Archive for February, 2013

Alan Kay: Learning to See

February 6th, 2013 No comments

All of Alan’s speeches are packed with “aha!” moments. This one is no disappointment…

I thought the ending was especially profound:

Every human being is born with the potential to learn to see… with their hearts, bodies, spirits, and minds, and to learn to be… vividly alive and human…

Our great gift is that, though we are the stuff that dreams are made of, we can invest those dreams with the clearer knowledge brought by careful study beyond our simple prejudices.

There is nothing more powerful than imagination coupled with investigation. Imagination allows us to dream and conceive of better futures for us all. Investigation finds the powers and knowledge to make better futures happen.

So I think my advice to our species would be: “We can’t learn to see until we admit we are blind”.

In other words, let us learn how to wake up from the slumbers of our nervous system, culture, and beliefs, [and] try to find out what is going on and what is really needed.

The full transcript is available at

Categories: Critical Thinking Tags:

WordPress: Fix Inove Theme footer for WP 3.5+

February 1st, 2013 No comments

If you see an error at the bottom of your blog pages like:

Warning: Missing argument 2 for wpdb::prepare(), called in /.../wp-content/themes/inove/footer.php on line 22 and defined in /.../wp-includes/wp-db.php on line 990

The problem is that the prepare function was recently changed to require at least two parameters.

As my Inove theme doesn’t seem to be supported, I dove it to fix it myself.

I quickly found a simple fix online. N.B. depending on the application, there may be security ramifications; the changeset linked above mentioned that authors may have been incorrectly using prepare to sanitize queries.

That having been said, to eliminate the error, just change /…/wp-content/themes/inove/footer.php: line 22 from:

$post_datetimes = $wpdb->get_row($wpdb->prepare("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970"));


$post_datetimes = $wpdb->get_row("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970");

That is, remove the call to prepare.

Hope that helps!

Categories: WordPress Tags:

Metacello: Conditional Loading

February 1st, 2013 No comments


The most frequent use case I have is for pending bug fixes. Imagine this… you find a bug in Pharo that you need fixed to progress on your project, so you fix it. Now, you’ll need the fix to be present anywhere your project is loaded, so what do you do while waiting for the fix to be integrated? You’re obviously not about to manually file in changesets when you have a powerful tool like Metacello! And anyway, you don’t want to have to edit the scripts for your continuous integration server.


I’ve found two ways I like to handle this scenario. I’ll show the (slightly) easier one first.

Method #1 – #customProjectAttributes

This is the method to use for Monticello packages

1. Make sure your configuration has #customProjectAttributes

Depending on the version of Metacello that was used to create your ConfigurationOfMyProject, you may have to add this method (which is easy enough).

In ConfigurationOfMyProject>>project, if you see the following two statements:

	"Construct Metacello project"
	constructor := (Smalltalk at: #MetacelloVersionConstructor) on: self.
	project := constructor project.

Change them to the following:

	project := MetacelloMCProject new projectAttributes: self customProjectAttributes. 
	constructor := (Smalltalk at: #MetacelloVersionConstructor) on: self project: project.
2. Define your custom attributes

#customProjectAttributes will return a collection of symbols that will be added to the Metacello platform symbols e.g. #’squeak4.4′ or #’pharo2.0.x’. The following is for the bug fix example we discussed earlier. The general process is a) declare a condition that let’s you know the fix hasn’t been applied in this image (e.g. a class is not present or DNU a message), and if true, add an attribute declaring that (e.g. #’PharoIssue6300′, as below).

	| requiresPharoFix6300 requiresPharoFix6382 attributes |
	attributes := OrderedCollection new.
	requiresPharoFix6300 := (Morph canUnderstand: #hasKeymapCategoryNamed:) not.
	requiresPharoFix6300 ifTrue: [ attributes add: #'PharoIssue6300' ].
	^ attributes.
3. Finally, add fixes to your baseline

With this method, they must be packaged with Monticello. See method #2 below if you have to use changesets or .st files

	spec for: #'PharoIssue6300' do: [
	spec package: 'SLICE-Issue-6300-Detach-keymaping-shortcuts' with: [
		spec repository: '' ].
	spec package: 'VimPharo' with: [ spec requires: #'SLICE-Issue-6300-Detach-keymaping-shortcuts' ] ].


Method #2 – #preLoadDoIt:

This is the method to use for changesets or .st files

1. Add a #preLoadDoIt: to your baseline

For example:

	spec for: #'common' do: [
		spec blessing: #'baseline'.
		spec preLoadDoIt: #preLoad.
2. Define your callback

This method is going to look much like #customProjectAttributes in method #1. The main difference is, since Metacello can not handle file-ins, you will load the code right in this method instead of delegating, as in the following example:

	| shouldFixIssue7294 |
	shouldFixIssue7294 := (EventHandler canUnderstand: #keyStrokeRecipient) not.
	shouldFixIssue7294 ifTrue: [ '/path/to/issue7294.cs' asFileReference fileIn. ].


So when would you want to use method #2? For one, you may already have a changeset handy. But the other reason is time decay. In Pharo, for example, because of the rapid pace of development, the package you fixed may have another fix applied first. Now, loading your version may silently replace those changes (this is what happens in the MC browser, I assume Metcello works the same way). I’m actually still figuring out the tradeoffs here for myself. For now, I default to method #1 unless I have a specific reason for #2.


So there you have a simple pattern to conditionally load packages or code files in a Metacello configuration

Hope it helps!

Categories: Pharo, Squeak Tags: , , ,

windows 7 product key

windows 7 product key

windows 7 key generator

windows 7 key generator

free winrar download

free winrar download

winzip activation code

winzip activation code

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

winrar download free

winrar download free

winzip free download full version

winzip free download full version

windows 7 activation crack

windows7 activation crack

windows 7 crack

windows 7 crack

free winzip

free winzip