Posts

Showing posts from December, 2007

Update to clipboard-modifier

Image
Of my tools that I've written, the one I use most often is clipboard-modifier. I have it on my panel so that it's only one click away.
I had longtime desire to make this tool more flexible, before I would have to always modify the code in order to have it do something different. Now each plugin can add wxPython widgets on the dialog, thus they can control their own state and parameters.
Perhaps the most useful is the ability to send the clipbard (via stdin) to any program and then update the clipboard from the program's output. A good example is sorting the clipboard. Another is filtering it through grep, say.

The program still needs more polish, but it's already very useful, for me.

Presentation: Using Python in Lieu of Bash

I just gave a presentation at Google today. Part of my promised results this quarter was to give at least one tech talk, so on the last day, that's what I did!
Normally I would point you to the slides, but some parts were Google confidential, so I can't. Basically, my talk covered how you can use Python instead of Bash for scripting purposes and showed some concrete examples with the subprocess module.
My talk suffered from Murphy's Law for demos, and failed in some places. It was because I had file called subprocess.py which was being included instead of the standard subprocess module (oops).
Once again I used my mm2s5 to create my presentation, and it worked like a charm. I had planned to use Open Office.orgs's Presentation, but ended up running out of time and using S5 instead. What I think I need is an mm2odp program to make an .odp file from my mindmap.

CAS and Python

I've been somewhat interested in CAS (Computer Algebra System) ever since I used Mathematica for a year while doing TA work for Lorne Nelson. Now, of course, there are some open source CAS programs you can use.

Sage
Sage looks quite interesting:
Use SAGE for studying a huge range of mathematics, including algebra, calculus, elementary to very advanced number theory, cryptography, numerical computation, commutative algebra, group theory, combinatorics, graph theory, and exact linear algebra.
[...]
SAGE makes it easy for you to use most mathematics software together. SAGE includes interfaces to Magma, Maple, Mathematica, MATLAB, and MuPAD, and the free programs Axiom, GAP, GP/PARI, Macaulay2, Maxima, Octave, and Singular.
[...] With the SAGE notebook you can create embedded graphics, beautifully typeset mathematical expressions, add and delete input, and start up and interrupt multiple calculations. Sage uses Python and allows you to access other CAS systems if they are installed. I th…

Pvote, Secure Voting with Python

Ka-Ping Yee wrote is PhD dissertation (University of Waterloo, Ontario) on Pvote. A secure voting software written in 460 lines of Python Code.
Ping's blog post and part of the abstract is below.
I examine the question of how to design election-related software, with particular attention to the threat of insider attacks, and propose the goal of simplifying the software in electronic voting machines. I apply a technique called prerendering to reduce the security-critical, voting-specific software by a factor of 10 to 100 while supporting similar or better usability and accessibility, compared to today's voting machines. Smaller and simpler software generally contributes to easier verification and higher confidence.

I demonstrate and validate the prerendering approach by presenting Pvote, a vote-entry program that allows a high degree of freedom in the design of the user interface and supports synchronized audio and video, touchscreen input, and input devices for people with disab…

Fun with PyEphem

I just tried finding out when and if the International Space Station would pass overhead. First I installed pyephem for linux:
$ sudo easy_install pyephemThen started python and typed the following:Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
>>> home=ephem.Observer()
>>> home.long = -43.9
>>> home.lat = 19.9
>>> home.elevation = 1000
>>> home.date = "2007/12/09 20:00"Getting the information about the ISS was a bit harder. Had to go to this page at celestrak and get the first three lines then enter it in ephem.
>>> iss = ephem.readtle("ISS (ZARYA)",
... "1 25544U 98067A 07343.37458451 .00020246 00000-0 12456-3 0 4837",
... "2 25544 51.6404 280.6485 0000524 313.0633 141.2500 15.7720376451…

My First Google Feature

I launched my first real user facing feature at 100% today (took a week to get to 100%).
Here's the link to the feature on the Orkut Blog (and in Portuguese).
Basically, we can show the user that they received new scraps in orkut right away as an animated pop up, similar to how you might get chat messages in gmail.