Uncategorized

  • How to Beat Sandman?


    So for those of you who saw Spiderman 3 over the weekend: supposing you can’t appeal to his emotion, how exactly do you beat Sandman?  I imagine an ending sort of like Terminator 2…

  • A Backend for Web Apps

    I’m just amazed at how far web applications have come over the last few years.  Javascript provides a solid programming foundation upon which CSS and the DOM can create rich user interfaces, and its all happening inside the web browser.

    We’re coming close to the point where entire applications could live within the browser,  were it not for the need to save and retrieve user information.  This requires a server backend built with anything from Ruby on Rails to ASP.NET AJAX.  Each new web application needs to consider the backend, which can be a huge time and cost sink for a personal developer.

    For anyone building robust web apps, this concern isn’t going to disappear.  But I’m excited about a few new products can drive down development time by exposing data to javascript:

    • Yahoo Pipes – Yahoo Pipes was released a few weeks ago to tremendous buzz, and seems to be growing steadily ever since.  Pipes offers a graphical programming language for manipulating RSS feeds.  Consider our Xanga Themes Forum as an example.  Each individual forum publishes its own RSS feed.  Using Yahoo Pipes, I was able to retrieve all the feeds, merge them into a single feed, sort by date, and then publish it as a widget on the Xanga Themes Site.  Yahoo Pipes offers many powerful options for manipulating feeds, including sorting, content analysis, and translation.
    • Google AJAX Feed API – The buzz around Google’s feed API isn’t so strong, but I’m really excited about this technology because is super easy to retrieve any RSS feed using Javascript.  The interface is simple: grab an rss feed as a javascript object and manipulate it.  But through that simplicity you could build an RSS reader completely in javascript.  Though Pipes is more powerful, the Feed API will get a lot of developers up and running faster, simply because it requires no configuration.
    • Microsoft’s Astoria – Microsoft made a ton of announcements at the MIX conference this week.  One of these was Astoria, which presents data in a variety of formats for web clients.  Astoria uses simple HTTP GET, PUT, POST and DELETE requests to perform database operations over the web.  Imagine the power: using javascript you can not only retrieve data, but also create, update and delete it!  Unlike the solutions above, Astoria will require some setup from the developer, but it will be an order of magnitude less that what must be done now.  I’ll be curious to see what kind of security precautions Astoria has for requests across the internet.

    Unlike Astoria, Pipes and the Feed API can only read data.  Although Yahoo and Google don’t offer a true database experience for Javascript, this doesn’t make them any less useful, since almost all web apps these days expose RSS feeds.

    The mashup of the past depended on providers like Xanga to expose RSS feeds which the developer would be responsible for managing.  These technologies make development even easier by removing that last step, and I think they can encourage a new generation of mashups that aren’t tethered to the backend.

  • Hypnotic Brass Ensemble

    For the last few years I’ve seen this brass and drum group performing in the subway stations and in Union Square.  They wield a commanding presence: all drums and horns blaring out strong hip-hop beats.  Well yesterday I finally got up the nerve to buy their CD, and it does not disappoint!  They are a 7-piece band from Chicago called the Hypnotic Brass Ensemble; check out their website, or watch the video for War.  I look forward to running into them some more over the summer.

  • TV Update

    Thanks to everyone who commented on my previous post about my TV; I got a lot of great feedback!  The computer is now hooked into the TV through the S-Video connector.  But the TV ignores any video signal through the component input, which means I can’t connect my DVD Player and computer to the TV at the same time!  I see a few ways to get around this:

    • Manually unplug the S-Video when I want to use the component inputs
    • Use an S-Video-to-Component cable to run my computer into my receiver, then out to the TV
    • Rapey suggested this Component Switch Selector
    • Buy a new reciever.  My current receiver was bought used 10 years ago, so it might be a good time to upgrade.  The new Onkyo’s on the horizon look pretty sweet. 

    Right now I’m fine switching the cables.  I can watch DVDs on the computer, but I still need a solution to this for the Wii and those very rare occasions when I need the VCR.  Naturally, I’m leaning towards the last option   By the way, the Media Center is running beautifully right now; more on that in another post!

  • Free baseball!

    Its torrentially raining here on the East Coast!  Luckily MLB Extra Innings is running a free preview thru this weekend.  So not only do I get to watch the Cubs & White Sox on TV, I get to see them on a day when most of the East Coast games are postponed due to rain.  Not a bad way to spend a lazy Sunday afternoon.

  • Must be cuz of Friday the 13th…

    Thank you thank you, I’ve managed to create a directory inside itself!

    This lovely feat was made possible by a malformed Robocopy command.  The screenshot above is as far as windows explorer lets me go.  If I try to delete the folder, I get this message:

    Smooooth.  Now, how do I get out of this mess?

    • rmdir /S
    • del /F
    • rm -f (*nix only, just thought I’d try for giggles)
  • Visual Studio Keyboard Shortcuts

    I’ve blogged a bit about mouse speed and productivity, but the fastest speed comes when you don’t reach for your mouse at all!  I’m trying to go completely mouse-free in Visual Studio .NET; its annoying to have to jump between keyboard and mouse to make little changes.  VS.NET offers a keyboard shortcut for just about anything; you just have to find it.

    Thankfully Jeff Atwood (my hero) has compiled a nice little cheat sheet for VS.NET shortcuts.  My favorite is CTRL-I, which allows incremental search; I didn’t realize VS.NET even did this!  (I pine for the day when all search is incremental…)

    I’ve given myself a little rule: every time I reach for the mouse in VS.NET, I’ll look up the equivalent keyboard shortcut.  Yes, I’m going to turn VS.NET into emacs!  Have any of you reached mouse-free zen?

  • Regular Expressions: Multiline vs. Singleline

    This post is really just for my own reference.  Writing regular expressions can be a complicated experience with a lot of guess and check.  The one thing that always confuses me is the definition of Multiline vs. Singleline.  They have nothing to do with what they intuitively seem to do; they aren’t even related to each other!  And every time I encounter these, I go scrambling across the internet trying to remember what they do.  So for posterity, I wanted to set the record straight on these two options:

    Multiline

    Changes the definition of ^ and $ so that they match at individual lines of the input string (instead of the beginning and end of the entire input string).  For example if you have the string:

    With a taste of your lips
    I’m on a ride
    You’re toxic
    I’m slipping under

    Multiline OFF will match ^ to the beginning of “With” and $ to the end of “under”, while Multiline ON will match ^ and $ to the beginning and end of each individual line (so there are 4 possible matches instead of 1).

    Singleline

    Changes the definition of the period character (.) so that it matches all characters, including newlines.  Taking the example text from above, a period with Singline OFF will match only to the end of the first line, whereas Singleline ON will match the entire text (i.e. it pretends the input is a single line).

    So Multiline is relevant only when using ^ and $, while Singleline is relevant only when using the period character.  They are unecessary in any other situations, and they don’t interact with each other.

    If you want to turn regular epxressions from a chore into something fun, I highly recommend Jeffrey Friedl’s Mastering Regular Expressions.  Not only is it the definitive book on practical regular expressions, its one of the best programming books I’ve ever read.

  • Introducing Xanga Themes!

    Customizing Xanga sites has always been popular.  I can still remember the first Custom Look & Feel page we had, written in Classic ASP!  Well, the web has changed A LOT since then: AJAX is a common word, javascript reigns supreme, and little snippets of code called “widgets” are taking over websites by storm.  

    So for the last few months we’ve been working on this project called “Xanga Themes”, aimed at bringing you as much control as possible over you Xanga site.  Its pretty cool what you can do: drag/drop modules around on the page, add custom flash widgets, and control virtually every Look & Feel setting in real time.  You can read the official announcement over at the XangaTheme’s site (and see John’s sweet screencast):

    http://www.xanga.com/XangaThemes

    On a personal note, working on Themes has been a blast!  I’ve learned a ton about javascript and done some pretty neat Prototype/Scriptaculous hacking.  Maybe all that will find its way into another post.  In the mean time, have fun with Xanga Themes, and use the forums to let us know what you think!

  • Help with TV

    I have an old Sony 32 inch TV.  Mind you, I don’t think its very old (I got it in 2000), but in electronic years, thats ancient.  Its old enough to make that loud “GONG” sound when you turn it on.  When I was getting cable installed, the cable guy chuckled and said he hasn’t heard that in ages.

    I don’t know the exact model of this TV, but it does have both composite and S-Video inputs (even though the TV only has one video mode).  What I’m wondering is what happens when you have devices connected to the composite and S-Video inputs at the same time?  How does it know which signal to choose?  Where does it take the audio from?

    I ask because the hard drive on my computer died this week, and I’m looking to overhaul the box into a Media Center PC.  My DVD player connects to the TV through the composite video via the receiver (which does not support S-Video.  Its old too).  I want to connect the computer to the TV through the S-Video input, but I wonder if the DVD and computer will conflict.  If there are issues, I could always go with an S-Video to Composite converter and run it through the reciever.  Any advice?

    EDIT: I thought a picture might help: