HNHacker News
TopNewBestAskShowJobs

valtron

298 karma · joined March 14, 2013

submissionscomments
valtron··on Show HN: 2048 Tetris
A first approximation for a strategy would be to follow a boustrophedon, and keep 2, 4 and 8 near the top, e.g. something like this:

    .   .   .   .
    .   4   2   .
    8  16  32   .
  512 256 128  64
valtron··on PEP 465 – Dedicated infix operators for matrix multiplication and matrix power
If you're really determined, you can use `.` as an operator via __getattr__ and inspect :p
valtron··on 2048
Tried 3 games, and the scores were 2700, 1200, 5000. So maybe. But then I wrote a function to play it for me:

    var manager = new GameManager(4, KeyboardInputManager, HTMLActuator);
    
    function play() {
      manager.restart();
      var m = 0;
      while (!manager.over) {
        manager.move(m);
        m = (m+1)%4;
      }
      return manager.score;
    }
... and that gets scores between 500 and 3000.

(Edit) Histogram of 500 runs:

  0k: ***
  1k: *******************
  2k: ****************
  3k: *********
  4k: *
  5k: *
  6k: *
valtron··on Show HN: Kriegspiel
I started working on a similar thing last year [0]. In my version, your pieces can see any spot on the board they are allowed to move to.

[0] https://github.com/valtron/fog

valtron··on Arscoin, our own custom cryptocurrency
I would be inclined to agree; that value is _not_ entirely caused by scarcity. (Though I will point out that if a resource is scarce, people might put more value on it and try to acquire more now because they're afraid they might not be able to get it later.)

However, for a currency, scarcity is critical! Let's say it was easy (and cheap) for people to print their own dollars. You then want to buy an apple. How much is an apple these days, about $1? That doesn't make sense, the apple store can easily print $1 worth of money and keep the apple. What about for $100? Same thing: it's still one bill. What about $1000000? Maybe. Depends how much harder it is to acquire that amount of paper and ink than the apple. At this point, congratulations, your currency is basically paper and ink. Buying anything remotely expensive (like groceries) involves hauling around tons of paper and ink.

http://w3.newsmax.com/newsletters/uwr/images/transcript-img1...

valtron··on Arscoin, our own custom cryptocurrency
The creation of a new coin has no bearing on the scarcity of another.

Scarcity is just one requirement for something to act as a currency; another would be that it can be exchanged for goods and services (read: other things that people value, and for which they want things that they also value).

valtron··on Why you should move that button 3px to the left
No, but I just checked a few of the sites we made and none break from ctrl+ (regarding this: I've never seen a non-tech person, i.e. 99% of traffic for the sites, use shortcuts in the first place); they also look consistent between _modern_ browsers; and how often do people load their own fonts? Is the designer responsible that a site becomes unusable under Wingdings? (Sorry for the strawman.)

That being said, when a designer says things like "move this button 3px to the left" they usually mean things like "move this button so its right edge aligns with the right edge of the content below, which got shifted because we added padding-right." So the original request gets implemented as what he _wants_ rather than what he asked for.

valtron··on Why you should move that button 3px to the left
When I used to work with my designer friend, he would tell me to do things like that: increase this padding by 5px, lighten the color by a little, slightly decrease the border-radius, etc. One by one like that, I find it hard to follow and it doesn't feel like anything really looks different -- until I compare the finished product with what I originally made by myself.

Anyway, slightly OT: the screenshot looks like a Google page. Does anyone know which one? I really want to know what difference the 3px makes!

valtron··on Flappy Space Program
Are you supposed to get it to go through the space between the "stars"? Is it even possible?

Edit: Got my first point (50 - 100 tries?). You need to make it go a full orbit without touching the outer circle. This seems obvious in retrospect.

Edit 2: And they knock each other out of orbit. This is fun.

valtron··on How to Save 90% on your S3 Bill
You only need to worry about this if you're doing 100k+ LIST requests. For me, turning off validate would save 0.2%.
valtron··on Torus-Earth
I can't tell if you're being sarcastic... but if not, this is the first legitimate use of uncyclopedia as a source I've seen.
valtron··on Life is a game, this is your strategy guide
It depends on the rules of the game.

Maybe the rules of life are competitive: you can only increase your score at someone else's expense. The score is either 0-1 or 1-0. (Maybe you're both starving but only have enough food to sustain one person.)

Or maybe they're cooperative: you can both achieve a >= score if you combine resources/knowledge/what-have-you. The score is 3-3 for cooperating or 1-1 for playing independently. (Take insurance, for example.)

In reality, the game is a complex mixture of these two extremes.

valtron··on Strangest Programming Language Feature?
Cool!
valtron··on Show HN: Website 181 Took Way Longer Than a Day – YumHacker
I can see this being much better than Yelp. How are you doing the recommendations? Something along the lines of PageRank?
valtron··on JQuery 1.11 and 2.1 Released
Rejoice! No more

    event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
valtron··on The Ramanujan sum of all positive numbers up to infinity is -1/12
There's only one way to add a finite list of numbers, but several ways to "add" infinite lists. Ramanujan summation is just one way. There are also other ways to define "addition" on infinite lists: Abel, Borel, Cesaro, Euler, etc. summation.

They're different from each other because they disagree on certain infinite sums, but they're still considered "summations" because, for finite lists, they give the same answer as normal addition.

valtron··on The Ramanujan sum of all positive numbers up to infinity is -1/12
Achilles runs at 1 unit/s and Tortoise at x < 1 unit/s. Tortoise gets a head start of 1 unit. How long until Achilles catches up?

Well first, Achilles has to travel 1 unit because Tortoise got a head start. That takes 1s. By then, Tortoise managed to run x units, so Achilles has to catch-up, which takes another x seconds, and by then... etc: The time it takes Achilles to catch up is 1 + x + x^2 + ... Since x < 1, this converges and the answer is 1/(1-x). It takes 1/(1-x) seconds for Achilles to catch up.

Plot the lines: Achilles runs along A(t) = t, the tortoise T(t) = 1 + x t. Solving for t: t = 1 + x t = t (1 - x) = 1; t = 1/(1-x).

Ok, now what if x > 1? Let's use x = 2.

1/(1-2) = -1. It takes -1 seconds for Achilles to catch up. Don't believe me? Plot it: A(t) = t, T(t) = 1 + 2t; Achilles catches up with Tortoise 1 second before the race starts!

There you have it, a physical interpretation of why 1 + 2 + 4 ... = -1. (I have no example right now for 1 + 2 + 3 ..., sorry.) So you see, this isn't nonsense, though I admit it DOES depend on definitions!

valtron··on The Harsh, Logical World of Cryptocurrencies
If cryptocurrencies take off, banks are simply going to store keys for people instead of physical money. For the layperson, nothing will change.

However, with cryptocurrency, the gap between how securely a single person vs. a dedicated entity such as a bank can store money decreases significantly.

valtron··on Nassim Taleb: We should retire the notion of standard deviation
He makes a good point about infinite MAD vs. STD.
valtron··on A 30 minute introduction to Rust
Don't points 2 & 3 together imply that anything that uses built-ins, which I assume are implemented with C FFI, is `unsafe`?
valtron··on Playing Atari with Deep Reinforcement Learning
A former coworker did his master's thesis on playing Atari games using RL. Here's a video of it learning to play Freeway: http://www.youtube.com/watch?v=44CilPmlimQ
valtron··on Click the Pic - How does this work?
It's composed of two images with transparent backgrounds. The foreground on one of the images consists only of white, and on the other only of black. Depending on what color's behind the picture, it obscures one or the other.

Edit: Gray background: https://twitter.com/SciencePorn/status/422565255726641152/ph...

valtron··on Implementing a JIT Compiled Language with Haskell and LLVM
Also worth reading: http://llvm.lyngvig.org/Articles/Mapping-High-Level-Construc...
valtron··on The Tuesday boy problem, in under 300 words
"I have a two children, one of which is a boy. What's the probability the other is a boy?"

Intuition wrongly treats the possibilities as sets and assigns probabilities 1/2 BB, 1/2 GB, rather than 1/3 BB, 1/3 GB, 1/3 BG.

valtron··on Radix Sort Revisited
Also works for sorting strings in alphabetical order.
valtron··on Show HN: Myth – CSS the way it was imagined
You can also write colors with the more intuitive hsl() and it'll convert them to hex notation.

(Only relevant if you need to support IE < 9, but still cool.)

valtron··on [dead]
Probably algorithmic trading.
valtron··on Why Bitcoin Will Never Be a Currency
Interesting point, and you're right: I was only considering printed money!
valtron··on Why Bitcoin Will Never Be a Currency
Let T be the total amount of money in circulation in a given currency C. When you see a value X in units of C, convert it to C' by X in C' = X / T. There you have it, every currency is already trivially equivalent to Bitcoin in that the supply of C' is fixed at 1.

How they're _not_ equivalent is that the creation of money in existing currencies is centrally controlled. You can get a clearer view of what happens when money is printed by looking at C' rather than C.

For simplicity, pretend there's only the Mint (can create money) and the Public (can't). Initially, Mint has X C and Public has Y C. In C', this is X/(X+Y) C' and Y/(X+Y) C'. Then Mint decides to create Z C. Mint now has (X+Z) / (X+Y+Z) C' and Public has X / (X+Y+Z). The Mint has effectively transferred money away from Public. All arguments against deflation are, basically, Mint will now redistribute the money in such a way as to stimulate the economy.

valtron··on Strategic Game of Life
1393 generations using the shotgun approach.
Page 1 of 3Next →