November, 2005


25
Nov 05

Time Wasting with Encarta IM

Many people including myself have wasted hours today asking the Encarta MSN IM Bot questions, just add encarta@conversagent.com to your contacts and ask away.

The bot can answer lots of useful questions like “What is the capital of Australia?”, but it can also entertain:

Simon says:
Will you marry me?

Encarta® Instant Answers says:
You’re nice, but I don’t see that working out.

Simon says:
Don’t you love me?

Encarta® Instant Answers says:
Yes indeed.

Simon says:
Then why not?

Encarta® Instant Answers says:
Trust me. There are reasons why not.

Simon says:
Is it because you’re a robot?

Encarta® Instant Answers says:
Yes.

Another favorite:

Simon says:
What is the air-speed velocity of an unladen swallow?
Encarta® Instant Answers says:
What do you mean? An African or a European swallow?

Simon says:
African
Encarta® Instant Answers says:
Based on recent scientific studies, the average cruising airspeed velocity of an unladen African Swallow is roughly 11 meters per second, or 24 miles an hour.

Simon says:
How do know so much about swallows?

Encarta® Instant Answers says:
Well, you have to know these things when you’re a good robot, you know.

Truly fantastic, you can have a lot of fun with this bot!


14
Nov 05

Python Indent Script

So, Python scripting for PN is shaping up nicely. I fixed some leaks, I exposed some more classes, and look what I can do now:

def findPrevLineLastChar(p, sci):
	while p > 0:
		p = p - 1
		c = chr( sci.GetCharAt(p) )

		# Look for a non-whitespace character ending the previous line.
		if not c in ['\n','\r','\t',' ']:
			return c
	return None

def python_indent(c, doc):
	sci = scintilla.Scintilla(doc)
	if c == '\n' or c == '\r':
		pos = sci.CurrentPos
		line = sci.LineFromPosition( pos )

		lc = findPrevLineLastChar( pos, sci )

		# If the previous line ended with a colon, then indent
		if lc == ':':
			indent = sci.GetLineIndentation( line )

			# Modify DumbIndent(tm) Indenting...
			previndent = sci.GetLineIndentation( line - 1 )
			if indent == previndent or indent == 0:
				indent += 4
				sci.IndentLine( line, indent )

# Hook up the python indenter.
s = getSchemeConfig("python")
s.indenter = python_indent

For those of you that can’t be bothered to read the above code to find out what it does, it provides a simplistic smart-indent algorithm for Python. If you add a new line after a “:” character, it indents the line.

Sure the algorithm could be more clever (it won’t work if there’s a comment after the ‘:’ for example) but the code basically works, and I can now write Python code with smart indenting. PN with Python rocks.


8
Nov 05

Text Clip Creator – First Release

You can now download a pretty functional (if rough and ready) editor for Text Clips: The PN2 Text Clip Creator

Requirements:

  • .NET Framework 1.1
  • Desire to create or modify text clips!

Have both of the above? Then get downloading (less than 10k)!

I know of a couple of bugs with this (cancel button doesn’t work, UI not extremely intuitive), and will fix them soon. The source is, of course, available and all contributions welcome: browse text clip creator source. Anyone who wishes to take over responsibility for maintenance of this project will be welcome on board.

Need help getting that source? Ask on the discussion list.

Update: Bjoern Graf has taken over the TCC project, and you can now file bugs for it on the sourceforge bug tracker for his attention! Thanks Bjoern, and good luck!


8
Nov 05

It’s got python in it…

In my PN directory I have a file called “init.py”, the contents look like this:


import pn

def onCharAdded(c, doc):
	s = "Got character: " + c
	doc.SendMessage(2282,  len(s),  s)

In my editor window right now, I have:

aGot character: a

It’s not a lot, it leaks, but it is a python interpreter embedded in PN2 responding to keypresses in an editor window. I finally got this going about 10 minutes ago after hours of head-scratching with boost python, boost shared_ptrs and other fun things.


5
Nov 05

New 0.6 stable release soon

There will be an update release for the 0.6 stable line soon fixing the following bugs:

  1. Unexpected error running tools (Expected a filter_sink instance here)
  2. Problems with tabs on the bottom
  3. Crashes interacting with the projects window
  4. A couple of other minor problems

If you are experiencing the unexpected error running tools, there is a simple fix. Edit the tool that displays the problem, select the “Console I/O” tab, check the settings, and then press OK.


1
Nov 05

DRM Software Going Too Far

Mark Russinovich tells the frightening tale of the rootkit-style software he found on his machine, installed without his knowledge (or permission) by the DRM software on a Sony music CD.

If the technical details in his write-up are all a bit much, I’ll summarise: When Mark played the Sony CD in his Windows computer, it quietly installed some software onto his computer that used special techniques to make it appear as if no such software was there (the files were hidden from most Windows programs including explorer). Not only this, but the software provided no way to remove it (should you discover its presence) and manual attempts to remove it by one of the more talented Windows hackers in the industry were fraught with problems.

It seems that not only are music lovers treated as criminals by the music industry, but that the music industry themselves are resorting to criminal methods to try and prevent fair use! Let us be very clear here – the people that this will affect are not those that are ripping enormous quantities of music and making them available online (who disabled autorun on their cd-rom drives many years ago), it affects the average home legal music user in an underhanded, undocumented and unwarranted way.

In case you hadn’t noticed, this stuff makes me mad!

Update 1: The software phones home too!
Update 2: Mark receives a response from First 4 Internet, creators of this rootkit. Mark then trashes said response.