Friday, December 26, 2008

Nokia 6630 and Internet Connection in Linux

Finally, I managed to connect to the Internet with my Nokia 6630 in Linux Kubuntu; it's not that I had troubles before: it's just that I had never had to connect with the cellphone, and I must admit that I quite appreciated that it was really easy and straightforward to this :-)

Actually, first I had tried with the bluetooth way and thanks to many documentation found on the web, I succeeded, though the procedure might not be trivial. However, in that case, I noticed that the connection was not reliable and not very fast. So I decided to buy a (quite expensive for what it does) USB cable (it's just a usb cable... why does it cost 20 euros?!).

Well, with USB the procedure is even more trivial: you just connect it and you'll see that dmesg happily reports this:

[ 149.162045] usb 3-2: new full speed USB device using uhci_hcd and address 2
[ 149.207194] usb 3-2: configuration #1 chosen from 1 choice
[ 149.461122] cdc_acm 3-2:1.8: ttyACM0: USB ACM device
[ 149.463589] usbcore: registered new interface driver cdc_acm
[ 149.463594] /build/buildd/linux-2.6.24/drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters
Isn't it nice? It correctly detects the modem and creates a device for it!
ll /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 2008-12-24 17:28 /dev/ttyACM0
So you'll just have to configure your dialup tool using that specific modem. In particular I use kppp, and I have a TIM connection, so I created a new modem using /dev/ttyACM0 and setting as INIT 2 string the following one:
AT+cgdcont=,"ip","ibox.tim.it"
and as for the telephone number *99# (username and password are not used, so you can use dummy ones). Here are some screenshots:



And then you're online! Not as fast as an ADSL... but still faster than an old serial modem ;-)

Monday, December 22, 2008

PhpBibliography 0.6

The new release of PhpBibliography is out!

First of all, this release fixes a very bad bug, discovered by Ezio Bartocci: in the merge authors procedure, the system did not check whether the two authors were exactly the same (i.e., the same id), and this used to lead to the removal of the author as the final step of the procedure, which was really bad. This is now fixed in this new release.

Concerning new functionalities:

  • a procedure for trying to detect duplicate papers is now available (it can also use the SOUNDEX algorithm); this will present possible duplicate papers, and let the user select those that are actually duplicate ones;
  • as for the main page, it is now possible to group papers also according to the years (an example can be found at my home page);
  • by default, papers are ordered by descending year, so that the most recent papers are shown first (this should be the most common wanted behavior);
  • a modification timestamp is automatically added to papers, and this timestamp is used as a sorting criterion when showing papers (the papers most recently modified are shown first)
  • another desirable feature is now available: when listing papers in administration mode (i.e., when you're logged), a direct edit/delete link is always shown;
  • each paper can be now marked as private, meaning that that specific paper will be shown only to logged users;
  • as for the DBLP import procedure, this was improved: when there is a cross reference (typically concerning the proceeding book where the paper was published), which is separate from the paper's own bibitem, the system will merge the two bibitems, so that the resulting inserted paper will contain all the information.
Finally, in the previous release 0.5 announcement, I forgot to mention that phpbibliography makes use of AJAX technology to perform some checks during the insertion/modification of a paper through the HTML form; in particular, it shows some warning messages for possible duplicate fields (e.g., title, bibtex key, etc.) and error messages when the type of the field is not correct (e.g., non numeric years). These messages are shown right under the field, upon leaving that field, as shown in the following screenshots:


The user specifies a non-numeric year

and the system checks it as soon as it leaves that field.

The same holds for instance for the title, but this time it's just a warning (since you can have two papers with the same title, e.g., one can be an extended version):

Saturday, November 15, 2008

GNU Source-Highlight 2.11

Here's the new release of GNU Source-Highlight.

From the low level point of view, the algorithm for finding the best matching regular expression was optimized; The strategy used by source-highlight is to select the first matching rule

  • with empty prefix (or prefix containing only space characters, i.e., spaces or tabs) or
  • with the smallest prefix.
Thus, it does not inspect all the possible expressions, but it stops as soon as it finds one that satisfies the above conditions.

As for end-user stuff, in C++ and Java, types used in variable and parameter definitions are now highlighted, see the example below.

/*
This is a classical Hello program
to test source-highlight with Java programs.

to have an html translation type

source-highlight -s java -f html --input Hello.java --output Hello.html

source-highlight -s java -f html < Hello.java > Hello.html

or type source-highlight --help for the list of options

written by
Lorenzo Bettini

http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite
*/

package hello;

import java.io.* ;

/**
* <p>
* A simple Hello World class, used to demonstrate some
* features of Java source highlighting.
* </p>

* TODO: nothing, just to show an highlighted TODO or FIXME
*
* @author Lorenzo Bettini

* @version 2.0
*/
public class Hello {

int foo = 1998 ;
int hex_foo = 0xCAFEBABE;

boolean b = false;
Integer i = null ;

char c = '\'', d = 'n', e = '\\' ;

String xml = "<tag attr=\"value\">&auml;</tag>", foo2 = "\\" ;


public static void main( String args[] ) {

// just some greetings ;-) /*
System.out.println( "Hello from java2html :-)" ) ;

System.out.println( "\tby Lorenzo Bettini" ) ;
System.out.println( "\thttp://www.lorenzobettini.it" ) ;

if (argc > 0)
String param = argc[0];

//System.out.println( "bye bye... :-D" ) ; // see you soon
}
}

Probably the main novelty is the possibility of specifying a line range, or multiple line ranges: only the lines in the input source that are in that range are actually in the output (--line-range). It is also possible to specify the sorrounding "context", i.e., the number of lines not in range that are put in the output anyway (--range-context); the context itself can be formatted with its own style. Finally, a range separator string can be specified, e.g., "..." (--range-separator). For instance, the following command
source-highlight -s java -f html
--line-range="12-18","29-34" --line-number
--range-context=3 --range-separator="<...>"
-i test.java -o test_linerange_sep.html
generates the following output (note the gray lines of context)

<...>
00009:
00010: or type source-highlight --help for the list of options
00011:
00012: written by
00013: Lorenzo Bettini
00014: http://www.lorenzobettini.it
00015: http://www.gnu.org/software/src-highlite
00016: */
00017:
00018: package hello;
00019:
00020: import java.io.* ;
00021:
<...>
00026: * </p>
00027: * TODO: nothing, just to show an highlighted TODO or FIXME
00028: *
00029: * @author Lorenzo Bettini
00030: * @version 2.0
00031: */
00032: public class Hello {
00033: int foo = 1998 ;
00034: int hex_foo = 0xCAFEBABE;
00035: boolean b = false;
00036: Integer i = null ;
00037: char c = '\'', d = 'n', e = '\\' ;
<...>

Tiziano Muller wrote a configuration file for bash_completion, for source-highlight (thank you Tiziano).

Finally, two new language definitions were added: one for xorg configuration files, and one for the Scala programming language (thanks to Dean Wampler), here are some examples:

Xorg file


# 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.
#
Section "Files"
EndSection
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "HorizEdgeScroll" "0"
Option "MinSpeed" "0.5" # touchpad speed when moving slowly
Option "MaxSpeed" "2.0" # touchpad speed when moving fast
Option "AccelFactor" "0.10"
Option "CircularScrolling" "on"
Option "EdgeMotionMinSpeed" "0.5"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection
Section "Device"
Identifier "Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller"
Driver "intel"
BusID "PCI:0:2:0"
# Option "NoDRI"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Modes "1440x900"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
# Uncomment if you have a wacom tablet
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
InputDevice "Synaptics Touchpad"
EndSection

Scala language


// Example Scala file for source-highlight.
case class Point(x: Double, y: Double)
abstract case class Shape { def draw(): Unit = println(this) }
case class Circle(center: Point, radius: Double) extends Shape
case class Rectangle(lowerLeft: Point, height: Double, width: Double) extends Shape
import scala.actors._
import scala.actors.Actor._
object ShapeDrawer extends Actor {
def act() {
loop {
receive {
case s: Shape => s.draw()
case "exit" => { println("exiting..."); exit }
case x: Any => println("Error: Unknown message! " + x)
}
}
}
}
ShapeDrawer.start()
ShapeDrawer ! Circle(Point(0.0,0.0), 1.0)
ShapeDrawer ! Rectangle(Point(0.0,0.0), 2, 5)
ShapeDrawer ! 3.14159
ShapeDrawer ! "exit"
// Output:
// => Circle(Point(0.0,0.0),1.0)
// => Rectangle(Point(0.0,0.0),2.0,5.0)
// => Error: Unknown message! 3.14159
// => exiting...

Thursday, October 30, 2008

Share your bookmarks with Foxmarks

I fell in love with foxmarks as soon as I started using it, as I had already said in this blog :-)

It looks like lately they've added some new cool features, in particular, what stroke me most was the possibility of sharing only specific folders of your bookmarks (actually, I've just discovered this feature, but it might have been around for some time now...)

If you go to your bookmarks in the foxmarks site, you can see the "Share" menu, and after you selected a specific folder you can share it (including subfolders):


Then you can provide your friend with the public link to see that specific bookmark folder (which, of course, will be kept up to date when you modify the bookmarks in that folder), and also an RSS link!


They also provide you with html or javascript code that you can add to your site or blog to show a nice widget with some of those bookmarks!


Isn't it nice? I find this feature delici... ehm... really amazing ;-)

Wednesday, October 29, 2008

Svn problems in Sabayon with https

On the new Sabayon installation (I guess the problem is in Gentoo too, though), I'm getting errors when accessing to an https repository which does not have a valid certificate (of course I trust that site):

svn checkout https://xxx svn: OPTIONS of 'https://xxx': SSL negotiation failed: SSL error: Key usage violation in certificate has been detected. (https://xxx)

I found this post on ubuntu forums which seems to be related to this very same problem: the neon library, which svn uses to access https sites, uses GNU TLS which does not like this kind of certificates (that's may be fine, but at least, I should give the possibility of choosing, shouldn't I?).

In Sabayon it's pretty easy to solve this problem because you can use emerge and use flags to rebuild the binaries as you wish :-)

In particular, you need to rebuild the neon package disabling the gnutls use option. I did this by changing (or adding) in /etc/portage/package.use this line:

net-misc/neon -gnutls

and then I emerged neon and subversion packages.

Hope this helps :-)

Sunday, October 26, 2008

Linux Mint

I happened to try the live version of this ubuntu-derived Linux distribution, on my laptop, a Dell D630: Linux Mint. I was quite impressed: the aspect is really elegant e beautiful, in a word, mint :-)



The main menu seems to be based on KDE 4, but I think it's better organized.

Then I tried to enable those cool compiz effects, and that's what you get :-)





Probably I'll go on with the installation in the future.
Posted by Picasa

Monday, October 20, 2008

KWin is not restored after removing Compiz

I tried Compiz on a desktop computer, but this made the system pretty slow, so I removed it with synaptic... after a restart, all the windows of the KDE desktop were shown without a frame (thus it was pretty useless). This seems to be a known bug in (k)ubuntu, but the solution

sudo aptitude reinstall kwin
did not work for me (all the windows were still frameless).

The only solution that worked for me was also to remove all the compiz configuration files in my home:
find ~/ -name "*compiz*" -exec rm -rf {} \;
hope this helps :-)