December 11, 2011

dot xsession for laptop with two external monitors

Hi,

Docked laptop configuration with two headed card need to:
- rearrange outputs using xrandr
- start power manager and screensaver
- set secondary kayboard and modify kaymap
- start windows manager

All this can be done from xsession configuration only iff `gdm3' deactivated on startup.



$ cat .xsession

xrandr --output LVDS1 --off
xrandr --output DVI1 --auto --rotate normal --pos 0x0 --output VGA1 --auto --rotate normal --left-of DVI1

#if [ -x /usr/bin/nm-applet ] ; then
#   nm-applet --sm-disable &
#fi

gnome-power-manager > /dev/null &

xrdb $HOME/.Xdefaults
xset -b
xhost +
xset r 130
xset r 103


xsetroot -solid midnightblue
xsetroot -cursor_name left_ptr

xscreensaver -no-splash &

setxkbmap -layout us,ru\(phonetic\) -option "grp:alt_shift_toggle,grp_led:scroll"

xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "keysym Caps_Lock = Control_L"
xmodmap -e "add Control = Control_L"


gnome-terminal &
#gnome-session
exec xmonad


October 12, 2011

Launch external editor (VIM) from SlickEdit

Launch external editor (VIM) from SlickEdit: "name_info(','VSARG2_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON|VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
external_cmd ( "gvim", "--servername SRC --remote-silent +:" :+ p_line :+ " \"" :+ p_buf_name :+ \" , 0, 0 )
message("Launching " :+ p_buf_name :+ " in VIM...")
}"

'via Blog this'

my edit for emacsclient here

#include "slick.sh"

_command goto_emacs() name_info(','VSARG2_EDITORCTL|VSARG2_READ_ONLY|VSARG2_ICON|VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_MACRO|VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
external_cmd ("emacsclient", " -n +" :+ p_line :+ ":" :+ p_col :+ " " :+ p_buf_name , 0, 0 )
message("Launching " :+ p_buf_name :+ " in Emacs...")
}

Enjoy it doing F12; goto_emacs; Edit; CopyPaste; F12 again and finally bind it to shortkeys or use Esc > got_emacs.





June 19, 2011

Graphical notation for Erlang processes

Hi,


Reading Maurice Castro "Towards an Event Modeling Language" ..
I remembered that Umlet has custom components but it was flexible enough to accommodate for Maurice's notation.

I brushed new Palette for Erlang process notation:
- Process definition with StartUp, ProcessLife and Interfaces
- Incarnation with and without link
-Synchronous and Asynchronous message passing 

It doesn't look close to original but feels more modern to me.


  9
  
    com.umlet.element.Class
    
      27
      90
      189
      162
    
    <<gen_server>>
X::erst
{T < 10 min}
--
{M,F,A}
_S=#state{val, another}_
--
/mod:start/0/
/mod:stop/1/
--
Responsibilities
- Coordinator
    
  
  
    com.umlet.element.Relation
    
      18
      234
      170
      63
    
    lt=.>
spawn
    27;45;153;45
  
  
    com.umlet.element.Relation
    
      18
      261
      170
      63
    
    lt=<x.>>>>>
spawn link
m2=1..n

    27;45;153;45
  
  
    com.umlet.element.Relation
    
      18
      306
      170
      63
    
    lt=<-
async msg
    27;45;153;45
  
  
    com.umlet.element.Relation
    
      18
      333
      170
      63
    
    lt=<<-
sync msg
    27;45;153;45
  
  
    com.umlet.element.Note
    
      9
      18
      279
      63
    
    - Process definition with StartUp, 
     ProcessLife and Interfaces
- Incarnation with and without link
- Synchronous and Asynchronous messages
fg=blue
    
  


June 6, 2011

Erlang, Testing and TDD

EUnit Testing gen_fsm – Part 1 | Erlang, Testing and TDD

Nice tutorial. TO support it with 'rebar on console we can use
$ while true; do inotifywait -r -e close_write --exclude ".*_flymake.*" */*.erl; rebar eunit; done

Works on linux.

March 4, 2011

Associative photography

Casual photographer snapshots done like (a) `I spy with my little eye.. ` something; and then putting camera between self ans something and taking a shot. Or (b) pick a subject; put a camera somewhere; imagine stranger come by and look in you camera; adjust; take a shot.

(b) is disassociative. This way impressionists work. You have to walk near their pictures to find that exactly spot where `camera was. (a) is associative method. It is all about creator. If in (b) most work is with light and sometime with color (usually DSLR get it right), going with (a) brings emotions, context and influence of stuff behind focal point to consideration.

It's hard to get `associative right. Nevertheless 8 from 10 images on `flickr taken this way.