Better HN
topnewbestaskshowjobs
Log inSign up

chpatrick

2,704 karma · joined May 5, 2014 (12y ago) · 1,214 submissions

Submissions

comment 10y ago · link · parent

Haskell's standard vector package supports this: https://hackage.haskell.org/package/vector-0.11.0.0/docs/Dat...

comment 10y ago · link · parent

Something very similar for Haskell, as a library: http://leventerkok.github.io/sbv/

comment 10y ago · link · parent

You can turn it into an SMT problem and solve it with a standard solver. In Haskell it's quite beautiful as you can write code that's basically identical to writing a parser, and then generate inputs that satisfy the parser magically.

https://github.com/ekmett/ersatz/tree/master/examples/regexp...

comment 11y ago · link · parent

Well, it would also be very strange if P=NP because you could use algorithms like this in polynomial time:

  bool isComposite(n) {
    guess a number d magically
    if (n % d == 0) {
      return true;
    } else {
      fail;
    }
  }

comment 11y ago · link · parent

I used Slackware, Gentoo and Arch for ten years but in the end I'm on Ubuntu. I liked feeling in control on those systems and it was great to have everything available immediately on Portage or AUR, but after a while I just got tired of having to read a wiki page for doing something as simple as setting up Bluetooth and ending up with a less convenient end result. I find there's almost always a PPA for an obscure package I need, so I found Ubuntu pretty convenient for actually getting stuff done.

1206.

Microsoft apps will be bundled on Cyanogen Android devices(engadget.com ↗)

1 points · by chpatrick · 11y ago · discuss

comment 12y ago · link · parent

At my University (Imperial College London), our operating systems coursework was built around a toy OS called Pintos (http://en.wikipedia.org/wiki/Pintos), which is written in assembly and C and runs on x86. The project was to fill in the blanks in the implementation (more advanced scheduling, memory management, swapping etc) and I think most people thought it was one of the most fun projects we had. Being more realistic wasn't really a problem as the really arcane parts were already implemented.

comment 12y ago · link · parent

One of my lecturers at Imperial College called it the most beautiful unknown algorithm. :)

comment 12y ago · link · parent

I'm not sure you could do that with a monad. They still let you use whatever pure function you want, which can have arbitrary complexity.

comment 12y ago · link · parent

I'm disagreeing with this statement: "You definitely need to use unsafe Haskell code in order to implement most cryptographic primitives in a way making them resistant to timing attacks."

Safe indexing is constant time too, unless you're out of bounds and you have to process the exception, in which case your program is wrong anyway.

comment 12y ago · link · parent

Why isn't it possible? The safe versions just do bounds checking, which still seems constant time to me. If you mean that somewhere in the stack something must do pointer math you're right, but that's a given whatever you do crypto or not.

comment 12y ago · link · parent

Sure, but the point is that you can get some pretty nice speeds without writing any C yourself.

comment 12y ago · link · parent

It's 1.08s on my computer for one line of Python, which is respectable:

  python2 -m timeit -v -n 1 -s "import numpy" "numpy.memmap('1_gb_file', mode='r').sum()"                                                                                    
  raw times: 1.08 1.09 1.08

comment 12y ago · link · parent

It's everywhere in Budapest: http://www.clubmate.hu/#map
1
3738394041