News for hackers. Stuff that matters.

ArrayBoundCheck

Re:Finding the “second bug” in glibc’s condition variable on Monday September 19, 2022 @12:29AM (#32894297)
That's not true at all. I wrote a simple set of threading functions and had 0 deadlocks no matter what I do to it. On youtube I watched a guy write out every possible state of his data structure for hashmap. It's implemented using atomics. It preformed pretty well according to the person and it also did not deadlock after being used in production for years
Re:Ask HN: Can I avoid being nuked by Stripe? on Thursday September 15, 2022 @02:58PM (#32856863)
I saw once a guy suggested to contact stripe for an account manager. I don't think he was very specific and I'm not sure if you can simply create a ticket or email them but I think that is a good step
Re:Escaping strings faster with AVX-512 on Thursday September 15, 2022 @12:08PM (#32854150)
Yeah I know, I'm saying only Daniel (and Carmack) can pull of titles like that without people thinking they're not telling the whole truth. I still remember john's tweet "I can send an IP packet to Europe faster than I can send a pixel to the screen. How f’d up is that?". A nerd said "Either he's crazy or this is an unusual situation" it was neither Carmack followed it up with https://superuser.com/a/419167
Re:Escaping strings faster with AVX-512 on Wednesday September 14, 2022 @07:58PM (#32845157)
I didn't care about speed. I was merely saying the waiting on I/O is false and didn't want to go as far as saying it hasn't been true for 15+ years
Re:Escaping strings faster with AVX-512 on Wednesday September 14, 2022 @07:57PM (#32845143)
Yep. I think the fastest nvme's were a tad above 3gb and network IO is certainly faster. It always irks me when something stop being true 15-20years ago is cited today
Re:Escaping strings faster with AVX-512 on Wednesday September 14, 2022 @07:03PM (#32844650)
Parsing JSON takes more time than IO
Re:Escaping strings faster with AVX-512 on Wednesday September 14, 2022 @06:58PM (#32844609)
The internet is so bad that when I see titles like these I know the article will not be true at all. The great thing is I can see lemire next to the title and I absolutely know not only did he walk the walk but he can write about it in an understandable way. I upvoted before reading and I haven't yet been disappointed. -Edit- Done, it's nice and short and I want to reread the code example. I'm not familiar enough with avx512
Re:A pair of Linux kernel modules using Rust on Tuesday September 13, 2022 @08:36PM (#32831897)
The fact that writing unsafe rust code is harder than unsafe C due to more rules? The fact that Rust has little support of nostdlib which is what the kernel is using? There's also the fact that most of the time in drivers (in my limited experience) you almost always want unsafe things but I assumed noone would think or admit that one
Re:Software component names should be whimsical and cryptic on Tuesday September 13, 2022 @04:39PM (#32829903)
What an awful article. I wish I can downvote
Re:A pair of Linux kernel modules using Rust on Tuesday September 13, 2022 @02:10PM (#32828124)
So one person said creating the rust interface is very difficult to do correctly and the other said rust bare metal isn't complete enough for his use case

I called both of these (and compile times) when people first tried to get rust on the linux kernel. Maybe it's better to acknowledge these problems before you start instead of beating your head? I'm no psychic and I know I wasn't the only one who called these

Re:Ladybird: A new cross-platform browser project on Monday September 12, 2022 @06:12PM (#32817745)
When it comes to common knowledge in programming it's more often incorrect. I still see people telling experts they shouldn't use global variables, that you can't beat the optimizer, that you should use a library (for something as trivial as left pad) etc
Re:Ladybird: A new cross-platform browser project on Monday September 12, 2022 @01:00PM (#32813163)
What does noone can dictate mean?

Google dictates it and I've ran into many many sites that doesn't function with firefox or anything other than chrome

Re:The Next Chapter for Learning on YouTube on Saturday September 10, 2022 @12:27AM (#32787796)
Why do I feel like I'll still be asked to like and subscribe?

I'm not interested in youtube cloning good resources we already have only for it to be sunset or charge a bunch. Like when people got upset about the firebase and map price hike

Re:Zig, the Small Language on Wednesday September 07, 2022 @06:02PM (#32757610)
That was my problem with it. That and being mildly annoyed the creator hates tabs
Re:Zig, the Small Language on Wednesday September 07, 2022 @06:00PM (#32757594)
Despite what students who never programmed professionally say, memory isn't a problem to a significant amount of C and C++ developers. I think it's been a year since I last access an invalid pointer and that only happened because I forgot that I am not suppose to add elements to array in a `for (auto var : array)` loop. It use to be a for index loop and it didn't take long to figure out the change broke something
Re:Zig, the Small Language on Wednesday September 07, 2022 @05:56PM (#32757550)
> systems programming language that is not safe?

It sounds like you're saying rust because I don't know what other languages claim both.

Rust is an awful language. That's why. If you're using a systems programming language then chances are unsafeness isn't the problem you're most concerned with

Re:Ask HN: Seriously, how do you TDD? on Sunday September 04, 2022 @12:05PM (#32714450)
First you need to be experienced enough to know what not to do. Like that you shouldn't write mocks, shouldn't test private functions, shouldn't use a ton of global or static vars etc

Then you should find some sort of coverage tool so you can know if you covered most lines or not. I tend to ignore error handling lines but if its easy to get into that case I'll writ a test for it. Then I'll write test that take <1ms to execute. If something needs a network I'll try to separate the logic so it can work on a file OR I'll it connect to something on my local machine.

Generally I try to get 95%+ coverage (including error cases). I have many test and the entire suite run in <100ms. Maybe my project is easier to do TDD on but that's the way I do it

Re:Japan declares war on floppy disks for government use on Friday September 02, 2022 @09:20PM (#32697602)
USBs usually have a CPU inside that sits between the storage and PC. This way the PC doesn't need to know a thing about the storage and the CPU can do whatever it needs to implement the USB protocol. However the CPU can be malicious and modify files

Ask HN: How do you read/look at screens?

I program a lot. After a few hours I can't easily read whats on the screen due to my eyes being uncomfortable. Sometimes I can look at my phone or read my kindle but even that can be a problem. I've gone on walks listening to books which I think is a partial solution but some days I only can do 4 hours of screen times while other days I do 9

( Read More... | 5 comments | 2 points | on HN )
Re:Making Wrong Code Look Wrong (2005) on Friday September 02, 2022 @04:00PM (#32695131)
But exceptions do invoke dread in me. Sometimes a goto (or 11) will skip an array bounds check. - This comment is mostly a joke, look at our names. But I did see this happen at least once
Re:Crystal Programming Language on Thursday September 01, 2022 @10:05PM (#32685771)
I clicked on 7+ pages. I still can not find how to use an array
Re:Cloudflare's abuse policies and approach on Wednesday August 31, 2022 @03:55PM (#32667480)
I don't want to live in a world where someone else makes the world a better place better than we do - Gavin B
Re:Slack’s free plan change is causing an exodus on Friday August 26, 2022 @08:46PM (#32614432)
Boo hoo. Either use open source of pay for the service. It's bizarre that people think everything should be free and spoonfed to them
While hiring I've done a 15min test before an interview (always looking through their portfolio first) that took some candidates 30-45mins. If they fail or took longer than 45mins it ends there. I then do a 30min interview that sometimes take 45min if they talk a lot or ask me questions about the company

How does this sound? I have no idea if this is ideal but so far we didn't hire any more bad candidates than we did using a different process

What about a take home test that should take 15min or less? Something not as simple as fizzbuzz but still takes < 15 lines of code?
Re:DuckDuckGo email protection beta now open on Thursday August 25, 2022 @02:27PM (#32597938)
The fact that this exist shows open source is bad. We should have had an alternative to email by now
Re:Vietnam to make Apple Watch and MacBook on Wednesday August 17, 2022 @04:58PM (#32501641)
I wonder what Gavin Belson is up to. I'm thinking about the episode where Gavin opens up a plant in goldbriar north carolina (Not a real place)
Re:.NET 6 is now in Ubuntu 22.04 on Tuesday August 16, 2022 @10:55AM (#32483589)
I use a VPS. The strange thing is one site never drops a connection and another one does. I'm not sure if its the physical location or my config but one of the two instance works very well. Its a $5 VPS too
Does it send me notifications? Is it called NipAlert2? Is professor bighetti a collaborator?
Some days I wish I could go without a phone number and have all my communications through an open protocol

Older »