Observations about the universe, life, Lausanne and me

Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Friday, September 30, 2011

Public service announcement

If you happen to use floats from the NumPy-module in your python program instead of the built-in floats (by, say, using a function like a Savitzky-Golay filter a kind soul has posted on the net instead of writing your own), your program will run 5 times slower: See also here.
Took me quuiiiite some time to find this out...

Wednesday, April 27, 2011

Nexus S

I have had my Nexus S for more than two months now - I got fed up with the iPhone 3G's slooooowness, and did not want to pay through my nose for the technologically already outdated iPhone 4. After a bit of research I decided to take the plunge and go Android.

Recursion


Now that I have used the thing for a while, here are my impressions. First, the good stuff:

  • zippedy-zippedy fast. This has mostly to do with the faster processor, and the fact that Apple doesn't give a shit about your old hardware when they update the OS.
  • no iTunes anymore on my PC. This sounds silly, but I swear I breathed a huge sigh of relief when I deleted that particular piece of crap software from my computer. How Apple think they can convince people to switch over to using their software and hardware when such an integral part of their user experience for windows-users is the worst #$%$ piece of crap software ever is beyond me. So long, iTunes, long may it be before I see your slow ass again.
  • Every setting accessible. I had jailbroken my iPhone, and was all set up to root the Nexus S, but there is really no need if you don't want to run a custom ROM. You can change nearly anything in the settings, and if you can't, there is an app that does it for you. I am currently using Swype as input method, for example, and got rid of the annoying and unnecessary fake shutter noise of the camera via the app silentSnap.
  • Multitasking. Handled excellently, and without burning resources needlessly. 
But all is not flowers and buttercups in Android garden. There are some things that Apple is just better at:
  • Systems integration. This is a biggy. Apples iOS is really the smoother operating and eco-system. From the centralised App-settings to the way Apps play nice with each other, iOS just works. For example, in Android you can choose your music player, podcast-player etc. So far so good, but then try and controll your music with the button on your headphones? Disaster. I like to listen to podcasts on my bike, but if I try pausing them, random music from winamp will start up - or nothing will happen. There is, as far as I can see, no real policy for how various apps can hand off control over the headphone button, so it is a matter of luck, or rather the current specific state of the phone, including which apps are suspended/running/still in memory. Urgh.
  • The music player. Apples iPhone evolved out of the iPod, and it shows. This thing is made to play music, and simply better at it than anything Android currently has to offer.
  • Simplicity of use. Apple's iOS, by virtue of being less capable, is also simpler to use. The difference is not large, but noticeable - Android will use a bit more of your brainpower until you are used to it.
Aaand that's it. All in all, I much prefer my Nexus S to the iPhone 3G, even back when the 3G wasn't running 3.1.3 and slow as hell. Still, I don't have a direct comparison to the iPhone 4, so I can't really recommend dumping that one for an Android in good conscience. I am happy with the Nexus, but maybe I'd be happy with an iPhone 4 too? Yet... No. iTunes. Any. More. Ever. ;)

Tuesday, May 18, 2010

Public Service Announcement

Om nom nom, the subfunction eats your counter.
MATLAB does not protect the namespace in subfunctions. If you have a loop with a counter called i in the main function and you call a subfunction that has also a loop that uses i, hilarity will ensue.
Also, hours of debugging.
That is all.

Monday, June 29, 2009

Why I hate Labview

I have harped about this before (and most probably will again): stay away from LabView if you want to keep your sanity. Point in case:



First of all, this is not an overly complex program. Or at least it wouldn't be, in any other language. It only has to control three instruments, using fairly simple syntax. But thanks to LabView's oh-so-simple "graphical" programming metaphor, you have lines and shit going everywhere. Furthermore, I've begun to not propagate error messages from module to module properly, just to cut down on the number of "wires" so I still have a small chance to understand what is going on in my main program. This does not make debugging easier. And now this:



Insane object indeed. I think I'll look into migrating the whole shebang to Matlab.

Thursday, June 25, 2009

Remote surveillance

Yes, I have joined the dark side.

With the increasing automatisation of my experiment (courtesy of my slave student R.), it is possible for me to  leave it running for two hours or so, gathering data. Pressure, voltage and oscilloscope are all controlled by the PC, via Labview (urg). Unfortunately there rests always the small possibility of the experiment gaining sentinence and taking over the world (or crashing and leaving the RF generator running at full power, which would melt my electrodes), so surveillance is a must.

Now, I could have delved deeply into Labview to find out how to write an interface to control it over the intranet. If you have ever used Labview, you know how much joy that would be. Or I could do the following:



The small round blob with the pink tape on the right? That's a webcam, aimed at generator and scope. I've got a small gadget running in my google desktop that shows it's picture, so I'll know at once if something iffy is going on...

Wednesday, June 24, 2009

New car battery

After the latest bout of removing car battery, charging car battery, putting car battery back in I had enough, and bought a new one. It's an SLA (sealed lead acid) battery, so no more watering the battery. It holds the same charge (60 Amp-hours) as the old one, but has double the peak current, nearly 600 amps. Does that make any difference for my car? I have no idea. (This is something that fills me with dismay. I know nearly nothing about the ton of steel that carries me around from time to time. I think I will buy the repair manual for it, and do some light reading.)

Here they are, new and old, sitting next to each other:



Photo courtesy of the crappy iPhone camera. Why the iPhone camera? because I discovered Flickit, a marvelous software that takes a photo and uploads it to Flickr immideatly. Now, if, lets say, the man wants me to delete a photo, I can do so with the reassurance that it will live on on the internet, forever.

Anyway, here is my battery sitting snugly in the running car. (Note the professional anti-corrosion coating!) Afterwards I discovered that my old battery was just fine, I had only forgotten to shut off the interior light of the car. Sigh.

Thursday, January 22, 2009

Hard disk upgrade

Lately I have found my 70 gigabyte hard disk a bit confining, so my poor old Dell laptop was due for an upgrade.

I ordered a bigger, faster disk ( a Western Digital 250 GB, with 16 MB cache) and an usb enclosure for it:


Putting the disk into the enclosure is simplicity itself, just plug the thing on the left onto the disk, slide in and tighten two screws.



Then I used Norton Ghost 14 to clone my internal disk to the new, now external usb disk.

Afterwards I opened up the enclosure and my laptop and swapped the two disks:



I rebooted - and the laptop ground to a halt at the windows login screen. Not even a nice crash - just nothing but a soothingly (ha!) blue screen. Whipping out my trusty iPhone, I searched for the reason, and soon Google told me where I went wrong: Under no circumstances should I have mounted the new disk in Windows before cloning to it. Because  Windows remembers the drive letter assigned to the disk, and when you clone it you transfer the registry as well - so when booting it searches for the OS in C:\, but assignes the old letter (in my case F:\) to your spanking-new system disk.

There is an easy solution for that floating around on the internet, that does not, unfortunately, work in my case: Boot from an Win98 bootdisk (or usb stick) and perform fdisk /mbr, which erases the disk label, so Windows does not "remember" to assign the wrong letter to the disk.
But Win98 can't read NTFS, so no fdisk for me. The newer fixmbr-thing that comes with Windows XP  does not work, because it does not erase the disk label.

But! There is another way: I connected my old disk vie the USB  enclosure. This had still the letter "C:\" assigned to it, so I could boot.  Then I found and followed the instructions here, which show you how to reassign the letter of the system drive while windows is running, using regedit. It worked!

Now I have place for all the pr0n photos I crave - and it took me only a paltry five hours!

Wednesday, January 14, 2009

Jailbreak

Yes, I finally did it, I broke my iPhone out of Apples confining App-store straightjacket. It was very straightforward, and now I can finally sync my Google calendar with the iPhone's calendar. Take hat, Jobs!

I have not really installed any free applications except for Nemussync (the aforementioned syncing) and Winterboard (prettying up and costumising the GUI). An Searcher (see screenshot of it installing to the right), which searches through all your contacts, events and sms.

The only application that seems not to be available in either the App-store or free repositories is an alarm clock that plays music in the morning. Why? To me, this is such a basic functionality. Why should I have to wake up to some ugly ringtone each morning, when there are four gigabyte of music on the damn thing? Why???

On a happier note, I must have read more than 10 000 pages on my iPhone already. Right now I am reading, or trying to read, Dumas' Le Comte de Monte-Christo. A book I like, and have read multiple times in it's German translation. The French original, however, proves to be less... accessible. But I shall persevere, and learn such important words as l'artimon (foremast) in the process.

Tuesday, November 18, 2008

Waxing poetic over the iPhone

I am still happy about my iPhone. I would even go as far as to say I am still ecstatic about it, weren't it for the sheer silliness of being ecstatic over a piece of silicon and plastic. That being said, I am still ecstatic about it.

First of all, the interface is so slick. It's not perfect - there are some things that are missing: it's sometimes awfully inconvenient that there is no multitasking. You can't, for instance, have your GPS tracking program running while reading an ebook (The iPhone makes an excellent ebook reader. Not sure if you'd be able to read them in the glaring sun on the beach, but in the current gloom it woks just fine). And there is no cut-and-paste, which makes entering URL awfully inconvenient.

But!  You never feel lost (GPS!) or confused. Nearly everything is intuitive, or at least easy to remember. And then there are the little things, like that the music you've been listening to shuts off automatically when you remove the headphones, instead of blaring over the speakers.

But most of all, I am so happy about having a 3G phone. It just feels so utopic to whip out your iPhone and update your Facebook page while sitting under a tree. In the rain. Well, hypothetically sitting under a tree if it weren't raining, which it is. Or showing your friend that the Dow Jones is still nosediving during lunch (not that you'd need an internet connection for that). All things I don't really need to be able to do, but which are just so much fun! I am even considering joining Twitter - not because I think that it is in any way interesting or because I have so much interesting stuff to say - only to be able to justify logging in and posting something from, say, the middle of the street during my ride home. Which would most likely end up with me in the hospital, but hey! No problem! I could still update my blog with my iPhone!

I guess eventually it will all get old and boring - but don't hold your breath.

Wednesday, September 3, 2008

Correction: Data-loss and backup

In my stupidity and rush to get to our holiday in Vienna, I linked to the wrong product in this post.


The amazing (and free!) backup software I use is called Allway Sync and not Allsync, and can be found here.

It is, by the way, also perfect to set up a backup-system with an external hard disk for your extremely non-tech-savvy parents.

Thursday, August 21, 2008

Data-loss and backup

Edit: 03.09.08: Like an idiot, I linked the wrong product. I meant Allway-sync, not Allsync.

Data-loss is the spectre that has graduate students waking up screaming in the night. If your definition of fun is being cruel to lowly beings, try creeping up on a graduate student during the coffee break and whispering: "Your PC is on fire, mate!" Have the defibrillator handy though, especially if he or she is already writing up. Ahh, good times.

Data-paranoia is a frequent symptom of the after-effects of having once lost data. A (relatively) sane individual like yours truly will have a couple of backups: In the lab PC and the office PC (in case the lab PC dies or the lab catches on fire), on an USB-stick you constantly carry on your person (just in case the fire in the lab can not be contained, and spread to the office), on your PC at home (in case you don't make it out of the office when the university burns down), on your external hard-disk (in case your laptop gets stolen by thieves who use the opportunity of the burning university distracting the police), and on a RAID-array on a server in another city (in case the fire cannot be contained to the university, and engulfs the whole town).

Severe cases of data-paranoia can express themselves in various ways: A friend of mine burned all his data to a fresh CD each day, and then hid them in the most unexpected places in his flat, his mates' flats and (so I suspect) in the apartments of unsuspecting strangers like a demented squirrel with a doomsday complex. That was back in the day where CDrs still cost quite a bit, so his habit was expensive to feed.

New technology of course makes your data-paranoia easier to bear. I just found the nice freeware program Allsync, which automagically syncs my usb-stick when I insert it in my office computer. I can breathe easier now... for a while.

Friday, July 11, 2008

Doppler weather RADAR images

I continue to play around with Google Gadgets. My newest creation is a very important addition to my sidebar: A Doppler weather RADAR image of western Switzerland. There is precipitation in Switzerland right now, or you could see it show up as coloured dots on the map. This not only helps me tell whether it rains or not without having to bother looking out of the window (a very important goal in and of itself), but can also help me decide when to ride my bike home.

Wednesday, June 25, 2008

Stupid Motorola

I have this Motorola KRZR phone, which I hate. I mean, it works well enough as a phone, but the menu structure is ridiculous, the camera is crappy and the phone software is so awful I wouldn't use the camera anyway, because downloading your pictures to the computer is complicated and buggy.

Also, despite having an USB plug, it won't charge off a PC without some Motorola drivers being installed. Why? Because Motorola hates me, thats why.



The last couple of days those drivers suddenly stopped working, spouting something about "fatal" errors. Now I like the association of fatal and Motorola, but of course the KRZR is more insidious: As soon as the battery gets low, it emits a very loud beep every ten minutes. For hours. Why? Because Motorola hates me, thats why.

I tried uninstalling and reinstalling the drivers, but no luck. Why? Because Motorola hates me, thats why.

But yesterday I finally found the solution on "The Digital Voice" blog: Go to c:/windows/system32/drivers and delete the file wdf01000.sys. Why? Because Motorola hates me, thats why. Also, because then it works.

Thursday, June 12, 2008

Good Coding Practice


I have been playing around with the Google desktop gadgets lately.

I love the sidebar, but it has always bugged me that the weather gadget only shows the forecast for the current day when docked to the sidebar like in the picture on the right. To see the forecast for the next three days you have to either undock it, then it floats around and clutters up your workspace, or click on it, then a stupid little window pops up - cluttering up your workspace. But there is no way to just expand it right there in the sidebar.

Well, I thought, I'll just have a quick look at the source code then. All gadgets are really just a bit of xml and javascript - it shouldn't be too difficult to figure out how to re-write it to do what I want it to do.

Well, without further ado, here is what professional javascript code looks like. Written either by Google's Best or a horde of drunken and angry, angry monkeys - I can't really tell:

Don't you just admire the clear structure? Not one character is wasted on comments or - heaven forfend! - whitespace. Or linebreaks. Because that's for whimps, really.

But I persevered, and finally found the bit of code I needed to change. It was in the eight of eight javascript files, naturally, 8_main.xml.compiled.js to be precise. You have to replace the instance of Function Ha() highlighted above with the function Ia(). And I know what you are thinking: "Obvious. Any idiot could have figured that out!" Well, so I did.

And here is the fruit of my labours: The expanded Google weather gadget, docked. Telling me that the weather will be crap the next three days, which is no big surprise, because it has been crap for the last two weeks. But still, it is nice to be confirmed in one's misery.

Wednesday, October 3, 2007

Diagrams and figures

I have been looking for a simple, lightweight program to draw figures and diagrams with. Apparently, those Apple-adherents swear by omniGraffle, but unfortunately that is Maclusive (sometimes I crack myself up, I really do).

Fortunately, a bout of ennui and the aimless web-surfing following it yielded a solution today: Inkscape

Very intuitive and fast, can export in encapsulated postscript, and has a wealth of hidden features that are, well, hidden. Hence the intuitiveness. My first oeuvre is to be admired on the right: The setup of the RF electrode in one of my experiments.


Also, I am following a course about Mathematica this term (hey, it's easy credits!). Mathematica is interesting, and I am playing with the idea of programming some simple evolutionary algorithms for my demonstration in december. But plotting data is a pain in the ass. This I found out when in the first ardour of learning a new software, when I wanted to plot my spectroscopic data. Bad idea. Formatting your plot takes all manners of weird commands that are cunningly hidden in the cryptic help system (I am using version 6.0, in which said system was overhauled and upgraded - go figure), and there doesn't seem to be a way to do the same over the GUI, if you want to just try out something quickly.

Consequently, I went back to Matlab for all my data manipulation needs. Here are some spectra. Pretty, are they not? Note the weird continuum of CF4, of which I have written before (see the corresponding plasma here). Only this time, it is pure CF4, not decomposition of Teflon.

Monday, September 3, 2007

Sneaky Facebook

And suddenly I have a Facebook account. Never wanted one, but there you are. All I wanted to do was view some photos of a friend of mine. Filled out some form or other, bla bla email, password - and then I find out I am sucked into the social sinkhole that is Facebook.

I don't know if I will do much with my new account - maybe I will add a couple of pictures or whatnot. If you can't contain yourself, here it is. But, you know, you have to have your own account to log in. And thus the dread disease does dispread.

I thought that dispread (a synonym of spread) is a(nother) completely nonsensical english word, seeing that the prefix dis- normally means the opposite or absence of something.

But, says the Merriam-Websters dictionary:

Main Entry: dis-
Function: prefix
Etymology: Middle English dis-, des-, from Anglo-French & Latin; Anglo-French des-, dis-, from Latin dis-, literally, apart; akin to Old English te- apart, Latin duo two -- more at TWO
1 a : do the opposite of b : deprive of (a specified quality, rank, or object) c : exclude or expel from
2 : opposite or absence of
3 : not
4 : completely

So it seems that dispread means (or meant, since its definition is "to spread abroad or out") spreading completely. Or I have mixed up the etymology, could be that the dis in dispread is just a coincidence and has nothing to do with the prefix dis-.

Monday, August 27, 2007

Ressurrection of one old ipod mini

My little sister had an old iPod mini, whose battery was thoroughly dead. (That's the deceiving little blue bastard on the right. It doesn't look dead, but it is. trust me.)

So I ordered a replacement battery, (packaging to the left) and installed it following these nice instructions.

It worked like a charm, but then I updated the firmware, 'cause iTunes told me to. Unfortunately, 1st generation iPod minis require a wall charger to finish the firmware flash. Don't ask me why. The iPod just showed me a friendly icon of the wall charger I don't have, and giggled sillily. Well, okay, it didn't (giggle, that is). I just wanted an excuse to use the adverb sillily. Which Blogger doesn't seem to recognize, even though the authority on all things English does:

Saith the Webster's 1913 dictionary:
(Sil·li·ly
adv.
[From Silly.]
In a silly manner; foolishly. Dryden.

Anyway, luckily there are the internets, more precisely this post from the bearisdriving blog, that showed me that the workaround is as simple as wiggling the usb connector so that the ground and +5V pins are connected and the two data pins (they are a mite shorter) are not. Easy. I should have thought of that, but didn't.

Now everything finally works, and I will have sweet music on my bike again!

Wednesday, May 23, 2007

Swan Vista Matchboxes


I just had a look via which keywords people were finding my blog. For example, there was this guy (or girl?) from Inverness, Scotland that found it by typing "swan vista matchboxes" into Google. I think this is an ingenious search term, and will provide another picture of a swan - I unfortunately do not have a new one of my matchbox. I don't know about Vista, I am still using XP and have no intention to switch at this time.




Somebody from Microsoft in Redmond, USA found my blog quite naturally via the term "breast enhancement" . I hope he or she wasn't disappointed...

Friday, April 20, 2007

Femlab


I am playing around with Femlab recently. Femlab is not an utility to design the woman of your dreams, which would be wasted on me anyway because I have found mine already (That's her on the left, asking after the way in Vilnius). It is rather a vastly powerful finite-element solver, which can simulate stuff ranging from heat conduction to radio waves, mechanical stress and fluids. As with all these really powerful programs, the learning curve is very steep.

And what's even worse: I do not trust my results. There are so many switches and parameters and thingamagics and watchamacallits in the program, which supposedly all do stuff and might change my results. Or they might not. Or they might crash the program. Which is not Femlabs fault (even they changed the name to COMSOL recently - I guess too many horny teenagers called support) of course, because you can find out all those things, if you have time enough. Which is more or less the definition of steep learning curve anyway, and I am only blathering on to hear myself type.

This weekend there will be a carnival in Lausanne. Don't ask me why, it being after Easter and all, but apparently those Protestant heretics don't care. I don't either, but I might take some pictures.

Friday, March 16, 2007

Irfanview

For all my image-displaying needs I use Irfanview. This program is, IMHO, nothing short of amazing. Small and lightweight (~1MB), ultra fast to load, thumbnail option, slide show etc. You can also do your basic cropping, rotating and adjust colour. It auto-rotates your photos based on the EXIF-data. As of version 3.99 it also has the nice "Auto-adjust colors" function, which does such a good job at judging the white-balance that it would have burned on the stake a couple of centuries before. It wouldn't surprise me if there was some hidden option to make coffee...

No, I do not get any money for advertising this. Really, I don't.

Of course, sometimes your basic global adjustments are not enough, and that's where you see the limits of Irfanview: No layers, hell, only rectangular masks! But I generally don't bother with photos that need this much adjustment - that just means that I fucked up when shooting. If I do have to 'save' a shot then I use the GIMP , because it's powerful and infinitely cheaper the Photoshop and its cohorts.