News for hackers. Stuff that matters.

hknmtt

the censorship is strong with this one. no wonder, this website is run by commiefornians who love nothing more than to impose their opinions on others but never consider others as also having their own. also, they love shitting on the streets so yeah.

Ask HN: How was setting up EU VAT for you?

If you have set up an EU VAT for your non-EU company, how was the process?I am in the EU and I am mainly interested about the process for outsiders, since I'd like to be able to explain it to potential business partners in the future.

( Read More... | 1 comment | on HN )
Re:Firefox built-in spyware that cannot be disabled on Sunday January 28, 2024 @12:04PM (#39167590)
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).

Re:From slow to SIMD: A Go optimization story on Wednesday January 24, 2024 @06:34AM (#39116114)
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?

Re:Scrum Sucks on Monday January 15, 2024 @12:10PM (#39003235)
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.
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.
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.
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.

Ask HN: How to Count Content Views?

Say I have a website that has articles, video and audio content.How should I determine how to count a content view?For text, is it a mere visit? What about multimedia, should there be some threshold of watched/listened length before a view is counted?How about repeated visits? Should they count the same or should there be a window where multiple views are counted as one?What if user keeps...

( Read More... | no comments | on HN )
Re:The One Billion Row Challenge on Thursday January 04, 2024 @02:55PM (#38871446)
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.
Re:The One Billion Row Challenge on Thursday January 04, 2024 @09:26AM (#38867360)
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.
Re:The One Billion Row Challenge on Thursday January 04, 2024 @04:49AM (#38865116)
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".
Re:The One Billion Row Challenge on Thursday January 04, 2024 @04:01AM (#38864743)
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.

Re:Sieve is simpler than LRU on Wednesday January 03, 2024 @02:38AM (#38851663)
>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?

Re:E621, Pornhub, and others block North Carolina residents on Monday January 01, 2024 @09:40PM (#38837442)
> 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.

ಠ_ಠ

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.
Re:I Reviewed 1,000s of Opinions on gRPC on Tuesday December 26, 2023 @01:13AM (#38769303)
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.

"if you do something illegal, WE will fine you" ... yeah, that makes perfect sense.
> Tier 2: $1,000, for illegal content

strange legal system you got there

Ask HN: Why sign in/out replaced log in/out?

I've been online for over two decades now and I have noticed that the usual "log in", "log out" has been slowly replaced by "sign in" and "sign out" in the past half a decade.Also "sign up" has replaced "register" and "create account".Does anybody know why?

( Read More... | 13 comments | 6 points | on HN )
Re:Otter, Fastest Go in-memory cache based on S3-FIFO algorithm on Saturday December 23, 2023 @11:19PM (#38751072)
> 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.

Re:Otter, Fastest Go in-memory cache based on S3-FIFO algorithm on Saturday December 23, 2023 @08:48PM (#38750293)
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.
Re:How Big Is YouTube? on Saturday December 23, 2023 @04:26AM (#38742849)
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.
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.
Re:About time: how to unit test code that depends on time on Wednesday December 20, 2023 @05:00AM (#38707016)
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.
Re:AI bots are now outperforming humans in solving CAPTCHAs on Sunday December 17, 2023 @03:34AM (#38671296)
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.
Re:YouTube is crippling Firefox on Asahi Linux on Tuesday December 12, 2023 @09:01AM (#38612149)
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.
Re:Russ Cox: Go Testing by Example on Wednesday December 06, 2023 @03:31AM (#38541652)
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).

Re:Ask HN: What side projects landed you a job? on Monday December 04, 2023 @03:57AM (#38515115)
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.
historically, whatever a government gets involved in usually works out amazingly well. right?

Older »