MySpace: Welcome to Web 0.5 (and a Y!Maps toy)

I'm not much into social networking sites. I joined the big wave of PHPers on LinkedIn, but I haven't really used it. Some of my friends/clients, however, are really into MySpace.

Sunny (my aforementioned friend), uses MySpace to promote his band. He maintains his upcoming tour dates within his MySpace profile. I maintain the code behind his site (he maintains the content), and I thought it would be a nice feature if he could update his tour dates in a single place, and have them syndicated elsewhere.

Since (as far as I can tell) there's no real API to update MySpace, the only viable way to achieve a central datastore is to read from MySpace. "No problem," I thought, "I'll just write up a quick wrapper for whatever format they use for Upcoming Show syndication."

(Read on to see the Flash app I came up with as a result of this whole adventure.)
Turns out, there's no API for that, either.

Great. What is this? 2002? "On to Plan B." Plan B involves page scraping. Remember that? It's that thing we did back in the olden days, before RSS caught on. It involves some sort of network layer to grab the content (PHP's streams to the rescue, here), and usually a huge regular expression or three. Where's the Semantic Web when we need it? (side note: notice the "2001" in that URL? Yeah.)

I'm going to let that (side note) distraction lead me on another tangent: What's with MySpace, anyway? It's the new Geocities. It's got the be the biggest mess on the Web (but not the Internet as a whole--that title is reserved for the current state of email). All that it's missing is blinking text, "under construction" logos, background music, animated word-art, impossible-to-read-text-on-background-images, and HUGE FONTS. Oh wait, no.. it's not missing any of that.

Note also that MySpace is not only behind on tech when it comes to new-Web things like RSS, but if you've ever had the.. uh.. pleasure of looking at MySpace's HTML source (and you didn't immediately pluck out your eyeballs), you'll agree with me that the markup is reminiscent of mid-90s-era HTML 3.0.

MySpace: I declare you Web 0.5 compliant. Congrats! (Well, I guess retro is in... right?)

So, (back on topic) I whipped something up to fake syndication. If your band happens to have a MySpace profile, and you maintain your tour dates on MySpace, first accept my apologies for that, then take a look at: http://www.caedmon.net/msm/rss.php?fid=brandnew (where brandnew is your myspace friendid (name or number)).

It's certainly not foolproof, but it allows for cool things like this Live Map: http://www.caedmon.net/msm/map.php?fid=brandnew.

Anway, the RSS allowed me to integrate Sunny's tour dates into his site (if you look closely, you'll see the foolish parts that are not um.. proofed). Mission accomplished.

But that map thing is really cool. I wanted him to be able to integrate a live version of the map into his profile page.

Fortunately, Yahoo! has cool developer tools, including for Y!Maps. (Rasmus blogged about these, a while back.)

MySpace, by their very nature, has had to lock down their profile pages, somewhat. This means: no JavaScript, no IFrames (because of XSS, CSRF, and the potential for worms). Some creative users have, however, figured out how to bypass some of their safeguards (see this -- typical MySpace warnings apply (it plays music)).

So, a big no-go on putting the map into an IFrame. Time to dust off Flash (and download a fresh 30-day trial! (-; ). MySpace allows embedding... but adds attributes to the tag so Flash can't script page elements.

A few hours later, I managed to concoct the 60-or-so lines of ActionScript (Flash's scripting language) required to pull off a Flash version. (I first tried to overlay my RSS, but something was mysteriously broken.)

Voila:

Check the source of this post for embedding details. The URL is: http://www.caedmon.net/msm/flash/msm.swf?brandnew (again, brandnew is the MySpace FriendID).

Enjoy. If you use any of this stuff, let me know.

Oh, and to MySpace: shame on you; update thyself!

S

Security and... Driving? (and Hiring)

There's been a [url=http://www.greebo.net/?p=320]blip[/url] on the PHP blogosphere (think what you will of that word, it's accurate) regarding PHP's "inherent security flaws."

I guess it's time to toss in my 2c (even though I [i]was[/i] one of the first to reply to [url=http://shiflett.org/archive/185]Chris'[/url] post on this). Since I like similes, I propose the following: coding is like driving.

What? It's pretty simple, if you think about it.

If you drive, you'll follow. If you don't, but have tried, you'll also follow. If you've never tried it, you should. (-:

Coding is like driving. When you [i]start[/i] driving, you're really bad at it. Everyone is horrible, even if they aren't aware.

As time passes, and you gain more experience behind the wheel, you're subjected to different driving conditions and new hazardous situations. These eventually make most of us better drivers.

Take me, for example. I grew up in a relatively small city in [url=http://en.wikipedia.org/wiki/New_Brunswick]New Brunswick[/url]. I learned to drive there. At the time, there was very little street parking, and as a result, very little parallel parking. I was really bad at parallel parking for a long time. I first started driving when I was 16. It wasn't until I was 20 that some friends and I took my car to the first (and only?) [url=http://slashdot.org/article.pl?sid=00/03/29/1644228]Geek Pride Festival[/url]. Closing in on Boston, the roads got wider and wider. Suddenly, I found myself driving on a road that was 4 lanes in each direction. You laugh, but this is daunting for a guy who'd never driven on anything wider than 2 lanes (in each direction), before. I knew to cruise on the right, and pass on the left, but... how do I use those other two lanes? I now live in Montreal, and feel confined when there are only two lanes. (-:

Another parallel is when I learned to drive stick (manual transmission). My first few weeks were quite jumpy... then, my clutch foot smoothed out, and my passengers were relieved.

More food for thought lies in the insurace industry. Now, I'll keep my feelings towards these racketeering slimeballs (mostly) to myself for the purposes of this entry, but they DO do something right: reward experienced drivers (often at the cost of young males, but I digress).

I have a motorcycle license. I had to pass both written and driven tests to be able to ride. Even then, I only qualified for the lower class of bike ( 550cc).

Alright, so what's my point? Simple: new coders are bad at their jobs. I [i]thought[/i] I was good at the time, but I was horrible. I'm better now, but in 2 years, I know I'll look back at this and think about how bad I was 2 years ago. New drivers are also bad.

So, the people who control the roads have put a few safeguards into effect to keep these people from hurting others. First, there's graduated licensing in many parts of the world. When I was 16, I had a 12 month waiting period before I could drive by myself, and even then, I had to maintain a 0.00% blood alcohol level whenever driving.

Insurance companies penalize (or, if you're fluent in [i]marketing[/i], "don't reward") new drivers. My insurance payments are now an order of magnitude lower than when I first started driving.

Trucking companies [i]are[/i] likely to hire newgrad drivers, but this is because their workforce is scarce. They put their better, and more experienced drivers on the most complicated routes. And most taxi drivers I see are well over 30.

Getting offtopic again: New coders are bad. They learn. Some quickly, some not so much. They make mistakes.

So, how do you get around this? Two ways. If you run a small shop, you should ONLY have experienced developers on staff. If your shop is a little bigger, then you can afford (ironically) to pay less to inexperienced devs that can do some grunt work, and get a bit of experience under their belts. Make sure that your [i]good[/i] devs are reviewing their work, though.

You're effectively enforcing "graduated licensing" on your devs. If they have little experience, give them little power.

That said, I firmly believe (and agree with [url=http://blogs.phparch.com/mt/?p=120]Marco[/url]) that it's not PHP's job to enforce this. Just as I would not expect Plymouth to limit my ability to drive my old Reliant K car. There are rules in place at a higher level, and that's [i]GOOD[/i] in my opinion.

PHP is easy, or at least it starts out that way, and then, after a certain threshold, gets more and more complicated, but that's OK. Everything works this way. "Windows" is easy.. but when your registry pukes, it takes guru skills to clean it up (or novice skills to find your XP CD to reinstall). Driving is "easy"... just don't put new drivers in a situation they haven't seen before (whiteout/blizzard, collision, black ice, blinding sun, etc).

The money you save by hiring new grads (without proper mentors/filtering/etc) is often trumped by your exposure to security flaws, bad design, and failure.

[i]A little aside: development shops and otherwise-hiring companies seem to be catching on to this. In the past 3 months, I've had 4 colleagues (former) come to me asking if I know any advanced PHP devs in Montreal who are looking for work... I've made a few suggestions, but most of the [b]GOOD[/b] locals I know are already happily employed. If you live here (or are planning on moving here), and you've got LOTS of PHP experience (more than 3 years), have diverse experience, and are genuinely a good coder, let me know, and I'll try to hook you up.[/i]

S

Steve Gibson on Open Source

You've probably heard about the recent Windows vulnerability in WMF, by now. You might've even heard about Steve Gibson's allegation that Microsoft put this in, intentionally, as a back door.

This interests me, but what interests me more is [url=http://www.grc.com/sn/SN-022.htm]this[/url]:
[quote=Steve Gibson]I'm finding myself gravitating more and more toward open source solutions because of their transparency... An advantage of that is that all kinds of people are looking at the code, and there's just no opportunity, especially when you build the system yourself from source, there's no opportunity for anything evil to get stuck in.[/quote]

I wouldn't have expected this from a hard-line Microsoft and Windows proponent like Gibson. It's no news that the tides are turning.. but maybe... just maybe: they've turned.

S

New Laptop Goodness

So, after much [url=http://blog.phpdoc.info/archives/24-Search-for-the-Perfect-Laptop.html]searching[/url], I think I found the perfect laptop (for the price).

The short: Asus sells a barebone laptop that is missing many key components, allowing the builder to supply his own parts.

I've got [url=http://www.phpdoc.info/gallery2/main.php?g2_view=core.ShowItem&g2_itemId=10]photos online[/url].

The Long:

Wow. What a great machine. I'm incredibly happy with it, so far.
Let's start with the basics.

So, as I mentioned, Asus (the motherboard manufacturer) makes a line of "barebone" laptops. Basically, you choose the model with the screen, platform (Intel or AMD) and other features such as video, that you want.

These laptops seem to be generally for OEMs (companies that want to create their own brand of laptops without becoming a full-fledged manufacturer). Asus makes a number of products in [url=http://usa.asus.com/products2.aspx?l1=5&l2=70]this product line[/url] (the "Z" series.

I ran into a few snags when following this path to laptop freedom. The worst was finding proper information on the Z71V. I found a retailer in Montreal that sells these, but they were clueless (to the point that they assured me that it came with certain features, only to get the laptop home and find it missing an optical drive and the wifi module).

So, let's take a look at the specs:

  • Asus Z71V
  • Screen: WSXGA (1680x1050)
  • Video: NVidia 6600 Go; [s]Video out, multihead capable. 128MB Shared memory (yeah, I know.. I didn't want shared; HOWEVER, it [i]is[/i] on the [url=http://en.wikipedia.org/wiki/PCI_Express]PCI Express[/url] bus, so I'm not nearly as worried about video refreshes hogging bus bandwidth.
  • Speaking of BUS: FSB is 533MHz (which is excellent).
  • CPU (I supplied this myself): Pentium-M 1.86GHz (DOTHAN -- the Z71V has support for SONOMA, but I don't know a whole lot about this, and the DOTHANs were the only CPUs that my retailer had, so I went with that). As I said, FSB is 533MHz, and it's got 2MB of L2 Cache, so it's more than sufficient for my needs.
  • Memory (supplied by me): 1x1GB DDR2 PC4200 RAM -- there's another empty slot under the keyboard: max RAM: 2GB
  • HD (also supplied by me): Hitachi 60GB at 7200RPM -- this disk is FAST
  • CDRW/DVDRom (me): could've gone for the DVD writer, here, but I already have an external one, so no need. This is hot-swappable, so I can eventually buy the (secondary) battery that fills this bay, if I so desire
  • Intel PRO 802.11a/b/g wireless (me) - MiniPCI ; this is installed in the top left corner of the images of the insides, if you're wondering -- the tech at my store did this one for free, so I don't have photos.
  • Ports: 5xUSB (yes, 5), 1 VGA, 1 sVideo (comes with composite adapter), memory card reader (but doesn't take CF, which is what I use in my camera )-: ), 1 PCMCIA, 1 CardBus (I think), built in microphone, Ambient Light Sensor (auto-dims the screen depending on room lighting -- pretty cool). 1 SPDIF/Earphone combo. 1 External Microphone Input; 1 Mini-firewire, Telephone (I'll probably never use the modem). Ethernet (gigabit! (but nothing else on my network is, so this is sort of useless, ATM). And external controls for CD playing (work even when the laptop is "off" which is kind of cool.. but I don't know if I'll actually use them or not).
  • Heat and weight are already noticibly better than the Dell. CPU still measures 55-60C, but the fan/heatpipe are much less noisy, and seem much cooler. The power brick is literally 1/3 the size and weight of the Dell's (but it gets REALLY hot under full load (charge + power).
  • Sound -- Orders of magnitude cleaner than the Dell. I can plug in my Shure E2Cs and hear nothing until music is played. Dell was staticky. Also, pretty cool that it's a SPDIF/Earphone combo jack.
  • Keyboard is larger than the Dell. The tilde is in the right place. It will take some getting used to, but overall, I like it so far. Same for the touchad. It's the same (symaptics), but it's got an additional dedicated vertical scroll area
  • Screen -- as I said, WSXGA (1680x1050) which is more than I wanted, even -- the widescreen is good, I guess.. *shrug*. The screen isn't quite as CLEAR as the Dell, but I'll get used to that in a few days (it's already "better" than it was, side-by-side). It's not drastic, but the Dell's screen was EXTREMELY clear
  • Battery life: well, the 7200 RPM drive hurts me here. It's looking like 2.5-3 hours on a full charge, but I'll need to play with power-saving to see how far I can go. There's also (as mentioned) a place for a second battery (swap out the optical drive)
  • Warranty.. My retailer sold me an additional 2 years on all components. So, I've got 3 on most. RAM is lifetime, etc. -- it's not next-day, in-office, but it's still pretty good.

In summary, I built a machine that's comparably to top-end Thinkpads, and the Acer Ferarri machines, but at (literally) half the price. It took some research on my part, but it was all worth it. Total price, including taxes and warrantees: <$2300 (cad).="" take="" a="" look="" at="" the="" photos.="" pretty="" easy="" to="" do="" this,="" if="" you're="" looking="" something="" similar;="" there's="" also="" an="" [url="http://www.synnex.com/sb/docs/june05/Z71V%20Training.pdf]installation" guide[="">url] (PDF) that I only found AFTER installing the parts -- oops (-:

Overall: I'm very happy with the results.

S

Wikis are not for documentation

Yesterday, I [url=http://marc.theaimsgroup.com/?l=phpdoc&m=111669074409349&w=2]posted a rant[/url] about Docbook, Wikis, and how they're fundamentally different, on the PHP documentation list.

Since the audience of that list is fairly limited, and its participants generally of the same mind, concerning Docbook's virtues, I thought I'd re-post it here for all to see.

I'd like to know your opinion. Especially if you're proficient in Docbook, but disagree with me.
----
There is a recurring idea in the PEAR community that they'll set up a
wiki and fix all of the PEARdoc problems. "Don't worry," they say,
"we'll write a Docbook exporter for our wiki markup."

I am of the opinion that this is simply impossible without comprimising
either 1) Docbook's robustness or 2) Wiki's simplicity

In (1), I think we phpdoc'ers would agree that docbook is robust. It
allows very detailed parsing that allows us to generate things like PDF
and CHM. It allows us to parse the document tree and determine which
extensions exist, constants in said extensions, functions in said
extensions, the prototypes for said functions. Docbook is primarily
focused on meta-data, and while visual markup is considered in meta-data
markup, docbook prefers to remain output-ignorant. Docbook is _not_
what-you-think-is-what-you-get, as Wikis often claim to be. Docbook is
extremely structured, by nature.

In (2), Wikis are known (and consequentially popular) for their
simplicity. Anyone who's tried to create a *||Multi|Column|Table||*
would agree that they're meant for simple markup only (but often have
certain "complicated" functionality). Sure, it would be possible to
implement wiki-specific markup for things like and
&entities; but for each one, additional wiki syntax would need to be
added. Once enough new syntax was added to accomplish similar goals
(robust wiki->docbook conversion), you'd have a toolbox that's no
simpler than docbook. Wikis are unstructured, by nature.

I believe that anyone who REALLY thinks this should be done has never
written a <methodsynopsis> block.

Now, don't get me wrong. I think wikis have a purpose. I even run one
for the doc-folk, but IMO, that purpose is NOT documentation.

Docbook isn't magic; it's just XML. Once you get past the mental block
of "this is hard", it really isn't.

</rant>

S

 1 2 Next →

About

User


Clicky Web Analytics