Changing the blog approach

It's time to change.

I admit that I'm doing a bad work on my blog and the main reason is that mainly I don't belive in blogging.

Anyway, I'm reading a book: Technical Blogging: Turn Your Expertise into a Remarkable Online Presence by Antonio Cangiano.

This book convinced me that I was wrong and I need to evolve and try to develop a real blog.

So, during the next weeks, I'm going to rebuild all my website sharing with you my "rebirth" path.

Stay tuned!

xorg.jpg Today I've updated my ArchLinux distro and, magically, xserver stops working.

In the log file /var/log/Xorg.0.log I found the message:

================ WARNING WARNING WARNING WARNING ================
This server has a video driver ABI version of 11.0 that this
driver does not officially support.  Please check
http://www.nvidia.com/ for driver updates or downgrade to an X
server with a supported driver ABI.

It could means the drivers are build for a different version of Xorg (older than the current one in ArchLinux). To solve the problem you can disable the check until the new drivers will be availables.

Just create a file in /etc/X11/xorg.conf.d/ called 20-nvidia.conf with the following code:

Section "ServerFlags"
    Option  "ignoreABI"     "True"
EndSection

If you aready have this file, just add those lines at the end of it. After the reboot you'll be able to use the xserver.

Anyway the nvidia drivers warn you in the log file:

(WW) NVIDIA: The driver will continue to load, but may behave stran
gely.
(WW) NVIDIA: This driver was compiled against the X.Org server SDK
from git commit b6c7b9b2f39e970cedb6bc1e073f901e28cb0fa3 and may 
not be compatible with the final version of this SDK.
(WW) NVIDIA: This server has an unsupported input driver ABI versio
n (have 13.0, need < 13.0).  The driver will continue to load, but
may behave strangely.

and, actually, it behave strangely on my pc :-)

Another script to rename files

programmer_mug-p1682924711369532772ln8f_400.jpg I'm posting another small script to rename files.

I'm working on files with spaces in their name (Oh! The Evil!) and I need to rename them to remove spaces and conver in camel-case.

At this time, I chose Python (version 3) to guarantee the script works also on Windows.

Just create a file called (for example) ToCameCase.py and past into it:

#!/usr/bin/env python3

import sys
import os

if len(sys.argv)<2:
    print("Indicate the file pattern, please")
    exit()

for filename in sys.argv:
    name_tokens = filename.split(" ")
    new_name=""
    for token in name_tokens:
        new_name+=token[0].upper()+token[1:]

    os.rename(filename,new_name)

From the console call the script passing to it the file name o pattern to rename. For example

 ToCameCase.py *.obj

it will convert the name of all the OBJ files in the directory.

Just a warn: it is very simple and only-for-my-usage oriented, so be careful if you use it: read the code and test it before use on your files!

Upgrading to kernel 3 and the sed story of Grub error 15

P1000074-(Small)-754189.JPG Calm down: this is an happy-ending story.

I've recently upgraded my Archlinux machine to linux kernel 3.0.

After that, obviously, I haven't be able to boot my machine because Grub claim the error 15 (file not found). Anyway the workaround is easy. The problem is in the naming convention for the kernel images. It is different in the new release respect of the old one: the vmlinuz2XX is now vmlinuz-linux and the initrd-2.XX.img is now initramfs-linux.img.

This post could be useful.

So when the Grub menu shows up you can press the 'e' key and edit the item to change the name of files. After, boot the system by hitting the 'b' key.

...and remember to properly reconfigure Grub (or (Grub2)[https://wiki.archlinux.org/index.php/GRUB2]) before restart linux again... this is a reminder for myself, obviously.

Writers use Emacs...

hemingway.jpeg ...maybe.

I'm collecting some interesting reference about Emacs for writers. I want highlight two post here.

The first is Let's just use Emacs By Urpo Lankinen. He describes exactly my feeling about writers' tools and it faces the Scriveners dilemma (buy it, don't buy it). The post convinced me (I was already convinced actually) that Emacs could be a good tools to write novels.

Anyway a big doubt still stays into the deepest part of my soul: Emacs could be a distracting tool. Yes, I know, Emacs is (could be) a minimalist tool and it boosts your writing speed and it helps you to focus on your work and... and... and... but you have to learn it before to gain any sort of advantage form it. If you aren't a Emacs pro, you'll loose a lot of time in trying to be a pro. The main advantage of Scrivener is that you already know all you need to write and you can optimize your performances by learning tips and tricks day by day. To be clear, my suggestion is take your time to learn Emacs, anyway. This because some day in the future you'll wake up and latest Scrivener release will be full of feature that you'll never use (please Keith don't!) and the research of the perfect novelist tools will start back again...

The second post that I want link here is Writing in the Age of Distraction by Cory Doctorow. I quote, in toto, this post.

I'd linke to mention also The Woodnotes Guide to Emacs for Writers by Randall Wood. I suspect that the document is not fully update but it suggests good hints.

Nuke on Archlinux

I've started my first Nuke fxphd course: it rocks!

Anyway I'm in trouble to run FrameCycle (Nuke image sequence player) and - until I'm not able to find a great idea to solve the problem - I've installed the open source alternative DJV: you have to just download it, untar and set some enviroment variable.

Here you can find a Nuke python script to use DJV for flipbook preview: http://www.creativecrash.com/nuke/downloads/scripts-plugins/c/flipbook-with-djv-view

Developing a multitouch table - test #1

I'm working on a double technology multitouch table. We are going to fuse the FTIR technology to the DI technology.In this video you can see some tests about the DI equipment.

Python lib installer for 64bit windows systems

I'm developing tools to support automatic tasks in a multi-system enviroment for the web radio RadioOhm.

To install additional python libraries on my Win7 64bit, I downloaded the easy_install windows installer and I tryed to launch it.

I realized that the official python website site provides only the 32bit version of the package so the installer fail to find the Python installation.

But this is an happy-ending story. I surfed the Net and I found this website where you can find windows installer for a lot of python library compiled for the 64bit environment. Enjoy it!

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Be an Emacs pro

I saw a interesting page that explain how to be more productive by Emacs.

Read it, it is awesome: http://sites.google.com/site/steveyegge2/effective-emacs

I compiled VTK and ITK libraries on both Debian and Archlinux machines.

On these machines I love to be clean and neat so: - all the software and libs installed by apt-get/pacman are in the dir /usr - all the libs and software manually compiled are installed in the dir /usr/local Sometime this introduces some path problems.

For example, installing manually Python packages, I found a "bad install directory or PYTHONPATH" error and a message like this:

"You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. "

It means that I'm going to install the Python package in a directory that is not in the search PATH of your Python system. The system looks for packages in /usr/lib/pythonX.X/site-packages but I'm going to install in /usr/local/lib/pythonX.X/site-packages.

In this case, I love the Python solution and so: - Create a file named altinstall.pth (or use the preferred file name just with the .pth extension) containing the code: import os, site; site.addsitedir(os.path.expanduser('/usr/local/lib/pythonX.X/site-packages')) - Put this site in your system python site-packages dir: /usr/lib/pythonX.X/site-packages

Now your Python know where are you new python modules! Clean and easy-to-maintain solution!

P.S

If you need add the /usr/local/bin to your system path follow the same idea and create a file in /etc/profile.d/ with the code: export PATH=$PATH:/usr/local/bin