Archive for January, 2009

Using a linear array as a bidimensional matrix

Tuesday, January 27th, 2009

Often times I find the need to use a list or linear array as if it was a table.

Everytime I need to do so, I always end up coding functions to convert a (x,y) coordinate to the real index n in the array.

Let me illustrate, with an example. You have a string that defines the elements of a game board, and you want to work using (x,y) coordinates.

s="xxxxx@xx@xxx@@xx"

If you were to look at it as a matrix (width=4), it’d be something like this

s="xxxx
   x@xx
   @xxx
   @@xx"

However, I can’t do
s[x,y], since it’s a linear array, it’s a string.

You need to convert from (x,y) to a number that represents an index in the array.

This is very simple:

width=4
def getNforXY(x,y):
  return x + width*y

What if you want to do it backwards. What if you need to know what’s the X and Y for a given index N in the string?

def getXYforN(n):
  y = int(n/width)
  x = n - width/y
  return (x,y)

Cheers

Jack Bauer: “HE DID WHAT???”:

Friday, January 23rd, 2009

My first attempt at a political satire using some fiction. Obama always reminded me of President Palmer on 24. The future release of a bunch of uncertain status prisoners in Guantanamo reminds me of Jack Bauer going through hell, doing a lot of illegal shit to catch the bad guys, and then they’ll get released, they’ll say they were put in there ilegally and they will be back outside more pissed than ever.

Unsigned band breaks into top 20 most shared music on the planet

Wednesday, January 21st, 2009

From Georgia Wonder:

London, UK: Georgia Wonder, an unsigned British band, climbed into the top 20 most shared music in the world last weekend, reaching 14th position in just four days with their debut EP ‘Hello Stranger’.

The EP was put onto the Pirate Bay tracker on Wednesday 14th January and by Saturday 17th was the only music in the top 100 from an unsigned artist. The EP of five songs, which the duo released themselves last year, hit the Pirate Bay Top 20 on Saturday evening and peaked at the 14th position in the early hours of Sunday morning. The Pirate Bay is the worlds largest tracker of shared files.

The band were able to propel their music into well over 50,000 homes across the world in just a few days after making their EP readily available to download from the welcome page of the Limewire software offshoot ‘Frostwire’.

“What Frostwire helped us achieve is incredible” explained Stephanie Grant, vocalist with Georgia Wonder. “Their support has put our music into the hands of tens of thousands of potential fans in a matter of days. 40 billion songs were shared online last year – that’s 6 songs for every person on earth. You can imagine what just five days in the top 20 means to a relatively unknown band like us.”

“We met the Frostwire guys on Twitter” said Julian Moore, the other half of Georgia Wonder. “I’d recently dusted off our Twitter account after hearing that British celebrities such as Jonathan Ross and Stephen Fry had become avid users, and after a few weeks we got chatting to the Frostwire team. They were really keen to let us try their new approach to band promotion and as we were already letting people share our music on Twitter we agreed to give it a shot. I’m so glad we did!’

Pirate Bay, the world’s largest BitTorrent tracker has repelled many unsuccessful attempts to shut it down over the last few years including a police raid in 2006 and bitter disputes with a variety of music and media companies in 2007. “It’s easy to forget that while the major record labels and anti-copyright groups have been taking high-profile shots at each other there are a lot of independent artists out here who are simply trying to navigate their way through the wreckage” said Julian. “Our success with Frostwire proves that you can cut through the argument and chart your own course.”

About Georgia Wonder

Georgia Wonder played in front of over 14,000 people for Simply Red frontman Mick Hucknall on his UK tour and performed at an historic election night at the London American Embassy alongside Glenn Tilbrook from Squeeze. Their song ‘Girl You Never Knew’ from their debut EP ‘Hello Stranger’ has been on rotation on Bliss TV for six months and has received plaudits from Record Of The Day and Pop Justice who called it ‘..one Grey’s Anatomy soundtrack appearance away from being an international hit single.’ They were recently nominated for an interactive award at Eurosonic and won best video in the rock category on OurStage.com in November ’08 for their song ‘Would Love To Meet’. Originally picked up by legendary BBC presenter ‘whispering’ Bob Harris who played their demos for two concurrent weeks on his BBC Radio 2 show, they have performed live on BBC Southern Counties, BBC Radio Solent, Original FM and a host of other regional radio stations.

–ENDS–

Contact

Julian Moore
julian at gwonder dot com

References
Pirate Bay Snapshot 18/1/09

40 Billion Songs Shared Online

Links

Georgia Wonder Website

Frostwire

‘Hello Stranger’ EP Torrent on Pirate Bay

Reviews

Record Of The Day

Record Of The Day – Record Of The Week

Pop Justice – Song Of The Day

Georgia Wonder sails to the pirate bay’s top 20 in 4 days

Sunday, January 18th, 2009

Here’s a screen capture of the Georgia Wonder’s Twitter update in regards to the promotion they did with FrostWire and FrostClick.

Georgia wonder twitters about their sucess with the FrostWire Promotion

They decided to share their EP, “Hello Stranger” for free via FrostWire. Their torrent has reached the Top 20 most shared music torrents of The Pirate Bay in only 4 days.

Britney Breaks the ice with Anime Fans

Tuesday, January 13th, 2009

A little too many references to Matrix, but it’s pretty cool. Seems like it’s part one of more to come.
<a href="http://www.joost.com/1359x0r/t/Britney-Spears-Break-The-Ice">Britney Spears &#8211; Break The Ice</a>

Remaining Questions about Palm’s Pre and it’s WebOS

Tuesday, January 13th, 2009

It was an impressive presentation the one Palm gave about it’s new product, but there are still many things they didn’t mention:

  • Battery life? It’s cool that it has a removable battery, but how long does it last?
  • What can we build on it? They mentioned HTML, CSS and Javascript as the tools of the trade, but if their JS interpreter doesn’t give us namespaces or global access to built in functions to access core functionality of the phone, there won’t be nothing more than a bunch of web widgets available. There was no mention whatsoever of games for this platform, maybe they’re going after the blackberry crowd and not the iPhone crowd
  • How do developers distribute apps? I didn’t like the whole Sprint Exclusive crap, give us a palm-pre store!
  • Flash Support?
  • No demo of the camera, can it do video, no demo whatsoever of multimedia so far
  • No demo of the device making a phone call

Not sure if those are things that we should take for granted, or that the device still has a long way to go.