This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
gem 'lifx' | |
require 'lifx' | |
start_time = Time.now.to_i | |
prev_objs = ObjectSpace.count_objects | |
lifx = LIFX::Client.lan | |
lifx.discover! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Patrick Pelletier, public domain / cc0 | |
* | |
* OpenSSL's default random number generator (RAND_SSLeay) is not | |
* fork-safe in the case where the child pids wrap around without the | |
* parent having used or reseeded the RNG in the interim. Which makes | |
* this a rare problem, but one which recently cropped up on Android: | |
* https://plus.google.com/+AndroidDevelopers/posts/YxWzeNQMJS2 | |
* and Nikolay Elenkov wrote a program to demonstrate the bug on Android: | |
* https://gist.github.com/nelenkov/581f9be65dcc0b6b35b9 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.AlgorithmParameterGenerator; | |
import java.security.InvalidParameterException; | |
public class Diffie { | |
public static void main (String[] args) throws Exception { | |
AlgorithmParameterGenerator apg = AlgorithmParameterGenerator . getInstance ("DiffieHellman"); | |
int good = 0; | |
for (int i = 512 ; i <= 16384 ; i += 64) { | |
try { | |
apg . init (i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WSAEINTR -> "A blocking operation was interrupted by a call to WSACancelBlockingCall." | |
WSAEACCES -> "An attempt was made to access a socket in a way forbidden by its access permissions." | |
WSAEFAULT -> "The system detected an invalid pointer address in attempting to use a pointer argument in a call." | |
WSAEINVAL -> "An invalid argument was supplied." | |
WSAEMFILE -> "Too many open sockets." | |
WSAEWOULDBLOCK -> "A non-blocking socket operation could not be completed immediately." | |
WSAEINPROGRESS -> "A blocking operation is currently executing." | |
WSAEALREADY -> "An operation was attempted on a non-blocking socket that already had an operation in progress." | |
WSAENOTSOCK -> "An operation was attempted on something that is not a socket." | |
WSAEDESTADDRREQ -> "A required address was omitted from an operation on a socket." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* list of hokey hash functions in rustc as of August 12, 2012 | |
* in response to https://github.com/mozilla/rust/issues/3041 */ | |
// libsyntax/ast_util.rs: | |
pure fn hash_ty(t: &@ty) -> uint { | |
let res = (t.span.lo << 16u) + t.span.hi; | |
return res; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NoekeonVects.java - Generate Noekeon test vectors using BouncyCastle. | |
Written in 2011 by Patrick Pelletier <code@funwithsoftware.org> | |
To the extent possible under law, the author(s) have dedicated all | |
copyright and related and neighboring rights to this software to | |
the public domain worldwide. This software is distributed without | |
any warranty. |
NewerOlder