Skip to content

Instantly share code, notes, and snippets.

View zhuomingliang's full-sized avatar

Jimmy Zhuo zhuomingliang

  • Gan Zhou, China
View GitHub Profile
@zhuomingliang
zhuomingliang / cucumber.yml
Created June 26, 2012 07:51 — forked from gugod/cucumber.yml
Cucumber + Watir Example
default: --language zh-TW --format progress .
@zhuomingliang
zhuomingliang / gist:2981008
Created June 24, 2012 02:02 — forked from zythum/gist:2856612
检测google敏感词
var b=_.L.NF().getKey(), c= _.L.NF().eH(), f=[];
for(var g=0,l=c.length,t=[],i; i=c[g],g<l; f.push(t.join('')),g++)
for(t=[],p=0;p<i.length;++p)
t.push(window.String.fromCharCode(i[p]^b));
console.log(f.join('\n')+'\n总数:'+f.length+'个');
@zhuomingliang
zhuomingliang / gist:2850730
Created June 1, 2012 09:30 — forked from zythum/gist:2848881
google收录的敏感词
@zhuomingliang
zhuomingliang / starry.pl
Created May 21, 2012 14:23 — forked from moritz/starry.pl
Starry obfu v1.1
+"(*+*)*(*+* +*/*) **** ** * * *+*+*/* **** ** * *
*+*-*/* **** ** * * *+* ****-* **** ** * * *-(*-*/
*) ** (*+*/*) **** ** * * *-* **** ** * * *-*+*/*
**** ** * * *+* **** ** * * *-* * * ***((* - */*)
** * * *-*/*) * * **** ** * * *+*/* ****-* ***(*-*
/*)**(*+*/*) * * ***((*-*/*)** * * *-*/*) * * ****
** * * *+*/* **** ** * * *+*+*/*-* * *".split(<***>
).map: {.(|(<* * *>xx.count)).chr.print given eval
"(* ** *+*+*-*/*+$_)" }
@zhuomingliang
zhuomingliang / gist:2706999
Created May 16, 2012 03:07 — forked from nbrown/gist:2706968
M0 Debugger idea

Debugger:

Use the same m0 run loop and ops as m0 proper

The debugger main function, should be called from m0 proper should have the same signature as m0 ops

Store all state data in a debugger state struct

The struct has the following fields:

  • Run state => an enumerated value which is initialized to STEP. The valid values for the enumeration are:
  • STEP => which means the debugger will execute a single iteration of the
@zhuomingliang
zhuomingliang / questions.txt
Created May 7, 2012 11:18 — forked from cotto/questions.txt
m0 memory questions
per-callframe constants segment layout:
constants segment starts with a list of fixed-width pointers. I/N entries are stored directly. S/P entries are pointers to later in the constants segment
The data segment has a couple options. It can be appended after the constants segment (either on the next page or immediately after), with the constants data being marked read-only. Alternately, it can just be another segment attached to a special register.
If callframes are analogous to subs, the constants and data segment can be analogous to lexical data.
If callframes are analogous to subs, how will recursion work?
* clone a callframe (when? before entering ( -> no state) or after entering (less waste, leftover state))
* need to work out calling conventions
use v6;
role Signal {
has @.slots; # a nice list of callbacks (that are methods)
multi method connect(Any:D $sender, Any:D $rcpt, Method $method){
@.slots.push([$sender, self, $rcpt, $method]);
}
multi method connect(Any:D $rcpt, Method $method){
@zhuomingliang
zhuomingliang / gist:2500410
Created April 26, 2012 15:34 — forked from Benabik/gist:2500370
GSoC Proposal: 6model Integration

6model Integration

Short Description

6model is the object model created for Rakudo Perl 6 and the newest iteration of the NQP lanugage. It appears to be more flexible than the PMC object model. This project is an attempt to integrate 6model into the core of Parrot.

Project Description

sub logic { first {! try .()}, @_ }
for 1,2,3 X 1,2,3 -> $x, $y {
logic { $x > 2 },
{ $x + $y == 5 },
{ $y < 3 },
{ say "$x + $y == 5"; Nil }
}
@zhuomingliang
zhuomingliang / parrot.h
Created February 6, 2012 16:12 — forked from gerdr/parrot.h
Parrot object model refactor proposal
#ifndef PARROT_H_
#define PARROT_H_
#include <stddef.h>
// short names so we don't have to type Parrot_ everywhere
#define PInt Parrot_Int
#define PNum Parrot_Num
// ...