Skip to content

Instantly share code, notes, and snippets.

View vls's full-sized avatar

Liang Zhaohao vls

View GitHub Profile
@vls
vls / slow.html
Created August 14, 2014 02:55
Javascript in Qt 5.3 Webkit QWebView too slow, and hang the MainWindows on Windows
<DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function do_load() {
var script = document.createElement('script');
script.src = "slow.js";
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
@vls
vls / build.sh
Created April 21, 2014 05:19
polarssl build script for iOS SDK 7.1 & polarssl 1.3.5
#!/bin/bash
# Automatic build script for polarssl
# for iPhoneOS and iPhoneSimulator
#
# Created by Felix Schulze on 08.04.11.
# Copyright 2010 Felix Schulze. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@vls
vls / Our.cs
Created December 10, 2013 05:42 — forked from robert-nix/Our.cs
using System;
using System.IO;
using System.Threading;
using UnityEngine;
public class OurMono : MonoBehaviour
{
StreamWriter log;
Timer t;
@vls
vls / test_cffi_re2.py
Created November 19, 2013 03:14
comparison between cffi_re2 and builtin re module
#!/usr/bin/env python
import sys
import time
def test_re():
print 'test python re'
import re
@vls
vls / gist:1873993
Created February 21, 2012 05:37
pyre2 modification
cdef inline _re2.StringPiece* _alloc_sp(self, char* cstring, Py_ssize_t& size):
cdef _re2.StringPiece * sp
sp = new _re2.StringPiece(cstring, size)
return sp
cdef inline void _dealloc_sp(self, _re2.StringPiece* sp):
del sp
cdef inline _my_match(self, _re2.StringPiece sp_zero, int pos, int size, _re2.re2_Anchor anchoring, _re2.StringPiece* submatch, int nsubmatch):
return self.re_pattern.Match(sp_zero, <int>pos, <int>size, anchoring, submatch, nsubmatch)
@vls
vls / c_re2_plain.c
Created February 21, 2012 03:26
test program for re2
#include <re2/re2.h>
#include <iostream>
#include <string>
#include <cassert>
#include <stdio.h>
#include <vector>
#include <cstdlib>
#include <time.h>
#include <unistd.h>
@vls
vls / export_plain.py
Created February 21, 2012 03:23
test script for re2 and re2
#!/usr/bin/env python
#encoding=utf-8
import time
import os, sys
import re
import pickle
import re2
re2.set_fallback_notification(re2.FALLBACK_WARNING)
@vls
vls / make_data.py
Created December 20, 2011 08:11
make test dataset
#!/usr/bin/env python
import os
begin = 1
end = 3000000
inc = 3000000
for j in xrange(3):
with open('%s.txt' % (j + 1), 'w') as wf:
for i in xrange(begin, end + 1):
@vls
vls / gist:1271927
Created October 8, 2011 06:06
checkout from git. The destination directory will NOT be under source control
git archive --format=tar HEAD | (cd ~/beta/web && tar xf -)
git archive --format=tar HEAD | ssh app08.gz "(cd ~/beta/qn_fd_system && tar xf -)"
@vls
vls / gist:1236794
Created September 23, 2011 05:20
get the comment of the last commit in svn
#get the comment of the last commit in svn
svn log -q -v --xml --with-all-revprops -r head | grep "^<msg" | sed -e "s/<msg>\(.*\)/\1/g"