Tag system similar to that of Flickr

I needed this code for a "tag system" I was making. Something like when entering tags for an image on Flickr. It extracts all the words and keeps quoted phrases together.

[php code]
$pattern = '#"([^"]+)"|([^"\' ,]+)|\'([^\']+)\'#';
preg_match_all($pattern, $string, $matches);

foreach ($matches[0] as $tag)
{
    echo $tag . "
"; } [/php code]

Getting SqeezeServer to work on Ubuntu

Since I am using mysql v5.1 I got the following error when trying to install the deb package I downloaded from http://www.mysqueezebox.com/.

sudo dpkg -i squeezeboxserver_7.4.1_all.deb
Selecting previously deselected package squeezeboxserver.
(Reading database ... 154792 files and directories currently installed.)
Unpacking squeezeboxserver (from squeezeboxserver_7.4.1_all.deb) ...
dpkg: dependency problems prevent configuration of squeezeboxserver:
squeezeboxserver depends on mysql-server-4.1 | mysql-server-5.0; however:
Package mysql-server-4.1 is not installed.
Package mysql-server-5.0 is not installed.
squeezeboxserver depends on libmysqlclient14-dev | libmysqlclient15-dev; however:
Package libmysqlclient14-dev is not installed.
Package libmysqlclient15-dev is not installed.
dpkg: error processing squeezeboxserver (--install):
dependency problems - leaving unconfigured
Processing triggers for sreadahead ...
sreadahead will be reprofiled on next reboot
Errors were encountered while processing:
squeezeboxserver

So I issued this command:
sudo dpkg --ignore-depends=mysql-server-4.1,mysql-server-5.0,libmysqlclient14-dev,libmysqlclient15-dev -i squeezeboxserver_7.4.1_all.deb

(Reading database ... 158195 files and directories currently installed.)
Preparing to replace squeezeboxserver 7.4.1 (using squeezeboxserver_7.4.1_all.deb) ...
Unpacking replacement squeezeboxserver ...
Setting up squeezeboxserver (7.4.1) ...
Adding system user `squeezeboxserver' (UID 119) ...
Adding new user `squeezeboxserver' (UID 119) with group `nogroup' ...
Not creating home directory `/usr/share/squeezeboxserver'.
* Reloading AppArmor profiles
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox-3.5
...done.

Making sure that Squeezebox Server is not running first: No squeezeboxserve found running; none killed.
Starting Squeezebox Server.

Processing triggers for sreadahead ...

Now everything seems to work as it should :)

Update 2009-12-09

It worked, but the update manager didn't want to upgrade my system since there were unresolved stuff... whatevah! Added 'deb http://debian.slimdevices.com testing main' to Software Sources and now things are good again. Well, update manager keeps warning me that there are unauthenticated packages but I can live with that.

After installing Windows

Reminder to self. After installing windows perform the following steps / install the following. Most of this software is free and much of it runs on Linux as well.

What about the bicycles?

I read an article in Best Life that said more than 80% of the public space in New York city was roads reserved for motor vehicles. Now don't get me wrong. I love driving. But 80% of the space?! Is that really necessary?

So I thought about it. If the current government in Norway was serious about the environment they'd build roads for bicycles (and pedestrians) with a roof over them to shelter from wet weather. That would certainly get more people using their legs to get to work. The health benefits would probably save us a nice lump of money in the long run too! I'd expect a few more broken bones along the way - but bones heal.

So why don't they do it? Well the only thing they really do is increase taxes on cars and gasoline. Which only serves one purpose - increasing the income of the government. Because what would happen if people actually started using their legs instead? The government would see a significant portion of their income dwindle away. Now that's something the bureaucracy beast does not want to see happen - the money is needed to fuel the expenses of the beast. I heard somewhere that we have twice the bureaucracy of Sweden - yet our population is half of theirs. I have no reason not to believe that.

Here's my plan for Norway. I'd like to remove all taxes on cars - even the sales tax (MVA). While at the same time we built roads and planned such that you could safely get where you wanted to go by bicycle. Now if we did want to punish the motorists we should do it by increasing the tax on gasoline much more. Doing it this way would make it easier for people to buy a nice safe car. You'd only pay taxes on the actual usage. Which again would motivate you to buy a car that is very fuel efficient.

A Better Battlefield2

I like EA games' Battlefield 2. I've spent quite a few hours with it. However there are a few things I wish were different. First off - a few things that could be found in Novalogic's Joint Operations.

The Littlebird

That's right - the little (usually unarmed) chopper we used to quickly move our troops into the field. Two men inside, four on the outside. We'd land on top of the bunkers, throw some flashbangs into it and slit the throats of our enemies before they knew what hit them. Going back to playing JOE is not an option. The Littlebird is really the no 1 thing I miss.

Bigger maps

... and more space between the earth and sky. Flying a jet in such a tight space gets a little ... I don't know ... I just want a bigger area. Using a couple of minutes to reach the combat zone wouldn't hurt. Maybe carry more powerful bombs not them firecrackers currently in use. The main reason for wanting a bigger map though is that I'd like to see logistics becoming more important. Plenty of Littlebirds and Blackhawks and teamplay should be necessary to get the troops to the fight. There was one map in Joint Ops that was huge like this... it wasn't the most popular though.

Those damn UAVs

They're not THAT effective in real life and I hate them - that scan function too. There is nowhere to hide! They should be switched off - permanently. However troops should be able to spot enemies and they should remain on the map a little longer - or fade out in some manner to let your comrades know that the area might be hot. This way we could use a few well camouflaged snipers to do some reconnaissance. Yay! Now instead of people bitching about snipers they would come to rely on them.

Transport choppers

In Joint Ops you could freely move around inside the Black Hawk and on the boats - you risked falling out but still... And even cooler - you could drive a vehicle onto the chopper and transport it to another part of the map. Cool stuff.

Final thoughts

I'm sure EA and the lot will conjure up cool stuff in the future - I just hope they won't forget the essentials... Peace out.