HN user

bham

16 karma
Posts0
Comments37
View on HN
No posts found.

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.

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.

Adieu google 17 years ago

You implicitly trust that it is deleted when you click that button?

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.

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?

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?

When to Redis 17 years ago

Please submit a few reproducible cases to the mailing list. I'm sure Ludo or I (or you) could even patch it quickly. Thanks!