Skip to content

Instantly share code, notes, and snippets.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 14, 2025 02:46
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@eleventigers
eleventigers / GLTextureView.java
Created March 14, 2014 10:34
GLTextureView from GLSurfaceView
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGL11;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
('uf75-087.cnf', 375441, [31.487606048583984])
('uf75-025.cnf', 280262, [16.950977087020874])
('uf75-033.cnf', 176098, [31.1582989692688])
('uf75-093.cnf', 41503, [8.910184144973755])
('uf75-073.cnf', 37146, [8.198410987854004])
('uf75-068.cnf', 35202, [6.82702898979187])
('uf75-010.cnf', 30868, [6.246903896331787])
('uf75-077.cnf', 18135, [10.877649068832397])
('uf75-018.cnf', 15117, [3.866144895553589])
('uf75-089.cnf', 11038, [8.57466983795166])
@jdennaho
jdennaho / SSHDServer.java
Last active April 18, 2021 14:23
How to use a PublickeyAuthenticator with Apache MINA SSHD
private static final String knownKey = "{SSH2.PUBLIC.KEY}";
public void start() {
SshServer sshd = SshServer.setUpDefaultServer();
sshd.setPort(22999);
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("hostkey.ser"));
sshd.setPublickeyAuthenticator(new PublickeyAuthenticator() {
public boolean authenticate(String username, PublicKey key, ServerSession session) {
if(key instanceof RSAPublicKey) {
In the past few years, there has been increased interest in automating
the reverse engineering and verification of binary executable code. The
importance of this subject has been highlight by the growing relevance
of security, reliability and legacy code. Since dynamic analysis is of
limited use for whole-program analyses, there has been a renewed
enthusiasm for the development of automated static analyses, which can
prove a property holds over all paths of the program. The abstract
interpretation framework exists for exactly this purpose, and has been
widely adopted in both academic and industrial circles. Yet, since its
introduction in 1977, standard abstract interpretation is still
@breun
breun / five_longest_classes_in_java_codebase.sh
Created March 19, 2010 21:16
Find the five longest class names in a Java codebase.
find . -name '*.java' -exec basename {} .java \; | awk '{ print length " " $0 }' | sort -n -r | head -n 5