Log in

No account? Create an account
'Twas brillig, and the slithy toves did gyre and gimble in the wabe [entries|archive|friends|userinfo]

[ website | Beware the Jabberwock... ]
[ deviantArt | the-boggyb ]
[ FanFiction | Torkell ]
[ Tumblr | torkellr ]

[Random links| BBC news | Vulture Central | Slashdot | Dangerous Prototypes | LWN | Raspberry Pi]
[Fellow blogs| a Half Empty Glass | the Broken Cube | The Music Jungle | Please remove your feet | A letter from home]
[Other haunts| Un4seen Developments | Jazz 2 Online | EmuTalk.net | Feng's shui]

November 7th's delayed post [Saturday 8th November 2008 at 12:53 am]

Today's post will have to wait until tomorrow later today: it's taking me longer than I was expecting to knock up a python script as part of the post.

Python scripts should be nice and quick to create. Unfortuantly this does not seem to hold when you add XML into the equation.
Link | Previous Entry | Share | Flag | Next Entry[ 3 pennies | Penny for your thoughts? ]

[User Picture]From: boggyb
Sunday 16th November 2008 at 9:42 pm (UTC)
I did find something called ElementTree, which was a lot easier and more intuitive than the DOM. The downside to it is that it keeps the entire structure in memory, so it's only really usable on small XML files. Works well enough with an Atom feed though.

I've seen JSON in use, and to me it looks, as with all good hacks, like an horrendous abuse of Javascript. Looks like it's got nice potential for security holes as well, if anyone's foolish enough to eval() it server-side without filtering it.
(Reply) (Parent) (Thread)
[User Picture]From: pteppic
Monday 17th November 2008 at 12:53 am (UTC)
JSON's key advantages are it's simple and light. It's noting more really than an associative array passed as a string. Since your server normally isn't running Javascript, passing it a JSON Object is harmless when common sense is applied. Security at ther client *can* be a concern, yes you can use eval(), but best practice says to use the JSON parser, which throws a hissy fit on your behalf if you're doing something you shouldn't be.

It's also got fuck-all overhead, so if you're passing between client and server, you're not sending whopping chunks of data over the pipe.

It's a tool like any other. It has it's advantgaes and disavantages.
(Reply) (Parent) (Thread)