Today I got my feature done in an hour, but I spent 3 hours wrestling Spring, JBOSS, and Eclipse.
I would just like to restate some of my principles now.
* Tool performance and stability is important.
* Iteration time is important.
* A good error message can save an hour of time.
Which is to say, if you pay someone $40 an hour, you should buy them a $400 tool if it saves them 10 hours of time over it's lifetime.
another four mouths to feed
Today I woke up and wanted to get an aquarium. Annie was decidedly neutral on the subject, but I had a fire in my belly, and so we headed out to Jim's Exotic Fish on PCH to see what was what.
We talked to Jim, and we told him that we were eventually interested in setting up aquaponics, but that we were basically new to fish, and wanted to start small and easy. Jim was incredibly helpful. He sold us a nice glass tank and an integrated unit that sits on top of it and does light and pump and filter, plus a heater. We sold ourselves some gravel and clay and plants and a rock. We took it all home and set it up, and filled it up with water, and put in the water conditioner. You have to do that to get the fluoridation out.
Then in the afternoon we returned for the fishes. Jim told us that he had been working 15 days in a row, because his daughter had just had a baby, so she couldn't come in to work. I sympathized. We picked up 2 pairs of 2 varieties of platies, and took 'em home, and after letting the temperature adjust and all that, we set them loose in their new home. Then we stood there and watched them for like 20 minutes.
It's a 12 gallon tank and it can hold a lot more than 4 little guys, but we wanted to start small and move up from there. Eventually we'll get to the goldfish, and then maybe koi, when and if we go for an outdoor pond system. But for now our little tank will be plenty. And I think Annie's already coming around to the idea ;-)
We talked to Jim, and we told him that we were eventually interested in setting up aquaponics, but that we were basically new to fish, and wanted to start small and easy. Jim was incredibly helpful. He sold us a nice glass tank and an integrated unit that sits on top of it and does light and pump and filter, plus a heater. We sold ourselves some gravel and clay and plants and a rock. We took it all home and set it up, and filled it up with water, and put in the water conditioner. You have to do that to get the fluoridation out.
Then in the afternoon we returned for the fishes. Jim told us that he had been working 15 days in a row, because his daughter had just had a baby, so she couldn't come in to work. I sympathized. We picked up 2 pairs of 2 varieties of platies, and took 'em home, and after letting the temperature adjust and all that, we set them loose in their new home. Then we stood there and watched them for like 20 minutes.
It's a 12 gallon tank and it can hold a lot more than 4 little guys, but we wanted to start small and move up from there. Eventually we'll get to the goldfish, and then maybe koi, when and if we go for an outdoor pond system. But for now our little tank will be plenty. And I think Annie's already coming around to the idea ;-)
a long rambling post on the latest topic
I think I want to write a book about software development, and why people find it so confusing. There's a lot of trendy methodologies and frameworks and languages and platforms out there, with their high priests and acolytes, promising that everything will be smooth as butter if you can just come over and see things their way. Well that's marketing for you I guess. But I think that most programmers don't have a good understanding of how really broad the programming landscape is.
I mean, one one side you have embedded systems, and then you have mobile devices, and then you have game consoles, and desktop, and then you have expert system, and then server, and then web... And they all have massively different constraints. That's what you don't get if you follow the software development trends. Most of the software development technologies out there were invented to solve very specific problems, but their evangelists are unwilling to admit it. So it's difficult to tell which buzzwords and trends fit your problem.
On the one hand this is all just basic design: list your requirements and your constraints at the beginning, and then pick solutions that fit. I guess what I object to, is that a lot of technology evangelists would really like you to skip the step where you pick solutions. As a marketer, if you can turn technology selection into a religious war, then you don't have to worry about your faithful jumping ship if their problem definition changes.
So, I'd love to see a map of the various axes of software development, along with which technologies, methodologies, etc., were designed for which region. And then I will print it out and roll it up and hit people over the head with it whenever they tell me that I should be using Ruby on Rails.
I mean, one one side you have embedded systems, and then you have mobile devices, and then you have game consoles, and desktop, and then you have expert system, and then server, and then web... And they all have massively different constraints. That's what you don't get if you follow the software development trends. Most of the software development technologies out there were invented to solve very specific problems, but their evangelists are unwilling to admit it. So it's difficult to tell which buzzwords and trends fit your problem.
On the one hand this is all just basic design: list your requirements and your constraints at the beginning, and then pick solutions that fit. I guess what I object to, is that a lot of technology evangelists would really like you to skip the step where you pick solutions. As a marketer, if you can turn technology selection into a religious war, then you don't have to worry about your faithful jumping ship if their problem definition changes.
So, I'd love to see a map of the various axes of software development, along with which technologies, methodologies, etc., were designed for which region. And then I will print it out and roll it up and hit people over the head with it whenever they tell me that I should be using Ruby on Rails.
more griping
If I were to try to keep myself to a strict schedule of a post a day, I think many more of my posts would just be complaining about software.
Every so often Eclipse seems to decide that you're being too productive. It'll crash, then refuse to launch. Generally to get it up again you have to lobotomize it first, and then rebuild your workspace. This usually takes at least an hour out of my day every time it happens. It happens about once a month, I'd say.
Every so often Eclipse seems to decide that you're being too productive. It'll crash, then refuse to launch. Generally to get it up again you have to lobotomize it first, and then rebuild your workspace. This usually takes at least an hour out of my day every time it happens. It happens about once a month, I'd say.
the world is a dangerous place: true/false
A while ago I saw an online book linked from boingboing about the science and psychology of right wing authoritarianism. Right wing in this case doesn't mean politically, necessarily, but means something more like, "aligned with governmental and religious authorities."
I read the book, and I found it disturbing and yet irresistibly fascinating. I like to think that I have a natural skepticism for people who tell me that my political enemies are dangerous people. I really don't like that idea, it smells like racism and fear-mongering. So I continue to find this book hard to integrate, inasmuch as it casts a shadow on a lot of people.
However I think it also offers pretty compelling window into the psychology of some large political movements, in the United States and elsewhere. Consider whether you agree with this statement: "Once our government leaders and the authorities condemn the dangerous elements in our society, it will be the duty of every patriotic citizen to help stomp out the rot that is poisoning our country from within." A lot of people do agree with that statement.
What's presented in the book is a collection of academic research on authoritarian personalities that, as far as I can tell, seems legitimate and makes sense. It's an easy read. The author does have a political axe to grind, and he's up-front about that. (It didn't bother me because I basically agree with him politically.) It addresses topics like hypocrisy, mental compartmentalization, leader and follower personalities, and religious fundamentalism, and along the way it paints a picture of the people who love and follow public figures such as Sarah Palin, Lou Dobbs, and Glenn Beck.
Like I said. This book makes me really uncomfortable because it tells me that my political enemies are dangerous, irrational people. What I'm trying to do with it is, instead of closing myself off further, to try to open myself up. If I can figure out a way to use this research to understand the emotions and beliefs that drive this certain kind of thought, then maybe I can communicate better.
Sam turned me on to a blog called slacktivist, which seems to spend most of its time ranting against right wing authoritarians, taking their arguments apart, and generally trying to get inside their heads. It's a really clever and insightful blog, but as much as I might enjoy it, slacktivist is a terrible tool for convincing your uncle that he needs to lighten up on the gays, for example. I think that by understanding the basic underpinnings of the RWA personality, we can do better.
Recognize that your uncle sees the world as a dangerous place, full of moral and physical peril. Recognize that your uncle believes that his culture, his very way of life, is under attack by coordinated, godless enemies. Recognize that he longs for a strong leader to tell him what to believe so that he can help defend his tribe. Then reconsider whether you want to get into that argument with him.
Anyway if you find any of this interesting, I think you should take a look at the book I linked at the top. I'd love to talk about it with some people.
I read the book, and I found it disturbing and yet irresistibly fascinating. I like to think that I have a natural skepticism for people who tell me that my political enemies are dangerous people. I really don't like that idea, it smells like racism and fear-mongering. So I continue to find this book hard to integrate, inasmuch as it casts a shadow on a lot of people.
However I think it also offers pretty compelling window into the psychology of some large political movements, in the United States and elsewhere. Consider whether you agree with this statement: "Once our government leaders and the authorities condemn the dangerous elements in our society, it will be the duty of every patriotic citizen to help stomp out the rot that is poisoning our country from within." A lot of people do agree with that statement.
What's presented in the book is a collection of academic research on authoritarian personalities that, as far as I can tell, seems legitimate and makes sense. It's an easy read. The author does have a political axe to grind, and he's up-front about that. (It didn't bother me because I basically agree with him politically.) It addresses topics like hypocrisy, mental compartmentalization, leader and follower personalities, and religious fundamentalism, and along the way it paints a picture of the people who love and follow public figures such as Sarah Palin, Lou Dobbs, and Glenn Beck.
Like I said. This book makes me really uncomfortable because it tells me that my political enemies are dangerous, irrational people. What I'm trying to do with it is, instead of closing myself off further, to try to open myself up. If I can figure out a way to use this research to understand the emotions and beliefs that drive this certain kind of thought, then maybe I can communicate better.
Sam turned me on to a blog called slacktivist, which seems to spend most of its time ranting against right wing authoritarians, taking their arguments apart, and generally trying to get inside their heads. It's a really clever and insightful blog, but as much as I might enjoy it, slacktivist is a terrible tool for convincing your uncle that he needs to lighten up on the gays, for example. I think that by understanding the basic underpinnings of the RWA personality, we can do better.
Recognize that your uncle sees the world as a dangerous place, full of moral and physical peril. Recognize that your uncle believes that his culture, his very way of life, is under attack by coordinated, godless enemies. Recognize that he longs for a strong leader to tell him what to believe so that he can help defend his tribe. Then reconsider whether you want to get into that argument with him.
Anyway if you find any of this interesting, I think you should take a look at the book I linked at the top. I'd love to talk about it with some people.
more abstraction rants
Mike was telling me about some advice for programmers, which is that premature abstraction is as bad as premature optimization. The idea is that abstracting too soon (i.e. before you know how to solve your problem) can cause problems later on when your assumptions change. Which is the same thing that you see in premature optimization. On the face of it, it sounds like simple advice, but there are some cultural reasons why it's not.
Abstraction and optimization act as opposing forces in software design. Optimization is always trying to push your algorithm closer to the metal, closer to the silicon. Optimization rejoices at side effects and arcane trickery. Abstraction is trying to push your algorithm away from the silicon. The mindset of abstraction is to make sure you never have to worry about those messy details. Abstraction rejoices at eliminating your algorithm completely by delegating it to a lower level. So abstraction allows a large group of developers to work on a vast project without slowing eachother down. Optimization on the other hand, allows code to run fast enough to be useful.
For academic applications, abstraction is more important. (If your code is slow you just come back in the morning.) So, that's why they teach you abstraction in school.* But for games, optimization is king. Generally, the optimization mind-set is not taught. You have to seek it out, you have to believe in it.
My belief, as a games programmer, is that abstraction is only permissible as long as it doesn't get in the way of necessary optimization. I currently am in the middle of a battle with a culture that seems to believe in abstraction as an inherent good, as a higher order value than optimization. I find that frustrating.
*There are lots of good reasons to teach abstraction, it's a difficult and important skill and it can color the way you think for the rest of your life. Optimization on the other hand is by nature tied to the specific technology that you're working with, it's far less generally applicable and it tends to be full of tricks, instead of full of insight.
Abstraction and optimization act as opposing forces in software design. Optimization is always trying to push your algorithm closer to the metal, closer to the silicon. Optimization rejoices at side effects and arcane trickery. Abstraction is trying to push your algorithm away from the silicon. The mindset of abstraction is to make sure you never have to worry about those messy details. Abstraction rejoices at eliminating your algorithm completely by delegating it to a lower level. So abstraction allows a large group of developers to work on a vast project without slowing eachother down. Optimization on the other hand, allows code to run fast enough to be useful.
For academic applications, abstraction is more important. (If your code is slow you just come back in the morning.) So, that's why they teach you abstraction in school.* But for games, optimization is king. Generally, the optimization mind-set is not taught. You have to seek it out, you have to believe in it.
My belief, as a games programmer, is that abstraction is only permissible as long as it doesn't get in the way of necessary optimization. I currently am in the middle of a battle with a culture that seems to believe in abstraction as an inherent good, as a higher order value than optimization. I find that frustrating.
*There are lots of good reasons to teach abstraction, it's a difficult and important skill and it can color the way you think for the rest of your life. Optimization on the other hand is by nature tied to the specific technology that you're working with, it's far less generally applicable and it tends to be full of tricks, instead of full of insight.
the craigslist blues
Trying to rent out a house is a bit nerve-wracking. I'll randomly get calls from people who always sound either harried, anxious, or apologetic. Then I have to set up a time for them to flake out and not show up to see the house.
Luckily we're not in the position that our financial solvency depends on getting the rent money, but boy it sure would help. So I have to worry about whether the price is too high, whether the ad is right, whether I could be doing more to get it out there. And whether the tenants will give me troubles when I finally find them. There's a lot of uncertainty about the whole thing, and I'm trying to keep a lid on it so it doesn't bubble over.
I think it's going to be well worth it when we do get someone in there, but it sure is nervous-making in the mean time.
Luckily we're not in the position that our financial solvency depends on getting the rent money, but boy it sure would help. So I have to worry about whether the price is too high, whether the ad is right, whether I could be doing more to get it out there. And whether the tenants will give me troubles when I finally find them. There's a lot of uncertainty about the whole thing, and I'm trying to keep a lid on it so it doesn't bubble over.
I think it's going to be well worth it when we do get someone in there, but it sure is nervous-making in the mean time.
shout outs
Just a quick shout-out to all my kharaa and marines, I had a great time on Thursday night kicking it old school with my ns crew. Man that game is so good with the right group. It turns on much more than just personal skill, and when a team strategy comes together you feel so great*.
We're setting up a fortnightly game, so let me know if you want in and I'll add you to the spam list.
We're setting up a fortnightly game, so let me know if you want in and I'll add you to the spam list.
*Um I guess it's like sports or something. awkward turtle.
grumble grumble
Some people will give you a screwdriver, and tell you to use it like a hammer. Then later they'll stumble across a real hammer, and they'll act like they invented it.
quick unrelated game idea
Merry Christmas everyone! Especially you Dave. Merry Oppressive Christmas.
***
I've been having the frustrating, complicated dreams that come with working late while sick, but this game idea popped out last night and I think it's cute.
Movie Plot Dominoes.
We're all directors, working on the same movie. We each specialize in a particular genre: Action, Adventure, Drama, Romance. We each have a deck of cards that references our genre, full of locations, characters, plot points, etc.. The goal is to contribute the most to the film and bring the movie mainly into your genre. Play works like dominoes - the movie's central plot develops linearly, scene by scene location by location, with offshoots for character development and subplots.
Players take turns laying down cards, but most cards must be matched, dominoes style, using a number of continuity symbols (probably less than 6, maybe just 4). Score by contributing cards to the main plot, resolving plot lines, and resolving characters. In addition to their mechanical symbols each card has flavor, version 1 rips all the cards straight from tvtropes.org.*
I'm trying to figure out if it demands any make-believe work, or "pitching" or auctioning, or if it's mechanically mostly just dominoes. I think with enough flavor on the cards it could work fine as dominoes, but that seems like a cop-out. On the other hand story telling games like happily ever after limit their audience by requiring high levels of creativity from everyone, and also it tends not to work so well for competitive play (when the correct competitive move is to claim that someone's story is bad and their turn is over).
Maybe each next scene is chosen randomly or something.
Anyway yeah that's my idea.
*Kill Dr. Lucky is an example of a game that lives on flavor. Or, hangs onto flavor by its fingernails as flavor leaps the Gap of Angry Making.
I've been having the frustrating, complicated dreams that come with working late while sick, but this game idea popped out last night and I think it's cute.
Movie Plot Dominoes.
We're all directors, working on the same movie. We each specialize in a particular genre: Action, Adventure, Drama, Romance. We each have a deck of cards that references our genre, full of locations, characters, plot points, etc.. The goal is to contribute the most to the film and bring the movie mainly into your genre. Play works like dominoes - the movie's central plot develops linearly, scene by scene location by location, with offshoots for character development and subplots.
Players take turns laying down cards, but most cards must be matched, dominoes style, using a number of continuity symbols (probably less than 6, maybe just 4). Score by contributing cards to the main plot, resolving plot lines, and resolving characters. In addition to their mechanical symbols each card has flavor, version 1 rips all the cards straight from tvtropes.org.*
I'm trying to figure out if it demands any make-believe work, or "pitching" or auctioning, or if it's mechanically mostly just dominoes. I think with enough flavor on the cards it could work fine as dominoes, but that seems like a cop-out. On the other hand story telling games like happily ever after limit their audience by requiring high levels of creativity from everyone, and also it tends not to work so well for competitive play (when the correct competitive move is to claim that someone's story is bad and their turn is over).
Maybe each next scene is chosen randomly or something.
Anyway yeah that's my idea.
*Kill Dr. Lucky is an example of a game that lives on flavor. Or, hangs onto flavor by its fingernails as flavor leaps the Gap of Angry Making.
names
I love the (locus? nexus? I'll settle for 'cognitive connection') between pagan true-name magic and modern computer systems.
The idea behind name magic is that if you know a thing's true name, it confers a measure of power over that thing. It's an idea similar how a voodoo doll is supposed to work, the name is a proxy for the thing, and by using the name you can control the thing*.
Computer architecture falls very easily into this metaphor. Every piece of information in a computer has an address, whether it's in memory or on a hard drive. This address can be thought of as a name. And if you have the true name of a piece of data, you can literally do whatever you want to it.
If we are all living in the matrix**, it's an easy leap to think that the developers put in a developer's console, that's intended to let players access the inner workings under certain circumstances. So if you have access to the console (magic), and if you have someone's True Name, you may be able to affect their life in any number of ways.
Actually, if you look at identity theft, it's pretty much the same story; and identity theft only gets more powerful, the more of our identity is represented remotely, by numbers and systems instead of face-to-face.
*I honestly don't know the first thing about name magic so maybe I'm grossly misrepresenting its origins or metaphysics. But anyway I enjoy the idea so much that I'm going to run with it. There are lots of examples of the importance of naming, going back hundreds or thousands of years in the cultures that I'm aware of, so I figure I can always fall back on those if I have to.
**HA!
The idea behind name magic is that if you know a thing's true name, it confers a measure of power over that thing. It's an idea similar how a voodoo doll is supposed to work, the name is a proxy for the thing, and by using the name you can control the thing*.
Computer architecture falls very easily into this metaphor. Every piece of information in a computer has an address, whether it's in memory or on a hard drive. This address can be thought of as a name. And if you have the true name of a piece of data, you can literally do whatever you want to it.
If we are all living in the matrix**, it's an easy leap to think that the developers put in a developer's console, that's intended to let players access the inner workings under certain circumstances. So if you have access to the console (magic), and if you have someone's True Name, you may be able to affect their life in any number of ways.
Actually, if you look at identity theft, it's pretty much the same story; and identity theft only gets more powerful, the more of our identity is represented remotely, by numbers and systems instead of face-to-face.
*I honestly don't know the first thing about name magic so maybe I'm grossly misrepresenting its origins or metaphysics. But anyway I enjoy the idea so much that I'm going to run with it. There are lots of examples of the importance of naming, going back hundreds or thousands of years in the cultures that I'm aware of, so I figure I can always fall back on those if I have to.
**HA!
abstraction layers that hurt
Hibernate is this tool that you can use, that means that you don't have to write any SQL in order to use a database. It's like a compiler for SQL: you write your code in java, and it compiles the SQL for you automatically.
The problem with Hibernate is that you have to be an expert in data storage theory in order to use it well. So at that point you may as well write the SQL, because let me tell you Hibernate is not a very good compiler. You have to spoon feed it your data structures, and in order to get it to work cleanly you have to give up a lot of speed and efficiency in your database design.
It does have some good data portability and regularity benefits, but I'm betting we'll never take advantage of them for our game. Abstraction Layers that don't reduce complexity, don't increase performance, and don't grant extra flexibility that you will actually use, should be avoided.
The problem with Hibernate is that you have to be an expert in data storage theory in order to use it well. So at that point you may as well write the SQL, because let me tell you Hibernate is not a very good compiler. You have to spoon feed it your data structures, and in order to get it to work cleanly you have to give up a lot of speed and efficiency in your database design.
It does have some good data portability and regularity benefits, but I'm betting we'll never take advantage of them for our game. Abstraction Layers that don't reduce complexity, don't increase performance, and don't grant extra flexibility that you will actually use, should be avoided.
a sortof for profit company
Publicly held companies have a fiduciary obligation to maximize shareholder profits. This can lead to all sorts of pathological activity.
Non-profit companies are prohibited from rendering an investment profit. This leads to some classes of inefficiency and drives away a lot of people who might otherwise like to participate.
I think we need a designation in between, a company that is bound to follow a well defined mission of some kind, but also wouldn't mind making some money at the same time. Not obliged to be evil, not beholden to shareholders, but not divorced from the market.
By the way, Google sees itself this way, if you believe their mission statement and their founders, and I do. Over the years I expect that Google will come to see itself as just another profit driven machine, but I think that as of now it still has some idealism left.
Craigslist is another place that seems to be operating this way, and I think their idealism may survive even longer.
It's the company everyone wants, but there's no place for it in the regulatory or investment schema. Maybe there should be?
Non-profit companies are prohibited from rendering an investment profit. This leads to some classes of inefficiency and drives away a lot of people who might otherwise like to participate.
I think we need a designation in between, a company that is bound to follow a well defined mission of some kind, but also wouldn't mind making some money at the same time. Not obliged to be evil, not beholden to shareholders, but not divorced from the market.
By the way, Google sees itself this way, if you believe their mission statement and their founders, and I do. Over the years I expect that Google will come to see itself as just another profit driven machine, but I think that as of now it still has some idealism left.
Craigslist is another place that seems to be operating this way, and I think their idealism may survive even longer.
It's the company everyone wants, but there's no place for it in the regulatory or investment schema. Maybe there should be?
clean design: software vs real life
We all love elegant simple solutions. We appreciate good clean design and we strive towards it. But I write code all day, and then I try to apply the same principles to mechanical systems in the real world, and I find that it's just a different design space. In the real world, you cannot stuff an infinite amount of functionality into a black box. You can't keep adding abstraction layers (or pipe fittings, adapters?) Inheritance is a meaningless concept. And you have to make compromises with euclidean geometry and existing structures. You cannot just put your house in a box and move it somewhere else. Or you can but it's not a best practice.
Just something to remember I guess.
Just something to remember I guess.
basic gardening lore
Row covers, keep your plants warm and pest-free. This is the kind of basic shit that I never learned. ;-)
http://www.homegrownevolution.com/2009/11/row-covers-in-warm-climate.html
I'm thinking about setting up a greenhouse/aquaponics system, I guess that's the same principle. I can't decide where to put it around the yard, since I'd like to have the koi pond in front and the greenhouse in back. I mean I can just pipe the water back and forth and not worry about it.
http://www.homegrownevolution.com/2009/11/row-covers-in-warm-climate.html
I'm thinking about setting up a greenhouse/aquaponics system, I guess that's the same principle. I can't decide where to put it around the yard, since I'd like to have the koi pond in front and the greenhouse in back. I mean I can just pipe the water back and forth and not worry about it.
solar
Ok fine I just read about it at Wired, but One Block Off the Grid looks pretty interesting. They collect a bunch of people in a city who want to get solar installed, and then negotiate a sweet deal on solar installations with all that collective buying power.
Their rates for their current campaign in Los Angeles look pretty attractive: about $6 a watt before government rebates and tax credits, and about $3.15 a watt after. So a 3 kilowatt system comes out about $10,000, though you may need to be able to front 18,000, I'm not sure.
Solar increases home resale value by a lot, too, so in addition to making it back in your electric bill, you make it back when you sell the house. I don't think we really use a ton of electricity, so a 3kW system should be plenty for us. Just interesting. Though I think before we do something like this, we'd want to make other efficiency improvements like replacing our windows and blowing insulation into our walls. Then we can talk solar.
Their rates for their current campaign in Los Angeles look pretty attractive: about $6 a watt before government rebates and tax credits, and about $3.15 a watt after. So a 3 kilowatt system comes out about $10,000, though you may need to be able to front 18,000, I'm not sure.
Solar increases home resale value by a lot, too, so in addition to making it back in your electric bill, you make it back when you sell the house. I don't think we really use a ton of electricity, so a 3kW system should be plenty for us. Just interesting. Though I think before we do something like this, we'd want to make other efficiency improvements like replacing our windows and blowing insulation into our walls. Then we can talk solar.
flash hack high five
to this guy
for this hack (my version):
static private function construct(type:Class, args:Array):*
{
//OK SO we can't dynamically pass an array in
//since this is a constructor and not a Function object...
//SO instead we're just going to hardwire it for up to N arguments
//I am so so sorry
//--Nate
if(!args || args.length == 0)
{
return new type();
}
else
{
switch(args.length)
{
case 1:
return new type(args[0]);
case 2:
return new type(args[0],args[1]);
case 3:
return new type(args[0],args[1],args[2]);
case 4:
return new type(args[0],args[1],args[2],args[3]);
case 5:
return new type(args[0],args[1],args[2],args[3],args[4]);
default:
throw new Error("Too many Dao Constructor Arguments: if you need more, expand the switch statement I guess. Sigh.");
}
}
return null;
}
Silent partners in suffering.
for this hack (my version):
static private function construct(type:Class, args:Array):*
{
//OK SO we can't dynamically pass an array in
//since this is a constructor and not a Function object...
//SO instead we're just going to hardwire it for up to N arguments
//I am so so sorry
//--Nate
if(!args || args.length == 0)
{
return new type();
}
else
{
switch(args.length)
{
case 1:
return new type(args[0]);
case 2:
return new type(args[0],args[1]);
case 3:
return new type(args[0],args[1],args[2]);
case 4:
return new type(args[0],args[1],args[2],args[3]);
case 5:
return new type(args[0],args[1],args[2],args[3],args[4]);
default:
throw new Error("Too many Dao Constructor Arguments: if you need more, expand the switch statement I guess. Sigh.");
}
}
return null;
}
Silent partners in suffering.
dear science, please clone this
Cold blooded, slow moving, tiny goats.
I think they would make excellent pets, especially for apartments, where they could laze out on the balcony all day. Their slow metabolism would mean that you wouldn't have to feed them much, but since they're mammals they might be more friendly and cuddly than most reptiles. You might have to spend a few generations domesticating them first, but it's gotta be worth a try, right?
I think they would make excellent pets, especially for apartments, where they could laze out on the balcony all day. Their slow metabolism would mean that you wouldn't have to feed them much, but since they're mammals they might be more friendly and cuddly than most reptiles. You might have to spend a few generations domesticating them first, but it's gotta be worth a try, right?
a cornucopia of entertainment
Really? Assassin's Creed 2 and Left 4 Dead 2 come out on the same day and they both get amazing reviews? I still haven't had time to plow through Torchlight yet, and I'm neglecting my WoW characters and my Rock Bands. It's so hard being a game consumer sometimes.
The sad truth is that my eyes are bigger than my stomach when it comes to games; I just don't have anywhere near the time to play these things. And that's not even counting the fourm mafia game, the play by wave zombie campaign, game night, or Descent. But I guess the good news is that I never have to be bored, ever again.
I'm literally embarrassed by this situation.
The sad truth is that my eyes are bigger than my stomach when it comes to games; I just don't have anywhere near the time to play these things. And that's not even counting the fourm mafia game, the play by wave zombie campaign, game night, or Descent. But I guess the good news is that I never have to be bored, ever again.
I'm literally embarrassed by this situation.
Subscribe to:
Posts (Atom)