I hereby claim:
- I am eliezio on github.
- I am elieziob (https://keybase.io/elieziob) on keybase.
- I have a public key ASDuNatsnfwoACg-S0pIvHX-KyDeQrABI_Fbppxca4Bu8Qo
To claim this, I am signing this object:
package com.riocard.exemplos; | |
import javax.smartcardio.*; | |
import java.util.List; | |
public class TestaRC700 { | |
private static final int WAIT_FOR_CARD_TIMEOUT = 30000; | |
private static final int CLA_MIFARE = 0xFF; | |
private static final int INS_GET_DATA = 0xCA; |
int readString(char *buffer, int max_len, int terminator) | |
{ | |
int pos = 0; | |
while (true) { | |
if (Serial.available() > 0) { | |
int readch = Serial.read(); | |
if (readch == terminator) { | |
buffer[pos] = '\0'; | |
break; |
--- /opt/Qt/5.4/gcc_64/mkspecs/common/g++-base.conf~ 2015-02-17 08:17:22.000000000 -0200 | |
+++ /opt/Qt/5.4/gcc_64/mkspecs/common/g++-base.conf 2015-05-25 15:15:06.293300241 -0300 | |
@@ -31,5 +31,5 @@ | |
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} | |
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE | |
-QMAKE_CXXFLAGS_CXX11 = -std=c++0x | |
+QMAKE_CXXFLAGS_CXX11 = -std=c++1y | |
QMAKE_LFLAGS_CXX11 = |
/** | |
* Artifício para evitar que o CLA do comando seja adulterado pela ChannelImpl.setChannel(). | |
* Thanks Bruno Jesus! | |
* <p/> | |
* Vide: http://www.java2s.com/Open-Source/Java/6.0-JDK-Modules-sun/security/sun/security/smartcardio/ChannelImpl.java.htm | |
* | |
* @param channel Canal | |
* @param cla CLA do comando | |
*/ |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
static void reverseBytes (char *bytes, int length) { | |
int left = 0; | |
int right = length - 1; | |
while (left < right) { | |
char t = bytes[left]; |
#!/bin/bash | |
if [ $BASH_VERSINFO -lt 4 ]; then | |
echo "*** ERROR: Requires Bash version 4 or newer" | |
exit 1 | |
fi | |
SCRIPTS_DIR=$(dirname $0) | |
RESOURCES_DIR=$(realpath $SCRIPTS_DIR/../resources) | |
RSA_PEM=$RESOURCES_DIR/rsa.pem |
function hex2bin() { | |
local data=$1 | |
echo -n $data | xxd -r -ps | |
} | |
function bin2hex() { | |
xxd -ps -c1024 | |
} | |
function to_ascii() { |
I hereby claim:
To claim this, I am signing this object:
import spock.lang.Specification | |
import spock.lang.Unroll | |
class UtilsSpec extends Specification { | |
@Unroll | |
def 'flat collection of integers: #list'() { | |
expect: | |
Utils.flatIntegers(list) == expectedResult |
import java.util.*; | |
public final class Utils { | |
public static List<Integer> flatIntegers(Collection col) { | |
if (col == null) { | |
throw new IllegalArgumentException("Collection cannot be null"); | |
} | |
List<Integer> result = new ArrayList<>(); | |
Deque<Iterator> queue = new ArrayDeque<>(); |