assorted-commits Mailing List for Assorted projects (Page 46)
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-05-09 07:40:19
|
Revision: 777 http://assorted.svn.sourceforge.net/assorted/?rev=777&view=rev Author: yangzhang Date: 2008-05-09 00:40:25 -0700 (Fri, 09 May 2008) Log Message: ----------- added publisher Added Paths: ----------- battlecode-2007-little/trunk/publish.bash Copied: battlecode-2007-little/trunk/publish.bash (from rev 761, java-reactor/trunk/publish.bash) =================================================================== --- battlecode-2007-little/trunk/publish.bash (rev 0) +++ battlecode-2007-little/trunk/publish.bash 2008-05-09 07:40:25 UTC (rev 777) @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +fullname='BattleCode 2007 Team Little' +version=1.0 +license=gpl3 +websrcs=( README ) +rels=( src-tgz: ) +nodl=true +. assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:37:41
|
Revision: 776 http://assorted.svn.sourceforge.net/assorted/?rev=776&view=rev Author: yangzhang Date: 2008-05-09 00:37:44 -0700 (Fri, 09 May 2008) Log Message: ----------- added a readme Added Paths: ----------- battlecode-2007-little/trunk/README Added: battlecode-2007-little/trunk/README =================================================================== --- battlecode-2007-little/trunk/README (rev 0) +++ battlecode-2007-little/trunk/README 2008-05-09 07:37:44 UTC (rev 776) @@ -0,0 +1,29 @@ +Overview +-------- + +This is [Greg] and my jumbled heap of code produced for the BattleCode 2007 +programming competition at MIT. + +Our overall strategy can be described as follows: our four archons stuck +together and spawned a large cluster of scouts (and I believe soldiers, but for +the longest time we were convinced that four tanks were the way to go). +Whenever we encountered the enemy, we buckled down until we destroy their +units. + +One highlight of this code was definitely Greg's regular-expression encoding of +Dijkstra's algorithm, which allowed us to perform perfect path-finding but +without incurring tons of instructions (since calls to standard library +routines such as regular expression substitution had a low constant cost). For +this hack we won a Sony PSP. + +Another neat feature was our EMP-spawning strategy: whenever we saw an enemy +archon, one of our scouts (somewhere in the middle of our cluster) would evolve +into an EMP, which would then pursue the archon. The other scouts would +concentrate on defending (clearing a path) for this EMP by walling off and +attacking potential threats. + +Other than the above information, I'm afraid I can't recall much else about our +entry. I can't even remember which of the directories to point you to if you +wanted to see our final submitted player. ...Yeah. + +[Greg]: http://glittle.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:15:21
|
Revision: 775 http://assorted.svn.sourceforge.net/assorted/?rev=775&view=rev Author: yangzhang Date: 2008-05-09 00:15:27 -0700 (Fri, 09 May 2008) Log Message: ----------- updated proj statuses Modified Paths: -------------- assorted-site/trunk/index.txt Modified: assorted-site/trunk/index.txt =================================================================== --- assorted-site/trunk/index.txt 2008-05-09 07:12:22 UTC (rev 774) +++ assorted-site/trunk/index.txt 2008-05-09 07:15:27 UTC (rev 775) @@ -10,15 +10,15 @@ providing only a brief description and the development status. More information to come later. -- ZDB: object database with an emphasis on semantics (active) +- ZDB: object database with an emphasis on semantics (passive) - General-purpose libraries ("commons") for various languages or platforms - [Python Commons](python-commons) (passive) - - [Scala Commons](scala-commons) (active) + - [Scala Commons](scala-commons) (passive) - [Java Reactor](java-reactor): simple event loop for single-threaded asynchronous IO and task scheduling (done) - [C++ Commons](cpp-commons) (active) - - Haskell Commons (passive) - - TeX Commons (passive) + - Haskell Commons (hiatus) + - TeX Commons (hiatus) - [Shell Tools](shell-tools): programs written in a variety of languages and oriented toward shell scripting and system administration (passive) - [AFX](python-afx): extensions (e.g. threading support) for the AF @@ -36,7 +36,7 @@ - NanoHTTPD: a do-nothing web server skeleton (done) - Meta programming - [Simple-Build](simple-build): YAML-based meta-build system for generating - Makefiles; you do not want to use this (active) + Makefiles; you do not want to use this (passive) - [Object Code Generator](object-codegen): currently targets Java serialization, emphasizing compactness, speed, and simplicity (done) - TopCoder tools: crawl [TopCoder] rankings to analyze players; currently @@ -60,7 +60,7 @@ - [Vim syntax file for JavaFX](http://www.vim.org/scripts/script.php?script_id=1943) (done) - Software Configurations: dot files, rc files, bootstrapping, etc.; note - that this includes third-party code (active) + that this includes third-party code (passive) - Wallpaper Tools: tools for managing wallpapers as they are being rotated through (done) - [BattleCode] @@ -76,18 +76,18 @@ functions on supplied data (done) - PRNG distribution: for observing the distribution of PRNGs (hiatus) - [Parallel hash join](hash-join): for exploring the scalability of hash - joins on many-core systems (active) + joins on many-core systems (done) - [NUMA benchmark suite](numa-bench): tests for understanding the performance - behavior of NUMA systems (active) + behavior of NUMA systems (done) - Sandbox: heap of small test cases to explore (mostly programming language details, bugs, corner cases, features, etc.) (passive) - Miscellanea - [Mailing List Filter](mailing-list-filter): deal with high-volume mailing lists by filtering your mailbox for threads in which you were a participant - (active) + (done) - [Scala Doc Search](http://scripts.mit.edu/~y_z/sds/): navigate the Scala API documentation by class or object name (done) - - Bibliography: my pan-paper BibTeX; i.e., stalling for ZDB (active) + - Bibliography: my pan-paper BibTeX; i.e., stalling for ZDB (passive) - Subtitle adjuster: for time-shifting SRTs (done) - Javascript Beautifier: a thin [Tamarin] wrapper for [js_beautify]. - Programming Problems: my workspace for solving programming puzzles This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:12:21
|
Revision: 774 http://assorted.svn.sourceforge.net/assorted/?rev=774&view=rev Author: yangzhang Date: 2008-05-09 00:12:22 -0700 (Fri, 09 May 2008) Log Message: ----------- added links to AFX, UDP Prober Modified Paths: -------------- assorted-site/trunk/index.txt Modified: assorted-site/trunk/index.txt =================================================================== --- assorted-site/trunk/index.txt 2008-05-09 07:10:30 UTC (rev 773) +++ assorted-site/trunk/index.txt 2008-05-09 07:12:22 UTC (rev 774) @@ -21,16 +21,16 @@ - TeX Commons (passive) - [Shell Tools](shell-tools): programs written in a variety of languages and oriented toward shell scripting and system administration (passive) - - AFX: extensions (e.g. threading support) for the AF asynchronous - programming framework (passive) + - [AFX](python-afx): extensions (e.g. threading support) for the AF + asynchronous programming framework (passive) - UI libraries - Scala TUI: a declarative reactive programming toolkit for constructing [ncurses]-based text user interfaces (hiatus) - JFX Table: an editable table (spreadsheet) widget in [JavaFX] (done) - LZXGrid: an editable table (spreadsheet) widget in [OpenLaszlo] (done) - System utilities - - UDP Prober: small program that logs the RTTs of periodic UDP pings, and an - exercise in using [`boost::asio`] (hiatus) + - [UDP Prober](udp-prober): small program that logs the RTTs of periodic UDP + pings, and an exercise in using [`boost::asio`] (hiatus) - Throttled Repeater: small program that sends a fixed number of lines at a time from a file to a server over TCP (done) - NanoHTTPD: a do-nothing web server skeleton (done) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:10:29
|
Revision: 773 http://assorted.svn.sourceforge.net/assorted/?rev=773&view=rev Author: yangzhang Date: 2008-05-09 00:10:30 -0700 (Fri, 09 May 2008) Log Message: ----------- released AFX 0.1 Added Paths: ----------- python-afx/tags/ python-afx/tags/0.1/ python-afx/tags/0.1/README python-afx/tags/0.1/publish.bash python-afx/tags/0.1/setup.py Removed Paths: ------------- python-afx/tags/0.1/README python-afx/tags/0.1/setup.py Copied: python-afx/tags/0.1 (from rev 761, python-afx/trunk) Deleted: python-afx/tags/0.1/README =================================================================== --- python-afx/trunk/README 2008-05-09 05:18:00 UTC (rev 761) +++ python-afx/tags/0.1/README 2008-05-09 07:10:30 UTC (rev 773) @@ -1,5 +0,0 @@ -To install, run setup.py or setup.bash. - -Future releases will come with scripts to build the epydoc API -documentation, but for now please refer to the project homepage for -the full documentation: http://assorted.sf.net/python-afx Copied: python-afx/tags/0.1/README (from rev 771, python-afx/trunk/README) =================================================================== --- python-afx/tags/0.1/README (rev 0) +++ python-afx/tags/0.1/README 2008-05-09 07:10:30 UTC (rev 773) @@ -0,0 +1,50 @@ +[documentation](doc) + +Overview +-------- + +AFX is a library that extends the AF asynchronous programming library. The +list of new features includes: + +- thread support: call-from-thread and call-in-thread (a la [Twisted]) +- fair queueing +- condition variables +- object-pickling socket streams +- atomic booleans +- queue control +- task pools +- traceback tools +- startup wrappers +- simple servers + +This extension was started while building [ICEDB]. + +Setup +----- + +Requirements: + +- AF (unreleased; contact [the author] for more information) +- [Python Commons] 0.2 + +[Python Commons]: http://assorted.sf.net/python-commons/ + +To install, run `setup.py` or `setup.bash`. + +Future Work +----------- + +- Substantial reorganization of the code. +- Code documentation. +- Test suite. + +Changes +------- + +version 0.1 + +- works, but very disorganized +- released for [ICEDB] + +[Twisted]: http://twistedmatrix.com/ +[ICEDB]: http://cartel.csail.mit.edu/icedb/ Copied: python-afx/tags/0.1/publish.bash (from rev 769, python-afx/trunk/publish.bash) =================================================================== --- python-afx/tags/0.1/publish.bash (rev 0) +++ python-afx/tags/0.1/publish.bash 2008-05-09 07:10:30 UTC (rev 773) @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +post-stage() { + epydoc -o $stagedir/doc src/afx/ +} + +fullname='AFX' +version=0.1 +license=psf +websrcs=( README ) +rels=( pypi: ) +. assorted.bash "$@" Deleted: python-afx/tags/0.1/setup.py =================================================================== --- python-afx/trunk/setup.py 2008-05-09 05:18:00 UTC (rev 761) +++ python-afx/tags/0.1/setup.py 2008-05-09 07:10:30 UTC (rev 773) @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- -# vim:ft=python:et:sw=4:ts=4 - -from commons import setup - -pkg_info_text = """ -Metadata-Version: 1.1 -Name: python-afx -Version: 0.1 -Author: Yang Zhang -Author-email: yaaang NOSPAM at REMOVECAPS gmail -Home-page: http://assorted.sourceforge.net/python-afx/ -Download-url: http://pypi.python.org/pypi/python-commons/ -Summary: Python AFX -License: Python Software Foundation License -Description: Utilities and extensions to the AF asynchronous IO library. -Keywords: Python,utility,utilities,library,libraries,async,asynchronous, - IO,networking,network,socket,sockets,I/O,threading,threads, - thread -Platform: any -Provides: commons -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: No Input/Output (Daemon) -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Python Software Foundation License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Topic :: Communications -Classifier: Topic :: Internet -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Topic :: System -Classifier: Topic :: System :: Networking -Classifier: Topic :: Utilities -""" - -setup.run_setup( pkg_info_text ) Copied: python-afx/tags/0.1/setup.py (from rev 772, python-afx/trunk/setup.py) =================================================================== --- python-afx/tags/0.1/setup.py (rev 0) +++ python-afx/tags/0.1/setup.py 2008-05-09 07:10:30 UTC (rev 773) @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*- +# vim:ft=python:et:sw=4:ts=4 + +from commons import setup + +pkg_info_text = """ +Metadata-Version: 1.1 +Name: python-afx +Version: 0.1 +Author: Yang Zhang +Author-email: yaaang NOSPAM at REMOVECAPS gmail +Home-page: http://assorted.sourceforge.net/python-afx/ +Download-url: http://pypi.python.org/pypi/python-commons/ +Summary: AFX +License: Python Software Foundation License +Description: Utilities and extensions to the AF asynchronous IO library. +Keywords: Python,utility,utilities,library,libraries,async,asynchronous, + IO,networking,network,socket,sockets,I/O,threading,threads, + thread +Platform: any +Provides: commons +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: No Input/Output (Daemon) +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Python Software Foundation License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Communications +Classifier: Topic :: Internet +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: System +Classifier: Topic :: System :: Networking +Classifier: Topic :: Utilities +""" + +setup.run_setup( pkg_info_text ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:09:12
|
Revision: 772 http://assorted.svn.sourceforge.net/assorted/?rev=772&view=rev Author: yangzhang Date: 2008-05-09 00:09:18 -0700 (Fri, 09 May 2008) Log Message: ----------- rename Modified Paths: -------------- python-afx/trunk/setup.py Modified: python-afx/trunk/setup.py =================================================================== --- python-afx/trunk/setup.py 2008-05-09 07:08:52 UTC (rev 771) +++ python-afx/trunk/setup.py 2008-05-09 07:09:18 UTC (rev 772) @@ -12,7 +12,7 @@ Author-email: yaaang NOSPAM at REMOVECAPS gmail Home-page: http://assorted.sourceforge.net/python-afx/ Download-url: http://pypi.python.org/pypi/python-commons/ -Summary: Python AFX +Summary: AFX License: Python Software Foundation License Description: Utilities and extensions to the AF asynchronous IO library. Keywords: Python,utility,utilities,library,libraries,async,asynchronous, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:08:46
|
Revision: 771 http://assorted.svn.sourceforge.net/assorted/?rev=771&view=rev Author: yangzhang Date: 2008-05-09 00:08:52 -0700 (Fri, 09 May 2008) Log Message: ----------- added change log Modified Paths: -------------- python-afx/trunk/README Modified: python-afx/trunk/README =================================================================== --- python-afx/trunk/README 2008-05-09 07:06:35 UTC (rev 770) +++ python-afx/trunk/README 2008-05-09 07:08:52 UTC (rev 771) @@ -19,9 +19,6 @@ This extension was started while building [ICEDB]. -[Twisted]: http://twistedmatrix.com/ -[ICEDB]: http://cartel.csail.mit.edu/icedb/ - Setup ----- @@ -40,3 +37,14 @@ - Substantial reorganization of the code. - Code documentation. - Test suite. + +Changes +------- + +version 0.1 + +- works, but very disorganized +- released for [ICEDB] + +[Twisted]: http://twistedmatrix.com/ +[ICEDB]: http://cartel.csail.mit.edu/icedb/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:06:29
|
Revision: 770 http://assorted.svn.sourceforge.net/assorted/?rev=770&view=rev Author: yangzhang Date: 2008-05-09 00:06:35 -0700 (Fri, 09 May 2008) Log Message: ----------- updated readme Modified Paths: -------------- python-afx/trunk/README Modified: python-afx/trunk/README =================================================================== --- python-afx/trunk/README 2008-05-09 07:06:26 UTC (rev 769) +++ python-afx/trunk/README 2008-05-09 07:06:35 UTC (rev 770) @@ -1,5 +1,42 @@ -To install, run setup.py or setup.bash. +[documentation](doc) -Future releases will come with scripts to build the epydoc API -documentation, but for now please refer to the project homepage for -the full documentation: http://assorted.sf.net/python-afx +Overview +-------- + +AFX is a library that extends the AF asynchronous programming library. The +list of new features includes: + +- thread support: call-from-thread and call-in-thread (a la [Twisted]) +- fair queueing +- condition variables +- object-pickling socket streams +- atomic booleans +- queue control +- task pools +- traceback tools +- startup wrappers +- simple servers + +This extension was started while building [ICEDB]. + +[Twisted]: http://twistedmatrix.com/ +[ICEDB]: http://cartel.csail.mit.edu/icedb/ + +Setup +----- + +Requirements: + +- AF (unreleased; contact [the author] for more information) +- [Python Commons] 0.2 + +[Python Commons]: http://assorted.sf.net/python-commons/ + +To install, run `setup.py` or `setup.bash`. + +Future Work +----------- + +- Substantial reorganization of the code. +- Code documentation. +- Test suite. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 07:06:21
|
Revision: 769 http://assorted.svn.sourceforge.net/assorted/?rev=769&view=rev Author: yangzhang Date: 2008-05-09 00:06:26 -0700 (Fri, 09 May 2008) Log Message: ----------- added publisher Added Paths: ----------- python-afx/trunk/publish.bash Added: python-afx/trunk/publish.bash =================================================================== --- python-afx/trunk/publish.bash (rev 0) +++ python-afx/trunk/publish.bash 2008-05-09 07:06:26 UTC (rev 769) @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +post-stage() { + epydoc -o $stagedir/doc src/afx/ +} + +fullname='AFX' +version=0.1 +license=psf +websrcs=( README ) +rels=( pypi: ) +. assorted.bash "$@" Property changes on: python-afx/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-05-09 06:54:45
|
Revision: 768 http://assorted.svn.sourceforge.net/assorted/?rev=768&view=rev Author: yangzhang Date: 2008-05-08 23:54:47 -0700 (Thu, 08 May 2008) Log Message: ----------- more diplomatic readme Modified Paths: -------------- udp-prober/trunk/README Modified: udp-prober/trunk/README =================================================================== --- udp-prober/trunk/README 2008-05-09 06:12:59 UTC (rev 767) +++ udp-prober/trunk/README 2008-05-09 06:54:47 UTC (rev 768) @@ -1,13 +1,16 @@ Overview -------- -UDP Prober is a simple program that takes a list of hosts and probes the entire -list periodically. This was an exercise in being "C++-ish," which meant using -boost libraries rather than C platform libraries---in particular, it was an -excuse for me to play with boost::asio. I tried to keep things simple, but the -end result is rather more complicated and verbose than I had anticipated. -boost::asio seems to make writing even the simplest of network applications an -ordeal. +UDP Prober is a simple program that takes a list of hosts also running UDP +Prober and pings the entire list periodically (and also listens for probes), +recording the latencies measured. This was an exercise in being "C++-ish," +which meant using boost libraries rather than C platform libraries---in +particular, it was an excuse for me to play with boost::asio. I tried to keep +things simple, but the end result is rather more complicated and verbose than I +had anticipated. boost::asio seems to have some difficulty scaling down to +simpler applications. It's probably fine as a portable, very-low-level C++ +interface to sockets and as a framework for asynchronous programming. Anyway, +here. Setup ----- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:12:51
|
Revision: 767 http://assorted.svn.sourceforge.net/assorted/?rev=767&view=rev Author: yangzhang Date: 2008-05-08 23:12:59 -0700 (Thu, 08 May 2008) Log Message: ----------- released udp prober 0.1 Added Paths: ----------- udp-prober/tags/ udp-prober/tags/0.1/ udp-prober/tags/0.1/README udp-prober/tags/0.1/publish.bash Copied: udp-prober/tags/0.1 (from rev 762, udp-prober/trunk) Copied: udp-prober/tags/0.1/README (from rev 765, udp-prober/trunk/README) =================================================================== --- udp-prober/tags/0.1/README (rev 0) +++ udp-prober/tags/0.1/README 2008-05-09 06:12:59 UTC (rev 767) @@ -0,0 +1,19 @@ +Overview +-------- + +UDP Prober is a simple program that takes a list of hosts and probes the entire +list periodically. This was an exercise in being "C++-ish," which meant using +boost libraries rather than C platform libraries---in particular, it was an +excuse for me to play with boost::asio. I tried to keep things simple, but the +end result is rather more complicated and verbose than I had anticipated. +boost::asio seems to make writing even the simplest of network applications an +ordeal. + +Setup +----- + +Requirements: + +- [boost] 1.35.0 + +[boost]: http://www.boost.org/ Copied: udp-prober/tags/0.1/publish.bash (from rev 766, udp-prober/trunk/publish.bash) =================================================================== --- udp-prober/tags/0.1/publish.bash (rev 0) +++ udp-prober/tags/0.1/publish.bash 2008-05-09 06:12:59 UTC (rev 767) @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +fullname='UDP Prober' +version=0.1 +license=gpl3 +websrcs=( README ) +webfiles= +rels=( src-tgz: ) +. assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:12:33
|
Revision: 766 http://assorted.svn.sourceforge.net/assorted/?rev=766&view=rev Author: yangzhang Date: 2008-05-08 23:12:40 -0700 (Thu, 08 May 2008) Log Message: ----------- released udp prober 0.1 Modified Paths: -------------- udp-prober/trunk/publish.bash Modified: udp-prober/trunk/publish.bash =================================================================== --- udp-prober/trunk/publish.bash 2008-05-09 06:10:34 UTC (rev 765) +++ udp-prober/trunk/publish.bash 2008-05-09 06:12:40 UTC (rev 766) @@ -6,5 +6,4 @@ websrcs=( README ) webfiles= rels=( src-tgz: ) -nodl=true . assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:10:27
|
Revision: 765 http://assorted.svn.sourceforge.net/assorted/?rev=765&view=rev Author: yangzhang Date: 2008-05-08 23:10:34 -0700 (Thu, 08 May 2008) Log Message: ----------- oops Modified Paths: -------------- udp-prober/trunk/README Modified: udp-prober/trunk/README =================================================================== --- udp-prober/trunk/README 2008-05-09 06:09:35 UTC (rev 764) +++ udp-prober/trunk/README 2008-05-09 06:10:34 UTC (rev 765) @@ -16,3 +16,4 @@ - [boost] 1.35.0 +[boost]: http://www.boost.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:09:30
|
Revision: 764 http://assorted.svn.sourceforge.net/assorted/?rev=764&view=rev Author: yangzhang Date: 2008-05-08 23:09:35 -0700 (Thu, 08 May 2008) Log Message: ----------- added publisher Added Paths: ----------- udp-prober/trunk/publish.bash Copied: udp-prober/trunk/publish.bash (from rev 761, cpp-commons/trunk/publish.bash) =================================================================== --- udp-prober/trunk/publish.bash (rev 0) +++ udp-prober/trunk/publish.bash 2008-05-09 06:09:35 UTC (rev 764) @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +fullname='UDP Prober' +version=0.1 +license=gpl3 +websrcs=( README ) +webfiles= +rels=( src-tgz: ) +nodl=true +. assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:08:20
|
Revision: 763 http://assorted.svn.sourceforge.net/assorted/?rev=763&view=rev Author: yangzhang Date: 2008-05-08 23:08:27 -0700 (Thu, 08 May 2008) Log Message: ----------- added a readme Added Paths: ----------- udp-prober/trunk/README Added: udp-prober/trunk/README =================================================================== --- udp-prober/trunk/README (rev 0) +++ udp-prober/trunk/README 2008-05-09 06:08:27 UTC (rev 763) @@ -0,0 +1,18 @@ +Overview +-------- + +UDP Prober is a simple program that takes a list of hosts and probes the entire +list periodically. This was an exercise in being "C++-ish," which meant using +boost libraries rather than C platform libraries---in particular, it was an +excuse for me to play with boost::asio. I tried to keep things simple, but the +end result is rather more complicated and verbose than I had anticipated. +boost::asio seems to make writing even the simplest of network applications an +ordeal. + +Setup +----- + +Requirements: + +- [boost] 1.35.0 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 06:00:33
|
Revision: 762 http://assorted.svn.sourceforge.net/assorted/?rev=762&view=rev Author: yangzhang Date: 2008-05-08 23:00:41 -0700 (Thu, 08 May 2008) Log Message: ----------- renamed udp pinger -> prober Added Paths: ----------- udp-prober/ Removed Paths: ------------- udp-pinger/ Copied: udp-prober (from rev 761, udp-pinger) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 05:17:54
|
Revision: 761 http://assorted.svn.sourceforge.net/assorted/?rev=761&view=rev Author: yangzhang Date: 2008-05-08 22:18:00 -0700 (Thu, 08 May 2008) Log Message: ----------- added note on global-auto-revert-mode Modified Paths: -------------- configs/trunk/src/emacs/yang.el Modified: configs/trunk/src/emacs/yang.el =================================================================== --- configs/trunk/src/emacs/yang.el 2008-05-09 05:16:50 UTC (rev 760) +++ configs/trunk/src/emacs/yang.el 2008-05-09 05:18:00 UTC (rev 761) @@ -485,6 +485,10 @@ ;; highlight current line (global-hl-line-mode t) +;; automatically detect when buffers have changed; disabled for now because what +;; I really want is not a silent revert but a prompt, as in vim +;; (global-auto-revert-mode t) + ;; set default haskell interpreter ;; TODO check this (setq haskell-program-name "ghci -fglasgow-exts") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-09 05:16:51
|
Revision: 760 http://assorted.svn.sourceforge.net/assorted/?rev=760&view=rev Author: yangzhang Date: 2008-05-08 22:16:50 -0700 (Thu, 08 May 2008) Log Message: ----------- better readme Modified Paths: -------------- hash-dist/trunk/README Modified: hash-dist/trunk/README =================================================================== --- hash-dist/trunk/README 2008-05-08 20:23:28 UTC (rev 759) +++ hash-dist/trunk/README 2008-05-09 05:16:50 UTC (rev 760) @@ -1,9 +1,13 @@ Overview -------- -This is a simple utility for observing the distribution of a hash-function. For -instance, the arguments +This is a simple utility for observing the distribution of a hash-function. +Usage +----- + +As an example, the arguments + full djb2 2 stl 1000000 should be structurally interpreted as @@ -32,7 +36,7 @@ ------------ - [Scala] 2.6.x -- [Scala Commons] +- [Scala Commons] 0.1 - [Simple Build] [Scala]: http://scala-lang.org/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:23:28
|
Revision: 759 http://assorted.svn.sourceforge.net/assorted/?rev=759&view=rev Author: yangzhang Date: 2008-05-08 13:23:28 -0700 (Thu, 08 May 2008) Log Message: ----------- blah...some sort of checkpoint Modified Paths: -------------- zdb/trunk/src/lzx/explorer.lzx Modified: zdb/trunk/src/lzx/explorer.lzx =================================================================== --- zdb/trunk/src/lzx/explorer.lzx 2008-05-08 20:22:22 UTC (rev 758) +++ zdb/trunk/src/lzx/explorer.lzx 2008-05-08 20:23:28 UTC (rev 759) @@ -1,21 +1,25 @@ -<canvas> +<canvas debug="true"> <class name="objlist" layout="axis:y" height="100%" width="200"> <edittext width="100%"/> - <list height="${parent.height - this.y}" width="100%"> - <textlistitem datapath="items:/item" text="$path{'text()'}" value="$path{'@value'}"/> + <list dataoption="lazy" height="${parent.height - this.y}" width="100%"> + <textlistitem datapath="items:/item" + text="$path{'field[@name="name"]/text()'}" + value="$path{'@id'}"/> </list> </class> <class name="field" layout="axis:x" width="100%"> - <text name="label" text="some field:" width="50%"/> - <edittext width="50%"/> + <attribute name="alpha" type="string" value="$path{'@name'}"/> + <text name="qqwe" text="${parent.alpha}"/> + <state apply="${parent.alpha != 'name'}"> + <text name="asdf" text="${parent.alpha}"/> + <text name="label" text="$path{'@name'}" width="50%"/> + <edittext text="$path{'text()'}" width="50%"/> + </state> </class> <class name="details" layout="axis:y" height="100%" width="200"> - <field/> - <field/> - <field/> - <field/> + <field datapath="items:/item[0]/field"/> </class> <view height="100%" width="100%"> @@ -27,53 +31,10 @@ </view> <dataset name="items"> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> - <item value="item1">item one</item> - <item value="item2">item two</item> - <item value="item3">item three</item> - <item value="item4">item four</item> - <item value="item5">item five</item> - <item value="item6">item six</item> + <item id="0"> + <field name="name">kazaa</field> + <field name="parents">file-sharing</field> + <field name="network">sharman</field> + </item> </dataset> </canvas> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:22:35
|
Revision: 758 http://assorted.svn.sourceforge.net/assorted/?rev=758&view=rev Author: yangzhang Date: 2008-05-08 13:22:22 -0700 (Thu, 08 May 2008) Log Message: ----------- blah...some sort of checkpoint Modified Paths: -------------- zdb/trunk/src/zdb/AltUi.scala zdb/trunk/src/zdb/Core.scala Modified: zdb/trunk/src/zdb/AltUi.scala =================================================================== --- zdb/trunk/src/zdb/AltUi.scala 2008-05-08 20:20:00 UTC (rev 757) +++ zdb/trunk/src/zdb/AltUi.scala 2008-05-08 20:22:22 UTC (rev 758) @@ -13,6 +13,23 @@ // import scala.collection.jcl._ import scala.io._ +//object Slick { +// implicit def str2xobj(s: String) = XObj(deref(getObj(s))) +// implicit def xobj2str(o: XObj) = o.obj.id +// implicit def objref2xobj(o: ObjRef) = XObj(deref(o)) +// implicit def xobj2objref(o: XObj) = o.obj.id +// implicit def obj2xobj(o: Obj) = XObj(o) +// implicit def xobj2obj(o: XObj) = o.obj +// case class XObj(obj: Obj) { +// def vals = ValsAdapter +// } +// def example { +// val word = XObj("Word") +// word("media about this") += "review of Word" +// word("media about this") += getObj("review of Word") +// } +//} + /** Command-line interface. */ object FileIo { @@ -39,7 +56,7 @@ def readStruct = { val lines = readBlock val pairs = for (line <- lines) yield { - val Seq(key, valstr) = line split (": ", 2) + val Seq(key, valstr) = line split (":", 2) map (_ trim) val vals = valstr split ";" map (_ trim) (key, vals) } @@ -47,66 +64,213 @@ if (map.size != pairs.length) throw new Exception("duplicate key") map } - /** Update by struct, either adding or updating an object. */ + /** + * Important notes: + * + * - 'parents' is ignored (only used when adding object) + * - everything is replaced; no diffs are computed + */ + def modifyStruct = { + val map = readStruct + val obj = getObj(map("names")(0)) + for ((key, vals) <- map; if key != "parents") { + vals match { + case Seq("_") => + try { unset(map("names")(0),key) } + catch { case e: BadPropException => () } + case _ => infoprop(obj,key).typ match { + case _: ObjSetT => setobj(map("names")(0),key)(vals:_*) + case _: StrSetT => set(map("names")(0),key)(vals:_*) + } + } + } + validateAll + } + + /** Read a block and parse it as a struct. */ + def readSuperStruct = { + val lines = readBlock + val Seq(vallines, proplines) = splitBy(lines)(_ == "new properties:") + + // Values + + val valtuples = for (line <- vallines) yield { + val Seq(key, valstr) = line split (":", 2) map (_ trim) + val vals = valstr split ";" map (_ trim) + (key, vals) + } + val vals = Map(valtuples: _*) + if (vals.size != valtuples.length) throw new Exception("duplicate val key") + + // Properties + + val proptuples = + for ((hdr,bdy) <- separateHeads(groupByHeaders(proplines)(!_.startsWith(" ")))) + yield { + val key = hdr.trim.toList.init.mkString + //val bdymap = Map(bdy map (x => x split ":" map (y => y trim)): _*) + val bdymap = Map(bdy map (_ split (":",2) map (_ trim)) map {case Seq(a,b) => (a,b)}: _*) + val typ = readType(bdymap("type")) + val defStr = bdymap("default") split ";" map (_ trim) + val default = typ match { + case _: StrSetT => mkStrSetV(defStr) + case _: ObjSetT => mkObjSetV(defStr map getObj) + } + (key, Prop(typ, default, false)) + } + val props = Map(proptuples: _*) + if (props.size != proptuples.length) throw new Exception("duplicate prop key") + + (vals, props) + } + /** + * Update by struct, either adding or updating an object. If the object + * exists, compute the diff and apply only those changes. + */ def updateStruct(shouldExist: Boolean) = { - val map = readStruct + val (vals,props) = readSuperStruct + val objname = vals("names")(0) val obj = if (shouldExist) { - deref(getObj(map("names")(0))) + getObj(objname) } else { try { - getObj(map("names")(0)) + getObj(objname) throw new Exception("object of that name already exists") } catch { - case e: Exception => mkObj(map("parents") map getObj) + case e: Exception => mk(vals("names"):_*)(vals("parents"):_*) } } - for ((key, vals) <- map; if key != "parents") { - obj.infoProp(key).typ match { - case _: ObjSetT => obj.setProp(key, mkObjSetV(vals map getObj)) - case _: StrSetT => obj.setProp(key, mkStrSetV(vals)) - } + + // TODO add a way to update parents; this probably requires a new + // ZdbUtil function + + // Next, update properties + + val oldPropsSeq = + for ((_, propname, prop, _) <- getProps(deref(obj))) + yield (propname, prop) + val oldProps: Set[(String,Prop)] = Set(oldPropsSeq.toStream: _*) + val newProps: Set[(String,Prop)] = Set(props.toStream:_*) + val addedProps = newProps -- oldProps + val removedProps = oldProps -- newProps + + for ((propname, p) <- addedProps) { + println("adding property: " + propname) + if (p.typ.isInstanceOf[StrSetT]) + prop(objname, propname, showType(p.typ), Some(p.default.asInstanceOf[StrSetV].s.toList(0)), p.opt) } + for ((propname, prop) <- removedProps) { + println("removing property: " + propname) + rmprop(objname, propname) + } + + // Next, update values + +// val oldValues = asdf +// +// for ((key, vals) <- map; if key != "parents") { +// infoprop(obj,key).typ match { +// case _: ObjSetT => setobj(map("names")(0),key)(vals:_*) +// case _: StrSetT => set(map("names")(0),key)(vals:_*) +// } +// } validateAll } + + def showVal(valOpt: Option[Val]) = { + valOpt match { + case Some(StrSetV(s)) => s mkString "; " + case Some(ObjSetV(s)) => s map deref map nameAndId mkString "; " + case Some(NilV()) => "(nil)" + case None => "_" + } + } + /** Show an object in struct format. */ def show(o: Obj) = { - val lines = for ((key, vals) <- o.vals) yield { - val valstr = vals match { - case StrSetV(s) => s mkString "; " - case ObjSetV(s) => s map deref map nameAndId mkString "; " - } - key + ": " + valstr + val vallines = for ((owner, name, prop, valsOpt) <- getProps(o)) yield { + name + ": " + showVal(valsOpt) } - lines mkString "\n" + + val full = false + val props = + if (!full) + o.props + else + for ((owner, name, prop, valsOpt) <- getProps(o)) + yield (name, prop) + + val proplines = for ((name, prop) <- props) yield { + val top = " " + name + ":" + val defaultstr = " default: " + showVal(Some(prop.default)) + val typestr = " type: " + ( + prop.typ match { + case StrSetT() => "string set" + case ObjSetT(rels) => "object set: " + ( + rels map { case (ref, revkey) => + nameAndId(deref(ref)) + " [" + revkey + "]" + } mkString "; " + ) + } + ) + List(top, defaultstr, typestr) mkString "\n" + } + + (vallines ++ List("new properties:") ++ proplines) mkString "\n" } + def showDescendants(s: String) { + for (d <- descendants(deref(getObj(s)))) { + println(show(d)) + println + } + } + + def showChildren(s: String) { + for (c <- deref(getObj(s)).children map deref) { + println(show(c)) + println + } + } + def main(argv: Array[String]) { while (true) { Console print ">>> " val line = Console.readLine if (line == null) return - val ws = words(line.trim) - val args = ws drop 1 - ws(0) match { - case "load-full" => loadFilePickle("data/data") - case "load" => load - case "validate" => validateAll - case "save-full" => { validateAll; saveFilePickle(ws(1)) } - case "save" => { validateAll; save } - case "find" => println(find(args mkString " ")) - case "get-full" => args match { - case Seq(name) => println(print(deref(getObj(name)))) - case Seq(name, refine) => println(print(deref(getObj(name, refine)))) + try { + val ws = words(line.trim) + val args = ws drop 1 + ws(0) match { + case "load-full" => loadFilePickle("data/data") + case "load" => load + case "validate" => validateAll + case "save-full" => { validateAll; saveFilePickle(ws(1)) } + case "save" => { validateAll; save } + case "find" => println(find(args mkString " ")) + case "get-full" => args match { + case Seq(name) => println(print(deref(getObj(name)))) + case Seq(name, refine) => println(print(deref(getObj(name, refine)))) + } + case "get" => args match { + case Seq(name) => + try { println(show(deref(name.toInt))) } + catch { case e: NumberFormatException => println(show(deref(getObj(name)))) } + case Seq(name, refine) => println(show(deref(getObj(name, refine)))) + } + case "add" => updateStruct(false) + case "update" => updateStruct(true) + case "modify" => modifyStruct + case "quit" => return + case "exit" => return + case "get-children" => showChildren(args(0)) + case "get-desc" => showDescendants(args(0)) + case "" => () + case x => println("unknown command: " + x) } - case "get" => args match { - case Seq(name) => println(show(deref(getObj(name)))) - case Seq(name, refine) => println(show(deref(getObj(name, refine)))) - } - case "add" => updateStruct(false) - case "update" => updateStruct(true) - case "" => () - case x => println("unknown command: " + x) + } catch { + case e: Exception => e.printStackTrace } } } Modified: zdb/trunk/src/zdb/Core.scala =================================================================== --- zdb/trunk/src/zdb/Core.scala 2008-05-08 20:20:00 UTC (rev 757) +++ zdb/trunk/src/zdb/Core.scala 2008-05-08 20:22:22 UTC (rev 758) @@ -10,6 +10,7 @@ package zdb import scala.collection.mutable._ +import scala.collection.{mutable => mut, immutable => immut} import scala.io.BytePickle._ import commons.Collections._ import commons.Control._ @@ -24,6 +25,11 @@ // object ZdbUtil { + def mkHashSet[a](xs: Seq[a]) = { + val set = new HashSet[a] + set ++= xs + set + } var universe = new Universe implicit def obj2xobj(o:Obj) = XObj(o) implicit def xobj2obj(o:XObj) = o.o @@ -58,9 +64,11 @@ case other => printSumm(other) } def printSummObj(o: Obj) = { - val names = o.getProp("names").asInstanceOf[StrSetV].s.toList - val name = if (names.length > 0) names(0) else "" - name + val names = getProp(o,"names") match { + case v: StrSetV => v.s.toList + case _ => List[String]() + } + if (names.length > 0) names(0) else "" } def printSumm(o: Obj): String = printSummObj(o) def printSumm(v: Val): String = v match { @@ -73,6 +81,9 @@ case Prop(typ, default, opt) => "Prop(typ: " + typ + ", default: " + printSumm(default) + ", opt: " + opt + ")" } type ObjRef = Int + /** + * Add a rel prop to both sides. + */ def addRelProp(lref: ObjRef, lname: String, rref: ObjRef, rname: String) = { val left = deref(lref) @@ -93,6 +104,14 @@ doit(left, rname, rref, lname) doit(right, lname, lref, rname) } + /** + * safe + * + * Add a rel prop to one side then the other. Similar to connect(), except + * this uses the raw props map rather than getProp. connect() is less safe + * to use than this as a result, since it may potentially mutate a + * grandparent. + */ def addRel(lname: String, left: ObjRef, rname: String, right: ObjRef) = { def addOneSide(o: Obj, name: String, other: Obj) = { def getDef(o: Obj): Option[Val] = o.props get name match { @@ -147,13 +166,26 @@ } } def getObjs(name: String) = { - val pred: Obj => Boolean = _.getProp("names").asInstanceOf[StrSetV].s.contains(name) - scala.collection.immutable.Set.empty[Obj] ++ (objs filter pred) + val pat = "^(.+) +\\(([0-9]+)\\)$" + val realname = name replaceAll (pat, "$1") + lazy val ref = name replaceAll (pat, "$2") toInt + def pred(o: Obj) = getProp(o,"names") match { + case v: StrSetV => v.s.contains(name) + case _ => false + } + if (realname == name) { + scala.collection.immutable.Set.empty[Obj] ++ (objs filter pred) + } else { + val o = deref(ref) + if (realname != "" && !(getProp(o,"names").asInstanceOf[StrSetV].s contains realname)) + throw new Exception + scala.collection.immutable.Set(o) + } } def getObj(name: String) = { val objs = getObjs(name) objs.size match { - case 0 => throw new NoResultException + case 0 => { Console.err println name; throw new NoResultException } case 1 => (objs toList 0).id case _ => throw new MultiResultException(objs.size, name, objs) } @@ -167,19 +199,46 @@ case _ => throw new MultiResultException(objs.size, name, objs) } } - def ancestors(x: Obj): Set[Obj] = { - Set(x) ++ strictAncestors(x) + + def descendants(x: Obj): Set[Obj] = Set(x) ++ strictDescendants(x) + def strictDescendants(x: Obj): Set[Obj] = { + val ds = for (c <- x.children map deref; d <- descendants(c)) yield d + Set(ds toList: _*) } + + def ancestors(x: Obj): Set[Obj] = Set(x) ++ strictAncestors(x) def strictAncestors(x: Obj): Set[Obj] = { - val as = for (p <- x.parents map deref; - a <- ancestors(p)) yield p + val as = for (p <- x.parents map deref; a <- ancestors(p)) yield a Set(as toList: _*) } - // given an object, returns a list of all the properties associated with the object, including those from its parents + + def union(typ: Type, vs: Seq[Val]) = { + def extract[a](vs: Seq[Val], subextract: Val => HashSet[a]) = { + val es = for (v <- vs; if !v.isInstanceOf[NilV]; e <- subextract(v)) yield e + mkHashSet(es) + } + typ match { + case _: StrSetT => StrSetV(extract[String](vs, _.asInstanceOf[StrSetV].s)) + case _: ObjSetT => ObjSetV(extract[ObjRef](vs, _.asInstanceOf[ObjSetV].s)) + } + } + + /** this will return a newly constructed value that is the union of all the + * ancestral defaults and the given object's instance value */ + def getProp(x: Obj, k: String) = { + // actual vals cannot be NilV, only default vals (and only str vals at that, it seems?? TODO) + val s = if (x.vals.contains(k)) List(x.vals(k)) else List[Val]() + val r = for (a <- ancestors(x); if a.props contains k) yield a.props(k).default + val allNil = s.isEmpty && (ancestors(x) forall { a => + !a.props.contains(k) || a.props(k).default.isInstanceOf[NilV] + }) + if (allNil) NilV() else union(x.infoProp(k).typ, s ++ r) + } + /** given an object, returns a list of all the properties associated with the + * object, including those from its parents */ def getProps(x: Obj) = { - for (a <- ancestors(x); - (propname, prop) <- a.props.elements.toList) - yield (a, propname, prop, optionize(x getProp propname)) + for (a <- ancestors(x); (propname, prop) <- a.props.elements.toList) + yield (a, propname, prop, optionize(getProp(x,propname))) } def pickleStrSetT: SPU[Type] = wrap( @@ -329,6 +388,10 @@ case class StrSetT extends Type case class ObjSetT(rels: HashSet[Rel]) extends Type +/** + * opt is actually ignored and always set to false (even though properties are + * almost always optional, except for e.g. name + */ case class Prop(typ: Type, default: Val, opt: Boolean) abstract class Val @@ -508,6 +571,7 @@ def addProp(name: String, typ: Type, default: Val, opt: Boolean): Unit = props.update(name, Prop(typ, default, opt)) //@ modifies: vals + /** safe: use this to reset the value of a property */ def setProp(name: String, value: Val): Unit = vals.update(name, value) private def getRecur[A](name: String, acc: Obj => Map[String,A]): Option[A] = @@ -624,7 +688,9 @@ override def toString = "InconsistentObjException(" + msg + "," + print(obj) + "\n)" } class BadValueException extends Exception +class BadTypeStrException(val s: String) extends Exception class NameConflictException extends Exception +class NotImplementedException extends Exception object ObjUser { def mkInst(newNames: String*)(srcNames: String*) = { @@ -639,6 +705,34 @@ obj.isInst = false obj.id } + def rmprop(objName: String, propName: String) { + val obj = deref(getObj(objName)) + if (obj.props removeKey propName isEmpty) throw new BadPropException(obj,propName); + // XXX make sure everyone else's ref to it is cut off + throw new NotImplementedException + } + /** safe: show a type-string */ + def showType(typ: Type) = typ match { + case _: StrSetT => "string set" + case _: ObjSetT => "object set" + case _ => throw new BadTypeException() + } + /** safe: parse a type-string */ + def readType(str: String) = { + val Seq(typ, params) = str.split(":",2) map (_ trim) + typ match { + case "string set" => StrSetT() + case "object set" => ObjSetT(mkHashSet( + for (param <- params split ";") yield { + val p = truncateWhile(param.trim.toCharArray)(_ == ']').mkString + val Seq(domain, revkey) = p split "\\[" map (_ trim) + (getObj(domain), revkey) + } + )) + case _ => throw new BadTypeStrException(str) + } + } + /** safe: add prop */ def prop(objName: String, propName: String, propType: String): Unit = prop(objName, propName, propType, None, false) def prop(objName: String, propName: String, propType: String, default: Option[String], opt: Boolean) = { @@ -647,10 +741,7 @@ case Some(s) => mkStrSetV(s) case None => NilV() } - propType match { - case "string set" => obj.addProp(propName, StrSetT(), dflt, opt) - case _ => throw new BadTypeException() - } + obj.addProp(propName, readType(propType), dflt, opt) } def set(objName: String, propName: String)(values: String*): Unit = set(getObj(objName), propName)(values: _*) @@ -662,6 +753,12 @@ } obj.setProp(propName, v) } + /** safe: wipe out the prop */ + def unset(objName: String, propName: String) = { + val obj = deref(getObj(objName)) + if (obj.vals removeKey propName isEmpty) + throw new BadPropException(obj, propName) + } def setobj(objName: String, propName: String)(values: String*): Unit = setobj(getObj(objName), propName)(values map getObj: _*) def setobj(objRef: ObjRef, propName: String)(values: ObjRef*) = { @@ -692,6 +789,7 @@ return inv throw new Exception } + /** unsafe: use of getProp may result in mutating an ancestor */ def connect(aref: ObjRef, asProp: String, bref: ObjRef) = { val a = deref(aref) val b = deref(bref) @@ -701,19 +799,23 @@ try { b.getProp(bsProp).asInstanceOf[ObjSetV].s += aref } catch { case _: BadPropException => setobj(bref, bsProp)(aref) } } + /** safe: read the value of a property */ def getprop(objName: String, propName: String): Val = getprop(getObj(objName), propName) def getprop(objRef: ObjRef, propName: String) = - deref(objRef).getProp(propName) + getProp(deref(objRef),propName) + /** safe: read the metadata of a property */ def infoprop(objName: String, propName: String): Prop = infoprop(getObj(objName), propName) def infoprop(objRef: ObjRef, propName: String) = deref(objRef).infoProp(propName) + /** safe: add a symmetric relation prop between two objects */ def mirror(objName: String, relName: String) = { val obj = getObj(objName) addRelProp(obj, relName, obj, relName) } + /** safe: add an asymmetric relation prop between two objects */ def rel(lobjName: String, lname: String, robjName: String, rname: String) = { val lobj = getObj(lobjName) @@ -727,6 +829,8 @@ def get(objName: String) = deref(getObj(objName)) def get(objName: String, propName: String) = deref(getObj(objName)).getProp(propName) + /** safe: delete an object from the system and unwire references to it from + * other objects */ def rmobj(objRef: ObjRef, propName: String, value: ObjRef) = { deref(objRef).vals(propName).asInstanceOf[ObjSetV].s -= value val inv = findInv(objRef, propName, value) @@ -1124,7 +1228,7 @@ val names = new HashSet[String] val cnames = new HashSet[String] universe.objs foreach { obj => { - val onames = obj.getProp("names").asInstanceOf[StrSetV].s + val onames = getProp(obj,"names").asInstanceOf[StrSetV].s onames foreach { oname => { if (!( names contains oname )) { names += oname This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:20:25
|
Revision: 757 http://assorted.svn.sourceforge.net/assorted/?rev=757&view=rev Author: yangzhang Date: 2008-05-08 13:20:00 -0700 (Thu, 08 May 2008) Log Message: ----------- added more robust initialization Modified Paths: -------------- configs/trunk/src/default.emacs Modified: configs/trunk/src/default.emacs =================================================================== --- configs/trunk/src/default.emacs 2008-05-08 20:19:42 UTC (rev 756) +++ configs/trunk/src/default.emacs 2008-05-08 20:20:00 UTC (rev 757) @@ -1,6 +1,11 @@ ;;; XEmacs backwards compatibility file -(load-file "/opt/armed/share/configs/emacs/yang.el") +(mapcar (lambda (basepath) + (let ((path (concat basepath "/armed/share/configs/emacs/yang.el"))) + (when (file-exists-p path) (load-file path)))) + (list "/opt" (concat (getenv "HOME") "/.local"))) +;;(load-file "/opt/armed/share/configs/emacs/yang.el") + ;; ;;; XEmacs backwards compatibility file ;; (setq user-init-file ;; (expand-file-name "init.el" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:19:49
|
Revision: 756 http://assorted.svn.sourceforge.net/assorted/?rev=756&view=rev Author: yangzhang Date: 2008-05-08 13:19:42 -0700 (Thu, 08 May 2008) Log Message: ----------- fixed (?) runtimepath to accommodate local installs Modified Paths: -------------- configs/trunk/src/default.vimrc Modified: configs/trunk/src/default.vimrc =================================================================== --- configs/trunk/src/default.vimrc 2008-05-08 20:19:00 UTC (rev 755) +++ configs/trunk/src/default.vimrc 2008-05-08 20:19:42 UTC (rev 756) @@ -1 +1,2 @@ set runtimepath+=/opt/armed/share/configs/vim/ +set runtimepath+=$HOME/.local/armed/share/configs/vim/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:19:05
|
Revision: 755 http://assorted.svn.sourceforge.net/assorted/?rev=755&view=rev Author: yangzhang Date: 2008-05-08 13:19:00 -0700 (Thu, 08 May 2008) Log Message: ----------- fixed the runner script generation Modified Paths: -------------- simple-build/trunk/src/build-templates/java Modified: simple-build/trunk/src/build-templates/java =================================================================== --- simple-build/trunk/src/build-templates/java 2008-05-08 20:18:33 UTC (rev 754) +++ simple-build/trunk/src/build-templates/java 2008-05-08 20:19:00 UTC (rev 755) @@ -27,14 +27,14 @@ $(SCRIPT): $(MAKEFILE_LIST) mkdir -p $(@D) if [ ! -z "$(MAINCLASS)" ]; then \ - echo -e "#!/usr/bin/env bash\n\nexec java -cp $(JAR):$(CLASSPATH) $(JRUNFLAGS) $(MAINCLASS) \"\$$@\"" > $(SCRIPT) ;\ + echo "#!/usr/bin/env bash\n\nexec java -cp $(JAR):$(CLASSPATH) $(JRUNFLAGS) $(MAINCLASS) \"\$$@\"" > $(SCRIPT) ;\ chmod +x $(SCRIPT) ;\ fi else $(SCRIPT): $(MAKEFILE_LIST) mkdir -p $(@D) if [ ! -z "$(MAINCLASS)" ]; then \ - echo -e "#!/usr/bin/env bash\n\nJAVA_OPTS=\"$(JRUNFLAGS) \$${JAVA_OPTS:-}\" exec scala -cp $(JAR):$(CLASSPATH) $(MAINCLASS) \"\$$@\"" > $(SCRIPT) ;\ + echo "#!/usr/bin/env bash\n\nJAVA_OPTS=\"$(JRUNFLAGS) \$${JAVA_OPTS:-}\" exec scala -cp $(JAR):$(CLASSPATH) $(MAINCLASS) \"\$$@\"" > $(SCRIPT) ;\ chmod +x $(SCRIPT) ;\ fi endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:18:53
|
Revision: 754 http://assorted.svn.sourceforge.net/assorted/?rev=754&view=rev Author: yangzhang Date: 2008-05-08 13:18:33 -0700 (Thu, 08 May 2008) Log Message: ----------- added .lzx (for some reason it doesn't seem to be working automatically) Modified Paths: -------------- configs/trunk/src/vim/plugin/_yang.vim Modified: configs/trunk/src/vim/plugin/_yang.vim =================================================================== --- configs/trunk/src/vim/plugin/_yang.vim 2008-05-08 20:18:02 UTC (rev 753) +++ configs/trunk/src/vim/plugin/_yang.vim 2008-05-08 20:18:33 UTC (rev 754) @@ -187,6 +187,7 @@ autocmd BufNewFile,BufRead *.{lzz,tt,tcc} setlocal filetype=cpp autocmd BufNewFile,BufRead *.{c,cc,cpp,cxx,h,lzz,tt,tcc} setlocal cindent expandtab softtabstop=2 shiftwidth=2 tabstop=8 autocmd BufNewFile,BufRead *.java setlocal cindent noexpandtab softtabstop=4 shiftwidth=4 tabstop=4 +autocmd BufNewFile,BufRead *.lzx setlocal filetype=lzx " autocmd GDB au BufNewFile,BufRead *.gdb set ft=gdb " autocmd hxx, cxx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-08 20:18:07
|
Revision: 753 http://assorted.svn.sourceforge.net/assorted/?rev=753&view=rev Author: yangzhang Date: 2008-05-08 13:18:02 -0700 (Thu, 08 May 2008) Log Message: ----------- added tamer support Modified Paths: -------------- simple-build/trunk/src/build-templates/cpp Modified: simple-build/trunk/src/build-templates/cpp =================================================================== --- simple-build/trunk/src/build-templates/cpp 2008-05-08 20:17:35 UTC (rev 752) +++ simple-build/trunk/src/build-templates/cpp 2008-05-08 20:18:02 UTC (rev 753) @@ -12,6 +12,7 @@ CC := gcc CXX := g++ +TAMER := tamer ifeq ($(LANG),c) COMPILER := $(CC) else @@ -21,8 +22,13 @@ $(TARGET): $(EXE) $(EXE): $(OBJS) - $(COMPILER) $(LDFLAGS) -o $@ $^ + $(COMPILER) $^ $(LDFLAGS) -o $@ +# TODO: get tamer working +$(OBJDIR)/%.cc: $(SRCDIR)/%.tt + mkdir -p $(@D) + $(TAMER) -g -o $@ -c $< || (rm $@ && false) + $(OBJDIR)/%.o: $(SRCDIR)/%.c mkdir -p $(@D) $(CC) $(CPPFLAGS) $(CFLAGS) -MD -c -o $@ $< This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |