Wrote this last night for my brother. It's a simple JavaScript class that reads from an rss file on the server and loads the entries into an HTML element. He has a blog (Wordpress) and a separate, static page that he wanted to be dynamically updated with recent posts. JavaScript and Ajax (plus some ghetto-parsing) was the quickest way I could think to get it done. Could XSLT be integrated somehow? I'm not sure.
The JavaScript file is called feed-injector.js and it requires Prototype 1.6+. Thanks to Alex Vollmer's article on object-oriented Ajax (along with his many commenters) to clean up the callback code.
There's very little magic here. Basically, the code makes an Ajax call to the requested rss file, parses out N entries containing title, link, and description elements, and then generates divs in the specified parent div. Example use (also using Prototype for the window load event):
// For http://example.com/mysite/mysite.rss
Event.observe(window, "load", function() { var fi = new FeedInjector("/mysite/mysite.rss");fi.load();
});
Ajax can't call across domains so no funny business, mister. This is usually resolved by a "proxy" on your server that makes the remote call (i.e. my.domain.com/ajax.html -> my.domain.com/proxy.php -> other.domain.com and back). YMMV.
[ updated 29 Apr 2009 ]
Or, you could just create a FeedBurner account. These articles are ad-heavy, but they or their comments may add information: Display and Show Feed on HTML Website with FeedBurner BuzzBoost, Google Lets You Embed Feeds on Your Site. Another article, How to Embed RSS Feeds into HTML Web Pages - The Easy Way, shows how to add feeds to your Google home page and has many comments with other possible solutions.
Image description: PEJE03 19610910 JÄRVENPÄÄ, FINLAND: Russian-born composer Igor Stravinsky lays flowers on Finnish composer Jean Sibelius's grave at Sibelius's home, Ainola, in Järvenpää, Finland, on September 10, 1961. LEHTIKUVA / PERTTI JENYTIN
Referenced and dead-linked by Alex Ross for The Rest Is Noise, I found the only (?) internet copy here and stole it.
~150 pages in. So far a very approachable review of 20th century music. Predominantly on the "classical" side, but with many stories on how different styles and different classifications have interbred. I think I recommend it to anyone interested, but I also have noticed that many of the refs in the book have been refiring my music history class synapses. YMMV. He's got streaming excerpts on his web page, but while reading I seldom stop to take advantage. Accessible knowledge is sometimes an inconvenient interruption.
Continue reading "The Rest Is Noise: Listening to the Twentieth Century; Alex Ross"Watched the Obama Flickr slideshow from election night. It's deceptive to be moved over beautiful pictures of well-dress and well-composed people. However, I can only imagine how black people felt to have this moment and have it with such a composed and intelligent politician and family (us whites had to skulk along with Bush or McCain as potential leaders; they don't inspire racial pride and even go so far as to bring up questions about humanity as a whole).
Brooke Shields in the new VW ads is very middle-aged-sexy. I think she just got on the list. The ads are not at all good though.
Embedding streaming audio in a web page: (1) works for Firefox and Opera using standard HTML, (2) works for Opera and IE using IE hack, (3) works for all three in some manner I have not yet divined. Fuck you, Microsoft.
Last Sunday went to buy DFW's The Broom of the System since I finished Brief Interviews with Hideous Men and needed a novel-not-short-stories. The pieces in Brief Interviews were not as good as Oblivion. Stand out items: The Depressed Person (virtuoso execution!), Octet, and Tri-Stan: I Sold Sissee Nar to Ecko (an inexplicable story of 1980s TV decadence written as Classical history). Before even finding BotS, impulse buy of Alex Ross's The Rest Is Noise (I read his blog, now I can read his book! I expect to pass it on to Lisa as the introduction to modern music), Alfred Bester's The Demolished Man (first Hugo Award winner, 1954, s/b short and punchy pulp sci-fi. I vaguely remember the title as one of those passed over during my teen years.), and Bad Monkeys (a Lisa impulse buy, 20 pages left right now and about to finish it, fun and light but maybe prepping for a Big Finish).
Re-hearing the Barber Violin Concerto made me fall in love with it again. Need to revisit his Piano Concerto. At some point in college I purched an ELL PEE with both and wore out the grooves listening to it. Perfect concert piece last night with Joshua Bell: short and catchy and well proportioned as a concerto.
The stupidity of the concept of the noble savage in music ("don't learn to read music! it will ruin your natural skill!!) set bare by Gershwin [ via Alex Ross ]. This has long been an irritant to me primarily because it's born of ignorance and passed on like folk wisdom fighting against the Big Bad Intellectuals who complicate what's just basic common sense. The fear as it is manifest in the Fine Arts possibly originates with the artists' understanding that inspiration is fleeting. Examine it too closely and you may purge the force that through your inner fuse drives the art. And there's the real issue of too incisive religious examination purging the force of belief, as was recently outlined in The Washington Post's article on Bart Ehrman, author of Misquoting Jesus.
The writing of those who have spent time researching their subjects to the point of obsession provides a more clear truth. I recently listened to Sarah Vowell dissect the history of "The Battle Hymn of the Republic." Her love of historical nuance provides a more nuanced understanding of the subject. And read any Feynman essay or Brian Greene book to feel their deep love of natural science and the workings of the universe. The capacity for appreciation, and belief, is proportional to knowledge.
I've always had a nagging issue with the refactoring item replace conditional with polymorphism. The concept is that you have a bunch of objects that are acted upon in the same situation but with different underlying actions. With the canonical Shape class and its Circle, Square, and Triangle subclasses, a poor design would have the draw method in Shape and a conditional within that method to draw each possible type. That's a little contrived because of the simplicity of the example, but real-world examples are common resulting from tree-forest syndrome in bulky classes, or from code bloat as more and more classes are added--requiring copy-pastes with small alterations to the conditional.
This refactoring method converts the multiple-line conditional blocks into single lines of code that distribute their work across an already-existing class hierarchy (see below). The problem I have is that, while the superfluous conditionals are removed, there's always one or two that must remain: those that create the separate objects in the first place.
if x then
process
else if y then
process
else if z then
process
end if
Becomes:
base->process() - - - - > calls x or y or z
That "redistribution" is key, and eliminates so much noisy, conditional code that I'm sometimes unjustly suspicious of every conditional I see. This is similar to how the standard's algorithms have made loops suspicious--breaking them up into templates (find<>, for_each<>, set_intersection<>, etc.) and predicates. Absolutes are never so absolute, so there are times to use loops and conditionals (and times when the standard binders justdon'twork). The Boost library and features in updates to the C++ standard and especially some of the functional magic going on in Alexandrescu's techniques are all helpful in this regard.
Continue reading "Conditionals and polymorphism"Today's edition of Soundcheck on WNYC is titled "Recorded Music and its Discontents" and discusses how the process and technology of recording has altered music itself, based on the central theme of Evan Eisenberg's book The Recording Angel [Amazon] (duly wishlisted). This has been been a frequent topic on music blogs since pre-NYC trip--in fact one of the original articles was in-flight reading. Probably an Alex Ross piece from The New Yorker ...
... searching ...
Bingo. With a follow up piece. Very good articles. David Byrne wrote a piece about it, as did A.C. Douglas (if you think I'm a snob, you haven't seen anything until you've read his blog). I'm recording the WNYC show in case I miss it.
Alex Ross is on target with his review of the recent performance of Koyaanisqatsi at the Rose Theater in NYC. Lisa & I saw Naqoyqatsi in the same series--hey, I wonder if Alex Ross was that hirsute guy sitting in front of us! Either way...we generally agree with critics when they (1) enlighten us in some way, or (2) agree with us.
I'll take 2.
Lost in the corporate email archives of either Sterling Commerce or Xcellenet is my review of Koyaanisqatsi at The Fox Theater sent to a co-worker in the day-after excitement--still shocked by the astoundingly perfect ending. I'm lucky I didn't encounter the movie in college or else, like Ross, I might have dismissed it as a trippy, slick, MTV-ish thing, to which some well-meaning soul had attached hippie messages about the mechanization of existence and the spoliation of the planet.
I was not the sharpest student in the pencil box, and, hanging around liberals much more rabid than me, would have been pelted with Groovy Theories. And those are the terms that I heard used when the movie was discussed in musical circles. When I finally saw it, my excitement came from a response to it's much more nuanced statement: that we're part of a complex system. Love it or whatever. The crushing mechanization, displayed alternately in frenzied time-lapse and langorous slow motion, is paired directly with scenes from nature using the same techniques. You can view 10-hours-as-10-minutes of factory workers in the same manner as of clouds passing. Our social systems are not necessarily a problem; they're what we are.
One point Alex Ross missed that hit me during The Fox performance was the sublime parallel of the images in the movie (e.g. workers as part of the machine of society) and the actions of the musicians--struggling to keep time with the flow of the movie and to match the sometimes very precise entries and exits. For me, it was a perfect introduction to Koyaanisqatsi.
Continue reading "Alex Ross on Koyaanisqatsi"Alex Ross has pointed out that John Adams [Wikipedia] is working on his third opera (libretto by bad boy Peter Sellars [Wikipedia]) to premiere in San Fran this October. It's titled Dr. Atomic and covers the hours leading up to the first atomic test [Wikipedia].
I may be clinging to a dead form, but I wish that there were a more active culture of modern historic opera. Adams' first two also covered relatively recent events: The Death of Klinghoffer [Wikipedia], about the Palestinian terrorist hijacking of the Achille Lauro in 1985, and Nixon in China, about Nixon's 1972 visit to China. Why do historical operas seem more compelling than a fictional re-telling in, say, novel or movie form? I'm not sure.
Related to my recent post on the dystopic personalization of media, Terry Teachout has an essay on the history of blogging [ via Alex Ross ].
With all of the great detail offered, I'm a little doubtful about his overall explanations that the red/blue state dichotomy sparked the drive for personalized culture (because the red states were disenfranchised by Liberal Media). He also asserts that the disconnect between mainstream media and groups not represented by mainstream media is somehow new to our modern culture (and that the common culture of widely shared values and knowledge that once helped to unite Americans of all creeds, colors, and classes no longer exists
). There are many ideas in the essay so I'll need to re-read, but his conclusions seem considerably counter to historic example.
It began earlier this week with WNYC discussing first The Rock Snob's Dictionary [Amazon] with its authors (very funny) on The Brian Lehrer Show. Then on The Leonard Lopate Show, a discussion of quirks in the English language resulted in many Language Snobs calling in to decry this or that usage they're aghast at (usually related to something dangling or mixed). Later, a co-worker passed around one of those how-observant-are-you trivia quizzes (Which way does a no smoking sign's slash run? How many sides does a stop sign have?
). A situation free of snobbery you think? Well, the Logic Snobs of the office took issue with the connotative/denotative ambiguity of some of the questions ("a stop sign only has two sides, it does however have eight edges"), succumbing to the urge to try to be smarter than the object that's challenging you. Then today, Alex Ross gave his readers a good laugh by pointing out the sometimes contradictory Music Snobbery of Pope Benedict XVI: Holy cow — Theodor W. Adorno has been elected Pope!
[Exclamation mine.]
I recently had an interesting, small-scale class design that takes advantage of some template tomfoolery. Alexandrescu's Modern C++ Design has some great concepts for compile-time polymorphism, but they're difficult to absorb without implementing. I've used policies many times before but decided to take a slightly different approach this time.
Continue reading "Compile- and run-time polymorphism"...an intuitive shudder...
Alex Ross is musing over the dread inherent in the key Eb minor. He suggests that, after string players emphasized to him the physical difficulty of performing pieces in Eb minor, the physical stress felt by the performer and heard by the listener produces an intuitive shudder even in listeners who do not think they know the difference.
This is important.
...an intuitive shudder..."
Everybody loves Amazon, and with the Search Inside feature it's become the Library of Alexandria.
I've begun using it to provide links to relevant quotes and have been a little lazy. The links ended up being session dependent and have expired. Here's a quick hack to do it correctly.
Continue reading "Amazon hacks"If you use an RSS reader, you can subscribe to a feed of all future entries matching 'Alex Ross'. [What is this?]