Categories
Blogs Bookmarks Computere og Internet Hackers Kim Blog (English) Open Source Technology

PHP blues – drawing a blank

Software development can be extremely frustrating, and it might be true that the computer only does what you tell it to do, but these days a lot of people, besides yourself, are telling the computer what to do, a fact that complicates matters “somewhat” (understatement of the year).

The following experience documents a case, where I was sure that I wasn’t doing anything wrong, and you could argue that I didn’t, I just didn’t know any better, but thanks to the community I solved the problem.

The setting

I’ve recently begun doing some PHP programming, and I like it a lot, mostly because of all the wonderful community. it’s my gut feeling that I find answers to my questions much faster when I have PHP related questions, compared to .NET questions.

So I was experimenting with generating some XML code from PHP, but when I gave the URL to the W3C validator, it told me that the XML wasn’t well-formed, and that it was the header that was the problem.

I couldn’t see anything wrong, until I took a closer look. There was a mysterious space prefixed the output when I did a View/Source, a space that I for sure knew I didn’t echo. Hmm…

I tried several things, including flushing the output, but nothing helped.

Then it dawned on me: it’s very likely that someone else has had this problem, and if they did, for sure they would have the generosity to share it, so Google to rescue.

I googled: problem php output leading blank, and hit number two yielded this article:

Script for removing blank spaces before and after PHP tags « memento

The solution

It turns out that PHP is quite sensitive if you, by accident, leave prefixed or sufficed blank spaces outside the starting and ending php tags.

So I went through my PHP files, luckily I only have two, made sure there were no leading or trailing blanks og lines, and I get well-formed XML now.

This is a rather annoying bug in, or should I say feature of, PHP, and it exists in both PHP4 and PHP5.

Once again the community came through, without it I’d still be drawing blanks.

And I love the drawing on the memento site, it doesn’t get geekier, and I think I’ll remember to strip leading and trailing blanks now.

I’m still looking for a modern development environment for PHP development (e.g. sourcecode debugging). PHPEclipse, a plug-in for the Eclipse development environment, should provide a relatively modern development environment, even though it’s not up to the standards set by Microsoft VisualStudio, that I’m so accustomed to, Microsoft has spoiled me.

Categories
Blogs Bookmarks Computere og Internet Hackers Historier/Stories Kim Blog (English) Open Source Resources Technology

BarCampCopenhagen: Ça plane pour nous!

BarCampCopenhagen Logo
BarCamp wiki / BarCampCopenhagen

Ça plane pour nous! …. Ça plane pour nous! … Ça plane pour nous! … Ça plane pour nous! Nous! Nous! Nous! Nous! Ça plane pour nous! uh-u-u-uh! Ça plane pour nous!

I går holdt 3/4 af folkene bag den næste BarCampCopenhagen, planlægningsmøde.

Planlægningsmødet var rigtig hyggeligt (som videoen vist viser) og hvis i kigger derovre, så er der bonus: det var nemlig også produktivt (som det faktum, at vi “sådan set” er klar, viser).

Først og fremmest fik vi lagt skinnerne, i form af to højglanspolerede spor, der kommer til at hedde:

  • Geeky sh*t
  • Kangagoo?

Temaet for de to spor bliver hhv. et teknisk (Geeky sh*t) og et ikke-teknisk spor (Kangaroo?). Emytlogien for Geeky sh*t skal findes i den forrige BarCampCopenhagen, for Kangaroo? Siger jeg: FGI!

Hvis du vil “svæve” med os, så sig til! Vi har plads til i alt 50, og det tal nærmer vi os, hvilket vi er benovede over – TAK for interessen.

Ellers har vi brug for stole, sponsorer (mad, drikkevarer, t-shirts, wi-fi udstyr, gaver) og talere (vi er sådan ca. halvt besat).

Næste BarCampCopenhagen afholdes den 25-januar-2008 hos Beaconware, Gl. Kalkbrænderivej 10, kld. 2100 kbh Ø. BarCampCopenhagen afholdes i overensstemmelse med retningslinjerne for afholdelse af en BarCamp, men sådan generelt er de:

The Rules of Bar Camp

  • 1st Rule: You do talk about Bar Camp.
  • 2nd Rule: You do blog about Bar Camp.
  • 3rd Rule: If you want to present, you must write your topic and name in a presentation slot.
  • 4th Rule: Only three word intros.
  • 5th Rule: As many presentations at a time as facilities allow for.
  • 6th Rule: No pre-scheduled presentations, no tourists.
  • 7th Rule: Presentations will go on as long as they have to or until they run into another presentation slot.
  • 8th Rule: If this is your first time at BarCamp, you HAVE to present. (Ok, you don’t really HAVE to, but try to find someone to present with, or at least ask questions and be an interactive participant.)

by Tantek Çelik as parodied from The Rules of Fight Club.

Categories
Blogs Computere og Internet Hackers Kim Blog (English) Open Source Technology

Drupal:Reloaded: Upon this “rock” I will build my “church”

Drupal.OrgAfter a while being away from Drupal CMS, and struggling with a, IMHO, buggy version 5.0 earlier this year, I’ve come back to visit this old friend, and I’m very happy to be back.

Firstly: I must say that the current version 5.3 of Drupal is rock solid, and that I have renewed confidence in Drupal.

My revisiting Drupal has, in part, been sparked by a rather depressing talk on the Drupal Denmark mailing list. The community seemed to be withering away, and I was sad to hear that.

Personally I’m back from a long break from ICT work, and I think that I did a fair share of volunteer work, while we were trying to set up the group last year.

Another reason I’m back, is that I have a number of web-projects coming up, and I’ve long considered making Drupal the foundation of a majority of my future web projects, you might not notice, since my projects, most likely, won’t look much like Drupal.

You might also want to check my del.icio.us links tagged with Drupal, I’m currently looking into integration issues, but I’ll also be sharing module recommendations, and I’ll, most likely, contribute localisation files back to the community – it’s good to be back.

Drupal: Upon this “rock” I will build my “church”

Categories
'i dag' (Danish) Blogs Hackers Historier/Stories Humor Manic Panic

Ward drive? Been there, done that!

Kim Bach کیم پاک:
Det er pokkers…jeg har ideerne, ved stort set hvordan alt skal laves, jeg har bare ikke energien
Det er da mega frustrerende at vi sidder i hver vores hjørne af verden og spilder MASSER af tid

Jamen, Kim.. Det er bare om at udnytte al din viden! Med mine evner til at stille spørgsmål og dine evner til at svare – hvem ved … en kur mod kræft er måske målet..

Kim Bach کیم پاک:
Kan nøjes med Warp drive
(og du ved godt at de kodnings spørgsmål du stiller er sådan < 101 niveau )

Ja, I know.. Sorry..
Jeg ved godt at jeg ikke ligefrem udfordrer dig..
Men jeg lover at vi sigter efter ward drive næste gang..

Kim Bach کیم پاک:
Ward drive? been there done that LOL
Det endte med at jeg “lånte” nogle penge til en pige der påstod at hun havde været Side 9 pige og på forsiden af V-MAX
Oh well hun skrev i min “poesi-bog” så noget fik jeg da ud af det

Categories
Blogs Hackers Historier/Stories IT Guruer Kim Blog (English) Photography Rumforskning Videnskab

Happy birthday dear Sputnik, Space Ship One, FSF, Russian democracy and brother dearest

The famous Earthrise pictureI’m so envious my dear brother, this day October 4th – your birthday – seems to coincide with one of the most important days in modern civilisation, a day that has importance for exploration of space, as well as important steps in the history of human thought and the move towards true democracy.

Today, October 4th 2007, it’s 50 years since the first man made satellite, Sputnik 1, was launched, and the world was changed almost overnight. 12 years later man had already walked on the moon

The first stage of the race towards space, has to be one of the single most impressive feats of human kind in history, really on a par with the building of the Pyramids.

Building of Pyramids was, like the space program, put on hold – it was just not efficient, even though the monument still stand, in the form of immense launch facilities at Kennedy Space Centre, it was only really a demonstration of power, and funding had to be cut, or else it could have ruined the economy, like continued pyramid building could have done to Egypt

Flash forward 47 years, three years ago, the era of real space exploration of space was ushered in, with the successful flight of SpaceShipOne, the first commercially developed vehicle, capable of reaching space.

So happy birthday to you all, and humanity for giving us the inspiration to do the impossible, which is escaping this cosy spaceship we’re all living in, or should I say on, the spaceship called Earth.

ps. I also found out that today marks the 23rd anniversary of establishment of The Free Software Foundation (FSF) by Richard Stallman. FSF and the thoughts behind it is slowly changing the mindset of people, and is the foundation of the current explosion in true knowledge sharing. Today also marks the 14 anniversary of the failed attempt by the Soviet military to stop the move towards democracy – October 4th truly is a historic day.

pps. If I had the energy to do so, I’d love to have made a picture showing the faces of Sergei Korolev, Burt Rutan, Paul Allen, Richard Branson, Richard Stallman, Boris Yeltsin and my brother René, to accompany this article – sorry but you have to make that – mentally – yourself.

Instead I’m showing one of the most important pictures of mankind, the “Earthrise” picture taken by Apollo 8, just a little over 11 years after the Sputnik 1 launch.

“We close with good night, good luck, a Merry Christmas, and God bless all of you — all of you on the good Earth.”

Categories
Blogs Computere og Internet Design Education/Undervisning Hackers Kim Blog (English) Music Technology Undervisning Videnskab

Show your love for science – Science After Dark @ City Hall Square

Researchers Night LogoFriday I went to the Science Fair – dubbed Science After Dark – that was held at Copenhagen City Hall Square (Københavns Rådhusplads), and I enjoyed it very much. I didn’t really know what to expect, but when I read that there would be live electronic music, I knew that I was going.

The first thing i noticed was that attendance, despite the location, was disappointingly low. I feel that it was because the venue looked quite uninviting, due to the fence, and the rather closed looking pavilions.

I also got the feeling that the PR for the Science Fair had been less than satisfactory.

ConDio – Controlling Audio

ConDio - Controlling Audio at RådhuspladsenAnyway, the first thing that grasped my eye was the ConDio, Controlling Audio. The ConDio is a device with which you can control the playback of sound, simply by moving physical bricks around on a table surface. The ConDio uses pattern recognition to determine the position of the different blocks, which translates into a specific function, for instance one brick changes the track that is being played, others applies filters.

It’s remarkably simple, efficient and intuitive to control a computer in this fashion, and it was a real crowd puller.

The ConDio has been developed by the medialogy branch of the University of Aalborg, and It was really great talking to the students that were responsible for the project. They were really feeding from the enthusiasm of the people that were looking at it.

I’m really envious that the students of today get to play with technology like this, to quote Haladjjan, the founder of Violet (manufacturer of the Nabaztag intelligent WiFi bunny):

“le début de l’internet a été une aimable kermesse… Maintenant les choses sérieuses commencent” – (translation: “the beginning of the Internet has been a friendly festival…Now the serious stuff begins”.

What a great time in history to be alive in.

Kim Bach – The failed scientist

I also enjoyed visiting the Bio Chemistry tent, where I had a discussion about how to bring science to the public (“videnskabs formidling”). The scientist in charge asked me it I’ve heard about Jens Martin Knudsen – and the regular reader would know that I just posted a tribute to him – we need more like him – since he was able to bring across complicated matters in lay-mans terms – we also discussed the great Richard Dawkins.

What I really hope is that someone could take up the reins from Jens Martin Knudsen, because we need those positive role-models from the scientific community to teach us the importance of understanding our world.

I also had a chance to redeem myself. I label my self a “failed scientist”. I’m really a product of the inspiration of the space program and the lunar missions, and when I was a kid, I desperately wanted to become a scientist – but “something” happened along the way – and it’s too complicated to talk about here – but I basically got fed up with boring educational system.

But it does seem like I have some basic scientific intuition, and I got some high marks from “the teacher” for thinking like a scientist, when I was observing the strange creature the Daphnia.

It was also interesting talking to the students from the Nano technology line. They’re looking into how to produce solar arrays that are less harsh on the environment, it turns out that you can use fruit juice from black berries as the base of a solar cell, instead of silicon – amazing.

Bend my circuits

But what I really enjoyed the most, was the tent dedicated to audio, which also included live performances from Dødskuglen, Rumpistol and Bjørn Svin (who I missed).

In the tent some interesting and simple demonstrators were set up, one was a Theremin that was controlled by a plant. You could actually play music by touching the leaves of the plant – very entertaining. Another was a tube with a number of nozzles from which gas could escape, and be lit, if you then played music, the sound-waves would modulate the flames – Daft Punk’s Robot Rock looked quite good “going up in flames”.

Dødskuglen plays with circuit bending, and they had gutted a lot of electronics with audio capabilities, for instance a couple of Furbys, that now looked – and sounded – like mean birds, and when you hooked them up to a keyboard, they were capable of making some wonderful noise.

Dødskuglen has their name from a dome shaped device, that is the center-piece of their show. According to them it’s filled with gutted electronics from Happy Meals and the like – I’m not surprised.

We also got a live demonstration of how to circuit bend – don’t try this at home – you might hit the AC power-supply and die – but if you’re careful, just take a cheap electronic keyboard apart, and try to apply some wire patches live – it was amazing to hear how the standard drum-machine suddenly went into a completely different state, and sounded completely different, only to return to it’s standard loop after being reset.

Kim Bach – The failed musician

After Dødskuglen, Rumpistol took the stage, and he’s using his computer in combination with analogue synthesisers to produce great electronica.

Besides being a failed scientist, I also consider myself a failed musician, but with the simple technology being showcased here, that is so much more fun and intuitive to control than a traditional instrument, I might be able to express myself – I know that I have some music in my head – maybe I can finally make some music – I know that I want a copy of the guitar simulator for the Nintendo DS called Jam Sessions.

A child’s mind

There’s a strange unifying synergy between science and music. When doing science and music, you really need to have a child’s mind, and like to play. That’s something I still, I’d say increasingly, possess – so I might still become a scientist/musician. It’s also noteworthy that a number of my heroes for instance RMS (Richard Stallman) and N (Peter Naur), actually play music themselves.

I went home after having had a great time, with renewed faith in our educational system, it seems to be producing playful scientists – I wished someone had told me that science was about playing, when I was a student.

I hope that Science After Dark will become a recurring event.

Show your <3 for science – make some NOIIIIISSSSSEEEEE!!!

I did, however, hear some rumours the Science After Dark has been frowned upon from the established scientific community. Come down from your ivory towers, Science is FUN and NOISY. Show your <3 for Science – make some NOIIIIISSSSSEEEEE!!!

Categories
Blogs Computere og Internet Education/Undervisning Hackers Historier/Stories Kim Blog (English) Mactopia Open Source Technology

Bad Penguin: “Linux – The OS I’ll – eventually – wear”: Kim Bach – still Mac user :-(

Bad PenguinClick here for the most popular videos

So I thought that Linux was ready for prime time, but not just yet – it was hurting my productivity too much :-(. I need some help setting my system up, and will attempt to get that when I soon will attend LinuxParty in Roskilde.

It did make for a couple of interesting Jaiku presense stream though (Kim Bach: Former Mac user and Installing Ubuntu on my new Lenovo V100 – Firefox on WiFi from the Live CD while my drive partitions. Have I died and gone to heaven?.

Performance of the applications is really great though, and I hit on one of the biggest obstacles, non-functioning DVD playback due to patent issues – really amazing that the International anti-thrust organisations haven’t looked into that :-(.

I hope to return to the Linux world soon, Ubuntu keeps improving

But the future really lies in simpler technology, and “the puck” is moving elsewhere than the monolithic computer. My mobile is increasingly my primary Internet access terminal, and Apple might just have got it right with the iPhone. The iPhone is actually much more Linux than people realise, it’s powered by FreeBSD and contains source code form from several open source projects, most noticeably KHTML which is the basis for the Safari browser.

Categories
Blogs Education/Undervisning Hackers Historier/Stories Kim Blog (English) Photography

“Angels” and “Demons” are lurking in your web-mail – kim.bach invites you to join Zorpia

Kim Bach: Pilgrim with an auraAccept my sincere apologies for spamming you with Zorpia invites

Zorpia is a spam-trap, so please DON’T register with the service.

I know that you used to trust me, but you shouldn’t trust me this time. Zopia are terrible people, but sometimes good things come from bad, so:

Categories
Blogs Bookmarks Computere og Internet Hackers Historier/Stories Humor Kim Blog (English) Technology Undervisning Videnskab

ICT Mythbusters part one: 640K should be enough for everyone! Not exactly! But how much do we need?

Banner Mb-Cafepress

Welcome to ICT Mythbusters Episode One – who needs prequels, start your numbering scheme at one!

ICT Mythbusters is inspired by the great Discovery show Mythbusters

It’s also premiering a new concept in advertising that will revolutionise it:

Commercials that the host – in this case me – don’t make any money from, so click the banner and support the REAL Mythbusters, if you want to me support, send me some money ;-).

Was Bill Gates wrong?

A very famous quote from Bill Gates is:

640KB of RAM should be enough for everyone

Everybody has been laughing at that statement, but was he actually right?

I can access the web in high-fidelity from my Nintendo DS, and any modern phone with Java ME can run the Opera mini browser, and these phones rarely have more than 1MB of RAM. I’d say that approximately 4MB should be enough for everyone.

So Bill Gates was right, or? Why is it that he wasn’t? It’s of course because we’ve moved our storage to the server, as a college of mine was so friendly to point out – actually I think he was quite annoyed with me – but that’s only because he didn’t understand what I meant.

The desktop and portable computer is an anachronism, as I’ve written before, and we need to move ALL the storage to the server – where it belongs, and run only thin clients. VERY thin clients would actually suffice for something like 90+ percent of the worlds business users.

So yes my college is right, yes 640K isn’t enough for everyone, neither is 4MB, but how much is then?

And we’re talking server storage, to cater to the computing needs of the entire world, at the time, not considering the more than exponential growth we’re likely to se in the future.

Help me do the math, or should I just submit it to Jamie, Adam, Toby, Grant and the red-hot Kari.

Categories
Blogs Education/Undervisning Frivillig arbejde Hackers Historier/Stories Kim Blog (English) Kunst NGOs Open Source Resources Technology Undervisning Videnskab

Your “Pyramid” is beautiful, but we’ve just invented the “Arch”

Balancing the Pyramid of KhefrenSo you thought you could build an economy on other peoples work, and even have the audacity to charge them (that is us) for it!!!

Well! You have your “Pyramid” – and it’s beautiful – unfortunately for you we‘ve just invented the “Arch”.

So Google will remain a fantastic monument, but we‘re building the Aqueducts, Viaducts and last but not least the beautiful temples.

And how come Google and all the other search engines, seems to ignore the copyright all together? No let’s boycott Google, and ask to be delisted, or have them block commericals.

So let’s put Google and all the SEO “creeps” out of business, and get rid of the commercial search engine, “itsy bitsy spider, walk along the web” – it’s not that hard to build a better google than google. Where we’re going we don’t need Google.

Civilisation has just gone out of beta!