2009-02-23

Thinking about summer HAR 2009

I've just read news about Hacking At Random 2009 event at 13 - 16 August 2009 in Holland. It's tempting proposition of spending some summer time in interesting and fun way. It's second after Chaos Communication Camp big European "camping and technology" event, full of interesting people. I have to rethink my summer time priorities and decide to go there or not.

Anybody is going there?

2009-02-16

Improve PHP application performance using opcode cacher and optimizer

One of university underpowered server cought "hiccup problems" during students rush at local Learning Management System (leading PHP LMS platform) during the end of semester. Because there was no chance for quick hardware upgrade I've checked server tuning check list again. Many basic settings was optimized (caches, all additional modules turned off etc.), but there was still room for small improvements. The big problem was memory limit under high load.

I've installed XCache PHP opcode cacher (they say it's production ready), and set it to cache most of common used code in RAM. Results was better than I suspected, maybe because of that application is utilizing a lot of PHP code. Under heavy load memory usage dropped about 3 times, the same gain factor was for CPU usage. I've checked if everything works ok and left it working with XCache then.

The next bottlenecks were database and CPU usage for some operations. It's hard to get further performance improvements of that scale without tweaking application code.

2009-02-11

Good SF book - Permutation City by Greg Egan

I have finished reading Greg Egan's "Permutation City" novel published in 1994. It's full of interesting ideas I liked or worked on in some way in past. You can find there consciousness simulation, AI living in VR, and other theories like cellular automatas and artificial evolution. The novel story is based on many fictional and unrealistic assumptions but the whole idea of creating computed simulation of an embedded then detached universe is very mind appealing.

The first kind of ideas in scientific world came from Konrad Zuse that proposed idea of universe computed on a computer grid. It's very strong paradigm shift of viewing our universe. Taking quantun effects and last popped popular theories like holographic principle, give me very strange feeling.

At the end read a xkcd comic with a twisted idea


Update:
Another research covering that area. Check the controversial but interesting theory by Stephen Wolfram.

2009-02-02

Using simple drawing tools to unlock creativity

One day I have played with my kid's sketch pad toy. It's about 15 inches diagonal - almost like smaller PC monitor or laptop screen size. After drawing funny pictures I started to draw and solve some of my work problems. It was astonishing easy to work in that way, and soon I get simple solutions. I realized it is really good device to unlock creative possibilities.

I rethinked that again and spot some interesting factors that helped me to enter into that state:
  • playing mood (it's almost as important as all other factors together)
  • everything you draw or write is temporary, unless you try to save it in some way, otherwise you make one sweep and you have clear area ready for new ideas
  • comfortable drawing with pen and handwriting unlocks physical obstacles slowing your work (like using keyboard)
  • all factors shorten interaction on path brain - drawing surface
  • the next similar tool is notepad with pen - loosing some of the play joyfulness


If we could transfer those features to laptop.. wait a minute there are laptops- tablet PCs! I've never used one but I'm really interested if is it as easy to work as simple sketch pad or notepad.

2009-01-26

How to export data to one big XML file


My company had to add extra export format for data in a system I'm working on. I get specification and XML schema and started analyzing it for best fast solution. Data was ready to export so there left decision about choosing right way to make XML. Deadline was imminent, and everybody was really busy at work. Making export file - was good task for our newest programmer. He never parsed/created XML using SAX/DOM or other libraries, but was envy to use and learn one of the standard.

The main technological problem was the size of output XML. For biggest data case it would generate over 500MB XML with about 50000 nodes at highest level. It would be efficiently generated using only writing partially to stream technique like SAX. I have chose two options- use SAX or own similar simple API - realization time was crucial. Because XML structure was relatively easy - all tags without attributes, so we decided to use plain string buffer technique with addition of couple helper functions.

At the beginning I had objections about not using standard libraries that should help. But the implementation of XML format moved forwards, output file was easy to validate with XML schema. The most time was committed to handle non existing or incomplete data cases. The export function was ready before time. That is one of examples where using simplest tools, meets desired goal.

What are your choices in similar situation?