Thu
Jun
21
Detecting microphone activity levels in flash requires a few magic incantations to get it to work:
mic = Microphone.get();
mic.onActivity = function(){}
_root.attachAudio(mic);
// now you can read the activityLevel
trace(mic.activityLevel);
The ActiveRecord documentation for date_select contains the cryptic statement:
"The selects are prepared for multi-parameter assignment to an Active Record
object."
10 minutes googling later...
"Besides that, it's now possible to do multi-parameter assigns that can
even be type-casted. This is extremely helpful to do something like
this for date attributes:
post.attributes = {
"written_on(1i)" => "2004",
"written_on(2i)" => "6",
"written_on(3i)" => "16"
}
If the written_on attribute is of the date type, this is turned into:
post.written_on = Date.new(2004, 6, 16)
The number in the parentheses òepresents the position in the
constructor and the i represents the type cast from string to integer
(you can also cast to floats or arrays)."
Sun
Jun
17
In Lua 5.0, you can get the arguments to a script with:
argv = arg
In Lua 5.1, this will fail horribly.
This bug is present in luaunit, which works only with Lua 5.0.
Sat
Jun
16
I wonder if any of these will ever stick.