Skip to content

Instantly share code, notes, and snippets.

@cloudwu
cloudwu / dh.c
Last active June 19, 2022 15:38
Diffie-Hellman Key Exchange
// The biggest 64bit prime
#define P 0xffffffffffffffc5ull
#define G 5
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
// calc a * b % p , avoid 64bit overflow
@lbj96347
lbj96347 / OpenANativeAppInWebApp.html
Created October 30, 2012 15:32
Open a native app in Web App
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for Web App Setup -->
<!-- Author : @CashLee李秉骏 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Web App icon -->
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
@yuest
yuest / fuckgfw.ico
Created August 12, 2012 04:36
在 Windows 7 上 建立 ssh -D 快捷方式 - blogist.yue.st
@gmuller
gmuller / SieveOfEratosthenes.java
Created June 15, 2012 00:45 — forked from gresrun/redisBitSetTests.java
Going back and forth between BitSet and redis bit sets in Java
import java.util.BitSet;
import redis.clients.jedis.Jedis;
public class SieveOfEratosthenes {
private static String sieveSetKeyCorrected = "correct_sieve";
private static String sieveSetKeyDefaultJava = "wrong_sieve";
private static String spoolSieve = "sieve_set_bits";
@rednaxelafx
rednaxelafx / clhsdb_session
Created November 25, 2011 14:52
A new "objtree" command for CLHSDB
$ pgrep java
3464
$ clhsdb
hsdb> attach 3464
Attaching to process 3464, please wait...
hsdb> jsload objtree.js
hsdb> objtree 0xc99f6378
Oop for java/util/HashSet @ 0x00000000c99f6378 (size of 16)
_mark: 5
map: Oop for java/util/HashMap @ 0x00000000c99f6388 (size of 48)