Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, October 29, 2011

Working Java 7 on Ubuntu Oneiric Ocelot 11.10 (update-alternatives)

I still have not figured out why the default openjdk installation on Ubuntu 11.10 seems broken. With broken I mean that there are no entries in the alternatives database and no command in the path (which follows from not being the default alternative).

As a consequence, I did the same old mumbo jumbo with update-alternatives. As the openjdk-7 is in /usr/lib/jvm/java-7-openjdk-i386/, I just run the following commands:

% sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-openjdk-i386/bin/java 4 
% sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-openjdk-i386/bin/javac 4     t
% sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-openjdk-i386/bin/jar 4 

I guess I may want to do  the trick for more executable stuff. Moreover, I have no idea whether the browser plugin works or not. It has been ages since I actually used it and right at the moment I do not care. Hope this will be helpful.

After that, just call the appropriate update-alternatives --config ja(vac|va|r) stuff!

I almost forgot... I just installed the plain openjdk-7-jdk/jdr stuff from the official ubuntu repositories.

Besides... I have seen a package sun-java-{yadda-yadda}-bin which may have been the provider of the links in the first place (when I was using sun's JDK which was correctly packaged). Right at the moment I cannot see a similar package for OpenJDK. My Ubuntu went postal recently and consequently I cannot verify. :(

Friday, October 28, 2011

Ubuntu 11.10

Yesterday I decided to update my netbook to the last incarnation of the Ubuntu distribution. In the past days I read something about bad bugs in the kernel regarding power saving and similar stuff; however, nothing happened here (yet).

I was quite amazed to find a Linux 3.0 kernel. It is the single event that made me think how little I keep myself informed about Linux specific stuff. I still find it hard to study all the languages, technologies and theory which has to do with my work (which is also responsible for me posting very little, lately) and my generic interests (functional programming, for example). I simply dropped most stuff regarding system administration and even platforms. In fact, I haven't upgraded to Lion either.

So I don't know a thing about this Linux 3.0 kernel. On the other hand I remember I followed very closely the new features of the 2.2, 2.4 and 2.6 kernels. In fact, I have also some memories of stuff before that (I used mkLinux, though). I think this means I'm just growing older.

Anyway... I still don't like Unity. However, I'm one of those guys who basically open up a shell a fire some stuff from there (editor, interpreters and compilers). Or occasionally I open IntelliJ/PyCharm. So really, I'm not entitled to talk about that. I simply noticed that the colours moved from that tiring orange to shades of green which are just easier on my eyes. Nothing important. I just find it nice not to have the gnome menus, since I have a very very tiny screen. In this sense, my iPad screen feels just larger (even though it is not). I think it simply depends on the way applications are designed.

I just found out that for some reason I do not have Java properly installed, even if before the update I did have it. It felt akward to run clojure and get a "command not found: java" error; especially considering that up to 5 minutes before that I was debugging a Java project inside IntelliJ. Though I think it has something to do with my current installation of OpenJDK 7.

About the "good" things... Now leiningen is packaged (and decently recen, as far as I can tell); moreover, also clojure 1.2 (and contrib) are installable packages. Perhapsit could be enough... Waiting for Clojure 1.3, by the way.

Wednesday, October 13, 2010

Ubuntu 10.10: so far, so good

On October 11th I decided to upgrade to the new ubuntu. I wanted to try the update procedure, as:
  1. It's not a big issue to reinstall afterwards (right now Linux is not critical for my job)
  2. I was really curious (and scared, from what I read on the web... but well, if OS X manages to just update, why Ubuntu should not?)
First I updated the system to the latest version as recomended. Then, I started the proper upgrade process. The installation process took *hours*. Not only because of the download process (here at the University we've got a pretty fast connection ;) ). It was just the setup/configure process. It took somethink like five or six bloody hours (I don't know, since I left the netbook on and went home). Besides, having question asked during the installation process (question blocking the process) means you have to be in front of the monitor for the whole process. So the day after I found some nice blocking panes asking me silly questions[0]. Then it also stopped responding to input. I inadvertently touched the shut down key and the system ignored my tentatives to press the cancel button. However, Ubuntu rebooted the half installed system fine (I think that it was just setting up unimportant applicative packages when I interrupted the procedure). dpkg --configure -a and now *everything* is fine. Perhaps I have been lucky, but I think they are doing a great job. I was expecting an epic failure (my fault, by the way). Usage impressions another day. Maybe. Or maybe not.

Monday, August 16, 2010

Why I hate binary package managers...

No matter how many packages they have: they always miss some. Or some sensible configuration.
E.g., my Ubuntu does not have Racket in the package list. The more recent PLT scheme it has is PLT 4.2.1.
And that is rather good... afterall in April (that is to say when this Ubuntu came out) there was PLT-Scheme 4.2.5. Yes, I know... if I want something done I could always do it.

There is worse... The packaged Gambit version is 4.2. There have been many major improvements to Gambit since then (it has reached version 4.6; 4.2 is about two years old, maybe more). And if I have a package manager, but still have to install things by hand...

Sunday, August 8, 2010

Pydistutil Configuration

Something I rather hate is mixing up my development environment with my ordinary system environment. I like having things I installed by myself separated from system stuff (and I'm not the only one... think about the convention of /usr/local).

My development machine are essentially single user machines. I am the only user. Thus, global installations are simply an overkill. And I hate pervasive package management systems. For the MacOS, for example, I chose brew. I love it. It does the minimum to automate tedious stuff, but it leaves me complete freedom.

Of course, since I want my package manager to do the minimum necessary stuff, I don't want it to touch my python modules.
Don't touch my Python!
 Well... anyway. As a consequence I heavily rely on python own module manager, that is to say pip/easy_install. You can tell distutils the default base install directory. For example, on Linux, I have in my home directory this .pydistutil.cfg file:

% cat .pydistutils.cfg  
[install]
prefix = ~/.local
install_scripts = ~/bin
install_lib = ~/.local/lib/python$py_version_short/site-packages

which basically makes all the installation in my home-directory.
More information here and here. I use this for modules I plan to use in multiple projects.
Otherwise, virtualenv.

Monday, August 6, 2007

My Yellow Dog ate my Red Hat.

I've always been one of the (not so) few geeks who run Linux on PowerPC.
Sometime ago, Linus himself was one of us, however, it appears that now
he uses a different machine.
Since Apple dropped PPC, the Linux PPC world is quite in turmoil. The architecture is perceived as almost dead. However, new interest comes from the Linux on PS3 projects.
In any case Ubuntu dropped official support for PPC. That was a sad piece of new, since I was quite satisfied with it. I had to recompile the kernel in order to fully support my machine (but this would have been solved in successive releases).
I got back to Debian. I've been a Debian user since Woody, and I liked it ever since. I was a Debian unstable user, and I have always been satisfied with it. However, this time it was different. I've had many more troubles: each upgrade broke something I needed.
I don't know if it's a matter of developers paying more attention to Ubuntu or whatever: the point is that using Debian unstable as a 'reliable' desktop system on power pc seemed quite hard. I don't want to blame Debian developers: it's unstable. No warranties. I used it at my own risk.
Since Debian is unsuitable for my present needs (no hassle, no config, no time), I considered switching Yellow Dog. I know that these days a PPC community mantained version of Ubuntu has been released.
ydl5-2007-08-6-10-27.jpg
I bought a Yellow Dog Enhanced account, since I did want to support their work and I was interested in support, if something was not perferct in the first place. Remember, no time.
I installed the distribution from the DVD. My hardware was entirely recognized correctly. From the soundcard to the backlit keyboard. My video card should also work with dual head, though I haven't tried it yet. YD comes with a nice GUI to do this.
The only thing that was not working was the airport card. I just had to get the fwcutter and extract the firmware. Then it worked. Moreover, the network applet that stays in the notification area works great. I don't know why, but in Debian and Ubuntu for some reasons it did not work properly (in Ubuntu from a certain moment the whole network-manager stopped working). I did not investigate as I needed less time to write a couple of shell scripts to configure the network interfaces when I needed to switch.
I have always been skeptical about rpm-based distros. Once I used SuSE, but after using Debian I got somewhat convinced of the superiority of the Debian packages. More accurate studies on rpm done recently seem to go in another direction: it was not that deb is better than rpm. It is just that deb repositories were maintained more carefully.
YellowDog repositories are maintained quite carefully. However, there is not a lot of software. I suppose something like 1000 packages (Debian has got ten times that). So I had to learn how to cook my own rpms or simply build software from sources and install it with make install. This is probably the major drawback. However, I'm pretty satisfied with Yellow Dog.

Sunday, July 29, 2007

About autotools, YellowDog, Prolog and Xpm

A few days ago, I switched to Yellow Dog for my powerbook.

I'm very satisfied with the hardware support. It's the first distro that supported my backlit keyboard from the beginning. However, it lacks a lot of software packages. Most of them can be taken from Fedora PPC (it's advised to use those of Fedora Core 5 or). However, other must be compiled.

For example, I had to compile swi-prolog, since the software I'm working on at the moment is written in Prolog. Swi Prolog itself was easy to install. I compiled it and I had it working in a few minutes. However, I was unable to compile XPCE. While I do not use the library itself, I find it useful sometimes to use gtrace or the 'graphic' help.

The problem reported was that Xpm was not found. However, I installed both libxpm and its development files. The ./configure script reported that it was not able to link against libXpm.

I first tried manually linking and it worked, so I had a look at the log. In fact it wasn't libxpm fault. The test program tried to link both libxpm and libxt, and the latter failed. Amazingly, the configure script did not check for errors in linking libxt, so the erroro reported was totally misleading.

The problem was that there was no libXt.so, but only libXt.so.6. I had to manually create the symbolic link.

Eventually, I bumped into another error (this time during 'make'). The culprit was once again Xt: it seemed that some of its 'standard' header files were missing. I found a fedora 5 devel package that fixed that and I was able to compile xpce.

Quite unfortunately, I can't use it now. Another bug in the installation of xorg conjures against me. This bug can be seen using a Tkinter canvas too. The problem is that 'names' of colors are not found (probably because rgb.txt is in the wrong place). Xpce fails and so does many stuff with Tkinter. I don't know where rgb.txt should be. I tried to put it in standard places, but up to now the server does not find it. The problem is that I have to restart the server each time (and since sometimes this hangs the whole system, I have to reboot, and Red Hat derived distros have slow boots.)

Wednesday, April 25, 2007

Illuminated keyboard on PowerBook G4 and Linux.

An image is worth a thousand words.

It was a matter of mod-probing i2c-dev.

It is a custom Linux 2.6.20 Kernel on Debian Unstable. Cool!

Wednesday, March 21, 2007

Welcome Home, Debian! (Ubuntu PPC discontinued?)

Ubuntu discontinued?

Recently there are rumors that Ubuntu PPC will be discontinued.

In fact there is an IRC log about it:

Something asked a few times: Will PPC support be discontinued soon?

We will make a final decision on PPC for Feisty by the end of next week

if there is sufficient community contribution on this, then the community port can be just as good as a Canonical-supported one

we would keep the builds in place, but not block the release if things failed to build

so if people step up to unblock issues when they occur, then PPC would be on the same footing as it currently is

sabdfl, will "but ps3 is ppc" be a valid argument? (asked a few times as well)

the extra architecture costs us a lot in terms of testing bandwidth at release time, and figuring out issues like how to deal with the live CD are compicated

if SONY fund Ubuntu-on-PS3 then I guarantee it will happen :-)

I have to say I've not been pleased about it. Of course Canonical should make its own interests: that is to say, if they feel that supporting PPC is not worth it, they are doing the right thing. However, it's quite sad: there are a loto of perfectly functioning G3, G4 and G5 machines out there. Dropping support like this, seems to be the way commercial companies act.

The point is that we must realize that Canonical is a commercial company. You just can't do anything about it and accept it.

Since at the moment I run Linux mostly on a PPC machine (my notebook), PPC support becomes a key factor in chosing the right distribution. My choice was obvious: I had been using Debian for ages before Ubuntu, why not going back to Debian? Welcome home, Debian!

Debian PPC

I downloaded the DVD iso for testing. Since I'm running on PPC, the new graphical installer is still experimental. Moreover, I quite feel at home with good old Debian textual installer.

Installation was really smooth. Debian recognised all my hardware with no need for manual intervention. Of course the airport card did not work without bcm43xx-fwcutter. Unfortunately enough, I left my working ethernet cable at the university, in the office I share with some fellow students. This was just a small delay.

Quite interesting Debian recognised my display better than Ubuntu (I still don't know why, but I had to set the resolution manually or Ubuntu would not start X11). However, Debian did not preload pbbuttons (that are used for the notebook multimedia keys, volume, lcd backlight, etc).

In fact I think a noob prefers to find a system with no multimedia buttons and working graphics than vice-versa. It seems that the guys at Debian did a pretty good work. Nonetheless, I'm quite sad for the exclusion of pbbuttons: I did chose a macro-package (when installing) called 'laptop' or something like that. I think that pbbuttons should be included in the first DVD. In fact most PPC machine out there should be laptops (well, maybe not 'most', but surely a great number).

Everything else worked smoothly. I recompiled the kernel (I would like to have that backlit keyboard working, it should work even with the 2.6.18 default kernel, but maybe something useful was not compiled into it). The backlit keyboard still does not work, which is a pity, but is something I can live without. Beryl does not work too (but it didn't work with Ubuntu, either). And it should work. But that is another thing I can happily live without.

Friday, December 22, 2006

.Xmodmap hex digits

I's a couple of day I'm hacking with xmodmap and keycodes to make my keyboard behave as I expect.

Recently it sprang to my mind that with SuSE 7.1 I used a utility called xkeycaps.

Unfortunately enough xkeycaps generates an .Xmodmap with keycodes expressed as hex numbers, while xev shows code as decimal numbers

This simple ruby oneliner converts an .Xmodmap file with hex codes to one with decimal codes

cat .Xmodmap.hex |
ruby -n -e "if $_ =~ /keycode\s*(0x[A-F0-9][A-F0-9])\s*=\s*(.+?)\n/; puts \"keycode #{$1.hex} = #{$2} \" else puts $_ end">
.Xmodmap.dec
provided you called the hex .Xmodmap '.Xmodmap.hex'.

Monday, December 18, 2006

Windowmaker

How much I love windowmaker...

Now it is much less used than once... Most people do use KDE or GNOME (or XFCE) and the good old Window Managers are kind of forgotten (or maybe simply unknown to the masses). However, when I started KDE was slow and took every single byte of RAM from my machine. GNOME was somewhat lighter. However, the desktop environment was not polished and practical (it wasn't even the 2.0).

In fact some window managers/desktop environment had higher usability (at least in my opinion) even though you had to renounce to a good file-manager (and back than gmc/nautilus was not as good as today).One of those is WindowMaker.

Simple and powerful. As it is today. Well... I restored it on my Ubuntu. Without the debian menu you have to build the application menu yourself (and that is a pain in the ass). However, since most of the times I'm only using firefox, emacs and a terminal, I managed to do it in a very short time.

Sunday, November 12, 2006

Ubuntu on Powerbook G4 (Trackpad Synaptics Two finger scroll multibutton emulation)

After such a long title (mainly for tagging reasons) I suppose I have to write a long article.
One of the things I didn't really like about Ubuntu standard configuration, was the track-pad.
In fact, although correctly recognized (using the synaptics Xorg driver) default was really poor: the mouse moved so slowly it was unusable. For the first hours you can use an external three button mouse and live happily. However, I wanted to fix my track-pad. I found some articles on the net.
There are plenty of blog posts on this subject and if you use synaptics as a key you find even more. This is a good starting point. However, I strongly advise to read synaptics manual (man synaptics). It is synaptics with a trailing s, not synaptic, the package manager.
If you read the manual, you get a lot of informations about how to configure your trackpad. You also have some GUI configurators (gsynaptics, ksynaptics, qsynaptics). They offer less
Options (but are easier to use).
While I was able to set tracking speed and acceleration correctly (mainly using the link I posted) I'm still somewhat unsatisfied with scrolling facilities. Two finger scroll does not seem to work, and edge scrolling (using the edges of the trackpad to scroll) is far from perfect.
The best thing is that I can use tapping to emulate buttons. Tapping in the right upper corner is a middle click and right lower a right click. Now I can use the powerbook without an external mouse.
I'm to post my xorg.conf. And remember... using 'radeon' codecs instead of 'ati' should be a good thing (I've not investigated, I only read it somewhere)
My XOrg:
# /etc/X11/xorg.conf (xorg X Window System server configuration file) 
# 
# This file was generated by dexconf, the Debian X Configuration tool, using 
# values from the debconf database. 
# 
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page. 
# (Type "man /etc/X11/xorg.conf" at the shell prompt.) 
# 
# This file is automatically updated on xserver-xorg package upgrades *only* 
# if it has not been modified since the last upgrade of the xserver-xorg 
# package. 
# 
# If you have edited this file but would like it to be automatically updated 
# again, run the following command: 
#   sudo dpkg-reconfigure -phigh xserver-xorg  
Section "Files"         
FontPath        "/usr/share/X11/fonts/misc"         
FontPath        "/usr/share/X11/fonts/cyrillic"         
FontPath        "/usr/share/X11/fonts/100dpi/:unscaled"         
FontPath        "/usr/share/X11/fonts/75dpi/:unscaled"         
FontPath        "/usr/share/X11/fonts/Type1"         
FontPath        "/usr/share/X11/fonts/100dpi"         
FontPath        "/usr/share/X11/fonts/75dpi"         
FontPath        "/usr/share/fonts/X11/misc"         # path to defoma fonts         
FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" 
End
Section "Module"         
        Load        "i2c"         
        Load        "bitmap"         
        Load        "ddc"         
        Load        "dri"         #
        Load        "dbe"         
        Load        "extmod"         
        Load        "freetype"         
        Load        "glx"         
        Load        "int10"         #
        Load        "record"         #
        Load        "v4l"         
        Load        "type1"         
        Load        "vbe" 
End
Section "InputDevice"         
Identifier        "Generic Keyboard"         
Driver                "kbd"         
        Option                "CoreKeyboard"         
        Option                "XkbRules""xorg"         
        Option                "XkbModel""pc105"         
        Option                "XkbLayout""it"         
        Option                "Xkb
        Options""lv3:ralt_switch"         
        Option                "XkbVariant""nodeadkeys" 
End
Section "InputDevice"         
Identifier        "Configured Mouse"         
Driver                "mouse"         
        Option                "Device""/dev/input/mice"         
        Option                "Protocol""ExplorerPS/2"         
        Option                "ZAxisMapping""4 5"         
        Option                "Emulate3Buttons""true" 
End
Section "InputDevice"          
Identifier         "Synaptics Touchpad"          
Driver                 "synaptics"          
        Option                "CorePointer"         
        Option                 "SendCoreEvents""true"          
        Option                 "Device""/dev/psaux"          
        Option                 "Protocol""auto-dev"          
        Option                 "SHMConfig""true"          
        Option                 "MinSpeed""0.30"          
        Option                 "MaxSpeed""1.10"          
        Option                 "EdgeMotionMinSpeed""200"          
        Option                 "EdgeMotionMaxSpeed""200"          
        Option                 "FastTaps""1"          
        Option                 "MaxTapTime""100"          
        Option                 "AccelFactor""0.030"          
        Option                 "HorizScrollDelta""0"          
        Option                "VertTwoFingerScroll""1"         
        Option                "HorizTwoFingerScroll""1"         
        Option                "CircularScrolling""1"         
        Option                "CircScrollTrigger""0"         
        Option                 "FingerLow""1"          
        Option                 "FingerHigh""3"          
        Option                 "LeftEdge""80"          
        Option                 "TopEdge""80"          
        Option                 "RightEdge""850"                  
        Option                 "BottomEdge""560"          
        Option                 "TapButton1""1"  
End
Section "Device"         
Identifier        "ATI Technologies, Inc. RV350 NP [Mobility Radeon 9600/9700 M10/M11]"         
Driver                "radeon"         
BusID                "PCI:0:16:0"         
        Option                "UseFBDev""true"         
End
Section "Monitor"         Identifier        "Generic Monitor"         
        Option                "DPMS" 
End
Section "Screen"         
Identifier        "Default Screen"         
Device                "ATI Technologies, Inc. RV350 NP [Mobility Radeon 9600/9700 M10/M11]"         
Monitor                "Generic Monitor"         
Default
        Depth        24         Sub
Section "Display"                 
        Depth                1                 
        Modes                "1280x786"         
End
Subsection "Display"                 
        Depth                4                 
        Modes                "1280x786"         
End
Subsection "Display"                 
        Depth                8                 
        Modes                "1280x786"         
End
Subsection "Display"                 
        Depth                15                 
        Modes                "1280x786"         
End
Subsection "Display"                 
        Depth                16                 
        Modes                "1280x786"         
End
Subsection "Display"                 
        Depth                24                 
        Modes                "1280x786"         
End 
End
Section "ServerLayout"         
Identifier        "Default Layout"         
Screen                "Default Screen"         
InputDevice        "Generic Keyboard"         
InputDevice        "Synaptics Touchpad"         
InputDevice        "Configured Mouse" 
End
Section "DRI"         
Mode        0666 
End

Ubuntu Edgy 6.10 on Powerbook G4 (general)

Recently I had to install a GNU/Linux system on my notebook. Mywork-group is heavily Linux-based and the software which I'm going touse/extend for my thesis at the moment compiles only on Linux (andprobably on BSD, however, not on MacOS X). Although it's a Prologsoftware some parts are written in C++ and I haven't had time to makeit work on MacOS X. Modifications are quite trivial (it's a matter ofbuilding a dylib). However, I should port the build system to libtoolto make it work on both platforms.

So I decided to install a GNU/Linux distribution. My first choice was Fedora. I'm not particularly fond of RH little sister, but that is the first choice in my team. The PPC version quite sucks. It's not that things do not work: simply it seems just a bit more than a recompilation of the x86 version. For example package pbbuttons (that makes multimedia keys of my pb work, wasn't even on the repositories). It's not that I particularly want to have the buttons working: it is like those who built it never used it. I mean no one ever tried to use it on a notebook? Moreover, it's painfully slow. Six minutes to boot. To start some applications (Emacs, the gnome 'quick' disc burner, etc) it takes minutes. This does not happen on the x86 version.

Partitioning

So I tried Ubuntu 6.10. It's heaven. Everything worked without my intervention. Well, almost everything.

The live CD did not recognize properly my screen. It thought it was a 20000x30000 pixel screen (and of course that was *wrong*): I just had to fix that manually. After booting the live CD, I started the installation. Everything went quite smoothly. Details in next posts

Saturday, March 25, 2006

Office? Ajax

Linspire batte Google nella corsa all'Office su web.
Provatolo funziona, ma è anche molto limitato. L'importazione di documenti word non eccessivamente complessi è ben fatta. Le capacità di editing, limitate.
Inoltre non è ben chiara la licenza del prodotto (al momento). Alla domanda "Come lo scarico" viene spiegato come usarlo online [ questo ha senso visto che è pensato per essere usato online, ma immagino che se fosse open dovrebbero rilasciare i sorgenti da qualche parte ].
Le potenzialità ci sono, anche se con l'ultima versione di Firefox compilato per Intel su MacIntel paiono esserci dei bachi.
Un ultima nota sul sito: sembrano abbiano fatto lo stesso errore di tutti i principianti che usano Ajax. Ovvero abusarne. Attenzione dunque ai bookmarks che non si comportano come dovuto.
Link homepageNotizia su Linux Filter

Thursday, March 23, 2006

Install gmp with c++ with Dynamic Libraries.

I have to admit I'm a libtool noob. However I know gcc and g++ 4.0.1 available with MacOS Tiger are able to compile c++ dynamic libraries. In fact this is done with flag -dynamiclib
However, gmp if configured with --enable-cxx and without disabling dyamic libraries fails. In fact it passes g++ the -shared option (that works for linux). If you compile plain gmp with no C++ support, the problem does not exist. I'm afraid it's a bug with gmp libtool (I suppose you could fix it with autoreconf, but I did not try it).
Unfortunately I need c++ support since I have to work with ppl. The solution is to modify all occurrences of "-shared" in the configure file with "-dynamiclib". And appears not to work.
The same hack worked with readline (but I'm afraid that's because readline was written in C and somehow support for C dynamic libraries seems better on mac os x: I'd say "older", so it's more likely developers made it work.
However darwin ports is able to build it the correct way. You only have to specify somewhere that gmp-cxx-wrappers should build with --host=none-apple-darwin

Thursday, March 16, 2006

SuSE 10

I know this ain't no piece of news... still I installed SuSE Linux today and I found it really well done and "easy" just from a visive point (that means the user is more likely not to panic).

Really well done. Still I'm in love with Debian.

Tuesday, March 14, 2006

Developing on Mac, Win, Linux (Database - pt. 2)

Databases

Databases on Linux range from trivial to very easy. Of course I'm talking about Postgres (my db of choice), SQLite, and, ahem MySQL. I've no informations on Oracle, I should try it one of these days. If you have to develop with MS SQL (one of the best MS products out there), of course you may want to use Windows.

MySQL

MySQL can be installed really easily on Linux/fBSD and all. It's a matter of aptgetting/rpming. You can also install that way all the bindings for different languages (beware, most are GPL, if you want to develop closed source apps, take this into account).

On Windows there is a beautifully crafted package. Double click and go.

On MacOS there is a .pkg that installs everything, even a PreferencePane to start and stop MySQL. There is also a StartupItem. Well, it works quite good (a part from suboptimal performance).

SQLite

On Linux same old story. Apt-get. Language bindings as above.

On MacOS X it's already installed. It's also the basis for CoreData. Ruby bindings are easily installed. I haven't tried Python ones (but should be a matter of compiling a python package) nor Perl. I don't use PHP at all (well, not if I can avoid).

I've not tried directly with Windows. However I see there are some precompiled that should just work fine.

PostgreSQL

This is my favourite database. Installing on linux is as easy as any other db. On MacOS I found no "pretty installer" a-la MySQL. You have to configure a bit of permissions and users. Not difficult, but more difficult than on GNU/Linux. Again, for FreeBSD applies what I told for linux.

Developing on Mac, Win, Linux (Editors - pt. 1)

I kind have to tell something about me, since it better helps understanding my position.

I chose MacOS X as my main developing platform. Of course it happens to write software meant to run on GNU/Linux (or other *nix flavours) or even on Win. Usually when this happens I'm using a cross platoform technology. I never wrote something longer than 100 lines with the WinAPI, for example.

Before I used GNU/Linux, fBSD and even before other unices (OSF1) and MacOS "Classic". This is my background. I never quite got exposed to windows. So my point is unusual: most people come from windows to other platforms. To me is quite the contrary (a part that I don't "go" to windows, I just happen to use it from time to time).

About programming environments, I've done (and do) lots of things. I like high level languages, such as Python or Ruby. I like ObjectiveC and Cocoa (of course this won't be in our comparison...). But also do a lot of low level C coding with the POSIX api (well I did... right now I prefer to do it in Python), develope some software in C++, I'm going to graduate with a project in Prolog. I quite like XML and CSS and I also have to use some Java and some calculus (both Matlab and C -- no, I don't quite master Fortran)

So my skills are not particulary vertical (for example someone who does all his job in the XML processing fields, or numeric calculus). They range in many different fields (this does not mean I'm really "guru" in each of them, on the contrary I've got much to learn).

Editors

Basically those who work in the Linux community used to share in equal parts between Emacs and vim. There used to be some other editors (nedit), but that was the story. Recently I've seen a lot interest around IDEs (kdevelop, anjuta) and some "lesser" editors have reached the status of full programmer's editors. Among these Scite and Kate, for example. Moreover HTML/web centric editors have also increased their popularity.

On the other side the Windows community has always been more IDE oriented. There were the Borland products, Microsoft Visual Studio, Wacom. The most used web environments were Dreameaver and Homesite (now builtin in dw).

Of course there were also a bunch of editors.

Linux pt. 1

If I have to work on Linux, I've got no problems of any sort. I'm average skilled both in vim and in Emacs and I can make it. I do use Aquamacs (an Emacs version) even on the MacOS: once I preferred vim, but right now I need some things Emacs has and vi hasn't (a decent Prolog mode, for example).

Windows

About an year and an half/two years ago I had to develop an application with Twisted. For a 0-based array of reasons I used Windows as my main developement environment. I installed entought python (and in those times there was no Python 2.4, so no problem), I put Twisted 1.3 on the top of it and chose gvim. Gvim is beautifully integrated with windows. Of course it acts quite much like vim does (i don't like the evim variant). I did it. Still I wasn't using windows. I cloned my linux environment on Windows. And it is what I made when I had to code some C++ with mingw and so on.

I chose to use gvim not because I really wanted to, but because other editors were really priced or poor. Yes I tried scintilla too. Not particulary poor, of course not priced... but in fact too simple.

Windows and MacOS

If you compare the situation with the MacOS it's tragic. MacOS has many "simple" editors that I do not really like (but some love SubEthaEdit or Smultron), but it has also BBEdit (the best web editing environment I've seen, much better than dreamweaver and priced 199$ - 129$ for TextWrangler users -- TW is a free editor everybody can download and use ). And it has TextMate: the best general programmer editor a part from Emacs.

UltraEdit (Windows)

Recently I had to do some more work: I tried UltraEdit, priced 39 $. The same as TextMate. A couple of users said it is a wonderful editor and I gave it a try. Out of the box it did not support nor Python nor Ruby. Quite annoying in fact.

I googled the solution and I find I had to copy some strings in a file. The format is awful. Where TM has a lot of small bundles, BBEdit has plugins, UltraEdit has only this big flatfile. Ok. What matters is functionality.

But functionality is missing. For example Python or Ruby indenting is really disappointing. TextMate indents code back and forth to match the syntax of the code. It takes less time to try than to read. If you haven't a Mac, Emacs does it.

TextMate also has lots of ways (and easy one) for saving me from typing lots of code. Snippets are poweful, and I also have commands (snippets are short words or commands that are expandend to full constructs with placeholders to fill in).

I find nothing like this (nothing that simple) in UltraEdit or in Scintilla. Not that Scintilla is not a bad editor. It correctly deals with a lot of languages, the syntax theme is clear and easily readable (I think I should do a "Scintilla Theme" for TextMate one day). With Python/Ruby it lets you run or check syntax directly from editor.

And UltraEdit (in the Studio Version) is a very good "tiny ide"-"enhanced editor" for Java, for example (but we are at 99$). Much better than BBEdit or TextMate in Java editing. It's fast and has some useful basical functions. Of course Eclipse or NetBeans do a lot more stuff, but UltraEdit Studio takes a couple on microseconds to load.

I've not tried it with PHP and HTML (have I already said I don't use PHP?), but it appears to be really good. I just can't stand feature bloated IDEs like DreamWeaver. They tend to make the programmer not to think... but that's another story.

The many windows editors

It could be a matter of taste. Another friend of mine who did a lot of coding in Windows suggested another text editor (I don't even remember the name of the editor -- I still remember my friend's name of course). Probably among all editors out there (more or less shareware) there is the one that suits my taste (a part from the Emacs/gvim variants). Still everybody knows a good way to fuck up a windows installation is to install and try software (I know ghost, but it looks like I've no time to waste to play with software).

GNU/Linux pt. 2

Again... GNU/Linux is quite convenient in this sense. Emacs and vim are wonderful editors (and they are both free and free). They can be extended to do almost everything (think about Emacs mode to make it a Java IDE or the Auctex package).

They are both available for Windows and Mac, but additional packages are not as easy to install (on Debian is a matter of aptgetting...)

About the IDEs... well, KDevelop is told to be really good. Probably For sure it outperforms XCode, but should be not as good as MS Vistal Studio, even if it should support more languages (so if you need one of those...). So depends on what you have to do... anyway it's a really good IDE, nothing to say... but :)

Windows pt 2

I tried some more editors. Notepad++ is nice (but not really suited for Python or Ruby: in this sense Scite is much better).

I tried Komodo, and it's wonderful (and also cross-platform). The best thing it does are easy debugging and intellisense like for dynamic languages (tried with python and ruby, it should work with PHP and Perl too). Unfortunately the full version costs almost 300 bucks. If you don't develop professionally you can buy the "personal or educational" version, that at 29$ is quite affordable.

Anyway some things in Komodo to me look quite akward, while TextMate is as easy as poweful. Of course comparing Komodo to TM in Rails editing is playing dirty. TM is the editor of choice of Rails developers. And Komode has that intellisense... well, I think it should be great (even if I didn't really use it, so I think I'm not really gonna miss it).

I've seen there are a lot of targetted small IDEs that are worth trying, but I'm not gonna spend all my time this way.

Next time I'm gonna talk about databases