saltwater.be

playground of Bruno Windels

05/09

Time Tracker Dashboard widget

I needed a simple time tracker widget for dashboard and I couldn't find any that didn't depend on an external project management service so I made one myself. If you would like to try it you can download it.


Categorieën: Andere, Programmeren, Apple | 1 reactie

24/09

Next MacOSX hack

Ok, now that we are writing about mac hacks, this one might be a little bit more useful than the previous one (altough little).

If you often have to write texts with a lot of accents on the vocals, you were born (or bought a computer) in one of the only two countries in the world that have azerty keyboards (Belgium or France) and you do your work on a mac, then this hack is for you.

The thing you want to do is modify your keyboard layout. In my case I need to write a lot of spanish texts, so I need the á, é, ú, í and ó. In spanish keyboard these come in the form of a so-called dead key (a key to let the computer know that the next key specifies the letter that you want to accent). I used the key to the right of the 'm' key on my azerty keyboard which says (% ù).

Mac keyboard layouts are (rather complicated) xml files. Luckily there is an application (Ukelele) that allows you to modify these files in an easy way, presenting you with a keyboard which' mappings you can modify.

So with this application I created the keyboard layout called "Guirilandia" (the land of the guiris, to the north of Spain, corresponding exactly with the territory of the azerty keyboard). I have only gotten this to work on Snow Leopard. On Leopard, for some reason, choosing this keyboard layout, you don't get any input.

If you are one of the rare people that meet the conditions for this to be useful, feel free to download the keyboard layout. Just leave it in ~/Library/Keyboard Layouts and change your keyboard layout in the Language and Text panel in the system preferences.


Categorieën: Andere, Programmeren, Apple, Spaans | Geen reacties

17/09

Sleep to disk on MacOSX

At little tech post to interrupt the silence. Just wrote a little applescript that people with an apple notebook also might find useful. It allows you to choose to hibernate (write the contents of the ram to disk and shutdown) or normal sleep (in fact safe sleep, it first writes the contents of the ram to disk but does not shutdown so you can wake fast at any moment).

I used to use a dashboard widget called deep sleep but it doesn't allow you to go back to normal sleep, after using it it always shuts down. So I read their docs and made a little applescript that allows you to do both. Feel free to do wathever you like with it. You can find more information on hibernation modes in MacOSX in the documention of deep sleep, especially chapter 7.

I bundled it into a little application (made a cute little icon for it too :) for you to download.

Keep in mind that when you close the lid, or choose sleep in the apple menu, the sleep mode you selected the last time you used Sleep Tight will be used. Oh, and no warranty whatsoever, but you already knew that.

UPDATE: Just saw that when you go to the preferences of the deep sleep widget, you can change the sleep mode, rendering this basically useless :)


Categorieën: Andere, Programmeren, Apple | 1 reactie

17/07

D-ilemma

Aah ... vakantie, gedaan met vakantiejob, nieuwe laptop; tijd om te programmeren! Tijd om terug in pixelscape te vliegen! Aangezien ik pixelscape schrijf in mijn vrije tijd moet het vooral leuk blijven.

Zoals vandaag weer duidelijk was is programmeren in C++ niet altijd leuk, maar meer dan soms frustrerend door ondermeer de ingewikkelde syntax en de hersendode foutmeldingen. Zeker nu ik werk op een nieuw platform.

Nu houd ik al een paar maanden de programmeertaal D in de gaten en ze ziet er veelbelovend uit. Naar mijn mening heeft ze de voordelen van C++ (OO, native binaries en geen VM, compatibel met C ABI, ...) gemengd met de voordelen van Java (OO, Garbage Collection, relatief eenvoudige syntax, het idee dat de compiler het maar moet uitzoeken, grote standaardbibliotheek, ...).

Pixelscape programmeren in D zou mij waarschijnlijk toelaten sneller en met minder frustratie (wat alletwee bijdrage levert aan de "leuk" factor) vooruit te gaan maar dan moet de C++ code die ik al heb eerst overgezet worden.

Anderzijds is D nog niet uit de betafase en kan de syntax nog wijzigen. Iedereen die pixelscape zou willen gebruiken moet zijn toepassing ook in D programmeren (tenzij je met een wrapper in C werkt o.i.d.). De tools blijven ook nog wat achter. En geen Qt.

Genoeg voor- en nadelen om er nog even over na te denken :)


Categorieën: Programmeren | 2 reacties

05/03

Prutsen met gepruts

Mobieltje blijkt corrupte fotos (JPEG's) te maken. Normaal merk je het niet omdat veel software de fouten negeert. PHP met GD valt er echter over. Hij weigert om er een thumbnail van te maken.

Oplossing: afbeelding met ImageMagick (die valt er niet over maar geeft wel een melding) eerst naar PNG omzetten en dan terug naar JPEG omzetten zodat alle structuren in het bestand opnieuw opgesteld worden. Gebeurt nu allemaal transparant op de server.

Gotta love unix met al zijn kleine tooltjes. Gotta hate de moeite die grote bedrijven (veralgemeening) vaak hebben met standaarden.


Categorieën: Programmeren | Geen reacties