assorted-commits Mailing List for Assorted projects (Page 42)
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-07-07 21:37:07
|
Revision: 877
http://assorted.svn.sourceforge.net/assorted/?rev=877&view=rev
Author: yangzhang
Date: 2008-07-07 14:37:10 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
more sandbox
Modified Paths:
--------------
sandbox/trunk/src/cc/longlongint.cc
Added Paths:
-----------
sandbox/trunk/src/java/TypedFactory.java
Modified: sandbox/trunk/src/cc/longlongint.cc
===================================================================
--- sandbox/trunk/src/cc/longlongint.cc 2008-07-07 21:36:37 UTC (rev 876)
+++ sandbox/trunk/src/cc/longlongint.cc 2008-07-07 21:37:10 UTC (rev 877)
@@ -32,3 +32,22 @@
cout << typeid(string).name() << endl;
return 0;
}
+
+/**
+ * on 64-bit machines:
+ *
+ * 32
+ * 32
+ * 8
+ * 8
+ * 8
+ * 8
+ * 8
+ * 8
+ * l
+ * x
+ * Ss
+ *
+ * on 32-bit machines:
+ *
+ */
Added: sandbox/trunk/src/java/TypedFactory.java
===================================================================
--- sandbox/trunk/src/java/TypedFactory.java (rev 0)
+++ sandbox/trunk/src/java/TypedFactory.java 2008-07-07 21:37:10 UTC (rev 877)
@@ -0,0 +1,25 @@
+//class Consumer<T> {
+// public Consumer(TypedFactory factory) { this.factory = factory; }
+// public T consume() { return factory.create<T>(); }
+// private TypedFactory factory;
+//}
+
+public class TypedFactory {
+ public static void main(String[] args) {
+ TypedFactory factory = new TypedFactory();
+ //Consumer<String> consumer = new Consumer<String>(factory);
+ //String string = consumer.consume();
+
+ // Explicitly specifying the type is not allowed; it must be possible to
+ // determine T from a parameter.
+ // factory.create<String>();
+ factory.create(String.class);
+ }
+
+ public <T> T create(Class<T> cls) {
+ if (cls.equals(String.class)) return (T) "hello!";
+ else throw new Exception("unknown type");
+ }
+}
+
+// vim:et:sw=2:ts=2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-07 21:36:41
|
Revision: 876
http://assorted.svn.sourceforge.net/assorted/?rev=876&view=rev
Author: yangzhang
Date: 2008-07-07 14:36:37 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
added/reorg papers
Modified Paths:
--------------
personal-site/trunk/src/index.txt
Added Paths:
-----------
personal-site/trunk/static/papers/icedb-msthesis08.pdf
personal-site/trunk/static/papers/relweb-webdb08.pdf
personal-site/trunk/static/papers/webtables-vldb08.pdf
Removed Paths:
-------------
personal-site/trunk/static/icedb-msthesis08.pdf
Modified: personal-site/trunk/src/index.txt
===================================================================
--- personal-site/trunk/src/index.txt 2008-07-07 21:14:07 UTC (rev 875)
+++ personal-site/trunk/src/index.txt 2008-07-07 21:36:37 UTC (rev 876)
@@ -138,18 +138,18 @@
Papers
------
-<!-- TODO: mirror papers. -->
+<!-- TODO: mirror papers. integrate with zdb -->
- Michael Cafarella, Alon Halevy, Daisy Wang, Eugene Wu, Yang Zhang.
- _WebTables: Exploring the Power of Tables on the Web_. VLDB 2008. <!--
- [PDF](papers/webtables-vldb08.pdf) -->
+ _WebTables: Exploring the Power of Tables on the Web_. VLDB 2008.
+ [PDF](papers/webtables-vldb08.pdf)
- Michael Cafarella, Nodira Khoussainova, Daisy Wang, Eugene Wu, Yang Zhang,
- Alon Halevy. _Uncovering the Relational Web_. WebDB 2008. <!--
- [PDF](papers/relweb-webdb08.pdf) -->
+ Alon Halevy. _Uncovering the Relational Web_. WebDB 2008.
+ [PDF](papers/relweb-webdb08.pdf)
- Yang Zhang. _ICEDB: Intermittently-Connected Continuous Query Processing_.
- MS Thesis, January 2008. [PDF](icedb-msthesis08.pdf)
+ MS Thesis, January 2008. [PDF](papers/icedb-msthesis08.pdf)
- Yang Zhang, Bret Hull, Hari Balakrishnan, Samuel Madden. _ICEDB:
Intermittently-Connected Continuous Query Processing_. ICDE 2007.
Deleted: personal-site/trunk/static/icedb-msthesis08.pdf
===================================================================
(Binary files differ)
Copied: personal-site/trunk/static/papers/icedb-msthesis08.pdf (from rev 858, personal-site/trunk/static/icedb-msthesis08.pdf)
===================================================================
(Binary files differ)
Added: personal-site/trunk/static/papers/relweb-webdb08.pdf
===================================================================
(Binary files differ)
Property changes on: personal-site/trunk/static/papers/relweb-webdb08.pdf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: personal-site/trunk/static/papers/webtables-vldb08.pdf
===================================================================
(Binary files differ)
Property changes on: personal-site/trunk/static/papers/webtables-vldb08.pdf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-07 21:14:13
|
Revision: 875
http://assorted.svn.sourceforge.net/assorted/?rev=875&view=rev
Author: yangzhang
Date: 2008-07-07 14:14:07 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
updated assorted site
Modified Paths:
--------------
assorted-site/trunk/build.bash
assorted-site/trunk/index.txt
Modified: assorted-site/trunk/build.bash
===================================================================
--- assorted-site/trunk/build.bash 2008-07-07 20:59:51 UTC (rev 874)
+++ assorted-site/trunk/build.bash 2008-07-07 21:14:07 UTC (rev 875)
@@ -14,7 +14,7 @@
# XXX fix rest later
-scp index.html main.css shell-sf:assorted/htdocs/
+scp index.html main.css sf:assorted/htdocs/
exit
rewrite() {
Modified: assorted-site/trunk/index.txt
===================================================================
--- assorted-site/trunk/index.txt 2008-07-07 20:59:51 UTC (rev 874)
+++ assorted-site/trunk/index.txt 2008-07-07 21:14:07 UTC (rev 875)
@@ -34,6 +34,10 @@
- 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)
+ - [Pidgin Monitor](pidgin-mon): simple, colored, live display of changes in
+ buddy statuses (done)
+ - [Cygwin Tools](cygwin-tools): tools for making Cygwin more pleasant to use
+ (done)
- Meta programming
- [Simple-Build](simple-build): YAML-based meta-build system for generating
Makefiles; you do not want to use this (passive)
@@ -43,19 +47,18 @@
only produces language statistics (done)
- [Simple Preprocessor](simple-preprocessor): tiny Scala implementation of
the C preprocessor's _object-like macros_ (done)
-- Tools for various websites or services
+- Tools for various websites/web applications
- [Facebook](facebook-tools): monitor changes in your [Facebook] network
(done)
- Myspace: crawl [MySpace] profiles within $n$ degrees of you for fast
searches (done)
- O'Reilly Safari: cache text from the [O'Reilly Safari] online bookshelf for
offline reading (abandoned)
- - Youtube: caches [YouTube] videos from your favorites, playlists, and
+ - YouTube: caches [YouTube] videos from your favorites, playlists, and
subscriptions (done)
- MovieLookup: given an [HBO](http://hbo.com/) schedule, look up movie
- ratings on [Rotten Tomatoes](http://rottentomatoes.com/), sort the movies
- by score, and aggregate the show times for those movies based on the
- schedule (done)
+ ratings on [Rotten Tomatoes], sort the movies by score, and aggregate the
+ show times for those movies based on the schedule (done)
- Google File Search: a simple web frontend to Google Web Search for finding
files in web directory listings (done)
- Configuration resources and desktop tools
@@ -65,7 +68,9 @@
etc.; note that this includes third-party code (passive)
- Wallpaper Tools: tools for managing wallpapers as they are being rotated
through (done)
-- Exploration and experimentation
+- Exploration, experimentation, research
+ - TCQ Wavelets: wavelet domain stream query processing for the Data Triage
+ project in TelegraphCQ (done)
- [Hash distribution](hash-dist): for observing the distribution of hash
functions on supplied data (done)
- PRNG distribution: for observing the distribution of PRNGs (hiatus)
@@ -75,7 +80,7 @@
behavior of NUMA systems (done)
- Sandbox: heap of small test cases to explore (mostly programming language
details, bugs, corner cases, features, etc.) (passive)
-- Miscellanea
+- Miscellaneous
- [Mailing List Filter](mailing-list-filter): deal with high-volume mailing
lists by filtering your mailbox for threads in which you were a participant
(done)
@@ -84,6 +89,8 @@
- 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].
+ - Pop Quiz: simple C# application that helped me learn vocab for standardized
+ verbal tests like those of the SAT and GRE (done)
- [BattleCode 2007 entry, Team Little](battlecode-2007-little): [Greg] and my
work for the [2007 competition]; see also [our (i.e. Greg's) entry] for the
[2008 competition] (done)
@@ -91,6 +98,11 @@
(hiatus)
- Source management: various tools for cleaning up and maintaining a source
code repository, identifying things that might not belong (hiatus)
+ - [Fartris](fartris): stupid DirectDraw game I wrote a long time ago (done)
+ - TI-86 data: backup of all the data I added to the calculator that served me
+ throughout high school (done)
+ - LMNH: a simple "end-user" scripting environment intended for
+ non-programmers, somewhat like Automator but in 2002 (abandoned)
- Websites
- [This website](http://assorted.sf.net/) (passive)
- [My personal website](http://www.mit.edu/~y_z/) (passive)
@@ -111,6 +123,7 @@
[MySpace]: http://www.myspace.com/
[Tamarin]: http://www.mozilla.org/projects/tamarin/
[js_beautify]: http://elfz.laacz.lv/beautify/
+[Rotten Tomatoes]: http://www.rottentomatoes.com/
What the statuses mean:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-07 21:00:13
|
Revision: 874
http://assorted.svn.sourceforge.net/assorted/?rev=874&view=rev
Author: yangzhang
Date: 2008-07-07 13:59:51 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
published site
Modified Paths:
--------------
fartris/trunk/README
Added Paths:
-----------
fartris/trunk/publish.bash
Modified: fartris/trunk/README
===================================================================
--- fartris/trunk/README 2008-07-07 20:52:37 UTC (rev 873)
+++ fartris/trunk/README 2008-07-07 20:59:51 UTC (rev 874)
@@ -1,10 +1,11 @@
Overview
-========
+--------
This is a simple, retarded game I wrote for my high school senior project.
I've compressed all the sources here because the resources (images and sounds)
are uncomfortably large.
-The `Site/` directory also contains archives of the history of this program.
-(Back then I wasn't using version control, sadly.)
+The `Site/` directory also contains archives of the history of this program
+(back then I wasn't using version control, sadly), along with the simple
+website I briefly maintained for this game.
Added: fartris/trunk/publish.bash
===================================================================
--- fartris/trunk/publish.bash (rev 0)
+++ fartris/trunk/publish.bash 2008-07-07 20:59:51 UTC (rev 874)
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+fullname='Fartris'
+version=0.1
+license=gpl3
+websrcs=( README )
+rels=( src-tgz: )
+nodl=true
+. assorted.bash "$@"
Property changes on: fartris/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-07-07 20:53:29
|
Revision: 873
http://assorted.svn.sourceforge.net/assorted/?rev=873&view=rev
Author: yangzhang
Date: 2008-07-07 13:52:37 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
reformatted, published
Modified Paths:
--------------
cygwin-tools/trunk/README
Modified: cygwin-tools/trunk/README
===================================================================
--- cygwin-tools/trunk/README 2008-07-07 20:32:33 UTC (rev 872)
+++ cygwin-tools/trunk/README 2008-07-07 20:52:37 UTC (rev 873)
@@ -1,5 +1,5 @@
Overview
-========
+--------
A small collection of scripts for using Cygwin. Mainly these are scripts for
starting the terminal and shell.
@@ -8,7 +8,7 @@
is installed and where the scripts themselves are placed.
Setup
-=====
+-----
First, copy the `src/` files to the `C:\cygwin\` directory.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-07 20:32:30
|
Revision: 872
http://assorted.svn.sourceforge.net/assorted/?rev=872&view=rev
Author: yangzhang
Date: 2008-07-07 13:32:33 -0700 (Mon, 07 Jul 2008)
Log Message:
-----------
updated and published site
Modified Paths:
--------------
pidgin-mon/trunk/README
Modified: pidgin-mon/trunk/README
===================================================================
--- pidgin-mon/trunk/README 2008-07-03 19:57:23 UTC (rev 871)
+++ pidgin-mon/trunk/README 2008-07-07 20:32:33 UTC (rev 872)
@@ -1,5 +1,5 @@
Overview
-========
+--------
This tool monitors [Pidgin] system logs for changes in your buddies' statuses.
Provides some simple coloring of output.
@@ -7,14 +7,14 @@
[Pidgin]: http://pidgin.im/
Setup
-=====
+-----
Requirements:
- [Python Commons](http://assorted.sf.net/python-commons/)
Todo
-====
+----
Known issues:
@@ -26,3 +26,4 @@
- Investigate whether Pidgin flushes logs in reasonable time bounds, and
whether there are any other such issues that could possibly be causing the
monitor to exhibit high latency.
+- Filters to allow monitoring only friends of interest.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-03 19:57:22
|
Revision: 871
http://assorted.svn.sourceforge.net/assorted/?rev=871&view=rev
Author: yangzhang
Date: 2008-07-03 12:57:23 -0700 (Thu, 03 Jul 2008)
Log Message:
-----------
added some notes to tabs2bullets
Modified Paths:
--------------
shell-tools/trunk/src/tabs2bullets.py
Modified: shell-tools/trunk/src/tabs2bullets.py
===================================================================
--- shell-tools/trunk/src/tabs2bullets.py 2008-07-03 19:51:47 UTC (rev 870)
+++ shell-tools/trunk/src/tabs2bullets.py 2008-07-03 19:57:23 UTC (rev 871)
@@ -1,5 +1,11 @@
#!/usr/bin/env python
+"""
+Given an outline where the indentation is specified by the number of leading
+tab characters, output the same outline but with tabs replaced by double spaces
+followed by a leading bullet.
+"""
+
from re import compile, sub
from sys import stdin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-03 19:52:02
|
Revision: 870
http://assorted.svn.sourceforge.net/assorted/?rev=870&view=rev
Author: yangzhang
Date: 2008-07-03 12:51:47 -0700 (Thu, 03 Jul 2008)
Log Message:
-----------
added tabs2bullets (similar to bullets.hs)
Added Paths:
-----------
shell-tools/trunk/src/tabs2bullets.py
Added: shell-tools/trunk/src/tabs2bullets.py
===================================================================
--- shell-tools/trunk/src/tabs2bullets.py (rev 0)
+++ shell-tools/trunk/src/tabs2bullets.py 2008-07-03 19:51:47 UTC (rev 870)
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+from re import compile, sub
+from sys import stdin
+
+for line in stdin:
+ p = compile( r'^\t*' )
+ m = p.match( line )
+ line = line[ m.end() : ]
+ print ' ' * m.end() + '-', line,
Property changes on: shell-tools/trunk/src/tabs2bullets.py
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-03 06:18:49
|
Revision: 869
http://assorted.svn.sourceforge.net/assorted/?rev=869&view=rev
Author: yangzhang
Date: 2008-07-02 23:18:58 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
more ancient stuff: imported lmnh
Added Paths:
-----------
lmnh/
lmnh/trunk/
lmnh/trunk/Command Sets/
lmnh/trunk/Command Sets/Artists.txt
lmnh/trunk/Command Sets/Corrections.txt
lmnh/trunk/Command Sets/Genres.txt
lmnh/trunk/Command Sets/Overbored.FileProcessor.Extensibility.DefaultCommands.dll
lmnh/trunk/Command Sets/Overbored.Modules.OverboredFileProcessor.Music.dll
lmnh/trunk/Default.xml
lmnh/trunk/Source Code/
lmnh/trunk/Source Code/Overbored.FileProcessor/
lmnh/trunk/Source Code/Overbored.FileProcessor/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.FileProcessor/FileProcessor.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/CommandConfiguration.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/CommandInformation.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/CommandTemplate.txt
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/Miscellaneous.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/Script.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/ScriptEnvironment.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility/VariableTable.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/ConcatenateTextCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/ConditionalCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/CreateDirectoryCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/DeleteFileCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/ExtractPathCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/FilePropertiesCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/FormatTextCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/IfElseCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/IllegalCharactersCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/LoopCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/Miscellaneous.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/MoveCopyFileCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/NumericOperationCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/NumericOperationConfiguration.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/NumericOperationForm.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/NumericOperationForm.resx
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/RenameFileCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/ReplaceTextCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Extensibility.DefaultCommands/SetVariableCommand.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/CommandConfigurationForm.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/CommandConfigurationForm.resx
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/EditScriptForm.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/EditScriptForm.resx
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/FileListForm.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/FileListForm.resx
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/FileProcessor.ico
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/OptionsForm.cs
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/OptionsForm.resx
lmnh/trunk/Source Code/Overbored.FileProcessor.Interface/Session.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/Miscellaneous.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/MusicDatabasePage.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/MusicDatabasePageEnumerator.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/MusicIdentity.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/NameFormatter.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/Possibilities.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/TextCorrectionList.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/TextList.cs
lmnh/trunk/Source Code/Overbored.Modules.OverboredFileProcessor.Music/VerifyNameCommand.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/
lmnh/trunk/Source Code/Overbored.Utilities.Collections/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/IExtendedEnumerator.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/ILinkedList.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/ILinkedListNode.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/IListIterator.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedList.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedListAction.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedListChangeEventArgs.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedListIterator.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedListNode.cs
lmnh/trunk/Source Code/Overbored.Utilities.Collections/LinkedListNodeEnumerator.cs
lmnh/trunk/Source Code/Overbored.Utilities.Web/
lmnh/trunk/Source Code/Overbored.Utilities.Web/AssemblyInfo.cs
lmnh/trunk/Source Code/Overbored.Utilities.Web/WebUtility.cs
Added: lmnh/trunk/Command Sets/Artists.txt
===================================================================
--- lmnh/trunk/Command Sets/Artists.txt (rev 0)
+++ lmnh/trunk/Command Sets/Artists.txt 2008-07-03 06:18:58 UTC (rev 869)
@@ -0,0 +1,486 @@
+112
+2 Unlimited
+3 Doors Down
+504 Boyz
+702
+98 Degrees
+Aaliyah
+Aaron Carter
+ABBA
+AC/DC
+Adam Sandler
+Adema
+Aerosmith
+Afroman
+Al Green
+Alabama
+Alan Jackson
+Alanis Morissette
+Alice Cooper
+Alice In Chains
+Alicia Keys
+Alient Ant Farm
+All-4-One
+Allman Brothers Band
+Amber
+America
+American Hi-Fi
+Anastacia
+Andrew W.K.
+Anne Murray
+Annie Lennox
+Aretha Franklin
+Ashanti
+B-52'S
+B.B. King
+B2K
+Bachman Turner Overdrive
+Backstreet Boys
+Bad Company
+Baha Men
+Barbra Streisand
+Barenaked Ladies
+Barry White
+Basement Jaxx
+Beach Boys
+Beastie Boys
+Beatles
+Beck
+Bee Gees
+Ben Folds Five
+Bette Midler
+Big Bad Voodoo Daddy
+Billie Holiday
+Billy Idol
+Billy Joel
+Billy Squier
+Black Crowes
+Black Sabbath
+Blink 182
+Blondie
+Blu Cantrell
+Blues Brothers
+Blues Traveler
+Bob Carlisle
+Bob Dylan
+Bob Marley And The Wailers
+Bob Seger
+Bobby Brown
+Bon Jovi
+Bonnie Raitt
+Boston
+Boyz II Men
+Brandy
+Brian McKnight
+Brian Setzer
+Britney Spears
+Brooks And Dunn
+Bruce Springsteen
+Bryan Adams
+Bubba Sparxxx
+Buckcherry
+Buddy Holly
+Busta Rhymes
+Calling
+Candlebox
+Celine Dion
+Charlie Daniels Band
+Cheap Trick
+Cher
+Cherry Poppin' Daddies
+Chicago
+Chieftains
+Chris DeBurgh
+Chris Isaak
+Chris Ledoux
+Christina Aguilera
+Chumbawamba
+Cinderella
+Clarence Carter
+Coldplay
+Collective Soul
+Coolio
+Corrosion Of Conformity
+Counting Crows
+Craig David
+Crazy Town
+Creed
+Creedence Clearwater Revival
+Crosby, Stills, And Nash
+Crosby, Stills, Nash, And Young
+Crystal Method
+Cypress Hill
+D12
+Daft Punk
+Dave Matthews Band
+David Allan Coe
+David Bowie
+David Lee Roth
+Debbie Gibson
+Deep Purple
+Def Leppard
+Delerium
+Denis Leary
+Depeche Mode
+Destiny's Child
+Diana Ross
+Dido
+Digital Underground
+Dishwalla
+Disney
+Dixie Chicks
+DJ Assault
+Dolly Parton
+Don Henley
+Doors
+Dr. Dre
+Dream
+Dream Theater
+Dwight Yoakam
+Eagle-Eye Cherry
+Eagles
+Earth, Wind, And Fire
+Eddie And The Cruisers
+Eddie Money
+Edwin McCain
+Edwin Starr
+Elton John
+Elvis Costello
+Elvis Presley
+Eminem
+En Vogue
+Engelbert Humperdinck
+Enrique Iglesias
+Enya
+Eric Clapton
+Eve
+Eve 6
+Everclear
+Everlast
+Faith Evans
+Faith Hill
+Fastball
+Fat Joe
+Fatboy Slim
+Filter
+Fiona Apple
+Fleetwood Mac
+Foo Fighters
+Four Tops
+Frank Sinatra
+Frank Zappa
+Frankie Valli And the Four Seasons
+Frankie Yankovic
+Freddy Fender
+Fuel
+Gap Band
+Garbage
+Garth Brooks
+Genesis
+George Clinton
+George Strait
+George Thorogood And The Destroyers
+George Winston
+Ginuwine
+Glen Lewis
+Glenn Frey
+Gloria Estefan
+Godsmack
+Goo Goo Dolls
+Gordon Lightfoot
+Grand Funk Railroad
+Grateful Dead
+Great White
+Green Day
+Guess Who
+Guns N' Roses
+Guttermouth
+Haddaway
+Hank Williams Jr.
+Hanson
+Harry Connick Jr.
+Harry Nilsson
+Heart
+Heatwave
+Heavy D And The Boyz
+Helen Reddy
+Herbie Hancock
+Honeydrippers
+Hootie And The Blowfish
+House Of Pain
+Huey Lewis And the News
+Incubus
+India.Arie
+Indigo Girls
+Inner Circle
+INXS
+Irish Rovers
+Isley Brothers
+J. Geils Band
+Ja Rule
+Jackson 5
+Jackson Browne
+Jagged Edge
+James Brown
+James Taylor
+Janet Jackson
+Janis Joplin
+Jay-Z
+Jaydee
+Jeff Beck
+Jeff Foxworthy
+Jeff Healey Band
+Jefferson Starship
+Jennifer Lopez
+Jessica Simpson
+Jewel
+Jill Scott
+Jimi Hendrix
+Jimmy Buffett
+Joe
+Joe Cocker
+Joe Jackson
+Joe Walsh
+John Anderson
+John Cafferty And Beaver Brown Band
+John Cougar Mellencamp
+John Fogerty
+John Lee Hooker
+John Lennon
+John Michael Montgomery
+Johnny Cash
+Johnny Gill
+Jon Secada
+Jonny Lang
+Journey
+Judas Priest
+Julio Iglesias
+Juvenile
+K.C. And The Sunshine Band
+Kansas
+Keith Sweat
+Kenny G
+Kenny Rogers
+Kenny Wayne Shepherd
+Kid Rock
+Kiss
+Koffee Brown
+Kool And The Gang
+Korn
+Kylie Minogue
+L.L. Cool J
+Lauryn Hill
+LeAnn Rimes
+Led Zeppelin
+Lee Greenwood
+Lenny Kravitz
+LFO
+Lifehouse
+Lil Wayne
+Lil' Bow Wow
+Lil' Kim
+Lil' Romeo
+Limp Bizkit
+Linkin Park
+Lionel Richie
+Live
+Lonestar
+Los Lobos
+Lou Bega
+Louis Armstrong
+Ludacris
+Luther Vandross
+Lynyrd Skynyrd
+Macy Gray
+Madonna
+Mandy Moore
+Marc Anthony
+Marcy Playground
+Mariah Carey
+Marvin Gaye
+Mary J. Blige
+Mary-Chapin Carpenter
+Master P
+Matchbox Twenty
+Maxwell
+Meat Loaf
+Melissa Etheridge
+Metallica
+Michael Bolton
+Michael Jackson
+Michelle Branch
+Mick Jagger
+Missy Elliott
+Mitch Ryder And the Detroit Wheels
+Moby
+Molly Hatchet
+Monica
+Monifah
+Montrose
+Muddy Waters
+Mya
+Mystikal
+M\xF6tley Cr\xFCe
+Nappy Roots
+Natalie Cole
+Natalie Imbruglia
+Neal McCoy
+Neil Diamond
+Neil Young
+Nelly
+Nelly Furtado
+Nickelback
+Nine Inch Nails
+Nirvana
+No Doubt
+*NSYNC
+O - Town
+Oasis
+Offspring
+Olivia Newton-John
+Otis Redding
+Our Lady Peace
+Outkast
+Ozzy Osbourne
+P. Diddy
+P.O.D.
+Pantera
+Papa Roach
+Parliament
+Pat Benatar
+Patsy Cline
+Paul McCartney
+Paul Simon
+Paula Abdul
+Peabo Bryson
+Pearl Jam
+Peter Gabriel
+Phil Collins
+Pink
+Pink Floyd
+Pogues
+Poison
+Pretenders
+Prince
+Prodigy
+Puddle Of Mudd
+Queen
+Queensryche
+R. Kelly
+R.E.M.
+Radiohead
+Rage Against The Machine
+Ramones
+Reba McEntire
+Red Hot Chili Peppers
+REO Speedwagon
+Rick James
+Rick Springfield
+Ricky Martin
+Righteous Brothers
+Ringo Star
+Rob Zombie
+Robert Palmer
+Rod Stewart
+Rolling Stones
+Roy Orbison
+Royal Crown Revue
+Run-D.M.C.
+Rush
+S Club 7
+Sade
+Salt-N-Peppa
+Sammy Hagar
+Santana
+Sarah McLachlan
+Savage Garden
+Scorpions
+Selena
+Semisonic
+Shaggy
+Shakira
+Shania Twain
+Sheryl Crow
+Simon And Garfunkel
+Sisqo
+Sister Sledge
+Slipknot
+Smash Mouth
+Smashing Pumpkins
+Smokey Robinson
+Snoop Dogg
+Social Distortion
+Sonny And Cher
+Souldecision
+Soundgarden
+Spice Girls
+Spin Doctors
+Stabbing Westward
+Staind
+Steely Dan
+Steppenwolf
+Steve Miller Band
+Stevie Nicks
+Stevie Ray Vaughn
+Stevie Wonder
+Sting
+Stone Temple Pilots
+Styx
+Sublime
+Sugar Ray
+Supremes
+System of a Down
+Talking Heads
+Ted Nugent
+Temptations
+Tesla
+The Corrs
+The Cranberries
+The Cure
+The Monkees
+The Moody Blues
+The Police
+The Who
+Third Eye Blind
+Tim McGraw
+Tina Turner
+TLC
+Tom Jones
+Tom Petty
+Toni Braxton
+Tony Toni Tone
+Tori Amos
+Tracy Byrd
+Tracy Chapman
+Train
+Travis Tritt
+Trik Turner
+Tupac Shakur
+Tweet
+Type O Negative
+U2
+Uncle Kracker
+Usher
+Van Halen
+Van Morrison
+Vanessa Carlton
+Vertical Horizon
+Village People
+Vince Gill
+Violent Femmes
+Vitamin C
+War
+Wayne Newton
+Weird Al Yankovic
+Whitesnake
+Whitney Houston
+Will Smith
+Willa Ford
+Willie Nelson
+Wilson Pickett
+Wings
+Wynonna Judd
+X-Ecutioners
+Yanni
+Yo-Yo Ma
+ZZ Top
\ No newline at end of file
Added: lmnh/trunk/Command Sets/Corrections.txt
===================================================================
--- lmnh/trunk/Command Sets/Corrections.txt (rev 0)
+++ lmnh/trunk/Command Sets/Corrections.txt 2008-07-03 06:18:58 UTC (rev 869)
@@ -0,0 +1,96 @@
+3 Doors Down:
+three doors down
+
+AC/DC:
+ac dc
+acdc
+
+Alanis Morissette:
+alanis morrisette
+alanis morrissette
+alanis morisette
+
+Alient Ant Farm:
+alien antfarm
+
+Alicia Keys:
+alicia keyes
+
+American Hi-Fi:
+american hifi
+
+Blink 182:
+blink182
+
+Britney Spears:
+brittany spears
+brittney spears
+britteny spears
+
+Celine Dion:
+celine dione
+
+Christina Aguilera:
+christina
+aguilera
+
+Coldplay:
+cold play
+
+Creedence Clearwater Revival:
+ccr
+
+Default:
+defalt
+
+Flavor Of The Weak:
+flavor of the week
+
+Gimme! Gimme! Gimme!:
+gimme, gimme, gimme
+gimme gimme gimme
+
+Guns N' Roses:
+guns and roses
+
+Guttermouth:
+gutter mouth
+
+Linkin Park:
+linking park
+
+NSYNC:
+n sync
+
+Rendezvous:
+rendevous
+
+Sheryl Crow:
+cheryl crow
+cheryl crowe
+sheryl crowe
+
+Snoop Dogg:
+snoop doggy dogg
+snoop doggie dogg
+snoop doggy dog
+snoop doggie dog
+snoop doggie
+snoop doggy
+snoop dog
+snoopdogg
+snoopdog
+
+Tupac Shakur:
+2pac
+2 pac
+tupac
+
+Whitesnake:
+white snake
+
+Weird Al Yankovic:
+weird al
+wierd al
+weird al yankovich
+wierd al yankovich
\ No newline at end of file
Added: lmnh/trunk/Command Sets/Genres.txt
===================================================================
--- lmnh/trunk/Command Sets/Genres.txt (rev 0)
+++ lmnh/trunk/Command Sets/Genres.txt 2008-07-03 06:18:58 UTC (rev 869)
@@ -0,0 +1,148 @@
+Blues
+Classic Rock
+Country
+Dance
+Disco
+Funk
+Grunge
+Hip-Hop
+Jazz
+Metal
+New Age
+Oldies
+Other
+Pop
+R&B
+Rap
+Reggae
+Rock
+Techno
+Industrial
+Alternative
+Ska
+Death Metal
+Pranks
+Soundtrack
+Euro-Techno
+Ambient
+Trip-Hop
+Vocal
+Jazz+Funk
+Fusion
+Trance
+Classical
+Instrumental
+Acid
+House
+Game
+Sound Clip
+Gospel
+Noise
+Alternative Rock
+Bass
+Soul
+Punk
+Space
+Meditative
+Instrumental Pop
+Instrumental Rock
+Ethnic
+Gothic
+Darkwave
+Techno-Industrial
+Electronic
+Pop-Folk
+Eurodance
+Dream
+Southern Rock
+Comedy
+Cult
+Gangsta
+Top 40
+Christian Rap
+Pop/Funk
+Jungle
+Native American
+Cabaret
+New Wave
+Psychadelic
+Rave
+Showtunes
+Trailer
+Lo-Fi
+Tribal
+Acid Punk
+Acid Jazz
+Polka
+Retro
+Musical
+Rock & Roll
+Hard Rock
+Folk
+Folk/Rock
+National Folk
+Swing
+Fast-Fusion
+Bebob
+Latin
+Revival
+Celtic
+Bluegrass
+Avantgarde
+Gothic Rock
+Progressive Rock
+Psychedelic Rock
+Symphonic Rock
+Slow Rock
+Big Band
+Chorus
+Easy Listening
+Acoustic
+Humour
+Speech
+Chanson
+Opera
+Chamber Music
+Sonata
+Symphony
+Booty Bass
+Primus
+Porn Groove
+Satire
+Slow Jam
+Club
+Tango
+Samba
+Folklore
+Ballad
+Power Ballad
+Rhytmic Soul
+Freestyle
+Duet
+Punk Rock
+Drum Solo
+Acapella
+Euro-House
+Dance Hall
+Goa
+Drum & Bass
+Club-House
+Hardcore
+Terror
+Indie
+BritPop
+Negerpunk
+Polsk Punk
+Beat
+Christian Gangsta Rap
+Heavy Metal
+Black Metal
+Crossover
+Contemporary Christian
+Christian Rock
+Merengue
+Salsa
+Trash Metal
+Anime
+JPop
+SynthPop
\ No newline at end of file
Added: lmnh/trunk/Command Sets/Overbored.FileProcessor.Extensibility.DefaultCommands.dll
===================================================================
(Binary files differ)
Property changes on: lmnh/trunk/Command Sets/Overbored.FileProcessor.Extensibility.DefaultCommands.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: lmnh/trunk/Command Sets/Overbored.Modules.OverboredFileProcessor.Music.dll
===================================================================
(Binary files differ)
Property changes on: lmnh/trunk/Command Sets/Overbored.Modules.OverboredFileProcessor.Music.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: lmnh/trunk/Default.xml
===================================================================
--- lmnh/trunk/Default.xml (rev 0)
+++ lmnh/trunk/Default.xml 2008-07-03 06:18:58 UTC (rev 869)
@@ -0,0 +1,1299 @@
+<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+<SOAP-ENV:Body>
+<a1:Hashtable id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Collections">
+<LoadFactor>0.72</LoadFactor>
+<Version>282</Version>
+<Comparer xsi:null="1"/>
+<HashCodeProvider xsi:null="1"/>
+<HashSize>11</HashSize>
+<Keys href="#ref-2"/>
+<Values href="#ref-3"/>
+</a1:Hashtable>
+<SOAP-ENC:Array id="ref-2" SOAP-ENC:arrayType="xsd:anyType[5]">
+<item id="ref-4" xsi:type="SOAP-ENC:string">Verify Music Files</item>
+<item id="ref-5" xsi:type="SOAP-ENC:string">Pile Files</item>
+<item id="ref-6" xsi:type="SOAP-ENC:string">Enumerate Files</item>
+<item id="ref-7" xsi:type="SOAP-ENC:string">Enumerate Files: BEGIN</item>
+<item id="ref-8" xsi:type="SOAP-ENC:string">Pile Files: BEGIN</item>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-3" SOAP-ENC:arrayType="xsd:anyType[5]">
+<item href="#ref-9"/>
+<item href="#ref-10"/>
+<item href="#ref-11"/>
+<item href="#ref-12"/>
+<item href="#ref-13"/>
+</SOAP-ENC:Array>
+<a3:Script id="ref-9" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-16"/>
+</a3:Script>
+<a3:Script id="ref-10" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-17"/>
+</a3:Script>
+<a3:Script id="ref-11" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-18"/>
+</a3:Script>
+<a3:Script id="ref-12" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-19"/>
+</a3:Script>
+<a3:Script id="ref-13" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-20"/>
+</a3:Script>
+<a4:LinkedList id="ref-16" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>3</count>
+<sentinels href="#ref-21"/>
+<enumeratorVersion>6</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a4:LinkedList id="ref-17" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>5</count>
+<sentinels href="#ref-22"/>
+<enumeratorVersion>10</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a4:LinkedList id="ref-18" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>4</count>
+<sentinels href="#ref-23"/>
+<enumeratorVersion>23</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a4:LinkedList id="ref-19" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>1</count>
+<sentinels href="#ref-24"/>
+<enumeratorVersion>2</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a4:LinkedList id="ref-20" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>1</count>
+<sentinels href="#ref-25"/>
+<enumeratorVersion>2</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<SOAP-ENC:Array id="ref-21" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-26"/>
+<item href="#ref-27"/>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-22" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-28"/>
+<item href="#ref-29"/>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-23" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-30"/>
+<item href="#ref-31"/>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-24" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-32"/>
+<item href="#ref-32"/>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-25" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-33"/>
+<item href="#ref-33"/>
+</SOAP-ENC:Array>
+<a4:LinkedListNode id="ref-26" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous xsi:null="1"/>
+<next href="#ref-35"/>
+<owner href="#ref-16"/>
+<value href="#ref-36"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-27" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-35"/>
+<next xsi:null="1"/>
+<owner href="#ref-16"/>
+<value href="#ref-38"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-28" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous xsi:null="1"/>
+<next href="#ref-39"/>
+<owner href="#ref-17"/>
+<value href="#ref-40"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-29" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-41"/>
+<next xsi:null="1"/>
+<owner href="#ref-17"/>
+<value href="#ref-42"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-30" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous xsi:null="1"/>
+<next href="#ref-43"/>
+<owner href="#ref-18"/>
+<value href="#ref-44"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-31" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-45"/>
+<next xsi:null="1"/>
+<owner href="#ref-18"/>
+<value href="#ref-46"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-32" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous xsi:null="1"/>
+<next xsi:null="1"/>
+<owner href="#ref-19"/>
+<value href="#ref-47"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-33" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous xsi:null="1"/>
+<next xsi:null="1"/>
+<owner href="#ref-20"/>
+<value href="#ref-48"/>
+</a4:LinkedListNode>
+<a4:LinkedListNode id="ref-35" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-26"/>
+<next href="#ref-27"/>
+<owner href="#ref-16"/>
+<value href="#ref-49"/>
+</a4:LinkedListNode>
+<a5:VerifyNameCommand id="ref-36" xmlns:a5="http://schemas.microsoft.com/clr/nsassem/Overbored.Modules.OverboredFileProcessor.Music/Overbored.Modules.OverboredFileProcessor.Music%2C%20Version%3D1.0.1105.31358%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<filePath id="ref-50">Path</filePath>
+<artistVariable id="ref-51">MusicArtist</artistVariable>
+<titleVariable id="ref-52">MusicTitle</titleVariable>
+<versionVariable id="ref-53">MusicVersion</versionVariable>
+<rankVariable id="ref-54">MusicRank</rankVariable>
+<artists href="#ref-55"/>
+<genres href="#ref-56"/>
+<corrections href="#ref-57"/>
+<caption id="ref-58">Verify the name of file Path against Launch.</caption>
+</a5:VerifyNameCommand>
+<a6:IfElseCommand id="ref-38" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-59">If MusicArtist equals "", then:</caption>
+<predicate>Equals</predicate>
+<leftVariable id="ref-60">MusicArtist</leftVariable>
+<rightVariable id="ref-61">""</rightVariable>
+<innerScript href="#ref-62"/>
+<ConditionalCommand_x002B_predicate>Equals</ConditionalCommand_x002B_predicate>
+<ConditionalCommand_x002B_leftVariable href="#ref-60"/>
+<ConditionalCommand_x002B_rightVariable href="#ref-61"/>
+<ConditionalCommand_x002B_innerScript href="#ref-62"/>
+</a6:IfElseCommand>
+<a4:LinkedListNode id="ref-39" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-28"/>
+<next href="#ref-63"/>
+<owner href="#ref-17"/>
+<value href="#ref-64"/>
+</a4:LinkedListNode>
+<a6:ExtractPathCommand id="ref-40" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-65">Extract file name from Path into variable FileName</caption>
+<pathComponent>FileName</pathComponent>
+<path id="ref-66">Path</path>
+<destinationVariable id="ref-67">FileName</destinationVariable>
+</a6:ExtractPathCommand>
+<a4:LinkedListNode id="ref-41" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-63"/>
+<next href="#ref-29"/>
+<owner href="#ref-17"/>
+<value href="#ref-68"/>
+</a4:LinkedListNode>
+<a6:IfElseCommand id="ref-42" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-69">If DestinationFileExists precedes or succeeds true, then:</caption>
+<predicate>Precedes, Succeeds</predicate>
+<leftVariable id="ref-70">DestinationFileExists</leftVariable>
+<rightVariable id="ref-71">true</rightVariable>
+<innerScript href="#ref-72"/>
+<ConditionalCommand_x002B_predicate>Precedes, Succeeds</ConditionalCommand_x002B_predicate>
+<ConditionalCommand_x002B_leftVariable href="#ref-70"/>
+<ConditionalCommand_x002B_rightVariable href="#ref-71"/>
+<ConditionalCommand_x002B_innerScript href="#ref-72"/>
+</a6:IfElseCommand>
+<a4:LinkedListNode id="ref-43" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-30"/>
+<next href="#ref-45"/>
+<owner href="#ref-18"/>
+<value href="#ref-73"/>
+</a4:LinkedListNode>
+<a6:SetVariableCommand id="ref-44" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-74">Set NewFileName equal to Counter</caption>
+<destinationVariable id="ref-75">NewFileName</destinationVariable>
+<source id="ref-76">Counter</source>
+</a6:SetVariableCommand>
+<a4:LinkedListNode id="ref-45" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-43"/>
+<next href="#ref-31"/>
+<owner href="#ref-18"/>
+<value href="#ref-77"/>
+</a4:LinkedListNode>
+<a6:NumericOperationCommand id="ref-46" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<operation>Add</operation>
+<leftVariable id="ref-78">Counter</leftVariable>
+<rightVariable id="ref-79">"1"</rightVariable>
+<targetVariable id="ref-80">Counter</targetVariable>
+<caption id="ref-81">Set Counter = Counter + "1"</caption>
+</a6:NumericOperationCommand>
+<a6:SetVariableCommand id="ref-47" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-82">Set Counter equal to "0"</caption>
+<destinationVariable id="ref-83">Counter</destinationVariable>
+<source id="ref-84">"0"</source>
+</a6:SetVariableCommand>
+<a6:SetVariableCommand id="ref-48" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-85">Set DestinationDirectoryPath equal to "C:\"</caption>
+<destinationVariable id="ref-86">DestinationDirectoryPath</destinationVariable>
+<source id="ref-87">"C:\"</source>
+</a6:SetVariableCommand>
+<a6:IfElseCommand id="ref-49" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-88">If MusicArtist precedes or succeeds "", then:</caption>
+<predicate>Precedes, Succeeds</predicate>
+<leftVariable id="ref-89">MusicArtist</leftVariable>
+<rightVariable id="ref-90">""</rightVariable>
+<innerScript href="#ref-91"/>
+<ConditionalCommand_x002B_predicate>Precedes, Succeeds</ConditionalCommand_x002B_predicate>
+<ConditionalCommand_x002B_leftVariable href="#ref-89"/>
+<ConditionalCommand_x002B_rightVariable href="#ref-90"/>
+<ConditionalCommand_x002B_innerScript href="#ref-91"/>
+</a6:IfElseCommand>
+<a5:TextList id="ref-55" xmlns:a5="http://schemas.microsoft.com/clr/nsassem/Overbored.Modules.OverboredFileProcessor.Music/Overbored.Modules.OverboredFileProcessor.Music%2C%20Version%3D1.0.1105.31358%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<table href="#ref-92"/>
+</a5:TextList>
+<a5:TextList id="ref-56" xmlns:a5="http://schemas.microsoft.com/clr/nsassem/Overbored.Modules.OverboredFileProcessor.Music/Overbored.Modules.OverboredFileProcessor.Music%2C%20Version%3D1.0.1105.31358%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<table href="#ref-93"/>
+</a5:TextList>
+<a5:TextCorrectionList id="ref-57" xmlns:a5="http://schemas.microsoft.com/clr/nsassem/Overbored.Modules.OverboredFileProcessor.Music/Overbored.Modules.OverboredFileProcessor.Music%2C%20Version%3D1.0.1105.31358%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<corrections href="#ref-94"/>
+</a5:TextCorrectionList>
+<a3:Script id="ref-62" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-95"/>
+</a3:Script>
+<a4:LinkedListNode id="ref-63" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<previous href="#ref-39"/>
+<next href="#ref-41"/>
+<owner href="#ref-17"/>
+<value href="#ref-96"/>
+</a4:LinkedListNode>
+<a6:ConcatenateTextCommand id="ref-64" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-97">String together DestinationDirectoryPath and FileName, and save to DestinationFilePath.</caption>
+<leftOperand id="ref-98">DestinationDirectoryPath</leftOperand>
+<rightOperand id="ref-99">FileName</rightOperand>
+<destinationVariable id="ref-100">DestinationFilePath</destinationVariable>
+</a6:ConcatenateTextCommand>
+<a6:IfElseCommand id="ref-68" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-101">If DestinationFileExists equals true, then:</caption>
+<predicate>Equals</predicate>
+<leftVariable id="ref-102">DestinationFileExists</leftVariable>
+<rightVariable id="ref-103">true</rightVariable>
+<innerScript href="#ref-104"/>
+<ConditionalCommand_x002B_predicate>Equals</ConditionalCommand_x002B_predicate>
+<ConditionalCommand_x002B_leftVariable href="#ref-102"/>
+<ConditionalCommand_x002B_rightVariable href="#ref-103"/>
+<ConditionalCommand_x002B_innerScript href="#ref-104"/>
+</a6:IfElseCommand>
+<a3:Script id="ref-72" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-105"/>
+</a3:Script>
+<a6:IfElseCommand id="ref-73" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-106">If Counter is less than "10", then:</caption>
+<predicate>LessThan</predicate>
+<leftVariable id="ref-107">Counter</leftVariable>
+<rightVariable id="ref-108">"10"</rightVariable>
+<innerScript href="#ref-109"/>
+<ConditionalCommand_x002B_predicate>LessThan</ConditionalCommand_x002B_predicate>
+<ConditionalCommand_x002B_leftVariable href="#ref-107"/>
+<ConditionalCommand_x002B_rightVariable href="#ref-108"/>
+<ConditionalCommand_x002B_innerScript href="#ref-109"/>
+</a6:IfElseCommand>
+<a6:RenameFileCommand id="ref-77" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-110">Rename the file Path to NewFileName, keeping the original extension</caption>
+<path id="ref-111">Path</path>
+<newName id="ref-112">NewFileName</newName>
+<keepsExtension>true</keepsExtension>
+</a6:RenameFileCommand>
+<a3:Script id="ref-91" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-113"/>
+</a3:Script>
+<a1:Hashtable id="ref-92" xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Collections">
+<LoadFactor>0.72</LoadFactor>
+<Version>830</Version>
+<Comparer xsi:null="1"/>
+<HashCodeProvider xsi:null="1"/>
+<HashSize>47</HashSize>
+<Keys href="#ref-114"/>
+<Values href="#ref-115"/>
+</a1:Hashtable>
+<a1:Hashtable id="ref-93" xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Collections">
+<LoadFactor>0.72</LoadFactor>
+<Version>6812</Version>
+<Comparer xsi:null="1"/>
+<HashCodeProvider xsi:null="1"/>
+<HashSize>239</HashSize>
+<Keys href="#ref-116"/>
+<Values href="#ref-117"/>
+</a1:Hashtable>
+<a1:Hashtable id="ref-94" xmlns:a1="http://schemas.microsoft.com/clr/ns/System.Collections">
+<LoadFactor>0.72</LoadFactor>
+<Version>2027</Version>
+<Comparer xsi:null="1"/>
+<HashCodeProvider xsi:null="1"/>
+<HashSize>107</HashSize>
+<Keys href="#ref-118"/>
+<Values href="#ref-119"/>
+</a1:Hashtable>
+<a4:LinkedList id="ref-95" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>1</count>
+<sentinels href="#ref-120"/>
+<enumeratorVersion>2</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a6:FilePropertiesCommand id="ref-96" xmlns:a6="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility.DefaultCommands/Overbored.FileProcessor.Extensibility.DefaultCommands%2C%20Version%3D1.0.1105.32235%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<caption id="ref-121">Access file properties</caption>
+<getAttribute>false</getAttribute>
+<getExists>true</getExists>
+<getSize>false</getSize>
+<getCreationTime>false</getCreationTime>
+<getLastAccessTime>false</getLastAccessTime>
+<getLastWriteTime>false</getLastWriteTime>
+<filePath id="ref-122">DestinationFilePath</filePath>
+<variableAttribute id="ref-123"></variableAttribute>
+<variableExists id="ref-124">DestinationFileExists</variableExists>
+<variableSize href="#ref-123"/>
+<variableCreationTime href="#ref-123"/>
+<variableLastAccessTime href="#ref-123"/>
+<variableLastWriteTime href="#ref-123"/>
+<attribute>Normal</attribute>
+</a6:FilePropertiesCommand>
+<a3:Script id="ref-104" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-125"/>
+</a3:Script>
+<a4:LinkedList id="ref-105" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>1</count>
+<sentinels href="#ref-126"/>
+<enumeratorVersion>2</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<a3:Script id="ref-109" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/Overbored.FileProcessor.Extensibility/Overbored.FileProcessor.Extensibility%2C%20Version%3D1.0.1104.16943%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<commands href="#ref-127"/>
+</a3:Script>
+<a4:LinkedList id="ref-113" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<Changed xsi:null="1"/>
+<Changing xsi:null="1"/>
+<isFixedSize>false</isFixedSize>
+<isReadOnly>false</isReadOnly>
+<isSynchronized>false</isSynchronized>
+<syncRoot xsi:type="xsd:anyType" xsi:null="1"/>
+<count>14</count>
+<sentinels href="#ref-128"/>
+<enumeratorVersion>28</enumeratorVersion>
+<iteratorVersion>0</iteratorVersion>
+</a4:LinkedList>
+<SOAP-ENC:Array id="ref-114" SOAP-ENC:arrayType="xsd:anyType[18]">
+<item id="ref-129" xsi:type="SOAP-ENC:string">AC/DC</item>
+<item id="ref-130" xsi:type="SOAP-ENC:string">Celine Dion</item>
+<item id="ref-131" xsi:type="SOAP-ENC:string">American Hi-Fi</item>
+<item id="ref-132" xsi:type="SOAP-ENC:string">Alanis Morissette</item>
+<item id="ref-133" xsi:type="SOAP-ENC:string">Guttermouth</item>
+<item id="ref-134" xsi:type="SOAP-ENC:string">Coldplay</item>
+<item id="ref-135" xsi:type="SOAP-ENC:string">Guns N' Roses</item>
+<item id="ref-136" xsi:type="SOAP-ENC:string">Christina Aguilera</item>
+<item id="ref-137" xsi:type="SOAP-ENC:string">Blink 182</item>
+<item id="ref-138" xsi:type="SOAP-ENC:string">Britney Spears</item>
+<item id="ref-139" xsi:type="SOAP-ENC:string">Weird Al Yankovic</item>
+<item id="ref-140" xsi:type="SOAP-ENC:string">Creedence Clearwater Revival</item>
+<item id="ref-141" xsi:type="SOAP-ENC:string">Tupac Shakur</item>
+<item id="ref-142" xsi:type="SOAP-ENC:string">Whitesnake</item>
+<item id="ref-143" xsi:type="SOAP-ENC:string">Sheryl Crow</item>
+<item id="ref-144" xsi:type="SOAP-ENC:string">Alient Ant Farm</item>
+<item id="ref-145" xsi:type="SOAP-ENC:string">Snoop Dogg</item>
+<item id="ref-146" xsi:type="SOAP-ENC:string">Alicia Keys</item>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-115" SOAP-ENC:arrayType="xsd:anyType[18]">
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-116" SOAP-ENC:arrayType="xsd:anyType[148]">
+<item id="ref-147" xsi:type="SOAP-ENC:string">Ethnic</item>
+<item id="ref-148" xsi:type="SOAP-ENC:string">National Folk</item>
+<item id="ref-149" xsi:type="SOAP-ENC:string">Vocal</item>
+<item id="ref-150" xsi:type="SOAP-ENC:string">Swing</item>
+<item id="ref-151" xsi:type="SOAP-ENC:string">Game</item>
+<item id="ref-152" xsi:type="SOAP-ENC:string">Beat</item>
+<item id="ref-153" xsi:type="SOAP-ENC:string">Oldies</item>
+<item id="ref-154" xsi:type="SOAP-ENC:string">Porn Groove</item>
+<item id="ref-155" xsi:type="SOAP-ENC:string">Acid Punk</item>
+<item id="ref-156" xsi:type="SOAP-ENC:string">Slow Rock</item>
+<item id="ref-157" xsi:type="SOAP-ENC:string">Power Ballad</item>
+<item id="ref-158" xsi:type="SOAP-ENC:string">Jazz+Funk</item>
+<item id="ref-159" xsi:type="SOAP-ENC:string">Cult</item>
+<item id="ref-160" xsi:type="SOAP-ENC:string">Christian Gangsta Rap</item>
+<item id="ref-161" xsi:type="SOAP-ENC:string">Opera</item>
+<item id="ref-162" xsi:type="SOAP-ENC:string">Ambient</item>
+<item id="ref-163" xsi:type="SOAP-ENC:string">Acid Jazz</item>
+<item id="ref-164" xsi:type="SOAP-ENC:string">Polsk Punk</item>
+<item id="ref-165" xsi:type="SOAP-ENC:string">Noise</item>
+<item id="ref-166" xsi:type="SOAP-ENC:string">Sound Clip</item>
+<item id="ref-167" xsi:type="SOAP-ENC:string">Ska</item>
+<item id="ref-168" xsi:type="SOAP-ENC:string">Acid</item>
+<item id="ref-169" xsi:type="SOAP-ENC:string">Funk</item>
+<item id="ref-170" xsi:type="SOAP-ENC:string">Meditative</item>
+<item id="ref-171" xsi:type="SOAP-ENC:string">Alternative</item>
+<item id="ref-172" xsi:type="SOAP-ENC:string">Celtic</item>
+<item id="ref-173" xsi:type="SOAP-ENC:string">Drum & Bass</item>
+<item id="ref-174" xsi:type="SOAP-ENC:string">Classical</item>
+<item id="ref-175" xsi:type="SOAP-ENC:string">Slow Jam</item>
+<item id="ref-176" xsi:type="SOAP-ENC:string">Pranks</item>
+<item id="ref-177" xsi:type="SOAP-ENC:string">Booty Bass</item>
+<item id="ref-178" xsi:type="SOAP-ENC:string">Dream</item>
+<item id="ref-179" xsi:type="SOAP-ENC:string">Pop/Funk</item>
+<item id="ref-180" xsi:type="SOAP-ENC:string">Psychedelic Rock</item>
+<item id="ref-181" xsi:type="SOAP-ENC:string">Dance Hall</item>
+<item id="ref-182" xsi:type="SOAP-ENC:string">Psychadelic</item>
+<item id="ref-183" xsi:type="SOAP-ENC:string">Rave</item>
+<item id="ref-184" xsi:type="SOAP-ENC:string">Pop-Folk</item>
+<item id="ref-185" xsi:type="SOAP-ENC:string">Big Band</item>
+<item id="ref-186" xsi:type="SOAP-ENC:string">Indie</item>
+<item id="ref-187" xsi:type="SOAP-ENC:string">Soundtrack</item>
+<item id="ref-188" xsi:type="SOAP-ENC:string">Gospel</item>
+<item id="ref-189" xsi:type="SOAP-ENC:string">Speech</item>
+<item id="ref-190" xsi:type="SOAP-ENC:string">Gothic</item>
+<item id="ref-191" xsi:type="SOAP-ENC:string">Punk</item>
+<item id="ref-192" xsi:type="SOAP-ENC:string">Trash Metal</item>
+<item id="ref-193" xsi:type="SOAP-ENC:string">Southern Rock</item>
+<item id="ref-194" xsi:type="SOAP-ENC:string">Bass</item>
+<item id="ref-195" xsi:type="SOAP-ENC:string">Anime</item>
+<item id="ref-196" xsi:type="SOAP-ENC:string">Rock & Roll</item>
+<item id="ref-197" xsi:type="SOAP-ENC:string">Jazz</item>
+<item id="ref-198" xsi:type="SOAP-ENC:string">Rock</item>
+<item id="ref-199" xsi:type="SOAP-ENC:string">Avantgarde</item>
+<item id="ref-200" xsi:type="SOAP-ENC:string">Metal</item>
+<item id="ref-201" xsi:type="SOAP-ENC:string">Trance</item>
+<item id="ref-202" xsi:type="SOAP-ENC:string">Trip-Hop</item>
+<item id="ref-203" xsi:type="SOAP-ENC:string">Musical</item>
+<item id="ref-204" xsi:type="SOAP-ENC:string">Revival</item>
+<item id="ref-205" xsi:type="SOAP-ENC:string">Symphonic Rock</item>
+<item id="ref-206" xsi:type="SOAP-ENC:string">Retro</item>
+<item id="ref-207" xsi:type="SOAP-ENC:string">Punk Rock</item>
+<item id="ref-208" xsi:type="SOAP-ENC:string">Terror</item>
+<item id="ref-209" xsi:type="SOAP-ENC:string">Folk</item>
+<item id="ref-210" xsi:type="SOAP-ENC:string">Humour</item>
+<item id="ref-211" xsi:type="SOAP-ENC:string">Freestyle</item>
+<item id="ref-212" xsi:type="SOAP-ENC:string">Fast-Fusion</item>
+<item id="ref-213" xsi:type="SOAP-ENC:string">Disco</item>
+<item id="ref-214" xsi:type="SOAP-ENC:string">Trailer</item>
+<item id="ref-215" xsi:type="SOAP-ENC:string">Techno-Industrial</item>
+<item id="ref-216" xsi:type="SOAP-ENC:string">Reggae</item>
+<item id="ref-217" xsi:type="SOAP-ENC:string">Country</item>
+<item id="ref-218" xsi:type="SOAP-ENC:string">Darkwave</item>
+<item id="ref-219" xsi:type="SOAP-ENC:string">Chamber Music</item>
+<item id="ref-220" xsi:type="SOAP-ENC:string">Chanson</item>
+<item id="ref-221" xsi:type="SOAP-ENC:string">Instrumental Pop</item>
+<item id="ref-222" xsi:type="SOAP-ENC:string">Sonata</item>
+<item id="ref-223" xsi:type="SOAP-ENC:string">Salsa</item>
+<item id="ref-224" xsi:type="SOAP-ENC:string">Merengue</item>
+<item id="ref-225" xsi:type="SOAP-ENC:string">Drum Solo</item>
+<item id="ref-226" xsi:type="SOAP-ENC:string">Acoustic</item>
+<item id="ref-227" xsi:type="SOAP-ENC:string">Bebob</item>
+<item id="ref-228" xsi:type="SOAP-ENC:string">Club</item>
+<item id="ref-229" xsi:type="SOAP-ENC:string">Dance</item>
+<item id="ref-230" xsi:type="SOAP-ENC:string">House</item>
+<item id="ref-231" xsi:type="SOAP-ENC:string">Rap</item>
+<item id="ref-232" xsi:type="SOAP-ENC:string">Eurodance</item>
+<item id="ref-233" xsi:type="SOAP-ENC:string">Easy Listening</item>
+<item id="ref-234" xsi:type="SOAP-ENC:string">Polka</item>
+<item id="ref-235" xsi:type="SOAP-ENC:string">Showtunes</item>
+<item id="ref-236" xsi:type="SOAP-ENC:string">Acapella</item>
+<item id="ref-237" xsi:type="SOAP-ENC:string">Soul</item>
+<item id="ref-238" xsi:type="SOAP-ENC:string">Gothic Rock</item>
+<item id="ref-239" xsi:type="SOAP-ENC:string">Duet</item>
+<item id="ref-240" xsi:type="SOAP-ENC:string">Techno</item>
+<item id="ref-241" xsi:type="SOAP-ENC:string">JPop</item>
+<item id="ref-242" xsi:type="SOAP-ENC:string">Industrial</item>
+<item id="ref-243" xsi:type="SOAP-ENC:string">Alternative Rock</item>
+<item id="ref-244" xsi:type="SOAP-ENC:string">Instrumental Rock</item>
+<item id="ref-245" xsi:type="SOAP-ENC:string">Bluegrass</item>
+<item id="ref-246" xsi:type="SOAP-ENC:string">Ballad</item>
+<item id="ref-247" xsi:type="SOAP-ENC:string">Club-House</item>
+<item id="ref-248" xsi:type="SOAP-ENC:string">Hard Rock</item>
+<item id="ref-249" xsi:type="SOAP-ENC:string">Hip-Hop</item>
+<item id="ref-250" xsi:type="SOAP-ENC:string">Instrumental</item>
+<item id="ref-251" xsi:type="SOAP-ENC:string">Contemporary Christian</item>
+<item id="ref-252" xsi:type="SOAP-ENC:string">New Age</item>
+<item id="ref-253" xsi:type="SOAP-ENC:string">Crossover</item>
+<item id="ref-254" xsi:type="SOAP-ENC:string">Latin</item>
+<item id="ref-255" xsi:type="SOAP-ENC:string">Goa</item>
+<item id="ref-256" xsi:type="SOAP-ENC:string">Christian Rap</item>
+<item id="ref-257" xsi:type="SOAP-ENC:string">BritPop</item>
+<item id="ref-258" xsi:type="SOAP-ENC:string">Other</item>
+<item id="ref-259" xsi:type="SOAP-ENC:string">Folk/Rock</item>
+<item id="ref-260" xsi:type="SOAP-ENC:string">R&B</item>
+<item id="ref-261" xsi:type="SOAP-ENC:string">Native American</item>
+<item id="ref-262" xsi:type="SOAP-ENC:string">Classic Rock</item>
+<item id="ref-263" xsi:type="SOAP-ENC:string">Symphony</item>
+<item id="ref-264" xsi:type="SOAP-ENC:string">Heavy Metal</item>
+<item id="ref-265" xsi:type="SOAP-ENC:string">Death Metal</item>
+<item id="ref-266" xsi:type="SOAP-ENC:string">Gangsta</item>
+<item id="ref-267" xsi:type="SOAP-ENC:string">Jungle</item>
+<item id="ref-268" xsi:type="SOAP-ENC:string">Christian Rock</item>
+<item id="ref-269" xsi:type="SOAP-ENC:string">New Wave</item>
+<item id="ref-270" xsi:type="SOAP-ENC:string">Lo-Fi</item>
+<item id="ref-271" xsi:type="SOAP-ENC:string">SynthPop</item>
+<item id="ref-272" xsi:type="SOAP-ENC:string">Fusion</item>
+<item id="ref-273" xsi:type="SOAP-ENC:string">Top 40</item>
+<item id="ref-274" xsi:type="SOAP-ENC:string">Electronic</item>
+<item id="ref-275" xsi:type="SOAP-ENC:string">Grunge</item>
+<item id="ref-276" xsi:type="SOAP-ENC:string">Space</item>
+<item id="ref-277" xsi:type="SOAP-ENC:string">Primus</item>
+<item id="ref-278" xsi:type="SOAP-ENC:string">Euro-Techno</item>
+<item id="ref-279" xsi:type="SOAP-ENC:string">Hardcore</item>
+<item id="ref-280" xsi:type="SOAP-ENC:string">Blues</item>
+<item id="ref-281" xsi:type="SOAP-ENC:string">Comedy</item>
+<item id="ref-282" xsi:type="SOAP-ENC:string">Tribal</item>
+<item id="ref-283" xsi:type="SOAP-ENC:string">Pop</item>
+<item id="ref-284" xsi:type="SOAP-ENC:string">Cabaret</item>
+<item id="ref-285" xsi:type="SOAP-ENC:string">Negerpunk</item>
+<item id="ref-286" xsi:type="SOAP-ENC:string">Chorus</item>
+<item id="ref-287" xsi:type="SOAP-ENC:string">Tango</item>
+<item id="ref-288" xsi:type="SOAP-ENC:string">Rhytmic Soul</item>
+<item id="ref-289" xsi:type="SOAP-ENC:string">Progressive Rock</item>
+<item id="ref-290" xsi:type="SOAP-ENC:string">Euro-House</item>
+<item id="ref-291" xsi:type="SOAP-ENC:string">Samba</item>
+<item id="ref-292" xsi:type="SOAP-ENC:string">Folklore</item>
+<item id="ref-293" xsi:type="SOAP-ENC:string">Satire</item>
+<item id="ref-294" xsi:type="SOAP-ENC:string">Black Metal</item>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-117" SOAP-ENC:arrayType="xsd:anyType[148]">
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-118" SOAP-ENC:arrayType="xsd:anyType[44]">
+<item id="ref-295" xsi:type="SOAP-ENC:string">snoop doggie dogg</item>
+<item id="ref-296" xsi:type="SOAP-ENC:string">brittany spears</item>
+<item id="ref-297" xsi:type="SOAP-ENC:string">gimme, gimme, gimme</item>
+<item id="ref-298" xsi:type="SOAP-ENC:string">weird al</item>
+<item id="ref-299" xsi:type="SOAP-ENC:string">aguilera</item>
+<item id="ref-300" xsi:type="SOAP-ENC:string">alien antfarm</item>
+<item id="ref-301" xsi:type="SOAP-ENC:string">ccr</item>
+<item id="ref-302" xsi:type="SOAP-ENC:string">acdc</item>
+<item id="ref-303" xsi:type="SOAP-ENC:string">wierd al yankovich</item>
+<item id="ref-304" xsi:type="SOAP-ENC:string">tupac</item>
+<item id="ref-305" xsi:type="SOAP-ENC:string">snoop doggy dog</item>
+<item id="ref-306" xsi:type="SOAP-ENC:string">snoop doggie dog</item>
+<item id="ref-307" xsi:type="SOAP-ENC:string">cold play</item>
+<item id="ref-308" xsi:type="SOAP-ENC:string">weird al yankovich</item>
+<item id="ref-309" xsi:type="SOAP-ENC:string">snoop dog</item>
+<item id="ref-310" xsi:type="SOAP-ENC:string">american hifi</item>
+<item id="ref-311" xsi:type="SOAP-ENC:string">snoop doggy</item>
+<item id="ref-312" xsi:type="SOAP-ENC:string">n sync</item>
+<item id="ref-313" xsi:type="SOAP-ENC:string">gimme gimme gimme</item>
+<item id="ref-314" xsi:type="SOAP-ENC:string">cheryl crow</item>
+<item id="ref-315" xsi:type="SOAP-ENC:string">brittney spears</item>
+<item id="ref-316" xsi:type="SOAP-ENC:string">cheryl crowe</item>
+<item id="ref-317" xsi:type="SOAP-ENC:string">ac dc</item>
+<item id="ref-318" xsi:type="SOAP-ENC:string">blink182</item>
+<item id="ref-319" xsi:type="SOAP-ENC:string">celine dione</item>
+<item id="ref-320" xsi:type="SOAP-ENC:string">alanis morrisette</item>
+<item id="ref-321" xsi:type="SOAP-ENC:string">snoop doggie</item>
+<item id="ref-322" xsi:type="SOAP-ENC:string">gutter mouth</item>
+<item id="ref-323" xsi:type="SOAP-ENC:string">britteny spears</item>
+<item id="ref-324" xsi:type="SOAP-ENC:string">alicia keyes</item>
+<item id="ref-325" xsi:type="SOAP-ENC:string">alanis morisette</item>
+<item id="ref-326" xsi:type="SOAP-ENC:string">christina</item>
+<item id="ref-327" xsi:type="SOAP-ENC:string">snoopdog</item>
+<item id="ref-328" xsi:type="SOAP-ENC:string">snoopdogg</item>
+<item id="ref-329" xsi:type="SOAP-ENC:string">alanis morrissette</item>
+<item id="ref-330" xsi:type="SOAP-ENC:string">snoop doggy dogg</item>
+<item id="ref-331" xsi:type="SOAP-ENC:string">2pac</item>
+<item id="ref-332" xsi:type="SOAP-ENC:string">white snake</item>
+<item id="ref-333" xsi:type="SOAP-ENC:string">guns and roses</item>
+<item id="ref-334" xsi:type="SOAP-ENC:string">wierd al</item>
+<item id="ref-335" xsi:type="SOAP-ENC:string">sheryl crowe</item>
+<item id="ref-336" xsi:type="SOAP-ENC:string">rendevous</item>
+<item id="ref-337" xsi:type="SOAP-ENC:string">2 pac</item>
+<item id="ref-338" xsi:type="SOAP-ENC:string">flavor of the week</item>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-119" SOAP-ENC:arrayType="xsd:anyType[44]">
+<item id="ref-339" xsi:type="SOAP-ENC:string">snoop dogg</item>
+<item id="ref-340" xsi:type="SOAP-ENC:string">britney spears</item>
+<item id="ref-341" xsi:type="SOAP-ENC:string">gimme! gimme! gimme!</item>
+<item id="ref-342" xsi:type="SOAP-ENC:string">weird al yankovic</item>
+<item id="ref-343" xsi:type="SOAP-ENC:string">christina aguilera</item>
+<item id="ref-344" xsi:type="SOAP-ENC:string">alient ant farm</item>
+<item id="ref-345" xsi:type="SOAP-ENC:string">creedence clearwater revival</item>
+<item id="ref-346" xsi:type="SOAP-ENC:string">ac/dc</item>
+<item href="#ref-342"/>
+<item id="ref-347" xsi:type="SOAP-ENC:string">tupac shakur</item>
+<item href="#ref-339"/>
+<item href="#ref-339"/>
+<item id="ref-348" xsi:type="SOAP-ENC:string">coldplay</item>
+<item href="#ref-342"/>
+<item href="#ref-339"/>
+<item id="ref-349" xsi:type="SOAP-ENC:string">american hi-fi</item>
+<item href="#ref-339"/>
+<item id="ref-350" xsi:type="SOAP-ENC:string">nsync</item>
+<item href="#ref-341"/>
+<item id="ref-351" xsi:type="SOAP-ENC:string">sheryl crow</item>
+<item href="#ref-340"/>
+<item href="#ref-351"/>
+<item href="#ref-346"/>
+<item id="ref-352" xsi:type="SOAP-ENC:string">blink 182</item>
+<item id="ref-353" xsi:type="SOAP-ENC:string">celine dion</item>
+<item id="ref-354" xsi:type="SOAP-ENC:string">alanis morissette</item>
+<item href="#ref-339"/>
+<item id="ref-355" xsi:type="SOAP-ENC:string">guttermouth</item>
+<item href="#ref-340"/>
+<item id="ref-356" xsi:type="SOAP-ENC:string">alicia keys</item>
+<item href="#ref-354"/>
+<item href="#ref-343"/>
+<item href="#ref-339"/>
+<item href="#ref-339"/>
+<item href="#ref-354"/>
+<item href="#ref-339"/>
+<item href="#ref-347"/>
+<item id="ref-357" xsi:type="SOAP-ENC:string">whitesnake</item>
+<item id="ref-358" xsi:type="SOAP-ENC:string">guns n' roses</item>
+<item href="#ref-342"/>
+<item href="#ref-351"/>
+<item id="ref-359" xsi:type="SOAP-ENC:string">rendezvous</item>
+<item href="#ref-347"/>
+<item id="ref-360" xsi:type="SOAP-ENC:string">flavor of the weak</item>
+</SOAP-ENC:Array>
+<SOAP-ENC:Array id="ref-120" SOAP-ENC:arrayType="a4:LinkedListNode[2]" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/Overbored.Utilities.Collections/Overbored.Utilities.Collections%2C%20Version%3D1.0.1101.35626%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
+<item href="#ref-361"/>
+<item href="#ref-361"/>
+</SOAP-ENC:Array>
+<a4:LinkedList id...
[truncated message content] |
|
From: <yan...@us...> - 2008-07-03 06:03:33
|
Revision: 868
http://assorted.svn.sourceforge.net/assorted/?rev=868&view=rev
Author: yangzhang
Date: 2008-07-02 23:03:40 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
more ancient stuff: imported fartris
Added Paths:
-----------
fartris/
fartris/trunk/
fartris/trunk/Fartris.tar.bz2
fartris/trunk/GDI.tar.bz2
fartris/trunk/README
fartris/trunk/Site/
fartris/trunk/Site/build.zip
fartris/trunk/Site/current.zip
fartris/trunk/Site/dx.zip
fartris/trunk/Site/dxsource.zip
fartris/trunk/Site/images/
fartris/trunk/Site/images/logo.gif
fartris/trunk/Site/index.html
fartris/trunk/Site/log.zip
fartris/trunk/Site/primer.zip
fartris/trunk/Site/reflection.zip
fartris/trunk/Site/tnt.zip
Added: fartris/trunk/Fartris.tar.bz2
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Fartris.tar.bz2
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/GDI.tar.bz2
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/GDI.tar.bz2
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/README
===================================================================
--- fartris/trunk/README (rev 0)
+++ fartris/trunk/README 2008-07-03 06:03:40 UTC (rev 868)
@@ -0,0 +1,10 @@
+Overview
+========
+
+This is a simple, retarded game I wrote for my high school senior project.
+
+I've compressed all the sources here because the resources (images and sounds)
+are uncomfortably large.
+
+The `Site/` directory also contains archives of the history of this program.
+(Back then I wasn't using version control, sadly.)
Added: fartris/trunk/Site/build.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/build.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/current.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/current.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/dx.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/dx.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/dxsource.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/dxsource.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/images/logo.gif
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/images/logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/index.html
===================================================================
--- fartris/trunk/Site/index.html (rev 0)
+++ fartris/trunk/Site/index.html 2008-07-03 06:03:40 UTC (rev 868)
@@ -0,0 +1,238 @@
+<html>
+<head>
+<title>Fartris - The Stinky Game</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF" text="#000000">
+<h2><img src="images/logo.gif" width="300" height="106" align="right">Fartris
+ v0.2.10b</h2>
+<p>by <a href="mailto:%20p...@ov...">Yang Zhang</a><br>
+ DirectX-Based Beta Release, Revision 10 (06/03/01)</p>
+<p><a href="#intro">Introduction/Backgrounder</a> • <a href="#downloads">Downloads</a>
+ • <a href="#info">Information</a> • <a href="#currentbugs">Current
+ Bug Reports</a> • <a href="#pastbugs">Past Bug Reports</a> • <a href="#gdi">GDI
+ Revision History</a> • <a href="#dx">DirectX Revision History</a> •
+ <a href="#links">Links</a></p>
+<h3><font color="#FF0000"><a name="intro"></a><b><font color="#FF0000">JUST </font></b>
+ ADDED:</font> Introduction/Backgrounder</h3>
+<p><b>UPDATES, 06/03/01:</b> Revision 10, 06/03/01: MP3 jukebox that plays any
+ MP3s in the \MUSIC\ directory; fixed MP3 unloading/rewinding (10 hours)</p>
+<p>Welcome to the official home page for <i>Fartris</i>. Currently, the page is
+ very simple (but comprehensive). Check back during mid-June for a full-blown
+ site.</p>
+<p>For those of you who don't know (in which case I'm deathly afraid to imagine
+ how you ended up here), <i>Fartris </i>is a computer game that I began in late
+ 2000 for my high school's senior project. It's still a work in progress, but
+ I'm planning to go really deep with this program into various different areas
+ (2D art, 2D real-time rendering, polygonal structures, 3D art, 3D real-time
+ rendering, music composition, sound effects and synthesis, MP3 playback, video
+ playback) because it would prove to be a terrific exercise in any aspect I want
+ to cover. It's not going to be easy trying to do all of these, however, and
+ I'm often busy with other things, so you'll just have to put up with my slow
+ pace.</p>
+<p>The game is very simple (relative to most commercial games on the market today),
+ but it's not bad for a beginner at <i>Windows </i>programming (that's right,
+ never did and, now that I know what it's like, probably never will again).</p>
+<p>Here are some documents I wrote depicting the process I went through.</p>
+<ul>
+ <li><a href="primer.zip">Game Design Theories: A Primer:</a> this is the research
+ paper that accompanied the hands-on project.</li>
+ <li><a href="log.zip">Activity Log:</a> this walks the reader through the entire
+ construction process, up through the final GDI revisions. (After that, I realized
+ I was too hard-pressed on time to to keep a thorough log while developing
+ simultaneously, but I have maintained a DirectX updates history below.)</li>
+ <li><a href="reflection.zip">Reflection</a>: a reflective summary of the culmination
+ of my experiences with <i>Fartris</i>. </li>
+</ul>
+<p>Anyway, have fun with the game, I really hope you enjoy it, even if for just
+ a few seconds before you hurl. =P</p>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="downloads"></a>Downloads</h3>
+<ul>
+ <li><a href="current.zip">CURRENT REVISION</a></li>
+ <li>Required Supplements: <a href="tnt.zip">AC, DC - TNT</a> (put in \MUSIC\
+ directory)</li>
+ <li><a href="clip.zip">Introductory Clip</a> (requires <a href="http://www.divx.com">DivX
+ ;-) codec</a>)</li>
+ <li><a href="dx.zip">All past DirectX revisions</a></li>
+ <li><a href="dxsource.zip">Last DirectX revision source code</a></li>
+ <li><a href="gdi.zip">All GDI revisions</a></li>
+ <li><a href="gdisource.zip">Last GDI revision source code</a></li>
+ <li><a href="extras.zip">Additional files required for GDI revisions</a></li>
+ <li>Optional Background Music: <a href="/music/z.mp3">0</a> (put in \MUSIC\
+ directory; I specifically made music riffing a part of my project, so feel
+ free to check it out)</li>
+</ul>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="info"></a>Information</h3>
+<p>OK, here's the basic premise of the game. You take control of one of two familiar
+ players (Terrance/Philip). You maneuver your player around the 8 horizontal
+ grids to catch the falling letters in a stack that sticks to the character,
+ but only in an order such that they spell "GAS", top-down, with as
+ many repetitions of A and S as you want (given that they're in order). If the
+ letters that are stacked up on you get out of order in any way, your collection
+ will "collapse"," leaving you to start over. Once you top off
+ your stack with a "G", you will have a complete spelling of "GAS",
+ which will then be added to your Gas Gauge.</p>
+<p>The Gas Gauge works as follows:</p>
+<p>"S" = +1 bar<br>
+ "A" = +2 bars<br>
+ "G" = multiply your total value of S's and A's by two</p>
+<p>This final value, doubled by the "G"-factor, is added to the Gauge.
+ Once this meter, which holds at most 50 bars, reaches 40 or above, you can press
+ the Release key to execute a fart, which in turn eliminates one of the spectators.
+ You'll be rewarded most if you can get the meter to exactly 50 bars, where Releasing
+ eliminates all of the spectators. If, however, you exceed 50, the game will
+ reset (you exploded). Releasing also deducts 30 from your meter.</p>
+<p>However, the tricky part (there's always a tricky part) is that each movement
+ you make to the left or right deducts one bar from your meter. So you get to
+ manage an economic system of time, points, and gas bars. I won't explain the
+ point system just yet 'cause I'm lazy and it isn't finalized, by it's kind of
+ a peripheral thing that you don't have to worry about.</p>
+<p>Here are the controls:</p>
+<p>ALL PLAYERS</p>
+<ul>
+ <li>Pause: P</li>
+ <li>Exit: Esc (not working yet, but it breaks the game)</li>
+ <li> F1: help (not working yet)</li>
+ <li>F2: new 1-player game</li>
+ <li>F3: new 2-player game</li>
+ <li>F4: end game</li>
+</ul>
+<p>PLAYER 1</p>
+<ul>
+ <li>Left: J</li>
+ <li> Right: L</li>
+ <li> Down: K</li>
+ <li> Release: Space</li>
+</ul>
+<p>PLAYER 2</p>
+<ul>
+ <li> Left: Left</li>
+ <li> Right: Right</li>
+ <li> Down: Down</li>
+ <li> Release: Insert</li>
+</ul>
+<p>It's pretty easy to get the hang of the game. Anyway, since you're all my beta-testers
+ (moohawhawhaw), I'd really appreciate it if you can report back with any bug
+ reports, etc. So it would actually be really great if you could invest the time
+ to bring this game to its knees (i.e. do the most unthinkable, random, unabiding
+ actions you can conceive to make the game crash or start acting weird or whatever).
+ Suggestions would also be nice, but please try to keep them reasonable, as this
+ project's due in a short amount of time (so none of that "Instead of falling
+ letters, make a game where you get to run, jump, and shoot at Pokemon!"
+ or whatever). One suggestion I'm dying for is what to replace these (boring)
+ letters with! Obviously, the most common thing that repeatedly comes up here
+ is food, but I've thought about it a lot and I can't seem to work it into this
+ design (for instance, it makes sense to arrange letters in order, but foods?).
+ Anyway the bottom line here is: please send me all your brilliant ideas!!!</p>
+<p>In its current stage of development, the game really isn't all too visually
+ appealing. Hopefully, once it's out of beta, it should work better. The reason
+ I first didn't make everything in DirectX (it uses Windows GDI currently, with
+ MFC-based windows, menu bars, etc.) is because I don't wanna screw up your systems.
+ So if anybody knows how to debug in full-screen capture, which is impossible
+ and if you know how you're a liar, please drop me a helpful line.</p>
+<p><b><font color="#FF0000">JUST ADDED:</font></b> Now that there's an internal
+ MP3 jukebox, feel free to put any of your favorite MP3s in the \MUSIC\ directory
+ for custom background music! This cuts down on size and adds to the ideal I'm
+ aiming this game toward: a software program that features everything but the
+ kitchen sink. Upon starting a new game, the program will randomly select a music
+ file to play, and once that one ends, it will randomly go on to another one.
+ The "AC, DC - TNT" theme MP3 must remain, however! That is the one
+ played at the title screen. <i>Winamp</i>, watch out!</p>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="currentbugs"></a>Current Bug Reports</h3>
+<ul>
+ <li>0.2.01-?: alt-tabbing out of the game kills it</li>
+ <li>0.0.00: "DIE, SONS OF BITCHES!" and "SOMEBODAY HELP MAH!"
+ mysteriously comes up in the middle of a game</li>
+ <li>0.0.00: doesn't have a photo of hottie André LaMothe</li>
+</ul>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="pastbugs"></a>Past Bug Reports (Remedied)</h3>
+<ul>
+ <li>0.2.09: MP3s keep playing even if another one begins; a mess of sound clutters
+ up speakers; <i>stopping MP3s doesn't unload them</i> (fixed in 0.2.10)</li>
+</ul>
+<p>Past problems (version associations lost):</p>
+<ul>
+ <li> 2->1 player transition leaves YOU LOST/WON! on second player's screen</li>
+ <li>4 spectators, not 8</li>
+ <li>enable overload explosion in singleplayer</li>
+ <li>re-adjust constants</li>
+ <li>a required dll is missing: msvcrtd.dll</li>
+ <li>the REVISION 12.exe file is linked to missing export MSVCRTD.DLL:_chkesp</li>
+ <li>a device attached to the system is not functioning</li>
+ <li>player position must be reset</li>
+ <li>player position must initialize to grid 0</li>
+ <li>build 12, not build 11</li>
+ <li>include MSVCRTD.DLL in \Windows\ directory</li>
+</ul>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="gdi"></a>Revision History: GDI</h3>
+<ul>
+ <li>Revision 01: falling letters (200 hours)</li>
+ <li>Revision 02: invisible player (30 minutes)</li>
+ <li>Revision 03: visible player (5 minutes)</li>
+ <li>Revision 04: moveable player (10 minutes) Problems: couldn't update instantly;
+ side collisions neglected</li>
+ <li>Revision 05: refreshed player on key-down, not thrower's timer; no more
+ odd character following "P" (10 minutes)</li>
+ <li>Revision 06: side collision detection (1 hour)</li>
+ <li>Revision 07: order handling (with beep), instant drop, collapse (2 hours)</li>
+ <li>Revision 08: gauge (1 hour)</li>
+ <li>Revision 09: fart; score (10 hours)</li>
+ <li>Revision 10: 2-player mode (1 hour)</li>
+ <li>Revision 11: fixed pausing; fixed "disappearing act"; separated
+ Score display (5 hours)</li>
+ <li>Revision 12: main menu; 1-player/2-player modes; end game function; seeded
+ randomization; all core features apparently working (except for ones </li>
+ <li>entioned below); ready for beta release!!! (10 hours)</li>
+ <li>*Revision 13, 5/11: tweaked gameplay constants and mechanics for more concise
+ sessions (to eliminate repetitiveness; drop key-holding enabled; fixed no-explosion
+ bug for single play; made non-debugging build (2 hours)</li>
+</ul>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="dx"></a>Revision History: DirectX</h3>
+<ul>
+ <li>Revision 01 [unsaved], 12/31/00: human-controlled "Hello, World!"
+ gliding around screen (approx. 500 hours)</li>
+ <li>Revision 02, 05/20/01: conversion to DirectX completed under "Testris";
+ fixed colors; fixed input; fixed crash-out bug (didn't construct new MASTERAREA);
+ cleaned up my code & parts of T3D libraries; fixed all linking problems;
+ still can't get DirectInput to work (emailed LaMothe) (30 hours)</li>
+ <li>Revision 03, 05/21/01: added graphical players (20 hours)</li>
+ <li>*Revision 04 [unsaved]: imported back to "Fartris"; repositioned
+ (centered) players; fixed (some) colors; updated (3 hours)</li>
+ <li>*Revision 05: removed mouse cursor; added borders; fixed all colors; fixed
+ positioning system; fixed super-spectator problem; updated _***_H's (5 hours)</li>
+ <li>*Revision 06: added music; added music jukebox; added sound; fixed positioning
+ system further; corrected transparency blitting (20 hours)</li>
+ <li>*Revision 07: removed mouse cursor earlier; visual meter gauge; fixed no-sound
+ problem; visual spectators; centered players' initial positions & resetted
+ positions; added winning/losing player sprites; fixed stack-overload bug;
+ hold results screen; replaced background, title, letters, score, and spectators
+ with images; added background toggle due to performance issues (20 hours)</li>
+ <li>*Revision 08: damn...can't remember what changes occurred (20 hours)</li>
+ <li>*Revision 09, 05/31/01 [unsaved; too big]: MP3 playback capability (40 hours)</li>
+ <li>*Revision 10, 06/03/01: MP3 jukebox that plays any MP3s in the \MUSIC\ directory;
+ fixed MP3 unloading/rewinding (10 hours)</li>
+</ul>
+<p>* corresponds to Release builds (as opposed to Debug builds, which are larger
+ in size but can be stepped through line-by-line of code for debugging purposes)</p>
+<p align="right"><a href="#">Back to top</a></p>
+<h3><a name="links"></a>Links</h3>
+<ul>
+ <li><a href="http://www.farts.com">Farts.com</a></li>
+ <li><a href="http://www.fart.com">Fart.com</a></li>
+ <li><a href="http://www.createafart.com">Create-A-Fart</a></li>
+ <li><a href="http://www.gamedev.net">GameDev.net</a></li>
+ <li><a href="http://www.xgames3d.com">Xtreme Games Ltd.</a></li>
+ <li><a href="http://www.southparkstudios.com">South Park Studios</a></li>
+ <li><a href="http://www.unoriginal.com">Unoriginal</a></li>
+ <li><a href="http://www.overbored.net">OvErboRed.net</a></li>
+</ul>
+<p align="right"><a href="#">Back to top</a></p>
+</body>
+</html>
Added: fartris/trunk/Site/log.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/log.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/primer.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/primer.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/reflection.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/reflection.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: fartris/trunk/Site/tnt.zip
===================================================================
(Binary files differ)
Property changes on: fartris/trunk/Site/tnt.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-03 05:42:14
|
Revision: 867
http://assorted.svn.sourceforge.net/assorted/?rev=867&view=rev
Author: yangzhang
Date: 2008-07-02 22:42:22 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
added old ti-86 data
Added Paths:
-----------
ti86/
ti86/trunk/
ti86/trunk/constants/
ti86/trunk/constants/AtmoPres.86k
ti86/trunk/constants/DEartSun.86k
ti86/trunk/constants/DEarthMn.86k
ti86/trunk/constants/DensAir.86k
ti86/trunk/constants/DensH2O.86k
ti86/trunk/constants/GGiga.86k
ti86/trunk/constants/MEarth.86k
ti86/trunk/constants/MMega.86k
ti86/trunk/constants/MMoon.86k
ti86/trunk/constants/MSun.86k
ti86/trunk/constants/REarth.86k
ti86/trunk/constants/RMoon.86k
ti86/trunk/constants/RSun.86k
ti86/trunk/constants/SpSound.86k
ti86/trunk/constants/TTera.86k
ti86/trunk/constants/cCenti.86k
ti86/trunk/constants/dDeci.86k
ti86/trunk/constants/daDeka.86k
ti86/trunk/constants/fFemto.86k
ti86/trunk/constants/hHecto.86k
ti86/trunk/constants/kKilo.86k
ti86/trunk/constants/mMilli.86k
ti86/trunk/constants/nNano.86k
ti86/trunk/constants/pPico.86k
ti86/trunk/constants/uMicro.86k
ti86/trunk/lists/
ti86/trunk/lists/fStat.86l
ti86/trunk/lists/xStat.86l
ti86/trunk/lists/yStat.86l
ti86/trunk/programs/
ti86/trunk/programs/Batteryz.86p
ti86/trunk/programs/Best Games.txt
ti86/trunk/programs/CONF.86P
ti86/trunk/programs/ConfInt.86p
ti86/trunk/programs/Eulers.86p
ti86/trunk/programs/Factor.86p
ti86/trunk/programs/IntRiem.86p
ti86/trunk/programs/IntSimp.86p
ti86/trunk/programs/IntTrap.86p
ti86/trunk/programs/Integral.86p
ti86/trunk/programs/LCDGCF.86p
ti86/trunk/programs/LngthEst.86p
ti86/trunk/programs/Newtons.86p
ti86/trunk/programs/Notes/
ti86/trunk/programs/Notes/CHECLIST.86p
ti86/trunk/programs/Notes/Ch01.86p
ti86/trunk/programs/Notes/Ch02.86p
ti86/trunk/programs/Notes/Ch03.86p
ti86/trunk/programs/Notes/Ch04.86p
ti86/trunk/programs/Notes/Ch05.86p
ti86/trunk/programs/Notes/Ch06.86p
ti86/trunk/programs/Notes/Ch07.86p
ti86/trunk/programs/Notes/Ch08.86p
ti86/trunk/programs/Notes/Ch09.86p
ti86/trunk/programs/Notes/Ch10.86p
ti86/trunk/programs/Notes/Ch12A.86p
ti86/trunk/programs/Notes/Ch12B.86p
ti86/trunk/programs/Notes/Ch12Q.86p
ti86/trunk/programs/Notes/Ch13.86p
ti86/trunk/programs/Notes/CheckRef.86p
ti86/trunk/programs/Notes/Derive.86p
ti86/trunk/programs/Notes/GenDefs.86p
ti86/trunk/programs/Notes/GenInfo.86p
ti86/trunk/programs/Notes/Hyper.86p
ti86/trunk/programs/Notes/NEWTONS.86P
ti86/trunk/programs/Notes/Physics.86p
ti86/trunk/programs/Notes/Physix2.86p
ti86/trunk/programs/Notes/Propertz.86p
ti86/trunk/programs/Notes/TrigID.86p
ti86/trunk/programs/NumGuess.86p
ti86/trunk/programs/PARTSUM.86p
ti86/trunk/programs/PHYSIX2.86P
ti86/trunk/programs/PolyDist.86p
ti86/trunk/programs/PolySolv.86p
ti86/trunk/programs/Programs.rar
ti86/trunk/programs/QuadSolv.86p
ti86/trunk/programs/RSolver.86p
ti86/trunk/programs/SHODAN.86p
ti86/trunk/programs/SHODAN2.86P
ti86/trunk/programs/StComp.86p
ti86/trunk/programs/Terms.86p
ti86/trunk/programs/VECTORS.86P
ti86/trunk/window setups/
ti86/trunk/window setups/DifEqRng.86w
ti86/trunk/window setups/FuncRng.86w
ti86/trunk/window setups/ParamRng.86w
ti86/trunk/window setups/PolarRng.86w
ti86/trunk/window setups/ZRCLRng.86w
Added: ti86/trunk/constants/AtmoPres.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/AtmoPres.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/DEartSun.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/DEartSun.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/DEarthMn.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/DEarthMn.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/DensAir.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/DensAir.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/DensH2O.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/DensH2O.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/GGiga.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/GGiga.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/MEarth.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/MEarth.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/MMega.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/MMega.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/MMoon.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/MMoon.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/MSun.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/MSun.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/REarth.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/REarth.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/RMoon.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/RMoon.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/RSun.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/RSun.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/SpSound.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/SpSound.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/TTera.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/TTera.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/cCenti.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/cCenti.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/dDeci.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/dDeci.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/daDeka.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/daDeka.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/fFemto.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/fFemto.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/hHecto.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/hHecto.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/kKilo.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/kKilo.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/mMilli.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/mMilli.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/nNano.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/nNano.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/pPico.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/pPico.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/constants/uMicro.86k
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/constants/uMicro.86k
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/lists/fStat.86l
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/lists/fStat.86l
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/lists/xStat.86l
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/lists/xStat.86l
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/lists/yStat.86l
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/lists/yStat.86l
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Batteryz.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Batteryz.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Best Games.txt
===================================================================
--- ti86/trunk/programs/Best Games.txt (rev 0)
+++ ti86/trunk/programs/Best Games.txt 2008-07-03 05:42:22 UTC (rev 867)
@@ -0,0 +1,7 @@
+arknoid2
+av
+ballistic
+bm86
+bomber
+boom
+catch
\ No newline at end of file
Added: ti86/trunk/programs/CONF.86P
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/CONF.86P
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/ConfInt.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/ConfInt.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Eulers.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Eulers.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Factor.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Factor.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/IntRiem.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/IntRiem.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/IntSimp.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/IntSimp.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/IntTrap.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/IntTrap.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Integral.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Integral.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/LCDGCF.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/LCDGCF.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/LngthEst.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/LngthEst.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Newtons.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Newtons.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/CHECLIST.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/CHECLIST.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch01.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch01.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch02.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch02.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch03.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch03.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch04.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch04.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch05.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch05.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch06.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch06.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch07.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch07.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch08.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch08.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch09.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch09.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch10.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch10.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch12A.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch12A.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch12B.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch12B.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch12Q.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch12Q.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Ch13.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Ch13.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/CheckRef.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/CheckRef.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Derive.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Derive.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/GenDefs.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/GenDefs.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/GenInfo.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/GenInfo.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Hyper.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Hyper.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/NEWTONS.86P
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/NEWTONS.86P
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Physics.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Physics.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Physix2.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Physix2.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/Propertz.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/Propertz.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Notes/TrigID.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Notes/TrigID.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/NumGuess.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/NumGuess.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/PARTSUM.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/PARTSUM.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/PHYSIX2.86P
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/PHYSIX2.86P
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/PolyDist.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/PolyDist.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/PolySolv.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/PolySolv.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Programs.rar
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Programs.rar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/QuadSolv.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/QuadSolv.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/RSolver.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/RSolver.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/SHODAN.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/SHODAN.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/SHODAN2.86P
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/SHODAN2.86P
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/StComp.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/StComp.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/Terms.86p
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/Terms.86p
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/programs/VECTORS.86P
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/programs/VECTORS.86P
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/window setups/DifEqRng.86w
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/window setups/DifEqRng.86w
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/window setups/FuncRng.86w
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/window setups/FuncRng.86w
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/window setups/ParamRng.86w
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/window setups/ParamRng.86w
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/window setups/PolarRng.86w
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/window setups/PolarRng.86w
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: ti86/trunk/window setups/ZRCLRng.86w
===================================================================
(Binary files differ)
Property changes on: ti86/trunk/window setups/ZRCLRng.86w
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-03 05:38:27
|
Revision: 866
http://assorted.svn.sourceforge.net/assorted/?rev=866&view=rev
Author: yangzhang
Date: 2008-07-02 22:38:30 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
recovered some ancient udpates that were sitting on old windows box
Modified Paths:
--------------
shell-tools/trunk/src/email-alert.bash
Modified: shell-tools/trunk/src/email-alert.bash
===================================================================
--- shell-tools/trunk/src/email-alert.bash 2008-07-02 19:50:18 UTC (rev 865)
+++ shell-tools/trunk/src/email-alert.bash 2008-07-03 05:38:30 UTC (rev 866)
@@ -15,6 +15,20 @@
-h display this help message
"
+while true ; do
+ echo -n start:\
+ date
+ count="$( grep "$@" "$(cygpath "$APPDATA")/Thunderbird/Profiles/default."*"/ImapMail/imap.csail.mit.edu/INBOX" | wc -l )"
+ if (( count > 2 )) ; then
+ "$(cygpath "$SYSTEMDRIVE")/Program Files/Windows Media Player/mplayer2.exe" "$sound"
+ fi
+ echo -n end:\
+ date
+ sleep $(( 10*60 ))
+done
+exit
+
+
while getopts 'hi:s:' opt ; do
case "$opt" in
h ) echo "$usage" ; exit ;;
@@ -28,7 +42,7 @@
do_alert=
date
while read pattern ; do
- if grep -qi "$pattern" "$(cygpath "$APPDATA")/Thunderbird/Profiles/default."*"/Mail/localhost/Inbox"
+ if ; then
echo " alert! $pattern"
do_alert=1
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-02 19:50:11
|
Revision: 865
http://assorted.svn.sourceforge.net/assorted/?rev=865&view=rev
Author: yangzhang
Date: 2008-07-02 12:50:18 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
added newbie normalization programs
Added Paths:
-----------
sandbox/trunk/src/hs/Normalize0.lhs
sandbox/trunk/src/hs/Normalize1.lhs
sandbox/trunk/src/hs/Normalize2.lhs
Added: sandbox/trunk/src/hs/Normalize0.lhs
===================================================================
--- sandbox/trunk/src/hs/Normalize0.lhs (rev 0)
+++ sandbox/trunk/src/hs/Normalize0.lhs 2008-07-02 19:50:18 UTC (rev 865)
@@ -0,0 +1,46 @@
+#!/usr/bin/env runhaskell
+
+This is one of my first attempts at writing Haskell. This sandbox contains
+three iterations of this program, which I went through while taking suggestions
+from people in #haskell.
+
+For each line from stdin, normalize the second field
+against the value specified on the command line.
+
+E.g., for input:
+ 1 200 lowest
+ 2 400 highest
+ 3 300
+ 4 400
+
+normalize should output:
+ 1 0.5 lowest
+ 2 1.0 highest
+ 3 0.75
+ 4 1.0
+
+> import System (getArgs)
+>
+> main = do
+> argv <- getArgs
+> interact $ (processLines (argv !! 0) (argv !! 1) (argv !! 2)) . lines
+> -- interact $ (uncurry processLines (take 3 argv)) . lines
+> -- getArgs >>= \argv -> (interact $ unlines . (processLines (head argv)) . lines)
+>
+> processLines operation max1 max2 ls = if operation == "max"
+> then show getMax
+> else unlines $ map normLine ls
+> where normLine = unwords . normWords . words
+> normLine :: String -> String
+> normWords ws = [head ws, normNumber ws] ++ (getRest ws)
+> normWords :: [String] -> [String]
+> getNumber = read . head . tail
+> getNumber :: [String] -> Double
+> getRest = drop 2
+> getRest :: [a] -> [a]
+> normNumber = show . (/ maxNumber) . getNumber
+> normNumber :: [String] -> String
+> maxNumber = max (read max1) (read max2)
+> maxNumber :: Double
+> getMax = maximum . (map (getNumber . words)) $ ls
+> getMax :: Double
Added: sandbox/trunk/src/hs/Normalize1.lhs
===================================================================
--- sandbox/trunk/src/hs/Normalize1.lhs (rev 0)
+++ sandbox/trunk/src/hs/Normalize1.lhs 2008-07-02 19:50:18 UTC (rev 865)
@@ -0,0 +1,35 @@
+#!/usr/bin/env runhaskell
+
+For each line from stdin, normalize the second (0-indexed) field
+against the value specified on the command line.
+
+E.g., for input:
+ 1 200 lowest
+ 2 400 highest
+ 3 300
+ 4 400
+
+normalize 1 400 should output:
+ 1 0.5 lowest
+ 2 1.0 highest
+ 3 0.75
+ 4 1.0
+
+> import System (getArgs)
+>
+> main = do
+> argv <- getArgs
+> interact $ (processLines (read (argv !! 0)) (read (argv !! 1))) . lines
+>
+> processLines :: Int -> Float -> [String] -> String
+> processLines index maxNumber ls = unlines $ map normLine ls
+> where normLine :: String -> String
+> normLine = unwords . normWords . words
+> normWords :: [String] -> [String]
+> normWords ws = before ++ middle ++ after
+> where before :: [String]
+> before = take index ws
+> middle :: [String]
+> middle = [show . (/ maxNumber) . read $ ws !! index]
+> after :: [String]
+> after = drop (index + 1) ws
Added: sandbox/trunk/src/hs/Normalize2.lhs
===================================================================
--- sandbox/trunk/src/hs/Normalize2.lhs (rev 0)
+++ sandbox/trunk/src/hs/Normalize2.lhs 2008-07-02 19:50:18 UTC (rev 865)
@@ -0,0 +1,35 @@
+#!/usr/bin/env runhaskell
+
+For each line from stdin, normalize the second (0-indexed) field
+against the value specified on the command line.
+
+E.g., for input:
+ 1 200 lowest
+ 2 400 highest
+ 3 300
+ 4 400
+
+normalize 1 400 should output:
+ 1 0.5 lowest
+ 2 1.0 highest
+ 3 0.75
+ 4 1.0
+
+> import System (getArgs)
+>
+> main = do
+> [arg0, arg1] <- getArgs
+> interact $ normalize (read arg0) (read arg1)
+>
+> normalize :: Int -> Float -> String -> String
+> normalize index maxNumber = processLines (processField index (/ maxNumber))
+>
+> processLines :: ([[String]] -> [[String]]) -> String -> String
+> processLines f = unlines . (map unwords) . f . (map words) . lines
+>
+> processField :: (Read a, Show a) => Int -> (a -> a) -> [[String]] -> [[String]]
+> processField index f = map (mapAt index (show . f . read))
+>
+> mapAt :: Int -> (a -> a) -> [a] -> [a]
+> mapAt index f ws = before ++ (f middle) : after
+> where (before, middle : after) = splitAt index ws
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-02 06:48:08
|
Revision: 864
http://assorted.svn.sourceforge.net/assorted/?rev=864&view=rev
Author: yangzhang
Date: 2008-07-01 23:48:11 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
forgot tests; updated wavelet.[ch] to latest?
Modified Paths:
--------------
tcq-wavelets/trunk/Test/wavelet.c
tcq-wavelets/trunk/Test/wavelet.h
Added Paths:
-----------
tcq-wavelets/trunk/Test/tests.tar.bz2
Added: tcq-wavelets/trunk/Test/tests.tar.bz2
===================================================================
(Binary files differ)
Property changes on: tcq-wavelets/trunk/Test/tests.tar.bz2
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: tcq-wavelets/trunk/Test/wavelet.c
===================================================================
--- tcq-wavelets/trunk/Test/wavelet.c 2008-07-02 06:41:27 UTC (rev 863)
+++ tcq-wavelets/trunk/Test/wavelet.c 2008-07-02 06:48:11 UTC (rev 864)
@@ -5,9 +5,13 @@
// TODO how to get rid of blanket noise?
// TASKS
+// TODO move all decls to top
+// TODO change // ... to /* ... */
// TODO output as table
+// TODO add checks / assertions on integrity of wcs (as fred did for hist)
// TODO handle multiple join, proj dimensions at a time (did I already do this? I forget....)
// TODO change dims to arrays, rename vars, remove the need for toasting, work with giant structure directly!
+// TODO add profiling calls
// TODO speed up equijoin
// TODO pfree stuff
@@ -43,6 +47,7 @@
#else
+#include "telegraphcq/histogram.h"
#include "telegraphcq/wavelet.h"
// TODO check
@@ -1733,7 +1738,7 @@
return l < r ? -1 : l > r ? 1 : 0;
}
-void renderhelper(WCS* wcs, LL* coeff, int i, double** c) {
+void renderhelper(WCS* wcs, LL* coeff, int i, double** c, mhist* h) {
//PL("\n");
//PL("renderhelper start (i = %d)\n", i);
//PI();
@@ -1780,6 +1785,11 @@
return;
}
+#ifdef RENDER_HIST
+ int* minvals = (int*) malloc(wcs->dims.count * sizeof(int));
+ int* maxvals = (int*) malloc(wcs->dims.count * sizeof(int));
+#endif
+
// output (w.r.boundary, count)
PL("v = % 2.3f\n", count);
if (mwc != NULL) { // TODO check
@@ -1790,8 +1800,14 @@
Assert(j < wcs->dims.count);
DI* di = (DI*) lln->value;
DN* dn = mwc->a[j];
+#ifdef RENDER_HIST
+ // TODO change to use unseg() instead?
+ minvals[j] = (int) dn->rl;
+ maxvals[j] = (int) dn->rh;
+#else
PL("\t%d : [ %d : %d ] or [ %f : %f ]\n", j,
dn->rl, dn->rh, unseg(wcs, di, dn->rl), unseg(wcs, di, dn->rh + 1));
+#endif
if (c != NULL) {
switch (j) {
case 0:
@@ -1815,6 +1831,10 @@
}
}
+#ifdef RENDER_HIST
+ add_bucket_to_mhist(hist, minvals, maxvals, count);
+#endif
+
//PUI();
//PL("renderhelper end\n");
//PL("\n");
@@ -1931,7 +1951,7 @@
LL_add(&temp2, plln);
}
}
- renderhelper(wcs, &temp2, i + 1, c);
+ renderhelper(wcs, &temp2, i + 1, c, h);
prev = topkey;
}
@@ -2124,7 +2144,20 @@
c[i] = (double*) wcalloc(s, sizeof(double));
}
}
- renderhelper(wcs, &ll, 0, c);
+ mhist* h = NULL;
+#ifdef RENDER_HIST
+ // TODO be more conservative with size estimate, use create_bigger_mhist as needed
+#define MAX_BUCKETS 65536
+ int nbuckets = min(MAX_BUCKETS, pow(1 << wcs->m, wcs->dims.count));
+ h = create_mhist(nbuckets, wcs->dims.count);
+ char** cols = (char**) malloc(sizeof(char*) * wcs->dims.count);
+ int j = 0;
+ for (j = 0; j < wcs->dims.count; j++) {
+ cols[j] = wcs->dims[j];
+ }
+ mhist_set_nameinfo(h, /* TODO change */ "placeholder", cols, wcs->dims.count);
+ renderhelper(wcs, &ll, 0, c, hist, &h);
+#endif // RENDER_HIST
if (c != NULL) {
int i, j;
for (i = 0; i < s; i++) {
@@ -2417,6 +2450,166 @@
}
#endif
+//void render_table(WCS* wcs) {
+// FuncCallContext *funcctx = NULL;
+// wcs_to_table_state *state = NULL;
+///* TupleDesc tupdesc;*/
+// char typename[128];
+//
+// if (SRF_IS_FIRSTCALL()) {
+// MemoryContext oldcontext;
+//
+// funcctx = SRF_FIRSTCALL_INIT();
+//
+// /*elog(LOG, "mhist_to_table(): Starting first-call setup.");*/
+//
+//
+// /* Create the data structure that will remember the status of this
+// * function. */
+// oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+// state = palloc(sizeof(*state));
+// MemoryContextSwitchTo(oldcontext);
+//
+// state->current_wavelet = 0;
+// state->num_wavelets = wcs->coefs.count;
+//
+// /* Generate the name of the type that corresponds to the histogram's
+// * number of dimensions. */
+// snprintf(typename, sizeof(typename), "__wcs%d", wcs->dims.count);
+//
+// /* Postgres SRF crap has been moved to this function: */
+// srf_firstcall_junk(funcctx, state,
+// wcs->coefs.count, typename);
+//
+// /*elog(LOG, "mhist_to_table(): Done with first-call setup.");*/
+// }
+//
+// /* Stuff that gets done every time the function is called: */
+// funcctx = SRF_PERCALL_SETUP();
+//
+// state = (wcs_to_table_state*)(funcctx->user_fctx);
+//
+// while (state->current_wavelet < state->num_wavelets) {
+// WC* wc = (WC*) wcs->coefs.nodes[state->current_wavelet];
+// if (wc->e)
+// break;
+// state->current_wavelet++;
+// }
+//
+// /* Are we done returning tuples? */
+// if (state->current_wavelet < state->num_wavelets) {
+// char **values;
+// int numvalues = -1;
+// HeapTuple tuple;
+// Datum result;
+// int valid = -1;
+//
+// /*
+// elog(LOG, "mhist_to_table(): Generating tuple for bucket %d (%d total).",
+// state->current_bucket, state->num_buckets);
+// */
+//
+// /* Not done returning tuples -- construct the next one. */
+// /* For the sake of simplicity, we convert the field values into strings
+// * and then back into values. */
+//
+// numvalues = 2 * hist->dims.count + 2;
+// /* Number of items in row == 2 + (2 x number of dimensions:
+// * 1 column for the bucketID (not strictly necessary)
+// * 1 column for the bucket's count
+// * 2 columns per dimension to hold min and max values.
+// */
+//
+// /*elog(LOG, "mhist_to_table(): This tuple has %d fields.",
+// numvalues);*/
+//
+// /* Build up the array of string values. */
+// values = (char**)palloc(sizeof(char*) * (numvalues));
+//
+// for (valid = 0; valid < numvalues; valid++) {
+// values[valid] = (char*)palloc(32 * sizeof(char));
+// }
+//
+// /* Fill in the array. */
+// for (valid = 0; valid < numvalues; valid++) {
+// if (0 == valid) {
+// /* First entry is the bucketid. */
+// snprintf(values[valid], 32, "%d", state->current_wavelet);
+//
+// } else if (numvalues - 1 == valid) {
+// /* Last entry is the bucket count. */
+// mhist_bucket *cur_bucket =
+// MHIST_BUCKET_PTR(hist, state->current_bucket);
+// /*
+// snprintf(values[valid], 32, "%d",
+// (int)(cur_bucket->count + 0.5));
+// */
+// /* Round up if necessary */
+// snprintf(values[valid], 32, "%f",
+// (cur_bucket->count));
+//
+// } else {
+// /* valid > 0 and < (numvalues-1) */
+// /* Entries between first and last are the bounds of the
+// * rectangle that comprises this bucket. These entries
+// * alternate between the lower and upper bound. */
+// int dimid = (valid - 1) / 2;
+// bool is_min = (valid % 2 == 1);
+// /* Is this a lower or upper bound? */
+// mhist_bucket *cur_bucket =
+// MHIST_BUCKET_PTR(hist, state->current_bucket);
+// snprintf(values[valid], 32, "%d",
+// is_min ?
+// cur_bucket->diminfo[dimid].min_val
+// : cur_bucket->diminfo[dimid].max_val);
+// }
+//
+// /*elog(LOG, "mhist_to_table(): Value %d is '%s'.",
+// valid, values[valid]);*/
+//
+// }
+//
+// /*elog(LOG, "mhist_to_table(): Done generating values.");*/
+//
+// /* Construct the tuple for the strings. */
+// tuple = BuildTupleFromCStrings(funcctx->attinmeta, values);
+//
+// /*elog(LOG, "mhist_to_table(): Done building tuple.");*/
+//
+// /* Make the tuple into a datum. */
+// result = TupleGetDatum(funcctx->slot, tuple);
+//
+// /* Clean up. */
+// for (valid = 0; valid < hist->hdr.numDims; valid++) {
+// /*elog(LOG, "mhist_to_table(): Freeing field %d of a tuple.",
+// valid);*/
+// pfree(values[valid]);
+// }
+// /*elog(LOG, "mhist_to_table(): Freeing holder for tuple %d.",
+// state->current_bucket);*/
+// pfree(values);
+//
+// /*elog(LOG, "mhist_to_table(): Done generating tuple for bucket %d.",
+// state->current_bucket);*/
+//
+// ++(state->current_bucket);
+//
+// // PROF_EXIT_FUNCTION("mhist_to_table");
+//
+// SRF_RETURN_NEXT(funcctx, result);
+// } else {
+// /*elog(LOG, "mhist_to_table(): Cleaning up.");*/
+//
+// /* here we are done returning items, and just need to clean up: */
+// srf_cleanup(funcctx);
+//
+// // PROF_EXIT_FUNCTION("mhist_to_table");
+//
+// SRF_RETURN_DONE(funcctx);
+// }
+//}
+
+
#ifndef STANDALONE
// renders the WCS to human-readable form to the log (and returns "blah").
// Currently simpleRender() is used, but it's inefficient,
Modified: tcq-wavelets/trunk/Test/wavelet.h
===================================================================
--- tcq-wavelets/trunk/Test/wavelet.h 2008-07-02 06:41:27 UTC (rev 863)
+++ tcq-wavelets/trunk/Test/wavelet.h 2008-07-02 06:48:11 UTC (rev 864)
@@ -34,6 +34,11 @@
#define false ((bool) 0)
#endif
+// this structure is not used
+typedef struct mhist {
+ int dummy;
+} mhist;
+
typedef struct HeapTupleData {
double* values;
//uint32 t_len; /* length of *t_data */
@@ -76,6 +81,7 @@
#else /////////////////////////////////////////////////////
+#define RENDER_HIST
#define STDERR
#include "postgres.h"
@@ -218,7 +224,7 @@
//
typedef struct PQ {
int maxCount;
- int count;
+ int count; // this is the number of occupied slots in the PQ, not the number of enabled nodes
void** nodes;
int (*compare)(void*, void*);
} PQ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-02 06:41:17
|
Revision: 863
http://assorted.svn.sourceforge.net/assorted/?rev=863&view=rev
Author: yangzhang
Date: 2008-07-01 23:41:27 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added binary IO demo
Added Paths:
-----------
sandbox/trunk/src/cc/binaryio.cc
Added: sandbox/trunk/src/cc/binaryio.cc
===================================================================
--- sandbox/trunk/src/cc/binaryio.cc (rev 0)
+++ sandbox/trunk/src/cc/binaryio.cc 2008-07-02 06:41:27 UTC (rev 863)
@@ -0,0 +1,24 @@
+#include <iostream>
+#include <fstream>
+using namespace std;
+int main() {
+ ofstream os;
+ double data = 534.663;
+ os.open("outfile", ios::out | ios::trunc | ios::binary);
+ if (os.is_open()) {
+ os.write(reinterpret_cast<char*>(&data), sizeof(data));
+ os.close();
+ }
+
+ ifstream is;
+ double data2 = 0;
+ is.open("outfile", ios::in | ios::binary);
+ if (is.is_open()) {
+ is.read(reinterpret_cast<char*>(&data2), sizeof(data2));
+ is.close();
+ }
+
+ cout << data2;
+
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-07-02 06:37:47
|
Revision: 862
http://assorted.svn.sourceforge.net/assorted/?rev=862&view=rev
Author: yangzhang
Date: 2008-07-01 23:37:56 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added tcq wavelets
Added Paths:
-----------
tcq-wavelets/
tcq-wavelets/trunk/
tcq-wavelets/trunk/Test/
tcq-wavelets/trunk/Test/Backup/
tcq-wavelets/trunk/Test/Backup/histogram.c
tcq-wavelets/trunk/Test/Backup/histogram.h
tcq-wavelets/trunk/Test/Backup/pg_proc.h
tcq-wavelets/trunk/Test/Backup/pg_type.h
tcq-wavelets/trunk/Test/Backup/shedding.c
tcq-wavelets/trunk/Test/Backup/shedding.h
tcq-wavelets/trunk/Test/Backup/wavelet.c
tcq-wavelets/trunk/Test/Backup/wavelet.h
tcq-wavelets/trunk/Test/Backup/wrapch.c
tcq-wavelets/trunk/Test/Copy (2) of Test.cpp
tcq-wavelets/trunk/Test/Copy (2) of wavelet.c
tcq-wavelets/trunk/Test/Copy (2) of wavelet.h
tcq-wavelets/trunk/Test/Copy (3) of wavelet.c
tcq-wavelets/trunk/Test/Copy (3) of wavelet.h
tcq-wavelets/trunk/Test/Copy (4) of wavelet.c
tcq-wavelets/trunk/Test/Copy (4) of wavelet.h
tcq-wavelets/trunk/Test/Copy (5) of wavelet.c
tcq-wavelets/trunk/Test/Copy (5) of wavelet.h
tcq-wavelets/trunk/Test/Copy (6) of wavelet.c
tcq-wavelets/trunk/Test/Copy (6) of wavelet.h
tcq-wavelets/trunk/Test/Copy (7) of wavelet.c
tcq-wavelets/trunk/Test/Copy (7) of wavelet.h
tcq-wavelets/trunk/Test/Copy (8) of wavelet.c
tcq-wavelets/trunk/Test/Copy (8) of wavelet.h
tcq-wavelets/trunk/Test/Copy of Test.cpp
tcq-wavelets/trunk/Test/Copy of wavelet.c
tcq-wavelets/trunk/Test/Copy of wavelet.h
tcq-wavelets/trunk/Test/Test.ncb
tcq-wavelets/trunk/Test/Test.sln
tcq-wavelets/trunk/Test/Test.suo
tcq-wavelets/trunk/Test/Test.vcproj
tcq-wavelets/trunk/Test/stdafx.cpp
tcq-wavelets/trunk/Test/stdafx.h
tcq-wavelets/trunk/Test/wavelet.c
tcq-wavelets/trunk/Test/wavelet.h
Added: tcq-wavelets/trunk/Test/Backup/histogram.c
===================================================================
--- tcq-wavelets/trunk/Test/Backup/histogram.c (rev 0)
+++ tcq-wavelets/trunk/Test/Backup/histogram.c 2008-07-02 06:37:56 UTC (rev 862)
@@ -0,0 +1,3741 @@
+/*
+ * PostgreSQL type definitions for built-in histogram data types.
+ *
+ * $Header: /project/eecs/db/cvsroot/postgres/src/backend/telegraphcq/histogram.c,v 1.23 2004/05/14 21:29:14 yangsta Exp $
+ */
+
+#include <ctype.h>
+#include <sys/time.h> // yang
+
+ /* For toupper(3) */
+
+#include "postgres.h"
+
+#include "access/hash.h"
+#include "executor/spi.h"
+#include "funcapi.h"
+#include "lib/stringinfo.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
+#include "utils/relcache.h"
+
+#include "utils/lsyscache.h"
+ /* For get_typlenbyval() function. */
+
+
+#include "telegraphcq/shedding.h"
+#include "telegraphcq/histogram.h"
+
+
+#define ENABLE_STREAM_STATE_CHECKS
+
+/*******************************************************************************
+ * INTERNAL DATA STRUCTURES
+ ******************************************************************************/
+
+/* Used for passing maxdiff information back.
+ *
+ * In particular, get_maxdiffs() returns a pointer to an array of these, one per
+ * bucket. */
+typedef struct bucket_maxdiff_info {
+ int abs;
+ /* The absolute difference between two adjacent tuples when sorted
+ * along a particular dimension. */
+
+ int dimid;
+ /* The dimension along which this difference occurs. */
+
+ double norm;
+ /* Normalized to the min. and max. values along this dimension. */
+
+} bucket_maxdiff_info;
+
+
+/*******************************************************************************
+ * PROTOTYPES FOR INTERNAL FUNCTIONS
+ ******************************************************************************/
+
+static mhist * real_mhist_in(char *relname,
+ char **cols,
+ int ncols,
+ int num_buckets);
+
+static void mhist_set_nameinfo(mhist *hist, char *relname,
+ char **cols, int ncols);
+
+static HeapTuple *get_table_as_array(char *relname, char **cols, int ncols,
+ int *ntuples, TupleDesc *descdest);
+
+static bool split_a_bucket(HeapTuple *giant_tup_array, int ntuples,
+ TupleDesc desc,
+ int *bucket_offsets, int *bucket_lengths, mhist *hist,
+ mhist_dim_info *ranges, int nbuckets_done);
+
+static void sort_tuples_along_dim(HeapTuple *tuples, int length, int dimid,
+ TupleDesc desc);
+
+static void load_mhist(char *relname, char **cols, mhist *hist);
+
+static mhist * create_mhist_copy(const mhist *orig);
+static mhist * create_bigger_mhist(mhist *hist);
+
+mhist * create_proj_mhist(const mhist * original, int dim);
+
+void srf_firstcall_junk(FuncCallContext *funcctx, void *state, int max_calls,
+ char *typename);
+
+void srf_cleanup(FuncCallContext *funcctx);
+
+mhist_dim_info * get_ranges(HeapTuple *giant_tup_array, int ntuples,
+ TupleDesc desc, int ndims);
+
+bucket_maxdiff_info *get_maxdiffs(
+ HeapTuple *giant_tup_array,
+ TupleDesc desc,
+ const int *bucket_offsets,
+ const int *bucket_lengths,
+ int nbuckets_done,
+ const mhist_dim_info *ranges);
+
+int get_mhist_bucket_for_tuple(mhist *hist, HeapTuple tuple, TupleDesc desc);
+
+mhist * real_mhist_project(mhist *inhist, int32 proj_dim);
+
+void project_mhist_bucket(mhist_bucket *src, mhist_bucket *dest,
+ int ndims, int proj_dim);
+
+void remove_empty_mhist_buckets(mhist *hist);
+
+mhist *merge_overlapping_mhist_buckets(mhist *hist);
+
+mhist *really_merge_overlapping_mhist_buckets(mhist *hist, bool *found_overlap,
+ bool verbose);
+
+mhist *merge_two_overlapping_buckets(mhist *hist,
+ int left_bucketid, int right_bucketid, bool verbose);
+
+void cut_top_off_mhist_bucket(mhist_bucket *bucket_ptr, int dimid, int new_max);
+
+void cut_bottom_off_mhist_bucket(mhist_bucket *bucket_ptr, int dimid,
+ int new_min);
+
+bool potential_overlap(mhist_bucket *left_bucket, mhist_bucket *right_bucket,
+ int ndims);
+
+double mhist_total_count(mhist *hist);
+
+char *mhist_to_str(mhist *hist);
+
+mhist * mhist_cross_product(const mhist *hist1, const mhist *hist2);
+
+void mhist_equality_select_in_place(mhist *hist, int dim1, int dim2);
+
+void check_mhist_integrity(const mhist *hist, const char *id);
+
+void get_mhist_split_point(HeapTuple *giant_tup_array, TupleDesc desc,
+ const int *bucket_offsets,
+ const int *bucket_lengths,
+ int nbuckets_done,
+ const mhist_dim_info *ranges,
+ int *split_bucketid, int *split_dimid, int *split_offset);
+
+bool no_buckets_to_split(HeapTuple *giant_tup_array,
+ const int *bucket_offsets,
+ const int *bucket_lengths,
+ int nbuckets_done,
+ TupleDesc desc);
+
+void mhist_stream_load_buckets(mhist_stream_state *state);
+
+void mhist_create_buckets(mhist *hist, HeapTuple *tuparr, int ntups,
+ TupleDesc desc);
+
+void tdesc_to_mhist_diminfo(mhist *hist, TupleDesc desc);
+
+mhist * create_reg_mhist(HeapTuple *tups, int ntups,
+ TupleDesc desc, int bucket_width);
+
+int create_reg_buckets(mhist *hist, mhist_dim_info *ranges, int num_dims,
+ int cur_dim, int bucket_width, int bucket_num, int *itr);
+
+int remove_duplicate_names(mhist_dim_name *names, int num_names);
+
+int get_dimid_for_name(mhist_dim_name *names, int num_names,
+ const char *name);
+
+int get_random(HeapTuple*, int, int, int, int, double);
+
+void create_prob_array(double*, double, int);
+
+int skip_random(double*, int);
+
+void print_array(HeapTuple*, int);
+
+/*******************************************************************************
+ * PROFILING
+ ******************************************************************************/
+
+int asdf(char *);
+int zxcv(char *);
+
+int asdf(char *str) {
+#ifdef ASDF
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ elog(LOG, "YANG START %s %d.%0.6d", str, tv.tv_sec, tv.tv_usec);
+#endif
+ return 0;
+}
+
+int zxcv(char *str) {
+#ifdef ZXCV
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ elog(LOG, "YANG END %s %d.%0.6d", str, tv.tv_sec, tv.tv_usec);
+#endif
+ return 0;
+}
+
+/*******************************************************************************
+ * EXTERNAL FUNCTIONS
+ ******************************************************************************/
+
+/* FUNCTION create_mhist
+ * ARGUMENTS: <num_buckets> is the number of buckets for a new histogram,
+ * and <num_dims> is the number of dimensions of the histogram.
+ * POSTCONDITIONS: Creates a new, empty histogram data structure and fills in
+ * the header fields.
+ */
+mhist * create_mhist(int num_buckets, int num_dims) {
+ mhist *result = NULL;
+ int32 hist_len = MHIST_SIZE(num_buckets, num_dims);
+
+ if (hist_len < MHIST_HDRSZ) {
+ elog(ERROR, "Invalid MHIST length of %d.", hist_len);
+ }
+
+ result = (mhist*)palloc(hist_len);
+
+ /*
+ elog(LOG, "create_mhist(): Created a structure of size %d at %p.",
+ hist_len, result);
+ elog(LOG, "create_mhist(): Last byte at %p.",
+ ((char*)result + hist_len) );
+ */
+
+ /* Zero out the struct so as not to screw up Postgres hash functions. */
+ memset(result, 0x0, hist_len);
+
+ result->hdr.length = hist_len;
+ result->hdr.numDims = num_dims;
+ result->hdr.numBucketsUsed = result->hdr.numBucketsAllocated = num_buckets;
+
+ return result;
+}
+
+/* FUNCTION mhist_load_buckets()
+ * ARGUMENTS: <giant_tup_array> is an array containing a bunch of tuples.
+ * <ntuples> is the number of tuples in the array.
+ * <hist> is an MHIST.
+ * PRECONDITIONS: <hist> has not been loaded yet, but its bucket boundaries
+ * have already been determined.
+ * POSTCONDITIONS: Fills up the buckets array of <hist> with information about
+ * the indicated buckets.
+ */
+void mhist_load_buckets(HeapTuple *giant_tup_array, TupleDesc desc,
+ int ntuples, mhist *hist)
+{
+ asdf("mhist_load_buckets");
+ int tupleid = -1;
+
+ /* SPECIAL CASE: No tuples to load. */
+ if (0 == ntuples) {
+ return;
+ }
+ /* END SPECIAL CASE */
+
+ for (tupleid = 0; tupleid < ntuples; tupleid++) {
+
+ /* Figure out what bucket this tuple should go into. */
+ int bucketid = get_mhist_bucket_for_tuple(hist,
+ giant_tup_array[tupleid], desc);
+
+ mhist_bucket *target_bucket_ptr = MHIST_BUCKET_PTR(hist, bucketid);
+
+ /* Increment the counters. */
+ /* TODO: Calculate the number of unique values along each dimension! */
+ target_bucket_ptr->count += 1.0;
+ }
+
+ zxcv("mhist_load_buckets");
+}
+
+
+
+/*
+ * MHist constructor. Takes a single string argument, in the following format:
+ *
+ * (<Relation name>),(<col1>,col2>,...,<coln>),(<numbuckets>)
+ *
+ * Where:
+ * <Relation name> is the name of the relation to be histogrammed.
+ * <col1>,col2>,...,<coln> are the columns of the relation to be
+ * included in the histogram.
+ * <numbuckets> is the number of buckets in the histogram.
+ */
+Datum
+mhist_in(PG_FUNCTION_ARGS)
+{
+ asdf("mhist_in");
+
+ char *str = PG_GETARG_CSTRING(0);
+ char *str_copy = NULL;
+ char *relname_str = NULL, *cols_str = NULL, *num_buckets_str = NULL;
+ char **cols_arr = NULL;
+ int ncols = -1, colno = -1;
+ char *ptr = NULL;
+ mhist *result = NULL;
+
+ /* TODO: Sould the parsing code below be moved to a single function? */
+
+ /* Parse a copy of the string, strtok() style. */
+ str_copy = palloc(1 + strlen(str));
+ strcpy(str_copy, str);
+
+ /* First the relation name, "(name)". */
+ if (str_copy[0] != '(') goto parse_error;
+ relname_str = ptr = str_copy + 1;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Relation string is '%s'.", relname_str);*/
+
+ /* Skip the comma between the parens. */
+ if (*ptr != ',') goto parse_error; ++ptr;
+
+ /* Then parse the column names, "(col1,col2,...,coln)". */
+ if (*ptr != '(') goto parse_error; ++ptr;
+ cols_str = ptr;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Cols string is '%s'.", cols_str);*/
+
+ /* Skip another comma, and parse the number of buckets. */
+ if (*ptr != ',') goto parse_error; ++ptr;
+ if (*ptr != '(') goto parse_error; ++ptr;
+ num_buckets_str = ptr;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Num. buckets string is '%s'.", num_buckets_str);*/
+
+ /* TODO: We currently ignore any junk at the end of the string. Should we
+ * read through it and complain about non-whitespace characters? */
+
+ /* Generate an array of column names. */
+ /* First we need to count the number of columns. */
+ ncols = 1;
+ ptr = cols_str;
+ if (ptr == '\0') goto parse_error;
+ while (*ptr != '\0') {
+ if (',' == *ptr) ++ncols;
+ ++ptr;
+ }
+
+ Assert(ncols <= MHIST_MAX_DIMS);
+
+
+ /* Then we generate the array, again by parsing strtok()-style. */
+ cols_arr = palloc(ncols * sizeof(char*));
+ ptr = cols_str;
+ for (colno = 0; colno < ncols - 1; colno++) {
+ cols_arr[colno] = ptr;
+ while (*ptr != ',') ++ptr;
+ *ptr = '\0'; ++ptr;
+ }
+ cols_arr[ncols-1] = ptr;
+
+ /* Generate the histogram object. */
+ result = real_mhist_in(relname_str, cols_arr, ncols,
+ atoi(num_buckets_str));
+
+ /* Clean up. */
+ /*elog(LOG, "mhist_in(): Cleaning up.");*/
+ pfree(str_copy);
+ pfree(cols_arr);
+
+ zxcv("mhist_in");
+
+ /* Now we're done. */
+ PG_RETURN_MHIST_P(result);
+
+ /* Error handlers. */
+parse_error:
+ /* elog(ERROR) should clean up everything we palloc()'d. */
+ elog(ERROR, "mhist_in(): Error parsing string '%s'.", str);
+
+ zxcv("mhist_in");
+
+ /* UNREACHABLE, but the compiler might not know that. */
+ PG_RETURN_MHIST_P(NULL);
+}
+
+/*
+ * Constructor that builds an MHIST with square buckets. Takes a single
+ * string argument, in the following format:
+ *
+ * (<Relation name>),(<col1>,col2>,...,<coln>),(<bucketwidth>)
+ *
+ * Where:
+ * <Relation name> is the name of the relation to be histogrammed.
+ * <col1>,col2>,...,<coln> are the columns of the relation to be
+ * included in the histogram.
+ * <bucketwidth> is the width of a single bucket along each dimension.
+ */
+Datum
+square_mhist_in(PG_FUNCTION_ARGS)
+{
+ asdf("square_mhist_in");
+
+ char *str = PG_GETARG_CSTRING(0);
+ char *str_copy = NULL;
+ char *relname_str = NULL, *cols_str = NULL,
+ *bucketwidth_str = NULL;
+ char **cols_arr = NULL;
+ int ncols = -1, colno = -1;
+ char *ptr = NULL;
+ mhist *result = NULL;
+ HeapTuple *giant_tup_array = NULL;
+ TupleDesc desc = NULL;
+ int ntuples = -1;
+
+ /* TODO: Sould the parsing code below be moved to a single function? */
+
+ /* Parse a copy of the string, strtok() style. */
+ str_copy = palloc(1 + strlen(str));
+ strcpy(str_copy, str);
+
+ /* First the relation name, "(name)". */
+ if (str_copy[0] != '(') goto parse_error;
+ relname_str = ptr = str_copy + 1;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Relation string is '%s'.", relname_str);*/
+
+ /* Skip the comma between the parens. */
+ if (*ptr != ',') goto parse_error; ++ptr;
+
+ /* Then parse the column names, "(col1,col2,...,coln)". */
+ if (*ptr != '(') goto parse_error; ++ptr;
+ cols_str = ptr;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Cols string is '%s'.", cols_str);*/
+
+ /* Skip another comma, and parse the number of buckets. */
+ if (*ptr != ',') goto parse_error; ++ptr;
+ if (*ptr != '(') goto parse_error; ++ptr;
+ bucketwidth_str = ptr;
+ while (*ptr != ')') {
+ if ('\0' == *ptr) goto parse_error; ++ptr;
+ }
+ *ptr = '\0'; ++ptr;
+
+ /*elog(LOG, "mhist_in(): Num. buckets string is '%s'.", bucketwidth_str);*/
+
+ /* TODO: We currently ignore any junk at the end of the string. Should we
+ * read through it and complain about non-whitespace characters? */
+
+ /* Generate an array of column names. */
+ /* First we need to count the number of columns. */
+ ncols = 1;
+ ptr = cols_str;
+ if (ptr == '\0') goto parse_error;
+ while (*ptr != '\0') {
+ if (',' == *ptr) ++ncols;
+ ++ptr;
+ }
+
+ Assert(ncols <= MHIST_MAX_DIMS);
+
+
+ /* Then we generate the array, again by parsing strtok()-style. */
+ cols_arr = palloc(ncols * sizeof(char*));
+ ptr = cols_str;
+ for (colno = 0; colno < ncols - 1; colno++) {
+ cols_arr[colno] = ptr;
+ while (*ptr != ',') ++ptr;
+ *ptr = '\0'; ++ptr;
+ }
+ cols_arr[ncols-1] = ptr;
+
+ /* Read in the tuples for this histogram. */
+ giant_tup_array = get_table_as_array(relname_str, cols_arr, ncols,
+ &ntuples, &desc);
+
+ /* Generate the histogram object. */
+ result = create_reg_mhist(giant_tup_array, ntuples, desc,
+ atoi(bucketwidth_str));
+
+ /* create_reg_mhist() doesn't know about the relation names, because
+ * they're not in the tuple descriptor. So we overwrite the dimension name
+ * information. */
+ mhist_set_nameinfo(result, relname_str, cols_arr, ncols);
+
+ /* Fill its buckets. */
+ mhist_load_buckets(giant_tup_array, desc, ntuples, result);
+
+ /* Clean up. */
+ /*elog(LOG, "mhist_in(): Cleaning up.");*/
+ pfree(str_copy);
+ pfree(cols_arr);
+
+ zxcv("square_mhist_in");
+
+ /* Now we're done. */
+ PG_RETURN_MHIST_P(result);
+
+ /* Error handlers. */
+parse_error:
+ /* elog(ERROR) should clean up everything we palloc()'d. */
+ elog(ERROR, "square_mhist_in(): Error parsing string '%s'.", str);
+
+ zxcv("square_mhist_in");
+
+ /* UNREACHABLE, but the compiler might not know that. */
+ PG_RETURN_MHIST_P(NULL);
+}
+/*
+ * MHIST-to-string conversion function (for output).
+ *
+ * It's hard to convert a histogram to a one-line string, so this function
+ * just prints a note to the effect that this is an MHIST.
+ */
+Datum
+mhist_out(PG_FUNCTION_ARGS)
+{
+ mhist *hist = PG_GETARG_MHIST_P(0);
+ char *result = mhist_to_str(hist);
+
+ PG_RETURN_CSTRING(result);
+}
+
+/*
+ * Function to convert an mhist into relational representation. This is a
+ * set-returning function (See section 9.5.6.2 of the Programmer's Reference),
+ * so it needs to save its state across multiple calls. Yuck.
+ *
+ * Based on hist_to_table().
+ *
+ * In order to call this function, you need to define the following SQL
+ * datatypes:
+ *
+ * CREATE_TYPE __mhist1 AS (bucketid, min0, max0, count);
+ * CREATE_TYPE __mhist2 AS (bucketid, min0, max0, min1, max1, count);
+ * CREATE_TYPE __mhist3 AS (bucketid, min0, max0, min1, max1, min2, max2,
+ * count);
+ * CREATE_TYPE __mhist4 AS (bucketid, min0, max0, min1, max1, min2, max2,
+ * min3, max3, count);
+ * [Add additional types here if you change the value of HISTOGRAM_MAX_DIMS.]
+ */
+Datum
+mhist_to_table(PG_FUNCTION_ARGS)
+{
+ asdf("mhist_to_table");
+
+ FuncCallContext *funcctx = NULL;
+ mhist_to_table_state *state = NULL;
+ mhist *hist = PG_GETARG_MHIST_P(0);
+/* TupleDesc tupdesc;*/
+ char typename[128];
+
+ check_mhist_integrity(hist, "mhist_to_table()");
+
+ if (SRF_IS_FIRSTCALL()) {
+ MemoryContext oldcontext;
+
+ funcctx = SRF_FIRSTCALL_INIT();
+
+ /*elog(LOG, "mhist_to_table(): Starting first-call setup.");*/
+
+
+ /* Create the data structure that will remember the status of this
+ * function. */
+ oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+ state = palloc(sizeof(*state));
+ MemoryContextSwitchTo(oldcontext);
+
+ state->current_bucket = 0;
+ state->num_buckets = MHIST_NUM_BUCKETS_USED(hist);
+
+ /* Generate the name of the type that corresponds to the histogram's
+ * number of dimensions. */
+ snprintf(typename, sizeof(typename), "__mhist%d", hist->hdr.numDims);
+
+ /* Postgres SRF crap has been moved to this function: */
+ srf_firstcall_junk(funcctx, state,
+ MHIST_NUM_BUCKETS_USED(hist), typename);
+
+ /*elog(LOG, "mhist_to_table(): Done with first-call setup.");*/
+ }
+
+ /* Stuff that gets done every time the function is called: */
+ funcctx = SRF_PERCALL_SETUP();
+
+ state = (mhist_to_table_state*)(funcctx->user_fctx);
+
+ /* Are we done returning tuples? */
+ if (state->current_bucket < state->num_buckets) {
+ char **values;
+ int numvalues = -1;
+ HeapTuple tuple;
+ Datum result;
+ int valid = -1;
+
+ /*
+ elog(LOG, "mhist_to_table(): Generating tuple for bucket %d (%d total).",
+ state->current_bucket, state->num_buckets);
+ */
+
+ /* Not done returning tuples -- construct the next one. */
+ /* For the sake of simplicity, we convert the field values into strings
+ * and then back into values. */
+
+ numvalues = 2 * hist->hdr.numDims + 2;
+ /* Number of items in row == 2 + (2 x number of dimensions:
+ * 1 column for the bucketID (not strictly necessary)
+ * 1 column for the bucket's count
+ * 2 columns per dimension to hold min and max values.
+ */
+
+ /*elog(LOG, "mhist_to_table(): This tuple has %d fields.",
+ numvalues);*/
+
+ /* Build up the array of string values. */
+ values = (char**)palloc(sizeof(char*) * (numvalues));
+
+ for (valid = 0; valid < numvalues; valid++) {
+ values[valid] = (char*)palloc(32 * sizeof(char));
+ }
+
+ /* Fill in the array. */
+ for (valid = 0; valid < numvalues; valid++) {
+ if (0 == valid) {
+ /* First entry is the bucketid. */
+ snprintf(values[valid], 32, "%d", state->current_bucket);
+
+ } else if (numvalues - 1 == valid) {
+ /* Last entry is the bucket count. */
+ mhist_bucket *cur_bucket =
+ MHIST_BUCKET_PTR(hist, state->current_bucket);
+ /*
+ snprintf(values[valid], 32, "%d",
+ (int)(cur_bucket->count + 0.5));
+ */
+ /* Round up if necessary */
+ snprintf(values[valid], 32, "%f",
+ (cur_bucket->count));
+
+ } else {
+ /* valid > 0 and < (numvalues-1) */
+ /* Entries between first and last are the bounds of the
+ * rectangle that comprises this bucket. These entries
+ * alternate between the lower and upper bound. */
+ int dimid = (valid - 1) / 2;
+ bool is_min = (valid % 2 == 1);
+ /* Is this a lower or upper bound? */
+ mhist_bucket *cur_bucket =
+ MHIST_BUCKET_PTR(hist, state->current_bucket);
+ snprintf(values[valid], 32, "%d",
+ is_min ?
+ cur_bucket->diminfo[dimid].min_val
+ : cur_bucket->diminfo[dimid].max_val);
+ }
+
+ /*elog(LOG, "mhist_to_table(): Value %d is '%s'.",
+ valid, values[valid]);*/
+
+ }
+
+ /*elog(LOG, "mhist_to_table(): Done generating values.");*/
+
+ /* Construct the tuple for the strings. */
+ tuple = BuildTupleFromCStrings(funcctx->attinmeta, values);
+
+ /*elog(LOG, "mhist_to_table(): Done building tuple.");*/
+
+ /* Make the tuple into a datum. */
+ result = TupleGetDatum(funcctx->slot, tuple);
+
+ /* Clean up. */
+ for (valid = 0; valid < hist->hdr.numDims; valid++) {
+ /*elog(LOG, "mhist_to_table(): Freeing field %d of a tuple.",
+ valid);*/
+ pfree(values[valid]);
+ }
+ /*elog(LOG, "mhist_to_table(): Freeing holder for tuple %d.",
+ state->current_bucket);*/
+ pfree(values);
+
+ /*elog(LOG, "mhist_to_table(): Done generating tuple for bucket %d.",
+ state->current_bucket);*/
+
+ ++(state->current_bucket);
+
+ zxcv("mhist_to_table");
+
+ SRF_RETURN_NEXT(funcctx, result);
+ } else {
+ /*elog(LOG, "mhist_to_table(): Cleaning up.");*/
+
+ /* here we are done returning items, and just need to clean up: */
+ srf_cleanup(funcctx);
+
+ zxcv("mhist_to_table");
+
+ SRF_RETURN_DONE(funcctx);
+ }
+}
+
+
+/*
+ * Function that removes a dimension of an MHIST, merging all bins along the
+ * dimension.
+ *
+ * Usage: mhist_project(hist, dim)
+ *
+ * Where:
+ * <hist> is a histogram created with mhist_in().
+ * <dim> is the name of the dimension to eliminate.
+ *
+ * This function creates and returns a new MHIST.
+ */
+Datum
+mhist_project(PG_FUNCTION_ARGS) {
+ asdf("mhist_project");
+
+ mhist *inhist = PG_GETARG_MHIST_P(0);
+ char *proj_dim_name = PG_GETARG_CSTRING(1);
+
+ mhist *result = NULL;
+
+ /* Figure out which index to project. */
+ int proj_dim = get_dimid_for_name(inhist->hdr.dimNames,
+ inhist->hdr.numDimNames,
+ proj_dim_name);
+
+ if (MHIST_NOT_A_DIMID == proj_dim) {
+ elog(ERROR, "mhist_project(): Dimension '%s' of '%s' not found.",
+ proj_dim_name, mhist_to_str(inhist));
+ }
+
+ result = real_mhist_project(inhist, proj_dim);
+
+ zxcv("mhist_project");
+
+ PG_RETURN_MHIST_P(result);
+}
+
+/*
+ * Function that removes all dimensions of an MHIST except for the dimensions
+ * corresponding to the specified columns.
+ *
+ * Usage: mhist_project_many(hist, dimlist)
+ *
+ * Where:
+ * <hist> is a histogram created with mhist_in().
+ * <dimlist> is a string containing the names of the dimensions to
+ * keep, separated by spaces.
+ *
+ * This function creates and returns a new MHIST.
+ */
+Datum
+mhist_project_many(PG_FUNCTION_ARGS) {
+ asdf("mhist_project");
+
+ mhist *inhist = PG_GETARG_MHIST_P(0);
+ char *dimlist = PG_GETARG_CSTRING(1);
+ int i = -1;
+ int num_cols_kept = -1;
+ int dimid = -1;
+ char dimlist_copy[512];
+ char *cols_kept[MHIST_MAX_DIMS];
+ mhist *curhist = NULL;
+ bool dims_to_keep[MHIST_MAX_DIMS];
+ bool first_copy = false;
+ int num_to_keep = -1;
+
+
+ /* Parse the list of column names. */
+ Assert(dimlist != NULL);
+
+ /* In one pass, we make an uppercase copy, count the number of columns,
+ * and make an array of pointers to their names. */
+ num_cols_kept = 1;
+ cols_kept[0] = dimlist_copy;
+ for (i = 0; dimlist[i] != '\0' && i < sizeof(dimlist_copy); i++) {
+ if (' ' == dimlist[i]) {
+ /* Names are separated by a single space. */
+ dimlist_copy[i] = '\0';
+ cols_kept[num_cols_kept] = dimlist_copy + (i+1);
+ num_cols_kept++;
+ Assert(num_cols_kept < MHIST_MAX_DIMS);
+ } else {
+ dimlist_copy[i] = toupper(dimlist[i]);
+ }
+ }
+ dimlist_copy[i] = '\0';
+
+ elog(LOG, "mhist_project_many(): Keeping the following cols:");
+ for (i = 0; i < num_cols_kept; i++) {
+ elog(LOG, " '%s'", cols_kept[i]);
+ }
+
+ /* Now we go through each column and see if it is one of the columns we
+ * want to keep; if it is not, we will project it out. */
+ curhist = inhist;
+ for (dimid = 0; dimid < MHIST_NUM_DIMS(curhist); dimid++) {
+ int colid = -1;
+
+ dims_to_keep[dimid] = false;
+ /* Start out assuming we're going to throw away this column. */
+
+ for (colid = 0; colid < num_cols_kept; colid++) {
+ int nameid = -1;
+ for (nameid = 0; nameid < MHIST_NUM_DIM_NAMES(curhist); nameid++)
+ {
+ elog(LOG, "Comparing '%s' with '%s'",
+ cols_kept[colid], MHIST_DIM_NAME(curhist, nameid));
+ if (MHIST_NAME_DIM(curhist, nameid) == dimid
+ && 0 == strncasecmp(cols_kept[colid],
+ MHIST_DIM_NAME(curhist, nameid),
+ MHIST_COL_NAME_LEN))
+ {
+ dims_to_keep[dimid] = true;
+ /* Want to keep this column. */
+ elog(LOG, " Found a match!");
+ }
+ }
+ }
+ }
+
+ /* Make sure we got the right number of columns. */
+ num_to_keep = 0;
+ for (dimid = 0; dimid < MHIST_NUM_DIMS(curhist); dimid++) {
+ if (dims_to_keep[dimid]) {
+ num_to_keep++;
+ }
+ }
+
+ if (num_to_keep != num_cols_kept) {
+ elog(ERROR, "Only found %d of %d columns '%s'.",
+ num_to_keep, num_cols_kept, dimlist);
+ }
+
+ /* For now, we project dimensions out one by one, since that code is
+ * already written. We do the dimensions in reverse order since projection
+ * causes the dimensions above the one projected to be renumbered. */
+ /* TODO: Perform all the projections in one step. */
+ first_copy = true;
+ for (dimid = MHIST_NUM_DIMS(curhist) - 1; dimid >= 0; dimid--) {
+ if (false == dims_to_keep[dimid]) {
+ mhist *newhist = real_mhist_project(curhist, dimid);
+
+ /* Don't want to pfree() the function argument, inhist. */
+ if (first_copy) {
+ first_copy = false;
+ } else {
+ pfree(curhist);
+ }
+ curhist = newhist;
+ }
+ }
+
+ zxcv("mhist_project");
+
+ PG_RETURN_MHIST_P(curhist);
+}
+
+
+
+
+/*
+ * Function that adds the corresponding buckets of two mhists.
+ *
+ * Usage: mhist_union(hist1, hist2)
+ *
+ * Where:
+ * <hist1> and <hist2> are MHISTs created with mhist_in().
+ *
+ * The dimension names for the output histogram will be taken from the
+ * union of the two histograms.
+ */
+Datum
+mhist_union(PG_FUNCTION_ARGS) {
+ asdf("mhist_union");
+
+mhist *hist1 = PG_GETARG_MHIST_P(0);
+ mhist *hist2 = PG_GETARG_MHIST_P(1);
+ mhist *result = NULL;
+ int num_buckets = -1;
+ int bucketid = -1;
+ int nameid = -1;
+ int num_names = -1;
+ mhist_dim_name new_names[2 * MHIST_MAX_COL_NAMES];
+
+
+ /* Verify the integrity of the inputs. */
+ check_mhist_integrity(hist1, "mhist_union() hist1");
+ check_mhist_integrity(hist2, "mhist_union() hist2");
+ if (MHIST_NUM_DIMS(hist1) != MHIST_NUM_DIMS(hist2)) {
+ elog(ERROR,
+ "mhist_union(): Histograms have different numbers of dimensions.");
+ }
+
+ elog(DEBUG1, "mhist_union(): Left arg is (%s).",
+ mhist_to_str(hist1));
+ elog(DEBUG1, "mhist_union(): Right arg is (%s).",
+ mhist_to_str(hist2));
+
+ /* Start out with the buckets of the original histograms. */
+ num_buckets = MHIST_NUM_BUCKETS_USED(hist1)
+ + MHIST_NUM_BUCKETS_USED(hist2);
+
+ /* Allocate a new histogram containing all the buckets from the input
+ * histograms. */
+ result = create_mhist(num_buckets, MHIST_NUM_DIMS(hist1));
+
+ /* Copy over the dimension names, and remove duplicates. */
+ for (nameid = 0; nameid < MHIST_NUM_DIM_NAMES(hist1); nameid++) {
+ new_names[nameid] = MHIST_DIM_NAME_INFO(hist1, nameid);
+ }
+
+ for (nameid = 0; nameid < MHIST_NUM_DIM_NAMES(hist2); nameid++) {
+ new_names[nameid + MHIST_NUM_DIM_NAMES(hist1)] =
+ MHIST_DIM_NAME_INFO(hist2, nameid);
+ }
+
+ num_names = remove_duplicate_names(new_names,
+ MHIST_NUM_DIM_NAMES(hist1) + MHIST_NUM_DIM_NAMES(hist2));
+
+ if (num_names > MHIST_MAX_COL_NAMES) {
+ elog(ERROR, "mhist_union(): Too many dimension names.");
+ }
+
+ memcpy(result->hdr.dimNames, new_names, num_names * sizeof(*new_names));
+
+ MHIST_SET_NUM_DIM_NAMES(result, num_names);
+
+ for (bucketid = 0; bucketid < MHIST_NUM_BUCKETS_USED(hist1); bucketid++) {
+ memcpy(MHIST_BUCKET_PTR(result, bucketid),
+ MHIST_BUCKET_PTR(hist1, bucketid),
+ MHIST_BUCKET_LEN(MHIST_NUM_DIMS(hist1)));
+ }
+
+ for (bucketid = 0; bucketid < MHIST_NUM_BUCKETS_USED(hist2); bucketid++) {
+ memcpy(MHIST_BUCKET_PTR(result,
+ bucketid + MHIST_NUM_BUCKETS_USED(hist1)),
+ MHIST_BUCKET_PTR(hist2, bucketid),
+ MHIST_BUCKET_LEN(MHIST_NUM_DIMS(hist1)));
+ }
+
+ /* Fix overlapping buckets. */
+ result = merge_overlapping_mhist_buckets(result);
+
+ zxcv("mhist_union");
+
+ PG_RETURN_MHIST_P(result);
+}
+
+/*
+ * Function that removes a dimension of am MHIST, keeping only those bins
+ * for which the bin along the indicated dimension was a particular number.
+ *
+ * Usage: mhist_slice(hist, dim, val)
+ *
+ * Where:
+ * <hist> is a histogram created with hist_in().
+ * <dim> is the name of the dimension to eliminate.
+ * <val> is the value to keep along that dimension.
+ *
+ * This function creates and returns a new MHIST.
+ */
+Datum
+mhist_slice(PG_FUNCTION_ARGS) {
+ asdf("mhist_slice");
+
+ mhist *hist = PG_GETARG_MHIST_P(0);
+ char *dim_name = PG_GETARG_CSTRING(1);
+ int32 val = PG_GETARG_INT32(2);
+ mhist *result = NULL;
+ int num_result_buckets = -1;
+ int bucketid = -1;
+
+ int32 dim = -1;
+
+ /* Verify the integrity of the inputs. */
+ check_mhist_integrity(hist, "mhist_slice() argument");
+
+ dim = get_dimid_for_name(hist->hdr.dimNames,
+ MHIST_NUM_DIM_NAMES(hist), dim_name);
+
+ if (MHIST_NOT_A_DIMID == dim) {
+ elog(ERROR, "mhist_slice(): Dimension '%s' of '%s' not found.",
+ dim_name, mhist_to_str(hist));
+ }
+
+ /* TODO: Right now, we accept any value. Is that okay? */
+
+ /* Create the empty output histogram. */
+ result = create_proj_mhist(hist, dim);
+
+ /* Project the buckets and adjust their counts. While we're at it, remove
+ * buckets that don't overlap with the indicated slice. */
+ num_result_buckets = 0;
+ for (bucketid = 0; bucketid < MHIST_NUM_BUCKETS_USED(hist); bucketid++)
+ {
+ int min_val = MHIST_DIMINFO_PTR(hist, bucketid, dim)->min_val;
+ int max_val = MHIST_DIMINFO_PTR(hist, bucketid, dim)->max_val;
+
+ /* Should we copy this bucket over? */
+ if (val >= min_val && val <= max_val) {
+ mhist_bucket *bkt_ptr = NULL;
+
+ project_mhist_bucket(
+ MHIST_BUCKET_PTR(hist, bucketid),
+ MHIST_BUCKET_PTR(result, num_result_buckets),
+ MHIST_NUM_DIMS(hist), dim);
+
+ /* Adjust the count of the bucket. */
+ bkt_ptr = MHIST_BUCKET_PTR(result, num_result_buckets);
+
+ /* We're taking a slice that is one unit wide. */
+ bkt_ptr->count /= (max_val - min_val + 1.0);
+
+ num_result_buckets++;
+ }
+ }
+
+ Assert(MHIST_NUM_BUCKETS_ALLOC(result) >= num_result_buckets);
+
+ MHIST_SET_NUM_BUCKETS_USED(result, num_result_buckets);
+
+ zxcv("mhist_slice");
+
+ PG_RETURN_MHIST_P(result);
+}
+
+/*
+ * Function that performs the approximate equijoin of two relations using
+ * MHISTs.
+ *
+ * Usage: mhist_equijoin(hist1, col1, hist2, col2)
+ *
+ * Where:
+ * <hist1> and <hist2> are MHISTs created with mhist_in().
+ * <col1> and <col2> are the names of columns for the MHISTs.
+ */
+Datum
+mhist_equijoin(PG_FUNCTION_ARGS)
+{
+ asdf("mhist_equijoin");
+
+ /* Function arguments. */
+ mhist *hist1 = PG_GETARG_MHIST_P(0);
+ char* colname1 = PG_GETARG_CSTRING(1);
+ mhist *hist2 = PG_GETARG_MHIST_P(2);
+ char* colname2 = PG_GETARG_CSTRING(3);
+
+ /* Locals */
+ mhist *xp = NULL;
+ mhist *result = NULL;
+ int xp_dim1 = -1;
+ int xp_dim2 = -1;
+ int col1 = -1;
+ int col2 = -1;
+ int nameid = -1;
+
+ /* Check validity of arguments. */
+ check_mhist_integrity(hist1, "mhist_equijoin() hist1");
+ check_mhist_integrity(hist2, "mhist_equijoin() hist2");
+
+ col1 = get_dimid_for_name(hist1->hdr.dimNames,
+ MHIST_MAX_COL_NAMES, colname1);
+ col2 = get_dimid_for_name(hist2->hdr.dimNames,
+ MHIST_MAX_COL_NAMES, colname2);
+
+ if (MHIST_NOT_A_DIMID == col1) {
+ elog(ERROR, "mhist_equijoin(): Dimension '%s' of '%s' not found.",
+ colname1, mhist_to_str(hist1));
+ }
+ if (MHIST_NOT_A_DIMID == col2) {
+ elog(ERROR, "mhist_equijoin(): Dimension '%s' of '%s' not found.",
+ colname2, mhist_to_str(hist2));
+ }
+
+
+ /* First, compute the cross-product of the two histograms. Using the
+ * cross-product isn't terribly space-efficient, but it makes
+ * correctness easier.
+ *
+ * TODO: Compute the join directly.
+ */
+ xp = mhist_cross_product(hist1, hist2);
+ /*check_mhist_integrity(xp, "mhist_equijoin() xp");*/
+
+
+ elog(LOG, "mhist_equijoin(): Starting.");
+ elog(LOG, "mhist_equijoin(): Left arg is (%s).",
+ mhist_to_str(hist1));
+ elog(LOG, "mhist_equijoin(): Right arg is (%s).",
+ mhist_to_str(hist2));
+ elog(LOG, "mhist_equijoin(): Cross product is (%s).",
+ mhist_to_str(xp));
+
+ /* Map our dimensions into the dimensions of the cross-product histogram.
+ */
+ xp_dim1 = col1;
+ xp_dim2 = MHIST_NUM_DIMS(hist1) + col2;
+
+ /* Next, perform the selection. */
+ mhist_equality_select_in_place(xp, xp_dim1, xp_dim2);;
+
+ /*check_mhist_integrity(xp, "mhist_equijoin() done selection");*/
+
+ /* Eliminate zero-size buckets. */
+ remove_empty_mhist_buckets(xp);
+
+ /*check_mhist_integrity(xp, "mhist_equijoin() removed empty");*/
+
+ /* Finally, project the resulting histogram so we have only one copy of the
+ * join column. */
+ result = real_mhist_project(xp, xp_dim2);
+ /*check_mhist_integrity(xp, "mhist_equijoin() result");*/
+
+ /* The projection removed the names of the second column in the equijoin,
+ * but we want the names transferred to the first column. Fix up the names
+ * array. */
+ for (nameid = 0; nameid < MHIST_NUM_DIM_NAMES(hist2); nameid++) {
+ if (MHIST_NAME_DIM(hist2, nameid) == col2) {
+ int new_id = MHIST_NUM_DIM_NAMES(result);
+ if (new_id >= MHIST_MAX_COL_NAMES) {
+ elog(ERROR,
+ "Too many column names (%d >= %d) creating equijoin.",
+ new_id, MHIST_MAX_COL_NAMES);
+ }
+ result->hdr.dimNames[new_id] = hist2->hdr.dimNames[nameid];
+ MHIST_SET_NAME_DIM(result, new_id, xp_dim1);
+ MHIST_SET_NUM_DIM_NAMES(result, MHIST_NUM_DIM_NAMES(result) + 1);
+ }
+ }
+
+
+ pfree(xp);
+
+ zxcv("mhist_equijoin");
+
+ /* TODO: Should we free hist1 and hist2? */
+ PG_RETURN_MHIST_P(result);
+}
+
+/*
+ * Function that performs the approximate cross-product of two relations using
+ * MHISTs.
+ *
+ * Usage: mhist_crossprod(hist1, hist2)
+ *
+ * Where:
+ * <hist1> and <hist2> are MHISTs created with mhist_in().
+ */
+Datum
+mhist_crossprod(PG_FUNCTION_ARGS)
+{
+ asdf("mhist_crossprod");
+
+ /* Function arguments. */
+ mhist *hist1 = PG_GETARG_MHIST_P(0);
+ mhist *hist2 = PG_GETARG_MHIST_P(1);
+
+ /* Locals */
+ mhist *xp = NULL;
+
+ /* Check validity of arguments. */
+ check_mhist_integrity(hist1, "mhist_crossprod() hist1");
+ check_mhist_integrity(hist2, "mhist_crossprod() hist2");
+
+ xp = mhist_cross_product(hist1, hist2);
+
+ zxcv("mhist_crossprod");
+
+ /* TODO: Should we free hist1 and hist2? */
+ PG_RETURN_MHIST_P(xp);
+}
+
+/*
+ * Function that performs the approximate equality selection on an MHIST.
+ *
+ * Usage: mhist_eq_selection(hist, col1, col2)
+ *
+ * Where:
+ * <hist> is an MHIST created with mhist_in().
+ * <col1> and <col2> are the names of columns stored inside <hist>.
+ */
+Datum
+mhist_eq_selection(PG_FUNCTION_ARGS)
+{
+ asdf("mhist_eq_selection");
+
+ /* Function arguments. */
+ mhist *hist = PG_GETARG_MHIST_P(0);
+ char* colname1 = PG_GETARG_CSTRING(1);
+ char* colname2 = PG_GETARG_CSTRING(2);
+
+ /* Locals */
+ mhist *result = NULL;
+ int dim1 = -1, dim2 = -1;
+
+ /* Check validity of arguments. */
+ check_mhist_integrity(hist, "mhist_eq_selection()");
+
+ dim1 = get_dimid_for_name(hist->hdr.dimNames,
+ MHIST_MAX_COL_NAMES, colname1);
+ dim2 = get_dimid_for_name(hist->hdr.dimNames,
+ MHIST_MAX_COL_NAMES, colname2);
+
+ if (MHIST_NOT_A_DIMID == dim1) {
+ elog(ERROR, "mhist_eq_selection(): Dimension '%s' of '%s' not found.",
+ colname1, mhist_to_str(hist));
+ }
+ if (MHIST_NOT_A_DIMID == dim2) {
+ elog(ERROR, "mhist_eq_selection(): Dimension '%s' of '%s' not found.",
+ colname2, mhist_to_str(hist));
+ }
+
+ result = create_mhist_copy(hist);
+
+ mhist_equality_select_in_place(result, dim1, dim2);
+
+ /* Eliminate zero-size buckets. */
+ remove_empty_mhist_buckets(result);
+
+ zxcv("mhist_eq_selection");
+
+ PG_RETURN_MHIST_P(result);
+}
+
+/* FUNCTION mhist_can_summarize_tuple
+ * ARGUMENTS: <desc> describes a type of tuple.
+ * POSTCONDITIONS: Returns TRUE if the current implementation of MHISTs can
+ * summarize the indicated type of tuple.
+ */
+bool mhist_can_summarize_tuple(TupleDesc desc) {
+ int i = -1;
+ int ncols = get_num_non_timestamp_attrs(desc);
+
+ asdf("mhist_can_summarize_tuple");
+
+ for (i = 0; i < ncols; i++) {
+
+ /* Skip the timestamp, if any. */
+ int attrid = get_attr_id_skipping_ts(i + 1, desc);
+
+
+ /* Is this attribute an integer? */
+ switch (desc->attrs[attrid - 1]->atttypid) {
+ case INT2OID:
+ case INT4OID:
+ case CHAROID:
+ case BYTEAOID:
+ /* We can insert values from this index into the MHIST. */
+ break;
+
+ default:
+ elog(LOG, "Can't build an MHIST on columns of type '%s'",
+ format_type_with_typemod(desc->attrs[i]->atttypid,
+ desc->attrs[i]->atttypmod));
+ zxcv("mhist_can_summarize_tuple");
+ return false;
+ }
+ }
+
+ zxcv("mhist_can_summarize_tuple");
+
+ /* Haven't found any indication that we can't summarize this tuple... */
+ return true;
+}
+
+/* FUNCTION get_timestamp_col
+ * ARGUMENTS: <desc> is a tuple descriptor.
+ * PRECONDITIONS: <desc> represents a stream.
+ * POSTCONDITIONS: Returns the attrid of the timestamp attribute for the
+ * stream.
+ */
+int get_timestamp_col(TupleDesc desc)
+{
+ Assert(desc != NULL);
+
+ if (NULL == desc->constr) {
+ /* No constraints, so no timestamp. */
+ return TCQTSATTRNOP;
+ }
+
+ /* Someone decided to make ts_attrnum 0-based, rather than 1-based. Rather
+ * than correct that mistake, we add 1 to convert to the actual attribute
+ * number. */
+ /* TODO: Fix the original problem. */
+ return 1 + (desc->constr->ts_attrnum);
+}
+
+/* FUNCTION get_num_non_timestamp_attrs
+ * ARGUMENTS: <desc> points to a tuple descriptor.
+ * POSTCONDITIONS: Returns the number of attributes of <desc> that are not
+ * timestamps.
+ */
+int get_num_non_timestamp_attrs(TupleDesc desc)
+{
+ int ts_col = -1;
+ Assert(desc != NULL);
+
+ ts_col = get_timestamp_col(desc);
+
+ if (ts_col != TCQTSATTRNOP) {
+ /* Have a timestamp column. */
+ return desc->natts - 1;
+ } else {
+ /* No timestamp. */
+ return desc->natts;
+ }
+
+}
+
+/* FUNCTION get_attr_id_skipping_ts
+ * ARGUMENTS: <id> is an attribute number and <desc> is a tuple descriptor.
+ * PRECONDITIONS: <id> is >= 1 and <= the number of non-TCQTIME attributes in
+ * <desc>.
+ * POSTCONDITIONS: Returns the attribute number of the <id>th attribute that is
+ * not a timestamp.
+ */
+int get_attr_id_skipping_ts(int id, TupleDesc desc)
+{
+ int ts_col = -1;
+ Assert(desc != NULL);
+ Assert(id >= 1 && id <= get_num_non_timestamp_attrs(desc));
+
+ ts_col = get_timestamp_col(desc);
+
+ if (ts_col != TCQTSATTRNOP && id >= ts_col) {
+ return id + 1;
+ } else {
+ return id;
+ }
+}
+
+/* FUNCTION get_int_field_val
+ * ARGUMENTS: <tup> is a tuple described by <desc>, and <fnum> is a field
+ * number for <tup>. <skip_ts> is true if you wish to skip the timestamp
+ * field of the tuple.
+ * PRECONDITIONS: <fnum> is 1-based, and the indicated field is not NULL.
+ * POSTCONDITIONS: Fetches the indicated field of the tuple, converts it into
+ * 32-bit integer, and returns it.
+ */
+int64 get_int_field_val(HeapTuple tup, TupleDesc desc, int fnum, bool skip_ts) {
+ Datum d;
+ int64 val = -1;
+ bool is_null = false;
+ Oid typoid;
+ int16 typlen = -1;
+ bool typbyval = false;
+
+ Assert(tup != NULL);
+ Assert(desc != NULL);
+
+ /* We skip over the timestamp column, if desired. */
+ if (skip_ts) {
+ fnum = get_attr_id_skipping_ts(fnum, desc);
+ }
+
+ /* Fetch the value of the tuple along this dimension. */
+ /* TODO: Should we be using fastgetattr()? */
+ d = heap_getattr(tup, fnum, desc, &is_null);
+
+ Assert(!is_null);
+
+ /* There are three kinds of integer, each of which has a different
+ * method of extracting from a Datum. Figure out which one to use
+ * here. */
+ typoid = desc->attrs[fnum - 1]->atttypid;
+
+ get_typlenbyval(typoid, &typlen, &typbyval);
+
+ /*elog(LOG, "get_int_field_val(): Length of integer is %d.", typlen);*/
+
+ switch(typlen) {
+ case 1:
+ /* 8-bit integer... */
+ val = DatumGetUInt8(d);
+ break;
+
+ case 2:
+ val = DatumGetInt16(d);
+ break;
+
+ case 4:
+ val = DatumGetInt32(d);
+ break;
+
+ case 8:
+ val = DatumGetInt64(d);
+ break;
+
+ default:
+ elog(ERROR, "get_int_field_val(): Got invalid field length %d.",
+ typlen);
+ break;
+ }
+
+ return val;
+}
+
+
+
+/*******************************************************************************
+ * INTERNAL FUNCTIONS
+ ******************************************************************************/
+
+/* FUNCTION create_mhist_copy
+ * ARGUMENTS: <hist> is an MHIST.
+ * PRECONDITIONS: <hist> is properly initialized.
+ * POSTCONDITIONS: Creates a copy of <hist>.
+ */
+static mhist * create_mhist_copy(const mhist *orig) {
+ mhist *result = NULL;
+ int len = MHIST_SIZE(MHIST_NUM_BUCKETS_ALLOC(orig), MHIST_NUM_DIMS(orig));
+
+ result = palloc(len);
+
+ /* Since there are no pointers stored in the MHIST currently, we can just
+ * do a byte-by-byte copy. */
+ memcpy(result, orig, len);
+
+ check_mhist_integrity(result, "create_mhist_copy()");
+
+ return result;
+}
+
+/* FUNCTION create_bigger_mhist
+ * ARGUMENTS: <hist> is an MHIST.
+ * PRECONDITIONS: <hist>'s numBucketsUsed header field is set correctly.
+ * POSTCONDITIONS: Creates a copy of <hist> with some empty space for new
+ * buckets.
+ */
+static mhist *create_bigger_mhist(mhist *hist) {
+ /* Double the size of the buckets array. */
+ mhist *ret = create_mhist(2 * MHIST_NUM_BUCKETS_ALLOC(hist),
+ MHIST_NUM_DIMS(hist));
+
+ /* Copy information about dimension names. */
+ memcpy(ret->hdr.dimNames, hist->hdr.dimNames, MHIST_NAMESZ);
+ MHIST_SET_NUM_DIM_NAMES(ret, MHIST_NUM_DIM_NAMES(hist));
+
+ /* Set the correct number of buckets used. */
+ MHIST_SET_NUM_BUCKETS_USED(ret, MHIST_NUM_BUCKETS_USED(hist));
+
+ /* Copy the buckets en masse. */
+ memcpy(ret->buckets, hist->buckets,
+ MHIST_NUM_BUCKETS_USED(hist)
+ * MHIST_BUCKET_LEN(MHIST_NUM_DIMS(hist)));
+
+ return ret;
+}
+
+
+/* FUNCTION real_mhist_in
+ * ARGUMENTS: <relname> is the name of the relation on which to build a
+ * histogram. <cols> and <ncols> represent which columns of the relation
+ * to build on, and <num_buckets> is the number of buckets to use.
+ * PRECONDITIONS: All strings are non-NULL, and the number of buckets is
+ * greater than zero.
+ * POSTCONDITIONS: Attempts to create an mhist on the indicated relation.
+ * Calls elog() on failure.
+ */
+static mhist * real_mhist_in(char *relname,
+ char **cols,
+ int ncols,
+ int num_buckets)
+{
+ asdf("real_mhist_in");
+ mhist *result = NULL;
+
+ /* Create the histogram data structure. */
+ result = create_mhist(num_buckets, ncols);
+
+ /* Fill in information about the different dimensions. */
+ mhist_set_nameinfo(result, relname, cols, ncols);
+
+
+ /* Load the histogram. */
+ load_mhist(relname, cols, result);
+
+ /* Pass our newly-minted histogram back up the stack. */
+ zxcv("real_mhist_in");
+ return result;
+}
+
+/* FUNCTION mhist_set_nameinfo
+ * ARGUMENTS: <relname> is a relation name, and <cols> is an array of column
+ * names. <hist> is an MHIST.
+ * PRECONDITIONS: The histogram is to be built on the indicated columns of the
+ * indicated relation, with dimensions in the same order as <cols>.
+ * POSTCONDITIONS: Fills in the dimension name information of the histogram.
+ */
+static void mhist_set_nameinfo(mhist *hist, char *relname,
+ char **cols, int ncols) {
+ int dimid = -1;
+
+ for (dimid = 0; dimid < ncols; dimid++) {
+ MHIST_SET_NAME_DIM(hist, dimid, dimid);
+ snprintf(MHIST_DIM_NAME(hist, dimid), MHIST_COL_NAME_LEN,
+ "%s.%s", relname, cols[dimid]);
+ /* We're assuming that the entire histogram was zeroed out;
+ * otherwise, we would have to pad the rest of the name field with
+ * zeros to avoid screwing up postgres hashing. */
+ }
+
+ MHIST_SET_NUM_DIM_NAMES(hist, ncols);
+}
+
+
+
+/* FUNCTION get_table_as_array
+ * ARGUMENTS: <relname>, <cols>, and <ncols> are as with real_mhist_in().
+ * <ntuples> points to a location where we will put the number of tuples
+ * read. <descdest> points to where we will put a descriptor for the
+ * tuples in the array we return.
+ * POSTCONDITIONS: Creates an array of HeapTuples of the appropriate size
+ * and loads it with the contents of the indicated columns. Returns
+ * the array, and sticks a tuple descriptor into *descdest.
+ */
+static HeapTuple *get_table_as_array(char *relname, char **cols, int ncols,
+ int *ntuples, TupleDesc *descdest) {
+ asdf("get_table_as_array");
+
+ StringInfo sql = makeStringInfo();
+ int dimid = -1, return_code = -1, proc = -1;
+ int tupnum = -1;
+
+ HeapTuple *ret = NULL;
+ /* Will be returned. */
+
+ MemoryContext main_context;
+ MemoryContext oldcontext;
+
+ Assert(ntuples != NULL);
+
+
+ /* First, we snarf all the data out of the table. At some point in the
+ * future, we will probably do some sampling here, but for now, we just
+ * snarf.
+ *
+ * In order to get at the tuples, we create a query, namely:
+ *
+ * SELECT col1, col2, ... , coln FROM relation;
+ */
+ appendStringInfo(sql, "SELECT ");
+
+ for (dimid = 0; dimid < ncols; dimid++) {
+
+ appendStringInfo(sql, "%s.%s", relname, cols[dimid]);
+ if (dimid < ncols - 1) {
+ appendStringInfo(sql, ", ");
+ }
+ }
+ appendStringInfo(sql, " FROM %s" , relname);
+
+ elog(LOG, "get_table_as_array(): Query is '%s'.", sql->data);
+
+ /* The Server Programming Interface is going to switch memory contexts
+ * behind our back, so we need to remember what the original context was.
+ */
+ main_context = CurrentMemoryContext;
+
+ /* Connect to the Server Programming Interface (see Postgresql Programmer's
+ * Reference, Chapter 17). */
+ if ((return_code = SPI_connect()) < 0) {
+ elog(ERROR, "get_table_as_array(): SPI_connect returned %d.",
+ return_code);
+ }
+
+ /* Execute the query. */
+ SetQuerySnapshot(); /* Don't know why we need to do this. */
+ return_code = SPI_exec(sql->data, 0);
+ /* The 0 here for number of tuples to retrieve apparently means to get
+ * as many tuples as possible. */
+ proc = SPI_processed;
+
+ elog(LOG, "get_table_as_array(): Query generated %d tuples.", proc);
+
+ /* Make a copy of the tuple descriptor. See note above about memory
+ * contexts... */
+ oldcontext = MemoryContextSwitchTo(main_context);
+ *descdest = CreateTupleDescCopy(SPI_tuptable->tupdesc);
+ MemoryContextSwitchTo(oldcontext);
+
+
+ /* SPECIAL CASE: Empty result. */
+ if (0 == proc) {
+ *ntuples = 0;
+
+ /* The caller should free the returned pointer unconditionally, so we
+ * need to allocate _something_. */
+ /* See note above about memory contexts. */
+ oldcontext = MemoryContextSwitchTo(main_context);
+ ret = palloc(1);
+ MemoryContextSwitchTo(oldcontext);
+
+ goto cleanup;
+ }
+ /* END SPECIAL CASE */
+
+ /* Fetch the result tuples and put them into a giant array. */
+ *ntuples = proc;
+
+ /* See note above about memory contexts. */
+ oldcontext = MemoryContextSwitchTo(main_context);
+ ret = palloc(proc * sizeof(HeapTuple));
+ MemoryContextSwitchTo(oldcontext);
+
+ for (tupnum = 0; tupnum < proc; tupnum++) {
+ HeapTuple current_tup;
+
+ /* See note above about memory contexts. */
+ oldcontext = MemoryContextSwitchTo(main_context);
+ current_tup = heap_copytuple(SPI_tuptable->vals[tupnum]);
+ MemoryContextSwitchTo(oldcontext);
+
+ ret[tupnum] = current_tup;
+ }
+
+
+cleanup:
+
+ /* Disconnect from the Server Programming Interface. */
+ if ((return_code = SPI_finish()) != SPI_OK_FINISH) {
+ elog(ERROR, "get_table_as_array(): SPI_finish() returned %d.",
+ return_code);
+ }
+
+ zxcv("get_table_as_array");
+
+ return ret;
+}
+
+/* FUNCTION split_a_bucket()
+ * ARGUMENTS: <giant_tup_array> is an array containing <ntuples> tuples,
+ * currently divided into (contiguous) buckets at locations given by
+ * <bucket_offsets> and <bucket_lengths>.
+ * PRECONDITIONS: <giant_tup_array> has been properly divided up.
+ * POSTCONDITIONS: If possible, splits one of the buckets and redistributes
+ * tuples accordingly. Updates the <bucket_offsets> and <bucket_lengths>
+ * arrays. Returns TRUE if it managed to split a bucket, FALSE
+ * otherwise.
+ */
+static bool split_a_bucket(HeapTuple *giant_tup_array, int ntuples,
+ TupleDesc desc,
+ int *bucket_offsets, int *bucket_lengths, mhist *hist,
+ mhist_dim_info *ranges, int nbuckets_done) {
+
+ asdf("split_a_bucket");
+
+ int split_bucketid = -1;
+ int split_dimid = -1;
+ int split_offset = -1;
+
+ int offset = -1, length = -1;
+ HeapTuple *bucketstart = NULL;
+
+ mhist_bucket *maxdiff_bucket_ptr = NULL;
+ mhist_bucket *new_bucket_ptr = MHIST_BUCKET_PTR(hist, nbuckets_done);
+ /* The actual bucket (currently empty) */
+
+ mhist_dim_info *maxdiff_di = NULL;
+ mhist_dim_info *newbucket_di = NULL;
+
+ int split_val = -1;
+
+ int ndims = (NULL == desc) ? 0 : get_num_non_timestamp_attrs(desc);
+
+ Assert(0.0 == new_bucket_ptr->count);
+
+ /*elog(LOG, "split_a_bucket(): Checking whether we can split.");*/
+
+ /* SPECIAL CASE: Can't perform any splits. */
+ if (no_buckets_to_split(giant_tup_array, bucket_offsets, bucket_lengths,
+ nbuckets_done, desc)) {
+ return false;
+ }
+ /* END SPECIAL CASE */
+
+ /*elog(LOG, "split_a_bucket(): Figuring out where to split.");*/
+
+ /* Figure out where to split. */
+ get_mhist_split_point(giant_tup_array, desc, bucket_offsets,
+ bucket_lengths, nbuckets_done, ranges,
+ &split_bucketid, &split_dimid, &split_offset);
+
+ /*elog(LOG, "split_a_bucket(): Starting split.");*/
+
+ /* Now we split the chosen bucket along the chosen dimension. */
+ maxdiff_bucket_ptr = MHIST_BUCKET_PTR(hist, split_bucketid);
+ offset = bucket_offsets[split_bucketid];
+ length = bucket_lengths[split_bucketid];
+ bucketstart = giant_tup_array + offset;
+
+ /*elog(LOG, "split_a_bucket(): Sorting.");*/
+
+ /* First we sort along the dimension. */
+ sort_tuples_along_dim(bucketstart, length, split_dimid, desc);
+
+ /*elog(LOG, "split_a_bucket(): Performing bookkeeping.");*/
+
+ /* The sorting has already partitioned the tuples; we just need to
+ * make note of the new bucket boundary! */
+ bucket_offsets[nbuckets_done] =
+ bucket_offsets[split_bucketid] + split_offset + 1;
+
+
+ /* The new bucket starts immediately after the current
+ * tuple. */
+ bucket_lengths[nbuckets_done] =
+ bucket_lengths[split_bucketid] - split_offset - 1;
+
+ bucket_lengths[split_bucketid] = split_offset;
+
+
+ /* Adjust the bucket boundaries in the histogram data structure. */
+
+ /* We start out by making a copy of the bucket we just split. */
+ memcpy(new_bucket_ptr, maxdiff_bucket_ptr, MHIST_BUCKET_LEN(ndims));
+
+ /* The we adjust the boundaries of the copies so that they split
+ * the space along the maxdiff line. */
+ maxdiff_di = &(maxdiff_bucket_ptr->diminfo[split_dimid]);
+ newbucket_di = &(new_bucket_ptr->diminfo[split_dimid]);
+
+ split_val = get_int_field_val(bucketstart[split_offset], desc,
+ split_dimid + 1, true);
+ /*
+ elog(LOG, "split_a_bucket(): Splitting at value %d on dimension %d.",
+ split_val, split_dimid);
+ */
+
+ /* By convention, the bucket contains values x, such that
+ * min_val <= x <= max_val.
+ */
+ maxdiff_di->max_val = split_val - 1;
+ newbucket_di->min_val = split_val;
+
+
+ /* We've created a hard boundary, so these two buckets should no
+ * longer accept outliers in the direction of the boundary. */
+ maxdiff_di->accept_above_max = false;
+ newbucket_di->accept_below_min = false;
+
+ zxcv("split_a_bucket");
+
+ return true;
+}
+
+/* Comparison function for passing to qsort. The globals before it are used to
+ * pass parameters to it on a "side channel". */
+static int global_cmpf_dimid = -1;
+static TupleDesc global_cmpf_desc = NULL;
+static int cmpf(const void * left, const void * right) {
+ HeapTuple *left_ptr = (HeapTuple*)left;
+ HeapTuple *right_ptr = (HeapTuple*)right;
+ int left_val = get_int_field_val(*left_ptr, global_cmpf_desc,
+ global_cmpf_dimid + 1, true);
+ int right_val = get_int_field_val(*right_ptr, global_cmpf_desc,
+ global_cmpf_dimid + 1, true);
+
+ /* We return a number less than zero if left < right */
+ if (left_val < right_val) {
+ return -1;
+ } else if (left_val == right_val) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+/* FUNCTION sort_tuples_along_dim()
+ * ARGUMENTS: <tuples> points to an array of <length> tuples, each of <ndims>
+ * dimensions. <dimid> is a dimension < <ndims>.
+ * PRECONDITIONS: The specified range stays within the actual bounds of the
+ * array.
+ * POSTCONDITIONS: Sorts the range of tuples along dimension <dimid>.
+ */
+static void sort_tuples_along_dim(HeapTuple *tuples, int length, int dimid,
+ TupleDesc desc) {
+
+ asdf("sort_tuples_along_dim");
+
+ /* Tell our comparison function which dimension to pay attention to. */
+ global_cmpf_dimid = dimid;
+ global_cmpf_desc = desc;
+
+ /* Then we can let qsort do the heavy lifting... */
+ qsort(tuples, length, sizeof(*tuples), &cmpf);
+
+ zxcv("sort_tuples_along_dim");
+}
+
+
+
+/* FUNCTION load_mhist
+ * ARGUMENTS: <relname> and <cols> are as with real_mhist_in(), and
+ * <hist> is an appropriately-sized and initialized MHIST data
+ * structure.
+ * PRECONDITIONS: The histogram is initial...
[truncated message content] |
|
From: <yan...@us...> - 2008-07-02 06:34:38
|
Revision: 861
http://assorted.svn.sourceforge.net/assorted/?rev=861&view=rev
Author: yangzhang
Date: 2008-07-01 23:34:48 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added gcj 06 entry
Added Paths:
-----------
problems/gcj/
problems/gcj/2006/
problems/gcj/2006/cjam.cpp
Added: problems/gcj/2006/cjam.cpp
===================================================================
--- problems/gcj/2006/cjam.cpp (rev 0)
+++ problems/gcj/2006/cjam.cpp 2008-07-02 06:34:48 UTC (rev 861)
@@ -0,0 +1,128 @@
+// Hareesh Nagarajan <hareesh AT symonds.net>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <cstring>
+#include <cassert>
+#define ROW_MAX 50
+#define COL_MAX 50
+#define PATH_STR_MAX (1<<10)
+#define INF 100000000
+using namespace std;
+
+typedef struct { int i, j; } point;
+
+static inline void get_neighbors(const char grid[ROW_MAX][COL_MAX], const int i, const int j,
+ const int rows, const int cols, vector<point> &vp)
+{
+ point p;
+ bool i_minus_1, i_plus_1, j_minus_1, j_plus_1;
+ int sub_i, add_i, sub_j, add_j;
+
+ i_minus_1 = i_plus_1 = j_minus_1 = j_plus_1= false;
+ sub_i = i - 1;
+ add_i = i + 1;
+ sub_j = j - 1;
+ add_j = j + 1;
+
+ if(sub_i >= 0) i_minus_1 = true;
+ if(add_i < rows) i_plus_1 = true;
+
+ if(sub_j >= 0) {
+ j_minus_1 = true; p.i = i; p.j = sub_j; vp.push_back(p); //i, j-1
+ }
+
+ if(add_j < cols) {
+ j_plus_1 = true; p.i = i; p.j = add_j; vp.push_back(p); //i, j+1
+ }
+
+ if(i_minus_1) {
+ p.i = sub_i; p.j = j; vp.push_back(p); //i-1, j
+ if(j_minus_1) { p.j = sub_j; vp.push_back(p); } //i-1, j-1
+ if(j_plus_1) { p.j = add_j; vp.push_back(p); } //i-1, j+1
+ }
+
+ if(i_plus_1) {
+ p.i = add_i; p.j = j; vp.push_back(p); //i+1, j
+ if(j_minus_1) { p.j = j - 1; vp.push_back(p); } //i+1, j-1
+ if(j_plus_1) { p.j = j + 1; vp.push_back(p); } //i+1, j+1
+ }
+}
+
+
+
+int compute(const char grid[ROW_MAX][COL_MAX], const char path[PATH_STR_MAX],
+ int &count, int i, int j, int rows, int cols, int path_iter, const int path_sz)
+{
+ if(path_iter >= path_sz) { count++; return 0; }
+ if(count > INF) return -1;
+ vector<point> neighbors;
+ vector<point>::iterator iter;
+
+ neighbors.reserve(8);
+ get_neighbors(grid, i, j, rows, cols, neighbors);
+
+ for(iter = neighbors.begin(); iter < neighbors.end(); iter++) {
+ if(grid[iter->i][iter->j] == path[path_iter])
+ compute(grid, path, count, iter->i, iter->j, rows, cols, path_iter + 1, path_sz);
+ }
+
+ return 1;
+}
+
+
+int search_paths(const char grid[ROW_MAX][COL_MAX], const char path[PATH_STR_MAX],
+ int rows, int cols, const int path_sz)
+{
+ int i, j, count;
+ count = 0;
+
+ for(i = 0; i < rows; i++) {
+ for(j = 0; j < cols; j++) {
+ if(grid[i][j] == path[0]) {
+ if(compute(grid, path, count, i, j, rows, cols, 1, path_sz) < 0)
+ return -1;
+ }
+ }
+ }
+ return count;
+}
+
+main()
+{
+ char path[PATH_STR_MAX];
+ int rows, cols, path_sz;
+
+ char grid[ROW_MAX][COL_MAX] = {
+ {'A','A','A','A','A'},
+ {'A','A','A','A','A'},
+ {'A','A','A','A','A'},
+ {'A','A','A','A','A'},
+ {'A','A','A','A','A'}
+ };
+ strcpy(path, "AAAAAAAAAAA");
+
+ rows = 5;
+ cols = 5;
+ path_sz = strlen(path);
+
+// char grid[ROW_MAX][COL_MAX] = {
+// {'A','B','A','B','A'},
+// {'B','A','B','A','B'},
+// {'A','B','A','B','A'},
+// {'B','A','B','A','B'},
+// {'A','B','A','B','A'}
+// };
+// strcpy(path, "ABABABBA");
+//
+// rows = 5;
+// cols = 5;
+// path_sz = strlen(path);
+
+ assert(rows < ROW_MAX);
+ assert(cols < COL_MAX);
+ assert(path_sz < PATH_STR_MAX);
+
+ cout << search_paths(grid, path, rows, cols, path_sz) << endl;
+}
Property changes on: problems/gcj/2006/cjam.cpp
___________________________________________________________________
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-07-02 06:32:52
|
Revision: 860
http://assorted.svn.sourceforge.net/assorted/?rev=860&view=rev
Author: yangzhang
Date: 2008-07-01 23:32:54 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added popquiz
Added Paths:
-----------
pop-quiz/
pop-quiz/trunk/
pop-quiz/trunk/PopQuiz/
pop-quiz/trunk/PopQuiz/App.ico
pop-quiz/trunk/PopQuiz/AssemblyInfo.cs
pop-quiz/trunk/PopQuiz/Copy of Form1.cs
pop-quiz/trunk/PopQuiz/Form1.cs
pop-quiz/trunk/PopQuiz/Form1.resx
pop-quiz/trunk/PopQuiz/PopQuiz.csproj
pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user
pop-quiz/trunk/PopQuiz/PopQuiz.sln
pop-quiz/trunk/PopQuiz/PopQuiz.suo
Added: pop-quiz/trunk/PopQuiz/App.ico
===================================================================
(Binary files differ)
Property changes on: pop-quiz/trunk/PopQuiz/App.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: pop-quiz/trunk/PopQuiz/AssemblyInfo.cs
===================================================================
--- pop-quiz/trunk/PopQuiz/AssemblyInfo.cs (rev 0)
+++ pop-quiz/trunk/PopQuiz/AssemblyInfo.cs 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,58 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
Added: pop-quiz/trunk/PopQuiz/Copy of Form1.cs
===================================================================
--- pop-quiz/trunk/PopQuiz/Copy of Form1.cs (rev 0)
+++ pop-quiz/trunk/PopQuiz/Copy of Form1.cs 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,457 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.IO;
+using System.Data;
+using System.Xml;
+using System.Diagnostics;
+using System.Threading;
+
+namespace PopQuiz
+{
+ /// <summary>
+ /// Summary description for Form1.
+ /// </summary>
+ public class Form1 : System.Windows.Forms.Form
+ {
+// [DllImport("user32")]
+// public static extern int SetWindowPos(int hwnd, int hWndInsertAfter, int x,
+// int y, int cx, int cy, int wFlags);
+
+ private bool isDefault = false;
+ private System.Windows.Forms.Timer timer;
+ private System.ComponentModel.IContainer components;
+
+ private Def def = null;
+ private System.Windows.Forms.Button buttonOK;
+ private System.Windows.Forms.Label labelKey;
+ private System.Windows.Forms.TextBox textBox;
+ private System.Windows.Forms.Label label;
+
+ // map int to string
+ private ArrayList list = null;
+ private ArrayList uniq = null;
+ private int initSize = 0;
+ private int increment;
+ private int decrement;
+ private int maxval;
+ private string txtPath = null;
+ private System.Windows.Forms.Panel panelButtons;
+ private System.Windows.Forms.Button buttonCorrect;
+ private System.Windows.Forms.Button buttonIncorrect;
+ private Form1 parent = null;
+
+ public Form1()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ isDefault = true;
+ timer.Enabled = true;
+ list = new ArrayList();
+ uniq = new ArrayList();
+ using(StreamReader reader = new StreamReader(@"list.txt"))
+ {
+// xmlPath = reader.ReadLine();
+ txtPath = reader.ReadLine();
+ }
+
+// using(XmlTextReader reader = new XmlTextReader(xmlPath))
+// {
+// while (reader.Read())
+// {
+// switch (reader.NodeType)
+// {
+// case XmlNodeType.Element:
+// break;
+// default:
+// break;
+// }
+// }
+// }
+
+ string readTxtPath = txtPath;
+ if (File.Exists(txtPath + ".new"))
+ {
+ readTxtPath += ".new";
+ }
+
+ using(StreamReader reader = new StreamReader(readTxtPath))
+ {
+ while (true)
+ {
+ int freq;
+ string strFreq = "";
+ string key;
+ try
+ {
+ while (strFreq == "")
+ strFreq = reader.ReadLine();
+ freq = int.Parse(strFreq);
+ key = reader.ReadLine();
+ }
+ catch
+ {
+ key = strFreq;
+ freq = 1;
+ }
+ string value = reader.ReadLine();
+ string details = "";
+ string line = null;
+ while (true)
+ {
+ line = reader.ReadLine();
+ if (line == "" || line == null)
+ {
+ // trim off newline chars
+ if (details.Length > 0)
+ details = details.Substring(0, details.Length - 2);
+ break;
+ }
+ details += line + "\r\n";
+ }
+
+ if (key == null || value == null || line == null)
+ break;
+
+ Def def = new Def(key, value, details, freq);
+ for ( int i = 0; i < freq; i++ )
+ {
+ list.Add(def);
+ }
+ uniq.Add(def);
+ }
+ }
+
+ initSize = uniq.Count;
+ increment = Math.Max(initSize / 10, 2);
+ decrement = Math.Max(increment / 5, 1);
+ maxval = Math.Max(initSize / 2, 2);
+ this.labelKey.Visible = false;
+ this.textBox.Visible = false;
+ this.label.Text = "Increment: " + increment
+ + "\r\nDecrement: " + decrement
+ + "\r\nUniques: " + uniq.Count
+ + "\r\nTotal: " + list.Count
+ + "\r\nMax Val: " + maxval;
+ this.buttonCorrect.Enabled = false;
+ this.buttonIncorrect.Enabled = false;
+ this.buttonOK.Text = "&Quiz Me Now";
+ this.WindowState = FormWindowState.Normal;
+ this.MaximizeBox = true;
+ this.MinimizeBox = true;
+ }
+
+ public Form1(Form1 parent, Def def)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ isDefault = false;
+ this.def = def;
+ this.labelKey.Text = def.Key;
+ this.parent = parent;
+ }
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.labelKey = new System.Windows.Forms.Label();
+ this.timer = new System.Windows.Forms.Timer(this.components);
+ this.buttonOK = new System.Windows.Forms.Button();
+ this.textBox = new System.Windows.Forms.TextBox();
+ this.label = new System.Windows.Forms.Label();
+ this.buttonCorrect = new System.Windows.Forms.Button();
+ this.buttonIncorrect = new System.Windows.Forms.Button();
+ this.panelButtons = new System.Windows.Forms.Panel();
+ this.panelButtons.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // labelKey
+ //
+ this.labelKey.Cursor = System.Windows.Forms.Cursors.Default;
+ this.labelKey.Dock = System.Windows.Forms.DockStyle.Top;
+ this.labelKey.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.labelKey.Location = new System.Drawing.Point(10, 10);
+ this.labelKey.Name = "labelKey";
+ this.labelKey.Size = new System.Drawing.Size(404, 38);
+ this.labelKey.TabIndex = 0;
+ //
+ // timer
+ //
+ this.timer.Interval = 300000;
+ this.timer.Tick += new System.EventHandler(this.timer_Tick);
+ //
+ // buttonOK
+ //
+ this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonOK.Location = new System.Drawing.Point(304, 8);
+ this.buttonOK.Name = "buttonOK";
+ this.buttonOK.Size = new System.Drawing.Size(96, 32);
+ this.buttonOK.TabIndex = 2;
+ this.buttonOK.Text = "OK";
+ this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
+ //
+ // textBox
+ //
+ this.textBox.Dock = System.Windows.Forms.DockStyle.Top;
+ this.textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.textBox.Location = new System.Drawing.Point(10, 48);
+ this.textBox.Name = "textBox";
+ this.textBox.Size = new System.Drawing.Size(404, 30);
+ this.textBox.TabIndex = 1;
+ this.textBox.Text = "";
+ //
+ // label
+ //
+ this.label.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.label.Location = new System.Drawing.Point(10, 78);
+ this.label.Name = "label";
+ this.label.Size = new System.Drawing.Size(404, 222);
+ this.label.TabIndex = 3;
+ //
+ // buttonCorrect
+ //
+ this.buttonCorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonCorrect.Location = new System.Drawing.Point(200, 8);
+ this.buttonCorrect.Name = "buttonCorrect";
+ this.buttonCorrect.Size = new System.Drawing.Size(96, 32);
+ this.buttonCorrect.TabIndex = 4;
+ this.buttonCorrect.Text = "&Correct";
+ this.buttonCorrect.Click += new System.EventHandler(this.buttonCorrect_Click);
+ //
+ // buttonIncorrect
+ //
+ this.buttonIncorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonIncorrect.Location = new System.Drawing.Point(96, 8);
+ this.buttonIncorrect.Name = "buttonIncorrect";
+ this.buttonIncorrect.Size = new System.Drawing.Size(96, 32);
+ this.buttonIncorrect.TabIndex = 4;
+ this.buttonIncorrect.Text = "&D\'oh!";
+ this.buttonIncorrect.Click += new System.EventHandler(this.buttonIncorrect_Click);
+ //
+ // panelButtons
+ //
+ this.panelButtons.Controls.Add(this.buttonOK);
+ this.panelButtons.Controls.Add(this.buttonCorrect);
+ this.panelButtons.Controls.Add(this.buttonIncorrect);
+ this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panelButtons.Location = new System.Drawing.Point(10, 252);
+ this.panelButtons.Name = "panelButtons";
+ this.panelButtons.Size = new System.Drawing.Size(404, 48);
+ this.panelButtons.TabIndex = 5;
+ //
+ // Form1
+ //
+ this.AcceptButton = this.buttonOK;
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(424, 310);
+ this.Controls.Add(this.panelButtons);
+ this.Controls.Add(this.label);
+ this.Controls.Add(this.textBox);
+ this.Controls.Add(this.labelKey);
+ this.DockPadding.All = 10;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "Form1";
+ this.Text = "PopQuiz!";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.Closed += new System.EventHandler(this.OnClosed);
+ this.panelButtons.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ public static void Main()
+ {
+ Application.Run(new Form1());
+ }
+
+ private void OnClosed(object sender, System.EventArgs e)
+ {
+ if (this.isDefault)
+ {
+ Application.Exit();
+ }
+ }
+
+ private void timer_Tick(object sender, System.EventArgs e)
+ {
+ int rand = new Random().Next(list.Count);
+ Def def = (Def) list[rand];
+ Form1 form = new Form1(this, def);
+ form.Show();
+ form.Activate();
+ }
+
+ private void buttonOK_Click(object sender, System.EventArgs e)
+ {
+ if (this.isDefault)
+ {
+ this.timer_Tick(null, null);
+ return;
+ }
+
+ if (this.def.Value != this.textBox.Text)
+ Incorrect();
+ else
+ Correct();
+
+ parent.Save();
+ }
+
+ private void Incorrect()
+ {
+ if (this.label.Text != "")
+ {
+ Close();
+ return;
+ }
+ this.def.Freq += parent.increment;
+ if (this.def.Freq > parent.maxval)
+ this.def.Freq = parent.maxval;
+ for (int i = 0; i < parent.increment; i++)
+ parent.list.Add(def);
+ this.label.Text = this.def.Value + "\r\n\r\n" + this.def.Details + "\r\n\r\nNow At: " + this.def.Freq;
+ }
+
+ private void Correct()
+ {
+ this.def.Freq -= parent.decrement;
+ for (int i = 0; i < parent.decrement; i++)
+ parent.list.Remove(def);
+ if (this.def.Freq <= 1)
+ this.def.Freq = 1;
+ Close();
+ }
+
+ private void Save()
+ {
+ using (FileStream stream = new FileStream(txtPath + ".new", FileMode.Create))
+ {
+ using (StreamWriter writer = new StreamWriter(stream))
+ {
+ foreach (Def def in uniq)
+ {
+ writer.WriteLine(def.Freq);
+ writer.WriteLine(def.Key);
+ writer.WriteLine(def.Value);
+ writer.WriteLine(def.Details);
+ writer.WriteLine();
+ }
+ }
+ }
+ }
+
+ private void buttonCorrect_Click(object sender, System.EventArgs e)
+ {
+ if (!this.isDefault)
+ {
+ Correct();
+ }
+ }
+
+ private void buttonIncorrect_Click(object sender, System.EventArgs e)
+ {
+ if (!this.isDefault)
+ {
+ Incorrect();
+ }
+ }
+
+ private void Form1_Load(object sender, System.EventArgs e)
+ {
+ if (this.isDefault)
+ this.timer_Tick(null, null);
+ else
+ this.TopMost = true;
+ }
+ }
+
+ public class Def
+ {
+ private string key;
+ private string value;
+ private string details;
+ private int freq;
+
+ public Def(string key, string value, string details, int freq)
+ {
+ Debug.Assert(key != null && value != null && details != null && freq > 0);
+ this.key = key;
+ this.value = value;
+ this.details = details;
+ this.freq = freq;
+ }
+
+ public string Key
+ {
+ get
+ {
+ return key;
+ }
+ }
+
+ public string Value
+ {
+ get
+ {
+ return value;
+ }
+ }
+
+ public string Details
+ {
+ get
+ {
+ return details;
+ }
+ }
+
+ public int Freq
+ {
+ get
+ {
+ return freq;
+ }
+ set
+ {
+ freq = value;
+ }
+ }
+ }
+}
+
Added: pop-quiz/trunk/PopQuiz/Form1.cs
===================================================================
--- pop-quiz/trunk/PopQuiz/Form1.cs (rev 0)
+++ pop-quiz/trunk/PopQuiz/Form1.cs 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,862 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.IO;
+using System.Data;
+using System.Xml;
+using System.Diagnostics;
+using System.Threading;
+using System.Text.RegularExpressions;
+
+namespace PopQuiz
+{
+ public enum Status
+ {
+ Neutral,
+ Correct,
+ Incorrect
+ }
+
+ /// <summary>
+ /// Summary description for Form1.
+ /// </summary>
+ public class Form1 : System.Windows.Forms.Form
+ {
+ private bool isDefault = false;
+ private System.Windows.Forms.Timer timer;
+ private System.ComponentModel.IContainer components;
+
+ private Def def = null;
+ private System.Windows.Forms.Button buttonOK;
+ private System.Windows.Forms.Label labelKey;
+ private System.Windows.Forms.TextBox textBox;
+
+ // ArrayList<Def>
+ private ArrayList list = null;
+ private ArrayList uniq = null;
+ private ArrayList additions = null;
+ private ArrayList history = new ArrayList();
+ // map string (word) to int (freq)
+ private Hashtable table = null;
+ private Hashtable fullTable = null;
+ private Status status = Status.Neutral;
+ private int initSize = 0;
+ private int increment;
+ private int decrement;
+ private int maxval;
+ private int undoFreq = -1;
+ private Def delayDef = null;
+ private string logPath = null;
+ private string txtPath = null;
+ private string freqPath = null;
+ private string addPath = null;
+ private DateTime spawnTime = DateTime.Now;
+ private System.Windows.Forms.Panel panelButtons;
+ private System.Windows.Forms.Button buttonCorrect;
+ private System.Windows.Forms.Button buttonIncorrect;
+ private System.Windows.Forms.Button buttonShow;
+ private System.Windows.Forms.TextBox label;
+ private System.Windows.Forms.Button buttonDelay;
+ private Form1 parent = null;
+
+ public Form1()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ isDefault = true;
+ timer.Enabled = true;
+ table = new Hashtable();
+ list = new ArrayList();
+ uniq = new ArrayList();
+ additions = new ArrayList();
+ using(StreamReader reader = new StreamReader(@"list.txt"))
+ {
+ txtPath = reader.ReadLine();
+ }
+
+ freqPath = Regex.Replace(txtPath, @"\.txt$", " Freq.txt");
+ if (File.Exists(freqPath))
+ {
+ using(StreamReader reader = new StreamReader(freqPath))
+ {
+ while (true)
+ {
+ int freq = 1;
+ string line = reader.ReadLine();
+ if (line == null)
+ break;
+ if (line == "")
+ continue;
+ line = line.Trim();
+ if (line[0] == '#')
+ continue;
+ string[] parts = line.Split('\t');
+
+ // format: <freq>\t<word>
+ freq = int.Parse(parts[0]);
+ table[parts[1]] = freq;
+ }
+ }
+ }
+
+ string filterPath = Regex.Replace(txtPath, @"\.txt$", " Filter.txt");
+ Hashtable filter = null;
+ if (File.Exists(filterPath))
+ {
+ filter = new Hashtable();
+ uniq = new ArrayList();
+ using(StreamReader reader = new StreamReader(filterPath))
+ {
+ while (true)
+ {
+ string line = reader.ReadLine();
+ if (line == null)
+ break;
+ if (line == "")
+ continue;
+ line = line.Trim();
+ if (line[0] == '#')
+ continue;
+
+ // format: <key>\t<value>
+ filter[line] = line;
+ }
+ }
+ }
+
+ fullTable = new Hashtable();
+ using(StreamReader reader = new StreamReader(txtPath))
+ {
+ while (true)
+ {
+ int freq = 1;
+ string line = reader.ReadLine();
+ if (line == null)
+ break;
+ if (line == "")
+ continue;
+ line = line.Trim();
+ if (line[0] == '#')
+ continue;
+ string[] parts = line.Split('\t');
+
+ if (filter != null && !filter.ContainsKey(parts[0]))
+ continue;
+
+ if (table.ContainsKey(parts[0]))
+ freq = (int) table[parts[0]];
+
+ if (!Regex.IsMatch(parts[0], @"[a-z]"))
+ {
+ // all caps, so must be assoc list
+ string[] keys = parts[1].Split(' ');
+ string[] values = line.Split(' ', '\t');
+ for (int i = 1; i < keys.Length; i++)
+ Add(new Def(keys[i], freq, values));
+ continue;
+ }
+
+ Def def = new Def(parts[0], freq, parts[1].Split(';'));
+ Add(def);
+ }
+ }
+
+ addPath = Regex.Replace(txtPath, @"\.txt$", " Additions.txt");
+ if (File.Exists(addPath)) {
+ using(StreamReader reader = new StreamReader(addPath)) {
+ while (true) {
+ string line = reader.ReadLine();
+ if (line == null)
+ break;
+ if (line == "")
+ continue;
+ line = line.Trim();
+ if (line[0] == '#')
+ continue;
+ string[] parts = line.Split('\t');
+
+ // format: <key>\t<value>
+ string key = parts[0];
+ string text = parts[1];
+ additions.Add(new Def(key, text));
+ if (fullTable.ContainsKey(key))
+ {
+ ((Def) fullTable[key]).Values.Add(text);
+ }
+ }
+ }
+ }
+
+
+ logPath = Regex.Replace(txtPath, @"\.txt$", " Log.txt");
+ if (File.Exists(logPath)) {
+ using(StreamReader reader = new StreamReader(logPath)) {
+ while (true) {
+ string line = reader.ReadLine();
+ if (line == null)
+ break;
+ if (line == "")
+ continue;
+ line = line.Trim();
+ if (line[0] == '#')
+ continue;
+ string[] parts = line.Split(':');
+ if (parts.Length != 3)
+ continue;
+ parts = parts[2].Split('(');
+ if (parts.Length != 2)
+ continue;
+ line = parts[0].Trim();
+ if (line == "")
+ continue;
+
+ string key = line;
+ if (!fullTable.Contains(key)) {
+ continue;
+ }
+ history.Add(fullTable[key]);
+ this.label.Text += line + "\r\n";
+ }
+ }
+ }
+
+ initSize = uniq.Count;
+ increment = Math.Max(initSize / 20, 2);
+ decrement = Math.Max(increment / 3, 1);
+ maxval = Math.Max(initSize / 5, 2);
+
+ this.label.Text += "Increment: " + increment
+ + "\r\nDecrement: " + decrement
+ + "\r\nUniques: " + uniq.Count
+ + "\r\nTotal: " + list.Count
+ + "\r\nMax Val: " + maxval
+ + "\r\nTimer: " + this.timer.Interval + "ms\r\n\r\n";
+
+ this.labelKey.Visible = false;
+ this.buttonDelay.Visible = false;
+ this.buttonShow.Visible = false;
+ this.buttonIncorrect.Visible = false;
+ this.buttonCorrect.Text = "Change &Timer";
+ this.buttonOK.Text = "&Quiz Me Now";
+ this.WindowState = FormWindowState.Normal;
+ this.MaximizeBox = true;
+ this.MinimizeBox = true;
+ }
+
+ public Form1(Form1 parent, Def def)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ isDefault = false;
+ this.def = def;
+ this.labelKey.Text = def.Key;
+ this.parent = parent;
+
+ int count = 0;
+ foreach (Def def2 in parent.list)
+ if (def2.Key == this.def.Key)
+ count ++;
+ this.labelKey.Text += " (" + count + ")";
+ }
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.labelKey = new System.Windows.Forms.Label();
+ this.timer = new System.Windows.Forms.Timer(this.components);
+ this.buttonOK = new System.Windows.Forms.Button();
+ this.textBox = new System.Windows.Forms.TextBox();
+ this.buttonCorrect = new System.Windows.Forms.Button();
+ this.buttonIncorrect = new System.Windows.Forms.Button();
+ this.panelButtons = new System.Windows.Forms.Panel();
+ this.buttonShow = new System.Windows.Forms.Button();
+ this.label = new System.Windows.Forms.TextBox();
+ this.buttonDelay = new System.Windows.Forms.Button();
+ this.panelButtons.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // labelKey
+ //
+ this.labelKey.Cursor = System.Windows.Forms.Cursors.Default;
+ this.labelKey.Dock = System.Windows.Forms.DockStyle.Top;
+ this.labelKey.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.labelKey.Location = new System.Drawing.Point(10, 10);
+ this.labelKey.Name = "labelKey";
+ this.labelKey.Size = new System.Drawing.Size(548, 38);
+ this.labelKey.TabIndex = 0;
+ //
+ // timer
+ //
+ this.timer.Interval = 300000;
+ this.timer.Tick += new System.EventHandler(this.timer_Tick);
+ //
+ // buttonOK
+ //
+ this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonOK.Location = new System.Drawing.Point(448, 8);
+ this.buttonOK.Name = "buttonOK";
+ this.buttonOK.Size = new System.Drawing.Size(96, 32);
+ this.buttonOK.TabIndex = 2;
+ this.buttonOK.Text = "OK";
+ this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
+ //
+ // textBox
+ //
+ this.textBox.Dock = System.Windows.Forms.DockStyle.Top;
+ this.textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.textBox.Location = new System.Drawing.Point(10, 48);
+ this.textBox.Name = "textBox";
+ this.textBox.Size = new System.Drawing.Size(548, 30);
+ this.textBox.TabIndex = 1;
+ this.textBox.Text = "";
+ //
+ // buttonCorrect
+ //
+ this.buttonCorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonCorrect.Location = new System.Drawing.Point(344, 8);
+ this.buttonCorrect.Name = "buttonCorrect";
+ this.buttonCorrect.Size = new System.Drawing.Size(96, 32);
+ this.buttonCorrect.TabIndex = 4;
+ this.buttonCorrect.Text = "&Correct";
+ this.buttonCorrect.Click += new System.EventHandler(this.buttonCorrect_Click);
+ //
+ // buttonIncorrect
+ //
+ this.buttonIncorrect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonIncorrect.Location = new System.Drawing.Point(240, 8);
+ this.buttonIncorrect.Name = "buttonIncorrect";
+ this.buttonIncorrect.Size = new System.Drawing.Size(96, 32);
+ this.buttonIncorrect.TabIndex = 4;
+ this.buttonIncorrect.Text = "&D\'oh!";
+ this.buttonIncorrect.Click += new System.EventHandler(this.buttonIncorrect_Click);
+ //
+ // panelButtons
+ //
+ this.panelButtons.Controls.Add(this.buttonShow);
+ this.panelButtons.Controls.Add(this.buttonOK);
+ this.panelButtons.Controls.Add(this.buttonCorrect);
+ this.panelButtons.Controls.Add(this.buttonIncorrect);
+ this.panelButtons.Controls.Add(this.buttonDelay);
+ this.panelButtons.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.panelButtons.Location = new System.Drawing.Point(10, 396);
+ this.panelButtons.Name = "panelButtons";
+ this.panelButtons.Size = new System.Drawing.Size(548, 48);
+ this.panelButtons.TabIndex = 5;
+ //
+ // buttonShow
+ //
+ this.buttonShow.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonShow.Location = new System.Drawing.Point(136, 8);
+ this.buttonShow.Name = "buttonShow";
+ this.buttonShow.Size = new System.Drawing.Size(96, 32);
+ this.buttonShow.TabIndex = 5;
+ this.buttonShow.Text = "&Show";
+ this.buttonShow.Click += new System.EventHandler(this.buttonShow_Click);
+ //
+ // label
+ //
+ this.label.BackColor = System.Drawing.SystemColors.Window;
+ this.label.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.label.Location = new System.Drawing.Point(10, 78);
+ this.label.Multiline = true;
+ this.label.Name = "label";
+ this.label.ReadOnly = true;
+ this.label.ScrollBars = System.Windows.Forms.ScrollBars.Both;
+ this.label.Size = new System.Drawing.Size(548, 318);
+ this.label.TabIndex = 6;
+ this.label.Text = "";
+ this.label.WordWrap = false;
+ this.label.TextChanged += new System.EventHandler(this.label_TextChanged);
+ //
+ // buttonDelay
+ //
+ this.buttonDelay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.buttonDelay.Location = new System.Drawing.Point(32, 8);
+ this.buttonDelay.Name = "buttonDelay";
+ this.buttonDelay.Size = new System.Drawing.Size(96, 32);
+ this.buttonDelay.TabIndex = 5;
+ this.buttonDelay.Text = "D&elay";
+ this.buttonDelay.Click += new System.EventHandler(this.buttonDelay_Click);
+ //
+ // Form1
+ //
+ this.AcceptButton = this.buttonOK;
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(568, 454);
+ this.Controls.Add(this.label);
+ this.Controls.Add(this.panelButtons);
+ this.Controls.Add(this.textBox);
+ this.Controls.Add(this.labelKey);
+ this.DockPadding.All = 10;
+ this.KeyPreview = true;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "Form1";
+ this.Text = "PopQuiz!";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.Closed += new System.EventHandler(this.OnClosed);
+ this.panelButtons.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ public static void Main()
+ {
+ Application.Run(new Form1());
+
+ }
+
+ private void OnClosed(object sender, System.EventArgs e)
+ {
+ if (this.isDefault)
+ {
+ Application.Exit();
+ }
+ else
+ {
+ switch (this.status)
+ {
+ case Status.Neutral:
+ parent.Log(def.Key);
+ break;
+ case Status.Correct:
+ parent.Log(def.Key + " (correct)");
+ break;
+ case Status.Incorrect:
+ parent.Log(def.Key + " (INCORRECT)");
+ break;
+ }
+ lock(this.parent)
+ {
+ this.parent.buttonOK.Enabled = true;
+ this.parent.timer.Enabled = true;
+ }
+ }
+ }
+
+ private void timer_Tick(object sender, System.EventArgs e)
+ {
+ lock(this)
+ {
+ if (!this.buttonOK.Enabled)
+ return;
+ this.buttonOK.Enabled = false;
+ }
+
+ Def def;
+ this.timer.Enabled = false;
+ if (this.delayDef == null) {
+ while (true) {
+ int rand = new Random().Next(list.Count);
+ def = (Def) list[rand];
+ bool wasRecent = false;
+ if (def.Freq <= uniq.Count / 40) {
+ for (int i = 0; i < uniq.Count / 2 && i < history.Count; i++) {
+ if (history[history.Count - i - 1] == def) {
+ wasRecent = true;
+ break;
+ }
+ }
+ }
+ if (!wasRecent) {
+ break;
+ }
+ }
+ } else {
+ def = this.delayDef;
+ }
+ history.Add(def);
+ this.delayDef = null;
+ Form1 form = new Form1(this, def);
+ form.Show();
+ form.Activate();
+ }
+
+ private void buttonOK_Click(object sender, System.EventArgs e)
+ {
+ if (this.isDefault)
+ {
+ if (this.textBox.Text != "")
+ if (this.fullTable.ContainsKey(this.textBox.Text))
+ this.delayDef = (Def) this.fullTable[this.textBox.Text];
+ else
+ {
+ MessageBox.Show("Can't find word '" + this.textBox.Text + "'", "PopQuiz");
+ return;
+ }
+ this.timer_Tick(null, null);
+ return;
+ }
+
+ if ((DateTime.Now - this.spawnTime).Seconds <= 1)
+ {
+ MessageBox.Show("One second must have elapsed before you can hit Enter.", "Accidental Typing Protection");
+ return;
+ }
+ if (!this.def.Contains(this.textBox.Text))
+ {
+ this.undoFreq = this.def.Freq;
+ Incorrect();
+ this.buttonShow.Text = "&Add definition";
+ }
+ else
+ {
+ Correct();
+ }
+ }
+
+ private void Incorrect()
+ {
+ if (this.label.Text != "")
+ {
+ Close();
+ return;
+ }
+
+ int oldFreq = this.def.Freq;
+ this.def.Freq += parent.increment;
+ if (this.def.Freq > parent.maxval)
+ this.def.Freq = parent.maxval;
+ this.label.ForeColor = Color.Red;
+ ShowDef(oldFreq);
+ int inc = this.def.Freq - oldFreq;
+ for (int i = 0; i < inc; i++)
+ parent.list.Add(def);
+
+ this.status = Status.Incorrect;
+ }
+
+ private void ShowDef(int oldFreq)
+ {
+ this.label.Text = "\r\n";
+ for (int i = 0; i < this.def.Values.Count; i++)
+ {
+ if (i == this.def.OrigCount)
+ this.label.Text += "\r\n";
+ this.label.Text += (i+1) + ". " + this.def.Values[i] + "\r\n";
+ }
+
+ this.label.Text += "\r\n\r\nFreq: " + this.def.Freq + "/" + this.parent.list.Count;
+ if (oldFreq < this.def.Freq)
+ this.label.Text += " = " + oldFreq + " + " + (this.def.Freq - oldFreq);
+ else if (oldFreq > this.def.Freq)
+ this.label.Text += " = " + oldFreq + " - " + (oldFreq - this.def.Freq);
+
+ if (oldFreq != this.def.Freq)
+ this.parent.Save();
+
+ this.buttonCorrect.Text = "Close";
+ this.buttonIncorrect.Text = "Close";
+ this.buttonShow.Text = "Close";
+ this.buttonOK.Text = "&Close";
+ }
+
+ private void Correct()
+ {
+ Correct(false);
+ }
+
+ private void Correct(bool isUndo)
+ {
+ if (this.label.Text != "" && !isUndo)
+ {
+ Close();
+ return;
+ }
+
+ int oldFreq = this.def.Freq;
+ if (isUndo)
+ this.def.Freq = undoFreq;
+ this.def.Freq -= parent.decrement;
+ if (this.def.Freq <= 1)
+ this.def.Freq = 1;
+ this.label.ForeColor = Color.Blue;
+ ShowDef(isUndo ? undoFreq : oldFreq);
+ int dec = oldFreq - this.def.Freq;
+ for (int i = 0; i < dec; i++)
+ parent.list.Remove(def);
+ this.status = Status.Correct;
+ if (isUndo)
+ undoFreq = 0;
+ }
+
+ private void Add(Def def)
+ {
+ if (fullTable.ContainsKey(def.Key))
+ {
+ Def oldDef = (Def) fullTable[def.Key];
+ Debug.Assert(def.Freq == oldDef.Freq);
+ foreach (string val in def.Values)
+ if (!oldDef.Contains(val))
+ oldDef.Values.Add(val);
+ }
+ else
+ {
+ fullTable[def.Key] = def;
+ for ( int i = 0; i < def.Freq; i++ )
+ list.Add(def);
+ uniq.Add(def);
+ }
+ }
+
+ private void Save()
+ {
+ using (FileStream stream = new FileStream(freqPath, FileMode.Create))
+ {
+ using (StreamWriter writer = new StreamWriter(stream))
+ {
+ foreach (Def def in uniq)
+ if (def.Freq > 1)
+ writer.WriteLine(def.Freq + "\t" + def.Key);
+ }
+ }
+ }
+
+ private void SaveAdditions()
+ {
+ using (FileStream stream = new FileStream(addPath, FileMode.Create))
+ {
+ using (StreamWriter writer = new StreamWriter(stream))
+ {
+ foreach (Def def in additions)
+ writer.WriteLine(def.Key + "\t" + def.Values[0]);
+ }
+ }
+ }
+
+ private void buttonCorrect_Click(object sender, System.EventArgs e)
+ {
+ if (!this.isDefault)
+ {
+ Correct();
+ }
+ else
+ {
+ try
+ {
+ this.timer.Interval = int.Parse(this.textBox.Text);
+ Log("Updated timer to " + this.timer.Interval + "ms");
+ }
+ catch
+ {
+ MessageBox.Show("Please specify a number.", "Timer Update");
+ }
+ }
+ }
+
+ private void Log(string text)
+ {
+ string line = DateTime.Now.ToString("t") + ": " + text;
+ this.label.Text += line + "\r\n";
+ StreamWriter log = new StreamWriter(this.logPath, true);
+ log.WriteLine(line);
+ log.Close();
+ }
+
+ private void buttonIncorrect_Click(object sender, System.EventArgs e)
+ {
+ if (!this.isDefault)
+ {
+ Incorrect();
+ }
+ }
+
+ private void Form1_Load(object sender, System.EventArgs e)
+ {
+ if (!this.isDefault)
+ this.TopMost = true;
+ }
+
+ private void buttonShow_Click(object sender, System.EventArgs e)
+ {
+ if (this.undoFreq > 0)
+ {
+ string text = this.textBox.Text.Trim();
+ if (!this.def.Contains(text))
+ {
+ this.parent.additions.Add(new Def(this.def.Key, text));
+ this.def.Values.Add(text);
+ parent.SaveAdditions();
+ }
+
+ Correct(true);
+ return;
+ }
+
+ if (this.label.Text != "")
+ {
+ Close();
+ return;
+ }
+
+ if (!this.isDefault)
+ ShowDef(this.def.Freq);
+ }
+
+ private void label_TextChanged(object sender, System.EventArgs e)
+ {
+ this.label.SelectionStart = this.label.Text.Length;
+ this.label.ScrollToCaret();
+ }
+
+ private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
+ {
+ if (!this.isDefault && e.KeyCode == Keys.Escape)
+ {
+ this.Close();
+ }
+ }
+
+ private void buttonDelay_Click(object sender, System.EventArgs e)
+ {
+ this.parent.delayDef = this.def;
+ Close();
+ }
+ }
+
+
+ public class Def
+ {
+ private int origCount;
+ private string key;
+ private ArrayList values = new ArrayList(); // strings
+ private int freq;
+ private int correctCount;
+ private int incorrectCount;
+
+ public Def(string key, string value)
+ {
+ this.key = key;
+ this.values.Add(value);
+ }
+
+ public Def(string key, int freq, string[] values)
+ {
+ Debug.Assert(key != null && values != null && values.Length != 0 && freq > 0);
+ this.key = key.ToLower().Trim();
+ this.freq = freq;
+
+ // take out our current word
+ int i = 0;
+ for (i = 0; i < values.Length; i++)
+ {
+ string val = values[i].ToLower().Trim();
+ if (val != key)
+ this.Values.Add(val);
+ }
+
+ origCount = this.values.Count;
+ }
+
+ public string Key
+ {
+ get
+ {
+ return key;
+ }
+ }
+
+ public ArrayList Values
+ {
+ get
+ {
+ return values;
+ }
+ }
+
+ public int Freq
+ {
+ get
+ {
+ return freq;
+ }
+ set
+ {
+ freq = value;
+ }
+ }
+
+ public int IncorrectCount
+ {
+ get
+ {
+ return this.incorrectCount;
+ }
+ set
+ {
+ this.incorrectCount = value;
+ }
+ }
+
+ public int CorrectCount
+ {
+ get
+ {
+ return this.correctCount;
+ }
+ set
+ {
+ this.correctCount = value;
+ }
+ }
+
+ private string Simplify(string value)
+ {
+ value = Regex.Replace(value, @"\b(the|an|a)\b", ""); // remove articles
+ value = Regex.Replace(value, @"[ \.,-]+", ""); // remove spaces and punctuation
+ return value.ToLower();
+ }
+
+ public bool Contains(string value)
+ {
+ foreach (string val in values)
+ if (Simplify(val) == Simplify(value))
+ return true;
+ return false;
+ }
+
+ public int OrigCount
+ {
+ get
+ {
+ return origCount;
+ }
+ }
+ }
+}
\ No newline at end of file
Added: pop-quiz/trunk/PopQuiz/Form1.resx
===================================================================
--- pop-quiz/trunk/PopQuiz/Form1.resx (rev 0)
+++ pop-quiz/trunk/PopQuiz/Form1.resx 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 1.3
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">1.3</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1">this is my long string</data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ [base64 mime encoded serialized .NET Framework object]
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ [base64 mime encoded string representing a byte array form of the .NET Framework object]
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used forserialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>1.3</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="labelKey.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="labelKey.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="labelKey.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="timer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="timer.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </data>
+ <data name="timer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="textBox.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="textBox.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="textBox.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonCorrect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonCorrect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonCorrect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonIncorrect.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonIncorrect.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonIncorrect.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="panelButtons.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="panelButtons.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
+ <data name="panelButtons.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="panelButtons.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>8, 8</value>
+ </data>
+ <data name="panelButtons.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
+ <data name="panelButtons.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonShow.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonShow.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonShow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="label.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="label.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="label.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonDelay.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="buttonDelay.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="buttonDelay.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+ <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>(Default)</value>
+ </data>
+ <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="$this.Name">
+ <value>Form1</value>
+ </data>
+ <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>False</value>
+ </data>
+ <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>8, 8</value>
+ </data>
+ <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
+ <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>80</value>
+ </data>
+ <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </data>
+ <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>Private</value>
+ </data>
+</root>
\ No newline at end of file
Added: pop-quiz/trunk/PopQuiz/PopQuiz.csproj
===================================================================
--- pop-quiz/trunk/PopQuiz/PopQuiz.csproj (rev 0)
+++ pop-quiz/trunk/PopQuiz/PopQuiz.csproj 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,119 @@
+<VisualStudioProject>
+ <CSHARP
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = "App.ico"
+ AssemblyKeyContainerName = ""
+ AssemblyName = "PopQuiz"
+ AssemblyOriginatorKeyFile = ""
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "WinExe"
+ PreBuildEvent = ""
+ PostBuildEvent = ""
+ RootNamespace = "PopQuiz"
+ RunPostBuildEvent = "OnBuildSuccess"
+ StartupObject = ""
+ >
+ <Config
+ Name = "Debug"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "DEBUG;TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "true"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "false"
+ OutputPath = "bin\Debug\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ <Config
+ Name = "Release"
+ AllowUnsafeBlocks = "false"
+ BaseAddress = "285212672"
+ CheckForOverflowUnderflow = "false"
+ ConfigurationOverrideFile = ""
+ DefineConstants = "TRACE"
+ DocumentationFile = ""
+ DebugSymbols = "false"
+ FileAlignment = "4096"
+ IncrementalBuild = "false"
+ NoStdLib = "false"
+ NoWarn = ""
+ Optimize = "true"
+ OutputPath = "bin\Release\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "4"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
+ />
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
+ />
+ <Reference
+ Name = "System.Drawing"
+ AssemblyName = "System.Drawing"
+ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+ />
+ <Reference
+ Name = "System.Windows.Forms"
+ AssemblyName = "System.Windows.Forms"
+ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
+ />
+ </References>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "App.ico"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "AssemblyInfo.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Form1.cs"
+ SubType = "Form"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Form1.resx"
+ DependentUpon = "Form1.cs"
+ BuildAction = "EmbeddedResource"
+ />
+ </Include>
+ </Files>
+ </CSHARP>
+</VisualStudioProject>
+
Added: pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user
===================================================================
--- pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user (rev 0)
+++ pop-quiz/trunk/PopQuiz/PopQuiz.csproj.user 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,48 @@
+<VisualStudioProject>
+ <CSHARP LastOpenVersion = "7.10.3077" >
+ <Build>
+ <Settings ReferencePath = "" >
+ <Config
+ Name = "Debug"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "true"
+ />
+ <Config
+ Name = "Release"
+ EnableASPDebugging = "false"
+ EnableASPXDebugging = "false"
+ EnableUnmanagedDebugging = "false"
+ EnableSQLServerDebugging = "false"
+ RemoteDebugEnabled = "false"
+ RemoteDebugMachine = ""
+ StartAction = "Project"
+ StartArguments = ""
+ StartPage = ""
+ StartProgram = ""
+ StartURL = ""
+ StartWorkingDirectory = ""
+ StartWithIE = "true"
+ />
+ </Settings>
+ </Build>
+ <OtherProjectSettings
+ CopyProjectDestinationFolder = ""
+ CopyProjectUncPath = ""
+ CopyProjectOption = "0"
+ ProjectView = "ProjectFiles"
+ ProjectTrust = "0"
+ />
+ </CSHARP>
+</VisualStudioProject>
+
Added: pop-quiz/trunk/PopQuiz/PopQuiz.sln
===================================================================
--- pop-quiz/trunk/PopQuiz/PopQuiz.sln (rev 0)
+++ pop-quiz/trunk/PopQuiz/PopQuiz.sln 2008-07-02 06:32:54 UTC (rev 860)
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PopQuiz", "PopQuiz.csproj", "{D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}.Debug.ActiveCfg = Debug|.NET
+ {D5BC44D9-56AA-40D7-8E4D-C49ACD8C0456}.Debug.Build.0 = Debug|...
[truncated message content] |
|
From: <yan...@us...> - 2008-07-02 05:23:30
|
Revision: 859
http://assorted.svn.sourceforge.net/assorted/?rev=859&view=rev
Author: yangzhang
Date: 2008-07-01 22:23:33 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added long long int test
Added Paths:
-----------
sandbox/trunk/src/cc/longlongint.cc
Added: sandbox/trunk/src/cc/longlongint.cc
===================================================================
--- sandbox/trunk/src/cc/longlongint.cc (rev 0)
+++ sandbox/trunk/src/cc/longlongint.cc 2008-07-02 05:23:33 UTC (rev 859)
@@ -0,0 +1,34 @@
+#include <iostream>
+#include <string>
+#include <typeinfo>
+
+using namespace std;
+
+void f(int64_t x) { cout << x << endl; }
+void f(int32_t x) { cout << x << endl; }
+void f(int16_t x) { cout << x << endl; }
+void f(int8_t x) { cout << x << endl; }
+void f(double x) { cout << x << endl; }
+void f(float x) { cout << x << endl; }
+void f(string& x) { cout << x << endl; }
+
+int
+main()
+{
+// long long int x = 32;
+ long int x = 32;
+ f(x);
+ int64_t y = 32;
+ f(y);
+// f(0LL);
+ cout << sizeof(int64_t) << endl;
+ cout << sizeof(long long) << endl;
+ cout << sizeof(long int) << endl;
+ cout << sizeof(long) << endl;
+ cout << sizeof(0LL) << endl;
+ cout << sizeof(0L) << endl;
+ cout << typeid(int64_t).name() << endl;
+ cout << typeid(long long).name() << endl;
+ cout << typeid(string).name() << endl;
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-06-30 02:59:02
|
Revision: 858
http://assorted.svn.sourceforge.net/assorted/?rev=858&view=rev
Author: yangzhang
Date: 2008-06-29 19:59:11 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
tweaks; added notify()
Modified Paths:
--------------
shell-tools/trunk/src/bash-commons/bashrc.bash
shell-tools/trunk/src/bash-commons/common.bash
Modified: shell-tools/trunk/src/bash-commons/bashrc.bash
===================================================================
--- shell-tools/trunk/src/bash-commons/bashrc.bash 2008-06-30 02:58:41 UTC (rev 857)
+++ shell-tools/trunk/src/bash-commons/bashrc.bash 2008-06-30 02:59:11 UTC (rev 858)
@@ -571,9 +571,19 @@
--tool=memcheck \
--leak-check=yes \
--leak-resolution=high \
- --show-reachable=yes
+ --show-reachable=yes \
+ "$@"
}
+# From http://www.emilsit.net/blog/archives/reduce-your-context-switch-delay/
+# Does not work with errexit.
+notify() {
+ "$@"
+ local status=$?
+ xmessage -center "exited with status $status: $*"
+ return $status
+}
+
#function set_title() {
# if [ $# -eq 0 ] ; then
# eval set -- "$PWD"
Modified: shell-tools/trunk/src/bash-commons/common.bash
===================================================================
--- shell-tools/trunk/src/bash-commons/common.bash 2008-06-30 02:58:41 UTC (rev 857)
+++ shell-tools/trunk/src/bash-commons/common.bash 2008-06-30 02:59:11 UTC (rev 858)
@@ -15,6 +15,10 @@
cmd_name="$( basename -- "$0" )"
+#
+# Colors
+#
+
# \e = \E = \033
# 0;34m = 34m
# 30's are foregrounds, 40's are backgrounds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-06-30 02:58:38
|
Revision: 857
http://assorted.svn.sourceforge.net/assorted/?rev=857&view=rev
Author: yangzhang
Date: 2008-06-29 19:58:41 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
added run(); added TerminalController; renamed free_struct; added repr, eq for free_struct
Modified Paths:
--------------
python-commons/trunk/src/commons/misc.py
python-commons/trunk/src/commons/structs.py
Modified: python-commons/trunk/src/commons/misc.py
===================================================================
--- python-commons/trunk/src/commons/misc.py 2008-06-30 02:54:06 UTC (rev 856)
+++ python-commons/trunk/src/commons/misc.py 2008-06-30 02:58:41 UTC (rev 857)
@@ -1,13 +1,18 @@
# -*- mode: python; tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4; -*-
# vim:ft=python:et:sw=4:ts=4
-from contextlib import *
-from time import *
-
"""
Miscellanea.
"""
+from contextlib import *
+from subprocess import CalledProcessError, PIPE, Popen
+from time import *
+
+# TerminalController
+from sys import stdout
+from re import sub
+
def generate_bit_fields(count):
"""
A generator of [2^i] for i from 0 to (count - 1). Useful for,
@@ -60,3 +65,162 @@
"""
f()
return g()
+
+def run(cmd):
+ """
+ Run the given command (a list of program and argument strings) and return the
+ stdout as a string, raising a L{CalledProcessError} if the program exited
+ with a non-zero status.
+ """
+ p = Popen(cmd, stdout=PIPE)
+ stdout = p.communicate()[0]
+ if p.returncode != 0: raise CalledProcessError(p.returncode, cmd)
+ return stdout
+
+class TerminalController:
+ """
+ From U{http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116}.
+
+ A class that can be used to portably generate formatted output to
+ a terminal.
+
+ `TerminalController` defines a set of instance variables whose
+ values are initialized to the control sequence necessary to
+ perform a given action. These can be simply included in normal
+ output to the terminal:
+
+ >>> term = TerminalController()
+ >>> print 'This is '+term.GREEN+'green'+term.NORMAL
+
+ Alternatively, the `render()` method can used, which replaces
+ '${action}' with the string required to perform 'action':
+
+ >>> term = TerminalController()
+ >>> print term.render('This is ${GREEN}green${NORMAL}')
+
+ If the terminal doesn't support a given action, then the value of
+ the corresponding instance variable will be set to ''. As a
+ result, the above code will still work on terminals that do not
+ support color, except that their output will not be colored.
+ Also, this means that you can test whether the terminal supports a
+ given action by simply testing the truth value of the
+ corresponding instance variable:
+
+ >>> term = TerminalController()
+ >>> if term.CLEAR_SCREEN:
+ ... print 'This terminal supports clearning the screen.'
+
+ Finally, if the width and height of the terminal are known, then
+ they will be stored in the `COLS` and `LINES` attributes.
+ """
+ # Cursor movement:
+ BOL = '' #: Move the cursor to the beginning of the line
+ UP = '' #: Move the cursor up one line
+ DOWN = '' #: Move the cursor down one line
+ LEFT = '' #: Move the cursor left one char
+ RIGHT = '' #: Move the cursor right one char
+
+ # Deletion:
+ CLEAR_SCREEN = '' #: Clear the screen and move to home position
+ CLEAR_EOL = '' #: Clear to the end of the line.
+ CLEAR_BOL = '' #: Clear to the beginning of the line.
+ CLEAR_EOS = '' #: Clear to the end of the screen
+
+ # Output modes:
+ BOLD = '' #: Turn on bold mode
+ BLINK = '' #: Turn on blink mode
+ DIM = '' #: Turn on half-bright mode
+ REVERSE = '' #: Turn on reverse-video mode
+ NORMAL = '' #: Turn off all modes
+
+ # Cursor display:
+ HIDE_CURSOR = '' #: Make the cursor invisible
+ SHOW_CURSOR = '' #: Make the cursor visible
+
+ # Terminal size:
+ COLS = None #: Width of the terminal (None for unknown)
+ LINES = None #: Height of the terminal (None for unknown)
+
+ # Foreground colors:
+ BLACK = BLUE = GREEN = CYAN = RED = MAGENTA = YELLOW = WHITE = ''
+
+ # Background colors:
+ BG_BLACK = BG_BLUE = BG_GREEN = BG_CYAN = ''
+ BG_RED = BG_MAGENTA = BG_YELLOW = BG_WHITE = ''
+
+ _STRING_CAPABILITIES = """
+ BOL=cr UP=cuu1 DOWN=cud1 LEFT=cub1 RIGHT=cuf1
+ CLEAR_SCREEN=clear CLEAR_EOL=el CLEAR_BOL=el1 CLEAR_EOS=ed BOLD=bold
+ BLINK=blink DIM=dim REVERSE=rev UNDERLINE=smul NORMAL=sgr0
+ HIDE_CURSOR=cinvis SHOW_CURSOR=cnorm""".split()
+ _COLORS = """BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE""".split()
+ _ANSICOLORS = "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE".split()
+
+ def __init__(self, term_stream=stdout):
+ """
+ Create a `TerminalController` and initialize its attributes
+ with appropriate values for the current terminal.
+ `term_stream` is the stream that will be used for terminal
+ output; if this stream is not a tty, then the terminal is
+ assumed to be a dumb terminal (i.e., have no capabilities).
+ """
+ # Curses isn't available on all platforms
+ try: import curses
+ except: return
+
+ # If the stream isn't a tty, then assume it has no capabilities.
+ if not term_stream.isatty(): return
+
+ # Check the terminal type. If we fail, then assume that the
+ # terminal has no capabilities.
+ try: curses.setupterm()
+ except: return
+
+ # Look up numeric capabilities.
+ self.COLS = curses.tigetnum('cols')
+ self.LINES = curses.tigetnum('lines')
+
+ # Look up string capabilities.
+ for capability in self._STRING_CAPABILITIES:
+ (attrib, cap_name) = capability.split('=')
+ setattr(self, attrib, self._tigetstr(cap_name) or '')
+
+ # Colors
+ set_fg = self._tigetstr('setf')
+ if set_fg:
+ for i,color in zip(range(len(self._COLORS)), self._COLORS):
+ setattr(self, color, curses.tparm(set_fg, i) or '')
+ set_fg_ansi = self._tigetstr('setaf')
+ if set_fg_ansi:
+ for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
+ setattr(self, color, curses.tparm(set_fg_ansi, i) or '')
+ set_bg = self._tigetstr('setb')
+ if set_bg:
+ for i,color in zip(range(len(self._COLORS)), self._COLORS):
+ setattr(self, 'BG_'+color, curses.tparm(set_bg, i) or '')
+ set_bg_ansi = self._tigetstr('setab')
+ if set_bg_ansi:
+ for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
+ setattr(self, 'BG_'+color, curses.tparm(set_bg_ansi, i) or '')
+
+ def _tigetstr(self, cap_name):
+ # String capabilities can include "delays" of the form "$<2>".
+ # For any modern terminal, we should be able to just ignore
+ # these, so strip them out.
+ import curses
+ cap = curses.tigetstr(cap_name) or ''
+ return sub(r'\$<\d+>[/*]?', '', cap)
+
+ def render(self, template):
+ """
+ Replace each $-substitutions in the given template string with
+ the corresponding terminal control string (if it's defined) or
+ '' (if it's not).
+ """
+ return sub(r'\$\$|\${\w+}', self._render_sub, template)
+
+ def _render_sub(self, match):
+ s = match.group()
+ if s == '$$': return s
+ else: return getattr(self, s[2:-1])
+
Modified: python-commons/trunk/src/commons/structs.py
===================================================================
--- python-commons/trunk/src/commons/structs.py 2008-06-30 02:54:06 UTC (rev 856)
+++ python-commons/trunk/src/commons/structs.py 2008-06-30 02:58:41 UTC (rev 857)
@@ -40,12 +40,19 @@
def __delitem__( self, k ):
return dict.__delitem__( self, k.lower() )
-class FreeStruct( object ):
+class free_struct( object ):
"""
General-purpose namespace structure.
"""
def __init__( self, **args ):
self.__dict__.update( args )
+ def __repr__( self ):
+ fields = ( '%s = %r' % ( name, value )
+ for name, value in self.__dict__.iteritems() )
+ return "%s(%s)" % ( self.__class__.__name__, ', '.join( fields ) )
+ def __eq__( self, other ):
+ return type( self ) == type( other ) and \
+ self.__dict__ == other.__dict__
class LazyObject( object ):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-06-30 02:53:57
|
Revision: 856
http://assorted.svn.sourceforge.net/assorted/?rev=856&view=rev
Author: yangzhang
Date: 2008-06-29 19:54:06 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
added pidgin monitor
Added Paths:
-----------
pidgin-mon/
pidgin-mon/trunk/
pidgin-mon/trunk/README
pidgin-mon/trunk/publish.bash
pidgin-mon/trunk/src/
pidgin-mon/trunk/src/colorize.py
pidgin-mon/trunk/src/mon.bash
Added: pidgin-mon/trunk/README
===================================================================
--- pidgin-mon/trunk/README (rev 0)
+++ pidgin-mon/trunk/README 2008-06-30 02:54:06 UTC (rev 856)
@@ -0,0 +1,28 @@
+Overview
+========
+
+This tool monitors [Pidgin] system logs for changes in your buddies' statuses.
+Provides some simple coloring of output.
+
+[Pidgin]: http://pidgin.im/
+
+Setup
+=====
+
+Requirements:
+
+- [Python Commons](http://assorted.sf.net/python-commons/)
+
+Todo
+====
+
+Known issues:
+
+- ctrl-c/sigint does not actually manage to kill everything; you must manually
+ `pkill tail` afterward.
+
+General tasks:
+
+- Investigate whether Pidgin flushes logs in reasonable time bounds, and
+ whether there are any other such issues that could possibly be causing the
+ monitor to exhibit high latency.
Added: pidgin-mon/trunk/publish.bash
===================================================================
--- pidgin-mon/trunk/publish.bash (rev 0)
+++ pidgin-mon/trunk/publish.bash 2008-06-30 02:54:06 UTC (rev 856)
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+fullname='Pidgin Monitor'
+version=0.1
+license=gpl3
+websrcs=( README )
+rels=( src-tgz: )
+nodl=true
+. assorted.bash "$@"
Property changes on: pidgin-mon/trunk/publish.bash
___________________________________________________________________
Name: svn:executable
+ *
Added: pidgin-mon/trunk/src/colorize.py
===================================================================
--- pidgin-mon/trunk/src/colorize.py (rev 0)
+++ pidgin-mon/trunk/src/colorize.py 2008-06-30 02:54:06 UTC (rev 856)
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+from re import sub
+from sys import stdout
+from commons.misc import TerminalController
+from commons.startup import run_main
+
+def main( argv ):
+ term = TerminalController()
+ for line in stdin:
+ line = sub(r'(Online)', r'${BOLD}${GREEN}\1${NORMAL}', line)
+ line = sub(r'(Available)', r'${BOLD}${GREEN}\1${NORMAL}', line)
+ line = sub(r'(Away)', r'${BOLD}${YELLOW}\1${NORMAL}', line)
+ line = sub(r'(Offline)', r'${BOLD}${RED}\1${NORMAL}', line)
+ line = sub(r'^---- (.*) changed status', r'---- ${BOLD}${WHITE}\1${NORMAL} changed status', line)
+ print term.render(line),
+ stdout.flush()
+
+run_main()
Property changes on: pidgin-mon/trunk/src/colorize.py
___________________________________________________________________
Name: svn:executable
+ *
Added: pidgin-mon/trunk/src/mon.bash
===================================================================
--- pidgin-mon/trunk/src/mon.bash (rev 0)
+++ pidgin-mon/trunk/src/mon.bash 2008-06-30 02:54:06 UTC (rev 856)
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+set -o errexit -o nounset
+
+pgid=
+
+lastlogs() {
+ for i in ~/.purple/logs/*/*/.system
+ do ls -t $i/* | head -1
+ done
+}
+
+colorize() {
+ "$(dirname "$0")/colorize.py"
+}
+
+tailit() {
+ tail -f $( lastlogs ) |
+ egrep -v '^$|^==> |Online to Online|Available to Available|Away to Away|Offline to Offline' |
+ colorize
+}
+
+handle() {
+ kill $pgid
+ exit
+}
+
+monitor() {
+ trap handle sigint
+ while true ; do
+ if [[ "$( lastlogs )" != "${currlogs:-}" ]] ; then
+ local currlogs="$( lastlogs )"
+ if [[ ! -z $pgid ]]
+ then kill $pgid ; wait $pgid
+ fi
+ tailit &
+ local pid=$!
+ # TODO: actually get the pgid instead of pid!
+ pgid=$pid
+ echo pgid $pgid
+ fi
+ sleep 60
+ done
+}
+
+monitor
Property changes on: pidgin-mon/trunk/src/mon.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-06-30 02:24:55
|
Revision: 855
http://assorted.svn.sourceforge.net/assorted/?rev=855&view=rev
Author: yangzhang
Date: 2008-06-29 19:24:56 -0700 (Sun, 29 Jun 2008)
Log Message:
-----------
added cygwin tools
Added Paths:
-----------
cygwin-tools/
cygwin-tools/trunk/
cygwin-tools/trunk/README
cygwin-tools/trunk/publish.bash
cygwin-tools/trunk/setup/
cygwin-tools/trunk/setup/cmdhere.reg
cygwin-tools/trunk/setup/cyghere.reg
cygwin-tools/trunk/setup/cygrunner.reg
cygwin-tools/trunk/src/
cygwin-tools/trunk/src/console.cmd
cygwin-tools/trunk/src/cyg.cmd
cygwin-tools/trunk/src/cygwin-here.cmd
cygwin-tools/trunk/src/cygwin.cmd
cygwin-tools/trunk/src/runemacs.cmd
Added: cygwin-tools/trunk/README
===================================================================
--- cygwin-tools/trunk/README (rev 0)
+++ cygwin-tools/trunk/README 2008-06-30 02:24:56 UTC (rev 855)
@@ -0,0 +1,27 @@
+Overview
+========
+
+A small collection of scripts for using Cygwin. Mainly these are scripts for
+starting the terminal and shell.
+
+These scripts hard-code the `C:\cygwin` directory as the directory where Cygwin
+is installed and where the scripts themselves are placed.
+
+Setup
+=====
+
+First, copy the `src/` files to the `C:\cygwin\` directory.
+
+Install the font [Bitstream Vera Sans Mono](http://www.gnome.org/fonts/); these
+are my favorite fixed-width fonts.
+
+There are a number of registry keys to import, found in the `setup` directory.
+
+To set up the `cyg` runner so that you can start Cygwin (bash in rxvt) by going
+to Start > Run and entering `cyg`, import (open) `cygrunner.reg`.
+
+To set up the Windows Explorer context menu item for starting Cygwin (bash in
+rxvt) in the selected folder, import `cyghere.reg`.
+
+To set up the Windows Explorer context menu item for starting `cmd` in the
+selected folder, import `cmdhere.reg`.
Added: cygwin-tools/trunk/publish.bash
===================================================================
--- cygwin-tools/trunk/publish.bash (rev 0)
+++ cygwin-tools/trunk/publish.bash 2008-06-30 02:24:56 UTC (rev 855)
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+fullname='Cygwin Tools'
+version=0.1
+license=gpl3
+websrcs=( README )
+rels=( src-tgz: )
+nodl=true
+. assorted.bash "$@"
Property changes on: cygwin-tools/trunk/publish.bash
___________________________________________________________________
Name: svn:executable
+ *
Added: cygwin-tools/trunk/setup/cmdhere.reg
===================================================================
--- cygwin-tools/trunk/setup/cmdhere.reg (rev 0)
+++ cygwin-tools/trunk/setup/cmdhere.reg 2008-06-30 02:24:56 UTC (rev 855)
@@ -0,0 +1,17 @@
+\xFF\xFEW |
|
From: <yan...@us...> - 2008-06-06 01:09:41
|
Revision: 854
http://assorted.svn.sourceforge.net/assorted/?rev=854&view=rev
Author: yangzhang
Date: 2008-06-05 18:09:41 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
some more c++ tests
Modified Paths:
--------------
sandbox/trunk/src/cc/boost_lexical_cast.cc
Added Paths:
-----------
sandbox/trunk/src/cc/boost_strings.cc
sandbox/trunk/src/cc/exceptions.cc
sandbox/trunk/src/cc/polymorphism.cc
Modified: sandbox/trunk/src/cc/boost_lexical_cast.cc
===================================================================
--- sandbox/trunk/src/cc/boost_lexical_cast.cc 2008-06-06 00:27:11 UTC (rev 853)
+++ sandbox/trunk/src/cc/boost_lexical_cast.cc 2008-06-06 01:09:41 UTC (rev 854)
@@ -13,6 +13,11 @@
int i = lexical_cast<int>(si);
cout << i << endl;
+ si = "asdf";
+ try { i = lexical_cast<int>(si); }
+ catch (exception& ex) { cout << "got an exception: " << ex.what() << endl; }
+ //catch (...) { cout << "got an exception" << endl; }
+
// Doesn't work.
// string sb("true");
// bool b = lexical_cast<bool>(sb);
Added: sandbox/trunk/src/cc/boost_strings.cc
===================================================================
--- sandbox/trunk/src/cc/boost_strings.cc (rev 0)
+++ sandbox/trunk/src/cc/boost_strings.cc 2008-06-06 01:09:41 UTC (rev 854)
@@ -0,0 +1,25 @@
+// Playground for boost string algorithms.
+
+#include <iostream>
+#include <string>
+#include <boost/algorithm/string.hpp>
+
+using namespace std;
+using namespace boost;
+
+int
+main()
+{
+ // This cannot be const for some reason (even though the iteration doesn't
+ // *seem* to be mutating the string).
+ /*const*/ string p("/tmp/dir/file");
+ typedef split_iterator<string::iterator> iter;
+ for (iter it = make_split_iterator(p, last_finder("/", is_equal()));
+ it != iter();
+ ++it) {
+ cout << "p: " << p << endl;
+ string part = copy_range<std::string>(*it);
+ cout << "part: " << part << endl;
+ }
+ return 0;
+}
Added: sandbox/trunk/src/cc/exceptions.cc
===================================================================
--- sandbox/trunk/src/cc/exceptions.cc (rev 0)
+++ sandbox/trunk/src/cc/exceptions.cc 2008-06-06 01:09:41 UTC (rev 854)
@@ -0,0 +1,17 @@
+#include <iostream>
+#include <stdexcept>
+
+using namespace std;
+
+class e1 : public exception {};
+
+int
+main()
+{
+ try { throw e1(); } catch (e1 & e) { cout << "got " << e.what() << endl; }
+ // This catches fine.
+ try { throw e1(); } catch (exception & e) { cout << "got " << e.what() << endl; }
+ // This doesn't work.
+ try { throw e1(); } catch (exception * e) { cout << "got " << e->what() << endl; }
+ return 0;
+}
Added: sandbox/trunk/src/cc/polymorphism.cc
===================================================================
--- sandbox/trunk/src/cc/polymorphism.cc (rev 0)
+++ sandbox/trunk/src/cc/polymorphism.cc 2008-06-06 01:09:41 UTC (rev 854)
@@ -0,0 +1,18 @@
+#include <iostream>
+
+// Demonstrates that polymorphism can be achieved via either pointers or
+// references.
+
+using namespace std;
+
+class A { public: virtual const char * f() { return "A"; } };
+class B : public A { public: const char * f() { return "B"; } };
+
+int
+main()
+{
+ B b;
+ A * a = b; cout << a->f() << endl;
+ A & a = b; cout << a.f() << endl;
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <yan...@us...> - 2008-06-06 00:27:09
|
Revision: 853
http://assorted.svn.sourceforge.net/assorted/?rev=853&view=rev
Author: yangzhang
Date: 2008-06-05 17:27:11 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
added boost lexical cast demo
Added Paths:
-----------
sandbox/trunk/src/cc/boost_lexical_cast.cc
sandbox/trunk/src/cc/boost_tokenizer.cc
Added: sandbox/trunk/src/cc/boost_lexical_cast.cc
===================================================================
--- sandbox/trunk/src/cc/boost_lexical_cast.cc (rev 0)
+++ sandbox/trunk/src/cc/boost_lexical_cast.cc 2008-06-06 00:27:11 UTC (rev 853)
@@ -0,0 +1,31 @@
+#include <iostream>
+#include <string>
+#include <vector>
+#include <boost/lexical_cast.hpp>
+
+using namespace boost;
+using namespace std;
+
+int
+main()
+{
+ string si("12345");
+ int i = lexical_cast<int>(si);
+ cout << i << endl;
+
+ // Doesn't work.
+// string sb("true");
+// bool b = lexical_cast<bool>(sb);
+// cout << b << endl;
+
+ string sb("1");
+ bool b = lexical_cast<bool>(sb);
+ cout << b << endl;
+
+ // Doesn't work as expected.
+ stringstream ss("false");
+ ss >> b;
+ cout << b << endl;
+
+ return 0;
+}
Added: sandbox/trunk/src/cc/boost_tokenizer.cc
===================================================================
--- sandbox/trunk/src/cc/boost_tokenizer.cc (rev 0)
+++ sandbox/trunk/src/cc/boost_tokenizer.cc 2008-06-06 00:27:11 UTC (rev 853)
@@ -0,0 +1,19 @@
+// Prints:
+// This
+// is
+// a
+// test
+
+#include<iostream>
+#include<boost/tokenizer.hpp>
+#include<string>
+
+int main(){
+ using namespace std;
+ using namespace boost;
+ string s = "This is, a test";
+ tokenizer<> tok(s);
+ for(tokenizer<>::iterator beg=tok.begin(); beg!=tok.end();++beg){
+ cout << *beg << "\n";
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|