o Matlab Interop
Fairly easy yet useful. Fully loading a matlab on windows is a pain in terms of speed.The following code achieves a dos-prompt access to matlab calculator
You can copy & paste freely, or dl from here ( matlabtest.py | myxls.cs ).
# Well, I guess you can see the difference: which is more verbose?
o Numerical Methods
- Doolittle Decomposition ( Doolittle.py )# Note: the problem of dividing by zero, should use LUP sometimes.
o Dynamic Programming
- Grimm ( grimm.cpp )In the work of cross-species comparison with JEB, I found it necessary to identify segments that are collinear. This program receives input of x, y coordinates and spits out segments with scores above certain thresholds. Note that many paramenters can be furthur adjusted.
- Nussinov( nussinov.cpp )
Implement the famous nussinov algorithm, as given a RNA sequence, it spits out a notation sequence to show the maximum number of Watson-Crick pairs.
o Fancy Codes
- Matrix effect ( matrix.pl )To actually see the effect, set the background to black and foreground to green, run the script and adjust the parameters, fun playing !
- Cut-string problem
( string_loop.cpp | string_loop.py )
Consider a loop of string of unit length. Suppose we cut the string independently and at random in n places. This will divide the loop into n pieces.
1. What is the expected (average) size of the smallest piece?
2. What is the expected (average) size of the largest piece?
o Python Stuff
- File Parser (new_parser.py) Scanner, Consumer, Iterator
- XML Parser (tinydom.py)
For large-sized XML file, we first break it into file like objects which contain the node that we want, and then use SAX or DOM parser to parse, one small unit at a time.


