As promised, here’s my material from the first week of “D520: Programming” (in IronPython). I gave the students a set of revision exercises [PDF] (and example answers [zip]), a course outline [PDF], and some brief notes [PDF]. The notes have four sections (this pattern will continue): which chapters of the textbook are covered this week (and a couple of sentences that summarise them or point out which parts are important to us), the tools that are required this week (since this is the first week, this section is large, covering installation of Adobe Reader, IronPython itself (including putting it on the PATH), and several IDEs (as previously covered), including configuration), key points, and example code (the examples that I plan to use in class). For anyone interested (chiefly: me in about nine months time, when I’m planning the 2010 course), here’s a summary of the first week. It’s rather long (2100+ words) – the summaries of future weeks should be shorter. Continue reading “D520 Week One”
Category: Work
IronPython Course Notes – The Plan
Since I decided to use IronPython as the programming language for teaching D520 at Northtec, I’ve planned on putting my course material online so that anyone else planning on using IronPython in teaching can make whatever use of it they can. There won’t be a huge amount of material, especially in this first year, and especially since I managed to find an excellent textbook to use, but there will be some exercises, assignments, an exam, and so forth. Each year I teach a course I add new material, and while some material is replaced or removed, usually the old material stays, so the amount of material gradually increases.
What I haven’t been able to decide is how to put this material online (the students have access to it via a Moodle installation, but I don’t want to make that publicly available). I toyed with the idea of putting it up in wiki format (but that seemed like a reasonable amount of work and I doubt there will be contributions from other people), with using iWeb to create a small dedicated site (mostly to play around with iWeb, which I have never really used, but that seemed like a lot of unnecessary work), or with putting it on Google Docs and sharing it that way (but I write the material in Pages and publish as PDF, so that doesn’t suit well, since I’d have to convert to Word then to Google Docs).
What I’ve finally decided is that I’ll just put it up here. It’s already setup, I’m a bit busy to put much else up at the moment so it won’t be crowded, and it’s very simple for me to do. I’ve further decided that it would be best to publish it bit-by-bit (since no-one else needs it at the moment anyway – if I’m wrong about that, please contact me). Each week, after the class has finished, I’ll post all the material I used that week, and some commentary about how well it went. I think this commentary will provide added value (including for me, when I’m revising the material next year), and it means that it’s easier for me to update the material as I go (although I’ve prepared the whole course, I expect that there will be changes since it’s so different than last year’s course).
I expect that as I continue to use IronPython in a teaching context, I might have additional comments that I feel like posting, so those will be nicely interspersed with the teaching material.
I’ll put everything in the “Teaching” and “Python” categories, so it’ll be easy to ignore everything else here if anyone is interested in using this material. I’m making it available under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 New Zealand License (I include using it in a similar course as non-commercial).
IronPython editor postscript
I earlier tried various editors I was considering using to teach IronPython. One of the glaring omissions was Eclipse/PyDev, which has built-in support and is a very well-known IDE (particularly in the Java community). The main reason that I skipped Eclipse was that when I was searching for an IDE to use professionally about five years ago I tried Eclipse (for Python, C, and C++ development) and I really hated it – the IDE was very slow (especially to launch), it was very Java-centric, and just didn’t suit me at all. I’d briefly tried Eclipse before that as well, with similar results.
Over the last few days, I decided that I was probably being unfair, and since this was a choice for my students rather than for me personally, I really ought to try Eclipse (with the PyDev extensions). I also noticed recently a post about using IronPython with NetBeans – I’d heard of NetBeans before, but only in a Java development context, and since I stay as far away from Java development as I can, I had no experience with NetBeans at all.
Eclipse/PyDev
I was right to re-examine Eclipse. The things that I remember bothering me so much five years ago (speed, the interface) seem to have been completely addressed, and it looks like a quite usable product. When adding PyDev (which was quite simple), there’s support for IronPython that appears completely built-in (although it’s still obvious that Java is the #1 choice). It seemed like a quite reasonable contender, unlike I tried to actually configure it to use the IronPython interpreter (which has to be done manually). I was using a completely standard, fresh, installation of IronPython 2.0.1 (from the .msi) installed in the default location (here ‘C:\Programs\Iron Python 2.0.1’) with ‘Eclipse Classic 3.5’ and version 6u14 of the Java Runtime.
I believe that, in theory, you can click the automatic configuration button, or manually locate the IronPython interpreter, and it’ll just work. Unfortunately, for me nothing seemed to work. The error message indicated that having spaces on the Eclipse path could be a problem (which seems pretty shocking in 2009), so I tried moving Eclipse to C:\, which didn’t help. I tried moving IronPython to C:\ (and renaming the folder to have no spaces), and that didn’t help. I imagine that someone more familiar with Eclipse, or with PyDev with CPython/Jython, might have been able to solve this easily. However, if I can’t figure it out in 10 minutes, then I am not at all comfortable with telling my first-year students to use it (even though we walk through the installation together, some of them will need to do that by themselves as well).
NetBeans
It wasn’t entirely clear which version of NetBeans to use, but I presumed that the most appropriate was NetBeans 6.7 “Python EA2”. Although the post I saw indicated that you needed to rename ipy.exe and ipyw.exe, I found that just selecting ipy.exe worked fine. I quite liked this IDE, and it appeared (although I didn’t use it for long) that using IronPython worked fine. There’s no graphical form designer, so NetBeans is in the same category as Komodo Edit (which I discussed previously). In many ways, it’s probably a better choice than Komodo Edit (in that the IronPython integration is simpler to do, although it does require that Java is installed), although I don’t know if there is any way to provide .NET auto-complete. It’s a fairly full-featured IDE, like Komodo and unlike DIE, which would normally be a positive, but in this specific case (first-year programming students) is actually a negative, since they need to ignore all the ‘team’ functionality, and you have to work within projects (which is true of Visual Studio as well). This is an “early access” version – since I’m not familiar with NetBeans I don’t know how unreliable that makes it – it makes me a little nervous about suggesting it to students, but I certainly didn’t have any trouble with it myself.
Conclusion
If you’re able to get Eclipse/PyDev installed, then I suspect it might slightly beat out my previous recommendations of Komodo Edit and DIE; since I didn’t get it working, I can’t recommend it to the students. NetBeans, however, will get added to the list of suggested tools (alongside Komodo Edit and DIE). If I wasn’t so familiar with Komodo Edit, I’d probably use NetBeans as the editor I use to demonstrate, but it didn’t wow me so much that it overcomes the familiarity.
Yet More Honeypot Goodness
My second success for a donated MX entry was back in early July (the first was February 1st). That was about a year for the first one, and then five months for the second. Yesterday, I had a third. While this seems like a big speed-up, this was for a different domain, so is really the first success and not the third. Even still, that’s about a month and a half for the first success for this donated MX, compared to a year for the original donation.
Again, please consider helping out if you can.
SpamBayes 1.1a3 is out!
py2exe & Grisoft’s AVG
As of today, Grisoft’s AVG anti-virus software is reporting any Windows (non-console) application built using py2exe (maybe just with Python 2.4?) as a virus.
If AVG is suddenly reporting an application you have used for a long time as a virus, don’t believe it. Unfortunately, unless you disabled AVG, it will probably have already deleted (moved to the ‘vault’) the application.
I (along with many others) have reported this to AVG, but please do so as well. They need to learn to be more careful when detecting real viruses.
eWido’s anti-virus/anti-spyware software had the same problem a couple of weeks ago (by the 24th of July they had corrected the error). I had hoped for better from AVG.
(This is all the fault of the Backdoor.Rajump Trojan).
technorati tags:python, AVG, grisoft, eWido, virus, py2exe, false positive, Backdoor.rajump
Corrections to JGC’s Spam and Anti-Spam Newsletter #37.
In John Graham-Cumming‘s Spam and Anti-Spam Newsletter #37, John printed comments from Gordon Cormark regarding the TREC 2005 Spam Track submissions:
Several submitted by participants have their heritage in a filter product, but are experimental in the sense I mentioned above, and not available for download or purchase: […] tamSPAM (spambayes as configured by Tony Meyer)
However, this is not correct. I emailed John the comments below, but it seems he didn’t feel they were worthy of including in later issues. This doesn’t bother me (it’s a minor enough thing), they got lost in his mail. They’ll be in a later issue, but for the record, I’ll reproduce them here. Continue reading “Corrections to JGC’s Spam and Anti-Spam Newsletter #37.”
Another Honeypot Success
Back on February 1st, I received notification that a MX entry that I donated to Project Honeypot helped identify a previously unknown email harvester. Last Thursday, I received notification of another success.
This is an interesting (although statistically irrelevant) speedup (about a year for the first, and about five months for the second). I’ve donated MX entries from two other domains (tangomu.com and badtomatoes.org) since then, so it’ll be interesting to see what the rate is for those (which certainly get hardly any spam compared to the original donation).
If you have the ability to, it would be great if you donated, too.
Distributed manual verification of a corpus
John Graham-Cumming (of popfile, among other things), has setup a site for manual verification of the 2005 TREC Spam Track corpus. The idea is that as many people as possible go to the site and manually classify the messages that are presented as ham or spam.
The TREC corpus was primarily classified automatically, so it's possible that there are errors in the corpus. It's an interesting experiment, and I look forward to reading papers about the results (and possibly using a more correct corpus). It's a shame that the TREC corpus is the best one available, since the mail is pretty old, and it's a weird collection of (Enron, I believe) mail from different people. It will be particularly interesting to see if there are messages that many people disagree on – some messages are particularly hard to classify, since you don't know what the interests/subscriptions of the original recipient were.
The site itself is particularly well done, IMO. Not only do you get the raw email, but you are presented with a screenshot showing you what the message looks like in a typcial mail client. This is a great idea.
I encourage everyone to go to the site and classify at least a few emails. It doesn't take much time, and it's a great contribution.
Honeypot Success
Nearly exactly a year after I donated an MX entry to Project Honeypot, it was used to catch a previously unknown harvester (Project Honeypot sends an email out to let you know that this has happened). The MX is public, so it could have been harvested from my site (not this one, or the Massey one, or the ihug one) or from anyone else’s that participates in Project Honeypot.
It’s interesting that it took a year (and two days) for this to happen. Does that mean that Project Honeypot has a really large number of MX’s compared to the number of new harvesters arriving? I like that theory more than the one that suggests that there are so few harvesters caught that it takes this long. Of course, it could just have been a fluke, and maybe other people’s MXs are successful more quickly.
The number of harvesters for the site seems pretty low, especially considering the amount of spam that must (because the addresses aren’t anywhere else) come from harvesting it. Perhaps I should adjust where the honeypot links are, to try and make them more appealing.
If you’re not already part of Project Honeypot, and you have a website (on which you can use custom cgi scripts), I strongly encourage you to join. You don’t have to donate an MX entry if you don’t have the ability to do that.