News for hackers. Stuff that matters.

bham

Re:Darts for Geeks: Statistician Cracks the Game’s Secrets on Thursday December 17, 2009 @04:48PM (#1001988)
I sort of did something similar for my Darts app for the iPhone, specifically for defining the throw model for the "AI" player.

I found it easiest to simulate millions of random dart throws parameterized by throw angle and velocity. I record the slot on the board (1-20, Bull) hit given the launch angles and force of the throw. I let this "simulation" run until I had 50 samples per board slot.

The simulation is run once ahead of time. The simulation results are bundled with the app.

When it becomes the AI's turn, it picks a slot to aim at based on the game variation and state of the game. Currently, it chooses rather poorly in Cricket.

Then it picks a random sample from the sample pool recorded from the aforementioned simulation. Based on the user-chosen competence level, it adds a small, random amount of error to the angle and velocity associated with the selected sample. Finally, the dart is launched using the calculated angles and force.

While the app is Objective C, the offline simulation was written in Python. The whole thing was a blast to write.

Here's an old video of gameplay:

http://vimeo.com/2010432

Skip ahead to around 1:10 to see the AI take its turn.

I cannot imagine how horrible this must be. Oh, the horror!
Re:Cloudant.com Refresh: CouchDB in the Cloud on Friday December 11, 2009 @11:09AM (#989898)
What is your take on CouchDB? After some initial investigation, I've all but written off CouchDB for anything moderately write-heavy due to its single writer at a time design. I'm by no means an expert on that however. Please tell me what I'm missing about CouchDB.
Re:Cloudant.com Refresh: CouchDB in the Cloud on Friday December 11, 2009 @11:08AM (#989893)
I think a good way to promote this would be to self-host the blog using a CouchDB application running on Cloudant instead of using Posterous.
Re:Accessing a MySQL database from Node.JS on Tuesday December 08, 2009 @12:16AM (#983083)
Try not to use wait() like this.

There was recently committed writeSync, statSync, etc. that perform POSIX API calls synchronously.

but this is history, boring, and by now not very interesting

So it is in the past, boring, and in the past and boring. OK.

Re:Antiobjects on Monday December 07, 2009 @11:43PM (#983038)
This reminds me of a funny Cracked skit about the 1979 game developer's conference wherein the birth of Frogger was reenacted. "Ok ok you are a truck driver and you try to run over frogs crossing the road". "No, no, you ARE the frog!" "Whoooa"

http://www.cracked.com/video_16019_video-game-pitch-meeting-...

Re:A simple chat server in Node.js on Monday December 07, 2009 @01:10AM (#980819)
Re:A simple chat server in Node.js on Monday December 07, 2009 @01:09AM (#980816)

    Array.prototype.each
This is not needed. There's .forEach already.
Re: Aardvark Mulls Over A $30+ Million Offer From Google on Monday December 07, 2009 @12:39AM (#980786)
So the decision comes down to sell now and take the guaranteed money, or roll the dice and go for the big win.

As anyone who watches Cash Cab knows, take the money and run.

Re:Web forms design guidelines: an eyetracking study on Sunday December 06, 2009 @12:21AM (#979209)
I'd love to find an eye-tracker and play with it to see what it is I tend to look at. Anyone have any experience?

Chui Chui loves food, and is very fond of sugared squid!

Good to know!

Re:Adieu google on Sunday December 06, 2009 @12:12AM (#979200)
You implicitly trust that it is deleted when you click that button?
Re:Adieu google on Sunday December 06, 2009 @12:10AM (#979195)
How can you have mistaken the Chrome logo for an evil robotic eye when it was engineered to resemble everyone's happy childhood game Simon

http://images.google.com/images?hl=en&client=firefox-a&#...

Come on in, the water's warm.

Re:Nginx HTTP Push Module on Sunday November 22, 2009 @11:54PM (#956845)
I just had some time to scan your repository on GitHub and noticed this: http://github.com/slact/nginx_http_push_module/commit/6823f7...

Though it just looks like a stub for now.

Also, I read the following here: http://github.com/slact/nginx_http_push_module/issues/unread...

"Meanwhile, you can use your application to do the authenticating, and generate ids for already-authenticated clients from a large enough (> 2^128) keyspace for security."

So, there, I did my homework.

Re:Nginx HTTP Push Module on Friday November 20, 2009 @11:42PM (#954181)
This looks fantastic. Thanks for writing it.

How would you go about restricting access to channels to a specific user or users? My first take would be to issue an unguessable id upon successful authentication and use this id as the channel id -- a shared secret. Only those who should know the id do know it.

I don't see support for streaming; the connection to the long-polling client is closed after consuming. Are you planning on adding support for streaming new messages as they are published?

Re:Ambient Life – Animated Vision Of The Future on Friday November 20, 2009 @11:14PM (#954159)
Did they really need to have a f'in plane crash into a building?
Re:Pastebin which is able to run your code. Accepts 40 languages. on Thursday November 19, 2009 @08:12PM (#951608)
Security by obscurity is not security at all. You should seriously consider opening up the source.

As my great aunt Ada used to say, "more eyeballs are better than your eyeballs."

Re:Google to Acquire AdMob for $750 Million on Monday November 09, 2009 @01:48PM (#931474)
I wonder what this means for us Adwhirl users.
Re:You're An Idiot For Not Using Heroku on Sunday November 08, 2009 @11:11PM (#930372)
save cleverness for reddit please :)
Please refer to this independent and unbiased study that bolsters my point, a study which I authored.
Re:Linode having some issues on Tuesday November 03, 2009 @04:59PM (#920390)
Oh, I missed that. Great.
Re:Heroku vs EngineYard Cloud vs Joyent on Tuesday November 03, 2009 @02:03PM (#919984)
For a straight web site, I'm sure any of these are fine if not "pricey". What do you folks use for web service hosting? Sure, it can be just a web host like any other. But Heroku (last time I checked) does not support any form of long-polling and/or streaming for instance.

I can setup a VPS with nginx proxying to tornado/node.js/etc that does streaming without a problem. However, there's the issue of scaling it out that's pain. You can use Linode's API or something similar but eek, what a mess.

Thoughts?

Re:Low End Dedicated Servers on Tuesday November 03, 2009 @01:26PM (#919902)
Hmm, they look like a Wholesale Internet reseller.
Re:Heroku (YC W08) makes PaaS flexible with Add-ons on Friday October 30, 2009 @12:19AM (#911525)
I don't see an add-on for long-polling. I kid, I kid.
Re:When to Redis on Friday October 30, 2009 @12:17AM (#911522)
Please submit a few reproducible cases to the mailing list. I'm sure Ludo or I (or you) could even patch it quickly. Thanks!
Re:Linode having some issues on Tuesday October 27, 2009 @11:45PM (#907092)
... and does not have bandwidth pooling, does it?
Re:Real time website statistics visualized on a 3d globe on Sunday October 25, 2009 @02:25AM (#901333)
Why is Africa flat-shaded? Or are you trying to show timezones?
Re:The Zimbu programming language, by vim author Bram Moolenaar on Wednesday October 21, 2009 @01:34PM (#895158)
Io is an absolute joy. It's too slow to be practical but that's my personal bent. Not everything has to be practical of course.
Crystal

Older »