Skip to content

Instantly share code, notes, and snippets.

View lalithr95's full-sized avatar
🎯
Focusing

Lalith Rallabhandi lalithr95

🎯
Focusing
View GitHub Profile
@CarlEkerot
CarlEkerot / FileClient.java
Created May 14, 2012 10:43
Simple java file transfer
package client;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
public class FileClient {
private Socket s;
@pithyless
pithyless / integer.rb
Created March 24, 2014 10:50
Ruby Integer::MAX and Integer::MIN
class Integer
N_BYTES = [42].pack('i').size
N_BITS = N_BYTES * 16
MAX = 2 ** (N_BITS - 2) - 1
MIN = -MAX - 1
end
p Integer::MAX #=> 4611686018427387903
p Integer::MAX.class #=> Fixnum
p (Integer::MAX + 1).class #=> Bignum