Why the tabs-vs-spaces debate matters:
Inconsistent indentation: 2 spaces were used for indentation, but the rest of the document was indented using 1 tab.
Usually I don't splurge on things like Nurf guns, but our family was challenged to a dual, and I decided we needed to load up. The kids had been saving money, so they all got to purchase their own gun, and so my only purchase was for my own. Anyway, I thought I'd post what everyone bought and a short review of each of them. Here's what we bought:
We bought these at Target, and none of them cost more than $25. In fact, most of them were $10 or less.
The gun with the most "cool factor" was the Nerf Retaliator. This gun is modular and therefore can actually be transformed into four different styles below:
If you remove the stock and the barrel, you get a very nice basic gun similar to a Skorpion (bottom right). If you have a stock without a barrel, you get a gun very reminiscent of a UMP45. If you have a barrel but no stock, it looks a bit like an MP5. With all of the attachments, it could be really any assault rifle, but it most reminds me of an M4 or FAL. Now, I should point out, this is pretty much all for show - I didn't detect any advantage of having a barrel attached - but it looks pretty intimidating nonetheless.
The Retaliator fires well, and with a long range , but is *very* erratic. In our battle with our friends, I'm not sure I hit *anyone* with this gun. It is mega-cool, and shoots pretty far, but don't count on actually hitting anything.
The gun that actually shot the best was the Vortex Proton - and I think it only cost $9. The Proton is one of Nerf's new disc-firing guns. The disks are Nerf disks so they don't hurt. However, the disks are *very* aerodynamic, so they actually fly straight! The Vortex is a single shot, and it takes a little bit to load, but nonetheless I had the best success with it because it was so accurate! I could be sure to know that the disk would fly exactly to where I aimed it! The only drawback, as I said, was that it was a single-shot, and didn't even have a spot to hold additional ammo. So, reloading was problematic because it took time, and fumbling around with ammo was difficult. I think if you got a multi-shot version of this you would have an amazing gun!
Another good gun is the Buzz Bee RADS 12. This is a twelve-shot gun that you pull back on a lever to cock it. It shoots decently and doesn't cost very much. Overall I would say that it is a decent purchase, but my 5-year-old was the one to purchase it, and it took too much hand strength to cock the gun. He could do it, but only if he held it on the ground with one hand and pulled with the other - not very helpful in a gun battle.
The worst gun was the Buzz Bee double-barrel shotgun. This was not worth buying. Here are the problems with the gun:
Anyway, my 6-year-old likes it because of the "realism", but I think that if we do too many more battles, he will realize the problems with the gun.
The next gun is the Buzz Bee Tek-3. This is a tiny gun with three shots. However, it does not auto-rotate the barrel. Between shots, you must BOTH cock the gun AND rotate the barrel. However, for a tiny gun, it packs a decent punch and is relatively easy to use. At Target, they had a 3-pack for $6. That's right, 3 guns for $6. It makes a good backup weapon (like a boot gun).
Also in the picture is an older Nerf gun that we already had - I believe it is a Nerf Dart Tag Strikefire. This is an old gun, but still shoots decently. It is a single-shot, muzzle-loaded pistol, but also has holding spots for five additional rounds. This original came with Nerf Dart Tag darts, but I think it can fire most anything. It works really well as a simple, basic gun.
Anyway, if you are looking for Nurf or Nurf-like guns, I hope this review was helpful to you!
I *hate* the direction that Rails is moving. It is becoming a bloated piece of garbage. I got into Rails precisely because Rails got out of my way most of the time, but was easy to use right where I needed it. ActiveRecord was a thin shell over SQL. Therefore, if there was a problem, I could easily diagnose it, because I knew SQL. It added a few bits of magic, but those were usually pretty understandable. Likewise with the javascript helpers and the like. If you needed something done, just pop into Javascript and patch it up.
This contrasted heavily with J2EE. I used J2EE for a while, but it turns out that if you want to use J2EE you have to commit to it like it's a religion. If you don't know 20 different platform libraries, you can't even do a hello world in J2EE. When you finally get it working, you don't know what the heck is even going on. Some magic is happening somewhere, but it is beyond what is plainly visible. This, and the fact that Ruby is very metaprogramming-ish, was the reason I chose Rails.
However, starting with Rails 3, the Rails team decided that it was simply going to do everything for you, and everything was going to be done in domain-specific languages. Thus, instead of the required list of languages/platforms being Ruby/Rails/SQL/Javascript, it has balooned out to Ruby/Rails/SQL/Javascript/Coffeescript/SASS/ECO/Node.js, and probably a few others I'm forgetting. The asset pipeline is kind of cool, but it's yet another place for things to go wrong. I think the anti-CSS measure of auto-h()ing code is terrible. If you wanted to go that way, instead you should use Perl's taint feature, and just give errors if you display tainted values. The idea that random code should transform my strings is horrible.
Finally, I understand the reason for getting rid of the javascripty stuff from rails core, but some of those were really what made the platform really rock. I think they have missed the mark - they put the ease-of-use in the wrong places, and instead have made sure that no one that doesn't have a relgious commitment to the software stack will ever find it usable. It has basically gone the way of J2EE, and I am now looking for a new platform to love.
I know this won't make a lot of sense to most people, but I thought I needed to store these thoughts in a more permanent place before I forget them. I've been reading a paper today on Algorithmic Information Theory, and it make me think these thoughts (most of which are probably ill-founded):
Before Apple's ARC, you would often have to manage memory semi-manually. Before operation queues, you would also have to manage setting up autorelease pools on new threads. If you didn't, you would get an error such as:
autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
However, the other day, I started getting these myself! I was a little shocked - what on earth was I doing that required an autorelease pool? Well, eventually I figured it out. It turns out that if you have custom +load() functions on your classes (these get called whenever the classes load - I use them for registering handlers and such), this is another situation in which you have to set up your own autorelease pool if you do any object creation.
So, in your +load() function (or, depending on what you are doing, in functions that +load calls), just wrap it with
@autoreleasepool {
Your Code Here
}
And it works!
I'm teaching calculus to some homeschool students this year, and I wanted to have a bunch of function plots printed out to show them. Therefore, I turned to Sage, which I have never used. It is great! You have to know a few other math software pieces to really understand it, but it's not that bad. Someone needs to do a general "how to use sage", and some day I might.
Anyway, here's my quick function for plotting graphs for students that some of you might like.
In one of the evaluation boxes, type the following:
def simpleplot(f, range=(-5,5,-5,5)):
p = plot(f, (x, range[0], range[1]))
p += text("$" + latex(f) + "$", (0, range[2] - (range[3] - range[2]) * 0.1), fontsize=30, rgbcolor=(1,0,0))
p.axes_range(range[0], range[1], range[2], range[3])
show(p, figsize=12)
What this does is create a function called "simpleplot" which will do the following:
Now, I can just do:
simpleplot(1/x)
And it gives me my output!
Just wanted to shout out and say thanks to Flay for saving me! I had a DVD that I forgot to finalize, but Flay had a nice set of instructions for how to manually copy off the files from the DVD drive.
Now I can finish editing and posting the videos for the Engineering and Metaphysics conference.
I've been chasing down a wierd bug where, on an NSManagedObjectContext, the hasChanges method keeps returning YES even after a rollback. It turns out, if you do the following sequence, hasChanges will *never* be cleared:
MyClass *c = [NSEntityDescription insertNewObjectForEntityName:@"MyClass" inContext:ctx];
//Do other stuff
[ctx deleteObject:c];
// Do other stuff
[ctx rollback];
[ctx hasChanges]; // Returns YES!
In my own case, I got around it by not deleting the object, and just rolling back if I wanted it gone, but that won't work for everyone. So, I did:
MyClass *c = [NSEntityDescription insertNewObjectForEntityName:@"MyClass" inContext:ctx];
//Do other stuff
[ctx rollback]; // Don't delete! just roll back
//Do other stuff
[ctx rollback]; // Now it works
[ctx hasChanges]; // Returns NO like it should
I have historically been grateful for stackoverflow.com, but I think that perhaps they may be getting overly full of themselves and self-conscious.
I have long used their site to get answers, especially to iOS questions. It always seems that someone answers any question I might have. I've always wanted to give back, but found that nearly every questions someone else has already answered.
So the other day I was trying to figure something out, and the answer on StackOverflow was that it was not possible. I spent a day messing around, and actually figured out how to do it (read about it here). So, having spent most of the morning trying to find if anyone had accomplished this, I actually found three different StackOverflow.com questions pertaining to it, as well as several sites on the Internet. So what did I do? I decided the best way to let people know about the answer was to write a blog post about it, and then point people to the blog to find the answer in each question. This was going to be my way of giving back.
So what happened? Well, two of my comments got deleted from StackOverflow, and one had a comment from a moderator attached accusing me of self-promotion!!!! Because I solved a problem that had been outstanding for a year, and told people the answer!!!!
So, in the future, I will just post to my blog, and leave StackOverflow out of it. You can come here for the answers. I don't have enough brain space to deal with that kind of junk.
For those interested in engineering and theology and philosophy, this conference is for you! I've got two talks slated for the conference - come and listen! Lots of fascinating stuff from a number of disciplines:
You can see the abstract list here and the conference flyer here.