This might be of use to someone

I’ve been writing PHP for a long time now. And one of the things that I see quite often is that people just dont get multidimensional arrays, and how to effectively store data in them for looping. Allow me to lead by example.

  • $store[‘fruit’][‘apple’]=3;
  • $store[‘fruit’][‘orange’]=1;
  • $store[‘berries’][‘blueberries’]=100;
  • $store[‘berries’][‘strawberries’]=100;
  • $store[‘fruit’][‘mango’]=5;
  • foreach ( $store as $type => $val ) {
    • foreach ( $val as $name => $qty ) {
      • echo “We have {$qty} {$name} ({$type} are good for you)rn”;
    • }
  • }

of course where the array comes from and what you do with it are completely optional. But it’s important to know that the array indexes should be as informational as the array values. Otherwise you arent using arrays properly.

Blogging some links and comments

Freespire? worth thinking about. From what I’ve been told by people who’ve used it it’s a really nice OS. I wouldn’t run any servers with it, but I might give it a good try for an oldish desktop which could use a faster browser 😀 (I dont actually know if linspire browses faster than, say, XP, but it’s a decent bet)

Save the internet I wonder if anyone on the internet besides bloggers are political enough to *do* it?

note to self: read more about google calendar I have a hobby project going on that I’m thinking about using google calendar for… I’ll need to remember to read this…

speaking of politics Since I’m “growing up” (and stuff) I constantly tell myself that I should be more aware than I am about the local and global politics shaping my world… I’ve held off as long as I could, but it feels more and more like it’s time to jump in and get my feet wet… I dont know enough to do anything but make an ass out of myself, but a 3rd (major) party doesnt sound like a bad idea IMHO.

Web 2.0 getting boring? Web 2.0 should never have been *overly* exciting to anyone with a truly analytical head in the first place. It’s the natural progression. However I’m sure we’ll see the same post about this length of time after web 3.0 (which wont be called that i’m sure)… all things fade..

Scott McNealy no longer sun’s CEO I stood in a room of about 12 people once while this guy talked. He was a fairly funny guy.

speaking of getting excited about web 2.0 This is something being done which is fairly cool… It’s not pushing at any new walls, but I think it’s a good push… and I’m glad to see us re-exporing our boundaries as technology evolves. d@rw1n? hah!

no peace for the dead, even the REALLY dead…

This is, hopefully, good news as the people who write the programs that those little bastard script kiddies use are getting more and more intelligent…

The shawshank redemption

On Sunday I got (sort of) a day(ish) alone at home while My wife was visiting the central valley. So I dusted off my tried and true favorite alone-time movie: The Shawshank Redemption. I dont know whnat it is about this movie, but somehow I identify with it on a very deep and moving level. I always find myself almost crying at the end (along with several points inside the actual movie itself)…
Hey… like my wife says… I’m wierd…

Apache is hurt

My baby girl kitty is hurt. We dont know what happened to her but she’s definately hurt her shoulder. She isnt purring anymore, and she doesnt want to eat (or presumably drink) hopefully she’s feeling a little better tomorrow. We’re going to keep a close eyhe on her tonight and tomorrow, and keep her quarantined inside the house. She has a vet visit on Wed. But if shes really hurt we’ll end up taking her in tomorrow… Everyone send good vibrations her way. shes the sweetest bestest kitty of all kitties everywhere.

Digital images have fingerprints (news to me, didnt know they had fingers, or hands…)

Whoa! Digital photographic fingerprints! Neat!

Who’d have thought that the forces of entropy were *against* the idea of anonymnity 😀 Entropy 1, Privacy 0! I wonder how long it’ll take for them to adapt this to digital video as well. Theoretically you would also see a uniform variation even when the background image was changing. Like having a cobweb on your TV.
A comic take (pun intended):

MOM! Kodak left fingerprints all over my images… and Cannon left the toilet seat up again!

I guess all those young pervs will have to stop taking candid shots of their sisters 😉

DK

Saw Silent Hill tonight

I thought the movie was VERY good. There were parts which were a bit too gory… but it was a horror movie. All in all it’s the best horror movie I’ve seen in a long time. I recommend it.

What I dont recommend is going and seeing the movie with the 8 people who randomly sat in front of us. Every 30 seconds it was f**** this/that or oh f**** or sh** or any number of other curse words… annoying to say the least. Once we got the manager in to talk to them, though, they quieted down and my Wife and I got to enjoy the last 3/4 of the movie in peace.

Cheers

DK

The brain is an amazing thing

It’s really amazing, when you stop to think about it. Try this little experiment: Go for a drive and spot all the traffic signs that you can find.

First, notice how long after you looked at each sign it took for your brain to realize it was a traffic sign. I bet that each recognition took an amount of time so small as tobe nearly unmeasurable.

Second, notice how many signs you saw. Different sizes, shapes, colors, words, meanings.

The point of this experiment is to bring a stark appreciation to the amount of data that you can process, visually, as well as the speed with which you store and retrieve dat. It’s truly amazing that you can distinguis these different objects, which have nothing physical in common just an abstract meaning and so readily classify them.

If you are still looking at me blankly, try this: write down a set of instructions that a 2 year old could follow to determine whether anything visual is a traffic sign in any condition. Just try and account for Stop, Yeild, Street Name, No parking, Carpool, Highway migh markers, no stopping, no parking, u turn, no u turn, right turn only, and those signs which are painted on the ground which are innevitably half covered in rubber… You begin to see the complexity of the situation now? Begin to appreciate how easily your brain can classify such data so readily?

It’s really quite fantastic!