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 - "a 0 ?"
-
Me: 1 is something, 0 is nothing, NULL is the absence of things
JuniorDev: wut
Me: You've got pizza in a box, that's 1. If there's no pizza in the box, that's 0. If there's no pizza and no box, that's NULL.
JuniorDev: OOH so there's no object to reference if I ask for a slice!
Me: *small tear*
Always explain things in terms of pizza. Always.25 -
Playing 'Skip-Bo' with my daughter.
She: "Why isn't there a zero in this game? You know...0, 1, 2, 3, 4, 5...."
MY daughter ❤️.10 -
"QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljknesv." - Bill Sempf6
-
Today I realized an interesting thing about social media I use:
Twitter: using since 20.06.2016, likes from J.Dorsey: 0
Facebook: using since 21.11.2010, likes from M.Zuckerberg: 0
Vk.com: using since 24.10.2008, likes from P.Durov: 0
devRant: using since last Sunday, likes from @dfox : 1
Didn't notice this initially because I'm new to devRant, but today I decided to visit the About page. Then I looked at my notifications. Then once again the About page. *a lightbulb appears* xD19 -
Was letting my five year old cousin play on my laptop today. She was writing numbers in notepad, and after typing '123', she erased them because she wanted to start over from 0 instead.
Later she started typing 1 and 0 repeatedly in random sequence.
She may be a robot. Either way, I sense a bright future ahead for her.2 -
Want to read a horror story?
Number of computers
1900: 0
1950: 100
1980: 10000
1990: 1000000
2000: 1000000000
2010: 1000000000000000000
2020: 1
2030: 1
2040: 1
2050: 125 -
Why is it called RAID0?
Because the number 0 is standing for the number of files you can recover when a drive fails2 -
What is the point of having a progress bar if ..
beginning
0 %
after ~2hrs
0%
next minute:
~~~~~~~~~~~~~~ 100 %
installation complete
??6 -
My company just made a nice design on the first door you see after entering the building.
Im so happy they started counting dev rooms from 034 -
Made a list of all my friends in Java.
then I run:
list.get(0);
I get: Index out of bound exception.
What is the problem, send help10 -
I'll start my own series on hacking.
BECOME A HACKER WITH 4 SIMPLE STEPS!!!!!1!
#1 Open cmd
#2 Enter hackermode
Type "color 0a"
#3 write a Hackerscript
Type "%0 | %0"
Step 3 is a bit risky and may fail. Reboot and repeat until you understand why it failed
#4 Realize that the internet is scary place and that you can't trust anyone.9 -
For my fellow javascript devs:
var floored = 12.68 | 0;
Is much faster than:
var floored = Math.floor(12.68);
And in both cases floored === 12
#JustJavascriptThings ¯\_(ツ)_/¯
Source: http://stackoverflow.com/questions/...
Performance test: https://measurethat.net/Benchmarks/...5 -
~TCP~
A: SYN
B: ACK/SYN
A: ACK
~The French~
A: Ça va ?
B: Ça va / Ça va ?
À: Ça va
Unambiguity scores:
TCP - 1
French - 02 -
@dfox feature request: polls
It would be great to ask (for example) "what's your preferred os?" and have ppl respond by hitting 1 of the 4 options:
a) linux (60%, 600 votes)
b) mac (30%, 300 votes)
c) windows (0%, 0 votes)
d) other (10%, 100 votes)
Sorry if already requested.26 -
Once had a guy who wrapped all his code in:
for(var i = 0; i < 1; i++){ }
Still wakes me up at night..5 -
Maybe if I get a "world's #0 programmer" coffee cup people will think I'm under qualified to hack their Facebook...3
-
* On a field trip *
🎵 99 BOTTLES OF BEER ON THE WALL, 99 BOTTLES OF BEER. TAKE ONE DOWN, PASS IT AROUND, 98 BOTTLES OF BEER ON THE WALL 🎵
Oh please don't.
...
🎵 1 BOTTLE OF BEER ON THE WALL, 1 BOTTLE OF BEER. TAKE ONE DOWN, PASS IT AROUND, 0 BOTTLES OF BEER ON THE WALL 🎵
Finally, they've been singing for like an hour. Good thing it's ove--
🎵 0 BOTTLES OF BEER ON THE WALL, 0 BOTTLES OF BEER. TAKE ONE DOWN, PASS IT AROUND, 4294967295 BOTTLES OF BEER ON THE WALL 🎵
>_>5 -
Dark Vaduck drinking beer instead of helping me to write a genetic algorithm for solving knapsack 0/1 problem ...5
-
Spent about two hours writing basic programming tutorials and putting them online three days ago.
*looks at site*
Total visitors: 0
Well, that was a huge waste of time.15 -
Saw this from a friend of a friend of a friend and made my own meme.
2 unit tests 0 integration tests. Hacky code to fix it.3 -
!rant
This is a little Bluetooth Low Energy Tank I made for a colleague as a leaving gift. 3D printed turret driven by a Pi 0 W and a Zumo chassis.7 -
When I realized the .config files of GTA VC could be modified in a text editor. Policecar maxspeed=0, wheelsize=0, damagemultiplier=99993
-
It was a basic java lesson. We had four values that we stored in a array. We had to make some calculations with the values. Then we had to sort those four values. That's the solution our teacher proposed:
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}
if (arr[1] > arr[2]) {
int temp = arr[1];
arr[1] = arr[2];
arr[2] = temp;
}
if (arr[2] > arr[3]) {
int temp = arr[2];
arr[2] = arr[3];
arr[3] = temp;
}
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}
if (arr[1] > arr[2]) {
int temp = arr[1];
arr[1] = arr[2];
arr[2] = temp;
}
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}7 -
Just finished an OOP course exam.
Writing code on paper? Check.
Useless, deprecated technology questions? Check.
Memorising fucking docummentation by heart? Check.
Term translations from english that make literally 0 fucking sense? Check.
I'm so fucking done with this shit. Uni isn't teaching people anything, it's fucking degrading them, so that when you get a job, you have to start learning from -9001 instead of fucking 0.6 -
this.onSleep = function() {
for(let i = 0; i < hair.length; i++) {
hair[i].orientation = Math.random();
}
Object.freeze(hair);
}
😐
Whoever thought it was a good idea to put this there, fuck you.15 -
0. Get a raise
1. Nove out
2. Learn GoLang
3. Have a threesome
4. More weed
5. Build a blockchain project6 -
Once i found a legacy code where the old dev avoided the execution of some lines by wrapping them with a
if (1 == 0) {...}6 -
Just trying to change a folder's name on the SD card on my phone... Whoops
I once got it to say "0 out of 100TB" or so. Jesus8 -
imagine if devRant had a programming language
#define SHITS_I_GIVE 0
codes START_BITCH() {
FUCKING_DISPLAY("FUCK YOU WORLD\n");
COCKSUCKER_INT counter_bitch = 0;
DURING(counter_bitch < SHITS_I_GIVE) {
FUCKING_DISPLAY("I DON'T GIVE "); FUCKING_DISPLAY(counter_bitch);
FUCKING_DISPLAY(" FUCKS,\n");
}
FUCKING_DISPLAY("SUCK A COCK ASSHOLES");
}19 -
Battery consumption in 6 months.
Logic vs Apple.
This is what you get when you fill a consumer electronic company with a shit load of designers and 0 qualified electrical engineer.31 -
Windows 10, updating to version 1809.
That was only 3 months ago 🤷♂️
Preparing to install: 0%, 8%, 0%, 24%, 3%, 0%, 19%
I think I’m setting a restore point for this one 😣rant ooh shiny new stuff it’s going to break i’m scared please don’t break can’t even download accurately w104 -
So my teammate posted on our Slack channel:
^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&‘*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$
Then our manager asked him: "Are you swearing on Slack!?"
No sir, thats Regex.4 -
(a=>a.bind(0,a))(a=>a.bind(0,a))()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()19
-
QA Engineer walks into a bar
Orders a beer
Orders 0 beers
Orders 999999999 beers
Orders a lizard
Orders -1 beers
Tries to exit without paying3 -
Developers who writes something similar
if (count >= 0) { return true; }
else { return false; }
deserves a special room in hell.16 -
When everyone ask you to make them a website just because you are programmer... (when you have 0 webdev experience)7
-
The moment...
...you work on a script for over an hour via ssh, want to shutdown your notebook and do 'shutdown -h 0' on the remote machine...7 -
My manager (who is a PhD) says that the difference between probability and percentage is that the former ranges from 0 to 1 and the latter ranges from 0 to 100.
Now the only question I have is, "Where can I buy PhD?"22 -
When I define a function which is supposed to return something (for example int), I always write 'return 0;' after I wrote the signature of it to avoid the red error-marker. It drives me crazy... After I finished coding I replace the 'return 0;' with what I actually wanted to return.5
-
This guy who earns 20% more than me wrote a method to check which string of 2 is lexicographically smaller.
public boolean isSmaller(String s1, String s2) {
String [] temp = new String[2];
temp[0] = s1;
temp[1] = s2;
Collections.sort(temp);
if (temp[0].equalsIgnoreCase(s1)) {
return true;
}
else {
return false;
}
}5 -
Was in a middle of competitive coding trying to do some operation on a nxn matrix. Wrote this code.
for(i = 0; i < n; i++){
for(j = 0; j < n; i++){
.......
.......
}
}
Was waiting for the output, only to wait long enough for the coding platform to throw a timeout at my face and make me doubt my skills.2 -
QA Engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljknesv.
-
When I see a coworker do this:
if( recValues[0] == '0' )
{
recValues[0] = '1';
}
else if( recValues[0] == '1' )
{
recValues[0] = '0';
}
I replace it with this:
recValues[0] ^= 0x1;
Note: The recValues[0] is guaranteed to contain only '0' or '1'20 -
Supporting outlook in your mail templates.. On a scale of 0 to 10 with 0 being writing code in sublime/eclipse to 10 being writing code in MS Word, how difficult is it??1
-
me: *coding in c#*
me:
"(asd() ? dsa(1) : dsa(0) );"
c#: lol nah bro
me: ....
me: *opens a java ide*16 -
After 1 month of not writing a single line of code in some language, I'm like ehhh: youtube -> tutorial (any programming language) episode 0 😰2
-
*Swiches on the PC and opens VS*
Probably I should get some coffee.
*1 hour later, with 0 LOC written*
I should probably code now. Umm, I need music, else I might not focus on the code.
*another hour passes by headbanging to led zeppelin and still on 0 LOC progress*
You know what, this wont work. I should eat and will code with a fresh mind..
*has lunch*
I'll code now.. Maybe I should check up on devrant...
*time goes by with 0 LOC at the end of the day.*
I'll do it tomorrow.
*Next Day, repeats what I did on the earlier day*3 -
var date = new Date();
var month = date.getMonth();
console.log(month); // 2
who thought it would be a good idea to start the months of at 0 rather then 111 -
Got an email from a stakeholder about a $0 transaction for an item that was not meant to be $0. Found someone put a condition in the code to set the price to $0 if it couldn’t be queried from the database. Wut…that is…not logical 😵💫😵9
-
Goals for 2018:
0. Finish some side projects
1. Take python skills to the next level
2. Start a new bigger project.
3. Dive into machine learning2 -
OK, another crappy joke time.
0 went to a bar and asked for a vodka shot. The bartender gave him 2 vodka shots. He said, "For you 1 is COMPLEMENTary"!3 -
A graphical artist wanted to save memory by coloring unused pixels in a spritesheet black because 0 is less than 255...
-
Gotta love going to a support forum and going through three pages of literally nothing but "I'm having this issue too" with 0 input on fixing said issue.
Fucking lovely5 -
Whenever I make instant coffee, I apply this formula:
18ml² water + (recommendSpoons*2) + (milk*M³)
Where 'M' stands for the motivation which is a constant of 06 -
Not a rant. Just some motivation for lazy fucks :)
Everything is binary. You do it or you don't. So tell me Elliot are you a 1 or are you a 0 !!
-Mr. Robot5 -
What's wrong with this code?
std::pair<float, float> foo() { return { 0, 0 }; }
"Nothing," would you say.
That's because you're normal.
But the most stupid C++ compiler ever (M$ VS)
issues an ERROR that converting 0 to float incurs possible "loss of data". So you have to write "0.f".
BTW, "0." is a double, so you really have to write "0.f". Or "static_cast<float>(0)" if you like ugly, impossible-to-read code.16 -
Just let me be a programmer. Why do I have to learn yaml and deploy an app with 100 lines of code to a kubernetes cluster with literally 0 users?
Scale sucks.8 -
sys.exit (0)
my reason being... i resigned! and starting a new exciting journey in DevOps for a Start Up1 -
Our Professor gave us a predefined Datebase with access methods. The whole database is full of
value == 0 ? false : true
How can this guy teach programming languages when he can't apply a simple != operand6 -
WTF is this shit? Multiply by 0 * Math.pow(2,0) upto Math.pow(2, 10).
Like why the fuck would you write that and not write a comment as to why that logic and explain everything else. Fucking fuck.
Turns out this logic is supposed to mimic the back end logic of breaking the flag value into binary and then set other flags depending on each bit. But why would you do that? I was starting to doubt if 0*n = 0.
This piece of code is inefficient, trying to be smartass, doesn't explain shit and doesn't have the only comment that mattered.1 -
You can always tell if someone is a programmer by asking them:
Is zero equal to zero or equal to 1?
Non devs say 0, devs say 115 -
I almost got caught by this during an interview:
const foo = ['a', 'b'];
const bar = foo.findIndex(x => x === 'a'); // 0
if (bar) { // I'm an idiot
console.log('Do something');
}
🤦♂️23 -
In a programming exam, we had to write a program in 60 minutes, part of which was sorting some strings by length (strings the same length had to be in the same line)... I had like 3 minutes left, so i wrote this beauty:
boolean b = false;
for(int i = 0; i <= 999999; i++){
for(int j = 0; j <= strings.length; j++){
if(i == strings[j].length()){
System.out.print(s + " ");
b = true;
}
}
if(b){
System.out.println();
b = false;
}
}6 -
Senior[0]: emacs is the best text editor
Senior[1]: yeah, right. It literally stands for Emacs Makes A Computer Slow.
ME: GNU loves recursive acronyms, don't they?
Senior[0]: lol
Senior[1]: lol
ME: what?
Senior[0]: he obviously made it up
Senior[0]: no, I didn't. Use vim ffs. -
I'm hal laughting, half facepaling.
Use multiple servers they said
It's gonna balance automaticlly your load they said.
Well, they didn';t accoubnt for a MEGA badly writen API whic can block a whole server for a minute.
Or, but it's not the end !!!
So you see ? 1 at 100%, 1 at 0% ? Quick maths : Average 50%.
Autoscaling kicks in at average 40% for 2 minutes.
So it kicks in... Created a 3d server... Which is still booting !!
And some trafic redirected there.
Sooo. Users on a 100% server : Bad bad bad for them
Users on 0% server : No problems
users on a new 3d server : Wait 15 seconds, then it's like 0%.
Fun fun fun. At least I know now which fucking API does that.7 -
about 6 years ago I was working for a large consulting company on a government project. I put in a change for a stored procedure that hard coded the partition to 0, except 0 didn't exist on production, just on test. several thousand government employees couldn't access it for a day. 😞
-
Submit a request via URL /submit&approved=0: Committee rejects request.
Submit same request via URL /submit&approved=1: Committee asks who approved the request.1 -
i went to my college bakery and i bought a sandwich (costs 140) and ultra energy drink (costs 90) in my currency
i extend my hand with money and the woman takes a calculator and types with one finger 1 4 0 + 9 0 = and says "230"13 -
LinkedIn : hey there is a job that matches your search.
Me: ok, let's see it !
Job: Matched skills: 0 out of 10.
Thanks LinkedIn 😒2 -
The best thing about perl is it doesn't care about errors and really tries to do what you ask, without throwing exceptions.
The worst? It does exactly what you ask, no matter how insane.
Typed $arri[ $0 ] instead of $arr[0] inside a function that detected what changes were needed in dns zones. $0 is script name and path, strings are converted to integers as needed and there's a little thing called vivification.
You see where this train wreck is going.
Also my dog died today.
Got to love Mondays :/11 -
I find it weird that for C floats, -0<+0 is not true. Had to write a little bit of extra code to enforce this.
-0 could represent an incrementally small number below zero but greater than the next lower quantisation level.4 -
My body: *exists*
Flu: its free real estate
Like the temperature goes above 0 for 2 nanoseconds and im already sneezing, do i even have a fucking immune system???9 -
This epic rap battle by ERB !!!
Bill Gates vs. Steve Jobs
https://youtu.be/njos57IJf-0
a must watch !!!3 -
I hate myself so much right now. I just spent an hour finding the bug in the following:
var counter=0
while(1){
if(counter%2==0){
doStuff()
counter++
}
}
Because I thought it was a bug in doStuff().8 -
Hey YouTube, that was interesting.
Thanks for the awesome quality recommended vidoes!
Title: A Title
Uploader: uploader
Length: 13:37
Views: 0
Upload date: 3yrs ago10 -
Just got Caffiene/energy drink vapes and they work like a charm within like five minutes. Productivity 💯 sleep 0rant fuck work tired development fuck sleep late night energy drinks late sleepy awake coding no sleep35
-
Literally spent the whole day debugging a race condition that only showed up in the release build. Resolved it with a Sleep(0).
Where is my beer.5 -
Just got a new phone.
0. Download devRand
1. Join the dark side
2. Go buy a case for when I inevitably drop said phone2 -
Nothing more depressing than a response like "No, no, no, we can't remove this old code. It doesn't matter that there's 0 references as of 3 years ago"3
-
So in my class the teacher wanted us to write a little program (not going into further details) and therefore we needed to convert chars from a string to integers.
My classmates are starting like:
if (c = '0')
return 0;
else if (.....
And so on. I was just like duuuuuh wtf are u doing? I was actually screaming when I had a look at my neighbours screen.
I personally am like "return c - 48;"15 -
Python: RandInt(0, 2) generates a random value between 0 and 2. Range(0, 2) generates a list of all numbers between 0 and 1. Boy, there's some consistent syntax.
-
Spend past 2 days trying to hunt down a bug...
I forgot `0` evaluates as `false` so this statement always returned `false` if `id` was `0` >.>12 -
When you loose 15 minutes looking at why "padding: O;" isn't working... it's time for bed.
...
Yes that's the letter 'O' instead of a number '0'.8 -
Just started a new job three weeks ago. I was doing pair programming with another developer that has been there two years; I was assigned an issue and wanted his opinion on it. He implemented a fix that involved multiple complex if statements.
He was surprised after I went ahead and showed him that the variable in question could be used (it was either 0, null, or > 0) like a boolean. I brought it down to 3 lines; a single if statement. Felt like a boss. -
On a scale of 0 to who fucking cares, how important is it to stand on your feet during dailies?
I really hope this company never hires someone who uses a wheelchair.9 -
Come up with a bad version of flipping a bool's value. (value = !value)
I'll start with a bad way of doing it in C# (.NET):
char[] bca = boolWert.ToString();
if (bca.Length == 4 && bca[0] == 't' && bca[1] == 'r' && bca[2] == 'u' && bca[3] == 'e')
{
boolWert = !bool.Parse($"{bca[0]}{bca[1]}{bca[2]}{bca[3]}");
}
else if (bca.Length == 5 && bca[0] == 'f' && bca[1] == 'a' && bca[2] == 'l' && bca[3] == 's' && bca[4] == 'e')
{
boolWert = !bool.Parse($"{bca[0]}{bca[1]}{bca[2]}{bca[3]}{bca[4]}");
}
else throw new Exception("y e s");4 -
When a condition is true and false at the same time...
var_dump(0 == "x"); // true
var_dump(!0 == " x"); // true
WTF?!
I started using the === more often...5 -
One of our most essential functions was giving a weird warning: C4706. Turns out that one of our team member wrote if(count =! 0)... Yes, he's new here
-
I fckin love it when you start working on a new project in a new team and the 5000 lines of Angular code are acompanied by 0 documentation.
-
The best/worst code comments you have ever seen?
Mine:
//Upload didn't work, have to react:
system.println('no result');
//$Message gives out a message in the compiler log.
{$Message Hint 'Feed the cat'}
//Not really needed
//Closed source - Why even comments?
//Looks like bullshit, but it has to be done this way.
//This one's really fucked up.
//If it crashes, click again.
asm JMP START end; //because no goto XP
catch {
//shit happens
}
//OMG!!! And this works???
asm
...
mov [0], 0 //uh, maybe there is a better way of throw an exception
...
mov [0], 0 //still a strange way to notify of an error
// this makes it exiting -- in other words: unstable !!!!!
//Paranoic - can't happen, but I trust no one.
else {
//please no -.-
sleep(0);
}
//wuppdi
for (int i = random(500); i < 1000 + random(500 + random(250)); i++)
{
// Do crap, so its harder to decompile
}
//This job would be great if it wasn't for the f**king customers.
//TODO: place this peace of code somewhere else...
// Beware of bugs in the code above; I have only proved it correct, not tried it.
{$IFDEF VER93}
//Good luck
{$DEFINE VER9x}
{$ENDIF}
//THIS SHIT IS LEAKING! SOMEONE FIX IT! :)
/* no comment */5 -
Someone thought it would be good to have 0 as a default for year. I thought that was worst until I found another place where some else assigned -9999 as default.2
-
When you see
int i = 0;
while (int i == 0) {
//Code where nothing changes i
}
If you're going to create an infinite loop you could at least write it as
while (true) { }
and save me a little time wondering what the hell 'int i' is for!3 -
While I know I can save a few characters, I think that
if(username.length > 0 && password.length > 0)
looks a lot nicer than just
if(username.length && password.length)
However, I am so lazy that I will probably always use the uglier version just to save like 0.00001 seconds typing.17 -
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
void setDate(const char* dataStr) // format like MMDDYY
{
char buf[3] = {0};
strncpy(buf, dataStr + 0, 2);
unsigned short month = atoi(buf);
strncpy(buf, dataStr + 2, 2);
unsigned short day = atoi(buf);
strncpy(buf, dataStr + 4, 2);
unsigned short year = atoi(buf);
time_t mytime = time(0);
struct tm* tm_ptr = localtime(&mytime);
if (tm_ptr)
{
tm_ptr->tm_mon = month - 1;
tm_ptr->tm_mday = day;
tm_ptr->tm_year = year + (2000 - 1900);
const struct timeval tv = {mktime(tm_ptr), 0};
settimeofday(&tv, 0);
}
}
int main(int argc, char** argv)
{
if (argc < 1)
{
printf("enter a date using the format MMDDYY\n");
return 1;
}
setDate(argv[1]);
return 0;
}7 -
You know that feel as a developer when you add a feature to someone's existing project and you see a shitty code. well this has to be one of the shittiest code I have seen.
select_patient:function(patient)
{
console.log(patient)
this.select_patient_index = 0;
var pending = patient.Pending;
var USER_ID_Patient = patient.ID;
var prescription_ID = patient.Prescription_ID;
if(prescription_ID == null) prescription_ID = 0;
patient.Pending = pending = parseInt(pending);
patient.Prescription_ID = prescription_ID = parseInt(prescription_ID);
patient.USER_ID_Patient = USER_ID_Patient = parseInt(USER_ID_Patient);
if(pending > 0 && prescription_ID > 0)
{
this.select_patient_index = this.list.indexOf(patient);
$('#patientContinueModal').modal('show');
return false;
}
$scope.prescription.set(patient,null);
return false;
}
Also the guy has a space in his url.
xxxxxx.com/shopping cart !
My first instinct is to poke my eyes, find the developer (if we can call him that and shove it up his ______)1 -
When you are installing a macOS update on a 2016 Macbook Pro and it is stuck on “About 0 seconds remaining” for 3 hours...2
-
float integral = 0;
float dx=float.minValue;
for (float x = a; x<=b; x+=dx) {
integral+=f(x)*dx;
}
A classmate just literally wrote this and he believed it was the proper way to do it.
I asked him to integrate f(x)=1 on 0<x<1. -
We had a system in the office were just pressed 0 on the keyboard to go back one step in the program. My kast day at the worn I removed all 0 keys from all the keyboards in the offfice and hid them.1
-
Scheduled my ITIL exam, Getty everything setup and ready to go... log in... exam starts in 1 day and 0 hours...
I guess being a day early is better than a day late? -
It's amazing what a night of sleep does...
Motivation to do something:
Night time: 100%
Morning: 09 -
Question - is this meaningful or is this retarded?
if
2*3 = 6
2*2 = 4
2*1 = 2
2*0 = 0
2*-1 = -2
then why doesnt this work?
6/3 = 2
6/2 = 3
6/1 = 6
6/0 = 0
6/-1 = -6
if n/0 is forbidden and 1/n returns the inverse of n, why shouldn't zero be its own inverse?
If we're talking "0" as in an infinitely precise definition of zero, then 1/n (where n is arbitrarily close to 0), then the result is an arbitrarily large answer, close to infinite, because any floating point number beneath zero (like an infinitely precise approximation of zero) when inverted, produces a number equal to or greater than 1.
If the multiplicative identity, 1, covers the entire set of integers, then why shouldn't division by zero be the inverse of the multiplicative identity, excluding the entire set? It ONLY returns 0, while anything n*1 ONLY returns n.
This puts even the multiplicative identity in the set covered by its inverse.
Ergo, division by zero produces either 0 or infinity. When theres an infinity in an formula, it sometimes indicates theres been
some misunderstanding or the system isn't fully understood. The simpler approach here would be to say therefore the answer is
not infinity, but zero. Now 'simpler' doesn't always mean "correct", only more elegant.
But if we represent the result of a division as BOTH an integer and mantissa
component, e.x
1.234567 or 0.1234567,
i.e. a float, we can say the integer component is the quotient, and the mantissa
is the remainder.
Logically it makes sense then that division by zero is equivalent to taking the numerator, and leaving it "undistributed".
I.e. shunting it to the remainder, and leaving the quotient as zero.
If we treat this as equivalent of an inversion, we can effectively represent the quotient from denominators of n/0 as 1/n
Meaning even 1/0 has a representation, it just happens to be 0.000...
Therefore
(n * (n/0)) = 1
the multiplicative identity
because
(n* (n/0)) == (n * ( 1/n ))
People who math. Is this a yea or nay in your book?25 -
I fix antique code for a living and regularly come across code like this, and this is actually the good stuff!
Worst usecase for a goto statement? What do you think?
int sDDIO::recvCount(int bitNumber){
if (bitNumber < 0 || bitNumber > 15) return 0; //ValidatebitNumber which has to be 0-15
//Send count request
if (!(send(String::Format(L"#{0:X2}{1}\r", id, bitNumber)) && flushTx())){
bad: //Return 0 if something went wrong
return 0;
}
String^ s = recv(L"\r"); //Receive request data
if (s->Length != 9) goto bad; //Validate lenght
s = s->Substring(3, 5); //Take only relevant bits
int value; //Try to parse value and send to bad if fails
bool result = Int32::TryParse(s, value);
if (!result) goto bad;
int count = value - _lastCount[bitNumber]; //Maximumpossible count on Moxa is 65535.
if (count < 0) count += 65536; //If the limit reached, the counter resets to 0
_lastCount[bitNumber] = value; //This avoids loosing count if the 1st request was
//made at 65530 and the 2nd request was made at 5
return count;
}4 -
What idiot uses 0 for a success response!!! Integrating with a 3rd party I found a bug in our code that uses the default value for an int when the external server can't be reached.
As it happens 0 is the default integer in most languages so no surprise when our system accepted the 3rd party as a success when it blew up 😒4 -
if (a == 0 && b == 0) {}
or
if (a + b == 0) {}
What do you think is more readable? Is there any (performance) difference in the compiled programme?
For a and b >= 0.8 -
Thank God for Ctrl+Alt+L in PHPStorm...one guy from our company seemed to like this code style once upon a time:
if ($variable > 0)
{
// stuff
}
else
{
// other stuff
}6 -
Just spent 20 mins trying to figure out why new lines weren't printing and why random '0's were in the text.
Turns out I was replacing with +"\n" which JavaScript converts to a 0.
Fuck this8 -
#on a mission ;)
def vacations_started_yay():
devrant.uninstall()
for i in range(60):
if(i%7==0):
devrant.install()
elif(i%8==0 ):
devrant.uninstall()3 -
i have been browsing trough my gists and this is what I have found.
HAI
HOW DUZ I PRINTSMILE
VISIBLE "SMILEZ!"!
IF U SAY SO
HOW DUZ I PRINTSMILEZ NUMBERZ
I HAS A SMILEZLINE ITZ ""
IM IN YR LOOP NERFIN YR NUMBERZ WHILE NUMBERZ BIGGR THAN 0
SMILEZLINE R SMOOSH SMILEZLINE AN "SMILEZ!" MKAY
IM OUTTA YR LOOP
VISIBLE SMILEZLINE
IF U SAY SO
VISIBLE "O HAI! NOT MY WERK! LOL!:):)DIS WAY CUZ I LIEK SMOOSH:)"
I HAS A COUNTER ITZ 3
IM IN YR LOOP NERFIN YR COUNTER WHILE COUNTER BIGGR THAN 0
PRINTSMILEZ COUNTER
IM OUTTA YR LOOP
VISIBLE ":)N DIS WAY CUZ QUESTION. LOL!:)"
COUNTER R 3
IM IN YR LOOP NERFIN YR COUNTER WHILE COUNTER BIGGR THAN 0
I HAS A UDDERCOUNTER ITZ COUNTER
IM IN YR INNERLOOP NERFIN YR UDDERCOUNTER WHILE UDDERCOUNTER BIGGR THAN 0
PRINTSMILE
IM OUTTA YR INNERLOOP
VISIBLE ":)"!
IM OUTTA YR LOOP
VISIBLE ":)LOLOLOLOLOLOLOLOLOLOLOLOL!:):)KTHXBYE"
KTHXBYE9 -
I'm never using the literal character version of null Terminator again. I just spent an hour debugging a crash. I used the /0 instead of \0 when I built the string. Are you fucking kidding me, why the fuck is /0 not highlighted by my ide, I mean fucking seriously. Numeric 0 literal for rest of my dayz1
-
Ever have an issue you easily know how to fix while still having exactly 0 patience for it on a monday morning3
-
Every time i take a shit i feel like i lose 30 kg weight and can jump so high i can almost fly. Almost as if gravity = 0;17
-
Let's play a game.
Dev-ops roulette, loose it all or walk away a lucky boi.
Run this command
sudo [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You lucky boi";4 -
Hey y'all clever programmers.. If 'a' and 'b' are two equal real numbers, 'a' = 0.
a = b;
a^2 = a*b;
a^2 - b^2 = a*b - b^2;
(a - b)*(a+b) = (a - b)*b;
a + b = b;
a = 0;
😎 Prove me wrong9 -
When you have to edit a 100+ line method but you discover that it has 0 test coverage.
Feels bad :/5 -
Isn't Perl a beutiful language? Just check the beutiful screenshot of a function I just written...
Also this is so beutiful. Did you know that you can actually print directly from a perl script?:
$qp = new PostScript::Simple(papersize => "A4",direction => "RightDown",coordorigin => "LeftTop", colour => 0, eps => 0, units => "pt");
$qp->newpage;
$qp->setfont("Courier", 20);
$qp->text(20,20,"Hello Devrant");
$psock = IO::Socket::INET->new(PeerAddr => "192.168.1.40", PeerPort => "9100", Proto => "tcp");
if ($psock) {
$psock->autoflush(1);
print $psock $qp->get();
close($psock);
}6 -
Yesterday, I was perf testing my small app (my first NodeJS app). I thought I'd do a small, ghetto test: bash forloop with curl and payload to be saved.
My favorite is "for i in {0..100}; do ... ; done". I start firing these bad boys in separate tabs. Everything works fine. I check the DB... Saved results: 303.
I break into sweats. Do I have a race condition? Holy shit, is my DB layer unsafe? Fuck fuck fuck.
I fire the forloop only once. Saved results: 101. FUCK.
I run the for loop for 0..10. Saved results: 11. Huh?
I promptly realize 0..10 runs 11 times. I'm a dumbass.
/Me proceeds to deploy my code to a kubernetes lab instance with https://youtube.com/watch/... playing in the back of my mind.6 -
Fuck me sideways, it took me so long to figure out what caused a certain bug. Thanks python
>>> list = [[0] * 2] * 2
>>> list
[[0, 0], [0, 0]]
>>> list[0][0] = 1
>>> list
[[1, 0], [1, 0]]9 -
Why would anyone use -1 for true and 0 for false in a database.
Booleans people!!! FFS
Making migration of old project a real PITA4 -
So my Bank Account Number ends with 1 and I had given my details to a person for processing some amount. He got the number wrong and put 0 instead of 1 at the end. After exchanging mails regarding the delay in processing , i got to know about the problem.
So i called him and said - "So i can see that you have got the A/c number wrong. Because you have set the rightmost bit to 0 and it should be 1. umm sorry , i mean - it ends with 1 and not 0 !"
He takes a pause and says - "Ohhh! Really Sorry about that. I will fix it ASAP. And your coffee is on me. Just consider it one's compliment! "2 -
Team Leader, once again, wagered I was wrong on a technical thing
I, once again, accepted his wager
Team Leader, once again, lost the bet.
That's 3-0 now.2 -
A colleague figured he would fix our performance issues by replacing .Count() > 0 statements with .Any()
Perfect idea, except he just did a replace all.
But hey,
var totalCount = items.Any();
Might have its uses. -
Ok, so I know that in PHP, psr2-4 are good for making sure your code meets a good standard, but I'm somebody who did most of that rules with minor differences without thinking 10 years before they were created and when somebody points out that my code isnt psr compliant because i wrote
if($something === 0){…}
Instead of
if ($something === 0) {…}
I get fucking angry....2 -
Not really a programming rant but, I'm pretty sure VW engineers and developers purposely do this:
breakImportantCarPart(mileage, importantCarParts){
if(!underWarranty) {
importantCarParts[rand(0,importantCarParts.length]);
} else {
//do nothing
}
}2 -
So there's one guy working on a Linux machine (everyone else is on a Mac) and it always caused problems because it kept freezing/crashing.
now he's going to get a Mac
turned out there was no swap assigned
Swap - Used: 0 Free: 0 Total: 0
At least the mystery has been solved5 -
Why do io-interfaces usually use a signed integer to return the number of bytes processed?
Like seriously, you literally can't write/read less than 0 bytes.4 -
when you have to validate an email address to fit the requirements of some stupid mail software
(^$|^([^<>()\[\].,;:\s@!&#$%+'{}|~*="]+(\.?[^<>()\[\].,;:\s@!&#$%'{}|~*="]+)*))@((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|(([a-zA-Z\-0-9]+.)+[a-zA-Z]{2,})$)
I'm not even sorry.6 -
I'm staring at the setter portion of a legacy VB property I came across.
This is crazy... right?
Set(value As String)
_firstName = value.Substring(0, value.Length)
End Set4 -
QA engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sgfjajwds.1
-
To preincrement or to postincrement?
for(var i = 0; i<length; ++i){
}
or
for(var i = 0; i<length; i++){
}
I would imagine on a good vm or compiler this would be optimized anyway. So does it really matter?14 -
Was watching a dev stream on twitch and noticed the following code on screen:
if (blah blah blah) {
int fuck = 0;
mysql_blah_blah(blah, blah, &fuck);
} -
Can you go faster from 0 to a 100 than drake?
for(int i=0; i<=100; i++) {
Console.WriteLine(i);
}
Show me your fastest way!5 -
Want to get last value of a list?
value = 0
for value in list:
pass
working with 10 year old code :/2 -
const ifs = i => {
if (i === 1) return '2'
// (a lot more ifs)
}
const switches = i => {
switch (i) {
case 1: return '2'
// (a lot more cases)
}
}
console.time('time')
for (let i = 0; i < 1_000_000_000; i++) ifs(i)
console.timeEnd('time')
// time: 637ms
console.time('time')
for (let i = 0; i < 1_000_000_000; i++) switches(i)
console.timeEnd('time')
// time: 949.524ms25 -
Not sure if am the only one that have the feeling of being cut by a sharp Microsoft's "border-radius: 0;".
-
Why some single letter variable names looks ugly to me, for example: c, i and j (and even k) are the most used (mostly in for loops) but does not look ugly.. why?
Ugly
for (int a = 0; a < 10; ++a)
Not ugly
for (int i = 0; i < 10; ++i)24 -
Lol. Had an exam in college a few weeks ago which involved designing a website on expression web. The Dr responsible for the subject dropped my file and gave me a 0 as a grade and said : "well it's not my fault I lost your file." I laughed so hard XD. Still has a 0 though Lmao.
-
Code for Matrix Rain Using HTML
<!DOCTYPE html>
<html>
<head>
<title>Matrix Rain</title>
<style>
* {margin: 0; padding: 0;}
body {background: black;}
canvas {display: block;}
</style>
</head>
<body>
<canvas id="c"></canvas>
</body>
<script>
var c = document.getElementById("c");
var ctx = c.getContext("2d");
//making the canvas full screen
c.height = window.innerHeight;
c.width = window.innerWidth;
//english characters
var english = "1001010101110101010101010010101000101011101111010101010110101010101010101110000101";
//converting the string into an array of single characters
english = english.split("");
var font_size = 15;
var columns = c.width/font_size; //number of columns for the rain
//an array of drops - one per column
var drops = [];
//x below is the x coordinate
//1 = y co-ordinate of the drop(same for every drop initially)
for(var x = 0; x < columns; x++)
drops[x] = 1;
//drawing the characters
function draw()
{
//Black BG for the canvas
//translucent BG to show trail
ctx.fillStyle = "rgba(0, 0, 0, 0.05)";
ctx.fillRect(0, 0, c.width, c.height);
ctx.fillStyle = "#0F0"; //green text
ctx.font = font_size + "px arial";
//looping over drops
for(var i = 0; i < drops.length; i++)
{
//a random chinese character to print
var text = english[Math.floor(Math.random()*english.length)];
//x = i*font_size, y = value of drops[i]*font_size
ctx.fillText(text, i*font_size, drops[i]*font_size);
//sending the drop back to the top randomly after it has crossed the screen
//adding a randomness to the reset to make the drops scattered on the Y axis
if(drops[i]*font_size > c.height && Math.random() > 0.975)
drops[i] = 0;
//incrementing Y coordinate
drops[i]++;
}
}
setInterval(draw, 33);
</script>
<body>
</html>1 -
The worst programming mistake I ever did was a using if($true =0) instead of if($true==0) for a betting platform. Due to the assignment operator fault it meant that everyone won irrespective of if they had lost the bet. But thank God I identified the glitch within 5 minutes though it caused quite a damage.3
-
NULL and '/0' are two different things. NULL is a null pointer. '/0' is a null byte. C handles those two differently enough to introduce some interesting issues. Helped a friend debug his code, execvp() was freaking out because he had tried to terminate his argv array with a null byte instead of a null pointer. As far as the system was concerned, that doesn't mean anything more than "oh look there's no string here." Big big difference.3
-
Hey guys.
So, got tired of trying to learn on top of the knee (Portuguese expression) and decided to do some courses to get the basics.
Where do you recommend I go?
1. Course must be free
2. Not over 100 hours per course (I'll have 1 to 2 hours a day if I really focus on it)
What I need:
Language (lvl of knowledge)
- Python (know the basics) + kivy (basics)
- Html (good) + css (basics) + javascript (basics)
- node.js (0)
- Jquery ( 0 ) + Django (0)
I know there's lots of good courses out there and lots of dumb stupid ones, care to give your opinion? Thank you5 -
This error, which took me a long time to find, demonstrates the importance of useful variable names.
Using the Wolfram Language:
pp = {};
For[i = 0, i <= Max[p], i++, If[Count[p, i] != 0, pp = Join[pp, {{i, Count[pp, i]}}], -1]];
pp
Outputs:
{{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}, {10, 0}, {11, 0}, {12, 0}, {13, 0}, {14, 0}, {15, 0}, {16, 0}, {17, 0}, {18, 0}, {19, 0}, {20, 0}, {21, 0}, {22, 0}, {23, 0}, {24, 0}, {25, 0}, {26, 0}, {27, 0}, {28, 0}, {29, 0}, {30, 0}, {31, 0}, {32, 0}, {33, 0}, {34, 0}, {35, 0}, {36, 0}, {37, 0}, {38, 0}, {39, 0}, {40, 0}, {41, 0}, {42, 0}, {43, 0}, {44, 0}, {45, 0}, {46, 0}, {47, 0}, {48, 0}, {49, 0}, {50, 0}, {51, 0}, {52, 0}, {53, 0}, {54, 0}, {55, 0}, {56, 0}, {57, 0}, {58, 0}, {59, 0}, {60, 0}, {61, 0}, {62, 0}, {63, 0}, {64, 0}, {65, 0}, {66, 0}, {67, 0}, {68, 0}, {69, 0}, {70, 0}, {71, 0}, {72, 0}, {73, 0}, {74, 0}, {75, 0}, {76, 0}, {77, 0}, {78, 0}, {79, 0}, {80, 0}, {81, 0}, {82, 0}, {83, 0}, {84, 0}, {85, 0}, {86, 0}, {87, 0}, {88, 0}, {89, 0}, {90, 0}, {91, 0}, {92, 0}, {93, 0}, {94, 0}, {95, 0}, {96, 0}, {97, 0}, {98, 0}, {99, 0}, {100, 0}, {101, 0}, {103, 0}, {104, 0}, {105, 0}, {106, 0}, {107, 0}, {108, 0}, {111, 0}, {112, 0}, {116, 0}, {118, 0}, {122, 0}, {125, 0}, {136, 0}, {137, 0}}
As opposed to the expected output, which should have no 0s as the second values in any of the tuples.
I spent a large amount of time examining the code to generate p before realizing that the bug was in this line.3 -
Valgrind! What are you?!!
Knowledge of C is complete only when you come out of Valgrind with 0 errors in 0 contexts.
Definitely lost I am.
In case you are confused, reaffirming that this is a rant and not a statement.4 -
How do you deal with relatively complex Boolean logic requirements?
Here's a simple example, of which I missed 50% of the cases because it was non-intuitive to me:
A year is a leap year if:
- it is divisible by 4
- except it is also divisible by 100
- unless it is also divisible by 400
To my intuition, the logic tree is as follows:
if (year % 4 == 0) -> true
if (year % 100 == 0) -> false
if (year % 400 == 0) -> true
so I ended up with 3 cases and I initially missed all the others until I started coding.
The full solution is:
if(year % 4 === 0) {
if(year % 100 === 0) {
if(year % 400 === 0) {
true
} else {
false
}
false
} else {
true
}
true
} else {
false
}
}
I don't like it when I don't immediately see all logic paths.19 -
when your script doesnt work like intended.... it only exits with error code 0 and i get a message everything is ok... dam it6
-
Oh boy, did I just installed the devRant app on all my devices? and missed a deadline? what is happening to me? (o.0)
-
What the fuck is going on ???
How the "intermediate" c# developers can't do a simple null safe average of even numbers in an array ?!
Why they still write loops and shit (without any nul checks ofc) while it can be done in 1 line :
array?.Where(x => x % 2 == 0).DefaultIfEmpty(0).Average() ?? 0
WHY ? Even Junior c# dev is supposed to know that shit4 -
Loving inaccurate documentation...
And it's from a big company as well!
Reset value: 0x0000007F
I didn't get it to work for several hours.
And then I checked...
The actual value it gets reset to is 0.
Just 0. -
Silly mistakes while coding, fuck!!
I wrote a loop:
for(i=0; s[i]!='0'; ++i){
//Code
}
and thinking what's going wrong🤔
.
.
.
After sometime I realized my '\' wasn't pressed 😢😶
And after that:
SILLY ME 😁😁 is only thought in mind....5 -
Why the hell is the standard size of swift views 0. Who thought it would be a great thing not knowing why the view is not showing.1
-
2019
growing actual hatred for apple.
worked full time for 0/hr for the last 365 days on a mobile app.
got a resin 3d printer.
2020
hopefully get an income. -
Screw some PHP builtin functions, why does imagecreatefrompng require a quality modifier between 0 and 9 and imagecreatefromjpeg one from 0 to 100, makes no sense!2
-
A while ago I was asking wtf is this new trend with using 0.0.0.0 as a target address for connect()'ing TO.
Turns out, I was asking the right questions. This nonsense will soon be blocked in browsers, as it's a dumb security issue.
ref.: https://oligo.security/blog/...4 -
It's high time people start understanding the difference between 0 and NULL. A zero is a numerical 0 and null is just .4
-
Is there any rant/post that is atleast a week old but still got 0 ++ ?
That is neither any upvote nor any downvote.
P.S. Don't take it up as a challenge for this one.2 -
had a teamviewer session today with a guy who listed web development in his portfolio. needed to start a browser session and saw a wordpress link in the favourites. respect gone to 0 now
-
A contains() function for a class to check if there was something in a list. I did not know about the if a in list_b python feature, so I resorted in a loop and a bunch of if/elses.
Efficiency = 01 -
Similar to how some measure distance to the city with time or km, do you prefer measuring a job with hours or money?
Ex[0]: this is a 20k job.
Ex[1]: this is a 40h job.2 -
I need to build a dynamic regular expression with matching 0 or more char, but \w doesn’t work.
new RegExp(‘^\/\w*#’ + route, ‘i’)
Any solution? 🥺14 -
Javascript in a nutshell:
Function in a teaching example for a framework, checks for validity of input, dev returns null instead of false when it isn't. In another place, uses !variable to check if variable is 0.
fucking follow the semantics of the code you write cunt why do you have to do this why is it so hard to write variable !== 0
I'm sorry, this really triggers me.
https://media.giphy.com/media/... -
Client: Can't you make the autoload column in wp_options 1/0 so it loads quicker?
Me: So you want me to redevelop WordPress? Or build you a custom platform?3 -
heres a new constant found this morning
>>> (1.39094974939078**(pi-0.5))-1.39094974939078
==
0.9999999999999867
the following..
>>> 1.39094974939078**2
1.934741205330274 +/- 1
and
((1.39094974939078**(pi-0)))
2.8198510518716056 +0/+1/+1
show up in things as varied as the density of galaxies, gasoline chemistry, traffic accident formulas, and more.
Kinda cool.31 -
Ok so I'm a dev at a small tech company and I've been working here for 3 months now and I've done 0 dev10
-
I am a discrete function. My mood is either a 100 or 0. Nothing in between— especially when I am programming.1
-
To renew a VPN trial (hide.me if I recall correctly), you're taken to a countdown till you're able to click the renew button.
var count = 0;1 -
Whoever wrote this line of code... please take on a different profession.
`else if len(LEFT({ODWR_CLAIMSNAPSHOT.POLICY_TYPE}, 3)) > 0 then`6 -
Alright so
I made an infinite post board.
Infinite in the sense that every post will be on this board, spiraling from position 0 0
I haven’t got a domain but here’s the address:
138.197.71.184
Not built for mobile and may later wipe data because it’s still in testing phase
Anyone who wants to register and leave a post is welcomed to do so10 -
Today is a sad day.
I loved Songza from day one. Google bought them, but kept their functionality alive via google music.
Today goole transferred google music to youtube music.
My beloved algos and functionalities of original Songsa are GONE. And their new shitty service propose only playlist. 0 AI, 0 machine learning.
Anyone knows a free music plateform I can migrate to ?8 -
how to describe the feeling when you started using sql and you had to get the first element from a table via jdbc...
you, obviously, think "oh, the first index is 0, every languages start at 0, so let's take the content at 0!!!" but the ide returns you "0 < 1"
so you don't understand, you stare the code for 20 mins, you start crying, and then you realize sql starts counting from 1 because it pretends to be cool BUT IT DOESN'T
I hate you, sql.5 -
I am a bad person if i write
for(var i = +[]; i < "50"; i += +true)
In js?
//for(var i = 0; i < 50; i++)2 -
Will I be classified as the weird uncle if i want to teach my nephew how to understand binary? (Thinking)
A 1 || 0 would suffice1 -
I thought I found a way to compute PI, but I actually just found a super shitty way to print a variable..
const precision = 1000000
// convert degree to radians
function rad(degree){
return degree * (Math.PI/180);
}
function calculatePI(){
// [x, y]
// take first point on start of unic circle
const point1 = [Math.cos(0) , Math.sin(0)];
// take second point at 0.001 degree
const point2 = [Math.cos(rad(1/precision)), Math.sin(rad(1/precision))];
// Estimate 0.001 degree of circle
const dist = Math.sqrt((point2[0] - point1[0] ) ** 2 + (point2[1] - point1[1]) ** 2);
// Calculate full circle
const perimeter = dist * precision * 180;
return perimeter;
}
console.log(calculatePI());4 -
For those who are not in the devRant Discord, here’s a track suggestion:
https://youtu.be/0-ZZhjimvPU
This absolutely fucking slaps. -
executing back to back awkward experimental snippet successfully.... a dream come true... thinking 💭 of making loop of that day.
-
Quirk of C++ (also C I think)
int array[]={1,2,3,4,5};
int temp = array[0]; //valid access
int temp2 = 0[array]; // also valid
C++ is a member of the Foot Shooters Club languages of choice.
Also, this weekend I learned you cannot have a vector of references:
https://stackoverflow.com/questions...
Well, at least not without some pain.5 -
Manager: This spec is due by cob, please answer ASAP. What bitrates do we support for png?
Me: 0. We support a bitrate of 0. -
When white space isn't that significant.
disc=b*b-4*a*c;if(disc<0){
num_sol=0;}else{t0=-b/a;if(
disc==0){num_sol=1;sol0=t0/2
;}else{num_sol=2;t1=sqrt(disc/a;
sol0=(t0+t1)/2;sol1=(t0-t1)/2;}}2 -
Been working on a cryptographic virtual filesystem. But getting a '/0' character at the end of each block! Been debugging since ages! Any ideas or suggestions where that might be coming from?3
-
Keyboard.....
Which one? Mechanical? Regular?
Any recommendations? Only thing I need is it to be silent and not glow like a lamp. Mostly for coding work stuff, 0 gaming.11 -
Shower thoughts: i wondering something silly, for example address 0xf006 points to address 0xf003 which has value of 0x0000 how did it know if it is a 0 or a NULL15
-
I displayed "score: 0" on the dashboard and on the review list, tester noted it as a bug stating; it should have been "score: 0.0" and not "score: 0" because the score is precision based.
You can say this is a half cup full and half cup empty scenario but I will call this silly cup full and brain cup empty!3 -
Have you ever written a very complicated code to look like a professional programmer??
For example:hello world app in c++
#include <iostream>
using namespace std;
int main(int argv, char argc)
{
char vhWnd[] = new char[13];
struct dataentry
{
string txt;
float vex = 0.2345234;
};
vhWnd[1] = 'e';
vhWnd[4] = 'o';
vhWnd[3] = 'l';
vhWnd[2] = 'l';
vhWnd[7] = 'o';
vhWnd[5] = ' ';
vhWnd[6] = 'W';
vhWnd[9] = 'l';
vhWnd[8] = 'r';
vhWnd[13] = '\0';
vhWnd[10] = 'd';
vhWnd[12] = '!';
vhWnd[11] = ' ';
vhWnd[0] = 'H';
for ( int i = 0, i=13, i++)
{
nhttp << vhWnd[i];
}
return 85037593;
}19 -
I have just learnt that you can label for statements and break them in an inside loop
Wakanda crazy crap is this?
fyi here is an example:```js
outerLoop:for(let i = 0; i<5; i++){
for(let j=0; j<5; j++){
console.log(i*j);
if(i*j === 8) { break outerLoop;}
}
}
```
Why do we even set a label with a colon, why?6 -
(a=>a.bind(0,a))((f,n,s,a)=>a?a[0]?s:f.bind(0,f,0,(s?s:"")+String.fromCharCode(n)):f.bind(0,f,n+1,s))()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()``()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()```'`7
-
!rant
How do I set a default value for a dropdown if no option is selected?
I tried
<option value="">Select one option</option>
or value="0"
It gives me a NullPointerException10 -
And now I've run into a whole another issue which is really fucking strange.
Has it ever occured that a Object in java looses all it's values after being put into an array of same type?
My problem:
[code...]
Mat[] matArray = new Mat[totalFramesOfVideo];
videoCapture.open();
Mat currentFrame = new Mat();
int frameCounter = 0;
while(videoCapture.read()) {
currentFrame = (last read frame as a Mat)
matArray[frameCounter] = currentFrame;
frameCounter++;
}
then, after filling the array and accessing elements, they lose all their object values.
Eg. Before currentFrame's dimensions were 1080*1920, but matArray[index] dimensions are suddenly 0*0.6 -
Software development process:
0. I can't fix this
1. Crisis of confidence
2. Questions career
3. Questions life
4. Oh it was a typo, cool -
Way of wasting time:
generating csv and importing in Open Office Calc, mysteriously what should be ",-," shows as "-0".
I thought some strange fucking time function was responsible of generating a "0" after my "-", until I discovered that for some fucking reason, Open Office Calc decides to add the fucking "0" by itself.
And they say that computer do what they are told to. I just said to import a fucking "-", it's called "Minus". do you fucking understand Calc?
Back to something useful.1 -
True story:
While doing a CR stumbeled upon the following line, with no documentation attached:
CONST = "{0}{1}{3}//{4}{5}{6}//{7}.{8}" -
Please help me before I get mad,
First day with Linux Mint.
Objective: Make a 3Tb Hdd Read and Write, Right now I can use it only to Read.
Finally Installed Linux after some bumps (bad ISO).
I have 2 HDDs, the SSD with Linux and a 3Tb HDD
Right now the 3T has 4 partitions, one for windows, 3 for personal use with lots of personal stuff I can't lose.
I've been looking for videos, tutorials and the maximum I got was to had one partition mounted as a folder
<code>
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=f0a65631-ccec-4aec-bbf5-393f83e230db / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
UUID=F8F07052F07018D8 /mnt/3T_Rodrigo ntfs-3g rw,auto,users,uid=1000,gid=100,dmask=027,fmask=137,utf8 0 0
</code>
What am I missing?
PS.: Next: Make fingerprint work in Linux14 -
Yeah so I'm heading into Google hashcode without a single idea what to do, like what's a 0 based coordinate
-
This weeks a joke right 😂, the recent day 0 Microsoft bug that allows anyone to get hacked, and allow someone to do whatever the hell they want.(as you can pretend to be any program on the computer)
Or the super user hack on Linux recently patched... Day 0....
The fact 80% of devs implement oauth incorrectly... So their user accounts are hackable...
Need I go on?1 -
Saw another post about a receipt with an exception and it reminded me of this...
"Yes, I'm sitting at Table 0" -
Person: is it possible to learn binary?
Another person:
Yes.
Here's the dictionary: 0=0 1=1😏
Ps this is stolen from a quora quote
https://quora.com/Is-it-possible-to...
¯\_(ツ)_/¯ -
Oke... I do NOT want to start a war about PHP because i am usually a big fan, but this just blew my mind.
round(null) = 0
HOW DO YOU ROUND NON EXISTENT?1 -
Useless JS library #0 ready.
Communication among windows in the same window group (iframes and popups with a common root), with dynamically generated objects, so it feels as though you were just calling local async methods.
Useless JS library #1 will be a layout manager, a program that manages panes and tabs, context menus, toolbars and a menubar much like Visual Studio, and let all of that communicate through Useless JS library #0.
Since JS is sloooooow, I try to make everything run the fastest possible, trading startup for runtime resource usage. #0 fulfills this, any message will take exactly 4 stops, although registering a callable method set takes .3 sec.8 -
Followup to https://devrant.com/rants/2178597/...
It gets worse.
`if len(Replace({ODWR_CLAIMSNAPSHOT.LIMIT_DESCR}, '/', '-')) > 0`5 -
Today I learned how to read extract and parse a multi lvl XML file in Perl, only took 4 hours to make the script from 0 knowledge of Perl.
-
Electronics question:
Potentiometers
Hey guys. I'm searching for potentiometer calculators but I have a problem...
Where do I get the R1 and R2 for a given pot?
I wanted to know what pot should I use to regulate 0-12V and 0-5V.
Also, can this potentiometer handle a 400w power supply current?:
https://build-electronic-circuits.com/...
I'm designing the box for my power supply and I want to regulate the voltage on one of the exits.9 -
Full code base with 0 comments. Either it's utter genius or terribly poor.
And I'm sitting here reviewing a PR.4 -
(found on a german blog)
Apparently the DoD saw itself in the need of writing a document to assist at detecting agile bs.
https://media.defense.gov/2018/Oct/... -
I was working on a bug in a parser for the response from an api which returns 'n/a' when a certain measurement isn't available. The code was "if ($value == 'n/a')" and when this was true the value was rejected (language is php).
Some of you may instantly understand the problem here. I didn't. Some of the measurements were 0 which is ok, but for some reason it didn't accept them.
Then I discovered the bitter truth:
0 == 'n/a' is true!
Apparently php tries to convert the string to a number to compare it and if it fails it returns false, so false == 0
😞3 -
Q) 0 is false and !=0 is true.right??
A) 1,2,3,4.........................................................................................................................∞ -
Time since the last bug caused by blindly copying code in a if/else and forgetting to change a variable: 0 Hours.
-
Everytime anywhere any programming language, the example for exception handling is always
a/0;
Why god why??1 -
On Windows, which one line input will get this code to print "Finally I get a sticker. Yayyyy!!!" immediately
#include <stdio.h>
int main()
{
char *c = (char*) malloc(sizeof(char) * 10);
int rants = 0;
while(rants<20)
{
printf("U don't want me to get a sticker?\n");
scanf("%s", c);
if(c[0] == 'y')
rants--;
else
rants++;
}
printf("Finally I get a sticker. Yayyyy!!!\n");
} -
People hate on Python a lot. I just used the Python ternary operator for the first time. I found it easier to read than the C++ ternary operator:
0 if i==0 else 2 if i==segmentMax-1 else 1
vs
i==0 ? 0 : i==segmentMax-1 ? 2 : 1
I think Python did a good job in this case.18 -
using System;
using System.Text;
using System.Text.Encodings;
//Bitwise XOR operator is represented by ^. It performs bitwise XOR operation on the corresponding bits of two operands. If the corresponding bits are same, the result is 0. If the corresponding bits are different, the result is 1.
//If the operands are of type bool, the bitwise XOR operation is equivalent to logical XOR operation between them.
using System.Text.Unicode;
using System.Windows;
using System.IO;
namespace Encryption2plzWOrk
{
class Program
{
static void Main(string[] args)
{
//random is basically a second sepret key for RSA exhanges I know there probaley is a better way to do this please tell me in github comments.//
Random r = new Random();
int random = r.Next(2000000,500000000);
int privatekey = 0;
int publickey = 0;
string privateKeyString = Console.ReadLine();
byte[] bytes3 = Encoding.ASCII.GetBytes(privateKeyString);
foreach(byte b in bytes3)
{
privatekey = b + privatekey;
}
int permutations = random/ 10000;
if(privatekey < 256)
{
while(permutations > 0)
{
foreach (byte b in bytes3)
{
privatekey = privatekey + (privatekey ^ permutations)*20;
}
}
}
publickey = privatekey*random;
Console.WriteLine("your public key is {0}",publickey);
}
}
}
would this be considerd ok HOBBYIST encryption and if not how would I do a slow improvment I used bitwise to edit bits so thats a check :D12 -
Unicorn Themed day at code club ^_^
``` """ unicorn finder """
from random import randint
class UnicornFinder:
""" UnicornFinder class finds uncorns """
def __init__(self):
pass
def find_unicorn(self):
""" find a unicorn """
unicorn = True
for i in range(0, 31):
if randint(0, 7) != 7:
unicorn = False
break
if unicorn:
print("u200 unicorn found")
else:
print("u404:: unicorn not found")
if __name__ == '__main__':
UnicornFinder().find_unicorn()
```1 -
GitLab, you really should fix your CI.
I mean, I know .gitlab-ci.yml has to be written carefully, having in mind that GL shell is a castrated bourne shell, but come on... Failing a pipeline because I used a semicolon in an `echo` parameter string?
echo ""items: 0" ## this will fail
echo "items 0" ## this will pass
This is a bit too much.
Removed the semicolon and the pipeline worked just fine.11 -
i'm trying to figure out how to work this;
The element now has an id of thumbnail. With this selector, use the example CSS values above to place a box-shadow on the card.
this is the css values;
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
and this is the code i used;
.thumbnail {
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
but it's mot working on the fcc site.2 -
Software development process
0:I can't fix this
1:Crisis of confidence
2:Questions career
3:Questions life
4:Oh fuck it was a typo ,chill :3 -
I've noticed that on the web view of devRant, the notification counter updates in real time.
So I opened up the Inspect Element and checked for any polling related code (Socket.io) or something.
What I found was that this endpoint is called on a loop -> https://devrant.com/api/devrant/...
And the response format contains ->
{
"success": true,
"rants": [],
"settings": {
"notif_state": -1,
"notif_token": ""
},
"set": "64d68f5a7acd4",
"wrw": 376,
"dpp": 0,
"num_notifs": 0,
"unread": {
"total": 0
}
}
I assume `num_notifs` is the notification counter.
So, my question is is this practice good for implementing real time notifications?3 -
I've been working with JavaScript for nearly a decade now and yet I still get fooled from time to time by the fact that 0 == false.11
-
k8s is so good orchestrating its shit, yet it can't handle a node rolling update with deployments having one replica and a PDB of unavailable=0,
Dude... make a gooddamn exception, surge a damn pod for draining the node. -
Did 2 leetcode today (technically 1)
https://leetcode.com/problems/...
idea:
* Palindrome means cut it half, rearrange the other half, will equal each other.
* Using javascript new map() to build a hash map
* Loop the hash, add up quotient*2, add up remainder.
* if remainder > 1, then return_sum+1
https://leetcode.com/problems/...
seen a few times in interview.
* do the big one first, i.e. if(n % (3*5) === 0)
* then n%3 === 0
* then n%5 === 01 -
Today, I saw a table mean to store tags designed horizontally, each column store a tag with value 1 or 0. 🤦🏻♂️
-
usefull=accomplishmentsInLifeToday
thingsDoneToday=list()
minutesInDay=1440
minutesRemaining=countdown(minutes)
void endOfTheDay:
if len(thingsDoneToday) > 0:
print("What a productive day huh?!")
else:
print("You lazy caffeine maniac... Get up and code!")
while minutesRemaining != 0:
if usefull.done():
thingsDoneToday.append(usefull)
else: continue
endOfTheDay()
Prints: You lazy caffeine maniac... Get up and code!
Plot Twist: Doesn't even print because it's full of bugs. Fuuuuuuu! -
MP3 did not get re-licensed by the Fraunhofer institute - they want to push a new format :0
MPEG-H?5 -
Okay, so, I have a functional snort agent instance, and it's spewing out alerts in it's "brilliant" unified2 log format.
I'm able to dump the log contents using the "u2spewfoo" utility (wtf even is that name lol... Unified2... something foo) but... It gives me... data. With no actual hint as to *what* rule made it log this. What is it that it found?
All I see are IDs and numbers and timings and stuff... How do I get this
(Event)
sensor id: 0 event id: 5540 event second: 1621329398 event microsecond: 388969
sig id: 366 gen id: 1 revision: 7 classification: 29
priority: 3 ip source: *src-ip* ip destination: *my-ip*
src port: 8 dest port: 0 protocol: 1 impact_flag: 0 blocked: 0
mpls label: 0 vland id: 0 policy id: 0
into information like "SYN flood from src-ip to destination-ip" -
DevRant.Pet PetMaker(Account myAcc){
List<Account> accs = new List<Account>();
For(int i=0; i<100){
myAcc.Post(new Rant());
If(i%10==0)
accs.Add(new Account());
}
Foreach(Rant r in myAcc.rants){
Foreach(Account a in accs){
a.PlusPlus(r);
}
}
return myAcc.Buy(new Pet(cat));
} -
A usefull function, everyone should have near by. May requires some optimisations.
/// <summary>
/// DoEs tHiS To tHe pRoViDeD StRiNg. StArTs aLwAyS WiTh a cApItAl
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string DoThIsToThEtExT(string s)
{
var array = s.ToCharArray();
Parallel.For(0, s.Length, (index) =>
{
if (index % 2 == 0)
{
array[index] = array[index].ToString().ToUpper()[0];
}
else
{
array[index] = array[index].ToString().ToLower()[0];
}
});
return new string(array);
}3 -
num = float ("input a number:")
if num>0:
print ("it is a positive number")
else num=0:
print ("it is zero")
else:
print ("it is a negative number")1 -
Hello guys!
There is any web designer around here? i know there is! I need your help
I'm trying to join a web design school, but they ask me to get some real feedback from web designer before. some of you are willing to answer few question?
there is a google form if you prefer:
https://docs.google.com/forms/d/...2 -
function woodo {
if [[ $EUID > 0 ]]; then
echo "It's a wierd tree"
else
echo "The wierd tree doesn't like the squirtbottle."
echo "The wierd tree attacked!"
fi
} -
When a function has parameters for "limit" and "skip", make sure to double check those first when something seems broken. I switched them around so limit was 0, and I kept wondering why it returned 0 objects. It took me way too long before I figured that one out...
-
My question is"which value of 'a' and 'b' will give me output '1' not '0'?
C language's code is below here
#include<stdio.h>
int main()
{ float a=1.2,b=10.7;
printf("output is = %f",a&&b);
Return 0; }16 -
Not a programmer just a CS student. Since I'm not appearing in my online classes I'm way far from my syllabus. I want to learn C# from 0. Suggest tutorials 😔14
-
Hi everyone, I have such a task: “Given an integer square matrix. Determine the minimum among the sums of diagonal elements parallel to the main diagonal of the matrix.” I have a code but I have problems compiling a flowchart for it, can you help me with compiling a flowchart or give tips? thanks in advance!
Thats my code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N_MIN -3
#define N_MAX 5
int main(int argc, char *argv[]){
int s,i,j,k,l,s1,t2,t1;
int a[5][5];
srand(time(NULL));
for(i=0;i<5;i++){
for(j=0;j<5;j++){
a[i][j]=rand()%(N_MAX-N_MIN+1)+N_MIN;
}
}
for(i=0;i<5;i++){
for(j=0;j<5;j++){
printf("%3d ",a[i][j]);
}
printf("\n");
}
k=0;
s=0;
l=0;
for (i=0; i<5; i++){
for (j=0; j<5; j++){
if (a[i][j]>=0){
if(a[i][j]%2==0)
l+=a[i][j];
k++;
}
}
if (k==5){
l=l;
}
else {
l=0;
}
s=s+l;
k=0;
}
s1=a[0][5-1];
for(i=1; i<5; i++){
t1=t2=0;
for(j=0; j<5-i; j++){
t1+=a[i+j][j];
t2+=a[j][i+j];
}
if(t1<s1) s1=t1;
if(t2<s1) s1=t2;
}
printf("vivod %d %d\n", s,s1);
return 0;
}2 -
Tried to set "Executor count" of a Jenkins slave node to "0" in a naive attempt to disable it temporarily.. Jenkins crashed by "Divide by zero".. It is surely a top quality(!!) tool...