HN user

ycitm

493 karma

[ my public key: https://keybase.io/richardtowers; my proof: https://keybase.io/richardtowers/sigs/M-8IG90NBwlLwpscBH7FdJjkNfov9VkYKP9rR6jHYIQ ]

Posts5
Comments37
View on HN
Magnifica Humanitas 2 months ago

The next sentence in the quote hasn't aged so well - "What weather they shall have is not ours to rule."

I don't think there's any way to do iteration in the type system (other than recursion), so there's no way around it.

I considered forking the compiler to set a deeper limit, but at some point Typescript itself is going to stack overflow. Also that probably goes a bit beyond what Criss is expecting in an interview...

I wondered if anyone would spot this :)

There's a recursion depth limit of 500 on the TypeScript compiler, which prevents this solution working for N > 7

Even Aphyr's original Haskell solution only demonstrates N = 6, so in some sense this is an improvement on the state of the art for type-level N Queens solutions /s

The runes are mostly "just because", but there is a reason.

Ideally, I would have written:

  type Nil = unique symbol
Which would ensure the Nil type wouldn't match with anything but itself. Unfortunately, the compiler doesn't allow unique symbol other than on const variables initialised with Symbol(). So I needed some meaningless symbols.

I could also have done

  type Nil = "nil"
But then it would have looked like the string meant something.

One of my new years resolutions was to learn to type faster. To get some practice I started taking notes in all the meetings I attend. This wasn't common practice in my team before, but I've found it to be really useful. I've lost track of the number of times someone's said "didn't we talk about this in that meeting a couple of weeks back" and I've been able to point them at my notes.

I've found a really simple way of authoring and sharing notes is to write them in Org mode and then push them to a wiki on github. Github understands how to render Org markup nicely, so you get a nicely formatted wiki pretty much for free.

As an added benefit I can now touch type :)

Vim 8.0 released 10 years ago

Surround support was just added in IdeaVim 0.46. From the release notes:

Support for vim-surround commands ys, cs, ds, S, enable it with set surround in your ~/.ideavimrc

Looks like it's just an optimization. If you change to

  let test_curry x  y =  x + y + x
You get the expected output
  function f(param) {
    return test_curry(32, param);
  }
Love for TypeScript 10 years ago

You could call your js function with a string, and rather than a compile time error you'd get broken behaviour at runtime.

Vim GIFs 10 years ago

Some nice intuitive stuff in the help, too.

  :help paragraph

  [...] The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp" [...]
(they're nroff macros, but pretty baffling to a beginner)

Yes:

    817023023960376946633975507110154649249407598806798730414849884461776172171921668594148071323527016137506405823108520062504849249423700259406905313281403901410082762097159560221463048924336192384026777502177262731045200322200149773127502888545234973139480887644585192600631058962876114156934248895171959246969597637127280010272143593885240940877456234662196130491400738438731832514335353824697930453078426722191105157568392826870043655708008545411143367763836566011740499383456592129662585004880376777597714978023542434421914201119537685489173509942329090631662014650033142642110914360849421856179611226450806562235534802516081595259914768497444702718749402330070488028751073730349460752771915484847399385631524708487646079936572410398967582895983187640798072309362094727654167628620105981459021548290415800096769214437425690934372015628796027498219902441288189398386359846661623243493534897411417685435424010451956954083531228374002591372549525280610594684910812811287436481207089763125424247793044043309737269468709710679872269272855389945385386467765509880648929743498214329578288874987193768439353382305260108425688024147656806932474058888992099083804597481699305852902662863062054067183925164590726103552998367994727700722491707 `mod` 231
    0
Angular 2 Core 12 years ago

I've just been looking for JavaScript work in the UK. Certainly the majority (maybe not 90%, but definitely > 50%) of jobs mention Angular. It's difficult to tell how many of these are just "put something cool on the advert to attract the hipsters" and how many are actual "we use or will use angular heavily in production" though.

Interestingly it looks like the "sways" do a lot of their layout calculations on the server. Resizing the window triggers a call back that returns what looks like a bunch of styling information (this div goes here, with this Z index, etc.) which would ordinarily be left to the browser.

Perhaps this allows them achieve more than they could with the browser's layout engine? Certainly an interesting approach.

(edit: wording)