PHP format for valid RSS date()

I couldn’t find this for easy copy-pasting online so here it is:

In order for the dates in your RSS feed to validate they must comply with the RFC822 standard, but with a full four number year. To generate this in php you must pass the format string ‘D, d M Y H:i:s O’.

i.e.

date(‘D, d M Y H:i:s O’, <your timestamp>)

This outputs your timestamp in the format to match ‘Wed, 02 Oct 2002 15:00:00 +0200′

Website Update

This holiday I’ve finally had time to recraft my web presence. Wot! It’s been a really long time coming.

The process of making the layout was truly horrendous. I built the whole thing from a concept that I grew to despise and eventually scrapped everything but the logical containment. I tore down images and graphics I’d spent a good few hours on each and replaced them with… well less. And now I’m happy. It very concisely does it’s job.

Writing the content to actually populate the thing took almost as long. I rather dislike writing about myself. Of course there will never be another person reading it with the same detail I did, so perhaps it unnecessary to worry about. Whatever. We are of course our own harshest critics.

I still have to add some images to the work page that I can’t access/generate without actually being on a Brown CS computer. The things will only ever let one account have access to the GPU at once  and I’ve yet to have the privilege when logged in over SSH – so I can’t run and screenshot my CS123 final. It can wait.

In addition to designing and building the layout, I’ve returned to my programming roots and had a chance to do some PHP work, whipping up a simple blog engine to run a Gruber style commentary thing on. It should let me keep my personal stuff on this blog and not have to resort to using posterous or another service for me to write about tech stuff around me. The engine let’s you post, edit, and delete and works with a MySQL db. Aside from that it has perma-links, pagination and an rss feed. That’s it. Oh and so far editing is done in raw HTML, but I might make it use markdown. As I said, simple. -But fun for a few hours of work – and the first time I’ve rally looked at PHP since coming to Brown.

I love these lyrics

When will certain people realize- an afterlife is nothing to live for Nothing to die for Nothing to fight for If those in this life are not sacred, then nothing that’s a part of it is sacred either If you think God is more important than your neighbor, you’re capable of terrible evil If you think some prophet’s words are more important than your brother and your sister You’re ill And you’re wrong You’re wrong.
  • ‘You do Mutilate?’ – Of Montreal

9 Brown CS Females -> MSFT

[this is a repost from my posterous. i have yet to decide properly which type of content will sit where. sorry for the dupe.]

Brown shipped off a bunch of my good friends and workmates from the Brown CS TA scene to Seattle this summer. For once it was a group of computer scientists within which a healthy proportion (I’m guestimating about half, but I sadly wasn’t out there… this year) were female.

The article is a bit disingenuous when it groups rising Juniors and rising Seniors into one group of ‘juniors’ but is nevertheless worth a read. http://www.microsoft.com/presspass/features/2010/aug10/08-13browninterns.mspx…

We’re sadly in no way this equally balanced within CS at Brown in general but within the TAing group they are much better represented percentage-wise.

Its a nice article to see but it still annoys the hell out of me that the situation is remarkable enough to be written about.

CS15 Skits

Presenting… every skit filmed during Brown’s CS intro course CS15 in fall 2009.

Poster for CS15

They’ve been a while coming but I’m thrilled to finally have them online for anyone to see. The atmosphere and attitude captured in these videos is probably unique to, and more importantly absolutely ubiquitous within, CS15.

Opening Day Skit

The skit showed/acted on the first day of class. Star Trek themed (as was the course and website) in 2009. Written by the 2009 Humor TAs.

Collaboration Policy Skit

3 short filmed skits animating the course’s collaboration policy. Written by the 2009 Humor TAs.

Star-crossed References

An in class skit personifying some of the aspects of programming and the Java environment. Includes variable scope, garbage collection, references and constants. Presumably written by TAs who’ve long since graduated.

Slush Gray

In class, Snow White themed skit. Has a linked list. The skit is a long-standing CS15 feature. Presumably written by TAs who’ve long since graduated.

Othello

The skit written and preformed on film by the group of TAs responsible for the final project ‘Othello’ in which students make the board game Othello and implement a minimax based AI.

Adventure

The skit written and preformed on film by the group of TAs responsible for the final project ‘Adventure’ in which students make a 3d randomly generating objective based maze game.

Sketchy

The skit preformed on film by the group of TAs responsible for the final project ‘Sketchy’ in which students make a basic graphics editing program. Written by previous years’ TAs.

Credits

The credits reel for all of the videos included on the DVD from which they were ripped.

Bloopers

Bloopers reel from lots of the above videos. Continue reading

Pointer to Peach

I wrote and acted in this skit for CS4 at Brown. Cs4 is an intro level CS course for likely non-concentrators (i.e. engineers). In it, we cover a whole bunch of Matlab and a small amount of C.

The skit is about pointers and is set in the Mushroom kingdom… It’s nowhere near as hardcore as the stuff that we did for CS15 but it’s my baby, so here it is.

Script after the break. Continue reading

Playing with user scripts

I’m taking a rather fun algorithms course with a website that reddit loves but I do not. I decided to turn this dire, lolcat-overloaded, situation into an opportunity to practice some javascript (without jQuery) and to write my first userscript.

User scripts are javascript files with the extension ‘.user.js’ that are executed client-side to add functionality to a web page. They are natively supported by chrome and opera and are supported via extensions in most other browsers of any note. (Some include Greasemonkey for Firefox, GreaseKit for Safari and Trixie for IE).

I succeeded in reskinning the whole website which was pretty fun. There seems to be a limit to the usefulness of userscripts in that support for the ‘@run-at document-start’ flag which I believe should make the script run before any scripts on the page do, is not supported by most browsers. It’s not all that useful a flag anyway as I imagine you’d often want the script to run after the DOM has been written so that you can work with the content expected to be on the page. In this case however it would be useful as I attempt to strip out a script on the course page that redirects 1% of all hits to a rickroll (sigh). As such the script still runs before the userscript and so the rickrolling still happens.

I might also put some more time into the replacement style sheet some time soon.

CS16 course site

OriginalCS16 course site with userscript and restyle

Reshaped and restyled

Code after the break. Continue reading