Entries in "Case"

Talk: Geocoding at Case

Tomorrow (November 28th at 6 PM) is ACM's Nerd Cultural Dinner at Case. The dinner is located in Thwing Ballroom and you should probably reserve a ticket by e-mailing acm-officers@case.edu.

After dinner is served, there will be several presentations. The first (at 6:30 PM) is by yours truly and is about Geocoding at Case. They gave me 15 minutes to talk, and I'll be following this approximate outline:

Geocoding at Case

  • What is geocoding?
  • Why is it useful?
  • Using the Case geocoder web service
  • A simple example
  • Development details
    • Location finding: Case Wiki, Google Maps, ...
    • Location parsing: Matching buildings, areas, addresses, ...
  • How you can contribute to its development and improvement

Hope to see you there!

Simple CAS 1.0 Authentication for Django

Back when I expressed interest in making the web presentation bounty based solely on client-side code, Simon (bounty master and Filer admin) expressed his wish to keep the two services decoupled (so I shouldn't rely on Filer for slideshow storage). While I still want to have a save-to-Filer feature, I decided that I should just go ahead and get the web presentation system up and running before worrying about a client-side-only version. So I started a Django project.

Anyway, the result is that I got CAS 1.0 working alongside the Django authentication system, which means I can take advantage of built-in features like permissions and messages with CAS-authenticated users.

If anyone else is interested in using CAS authentication with Django, you can download the code I'm using. Here's a brief usage guide:

  • Set SERVICE_URL in cas/__init__.py to the location of your CAS service. For example, Case's is https://login.case.edu/cas/.
  • Set DEFAULT_REDIRECT_URL in cas/__init__.py. Normally the user will be sent back to their HTTP_REFERER (the page that requested login) after authentication. But if the user requests /accounts/login/ directly (or there is no HTTP_REFERER), they will be sent to DEFAULT_REDIRECT_URL.
  • Enable the login and logout views by adding these to your URLconf (customize the URLs if you want):
    (r'^accounts/login/$', 'your_site.cas.views.login'),
    (r'^accounts/logout/$', 'your_site.cas.views.logout'),
    
  • Add the backend in settings.py:
    AUTHENTICATION_BACKENDS = (
        'your_site.cas.backends.CASBackend',
    )
    
  • Make sure at least the following apps are installed:
    INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.sessions',
        'your_site.cas',
    )
    
  • Finally, if you have a way to populate the user's name and e-mail address fields from their username, put it in cas/backends.py (see the comments). For example, I have LDAP code there.

P.S.: This just implements the minimum required for CAS authentication. Features like gateway, renew, and proxies are not supported.

An alpha version of the presentation system should be online to play with later this week.

Workshop: Making Databases Fun with Python

Reminder! This is today!

Did you ever notice how writing SQL is not very fun?

This Monday (November 20th) on behalf of Case Project Club, I will be hosting a workshop for those interested in Python and databases. The talk will be at 7:01 PM (sharp) until 8:30 PM in the Olin 303 classroom/computer lab. I'll have Python all set up for everyone to play with and follow along. Pizza and drinks will be provided!

Python is a powerful dynamic programming language suitable for many tasks, including data analysis for research, web programming, and just plain fun. Even if you don't know Python, there won't be any crazy wizardry going on during the worskhop, so you should be able to pick up the basics very quickly.

Some contents of the talk will include:

  • Simple data/object persistence, for when SQL is overkill.

  • The dbapi, a standardized interface for talking to databases with Python.

  • An overview of object-relational mappers that will let you harness the power of relational databases without writing a single line of SQL (and easily swap out SQL backends).

  • Construction of a database application during the workshop everyone can play with, made with Django's object-relational mapper (or perhaps SQLAlchemy).

Again, no prior knowledge of Python or any of the related libraries is required.

Hope to see you there!

databases_72.png

Workshop: Making Databases Fun with Python

Reminder! This is today!

Did you ever notice how writing SQL is not very fun?

This Monday (November 20th) on behalf of Case Project Club, I will be hosting a workshop for those interested in Python and databases. The talk will be at 7:01 PM (sharp) until 8:30 PM in the Olin 303 classroom/computer lab. I'll have Python all set up for everyone to play with and follow along. Pizza and drinks will be provided!

Python is a powerful dynamic programming language suitable for many tasks, including data analysis for research, web programming, and just plain fun. Even if you don't know Python, there won't be any crazy wizardry going on during the worskhop, so you should be able to pick up the basics very quickly.

Some contents of the talk will include:

  • Simple data/object persistence, for when SQL is overkill.

  • The dbapi, a standardized interface for talking to databases with Python.

  • An overview of object-relational mappers that will let you harness the power of relational databases without writing a single line of SQL (and easily swap out SQL backends).

  • Construction of a database application during the workshop everyone can play with, made with Django's object-relational mapper (or perhaps SQLAlchemy).

Again, no prior knowledge of Python or any of the related libraries is required.

Hope to see you there!

databases_72.png

Ask.com Maps Has the Finished Village

Looks like Ask.com Maps has the most up to date aerial view of campus, better than Google Maps, Yahoo! Maps, and Virtual Earth. Google Maps comes in second place where it's at least under construction.

Now, I wonder if they have a geocoder I could add to geopy?

Case Public Computing Thoughts

On a typical day at Case I use anywhere from 3 to 7 different computers, often on 2 or 3 different platforms (Windows, Linux, Mac). I only own two computers, so this means I spend a lot of time using the "public" computing facilities around campus.

There are three facilities that do nearly everything I want and offer an enjoyable experience. I'll save those for last. First I'd like to offer some criticism about everything else. I admit that I'm more demanding than most users, but why is that an excuse to make your facilities crappy?

iBooks in Kelvin Smith Library: Anyone can check out an iBook from the amazing Freedman Center in our library. Ah, wonderful! An operating system where I can easily SSH into my own computer and install things to my home directory without making a huge mess.

Sadly, not so. Even though OS X clearly has a satisfactory permissions model, these are totally locked down. You can't even run Terminal. Sorry, but if I can't do this on a computer, I consider it useless. Part of the problem is that there is a single universal login for everyone. Having real user profiles would be a hassle since they only connect via wireless and downloading a user's Home folder would slow things down quite a bit. Maybe there could be a link on the desktop to the user's Filer account, encouraging them to save there, and the Home folders could be wiped at the end of the session?

Desktops in Kelvin Smith Library: You have five options: Internet Explorer, Excel, PowerPoint, Publisher, and Word. No, not even Notepad or Calculator are available.

E-mail Machines in Thwing, Village at 115, Wade, Fribley: These Windows machines are only good at one thing: checking e-mail. Some of them won't even let you check the time, because the system tray clock is disabled for no apparent reason. They are totally locked down. There's no Firefox, so web surfing for more than a few minutes sucks. There's no PuTTY. Why do these have to suck so much? Here's how to fix them: install Firefox, install PuTTY, install TightVNC, let people run Remote Desktop if they can't already, and make the clock huge instead of nonexistant.

Virtual Worlds Lab: Not much to complain about here, these machines are pretty sweet despite the fact that they are running Windows. They have big storage drives separate from the Windows drive where you can install and run programs, but sadly these are machine-specific and not network drives. These machines would be absolutely sweet for graphic design, but every time I try this I remember that you can't install fonts due to the lame permissions, so you're stuck with the defaults. Also—correct me if I'm wrong—these are supposed to be gaming machines, yes? Are there even any games on there yet? It's been a year. And last I checked, using flash drives did not work in here.

Technology Enhanced Classrooms: These suffer from some of the same problems as the public computers in Thwing. No Firefox. No PuTTY, although thankfully you can run executables that don't install anything, so downloading PuTTY (and VNC, and VLC) is no problem. There is a universal login, so leftover crap from random people clutters the Desktop and My Documents folders. Also, could someone please explain to me how the ability to right-click is a security flaw? Seriously, it's like someone is playing a cruel joke by disabling random features—or is Windows really that busted?

Jennings Windows Lab: Why would anyone use these when there are machines that don't take five minutes to log on right across the room? Sometimes you get lucky and it doesn't take forever to migrate your profile for some reason. I think reading from flash drives works, but not writing.

Finally, here are the computing facilities I actually find enjoyable.

Jennings Unix Lab: Holy crap, these thin clients running Ubuntu are a dream come true. There are hundreds of awesome desktop apps on here. Your choice of KDE, GNOME, or something more exotic. You can install stuff to your home directory, and drop stuff in your ~/web directory to put it online. I think I have a better success rate printing from here than on the Windows machines. And Simon is looking to make these even better with one of those handy EECS bounties (which I took him up on).

Smith Computer Lab (aka Nord Lab): Wow, non-crippled Macs and power-user-friendly Windows machines. On the Macs, dragging applications to your Home folder installs them there, and you can run Terminal. Heck, I even installed SQLite, Ruby, Rails, and DarwinPorts on there and ran a server. I think there's a link to your Filer drive on the desktop.

The Windows machines are done right, too, with PuTTY, TightVNC, and even an X11 server for Windows (the name escapes me, it's not Cygwin).

Astronomy Computer Lab: Located on the fifth floor of Sears next to the Astronomy Library are some Windows and Linux machines. The Linux machines are running RedHat and are totally sweet! They offer a very similar experience to the Jennings thin clients, except the audio output works and there's no annoying redraw that comes with using a thin client. The only problem is there is no automated account registration, you have to personally request an account (and probably have a purpose for it).

Speaking of public computing, the only computers around the (totally awesome) new EECS student lounge are the Windows machines in the circuits lab. There is so much desk space in this new lounge I was considering covertly setting up a Linux machine anyone could log onto with their Case ID; I wonder if anyone would notice?

A Web-Based Presentation System for Case

If you saw the new EECS department bounty system, you may have noticed the bounty for a web-based presentation system. This is now a work-in-progress by yours truly.

The goal is to let Case people generate slideshows through the web with Case-themed templates, mostly for use on the plasma displays in the EECS department (well, the displays that will be in Glennan). Another use could be by faculty in place of PowerPoint (so it should have familiar features such as transitions).

You may have seen those displays in the fishbowl last year showing pictures and such. Apparently these are a pain to administer because they are connected by a wireless connection and thus are not easy to connect to via Remote Desktop. So when they are rebooted or PowerPoint closes somehow, getting the slideshow back up and running can be a real hassle. Having them in kiosk mode in a web browser will allow them to easily refresh if anything goes wrong, and will also let them grab updated content. This is how the plasma displays around campus show their (I think Flash-based) slideshows.

There are two such tools on which to base such a system: S5 and Slidy. If you've ever viewed a text-based presentation online, it was probably with S5. This is the first time I have heard of Slidy, but it actually looks a lot better to me. Every time I've encountered S5 in the wild, the JavaScript has eventually completely messed up the text sizing and positioning, making everything unreadable.

There are existing services that combine web presentation systems with editing and sharing, such as S5 Presents and SoapBX. SoapBX is not open source while S5 Presents is GPL licensed and in Ruby. I would have no problem with using S5 Presents, but apparently it has gone unmaintained for almost two years, and Simon was disappointed when he looked into configuring it to run under a real web server.

Tonight I decided to see what actually using S5 is like, so I customized the default theme to resemble the Case PowerPoint template found on the Case branding page. So here is my Case-themed S5 presentation. It's pretty incomplete and doesn't match exactly, but it's close (and anyway, the goal is to make it look good, not match exactly—their PowerPoint template could use some work).

When I first considered this bounty, I thought "hmm, web-based, which web framework will I use?" One of the major goals is to be easily maintainable once I leave, so something popular or at least very easy would be the best choice. Which best fits this description? Django? TurboGears? web.py? I've never really considered the maintainability of any of these, since usually I can choose whichever I like at the moment.

After a bit of talking with Chris, we determined that any server-side code at all isn't even really needed. The only thing it would be used for is to display view and edit pages for the presentations and to store them. The first two can be done with static HTML and JavaScript, while the third can be used by POSTing with AJAX to some location. For example, we could POST presentations to the EECS department's new DokuWiki-powered site with the appropriate permissions. Since S5 and Slidy presentations are just HTML, the wiki page itself would be the presentation outline, and the slideshow viewer could just grab the markup from there. Or we could use AJAX to upload the presentation via WebDAV to the author's Filer account.

Since there would be heavy JavaScript usage regardless of the selected framework, the author would need to be fluent in it anyway. So why not a pure JavaScript solution, given the possibilities above? This is what I'll be looking into for the next few weeks. The code will soon live at opensource.case.edu/projects/present.

If anyone has experience with S5 or Slidy and would like to share their opinions, please do (even if it's just which system you like more).

Miscellaneous School, Blog, Python Stuff

Today was perhaps the most easygoing day ever. My first class was cancelled, my second class ended 20 minutes early, and my last class only lasted for 20 minutes. Ah, education!

After getting some free food from the ACM / Women in EECS event, I finished my day by admiring this totally legit use of the Expression Wall (clink clink!):

regexp.jpg

Finally, an expression I can relate to!

A while ago I decided to try out some fancy log analyzers like Performancing Metrics and Google Analytics. Google Analytics seems to be better for checking out data about your users, while Performancing Metrics seems to be better for checking referrers and (surprisingly) search terms (well, Google's might be better, but Performancing Metrics is way easier to navigate).

One interesting thing these sites (and Blog@Case Stats) tell me is that start.case.edu is consistently my top external referrer. So it seems to send a lot of traffic my way. Go start!

Chris and I are working on the next version of dmath, mostly for speed and to deal with custom contexts. For example, the result of atan2(0, 0) should be indefinite, but in the math module it's 0 (presumably so that the function is continuous). But if someone wants it to be indefinite (by which I mean D('NaN')), they should be able to set that in their context. Oh yeah, one big improvement is that pow will allow Decimals to be raised to Decimal powers.

We're still trying to wrap our heads around some of the context stuff. For example, should all of our functions accept an optional context argument, like the sqrt, pow, and other methods in Decimal? If so, does every Decimal constructed within that function need to also be passed the context, even D(1)? This is stuff that will probably be obvious after some more browsing of decimal.py. We're also looking into doing things in pyrex once everything is known to be in working order. Need for speed, baby!

Did I ever mention that geopy trunk now has support for GeoNames, and may soon support Map24? Map24 has done a pretty good job of convoluting their JavaScript so that their free geocoder is only accessible via AJAX, but this is merely a speedbump and not a road block. It almost works (but not the version in trunk). Sadly, like Yahoo!'s, their Terms of Use state that their geocoding tools can only be used in combination with their Maps AJAX API. But hey, just because you can access their stuff from Python doesn't mean the developer isn't still using it legitimately (that is to say, to show locations on a Map24 map).

That's all I got!

Project Club Barbecue, Friday 9/15

Tomorrow Case Project Club will be hosting another barbecue at 12:30 PM in front of Olin, which means free food for everyone! The last one was a big success. According to Jon Ward, we have "way too much food." There will be hamburgers, hot dogs, chips, pop, fruit, veggies and other snacks.

See you there!

MT-Blacklist and Spam

My blog has been getting hit hard by spammers (you probably noticed if you subscribe to Blog@Case Comments). I use the MT-Blacklist plugin to mark every one of them as spam, so I figured I was doing some good... but it keeps letting them through, even if the URL patterns are obviously similar.

So I checked the MT-Blacklist page and noticed that it says only 39 URL patterns are blacklisted. Huh? Does it just add all those as string patterns instead? If so, even that's not working; I still get spams with the URL dunetribune.info even after de-spamming all of them.

Is our spam filter working? Am I just not seeing the tidal wave of messages that are actually coming in? Why don't I ever see any spam on Mano Singham's journal (and I'm subscribed to Blog@Case Comments, so I'd see them even if he deleted them afterward)?

Geocoding Tools for Python (and CaseClasses)

I've been working on some geocoding classes in Python. Right now I've got tools made for MediaWiki, Semantic MediaWiki, and the Google geocoder. I plan to include the Yahoo! geocoder in this toolbox soon.

I think this could be a useful package, so I plan to upload it to the Cheese Shop soon.

I added the relevant geocoder classes to the Python CaseClasses so that developers can easily geocode strings using Case's Semantic MediaWiki.

Check it out. First grab the geocoder:

>>> from Case import Geocode
>>> wiki = Geocode.CaseWikiGeocoder()

Then start geocoding:

>>> place, (lat, lng) = wiki.geocode('KSL')
Fetching http://wiki.case.edu/KSL...
>>> print "%s: %.5f, %.5f" % (place, lat, lng)
Kelvin_Smith_Library: 41.50727, -81.60950

geocode returns a tuple consisting of the location name found and the coordinates (another tuple).

Here's where the Semantic part comes in. The Project Club article isn't geocoded, but it is located in Olin, which is geocoded:

>>> place, (lat, lng) = wiki.geocode('Project Club')
Fetching http://wiki.case.edu/Project_Club...
Fetching http://wiki.case.edu/index.php/Special:ExportRDF/Project_Club?xmlmime=rdf...
Fetching http://wiki.case.edu/index.php/Olin_Building...
>>> print "%s: %.5f, %.5f" % (place, lat, lng)
Olin_Building: 41.50224, -81.60778

CaseWikiGeocoder is a subclass of SemanticMediaWikiGeocoder and is defined by only the following:

class CaseWikiGeocoder(SemanticMediaWikiGeocoder):
    def __init__(self):
        super(CaseWikiGeocoder, self).__init__("http://wiki.case.edu/%s",
                                               relations=['Located in'])

This creates a SemanticMediaWikiGeocoder with a base URL of 'http://wiki.case.edu/' that follows the 'Located in' relation if a page fails to geocode. So SemanticMediaWikiGeocoder could easily be used for any Semantic MediaWiki with any set of relationships defined. This class is brand new and has only been tested on the Case Wiki, so it might be buggy.

MediaWikiGeocoder relies on BeautifulSoup since it assumes wiki pages can be malformed.

Remember, if you have easy_install, you can simply type this to install CaseClasses:

sudo easy_install http://opensource.case.edu/svn/CaseClasses/python/trunk

After this geocoding toolbox is complete, I'll see if I can make that Case geocoder web service we talked about on the forum.

Update: Per Greg's comment, support for reading coordinates from semantic attributes is now in Case.Geocode (along with some other small improvements).

CaseWikiGeocoder is now defined as:

class CaseWikiGeocoder(SemanticMediaWikiGeocoder):
    def __init__(self):
        base = super(CaseWikiGeocoder, self)
        base.__init__("http://wiki.case.edu/%s",
                      attributes=['Geographical coordinate'],
                      relations=['Located in'], prefer_semantic=True)

Geocoding Tools for Python (and CaseClasses)

I've been working on some geocoding classes in Python. Right now I've got tools made for MediaWiki, Semantic MediaWiki, and the Google geocoder. I plan to include the Yahoo! geocoder in this toolbox soon.

I think this could be a useful package, so I plan to upload it to the Cheese Shop soon.

I added the relevant geocoder classes to the Python CaseClasses so that developers can easily geocode strings using Case's Semantic MediaWiki.

Check it out. First grab the geocoder:

>>> from Case import Geocode
>>> wiki = Geocode.CaseWikiGeocoder()

Then start geocoding:

>>> place, (lat, lng) = wiki.geocode('KSL')
Fetching http://wiki.case.edu/KSL...
>>> print "%s: %.5f, %.5f" % (place, lat, lng)
Kelvin_Smith_Library: 41.50727, -81.60950

geocode returns a tuple consisting of the location name found and the coordinates (another tuple).

Here's where the Semantic part comes in. The Project Club article isn't geocoded, but it is located in Olin, which is geocoded:

>>> place, (lat, lng) = wiki.geocode('Project Club')
Fetching http://wiki.case.edu/Project_Club...
Fetching http://wiki.case.edu/index.php/Special:ExportRDF/Project_Club?xmlmime=rdf...
Fetching http://wiki.case.edu/index.php/Olin_Building...
>>> print "%s: %.5f, %.5f" % (place, lat, lng)
Olin_Building: 41.50224, -81.60778

CaseWikiGeocoder is a subclass of SemanticMediaWikiGeocoder and is defined by only the following:

class CaseWikiGeocoder(SemanticMediaWikiGeocoder):
    def __init__(self):
        super(CaseWikiGeocoder, self).__init__("http://wiki.case.edu/%s",
                                               relations=['Located in'])

This creates a SemanticMediaWikiGeocoder with a base URL of 'http://wiki.case.edu/' that follows the 'Located in' relation if a page fails to geocode. So SemanticMediaWikiGeocoder could easily be used for any Semantic MediaWiki with any set of relationships defined. This class is brand new and has only been tested on the Case Wiki, so it might be buggy.

MediaWikiGeocoder relies on BeautifulSoup since it assumes wiki pages can be malformed.

Remember, if you have easy_install, you can simply type this to install CaseClasses:

sudo easy_install http://opensource.case.edu/svn/CaseClasses/python/trunk

After this geocoding toolbox is complete, I'll see if I can make that Case geocoder web service we talked about on the forum.

Update: Per Greg's comment, support for reading coordinates from semantic attributes is now in Case.Geocode (along with some other small improvements).

CaseWikiGeocoder is now defined as:

class CaseWikiGeocoder(SemanticMediaWikiGeocoder):
    def __init__(self):
        base = super(CaseWikiGeocoder, self)
        base.__init__("http://wiki.case.edu/%s",
                      attributes=['Geographical coordinate'],
                      relations=['Located in'], prefer_semantic=True)

Saturday Mapping Thrills

Today I decided that I needed to be punished and proceeded to create and geocode 58 parking lots on the Case Wiki.

This will slightly help the campus crime mapper since some reports are given lot numbers as their location. You probably noticed that the crime mapper got a bit fancier. I made icons for a few categories of violations, and took care of multiple incidents being located in one spot. It's also running with FastCGI now so maybe it's faster?

One pattern I've already started to notice is that some places are hotspots for a certain type of violation. Check out the Crimes in 2006 page and you can tell that it's a bad idea to park your bike near Fribley, and to park your car on Carlton Road. (Also on that page, zoom way out for a surprise!)

Well, I'm all geocoded out after hunting down parking lots for the past couple hours. Suggestions for the crime mapper are welcome.

P.S. The code is now on opensource.case.edu and there's a to-do list on the wiki. Feel free to browse around or contribute!

Update: Hey all you geocoders and wiki mappers, check out this awesome resource I just found. It's a build identification glossary with location names, aliases, and addresses. This is exactly what the crime mapper needs...

Mapping Crimes on Campus

So a couple entries ago I mentioned that someone should make something like chicagocrime.org for Case. This is possible since we have a daily crime log which lists the location of each incident, and an excellent wiki with many geocoded locations.

I was bored a few nights ago and decided to try it out. In the interest of releasing early and often, I've made my first test available online at exogen.case.edu/crime/recent.

As you can see, it's nothing too fancy yet. This is my first non-trivial Django application, and I plan on using it as a testbed for Merquery.

So here's my to-do list (when I'm not working on Merquery, of course):

  • Draw new markers.
  • What should happen when two markers are placed on the same location, which is likely? Show both in the info window? Change the color of the marker? Try to put them next to each other?
  • Offer views by type of violation.
  • Activate the better location parsing (right now only the wiki data is checked, but the Google geocoding API helps with addresses). Already written, just needs to be put into production...
  • Geocode all the locations that couldn't be found.
  • Offer an RSS feed of recent crimes.
  • Import all incidents back to 2000 (for fun).
  • Use all the imported data for crime statistics per area.
  • Put code on opensource.case.edu.

Now to watch for that bicycle thief...


Update: Problem seems to be fixed, let me know if it's broken for you.

Update: Put the new location parser into production, and it now has a 66% success rate for geocoding locations. More wiki entries would help that number... anything to avoid doing them manually.

What You Need, When You Need It

So, it's midnight and I'm sitting in the basement of Olin. I'm looking up schemes to help The Segelmeister's wireless connectivity, which has been less than optimal for the past week. I settle on these plans for a coffee can wireless antenna. I spin around in my chair, ready to collect some parts. I look down at my feet. About one foot away, sitting in a box, is a completely assembled coffee cantenna, including enough spare parts for another.

Where else could this happen but in Case's very own Thunder Labs a.k.a. Project Club Lab? I've mentioned Thunder Labs and Project Club several times on this blog, but I've never really explained it to the uninitiated. The wiki page does it no justice. Project Club is where hackers, builders, and inventors can go on campus to tinker!

Located in Olin 101, we've got enough toys to keep the creative and technically minded busy during their time at Case. We have oscilloscopes, soldering irons, motors, wheels, batteries, tons of tools and materials, workstations, servers, computer parts, a projector, a laminator, secure storage lockers, engineering & programming textbooks, a silkscreener, and more. Did I mention we have pirate costumes? Top shelf, in the Dell box.

Want to run a live web cam through some awesome Linux software for your crazy art show project? (Ian?)

Want to use a terminal for the awesome Linux setup in the Jennings lab, except on a couch, with a nice stereo, and even a nice paint job?

Want to build a robot? A tesla coil? An electric bike?

We want to do all that stuff, too. So come give us a hand in Olin 101!

Now, back to Sara's wireless problem...

Python Web Programming Talk Post-Mortem

As mentioned earlier today, I gave a Python Web Programming talk this evening for the Case community. A slightly larger crowd showed up compared to the last talk—around a couple dozen people.

Like last time, I could have been more organized. I had a sufficiently complex example lined up for demonstration, but unfortunately it involved way more JavaScript than Python, so it turned out not to be such a great example. So I just came up with a new example on the spot—the classic to-do list example. It fit my requirements of having more than one SQLObject table (so I could show how to relate them), having more than one page (so I could show how controllers work), and not being a wiki.

Also like last time, there were a few things I neglected to mention that probably would have put many people's minds at ease while they were trying to keep up with what the heck I was coding.

For instance, I never mentioned that templating with Kid guarantees well-formed XML input and output, and in practice leads to much cleaner templates (based on my own experiences with Cheetah). So people who had never seen Kid or ZPT before were probably thinking "what the heck is this all about?"

Deficiencies aside, I was told that it was an entertaining talk and I didn't make too much of a fool of myself. But most importantly, I hope I made a good impression of Python.

Web Programming with Python Talk

At 5:30 this evening (Thursday, March 30th) I'll be giving a talk about Web Programming with Python. The talk is in Glennan 421, same place as the previous Python talk.

I'll give a primer on the major web application frameworks in Python, then show you how to make a web application with TurboGears, one of the frameworks. Even if you don't know Python, it is easy to pick up. If you're coming from a PHP or Ruby background, I can even answer any questions about how things are different in Python. By the end of the talk we should have a live, working web application.*

At 7:00 PM there is a Google talk with pizza and such. I'll finish with plenty of time to spare so we can all go over to the Google talk afterwards!

* If there are any web application ideas you'd like to see (that are possible in less than an hour), suggest them here. I haven't planned this app at all yet.

<capsule> eggs again sent me like 80 e-mails about some snake

Fostering Python Development at Case

I love programming in Python. Despite what your opinions of Python might be...

Alright, so instead of mirroring Greg's post, I'll just talk a little about the new Python Case classes.

Right now you can easily:


  • Authenticate someone with CAS

  • Search and retrieve LDAP attributes

  • Query the USG web service

  • Read syndicated feeds from Blog@Case, KSL, CaseWiki, Housing, Help Desk, Case News, UPB, Photos, and Forum

  • Manage files with Filer

  • Read and manage mail over IMAP

  • Various little niceties like validating Case IDs, guessing someone's Case ID from their name, and checking all the valid mail domains (having a single alias at Case is like having at least 10 e-mail addresses).

Sprinkle on some HTML and you've got a portal. In a later posting I'll go into the usage of these modules, since seeing it in action might encourage people to tinker around with it. By the way, I found all those RSS feeds (and a few more) with this Google query.

I had my first experience creating a Python Egg for easy distribution of Case Classes. Eggs are the Python equivalent of Java's Jars. It was all quite painless. You can grab the latest egg (Case-0.1dev-py2.4.egg) from Subversion.

Me and Python Case Classes

Five minutes after commenting on Greg's latest entry, I saw him and said "hey" but I don't think he knew who I was. That, or the blank stare was because he wanted to kill me for trash-talking PHP. Anyway, here's a picture of me looking stupid ("looking pretty much like myself," according to Patty) for you to click on. If you want to punch me for anything I say on here, this will make it easier. Hi, Greg!

It's me, Brian!

I'm getting tired of this blog template, so maybe when I redesign (along with Patty) I'll follow Aaron and Mano's lead and put my picture right on there.

Speaking of who I am, search engines these days are pretty sweet! Even though I've never mentioned my last name on here (comments aside), Google, MSN and Yahoo point you here if you search for me.

On to Greg's post. I was a bit pessimistic in my comment about Python Case classes. I've got nothing to lose by adding them to Greg's repository, so I might as well hand 'em over sometime. Maybe tomorrow.

Is there anything besides CAS login and LDAP attribute lookup to plug into? Greg, what other PHP classes do you keep around?

Update: Python Case classes have been committed. Browse the sources in the Trac browser. No web framework dependencies like I was whining about.

Village at 115 Feedback

I don't know who exactly I'm posting this for. To vent, perhaps?

GOOD JOB


  • Beds, kitchens (especially the dishwashers), new faceplates, and the rest of the niceties.

COULD BE BETTER


  • If there's one thing everyone I know at Case has a lot of, it's books. Yet any kind of shelves other than in the closet area, where there is a single shelf (presumably for wardrobe) are mysteriously missing. This is going to result in people attaching shelves to their wall, forbidden or not. Other people I know paid for some cheap shelves.
  • I don't understand those little "shelves" in the shower. One of them can hold a single bar of soap while the other is completely useless as far as I can tell. Still, the South Side showers had nothing.
  • One thing South Side closets had over our new "closet areas" was hooks. Hooks are useful and versatile and easy to install. Like, where do I put my towel when I get out of the shower? If I try to put it on my doorknob it opens the door or falls off.
  • Aren't these new laundry machines supposedly money-saving and eco-friendly? So why are they more expensive for us? This is stupid.

MASSIVE FAILURE


  • If the only problem with the phones were sharing a single line with more people, this would be under Could Be Better. But there is also what I can only guess is a "privacy feature," where two people can't have the phone picked up at the same time. This means that if someone calls for you and someone else picks up the phone, you either have to go to their phone or tell the person to call back so that you can pick up. Or call their number. You can't say "I got it!" and wait for the other person to hang up, you'll just get a busy signal. This sucks.
  • Almost everyone I know (including myself) has locked themselves out already. Also, since the card readers are battery-operated, we need to carry an extra card around that opens our apartment doors. (If they were wired into the rest of the system, we could be identified like normal.)
  • So far only one apartment I've heard of has actually received the trash cans listed on the apartment inventory. If this were the only trash problem, it would be under Could Be Better. But where the hell are we supposed to put the bigger stuff, such as all the cardboard boxes and bags we used to move in? We've had a huge pile of crap in our apartment for the past week because we have to walk through two other buildings just to get to a trash chute.

2005-2006 Housing Costs, Exposed!

There has been some heated discussion over at home dot cwru about housing options for next year. What many people fail to realize is that it may very well be cheaper for them to live on campus. The bottom line: it depends first and foremost on your financial aid package, and secondly on how many people you plan to live with. If you receive grant-in-aid from Case, and most people do, disregard the generalizations being made over at home dot cwru and read on—it may save you some money.

The idea that living on campus could actually be cheaper seems like a strange one, especially considering the cost of the new North Residential Village apartments. It revolves around the fact that when you move off campus, you lose $5,030 in grant money, provided of course that you actually receive that much grant-in-aid from Case. That's FREE MONEY, it doesn't need to be paid back, and most people I know here receive it.

The cost of a North Residential Village 4-5 bedroom apartment is $6,990 for the upcoming school year (approximately 9 months), plus $400 for the technology fee ($200/semester). If you lose the $5,030 grant (you lose all of it regardless of your meal plan choice), that leaves you with $2,360 ($6,990 + $400 - $5,030) to work with for the school year if you'd like to match the on-campus solution. With a 9-month school year, that means you'd need to find something cheaper than $262 per month (per person). That includes utilities, internet, and any other services you want that are included in the on-campus housing cost. Good luck!

This obviously doesn't justify the high cost of on-campus housing, but since this grant-money constraint isn't exactly something we can work around, it pays to look at your situation before taking those numbers into account. You're much more likely to save money by getting off the meal plan. Even the cheapest meal plan offered next year is $2,200 per year for 7 meals per week. You could quite comfortably survive on 21 meals per week for not much more than that.

Depending on how many people you plan to share an apartment or house with, you may find a situation where it's cheaper to split the cost than to live on campus. It's actually not too hard to find rooms for rent in the $200–$250/month price range; such ads are posted on the home dot cwru classifieds and craigslist all the time. And if you don't receive that grant money from Case, it is obviously cheaper to live off campus regardless.

Also take into consideration which option you would choose if both housing solutions were the same price. To those who would say off-campus: have you seen the new apartments?! Combine their features with included utilities, the network connection, cleaning, and the Village itself and I'd gladly take the North Residential Village over off-campus housing any day.

If you want numbers you can fiddle with, I recommend taking a look at this Excel spreadsheet created by my friend and suitemate, Franz. It allows you to adjust any variable I've mentioned above to find out which housing solution will be cheapest for you. Please note that housing and meal plan are independent, but appear related in the spreadsheet. You can easily change the on-campus meal plan value to match your actual food costs (the default value is not a sufficient meal plan)—more likely, you should enter the same value as 'off-campus food' if you plan to opt out.

Your decisions are clearly none of my business, but hopefully you'll find this helpful and read the fine print!

EDIT: Access logs tell me that this post is making the rounds in the Housing department. If I'm wrong or there's something I'm missing (for example, if the grant-in-aid is likely to be automatically replaced by another form of aid), please post a comment!

Weblog Persistence

Regarding Jeremy's extended FAQ post, there's one important assumption made about the issue that isn't explicitly stated: people ask the question "what happens to my blog when I leave?" all wanting to hear the same response. Nobody wants to be told that their blog will be wiped. It's the same thing with university e-mail addresses—even though there are dozens of free services that offer better features, it's the principal of keeping what you already have and maintaining that important connection with the Case community. Speaking as a user, ITS should not be asking "are we going to allow blogs to persist?" They should be asking "what needs to be done to allow blogs to persist?" It seems to me that resources like alumni donations and other support for the university would be more easily encouraged by allowing continued use of these established services.

Statistically, I think ITS can justify the persistence of blogs on this service. The total student population is about 9,200 students (note that faculty—2,000 more people—can also make use of this service). Now, ITS probably doesn't expect all 9,200 students to sign up and be active—but since they're all eligible, the resources should exist to do so. Now, look at Home (or 'home dot cwru' as I like to call it)—this is an entirely student-run service, by the way, but I'm not looking at their usage or storage policies. Home has existed since 1998 and allows anyone to sign up (even alumni and unaffiliated users), yet they have only 10,600 user accounts—which isn't much larger than the student population at any given time. Many of those users probably just signed up to post in one thread and never returned, which suggests that there is an even smaller number of active users. I think if ITS reserves the resources to support the entire student population, usage statistics will allow for the persistence of blogs belonging to those separated from the university.

Finally, and practically speaking, ITS has the authority to impose whatever policies they see fit. The most obvious solution, from my point of view, would be to purge separated-user blogs that have been inactive for a certain threshold of time. Don't post in your blog for 6 months after leaving Case? Then you get a notification that your blog will be erased shortly. Another obvious policy would be to not offer continued tech support to users separated from the university, but still allow them to go about their business using the service.

In other news, you can probably tell I'm still tinkering with my template. All that navigation and side bar stuff will make a return at some point. It's much easier to build the template piece by piece. Individual entry pages still look ugly at the bottom—haven't customized that yet.

I finally got the number-of-comments-centered-in-a-circle working. If there's one place where CSS is a huge failure it's vertical alignment. Phew! Also finally decided on a trackback icon (a pair of quotes). It's the pink one!

The Blog@Case stats page shows me (exogen) as the top, I think, non-robot host making requests (unless one of those is Jeremy or another admin). I blame my template, for wanting to be tweaked every five minutes.