Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, November 7, 2011

Vala compile error: cannot infer generic type argument for type parameter `GLib.Thread.create.T'

Today I tried to work with Vala and threads.
Turned out that documentation, even the official sources, is still sketchy and young.
E.g. I tried to build the following, taken from here:
void* thread_func()
{
    stdout.printf("Thread running.\n");
    return null;
}

int main(string[] args)
{
    if (!Thread.supported())
    {
        stderr.printf("Cannot run without threads.\n");
        return 1;
    }

    try
    {
        Thread.create(thread_func, false);
    }
    catch (ThreadError exc)
    {
        return 1;
    }  

    return 0;
}
It will give up compiling with the following error:
$ valac --thread main.vala
 main.vala:19.9-19.21: error:
 cannot infer generic type argument
  for type parameter `GLib.Thread.create.T'
        Thread.create(thread_func, false);
        ^^^^^^^^^^^^^
 Compilation failed: 1 error(s), 0 warning(s) 
The compiler does complain about an actual lack in my code. Infact the declaration of "Thread.create()" is:
Thread<T> create<T>(ThreadFunc<T> func, bool joinable)
The culprit is the generic type "T" to be passed to the create method.

But the type of what I need to provide?
Thread.create<?>(thread_func, false)
It's the return type of the thread function "thread_func" passed as the first parameter to the create method.
Hence I need to call it this way instead:
Thread.create<void*>(thread_func, false)
In the case thread_func had returned bool:
Thread.create<bool>(thread_func, false)
And so on.

Here's the incomplete documentation for the create method that led me to the initial impasse.
Here is where I found the solution (thanks to Abderrahim Kitouni) instead.
Yeah, a bit of Googling helped me as well.

Sunday, September 11, 2011

Gnome3 e GnomeShell. I miei due centesimi.

Uso Gnome3 e la Shell da quando è uscito dalla fase di testing in Arch Linux. Effettivamente l'inizio è stato un pò ostico perchè molte cose sono cambiate, ma successivamente ho apprezzato il design tutto sommato lineare e pulito: sembra fatto bene e, soprattutto, pensato bene.

Ok, la status-bar è stata pensata male e realizzata peggio, ma tutto il resto se la cava piuttosto bene, tranne che per l'aspetto "configurazione".

Su quel versante Gnome3 mostra molto il fianco; in particolare è davvero troppo poco configurabile (sembra un prodotto Apple) e le extensions sono ancora troppo poco diffuse e, spesso, realizzate male.
Ma ciò che mi spaventa di più è che la configurazione del sistema sembra essere stata realizzata in modo così spartano e semplice di proposito. Se così fosse allora Gnome avrebbe perso un'occasione di quelle d'oro. Diciamo solo che hanno tempo di recuperare e spero sinceramente che lo facciano. Per loro.

Vogliamo parlare poi di stabilità? Stabilissimo e anche molto reattivo. Anche qua traspare l'impressione di buona realizzazione e buon design iniziale e, come bonus, i crash e i difetti sono lontani da un ambiente pulito e funzionante giusto un "ALT+F2 r".


In definitiva sono molto soddisfatto e propenso a credere che successivi rilasci portino ulteriori miglioramenti anche sotto questo aspetto.

Vorrei infine porre l'accento ancora una volta sulle extensions, stavolta con una nota molto positiva: sono realizzabili in Javascript... cosa mai avrei potuto desiderare di più (se non un'Aston Martin la mattina di Natale).

Friday, September 2, 2011

Bug after updating to ruby 1.9.2 on Arch Linux

If you ever encountered the following error in your ArchLinux box:
$ gem install <your_gem_name_here>
/usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:62:in `installed_spec_directories':
  undefined method `path' for Gem:Module (NoMethodError)
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:52:in `from_installed_gems'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:914:in `source_index'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:83:in `init_gemspecs'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `new'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `searcher'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:495:in `find_files'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1034:in `load_plugins'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:84:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/bin/gem:9:in `<main>'
You can use these commands to solve the issue:
$ sudo pacman -U /var/cache/pacman/pkg/ruby-1.9.1_p429-1-x86_64.pkg.tar.xz
[or equivalent 1.9.1 version]
$ sudo gem update --system
$ sudo pacman -S ruby

[to return to the new ruby (1.9.2 in my case)]

Monday, May 30, 2011

Achtung Baby. UDEV is changing.

Seen today when upgrading to UDEV 171:
ATTENTION UDEV:
---------------
Kernel 2.6.32 or newer is now required.
OSS emulation modules are not loaded by default, add to rc.conf if needed.
Arch specific cd symlinks are now no longer created.
cd and net persistent rules will no longer be autogenerated,
see <https://wiki.archlinux.org/index.php/Udev> for details.
Errors are now logged (possibly to the console) by default.

Given that I'm developing a system based on UDEV...
Arch Linux is an amazing distribution to develop with!

Thursday, February 3, 2011

[SOLVED] Kernel 2.6.37 : No temperature info for CPU

After the update to kernel 2.6.37 on my Arch-powered notebook I found my AWN temperature applet was showing GPU data only and no sensors could be detected for the CPU.

I solved by installing lm_sensors and modprobe-ing coretemp module.

Just in case someone is stuck on it, too.

Monday, January 31, 2011

My Desktop as of 31-01-2011



Snapshot of my desktop.
Powered by Arch Linux, Gnome, AWN and Elegant-Awoken icon-set.
At this moment I don't have time to write a post longer than this...

Tuesday, January 8, 2008

"Io ho la macchinina quella rossa della pubblicità e tu no!"

Secondo quanto riferito da "Edit" (il blog di HTML.it), una delle ultime campagne pubblicitarie della Mozilla Foundation stavolta l'ha "fatta un po fuori".

Io concordo... e rilancio anche: secondo me stà storia dei confronti ha fatto il suo tempo (se mai ne ha avuto uno...): io non uso determinati prodotti open/free perchè la controparte made in Redmond "sucks" (il che non è sempre vero tra l'altro).

Io uso Linux perchè mi piace a prescindere, senza confrontarlo con Windows.
Uso Firefox perchè è ricco di funzionalità, accattivante (anche se dopo questa "genialata" lo è molto di meno) e ampiamente estendibile.

Ripeto, secondo me è ora di finirla con questi confronti: il mondo open non è bello perchè "meglio di quello closed", ma perchè ha SUOI E SOLO SUOI punti di forza, del tutto originali, che non hanno riscontro nella contro-parte closed e sui quali bisogna puntare invece che su queste solite, stupide "crociate" nel nome del software libero.

Che poi, a ben guardare, la "libertà" è anche quella di poter dire a qualcuno "a me piace questo, ma tu sei LIBERO DI SCEGLIERE QUALCOS'ALTRO".

Thursday, September 27, 2007

Una soluzione ai problemi dell'open-source

"Quindi, tutti voi, proponete nuove idee, segnalate bug, dite cosa c’è che non va senza peli sulla lingua, insomma, aiutiamoci ad avere il miglior sistema operativo di sempre. Questo è lo spirito Open Source, aiutare, ognuno con i propri mezzi, anche se non si è programmatori." (oneOpenSource blog)

Tempo fa avevo espresso dei dubbi sul "movimento" Open Source nel mondo Linux, secondo me sempre più influenzato (negativamente) dalle varie "caste" dei progetti che lo compongono.
Bene, con le parole citate in cima a questo post mi sono definitivamente convinto che il movimento Open Source (e quindi anche quello Linux) sia diviso in infinite sfumature che partono e si mescolano a partire da due estremi principali:
  • Un movimento che proviene "dal basso", fatto prima di tutto dagli utenti che utilizzano il software e che contribuiscono enormemente alla "causa" dell'Open Source segnalando bugs e suggerimenti
  • Quello che proviene "dall'alto", fatto delle elite di sviluppatori che si formano intorno ai progetti Open più importanti (soprattutto il kernel Linux, ma non solo)
Quello che mi pare di capire è che la corrente "dall'alto" dia sempre meno ascolto a quella "dal basso", risultando nella progressiva nascita di un gigante dai piedi di argilla.
Io utilizzo molto come esempio la cerchia di sviluppatori del kernel, ma le mie considerazioni si applicano indifferentemente a moltissimi altri progetti (vedasi a titolo esemplificativo Gimp e alcune scelte a dir poco bislacche fatte dagli sviluppatori Ubuntu).

Concluderei dicendo che secondo me l'unico modo per far si che la testa del gigante ricominci ad ascoltare anche le altre parti del proprio corpo è farsi sentire, a iniziare dalle segnalazioni e dalle "proteste" che possiamo fare.
Come giustamente ha fatto osservare Dario Freddi con le parole che ho citato in alto.


P.S. Vi farei notare che il discorso sulla "partecipazione attiva" si applica paro-paro all'attuale situazione della politica italiana (leggasi: "prima di condannare i politici, pensiamo a quanto siamo disonesti ogni giorno nel nostro piccolo noi tutti cittadini italiani").

Sunday, August 26, 2007

Lock your kernel version

As most of the kernel "developers" are getting lazier, more selfish and blinder every-day, the result is that new kernel versions are really buggy and full of errors.

SOLUTION: "pin" your kernel version in Synaptic.
1. Select "linux-image-XXX"
2. Select the "Packages > Lock Version" menu item

...and now wait until the new versions that will come get stable...

Saturday, August 18, 2007

Update to "Perderne un'altra"

Il tool in questione non è poi tanto usabile: in effetti non fa che scaricare dalla rete un'immagine dell'installer Debian. Immagine tramite la quale, al successivo riavvio del sistema, viene fatta partire l'installazione.
Sembra che per far ciò vada a scrivere su disco (ma non so dirvi dove) e a modificare l'MBR (Master Boot Record). Ergo: utilizzate un Live CD così, prima di installare, potete anche verificare la compatibilità hardware del vostro computer (inoltre vi risparmiate la scrittura dell'MBR e sul disco).

Friday, August 17, 2007

Perderne un'altra

Ecco un'altra buona cosa riguardante il mondo Linux e che finisce a genziane a causa del solito "Microsoft is the Enemy"...
Il tool proposto è un EXE che si scarica facendo click sull'immagine Debian: sembra veloce e usabile, oltrechè essere windows-friendly (da non sottovalutare quando ci si rivolge a un pubblico di utenti windows: li si rassicura già in partenza)...
MA...
Io direi che sarebbe anche ora di smetterla con i varii "Goodbye Microsoft", "Microsoft is Evil" e "Winzozz". Sembrerebbe proprio che Linux non riesca a vivere se non grazie a una costante (e noiosa) contrapposizione a Windows... Ora, se invece ci si concentrasse sul pubblicizzare le belle cose del mondo Linux (e ce ne sono parecchie!) e si lasciasse perdere Microsoft, allora si che si inizierebbe ad apparire seri, professionali e meritorii di essere presi in considerazione. Leggasi: "se si continua con l'atteggiamento Goodbye-Microsoft si fa pubblicità gratuita a Windows e contro-pubblicità altrettanto gratuita al mondo Linux". Il sito si sarebbe anche potuto chiamare "DebianWindowsInstaller.org" (nome bruttino, vabbè) e credo che avrebbe reso un miglior servizio a Debian e avrebbe attirato molti meno "faziosi" del pinguino (che paradossalmente ce l'hanno già installato) e invece molte più persone veramente interessate a cambiare sistema operativo.

Come dicevo: un'altra occasione persa...

[ UPDATE ]

Sunday, August 12, 2007

Ubuntu: Switch from Gnu GCJ and GIJ to Sun JRE

If you experienced (I did, grrrrr...) some problems like Eclipse not running very well (e.g. CPU at 100% all the time) or Java-based apps stopping with errors, well Alec the Geek has a possible solution (a definitive solution won't be born until the guys at the GNU Foundation will decide to stop messing around with "Free as in speach..." or "Free as in beach..." or "Libertè, Egalitè, Penguinitè" and maybe will turn back to writing code and FIX GIGANTIC BUGS).

The idea is simple and useful even for other needs: you point the wrappers to the Java compiler and the Java bytecode interpreter to the official Sun JRE, instead of using the GNU implementation (which is the default Ubuntu behavior).
You do that by using the following command, sudo update-alternatives --config java , and by choosing the Sun JRE from the list (only if you have installed it, of course...).

Guys, repeat with me: "Thaaanks Aleeec"

Monday, August 6, 2007

Make two different Thunderbird versions cohabit in the same Ubuntu installation

In my recent post "Make two different Firefox versions cohabit in the same Ubuntu installation" I explained why (and how) I have two different Firefox installations sharing the same settings, bookmarks and add-ons.
This time things get a little more tricky, but don't worry and let's get the party started.
  1. Download Thunderbird
  2. Unzip to your home directory (tar xf thunderbird-2.0.0.6.tar.gz , TAB is your friend, use TAB)
  3. Now you have to make mailboxes, settings and the other stuff be shared between your two Thunderbird installations (the "native" one and the "new" one). NOTE: follow these steps before you start your newly downloaded Thunderbird
    1. Locate in your home directory the folder ".mozilla-thunderbird" (you must select "View > Show hidden files" or press "Ctrl + H" if you are using a file manager)
    2. Look at the files that the folder contains: we are interested at the file "profiles.ini" and at a folder named "XXXXXX.default" or "default.XXXXXX" (where "XXXXXX" can be "whatever-Thunderbird-decided" sequence of letters and numbers)
    3. We must link this folder and "profiles.ini" to the folder "/home/$USERNAME/.thunderbird" (if this folder doesn't exist, create it):
      1. cd
      2. ln -s ./.mozilla-thunderbird/profiles.ini ./.thunderbird/profiles.ini
      3. ln -s ./.mozilla-thunderbird/XXXXXX.default ./.thunderbird/XXXXXX.default
  4. Start Thunderbird: /home/$USERNAME/thunderbird/thunderbird
NOTE: You can use both Thunderbird installations and this HOWTO can be applied to any version of Thunderbird and Firefox. This comes pretty useful especially when testing beta (and/or alpha) versions of the two products.

As previously said: let me know if that works (it seems that my comments aren't accessible from the home-page of the blog: to comment you must open the post in its own window by clicking the post title and scroll the page down until you see the "Comments" box).

Saturday, July 28, 2007

Make two different Firefox versions cohabit in the same Ubuntu installation

Few days ago I was founding quite disappointing the performance of my Firefox web browser under my Ubuntu distro. In addition, the installed Firefox version won't be updated until Gutsy (or until a security update will be published). (this is a policy I sincerely don't understand: why I can have the always up to date software in Windows and not in Ubuntu? Mah!)

BTW, I came to a solution: installing from the binaries provided by the Mozilla foundation would be enough... Nearly enough: I also didn't want to loose my current Firefox installation, nor I wanted to loose all the plugins and the extensions I had already installed and configured.
So I turned to this solution: install the new version (downloaded from here) side by side with the "old" one, letting them share the same settings folder.
  1. Download Firefox
  2. Move "firefox-2.0.0.5.tar.gz" to your home directory
  3. Extract it (tar xf firefox-2.0.0.5.tar.gz)
That's all: from your home folder run firefox/firefox or type ./firefox from the "firefox" folder or place an icon on your desktop.

From now on the two versions of Firefox will share preferences, settings and extensions (all the settings and the extensions are located into your /home/$USERNAME/.mozilla/firefox folder).

Let me know if that works.

(Coming soon: the same way for... Thunderbird!)

Thursday, July 26, 2007

The professional Ubuntu (first part)

Ubuntu Studio is an unofficial flavor of Ubuntu, based on Gnome and few other apps, all available through the official Ubuntu repositories.
I will not discuss on how installing Ubuntu Studio in details (see UbuntuStudio.org or/and this wiki for more infos on this topic), but I will tell you one thing: this distro best embodies my concept of "modularity". They took the very few of the Ubuntu core (the "main module") and built up around it a consistent distro, made itself of other modules (that are known, in the Ubuntu language, as "meta-packages").
Ubuntu Studio is made up of 4 meta-packages:
  • Graphics, featuring Gimp, Inkscape, Agave, CinePaint, Scribus and so on
  • Audio, featuring Audacity, Jack, Ardour, Muse and others
  • Video, a metapackage that contains Cinepaint, Kino, Stopmotion and others
  • Audio plugins, containing the most useful plugins for the apps of the Audio meta-package

When I came to install Ubuntu Studio on my laptop I found very interesting to choose at install-time which of those sets of apps will be installed: the installer did all of the hard work on his own, by taking all the .deb packages from the installation CD.
So, this is the first goal of modularization that has been obtained : simple and powerful 20-minutes installations that lets your system in a consistent and immediately productive state.

Also, Ubuntu Studio does so by targeting a precise and unique target of users: the creative professionals.
I want modularity... just give me all AND ONLY the packages I need for my work!

<< Link to the Intro | Link to the second article >> [COMING SOOOOON...]

The professional Ubuntu (Intro)


When I came the first time to UbuntuStudio.org I promised myself the next time I'll be upgrading my Ubuntu I will install this professional flavour of the "human distro".
So, when the Feisty Fawn was born I decided to move from classical Ubuntu to Ubuntu Studio.
Currently the first screenshot (click to see the full size version) you see on the left is the result of some customizations.


Some lines back I highlighted the word "professional"; I did so to focus your attention on an aspect of Ubuntu that is often guiltily omitted: Ubuntu lacks an "I-don't-know-what" that will make it truly professional.
I know, I know, Ubuntu has several "pro-level" apps, offers a highly usable and friendly desktop, is becoming more mature every day, is already a competitive alternative to MS Windows, but I think it really misses a "behavior" that puts it on the same level as Mac OS X is.
No, I'm not jocking, I really do mean that with some adjustments Ubuntu could be a competitive alternative even for those people that every day need a stable, simple, homogeneous and "serious" working environment (talking about you, OS X).

The point in this post is that we can't wait to Ubuntu to become this way, so we can go two different ways:
  1. Help Ubuntu change and become more professional (I absolutely do not mean to make it more OS X like): Launchpad is supposed to be the center of the community, so manifest there your requests for a better Ubuntu and help developers with bugs (the least you can do is help who provides you such a good system with such a little expense (zero, nada, nothing, zéro, null, nil, nothing ...))
  2. Try to customize yourself Ubuntu or any derivative distro, like I did and like we are going to explore in this post
Notice the two preceding points are complimentary: I really encourage you to follow both of them!

Before we develop the central topic of the post I want you to acknowledge the human distro to be a heavy modular one: Linux is modular to a near-to-the-maximum extent and Synaptic and the system of packages and meta-packages that constitute Ubuntu is a perfect and user-friendly complement to this modularity.

We were speaking of "professionalism", why turning to "being modular"?
Because I think the two things are strictly correlated when it comes to operating systems.
So I'll explain how to achieve professionalism through being modular.

Link to the first article >>

Saturday, July 14, 2007

Intel Core Duo optimizations and CK patches for Ubuntu Feisty

If you are, like me, a performance-hungry guy, well, today I have very good news for you.
I found a repository that provides optimized Linux kernel builds for Ubuntu Feisty.
Provided optimizations are the following:
  1. CK patches (read more at this link)
  2. Kernel compiled with Intel Core Duo optimizations
This work is provided by Giuseppe, an Italian blogger you can found at http://www.iuculano.it.
Check Giuseppe's post to read more details; the author of the blog is Italian (like me!), so expect to read these details in Italian... But, even if you don't understand Italian, well this is the sequence of steps to add Giuseppe's repositories to your list and for installing the patched kernel:

wget http://ubuntu.iuculano.it/AE3BE9AA.gpg -O- | sudo apt-key add -

After that, add this repositories to your sources.list:
deb http://ubuntu.iuculano.it feisty all
deb-src http://ubuntu.iuculano.it feisty all

Finally:
sudo apt-get update && sudo apt-get install linux-686-ck linux-headers-686-ck
or
sudo apt-get update && sudo apt-get install linux-core2-ck linux-headers-core2-ck
(depending on your CPU)

Note that even if the kernel is labeled "*-core2-*" it works fine in my Core Duo "first generation", so it sure suits well both Core Duo and Core 2 Duo CPU families.

I tried myself the so-optimized kernel and I found that it provides actual noticeable performance increment only for those applications CPU-intensive (e.g. GIMP, video editing and audio conversations). It also seems that my desktop is more responsive, but I didn't take any test to verify an eventual performance gain for the X server.
I warn you: don't expect sparks and a performance boost from every application of your system (especially from IO-intensive applications... )!

At the bottom of the Giuseppe's post is also provided a tip to increase the responsiveness of the X server:
sudo dpkg-reconfigure -plow x11-common
and answer -10 when it asks for the X server "nice" value.
This is a tip that works with every kernel (it affects the X server, not the kernel) and could probably increase your desktop responsiveness, but I didn't try it, so I can't tell you more.

(If you wanna know more about CK (Con Kolivas) kernel patches: ck.wikia.com)

Friday, June 22, 2007

Full-Screen your 2.44 Blender backport

In my last post I explained how to get a 2.44 Blender version working on a Ubuntu Feisty (or derived) distro.
One thing you can loose by installing Blender that way is the "Blender (full-screen)" option in your Ubuntu Application menu.
Well, isn't exact that you loose this menu entry; the entry is at its own place, but it simply doesn't work... but, don't worry, we are going to fix it!
1. Right-click the Application menu
2. Select "Edit Menus"
3. Browse the resulting list to the "Blender (full-screen)" voice
4. Right-click it
5. Select "Properties"
6. In the "command-line" box change from "blender" to "blender -W" (note that "W" is uppercase)
7. Done!

See you soon

Wednesday, June 20, 2007

How to get Blender 2.44 working on ubuntu 7.04

Hi folks!
My current Ubuntu system is an UbuntuStudio 7.04 (Feisty Fawn) and it cames with Blender 2.43 installed... "But I want the 2.44 one!", so I searched for a .deb package, maybe optimized for my DualCore... nothing worth enough to risk corrupting my clean, "synaptic-only" installation.
So I came to this compromise: enable the backports of Gutsy Gibbon (the future Ubuntu 7.10), which contain Blender 2.44, and install it by simply clicking on "Mark for upgrade" in my Synaptic window.

But lets procede with order:
1. Go to "System > Administration > Synaptic Package Manager"
2. Now: "Settings > Repositories"
3. Select the "Updates" tab
4. Check "Unsupported updates (feisty-backports)"
5. "Close"
6. Now reload the software list by clicking the "Reload" button
7. Look for the "blender" package: it's shown as upgradable (you know the beautiful little star?)
8. Click and select "Mark for upgrade"
9. Apply changes
10. ... Done!

I obtained my new Blender, but still I miss optimized builds... maybe one of these days I will build them on my own.

Friday, June 15, 2007

The new Skype for Linux

A new version for Skype is available for being installed in your distribution.
It's Skype 1.4 beta and my first estimation of it is that we are going to have a "real" Skype client for Linux.
It performs quite well (just... too much memory dudes) and has a completely revised GUI (that integrates very well into my Gnome theme).
Some little errors (sometimes it seems my configuration resets), but, hey folks! It's a beta!
I think Skype developers took the right direction.