Archive for the 'Computers' Category

Creating a comma separated list

For years, whenever I have to create a comma separated list from an array I have been writing code that looks vaguely like this.

$first = true;
foreach($arr as $m) {

if ($first) {
$first = false;
}
else {
echo ",";
}
echo $m;
}

I’ve had it. There has to be a cleaner way than using $first to skip the comma on the first value. What am I doing wrong?

Philadelphia Hackathon

I’ll be doing a short talk about Dungeon Adventure tomorrow at the Philadelphia Ship It Society’s Hackathon. Tickets are available here.

The Ship It Society is all about getting together and rapid prototyping a project to see if its feasible. Should be a fun time.

Rob Kolstad is an Asshole

This month’s Wired has a great article (not online yet, so no link) by Jason Fagone about the International Olympiad in Informatics where high school students from all over the world compete to solve problems through software. It’s fiercely competitive and has its own sub culture of super stars, namely Gennady Korotkevich of Belarus, who at 14 became the youngest world champion.

What should have been an inspiring and interesting look into this academic sport with open ended problems such as how to best determine the language of a given text string, went sour for me when Fagone brought up US coach, Rob Kolstad, who admits he doesn’t “know how to do most of the algorithms.” After Korotkevich won his second straight Olympiad at 15, Kolstad remarked, “the question is, will he die a virgin?

I expect smartasses with no respect for the brilliance of these kids to say something like that, but not someone who works with them every day and helps them train. He’s not someone I want to represent the US either.

Rob Kolstad

US Coach Rob Kolstad, who clearly does very well with the ladies.

Sorry, it just made me angry.

Vista

My first Vista startup. Hmmm….

Pop up hell

Pop up hell

Could Twitter Have Worked in 1999?

For many years the Internet has brought us ideas and services that we wish we had thought of first. ?Most technologists wish they could go back in time and hit big with online auctions, classifieds, blogging software, and social networking. ?Microblogging (ie. Twitter) is the latest and greatest of these facepalming ideas because it’s so damn simple.

twitter-status6

But would Twitter have worked ten years ago?

The two components to this question are the technical feasibility and user feasibility. ?Were the computers fast enough for a worldwide application handling millions of messages per day in real time? ?Were people ready for a public, messy communication tool?

Technology:
Did we have the technology for Twitter in 1999? ?The fail whales of the past few years indicate we may not have had equipment and system software powerful enough for a monster like Twitter. ?Were there any applications of that size in 1999?

To me, the only comparable 20th century, many-to-many application was eBay. ?The web and the Internet ?itself were enormous systems handling many-to-many relationships, but its architecture was distributed world wide to share the load.

Users:
What did the Internet look like? ?Google had just arrived, Internet Explorer had achieved dominant market share, eBay seemed like the best Internet business, blogs were in their infancy, message boards and usenet were extremely popular, and mainstream communication was dominated by email and instant messaging. ?So much time and effort went into making sure messaging was private and secure, I think it would have been a big stretch to think people would have been ok with mostly public messaging. ?In fact, I think the only way public messaging could have caught on was through the emergent behavior we saw on friendster?testimonials?and myspace wall posts, which were the precursors to twitter. ? Message boards were obviously public in 1999, but we hadn’t yet grown tired of the trolls, spammers, flamers, creationists, and over-reacting moderators. ?For many of us Twitter reclaimed that energy and spirit the web had before these problems got unbearable.

This is what my site looked like in 1999.  Ouch.

This is what my site looked like in 1999. Ouch.

So in my opinion, we may or may not have been technically ready for Twitter, but the users definitely weren’t ready. ?We needed to be shown over and over again that email, chat, ?and message boards all kind of sucked once they got to a certain size. ?Twitter made it truly mass communication?usable?again and it works despite its negatives, but only because we know the alternatives are worse.

Follow me on twitter: ?http://twitter.com/bengarvey

iTunes Genius

I finally got around to downloading the latest version of iTunes and with it came their new Genius playlist feature. Here’s how it works:

You pick a song in your library you like, hit the Genius button, and it generates a playlist from your library of 25 complimentary songs. I was skeptical, but tried it out. It first parses through your whole library and uploads that data to a central server somewhere (let’s call it Mother Brain) and cross references with thousands of other people’s libraries and musical tastes. So can Genius generate the awesomest mixtape ever from just one song? Will John Cusack and Jack Black use this feature as evidence of an impending apocalypse in High Fidelity 2?

Maybe. Here’s how it did when I selected Neighborhood #2 (Laika) by Arcade Fire…

  1. Neighborhood #2 (Laika) by Arcade Fire

  2. Five Years – David Bowie
  3. Slow Hands – Interpol
  4. Last Goodbye – Jeff Buckley
  5. Lua – Bright Eyes
  6. The Skin of My Yellow Country Teeth – Clap Your Hands Say Yeah
  7. El Scorcho – Weezer
  8. We Are Nowhere and It’s Now – Bright Eyes
  9. Grace – Jeff Buckley
  10. Lover’s Spit – Broken Social Scene
  11. Caring is Creepy – The Shins
  12. Molly’s Chambers – Kings of Leon
  13. 12:51 – The Strokes
  14. Business Time – Flight of the Conchords
  15. Lazy Eye – Silversun Pickups
  16. I Summon You – Spoon
  17. My Moon My Man – Feist
  18. Vampire / Forest Fire – Arcade Fire
  19. Fake Palindromes – Andrew Bird
  20. Do You Realize? – The Flaming Lips
  21. Evil – Interpol
  22. Wolf Like Me – TV on the Radio
  23. Y Control – Yeah Yeah Yeahs
  24. Woman King – Iron & Wine
  25. In the Backseat – Arcade Fire

Not bad, but a little heavy on Bright Eyes. Let’s try another song: Coffee & TV – Blur

  1. Coffee & TV – Blur

  2. Every You Every Me – Placebo
  3. Alright – Supergrass
  4. Supersonic – Oasis
  5. The Charming Man – The Smiths
  6. Summer Babe – Pavement
  7. The Dark of the Matinee – Franz Ferdinand
  8. Lucky – Radiohead
  9. Monkey Gone to Heaven – Pixies
  10. Slow Hands – Interpol
  11. The New Pollution – Beck
  12. Here Comes Your Man – Pixes
  13. El Scorcho – Weezer
  14. She’s So High (Live) – Blur
  15. The Skin of My Yellow Country Teeth – Clap Your Hands Say Yeah
  16. Out of Time – Blur
  17. The W.A.N.D (The Will Always Negates Defeat) – The Flaming Lips
  18. No Cars Go – Arcade Fire
  19. Mistaken for Stranges – The National
  20. For Tomorrow – Blur
  21. You and Me Song – The Wannadies
  22. Tropicalia – Beck
  23. We Used to Vacation – Cold War Kids
  24. One Big Holiday – My Morning Jacket
  25. Molly’s Chambers – Kings of Leon.

The way I’ve been using it is to create the playlist and not look at what was selected, preferring to treat it like a robot radio station while I listen to it on my commute. What’s cool about it is that it will dig down and find stuff that you probably forgot about and never got a chance to rate (if you rate your songs at all).

Top Ten Programming Languages

I’m currently learning Ruby on Rails, and since Ruby is a new language for me I got to thinking what my favorite programming languages are…

10.? Assembly
9.? ASP / vbscript
8.? JavaScript
7.? Visual Basic
6.? C
5.? C++
4.? SQL
3.? PHP
2.? Java
1.? perl

Honestly, the more I program in any language the more I like perl.

Using 3rd party headphones with the iPhone

My cousin Tom put together this very serious video for making your headphones iPhone compatible.

How To Hack Any Headphones For Your IPhone!Celebrity bloopers here

New Computer on the Way

I ordered my new computer parts last night. Here are the specs!

Intel Core 2 Duo E6300 Conroe 1.86GHz LGA 775
Processor Model BX80557E6300 – Retail

PNY VCG7900SXPB GeForce 7900GS 256MB GDDR3 PCI Express x16 Video Card – Retail

MSI 945P Neo3-F LGA 775 Intel 945P ATX Intel Motherboard – Retail

WINTEC AMPO 2GB (2 x 1GB) 240-Pin DDR2 SDRAM DDR2 667 (PC2 5300) Dual Channel Kit Desktop Memory Model 3AMD2667-2G2K-R – Retail

Western Digital Caviar SE WD2500JS 250GB 7200 RPM SATA 3.0Gb/s Hard Drive – OEM

SAMSUNG 18X DVD?R DVD Burner With 12X DVD-RAM Write Black E-IDE/ATAPI Model SH-S182D/BEBE – OEM

Antec LifeStyle SONATA II Piano Black Steel ATX Mid Tower Computer Case 450Watt SmartPower 2.0 Power Supply – Retail

SAMSUNG 941BW Black 19″ 4 ms (GTG) DVI Widescreen LCD Monitor – Retail

KO’D Computer

It looks like my PC just barely outlasted Kurt Vonnegut. After a power outage I found that it won’t boot up anymore. The power turns on and I can hear the drives kicking in and the fans turning, but nothing makes it to the screen. No error beeps either, which tells me it’s either the motherboard or part of the power supply that is bad. I thought it might be the CMOS battery, but my friend Steve convinced me that it would still boot up with a dead one.

The good news is that my hard drives are probably ok, and even if they aren’t everything should be backed up on my external drive.

So… do I buy the same motherboard and rebuild my current machine? If I upgrade the MB I’ll probably have to buy a new processor, RAM, and video card, so we’re already talking hundreds of dollars.