From 3e17f2c2f5598338738a94c5f0a1bb9ce9653bfa Mon Sep 17 00:00:00 2001 From: Webmaster Date: Sat, 24 Mar 2007 03:55:56 +0000 Subject: [PATCH] More sexy time --- Makefile | 5 +- cscweb.xsl | 14 ++++++ events.xml | 6 +-- media/index.xml | 63 +++++++++++++++++++++-- xml2ics.pl | 130 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 211 insertions(+), 7 deletions(-) create mode 100644 xml2ics.pl diff --git a/Makefile b/Makefile index ad5eafd..7505a93 100755 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ INPUTS = index.xml footer.xml SUBDIRS = about events docs office news users clubs media # the following two rules are there so cow gets built first. -cow-first: recurse-cow books.xml members.xml menu.xml all +cow-first: events.ics recurse-cow books.xml members.xml menu.xml all recurse-cow: cd cow && $(MAKE) && cd .. @@ -19,6 +19,9 @@ books.xml: ceoquery booklist | awk -F \| '{ isbn = $$1; title = $$2; author = $$3; edition = $$4; published = $$5; gsub(/&/, "\\&", title); gsub(/&/, "\\&", author); gsub(/&/, "\\&", published); gsub(/&/, "\\&", edition); gsub(/"/, "\\"", title); gsub(/"/, "\\"", author); gsub(/"/, "\\"", published); gsub(/"/, "\\"", edition); print ""; }' >> $@ echo '' >> $@ +events.ics: + perl xml2ics.pl events.xml > events.ics + include default.mk default.mk: default.mk.in diff --git a/cscweb.xsl b/cscweb.xsl index 712da3c..90bf2f5 100755 --- a/cscweb.xsl +++ b/cscweb.xsl @@ -103,6 +103,20 @@

+ + + + diff --git a/events.xml b/events.xml index 10cf462..5d332ce 100755 --- a/events.xml +++ b/events.xml @@ -27,7 +27,7 @@ Richard Stallman has cancelled his trip to Canada. - A talk by David Tenty and Alex Parent @@ -39,7 +39,7 @@ Richard Stallman has cancelled his trip to Canada. - A demo/intrdocution to a new source code search engine. A talk by Holden Karau @@ -56,7 +56,7 @@ The talk will primarily be a demo of All The Code, along with a brief discussion - A talk by Michael Biggs diff --git a/media/index.xml b/media/index.xml index 97decb8..f9ceda3 100755 --- a/media/index.xml +++ b/media/index.xml @@ -10,6 +10,31 @@ Most of these should be available upon request at the Computer Science Club office to be burnt to CD or DVD should you so choose.

    + + +

    A talk for those interested in 3-dimensional graphics but unsure of + where to start. Covers the basic math and theory behind projecting + 3-dimensional polygons on screen, as well as simple cropping + techniques to improve efficiency. Translation and rotation of polygons + will also be discussed.

    +
    + + + + + +
    + +

    A discussion of software start-ups founded by UW students and what they did that helped them grow + and what failed to help. In order to share the most insights and guard the confidences of the + individuals involved, none of the companies will be identifed.

    +
    + + + + + +

    For decades, mainstream parallel processing has been thought of as inevitable. Up until recent @@ -69,9 +94,41 @@ -

    Bill Gates discusses the past, present and future of Microsoft. The - talk was recorded in 1989 but was only recently digitized. The following - picture was taken after the talk (click for higher-res).

    +

    Bill Gates discusses the software and computer industry, and how + Microsoft has + contributed. Gates also discusses his views on the future of the + computing + industry. The talk was recorded in 1989 but was only recently + digitized. +
    + Topics include:

      +
    • The start and history of the microcomputer industry
    • +
    • Microsoft BASIC and the Altair 880 computer
    • +
    • The transition from 8-bit to 16-bit computers
    • +
    • Microsoft's history with IBM
    • +
    • 640k memory barrier and 16-bit architectures
    • +
    • 32-bit 386 and 486 architectures
    • +
    • RISC and multi-processor machines
    • +
    • EGA graphics and WYSIWYG editors
    • +
    • Decreasing cost of memory, harddisks and hardware in general
    • +
    • The importance and future of the mouse
    • +
    • Object-oriented programming
    • +
    • MS-DOS and OS/2
    • +
    • Multi-threaded and multi-application systems
    • +
    • Synchronization in multi-threaded applications
    • +
    • Diskette-based software
    • +
    • UNIX standardization and POSIX
    • +
    • History of the Macintosh and Microsoft' involvement
    • +
    • Involvement of Xerox in graphical user interfaces
    • +
    • Apple vs. Microsoft lawsuit regarding user interfaces
    • +
    • OS/2 future as a replacement for MS-DOS
    • +
    • Microsoft Office on Macintosh
    • +
    • Thin/dumb clients
    • +
    • Compact discs
    • +
    • Multimedia applications
    • +
    • Gates' current role at Microsoft
    • +
    + The following picture was taken after the talk (click for higher-res).

    diff --git a/xml2ics.pl b/xml2ics.pl new file mode 100644 index 0000000..45e9c7c --- /dev/null +++ b/xml2ics.pl @@ -0,0 +1,130 @@ +#!/usr/bin/perl + +use XML::DOM; +use strict; + +# get the first element under a node of the given tag +# @param node: node under which to look for elements +# @param tag: the tage to look for +# @return: first element under node with the given tag +sub subvalue($$) +{ + my ($class, $tag) = @_; + return value($class->getElementsByTagName($tag)->item(0)); +} + +# get the node value of the first child of a given node +# @param node: whose child to use +# @return: node value of given node's first child +sub value($) +{ + my ($class) = @_; + if (undef == $class) { return undef; } + + my $child = $class->getFirstChild(); + + if (undef == $child) { + return undef; + } + + return $child->getNodeValue(); +} + +print <new(); +my $doc = $parser->parsefile($ARGV[0]); +my @events = $doc->getElementsByTagName("eventitem"); + +foreach my $event (@events) { + my $date = $event->getAttribute("date"); + my $time = $event->getAttribute("time"); + my $talk_title = $event->getAttribute("title"); + $talk_title =~ s/[:;,]//g; + + my $room = $event->getAttribute("room"); + + my $short = subvalue($event, "short"); + $short =~ s/[:;,]//g; + my $abstract = $event->getElementsByTagName("abstract")->item(0)->toString(); + + my $ical_date = `date -d"$date" +%Y%m%d`; + chomp $ical_date; + + my ($ical_start, $ical_end); + + if ($time =~ /(.*)-(.*)/) { + $ical_start = ical_time($1); + $ical_end = ical_time($2); + } else { + $ical_start = ical_time($time); + $ical_end = ical_time("$time + 1 hour"); + } + + $abstract =~ s///; + $abstract =~ s/<\/abstract>//; + $abstract =~ s/\n/ /sg; + + my $ical_abstract = "\"$abstract\""; + +sub ical_time { + my ($ds) = @_; + my $d = `date -d"$ds" +\%H\%M\%S`; + chomp $d; + return $d; +} + +print <$talk_title -- $short +DESCRIPTION:$ical_abstract +END:VEVENT +END_OF_EVENT +} + +print "END:VCALENDAR\n"; + + + + + + +