HNHacker News
TopNewBestAskShowJobs

hknmtt

352 karma · joined September 5, 2022

submissionscomments
hknmtt··on Firefox built-in spyware that cannot be disabled
yes, ff does a ton of background connections. use wireshark to see what it is doing. i tried to block all that crap once but after a while i just gave up.

it is still my primary browser because it is now the only alternative to google's monopoly(even though mozilla is de facto living off of google's money).

hknmtt··on From slow to SIMD: A Go optimization story
a) why not use switch { case len(a) < len(b): b = b[:len(a)] case len(b) < len(a): a = a[:len(b)] }

b) do you know the usual length of the slices? if so, can't you autogenerate/manually write switch to manually do the math? how would that perform?

hknmtt··on Scrum Sucks
Scrum/Agile is awesome! I always used the daily calls to ask as much dumb shit as possible to make the meetings as long as i could so i could keep charging my hourly rate without actually working.
hknmtt··on Microsoft suggests command line fiddling to get Windows 10 update installed
No, i just remember a comment from some former MS dev who knew something about the testing process in MS. I think it might have even been a comment in here actually.
hknmtt··on YouTube is loading slower for users with ad blockers yet again
interesting. i was actually yesterday pondering whether youtube gave up on this since i have not had issues for months now. before i had to scrape all cache and logout. usually once a week. but then it stopped and all went back to normal. i am using ubo, still.
hknmtt··on Microsoft suggests command line fiddling to get Windows 10 update installed
i remember reading years ago about the reason windows updates since 8 or 10 were so bad was because MS fired all testers and scrapped their testing hardware and now they are testing virtually in cloud. I guess nothing has changed, still. cost cutting at its best.
hknmtt··on The One Billion Row Challenge
essentially that is how integrals are calculated in mathematics if i remember correctly. you take a curve and divide it into columns, the thinner the column the smaller the deviation(because the curve has round edges so your bar will have inherent error) and you simply calculate each column and then total it and you get the body/volume of the function. same principle like radians with circle. you are merely splitting the work into smaller pieces that you can process.
hknmtt··on The One Billion Row Challenge
say you load 1 million records and you average them at 5.1. you then load another million and average them at 4.5. so you 5.1+4.5=9.6/2=4.8. rinse and repeat. as long as you keep the amount of records processed per each run about the same, your numbers will not be skewed. only the last chunk will most likely be smaller and it will introduce small rounding error, like if it has only 10k records instead of 1M. but still it is the simplest solution with good enough outcome.
hknmtt··on The One Billion Row Challenge
actually i think you can also just average each chunk and then add it to existing data. like read N rows(say all have one location to keep it simple), average the data from the chunk, update/save min and max, move on to next chunk, do the same but now update the average by adding to existing/previously computed average and divide by two. the result will be the same - disk IO will be the most limiting aspect. this "challenge" is not really a challenge. there is nothing complicated about it. it just seems "cool" when you say "process 1 billion rows the fastest you can".
hknmtt··on The One Billion Row Challenge
first search result for averaging streaming data:

https://nestedsoftware.com/2018/03/20/calculating-a-moving-a...

so you just walk the file and read a chunk, update the averages and move on. the resource usage should be 0.000 nothing and speed should be limited by your disk IO.

hknmtt··on Sieve is simpler than LRU
>On a cache hit, SIEVE marks the object as visited. On a cache miss, SIEVE checks the object pointed to by the hand. If the object has been visited, its visited bit is reset, and the hand moves to the next position, keeping the retained object in its original position in the queue. This continues until an unvisited object is found and evicted. After eviction, the hand moves to the next position.

Dude, what?

hknmtt··on E621, Pornhub, and others block North Carolina residents
> Officials explained that companies will be able to use commercially available databases to verify that users are old enough to access their content. The new law will take effect starting January 1st.

ಠ_ಠ

hknmtt··on Spotify starts divesting from France in response to new music-streaming tax
looks like the increased cost is not worth the profit. simple mathematics. capitalism is nature and you cannot fight the nature because sooner or later something gives.
hknmtt··on I Reviewed 1,000s of Opinions on gRPC
I used to use it a lot but in time it becomes more of an obstacle than a net positive. http and websockets with json(front end), cbor(back end) or pb(back end) is the way to go. it gives you exactly the same features but zero restrictions. it is nice to have pb schema that is transferable into other languages but you can define schema in anything and port it to anything, it just takes time to initially write it instead of using pb as intermediary. the little layers of code it autogenerates is not worth the limitations you might be needing to overcome in the future with a larger project. also there is massive issue with no value provided vs null or empty or zero value. pb tries to solve this by using wrappers but in code that is massive pain to work with all the nesting. that was actually what broke the camel's back for me.

i just want to mention that i do not use rest, at all. i do use http methods and url routes but i never accept any rest rules for design or behavior. i am using something like json rpc but i am not using a single route to handle all communication. i still use the same approach as grpc does - route per method, but i keep the flexibility of naming and http methods. people seem to be very much stuck with rest and its limitations/rules for some weird reason.

hknmtt··on T-Mobile introduce fines from Jan 1 for "Code of Conduct" violations
"if you do something illegal, WE will fine you" ... yeah, that makes perfect sense.
hknmtt··on T-Mobile introduce fines from Jan 1 for "Code of Conduct" violations
> Tier 2: $1,000, for illegal content

strange legal system you got there

hknmtt··on Otter, Fastest Go in-memory cache based on S3-FIFO algorithm
> TTL doesn’t say anything about eviction among objects that are still live, no?

TTL IS eviction policy. You just store a timestamp along the value. When you access it, you check the timestamp and if it is stale, you delete it and return not found error(or whatever not found should return). And you have a simple bg worker that scans the cache periodically and deletes these stale entries to free up the memory.

This is the basis for all caches. You can add cost on top of this as yet another eviction policy but that only adds another worker to scan the cache for items to purge and you have to store the cost along with the entry so you are increasing the each entry by at least 4 bytes, if we're talking uint32. Not to mention that for this eviction policy, you need sorted cache because you need to know where the cut off for cost is.

Walking the entire cache to purge expired TTL entries is one thing, but keeping ordered cache is a whole another thing.

hknmtt··on Otter, Fastest Go in-memory cache based on S3-FIFO algorithm
I never understood this cost nonsense. TTL is the only thing that makes any sense to me. And implementation is trivial. All these caches are just a map underneath anyway, pointing to some data somewhere in memory. That's about it. Not much else to it.
hknmtt··on How big is YouTube?
As a user, for me, YouTube has been shrinking ever since the first adpocalypse. By that I mean I rarely see new videos or relevant recommendations. It is all stale content and pages only couple of pages instead of going infinite like it used to. My most visited page is home page which shows recommended content(it used to be on a dedicated page) and I literally see the same content for days, rarely with new videos. And I have hundreds of subscribed channels. Youtube is a living corpse, I do not care what numbers they put out in the public.
hknmtt··on I spent a year building an app and failed – The story of Taskwer
Ive done many projects in my life, none took off. I've got my first computer in 96 and been online around 2001. So I think i have seen the internet evolve for the past two decades. And what I have been observing ever since we left the 2010s is the rise of monopolization. The 2010s were magical years. Internet was amazing place where you could find a lot of things, communities, people... you could have made anything and you had good odds of attracting people and making it work. For profit or for fun. But ever since we left those golden year, it no longer is about the idea, or even execution. Now it is solely about how much money you can spend on advertising. The internet is too noisy and too monopolized. All meaningful services are owned by big tech. They either compete with you directly or they own services you will have to use(cloud, maps, translations...) so they will make money off of one anyway. And if you hit a unicorn status, they will give you the led or gold offer(they buy you out or make a competing service and bury you business in no time) so you are f'd one way or another, unless you have a ton of cash backing you up and even then you have hard fight against you. And it will only get worse. So good luck to all.
hknmtt··on How to unit test code that depends on time
In Go, I would normally have my own time function which would return the std lib time function, which works flawlessly for testing my own code. The problem is if there is foreign code(ie. 3rd library dependency) that uses time and which makes obviously calls to the std library time, making it untestable. The only solution is to overwrite time on language level by some trickery(not all languages allow this) or literally change the OS's clock and test manually one test at a time. This is one of those unsolved programming issues.
hknmtt··on An Empirical Study and Evaluation of Modern CAPTCHAs
no need for captchas, just implement throttling per ip. like bcrypt dues for passwords. if a bot fills up a form(or whatever), so be it, but it won't be able to do it for another N seconds or minutes..so the problem then is lowered from per try, which can be thousands of submissions, all the way down to per period and per ip.
hknmtt··on YouTube is crippling Firefox on Asahi Linux?
I remember youtube being shady with firefox for ages. I think there was some kind of famous div being injected into firefox responses that caused some issues. Fuck google.
hknmtt··on Go Testing by Example [video]
I do like Go tests. Would love to have ability to find out untested parts of the code base though to increase coverage, but I do not think there is a way to measure this with available tools just yet.

Although I have yet to make integration tests that require live database and other dependencies. That will be fun...

Anyway, my main gripe with tests or TDD is that even if the code base is 95% finished, not talking libraries here, even small code changes can cause a cascade of changes that need to be addressed and tests essentially multiply the work load by a factor of 10, easy. And I am not talking about big changes. It might be a simple addition of a new struct field which suddenly breaks half of your test suite. Hence teste should be, in my experience, written as the absolutely last step before going live. Otherwise they might impose massive costs on time, and potentially money(if we're talking actual business and not one man shot type of project).

hknmtt··on Ask HN: What side projects landed you a job?
All of them. But it's not what you think. The experience I gained by working on them simply increased my confidence and THAT always got me a job. To the point where I reached fuck it level and never got stressed out by a work. I set my red lines and that was that. I ended up working the best job I ever had, until I quit working altogether to live off of my investments. Mind you I have worked a full time job only one year in my whole life.
hknmtt··on Some observations on the final text of the European Digital Identity framework
historically, whatever a government gets involved in usually works out amazingly well. right?
hknmtt··on Mistakes in the Design of CSS (2013)
The biggest fuckup of CSS, to this day, is lack of vertical centering of content.
hknmtt··on Ask HN: What are you reading these days?
I forgot I also have all the sherlock holmes novels/shorts so i want to read them all.
hknmtt··on Ask HN: What are you reading these days?
Magicians of The Gods by Graham Hancock. But I will not finish it. It is boring and long-winded and he's more a travel journalist than researcher or scholar, so no real breakthroughs and a sprinkle of Daniken-like sensationalism while stretching the facts quite a bit. But what killed the book for me eventually was his unfounded attack on Sitchin. The previous book I read from him was Fingerprints of The Gods, that one was better but still had similar issues.

I would like to finish reading Hitler's Mein Kampf. I had it for years, started it twice but never finished it. I have no other books to read so I think this will be my next.

hknmtt··on Ko: Easy Go Containers
I have used something like this in the past:

FROM alpine:latest AS base # Scratch does not have shell so we have to create non-root user in here and later copy it into scratch. RUN adduser -D -u 123456 appusr

FROM scratch # Copy the binary. COPY foo.bin /foo.bin # Copy the user and set is as active. COPY --from=base /etc/passwd /etc/passwd USER appusr # Non-root user cannot bind to "privileged" ports(<=1024). EXPOSE 1234 ENTRYPOINT ["/foo.bin"]

Simple. But i can see ko being good alternative if you for some reason do not want to install docker on your computer but still be able to build docker containers.

Page 1 of 9Next →