Tweets

måndag 19 mars 2012

Were are you?

It is not always easy to know which window is the current active one. Specially when you have multiple monitors and an operating system with the bad habit to suddenly activate "important" windows to get your attention.

Active windows are almost always indicated in some graphical way, but not that distinct that you would be able to tell the active window in a split second. And that is how fast you would like to, wouldn't you?

Here is a AutoHotKey script for you. Activate it by ctrl+super+space and toggle with super+alt+space.

; This script puts a red border on the current window. 
; Nice to have something clearly indicating what is active.

; Author: @danielgasinski
; Source of inspiration http://blog.sveri.de/2010/01/27/script-to-draw-a-border-around-an-active-window-with-autohotkey/
Toggle:=0

^#space::
 Loop
 {
  if(Toggle != 1)
  {
   b = 6 ; border 
   full_width = 1936 ; w value from WinGetPos, lite more than screen width
   
   WinGetPos, x, y, w, h,  A
   
   if(w >= full_width)
   {
    b:=12 ; We make the border thicker when in full screen, otherwise it may not be visible
   }
   
   width:=w-b
   height:=h-b

   Gui, -Caption +Lastfound +AlwaysOnTop +Toolwindow
   Gui, Color, FF0000
   
   WinSet, Region, %b%-%b% %b%-%height% %width%-%height% %width%-%b% %b%-%b%  0-0 %w%-0 %w%-%h% 0-%h% 0-0
   
   Gui, Show, w%w% h%h% x%x% y%y% NoActivate, 
  }
  Sleep, 50 ; Chance/time to interupt
 }
return

; Toggle on of alt+win+space 
!#space::
Toggle := Toggle<1 ? 1 : 0

Gui, Show, w0 h0 x0 y0 NoActivate, 
return
Example of how the script works. Nota bene: ignore the semicolons on row 18 and 39. It is something fishy with the AutoHotKey highlight script making them appear in the post. Sorry.

lördag 3 mars 2012

Cloud sync, thumbs down

I often switch between my computers and have spend a lot of time to make it as easy as possible. It is not simple since I want to synchronize files, applications  and configurations. One infrastructure for synchronizing are services like Dropbox and SugarSync. However, this is also problematic. Here are some problems I have encountered:

  • SugarSync freaked out and started to eat memory, over one 1 GB before I got tired and turned it off. Reinstalling with the latest version did not help stop the memory leak.
  • You are limited to small sizes if you are not willing to pay for more.
  • Some files get locked while in use, like database files, and are therefore not synchronized. ArsClip's .db-files are example of that. Another example are (TrueCrypt etc) files that do not change their size and timestamp making them to appear unchanged.
  • Some applications touch a lot of files (installing new plugins in Eclipse), other touch few but big. One example is Dito that makes changes to a file that is about 50 MB each time you copy something. Synchronizing a large number of files and bytes is not fast.
  • The worst part of using synchronization services is the time you have to wait for the files to get synchronized. When I leave home and my desktop computer I sometimes want to continue using the same files on my laptop while sitting on the train. Waiting for a folder to be downloaded from the cloud is like being a farmer waiting for rain.

The answer to these problems is to use thumb drives instead. My experiences so far is more positive than negative. Since you probably get the pros, here are the cons:

  • Anti-virus program starts when you plug-in the thumb drive. Kaspersky won't actually stop scanning just because you press escape and the scanning window disapear.
  •  Watch out for thumb drives with plastic connectors, you will plug and unplug quit often and mine broke after two weeks. Make also sure that the part that is connected to your key chain is something harder than a small piece of rubber.
  • From time to time you get a small delay while using the programs located on the thumb drive. Thunderbird is an exception, the delay is often extreme. Then suddenly, it works like a charm. Make sure you spend some extra money on a fast drive.


The white plastic is almost completely gone and the metal is visible  

Not so clever to use rubber... It broke and I had  move the key chain further up

They have done some speed tests on thumb drives Tom's hardware and here are some suitable quotes from the article:
"...accessing files and programs stored 'in the cloud' is not possible in real-time for many users".