Monday, November 25, 2013

KeyRemap4MacBook implement XWindows auto select with Mouse Gestures.

I love the Xwindows feature that you can auto copy selected text from a cursor selection. So this is the scenario, when I select a piece of text I would like it to be stored in the buffer/clipboard with control-C after I lift my mouse button. I don't need the paste function however could easily be implemented as well.
With KeyRemap4MacBook your can rearrange your input events. Here the snippet I use for the TERMINAL application to do just so:
  <item>
   <name>Autoselect Copy</name>
   <identifier>private.autoselect_copy</identifier>
   <only>TERMINAL</only>
   <autogen>
    __PointingButtonToKey__
    PointingButton::LEFT, ModifierFlag::NONE,
    KeyCode::VK_MODIFIER_EXTRA1,

    Option::KEYTOKEY_BEFORE_KEYDOWN,
    KeyCode::VK_MOUSEKEY_LOCK_BUTTON_LEFT,
    KeyCode::VK_LOCK_EXTRA2_FORCE_ON,
    <!-- VK_LOCK_EXTRA2 is necessary for Middle Button to Command+Tab (Switch 
     Applications) -->

    Option::KEYTOKEY_AFTER_KEYUP,
    KeyCode::VK_MOUSEKEY_LOCK_BUTTON_ALL_FORCE_OFF,
    KeyCode::C, ModifierFlag::COMMAND_L,
    KeyCode::VK_LOCK_EXTRA2_FORCE_OFF
   </autogen>
  </item>

After this I can paste the text... in this example my stickies.

Sunday, November 24, 2013

Extracting images from PDF and removing whitespace.

Two tools you need
  1. ImageMagick (convert) - http://www.imagemagick.org/script/binary-releases.php
  2. pdfimages - http://en.wikipedia.org/wiki/Pdfimages
Here the order:
  570  pdfimages ../../20120101.pdf 20120101
  571  convert *.ppm -fuzz 7% -trim ../20120101-%d.jpg

Tuesday, November 19, 2013

WLSTException: Error occured while performing save : Cannot call Edit functions when you are not in the Edit tree

I'm getting the following message for my weblogic script .... what to do next?
Create mbean Properties with name user
INFO: Saving domain
Problem invoking WLST - Traceback (innermost last):
File "/installables/met10.3/met/wdm/1_02/bin/configure_domain_9.py", line 81, in ?
File "", line 405, in save
File "", line 1744, in raiseWLSTException
WLSTException: Error occured while performing save : Cannot call Edit functions when you are not in the Edit tree.
Try wrapping your work in a session like this....
edit()
startEdit(-1,-1,'false')
..
...
..
save()
activate()