The traceback module has utility functions for printing the currently running stack, not just tracebacks.
import traceback
import logging
# somewhere in your buggy code
logging.log(1, "".join(traceback.format_stack())
pulling the rug
Friday, 24 July 2009
The traceback module has utility functions for printing the currently running stack, not just tracebacks.
import traceback
import logging
# somewhere in your buggy code
logging.log(1, "".join(traceback.format_stack())
Wednesday, 15 July 2009
Bill Gates bought and put Feynman’s physics lectures on line. Unfortunately, I couldn’t watch it using Chrome (which has outstanding stability compared to IE8). However, once in a while, I’m prepared to pay the Microsoft Tax, fire up MS IE and watch:
http://research.microsoft.com/apps/tools/tuva/index.html
Update: It appears that the site is down at the moment.
Tuesday, 14 July 2009
Escaping escapes can be a near impossible task with XSLT.
Here is the standard form of testing whether a string matches
<xsl:if
test=”countryName=’USA’” >
Name matches
</xsl:if>
What happens if the country name is People’s Republic of China instead?
You can’t use the apostrophe because the single quote is already used to delimit the string.
You can’t use double quotes [...]
Wednesday, 24 June 2009
Like any other information junkie, my browser is full of open tabs of material that I would have liked to have read, but simply lost interest or took too long to read. It occurred to me that I would normally read books at a faster pace, but somehow the screen wasn’t conducive for speed reading. [...]
Friday, 24 April 2009
A Japanese publication has a very nice writeup about Lars Bak’s V8 engine (in English) Why is Google’s new V8 Javascript Engine so fast – Nikkei Electronics Asia
I even learned new words like “Premonomorphic”
Friday, 24 April 2009
Note to self. If I see another error involving NOEXPAND check these
1) Make sure server is running SQL 2005
2) Make sure the view has WITH SCHEMABINDING in the DDL (i.e. I need to check my upgrade scripts, … in reverse order)
Thursday, 16 April 2009
Tom Gleeson aka Goban Saor has an interesting perspective on how well SQLite acts as a general table store which can then be used in OLAP and Excel. He describes the SQLite as the “MP3 for databases”, and I think he comes pretty close to the mark on this.
What’s there to stop anyone from [...]
Wednesday, 15 April 2009
Here’s the configuration page if my memory fails me in the future
https://www.mynetfone.com.au/media/support/downloads/sipura-spa2000/config/config.html
Tuesday, 7 April 2009
I came across Almost Perfect via Hacker News, a candid first-hand account of the rise and fall of WordPerfect.
It is so interesting to see how WordPerfect was blind its impending death. I am not singling out WordPerfect here, rather as a theme how corporations are all blind to their eventual death. The singular theme [...]
Saturday, 21 March 2009
It’s Saturday morning and I’m bored.
I might go create something whose sole purpose is to praise me.
while 1:
print "I praise Chui, who created me for the purpose of praising him."
Tuesday, 3 March 2009
Something to read later.
I first heard of Etherpad on IT Conversations. Etherpad enables users to edit the same text area, using serialized javascript functions to transmit diffs.
Marek implemented a scalable etherpad clone using Erlang and RabbitMQ. All in six afternoons.
Wednesday, 18 February 2009
Click on image above to launch via WebStart
Drawing rectangles is pretty straightforward in JavaFX. I decided to add a little bit of animation so that the pieces of the puzzle “fall” into place. This is done by applying ParallelTransition which combines ScaleTransition, RotateTransition and TranslateTransition.
Tuesday, 17 February 2009
More here:
“A taxi driver must also have scientific methods,” he said. I was surprised and I got curious: “What scientific methods?”
Monday, 16 February 2009
Steps:
1. Use javafxpackager to create the .jar file (it will be created in the dist directory). Make sure the dist directory is empty, or you’ll find your jar file growing bigger each time.
javafxpackager -appClass fisheye -src .
2. Launch the jar file, and don’t forget to include the path to the JavaFX libraries
java [...]
Friday, 13 February 2009
Here is a minimal test case illustrating how exasperating the default JavaFX Text node can be, especially when aligning text.
You’d be surprised to note that both pieces of text below are aligned using TextAlignment.CENTER.
import javafx.scene.text.*;
import javafx.scene.layout.*;
VBox
{
translateY:10
content:
[
Text {
[...]
Saturday, 7 February 2009
Calling oneself a Buddhist is no justification for seizing land from other ethnic groups. http://news.bbc.co.uk/2/hi/asia-pacific/7872635.stm
Wednesday, 4 February 2009
JavaFX gets to start on a clean slate, without burdens of compatibility with browsers. However, how well does it paint itself?
How are – say – Rectangles defined?
Is the startX based on center lines? or is it from the origin?
What about borders? Are borders painted to the bottom right of the origin?
How [...]
Tuesday, 3 February 2009
For java developers, JavaFX is a breath of fresh air in terms of conciseness and power. A lot more could be expressed in much less lines.
However, for a web developer, the effort involved in creating some text bounded with a rectangular box on JavaFX is considerably higher compared with HTML.
I recommend starting off with a [...]
Thursday, 29 January 2009
There seems to be some misconceptions about mutability rules with JavaFX sequences (see here for example).
We can see what is going on under the hood by using the java disassembler (javap).
// seq.fx
var mylist = [1..3];
insert 4 into mylist;
compiling using javafxc seq.fx and then disassembling it with javap -c seq shows us what goes on under [...]