Archive for the ‘programming’ Category:
Keyboard rant
I’ve not blogged about this or many other small details about my life really, I like to keep many private things private and sometimes I don’t think my small observations are worth writing about. But I think it’s time for me to rant a bit about Linux and software on it. Not just for my readers, but for myself. Maybe I can come back in 5 years time and see if I was right. Oh, and prepare for a long post…
First the backgrounds: I consider myself a power user of operating systems and software, and I would think most people would agree. My work includes designing software for other people too, and my goal is usually to make software simple on the outside but complex on the inside for average users, but enable all complexity for power users like myself. I don’t like having a nerd or geek label on myself though, but I demand lots from my software as any professional would from their expensive power tools. If at all possible, I operate the computer without a mouse and navigate all applications with the keyboard and demand that all applications have good keyboard support. Even on Windows I many times preferred the command line for many batch operations.
Having switched completely from Windows to Linux and the KDE 3 desktop environment, I find myself relearning a lot of basic ways to navigate the system. At first I had custom key bindings that resembled Windows (such as Win+R for run command instead of the KDE default Alt+F2), but after a partial reinstall of some libraries I lost the configuration and use more and more “Linux style” (KDE style) keystrokes. Having a custom set of key command is of course practical for myself, but anyone else using my system would have a hard (or impossible) time to do anything quickly. Security through obfuscation comes to mind, but that’s another topic for another day.
The benefits of having a custom set of keystrokes is of course more operating speed for me, but downsides may be far too many I fear, that I should use them. While I learn my specialized system, some of my unique commands will be stuck in “muscle memory” that aren’t applicable to other systems. So who knows what will happen in some other random system (my clients, friends, family etc.) if I suddenly hit Win+T or Win+Shift+E etc. that may have some meaning on my system, but another on theirs. Sometimes I quickly hit a keyboard command realising too late, that this command is not available on this other system. After a solid 7 months of using Linux, the less I remember how to use Windows. Some would congratulate me for getting away from the Windows habits, but that doesn’t really go well for a computer specialist, who needs to know a fair deal about every system around, and not do any damage when using a borrowed system. Pressing Ctrl+Alt+Del in Linux may initiate a reboot, while in recent versions of Windows it just opens up the task manager. I’m supposed to know and memorise where and when a keyboard command is safe to use. I wouldn’t want to accidentally do a reboot on a system that’s vital to keep online, so I would like to remind myself here and now, that being safe and secure always requires me to think twice before doing anything. Own system = do whatever you want and press your favourite keys. Borrowed system = just use basic commands such as Ctrl+C and Ctrl+V for copy-paste, and use the mouse if you can to slow me down. No job, except hacking in warzones and saving people from burning buildings can be that critical and important that I have to use super fast keyboard commands… right? (Hmm, so keyboard commands are just for my own pleasure!)
On a side-note, I noticed the same happening with mouse gestures for those occasions I actually use the mouse ;) I mainly use the back/forward/close document gestures in Opera and Firefox (easily obtained from https://addons.mozilla.org/en-US/firefox/addon/39). Whenever I use Internet Explorer, I get frustrated for not having gestures there too.
Back to keyboard shortcuts! Today I was browsing my immensely vast collection (no exaggeration here!) collection of photos. From old old habits of some windows software I had, I prefer to hit right and left arrow key instead of space and backspace for browsing to the next and previous image. Depending on the image viewing software, these arrow keys do something else. This time I was using Gwenview on a folder, cause I had just JPEG images. Whenever I press right/left it rotates the image, which totally made me angry.
When you accidentally have rotated an image and then remember to press space, it always pops up a dialogue asking me if I want to save the image changes. I can select “Yes”, “No” and I can also check the a box “Don’t show this dialogue” anymore. I always press NO, because I am viewing images. I don’t ever want to modify my original images. Besides, I don’t trust what it would do to my image. Will it use an internal algoritm, mogrify or jpegtran? Will it preserve EXIF data, will it preserve original modification timestamp for the file? Is there a backup of the original, can I undo the changes? Is it really my job to figure all of this out with this simple Yes / No” dialogue? And what if I actually check the box… where does it store my setting, how can I undo it? If I have the setting saved, will it automatically answer yes or no in the future. Will my image viewer be rendered useless after that? So what do I do, besides get angry? I read the manual. Pressing F1 opens up the Gwenview User Manual. 4 chapters in total.
Revision 1.2.92 (2005-08-21)
Copyright © 2005 Aurélien Gâteau
Table of Contents
1. Introduction
What is Gwenview
2. The interface
Browse and View modes
3. External tools
4. Tips
Using the mouse
Panning with the mouse
Zooming with the mouse
Browsing with the mouse
Key bindings
Docked windows
The manual is from 2005?! You have to be kidding me!! This made me even more angry. In fact, angry to the point that I downloaded the source code by issuing the command
apt-get source gwenview
Then I started examining the source code for the application to see what it did if I rotated the image. It seems to rotate the image just in memory, set a bool mModified to contain true. After a bit of investigation, in the file src/gvcore/document.cpp I disabled the function saveBeforeClosing to do nothing, even if the file has been “modified”.
void Document::saveBeforeClosing( ) {
d->mModified=false;
return;
}
To test my changes, I just needed to recompile the sources. I just recently learned from my friends how to do it the right way in a distribution specific way. Instead of running make && make install, you are supposed to create an installation package with a simple dpkg-buildpackage in the source code root. After that you can just issue dpkg -i on the generated .deb file.
Compilation took a few long minutes but after installation of my custom package, it now stopped asking me about saving my changes. And that’s how I made my image viewer to be less annoying. Of course, I’ve now also changed keyboard shortcuts inside Settings –> Configure Shortcuts to customise my keyboard shortcuts to something that suits me better. Now I have left and right for browse previous and next and Alt+left and Alt+right for rotating the image.
Just don’t let me use your KDE system, I might accidentally destroy your original image files, if your system behaves in the standard, or even worse, in some other custom fashion!
What do we learn from all of this?
Windows is good. Linux is too good.
Now I just need to find a way to disable automatic rotation of the thumbnails and images from the EXIF orientation tag. Some might like it, but it’s slow on my system and I really need to see which images aren’t correctly rotated. Already found the file miscconfig.kcfg, only thing that remains is to understand how it works. Hmm.. Seems to address just the two issues I have with the browser! Don’t ask me about saving and don’t rotate images.
Back to the Configuration dialogue… aha!
It took me the source code not to become blind to the obvious settings! How blind can one get? Back away professionalism, I couldn’t even see the forest for the trees.
I don’t feel stupid for wasting my time trying to hack into the code to solve a trivial problem, not at all. Now I am actually learning how to modify KDE applications for my system, which will undoubtedly come in handy in the future when I plan to submit patches to the official Kubuntu repository :)
Read more about keyboard bindings on KDE here http://www.linux.com/feature/54468
Happy 5 + 10 + 30 years = 2008!
Ooh, I should have written about this ages ago but I’ve been busy, lazy and ignorant for the past month.
2008 is triple milestone in my life.
10 years ago I moved to Finland from Sweden.
5 years ago I started working at the company I work for today.
30 years ago I was born (oh well, later in August. Those other two happened in January)
Happy happy, joy joy?
As it turns out, sure. I’ve had lots of happy times these past 10 years, but I can’t say life always gives grapes, there are bound to be some lemons from time to time.
I’m planning on making some changes in my life this year. Can’t tell yet if they’re for the better or for the worse. Not yet anyways.
I also made a few New Year’s resolutions, mainly as a joke, cause I don’t really like to make them (and I promised in year xxxx that I’d never make then no more).
Of course I chose almost impossible things, so I lasted for about 2 weeks (cause I’m a slave for some of my obsessions ;P). From now I’ll just hold on to my resolution I made several years ago….
Scripting is my passion still it seems. I’ve been working hard (ha!) on the Popodeus scripts, you know, the ones that are supposed to replace my Numeric Grades (+ others). Remember me mentioning that I’m planning to change a few things in life? Well, as a side-effect, I will need to find another server for my website, and I’m currently in the midst of testing it out. If it seems efficient and stable enough (I have my doubts, cause it’s way too cheap….) I’ll move everything there before the big launch of POPODEUS.
Other things hindering development: It requires a version of Greasemonkey not widely available yet…
But we’ll soon be there guys. Grand opening! I promise!
Scripts updated!
Yay,
I posted a revised version of Numeric Grades and Fine Forum helper scripts for Popomundo. They should now be working as usual, if not even better.
Nothing new added though, sorry about that, I only fixed the existing functions to work with the new layout.Since the devs have incorporated some of my script functionality into the core game, I can now remove the skill stars counter and those word-lists from the code. The scriptfiles are now also a bit smaller! Heaps of code gone, and I feel good about it.
Get the Greased machine up and running again…
Okay, so this is pissing me off. I want to code my Greasemonkey scripts for Popomundo. I really do!
But all my time is either spent traveling, or pulling my hair off in despair. Not because of a woman, nooo.. but my computer.
There was a time when I had 1GB of RAM in it, but now it doesn’t boot with the other memory module, so I had to remove it from my machine. Running Windows 2000 server with 512 MB of RAM + Firefox + lots of add-on, a JavaScript development IDE, MSN, Winamp etc. etc. Well. IT IS NOT POSSIBLE! It just trashes memory to the hard drives and is sloooooow.
I hate this! I can’t do any coding on my computer unless I get more RAM and FAST.
It only costs about 30 euros, but I’m too poor to afford it this month.
If 30 of my readers would donate 1 euro each, I’d be quickly up and running again.
(Paypal takes about 30 eurocents per transaction, so giving 1 euro leaves me with 60-70 cents…)
This just sucks!
Help a sad sod to get the greased machine up and running again. Oh Puhleeezze
Edit:
1 donation received so far from Holland! This is making me happy!
Edit 2:
I removed the donation button for now :)
Delays
Heya guys. Sorry for not having updated the scripts for a while. I’ve had an interesting and busy period in my life, so no time to sit by the computer! But this weekend I’ll roll out a fixed version that removes features that the devs have added into the game itself so they don’t need to be scripted anymore.
Oh, by the way, did you notice that Greasemonkey was just recently updated to version 0.69? Be sure to get it!
Layout change
Later today I will be uploading new versions that fixes some issues you’ve had with the latest Popomundo scripts. Also, I’m in the midst of changing the layout of my script repository and blog. Even though this current look has gotten some praise, this has only been temporary. Oh, why do all sites want to change looks all the time? Crazy!
P.S.
Retro-looks will not be available.
Changes…
I’ve anticipated some changes on the Popomundo website. Scripts will probably be broken for a few days, but the incompatibilies will be sorted out during this week. Not to worry!
Italian changes again
Small update today.
Updated the Italian numeric grades translation again.
Oh, and from this version and onwards (1.53), the numeric grades update will work again by clicking on the red blinking exclamation mark. I had broken it when I rearranged some stuff on my site.
Italian language change
I’m feeling weird. I don’t need no doctor to tell me that I have a sore throat and headache. Maybe I have the.. cold. Nice. Well, just because of that, I added one change to the numeric grades script. Any songs in the repertoire that is missing a genre will be highlighted. This is for newbies. And for us old-timers, who sometimes forget.
Italian translation was broken, so I fixed that. Revision is now up to 1.5x something…
Something’s gotta give
I’m temporarily putting old versions of the scripts online now.
- Numeric grades
- Forum helper (Integrated with Popomundo’s own search)
- Popo friends
Remember kids. I’m rewriting big portions of the code. Learning from mistakes and testing ideas, so it’s a slow process. I want it to be good. Nah, better than good!
Hello popo’ers
Nice of you to pop by. Or popo by, as we should say it ;)
So, what’s the news?
Well the good news is, I like it that my code has gotten this much attention.
The bad news is that, oh my, it has gotten this much attention!
Before I did this just for my own pleasure, now I need to think of the pleasure of others. And I just wanted to be a selfish man, like we all men are. Right?
But before we jump in bed with the new code I am about to release, I need to polish them first. I have some ideas that don’t work yet, and I don’t feel like doing it sloppy. I’m a bit of a perfectionist, and all the previous releases were just plain miserable.
I hereby declare, that the release date is:
You’ll absolutely (not) gonna love this:
It’s ready when it’s ready, and it’s not ready yet.
But I will re-release the old scripts for your enjoyment tomorrow (Sunday), so that all those who’ve formatted their hard-drives etc. may reinstall lost scripts.
Please, have some patience, and come back later. Thank you for your interest!
Main