Vincent Gable’s Blog

December 26, 2008

Always Update the View From the Main Thread

Filed under: Announcement,Bug Bite,Cocoa,Interface Builder,MacOSX,Objective-C,Programming,Quotes | , ,
― Vincent Gable on December 26, 2008

I wish I’d read this years ago:

AppKit, the GUI framework, is not thread safe. In order for things to work properly, you (almost) always need to update GUI classes from the main thread

Dave Dribin (slightly edited)

I’ve run into UI + threading problem before, but I’d just never seen this limitation of AppKit spelled out.

Dave’s article explains how to call code on the main thread better then I can.

December 18, 2008

Automator Bugs

I’ve started using Automator in IMLocation to let people build a set of actions that are executed when they arrive somewhere (for example, muting their laptop’s speakers in a classroom).

Unfortunately, my impression of Automator.framework so far is: buggy.

Here are some issues I’ve run into so far.

-[AMWorkflowController stop:] does not stop the workflow! I do not yet have a workaround.

AMWorkflowController sends its delegate a -document message whenever an action is removed from the workflowView, by clicking the (x) button. If the delegate does not implement it, the action will not be removed!

The (x) button is enabled , but does nothing, in workflows that are not editable.

-[AMWorkflow initWithContentsOfURL:error:] throws an exception when the URL is nil.

This project demonstrates the first two issues.

December 2, 2008

Bug In The Machine

Filed under: Announcement,Programming,Reverse Engineering | , , ,
― Vincent Gable on December 2, 2008

I was going through some old (OS 9 old at youngest!) backups, and found this dump from a MacsBug session. You can actually see a bug sitting in memory! To me it looks like the bug is inside an old television, with distortion sweeping across the screen, so some of the bug’s left side is wrapped around to the right.

 Displaying memory from 1D9F8CB0
  1D9F8CB0  •???•???•???•???•???•???•???•???•???•???•???•???•???•???•???•???
  1D9F8CF0  •???•???•???•???•???•???•???•???•???•???•???•???•???•???•???•???
  1D9F8D30  •???•???•???•???•???•???•???•???•???•???•???•???•???•???•???•???
  1D9F8D70  •???•???•???•???•üÖ`´••••••P•••Ñ•y•pÄ@•••••Ä•@•••••••••H•••H••••
  1D9F8DB0  •••••••••••É9ÿ•••••••••••••••••••üçÄ´••••• •••‚ 0000000000000000
  1D9F8DF0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8E30  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8E70  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8EB0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8EF0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8F30  0000000000000000000000000000000000000000000000000000000000000000
  1D9F8F70  0000000000000000000000000000000000000000000000000000000%***$*#**
  1D9F8FB0  #*$$*$*#*#**$$*00*$*$*$$**#*#*#*#*#*#**#%00000000000000*•!#•!!!!
  1D9F8FF0  !!!•!!!!!!!!!!!0%!!!!#!!!!!!!!!!!!!!!!!!*00000000000000*!"!•!!!!
  1D9F9030  !!••!!!!!!!!!!!0.!!••!!!!!!!!!!•!•!!•!!!#00000000000000*!!!(•!!!
  1D9F9070  !!!(•!!!!!!!!!!0%!!((!!!!!!!!•!!!!!!!!!!*00000000000000#!!! ••! 
  1D9F90B0  •••••••••••••••0*••!•••••••••••••••••••••00000000000000*!!!•••00
  1D9F90F0  •••••••••••••••0#••!•••••••••••!00•••••••00000000000000#!!!••#0/
  1D9F9130  0&••••••••••••••!••! •••••••••+0$0.••••••00000000000000#!!!•!0••
  1D9F9170  !00#••••••••!000000$!•••••••!00!••,••••• 00000000000000*!!!•0%••
  1D9F91B0  ••%0%••••••%00000000/••••••,0.••••%0•••••00000000000000$!••00•••
  1D9F91F0  ••!*00••••000000000000••••00!••••••00#•••00000000000000*!!/0••••
  1D9F9230  ••!••/0$•00000000000000••0$••••••••*0%!•!00000000000000#•#0$••••
  1D9F9270  •!•••!$•*00000000000000%•!•••••••!(•*0*• 00000000000000*•00••••!
  1D9F92B0  (•••••••0000000000000000•••••••!* •••%0•!00000000000000*00••••!0
  1D9F92F0  &!•••••/00000000000000000!•••'$00!••••00*00000000000000*•*!•••00
  1D9F9330  000••••000000000000000000•!•*00/%0••••••*00000000000000$!•!••$0•
  1D9F9370  ••%00•!000000000000000000*$00%!••0#••••••00000000000000$!••••0.•
  1D9F93B0  ••••$•%0000000000000000000•%!•••••0!••••!00000000000000*!•(•00••
  1D9F93F0  •••(••00000000000000000000!! •••••/0"••••00000000000000#!!!$0•••
  1D9F9430  ••!!••00000000000000000000•!!••••!#0%!•••00000000000000*!!*0*•••
  1D9F9470  ••!•••00000000000000000000*!•••("!••0#•••00000000000000*!!0,••••
  1D9F94B0  •! •••00000000000000000000#!•!•!••••/0•• 00000000000000#!%0!••••
  1D9F94F0  ••••••00000000000000000000#•*••••••••0%!!00000000000000*!•$•••%0
  1D9F9530  0000#•00000000000000000000#%00000%•••!•!•00000000000000*!!!••!0%
  1D9F9570  *•! ••00000000000000000000*#*$!!•0!•••••*00000000000000*!(!••00!
  1D9F95B0  ••••••00000000000000000000••!!•••/0•••••#00000000000000#!!!•$0••
  1D9F95F0  ••••••%0000000000000000000!(!!••••0%•••••00000000000000*!!!(0*••
  1D9F9630  ••!!!!.000000000000000000.!!!••!!!%0-!••!00000000000000*!(•0,•••
  1D9F9670  ••!•!•!000000000000000000•#*•••••••,0••••00000000000000$!!$0••••
  1D9F96B0  •!•$00•/00000000000000000•00/*••••••0.!•!00000000000000*!!!!••••
  1D9F96F0  #000•••!0000000000000000$(•.00%••••• •!!•00000000000000*!!••••••
  1D9F9730  00!•••••/000000000000000!!(!!*00•••••• !•00000000000000$!!(••••$
  1D9F9770  0•••••••!00000000000000*!!!!!•!0!••••••!$00000000000000#(!!••••0
  1D9F97B0  ,••••••!!$000000000000$!!!!!!•!00•••••••$00000000000000*!!!••••0
  1D9F97F0   ••••!••••!0000000000$(!!!!!••••0*••••••!00000000000000#!!!•••,/
  1D9F9830  ••••!!!•••••00000000*!!!!"!!••••/0••••••!00000000000000*!!!•••0!
  1D9F9870  ••••••••••••••$%%%•!!!!!!!!••••• 0)••••••00000000000000#!!!••/0•
  1D9F98B0  •••!!•••••••••.,/•(•!!!!!!•••••••0,!!••••00000000000000*!!!••0!•
  1D9F98F0  •••••••••••••00000•!!!!!!••••••••!0!!••••00000000000000#!!!•••••
  1D9F9930  ••!!••••••••.000000!!!!!••••••••••••!!••!00000000000000$••!•••••
  1D9F9970  ••!•••••••••0000000!• •••••••••••••••!•••00000000000000*!•!•••••
  1D9F99B0  •!!•••••••••0000000$!••••••••••••••••!!•!00000000000000#!!!•••••
  1D9F99F0  •!•••••••••!0000000*!"••••••••••••••••!• 00000000000000#!!••••••
  1D9F9A30  ••••••••••••0000000#!!••••••••••••••••••!00000000000000#!!!•••••
  1D9F9A70  ••••••••••••0000000•!!!••••••••••••••••••00000000000000$!"••••••
  1D9F9AB0  •••••••••••••000000!!!••••••••••••••••••!00000000000000*!!!•••••
  1D9F9AF0  •••••••••••••/0000•(!!!••••••••••••••••• 00000000000000#!•!•••••
  1D9F9B30  ••••••••••••••!*$•!!!!!••••••••••••••••••00000000000000#!!••••••
  1D9F9B70  ••••••••••••••••!!!"!!!••••••••••••••••••00000000000000*!!!•••••
  1D9F9BB0  •••••••••••••••••!!!!!•••••••••••••••••••00000000000000%$#*!!•! 
  1D9F9BF0  •!!!•• ! •! • • !#*$*#!!!•! !! !•• ! • !*00000000000000000000000
  1D9F9C30  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9C70  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9CB0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9CF0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9D30  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9D70  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9DB0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9DF0  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9E30  0000000000000000000000000000000000000000000000000000000000000000
  1D9F9E70  0000000000000000000000000000000000000000000000000000000000000000
 Unrecognized symbol 'prinf'
 Closing log

I swear this is a real memory dump of a sold-for-money application that I didn’t have any part in writing. Unfortunately I don’t remember some specifics, like which application it was.

October 12, 2008

Customers are Not Users

Filed under: Announcement,Design |
― Vincent Gable on October 12, 2008

Customers and users are not the same thing. The distinction is important but often missed.

A user is someone who uses the software you make.

A customer is someone who chooses to give you money for your software.

For many classes of software (eg a POS system), the majority of legitimate software users are not customers. They are using software chosen by someone else, often their employer, or an OEM.

The first step to satisfying both users and customers is to not confuse them.

October 11, 2008

Incentive Plans Always Fail

Filed under: Announcement | , , ,
― Vincent Gable on October 11, 2008

This article by Joel Spolsky convincingly argues that incentive plans will always fail damagingly,

As some of your workers substitute making the most of an incentive program for serving customers the best way they know how, the customer experience will suffer. Your best employees will find themselves fighting with incentive seekers to keep the business on track.

Co-incidentally I had a bad experience, caused by an incentive plan, at Best Buy a few days ago. I bought a GPS navigator, because I needed one then, and couldn’t wait for one to be shipped to me (even though it would have been cheaper to get one online). The cashier keep trying to push an “extended warranty” on me, even after I said “no” repeatedly. Undaunted, she switched tactics, and tried to scare me by telling me how often the model I was buying failed. At this point the sale hadn’t yet been made. But the cashier was trying to convince me that the thing I was about to buy broke all the time. Unbelievable!

If the cashier’s story is to be believed, she sees about one GPS unit returned every (6 hour) day, and sells about 20-30 in the same time. So now you know what I know about Best Buy’s quality and service.

An AppleScript Quine

Filed under: Announcement,Programming,Research | ,
― Vincent Gable on October 11, 2008

Here is my first quine. It’s written in AppleScript, because I wasn’t able to find, another AppleScript quine.

When run quine.applescript will make Script Editor create a new window containing the source code. It’s particularly meta if you use Script Editor (the default application) to run the quine, because it’s not just printing itself, it’s writing itself in the IDE!

Fortunately, the problems I’d originally had with Script Editor and the quine seem to have been fixed.

EDITED TO ADD: Here’s the quine’s source, but you really should download it to run it, because wordpress has a habit of subtly mucking with copied code…

set d to "on string_from_ASCII_numbers(x)
	set s to ASCII character of item 1 of x
	repeat with i from 2 to number of items in x
		set s to s & (ASCII character of item i of x)
	end repeat
end string_from_ASCII_numbers
set set_d_to to {115, 101, 116, 32, 100, 32, 116, 111, 32}
set scriptEditor to {83, 99, 114, 105, 112, 116, 32, 69, 100, 105, 116, 111, 114}
set quine to string_from_ASCII_numbers(set_d_to) & quote & d & quote & return & d
tell application string_from_ASCII_numbers(scriptEditor) to make new document with properties {contents:quine}"
on string_from_ASCII_numbers(x)
	set s to ASCII character of item 1 of x
	repeat with i from 2 to number of items in x
		set s to s & (ASCII character of item i of x)
	end repeat
end string_from_ASCII_numbers
set set_d_to to {115, 101, 116, 32, 100, 32, 116, 111, 32}
set scriptEditor to {83, 99, 114, 105, 112, 116, 32, 69, 100, 105, 116, 111, 114}
set quine to string_from_ASCII_numbers(set_d_to) & quote & d & quote & return & d
tell application string_from_ASCII_numbers(scriptEditor) to make new document with properties {contents:quine}

August 23, 2008

Don’t Buy Down Pillows

Filed under: Announcement,Usability | , ,
― Vincent Gable on August 23, 2008

After I saw duckling’s jumping out of trees (from Planet Earth), I had to try some down pillows. And they are great, except that the tips of the feathers eventually work their way out of the pillowcase and poke you. The pokes are so disruptive that they ruin sleep more then a slightly-less-comfortable pillow. I’m sure there’s a good metaphor in there somewhere.

August 12, 2008

Dude, Where’s my Gun?

Filed under: Announcement | ,
― Vincent Gable on August 12, 2008

Last weekend I watched National Treasure 2: Book of Secrets. I don’t recommend it.

But there is one, unintentionally, interesting scene. About one hour and 17 minutes into the movie, the police rush into the Library of Congress (chasing the man who kidnapped the president of course). Interestingly, there were no (fake) guns in any of the scenes inside the Library of Congress. The actors rushed in pointing their fingers!
Look ma, no guns!
Look carefully at this policeman’s hands, he’s holding them in a “low ready” position as if he were carrying a pistol, but there’s nothing there.

I guess they thought nobody would notice, and according to google, they were right so far.

If anyone has a high-definition copy of the movie, and can extract that one scene, I would appreciate it. A picture just doesn’t show it all (although a grainy video is worse).

August 11, 2008

Internal Microphones are OK

Filed under: Announcement
― Vincent Gable on August 11, 2008

Laptop’s built-in microphones, even on pretty cheap laptops, do a surprisingly decent job of recording talks. At least that’s the word on the street.

July 28, 2008

Burger King Sucks

Filed under: Announcement | , , , ,
― Vincent Gable on July 28, 2008

My last year in college, there were five fast-food restaurants within walking distance of my apartment. Now I won’t say I’m a connoisseur of the stuff, but I’ve had my share of drive-through-dinners (especially when coupons are involved). And I must say Burger King really stood out with their poor quality food. Unfortunately, they are now the only drive-through restaurant within a mile of my current apartment.

Now, I agree that the Whopper is a pretty good burger — better then anything from McDonalds (but a little less tasty then a Sourdough Jack). And the Cheesy Tots do have their moments. And I have to give props to my local BK for carrying Dr. Pepper, unlike every Taco Bell I’ve been to in the Midwest. And I really liked the creepy/hilarious “The Burger King” commercials. (And don’t forget the Video Game.)

But outside of hamburgers… Burger King is just bad. Almost all of their “chicken” products are mechanically separated meat. Their Original Chicken Sandwich is made of MSM, and has noticeably worse taste and nutritional value then the equivalent offering from Wendy’s, made of whole chicken. Burger King is the only restaurant who’s coupons I’ve thrown away.

Then there’s the health of it all, where Burger King gets low marks: “Fried foods from Burger King are alarmingly high in trans fat, according to The Center for Science in the Public Interest. A regular-size order of Chicken Tenders with a large order of French fries has 8 grams of trans — more than someone should consume in four days.“.

« Newer PostsOlder Posts »

Powered by WordPress