assorted-commits Mailing List for Assorted projects (Page 51)
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-02 05:41:46
|
Revision: 652 http://assorted.svn.sourceforge.net/assorted/?rev=652&view=rev Author: yangzhang Date: 2008-04-01 22:41:52 -0700 (Tue, 01 Apr 2008) Log Message: ----------- fixed string escaping; added support for setting up the user project dir Modified Paths: -------------- configs/trunk/src/topcoder/contestapplet.conf.template configs/trunk/src/topcoder/setup.py Modified: configs/trunk/src/topcoder/contestapplet.conf.template =================================================================== --- configs/trunk/src/topcoder/contestapplet.conf.template 2008-04-02 05:21:28 UTC (rev 651) +++ configs/trunk/src/topcoder/contestapplet.conf.template 2008-04-02 05:41:52 UTC (rev 652) @@ -165,7 +165,7 @@ com.topcoder.jmaContestApplet.frames.codingframe.size=1024\:746 com.topcoder.jmaContestApplet.frames.codingframe.dividerloc=319 com.topcoder.jmaContesntApplet.ContestApplet.enableTimestamps=true -fileeditor.config.dirName=C\:\\Documents and Settings\\Yang\\My Documents\\Visual Studio 2008\\Projects\\TopCoderCS\\TopCoderCS +fileeditor.config.dirName=`USERDIR` fileeditor.config.fileName=Program fileeditor.config.beginCut=// BEGIN CUT HERE fileeditor.config.endCut=// END CUT HERE Modified: configs/trunk/src/topcoder/setup.py =================================================================== --- configs/trunk/src/topcoder/setup.py 2008-04-02 05:21:28 UTC (rev 651) +++ configs/trunk/src/topcoder/setup.py 2008-04-02 05:41:52 UTC (rev 652) @@ -1,6 +1,10 @@ #!/usr/bin/env python # vim:et:sw=2:ts=2 +""" +Set up topcoder configuration. +""" + from __future__ import with_statement from contextlib import * from os import * @@ -9,6 +13,13 @@ from sys import * from urllib import * +# Utilities. +def esc( s ): return sub( r'([\\:])', r'\\\1', s ) +def mkdirp( path ): + try: makedirs( path ) + except OSError, ex: + if ex.errno != 17: raise + # Source URLs to the plugin jars. urls = """ http://www.topcoder.com/contest/classes/ExampleBuilder/ExampleBuilder.jar @@ -18,12 +29,19 @@ # Figure out and setup paths. homedir = environ[ 'HOME' if platform != 'win32' else 'HOMEPATH' ] + sep -plugindir = ( argv[1] if len(argv) < 1 else homedir + '.topcoder' ) + sep -try: makedirs( plugindir ) -except OSError, ex: - if ex.errno != 17: raise +userdir = argv[1] +plugindir = ( argv[2] if len(argv) < 2 else homedir + '.topcoder' ) + sep +mkdirp( userdir ) +mkdirp( plugindir ) paths = [ plugindir + basename(url) for url in urls ] +# Sample default user directories, where the file will be placed. +# TODO parse command line options. +# if platform == 'win32': +# userdir = homedir + 'My Documents\\Visual Studio 2008\\Projects\\TopCoderCS\\TopCoderCS\\' +# else: +# userdir = homedir + 'work/topcoder/' + # Download jars if necessary. for url, path in zip( urls, paths ): if not exists( path ): @@ -31,7 +49,8 @@ # Generate the final configuration file from the template. with file( 'contestapplet.conf.template' ) as template: - with file( homedir + 'contestapplet.conf', 'w' ) as output: - output.write( sub( '`CLASSPATH`', - pathsep.join( paths ), - template.read() ) ) + contents = template.read() +contents = sub( '`CLASSPATH`', esc( pathsep.join( paths ) ), contents ) +contents = sub( '`USERDIR`', esc( userdir ), contents ) +with file( homedir + 'contestapplet.conf', 'w' ) as output: + output.write( contents ) 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:21:27
|
Revision: 651 http://assorted.svn.sourceforge.net/assorted/?rev=651&view=rev Author: yangzhang Date: 2008-04-01 22:21:28 -0700 (Tue, 01 Apr 2008) Log Message: ----------- added topcoder setup script and config template Added Paths: ----------- configs/trunk/src/topcoder/ configs/trunk/src/topcoder/contestapplet.conf.template configs/trunk/src/topcoder/setup.py Added: configs/trunk/src/topcoder/contestapplet.conf.template =================================================================== --- configs/trunk/src/topcoder/contestapplet.conf.template (rev 0) +++ configs/trunk/src/topcoder/contestapplet.conf.template 2008-04-02 05:21:28 UTC (rev 651) @@ -0,0 +1,197 @@ +#TopCoder ContestApplet Preferences File +#Thu Sep 13 01:33:13 EDT 2007 +com.topcoder.client.contestApplet.common.LocalPreferences.menufont=Arial +com.topcoder.client.contestApplet.common.LocalPreferences.menufontsize=10 +com.topcoder.client.contestApplet.common.LocalPreferences.commonclasspath=`CLASSPATH` +com.topcoder.client.contestApplet.common.LocalPreferences.chatpanelback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.chatfindhighlight=-8355712 +com.topcoder.client.contestApplet.common.LocalPreferences.chatfindback=-16776961 +com.topcoder.client.contestApplet.common.LocalPreferences.chatfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.chatfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.keysubmit=Alt+U +com.topcoder.client.contestApplet.common.LocalPreferences.edstdkeyfind=Alt+F +com.topcoder.client.contestApplet.common.LocalPreferences.keycompile=Alt+C +com.topcoder.client.contestApplet.common.LocalPreferences.edstdkeyredo=Ctrl+Y +com.topcoder.client.contestApplet.common.LocalPreferences.edstdkeyundo=Ctrl+Z +com.topcoder.client.contestApplet.common.LocalPreferences.edstdkeygoto=Alt+G +com.topcoder.client.contestApplet.common.LocalPreferences.keytest=Alt+T +com.topcoder.client.contestApplet.common.LocalPreferences.keysave=Alt+S +com.topcoder.client.contestApplet.common.LocalPreferences.edstdselb=-16751104 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdselt=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxkeywords=-6710785 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxliterals=-65281 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxcomments=-16724992 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxdefault=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdfore=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.edstdfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdtabsize=4 +com.topcoder.client.contestApplet.common.LocalPreferences.problemback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.problemfore=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.messagefore=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.messageback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.problemfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.problemfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.problemfixedfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.problemfixedfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.messagefont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.messagefontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.chalsrcback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobback=-16777216 +com.topcoder.client.contestApplet.common.LocalPreferences.chalsrcfore=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobfore=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobfixedfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.chalprobfixedfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.chalsrcfont=Monospaced +com.topcoder.client.contestApplet.common.LocalPreferences.chalsrcfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryunopened.color=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryunopened.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryunopened.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryopened.color=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryopened.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryopened.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycompiled.color=-1 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycompiled.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycompiled.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavapoints.color=-16711936 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavapoints.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavapoints.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlpassed.color=-16711936 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlpassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlpassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlfailed.color=-16711936 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavachlfailed.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasyspassed.color=-16711936 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasyspassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasyspassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasysfailed.color=-65485 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasysfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryjavasysfailed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycpppoints.color=-103 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycpppoints.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycpppoints.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlpassed.color=-103 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlpassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlpassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlfailed.color=-103 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppchlfailed.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsyspassed.color=-103 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsyspassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsyspassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsysfailed.color=-65485 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsysfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycppsysfailed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharppoints.color=-10066177 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharppoints.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharppoints.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlpassed.color=-10066177 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlpassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlpassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlfailed.color=-10066177 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpchlfailed.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsyspassed.color=-10066177 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsyspassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsyspassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsysfailed.color=-65485 +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsysfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarycsharpsysfailed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbpoints.color=-8267265 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbpoints.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbpoints.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlpassed.color=-8267265 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlpassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlpassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlfailed.color=-8267265 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbchlfailed.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsyspassed.color=-8267265 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsyspassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsyspassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsysfailed.color=-65485 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsysfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summaryvbsysfailed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonpoints.color=-39169 +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonpoints.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonpoints.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlpassed.color=-39169 +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlpassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlpassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlfailed.color=-39169 +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonchlfailed.italic=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsyspassed.color=-39169 +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsyspassed.bold=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsyspassed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsysfailed.color=-65485 +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsysfailed.bold=false +com.topcoder.client.contestApplet.common.LocalPreferences.summarypythonsysfailed.italic=true +com.topcoder.client.contestApplet.common.LocalPreferences.usertablefont=Arial +com.topcoder.client.contestApplet.common.LocalPreferences.usertablefontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.summaryfont=Arial +com.topcoder.client.contestApplet.common.LocalPreferences.summaryfontsize=12 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxcommentsstyle=0 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxliteralsstyle=0 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxkeywordsstyle=0 +com.topcoder.client.contestApplet.common.LocalPreferences.edstdsyntaxdefaultstyle=0 +com.topcoder.client.contestApplet.common.LocalPlight=true +com.topcoder.client.contestApplet.common.LocalPreferences.chalsrcsyntaxhighlight=true +com.topcoder.client.contestApplet.LocalPreferences.connectionType=DIRECT +com.topcoder.client.contestApplet.panels.ChatPanel.generalback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.whispertoback=-65536 +com.topcoder.client.contestApplet.panels.ChatPanel.meback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.systemfore=-16711936 +com.topcoder.client.contestApplet.panels.ChatPanel.whisperback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.whispertofore=-6710887 +com.topcoder.client.contestApplet.panels.ChatPanel.whisperfore=-6710887 +com.topcoder.client.contestApplet.panels.ChatPanel.generaltoback=-65536 +com.topcoder.client.contestApplet.panels.ChatPanel.emphsystemfore=-16711936 +com.topcoder.client.contestApplet.panels.ChatPanel.emphsystemback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.systemback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.generaltofore=-1 +com.topcoder.client.contestApplet.panels.ChatPanel.handleback=-16777216 +com.topcoder.client.contestApplet.panels.ChatPanel.mefore=-6710887 +com.topcoder.client.contestApplet.panels.ChatPanel.generalfore=-1 +com.topcoder.client.contentApplet.panels.ChatPanel.moderatedChatQuestionFore=-16711936 +com.topcoder.client.contentApplet.panels.ChatPanel.moderatedChatSpeakerFore=-1 +com.topcoder.client.contentApplet.panels.ChatPanel.moderatedChatSpeakerBack=-16777216 +com.topcoder.client.contentApplet.panels.ChatPanel.moderatedChatQuestionBack=-16777216 +com.topcoder.jmaContestApplet.frames.codingframe.location=0\:0 +com.topcoder.jmaContestApplet.frames.codingframe.size=1024\:746 +com.topcoder.jmaContestApplet.frames.codingframe.dividerloc=319 +com.topcoder.jmaContesntApplet.ContestApplet.enableTimestamps=true +fileeditor.config.dirName=C\:\\Documents and Settings\\Yang\\My Documents\\Visual Studio 2008\\Projects\\TopCoderCS\\TopCoderCS +fileeditor.config.fileName=Program +fileeditor.config.beginCut=// BEGIN CUT HERE +fileeditor.config.endCut=// END CUT HERE +fileeditor.config.probdescfileextnsion=txignaturefilename= +fileeditor.config.lineComments=true +fileeditor.config.overrideFileName=true +fileeditor.config.provideBreaks=false +fileeditor.config.probdescfilewrite=false +fileeditor.config.breakAt=60 +fileeditor.config.htmldesc=false +fileeditor.config.backup=true +fileeditor.config.javatemplate=$BEGINCUT$\n$PROBLEMDESC$\n$ENDCUT$\nimport java.util.*;\npublic class $CLASSNAME$ {\n\tpublic $RC$ $METHODNAME$($METHODPARMS$) {\n\t\t\n\t}\n\tpublic static void main(String[] args) {\n\t\t$CLASSNAME$ temp \= new $CLASSNAME$();\n\t\tSystem.out.println(temp.$METHODNAME$($METHODPARMS$));\n\t}\n} +fileeditor.config.cpptemplate=// vim\:et\:sw\=2\:ts\=2\n\n$BEGINCUT$\n\#if 0\n$PROBLEMDESC$\n\#endif\n$ENDCUT$\n\n\n\n\n\n\n\n//\#line $NEXTLINENUMBER$ "$FILENAME$"\n\#include <algorithm>\n\#include <cassert>\n\#include <cctype>\n\#include <cmath>\n\#include <cstdio>\n\#include <cstdlib>\n\#include <deque>\n\#include <iostream>\n\#include <map>\n\#include <queue>\n\#include <set>\n\#include <sstream>\n\#include <stack>\n\#include <string>\n\#include <vector>\nusing namespace std;\n\n\#define ARRSIZE(x) (sizeof(x)/sizeof(x[0]))\n\n\n\n\n\n\n\n$BEGINCUT$\ntemplate<typename T> void print( T a ) {\n\tcerr << a;\n}\nstatic void print( long long a ) {\n\tcerr << a << "L";\n}\nstatic void print( string a ) {\n\tcerr << '"' << a << '"';\n}\ntemplate<typename T> void print( vector<T> a ) {\n\tcerr << "{";\n\tfor ( int i \= 0 ; i \!\= a.size() ; i++ ) {\n\t\tif ( i \!\= 0 ) cerr << ", ";\n\t\tprint( a[i] );\n\t}\n\tcerr << "}" << endl;\n}\ntemplate<typename T> void eq( int n, T have, T need ) {\n\tif ( have \=\= need ) {\n\t\tcerr << "Case " << n << " passed." << endl;\n\t} else {\n\t\tcerr << "Case " << n << " failed\: expected ";\n\t\tprint( need );\n\t\tcerr << " received ";\n\t\tprint( have );\n\t\tcerr << "." << endl;\n\t}\n}\ntemplate<typename T> void eq( int n, vector<T> have, vector<T> need ) {\n\tif( have.size() \!\= need.size() ) {\n\t\tcerr << "Case " << n << " failed\: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl;\n\t\tcerr << " have\: "; print( have );\n\t\tcerr << " need\: "; print( need );\n\t\treturn;\n\t}\n\tfor( size_t i\= 0; i < have.size(); i++ ) {\n\t\tif( have[i] \!\= need[i] ) {\n\t\t\tcerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl;\n\t\t\tcerr << " have\: "; print( have );\n\t\t\tcerr << " need\: "; print( need );\n\t\t\treturn;\n\t\t}\n\t}\n\tcerr << "Case " << n << " passed." << endl;\n}\nstatic void eq( int n, string have, string need ) {\n\tif ( have \=\= need ) {\n\t\tcerr << "Case " << n << " passed." << endl;\n\t} else {\n\t\tcerr << "Case " << n << " failed\: expected ";\n\t\tprint( need );\n\t\tcerr << " received ";\n\t\tprint( have );\n\t\tcerr << "." << endl;\n\t}\n}\n$ENDCUT$\n\n\n\n\n\n\n\n$BEGINCUT$\n\#if 0\ntemplate<typename T> void pp(const T & xs) {\n\tfor (typename T\:\:const_iterator it \= xs.begin();\n\t\tit \!\= xs.end();\n\t\tit++)\n\t\tcout << *it << " ";\n\tcout << endl;\n}\n\nvector<string> split( const string& s, const string& delim \=" " ) {\n\tvector<string> res;\n\tstring t;\n\tfor ( int i \= 0 ; i \!\= s.size() ; i++ ) {\n\t\tif ( delim.find( s[i] ) \!\= string\:\:npos ) {\n\t\t\tif ( \!t.empty() ) {\n\t\t\t\tres.push_back( t );\n\t\t\t\tt \= "";\n\t\t\t}\n\t\t} else {\n\t\t\tt +\= s[i];\n\t\t}\n\t}\n\tif ( \!t.empty() ) {\n\t\tres.push_back(t);\n\t}\n\treturn res;\n}\n\nvector<int> splitInt( const string& s, const string& delim \=" " ) {\n\tvector<string> tok \= split( s, delim );\n\tvector<int> res;\n\tfor ( int i \= 0 ; i \!\= tok.size(); i++ )\n\t\tres.push_back( atoi( tok[i].c_str() ) );\n\treturn res;\n}\n\#endif\n$ENDCUT$\n\n\n\n\n\n\n\nclass $CLASSNAME$ {\n\tpublic\:\n\t$RC$ $METHODNAME$($METHODPARMS$) {\n\t\t$RC$ res;\n\t\treturn res;\n\t}\n};\n\n\n\n\n\n\n\n$BEGINCUT$\nint main() {\n$MAINBODY$\n\tcin.get();\n\treturn 0;\n}\n$ENDCUT$\n +fileeditor.config.csharptemplate=using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Text.RegularExpressions;\n\npublic class $CLASSNAME$ {\n\tpublic $RC$ $METHODNAME$($METHODPARMS$) {\n\t}\n\n\n\n\n\n\n\tpublic void pp<T>(T x) { Console.WriteLine(x); }\n\n\n\n\n\n\n\n\n\t$BEGINCUT$\n\tpublic static void Main(string[] args) {\n\t\t$MAINBODY$\n\t\tConsole.WriteLine("done\!");\n\t\tConsole.Read();\n\t}\n private static void eq( int n, object have, object need) {\n if( eq( have, need ) ) {\n Console.WriteLine( "Case "+n+" passed." );\n } else {\n Console.Write( "Case "+n+" failed\: expected " );\n print( need );\n Console.Write( ", received " );\n print( have );\n Console.WriteLine();\n }\n }\n private static void eq( int n, Array have, Array need) {\n if( have \=\= null || have.Length \!\= need.Length ) {\n Console.WriteLine("Case "+n+" failed\: returned "+have.Length+" elements; expected "+need.Length+" elements.");\n print( have );\n print( need );\n return;\n }\n for( int i\= 0; i < have.Length; i++ ) {\n if( \! eq( have.GetValue(i), need.GetValue(i) ) ) {\n Console.WriteLine( "Case "+n+" failed. Expected and returned array differ in position "+i );\n print( have );\n print( need );\n return;\n }\n }\n Console.WriteLine("Case "+n+" passed.");\n }\n private static bool eq( object a, object b ) {\n if ( a is double && b is double ) {\n return Math.Abs((double)a-(double)b) < 1E-9;\n } else {\n return a\!\=null && b\!\=null && a.Equals(b);\n }\n }\n private static void print( object a ) {\n if ( a is string ) {\n Console.Write("\\"{0}\\"", a);\n } else if ( a is long ) {\n Console.Write("{0}L", a);\n } else {\n Console.Write(a);\n }\n }\n private static void print( Array a ) {\n if ( a \=\= null) {\n Console.WriteLine("<NULL>");\n;\n for ( int i\= 0; i < a.Length; i++ ) {\n print( a.GetValue(i) );\n if( i \!\= a.Length-1 ) {\n Console.Write(", ");\n }\n }\n Console.WriteLine( '}' );\n }\n\t$ENDCUT$\n}\n +fileeditor.config.javaextension=java +fileeditor.config.cppextension=cpp +fileeditor.config.csharpextension=cs +editor.defaultname=ExampleBuilder +editor.1.name=ExampleBuilder +editor.1.entrypoint=codeprocessor.EntryPoint +editor.1.classpath= +editor.1.eager=1 +editor.numplugins=1 +editor.2.name=ExampleBuilder +editor.2.entrypoint=codeprocessor.EntryPoint +editor.2.classpath= +editor.2.eager=1 +codeprocessor.config.pluginentrypoint=fileedit.EntryPoint +codeprocessor.config.codeprocessor=tc_plugin.ExampleBuilder Added: configs/trunk/src/topcoder/setup.py =================================================================== --- configs/trunk/src/topcoder/setup.py (rev 0) +++ configs/trunk/src/topcoder/setup.py 2008-04-02 05:21:28 UTC (rev 651) @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# vim:et:sw=2:ts=2 + +from __future__ import with_statement +from contextlib import * +from os import * +from os.path import * +from re import * +from sys import * +from urllib import * + +# Source URLs to the plugin jars. +urls = """ +http://www.topcoder.com/contest/classes/ExampleBuilder/ExampleBuilder.jar +http://www.topcoder.com/contest/classes/CodeProcessorV2/CodeProcessor.jar +http://www.topcoder.com/contest/classes/FileEdit/FileEdit.jar +""".strip().split() + +# Figure out and setup paths. +homedir = environ[ 'HOME' if platform != 'win32' else 'HOMEPATH' ] + sep +plugindir = ( argv[1] if len(argv) < 1 else homedir + '.topcoder' ) + sep +try: makedirs( plugindir ) +except OSError, ex: + if ex.errno != 17: raise +paths = [ plugindir + basename(url) for url in urls ] + +# Download jars if necessary. +for url, path in zip( urls, paths ): + if not exists( path ): + urlretrieve(url, path) + +# Generate the final configuration file from the template. +with file( 'contestapplet.conf.template' ) as template: + with file( homedir + 'contestapplet.conf', 'w' ) as output: + output.write( sub( '`CLASSPATH`', + pathsep.join( paths ), + template.read() ) ) Property changes on: configs/trunk/src/topcoder/setup.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-02 03:39:18
|
Revision: 650 http://assorted.svn.sourceforge.net/assorted/?rev=650&view=rev Author: yangzhang Date: 2008-04-01 20:39:21 -0700 (Tue, 01 Apr 2008) Log Message: ----------- added simple tcp client example Added Paths: ----------- sandbox/trunk/src/c/client.c Added: sandbox/trunk/src/c/client.c =================================================================== --- sandbox/trunk/src/c/client.c (rev 0) +++ sandbox/trunk/src/c/client.c 2008-04-02 03:39:21 UTC (rev 650) @@ -0,0 +1,63 @@ +#include <strings.h> +#include <sys/socket.h> +#include <arpa/inet.h> +#include <unistd.h> +#include <netinet/in.h> +#include <netdb.h> +#include <stdio.h> + +int +main() +{ + // Create socket. + int s = socket(AF_INET, SOCK_STREAM, 0); + if (s == 0) { + perror("socket"); + return 1; + } + + // Create remote socket address. + struct sockaddr_in sa; + bzero(&sa, sizeof sa); + sa.sin_family = AF_INET; + + // Use port number. + sa.sin_port = htons(80); + + // Look up by service name. + struct servent *sp = getservbyname("http", "tcp"); + if (sp == NULL) { + perror("getservbyname"); + return 1; + } + // getservbyname already returns the port in. + sa.sin_port = sp->s_port; + //printf("%d\n", sa.sin_port); + + // Use string IP address. + sa.sin_addr.s_addr = inet_addr("127.0.0.1"); + if (sa.sin_addr.s_addr == -1) { + perror("inet_addr"); + return 1; + } + + // Look up by hostname. + struct hostent *h = gethostbyname("www.google.com"); + if (h == NULL) { + perror("gethostbyname"); + return 1; + } + bcopy(h->h_addr, (char*) &sa.sin_addr, h->h_length); + + // Connect. + if (connect(s, (struct sockaddr*) &sa, sizeof sa) != 0) { + perror("connect"); + close(s); + return 1; + } + + // Close socket. + close(s); + + 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 03:39:08
|
Revision: 649 http://assorted.svn.sourceforge.net/assorted/?rev=649&view=rev Author: yangzhang Date: 2008-04-01 20:39:08 -0700 (Tue, 01 Apr 2008) Log Message: ----------- forgot to close socket Modified Paths: -------------- sandbox/trunk/src/c/server.c Modified: sandbox/trunk/src/c/server.c =================================================================== --- sandbox/trunk/src/c/server.c 2008-04-02 03:38:37 UTC (rev 648) +++ sandbox/trunk/src/c/server.c 2008-04-02 03:39:08 UTC (rev 649) @@ -30,5 +30,7 @@ return 1; } + close(s); + 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 03:38:36
|
Revision: 648 http://assorted.svn.sourceforge.net/assorted/?rev=648&view=rev Author: yangzhang Date: 2008-04-01 20:38:37 -0700 (Tue, 01 Apr 2008) Log Message: ----------- added test of exceptions in threads Added Paths: ----------- sandbox/trunk/src/cc/thread_exceptions.cc Added: sandbox/trunk/src/cc/thread_exceptions.cc =================================================================== --- sandbox/trunk/src/cc/thread_exceptions.cc (rev 0) +++ sandbox/trunk/src/cc/thread_exceptions.cc 2008-04-02 03:38:37 UTC (rev 648) @@ -0,0 +1,29 @@ +// Question: what happens when you throw an exception from a thread? +// Answer: at least on Linux in g++, it turns out that an uncaught exception +// causes the whole process to exit. One person in ##c++ says that this has +// undefined behavior. + +#include <iostream> +#include <pthread.h> +#include <boost/bind.hpp> +#include <commons/boost/threads.h> + +using namespace boost; +using namespace commons; +using namespace std; + +void +f() +{ + cout << "throwing an exception\n" << endl; + throw 0; +} + +int +main() +{ + pthread_t t = checkpass(spawn(bind(f))); + pthread_join(t, NULL); + cout << "survived" << endl; // We never get here. + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-27 17:45:09
|
Revision: 647 http://assorted.svn.sourceforge.net/assorted/?rev=647&view=rev Author: yangzhang Date: 2008-03-27 10:45:15 -0700 (Thu, 27 Mar 2008) Log Message: ----------- updated status string; added note about more complex status listing all screens Modified Paths: -------------- configs/trunk/src/screenrc Modified: configs/trunk/src/screenrc =================================================================== --- configs/trunk/src/screenrc 2008-03-27 00:10:56 UTC (rev 646) +++ configs/trunk/src/screenrc 2008-03-27 17:45:15 UTC (rev 647) @@ -292,5 +292,16 @@ ## attrcolor b "R" -hardstatus string "[screen %n%?: %t%?] %h" +hardstatus string "[%H %n%?: %t%?] %h" +#hardstatus alwayslastline +#hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' + +# The following is a mini extract of the above (commented) hardstatus string; +# playing with this to understand hardstatus strings better. +# TODO: the following is glitchy. +# `%-Lw` means start from first window up to current window. +# `%+Lw` means start from current window up to last window. +# These wrap the formatter for each window. +#hardstatus string '%=%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%=' + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-27 00:10:51
|
Revision: 646 http://assorted.svn.sourceforge.net/assorted/?rev=646&view=rev Author: yangzhang Date: 2008-03-26 17:10:56 -0700 (Wed, 26 Mar 2008) Log Message: ----------- added server demo Added Paths: ----------- sandbox/trunk/src/c/server.c Added: sandbox/trunk/src/c/server.c =================================================================== --- sandbox/trunk/src/c/server.c (rev 0) +++ sandbox/trunk/src/c/server.c 2008-03-27 00:10:56 UTC (rev 646) @@ -0,0 +1,34 @@ +// This is how you set up a server in raw C. + +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> + +#include <stdio.h> +#include <unistd.h> +#include <strings.h> + +int +main() +{ + int s = socket(AF_INET, SOCK_STREAM, 0); + if (s == 0) { + perror("socket() failed"); + return 1; + } + + 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); + sa.sin_addr.s_addr = htonl(0xff000001); + + if (bind(s, (struct sockaddr*) &sa, sizeof(struct sockaddr_in)) != 0) { + perror("bind() failed"); + close(s); + 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-03-26 19:04:35
|
Revision: 645 http://assorted.svn.sourceforge.net/assorted/?rev=645&view=rev Author: yangzhang Date: 2008-03-26 11:57:40 -0700 (Wed, 26 Mar 2008) Log Message: ----------- renamed Added Paths: ----------- personal-site/trunk/static/slides/icedb-presentation-icde07.pptx Removed Paths: ------------- personal-site/trunk/static/slides/icedb-presentation-icde07.pdf Deleted: personal-site/trunk/static/slides/icedb-presentation-icde07.pdf =================================================================== (Binary files differ) Copied: personal-site/trunk/static/slides/icedb-presentation-icde07.pptx (from rev 644, personal-site/trunk/static/slides/icedb-presentation-icde07.pdf) =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-26 18:48:24
|
Revision: 644 http://assorted.svn.sourceforge.net/assorted/?rev=644&view=rev Author: yangzhang Date: 2008-03-26 11:48:21 -0700 (Wed, 26 Mar 2008) Log Message: ----------- added ICEDB slides Added Paths: ----------- personal-site/trunk/static/slides/icedb-presentation-icde07.pdf Added: personal-site/trunk/static/slides/icedb-presentation-icde07.pdf =================================================================== (Binary files differ) Property changes on: personal-site/trunk/static/slides/icedb-presentation-icde07.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-24 15:40:43
|
Revision: 643 http://assorted.svn.sourceforge.net/assorted/?rev=643&view=rev Author: yangzhang Date: 2008-03-24 08:40:30 -0700 (Mon, 24 Mar 2008) Log Message: ----------- added libnuma, but it's unused Modified Paths: -------------- hash-join/trunk/src/hashjoin.cc Modified: hash-join/trunk/src/hashjoin.cc =================================================================== --- hash-join/trunk/src/hashjoin.cc 2008-03-24 03:37:25 UTC (rev 642) +++ hash-join/trunk/src/hashjoin.cc 2008-03-24 15:40:30 UTC (rev 643) @@ -31,6 +31,14 @@ #include <boost/scoped_array.hpp> +#ifdef NUMA +#ifdef TILE64 +#include <linux/numa.h> +#else +#include <numa.h> +#endif +#endif + using namespace std; using namespace boost; #ifndef STLPORT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-24 03:37:20
|
Revision: 642 http://assorted.svn.sourceforge.net/assorted/?rev=642&view=rev Author: yangzhang Date: 2008-03-23 20:37:25 -0700 (Sun, 23 Mar 2008) Log Message: ----------- fixed one-leftover-header bug Modified Paths: -------------- hash-join/trunk/tools/LogProc.scala Modified: hash-join/trunk/tools/LogProc.scala =================================================================== --- hash-join/trunk/tools/LogProc.scala 2008-03-23 22:36:31 UTC (rev 641) +++ hash-join/trunk/tools/LogProc.scala 2008-03-24 03:37:25 UTC (rev 642) @@ -28,9 +28,8 @@ // Parse logs into Stats. for (line <- lines) { if (line contains indexer) { - if (index != None) { + if (index != None) stats(index.get) += map.clone - } index = Some(line.split(" ")(1).toInt) map.clear } else { @@ -39,6 +38,8 @@ map(name) = value.toDouble / 1000.0 } } + if (index != None) + stats(index.get) += map.clone // Build plot data. val plotData = for (name <- names) yield { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-23 22:36:31
|
Revision: 641 http://assorted.svn.sourceforge.net/assorted/?rev=641&view=rev Author: yangzhang Date: 2008-03-23 15:36:31 -0700 (Sun, 23 Mar 2008) Log Message: ----------- added a tile64 runner and makefile Added Paths: ----------- hash-join/trunk/src/run.bash hash-join/trunk/src/tile64.mk Added: hash-join/trunk/src/run.bash =================================================================== --- hash-join/trunk/src/run.bash (rev 0) +++ hash-join/trunk/src/run.bash 2008-03-23 22:36:31 UTC (rev 641) @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# This is for running on the TILE64. + +set -o errexit -o nounset + +make -s + +run() { + local n="$1" + time tile-monitor --batch-mode --pci \ + --upload data/actresses.dat actresses.dat \ + --upload data/movies.dat movies.dat \ + --upload out/hashjoin hashjoin \ + --run - hashjoin $n movies.dat actresses.dat - +} + +for n in 1 8 16 32 48 56 +do run $n +done | tee log Property changes on: hash-join/trunk/src/run.bash ___________________________________________________________________ Name: svn:executable + * Added: hash-join/trunk/src/tile64.mk =================================================================== --- hash-join/trunk/src/tile64.mk (rev 0) +++ hash-join/trunk/src/tile64.mk 2008-03-23 22:36:31 UTC (rev 641) @@ -0,0 +1,3 @@ +out/hashjoin: hashjoin.cc + mkdir -p out + tile-c++ -O3 -DTILE64 -I ~/ccom/src/ -I ~/boost_1_34_1/ -o out/hashjoin -lpthread hashjoin.cc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-23 22:36:22
|
Revision: 640 http://assorted.svn.sourceforge.net/assorted/?rev=640&view=rev Author: yangzhang Date: 2008-03-23 15:36:23 -0700 (Sun, 23 Mar 2008) Log Message: ----------- - added support for stlport hash_map - fixed non-std c++ - 100K min bucket size - refactored bucket_size calculations - using vectors instead of raw arrays (in certain places) Modified Paths: -------------- hash-join/trunk/src/hashjoin.cc Modified: hash-join/trunk/src/hashjoin.cc =================================================================== --- hash-join/trunk/src/hashjoin.cc 2008-03-19 16:57:53 UTC (rev 639) +++ hash-join/trunk/src/hashjoin.cc 2008-03-23 22:36:23 UTC (rev 640) @@ -8,7 +8,11 @@ #include <iostream> #include <exception> #include <vector> +#ifdef STLPORT +#include <hash_map> +#else #include <ext/hash_map> +#endif #include <sys/types.h> #include <sys/stat.h> @@ -25,12 +29,14 @@ #include <commons/threads.h> #include <commons/time.h> -// TODO: #include <boost/array.hpp> +#include <boost/scoped_array.hpp> using namespace std; +using namespace boost; +#ifndef STLPORT using namespace __gnu_cxx; +#endif using namespace commons; -// TODO: using namespace boost; typedef hash_map< const char*, @@ -52,9 +58,9 @@ }; // TODO use dependency injection! -unsigned int ncpus = 1; -const hmap::size_type map_size = 1000000; -const int min_bucket_size = 1000000; +unsigned int ncpus = 1; +const hmap::size_type map_size = 1000000; // 1MB +const size_t min_bucket_size = 100000; // 100KB /** * Buckets are produced in the hash-partitioning phase. These are simple @@ -88,7 +94,10 @@ class db { public: - db(const char *path) : buf(load_file(path, buflen, ncpus)) + db(const char *path) : + buf(load_file(path, buflen, ncpus)), + // TODO dependency injection + bucket_size(max((size_t) min_bucket_size, buflen / ncpus / ncpus * 3)) { scan(buf, buflen); } @@ -107,8 +116,8 @@ * \param p The start of the tuple. * \param nbytes The length of the tuple. */ - unsigned int push_bucket(char **heads, bucket *bs, const char *s, const char - *p, size_t nbytes); + unsigned int push_bucket(vector<char *> & heads, bucket *bs, const char *s, + const char *p, size_t nbytes); protected: /** * This routine runs on each processor to hash-partition the data into local @@ -117,6 +126,7 @@ virtual void partition1(unsigned int pid, bucket* bucket) = 0; char *buf; size_t buflen; + size_t bucket_size; }; /** @@ -223,9 +233,8 @@ bucket **buckets = new bucket*[ncpus]; for (unsigned int i = 0; i < ncpus; i++) { buckets[i] = new bucket[ncpus]; + check(buckets[i]); for (unsigned int j = 0; j < ncpus; j++) { - // TODO dependency injection - size_t bucket_size = max((size_t) min_bucket_size,buflen / ncpus * 3); // Each bucket should be twice as large as it would be given uniform // distribution. This is just an initial size; extending can happen. buckets[i][j].bufs.push_back(new char[bucket_size]); @@ -237,13 +246,12 @@ // Partition the data into the buckets using the hash function. Reason for // buckets: poor man's message passing. All the data from CPU i to CPU j goes // into bucket[i][j]. - pthread_t ts[ncpus]; + vector<pthread_t> ts(ncpus); for (unsigned int i = 0; i < ncpus; i++) { ts[i] = method_thread(this, &db::partition1, i, buckets[i]); } for (unsigned int i = 0; i < ncpus; i++) { - void *value; - check(pthread_join(ts[i], &value) == 0); + check(pthread_join(ts[i], NULL) == 0); } return const_cast<const bucket**>(buckets); // TODO why is this cast needed? @@ -257,11 +265,10 @@ } unsigned int -db::push_bucket(char **heads, bucket *bs, const char *s, const char *p, size_t nbytes) +db::push_bucket(vector<char*> & heads, bucket *bs, const char *s, const char *p, size_t nbytes) { size_t h = hash_djb2(s); unsigned int bucket = h % ncpus; - size_t bucket_size = max((size_t) min_bucket_size, buflen * 3 / ncpus); if (heads[bucket] + nbytes < bs[bucket].bufs.back() + bucket_size) { memcpy(heads[bucket], p, nbytes); heads[bucket] += nbytes; @@ -288,7 +295,7 @@ partstart - buf << ".." << partend - buf << endl; // Position the writing heads at the head of each bucket. (TODO find better // name than head) - char *heads[ncpus]; + vector<char*> heads(ncpus); for (unsigned int i = 0; i < ncpus; i++) { heads[i] = bs[i].bufs[0]; } @@ -323,7 +330,7 @@ // Position the writing heads at the head of each bucket. (TODO find better // name than head) - char *heads[ncpus]; + vector<char *> heads(ncpus); for (unsigned int i = 0; i < ncpus; i++) { heads[i] = bs[i].bufs[0]; } @@ -352,8 +359,7 @@ tmp[tmplen-1] = '\0'; // Copy the tuple into the correct local bucket. - unsigned int bbb; - bbb = push_bucket(heads, bs, title, tmp, tmplen); + push_bucket(heads, bs, title, tmp, tmplen); counter++; // End of tuple? @@ -376,7 +382,7 @@ const hmap * movdb::build(const bucket **movbucs) { - pthread_t ts[ncpus]; + vector<pthread_t> ts(ncpus); hmap *hs = new hmap[ncpus]; for (unsigned int i = 0; i < ncpus; i++) { ts[i] = method_thread(this, &movdb::build1, i, movbucs, &hs[i]); @@ -416,7 +422,7 @@ void actdb::probe(const hmap *hs, const bucket **actbucs, bool show_progress) { - pthread_t ts[ncpus]; + vector<pthread_t> ts(ncpus); for (unsigned int i = 0; i < ncpus; i++) { ts[i] = method_thread(this, &actdb::probe1, i, &hs[i], actbucs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-19 16:57:57
|
Revision: 638 http://assorted.svn.sourceforge.net/assorted/?rev=638&view=rev Author: yangzhang Date: 2008-03-19 09:57:46 -0700 (Wed, 19 Mar 2008) Log Message: ----------- reformatted a bit; updated for missingh-1.0.0 Modified Paths: -------------- scala-doc-search/trunk/src/srch.hs Modified: scala-doc-search/trunk/src/srch.hs =================================================================== --- scala-doc-search/trunk/src/srch.hs 2008-03-19 16:39:17 UTC (rev 637) +++ scala-doc-search/trunk/src/srch.hs 2008-03-19 16:57:46 UTC (rev 638) @@ -1,30 +1,31 @@ #!/usr/bin/env runhaskell +import Control.Arrow ((>>>)) import Data.Char (toLower) import Data.List (union, isSuffixOf) -import Data.String (replace, split) +import Data.String.Utils (replace, split) name file = last $ split "/" $ replace ".html" "" $ replace "$object" " object" $ file :: String base = "http://www.scala-lang.org/docu/files/api/scala" findFiles suffix files = - let lsuffix = "/" ++ map toLower suffix - has file = - let lfile = map toLower file - in if lsuffix `isSuffixOf` lfile && lsuffix /= "" + let lsuffix = "/" ++ map toLower suffix + has file = + let lfile = map toLower file + in if lsuffix `isSuffixOf` lfile && lsuffix /= "" then [(name file, base ++ file)] else [] in concat $ map has files :: [(String,String)] types = words "object trait class" find typ name files = - if not (typ `elem` types) + if not (typ `elem` types) then union [] $ concat $ map (\t -> find t name files) types else let suffix = case typ of "object" -> "$object.html" "trait" -> ".html" "class" -> ".html" - in flip findFiles files $ name ++ suffix :: [(String,String)] + in flip findFiles files $ name ++ suffix :: [(String,String)] decorate (name,url) = if url == "" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-19 16:57:57
|
Revision: 639 http://assorted.svn.sourceforge.net/assorted/?rev=639&view=rev Author: yangzhang Date: 2008-03-19 09:57:53 -0700 (Wed, 19 Mar 2008) Log Message: ----------- tweaks Modified Paths: -------------- scala-doc-search/trunk/README Modified: scala-doc-search/trunk/README =================================================================== --- scala-doc-search/trunk/README 2008-03-19 16:57:46 UTC (rev 638) +++ scala-doc-search/trunk/README 2008-03-19 16:57:53 UTC (rev 639) @@ -9,9 +9,17 @@ [service]: http://scripts.mit.edu/~y_z/sds/ +Requirements +------------ + +- Haskell compiler +- [MissingH] 1.0.0 + +[MissingH]: http://software.complete.org/missingh/ + Setup ----- 1. Run `mkindex.bash` to generate the lookup index `scaladocs.txt`. -2. Upload `srch.hs`, `index.php`, and `scaladocs.txt`; ensure they're in the same dir. +2. Publish `srch.hs`, `index.php`, and `scaladocs.txt` to a web directory. 3. Browse to that dir (`index.php`). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-19 16:39:20
|
Revision: 637 http://assorted.svn.sourceforge.net/assorted/?rev=637&view=rev Author: yangzhang Date: 2008-03-19 09:39:17 -0700 (Wed, 19 Mar 2008) Log Message: ----------- added publisher Added Paths: ----------- scala-doc-search/trunk/publish.bash Added: scala-doc-search/trunk/publish.bash =================================================================== --- scala-doc-search/trunk/publish.bash (rev 0) +++ scala-doc-search/trunk/publish.bash 2008-03-19 16:39:17 UTC (rev 637) @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +fullname='Scala Documentation Search' +version=0.1 +license=gpl3 +websrcs=( README ) +rels=( src-tgz: ) +nodl=true +. assorted.bash "$@" Property changes on: scala-doc-search/trunk/publish.bash ___________________________________________________________________ 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-03-19 16:39:14
|
Revision: 636 http://assorted.svn.sourceforge.net/assorted/?rev=636&view=rev Author: yangzhang Date: 2008-03-19 09:39:11 -0700 (Wed, 19 Mar 2008) Log Message: ----------- made readme more useful Modified Paths: -------------- scala-doc-search/trunk/README Modified: scala-doc-search/trunk/README =================================================================== --- scala-doc-search/trunk/README 2008-03-19 16:38:42 UTC (rev 635) +++ scala-doc-search/trunk/README 2008-03-19 16:39:11 UTC (rev 636) @@ -1,3 +1,17 @@ -1. ./index.bash -2. Upload srch.hs, index.php, and scaladocs.txt; ensure they're in the same dir -3. Browse to index.php +Overview +-------- + +Search scaladoc-generated documentation by class/object/trait name. + +This [service] is running for the main Scala API. The code provided here can +be used to search any scaladoc-generated documentation (e.g., if you want to +search your own API). + +[service]: http://scripts.mit.edu/~y_z/sds/ + +Setup +----- + +1. Run `mkindex.bash` to generate the lookup index `scaladocs.txt`. +2. Upload `srch.hs`, `index.php`, and `scaladocs.txt`; ensure they're in the same dir. +3. Browse to that dir (`index.php`). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-19 16:38:44
|
Revision: 635 http://assorted.svn.sourceforge.net/assorted/?rev=635&view=rev Author: yangzhang Date: 2008-03-19 09:38:42 -0700 (Wed, 19 Mar 2008) Log Message: ----------- renamed indexer Added Paths: ----------- scala-doc-search/trunk/src/mkindex.bash Removed Paths: ------------- scala-doc-search/trunk/src/index.bash Deleted: scala-doc-search/trunk/src/index.bash =================================================================== --- scala-doc-search/trunk/src/index.bash 2008-03-18 16:49:44 UTC (rev 634) +++ scala-doc-search/trunk/src/index.bash 2008-03-19 16:38:42 UTC (rev 635) @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -( -cd /usr/local/share/scala/doc/scala-devel/scala/api/scala -find . -name '*.html' | sed 's:^\.::' | sort -) > scaladocs.txt Copied: scala-doc-search/trunk/src/mkindex.bash (from rev 616, scala-doc-search/trunk/src/index.bash) =================================================================== --- scala-doc-search/trunk/src/mkindex.bash (rev 0) +++ scala-doc-search/trunk/src/mkindex.bash 2008-03-19 16:38:42 UTC (rev 635) @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +( +cd /usr/local/share/scala/doc/scala-devel/scala/api/scala +find . -name '*.html' | sed 's:^\.::' | sort +) > scaladocs.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-18 16:49:46
|
Revision: 634 http://assorted.svn.sourceforge.net/assorted/?rev=634&view=rev Author: yangzhang Date: 2008-03-18 09:49:44 -0700 (Tue, 18 Mar 2008) Log Message: ----------- renamed lcg Modified Paths: -------------- cpp-commons/trunk/src/commons/rand.h Modified: cpp-commons/trunk/src/commons/rand.h =================================================================== --- cpp-commons/trunk/src/commons/rand.h 2008-03-17 22:04:55 UTC (rev 633) +++ cpp-commons/trunk/src/commons/rand.h 2008-03-18 16:49:44 UTC (rev 634) @@ -4,8 +4,8 @@ namespace commons { /** - * Linear congruence generator. This is actually an example rand() provided - * in the POSIX specification. + * Linear congruential generator. This is actually an example rand() + * provided in the POSIX specification. * * TODO: rename this class */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-17 22:04:55
|
Revision: 633 http://assorted.svn.sourceforge.net/assorted/?rev=633&view=rev Author: yangzhang Date: 2008-03-17 15:04:55 -0700 (Mon, 17 Mar 2008) Log Message: ----------- added chew-tile Added Paths: ----------- numa-bench/trunk/src/chew-tile.bash Copied: numa-bench/trunk/src/chew-tile.bash (from rev 624, numa-bench/trunk/src/chew.bash) =================================================================== --- numa-bench/trunk/src/chew-tile.bash (rev 0) +++ numa-bench/trunk/src/chew-tile.bash 2008-03-17 22:04:55 UTC (rev 633) @@ -0,0 +1,71 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset + +reps=1 + +#make -s chew-dbg +make -s out/chew + +run() { + for ((i = 0; i < reps; i++)) + do tile-monitor --batch-mode --pci --upload out/chew chew --run - chew "$@" - + done +} + +K=000 M=000000 G=000000000 +KB=000 MB=000000 GB=000000000 + +# ncpus size opcount nreps shuffle par pin local write cross rrnodes nnodes ncpus + +if true ; then + +#echo writes +#run 64 100$MB 10$M 1 0 0 1 1 1 0 1 4 64 +#run 64 100$MB 500$K 1 1 0 1 1 1 0 1 4 64 +#run 64 100$MB 10$M 1 0 0 1 0 1 0 1 4 64 +#run 64 100$MB 500$K 1 1 0 1 0 1 0 1 4 64 +# +#echo reads +#run 64 100$MB 500$K 1 0 0 1 0 0 0 1 4 64 +#run 64 100$MB 500$K 1 1 0 1 0 0 0 1 4 64 + +#for n in 1 16 32 48 64 ; do +for n in 4 8 12 20 24 28 36 40 44 52 56 60 ; do + echo par +# ncpus size opcount nreps shuffle par pin local write cross rrnodes nnodes ncpus + run $n $((1$GB/n)) 500$K 1 0 1 1 0 0 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 1 1 1 0 0 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 0 1 1 1 0 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 1 1 1 1 0 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 0 1 1 0 1 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 1 1 1 0 1 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 0 1 1 1 1 0 1 4 64 + run $n $((1$GB/n)) 500$K 1 1 1 1 1 1 0 1 4 64 + + #echo cross + #run $n 1000$MB 1$M 1 0 1 1 0 0 1 1 1 64 + #run $n 1000$MB 1$M 1 1 1 1 0 0 1 1 1 64 + #run $n 1000$MB 1$M 1 0 1 1 0 1 1 1 1 64 + #run $n 1000$MB 1$M 1 1 1 1 0 1 1 1 1 64 +done + +else + +#run 1 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 2 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 3 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 4 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 8 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 12 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 +#run 16 1000$MB 10$M 1 1 1 1 0 1 0 1 4 16 + +run 1 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +#run 2 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +#run 3 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +#run 4 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +run 8 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +run 12 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 +run 16 1000$MB 10$M 1 1 1 1 0 0 0 1 4 16 + +fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-17 18:10:12
|
Revision: 632 http://assorted.svn.sourceforge.net/assorted/?rev=632&view=rev Author: yangzhang Date: 2008-03-17 11:10:15 -0700 (Mon, 17 Mar 2008) Log Message: ----------- identified the RNG Modified Paths: -------------- cpp-commons/trunk/src/commons/rand.h Modified: cpp-commons/trunk/src/commons/rand.h =================================================================== --- cpp-commons/trunk/src/commons/rand.h 2008-03-17 15:50:09 UTC (rev 631) +++ cpp-commons/trunk/src/commons/rand.h 2008-03-17 18:10:15 UTC (rev 632) @@ -4,7 +4,10 @@ namespace commons { /** - * TODO: Identify and rename this RNG. + * Linear congruence generator. This is actually an example rand() provided + * in the POSIX specification. + * + * TODO: rename this class */ class posix_rand { private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-17 15:50:17
|
Revision: 631 http://assorted.svn.sourceforge.net/assorted/?rev=631&view=rev Author: yangzhang Date: 2008-03-17 08:50:09 -0700 (Mon, 17 Mar 2008) Log Message: ----------- tweak Modified Paths: -------------- numa-bench/trunk/tools/plot-hist.bash Modified: numa-bench/trunk/tools/plot-hist.bash =================================================================== --- numa-bench/trunk/tools/plot-hist.bash 2008-03-17 15:49:56 UTC (rev 630) +++ numa-bench/trunk/tools/plot-hist.bash 2008-03-17 15:50:09 UTC (rev 631) @@ -1,4 +1,5 @@ #!/usr/bin/env bash set -o errexit -o nounset make -s +mkdir -p graphs egrep '^[[:digit:]]+: [[:digit:]]+|config' "$@" | out/plot-hist This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-17 15:49:52
|
Revision: 630 http://assorted.svn.sourceforge.net/assorted/?rev=630&view=rev Author: yangzhang Date: 2008-03-17 08:49:56 -0700 (Mon, 17 Mar 2008) Log Message: ----------- added indifference to memory size (for grouping graphs on scaling) Modified Paths: -------------- numa-bench/trunk/tools/PlotHist.scala Modified: numa-bench/trunk/tools/PlotHist.scala =================================================================== --- numa-bench/trunk/tools/PlotHist.scala 2008-03-16 22:07:36 UTC (rev 629) +++ numa-bench/trunk/tools/PlotHist.scala 2008-03-17 15:49:56 UTC (rev 630) @@ -51,7 +51,7 @@ val scaling: MultiMap[ConfigDescrip, (NumWorkers, Throughput)] = multimap( for ((config, points) <- graphs) yield { val attrmap = Map(pairs(config split " "): _*) - val Seq(_, nworkers, rest) = config split (" ", 3) + val Seq(_, nworkers, _, size, rest) = config split (" ", 5) val maxTime = Iterable.max(points map (_._2)) val tput = nworkers.toDouble * attrmap("opcount").toDouble / (maxTime / 1000.0) (rest, (nworkers.toInt, tput)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-16 22:07:35
|
Revision: 629 http://assorted.svn.sourceforge.net/assorted/?rev=629&view=rev Author: yangzhang Date: 2008-03-16 15:07:36 -0700 (Sun, 16 Mar 2008) Log Message: ----------- added bullets.hs Modified Paths: -------------- shell-tools/trunk/README Added Paths: ----------- shell-tools/trunk/src/bullets.hs Modified: shell-tools/trunk/README =================================================================== --- shell-tools/trunk/README 2008-03-16 21:53:15 UTC (rev 628) +++ shell-tools/trunk/README 2008-03-16 22:07:36 UTC (rev 629) @@ -45,6 +45,9 @@ -------------- ----------------------------------------------- --------------- `ascii-colors` Demo terminal color escape sequences. bash +`bullets` Converts Markdown-style bulleted lists to Some Haskell + MediaWiki-style bulleted lists. implementation + `cleanup` Remove intermediate build files and other gunk Some Haskell from a directory tree. implementation, [HSH] Added: shell-tools/trunk/src/bullets.hs =================================================================== --- shell-tools/trunk/src/bullets.hs (rev 0) +++ shell-tools/trunk/src/bullets.hs 2008-03-16 22:07:36 UTC (rev 629) @@ -0,0 +1,18 @@ +#!/usr/bin/env runhaskell + +module Main where + +import Control.Arrow +import Data.List + +proc line = + let (indent, rest) = span (== ' ') line + nindent = 1 + (length indent `div` 2) + isBullet = "- " `isPrefixOf` rest + content = drop 2 rest + output = if isBullet + then replicate nindent '*' ++ " " ++ content + else line + in output + +main = interact $ lines >>> map proc >>> unlines Property changes on: shell-tools/trunk/src/bullets.hs ___________________________________________________________________ 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-03-16 21:53:15
|
Revision: 628 http://assorted.svn.sourceforge.net/assorted/?rev=628&view=rev Author: yangzhang Date: 2008-03-16 14:53:15 -0700 (Sun, 16 Mar 2008) Log Message: ----------- disabled a problematic hotkey Modified Paths: -------------- configs/trunk/src/emacs/yang.el Modified: configs/trunk/src/emacs/yang.el =================================================================== --- configs/trunk/src/emacs/yang.el 2008-03-15 21:33:36 UTC (rev 627) +++ configs/trunk/src/emacs/yang.el 2008-03-16 21:53:15 UTC (rev 628) @@ -364,7 +364,7 @@ ;; key bindings {{{ -(global-set-key "C-xj" 'compile) +;;(global-set-key "C-xj" 'compile) ;; TODO PROBLEM (global-set-key [f5] 'goto-line) (global-set-key "\C-ha" 'apropos) (global-set-key (kbd "C-c j") 'join-lines) @@ -655,4 +655,4 @@ ;; use pretty fonts (if (>= emacs-major-version 23) - (set-default-font "Bitstream Vera Sans Mono-10")) \ No newline at end of file + (set-default-font "Bitstream Vera Sans Mono-10")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |