HNHacker News
TopNewBestAskShowJobs

kkdaemas

397 karma · joined March 6, 2020

submissionscomments
kkdaemas··on Tell HN: We are trying to get tail calls into the WebAssembly standard
Surely it's easier to stick to JavaScript The Good Parts than to introduce a whole new layer in the form of Blazor?
kkdaemas··on I cheated on my Microsoft interview (2019)
The question is very unrealistic... how often do you know there is exactly one duplicate in a list?

Much more common is there are zero or more duplicates.

Here is what I came up with:

- We need a way to record what has been already seen

- A hash-map could work, but I think we can be more efficient

- We know that all elements are less than the array length in size...

- So we can allocate a single array of flags with the same length as the input

- The flag for value `n` is at position `n` in this array

    let findDuplicates xs =
      let seen = Array.create (Seq.length xs) false

      let mutable duplicates = []

      for x in xs do
        if seen[x] then
          duplicates <- x :: duplicates
        else
          seen[x] <- true

      duplicates
I'm pretty sure this is O(n)?

I think it's interesting that the mathematical trick (sum of numbers 1 to n formula) does not work in the more realistic variant. This fact is probably why leet-code problems are so disconnected from the real world. It's like AI for board-games.

kkdaemas··on Bob Cassette Rewinder: Hacking Detergent DRM
This is true cyberpunk.
kkdaemas··on Terraform should have remained stateless
No because the metadata on the deleted resource is now lost.

With the information being stored outside the resource, we know that it was deleted and the metadata about it.

kkdaemas··on When buying the dip doesn’t work: An analysis of the dot-com crash
This strategy would miss some huge and unexpected gains. Tesla comes to mind (at least for the time being...)
kkdaemas··on GraphQL Is a Trap?
It's not that GraphQL enables anything that was not possible before; it's that GraphQL provides a bit more structure and standardization around these things. If you plan to do this stuff, why not follow something with a spec and various bits of tooling rather than doing it ad-hoc?
kkdaemas··on The money I saved as a child would buy one picogram of gold today
The problem is Bitcoin Core may have (will have) unknown vulnerabilities and those might not get patched correctly once discovered.
kkdaemas··on Why Compilers Don’t Autocorrect “Obvious” Parse Errors
That can be desirable but there are a few challenges:

- The compiler code becomes more complicated, making correctness harder

- The compiler might become slower to run

- Introducing new languages features may become harder, again due to code complexity

kkdaemas··on New EU data blockage as German court would ban many cookie management providers
Websites will get updated pretty damn fast if everyone has them disabled.
kkdaemas··on New EU data blockage as German court would ban many cookie management providers
Here's an idea for the EU: mandate that all major browsers ship with third-party cookies disabled by default and drop the whole cookie-banner nonsense.
kkdaemas··on Bullets: Sizes, Calibers, and Types (2020)
Wait, it's not about game development??
kkdaemas··on Supply Chain Shortages Continue Around the World. Get Used to It
A significant burden is actually the lack of regulatory alignment. Before Brexit there was a largely customs-check free flow of goods in and out of the EU. Now we have more delays and paperwork. This is not a tariff, but it imposes costs like one.
kkdaemas··on Is Hacker News a good predictor of future tech trends?
In case of NFTs these were called "Colored Coins" much earlier.
kkdaemas··on “Great resignation” wave coming for companies
So... they double-down on a poor proxy of effectiveness on the job?
kkdaemas··on Ask HN: Predictions for 2021?
We won't really know until the election, but for what it's worth opinion polls have Johnson down compared to when he started his term.
kkdaemas··on Ask HN: Predictions for 2021?
Interesting that you came to this view. Boris seems to have handled COVID incredibly poorly (e.g. the death rate in the UK is higher than comparable countries) and the trade deal is considerably worse than deals he previously rejected (e.g. customs border inside the UK). I expect that once the world stabilizes again, members of his own party will want to take his job.
kkdaemas··on Ask HN: Predictions for 2021?
Doubtful, the UK would suffer greatly from reduced demand for their goods and services.
kkdaemas··on UK and EU agree Brexit trade deal
The UK still needs to follow EU rules to trade there, but now has no say in those rules.
kkdaemas··on How bad is your Spotify?
Please, please make this work without Spotify (e.g. type in a few favorite albums from Musicbrainz or something)
kkdaemas··on iPhone factory workers say they haven’t been paid, cause millions in damages
I think what the poster means is that the workers had so little trust in the legal system that they did not bother pursing this is court. Instead, they tried to create a media narrative to get Apple to pay attention.
kkdaemas··on Winamp for Windows 10
Anyone remember Songbird?
kkdaemas··on Show HN: You had a productive day, until now
Not a very original concept. They use these puzzles for child intelligence tests. Are the puzzles automatically generated?

What would be hilarious (imo) would be if the 100th puzzle is actually unsolvable.

kkdaemas··on Admitting That Functional Programming Can Be Awkward (2007)
Order of execution bugs rarely come up in game programming to be honest.
kkdaemas··on Does C++ still deserve a bad rap?
> implementing the hard things on C or C++

This misses the point. I don't care how the language implements the functionality if it meets my performance requirements and it is convenient to use.

kkdaemas··on The Downs–Thomson Paradox
With coronavirus restrictions forcing cities to rethink their infrastructure, more people should be aware of this paradox.
kkdaemas··on Show HN: Use-sound, a React hook for sound effects on the web
When all you have is a hammer...
kkdaemas··on It's not what programming languages do, it's what they shepherd you to
This is also why CMake, even Modern CMake, is so bad. You have to fight tooth and nail for something even remotely maintainable.
kkdaemas··on Pangolins found to carry viruses related to Covid-19
This wouldn't work. It's like diamonds, the value is in the rarity.
kkdaemas··on Using the Specification Pattern to Build a Data-Driven Rules Engine
Any other ML programmers look at this and see a very verbose discriminated union?
kkdaemas··on Don’t bail out the cruise industry
This is a very short sighted view. Police forces cannot maintain order in the event of massive unrest and the best way to prevent this is to keep people above the poverty line and the death rates low. Desperation leads to upheaval.
Page 1 of 2Next →