assorted-commits Mailing List for Assorted projects (Page 50)
Brought to you by:
yangzhang
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(86) |
Feb
(265) |
Mar
(96) |
Apr
(47) |
May
(136) |
Jun
(28) |
Jul
(57) |
Aug
(42) |
Sep
(20) |
Oct
(67) |
Nov
(37) |
Dec
(34) |
2009 |
Jan
(39) |
Feb
(85) |
Mar
(96) |
Apr
(24) |
May
(82) |
Jun
(13) |
Jul
(10) |
Aug
(8) |
Sep
(2) |
Oct
(20) |
Nov
(31) |
Dec
(17) |
2010 |
Jan
(16) |
Feb
(11) |
Mar
(17) |
Apr
(53) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(6) |
Sep
(11) |
Oct
(4) |
Nov
(17) |
Dec
(17) |
2011 |
Jan
(3) |
Feb
(19) |
Mar
(5) |
Apr
(17) |
May
(3) |
Jun
(4) |
Jul
(14) |
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(10) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yan...@us...> - 2008-04-23 20:41:17
|
Revision: 677 http://assorted.svn.sourceforge.net/assorted/?rev=677&view=rev Author: yangzhang Date: 2008-04-23 13:41:17 -0700 (Wed, 23 Apr 2008) Log Message: ----------- commas in macros Modified Paths: -------------- sandbox/trunk/src/c/macros.c Modified: sandbox/trunk/src/c/macros.c =================================================================== --- sandbox/trunk/src/c/macros.c 2008-04-23 20:40:48 UTC (rev 676) +++ sandbox/trunk/src/c/macros.c 2008-04-23 20:41:17 UTC (rev 677) @@ -5,6 +5,7 @@ #define greet(x) printf("hello, " #x "!\n") #define rename(x) x##_val_##x +#define decl(x) int x; // GCC extensions. @@ -20,6 +21,10 @@ x_val_x = 0; printf("%d\n", x_val_x); + // decl(alpha,beta,gamma); // This won't work. +#define comma , + decl(alpha comma beta comma gamma); // This works. + char a = 'A'; dup(a,b); b += 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-23 20:40:51
|
Revision: 676 http://assorted.svn.sourceforge.net/assorted/?rev=676&view=rev Author: yangzhang Date: 2008-04-23 13:40:48 -0700 (Wed, 23 Apr 2008) Log Message: ----------- small sample code for performing block-segmented operations Added Paths: ----------- sandbox/trunk/src/c/blocks.c Added: sandbox/trunk/src/c/blocks.c =================================================================== --- sandbox/trunk/src/c/blocks.c (rev 0) +++ sandbox/trunk/src/c/blocks.c 2008-04-23 20:40:48 UTC (rev 676) @@ -0,0 +1,36 @@ +#include <stdio.h> +#include <stdint.h> + +#define min(X,Y) ((X) < (Y) ? (X) : (Y)) + +enum { blk = 10 }; +enum { datlen = 2 * blk }; + +void +f(uint32_t off, uint32_t len) +{ + uint32_t end = off + len; + uint32_t fstblk = off / blk, lstblk = (end + blk - 1) / blk; + printf("f(off %4d, len %4d), fstblk %2d, lstblk %2d\n", off, len, fstblk, lstblk); + char *p = 0; + for (uint32_t i = fstblk; i < lstblk; i++) { + uint32_t blkoff = i == fstblk ? off % blk : 0; + uint32_t blklen = min(end - i * blk, blk) - blkoff; + printf(" i %2d | blkoff %4d | blklen %4d | p %04p\n", i, blkoff, blklen, p); + p += blklen; + } + printf("\n"); +} + +int +main() +{ + uint32_t starts[] = {0, 1, blk - 1, blk, blk + 1, 2 * blk}; + uint32_t ends[] = {0, 1, blk - 1, blk, blk + 1, 2 * blk}; + for (int i = 0; i < sizeof starts / sizeof(*starts); i++) { + for (int j = 0; j < sizeof ends / sizeof(*starts); j++) { + f(starts[i], ends[j]); + } + } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-22 01:24:06
|
Revision: 675 http://assorted.svn.sourceforge.net/assorted/?rev=675&view=rev Author: yangzhang Date: 2008-04-21 18:24:12 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added ruby paths Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2008-04-22 01:23:54 UTC (rev 674) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2008-04-22 01:24:12 UTC (rev 675) @@ -108,9 +108,12 @@ export PAGER=less # TODO export PAGER=special less-like vim -prepend_std PATH bin sbin /sbin /usr/sbin +# TODO fix this to not use an explicit ruby version +prepend_std PATH bin sbin /sbin /usr/sbin /var/lib/gems/1.8/bin prepend_std MANPATH man '' prepend_std INFOPATH info +# TODO fix this to not use an explicit ruby version +prepend_std RUBYLIB /var/lib/gems/1.8/lib # i think: # - LD_LIBRARY_PATH is for dynamic shared libs # - LIBRARY_PATH is for gcc (static linking) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-22 01:23:47
|
Revision: 674 http://assorted.svn.sourceforge.net/assorted/?rev=674&view=rev Author: yangzhang Date: 2008-04-21 18:23:54 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added url-codec Added Paths: ----------- shell-tools/trunk/src/url-codec.py Added: shell-tools/trunk/src/url-codec.py =================================================================== --- shell-tools/trunk/src/url-codec.py (rev 0) +++ shell-tools/trunk/src/url-codec.py 2008-04-22 01:23:54 UTC (rev 674) @@ -0,0 +1,7 @@ +#!/usr/bin/env python +from urllib import * +from sys import * +if len( argv ) < 2: print >> stderr, 'usage: url-codec (encode|decode)' +elif argv[1] == 'decode': print unquote(stdin.read()) +elif argv[1] == 'encode': print quote(stdin.read()) +else: print >> stderr, 'usage: url-codec (encode|decode)' Property changes on: shell-tools/trunk/src/url-codec.py ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-22 01:13:18
|
Revision: 673 http://assorted.svn.sourceforge.net/assorted/?rev=673&view=rev Author: yangzhang Date: 2008-04-21 18:13:22 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added the javascript beautifier Added Paths: ----------- js-beautifier/ js-beautifier/trunk/ js-beautifier/trunk/README js-beautifier/trunk/publish.bash js-beautifier/trunk/setup.bash js-beautifier/trunk/src/ js-beautifier/trunk/src/Makefile js-beautifier/trunk/src/beautify.js js-beautifier/trunk/src/jsbeautify js-beautifier/trunk/src/jsbeautify.js Added: js-beautifier/trunk/README =================================================================== --- js-beautifier/trunk/README (rev 0) +++ js-beautifier/trunk/README 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,11 @@ +% Javascript Beautifier +% Yang Zhang + +Overview +-------- + +This is a wrapper for the [elfz Javascript beautifier]. I found this to be the best Javascript beautifier available, but I needed to be able to run it in batch and from shell scripts. Since I needed also to parse Facebook's monstrous common.js file, I decided to also look into [Tamarin], Adobe's JIT gift to Mozilla. It provides the minimal file IO facilities needed to run this beautifier tool standalone. + +[elfz Javascript beautifier]: http://elfz.laacz.lv/beautify/ +[Tamarin]: http://www.mozilla.org/projects/tamarin/ + Added: js-beautifier/trunk/publish.bash =================================================================== --- js-beautifier/trunk/publish.bash (rev 0) +++ js-beautifier/trunk/publish.bash 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +fullname='Javascript Beautifier' +version=0.1 +license=gpl3 +websrcs=( README ) +webfiles=() +rels=( src-tgz: ) +nodl=true +. assorted.bash "$@" Property changes on: js-beautifier/trunk/publish.bash ___________________________________________________________________ Name: svn:executable + * Added: js-beautifier/trunk/setup.bash =================================================================== --- js-beautifier/trunk/setup.bash (rev 0) +++ js-beautifier/trunk/setup.bash 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +pkg=js-beautifier +. simple-setup.bash || exit 1 + +# TODO! Property changes on: js-beautifier/trunk/setup.bash ___________________________________________________________________ Name: svn:executable + * Added: js-beautifier/trunk/src/Makefile =================================================================== --- js-beautifier/trunk/src/Makefile (rev 0) +++ js-beautifier/trunk/src/Makefile 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,7 @@ +jsbeautify.abc: jsbeautify.js beautify.js + asc jsbeautify.js + +clean: + rm -f jsbeautify.abc + +.PHONY: clean Added: js-beautifier/trunk/src/beautify.js =================================================================== --- js-beautifier/trunk/src/beautify.js (rev 0) +++ js-beautifier/trunk/src/beautify.js 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,533 @@ +/* + + JS Beautifier +--------------- + $Date: 2008-04-21 16:13:36 +0300 (Mon, 21 Apr 2008) $ + $Revision: 53 $ + + + Written by Einars "elfz" Lielmanis, <el...@la...> + http://elfz.laacz.lv/beautify/ + + Originally converted to javascript by Vital, <vi...@gm...> + http://my.opera.com/Vital/blog/2007/11/21/javascript-beautify-on-javascript-translated + + + You are free to use this in any way you want, in case you find this useful or working for you. + + Usage: + js_beautify(js_source_text); + +*/ + + +function js_beautify(js_source_text, indent_size, indent_character) +{ + + var input, output, token_text, last_type, last_text, last_word, current_mode, modes, indent_level, indent_string; + var whitespace, wordchar, punct, parser_pos, line_starters, in_case; + var prefix, token_type; + + function print_newline(ignore_repeated) + { + ignore_repeated = typeof ignore_repeated === 'undefined' ? true: ignore_repeated; + + // remove trailing whitespace and indent + while (output.length && (output[output.length - 1] === ' ' || output[output.length - 1] === indent_string)) { + output.pop(); + } + + if (!output.length) { + return; // no newline on start of file + } + + if (output[output.length - 1] !== "\n" || !ignore_repeated) { + output.push("\n"); + } + for (var i = 0; i < indent_level; i++) { + output.push(indent_string); + } + } + + + + function print_space() + { + var last_output = output.length ? output[output.length - 1] : ' '; + if (last_output !== ' ' && last_output !== '\n' && last_output !== indent_string) { // prevent occassional duplicate space + output.push(' '); + } + } + + + function print_token() + { + output.push(token_text); + } + + function indent() + { + indent_level++; + } + + + function unindent() + { + if (indent_level) { + indent_level--; + } + } + + + function remove_indent() + { + if (output.length && output[output.length - 1] === indent_string) { + output.pop(); + } + } + + + function set_mode(mode) + { + modes.push(current_mode); + current_mode = mode; + } + + + function restore_mode() + { + current_mode = modes.pop(); + } + + + function in_array(what, arr) + { + for (var i = 0; i < arr.length; i++) + { + if (arr[i] === what) { + return true; + } + } + return false; + } + + + + function get_next_token() + { + var n_newlines = 0; + var c = ''; + + do { + if (parser_pos >= input.length) { + return ['', 'TK_EOF']; + } + c = input.charAt(parser_pos); + + parser_pos += 1; + if (c === "\n") { + n_newlines += 1; + } + } + while (in_array(c, whitespace)); + + if (n_newlines > 1) { + for (var i = 0; i < 2; i++) { + print_newline(i === 0); + } + } + var wanted_newline = (n_newlines === 1); + + + if (in_array(c, wordchar)) { + if (parser_pos < input.length) { + while (in_array(input.charAt(parser_pos), wordchar)) { + c += input.charAt(parser_pos); + parser_pos += 1; + if (parser_pos === input.length) { + break; + } + } + } + + // small and surprisingly unugly hack for 1E-10 representation + if (parser_pos !== input.length && c.match(/^[0-9]+[Ee]$/) && input.charAt(parser_pos) === '-') { + parser_pos += 1; + + var t = get_next_token(parser_pos); + c += '-' + t[0]; + return [c, 'TK_WORD']; + } + + if (c === 'in') { // hack for 'in' operator + return [c, 'TK_OPERATOR']; + } + return [c, 'TK_WORD']; + } + + if (c === '(' || c === '[') { + return [c, 'TK_START_EXPR']; + } + + if (c === ')' || c === ']') { + return [c, 'TK_END_EXPR']; + } + + if (c === '{') { + return [c, 'TK_START_BLOCK']; + } + + if (c === '}') { + return [c, 'TK_END_BLOCK']; + } + + if (c === ';') { + return [c, 'TK_END_COMMAND']; + } + + if (c === '/') { + var comment = ''; + // peek for comment /* ... */ + if (input.charAt(parser_pos) === '*') { + parser_pos += 1; + if (parser_pos < input.length) { + while (! (input.charAt(parser_pos) === '*' && input.charAt(parser_pos + 1) && input.charAt(parser_pos + 1) === '/') && parser_pos < input.length) { + comment += input.charAt(parser_pos); + parser_pos += 1; + if (parser_pos >= input.length) { + break; + } + } + } + parser_pos += 2; + return ['/*' + comment + '*/', 'TK_BLOCK_COMMENT']; + } + // peek for comment // ... + if (input.charAt(parser_pos) === '/') { + comment = c; + while (input.charAt(parser_pos) !== "\x0d" && input.charAt(parser_pos) !== "\x0a") { + comment += input.charAt(parser_pos); + parser_pos += 1; + if (parser_pos >= input.length) { + break; + } + } + parser_pos += 1; + if (wanted_newline) { + print_newline(); + } + return [comment, 'TK_COMMENT']; + } + + } + + if (c === "'" || // string + c === '"' || // string + (c === '/' && + ((last_type === 'TK_WORD' && last_text === 'return') || (last_type === 'TK_START_EXPR' || last_type === 'TK_END_BLOCK' || last_type === 'TK_OPERATOR' || last_type === 'TK_EOF' || last_type === 'TK_END_COMMAND')))) { // regexp + var sep = c; + var esc = false; + c = ''; + + if (parser_pos < input.length) { + + while (esc || input.charAt(parser_pos) !== sep) { + c += input.charAt(parser_pos); + if (!esc) { + esc = input.charAt(parser_pos) === '\\'; + } else { + esc = false; + } + parser_pos += 1; + if (parser_pos >= input.length) { + break; + } + } + + } + + parser_pos += 1; + if (last_type === 'TK_END_COMMAND') { + print_newline(); + } + return [sep + c + sep, 'TK_STRING']; + } + + if (in_array(c, punct)) { + while (parser_pos < input.length && in_array(c + input.charAt(parser_pos), punct)) { + c += input.charAt(parser_pos); + parser_pos += 1; + if (parser_pos >= input.length) { + break; + } + } + return [c, 'TK_OPERATOR']; + } + + return [c, 'TK_UNKNOWN']; + } + + + //---------------------------------- + + indent_character = indent_character || ' '; + indent_size = indent_size || 4; + + indent_string = ''; + while (indent_size--) { + indent_string += indent_character; + } + + input = js_source_text; + + last_word = ''; // last 'TK_WORD' passed + last_type = 'TK_START_EXPR'; // last token type + last_text = ''; // last token text + output = []; + + whitespace = "\n\r\t ".split(''); + wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split(''); + punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |='.split(' '); + + // words which should always start on new line. + line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(','); + + // states showing if we are currently in expression (i.e. "if" case) - 'EXPRESSION', or in usual block (like, procedure), 'BLOCK'. + // some formatting depends on that. + current_mode = 'BLOCK'; + modes = [current_mode]; + + indent_level = 0; + parser_pos = 0; // parser position + in_case = false; // flag for parser that case/default has been processed, and next colon needs special attention + while (true) { + var t = get_next_token(parser_pos); + token_text = t[0]; + token_type = t[1]; + if (token_type === 'TK_EOF') { + break; + } + + switch (token_type) { + + case 'TK_START_EXPR': + + set_mode('EXPRESSION'); + if (last_type === 'TK_END_EXPR' || last_type === 'TK_START_EXPR') { + // do nothing on (( and )( and ][ and ]( .. + } else if (last_type !== 'TK_WORD' && last_type !== 'TK_OPERATOR') { + print_space(); + } else if (in_array(last_word, line_starters) && last_word !== 'function') { + print_space(); + } + print_token(); + break; + + case 'TK_END_EXPR': + + print_token(); + restore_mode(); + break; + + case 'TK_START_BLOCK': + + set_mode('BLOCK'); + if (last_type !== 'TK_OPERATOR' && last_type !== 'TK_START_EXPR') { + if (last_type === 'TK_START_BLOCK') { + print_newline(); + } else { + print_space(); + } + } + print_token(); + indent(); + break; + + case 'TK_END_BLOCK': + if (last_type === 'TK_START_BLOCK') { + // nothing + unindent(); + } else { + unindent(); + print_newline(); + } + print_token(); + restore_mode(); + break; + + case 'TK_WORD': + + if (token_text === 'case' || token_text === 'default') { + if (last_text === ':') { + // switch cases following one another + remove_indent(); + } else { + // case statement starts in the same line where switch + unindent(); + print_newline(); + indent(); + } + print_token(); + in_case = true; + break; + } + + prefix = 'NONE'; + if (last_type === 'TK_END_BLOCK') { + if (!in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) { + prefix = 'NEWLINE'; + } else { + prefix = 'SPACE'; + print_space(); + } + } else if (last_type === 'TK_END_COMMAND' && current_mode === 'BLOCK') { + prefix = 'NEWLINE'; + } else if (last_type === 'TK_END_COMMAND' && current_mode === 'EXPRESSION') { + prefix = 'SPACE'; + } else if (last_type === 'TK_WORD') { + prefix = 'SPACE'; + } else if (last_type === 'TK_START_BLOCK') { + prefix = 'NEWLINE'; + } else if (last_type === 'TK_END_EXPR') { + print_space(); + prefix = 'NEWLINE'; + } + + if (in_array(token_text, line_starters) || prefix === 'NEWLINE') { + + if (last_text === 'else') { + // no need to force newline on else break + print_space(); + } else if ((last_type === 'TK_START_EXPR' || last_text === '=') && token_text === 'function') { + // no need to force newline on 'function': (function + // DONOTHING + } else if (last_type === 'TK_WORD' && (last_text === 'return' || last_text === 'throw')) { + // no newline between 'return nnn' + print_space(); + } else if (last_type !== 'TK_END_EXPR') { + if ((last_type !== 'TK_START_EXPR' || token_text !== 'var') && last_text !== ':') { + // no need to force newline on 'var': for (var x = 0...) + if (token_text === 'if' && last_type === 'TK_WORD' && last_word === 'else') { + // no newline for } else if { + print_space(); + } else { + print_newline(); + } + } + } + } else if (prefix === 'SPACE') { + print_space(); + } + print_token(); + last_word = token_text; + break; + + case 'TK_END_COMMAND': + + print_token(); + break; + + case 'TK_STRING': + + if (last_type === 'TK_START_BLOCK' || last_type === 'TK_END_BLOCK') { + print_newline(); + } else if (last_type === 'TK_WORD') { + print_space(); + } + print_token(); + break; + + case 'TK_OPERATOR': + + var start_delim = true; + var end_delim = true; + + if (token_text === ':' && in_case) { + print_token(); // colon really asks for separate treatment + print_newline(); + break; + } + + in_case = false; + + if (token_text === ',') { + if (last_type === 'TK_END_BLOCK') { + print_token(); + print_newline(); + } else { + if (current_mode === 'BLOCK') { + print_token(); + print_newline(); + } else { + print_token(); + print_space(); + } + } + break; + } else if (token_text === '--' || token_text === '++') { // unary operators special case + if (last_text === ';') { + // space for (;; ++i) + start_delim = true; + end_delim = false; + } else { + start_delim = false; + end_delim = false; + } + } else if (token_text === '!' && last_type === 'TK_START_EXPR') { + // special case handling: if (!a) + start_delim = false; + end_delim = false; + } else if (last_type === 'TK_OPERATOR') { + start_delim = false; + end_delim = false; + } else if (last_type === 'TK_END_EXPR') { + start_delim = true; + end_delim = true; + } else if (token_text === '.') { + // decimal digits or object.property + start_delim = false; + end_delim = false; + + } else if (token_text === ':') { + // zz: xx + // can't differentiate ternary op, so for now it's a ? b: c; without space before colon + start_delim = false; + } + if (start_delim) { + print_space(); + } + + print_token(); + + if (end_delim) { + print_space(); + } + break; + + case 'TK_BLOCK_COMMENT': + + print_newline(); + print_token(); + print_newline(); + break; + + case 'TK_COMMENT': + + // print_newline(); + print_space(); + print_token(); + print_newline(); + break; + + case 'TK_UNKNOWN': + print_token(); + break; + } + + last_type = token_type; + last_text = token_text; + } + + return output.join(''); + +} Added: js-beautifier/trunk/src/jsbeautify =================================================================== --- js-beautifier/trunk/src/jsbeautify (rev 0) +++ js-beautifier/trunk/src/jsbeautify 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +exec avmplus jsbeautify.abc -- "$@" Property changes on: js-beautifier/trunk/src/jsbeautify ___________________________________________________________________ Name: svn:executable + * Added: js-beautifier/trunk/src/jsbeautify.js =================================================================== --- js-beautifier/trunk/src/jsbeautify.js (rev 0) +++ js-beautifier/trunk/src/jsbeautify.js 2008-04-22 01:13:22 UTC (rev 673) @@ -0,0 +1,9 @@ +import avmplus.*; +include 'beautify.js'; + +if (System.argv.length < 1) + throw new Error(0, "must specify file to beautify!"); + +var pre = File.read(System.argv[0]); +var post = js_beautify(pre, 2, ' '); +print(post); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 19:52:36
|
Revision: 672 http://assorted.svn.sourceforge.net/assorted/?rev=672&view=rev Author: yangzhang Date: 2008-04-21 12:52:35 -0700 (Mon, 21 Apr 2008) Log Message: ----------- conversions demo Modified Paths: -------------- sandbox/trunk/src/cc/conversions.cc Modified: sandbox/trunk/src/cc/conversions.cc =================================================================== --- sandbox/trunk/src/cc/conversions.cc 2008-04-21 19:52:14 UTC (rev 671) +++ sandbox/trunk/src/cc/conversions.cc 2008-04-21 19:52:35 UTC (rev 672) @@ -1,15 +1,38 @@ +// Demo of conversions. + #include <iostream> +#include <string> using namespace std; +void f(const string& str) { + cout << "f(const string& str = " << str.c_str() << ")" << endl; +} + +void f(bool b) { + cout << "f(bool b = " << b << ")" << endl; +} + int main() { - // This doesn't compile. + // This lexical conversion doesn't compile. // int i("321"); // This doesn't work as expected; always outputs 1. bool b("false"); cout << b << endl; + + // What happens is that C++ can't find an exact match for a "const char*" parameter. It looks at all the available constructors, and looks at which ones are possible. There are two: + // + // 1. bool via a pointer -> bool conversion + // 2. std::string via the std::string(const char*) constructor + // + // 1. is a "standard conversion sequence" + // 2. is a "user-defined conversion sequence," since it is a function. + // + // C++ decides the "best" function to call by ranking all the possible calls. Standard conversions rank better than user-defined conversions, so #1 is called. + f(string("hello")); + f("hello"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 19:52:22
|
Revision: 671 http://assorted.svn.sourceforge.net/assorted/?rev=671&view=rev Author: yangzhang Date: 2008-04-21 12:52:14 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added class decl test Modified Paths: -------------- sandbox/trunk/src/cc/classdecls.cc Modified: sandbox/trunk/src/cc/classdecls.cc =================================================================== --- sandbox/trunk/src/cc/classdecls.cc 2008-04-21 06:57:33 UTC (rev 670) +++ sandbox/trunk/src/cc/classdecls.cc 2008-04-21 19:52:14 UTC (rev 671) @@ -1,10 +1,15 @@ // Anonymous classes, inner classes, nested classes. +// Free variable capture, outer class access: you cannot refer to the outer +// class from an inner class (closures are coming in c++0x, though). Inner +// classes also cannot refer to the privates of the outer class. The inner and +// outer class have no special relationship. + // Anonymous class gets a warning. // class { int x; } c; class C { - // Inner class. C cannot see I::y. + // Inner class. C cannot see I::y, only I::x. class I { public: int x; private: int y; }; int f() { return I().x; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 06:57:35
|
Revision: 670 http://assorted.svn.sourceforge.net/assorted/?rev=670&view=rev Author: yangzhang Date: 2008-04-20 23:57:33 -0700 (Sun, 20 Apr 2008) Log Message: ----------- boost-thread test Added Paths: ----------- sandbox/trunk/src/cc/boost_thread.cc Added: sandbox/trunk/src/cc/boost_thread.cc =================================================================== --- sandbox/trunk/src/cc/boost_thread.cc (rev 0) +++ sandbox/trunk/src/cc/boost_thread.cc 2008-04-21 06:57:33 UTC (rev 670) @@ -0,0 +1,25 @@ +// Demonstrates how to access the handle to the underlying system thread via +// boost threads. It turns out that this wasn't available in 1.34; +// native_handle() was added in 1.35. + +#include <boost/bind.hpp> +#include <boost/thread.hpp> +#include <iostream> + +using namespace boost; +using namespace std; + +void +f() +{ + thread t; + cout << "hello from " << t.native_handle() << endl; +} + +int +main() +{ + thread t(bind(f)); + t.join(); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 06:56:51
|
Revision: 669 http://assorted.svn.sourceforge.net/assorted/?rev=669&view=rev Author: yangzhang Date: 2008-04-20 23:56:47 -0700 (Sun, 20 Apr 2008) Log Message: ----------- class decl test Added Paths: ----------- sandbox/trunk/src/cc/classdecls.cc Added: sandbox/trunk/src/cc/classdecls.cc =================================================================== --- sandbox/trunk/src/cc/classdecls.cc (rev 0) +++ sandbox/trunk/src/cc/classdecls.cc 2008-04-21 06:56:47 UTC (rev 669) @@ -0,0 +1,20 @@ +// Anonymous classes, inner classes, nested classes. + +// Anonymous class gets a warning. +// class { int x; } c; + +class C { + // Inner class. C cannot see I::y. + class I { public: int x; private: int y; }; + int f() { return I().x; } +}; + +int +main() +{ + // Nested class. + { class C { int x; } c; } + // Anonymous, nested class. + { class { int x; } c; } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 03:55:13
|
Revision: 668 http://assorted.svn.sourceforge.net/assorted/?rev=668&view=rev Author: yangzhang Date: 2008-04-20 20:55:13 -0700 (Sun, 20 Apr 2008) Log Message: ----------- added protected member test Added Paths: ----------- sandbox/trunk/src/cc/protected.cc Added: sandbox/trunk/src/cc/protected.cc =================================================================== --- sandbox/trunk/src/cc/protected.cc (rev 0) +++ sandbox/trunk/src/cc/protected.cc 2008-04-21 03:55:13 UTC (rev 668) @@ -0,0 +1,17 @@ +// Does `protected` work on a non-this object? No! + +class C { + protected: int x; +}; + +class D : public C { + public: int x(C c) { return c.x; /* No. */ } +}; + +int +main() +{ + C c; + D d; + return d.x(c); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-21 03:29:22
|
Revision: 667 http://assorted.svn.sourceforge.net/assorted/?rev=667&view=rev Author: yangzhang Date: 2008-04-20 20:29:22 -0700 (Sun, 20 Apr 2008) Log Message: ----------- added friend test Added Paths: ----------- sandbox/trunk/src/cc/friends.cc Added: sandbox/trunk/src/cc/friends.cc =================================================================== --- sandbox/trunk/src/cc/friends.cc (rev 0) +++ sandbox/trunk/src/cc/friends.cc 2008-04-21 03:29:22 UTC (rev 667) @@ -0,0 +1,17 @@ +// Demonstrates that you don't have to "know" a friend class. + +class C { + friend class F; + private: int x; +}; + +class F { + public: int x(C c) { return c.x; } +}; + +int +main() { + C c; + F f; + return f.x(c); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-20 14:57:45
|
Revision: 666 http://assorted.svn.sourceforge.net/assorted/?rev=666&view=rev Author: yangzhang Date: 2008-04-20 07:57:51 -0700 (Sun, 20 Apr 2008) Log Message: ----------- updated macro test Modified Paths: -------------- sandbox/trunk/src/c/macros.c Modified: sandbox/trunk/src/c/macros.c =================================================================== --- sandbox/trunk/src/c/macros.c 2008-04-20 03:59:13 UTC (rev 665) +++ sandbox/trunk/src/c/macros.c 2008-04-20 14:57:51 UTC (rev 666) @@ -1,10 +1,16 @@ -// Demonstrates features of the standard C preprocessor. +// Demonstrates features of the standard C preprocessor and the GCC +// preprocessor extensions. #include <stdio.h> #define greet(x) printf("hello, " #x "!\n") #define rename(x) x##_val_##x +// GCC extensions. + +// Not really a preprocessor extension. +#define dup(x,y) typeof(x) y = x; + int main() { @@ -14,5 +20,11 @@ x_val_x = 0; printf("%d\n", x_val_x); + char a = 'A'; + dup(a,b); + b += 1; + + printf("%c %c\n", a, b); + return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-20 03:59:11
|
Revision: 665 http://assorted.svn.sourceforge.net/assorted/?rev=665&view=rev Author: yangzhang Date: 2008-04-19 20:59:13 -0700 (Sat, 19 Apr 2008) Log Message: ----------- standard preprocessor feature Added Paths: ----------- sandbox/trunk/src/c/macros.c Added: sandbox/trunk/src/c/macros.c =================================================================== --- sandbox/trunk/src/c/macros.c (rev 0) +++ sandbox/trunk/src/c/macros.c 2008-04-20 03:59:13 UTC (rev 665) @@ -0,0 +1,18 @@ +// Demonstrates features of the standard C preprocessor. + +#include <stdio.h> + +#define greet(x) printf("hello, " #x "!\n") +#define rename(x) x##_val_##x + +int +main() +{ + greet(world); + + int rename(x); + x_val_x = 0; + printf("%d\n", x_val_x); + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-20 03:27:03
|
Revision: 664 http://assorted.svn.sourceforge.net/assorted/?rev=664&view=rev Author: yangzhang Date: 2008-04-19 20:27:10 -0700 (Sat, 19 Apr 2008) Log Message: ----------- added pwrite test Added Paths: ----------- sandbox/trunk/src/c/pwrite.c Added: sandbox/trunk/src/c/pwrite.c =================================================================== --- sandbox/trunk/src/c/pwrite.c (rev 0) +++ sandbox/trunk/src/c/pwrite.c 2008-04-20 03:27:10 UTC (rev 664) @@ -0,0 +1,30 @@ +// What does pwrite() do when offset is beyond EOF? +// It simply appends to the EOF. + +#include <fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdio.h> + +int +main() +{ + int fd = creat("/tmp/touchme", O_WRONLY); + if (fd < 0) { + perror("creat"); + return -1; + } + char buf[] = "hello, world!"; + // Notice the offset! + size_t count = sizeof buf, offset = 10; + if (pwrite(fd, buf, count, offset) < 0) { + perror("pwrite"); + return -1; + } + if (close(fd) != 0) { + perror("close"); + return -1; + } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-20 03:02:36
|
Revision: 663 http://assorted.svn.sourceforge.net/assorted/?rev=663&view=rev Author: yangzhang Date: 2008-04-19 20:02:37 -0700 (Sat, 19 Apr 2008) Log Message: ----------- added st segfault "bug" Added Paths: ----------- sandbox/trunk/src/c/stsegfaultbug.c Added: sandbox/trunk/src/c/stsegfaultbug.c =================================================================== --- sandbox/trunk/src/c/stsegfaultbug.c (rev 0) +++ sandbox/trunk/src/c/stsegfaultbug.c 2008-04-20 03:02:37 UTC (rev 663) @@ -0,0 +1,50 @@ +// Not really a bug...see the end! + +#include <arpa/inet.h> +#include <netdb.h> +#include <netinet/in.h> +#include <strings.h> +#include <sys/socket.h> +#include <unistd.h> + +#include <st.h> + +int +main() +{ + int sfd = socket(PF_INET, SOCK_STREAM, 0); + + // Create the socket address. + struct sockaddr_in sa; + bzero(&sa, sizeof(sa)); + sa.sin_family = AF_INET; + sa.sin_port = htons(17000); + sa.sin_addr.s_addr = htonl(INADDR_ANY); + + // Configure the socket. + int n = 1; + if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (char *)&n, sizeof(n)) != 0) { + perror("setsockopt"); + return 1; + } + + // Bind the socket to the local socket address. + if (bind(sfd, (struct sockaddr*) &sa, sizeof(struct sockaddr_in)) != 0) { + perror("bind"); + return 1; + } + + // Start listening. + if (listen(sfd, 256)) { + perror("listen"); + return 1; + } + + st_init(); + + // I thought there was a segfault bug here, but it was because I had + // forgotten to initially call st_init(). + st_netfd_t nfd = st_netfd_open_socket(sfd); + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-20 03:02:29
|
Revision: 662 http://assorted.svn.sourceforge.net/assorted/?rev=662&view=rev Author: yangzhang Date: 2008-04-19 20:02:30 -0700 (Sat, 19 Apr 2008) Log Message: ----------- added voit pointer arith demo Added Paths: ----------- sandbox/trunk/src/c/voidptrs.c Added: sandbox/trunk/src/c/voidptrs.c =================================================================== --- sandbox/trunk/src/c/voidptrs.c (rev 0) +++ sandbox/trunk/src/c/voidptrs.c 2008-04-20 03:02:30 UTC (rev 662) @@ -0,0 +1,15 @@ +// Demonstrates that void pointer arithmetic works (they operate in bytes). + +#include <stdio.h> +#include <strings.h> + +int +main() +{ + char c[256] = "hello world"; + void *p = c; + p += 5; + bzero(p, 10); + printf("%s\n", c); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-17 21:29:31
|
Revision: 661 http://assorted.svn.sourceforge.net/assorted/?rev=661&view=rev Author: yangzhang Date: 2008-04-17 14:28:03 -0700 (Thu, 17 Apr 2008) Log Message: ----------- scanf Added Paths: ----------- sandbox/trunk/src/c/scanf.c Added: sandbox/trunk/src/c/scanf.c =================================================================== --- sandbox/trunk/src/c/scanf.c (rev 0) +++ sandbox/trunk/src/c/scanf.c 2008-04-17 21:28:03 UTC (rev 661) @@ -0,0 +1,11 @@ +#include <stdio.h> +int main() { + char name[256]; + int choices, blanks; + char sorted, uniq; + char * input = "twos: 70 8 T F"; + // scanf does not backtrack + int res = sscanf(input, "%s: %d %d %c %c", name, &choices, &blanks, &sorted, &uniq); + printf("%d %s\n", res, name); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-17 21:27:50
|
Revision: 660 http://assorted.svn.sourceforge.net/assorted/?rev=660&view=rev Author: yangzhang Date: 2008-04-17 14:26:12 -0700 (Thu, 17 Apr 2008) Log Message: ----------- added pointers/arrays test Added Paths: ----------- sandbox/trunk/src/c/ptrsarrays.c Added: sandbox/trunk/src/c/ptrsarrays.c =================================================================== --- sandbox/trunk/src/c/ptrsarrays.c (rev 0) +++ sandbox/trunk/src/c/ptrsarrays.c 2008-04-17 21:26:12 UTC (rev 660) @@ -0,0 +1,25 @@ +// Pointers and arrays + +#include <stdio.h> + +int +main() +{ + { + // This is a pointer to some static data. We actually don't need to + // qualify this with const, for some reason. + char *hello = "hello\n"; + // Static data is read-only! + // hello[0] = 'H'; + printf(hello); + } + + { + // This is different. It stack-allocates and initializes an array (copies + // "hello" into it). + char hello[] = "hello\n"; + hello[0] = 'H'; + printf(hello); + } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-09 04:39:42
|
Revision: 659 http://assorted.svn.sourceforge.net/assorted/?rev=659&view=rev Author: yangzhang Date: 2008-04-08 21:39:47 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Added Paths: ----------- sandbox/trunk/src/c/stxbuilderr.c Added: sandbox/trunk/src/c/stxbuilderr.c =================================================================== --- sandbox/trunk/src/c/stxbuilderr.c (rev 0) +++ sandbox/trunk/src/c/stxbuilderr.c 2008-04-09 04:39:47 UTC (rev 659) @@ -0,0 +1,13 @@ +// This was originally written to report a build error with stx. Turns out I +// just had to specify -lresolv in addition to -lstx -lst. + +#include <st.h> +#include <stx.h> + +int +main() +{ + struct in_addr addr; + stx_dns_getaddr("google.com", &addr, 0); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-09 03:54:31
|
Revision: 658 http://assorted.svn.sourceforge.net/assorted/?rev=658&view=rev Author: yangzhang Date: 2008-04-08 20:54:31 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Added Paths: ----------- sandbox/trunk/src/c/socketclose.c Added: sandbox/trunk/src/c/socketclose.c =================================================================== --- sandbox/trunk/src/c/socketclose.c (rev 0) +++ sandbox/trunk/src/c/socketclose.c 2008-04-09 03:54:31 UTC (rev 658) @@ -0,0 +1,25 @@ +// Closing a closed socket is an error. + +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <unistd.h> + +int +main() +{ + int s = socket(PF_INET, SOCK_STREAM, 0); + if (s == 0) { + perror("socket() failed"); + return 1; + } + if (close(s) != 0) { + perror("first close() failed"); + return 1; + } + if (close(s) != -1) { + perror("second close() succeeded (failure expected)"); + return 1; + } + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-09 03:47:34
|
Revision: 657 http://assorted.svn.sourceforge.net/assorted/?rev=657&view=rev Author: yangzhang Date: 2008-04-08 20:47:34 -0700 (Tue, 08 Apr 2008) Log Message: ----------- Modified Paths: -------------- sandbox/trunk/src/c/server.c Added Paths: ----------- sandbox/trunk/src/c/vaargs.c sandbox/trunk/src/cc/boost_test.cc Modified: sandbox/trunk/src/c/server.c =================================================================== --- sandbox/trunk/src/c/server.c 2008-04-07 05:31:11 UTC (rev 656) +++ sandbox/trunk/src/c/server.c 2008-04-09 03:47:34 UTC (rev 657) @@ -11,7 +11,7 @@ int main() { - int s = socket(AF_INET, SOCK_STREAM, 0); + int s = socket(PF_INET, SOCK_STREAM, 0); if (s == 0) { perror("socket() failed"); return 1; Added: sandbox/trunk/src/c/vaargs.c =================================================================== --- sandbox/trunk/src/c/vaargs.c (rev 0) +++ sandbox/trunk/src/c/vaargs.c 2008-04-09 03:47:34 UTC (rev 657) @@ -0,0 +1,57 @@ +#include <stdarg.h> +#include <stdio.h> + +// Note that ISO C requires a named argument before ‘...’, so you cannot +// define: +// +// f(...) + +// First, a simple complete example. +void +f(int base, ...) +{ + va_list ap; + va_start(ap, base); + int sum = base; + for (;;) { + int i = va_arg(ap, int); + if (i == 0) break; + sum += i; + } + va_end(ap); + printf("%d\n", sum); +} + +void +g(int base, va_list ap) +{ + //va_start(ap, base); + int sum = base; + for (;;) { + int i = va_arg(ap, int); + if (i == 0) break; + sum += i; + } + printf("%d\n", sum); +} + +// This is how you pass a suffix of the va_list to a another function. Here we +// have h passing everything but garbage on to g. This requires h to extract +// out the first argument and pass that as a normal arg. +void +h(int garbage, ...) +{ + va_list ap; + va_start(ap, garbage); + int base = va_arg(ap, int); + va_end(ap); + g(base, ap); +} + +int +main() +{ + f(1, 2, 3, 0); + h(-3, 1, 2, 3, 0); + return 0; +} Added: sandbox/trunk/src/cc/boost_test.cc =================================================================== --- sandbox/trunk/src/cc/boost_test.cc (rev 0) +++ sandbox/trunk/src/cc/boost_test.cc 2008-04-09 03:47:34 UTC (rev 657) @@ -0,0 +1,13 @@ +// Demonstrates how to use the (poorly documented) boost test framework. + +#define BOOST_TEST_MAIN +//#define BOOST_TEST_MODULE MyTest +#include <boost/test/unit_test.hpp> +#include <boost/test/included/unit_test_framework.hpp> +using namespace std; + +BOOST_AUTO_TEST_CASE( my_test ) +{ + BOOST_CHECK( 1 == 1 ); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-07 05:31:12
|
Revision: 656 http://assorted.svn.sourceforge.net/assorted/?rev=656&view=rev Author: yangzhang Date: 2008-04-06 22:31:11 -0700 (Sun, 06 Apr 2008) Log Message: ----------- added more notes Modified Paths: -------------- pidgin-facebook/trunk/doc/TODO Modified: pidgin-facebook/trunk/doc/TODO =================================================================== --- pidgin-facebook/trunk/doc/TODO 2008-04-07 05:22:45 UTC (rev 655) +++ pidgin-facebook/trunk/doc/TODO 2008-04-07 05:31:11 UTC (rev 656) @@ -6,9 +6,17 @@ - logins - next steps in getting this thing up and running - echo the challenge - - transliterate the charset_test: "€´.<B4>..." -> "%E2%82%AC%C2%B4.%EF%BF%BD..." + - transliterate the charset_test: "€´.<B4>..." -> + "%E2%82%AC%C2%B4.%EF%BF%BD..." - verify that simply sending this (and answering the basic tests) works - chat - see what the xml http requests look like from netcat - general practice - get proper codecs + +RESOURCES +- <http://shanti.railsblog.com/how-to-automate-facebook-interaction-using-ruby-and-www-mechanize> +- <http://shanti.railsblog.com/introducing-fsx-trader-automated-fantasy-stock-trading-in-ruby> +- <http://fsxtrader.rubyforge.org/> + - trader.rb:135 +- <http://mechanize.rubyforge.org/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-07 05:22:44
|
Revision: 655 http://assorted.svn.sourceforge.net/assorted/?rev=655&view=rev Author: yangzhang Date: 2008-04-06 22:22:45 -0700 (Sun, 06 Apr 2008) Log Message: ----------- started pidgin-facebook - may abort this project if too much work Added Paths: ----------- pidgin-facebook/ pidgin-facebook/trunk/ pidgin-facebook/trunk/doc/ pidgin-facebook/trunk/doc/TODO pidgin-facebook/trunk/doc/login-request pidgin-facebook/trunk/src/ Added: pidgin-facebook/trunk/doc/TODO =================================================================== --- pidgin-facebook/trunk/doc/TODO (rev 0) +++ pidgin-facebook/trunk/doc/TODO 2008-04-07 05:22:45 UTC (rev 655) @@ -0,0 +1,14 @@ +SO FAR +- got some basic xml http dialog logged using the userscript +- observed what a login http request looks like + +UP NEXT +- logins + - next steps in getting this thing up and running + - echo the challenge + - transliterate the charset_test: "€´.<B4>..." -> "%E2%82%AC%C2%B4.%EF%BF%BD..." + - verify that simply sending this (and answering the basic tests) works +- chat + - see what the xml http requests look like from netcat + - general practice + - get proper codecs Added: pidgin-facebook/trunk/doc/login-request =================================================================== --- pidgin-facebook/trunk/doc/login-request (rev 0) +++ pidgin-facebook/trunk/doc/login-request 2008-04-07 05:22:45 UTC (rev 655) @@ -0,0 +1,15 @@ +POST /login.php HTTP/1.1 +User-Agent: Opera/9.25 (Windows NT 5.1; U; en) +Host: harvard.csail.mit.edu:8888 +Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 +Accept-Language: en-US,en;q=0.9 +Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1 +Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0 +Referer: http://harvard.csail.mit.edu/~yang/fb/ +Cookie: __utmz=44088765.1199266763.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utma=44088765.827087717.1199266763.1199329212.1199332407.6; __utmz=211403527.1199908271.3.2.utmccn=(referral)|utmcsr=mit.edu|utmcct=/~y_z/|utmcmd=referral; __utma=211403527.1306312000.1193342312.1199908271.1204221087.4; __qca=459769cb-b3d19-fa87b-759e0; __utmz=242276382.1206935837.14.7.utmcsr=sirrice.webfactional.com|utmccn=(referral)|utmcmd=referral|utmcct=%2F; __utma=242276382.1092638357.1172556735.1206823564.1206935837.14 +Cookie2: $Version=1 +Connection: Keep-Alive +Content-Length: 127 +Content-Type: application/x-www-form-urlencoded + +challenge=c5f0a597e4ce4f648e2d49915250e919&md5pass=1&noerror=1&email=aoeu&pass=%3Bqjk&charset_test=%E2%82%AC%C2%B4.%EF%BF%BD... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-06 02:25:58
|
Revision: 654 http://assorted.svn.sourceforge.net/assorted/?rev=654&view=rev Author: yangzhang Date: 2008-04-05 19:25:54 -0700 (Sat, 05 Apr 2008) Log Message: ----------- added literals tests Added Paths: ----------- sandbox/trunk/src/c/literals.c sandbox/trunk/src/cc/literals.cc Added: sandbox/trunk/src/c/literals.c =================================================================== --- sandbox/trunk/src/c/literals.c (rev 0) +++ sandbox/trunk/src/c/literals.c 2008-04-06 02:25:54 UTC (rev 654) @@ -0,0 +1,12 @@ +// Integer literals test. + +#include <stdio.h> + +int +main() +{ + // This works fine (gets -10). + long long x = 0xFFFFFFFFFFFFFFF6; + printf("%lld\n", x); + return 0; +} Added: sandbox/trunk/src/cc/literals.cc =================================================================== --- sandbox/trunk/src/cc/literals.cc (rev 0) +++ sandbox/trunk/src/cc/literals.cc 2008-04-06 02:25:54 UTC (rev 654) @@ -0,0 +1,15 @@ +// Integer literals test. Same as ../c/literals.c. A post claimed that this +// wouldn't work in C++: +// +// http://bytes.com/forum/thread137121.html + +#include <stdio.h> + +int +main() +{ + // This also works fine (gets -10). + long long x = 0xFFFFFFFFFFFFFFF6; + printf("%lld\n", x); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-04-02 05:45:17
|
Revision: 653 http://assorted.svn.sourceforge.net/assorted/?rev=653&view=rev Author: yangzhang Date: 2008-04-01 22:45:22 -0700 (Tue, 01 Apr 2008) Log Message: ----------- added some instrs Modified Paths: -------------- configs/trunk/src/topcoder/setup.py Modified: configs/trunk/src/topcoder/setup.py =================================================================== --- configs/trunk/src/topcoder/setup.py 2008-04-02 05:41:52 UTC (rev 652) +++ configs/trunk/src/topcoder/setup.py 2008-04-02 05:45:22 UTC (rev 653) @@ -3,6 +3,11 @@ """ Set up topcoder configuration. + +./setup.py USERDIR [PLUGINDIR] + + USERDIR: where you'll work form (where FileEdit writes/reads) + PLUGINDIR: where the plugin jars should be stored """ from __future__ import with_statement This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |