You can use the TotalFinder extension to beef up the Finder program in OS X (including add tabs!)
As of writing, there's a 14 day trial (which I've used for longer than 14 days without issue so far), and program cost is $18.
Saturday, September 29, 2012
Sunday, August 19, 2012
Disable animations when switching desktops in Lion
As mentioned here, TotalSpaces lets you disable the animation for switching between spaces (look on the Transitions tab). Yay!
Tuesday, July 3, 2012
Automatically sync Windows time with Internet at boot
If you want Windows to sync with its Internet time servers at boot (e.g. your CMOS battery died and you're too lazy to replace it), put the following into a batch file and put it in the All Users Start Up folder:
fix-time.bat:
Put it in the All Users startup folder:
1) Right click on Start Menu -> All Programs -> Start Up and choose Explore All Users
2) Copy fix-time.bat into that folder
fix-time.bat:
net start w32time w32tm /resync /force
Put it in the All Users startup folder:
1) Right click on Start Menu -> All Programs -> Start Up and choose Explore All Users
2) Copy fix-time.bat into that folder
Friday, March 23, 2012
Controlling MPD via hotkeys in OS X
You can use Spark to set global hotkeys in OS X. Then, to control mpd with mpc, create AppleScript hotkeys with the following commands, and bind them to the desired key combination:
- do shell script "/opt/local/bin/mpc prev"
- do shell script "/opt/local/bin/mpc toggle"
- do shell script "/opt/local/bin/mpc next"
Saturday, January 21, 2012
Profiling node.js on linux
According to "Understanding V8" by Vyacheslav Egorov, you profile node applications like this:
However, I couldn't get the linux-tick-processor (in the same folder) to work:
I ran scons as instructed, but the command still wouldn't work. What I finally realized is that I need to run the command from the v8 folder:
Lame, but it works.
% node --prof parser.js
806 ms
711.4267990074442 bytes/ms
% deps/v8/tools/mac-tick-processor
[GC]:
ticks total nonlib name
576 79.0%
However, I couldn't get the linux-tick-processor (in the same folder) to work:
% ~/Documents/node/deps/v8/tools/linux-tick-processor v8.log
d8 shell not found in .
To build, execute 'scons d8' from the V8 directory
I ran scons as instructed, but the command still wouldn't work. What I finally realized is that I need to run the command from the v8 folder:
% pwd
/home/iggames/Documents/node/deps/v8
% tools/linux-tick-processor ~/code/nodetest/v8.log
Lame, but it works.
Thursday, October 6, 2011
More robust verification
Fragile: relying on certain behavior between action and response, and using this to know when to validate the response
Better: make no assumptions about the behavior. Instead, continuously check for a valid response for a reasonable amount of time.
e.g.:
Fragile:
- perform action
- wait for loading ui (if the devs change or remove loading ui, this will break)
- validate response
Better:
- perform action
- check for valid response
- wait a second or two
- check again...for 5-10 seconds
The second is only invalidated if the response changes (less likely). The former is invalidated if the loading UI changes (apparently, any time the PM/devs get bored).
Better: make no assumptions about the behavior. Instead, continuously check for a valid response for a reasonable amount of time.
e.g.:
Fragile:
- perform action
- wait for loading ui (if the devs change or remove loading ui, this will break)
- validate response
Better:
- perform action
- check for valid response
- wait a second or two
- check again...for 5-10 seconds
The second is only invalidated if the response changes (less likely). The former is invalidated if the loading UI changes (apparently, any time the PM/devs get bored).
Wednesday, October 5, 2011
TimeStamp100nSec is DateTime FileTime
The TimeStamp100nSec value of CounterSamples is in the same format you get from DateTime.ToFileTime() (or maybe DateTime.ToFileTimeUtc() in some situations, not sure).
This was not made clear to me in any documentation I could find, but some example code half-way down this page spells it out.
To go from TimeStamp100nSec to a DateTime object, use DateTime.FromFileTime(timestamp100nsec).
This was not made clear to me in any documentation I could find, but some example code half-way down this page spells it out.
To go from TimeStamp100nSec to a DateTime object, use DateTime.FromFileTime(timestamp100nsec).
Friday, September 30, 2011
Division of labor for automation
Devs should maintain robust task library of functions that perform and validate user interactions (e.g. "Select", "Resize"), so they can easily update these functions at the same time the behavior changes in the build.
Test should maintain the scenarios that use these basic actions. This way, they can stay above the nitty gritty of changes to buttons, DOM, etc, and focus on building a large library of interesting/eclectic scenarios and test files.
This is especially bad with actively changing features -- if test is responsible for the tasklibrary as well, then they get stuck churning code just to keep the most basic functionality tests up to date. This is made worse if dev hates the automation system test uses...
Test should maintain the scenarios that use these basic actions. This way, they can stay above the nitty gritty of changes to buttons, DOM, etc, and focus on building a large library of interesting/eclectic scenarios and test files.
This is especially bad with actively changing features -- if test is responsible for the tasklibrary as well, then they get stuck churning code just to keep the most basic functionality tests up to date. This is made worse if dev hates the automation system test uses...
Saturday, August 27, 2011
My bash prompt
Here's my bash prompt (in ~/.bashrc):
For an explanation of the control codes (the parts that look like gibberish), go here.
The result looks something like this:
In other words, it shows the time and the name of the directory I'm currently in (not the full path; if I need that, I can just run
Most prompts show the user and/or machine name, which is probably a good default, but I usually don't care about it so much. What I found far more useful in multi-machine situations with command prompts was to change the color of the timestamp (e.g. my laptop was green, my home server was yellow, various school machines were white), since I'm personally much more likely to notice differences in color than differences in name.
I also find the time to be useful in a variety of situations (e.g. how long did that command take to run? when was the last time I built?)
You can certainly do more elaborate prompts with all kind of information in them, but I like mine because it's very compact and leaves lots of space, even in 80-char windows
PS1="\[\033[1;32m\]$(date +%H:%M)\[\033[0m\]:\[\033[1;34m\]\W\[\033[0m\]$ "For an explanation of the control codes (the parts that look like gibberish), go here.
The result looks something like this:
16:29:Downloads$ In other words, it shows the time and the name of the directory I'm currently in (not the full path; if I need that, I can just run
pwd)Most prompts show the user and/or machine name, which is probably a good default, but I usually don't care about it so much. What I found far more useful in multi-machine situations with command prompts was to change the color of the timestamp (e.g. my laptop was green, my home server was yellow, various school machines were white), since I'm personally much more likely to notice differences in color than differences in name.
I also find the time to be useful in a variety of situations (e.g. how long did that command take to run? when was the last time I built?)
You can certainly do more elaborate prompts with all kind of information in them, but I like mine because it's very compact and leaves lots of space, even in 80-char windows
Sunday, July 31, 2011
On mazes as levels
Turns out mazes are no fun as levels in games. Designing good levels requires actual design skill/experience, and designing an algorithm to randomly generate good levels requires even more.
Randomly generated maze? Nowhere *near* cutting it.
Randomly generated maze? Nowhere *near* cutting it.
Saturday, June 4, 2011
Hide the resize grip in Ubuntu 11.04
In Ubuntu 11.04, they added a gray box/triangle to the lower right hand corner of GTK windows (to help people who were trying to resize by dragging it, I guess). For those of us that use Alt+Right Mouse Button to resize their windows, it's pretty obnoxious. Hide it by putting the following in your
See here for more info.
EDIT: It looks like the
.gtkrc-2.0 file:style "default-style"
{
GtkWindow::resize-grip-height = 0
GtkWindow::resize-grip-width = 0
}
class "GtkWidget" style "default-style"See here for more info.
EDIT: It looks like the
.gtkrc-2.0 file will be overwritten by Gnome every time you change your theme. However, it will always include the contents of .gtkrc.mine, if it exists. I recommend putting the above in there instead.
Saturday, April 9, 2011
Disable volume OSD in gnome (workaround)
By default, when you use the media keys to change the volume in Gnome, an On Screen Display (OSD) appears, telling you what the volume is. This is distracting when you're trying to watch full screen video (especially in flash), and can cause other problems with full screen apps.
There doesn't seem to be a good way to turn it off, but here's a way to work around it:
There doesn't seem to be a good way to turn it off, but here's a way to work around it:
- In Gnome's "Keyboard Shortcuts" dialog, use "Add" to add 3 custom shortcut
- Increase volume:
amixer -c 0 sset Master,0 1+ unmute - Decrease volume:
amixer -c 0 sset Master,0 1- unmute - Toggle mute:
amixer -c 0 sset Master,0 toggle
- Increase volume:
- Assign these to the media keys
Friday, March 25, 2011
Disable flashing notification in Windows
Use regedit to set
There's also
Be sure to log out for the changes to take effect.
HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundFlashCount to 1 (more info here)There's also
ForegroundLockTimeout, I'm not quite sure what that does.Be sure to log out for the changes to take effect.
Tuesday, February 1, 2011
Center mouse after aero snap keyboard shortcut (auto hotkey)
True X-Mouse has a few problems. The most noticeable (for me) is that if the window the mouse is over moves (ie: you use the Aero Snap keyboard shortcuts, practically my favorite command in Windows 7), the window focus changes to the window below it. (This can really mess with your muscle memory!)
Turns out AutoHotKey can remedy the situation (I'm new to AutoHotKey, so there's probably a more elegant way to do this):
This captures the aero snap shortcuts, gets the title for the current window, sends the aero snap shortcut to windows (which moves the window), then re-activates the old window and centers the mouse.
It's not instant (even with MoveMouse speed=0, I tried it), so you can't do Win+Shift+Left/Right rapid fire, but it works pretty well other than that.
Turns out AutoHotKey can remedy the situation (I'm new to AutoHotKey, so there's probably a more elegant way to do this):
; Aero-Snap Mouse
; Move mouse to center of windows that are aero-snapped (True X-Mouse won't do this)
CenterMouseInWindow(Title)
{
WinActivate, %Title% ; True X-Mouse may have taken focus away when we moved
WinGetPos, X, Y, width, height, %Title%
center_x:=width/2
center_y:=height/2
MouseMove,center_x,center_y
return
}
#Left::
WinGetTitle, Title, A
SendInput #{Left}
CenterMouseInWindow(Title)
return
#+Left::
WinGetTitle, Title, A
SendInput #+{Left}
CenterMouseInWindow(Title)
return
#Right::
WinGetTitle, Title, A
SendInput #{Right}
CenterMouseInWindow(Title)
return
#+Right::
WinGetTitle, Title, A
SendInput #+{Right}
CenterMouseInWindow(Title)
return
#Up::
WinGetTitle, Title, A
SendInput #{Up}
CenterMouseInWindow(Title)
return
#Down::
WinGetTitle, Title, A
SendInput #{Down}
CenterMouseInWindow(Title)
return
This captures the aero snap shortcuts, gets the title for the current window, sends the aero snap shortcut to windows (which moves the window), then re-activates the old window and centers the mouse.
It's not instant (even with MoveMouse speed=0, I tried it), so you can't do Win+Shift+Left/Right rapid fire, but it works pretty well other than that.
Wednesday, January 26, 2011
Focus follows mouse for Windows
True X-Mouse does a good job of focus-follows-mouse in Windows. It's *really* nice for switching focus from remote desktop to local windows, since alt-tab is (intentionally) eaten by the remote machine
It also does some clip-board stuff to simulate X-Windows cut/copy/paste behavior, which I don't really care about (but so far hasn't gotten in my way).
It also does some clip-board stuff to simulate X-Windows cut/copy/paste behavior, which I don't really care about (but so far hasn't gotten in my way).
Saturday, January 1, 2011
Wednesday, November 24, 2010
Easily sleep/restart/shutdown Windows via remote desktop
To easily shutdown/restart/sleep a windows machine via remote desktop, click on the desktop and press Alt+F4. This will bring up the standard Windows shutdown prompt (where you can choose shutdown, restart, sleep, etc). (I didn't know that!)
More info here.
More info here.
Sunday, November 21, 2010
"Aero Snap" (sort of) in FVMW
I really like Windows 7's "Aero Snap" feature. I never drag windows, but I use Win+Left/Right all the time, and it really bugs me when I use another system and it doesn't do anything.
Here's how to do it in FVWM:
FVWM will remember the old window size for you (but will follow your window placement rules when positioning it).
Here's how to do it in FVWM:
AddToFunc LeftHalf
+ I Move 0 0
+ I Maximize 50 100
+ I Raise
AddToFunc RightHalf
+ I Maximize 50 100
+ I Move 50 0
+ I Raise
Key Left A 4 LeftHalf
Key Right A 4 RightHalfFVWM will remember the old window size for you (but will follow your window placement rules when positioning it).
Thursday, November 18, 2010
VSTS data bindings and unicode
I have a test with a data source (settings.csv) and a data binding (mysetting). Settings.csv exists, and there's an entry for 'mysetting', but VSTS complains:
Turns out it's because the csv file is Unicode. The easiest way to fix this (for me, at any rate), is Powershell:
Compare the sizes of settings.csv and temp.csv with ls. If temp.csv is smaller, then settings.csv was unicode.
The truly maddening thing is that VS seems to be saving out as Unicode itself, so I have to edit my csv files elsewhere.
Error...Could not run Web test 'test' on agent 'agent': Could not access table 'settings#csv' in data source 'settingsSource' of test '12345678-abcd-abcd-abcd-12345678abcd': No value given for one or more required parameters.Turns out it's because the csv file is Unicode. The easiest way to fix this (for me, at any rate), is Powershell:
cat settings.csv | out-file temp.csv -encoding asciiCompare the sizes of settings.csv and temp.csv with ls. If temp.csv is smaller, then settings.csv was unicode.
mv temp.csv settings.csv -forceThe truly maddening thing is that VS seems to be saving out as Unicode itself, so I have to edit my csv files elsewhere.
Fullscreen flash in linux freezes video: partial solution
Linux flash has problems with fullscreen on my laptop with an integrated intel graphics chipset. Most of the time I fullscreen it, the audio keeps playing but the video freezes.
You can solve the problem by disabling hardware acceleration, but that noticeably impacted my video quality (dropped frames, pixelation). However, it appears that a combination of changing focus to other windows and quickly fullscreening/un-fullscreening will make it work. Unfortunately, I haven't found a set of steps that works every time...usually, I just click around a lot until it works.
You can solve the problem by disabling hardware acceleration, but that noticeably impacted my video quality (dropped frames, pixelation). However, it appears that a combination of changing focus to other windows and quickly fullscreening/un-fullscreening will make it work. Unfortunately, I haven't found a set of steps that works every time...usually, I just click around a lot until it works.
Subscribe to:
Posts (Atom)