AboutC hacken ist Krieg!
SkillsC, assembly, embedded, electronics
Joined devRant on 5/26/2018
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
I did it - I went outside! Felt strange, like Y2K and Maya doomsday would have been together. Of course I went out only during daylight because THEY hide in the dark. Infrastructure was mostly still intact, I've even seen some houses. Occasionally, survivors scrambling the area.
GPS didn't work so I used my magnetic compass. OK, it was because I forgot my mobile at home, but anyway. Should I take petrol with me so that I could burn my clothing upon return? Or would this attract THEM? Occasional gunfire in the distance. Might also be some pneumatic hammer, that's what the media would try to tell me.
The local supermarket had still trolleys outside. I took note because I might need them to bar the stairwell, along with the land mines that I still have left over from New Year's Eve.
Deserted cars standing around. Looked like neatly parked, but that doesn't mean anything. When Germans turn into zombies, their last human action is to park their cars. That's so genetically hardwired that no virus can override it.
Dusk set in. I better returned home.18
Meeting with American customers in Germany. One of them fetched a bottle of water with crown cap, but the opener was missing. She asked whether someone had an opener, so I got out a lighter and opened the bottle. Surprised looks.
My (Indian) PM: "That's a German thing, opening bottles with everything except bottle openers. Even with other bottles."
Customers were like, WTF?!15
The tons of undefined behaviour in C that ought to have been implementation defined instead, and increasingly sadistic compiler writers on the other side.
Like signed integer overflow that should just do what the underlying machine does, i.e. in practice, wrap around two's complement.
But the wierdest UB is when a C source code line has a non-matching ' or ". WTF, this should have been a compile time error!4
Dialogue when I entered the room of a co-worker, and it wasn't an individual office.
Me: YO MAMA her son bitching 'bout compiler licence?
Him: Kiss my ass!
Me: Could cram a wet roll of toilet paper down your pants.
Him: Yeah that'd come pretty close.
Other co-workers: WTF?12
I'm starting to hate 2020. Back pain because of muscle strain, ongoing middle ear inflammation, and now a tooth crown has broken off. Fuck this shit.12
Uh-oh shit went wrong with umpteen thousand jobs in a pointer heavy, multi-threaded application in raw C. Fuck, some pointer gone wild?!
30 minutes later, after trying to find out how many jobs it takes to start failing. Noticed that it's about the default settings. Wait what? That's where the realloc'ing should kick in, check that.
Aahhhh. Maybe I shouldn't zero the whole buffer after realloc, just the new part. D'uh!
There's an interesting species out there, the skiplings. They are small, furry beasts, and usually go unseen because they live underground. When there's trembling action however, they leave their burrows to check out what's going on, typically while sitting up.
The rarest breed has the distinct habit of appearing quickly, and once things are observed to be calm, slowly return underground. They are mildly social in that several of them can inhabitate an area, but each has its own little den for sleeping.
Unfortunately, skiplings are a rare species so that they are protected under WCAG 2.1 section 2.4.1 at maximum criticality level A.3
Arrrrrry new year, you bloody pirates!
For those few of us still running fully static sites: remember to update the year constant, re-compile and upload.4
So that's where the W3C ivory tower clique ended up this year, as rubberstamping secretary for the WHATWG: https://w3.org/blog/2019/...
Well at least, the W3C got the grounding they clearly were lacking over many years!
Recap: the W3C went totally out of touch with reality and wanted an HTML incompatible successor that neither browser vendors nor web authors were interested in. They wasted years on XHTML and drafted specs into the void.
15 years ago, Mozilla and Opera said "fuck this shit" and founded the WHATWG which would work on HTML5. Apple and Google joined in later.
And now the W3C does ground-breaking work like providing the recommendation texts in different formatting, LOL!10
Google: hey website owner, use link rel preload for images loaded by CSS to reduce roundtrip delays. Chrome supports that, Safari also, and even Edge does.
Mozilla: we had some bug with preload back in FF 57 and our solution since has just been to disable preload per default. Done. Who would care about loading speed?
Also Mozilla: we have no idea why our market share has been plunging. Google is evil.9
At a festival where I was with my GF from back then, I asked her whether it was OK if I drank some more, which she was fine with, but she didn't get the implication.
Later in the tent, when I was totally drunken, she turned me around and wanted some action. The sudden movement didn't go well, I was just able to open the tent, vomited out of the tent, and turned around to continue sleeping.6
Gna gna gna Chrome you stupid sucker!
I have some objects that I animate using JS triggered CSS translate with a transition duration. Why on earth would Chrome think it's a good idea to apply that duration also after the animation when I zoom the whole page?!
OK, slap a transition end handler on the object and reset the transition duration when the animation is done. But FF doesn't have that problem in the first place, and even IE works as intended!5
Today in the office, a co-worker and me had a synchronised rant. Both sitting at each our desks, and independently of each other, he suddenly cursed "I hate text fields" while I burst out "network, piece of shit!"
So, Terminator : Dark Fate was in the cinema. Not as good as I had expected, and Hollywood's contemporary in-your-face leftist propaganda made it even weaker.17
Attack is the best defence! I read my emails in the morning and figure out whether there's some action for me. When I go and get my second coffee, I drop by the PM's office and have a short chat with him.
Where I am in the projects, whether there's stuff from other tasks or unexpected actions, how long that might take, whether schedules are still OK, whether I need him to take care of some customer communication, these things. Usually less than 5 minutes.
The kicker is that he mostly doesn't interrupt me because I instead interrupt him - unless he is highly busy, in which case he just says "sorry, later", same as I would do.
It's a win-win because I can schedule the interruptions while he enjoys that he doesn't have to ask around.7
Me: You're looking rested - the vacation does you good, it seems.
Co-worker: I didn't have vacation?!
Me: but our PM does.
I want to stop charging my e-scooter at around 85% because this will increase the battery life. To avoid always having to pull the plug at the right level, I made a stop circuit that goes between charging brick and e-scooter.
There's no processor involved, just a CMOS 555 used as inverting Schmitt Trigger which controls a power mosfet. Also two status LEDs and a start switch. The poti adjusts the cut-off level. Worked on first try, with only manual voltage and tolerance calculations beforehand!31
*LOL* The animal rights organisation PETA criticises the use of donkeys in the traditional Passion play in Oberammergau, Bavaria, Germany. PETA claims that Jesus would ride into Jerusalem on an e-scooter.
Have you always been missing ads in CLI applications? Have you been wondering how to bring such modern browsing experience to CLI? NPM has solved this problem, it has CLI ads now!
However, the are already people who spoil this great new experience with CLI ad blockers:
Yeah, my new e-scooter arrived today! I just have to get the insurance sticker that is legally required here; I'll do that on Monday.3
Toilets and race conditions!
A co-worker asked me what issues multi-threading and shared memory can have. So I explained him that stuff with the lock. He wasn't quite sure whether he got it.
Me: imagine you go to the toilet. You check whether there's enough toilet paper in the stall, and it is. BUT now someone else comes in, does business and uses up all paper. CPUs can do shit very fast, can't they? Yeah and now you're sitting on the bowl, and BAMM out of paper. This wouldn't have happened if you had locked the stall, right?
Him: yeah. And with a single thread?
Me: well if you're alone at home in your appartment, there's no reason to lock the door because there's nobody to interfere.
Him: ah, I see. And if I have two threads, but no shared memory, then it is as if my wife and me are at home with each a toilet of our own, then we don't need to lock either.
Ah well, it's double out of fashion because smoking is on the black list of the health maniacs, and nobody smokes pipes anyway. BUT! filling a pipe and smoking it for easily half an hour is quite some pleasure!74
Meeting with a co-worker who is supposed to do a code analysis on a large legacy project. Actually, HER project - she inherited it already years ago, and the original devs aren't in the company anymore.
Her: customer is asking this and that analysis.
Me: easily two weeks.
Her: but who will do that?
Me: you of course.
Her: but I don't know most of the code.
Me: me neither.
Her: and I don't know the protocols.
Me: google them. I'd have to do the same.
Really, I told her to google shit, which I consider as quite a slap for a co-worker. Basically, she tried to offload a complex analysis because she just wants the low effort parts of the job.
Won't happen. DO YOUR FUCKING JOB!14
Talk with a co-worker who has a bit of a motivational problem.
Him: if I had more fun, I would be more productive.
Me: you're not here for fun, that's why they pay us.
Him: how are you motivated?
Me: by money.
A bit later.
Him: do you plan for retirement some day?
Me: no. By then, there won't be retirement anymore. We will eat fried rats in the street.
He starts understanding why I'm wearing black metal shirts.10
Yeaaahhh that moment when the program flawlessly crunches through ten thousands of files, only limited by the slowish HDD! :-)
In full multi-threading, tons of dynamic buffer resizing, pointer shit left and right, also two star programming, and everything written in raw C!14
Yeah so I quickly hacked stuff together. Why make it beautiful before I know whether it will actually do? Hack now, refactor later!
Yeah and then that moment in refactoring where main() gets under 700 lines and I don't know whether what I'm feeling is joy or despair. Gaaaahhhh!
At least I have also written automatic tests so that I can see when something breaks.4
LOL that's why I love C!
The function pointer cast for strcmp because qsort expects a compare function with two const void * pointers instead of two const char * pointers, that's just beautiful.
Not to mention the hack to abuse strcmp on a struct - which just works because the first struct member is a string and the rest just gets swapped with memcpy as opaque data.
I guess that wouldn't pass a code review at work. :-)9