Better HN
topnewbestaskshowjobs
Log inSign up

ycitm

493 karma · joined Apr 5, 2013 (13y ago) · 46 submissions

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

comment 6mo ago · link · parent

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

comment 1y ago · link · parent

Most importantly, this means my type system N-queens solution now works for an 8x8 chessboard (actually up to 10x10) instead of complaining about recursion depth:

https://www.richard-towers.com/2023/03/11/typescripting-the-...

comment 1y ago · link · parent

Doesn't seem to be any discernable improvement on the Zoom Cat Lawyer.

comment 3y ago · link · parent

You can also play around with the code in the TypeScript playground:

https://www.typescriptlang.org/play?#code/PTAEEkDsAsEMBsCmAa...

comment 3y ago · link · parent

Ah, thank you so much! Great spot.

I've corrected this, and credited you in the errata - https://www.richard-towers.com/2023/03/11/typescripting-the-...

comment 3y ago · link · parent

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

comment 3y ago · link · parent

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

comment 3y ago · link · parent

The series is actually by Aphyr: https://aphyr.com/tags/interviews

This post is a pastiche of https://aphyr.com/posts/342-typing-the-technical-interview

comment 3y ago · link · parent

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.

10.

TypeScripting the technical interview(richard-towers.com ↗)

727 points · by ycitm · 3y ago · 159 comments

11.

The impact of removing jQuery on our web performance(insidegovuk.blog.gov.uk ↗)

2 points · by ycitm · 4y ago · discuss

12.

How and why we removed jQuery from Gov.uk(insidegovuk.blog.gov.uk ↗)

49 points · by ycitm · 4y ago · 43 comments

comment 9y ago · link · parent

If you've got any experience or interest in programming, I'd recommend having a stab at Google Summer of Code[0].

[0] - https://developers.google.com/open-source/gsoc/

14.

Lessons from last week’s cyberattack(blogs.microsoft.com ↗)

377 points · by ycitm · 9y ago · 282 comments

comment 9y ago · link · parent

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 :)

comment 9y ago · link · parent

If you have control of your nameservers you can use cloudflare's free TLS offering and keep your current webhost.

comment 10y ago · link · parent

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

comment 10y ago · link · parent

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);
  }

comment 10y ago · link · parent

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

comment 10y ago · link · parent

At least in new versions of Chrome, NodeList is iterable, so you can use forEach and map on it.

https://medium.com/@devlucky/nodelist-object-is-finally-an-i...

comment 10y ago · link · parent

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)

comment 10y ago · link · parent

Perhaps Tōkaidō Shinkansen would be a better example? 331 trains / day, 391 thousand passengers / day according to: http://english.jr-central.co.jp/company/ir/annualreport/_pdf... (pdf)

comment 11y ago · link · parent

Yup, see @pauljz's comment above - https://news.ycombinator.com/item?id=10375297

comment 11y ago · link · parent

Regarding [7] and [8], Snowden has explicitly denied that he is the source for the GCHQ Oman leak - http://www.theguardian.com/commentisfree/2013/aug/23/uk-gove....

comment 11y ago · link · parent

Agreed, both of those are better. Hopefully one will gain traction.

Thanks for the link, good to know people are thinking about the naming issues.

comment 11y ago · link · parent

Is this just criticism of the "isomorphic" term?

I'm not a fan of it either ("isomorphic" already has a different well-defined meaning in CS), but it does seem to have some traction now.

Perhaps you have an alternative term you'd prefer these frameworks used?

comment 11y ago · link · parent

Yes:

    817023023960376946633975507110154649249407598806798730414849884461776172171921668594148071323527016137506405823108520062504849249423700259406905313281403901410082762097159560221463048924336192384026777502177262731045200322200149773127502888545234973139480887644585192600631058962876114156934248895171959246969597637127280010272143593885240940877456234662196130491400738438731832514335353824697930453078426722191105157568392826870043655708008545411143367763836566011740499383456592129662585004880376777597714978023542434421914201119537685489173509942329090631662014650033142642110914360849421856179611226450806562235534802516081595259914768497444702718749402330070488028751073730349460752771915484847399385631524708487646079936572410398967582895983187640798072309362094727654167628620105981459021548290415800096769214437425690934372015628796027498219902441288189398386359846661623243493534897411417685435424010451956954083531228374002591372549525280610594684910812811287436481207089763125424247793044043309737269468709710679872269272855389945385386467765509880648929743498214329578288874987193768439353382305260108425688024147656806932474058888992099083804597481699305852902662863062054067183925164590726103552998367994727700722491707 `mod` 231
    0
12