«
June 2006 |
»
Main
«
| August 2006
»
Sunday 30 July 2006
This article about
new assignment semantics
in JavaScript 1.7 used Ruby's partition method as an example of multiple
assignment. It was a funny example to me, since I'm quite familiar with
multiple assignment, having used it many many times in Python code.
The new thing for me was partition. I'd never heard of it, though
a number
of programming languages have it.
It's easy to implement in Python:
# An implementation of partition for Pythondef partition(l, pred): yes, no = [], [] for e in l: if pred(e): yes.append(e) else: no.append(e) return yes, no
And it's easy to test:
import unittestdef is_odd(n): return (n % 2) == 1class PartitionTest(unittest.TestCase): def testSimple(self): odd, even = partition(range(10), is_odd) self.assertEqual(even, [0,2,4,6,8]) self.assertEqual(odd, [1,3,5,7,9]) def testAllYes(self): odd, even = partition([1,3,5], is_odd) self.assertEqual(odd, [1,3,5]) self.assertEqual(even, []) def testAllNo(self): odd, even = partition([2,4,6], is_odd) self.assertEqual(odd, []) self.assertEqual(even, [2,4,6]) def testEmpty(self): odd, even = partition([], is_odd) self.assertEqual(odd, []) self.assertEqual(even, [])if __name__ == '__main__': unittest.main()
I also wondered about generalizations: take a function returning a small
integer, and return a list where the i'th element is a list of all the values
for which the function return i? Or return a dictionary whose keys are
the values returned by the function, and the values are lists of input
values that caused them? I imagine different cases could be made for either
of these.
I don't have a use for any of this at the moment, just an idle mental exercise.
BTW: JavaScript 1.7 turns out to have
a ton of new stuff.
It sounds very cool, but how will developers make use of it generally? They
can't count on these features being in general deployment. I guess it's just
for version-specific development.
Saturday 29 July 2006
Odd Job Jack is an animated
TV show on Canadian TV, so I've never seen it. The reason I mention it
is that they are open-sourcing their production files.
FreeJack is their
give-away of all of the files used to produce each episode. The whole
thing is done in Flash, and they've made available all of their work
for others to learn from, borrow, and re-purpose.
It's fascinating to see how the open source movement will translate into
other domains. Will this be common, or is Odd Job Jack going to remain the
odd man out? In either case, it's great for students of animation who
want to see how a show like this is put together. And they've got what
looks like detailed tutorials explaining what they do.
The files are distributed over bittorrent because of their size (about
800Mb per episode)!
Wednesday 26 July 2006
More?
Tuesday 25 July 2006
I attended WebInno 7
last night in Cambridge. This regular gathering is growing quite large, there
were probably 150 people there.
There were three companies doing formal presentations:
These demos were all concise and to the point. One thing they had in
common: none of them mentioned their business model! The first question
for the two social sites was, "What's your business model?", and the answer
was "targeted advertising". MyBlogLog didn't get asked. I assume they'll
have a pro account model, where blog owners can pay for the really juicy
factoids.
SwapTree had a fairly complete app, including printing of mailing labels
with postage when the time came to ship your stuff to someone else.
They've written a browser plugin so that when you're on Amazon pages,
you can query SwapTree to see if you can trade
for the product rather than pay for it.
They've done a lot of work.
It remains to be seen whether people will want to participate in these
ad-hoc bartering networks, and whether they can support themselves with ads
(at least long enough to get bought by eBay).
The PawSpot guy had the most information at his fingertips about the
business side of his product, which makes sense because he mentioned in his
opening sentence that he was from Sloan. Actually, one audience
member mentioned to me that they stopped listening at that point! The interesting
thing about the crowd at WebInno is that there are distinct sectors: technical
people, people wanting money, people with money, and so on.
There were also four side-dish demos that I didn't manage to catch at all.
Another thing all the demos had in common: all of these sites were really nicely
designed. As a result, none of these seemed like technology demos, they
seemed like product demos. Hard to know while sitting in the audience where things
really stood. Design really helps the perception of a completed product.
Five Tabblo'ers showed up to hear the buzz and to spread the word about Tabblo.
The people I spoke to about Tabblo were very positive about it.
Antonio took some pictures:
Monday 24 July 2006
Timeline.
Sunday 23 July 2006
One idle afternoon in the summer, Ben (8) was playing with some Silly
Putty, and asked, "How come no one does claymation with Silly Putty?"
No one had an answer, so with Max (14) as cinematographer with a still
camera, Ben started animating. Fifteen minutes later, we had this basic
proof of concept:
It can be done! Silliputtimation is possible!
BTW: this is the first video I've uploaded to YouTube. They do a good
job of the process, making it very straightforward to get content on their
site. I liked their wording for three-option radio buttons, for example,
for allowing comments on videos. The choices are "Yes", "No", and "Kinda",
meaning moderated.
Friday 21 July 2006
Back in May, I wrote a post about
spam
that was written by genuine humans. In the comments that ensued,
a number of people theorized that the spam was still generated by machine,
since it isn't that hard to synthesize sentences that are kind of on target,
and they had stopped the spam with captchas.
Since then, I've continued to get comments which are strangely relevant,
reinforcing my belief that people are actually typing these comments one
at a time. This morning, though, I had stronger evidence.
Yesterday, I changed my comment software a little bit, and in the process,
added a small bug: web site URLs would be rejected if they had any spaces in them,
including trailing spaces. I should have trimmed the URL first, but forgot
to.
On yesterday's Unnecessary censorship
post, a commenter named "Samantha" tried eight times to post a comment.
The URL she was using was a .info domain about contact lenses, but I'll
replace it here with stupidspammers.info.
Her first comment (at 3:21 am) was a typical on-topic spam comment
(The important trailing spaces are shown as bullets):
name: Samantha
website:••
remote_addr: 64.141.68.58
I was laughing so hard, my stomach hurts :-) And that Bush part was amazing, great work altogether.
error: That's not a good website.
At 3:44, she tried five more times with the exact same comment, probably
re-editing the URL to see if she had mis-typed something that was getting
caught in the URL validation.
Then she posted again, but with a different URL, one to help people
stop smoking, but her trailing spaces were still there, so it failed again.
At 3:48, she removed the URL altogether, and the comment finally worked
(the web site URL is optional). Now that she knew she could get a comment
posted, she made another one, with the URL in the body:
name: Samantha
remote_addr: 64.141.68.58
I was laughing so hard, my stomach hurts :-) And that Bush part was amazing, great work altogether.
<a href="">funny</a>
I can see how you might think the content here could be auto-generated
(though I didn't mention that Bush was in the video, so that's also a give-away),
but the trial and error displayed in these attempts is very clear: Samantha
is a real person typing comments to get links for a cheesy spam site.
The time between her first attempt at 3:21 and her second at 3:44 were likely
spent re-checking the web site herself, or re-checking instructions from
her spam-master.
Ick ick ick. What a world.
Thursday 20 July 2006
Part 3 of the story of our night at the White House.
(if you haven't already,
read Part 1
and Part 2.)
Bush has just declared it bedtime, and left.
»
read more of: Sue and Ned's excellent adventure, part 3... (33 paragraphs)
Brilliant and hilarious: Unnecessary censorship.
Wednesday 19 July 2006
One?
Tuesday 18 July 2006
The '60's all over again, baby!
Dead."
Sunday 16 July 2006
Part 2 of the story of our night at the White House.
(Part 1 is here.)
When last we saw our protagonists, they were ready to enter the dining room for dinner.
»
read more of: Sue and Ned's excellent adventure, part 2... (25 paragraphs)
Friday 14 July 2006
Sus.
»
read more of: Sue and Ned's excellent adventure, part 1... (32 paragraphs)
Saturday 8 July 2006
Some.
Friday 7 July 2006
I...
Saturday 1 July 2006
The Web 2.0 trend
to label everything beta has been continuing unabated.
The Museum of Modern Betas
lists nearly 1500 sites labeled "beta".
Over at Tabblo, we've done our part
to combat this pernicious phenomenon by leaving our public beta period
after only six weeks. In a nod to older software distribution models,
we're labelling it Tabblo 1.0.
Of course, it's a web site, so in all
probability the live code will be updated again before the week is out,
so numbering a release is kind of pointless. But it's better than calling
it "beta" for years and years.
2006,
Ned Batchelder