Schurger.org

17 avril 2009

another ruby ‘unexplicite’ error

Filed under: Non classé — Jean Schurger @ 16:34

During a classic rake db:migrate

(in /var/tracks)
rake aborted!
no such file to load -- spec/rake/spectask
/var/tracks/Rakefile:10
(See full trace by running task with --trace)

The resolution is: gem install rspec

Let’s jam ! (or vkeybd for the fun)

Filed under: Non classé — Jean Schurger @ 4:21

One apon a time, i've designed a three octaves kayboard layout for the vkeybd program, but for an french keyboard.

This evening, some of my collegues decided to jam with nice instruments, so i thought it was the good time to take a look one more time to fluidsyth, bristol, and vkeybd. But as i now live in Canada, i use an english keybord. Xev helping, i've made a new three octaves layout for the english keyboard.

Available here: vkeybdmap-en

and it looks like:

Keymap

9 avril 2009

My own keyboard layout

Filed under: Non classé — Jean Schurger @ 5:37

After having tested the Colemak layout, the French, the US and the Canadian one, my conclusion, is ... simply a new layout : mine :)

  • It have the advantages of the US one for the <> ./ [] {} characters locations
  • The Backspace at the Caps lock location (stolen from Colemak)
  • The Delete key near the between the Alt Gr and the Right control
  • The ability to type a lot of accentued characters, directly or with dead keys. The idea is stolen from Colemak too,  but i've changes some accents orientation to fit better to the french words.

Here is the result: JSK

To use it, just drop the file to /usr/share/X11/xkb/symbols and invoke setxkbmap jsk

Here is the layout:

JSK Layout

4 avril 2009

A new desktop theme

Filed under: Non classé — Jean Schurger @ 3:52

I finally decided to publish my dark Black and Red desktop theme.
Here is a screenshot:

JS Black and Red theme screenshot

Available here: JS-Black-and-Red.tar.bz2

3 avril 2009

Quick Howto: Write/Install/Use a plugin in python with entry points

Filed under: Code,Python — Jean Schurger @ 19:52

Write a plugin

in a 'super_plugin' directory dedicaced to the plugin, create two files:

__init__.py with your plugin 'content' eg:

class Foo:
    def __init__(self):
        print "Foo plugin loaded !"

    def super_function(self):
        print "Bar !"

setup.py with your plugin description eg:

from setuptools import setup, find_packages

setup (
    name='SuperPlugin',
    version="1.0",
    description="A Super plugin for the 'Baz' project",
    author="Jean Schurger",
    packages=find_packages(),
    include_package_data=True,
    entry_points="""
        [Baz.plugin]
        Foooo=super_plugin:Foo
    "
"",
)

Install your plugin

sudo python setup.py install

Use your plugin

Let's try with ipython

In [1]: from pkg_resources import load_entry_point

In [2]: load_entry_point('SuperPlugin', 'Baz.plugin', 'Foooo')
Out[2]:

In [3]: object = _()
Foo plugin loaded !

In [4]: hasattr(object, "super_function")
Out[4]: True

In [5]: # that's very cool !

In [6]: object.super_function()
Bar !

Just a word about groups and how to discover plugins


In a more complex application, you may have more plugins ! and you may want to
discover them and maybe load them too !
Let's try (with ipython)

In [1]: from pkg_resources import iter_entry_points

In [2]: for object in iter_entry_points(group='Baz.plugin'):
...:     print object
...:
...:
Foooo = super_plugin:Foo

In [3]: object.load()
Out[3]:

In [4]: _().super_function()
Foo plugin loaded !
Bar!

2 avril 2009

ruby & mkmf

Filed under: Code,ruby — Jean Schurger @ 23:02

Just a remember for people like me who never remember what to do with this thing:

extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1

Just do:

apt-get install ruby-dev

Powered by WordPress