Monday, September 25, 2006
The Economist Podcast
It's quite interesting to hear the voices of the authors of The Economist's articles and fortunately their podcast seems to be updated now more regularly.
Sunday, September 10, 2006
Dario Nardi on Socialbot
When I met Dario Nardi earlier this year he told me he prepared a video for Frontiers of Interaction II on socialbot as he couldn't be there in person.
Now some kind soul has uploaded his talk on youtube (Part 1, Part 2).
AFAIU socialbot is a little like Eliza but not aiming at being a therapist, rather than that it imitates cognitive behavior by showing aspects of memory, inference and animated gestures; and it uses speech recognition as well. When used in a seminar with students interaction sessions get logged and are used as a harness to further development of socialbot's behavior.
Now some kind soul has uploaded his talk on youtube (Part 1, Part 2).
AFAIU socialbot is a little like Eliza but not aiming at being a therapist, rather than that it imitates cognitive behavior by showing aspects of memory, inference and animated gestures; and it uses speech recognition as well. When used in a seminar with students interaction sessions get logged and are used as a harness to further development of socialbot's behavior.
Saturday, September 09, 2006
JavaScript Memoization and Dependencies
I've extended Oliver Steele's appealing implementation of memoization in JavaScript to use a different dependency mechanism which also works with complex variables such as arrays or hashes by introducing a dependencies callback that returns a string or other simple datatype.
Here is some code that shows how memoize() can be used to specify dependencies both on function arguments and global variables.
Take a look here if you're not familiar with the concept of Memoization.
(Thanks to Stephan for mentioning Oliver's post.)
Function.prototype.memoize = function(options) {
var fn = this
var cache = []
return function() {
var dependencyFlags = options.dependencies.apply(this, arguments)
var cacheHit = cache && cache[0] == dependencyFlags
if (cacheHit) {
return cache[1]
}
cache = [dependencyFlags, fn.apply(this, arguments)]
return cache[1]
}
}
var fn = this
var cache = []
return function() {
var dependencyFlags = options.dependencies.apply(this, arguments)
var cacheHit = cache && cache[0] == dependencyFlags
if (cacheHit) {
return cache[1]
}
cache = [dependencyFlags, fn.apply(this, arguments)]
return cache[1]
}
}
Here is some code that shows how memoize() can be used to specify dependencies both on function arguments and global variables.
var sortOrder = 0;
getSortedModel = function(user) {
// ... some lenghty calculation
alert("Performing Lengthy Calculation for " + user)
return [1, 2, 3, 4]
}.memoize({ dependencies: function(user) { return user + ":" + sortOrder }})
getSortedModel = function(user) {
// ... some lenghty calculation
alert("Performing Lengthy Calculation for " + user)
return [1, 2, 3, 4]
}.memoize({ dependencies: function(user) { return user + ":" + sortOrder }})
Take a look here if you're not familiar with the concept of Memoization.
(Thanks to Stephan for mentioning Oliver's post.)
Friday, September 08, 2006
A Dedication to "King Lear"
O bridal world of sunshine dreams
colour me brutish
wicked eyes
violently in lust
trifle life
God's horror hath a place
in the bluntness of
a serpent-like man
Cordelia,
our mildness
once, strong
is thy prison
of eyeless love
colour me brutish
wicked eyes
violently in lust
trifle life
God's horror hath a place
in the bluntness of
a serpent-like man
Cordelia,
our mildness
once, strong
is thy prison
of eyeless love
Subscribe to:
Posts (Atom)