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.

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:
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 RightHalf


FVWM 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:
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 ascii
Compare 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 -force

The 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.

Sunday, November 14, 2010

Putting CG shaders where VS can find them

For a while, I was having problems running my CG tests out of visual studio. It couldn't find my shader files, so I had to run from the command line. Not only did this add some steps, it meant I couldn't debug.

Turns out, all I had to do was move the shader to where VS creates new classes by default (another level deeper in the directory than where I normally put my source code). I went ahead and moved all my code and shaders there, and now it will happily find the shaders when I run via F5.

Thursday, November 11, 2010

Vertical Split (sort of) in Microsoft Word 2010

Word (along with other Microsoft products, such as Visual Studio) only allows you to "split" a document horizontally (that is, into two sections on top of each other). Since the trend these days is towards widescreen monitors, it would really be more helpful to split vertically (that is, two sections side by side).

You actually can do this in Word (and VS), they just don't call it "split". The paradigm seems to be making "new windows", which you can then position side by side yourself (VS's inner window management does this for you).

In Word 2010, go to "View" on the Ribbon and click "New Window". If you have Windows 7, then you can use Win+Left and Win+Right (or drag the windows into the corners) to make each window take up half the screen.

A true vertical split would let you resize both views by dragging one separator, but this works well enough most of the time.