Skip to content

Instantly share code, notes, and snippets.

马岗云浮
电信:
[AS4134] -> [AS2914] -> [AS32787] -> [AS27357/AS36459] 20 hops
--- github.com ping statistics ---
100 packets transmitted, 98 received, 2% packet loss, time 99030ms
rtt min/avg/max/mdev = 343.288/369.634/386.614/9.755 ms
联通:
[AS17816] -> [AS4837] -> [AS2914] -> [AS32787] -> [AS27357/AS36459] 22 hops
--- github.com ping statistics ---
package main
import (
"flag"
"fmt"
"sync"
"sync/atomic"
"time"
"runtime"
"net/http"
@unkstar
unkstar / safari JIT bug
Created July 26, 2013 16:57
safari bug demo: tested in Safari Version 6.0.5 (8536.30.1) bad(2,1) shall always return false. But in the buggy version of safari, it will return true from 75 to 95 times it's being called. on the other hand very very similar version good, behave just as it should. by warming up the bad function by about 100 times, it will almost behave correct…
<html>
<head>
<script type="text/javascript">
var append = function(text) {
document.body.appendChild(document.createTextNode(text));
document.body.appendChild(document.createElement("br"));
}
bad = function(lhs, rhs) {
var dist = (rhs - lhs) >>> 0;
return dist < 256;
@unkstar
unkstar / Base.h
Created April 26, 2012 12:06 — forked from anonymous/Base.h
#include <string>
#include <list>
#include <iostream>
class FunctorBase
{
public:
virtual std::string get() = 0;
};
#include "coroutine.h"
#include "deferred.h"
#include <QtGui>
#include "md5.h"
static int ptcc = 0;
struct PromiseTimerCtx
{
HANDLE timer;