{Snamell(it)}

  • {Snamell(it)}
  • Blog
  • About
  • Location
  • Contact Us

Monthly Archives: June 2011

June 30, 2011 · pti

Organizing Windows using the Keyboard with Compiz Grid

The Mac has a great utility called Divvy to easily map windows to loacation on the screen using the keyboard. Fiddling with the mouse to get multiple windows in the right location is a productivity killer and a pain in the neck (or shoulder, or elbow, or …)

Ubuntu (and of course any other Linux distro with compiz) has a similar feature built in as a plugin for compiz. Type Alt-F2 and enter ccsm + Return in the command prompt to launch the CompizConfig Settings manager. Select the Window Management from the left menu and enable the Grid plugin. Click on it so you can look at the key bindings in the Bindings tab.

If you are on a desktop or a big laptop with a separate numeric keyboard you are set. As you can see the locations for the windows are by default mapped in a logical fashion like the arrow keys on the numeric keypad.

However my laptop does not have a separate numeric keyboard and enabling it before typing the key code is a pain. Remapping them is easy by clicking on the button with the key code. A window appears with a Grab key code button. Click it and type the new keycode you want to assign it to. If there is a conflict, you will get a window explaingin the conflict and asking how to resolve it.

My first attempt was to remap the laptop numeric keys using the super keys. This conflicted with the unity launcher since the top row 7-8-9 map to the apps in the launcher.

To avoid conflicts I use now Control-Super with the keys around the j-key (which is the home key for the right hand)

Also autokey (a text macro expander) is mapped to Super-K

  • Control-Super-j : 100% (maximize)
  • Control-Super-h : 50% left
  • Control-Super-k : 50% right
  • Control-Super-u : 50% top
  • Control-Super-m : 50% bottom
  • Control-Super-y : 25% top-left
  • Control-Super-i : 25% top-right
  • Control-Super-n : 25% bottom-left
  • Control-Super-, : 25% bottom-right

If Control-Super-j is used to maximize a window, clicking on one of the other keys will first restore it to the original size and position and only map it to its place on the second click. I consider this a feature, but you are free to interprete it as a bug.

Result, this is now super practical way to divide my windows on my screen.

Posted in Ubuntu | Tags: keyboard, linux | Leave a comment |
June 28, 2011 · pti

Proxy Support for Grails

Not a big thing, actually for me it is.

I am always struggling with proxy settings. It requires a lot of different incantations to be done, every program deals with it differently, support for platform settings is flaky, …

Grails deals with this is a way which pleasantly surprised me :

grails add-proxy <name> –host=<hostname> –port=<portno>

e.g.

grails add-proxy client –host=proxy –port=3128

allows you to create a setting for a proxy and bind it to a name. It also supports username/password.

Switching to the setting involves only

grails set-proxy client

to enable the proxy setting, and

grails clear-proxy

when I get back in a transparent environment.

(for completeness there is a remove-proxy command which is useful to remove those passwords after the need has passed).

I particularly impressed  that this was done in a simple and straightforward without the need fo brain gymnastics trying to remember which arcane curse needs to be put at what location in which file.

Nice.

 

Posted in Java Stuff | Leave a comment |
June 23, 2011 · pti

Fix for Sonar choking on ‘result returns more than one elements’

Recently our sonar installation on our Hudson CI choked again, this time with an error I have not seen before. It was just before the release of an important milestone for the team, so not being unable to publish new version on the test server could not come on a worse time.
In the Console Log of a failing built we found the message.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.791s
[INFO] Finished at: Thu Jun 23 09:20:05 CEST 2011
[INFO] Final Memory: 20M/429M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0-beta-2:sonar (default-cli) on project pfus: Can not execute Sonar: PicoLifecycleException: method 'public void org.sonar.batch.ProjectTree.start() throws java.io.IOException', instance 'org.sonar.batch.ProjectTree@50a6023a, java.lang.RuntimeException: wrapper: result returns more than one elements -> [Help 1]

Ok, apparently something returns 2 results which should only have one result and it stands to reason that it is coming from the database. Pity there is no indication on which table would be affected.

Some googling retrieved this post which points to the snapshots table and more specifically to records with the field islast set to true.

A quick check in …/conf/sonar.properties revealed the database connection parameters.

Ok, this is a good time to check you have an up-to-date backup of your database. (Or make one if you’re not sure)

Using your SQL query tool of choice (I used the built in Data Sources tool in IntelliJ) connect to the database.

The snapshots table contains a project_id which confusingly does not really contains projects, but actually all kinds of assets, artefacts, files, however you ike to call it. Unfortunately there are many thousands. Even if I limited to only the ones with islast=1 there were close to 1000 records.

Narrowing further down with :


select project_id, cnt
  from (select project_id,
          count(*) as cnt
        from snapshots
        where islast=1
        group by project_id) as cntsnap
  where cnt > 1

Gave me the project_id I’ve been looking for, in my case 2089

Now a quick

select * from snapshots where project_id=2089

Gave the 2 offending rows. A quick glance showed that one of them was very suspicious : the parent_id was the same as his own project_id and there were lots of null columns.

I deleted the row based on the id. Retriggered hudson to rebuild the project, and the build succeeded and sonar seems to be happy again.

I hope there will be no other repercussions. For our purposes the sonar data is not really critical and we could also restart without any impact. If your sonar data is more critical a better choice would be to restore from backup before the build started failing.

 
Posted in Uncategorized | 1 Comment |
June 19, 2011 · pti

Vraagstukken 5de leerjaar

Wiskunde Vraagstukken 5e leerjaar

Bij de voorbereiding voor de wiskunde proeven op het einde van het 5e leerjaar kwam Hendrik een aantal vraagstukken te kort zodat hij de uitkomsten al van buiten kende, en zich niet meer bekommerde om de manier waarop de uitkomst bekomen werd. Ik heb er dus een aantal bij verzonnen die voor hem heel herkenbaar waren. Dat vond hij fantastisch!

Ik heb deze vragen dan maar geblogd op aandringen van Hendrik. ik vond dat een schitterend idee want dan ben ik er zeker van dat ik ze kan terugvinden als Emma en Lotte ze nodig hebben. En ondertussen kunnen anderen er ook plezier aan beleven.

Vraagstuk 1

Piet loopt 800m in 2m44.76 sec. Jan deed er 15.34 sec langer over.
Wat was de tijd van Jan?
Formule : …………………………………………………
Antwoord : ………………………………………………..
………………………………………………………….

Vraagstuk 2

We rijden van Antwerpen naar het Kaunertal (840km) in 8 uur tijd.
a) Wat was de gemiddelde snelheid?
Formule : …………………………………………………
Antwoord : ………………………………………………..
………………………………………………………….
b) We zijn onderweg 1u gestopt om te eten. Wat was de gemiddelde
snelheid toen toen we aan het rijden waren.
Formule : …………………………………………………
Antwoord : ………………………………………………..
………………………………………………………….

Vraagstuk 3

Hendrik loopt 3300m in 12min. Hoeveel km/u liep hij gemiddeld?
Formule : …………………………………………………
Antwoord : ………………………………………………..
………………………………………………………….

Vraagstuk 4

Een sportwagen rijdt 240km op een circuit in 1 u.
Een zeilvis zwemt 60km in de zee in 1u.
De snelheid van de auto en de zeilvis verhouden zich als ….. tot …..

Vraagstuk 5

Opa gaat ‘s maandags fietsen met de gepensioneerden
Hij vertrekt om 13h45 en rijdt een toertje van 60km. Ze hebben in
Postel een halfuurtje pauze genomen om een trappist te drinken.
Als de gepensioneerden gemiddeld 20km/u rijden, hoe laat is Opa dan
terug?
Formule : …………………………………………………
Antwoord : ………………………………………………..
………………………………………………………….

Vraagstuk 6

Zoek de kans :
We doen alle schaakstukken en een zak en schudden ermee tot ze
allemaal door elkaar gehusseld zijn. Lotte wordt geblindoekt en
haalt een stuk uit de zak.
Wat is de kans dat :
|--------------------+---------------+----+--------------|
|                    |               |    |              |
| een wit stuk is    | ............. | op | ............ |
|                    |               |    |              |
| een zwarte pion is | ............. | op | ............ |
|                    |               |    |              |
| een paard is       | ............. | op | ............ |
|                    |               |    |              |
| een koningin is    | ............. | op | ............ |
|                    |               |    |              |
| de witte koning is | ............. | op | ............ |
|--------------------+---------------+----+--------------|
Posted in Huiswerk, Kinderen, Personal | 1 Comment |

Pages

  • {Snamell(it)}
  • Blog
  • About
  • Location
  • Contact Us

Archives

  • July 2013
  • March 2012
  • July 2011
  • June 2011
  • November 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008

Categories

  • build (2)
  • Java Stuff (6)
  • linux (5)
  • MacOSX (1)
  • Personal (1)
    • Huiswerk (1)
    • Kinderen (1)
  • Plone (1)
  • Project Management (2)
  • Ubuntu (6)
  • Uncategorized (3)

WordPress

  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)
© My Website