Subscribe RSS

Archive for the Category "Geeklife"

PHP question Feb 16

Apologies for the complete geekery of this post.

I have some data in a file and I would like to manipulate it using PHP to produce an HTML output. Not being very familiar with file-handling, can anyone suggest how I get the data into a usable form?

The input file contains (almost) fixed width data in the form:

texttexttexttexttext #####
textext  ###
texttextext ###

where texttexttext is a string and #### is a number.

I’d like to import the file into a two-dimensional array, the first part containing the text (trimmed of spaces to the right), with the second containing the number (with any whitespace either side trimmed). The text field is 60 wide and the number field is 8 wide.

Does anyone have any handy code to do this, please? I’ve had a Google and can’t find what I’m after. It’s not so much the trimming as getting the two bits of data into different parts of the array. Thanks.

 | 7 Comments
Sad news Feb 10

Sad news from Digital Spy: Amstell and Oliver quit C4’s Popworld. Who will make stuck-up “celebs” look foolish now? Apart from Celebrity Big Brother, obviously…

 | 3 Comments
Back in the twentieth century Feb 09

This time last month, I was without a TV and a fridge. Now I have a new TV, a new fridge, and, as of today and after a bit of hassle, broadband. I feel almost modern.

The advent of high-speed internet access may mean a bit more blogging too.

Mememememe Feb 02

Stephen and Jonathan have tagged me with this. By filling it in, I become an Adherent of the Repeated Meme.

I keep changing my mind on some of the answers. Best to post, I think, or I’ll just keep amending them…

7 THINGS TO DO BEFORE I DIE

  1. Run a marathon, but I would die. So: lose weight
  2. Work on a US presidential election campaign
  3. Get some more pre- or post-nominal letters
  4. Own every DVD in the world ever
  5. Write a book. Have written a book.
  6. Win big on Who Wants To Be A Millionnaire?
  7. Make a humourous video will

7 THINGS I CANNOT DO

  1. Turn back time
  2. Exercise
  3. Write for toffee
  4. Shop for shoes
  5. Roll my “R”s
  6. Quit smoking (by definition; I thought about taking it up because they say quitting is good for your health)
  7. Repress my facetiousness

7 THINGS THAT ATTRACT ME TO… LONDON

  1. Friends
  2. Clubs (of the musical variety, for the music)
  3. Public transport
  4. Genealogical sources and museums
  5. The sheer variety of stuff
  6. Gossip on the Underground
  7. Never having lived there

THINGS I OFTEN SAY

  1. “I think…”
  2. “What’s the word…?”
  3. “Then again…”
  4. “Sorry?”
  5. “Peoples of the universe, please attend carefully…”
  6. “Is there anything on TV?”
  7. “Cheerio”

7 BOOKS THAT I LOVE
Hmm. There are plenty of books I enjoyed at the time, but none that I read over and over. Whereas…
7 TV SERIES THAT I LOVE (and there are so many more)

  1. Doctor Who
  2. The West Wing
  3. The Simpsons
  4. The Avengers
  5. Columbo
  6. The Smoking Room
  7. Yes, (Prime) Minister

7 MOVIES I WATCH OVER AND OVER AGAIN

  1. Sleuth (“A jumped-up a pantry boy who doesn’t know his place!”
  2. Clue
  3. (“I’m gonna go home and sleep with my wife!”)

  4. Murder by Death (“Oh, that’s tacky. That’s really tacky.”)
  5. Psycho (“You eat like a bird.”)
  6. The Thomas Crown Affair remake (“She keeps an apartment. I keep goldfish.”)
  7. Back to the Future (“Where we’re going we don’t need roads!”)
  8. The Wicker Man (“The landlord’s daughter!”)

7 PEOPLE I WANT TO JOIN IN TOO
Apologies in advance if this is beneath your serious blogs 🙂

  1. Mr Barlow
  2. Mr Simon
  3. Mr Foster
  4. The boy Fenwick
  5. Mr Graham
  6. Mr Cullen
  7. Mr Biscit
 | 6 Comments