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
Search - "zeros"
-
Yesterday: Senior dev messages out a screenshot of someone using an extension method I wrote (he didn’t know I wrote it)..
SeniorDev: “OMG…that has to be the stupidest thing I ever saw.”
Me: “Stupid? Why?”
SeniorDev: “Why are they having to check the value from the database to see if it’s DBNull and if it is, return null. The database value is already null. So stupid.”
Me: “DBNull is not null, it has a value. When you call the .ToString, it returns an empty string.”
SeniorDev: ”No it doesn’t, it returns null.”
<oh no he didn’t….the smack down begins>
Me: “Really? Are you sure?”
SeniorDev: “Yes! And if the developer bothered to write any unit tests, he would have known.”
Me: “Unit tests? Why do you assume there aren’t any unit tests? Did you look?”
<at this moment, couple other devs take off their head phones and turn around>
SeniorDev:”Well…uh…I just assumed there aren’t because this is an obvious use case. If there was a test, it would have failed.”
Me: “Well, let’s take a look..”
<open up the test project…navigate to the specific use case>
Me: “Yep, there it is. DBNull.Value.ToString does not return a Null value.”
SeniorDev: “Huh? Must be a new feature of C#. Anyway, if the developers wrote their code correctly, they wouldn’t have to use those extension methods. It’s a mess.”
<trying really hard not drop the F-Bomb or two>
Me: “Couple of years ago the DBAs changed the data access standard so any nullable values would always default to null. So no empty strings, zeros, negative values to indicate a non-value. Downside was now the developers couldn’t assume the value returned the expected data type. What they ended up writing was a lot of code to check the value if it was DBNull. Lots of variations of ‘if …’ , ternary operators, some creative lamda expressions, which led to unexpected behavior in the user interface. Developers blamed the DBAs, DBAs blamed the developers. Remember, Tom and DBA-Sam almost got into a fist fight over it.”
SeniorDev: “Oh…yea…but that’s a management problem, not a programming problem.”
Me: “Probably, but since the developers starting using the extension methods, bug tickets related to mis-matched data has nearly disappeared. When was the last time you saw DBA-Sam complain about the developers?”
SeniorDev: “I guess not for a while, but it’s still no excuse.”
Me: “Excuse? Excuse for what?”
<couple of awkward seconds of silence>
SeniorDev: “Hey, did you guys see the video of the guy punching the kangaroo? It’s hilarious…here, check this out.. ”
Pin shoulders the mat…1 2 3….I win.6 -
To those who say game is not an art, we paint worlds with ones and zeros in real time that you can get lost in for hours. If this is not art, nothing is.2
-
Friend: I wiped this drive, and then I open it in my Hex viewer app, and it's all zeros!
Me: yeah?
Friend: Why isn't it empty?
Me: uh well a drive must have its bits set to some value and can't just nothingness so zeros is just a default meaningless value that resolves to nothing..
Friend: No, but why is it full of zeros? why it isn't empty?
...
I attempted several times and then exploded. rip self14 -
!!depression
I used to measure my performance in features per day (or week, depending on their scope), or tasks/day or loc/day for huge projects. My usual was two to three small features a day, and some progress on a larger one.
Now I’m so burned out and depressed that i measure my progress in the amount of days per week that aren’t “zeros” — as in days where i get literally nothing done. Now any day where i get _anything_ done, no matter how little, is a “good day.” I partially refactored about fifty lines of json builder spaghetti on Tuesday. That was a great day.
This week I’ve had two zeros, and it’s Thursday morning. I think it’s going to be a three zero week.
Worse: performance reviews were due weeks ago. I still haven’t written mine, and have no idea what i would even write. How can i make myself sound good when i can barely even force myself to eat or take a shower?50 -
WOW, I can't believe I left for a while and I got that many ++'s!
It's insane!!!
Wait...
Why does it only have ones and zeros?
Fuck, it's in binary 😭😭😭😂 -
I came back here, after not logging in for about a year just to say that patents are fucking stupid. Thanks, see you in another year!5
-
It's truly amazing how much a single line of perl can do. Such a time saver.
I only wish that I could understand what it does two days later.1 -
So, I'm a Jr. Webdev started one year ago to work on a €200mln. retail platform. Our development team consists out of my Sr. dev who designed the whole platform and it's basically his baby. Now he's leaving and it's expected from me to do new developments, support, meetings with managers from all over Europe, roll-outs in new countries, deal with all the issues SAP has, eat their bullshit when they can't upload a .csv file because they are too stupid to check for missing leading zeros. Listen to important their new functions are that they want because 120% of the salespeople needs it. How stupid can this company be to take the financial risk? I'm done.9
-
Putty, you son of a bitch. Why do you call the logging option "All session output" if you don't include binary zeros in the output? Zeros don't count as "all" or what?
Then call the option "All session output without zeros", that would have saved me some time and prevented handing out false data.6 -
Coding is like the minds virus for me. I can't stop, but I sometimes question if it's good for me. Work is ok nowadays, but keeping a balance in hobbies is so hard. When I discover something new that's fun it can eat me up for days. But that excitement can leave just as quickly with very few projects ever finished as a result.2
-
Programming when sad...
My dad is acutely ill, and trying to focus on code is so hard! This has happened before, and makes me realize that our normal day job is really taxing mentally...2 -
The Qt ide lost me three files aka 1 week of work... Obviously it overwrote them with zeros so I cant recover them... Backups??? Well i didnt think of murphys law....3
-
package main
import (
"log"
"strings"
)
type Present struct {
from string
to string
}
type Santa struct {
presents []Present
}
type Person struct {
Name string
Nice bool
Presents []Present
}
func (santa *Santa) givePresents(person Person) []Present {
result := []Present{}
if person.Nice != true {
return result
}
for _, present := range santa.presents {
if strings.Compare(present.to, person.Name) == 0 {
result = append(result, present)
}
}
return result
}
func main() {
santa := Santa{
[]Present{
{"devRant", "Alex"},
{"Johanna", "Alex"},
{"Alex", "devRant"},
{"Alex", "Johanna"},
},
}
persons := []Person{
{"Alex", true, []Present{}},
{"Johanna", true, []Present{}},
{"devRant", false, []Present{}},
}
for idx, person := range persons {
persons[idx].Presents = santa.givePresents(person)
}
log.Println(persons)
}2 -
Good Morning Devs. Funny thing... Why was I dreaming about subnetting 😂. I literally remember in the dream about telling someone to count zeros. I woke up like 🤔🤔. Zeros...zeros. Was I just explaining to someone how to figure the total IP addresses and Hosts....🤭🤦♂️🤦♂️
-
At work we have to split a potentially large ID into 2 10-digit long parts that will be passed to an outside system that will later return them with some more data to us.
A colleague had implemented it using regular expression, it passed code review, everything was ok, until he noticed a potential problem. For some cases, because the outside system stores them as int and therefore will remove any leading zeros, there will be no way to reconstruct the number.
So we brainstorm and I propose ether a modified regex, or to just use math like part1 = id % 10^10 and part2 = floor(id % 10^10) and then we can reconstruct it simply by: part2 * 10000000000 + part1
Colleague: - Well, the regex will be faster, there won't be any calculations
Me: - :| I disagree but ok..
We do some more brainstorming and testing and find a case where the proposed new regex fails as well
So I bring up my previous proposal, I explain what exactly it does.
Colleague: - I don't like the math, it has calculations, which won't be needed before we reach the 11th digit
Have I missed some major development in computer hardware? When did they become bad/slow at doing math? :|8 -
When you realise a so-called app developer has used nvarchar columns to store every single date record, in every DB table of your platform.
Using d/m/Y format.
Without leading zeros.
And, in just a few tables, m/d/Y.
*sigh*2 -
How do you prevent your software being vulnerable to IP address spoofing? Authentication? Certificates? VPN? Nah, just check the MAC address field of every packet. Nobody ever spoofed a MAC address before, that's just impossible. I thought that in binary there were only ones and zeros, but I guess nobody told me about the special tamper-resistant ones and zeros that MAC address fields are made of.
Oh, once you've done that, don't forget to tell the marketing people to put it in a brochure as an "innovation" for everyone to see.
I should post more of the crap the idiots I work "with" (quotes, because I am only here in body not mind) say. Especially when it comes to network stuff. -
Name one thing more fun than atomically writing values into a gpu buffer and them mysteriously vanishing into the aether immediately after the compute shader invocation
I can literally see them in the buffer using RenderDoc and then as soon as I go to the next command the buffer is completely filled with zeros again as if the values never existed
?? like how ??11 -
Annoying thing when your accuracy is going up but your val_acc is sticking around 0.0000000000{many zeros later}01
😒 Somebody shoot this bitch!5 -
I know people like to rant about Apple removing ports, but it was a great day for a great cable standard yesterday!1
-
You know prior to becoming a dev and learning the ticket system I never had a dislike against any number now I hate most of all of them
-
FREAKING STUPID **** EXCEL
Goddammit, spend hours and hours debugging a csv file generation... It always missed a zero.... Guess what: Excel deletes fucking shit leading zeros -_-3 -
Playing around with GW-BASIC on an old 286 when I was maybe 8 I knew that I would spend my life programming. It was magic. It's less magic now, but I know I will not run out of challenges in my life or career, and that's pretty good too :)
-
The end of today was extremely fun.
Imagine the surprise. I was importing a simple 8 GB big virtual machine into the Proxmox hypervizor.
First issue: It was in the Open Virtualization Format (.ova) for easy import into... most hypervizors... Not Proxmox, however.
But really, not that bad, there are ways around it. Create a blank virtual machine through the UI, scrap the disk you create, then extract the two disk QCOW2 files from the .ova file, which by itself is just a POSIX TAR archive. Then import them through the commandline.
...So I did just that. The larger of the two was about 8 GBs, the other just like... 50 MBs.
The larger imported fine. The smaller?
Color me surprised, when it created a FUCKING. 1. TB. LOGICAL. VOLUME.
...
That it then proceeded to try and fill full of zeros...
Oh yes, it was one of the fancy dynamic storage files that expand as space is needed.
...
Tomorrow, I'll have to try if I can export just the filesystem data into an individual, shrunken down, normal, plain, old disk. None of this fancy black magic shit.
...Also... I don't get why Proxmox doesn't support that... The filesystem was only a few megs big... Ugh.1 -
What would it take to connect two Raspberry Pi's together via Ethernet ports? I want to make a low latency network connection between them, for Retropie Netplay.
I have a background in Python and some Linux, but I'm not well versed in raspi's.
I imagine that it would be limited to 100mb/s if I used raspberry pi zeros with adapters. And I would probably need an router since they aren't setup to be both hosts with the default setup?2 -
So... I have 5 Raspberry Pi Zeros (no Wifi), one RPI Zero with wifi and one RPI 2 b+. I want to do home automation stuff with them. Any ideas?
I was thinking openhab, my only problem is that the rpi zeros dont have wireless connections.5 -
Last week of the school project, I'm one of the few programmers. All of a sudden the floodgates open and everyone needs help. Where were they when I had all the time in the world?
-
My robotics mentor who had never said anything about computers asks some of our good programmers where he can buy 20 raspberry pi zeros.
The next day the PoisonTap exploit goes public.
Coincidence? -
Had to code review a line of java with this code a while back: ServiceService.isProductProduct. Funny thing is that even though it's obviously stupid, it was in accordance with the coding standard and I couldn't really object to it (._.)
-
I came to the conclusion that 1D can (as in "It IS, but it being only the case when you apply the following") also be 4D, 3D, ..., nD, if you have e.g. a vector with only one element, which can be any number, inside and add more and more elements into this vector with a bunch of zeros.4
-
Exceptions... Are they good for anything? I haven't seen them add value to code once in my career...
-
Just turned myself inside out why parsing data from serial didn't work. A full day, and 20 minutes before going home I realize the uart interrupt function was too slow. I just didn't get all chars...