Home

t3knomanser's Fustian Deposits

More drek than you can pull from an elephant's arse.

How Random Babbling Becomes Corporate Policy

IOCCC Original Winner

Mad science gone horribly, horribly wrong(or right).

Navigation

July 11th, 2009

Morons oppose security

Add to Memories Tell a Friend
tesla
Today, ImageShack was hacked by some anonymous children seeking to get their manifesto out there. If nothing else, it does a good job of showing off that the differently-abled can still master basic computer security tools.

Actually, I'm pretty sure this is a prank. They ramble on and on about the evils of "full disclosure". But nobody in the security industry advocates full disclosure. To the contrary, responsible disclosure is the most common approach security researchers take. When a researcher identifies a vulnerability in a software product, the first thing they do is approach the vendor to alert them to it. The vendor is given a reasonable period of time to work out a patch, before the details are revealed to the public. In some cases, the only people who get full details are the people responsible for the software- everyone else gets alerted to the vulnerability.

But in any case, the objection is: why disclose vulnerabilities at all? Why not keep them a secret, thus keeping the bad guys from exploiting them?

Because many of the bad guys are pretty smart. If I'm smart enough to find a security vulnerability, there's good odds that there's a bad guy who is also smart enough to find it. So when a vulnerability is discovered, it's good to assume that the bad guys already know about it too. Maybe they haven't exploited it yet, but they could be working on it. You certainly don't know what they know or what they're doing, and you can't control it either.

Keeping it a secret doesn't keep the bad guys from finding it, but it does keep the good guys ignorant. If the good guys don't know about the vulnerability, they don't know what they can do to defend themselves. Until the vulnerability is patched, they're sitting there exposed- and without disclosure, in blissful ignorance.

Okay, but why full disclosure? Isn't it enough to say, "Hey, I found a vulnerability?" Nope, because the software vendor's response is: "No you didn't. Prove it." And this is where the "science" aspect of computer science kicks in. The researcher has just published the results of an experiment: "I performed test X, and got result Y, which means I just pwned this system." Merely publishing the results is not enough to prove you've done it- you also need to show your work. You have to distribute your methodology, so other people can replicate your work.

The sucky thing, of course, is that, if the bad guys haven't found out about the vulnerability, they certainly have now. Which brings us back to responsible disclosure: a researcher should give a vendor a window in which to resolve the problem. The fact that this window closes is vital to keeping the vendors honest. There have been plenty of occasions in which researchers have alerted software vendors to a vulnerability, and the vendor has ignored them.

Fixing bugs costs money, and fixing security vulnerabilities looks bad- like they're admitting weakness. A company, acting on its short-term best interests, may choose to ignore reports from the security community. But if the researcher discloses the vulnerability to the public- well, now the vendor has to act.

July 7th, 2009

On critique

Add to Memories Tell a Friend
IOCCC Original Winner
With the recent spate of money-making, blockbuster films that are heaping piles of suck, people complain that it's unfair to call a movie bad- it's just opinion. There are no objective standards.

There are objective standards. When picking a hammer, many of the details may be a matter of the user's taste, if the hammer is unable to drive nails, we would all agree that it's a bad hammer. If your aunt knits you a sweater with no arms, while it was a sweet sentiment, we would all agree that it's a bad sweater. If someone were to take a great number of words, selected at random, put them onto page and call it a novel, I think we would all agree that it's a bad novel.

While there is a lot of room for opinion, in any creative endeavor, there are metrics for success and failure. There are, mostly qualitative, but some quantitative measures for whether a creative work is "good" or "bad".

My purpose here is not to write a treatise on critique, which I'm sure has been done better by someone else, who has devoted a great deal more time and effort to the subject. But as a critical dilettante, here's how I approach a critical examination of creative works- regardless of medium.
Read more... )

July 3rd, 2009

Idea Mining

Add to Memories Tell a Friend
run the fuck away
So, I've been doing "this thing", the thing being "idea mining". I'm the sort of person that gets all sorts of random ideas during the day. At the time, they always strike me as interesting, but they're always transient. Idea appears, it looks interesting, and then it's forgotten as I go back to the actual task at hand.

Later, I sit down, and try and remember it, and WHOOSH. Nothing. It's gone.

So, a few weeks ago, I decided to start trying to record those ideas. The name of the practice is idea mining. The goal is to collect ones ideas and thoughts, organize them, and use them later as sources of inspiration and action. Or maybe pass them off to someone better positioned to act on them. Or just put them aside because they're impractical, or just plain dumb. Whatever.

Step One: Record


The first step in building an idea mine is recording your ideas. The obvious choice would be a notebook. I personally use Evernote on my iPhone. A handheld digital recorder, a PDA, whatever. Some people like Wikis.

Regardless of what you chose, it has to be:
a) Something that you always have with you - you can't record your ideas in it if it's not there
b) Something that is low friction and quick - you aren't going to record your ideas if it takes a significant amount of effort to record them
c) Something that is easy to work with later

That third point is my main reason for sticking with Evernote, but again- it doesn't matter what you use. Focus on the goal- record ideas when you have them. I'm the sort that does his best thinking on the toilet or as he drifts off to sleep, so my phone is great. If you do your thinking in the car, a digital recorder might be better.

It also takes some discipline. I know, several times, I've been near sleep, had an idea, and had to force myself to sit up and scribble it down. I try and say things like, "Oh, you'll remember it tomorrow," or "it's not that good an idea anyway".

And you'll have that thought a lot. "It's not a good enough idea to be recorded." Irrelevant! Maybe you're right, maybe you're wrong, but record it no matter what. Even if you ignore everything after this step, record every idea. Don't try and only record the good ones, because you're not always going to be able to tell, and the goal here is to build up the habit of recording your ideas. Once you get into the habit, you're going to get more ideas.

My experience with this step was that, for the first week, I was a virtual font of ideas. It tapered off and I went through a dry spell for a few weeks, and now I'm getting up a steady output of a few ideas a day, coupled with a few longer "jot of the day" notes- several paragraphs expanding on an idea of interest to me.

Step Two: Organize


You're going to be generating a lot of data, here. You're going to need to spend some time going through it. Fortunately, you've got all your ideas recorded, so there's no real rush on this. Even if you get backlogged, the ideas are still written down some place, and you won't forget them now.

How to organize them is up to you. Using Evernote, all the notes I record on my phone are synced to my home computer. In my Evernote client, I can tag the notes, using tags like, "good idea", "bad idea", "impractical", "actionable", "todo", "done", etc.. I tag by topic too, like "mad science", "writing", "hook", "character".

Again, the techniques to use here are largely up to you. Unlike recording, which requires immediate action, this can be done at your leisure. Just don't lose anything, because the last step is:

Step Three: Mine them thar' ideas!


Keep the organizing and acting steps separate. Periodically, check your "actionable" ideas, see if there's anything you want to tackle. When you're working on a creative project and are stumped, head back to your mine and see if there's anything in there that works for you. Use it for inspiration. Use it as a todo list. Use it as a personal reference.

My experience, after having done this for a few weeks, is that you're in for some surprises. You'll have more ideas than you think you will, even through those dry spells (in the past month, I've logged 206 notes, for an average of 6.9/day- not Manfred Macx territory, but not too bad). You'll have more bad ideas than you'll ever expect, (one of mine was a portable bidet, another was that a late night talk show hosted by William Shatner would be awesome, and an idea for a movie starring Eminem and Steve Guttenberg called, "What Mathers?"), but you'll also have a bunch that make you go, "Hey, that's pretty clever."

The final goal, of course, is to act on some of these ideas. Or hand them off to someone who can. Add a little creativity to the world, and turn ideas into end products.

June 26th, 2009

That extra pudge is a side effect of the panorama process. He's husky, but not quite that husky.

June 19th, 2009

Ship of Theseus

Add to Memories Tell a Friend
Podlek
The Ship of Theseus is one of those old philosophical saws. It came up in conversation the other day, and so I skimmed the Wikipedia article, only to be surprised that none of the sources cited took the same attack to the problem that seemed intuitive to me.

So, on the off chance this is a relatively original idea, I decided that I should get it written up.

For those unfamiliar, the Ship of Theseus poses this problem: If you take a ship, and replace every component of the ship, until nothing original remains, is it the same ship? At what point does it cease to be the same ship?

Common sense tells us, of course, that it is the same ship. And everyone from Aristotle forward has tried to explain why that is, with the occasional jerk that takes the stance that it isn't the same ship.

The Aristotelian approach was to separate the formal cause and the material cause of the thing. It's a fairly Platonic approach, which isn't surprising: there's the "idea" of the ship, and the "material" of the ship- even as the material changes, the idea stays the same. Pirsig's concept of patterns is a less Platonic approach to the same idea: there's the pattern of a ship which is made up of subpatterns in the form of the different components; changes to the subpatterns don't change the over-pattern.

The other big approach is "four dimensionalism"- which, at first glance, was my preferred approach to the subject. If you view the ship not as a three dimensional object, but a four dimensional one, where its history and future are one long line, and the 3D ship is just one temporal slice out of that line, you can easily resolve this conundrum.

Except, of course, that to be complete, one would have to have a 4D timeline for all of the components, and suddenly the ship is less a ship, than a generalized area where the timelines for other objects occasionally merge.

I'm not a fan of any of these approaches, in part because they all share an unspoken assumption: that the world is composed of objects, and that these objects are distinct from one another.

Our sense organs receive inputs from the world, a whole hierarchy of processing centers pick up those signals and organize them into structures. When you look at the pathway of just the visual processing centers, you can clearly see the evolutionary steps that built the rather complex visual system we have. At low levels, we have simple abilities like recognizing lines, and increasingly complex abstractions get built up from what is, at the lowest level, the stimulation of light sensitive cells.

Photons excite your rods and cones, which in turn send signals across your nervous system, which get processed by various neurological systems and result in a mental model of the world, where those photons are interpreted as "a ship".

A large purpose of our brains is to convert the inputs to our senses into models that can be manipulated and acted upon. If my brain is able to identify that ship as Theseus's ship, and not my ship, I know not to trespass, less I earn myself an ass-kicking. And by being able to distinguish those sensory impressions as "a ship" and not, "ocean", I can do nifty things like not drown because I thought I was standing on a boat's deck while really I'm on the ocean floor.

It sounds absurd, but we know that, when failures occur in this processing system, really bizarre results can occur. Like the rather famous story of a man who thought his wife was a hat.

The point I'm trying to dig down to is this: the world is not a collection of objects that we can interact with. The world is continuous. The identity of objects as distinct objects is not a fact of the world, but a fact about our understanding of the world. The pile of matter that constitutes Theseus's ship is just a pile of matter.

The problem of Theseus's ship is not one of the identity of objects: objects don't have an identity. The identity of objects is a perceptual thing, born from our own minds' organizing principle. Our brains are object oriented. The world can be understood in these terms, but as the Ship of Theseus problem shows, there are edge cases that can give us bizarre results when we start trying to analyze what about an object provides it with its identity.

God, I hope that made sense.

June 16th, 2009

Safe Communications

Add to Memories Tell a Friend
run the fuck away
Given the events transpiring in Iran, now's a good time for more people to fire up Tor, an "onion router". Essentially, it's a Peer-to-Peer anonymizer that helps keep your Internet traffic confidential. The more peers on the Tor network, the better the network performs and the more anonymous it is.

Tor also acts as a proxy, so if you or someone you know is living in a country where Internet traffic is restricted, using Tor allows them to bypass web censorship. With browser plugins to make it easy to use, anyone with only a small amount of technical know-how can get unfiltered web access whether their government or employer likes it or not.

You can download Tor, and quickly benefit from its security benefits, if you're concerned about staying anonymous online. If you want to help others bypass censorship, you must run in relay mode. It's easy to setup, and will only take you a few minutes. It will even do its best to talk to your router to configure services so that you don't have to.

By simply leaving a Tor relay node running on one computer on your network, you can help guarantee anonymous, unfiltered access to the Internet for anyone in the world. No muss, no fuss.

If someone lives in a country with web censorship, they may have a hard time getting access to the Tor install files. So, if you have some web space, consider mirroring the install files. Pass the link discreetly to those that might be interested in such things. I'm setting up my own mirror right now.

June 14th, 2009

Riots in Iran

Add to Memories Tell a Friend
IOCCC Original Winner
At this very moment, things are spiraling out of control in Iran. Frightened by a suddenly politically active youth bloc, the government did the only thing you can do if you're a repressive, theocratic, and generally vile government: it tampered with the election results. It didn't just tamper- "tampering" implies that they wanted to conceal their actions. They fabricated election results. They released election results that have as much grounding in reality as Lord of the Rings.

The message was clear: "Go away. We do not want you involved in the political process. Return to your cynicism and go away. Fuck. You."

Fuck you indeed. Since the announcement of the fabricated results, the Persians have taken to the streets, and they're still out there. Marching, rioting. They are mad as hell, and they're not going to take it anymore. As of this morning, protests are still moving through the cities.

It's too early to tell where this is going to go. The government is scrambling, raiding dorms, arresting anyone that could rally the people, cutting power, Internet, telephones, and now hunting satellite phones. But word is still getting out, people are still getting organized.

This may be the beginning of the end for the current regime, and good riddance to bad rubbish. For Persians and for the rest of the world, this violent upset could be the best thing to happen to the region, and it's been a long time coming. This could be the death of Iran's theocracy.

Which raises the question, where's the US news media? It's not that they're not covering the story- it's getting headlines, here and there. But they're focusing on other things. Last night, as people were taking to the rooftops in Iran. CNN's top story was the Six Flags Bankruptcy.

Not only was the Internet the best place to get up to the minute reports, it was the only place. Considering Iran's role in the US's foreign policy, this is patently ridiculous.

All this said, there's painfully little we can do. But some people in Iran are still online. Discuss the subject, and let the people of Iran know that the world supports them.

June 9th, 2009

I'm the KOOL AID MAN!

Add to Memories Tell a Friend
Tom Baker


//Oh yeah!

June 6th, 2009

Minna and I haven't been too hot on buying a house. We're saving a big wad, and waiting for the right thing to come along. We're not going to stress about it, we're not going to angst over it. Our apartment is nice, cheap, and enough for anything we need.

In short, we're a Realtor's worst nightmare. They can't leverage us. "I've got another offer in, so you need to act quick!" No, no I don't. If I don't get this place, there'll be something else. Each place I've looked at is nicer than the last, and at a better price.

We looked at a place today, and we were feeling pretty good about it. We tagged along on someone else's showing, so we didn't meet the selling agent. In order to save a few bucks, Minna and I are willing to brave the process without a buyer's agent, if the seller's agent is willing to cut their commission from 6% down to 4-5%.

I thought this was pretty reasonable, and I've talked to some Realtors that were fine with such arrangements. This Realtor, on the other hand, gave me shit over it. "Oh, I'm way too busy to handle both sides of the transaction for a mere 4-5%."

Yeah, because we've eaten up so much of your day by getting you to show the house (oh, right, we didn't!). And, like a regular buyer's agent, we've dragged you to a million houses while looking for something we like (oh, right, we didn't!).

If we brought in our own buyer's agent, she'd get 3%. I'm offering her 1-2% on top of that all for the glorious chore of signing some papers. It just makes no sense to me- I'm offering you more money for doing pretty much nothing. It just boggles my mind. Even worse, she was such a raging bitch about it, that I don't even want her to get even the 3%- I don't want to do business with her. It's not that she was rude, or really lost her shit, she just started ranting at me well past the point where I was ready to drop the subject. I'm trying to cut you a deal, I'm trying to work out something were everybody wins. It's fine to say "No thanks," but she ranted at me about it well past the point where I cared anymore, and was just trying to end the phone call politely.

It's sad, because it was a nice place, but the condo fee was too steep anyway- $200/mo is just more than we could afford on top of taxes and mortgage. She had an offer in anyway (she claimed, and I believe it), so she can just hope that goes through, because I'm not going to counter offer, and if I see she's the selling agent on another property I'm interested in, I'm going to avoid it. It'd have to be something really special to get me to deal with her.

There's a reason Levitt equates NAR with the KKK (Freakonomics is an excellent read, by the way).

June 4th, 2009

On the Order Of

Add to Memories Tell a Friend
IOCCC Original Winner
Programmers, when they're really concerned with being efficient, will often start talking about "Big O" or "Order". There's a lot of interesting math behind this, but what it boils down to is a very simple concept- how many operations does it take to solve a certain problem, using a certain algorithm? I'm going to simplify things here, ignore the difference between so called "Big O" and "Little O" and not worry too much about the theoretical underpinnings. This also isn't the only metric used to evaluate how efficient an algorithm is, but it's a major one.

For example, if I hand you a deck of cards, and I tell you to find the Ace of Spades, how many cards would you have to look at in order to find it? Assume you start at the top, and keep drawing cards until you find the one you want. In the best case, the very first card you flip is the one you're looking for. That's on the order of one operation, written as O(1). But, that's the best case. What about the worst? If it were the last card you flipped, that would have taken 52 operations- O(52), or, to be really programmery, O(n), where "n" is the number of cards in the deck. By being general, we can extrapolate this to any collection of cards- be it a full deck, less than a full deck, or even a collection of something else entirely- like an address book.

When talking about the "O" of an algorithm, programmers don't like to worry about constants. We don't like "52"- that's far to specific. "n" is much more useful. But similarly, if there were an algorithm with O(2n+1), we're going to ignore the 2 and the +1 and just call in O(n). Doubling it once just isn't a big enough change to really count. It's details and small stuff, and if "n" is sufficiently large, it just doesn't matter.

Now, searching each individual card in the deck isn't terribly clever, but if the deck is shuffled, that's really all you can do. Picking out randomly, going from top to bottom, bottom to top, it just doesn't matter. But if the deck were sorted- now that could be useful. Think about the phone book- it's sorted, and you don't have to search every single name to find the one you're looking for.

If you were writing a computer program to find a name in the phone book, you'd start by going to the name in the middle. If it's the name you're looking for, great, you're done. If not, does it come before or after the name you're looking for? Once you know that- you've just eliminated half of the names. Take the remaining half, and go to the middle. Repeat the previous process until you find the name you want. Each operation (name you look at) eliminates half of the remaining names. Searching a sorted list is very effeceint, and in this case, it's on the order of "lg n". (lg is the log base 2, or "what power do I have to raise 2 to to get "n"). This, by the way, is called "binary search" and is the goto searching algorithm to use in any search.

In our naive search, where we just checked every element, it's O(n). In a deck of 52 cards, that's 52 operations. Not that bad, but what if I had a list of 1,024 items? That's 1,024 comparisons. But if we used the binary search, it's O(lg n)- 10 comparisons. (210 = 1,024). That's a savings of 1,014 comparisons, in the worst case.

Programmers tend to break down algorithms into a few major categories based on their Big O.

Stuff that's O(lg n) is very fast stuff. They scale really efficiently to big sets of data (1,000 elements is 10 operations, a million elements is 20 operations, a billion elements is only 30 operations!).

O(n) isn't as liked, and most O(n) algorithms can be turned into O(lg n) if you're very clever and find ways to cheat (for example, if you need to search an unsorted list, it'll always be O(n), but if you sort it first, even though sorting is expensive, you'll make it up if you search a lot).

Sorting is really expensive, in comparison. The best sorting algorithms are O(n*lg n). That means, for a set of a thousand elements, it would take 10,000 operations to sort. Ugh, but some problems just can't be made any easier. O(n*lg n) is the best you'll get for sorting algorithms, and there are whole classes of problems that fall into this category.

Worst is O(n2), or even larger exponents. This is the demon of programmers. For example, the first sorting algorithm that most CompSci students learn is the Bubble Sort. It's very simple to understand and implement, but it's an O(n2) sort. But, to sort 1,000 elements, you have to do 1,000,000 operations. Algorithms that run in "polynomial" time are ones that programmers hate. It's worth noting that there are a lot of problems that, as far as we know, can't be solved any faster. There's a whole family of problems that are called "NP Complete", which, right now, can only be solved in polynomial time. Whether or not it's possible to find a better way to solve these problems is an open question.

This was brought up today because I'm working on Gravitone, an iPhone instrument that uses gravity to generate music. I took a very naive approach to the problem, and simply cycle through all the masses and objects in the world and apply gravity to every other object. My algorithm is O(n*m), where n is the number of orbs in play, and m is the number of masses. Sort of polynomial, and if I were to try and scale it up so that the orbs could effect each other, it'd be O(n2). Ugh, polynomial time? That's expensive. Or is it?

I did some research in gravity simulation, and found that the best algorithms out there run in O(n*lg n). The one I looked at specifically was called the "Barnes-Hut algorithm", and it's very clever, and something I'll probably use for a different application. It's also fairly complex to implement, and requires a lot of memory, despite being very fast (memory/speed are a common trade off).

It's faster, but should I use it in this application? No!

In my application, I've capped it at 15 orbs in play and 5 masses in play, which means it's going to take 60 operations.

That's 20 objects total, and in the Barnes-Hut algorithm, 20 * lg 20 ≈ 60 operations.

For very small data sets, sometimes, really expensive seeming algorithms are okay. Now, the Barnes-Hut algorithm would be better- it would scale better, and it would allow me to have the different orbs attract each other, and the masses- it'd be a much more compelling simulation, but that's not the point of the application. I don't need the power offered by Barnes-Hut.

All that said, I think making a Barnes-Hut simulation on the iPhone would be kinda neat. Maybe a game, or a different instrument.

May 4th, 2009

Antivaccination Deaths

Add to Memories Tell a Friend
abort!
An infant died of whooping cough in Australia recently. She was too young to be immunized, but if the adults she came in contact with had been, she would have benefited from herd immunity, and would still be alive.

Out of curiosity, I ran some numbers on vaccinations.

Let's be very generous. Let's posit that this utterly unsubstantiated and implausible link between autism and vaccination exists.

What's the rate of incidence? There's 6 in 1,000 people that have some sort of autism spectrum disorder. 2 in 1,000 have true autism. We'll work with that number. Let's assume that every member of this 0.2% is properly diagnosed and the disease was caused by a vaccination.

I repeat: these assumptions are very generous. Even if vaccines did cause autism (they don't), we know that there are other causes as well. These are very generous assumptions to make.

Now, let's look an measles. In an vaccinated person in a developed country, 3 in 1,000 people die- 0.3% fatality rate. In underdeveloped nations, it's closer to 280 per thousand. In immunocompromised patients, like AIDS victims or cancer patients, it's in the same neighborhood- about 300 in 1,000.

And that's just measles. And that's just deaths- we're not counting complications like corneal scarring- yes, measles can blind you.

So, even if we grant the most generous possible claims made by the anti-vaxxers, their arguments don't stand up. Measles, alone, is a more credible threat than vaccine induced autism, even if every autism case was caused by a vaccine. Even if we take the absurd claims at face value, the argument doesn't hold up.

Oh, let's keep going. Whooping cough kills 600,000 people a year of the 10-90 million it infects. Why the big range? It occurs mostly in third world countries where it's hard to get good statistics. Let's pick in the middle- say, 60 million cases. That's a 1% fatality rate. Heck, even if we go out to 90 million, we're still looking at a 0.6% fatality rate- which is the same rate of autism spectrum disorder in the population.

Between measles and whooping cough, we're talking a 0.9% fatality rate. Wanna start adding diseases? Polio isn't extinct, you know.

Ignoring the non-existent autism link, there are real risks to vaccines. The CDC has some data, but it should be perfectly clear: vaccines are less dangerous than the disease they prevent.

April 25th, 2009

I love functional programming. I'm going to present on doing FP in VB.Net in August- this is a feature new to .NET 3.5. I was very excited about the ability to do functional programming in VB.Net. And some of the key features I really wanted, currying and closures, are there.

But the limitations... they almost make it not worth the trouble. Most obviously, VB.Net doesn't support true lambdas. In a true lambda environment, I could do something like this:
f = Function(x as integer) if (x % 2 = 0) then return x / 2 else ... some other code ...
In true lambdas, you can put any code you like inside of your function. C# and F# allow this. VB.Net does not- VB.Net only allows expressions (you can't do ifs or loops or anything like that).

Still, there's a lot you can do with expressions, so that's not too bad. Since you get closures, you can work around that without too much trouble.

But then you start running into the bizarre things. I wanted to do a patterned call. In many functional languages, you can create functions like this: f(1) = 1; f(2) = 2; f(x) = f(x - 1) + f(x - 2);. Calling f(13) will print out the 13th number it the Fibonacci sequence.

Now, I accept that VB.Net wouldn't have an architecture like that built in- it's a somewhat obscure functional trick. But I was hoping I could roll my own. My first attempt at it was to come up with a compiler macro- oops! VB.Net doesn't support pre-proccesor macros. C# does, of course.

Well, okay, what about Attributes? .NET has the ability to define metadata on code, that you can "reflect" on to change runtime behavior. I could do something like this:
Module 1
  '"fib" is the function name, the second parameter is the pattern- if it returns true, execute this
  'operation, otherwise, go find another operation named "fib" to execute.
  <PatternedFunction("fib",function(x as Integer) x = 1 or x = 2)> Function f1(x as Integer)
    Return x
  End Function

  <PatternedFunction("fib",function(x as Integer) true)> Function f2(x as Integer)
    Return PatternedCall("fib")(x - 1) + PatternedCall("fib")(x - 2)
  End Function
End Module


Not as concise as I would like, but hey, it works, right? Wrong. Turns out, since Attributes are evaluated at compile time, you can only pass constant expressions into them. Since a function may possibly contain a closure (even though this one does not), you can't ever treat a function like a constant.

I'm being an FP snob, and I know it. My reason for wanting to do this is less because I have a specific need and more because I want to. I get frustrated when a language implements a potentially awesome feature in a half assed way, but as I think about it, "Potentially awesome, practically useless" describes VB.Net to a "T". If I had my druthers, we'd be a C# shop if we were doing Microsoft at all- I think a big portion of our business would be streamlined by a real RAD language, like Ruby or Python.

All of my complaints would be patched if VB.Net supported compiler macros. I'm stunned that it doesn't- it's not exactly the hardest thing on earth to implement; your average C compiler has had a macro pre-processor since before I was born. C# has one. And here's the real kick in the teeth: most macro engines are language agnostic, so there's no reason they couldn't have wired the C# engine onto VB.Net.

Basically, this is an exercise in driving home the flaws of the language that pays my bills.

April 21st, 2009

Gravitone

Add to Memories Tell a Friend
IOCCC Original Winner


Here's a demo of my current project- an iPhone app called "Gravitone".

April 12th, 2009

Ever since moving to Pittsburgh, I've kinda been avoiding the Warhol Gallery. I don't like Warhol. I don't generally care for pop art (although this is pretty cool).

But, a friend volunteers/works there and managed to score tickets to a beer tasting. Hey, free beer? I'll take a look at any art gallery if free beer is involved.

The local brewery they chose, Stoudt's, didn't have much to offer that I was blown away by. Good, but not spectacular stuff. Very Belgian style, even in their "American" beers. But that's not the real point of this post.

After enjoying a generous helping of beer, we took a stroll through the gallery. A lot of it, unsurprisingly, was dedicated to Warhol himself. There were some other modern installations too. And it was all, generally, crap. As I'm walking through there, seeing wall after wall of celebrity snapshots and pop culture ephemera, "recontextualized" as art, it really struck me:

If pop art were a person, it would be the gum-snapping coworker in the cube over from you with some ear-wormy ringtone on the too-loud-cellphone that natters on and on and on about Branjelina and Brestica or whatever while gossiping about how great the next "Sex and the City" movie is going to be.

That's my take away from the Warhol gallery. A large amount of pop art focuses on taking the inane, vapid and annoying and "recontextualizing" it as art. The result is art that is inane, vapid and annoying.

Now, after venting my spleen, let me cushion the blow with a hint of perspective. A large part of my reaction is that it simply hasn't aged well. The reason people appreciate Warhol is that he altered the definition of what constitutes art. That's not entirely a good thing, and he was certainly standing on the shoulders of giants, like Duchamp. But teleporting myself back to the 50s and 60s, seeing giant Elvises shooting at me from a wall would be jarring, and that's obviously the desired effect.

One solace in the Warhol gallery: Warhol hated Pittsburgh. Reviled it. So, the fact that the town has a little shrine to him and has named a bridge after him stands out as a little "fuck you" to Warhol, and I can live with that.
Not content to have exceeded the assignment's requirements by adding a graphical layer, I went a few steps farther: I added support for animation and multitouch gestures. The latest version of the source lives here, and it's chock full of comments this time.

Once again, it's under a Share-Alike-CC-license. Don't hand it in as your homework.

April 11th, 2009

iPhone Programming : CS193P

Add to Memories Tell a Friend
tesla
Stanford University is publishing video and assignments for their iPhone programming course online. I've been following it and doing the assignments, and man... I miss compsci classes. I've been having so much fun doing this. For those that recall me in college, I was a lazy underachiever in most of my classes- but not the programming ones. In those, I always took the assignment and exceeded the parameters. I would show other students how to do the assignments. I'd add little flourishes.

This has been such a breath of fresh air. By day, I slog through tedious code written in tedious languages to do tedious tasks. By comparison, programming on the iPhone is downright sexy. It's fun, it's fast.

But more than that, I'm enjoying my remote college experience. My brain is getting a gentle stretching, and I really like that. Of course, it's very gentle- the course material goes at a painfully slow pace and is treading over the basics of OOP with a leaden step. But then I pick up the homework assignments, and run past the requirements and show off, and I don't care how dull the lectures get.

Not to say I get nothing from the lectures. I finally "get" Objective-C memory management. ObjC has an approach that's someplace between Java-style Garbage Collection and C style malloc/free.

In any case, I've got my first non-trivial iPhone application done. The business logic is pretty trivial- do some stuff with polygon shapes- but the UI has drawing and animations, which is well beyond the goals for the current homework assignment. If you have an Intel Mac, you can download the SDK from Apple (free signup required) and run it if you like. The linked code is distributed under a CC-share-alike license: HelloPoly code.

If anyone is dumbshit enough to try and hand this in to the class, they're going to get owned, because it's pretty obviously not what the assignment called for.

March 28th, 2009

Penis Train

Add to Memories Tell a Friend
IOCCC Original Winner
I get back from the opera, after a wonderful night out with my wife, and the Internet gives me this:


Well, it's no La Bohème, but it's got a certain charm.

The Pittsburgh Opera Company did an excellent job of putting on La Bohème. It's not one of my favorite operas, but they did a great job. We have to do this and the symphony more often.

March 25th, 2009

Against the Cloud

Add to Memories Tell a Friend
tesla

Screw you, Cloud


I hate the term cloud computing. I'm generally opposed to the idea of it. I know that this goes against the current fad, but I really really have a philosophical problem with it. Before I go into a long-winded history lesson to make a point, I want to address one point first: the utter stupidity of the name "cloud computing". When IT people make diagrams, there are often areas or elements that are out of scope, for example, when talking about how data gets from your computer to Livejournal and back, it's superfluous to explain all the routers and network hops in-between. For most applications, I don't need that kind of detail, so I just draw a cloud there and label it "the Internet". A cloud means the details are unknown or unimportant to the problem at hand.

"Cloud computing" takes its name from that. "Where does the application live? The cloud!" A market-friendly way of saying, "Don't know, don't care," which conceals the fact that we do know and should care.

In the beginning...


Let's rewind the clock. A long, long time ago, computers were expensive. Processing power was expensive. Storage was expensive. Because of this, computing resources were jealously guarded. Slowly but surely computers made the transition from batch processing to interactive sessions, and it's at that point something interesting happened. We finally reached the point where we could have programs that interacted with the user. In a time sharing system, we could have a bunch of programs running and a bunch of users talking to them, and it all happened fast enough to seem instantaneous to the end users.

This was the birth of the dumb terminal era.
Read more... )
I have a vision of a device. The super-smart anti-terminal. It's small, maybe the size of a very large wall wart. Inside, it's got a lightweight processor, a decent sized laptop HDD or SSD, wireless Ethernet, maybe Bluetooth/wireless USB. It plugs directly into an outlet. It has a USB port or two on the outside.

Out of the box, it's got an embedded Linux server running. You plug it in, connect to its "configuration network" and follow through a wizard like you would when setting up your wireless router. It joins your wireless or wired network, it registers a domain name (or a free dynamic DNS subdomain), and points it at your network. As much as possible, it automatically sets itself up with port forwarding on your router.

The entire point of all of this? All those cloud services? Google Docs, Twitter, etc? They run here. Out of the box, it's got WordPress, Laconica, a web based office suite, and acts as a remote file server. It can stream media, it can track bittorrents. Using some of the open social networking standards, it becomes your social networking identity. Accessible via the web, via phone client software. Options to mirror an encrypted disk image to an offsite backup.

Now we get the benefits of thin client access, anywhere access, etc.- but without reverting to the maniframe age with slightly different branding.

All the pieces are there to make this technology work. What really needs to happen is to have someone sit down and really work out the mechanics of doing this so that it really is plug-and-play. It needs to be as easy to configure as a Wii. Not an easy task, especially considering the complexity of the problem being solved.

In Conclusion


I think "cloud computing" is a horrible term. It's centralized computing. And I think it's a bad thing. I think putting things on the edge, where the users live, is a much better idea than putting it on Google or Microsoft's servers.

And have you noticed that? Not to go all tinfoil hatty here, but have you noticed that it's giant companies that want to hold your data for you? They want everyone using thin clients on tiny little netbooks, and that gives them the power. They have the data, they have the processors and the storage. I'm not claiming that there's any conspiracy to weaken the public- but conspiracy or no, that would be the result.

March 15th, 2009

Amazing Stories, MAR1943

Add to Memories Tell a Friend
IOCCC Original Winner

Amazing Stories, MAR1943
Originally uploaded by t3knomanser.
Purchased at the Caliban Bookstore on Craig St. in Oakland. For starters, that is an AWESOME bookstore. And this, for $9.50 is an awesome book.

One of the stories advertised on the cover, "Victory from the Void" has a most promising capsule summary in the table of contents: "An asteroid arrives in the Solar System and circles the Earth - and becomes a base for Nazi bombers!"

Caliban had a whole pile of these, but this had the best cover.

March 1st, 2009

Teller

Add to Memories Tell a Friend
Rainbow Me
A fun article about Teller (of Penn &), and his Red Ball trick illusion. I must tell you, seeing it actually done is more amazing than the article really gives credit for. It's one of the most perfectly executed effects I've ever seen, and it's done so simply, with an utter lack of pretension. It is a perfect trick.

February 27th, 2009

Musings

Add to Memories Tell a Friend
IOCCC Original Winner
So, every once in awhile, with Heavy Metal pounding in my ears, my fingers on the keyboard typing "JETPACK SHARK" for the millionth time, building the ridiculous (and now finished) first draft of the short (it's 19 pages, but my target is 15) intro issue for Jetpack Shark, I stop and think: holy crap, was that a tortured sentence or what?

No, no, not that. I stop and think, "Hey, this is kinda ridiculous and hyperviolent. Is there a market for this, really?"

Thankfully, the latest Tales from the Longbox got posted today. For those unfamiliar, author Protoclown takes comics (bad comics), and rips the shit out of them with scathing commentary. It's like MST3K for comics.

And you know what? When I compare my ridiculous, silly comic to Marvel's rapidly decaying "Ultimates", I notice a few glaring differences. For starters, events make sense and happen for a reason. A causes B which causes C. Even when the events are structured for sheer awesomeness and play fast and loose with reality or physics there's an internal logic that carries things forward. Sure, all the characters are paper thin cartoons, but... well... it actually makes more sense. Again, it's got it's own internal logic.

Also, nobody ever says: "I thinketh it cuteth." Seriously.

Reading that and knowing that these people are getting a comic published simultaneously makes me feel good about my writing skills and weep for humanity.

February 26th, 2009

You know me. I get ideas. From Recursed, the time travel game, to all sorts of other things. Writing, reading, programming, whatever.

Well, I've had another idea. It's turned into a mostly finished first draft of a script for a comic book.

Jetpack Shark: The Comic.

The title character, of course, is a shark with a jetpack. The setting is a post apocalyptic wasteland, with one final outpost of humanity: Oceanic City, a paleofuturist floating, domed city. Jetpack Shark has taken it upon herself to defend the city from all sorts of enemies: dinosaurs, robots, aliens, alien robots, robot dinosaurs, alien dinosaurs and alien robot dinosaurs. It's not an altruism thing, she's no hero. She's a shark with a jetpack. In exchange for her saving the city, she eats a few school children now and again. They're young and delicious.

The flavor I've been going for in the script is the narrative of a young kid playing with toys on the kitchen floor. I mean, these are the sorts of stories I made up as a kid. I mean, talking dinosaurs in giant speedboat just make sense in that context. It's crazy and wacky and emphasizes fun.

I need an artist.

February 21st, 2009

For Minna's birthday, I made her a dark chocolate cheesecake using this recipe. This is a bit unfair, really- this recipe should carry a surgeon general's warning. It's incredible, and probably about as dense as electron degenerate matter. And chocolate.

One warning: while not the hardest recipe on Earth, it's definitely the sort that requires some baking experience and some patience. And big bowls. I don't have any big bowls. And something with a bit more oomph than a hand mixer (I was deathly afraid I was going to burn the motor out).

February 10th, 2009

Recursed: Open Playtest

Add to Memories Tell a Friend
run the fuck away
A bit ago I mentioned the core ideas for Recursed. Well, after registering the most awesome domain name ever, I set up a Wiki, and went to town putting together the core rulesets and some printable playtesting supplies.

The wiki has all of the core stuff, even if most of the pages are protected against edits. The Talk pages aren't, and that's really where I expect the action to be.

So... have at!

February 5th, 2009

Mike Nelson, of MST3K and RiffTrax fame, is taking it upon himself to eat nothing but bacon for a month. Rifftrax does live webcasts every couple of weeks, and I'm curious to see the horrors wrought on him by the second week of this experiment- if he keeps up with it that long.

You folks know me. I love bacon. But even I could not eat nothing but bacon for a month. Bacon with a side of raw broccoli, Mountain Dew and the occasional slice of pizza... well, not since college.

February 2nd, 2009

For Christmas, Minna got me the boxed set of the "Man with No Name" trilogy; the famous Clint Eastwood spaghetti westerns filmed by Sergio Leone. I'm a sucker for these kinds of movies, and we've been enjoying the brooding anti-hero.

I was discussing this recent Clint Eastwood kick with a co-worker, and she said, "I never got into Eastwood. He's a bit of a one trick pony."

"Yeah," I replied, "but it's a good trick."

Leone had a similar comment. He was reputed to say that he loved working with Eastwood, and that he had two expressions: one with a hat on, and one with it off.

I didn't develop an interest in Westerns until college. One of my professors assigned High Noon as extra credit. He absolutely raved about the film, and I respected his opinion, even if a black and white Western from the 50s didn't seem like my cup of tea. And one can always use extra credit.

I was pleasantly surprised to find my preconceptions about the genre subverted. High Noon was a film that didn't trot out the idea that, a manly enough hero could thwart any obstacle. It had emotional depth. A 1950s movie where the male lead cries is somewhat landmark. Especially a Western.

In my recent research, I learned that High Noon marks one of the early "revisionist Westerns". An offshoot of the genre that broke a lot of the traditional conventions. It's a good way to identify the sorts of Westerns I like versus the ones I wouldn't care for. I find it interesting that John Wayne only ended up doing revisionist Westerns when he didn't know he was doing it- films that were subtle sendups of the traditional John Wayne character.

I'm drifting off topic; I didn't mean to turn this into an analysis of the Western genre. In fact, I have a specific and interesting anecdote to relate.

In 1929, Dashiel Hammet, in a novel called Red Harvest, introduced the character of the "Continental Op" to Personville (often called "Poisonville" by the characters). The Continental Operative is a nameless, hardboiled investigator working for (and occasionally against) the Continental Detective Agency. Personville is a lawless town ruled by warring crime gangs. The Continental Op plays both sides against the middle, and ends up bringing peace to the town (by getting the gangs to kill each other), and profiting a bit in the process. It's one of the quintessential noir novels, and it's quite a good read (the better of the two "Continental Op" novels, I can't speak to the short stories).

In 1961, Akira Kurosawa directed Yojimbo. A nameless Ronin comes into a town ruled by warring criminal gangs. He convinces each gang to use him as protection against the others. He brings peace to the town by getting the two gangs to kill each other. Sound familiar?

Not a novel story, perhaps. But Kurosawa freely admitted the influence of Red Harvest on his work.

Sergio Leone was a big fan of Kurosawa's work; it influenced a great deal of his directing style. When he made, A Fistful of Dollars (a story about a nameless gunslinger who cleans up Western town ruled by competing crime families by getting the two gangs to kill each other off), he leaned heavily on Kurosawa for the look and style of the film.

Intended as a tribute to Yojimbo, Leone found himself in a copyright dispute. Kurosawa's production company claimed that A Fistful of Dollars was an unlicensed remake of Yojimbo. The courts agreed and a chunk of the gross went to Kurosawa's company, along with exclusive distribution rights in the Asian markets.

I would argue that Leone got screwed on that one. It was hardly a unique story idea, and it's at least as distant from Yojimbo as Yojimbo is from Red Harvest. I guess that's why I'm a programmer and not a judge. But the interesting turn comes next.

Leone had a falling out with his production company, and when he went to make the sequel to Fistful, named, For a Few Dollars More he got someone else to produce. His old production company sued, claiming they owned the rights to the characters from Fistful, including the character Eastwood had played (called "Joe" in the script, although only the gravedigger ever used that name).

This time, the court (presumably a different court), found that the archetype of the Western gunslinger wasn't unique enough to copyright. Never mind the fact that Eastwood's character in A Few Dollars more was not only the same character (although called "Monco" a few times in this film), he wore the same poncho. Not a similar poncho- the same poncho. For all three films (the third being The Good, the Bad, and the Ugly) Eastwood wore the same poncho (and it was never washed during that time). Then, of course, was the similarity between the two titles, the style of the film, and everything else.

This time, Leone's old production company got screwed. In sports, we would call something like that a "make up call"- a decision so obviously flawed that it could only be taken as an attempt to balance the previous bad decision. I sincerely doubt that this was the case, but I find it fascinating that Leone lost one case on pretty dubious grounds and won another on similarly dubious grounds. Maybe his new production company understood how to hire good lawyers. I dunno.

One last thing: in all of Leone's movies, he used Ennio Morricone for the music. The soundtracks on these films are incredible. I mean, seriously fantastic music. "The Ecstasy of Gold" is pretty incredible, but "Sixty Seconds to What?" gives me chills when the organ cuts in.

Superbowl Celebrations

Add to Memories Tell a Friend
Megaweapon
As you may have heard, the Steelers won the Superbowl. After the game, Pittsburgh went kinda nuts. Oakland, the nearby college neighborhood got a little too crazy- there was some vandalism and people burning furniture in the streets. Shadyside, on the other hand, was mostly good natured drunks blocking traffic. Southside was a little wild, but not nearly so much as Oakland.

Oakland, of course, is aswarm with out-of-towner college kids that were just looking for an excuse to wreck shit. Southside is a heavy college-kid neighborhood, but it seems to be more locals. Shadyside also has a heavy college bias, but it's mostly the college kids with money.

I got some photos, and below are a few of my favorites. Read more... )

January 31st, 2009

I got a bug up my ass the other day, and started working on making a set of rules for a miniatures strategy game. Being the sort of person I am, this is no normal combat game- it involves time travel.

Not the whimsical variant of time travel you'd see in a game like Chrononauts, where you're looking down on all of history and playing with it. No, this is a game about time traveling soldiers on a battlefield, where events from the future ripple back into the past and vice versa. Essentially, I wanted to do something more like Chronoton (awesome game, if you haven't played it, btw).

As you can imagine, it's a tricky game to design.

A brief sketch of the rules and gameplay )
As odd as it may sound, I had an easier time figuring out a workable time travel system than I did working out a combat system. I've got enough of the rules sketched out that I can unit test them, but this raises another problem- with all these Dopplegängers running around, it's going to be a pain in the ass to track all of them. Which brings me to my real question: how would you rather track these sorts of things?

The options I've come up with so far are these:
Logsheet
This is my least favorite option. I don't want to make the players track lots of things with paperwork. It also means that you can't tell the state of the game without asking the other players, "Is this piece the Doppel of this one or that one? How many wounds does it have?"
Token madness
Lots of things have to be represented by tokens. Declarations to travel, commitments to future actions- these have to be easily seen and obvious to all players. But what about using tokens to track doppling? The advantage here is that one can have a bunch of generic "Soldier" units, for example, and identify which piece is Pvt. JenkinsP and which is Pvt. JenkinsF (and, since we could have all sorts of future actions, F1, F2, F3...). When JenkinsP departs for the past, JenkinsF becomes JenkinsP. This means establishing parent-child relationships via tokens, and that means the tokens have to be unique enough that every unit on the field could Doppel multiple times and you could still tell them all apart.
Pre-printed Planning
There's an absolute number of Doppels that could appear for any given unit. For some units, like a Time Master, it could be quite a lot. For your average soldier, it will only be 3 or 4. So perhaps I could print off a bunch of pieces all labeled "Pvt. Jenkins". The programmer in me balks at this approach- we're essentially hard coding in the numbers. I could drop a counter marked "0" on the first Pvt. Jenkins, and when she Doppels, I can put another Jenkins on the board with a "1" counter. When the present day Jenkins travels back, I can move the "0" over to the "1", the "1" to the "2", etc.

What other options do you think I could use? I'm preferring the last one in the list- it seems to be the easiest to track that's also the most visual. At a glance, you can see who's who, and where they originated in the time line.
Powered by LiveJournal.com