assorted-commits Mailing List for Assorted projects (Page 35)
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-11-04 00:56:20
|
Revision: 1052 http://assorted.svn.sourceforge.net/assorted/?rev=1052&view=rev Author: yangzhang Date: 2008-11-04 00:55:45 +0000 (Tue, 04 Nov 2008) Log Message: ----------- added more people to my buddy list Modified Paths: -------------- configs/trunk/src/zephyr/anyone Modified: configs/trunk/src/zephyr/anyone =================================================================== --- configs/trunk/src/zephyr/anyone 2008-11-03 17:44:13 UTC (rev 1051) +++ configs/trunk/src/zephyr/anyone 2008-11-04 00:55:45 UTC (rev 1052) @@ -1,5 +1,13 @@ +austinh +chihyu +csauper dheera emkim +egrimson +guttag +irenefan kchen pawan +price +welg y_z This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-03 19:25:23
|
Revision: 1051 http://assorted.svn.sourceforge.net/assorted/?rev=1051&view=rev Author: yangzhang Date: 2008-11-03 17:44:13 +0000 (Mon, 03 Nov 2008) Log Message: ----------- added demo of wx raise quirk Added Paths: ----------- sandbox/trunk/src/py/wxraise.py Added: sandbox/trunk/src/py/wxraise.py =================================================================== --- sandbox/trunk/src/py/wxraise.py (rev 0) +++ sandbox/trunk/src/py/wxraise.py 2008-11-03 17:44:13 UTC (rev 1051) @@ -0,0 +1,27 @@ +# Demo of some quirky behavior in wx: sometimes newly created-and-shown windows +# do not get focus, despite the documentation saying: +# +# "You may need to call Raise for a top level window if you want to bring it to +# top, although this is not needed if Show is called immediately after the +# frame creation." +# +# <http://wxpython.org/docs/api/wx.Window-class.html#Show> + +import wx + +def h(e): + global f + f.Destroy() + f = wx.Frame(None) + f.Show() + f.Raise() + f.SetFocus() + f.Bind(wx.EVT_CLOSE, h) + +app = wx.App() +f = wx.Frame(None) +f.Show() +f.Raise() +f.SetFocus() +f.Bind(wx.EVT_CLOSE, h) +app.MainLoop() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-02 19:02:56
|
Revision: 1050 http://assorted.svn.sourceforge.net/assorted/?rev=1050&view=rev Author: yangzhang Date: 2008-11-02 19:02:52 +0000 (Sun, 02 Nov 2008) Log Message: ----------- added a simple demo of using wx Added Paths: ----------- sandbox/trunk/src/py/wxtest.py Added: sandbox/trunk/src/py/wxtest.py =================================================================== --- sandbox/trunk/src/py/wxtest.py (rev 0) +++ sandbox/trunk/src/py/wxtest.py 2008-11-02 19:02:52 UTC (rev 1050) @@ -0,0 +1,95 @@ +import wx + +class ModeFrame(wx.Frame): + def __init__(self): + wx.Frame.__init__(self, parent = None, title = '6.00 Word Game') + buttons = {wx.Button(self, label = '&Solo Game'): self.OnSolo, + wx.Button(self, label = 'Vs. &Computer'): self.OnVsComp, + wx.Button(self, label = 'Vs. &Human'): self.OnVsHuman} + hbox = wx.BoxSizer(wx.HORIZONTAL) + for button, handler in buttons.iteritems(): + button.Bind(wx.EVT_BUTTON, handler) + hbox.Add(button, 1, wx.EXPAND | wx.ALL) + self.SetSizer(hbox) + self.Center() + def OnSolo(self, event): + frame = PlayFrame('solo') + frame.Show() + def OnVsComp(self, event): + frame = PlayFrame('vs comp') + frame.Show() + def OnVsHuman(self, event): + frame = PlayFrame('vs human') + frame.Show() + +class InteractionPanel(wx.Panel): + def __init__(self, parent): + wx.Panel.__init__(self, parent, style = wx.BORDER_SUNKEN) + # play panel + playPanel = wx.Panel(self) + try: + # entry panel + entryPanel = wx.Panel(playPanel) + submitButton = wx.Button(entryPanel, label = 'Enter!') + submitButton.SetDefault() + self.inputBox = wx.TextCtrl(entryPanel) + inputBoxLabel = wx.StaticText(entryPanel, label = '&Enter word:') + # TODO wire focusing on inputBoxLabel to focusing on inputBox + hbox = wx.BoxSizer(wx.HORIZONTAL) + hbox.Add(inputBoxLabel, 0, wx.ALIGN_CENTER_VERTICAL) + hbox.Add(self.inputBox, 1, wx.EXPAND) + hbox.Add(submitButton, 0, wx.EXPAND) + submitButton.Bind(wx.EVT_BUTTON, self.OnEnter) + entryPanel.SetSizer(hbox) + except: pass + historyLabel = wx.StaticText(playPanel, label = 'Previously entered words:') + self.history = wx.ListBox(playPanel) + vbox = wx.BoxSizer(wx.VERTICAL) + vbox.Add(historyLabel, 0, wx.EXPAND) + vbox.Add(self.history, 1, wx.EXPAND) + vbox.Add(entryPanel, 0, wx.EXPAND) + playPanel.SetSizer(vbox) + # rest + sizer = wx.FlexGridSizer(rows = 2, cols = 3) + empty = lambda: wx.StaticText(self, label = '') + self.stats = [None,None] + self.stats[0] = wx.StaticText(self, label = 'Player 1', style = wx.ALIGN_CENTER, size = (100, -1)) + self.stats[1] = wx.StaticText(self, label = 'Player 2', style = wx.ALIGN_CENTER, size = (100, -1)) + cells = [ self.stats[0], empty(), self.stats[1], empty(), playPanel, empty() ] + sizer.AddGrowableRow(1) + sizer.AddGrowableCol(1) + sizer.AddMany( [ (cell, 1, wx.EXPAND) for cell in cells ] ) + self.SetSizer(sizer) + def OnEnter(self, event): + is_valid_word = lambda *args: True + self.hand = None + word = self.inputBox.GetValue() + if is_valid_word(word, self.hand): + self.history.Insert(word, 0) + self.stats[0].SetLabel('Player 1\n\nScore: 5') + self.GetGrandParent().statusBar.SetStatusText('yay!') + else: + self.GetGrandParent().statusBar.SetStatusText('nay.') + self.inputBox.Clear() + +class PlayFrame(wx.Frame): + def __init__(self, mode): + wx.Frame.__init__(self, parent = None, title = '6.00 Word Game') + masterPanel = wx.Panel(self) + interactionPanel= InteractionPanel(masterPanel) + self.statusBar = wx.StatusBar(masterPanel) + self.statusBar.SetStatusText('This is the status bar.') + vbox = wx.BoxSizer(wx.VERTICAL) + vbox.Add(interactionPanel, 1, wx.EXPAND | wx.ALL, 5) + vbox.Add(self.statusBar, 0, wx.EXPAND | wx.ALL, 5) + masterPanel.SetSizer(vbox) + self.SetMinSize((450, 200)) + self.Center() + +if __name__ == '__main__': + app = wx.App() + frame = ModeFrame() + frame.Show() + app.MainLoop() + +# vim:et:sw=4:ts=4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-02 04:02:31
|
Revision: 1049 http://assorted.svn.sourceforge.net/assorted/?rev=1049&view=rev Author: yangzhang Date: 2008-11-02 04:02:29 +0000 (Sun, 02 Nov 2008) Log Message: ----------- oops, revealed previous secret key Modified Paths: -------------- facebook-tools/trunk/src/fb.py facebook-tools/trunk/src/update-facebook-friends-api.py Modified: facebook-tools/trunk/src/fb.py =================================================================== --- facebook-tools/trunk/src/fb.py 2008-11-02 03:01:52 UTC (rev 1048) +++ facebook-tools/trunk/src/fb.py 2008-11-02 04:02:29 UTC (rev 1049) @@ -8,12 +8,16 @@ parameter. """ +from __future__ import with_statement +import os from facebook import * from commons.startup import run_main def fb_session(): 'Create/authenticate a FB session.' - fb = Facebook('f5a7a02ea0cfd954bf8fb5504ffbf49a', '2a57c669977f9e813b8fd9496f6d3746') + with file(os.path.expanduser('~/.fb.auth')) as f: + apikey, seckey = f.read().strip().split('\n') + fb = Facebook(apikey, seckey) fb.auth.createToken() fb.login() raw_input('press enter to cont...') Modified: facebook-tools/trunk/src/update-facebook-friends-api.py =================================================================== --- facebook-tools/trunk/src/update-facebook-friends-api.py 2008-11-02 03:01:52 UTC (rev 1048) +++ facebook-tools/trunk/src/update-facebook-friends-api.py 2008-11-02 04:02:29 UTC (rev 1049) @@ -4,6 +4,7 @@ # IF PYTHON 2.5 #from __future__ import with_statement # END IF +import os import syck import facebook as fb import itertools @@ -47,8 +48,8 @@ new_dict.update( old_waiting_dict ) # Initialize FB API - api_key = 'f5a7a02ea0cfd954bf8fb5504ffbf49a' - sec_key = '2a57c669977f9e813b8fd9496f6d3746' + with file( os.path.expanduser( '~/.fb.auth' ) ) as f: + api_key, sec_key = f.read().strip().split('\n') facebook = fb.Facebook( api_key, sec_key ) facebook.auth_createToken() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-02 03:01:54
|
Revision: 1048 http://assorted.svn.sourceforge.net/assorted/?rev=1048&view=rev Author: yangzhang Date: 2008-11-02 03:01:52 +0000 (Sun, 02 Nov 2008) Log Message: ----------- added more docs Modified Paths: -------------- facebook-tools/trunk/src/fb.py Modified: facebook-tools/trunk/src/fb.py =================================================================== --- facebook-tools/trunk/src/fb.py 2008-11-02 03:00:39 UTC (rev 1047) +++ facebook-tools/trunk/src/fb.py 2008-11-02 03:01:52 UTC (rev 1048) @@ -1,7 +1,11 @@ #!/usr/bin/env python """ -General-purpose utility for working with Facebook from a Python shell. +General-purpose utility for working with Facebook from a Python shell. Just +import this and use fb_session(). + +This also has a main function that exec's the first (single) command line +parameter. """ from facebook import * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-02 03:00:47
|
Revision: 1047 http://assorted.svn.sourceforge.net/assorted/?rev=1047&view=rev Author: yangzhang Date: 2008-11-02 03:00:39 +0000 (Sun, 02 Nov 2008) Log Message: ----------- added fb.py Added Paths: ----------- facebook-tools/trunk/src/fb.py Added: facebook-tools/trunk/src/fb.py =================================================================== --- facebook-tools/trunk/src/fb.py (rev 0) +++ facebook-tools/trunk/src/fb.py 2008-11-02 03:00:39 UTC (rev 1047) @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +""" +General-purpose utility for working with Facebook from a Python shell. +""" + +from facebook import * +from commons.startup import run_main + +def fb_session(): + 'Create/authenticate a FB session.' + fb = Facebook('f5a7a02ea0cfd954bf8fb5504ffbf49a', '2a57c669977f9e813b8fd9496f6d3746') + fb.auth.createToken() + fb.login() + raw_input('press enter to cont...') + fb.auth.getSession() + return fb + +def main(argv): + fb = fb_session() + exec argv[1] + +run_main() Property changes on: facebook-tools/trunk/src/fb.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-01 21:41:39
|
Revision: 1046 http://assorted.svn.sourceforge.net/assorted/?rev=1046&view=rev Author: yangzhang Date: 2008-11-01 21:37:51 +0000 (Sat, 01 Nov 2008) Log Message: ----------- updated string literal regex demo Modified Paths: -------------- sandbox/trunk/src/py/string_literal_regex.py Modified: sandbox/trunk/src/py/string_literal_regex.py =================================================================== --- sandbox/trunk/src/py/string_literal_regex.py 2008-11-01 19:37:03 UTC (rev 1045) +++ sandbox/trunk/src/py/string_literal_regex.py 2008-11-01 21:37:51 UTC (rev 1046) @@ -3,4 +3,4 @@ pat = r'"((?:[^"\\]|\\.)*)"|((?:[^\\\s]|\\.)+)(?:\s+|\s*$)' for m in finditer(pat, target): [x] = [x for x in m.groups() if x is not None] - print sub(r'\\(.)', r'\1', x.strip('"')) + print sub(r'\\(.)', r'\1', x) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-11-01 19:37:18
|
Revision: 1045 http://assorted.svn.sourceforge.net/assorted/?rev=1045&view=rev Author: yangzhang Date: 2008-11-01 19:37:03 +0000 (Sat, 01 Nov 2008) Log Message: ----------- added demo of parsing string literals Added Paths: ----------- sandbox/trunk/src/py/string_literal_regex.py Added: sandbox/trunk/src/py/string_literal_regex.py =================================================================== --- sandbox/trunk/src/py/string_literal_regex.py (rev 0) +++ sandbox/trunk/src/py/string_literal_regex.py 2008-11-01 19:37:03 UTC (rev 1045) @@ -0,0 +1,6 @@ +from re import * +target = r'abc "def \"happy\" ghi" jkl "mno\\ pqr\\"' +pat = r'"((?:[^"\\]|\\.)*)"|((?:[^\\\s]|\\.)+)(?:\s+|\s*$)' +for m in finditer(pat, target): + [x] = [x for x in m.groups() if x is not None] + print sub(r'\\(.)', r'\1', x.strip('"')) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-29 16:49:59
|
Revision: 1044 http://assorted.svn.sourceforge.net/assorted/?rev=1044&view=rev Author: yangzhang Date: 2008-10-29 16:49:51 +0000 (Wed, 29 Oct 2008) Log Message: ----------- added gitconfig Modified Paths: -------------- configs/trunk/setup-yang.bash Modified: configs/trunk/setup-yang.bash =================================================================== --- configs/trunk/setup-yang.bash 2008-10-29 16:49:46 UTC (rev 1043) +++ configs/trunk/setup-yang.bash 2008-10-29 16:49:51 UTC (rev 1044) @@ -17,6 +17,7 @@ install .darcs/ darcs/boring install .devscripts devscripts install .inputrc inputrc +install .gitconfig gitconfig install .owl/ owl/startup install .pythonrc.py pythonrc.py install .screenrc screenrc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-29 16:49:57
|
Revision: 1043 http://assorted.svn.sourceforge.net/assorted/?rev=1043&view=rev Author: yangzhang Date: 2008-10-29 16:49:46 +0000 (Wed, 29 Oct 2008) Log Message: ----------- added gitconfig Added Paths: ----------- configs/trunk/src/gitconfig Added: configs/trunk/src/gitconfig =================================================================== --- configs/trunk/src/gitconfig (rev 0) +++ configs/trunk/src/gitconfig 2008-10-29 16:49:46 UTC (rev 1043) @@ -0,0 +1,7 @@ +[alias] + b = branch + ci = commit -a + co = checkout + h = help + llog = log --date=local + st = status This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-27 20:57:58
|
Revision: 1042 http://assorted.svn.sourceforge.net/assorted/?rev=1042&view=rev Author: yangzhang Date: 2008-10-27 20:57:43 +0000 (Mon, 27 Oct 2008) Log Message: ----------- added mutable key demo Added Paths: ----------- sandbox/trunk/src/py/mutable_keys.py Added: sandbox/trunk/src/py/mutable_keys.py =================================================================== --- sandbox/trunk/src/py/mutable_keys.py (rev 0) +++ sandbox/trunk/src/py/mutable_keys.py 2008-10-27 20:57:43 UTC (rev 1042) @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +# You *can* use mutable types as keys. + +class c(object): + def __hash__(self): return self.x + +x=c() +x.x = 0 +print {x: 0} +x.x = 1 Property changes on: sandbox/trunk/src/py/mutable_keys.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-27 20:20:34
|
Revision: 1041 http://assorted.svn.sourceforge.net/assorted/?rev=1041&view=rev Author: yangzhang Date: 2008-10-27 20:20:21 +0000 (Mon, 27 Oct 2008) Log Message: ----------- extended the global modules demo Modified Paths: -------------- sandbox/trunk/src/py/module-globals/globs.py sandbox/trunk/src/py/module-globals/main.py Modified: sandbox/trunk/src/py/module-globals/globs.py =================================================================== --- sandbox/trunk/src/py/module-globals/globs.py 2008-10-27 07:19:30 UTC (rev 1040) +++ sandbox/trunk/src/py/module-globals/globs.py 2008-10-27 20:20:21 UTC (rev 1041) @@ -1,3 +1,5 @@ def foo(): global x x = 'hello' + +v = raw_input() Modified: sandbox/trunk/src/py/module-globals/main.py =================================================================== --- sandbox/trunk/src/py/module-globals/main.py 2008-10-27 07:19:30 UTC (rev 1040) +++ sandbox/trunk/src/py/module-globals/main.py 2008-10-27 20:20:21 UTC (rev 1041) @@ -3,7 +3,14 @@ # Demonstrates that an imported module cannot affect the globals seen by the # outer (importing) modules. +# Also demonstrates that you can change things like sys.stdin out from under +# another module before importing, so that even their in-line code is affected. +from cStringIO import StringIO +import sys +sys.stdin = StringIO('abc') from globs import * +import globs +assert v == 'abc' def bar(): global x @@ -11,13 +18,14 @@ def main(): global x + x = 0 - # This doesn't work: - # foo() - # print x + foo() # affects only globs' x + print x # prints 0, not 'hello' + print globs.x # prints 'hello' - # Only this works: - bar() - print x + bar() # affects this module's x + print x # prints 3 + print globs.x # prints 'hello' main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-27 07:19:37
|
Revision: 1040 http://assorted.svn.sourceforge.net/assorted/?rev=1040&view=rev Author: yangzhang Date: 2008-10-27 07:19:30 +0000 (Mon, 27 Oct 2008) Log Message: ----------- added readme Added Paths: ----------- sandbox/trunk/src/one-off-scripts/pronunciation-trainer/README Added: sandbox/trunk/src/one-off-scripts/pronunciation-trainer/README =================================================================== --- sandbox/trunk/src/one-off-scripts/pronunciation-trainer/README (rev 0) +++ sandbox/trunk/src/one-off-scripts/pronunciation-trainer/README 2008-10-27 07:19:30 UTC (rev 1040) @@ -0,0 +1,5 @@ +This was originally designed to be a tool for selectively revealing pinyin for +certain chars, but this turned out to mostly exist in +<http://de.mdbg.net/chindict/chindict.php?page=annotate>. I can still provide +features like history, though (so you get scored based on how well you remember +previously revealed things). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-26 23:50:17
|
Revision: 1039 http://assorted.svn.sourceforge.net/assorted/?rev=1039&view=rev Author: yangzhang Date: 2008-10-26 23:50:08 +0000 (Sun, 26 Oct 2008) Log Message: ----------- added pronunciation trainer Added Paths: ----------- sandbox/trunk/src/one-off-scripts/pronunciation-trainer/ sandbox/trunk/src/one-off-scripts/pronunciation-trainer/test.cgi Added: sandbox/trunk/src/one-off-scripts/pronunciation-trainer/test.cgi =================================================================== --- sandbox/trunk/src/one-off-scripts/pronunciation-trainer/test.cgi (rev 0) +++ sandbox/trunk/src/one-off-scripts/pronunciation-trainer/test.cgi 2008-10-26 23:50:08 UTC (rev 1039) @@ -0,0 +1,63 @@ +#!/usr/bin/env /mit/y_z/.local/armed/bin/mit-mako-render +Content-type: text/html; charset=UTF-8 +<% +import cgitb +cgitb.enable() +import cgi, codecs, re +from cPickle import load, dump +from commons.strs import unicode2html as uh, quotejs as js, html2unicode + +form = cgi.FieldStorage() + +if 'src' in form: + try: + f = file('cedict.pickle', 'rb') + try: simp2info = load(f) + finally: f.close() + except: + f = codecs.open('cedict.txt', 'r', 'utf-8') + try: + simp2info = {} + for line in f: + m = re.match( ur'(?P<simp>[^ ]+) ' + ur'(?P<trad>[^ ]+) ' + ur'\[(?P<pinyin>[^\]]+)\] ' + ur'\/(?P<english>.+)\/( *#.*)?', line ) + if m: + simp, trad, pinyin, english = \ + map( m.group, 'simp trad pinyin english'.split() ) + simp2info[simp] = (pinyin, english) + dump( simp2info, file('cedict.pickle', 'wb'), 2 ) + finally: + f.close() + + src = form['src'].value.decode('utf-8') # html2unicode(form['src'].value) + dst = u''.join( simp2info.get(c, u'__')[0] for c in src ) +else: + src = u'' + dst = u'' +%> + +<html> + ##<script> + ## var p = new Array(); + ## var e = new Array(); + ## % for simp, (pinyin, english) in simp2info.items(): + ## p['${simp|js}'] = '${pinyin|js}' + ## e['${simp|js}'] = '${english|js}' + ## % endfor + ##</script> + ##% for simp, (pinyin, english) in simp2info.items()[:1]: + ## <p> + ## simplified: ${simp|uh}<br/> + ## pinyin: ${pinyin|uh}<br/> + ## english: ${english|uh}<br/> + ## </p> + ##% endfor + <form method="post" enctype="multipart/form-data"> + <p><textarea name="src">${src|uh}</textarea></p> + <p><textarea name="dst">${dst|uh}</textarea></p> + <p><input name="submit" type="submit"/></p> + </form> +</html> +## vim:ft=mako This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-24 03:51:00
|
Revision: 1038 http://assorted.svn.sourceforge.net/assorted/?rev=1038&view=rev Author: yangzhang Date: 2008-10-24 03:50:41 +0000 (Fri, 24 Oct 2008) Log Message: ----------- fancier headers Modified Paths: -------------- personal-site/trunk/static/plain.css Modified: personal-site/trunk/static/plain.css =================================================================== --- personal-site/trunk/static/plain.css 2008-10-23 16:30:43 UTC (rev 1037) +++ personal-site/trunk/static/plain.css 2008-10-24 03:50:41 UTC (rev 1038) @@ -42,7 +42,8 @@ h1, h2, h3, h4, h5, h6, h1 a, h2 a { color: gray; /* #527bbd; */ font-weight: normal; - font-family: sans-serif; + font-family: arial; + text-transform: uppercase; margin-top: 1.2em; margin-bottom: 0.5em; line-height: 1.3; @@ -51,10 +52,12 @@ h1 { border-bottom: 2px solid silver; + letter-spacing: -3px; } h2 { border-bottom: 2px solid silver; padding-top: 0.5em; + letter-spacing: -2px; } div.sectionbody { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 16:30:52
|
Revision: 1037 http://assorted.svn.sourceforge.net/assorted/?rev=1037&view=rev Author: yangzhang Date: 2008-10-23 16:30:43 +0000 (Thu, 23 Oct 2008) Log Message: ----------- updated the readme with a changelog Modified Paths: -------------- wp-easy-filter/trunk/README Modified: wp-easy-filter/trunk/README =================================================================== --- wp-easy-filter/trunk/README 2008-10-23 15:43:05 UTC (rev 1036) +++ wp-easy-filter/trunk/README 2008-10-23 16:30:43 UTC (rev 1037) @@ -27,13 +27,24 @@ Drop `easyfilt.php` into your `wp-content/plugins/` directory, then activate the plugin from the admin interface. -Related Links -------------- +Links +----- The author of [PHP Markdown Extras] wrote an [informative blog post] describing problems he had getting his filter to work properly and co-exist with the other built-in filters. +Changes +------- + +version 0.2, 2008-10-23 + +- fixed debugging code + +version 0.1, 2008-10-22 + +- initial release + [WordPress]: http://www.wordpress.org/ [Pandoc]: http://johnmacfarlane.net/pandoc/ [PHP Markdown Extras]: http://michelf.com/projects/php-markdown/extra/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 16:22:07
|
Revision: 1034 http://assorted.svn.sourceforge.net/assorted/?rev=1034&view=rev Author: yangzhang Date: 2008-10-23 15:31:48 +0000 (Thu, 23 Oct 2008) Log Message: ----------- switched the publishing mechanism to use assorted.bash; tweaks Modified Paths: -------------- assorted-site/trunk/index.txt Added Paths: ----------- assorted-site/trunk/publish.bash Removed Paths: ------------- assorted-site/trunk/build.bash Deleted: assorted-site/trunk/build.bash =================================================================== --- assorted-site/trunk/build.bash 2008-10-23 15:31:26 UTC (rev 1033) +++ assorted-site/trunk/build.bash 2008-10-23 15:31:48 UTC (rev 1034) @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -# preliminaries -set -o errexit -cd "$( dirname "$0" )" -rm -r output 2> /dev/null || true -mkdir output -cd output -base="../../.." - -# main index -cp ../main.css . -pandoc -s -S --tab-stop=2 -c main.css -H ../header.html -A ../footer.html -o index.html ../index.txt - -# XXX fix rest later - -scp index.html main.css sf:assorted/htdocs/ -exit - -rewrite() { - cat << "EOF" -<IfModule mod_rewrite.c> -RewriteEngine On -RewriteBase / -#RewriteCond %{REQUEST_FILENAME} !-f -#RewriteCond %{REQUEST_FILENAME} !-d -EOF - cat - echo '</IfModule>' -} - -rule() { - echo "RewriteRule $@ [L]" >&3 -} - -{ - # python-commons - epydoc -o python-commons "$base/python-commons/trunk/src/commons/" || true - rule '^python-commons/download/?$ http://cheeseshop.python.org/packages/source/p/python-commons/python-commons-0.1.tar.gz' - - # facebook-tools - mkdir facebook-tools - man2html "$base/facebook-tools/trunk/doc/update-facebook-friends.1" > facebook-tools/index.html - rule '^facebook-tools/download/?$ http://assorted.svn.sourceforge.net/viewvc/*checkout*/assorted/facebook-tools/trunk/src/update-facebook-friends.bash' -} 3> >( rewrite > .htaccess ) - -# deploy -tar czf - . | -ssh shell-sf ' - cd assorted - rm -r htdocs-new 2> /dev/null || true - mkdir htdocs-new - tar xzmf - -C htdocs-new - shopt -s dotglob - rm -r htdocs/* - mv htdocs-new/* htdocs/ - rmdir htdocs-new -' Modified: assorted-site/trunk/index.txt =================================================================== --- assorted-site/trunk/index.txt 2008-10-23 15:31:26 UTC (rev 1033) +++ assorted-site/trunk/index.txt 2008-10-23 15:31:48 UTC (rev 1034) @@ -63,6 +63,9 @@ - [Google File Search](http://y_z.scripts.mit.edu/gfs/): a simple web frontend to Google Web Search for finding files in web directory listings (done) + - [WordPress EasyFilter](wp-easy-filter): a small, simple-to-setup plug-in + to allow you to use any custom command-line text filter on your WordPress + posts (done) - Configuration resources and desktop tools - [Vim syntax file for JavaFX](http://www.vim.org/scripts/script.php?script_id=1943) (done) Copied: assorted-site/trunk/publish.bash (from rev 1030, wp-easy-filter/trunk/publish.bash) =================================================================== --- assorted-site/trunk/publish.bash (rev 0) +++ assorted-site/trunk/publish.bash 2008-10-23 15:31:48 UTC (rev 1034) @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +fullname='Assorted Website' +version=0.1 +license=gpl3 +websrcs=( index.txt ) +webfiles=( main.css ) +rels=( src-tgz: ) +nodl=true +webdir=. +chmod=false +footer=footer.html +. assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 15:43:14
|
Revision: 1036 http://assorted.svn.sourceforge.net/assorted/?rev=1036&view=rev Author: yangzhang Date: 2008-10-23 15:43:05 +0000 (Thu, 23 Oct 2008) Log Message: ----------- fixed debugging, metadata Modified Paths: -------------- wp-easy-filter/trunk/src/easyfilt.php Modified: wp-easy-filter/trunk/src/easyfilt.php =================================================================== --- wp-easy-filter/trunk/src/easyfilt.php 2008-10-23 15:32:38 UTC (rev 1035) +++ wp-easy-filter/trunk/src/easyfilt.php 2008-10-23 15:43:05 UTC (rev 1036) @@ -3,7 +3,7 @@ Plugin Name: Easy Filter Plugin URI: http://assorted.sf.net/wp-easy-filter/ Description: Easy filtering of blog posts. -Version: 1.0 +Version: 0.2 Author: Yang Zhang Author URI: http://www.mit.edu/~y_z/ */ @@ -57,7 +57,7 @@ # function filter_custom($content) { - global $debug, $tag2cmd, $wp_filter, $descriptorspec; + global $debug, $debugfile, $tag2cmd, $wp_filter, $descriptorspec; $lines = explode("\n", $content); $tag = trim(substr($lines[0], 2)); if (substr($lines[0], 0, 2) === '#!' && $tag2cmd[$tag]) { @@ -72,6 +72,9 @@ $filtered = stream_get_contents($pipes[1]); fclose($pipes[1]); + $stderr = stream_get_contents($pipes[2]); + fclose($pipes[2]); + $retval = proc_close($process); } } else { @@ -80,10 +83,16 @@ } if ($debug) { $f = fopen($debugfile, 'w'); - fwrite($f, print_r($wp_filter, true)); - fwrite($f, print_r($lines, true)); - fwrite($f, substr($lines[0], 0, 2) . " " . (substr($lines[0], 0, 2) === '#!') . " " . $cmd . " " . $tag2cmd[$cmd]); - fwrite($f, "\n===\n$content\n===\n$filtered"); + fwrite($f, "\nwp_filter = " . print_r($wp_filter, true)); + fwrite($f, "\nlines = " . print_r($lines, true)); + fwrite($f, "\nlines[0][0:2] = " . substr($lines[0], 0, 2)); + fwrite($f, "\nlines[0][0:2] === '#!' = " . (substr($lines[0], 0, 2) === '#!')); + fwrite($f, "\ntag = " . $tag); + fwrite($f, "\ncmd = " . $cmd); + fwrite($f, "\nretval = " . $retval); + fwrite($f, "\n\n\ncontent =\n$content"); + fwrite($f, "\n\n\nfiltered =\n$filtered"); + fwrite($f, "\n\n\nstderr =\n$stderr"); fclose($f); } return $filtered; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 15:32:48
|
Revision: 1035 http://assorted.svn.sourceforge.net/assorted/?rev=1035&view=rev Author: yangzhang Date: 2008-10-23 15:32:38 +0000 (Thu, 23 Oct 2008) Log Message: ----------- added assorted sourceforge web profile Modified Paths: -------------- configs/trunk/src/ssh/config Modified: configs/trunk/src/ssh/config =================================================================== --- configs/trunk/src/ssh/config 2008-10-23 15:31:48 UTC (rev 1034) +++ configs/trunk/src/ssh/config 2008-10-23 15:32:38 UTC (rev 1035) @@ -93,9 +93,9 @@ HostName pubmgr.cvs.sourceforge.net User yangzhang -Host sf - HostName shell.sourceforge.net - User yangzhang +Host assorted + HostName web.sourceforge.net + User yangzhang,assorted Host db HostName db.csail.mit.edu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 15:31:32
|
Revision: 1033 http://assorted.svn.sourceforge.net/assorted/?rev=1033&view=rev Author: yangzhang Date: 2008-10-23 15:31:26 +0000 (Thu, 23 Oct 2008) Log Message: ----------- updated assorted.bash to accommodate assorted-site Modified Paths: -------------- shell-tools/trunk/src/bash-commons/assorted.bash Modified: shell-tools/trunk/src/bash-commons/assorted.bash =================================================================== --- shell-tools/trunk/src/bash-commons/assorted.bash 2008-10-23 03:17:18 UTC (rev 1032) +++ shell-tools/trunk/src/bash-commons/assorted.bash 2008-10-23 15:31:26 UTC (rev 1033) @@ -22,10 +22,11 @@ project="$( basename "$( realpath "$projdir/.." )" )" root_site_dir="$( parent-dir named assorted )/assorted-site/trunk" || die 'could not find project root dir' -: ${clean:=false} ${nodl:=false} ${webfiles:=} +: ${clean:=false} ${nodl:=false} ${webfiles:=} ${chmod:=true} +footer="$root_site_dir/${footer:-google-footer.html}" prof=sf -base_web_dir=assorted/htdocs -webdir=$base_web_dir/$project +mountpt=/tmp/assorted +webdir=$mountpt/htdocs/${webdir:-$project} stagedir="$( mktemp -d )" package=$project-$version @@ -195,7 +196,7 @@ pandoc -s -S --tab-stop=2 \ -c http://assorted.sf.net/main.css \ -H "$root_site_dir/header.html" \ - -A "$root_site_dir/google-footer.html" \ + -A "$footer" \ -o "$stagedir/$out" "$src" done fi @@ -208,16 +209,24 @@ publish() { stage - scp -o Compression=on -o CompressionLevel=9 "$stagedir" - tar czf - -C "$stagedir" . | - ssh $prof " - set -o errexit -o nounset - if $clean ; then rm -r $webdir ; fi - mkdir -p $webdir - cd $webdir - tar xzmf - - chmod -R +rX . - " + # Mount sshfs if the not already mounted. + if ! mount | fgrep assorted: | fgrep "$mountpt" > /dev/null + then sshfs assorted: "$mountpt" + fi + + # Wipe out/start from scratch? + if $clean + then rm -r "$webdir" + fi + + # Copy the files over. + mkdir -p "$webdir" + cp -r "$stagedir"/* "$webdir" + + # Make the published directories world-readable. + if $chmod + then chmod -R +rX "$webdir" + fi } exp() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 03:17:24
|
Revision: 1032 http://assorted.svn.sourceforge.net/assorted/?rev=1032&view=rev Author: yangzhang Date: 2008-10-23 03:17:18 +0000 (Thu, 23 Oct 2008) Log Message: ----------- tagged 0.1 release Added Paths: ----------- wp-easy-filter/tags/ wp-easy-filter/tags/0.1/ wp-easy-filter/tags/0.1/README Removed Paths: ------------- wp-easy-filter/tags/0.1/README Deleted: wp-easy-filter/tags/0.1/README =================================================================== --- wp-easy-filter/trunk/README 2008-10-22 22:58:44 UTC (rev 1030) +++ wp-easy-filter/tags/0.1/README 2008-10-23 03:17:18 UTC (rev 1032) @@ -1,41 +0,0 @@ -Overview --------- - -This is a simple, general filter plug-in for WordPress. You specify a mapping -from tags to commands, such as: - - $tag2cmd = array('pandoc' => '/usr/bin/pandoc -s --tab-stop=2'); - -Then, for posts which are prefixed with a shebang line containing that tag, as in: - - #!pandoc - - Hello, world. - -Then the plug-in will feed the post contents to that command's stdin and return -the rendered output to WordPress for display. - -This plug-in was designed to allow me to start using [Pandoc] for writing my -blog posts. (I couldn't force myself to use the [PHP Markdown Extras] -plug-in.) - -It disables the `wpautop` filter, which automatically inserts `<p>` tags (among -other magic), because that filter cannot properly parse the style of HTML that -Pandoc outputs. - -Setup ------ - -Drop `easyfilt.php` into your `wp-content/plugins/` directory, then activate -the plug-in from the admin interface. - -Notes ------ - -The author of [PHP Markdown Extras] wrote an [informative blog post] describing -problems he had getting his filter to work properly and co-exist with the other -built-in filters. - -[Pandoc]: http://johnmacfarlane.net/pandoc/ -[PHP Markdown Extras]: http://michelf.com/projects/php-markdown/extra/ -[informative blog post]: http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/ Copied: wp-easy-filter/tags/0.1/README (from rev 1031, wp-easy-filter/trunk/README) =================================================================== --- wp-easy-filter/tags/0.1/README (rev 0) +++ wp-easy-filter/tags/0.1/README 2008-10-23 03:17:18 UTC (rev 1032) @@ -0,0 +1,40 @@ +Overview +-------- + +This is a simple, general filter plugin for [WordPress]. You specify a mapping +from tags to commands, such as: + + $tag2cmd = array('pandoc' => '/usr/bin/pandoc -s --tab-stop=2'); + +Then, for any posts which start with a shebang line containing that tag, as in: + + #!pandoc + Hello, world. + +the plugin will feed the post contents (minus the shebang line) to the mapped +command's stdin, and return the rendered output to WordPress for display. + +This plugin was designed to allow me to start using [Pandoc] for writing my +blog posts. (I couldn't force myself to use the [PHP Markdown Extras] plugin.) + +It disables the `wpautop` filter, which automatically inserts `<p>` tags (among +other magic), because that filter cannot properly parse the style of HTML that +Pandoc outputs. + +Setup +----- + +Drop `easyfilt.php` into your `wp-content/plugins/` directory, then activate +the plugin from the admin interface. + +Related Links +------------- + +The author of [PHP Markdown Extras] wrote an [informative blog post] describing +problems he had getting his filter to work properly and co-exist with the other +built-in filters. + +[WordPress]: http://www.wordpress.org/ +[Pandoc]: http://johnmacfarlane.net/pandoc/ +[PHP Markdown Extras]: http://michelf.com/projects/php-markdown/extra/ +[informative blog post]: http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-23 03:10:52
|
Revision: 1031 http://assorted.svn.sourceforge.net/assorted/?rev=1031&view=rev Author: yangzhang Date: 2008-10-23 03:10:48 +0000 (Thu, 23 Oct 2008) Log Message: ----------- updated the readme Modified Paths: -------------- wp-easy-filter/trunk/README Modified: wp-easy-filter/trunk/README =================================================================== --- wp-easy-filter/trunk/README 2008-10-22 22:58:44 UTC (rev 1030) +++ wp-easy-filter/trunk/README 2008-10-23 03:10:48 UTC (rev 1031) @@ -1,23 +1,21 @@ Overview -------- -This is a simple, general filter plug-in for WordPress. You specify a mapping +This is a simple, general filter plugin for [WordPress]. You specify a mapping from tags to commands, such as: $tag2cmd = array('pandoc' => '/usr/bin/pandoc -s --tab-stop=2'); -Then, for posts which are prefixed with a shebang line containing that tag, as in: +Then, for any posts which start with a shebang line containing that tag, as in: #!pandoc - Hello, world. -Then the plug-in will feed the post contents to that command's stdin and return -the rendered output to WordPress for display. +the plugin will feed the post contents (minus the shebang line) to the mapped +command's stdin, and return the rendered output to WordPress for display. -This plug-in was designed to allow me to start using [Pandoc] for writing my -blog posts. (I couldn't force myself to use the [PHP Markdown Extras] -plug-in.) +This plugin was designed to allow me to start using [Pandoc] for writing my +blog posts. (I couldn't force myself to use the [PHP Markdown Extras] plugin.) It disables the `wpautop` filter, which automatically inserts `<p>` tags (among other magic), because that filter cannot properly parse the style of HTML that @@ -27,15 +25,16 @@ ----- Drop `easyfilt.php` into your `wp-content/plugins/` directory, then activate -the plug-in from the admin interface. +the plugin from the admin interface. -Notes ------ +Related Links +------------- The author of [PHP Markdown Extras] wrote an [informative blog post] describing problems he had getting his filter to work properly and co-exist with the other built-in filters. +[WordPress]: http://www.wordpress.org/ [Pandoc]: http://johnmacfarlane.net/pandoc/ [PHP Markdown Extras]: http://michelf.com/projects/php-markdown/extra/ [informative blog post]: http://michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-22 22:58:47
|
Revision: 1030 http://assorted.svn.sourceforge.net/assorted/?rev=1030&view=rev Author: yangzhang Date: 2008-10-22 22:58:44 +0000 (Wed, 22 Oct 2008) Log Message: ----------- fixed name Modified Paths: -------------- wp-easy-filter/trunk/publish.bash Modified: wp-easy-filter/trunk/publish.bash =================================================================== --- wp-easy-filter/trunk/publish.bash 2008-10-22 22:54:21 UTC (rev 1029) +++ wp-easy-filter/trunk/publish.bash 2008-10-22 22:58:44 UTC (rev 1030) @@ -2,7 +2,7 @@ . common.bash || exit 1 -fullname='WordPress Easy Filter' +fullname='WordPress EasyFilter' version=0.1 license=gpl3 websrcs=( README ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-22 22:54:23
|
Revision: 1029 http://assorted.svn.sourceforge.net/assorted/?rev=1029&view=rev Author: yangzhang Date: 2008-10-22 22:54:21 +0000 (Wed, 22 Oct 2008) Log Message: ----------- added mit-pandoc Added Paths: ----------- mit-tools/trunk/src/mit-pandoc.bash Added: mit-tools/trunk/src/mit-pandoc.bash =================================================================== --- mit-tools/trunk/src/mit-pandoc.bash (rev 0) +++ mit-tools/trunk/src/mit-pandoc.bash 2008-10-22 22:54:21 UTC (rev 1029) @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export PATH=/mit/y_z/.local/armed/bin:$PATH +export LD_LIBRARY_PATH=/mit/y_z/.local/armed/lib:$LD_LIBRARY_PATH +exec pandoc "$@" Property changes on: mit-tools/trunk/src/mit-pandoc.bash ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-10-22 22:53:25
|
Revision: 1028 http://assorted.svn.sourceforge.net/assorted/?rev=1028&view=rev Author: yangzhang Date: 2008-10-22 22:53:22 +0000 (Wed, 22 Oct 2008) Log Message: ----------- added publisher Added Paths: ----------- wp-easy-filter/trunk/publish.bash Copied: wp-easy-filter/trunk/publish.bash (from rev 1023, scala-commons/trunk/publish.bash) =================================================================== --- wp-easy-filter/trunk/publish.bash (rev 0) +++ wp-easy-filter/trunk/publish.bash 2008-10-22 22:53:22 UTC (rev 1028) @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +. common.bash || exit 1 + +fullname='WordPress Easy Filter' +version=0.1 +license=gpl3 +websrcs=( README ) +rels=( src-tgz: ) +. assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |