Archive of articles classified as "article"

Back home

Mint is Wrong

29/07/2008

Mint is confused and just sent me an email:

Hi there,

Over the last 30 days you spent $Y on Mortgage & Rent. You usually spend $Z.

A few things to consider:

  • My rent increased a few months ago from $X to $Y.
  • $X > $Z, by over $400.
  • I pay rent every single month.
  • I pay rent at the beginning of the month. It’s now the 29th.

My conclusions:

  • Mint doesn’t know what the hell it’s talking about.
  • Mint’s unusual-spending notices are not timely and are therefore useless.
  • Mint does not adapt to small and expected changes in spending (like rent increases) so its unusual-spending notices are false positives (and useless) far too often.

Wait, why do I use Mint again?

2 Comments

The Tyranny of Fetishistic Compulsion in Programming

5/11/2007

For you programmers out there, this is for you. For everyone else, just humor me; this won’t take long.

I’m taking a brief primer on C# (which, granted, is almost a beginner-level tutorial, but I didn’t want to miss anything important that an expert programmer’s primer may have passed over), and I’m reminded of some very disturbing things about the world of strictly-typed programming languages:

They’re designed by people who have RSS and email inboxes of zero unread items; both count and avoid cracks, twigs, and cigarette butts on the sidewalk; and SUCK ON DIRTY TOES FOR SEXUAL PLEASURE. I might also accuse them of being fundamentalist automata, but automata don’t have the emotional baggage necessary to inflict such misery on their fellow beings.

I began my computer science education by learning these kinds of languages, and I can’t blame my professors; teaching students scripting in esteemed computer science departments was a huge no-no. And consequently, I was mostly oblivious to the unnecessary sadism that was being inflicted upon us. C++ was the first remotely object-oriented language I learned, and while I was, like many students, unhappy with the level of specificity it required, I was generally satisfied that C++ was A MAN’S PROGRAMMING LANGUAGE. No pussies allowed. Runtime garbage collection? What are you? A terrorist? Implicit typecasting? Fuck off, cross-dressing hippies. I had no idea that I would soon, voluntarily subject myself to a much more hideous example of computer science sadism: Java.

At least C++ didn’t force you to write object-oriented code. I took an elective Java lab course a few semesters later. At the time, I thought: Gee, what a consistent language! The rules are elegant and applied without discrimination. Everything’s OOP. Polymorphism is easy. Completely virtual classes are possible. No confusing multiple inheritance allowed, and neither is any silly object overloading bullshit. Terrific, right?

I must be, only now, coming out of a haze of type-lenient, quick-and-dirty scripting utopia, because it’s only now that I remember what made me run screaming from pure, strictly typed, enforced OOP. I still don’t even think I can completely quantify it. Is it the bloat? Sure. What about wasted time worrying about method and property restrictions? Yep. Even more wasted time spent writing subclass upon subclass upon subclass or implementing interfaces? Definitely. How about the frustration of fixing bugs through subclasses? Aye. The complication of working through insane namespace spiderwebs? The migraine-inducing procedure of visualizing polymorphism on multiple levels? The insanity of writing one-line accessor methods? Did I mention bloat? All of the above.

I may have been overly generous to grant the designers (or strict adherents) of these languages the relatively mild sexual deviance of sucking on dirty toes. This level of sadism, control, and even masochism can only force the human psyche to act out in much more destructive ways.

I’m well aware that the more monastic languages have their place, especially those applications where security, provability, and/or the protection of human life are required. But if you’re not doing that, take it easy, folks. Try out some BASH one-liners on occasion. Or (gasp!) PHP in line with XHTML. Maybe even some easy-go-lucky Python. If no one else has to read it, maybe even PERL. Throw some caution to the wind. Make it easy on yourself.

2 Comments

LSL Script Delays Hurt the Wrong People

14/09/2007

At some point in the history of Second Life, Linden Lab decided that griefing and spamming were such terrible problems that they put in little speed bumps all over the place to prevent abuse of things like automated inventory offers, external URLs, object rezzing, instant messaging, and others.

For instance, say you want your script to offer inventory to the person who just clicked on your object. As a new LSL scripter, you do the straightforward, obvious thing:

  1. Detect a touch.
  2. Give a virtual nickel bag to the avatar who just touched the object.

You may even go so far as to detect multiple touches and offer everyone who just touched the object their own nickel bag. Soon you find that your everyone loves the quality of your hydroponic, closet-grown product, and people start complaining. “You got something against furries? Why I can’t I have a nickel bag?” Or “Your MJ vendor is broken, dude.”

You scour the documentation and soon find that there’s a built-in delay to giving inventory. In particular, llGiveInventory() has a built-in delay of three seconds. Crazy! How do you make sure to give everyone who wants it their own piece of chloroplastic heaven?

The most common technique seems to be what is affectionately known as the “multiple-slave-comm-script” trick, or as I prefer to call it, the “dispatcher-to-agents” technique. In this technique, there is one dispatcher and many agents. In this example, the dispatcher would work like this:

  1. Detect a touch.
  2. Send a message to one of the agents (via a link message).

An agent would work like this:

  1. Detect a message from the dispatcher.
  2. Offer a nickel bag to the avatar who touched the object.

The dispatcher should start with the first agent and work its way down to the last one before starting over. This way, only the agent is affected by the script delay. The dispatcher is immune and can happily go along ordering the agents around all day with no script delays. Beautiful!

If your happy grass gets really popular, you may start to notice that the dispatcher loops around to the first agent before its script delay is done; you got caught by the inherent race condition in this technique. So, to beat it, you make some more agents, and more agents, and more agents, until you discover that all of your agents stop working. “WTF?” you may ask. WTF indeed.

In yet another effort to reduce griefing and spamming, LL implemented further so-called protection. They knew people would use the dispatcher-to-agents method, and when a single object starts doing something griefy or spammy too quickly, they just disable the guilty scripts through some unknown means. There seems to be no warning. And all you can do is reset your scripts and start over. It also seems that this new “protection” only takes effect if there are enough scripts doing the griefy/spammy actions too fast. In my brief experimentation, 16 seems like too many, and the agents are quickly disabled, but 10 is too few, and they run along happily.

But for a popular vendor, 10 agents are simply not enough to avoid the race condition, but at this point, you give up and rationalize that you’ve mitigated the consequences of LL’s anti-griefing and anti-spamming measures as best you can. You console yourself that these protections are also stopping griefers and spammers from maliciously offering inventory too quickly.

But wait, aren’t you an honest avatar, trying to give away your pot in peace? You’re not spamming anyone. You only give it out to people who ask for it!

Here’s the problem with LL’s LSL speed bumps: They don’t prohibit griefers and spammers from working around the problem. When it comes down to it, does a griefer or a spammer really care if they hit the race condition? A spammer may, but they’re still able to spam. A griefer probably doesn’t. But you, the honest avatar who wants to write robust software that works reliably so your customers are satisfied is the one who suffers. The spammer still spams. The griefer still griefs. You and your customers suffer.

(On a side note, this problem is orders of magnitude worse when dealing with XML-RPC.)

What is a virtual person to do? Vote for JIRA issue MISC-686, and ask Linden Lab to remove script delays and grey-goo mitigation, and let honest developers write truly robust and reliable code.

No Comments

iTunes Boots NBC

2/09/2007

Apple issued a to-the-point press release earlier this week, saying they wouldn’t be carrying NBC TV content starting this month. Apparently, NBC wanted to charge five bucks for a single episode and thought Apple wasn’t doing enough to protect those shows against piracy.

Before your brain explodes from the sheer nonsense from NBC, have a look at Jeremy Horowitz’s retort, which takes NBC to task for its hypocrisy and says just about everything I would have.

No Comments

They’re In My Ears!

15/08/2007

Dear Apple,

Your stock iPhone headphones suck really hard.

I live in New York City. You might know it. It’s that place where people walk, loud noises happen, and tons of people love your products. Every day I walk to and from the train. Your headphones do not stay in my ears during this activity, apparently rare every else, except with some precision placement worthy of a champion Jenga player. Every day I walk under an elevated train to the coffee shop and ride trains that produce what some may know as “loud noise”. I love that nifty control button on the mic because I have to use it during these occasions to pause the audio, lest I miss several minutes of “Buzz Out Loud” or “TWiT” or “Science Friday”. In case you’re unaware, those are podcasts that you syndicate on your iTunes Store. Podcasts. Things you listen to. On the go. On your iPhone. In your ears.

These V-MODA headphones you offer are not an acceptable alternative. You remember that control button on the mic? They don’t have one. I think I may have use for that pause button since I can’t pause audio without unlocking the iPhone otherwise. I recommend you ban V-MODA from your store because of their inability to sell decent after-market products.

And these? Really? Do I really need to buy two things to listen to audio on the iPhone? And do I really need to use a clip to position the mic near my mouth? Please also ban Shure.

I not only come to you with criticism but with a solution! What is this miracle of ingenuity? This innovative new thinking? You know those other headphones you sold for the iPod? Yeah, those. Uhm, why not sell those for the iPhone with the same fancy mic and control button? Genius. I know you never thought of it because it’s been two months since I bought my iPhone and they’re not out yet. Therefore, I must be the first person in the universe to have this idea. You’re lucky to have me on your team, guys.

Sincerely,

Dean and His Pants

No Comments

Buh-Bye, Linux

14/08/2007

The hard drive on my Linux box failed today, which leaves me, for the moment, in a Mac-only household (well, just me): two iMacs, a MacBook, an Apple TV, and an iPhone.

While my attention as of late has been focused on development in Second Life (as it pays the bills), I had been resisting the urge to come to real terms with the “former” in “former system administrator”. I’m a developer now and will hopefully continue to be. Unfortunately, the Linux box was doing a few very important things. Most importantly, it was running backups on itself and my main iMac. That’s not something I can just ignore.

So now my choices are:

  • Get a new hard drive and repair the Linux box. This is simply not going to happen. In terms of daily life and of long-term planning, Linux and system administration are just diversions, distracting me from honing my development skills.
  • Run a virtualized Linux on the old iMac (or a new Mac Mini). If I were to ditch Gentoo, this might be easier, but for the reasons above, it’s not an option either. I don’t want to divert my resources.
  • Run backups on the old iMac (or a new Mac Mini) from Mac OS. This seems feasible. Assuming MacPorts is still an active project and they have builds of rsnapshot (the best backup utility I’ve used), this should be a no-brainer.

One problem remains, though. The filesystem on the backup drive (an external USB 2.0 and Firewire 400/800 drive) is ReiserFS over LVM. I have no idea if Mac OS can handle these natively, so I may have to do some swapping around with a virtualized Linux just to get my backups out.

In any case, I guess I’ll be Linux-free by the time this is all over.

No Comments

The iPhone Post

2/07/2007

I bought an iPhone. You’re surprised? Seriously? You don’t know me at all.

Read the rest of this article »

No Comments

Gimp, Suck It

18/03/2007

This may sound like part of a scene that got cut from “Pulp Fiction”, but let me assure you, this is about good software.

GIMP is a free software/open source alternative to a program like Adobe Photoshop, and serving as a you-pay-for-what-you-get replacement, it’s done fine for me. I’ve used it a lot, though I’d never touch one of my photos with it (I use Photoshop Lightroom for that), I’ve made many a Second Life texture with it, but here’s the number one reason I’m going to buy Photoshop: kerning. GIMP doesn’t have it. GIMP can do diddly-shit with text. And no, I’m not going to spend an afternoon building some legacy version from source on my Mac and hope to get the Freetype plugin working. Do you want to know how much I want this (and other things) to work out of the box? I’m going to spend $700 (or whatever it costs when it comes out) for Photoshop CS3. It doesn’t help, either, that while trying to make a minute markers on a clock face texture for SL, GIMP crashes 90% of the time while rotating a layer. Fuck that.

No Comments

A Few Trig Problems

26/02/2007

Here are a few useful formulas I’ve derived in the time I’ve squirreled away building in SL. I thought they might be useful to someone out there, and I’d love to have them here for my own reference instead of in the middle of what looks like an high school freshman’s geometry notebook hidden amongst diagrams of parallelograms and triangles. Also of note, I deal only with my ruler in world coordinates, not local or reference.

(Big thanks to SL friend Sanford Foulon who put me on the right track on calculating the visually deceiving values of Y taper.)

To calculate the angle created by applying Y shear to a box primitive:

arc tan ((y * shear) / z) = theta

  • y is “Y” size.
  • shear is the value in the “Y” box under “Top Shear”.
  • theta is the angle created between the XZ plane and the sides of the box originally parallel to the XZ plane (before shearing).

To calculate the angle created by applying Y taper to a box primitive:

arc tan ((y * taper) / (2z)) = theta

  • y is the “Y” size.
  • taper is the value in the “Y” box under “Taper”.
  • theta is the angle created between the XZ plane and the sides of the box originally parallel to the XZ plane (before tapering).

The values of Y sheer and Y taper that will give you a perfectly upright (i.e., parallel to the XZ plane) side:

taper = 2 sheer

If anyone would care to see me derive these or show visual examples, please just comment.

No Comments