another ruby ‘unexplicite’ error
During a classic rake db:migrate
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
During a classic rake db:migrate
The resolution is: gem install rspec
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:

After having tested the Colemak layout, the French, the US and the Canadian one, my conclusion, is ... simply a new layout : mine
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:
I finally decided to publish my dark Black and Red desktop theme.
Here is a screenshot:
Available here: JS-Black-and-Red.tar.bz2
in a 'super_plugin' directory dedicaced to the plugin, create two files:
__init__.py with your plugin 'content' eg:
def super_function(self):
print "Bar !"
setup.py with your plugin description eg:
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
""",
)
Let's try with ipython
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 !
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 [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!
Just a remember for people like me who never remember what to do with this thing:
Just do:
I have the pleasure to annonce the launch of 3 new Schurger.org subdomains :
I progressively move my projects to this site. It runs Redmine (powered by Ruby On Rails).
Currently, it works with apache mod_proxy, but i plan to run it by passenger (mod_rails)
Sources
Which contains public Mercurial Repositories of my projects, everybody can "clone" projects from here.
It runs the Mercurial web service throug apache and mod_wsgi ![]()
Packages
Here are apt-get enabled repositories for my custom packages.
Put that code into a script, set a keybinding desktop wide, and tomboy notes will be created, containing your current X selection, simple, easy, and terribly usefull ! (needs xsel)
import sys, dbus, dbus.glib
from datetime import datetime
from subprocess import Popen, PIPE
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Tomboy", "/org/gnome/Tomboy/RemoteControl")
tomboy = dbus.Interface(obj, "org.gnome.Tomboy.RemoteControl")
p = Popen(args=["/usr/bin/xsel"], shell=False, stdout=PIPE)
p.wait()
sel = p.stdout.read()
if sel:
now = datetime.now().ctime()
new_note = tomboy.CreateNote()
tomboy.SetNoteContents(new_note, "X %s\n\n%s" % (now, sel))
tomboy.AddTagToNote(new_note, "X")
"Apf jyl pfaij ragurtufs bj jylp clppfkg efjbyaps iajylg ^ ug maj bf ar y;gumuzfs ar jyl ghuke !"
This is the sort of thing you may write starting to use the Colemak layout.Why not trying it, here is its
description pasted from the original website : http://colemak.com :
"The QWERTY layout was designed in the 19th century to allow typewriter salesmen to easily type the word "typewriter" and to prevent typebars from sticking. We've been stuck with QWERTY ever since.
Colemak is a modern alternative to the QWERTY and Dvorak layouts. It is designed for efficient and ergonomic touch typing in English.
Learning Colemak is a one-time investment that will allow you to enjoy faster and pain-free typing for the rest of your life. Colemak is now the 3rd most popular keyboard layout for touch typing in English, after QWERTY and Dvorak."
And here is the complete layout build from the Gnome keyboard setting tool (available in hi resolution to print it and stick somewhere not far from you screen):
import dbus
import dbus.glib
import sys
class LidSwitch(object):
def __init__(self):
bus = dbus.SystemBus ()
hal_obj = bus.get_object ('org.freedesktop.Hal',
'/org/freedesktop/Hal/Manager')
hal = dbus.Interface (hal_obj, 'org.freedesktop.Hal.Manager')
udis = hal.FindDeviceByCapability ('input.switch')
for udi in udis:
dev_obj = bus.get_object ('org.freedesktop.Hal', udi)
dev = dbus.Interface (dev_obj, 'org.freedesktop.Hal.Device')
if dev.GetProperty ('button.type') == "lid":
self._lid_dev = dev
def _is_closed(self):
if hasattr(self, "_lid_dev"):
return self._lid_dev.GetProperty ('button.state.value')
else:
raise ValueError("no lid switch found")
is_closed = property(_is_closed)
if __name__ == "__main__":
ls = LidSwitch()
print "Lid switch is %s" % (ls.is_closed and "closed" or "open")
Powered by WordPress