Skip to content

Instantly share code, notes, and snippets.

View adammika's full-sized avatar
🤠

Adam Mika adammika

🤠
View GitHub Profile
### Keybase proof
I hereby claim:
* I am adammika on github.
* I am adammika (https://keybase.io/adammika) on keybase.
* I have a public key whose fingerprint is 7750 DB6E BF51 59B1 5F03 F165 4311 8A3A 2FB2 5FB1
To claim this, I am signing this object:
for (int i = 0; i < (int)peers.size(); i++) {
char* peer;
bzero((char *) &peer, sizeof(peer));
peer = peers.at(i);
char* ip = strtok(peer," ");
char* port = strtok(NULL," ");
server_address.sin_port = htons(atoi(port));
if (inet_pton(AF_INET,ip,&server_address.sin_addr) != 0) {
ostringstream xval;
xval << posx;
// Check whether the regex is in the compareTo string
private boolean contains(String regex, String compareTo)
{
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(compareTo);
return m.matches();
}