Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Saturday, 13 March 2010

Moving title bar buttons to the left

I always liked the Mac style of the buttons in the window title bar: LEFT.

Gnome (as well as KDE or XFCE) show them on the right of the window title by default.

Historically, Microsoft could not simply copy all of Macitoshs interface so they "invented something new". Buttons to minimize, maximize and close the window are shown on the right of the title bar.

OK, it's different, but on second thought, it is stupid as well. On a Mac (as on my Linux box) everything having to do with commands is in the top left corner (general menus, window menues, etc.). So why move the mouse to the far left of a page to manpulate window controls?

Cut a long monologue short: How to get the buttons from right to left?
gconf-editor
Search for the key:
/apps/metacity/general/button_layout
Replace the colon right to menu with a comma and place the colon at the end of the line. You can place the colon any place you want to separate left from right buttons.

I have done this on my machines and the theme now looks perfect.

Monday, 4 May 2009

Backup with Clonezilla

On my server I use LVM to manage my disks. My physical volume group has two disks containing one logical volume. Up till now I had trouble backing up my server as all the backup tools did not recognize the LVM.

This time I used Clonezilla 1.2.1.48. It's release notes state that it recognizes and honours logical volumes.

And it does.

Just to let you know.

Sunday, 15 February 2009

Adding Code Intelligence to Komodo

Writing programs in Python using PyGTK can be hard as the documentation is not consistent and somewhat outdated.

Adding Code Intelligence to the Komodo IDE is a matter of adding a specific XML-File to the IDE. Here is the link to the CIX-Files that do the trick:
http://community.activestate.com/files/gtk._gtk.cix_.gz
http://community.activestate.com/files/gtk_v2.cix_.gz
Extract the files to a directory. Add the two under Edit/Preferences/CodeIntelligence "Add an API Catalog...".

Viola. You have code completion.

Monday, 14 May 2007

First steps in Python

In my blog Python demystified I reflected on some thoughts about computer programming and the language in particular.

Ever since then I was aware and interested in this language. Remember I said:
Without any decent IDE (like Netbeans for Java) that allows for graphical programming and UI-design, I strongly doubt that Python will ever gain momentum.
Well, I found a decent IDE: ActiveState Komodo IDE.

Except for GUI it has everything, a decent IDE needs: Syntax highlighting, code completion and code folding, integration into version control (subversion), debugging and profiling.

So just as I was to change my attitude and general opinion on Python the snakes ugly head rose from the depth of my notebooks core:

(Briefly): Python allows for object oriented programming. Objects can be created and instanciated. When going out of scope they are subjected to the garbage collector for destruction. So far so good.

I tried on example program from a popular python book - it worked.

I tried to extend the program (for better understanding) - it crashed.

Well, it terminated with an exception.

Further investigation revealed:
Python stores class definition and object instances in a globally accessible list. When program flow exits the current scope, all objects within scope are subjected to garbage collection according to this global list (and in the exact order of appearance within it).

So there is the possibility that an instance "wol" may be destructed before the class definition "Person". Changing the object name to "wolf" brings it after the "Person" identifier in the globals list and thus there is an object still in memory and valid, where the class definition is destroyed. Any following destructor of the objects instance cannot be called. The code is not there any more.

Is it just me that I find these things on my first day with the language?

Other than that I am fascinated by this elegant and slim language. Worth a try.

Monday, 23 April 2007

Ubuntu vacation feelings

After a long and discontinuous experience with Linux and particularly Ubuntu, I switched to Ubuntu over Easter.

All the good reviews

If you are interested in appraisal only reports, look somewhere else. I had so many errors, bugs and strange behaviours that I cannot fall into the choir of Ubuntu enthusiasts.

Ready for prime time - for some

If you use your computer just for E-Mail, web browsing and the occasional word processing, you will love Ubuntu.

If you watch a video every now and then, you will be excited to see that it can be painless.

but not for all

If, on the other hand, you want to use Ubuntu in a mixed environment with Windows clients and servers, prepare for some surprising incidences.

Gnome provides an interesting approach to file access: gnome-vfs (Gnome virtual file system). Its an easy to use API that allows applications to access remote and heterogeneous file systems. Just mount a volume, drive or directory and access it with any application. That's what it says on the box.

Reality quickly catches on: Only a few applications are aware of gnome-vfs and the mounted drives. Nautilus (the Explorer pendant under Gnome) can access files. OpenOffice supports gnome-vfs as well. Others don't. And they are not just any applications: Thunderbird and Firefox are among them.

Notebook misery

I run Ubuntu on several notebooks. The basic system will always work. If you want to use notebook specific features like touchpads, sleep mode or wireless LAN, prepare for nightly sessions of debugging and error discovery. If your notebook is equipped with exotic peripherals (anything other than a keyboard a screen and an external mouse will do), you will likely find it not working.

On a HP nx8220 the smart card reader is not recognized, the SD cards cannot be mounted and sleep mode will wake up with sound amiss.

My HP 510 has a built-in Synaptics mouse pad. This is recognized in my nx8220 but not in the HP510. To calm us down, sound works after wakeup.


Tiny little annoyances

As a professional developer I am not prepared to ship things that do not work. And it seems pretty clear that some things don't work. So, they should not having been shipped.

Video playback using the proprietary graphics drivers from ATI don't go well with video playback. OK, they are turned of by default. Also compiz is turned of by default, and that is good so as it conflicts with video playback as well.

There is no centralized tool to adjust regional settings. This has to be done in configuration files, logon scripts, gnome tools and sometimes within the application itself. Thunderbird for examples does not honour the system wide font setting. It also ignores regional time formats. You have to set these using environment variables.

Why do I use it?

So, if I am not happy, why did I bother migrating?

Well, I did not say, I was unhappy. There are things that really work well. Automatic update, upgrading to a new version, installation and deinstallation of software all are more stable and trustworthy than the monopolists counterpart.

There is no IE installing malware behind my back, no Office update that deletes some of my .NET framework DLLs and most of all, no DRM to tell me what I am allowed to do, see and view.

I have no need to defrag my harddisk or registry, no thrills using some low level maintenance tools. I do my work and thats ok.

If there are some issues or lack of functionality I can look under the hood and identify the problem myself. I can contribute to the evolution of a system and that contribution is valued (as opposed to Microsoft where reporting a bug will cost you money).

But most of all, I feel like a person that has left its privileged live behind. All the high-tech gadgets, the nitty-gritties, items and toys that seemed so important mean nothing. I stand here with my bare feet in the sand, watch sunrise (or sunset, whichever you prefer). I feel like I don't need all the chaos, hectic and stress.

I feel like I'm on vacation.

Tuesday, 27 March 2007

Finger weg from Eclipse

We have this ongoing argument about not enough Java/Oracle programmers available. I took this to brush up on my Java know-how.

A friend suggested Eclipse to use as an IDE. So I listened and tried it.

Let me put it this way: I have not used such a bad piece of software in a while.

OK, it's free of charge but that's about all that speaks for it.
  • It's slow. Dead slow. A simple "Hello world" took 5 minutes to set up, 2 minutes to debug and more than a minute to launch from the IDE
  • It's complicated: To set up a project you need to go from Window to Window to set up projects, packages, classes, hierarchies and outlines
  • It's slow (did I mention that already?): The code completion takes for ages and even blocks text entry (System - hang - .out. - hang - println - hang ...)
  • It's confusing: Try to debug, does nothing. You have to select which type of project it should be (Can a Java class be debugged as C/C++?)
  • It's broken: I tried to update the IDE (I used 3.2). There were some updated modules. The update mechanism asked over and over which Download center I wanted to use (the automatic selection ended in a disaster). And after another 15 minutes of downloading, the IDE told me, I had not enough rights to install the update. Thanks for telling me so soon
  • It's cumbersome: Creating a SWT app is not straight forward. I gave up working on this one
  • It's slow (deja vu): You can add plug-ins easily (if you have root privilege, that is). With each plug-in, the IDE becomes slower and more unusable
Conclusion: If I have to write programs in Java, I use Netbeans (free of charge) or IntelliJ ($ 599,- incl. TeamCity).

Tuesday, 16 January 2007

Python demystified?

Four years ago I was asked to troubleshoot a project under tight schedule and budget. The team had committed itself to finish an ASP application within 2 years. When I was called, there were only 4 month to the deadline.

I agreed to manage the team under the condition that 2 out of 3 parts be substituted by standard OTS componenten (who needs to develop their own database or browser) and efforts being concentrated on the core functionality.

My proposal was rejected. The project team was confident that using Python programming language would give them an advantage to finish on time and budget.

Later I learned that the project failed and the company went out of business.

My argument then was that Python was not to be compared to C# or Java in efficiency. More so, no real libraries exist.

I was right about the potential of Python as a tool to finish in time.

However I was wrong about the true reason why Python has not gained momentum and probably will not in the future as Java and C# had.

Recent occupation with the subject led me to a different opinion.

1. C# is easy to use and convenient for writing software. However, C#'s strong typing requires programmers to define in advance what to do. Even with refactoring tools and support for generics changes in structure and data definition can cause headache.

Python (as JavaScript) offer weak typing. Objects can be of any type, programmers don't have to worry in advance what they have to handle. Python as opposed to JavaScript has a tight syntax an object declaration (var i, I know its var, so why do I have to state it?)
There are many more advantages to the Python language. Some of them are:
  • everything is an object,
  • strong string operations,
  • plethora of external modules,
  • integration into host operating systems,
  • integration with other programming languages,
  • etc. ...
These make Python a powerful programming tool.

Going from here, I would prefer Python to any language any day.

2. In the early days of Java, everyone wrote their own IDE. This was possible because Java offered AWT a platform independent graphics subsystem. That allowed for many programmers to adopt Java. C# is hosted in the Visual Studio IDE (with a free Express edition available). Even Mono has two prominent IDE's: MonoDevelop and SharpDevelop.

Python offers an outdated IDLE (basically a specialised shell with no charm), ERIC (a bloated QT based environment with an older version of python interpreter), PyDev, a slugish Eclipse plugin, and many more alpha and pre-alpha Editors.

Without any decent IDE (like Netbeans for Java) that allows for graphical programming and UI-design, I strongly doubt that Python will ever gain momentum.

3. There is plenty of introductory books about Java, C# or VB. There are some books around introducing Python. None of the books I reviewed showed how to set up a working python development environment. Maybe its the selection, maybe I am used to skipping chapters on how to get started with other languages. With Python I wasted hours installing, testing and deinstalling IDE's and development tools.

Without a cross platform native or Python based IDE I am pretty sure that Python will be something like Modula 2 in the 70s, ADA in the 80s and LiveScript in the 90s.

Looking back, finishing the project on time was absolutely impossible. Not because of missing power in the language but lack of a powerful IDE.