I’ve just made another enhancement to Pythonica. It now supports lists and slices a la Mathematica.
This change was inspired by a conversation with Arteum Bochevarov, who is also working on expanding Pythonica. Hopefully we can merge our versions together.
No Comments »
Joe Strout posted recent on the RB Network Users Group list about a cool project he did a while ago called Pythonica (in the context of symbolic evaluation). While Pythonica is a bit out of date (the page last updated in ’97), it’s still pretty nifty.
Pythonica is a symbolic evaluation program written in Python. It’s loosely based off of Mathematica and is a really good start. It’s missing a lot and it’s weak in other areas, but it’s still fun to play around with and can be extended.
Anyway, over the last couple of days I’ve been updating it a bit (replacing uses of the regex module with re, removing some deprecated uses of the string module, etc) and improving it. I’ve implemented some new functions (Sin/Cos/Tan/ASin/ACos/ATan/Rad2Deg/Deg2Rad), added a couple of default symbols (pi and e), and fixed some bugs (for example, Sin[pi/4] used to produce Sin[pi,4] instead of Sin[Divide[pi,4]]). At some point I’m probably going to start re-writing some of the internals to support some things Joe suggests on his page.
Anyway, Pythonica is pretty cool and a decent example of Python code. If you like Python, you should check it out.
No Comments »
It’s been a while since I’ve posted anything, I know. I really should start posting again. I just don’t have much to talk about. Here’s an update on my current status:
Colloquy
Colloquy is a Mac OS X IRC client. It’s not as powerful as some others,
notably X-Chat Aqua, but it’s the only one that’s actually well-designed
from a UI standpoint (it looks like an Aqua IRC client should look).
Colloquy is also really nice from a code standpoint. For instance, the way
it does Styles. It has several different styles, and they all look fairly different.
The way it’s done is everything is rendered in a WebView using Safari’s
WebKit. It translates the IRC traffic into an XML log and uses XSLT to
translate the log into an XHTML document and renders that in the WebView.
For new messages it uses JavaScript to append the message to the end of
the document. This makes it really flexible and really powerful. Here’s a
screenshot of my favorite style, called Meinzer:
(more…)
No Comments »
Yesterday I finally got modpython working with the help of the friendly folks on the modpython mailing list. And then I started fooling around with a script I’m calling index.py. Eventually I’ll turn this into a template system for my new website (once I finally get off my butt and design myself one). But for now, I was just playing around, learning how to do stuff with this. So, to learn, I made myself a routine that duplicates the built-in FancyIndexing feature (you know, where you type in a directory that doesn’t have an index file and it displays a list of all the files, with icons and information). It duplicates everything except the Description column and sortable headers. Other than that, it looks identical to the real thing, even down to the spacing of elements and the icons (hell, I went to the trouble of parsing the server config for the AddIcon and AddIconByType and DefaultIcon directives just to get the icons right!). Later I’ll add the Description column and, hopefully, sortable headers. Then it will look exactly the same. The only way to tell the difference will be to look at the source, where you’ll see a much nicer-looking source than the built-in indexing feature.
The other facet of my script is anything accessed from inside that directory is funnelled through the script, i.e. the script is given the filename and it opens it and gets the content-type and outputs the contents of the file. The point of this, of course, is for the templating system, but for now it’s just for fun.
If you want to try it, just go here.
Please note that this address is only valid if my computer is plugged in at college. I’m going home Thursday, and at that point I’ll attempt to get a new URL for my computer
The URL is no longer valid
No Comments »