Details
-
LocationEarth
Joined devRant on 5/4/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
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.
Me: exactly!12 -
So a few days ago I felt pretty h*ckin professional.
I'm an intern and my job was to get the last 2003 server off the racks (It's a government job, so it's a wonder we only have one 2003 server left). The problem being that the service running on that server cannot just be placed on a new OS. It's some custom engineering document server that was built in 2003 on a 1995 tech stack and it had been abandoned for so long that it was apparently lost to time with no hope of recovery.
"Please redesign the system. Use a modern tech stack. Have at it, she's your project, do as you wish."
Music to my ears.
First challenge is getting the data off the old server. It's a 1995 .mdb file, so the most recent version of Access that would be able to open it is 2010.
Option two: There's an "export" button that literally just vomits all 16,644 records into a tab-delimited text file. Since this option didn't require scavenging up an old version of Access, I wrote a Python script to just read the export file.
And something like 30% of the records were invalid. Why? Well, one of the fields allowed for newline characters. This was an issue because records were separated by newline. So any record with a field containing newline became invalid.
Although, this did not stop me. Not even close. I figured it out and fixed it in about 10 minutes. All records read into the program without issue.
Next for designing the database. My stack is MySQL and NodeJS, which my supervisors approved of. There was a lot of data that looked like it would fit into an integer, but one or two odd records would have something like "1050b" which mean that just a few items prevented me from having as slick of a database design as I wanted. I designed the tables, about 18 columns per record, mostly varchar(64).
Next challenge was putting the exported data into the database. At first I thought of doing it record by record from my python script. Connect to the MySQL server and just iterate over all the data I had. But what I ended up actually doing was generating a .sql file and running that on the server. This took a few tries thanks to a lot of inconsistencies in the data, but eventually, I got all 16k records in the new database and I had never been so happy.
The next two hours were very productive, designing a front end which was very clean. I had just enough time to design a rough prototype that works totally off ajax requests. I want to keep it that way so that other services can contact this data, as it may be useful to have an engineering data API.
Anyways, that was my win story of the week. I was handed a challenge; an old, decaying server full of important data, and despite the hitches one might expect from archaic data, I was able to rescue every byte. I will probably be presenting my prototype to the higher ups in Engineering sometime this week.
Happy Algo!8 -
~During app demo to our client~
- And when you click here the request will be submitted, the admin will be notified.
*App crashes*
- And of course the app will close itself since it's the end of the process.
- Client: That's good
- Me: ⊙﹏⊙13 -
Me: *hours of coding, develops a feature*
Code: I'm working..
Me: Oh good.. will monitor you for sometime.
Code: Ok, I'm done. I'll stop working now.
Me: WTF
Me: *sits for hours to solve bugs*
And when almost done,
VPN: Someone's having a good day, I'll disconnect you now.
Me: WTF
Me: *tries switching on/off VPN couple of times..*
When it starts to connect,
WIFI: Oh wait!! It's my turn to bid goodbye now. Have a nice day sir
Me: Of course !! The wifi
Me: *restarts router/ troubleshoot etc*
When wifi says connected...
Battery: Good job with wifi.. I'm down now..what you gonna do?
Me: Are you fucking kidding me???
Me: *connects charger, wait for laptop to switch on*
Windows: Updating....
Me: *jumps out window*13 -
| ̄ ̄ ̄ ̄ ̄ ̄|
| backup + |
| encrypt all |
| the things |
|______|
(\__/) ||
(•ㅅ•) ||
/ づ
| ̄ ̄ ̄ ̄ ̄ ̄|
| also test all |
| ur backups |
| so u don't |
| lose all ur |
| things |
|______|
(\__/) ||
(•ㅅ•) ||
/ づ8 -
"Time to listen to some music"
* Puts on headphones and searches my favorite death metal *
* No sound *
"Silly me, I muted it"
* Unmute *
* 108% death metal brainfucking me from both ears *
I think I lost 5 years worth of hearing this instant4 -
Paid intern: It's just like $feature_in_other_app
me: Yeah, in the same way that chemotherapy is a haircut...2 -
Hi ! 😁
I was wondering how ap decides about the bandwidth given to each node.
Does it depends on the order they
got connected or just how much the node requests?
The question is how this distribution gets calculated.
Thanks !9 -
I had a 6 hour flight home so thought I would do some coding. We take off, get to cruising altitude, I get my laptop out and boom windows update. It's like they know the most inconvenient time possible FML3
-
Weekends be like:
Half day = *thinking* what should I do in weekend
Half day= *thinking in regret* I didn't do anything productive
😂😂😂3 -
This is a view from a rooftop in NYC that I sometimes get the pleasure to work from. I really like the view and it’s pretty quiet usually. It also overlooks one of my favorite buildings, the Empire State Building.
I’m looking forward to seeing everyone else’s desks, setups, and remote/outdoor workspaces.
We’ll be featuring them on our recently launched devRant Instagram account, devDesks (https://www.instagram.com/devdesks).35 -
I can type the password for the SSH key to my servers while drunk.
Muggles can't type the fucking email address while sober.
WHAT THE ACTUAL FUCK?!!! Is it really that fucking hard?!!! Pieces of shit!!7 -
>>Be me
>>Looks at laptop once
>>Gets 4 emails about the same fucking one
>>Be me
>>Looks at shoes once
>>Gets 3 emails and one notification from the app about a sale on shoes
>>Be me
>>Buy a mechanical keyboard
>>Gets 4 emails and 3 notifications from the app about a sale on keyboards.
Ok Amazon calm the fuck down bud.13