Skip to content

Instantly share code, notes, and snippets.

View qtxie's full-sized avatar
🏠
Working from home

Qingtian qtxie

🏠
Working from home
  • FullStack Technologies
View GitHub Profile
1. C Benchmark
program: https://gist.github.com/qtxie/5835613
- No optimizition
compiling: cl random.c
run in windows powershell:
PS > Measure-Command {Start-Process .\random.exe -Wait}
@qtxie
qtxie / random.c
Created June 22, 2013 02:36
Mersenne Twister algorithm C implementation corresponding to the Red/System implementation. Use to do benchmark with the Red/System implement.
#include <stdio.h>
/* Mersenne Twister magic numbers */
#define _RAND_N 624
#define _RAND_M 397
#define _RAND_U 0x80000000L
#define _RAND_L 0x7fffffffL
/* Mersenne Twister state and seed storage */
static int rand_state[_RAND_N];
@qtxie
qtxie / random.reds
Last active December 18, 2015 19:09
Mersenne Twister algorithm Red/System implementation -- generates a random number using the Mersenne Twister algorithm. Reference http://code.google.com/p/c-standard-library/source/browse/src/internal/_rand.c
Red/System [
Title: "Mersenne Twister Random Function"
Author: "XieQ"
Tabs: 4
Purpose: {
Generates a random number using the Mersenne Twister algorithm.
Reference http://code.google.com/p/c-standard-library/source/browse/src/internal/_rand.c
}
]
@qtxie
qtxie / gist:3958501
Created October 26, 2012 12:30 — forked from observerss/gist:3798896
Google Keyword Tool Scraper(selenium+python version)
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
import selenium.webdriver.support.wait
selenium.webdriver.support.wait.POLL_FREQUENCY = 0.05
import re
import random
import collections
class AdwordsAutomater(object):