Wishful Coding

Didn't you ever wish your
computer understood you?

Excavator

Today I spent some time building an excavator. I had to choose between controlling all parts of the arm and letting some parts move together mechanically.

I chose to do the former, which means I don’t have any motors left for the chassis, but can freely move all parts of the arm.

Maybe another NXT or RCX kit could serve as the base, which also needs 3 motors: 2 to drive and 1 for the rotating platform.

Published on

AppleScript tiling windows

On Linux I use all sorts of key combos to tile windows, even though I no longer use a real tiling window manager.

On Mac OS X my windows are still mostly stacked and all over the place in a big mess. Mac doesn’t even have a proper fullscreen button, other than you know… making it a space on its own.

I know there are tools to do the same thing in a more fancy way, but instead I wrote a few AppleScripts to split and maximise windows.

To use them, I placed them in my Scripts folder and enabled the AppleScript menu in the preferences of the AppleScript Editor.

AppleScript Editor preferences

tell application "System Events"
	set frontmostProcess to first process where it is frontmost
	set visible of frontmostProcess to false
	repeat while (frontmostProcess is frontmost)
		delay 0.1
	end repeat
	set secondFrontmost to name of first process where it is frontmost
	set frontmost of frontmostProcess to true
	set frontmostApplication to name of frontmostProcess
end tell

tell application "Finder"
	set screenSize to bounds of window of desktop
	set screenWidth to item 3 of screenSize
	set screenHeight to item 4 of screenSize
end tell

tell application frontmostApplication
	set bounds of the first window to {0, 0, screenWidth / 2, screenHeight}
end tell

tell application secondFrontmost
	set bounds of the first window to {screenWidth / 2, 0, screenWidth, screenHeight}
end tell
tell application "System Events"
	set frontmostProcess to name of first process where it is frontmost
end tell

tell application "Finder"
	set screenSize to bounds of window of desktop
end tell

tell application frontmostProcess
	set bounds of the first window to screenSize
end tell
Published on

All NXT building instructions now free

I thought long and hard about this, as a lot of effort went into making these building instructions, but I concluded that I feel better about sharing them with as many people as possible than sharing them with a handful and making a few bucks.

So I’m happy to announce that all the instructions I made so far will be available for free. Go check them out.

I haven’t been writing a whole lot in the past months, but I feel some things breeding and I’m also super excited about the new EV3 coming out this year.

Published on