HN user

pathikrit

311 karma
Posts43
Comments106
View on HN
github.com 3y ago

Show HN: A tiny toy CLI ChatGPT interface in Node.js (<200 LOC)

pathikrit
1pts0
github.com 3y ago

Show HN: A Node.js based e-ink live newspaper display

pathikrit
3pts0
en.wikipedia.org 4y ago

Hyperart Thomasson

pathikrit
1pts0
en.wikipedia.org 7y ago

Brahui Language

pathikrit
1pts0
en.wikipedia.org 7y ago

Mercedes Benz W125 Rekordwagen (1938)

pathikrit
1pts0
sites.google.com 7y ago

Site.Google.com

pathikrit
1pts0
shoppinglist.google.com 7y ago

Shoppinglist.Google.com

pathikrit
2pts0
gist.github.com 9y ago

Mortgage Math Cheatsheet

pathikrit
1pts0
outlook.uservoice.com 10y ago

Microsoft enrages users by removing “sweep emails” functionality from Outlook

pathikrit
2pts0
en.wikipedia.org 10y ago

Naked mole rat

pathikrit
2pts0
gist.github.com 10y ago

N-queen puzzle in 4 lines of Scala

pathikrit
120pts94
en.wikipedia.org 10y ago

British Airways Flight 5390

pathikrit
1pts0
gist.github.com 10y ago

Scala implementation of Peter Norvig's spellchecker

pathikrit
1pts0
www.scala-lang.org 10y ago

Odersky: Essence of Scala

pathikrit
4pts1
www.javaadvent.com 10y ago

Reactive file system monitoring using Akka actors

pathikrit
2pts0
github.com 10y ago

Better-files: Simple safe intuitive I/O in Scala

pathikrit
2pts0
github.com 10y ago

Scala wrapper for Java NIO

pathikrit
1pts1
github.com 10y ago

Show HN: My OS X setup script

pathikrit
1pts0
www.google.com 11y ago

Google Nik Collection

pathikrit
2pts0
www.simple.gy 11y ago

FRP: Infinite Scroll with Bacon.js

pathikrit
3pts0
en.wikipedia.org 11y ago

Cecilia R. Aragon

pathikrit
1pts0
www.facebook.com 11y ago

Facebook Directory

pathikrit
1pts0
github.com 11y ago

Sauron: A Scala lens macro in 30-lines of code

pathikrit
1pts0
stackoverflow.com 11y ago

StackOverflow: Disable personalized predictions

pathikrit
2pts0
gist.github.com 11y ago

Google Maps Wishlist

pathikrit
2pts0
github.com 11y ago

Scala macros to generate RESTful models

pathikrit
2pts0
stackoverflow.com 12y ago

What is the difference between reactive programming and plain old closures?

pathikrit
1pts0
verbalexpressions.github.io 12y ago

VerbalExpressions

pathikrit
1pts1
en.wikipedia.org 12y ago

Yet another Wikipedia time sink: List of experimental aircrafts

pathikrit
1pts0
meta.stackexchange.com 12y ago

StackExchange.Meta: Where to ask questions?

pathikrit
2pts0

10-15 years ago HN was the place where everyone showed off their new shiny toys and people would jump over themselves to try some new framework or db or tool. Now, so much negative sentiment about AI coding. I bet if LLMs came 15 years ago, HN would be brimming with excitement. What happened?

I love math but the symbology and notations get in my way. 2 ideas:

1. Can we reinvent notation and symbology? No superscripts or subscripts or greek letters and weird symbols? Just functions with input and output? Verifiable by type systems AND human readable

2. Also, make the symbology hyperlinked i.e. if it uses a theorem or axiom that's not on the paper - hyperlink to its proof and so on..

My favorite conspiracy theory:

After Tiananmen, the CCP planned many contingents next time something similar happened.

Cue, the [2019 Hong Kong Democracy Protests][1]. The MSS releases Covid19 at the peak of the protests (actually they do pick Wuhan so they can use lab leak as a plausibility if needed) in Sep 2019 and later they use the lockdown laws to completely clamp down the protests.

[1] https://en.wikipedia.org/wiki/2019%E2%80%932020_Hong_Kong_pr...

Most likely he realized once the authorities have his name - he can't run forever.

That being said - some obvious stuff he could have done like grow a beard and shave it after and fly out of the country to somewhere cheap like Thailand with $10k

The X-Y Problem 4 years ago

Why not respond with both X and Y? e.g. for the last 3 character thing, here would be an appropriate response:

To get the last 3 characters, do `echo ${foo: -3}`. Are you trying to get the file extension though? What if the extension is not 3 characters e.g. `foo.jpeg`? You then want to do `${foo##*.}`

When I first read Monty Hall problem, I actually thought it was blindingly obvious to switch. The fact the presenter had 2 doors to chose from and the one he opens is a goat _should_ increase the chance of the other one being not(goat) right?

My quick and dirty tl;dr: https://gist.github.com/pathikrit/a7845f72645159646fdb632bc3...

Let C<A> be a higher-kinded type e.g. in List<Animal>, List is C and Animal is A.

Let S be a subtype of T e.g. in class Cat extends Animal, Cat is S and Animal is T

If C<S> is a subtype of C<T>, then C is covaraint on T e.g. List<Cat> is a subtype of List<Animal>

If C<T> is a subtype of C<S>, then C is contravariant on T e.g. Predicate<Animal> is a subtype of Predicate<Cat>

If neither C<T> and nor C<S> are subtypes of the other, thenC is invariant on T

Basically in a social graph, you are more likely to be in the edge (because there are more vertices in the edge) than in the center (visualize how in a balanced binary tree there are more leaf nodes than inner vertices).

OP here. Sorry for the code-golfy post on HN. But, some clarifications:

1. Yes, it is O(n!) - it says so in the description but not on the title of the post on HN.

2. It is 4 lines of code for `nQueen` function. I did not include the printing code in the line count.

3. And no, I did not cheat by using semicolons in same lines - these are 4 legit lines IMO. You can put the `&` clause in 1 line to reduce it further.