Tuesday, November 20, 2007

Problems in restoring Palm

It's not the first time I forgot to recharge my Palm Tungsten E for a long time; usually I manage to recharge it before it's too late, but this time I actually left my palm on (with the gps application running) so it definitely exhausted all its charge and so it went dead.

So I had to restore it, and, in order to avoid reinstalling all the applications, before performing the first synchronization, I had set the synchronization program to overwrite everything on the palm using the backup on my PC, in particular, the application database.

It went fine, but when I restarted the palm (it was required by the synchronization process) I got the scary error message:

DataMgr.c, Line:xxxx, Index out of range

I don't remember the actual line, but this is quite a typical error message, that requires a reset (the palm does not even switch off).

Fortunately, as I said, this error is quite typical, and you find on google with many results. I was lucky enough to find this post on a forum, and the situation looked quite similar to mine.

The problem seems to be caused by the Saved_Preferences.prc file; so, I removed it from the backup folder on my PC, and tried to perform synchronization again (with the above settings, saying to replace all the applications from the backup of my PC into the palm).

It worked! :-)

Of course, my preferences were lost, but at least my palm was up and running again.

Hope I won't have to reinstall the applications again (at least not until the next time I'll forget to recharge the palm ;-)

Monday, October 29, 2007

Thunderbird won't open http links

Sometimes, in Linux, after an update or a brand new install, Thunderbird won't open http links (e.g., with Firefox). This might depend on some default configuration value of your distribution.

However, the quickest, and, as far as I know, distribution independent solution, is to manually set these preferences in the prefs.js file:

user_pref("network.protocol-handler.app.ftp", "firefox");
user_pref("network.protocol-handler.app.http", "firefox");
user_pref("network.protocol-handler.app.https", "firefox");
where "firefox" can be replaced with your preferred browser.

Alternatively, you might set these settings with the config editor available from the "advanced" tab. You'll probably need to create new entries for these preferences (of type string).

Hope this helps, at least until the problem is fixed in your distribution :-)

Wednesday, October 17, 2007

Wifi-radar and WPA

Under my Debian installation I'm using Wifi-radar, a nice utility for managing wireless networks (although it is a GNOME application, I'm using it under KDE without problems). I've always used for WEP networks, but now I needed to start using also for WPA networks, and in order to deal with such networks, wifi-radar relies on wpa-supplicant, which is also available for Debian.

Thus, you need to setup the configuration file of wpa-supplicant so that wifi-radar can use it (thus, you cannot set WPA parameters from within wifi-radar), but this is not hard to do; for instance, in wpa_supplicant.conf you can put such a stanza:

network={
ssid="network ssid"
key_mgmt=WPA-PSK
proto=WPA
psk="network password"
}
and then you can specify the driver for your card in the "WPA" section of the wifi-radar's configuration dialog (for instance, for my ipw2200 wireless card, I chose wext).

Unfortunately, if you try this way, you'll get an error from wifi-radar due to an undefined variable:

NameError: global name 'WPA_SUPPLICANT_ARGS' is not defined

to solve this problem, I actually modified the wifi-radar script (it's a python script) by changing the line:

wpa_args = WPA_SUPPLICANT_ARGS % ( INTERFACE, profile['wpa_driver'] )

with

wpa_args = "-B -i " + INTERFACE + " -c " + WPA_SUPPLICANT_CONF + " -D " + profile['wpa_driver'] + " -P " + WPA_SUPPLICANT_PIDFILE

and now it seems to work correctly.

Saturday, October 06, 2007

Firmware upgrade for router D-Link DSL-G604T

I've been using this ADSL wireless router, D-LINK DSL-G604T, for almost one year now and I was quite happy with it, unless I discovered that the wireless connection provided by this router was not very good: my ADSL is 4Mb (and indeed with the wired connection I was reaching the full speed, ~500K) but with the wireless connection I was hardly reaching 100K speed, so the wireless connection was pretty slow.

I also tried with some wireless settings of the router (also using WEP and WPA) but nothing was changing (and the wireless embedded card in my laptop is actually OK since I was reaching very high speed with other wireless networks).

I checked the D-Link home site only to discover that this router is not maintained any more (discontinued product) and indeed I couldn't find any updates for it. However, by googling I found this site that was referring to a D-Link site which still provides some information and software about this router: http://www.dlink.com.au/tech. In particular, here I found a quite new firmware version for my router revision (A): V2.00B12.AU 20070509.


I was quite skeptical in trying to update the firmware (the last I had tried this procedure I ruined my previous Atlantic router), furthermore, the firmware in this site is Australian and in the readme file you read that this was tested only for Australian router... However, since the router was not working perfectly for me I decided to have a try: if the router was ruined I was willing to buy a new one :-)

Since my firmware version was 1.x and I was updating to version 2.x, as reported in the documentation in that site, I could not use the web update procedure, but I should use the EXE version, so I downloaded this zip file, which contains the .exe program to update the firmware.

Then I followed this procedure (using instructions found on that site and some instructions found on some other forums):

  1. Factory reset of the router (using the button on the back, pressed for at least 10 seconds)
  2. Connect my computer directly to the router and remove all the other computers from the router
  3. Disable antivirus and firewall on my computer
  4. Give a static IP address to my computer in the range 192.168.1.x (the IP and subnet mask depends on the current firmware in your router; for instance, the site states that the router address is 10.1.1.1, subnet mask 255.0.0.0, but my router has the default IP address 192.168.1.1, subnet 255.255.255.0)
  5. Run the exe program and specify the IP address of the router, 192.168.1.1, and the admin password (which is admin, since it was reset to the default settings)
  6. I did not choose the "corrupted image" checkbox (although it was suggested on some forums)
The upgrade of the firmware started and correctly concluded.

At this point the new firmware is on and the router is still working! :-)

Now the router has to be configured from the start. Since the new firmware is Australian, the default IP of the router is 10.1.1.1 (subnet 255.0.0.0), so I had to configure my computer accordingly in order to access the web interface of the router and perform the configuration (first of all I switched back to the local network 192.168.1.x).

Guess what: the wireless network now works perfectly and at full speed! :-)

With this firmware the router should also support ADSL 2, but I can't confirm this since I still have ADSL 1.

There are some new menus which I still have to go through. However, one thing that changed is that you cannot save the new configuration without rebooting, which was a nice previous feature (at least, I wasn't able to find a way to).

Monday, October 01, 2007

Researcher in Turin

It's with great pleasure that I can announce that today I started to work as a Researcher (in Computer Science) at Dipartimento di Informatica, University of Turin! On 20th September 2007 I won the permanent position, and I'm very happy and proud to work in this department :-)

Tuesday, September 18, 2007

GNU Source-highlight 2.8

Apart from the usual bug fixes, the main novelties of this release are:

  • Language definition for S-Lang (thanks to John E. Davis)
  • Perl and Javascript highlighting was improved
  • C-style comments are not defined as nested (I swear I never knew this, though I've been programming in C++ and Java for years... shame on me :-)
  • The padding character of line numbers can be specified (it does not have to be 0, e.g., it could be a blank space), thanks to Roger Nilsson.
Furthermore, I extended the language definition syntax a little bit, in order to handle, what I called, dynamic backreferences (to distinguish them from the backreferences of standard regular expressions).

With dynamic backreferences you can refer to a string matched by the regular expression of the first element of a delim specification. This is crucial in cases when the rigth delimiter depends on a subexpression matched by the left delimiter; for instance, Lua comments can be of the shape --[[ comment ]] or --[=[ comment ]=], but not --[=[ comment ]] neither --[[ comment ]=] (furthermore, they can be nested). Thus, the regular expression of the right element depends on the one of the left element.

A dynamic backreference is similar to a variable, but there's no declaration, and have the shape of

     @{number}

where number is the number of the marked subexpression in the left delimiter (source-highlight will actually check that such a marked subexpression exists in the left delimiter).

For instance, this is the definition of Lua comments (see also lua.lang):

     environment comment delim `--\[(=*)\[` "]" + @{1} + "]"
multiline nested begin
include "url.lang"
...
end

Notice how the left delimiter can match an optional =, as a marked subexpression, and the right delimiter refers to that with @{1}.

Source-highlight will take care of escaping possible special characters during dynamic backreference substitutions. For instance, suppose that you must substitute | for @{1}, because we matched | with the subexpression [^[:alnum:]] in a delim element like the following one:

     comment delim `([^[:alnum:]])` @{1}

Since | is a special character in regular expression syntax source-highlight will actually replace @{1} with \|.

Finally, although this is not related to this new release of source-highlight, Roger Nilsson wrote a frontend for source-highlight that is used in a popular webdesign app for OSX called RapidWeaver. The frontend is called High-Light and allows users to easily add syntax-colored code inside RapidWeaver.

http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html

Monday, September 17, 2007

Italian Hyphenation in OpenOffice (Debian)

I'm using LaTeX for most of the time for my writings, but for simple and small documents (e.g., letters) I prefer to rely on OpenOffice. I'm actually Italian, but I write most of my documents in English... sometimes, though, I have to go back to my mother tongue ;-) Thus, I wanted to use hyphenation in OpenOffice, under Debian, and so I installed the related packages, in particular, openoffice.org-hyphenation-it.

Unfortunately, hyphenation still did not work... Then, Kent West, in the debian-user mailing list, told me to install hyphenation packages directly from OpenOffice, and it worked! (Thank you Kent!)

I had never used such functionalities in OpenOffice, and they work great! I used the menu File->Wizards->Install Dictionaries and it does most of the work automatically, you just need to retrieve the list of available dictionaries and choose the one you want. Then, you'll find the corresponding dictionary in Options->Language Settings->Writing Aids.