Better HN
topnewbestaskshowjobs
Log inSign up

bham

16 karma · joined Oct 5, 2009 (17y ago) · 37 submissions

Submissions

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

I cannot imagine how horrible this must be. Oh, the horror!

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

Try not to use wait() like this.

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

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

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-...

comment 16y ago · link · parent

There's also an ircd

https://gist.github.com/a3d0bbbff196af633995

comment 16y ago · link · parent

    Array.prototype.each
This is not needed. There's .forEach already.

comment 16y ago · link · parent

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.

comment 16y ago · link · parent

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!

comment 16y ago · link · parent

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

comment 16y ago · link · parent

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.

comment 17y ago · link · parent

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.

comment 17y ago · link · parent

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?

comment 17y ago · link · parent

Did they really need to have a f'in plane crash into a building?

comment 17y ago · link · parent

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."

comment 17y ago · link · parent

I wonder what this means for us Adwhirl users.

comment 17y ago · link · parent

save cleverness for reddit please :)

comment 17y ago · link · parent

Please refer to this independent and unbiased study that bolsters my point, a study which I authored.

comment 17y ago · link · parent

Oh, I missed that. Great.

comment 17y ago · link · parent

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?

comment 17y ago · link · parent

Hmm, they look like a Wholesale Internet reseller.

comment 17y ago · link · parent

I don't see an add-on for long-polling. I kid, I kid.

comment 17y ago · link · parent

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

comment 17y ago · link · parent

... and does not have bandwidth pooling, does it?

comment 17y ago · link · parent

Why is Africa flat-shaded? Or are you trying to show timezones?

comment 17y ago · link · parent

http://github.com/mojombo/bert/blob/master/lib/bert/encoder....

http://github.com/mojombo/erlectricity/blob/master/lib/erlec...

comment 17y ago · link · parent

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.

comment 17y ago · link · parent

Crystal
12