For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more pieguy's commentsregister

Not sure how you came up with 5 cents but I get $1.36: 4000 dollars/btc * 10^-8 btc/satoshi * 150 satoshi/byte * 226 bytes/transaction = $1.356 per transaction


If you wanted to get confirmed in the very next block you could probably use 25 satoshi/byte at this point in time. Personally, if I were sending a non critical/time-sensitive transaction right now I would use about 5 satoshi/byte.


The solution to 1.1 is incomplete - Alice can set p=1 and q=n


Ah! It's one thing to be able to answer the question and another to show that the proposed solution is not good enough :-)

Thanks for the heads up - we should have specified this constraint about p and q.


I prefer the approximation (4+832/N), which gives its result in months. Not as easy to do in your head but it's quite accurate.


A couple years ago I saw a 3.5x improvement migrating a lockfree skiplist from hazard pointers to epochs. The problem with hazard pointers is that they require memory barriers after every assignment, whereas epochs only require one at the start.


A study published in Science in June 2014, described as "likely the most thorough and precise study that has been done on the performance of the D-Wave machine" and "the fairest comparison yet", found that the D-Wave chip "produced no quantum speedup".

https://en.wikipedia.org/wiki/D-Wave_Systems#Reception


The "quarter mile stretch of wall all to your own" reward already has over 16k backers. How are they planning to deliver when the wall is only 300 miles?


Obviously they'll just have to build multiple concentric walls. This will also sap the morale of any burners who are ambitious enough to climb over the outer one.


Every seen that "Office Space" documentary, err, I mean comedy, where the poor TPS report programmer has like eight bosses all telling him what to do because he works solely for them? Well...


IPSC 2014 problem E looks like a machine learning problem, but the intended solution was to make multiple submissions and use the judge feedback to reverse-engineer the test data. The winning team needed only 6 submissions to hit 95% accuracy. It was one of my favourite problems from the contest.

http://ipsc.ksp.sk/2014/real/problems/e.html


What did they use the sixth submission for? You can win it in five submissions, can't you? :-)


What many descriptions of the problem leave out is that it is critical that Monty knowingly picks a door with a goat. If Monty chooses at random, then the winning odds do indeed increase to 50% if he happens to open a door with a goat behind it.

The randomized variant, by the way, tends to garner roughly the same degree of "you're completely wrong" responses when given to people who know just enough about the normal Monty-hall problem not to be fooled by it.


Here's an iterative solution which is shorter and 3 times as fast:

  void iterative(int n)
  {
      int from[2][3] = {{0,1,2},{0,2,1}};
      int   to[2][3] = {{1,2,0},{2,1,0}};
      for(int i=1; i<1<<n; i++)
      {
          int disk = __builtin_ctz(i);
          int count = (i>>(1+disk))%3;
          int parity = (disk^n)&1;
          move(from[parity][count], to[parity][count]);
      }
  }


Neat. Were you able to get his code to run? What did you change / what compiler flags did you use?


I removed the free() call because it was crashing. I also added a cast to the malloc() because I was compiling in C++. Compiled with

  g++ -o hanoi hanoi.cpp -O2 -lrt


Thanks. I had also cast malloc() but didn't think to just comment out free().

So I'm seeing similar results as you. Your iterative implementation is about 3x faster than the author's, but still not as fast as the recursive version. I'm surprised!


And what's the alternative for if(A && B){ x(); }else{ y(); }? Seems very easy to shoot yourself in the foot with this approach.


Well, you could

    if (one) {
    if (two)
    if (three)
    if (soon) {
        stuff
    }} else {
        else stuff
    }
Personally, I think I won't have any trouble reading that, but I have noticed I'm somewhat more tolerant than others in this regard. Though I am more OCD than others in other ways.


That doesn't what he's talking about, though. Your else will run anytime `one` is false, not when `one && two && three && soon` is false.


But it's still not the equivalent of: if (one && two && three && soon) {stuff} else {stuff} which I assume the GP meant.


Here, the x() and y() are assignments, so it's easy:

    ret = 0; //y()
    if (A)
    if (B)
        ret = 1; //x()
If the else statement is more involved, it gets difficult.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You