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 - ".equals"
-
Happy today! 13th of September. The 256th day of the Year, that equals to 11111111 in Binary. Finally, Happy Programmer’s Day, The people who Dev & Rant 😍🤗🎂7
-
And that's why there are scientific programming languages:
"Hey, you are the Java guy, aren't you? My Java is broken!"
Me: *Takes a look at the code*
if ("4+4".equals("5+3")) {
System.out.println("Same result!");
} else {
System.out.println("Different result!");
}15 -
Please kindly fuck off. I don't need your genderbiased bullshit. I couldn't care less about a programmer's gender.
I'm also aware about the margin between the numbers of female and male dev who want to study CS, but if you seriously think that a learning algorithm is biased on gender and ethnic it's creator, I will have to kindly remind you that math doesn't support an output based on your gender.
Now please get the fuck off my sacred newsfeed...69 -
PSA: An exclamation point is not devRant's version of a hashtag. It means 'not,' as in != means 'not equals.' So when you type '!rant' and it's a rant, you're creating a theoretical assertion error.
Let's all do our part to keep devRant theoretical error free! 👍😁 *Cheesy music*10 -
The programmer who killed people: Not so talented programmer named John, made a mistake in his code. because of this mistake the program users spent 15 minutes to do a workaround. this program had 10 million users. In general the users spent 150 million minutes because of john's mistake, which is 2.5 million hours. if a person sleeps about 8 hours a day, he have 16 active hours. which means john wasted 156,250 human days that equals to 427.8 human years. people leave approx. until the age of 64, that means John just killed 6.68 people because of his bug. So john, how do you sleep at night?10
-
My 4yo monster just randomly told me:
"Mommy! One plus two plus three plus four plus five equals fifteen!"
I'm so proud.
And really surprised 🤔
I've been teaching him basic math (adding and subtracting numbers 0-20), but haven't gone beyond two operations / three numbers.10 -
Today i switched
That equals -1 hardcore Windows-user, +1 Debian-user
Not even dual boot
Wish me luck, will need it13 -
The fact that my wife thinks Devrant is lame is for me more confirmation that Devrant is the only social network for me worth spending time on. Thanks @dfox for making the world a better place for developers.2
-
fork() can fail: this is important
Ah, fork(). The way processes make more processes. Well, one of them, anyway. It seems I have another story to tell about it.
It can fail. Got that? Are you taking this seriously? You should. fork can fail. Just like malloc, it can fail. Neither of them fail often, but when they do, you can't just ignore it. You have to do something intelligent about it.
People seem to know that fork will return 0 if you're the child and some positive number if you're the parent -- that number is the child's pid. They sock this number away and then use it later.
Guess what happens when you don't test for failure? Yep, that's right, you probably treat "-1" (fork's error result) as a pid.
That's the beginning of the pain. The true pain comes later when it's time to send a signal. Maybe you want to shut down a child process.
Do you kill(pid, signal)? Maybe you do kill(pid, 9).
Do you know what happens when pid is -1? You really should. It's Important. Yes, with a capital I.
...
...
...
Here, I'll paste from the kill(2) man page on my Linux box.
If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), ...
See that? Killing "pid -1" is equivalent to massacring every other process you are permitted to signal. If you're root, that's probably everything. You live and init lives, but that's it. Everything else is gone gone gone.
Do you have code which manages processes? Have you ever found a machine totally dead except for the text console getty/login (which are respawned by init, naturally) and the process manager? Did you blame the oomkiller in the kernel?
It might not be the guilty party here. Go see if you killed -1.
Unix: just enough potholes and bear traps to keep an entire valley going.
Source: https://rachelbythebay.com/w/2014/...12 -
Why do programmers always mix up Halloween and Christmas?
Because Oct 31 equals Dec 25.
*badum tsss* -
After heck a lot of hours of debugging my Java code which looked all right, found out my mistake was just using == instead of equals()5
-
Today was fucking awesome!
I always wanted to do a project in C++ since I've been more of a Java guy for years now.
And today, I finally wrote a full console program in C++! (For windows, it's a .exe)
The purpose of that program is to show if a file has a file lock on it (because of copying for example).
It started as simple as that, but got complicated quickly:
- It needs colors! So I added colors.
- Just a single file? Boring. I need wildcards, so I can put a * for anything in the file name! Jup.
- Just one directory? Boring. I need a recursive directory walk! Got it.
- But wait! There has to be an option to switch between recursive and wildcard/single mode! So I checked if the first argument equals "-r"! Hacky but works.
- Oh uh... that spams a lot now! The purpose was to show locked files, so I need another argument to specify that I only want to see locked files! Damn now it get's hard... I need a Linux-like command line argument parser (this -h and -s "hello" stuff). So I took the opportunity to write one myself! Done.
- Refactoring everything to use my new fancy parser...
- Adding more and more arguments, just because I can:
- "-d" hides "access denied" messages
- "-l" shows only locked files
- "-r" activates recursive directory walk
- "-f" formats everything nicely, basically printf("%-150.150s | %s", filename, locked); a maximum width which get's truncated if too long so everything lines up nicely
- "-h" which of course displays the help page
- "-w file" watches a file, if the file is locked it will refresh every 500ms, if it's still locked nothing happens, if it's unlocked, the program prints "unlocked" in green and exits. And yes, it does have a rotating line (something like this: "-" "\" "|" "/" "-" and so forth...)
That project was just awesome to make. I learn languages fastest if I just do a big project in them, and today, I really learned a lot.
Thank you for reading all this!3 -
Just looking at code, my colleague ("Senior Java Developer"), wrote...
if (process == "null") {...}
As you can guess, process is a String.
I just don't know what I can tell him. It's just so wrong, in every possible way...10 -
My last special snowflakes teacher story. This happend last Friday.
Background: we had to do a "little" project in less than 2 weeks (i ranted about that) and got our degree on Friday. I did a perfectly fine meal suggester, with in my opinion one of the best codes i've ever written.
After getting my degree (which is totally fine and qualifies me as IT technician/ "staatlich geprüfte Informationstechnische Assistentin") i asked him what my grade for the project was.
Me: what was my grade for the project again?
Him: i left it at 90%
Me: why exactly? You seemed to be really excited and liked it obviously. And there was no critique from you after my presentation.
Him: yadda yadda. I can't give you more. Yadda yadda be happy i didn't lower your grade.
Me: why would you lower my grade? This doesn't make sense at all. I matched all your criteria. You wanted a program everyone loved, everyone wanted to buy. There you go. I made exactly that.
Him: i can't give you a 1 (equals an A)
Me: why not?
Him: you wrote to much. I didn't want so much (he never specified a maximum). And you used to advanced code. And there were so many lists and ref - methods. The class couldn't benefit from it.
Me: Excuse me!? The only "advanced code" i used was a sqlite library. And i explained what i did with that. What do you mean by "so many lists" and ref-menthodes. In which methodes am i using ref?
Him: I don't know, i just skimmed through the code.
Me, internal: WHAT THE FUCKING HELL!?
Me: so you are telling me, you didn't even read my code fully and think it is too advanced for the class? And because of that you give a 2 (equals a B)?
Him: yes
I just gave him a deathstare and left after that. What the hell. Yes, i used encapsulation - which is something we hadn't done much in class. But the code is still not more advanced because i use more files -.-16 -
Me (experienced java dev) in an interview..
C: „what’s the difference between equals and equals equals and equals equals equals in js?“
Me: *i explained it perfectly*
C: „what’s the difference in Java between equals and equals equals and dot equals?“?
Me: „sorry, I don’t know. I’ve never ever seen .=„..
About 15 min after the interview, I was like: „holy moly fucking shit, please shoot me.. he meant .equals.. not .=....
For the devs: I‘M FUCKING STUPID!!!!
For the beginners: THATS the importance of „context“!4 -
Why do people say "Well, I don't know about that" to voice disagreement?
If you admit your own naivety on a subject compared to your peers, if you admit that you do not have the required knowledge to have formed an opinion, how can you disagree?
So it can either be expressed with genuine innocence, like 'Well, I don't know about that, tell me more!', which is never the case.
Or it means "Well I don't know anything about that... and I'm ashamed of the fact that I can't find any counter argument, so I refuse to trust your fucking expertise, shut the fuck up until I give you the right to voice your knowledge"
Which is a bit rude.
Now that we're on the topic of annoying expressions and platitudes...
"It's not rocket science" -- Rocket science, understanding how a rocket works, is surprisingly simple. You fill a cylinder with fuel and oxygen, add a pump or two, put some sparks underneath. Chemical reaction equals energy, direct energetic particles using a nozzle, Newton's first law does the rest. It's so simple that people don't actually study rocket science. They study aerospace engineering, or astrodynamics, which are difficult topics.
So if someone says "Devops is not rocket science", they're right, but for the wrong reason. It's actually harder than rocket science. Maybe easier than developing thermal protection system materials or solving n-body orbital problems with a slide ruler though.
"Great minds think alike" -- No, great minds actually think creatively and generate unique thoughts, if two minds think alike, the solution was just fucking obvious.
"Don't reinvent the wheel" -- First of all, pretty much nothing in code looks or even remotely functions like a simple wheel. Even metaphorically, all existing code equates to oval or square wheels. If you said "Hey, don't bother making better wheels, I like my ride to be bumpy because it stimulates my asshole", say no more, who am I to come between a product manager and their anal stimulation.
Anyway, those were four coworkers who I would've strangled with an Ethernet cable if it weren't for a certain pandemic and the risk of infection which comes with choke-coughing.
What are your linguistic pet peeves you get homicidal over?23 -
About 2 years ago, our management decided to "try outsourcing". I was in charge for coordinating dev tasks and ensuring code quality. So management came up with 3 potential candidates in India and I had to assess them based on Skype calls and little test tasks. Their CVs looked great and have been full of "I'm a fancy experienced senior developer." ....After first 2 calls I already dismissed two candidates because they had obviously zero experience and the CV must have been fake. ..After talking to the third candidate, I again got sceptical. The management, however, started to think that I'm just an ass trying to protect my own position against outside devs. They forced me to give him a chance by testing him with a small dev task. The task included the following statement
"Search on the filesystem recursively, for folders named 'container'. For example '/some_root_folder/path_segments/container' " The term 'container' was additionally highlighted in red!
We also gave him access to a git repo to do at least daily push. My intention was to look at his progressions, not only the result.
I tried the task on my own and it took me two days, just to have a baseline for comparison. I, however, told him to take as much time as he needs. (We wanted to be fair and also payed him.)
..... 3 weeks went by. 3 weeks full of excuses why he isn't able to use git. All my attempts to help him, just made clear that he has never seen or heard of git before. ...... He sent me his code once a week as zip per email -.- ..... I ignored those mails because I made already my decision not wanting to waste my time. I mean come on?! Is this a joke? But since management wanted me to give him a chance .... I kept waiting for his "final" code version.
In week 5, he finally told me that it's finished and all requirements have been met. So I tried to run his code without looking at it ..... and suprise ... It immediately crashed.
Then I started to look through the code .... and I was ..... mind-blown. But not in a good way. .....
The following is what I remember most:
Do you remember the requirement from above? .... His code implementing it looked something like this:
Go through all folders in root path and return folders where folderName == "/some_root_folder/path_segments/container".
(╯°□°)╯︵ ┻━┻
Alone this little peace of code was on sooooooo many levels wrong!!!!! Let me name a few.
- It's just sooooo wrong :(
- He literally compared the folderName with the string "/some_root_folder/path_segments/container"...... Wtf?!?
- He did not understand the requirement at all.
- He implemented something without thinking a microsecond about it.
- No recursive traversal
- It was Java. And he used == instead of equals().
- He compares a folderName with a whole path?!? Wtf.
- How the hell did he made this code return actual results on his computer?!?
Ok ...now it was time to confront management with my findings and give feedback to the developer. ..... They believed me but asked me to keep it civilized and give him constructive feedback. ...... So I skyped him and told him that this code doesn't meet the requirements. ......... He instantly defended himself . He told me that I he did 'exactly what was written in the requirements document" and that there is nothing wrong. .......He had no understanding at all that the code also needs to have an actual business purpose.
(╯°□°)╯︵ ┻━┻
After that he tried to sell us a few more weeks of development work to implement our "new changed requirements" ......
(╯°□°)╯︵ ┻━┻
Footnote: I know a lot of great Indian Devs. ..... But this is definitely not one of them. -.-
tl;dr
Management wants to outsource to India and gets scammed.9 -
condition == true
is for boys,
public static boolean isTrue(boolean condition) {
try {
return new Boolean(condition).equals(Boolean.parseBoolean(new String(Boolean.toString((boolean) Boolean.class.getField(String.valueOf(true != false).toUpperCase()).get(null)).toString().toCharArray())));
} catch(Throwable t) {
return condition;
}
}
is for men.6 -
I am tired of toxic politics at work.
Signs of a toxic workplace:
* (good) decisions are discouraged rather than encouraged.
Someone wants to introduce a great optimization and guess what the reply is (often from someone IT-ignorant): wait a minute, you can't do that because we have all these nifty little hacks and if you dare to suggest change to our shitty system, we could not allow that! We want to stay in our comfy zone, no no!
* no one can make a decision unless Mr. favorite-developer-everyone-likes says it's a good idea. And even if he's wrong, no one cares to listen to anyone else's idea on it. Stupid Feudalism. One man decides over the entire codebase. That's just idiocy. Where's TEAM in there?
* thinking years of experience equals intellectual capacity. It certainly does not! There are senior developers with 15 years of experience who don't even know how to open commandline, or they didn't even know about Chrome developer tools, or how the HTTP spec is built. That shit just makes me cry inside. How can you give these peoples the title of senior when they know less than a freshman year kid?!
* ignoring people's education and/or capacities. "You just graduated, so you're a noob". Right, I know more than you, you idiot. You've demonstrated your ignorance often enough. Stupid ignorant colleagues.
* blaming politics (every team blames the other team and there's constant tension)
* roaming ignorance (no one in the company, and I mean no one, besides me, knows enough about Information Technology to make competent decisions or analysis)
Politics:
What gives testers the idea that they know more than other members of the team? Why do they treat devs like they are mentally challenged?
What gives PO's that same idea?
What gives managers the idea that they can just yell at developers and threaten them with time pressure? Yeah, because the customers are breathing down their neck.
Just because I am a Junior Developer, that makes me stupid? I am tired of no one caring to listen to my ideas. I could save the company at the snap of a finger but everyone ignores my opinion (and often facts) on things.
People come in and instead of asking me for help, they ask everyone else for help, including the people who don't know shit about IT; now that's insulting.
Anyway, toxic politics.3 -
When your specs simply won't run new code no matter what you do, non-conditioned (and unmodified) calls don't get called, and 2+2 somehow equals Q, you know it's time to give up and restart the simulation by going to bed.
Except it's early afternoon and the project deadline is tonight. 😔
Back to debugging reality.11 -
Been programming Java for a few weeks now, and WTF is this, Java?!
"Example".equals("Example")
What is wrong with the form that a dozen of other languages use?
"Example" == "Example"
P. S. If you don't know Java, the latter one compares for the type of objects and always returns true in this case.15 -
Fun drinking game: work on a legacy system for a few hours. Every time you say "what the fuck?" equals 1 shot.3
-
In my software development class today, the teacher asked us what a double equal sign means, and I swear to god, a student said “it double equals that value” 🤦♂️4
-
The legacy codebase, episode 4584985948:
- outdated comment
- die parentheses space string no-space parentheses
- die AND exit, just to be on the safe side
- won't comment about the screaming boolean
- at least they used triple equals (and yep, that's a font ligature)4 -
Welp, here it goes:
High school is feeding me a huge amount of shit that I do not care about. This, causes me not to have enough time to carry on my own programming and infosec studies due to a lack of time, despite the fact that I'm pretty organized. Among all that, is the fact that I have 3 weekly martial arts training in the evening, which equals to even less time.
I am starting to feel quite shitty about this situation, and no, I'm not going to wait precious years of my life before continuing with my studies.
Let's hope I'll pull through. :(3 -
Riddle:
Alice and bob want to communicate a secret message, lets say it is an integer.
We will call this msg0.
You are Chuck, an interloper trying to spy on them and decode the message.
For keys, alice chooses a random integer w, another for x, and another for y. she also calculates a fourth variable, x+y = z
Bob follows the same procedure.
Suppose the numbers are too large to bruteforce.
Their exchange looks like this.
At step 1, alice calculates the following:
msg1 = alice.z+alice.w+msg0
she sends this message over the internet to bob.
the value of msg1 is 20838
then for our second step of the process, bob calculates msg2 = bob.z+bob.w+msg1
msg2 equals 32521
he then sends msg2 to alice, and again, you intercept and observe.
at step three, alice recieves bob's message, and calculates the following: msg3 = msg2-(alice.x+alice.w+msg0)
msg3 equals 19249. Alice sends this to bob.
bob calculates msg4 = msg3-(bob.x+bob.w)
msg4 equals 11000.
he sends msg4 to alice
at this stage, alice calculates ms5.
msg5 = (msg4-(alice.y)+msg0.
alice sends this to bob.
bob recieves this final message and calculates
the sixth and final message, which is the original hidden msg0 alice wanted to send:
msg6 = msg5-bob.y
What is the secret message?
I'll give anyone who solves it without bruteforcing, a free cookie.18 -
Core library was giving serious blow out of execution speed as data file size increased.
Traced it back to a GetHashCode implementation that was giving too many collisions for unequal objects, so when used as the key in a hash table it was causing the lookup to fall back to checking Equals (much slower).
Improved the GetHashCode implementation, and also precalculated it on construction (they were immutable objects), and run time went to warp speed! Was very happy with that.
Obviously put in a thread sleep to help manage expectations with the boss/clients going forwards. Can’t give those sort of gains away in one go. Sets a dangerous precedent.1 -
All set up.
I found the shelf under the "ghetto" blaster outside today. Cleaned it up and it was good to go.
Put my dad's old music box on top of it. It's a bit dusty. Also need to clean that up. But for now I think it looks cool from under my desk haha4 -
I wonder if they have speech to text for code.
Var cars equals left bracket quote Saab quote comma quote Volvo quote comma quote BMW quote right bracket semi-colon4 -
If you ask a scientist what pi is, he'll tell you it equals 3.14159..
If you ask a mathematician, he'll tell you pi equals the circumference of a circle divided by its diameter..
If you ask an engineer, he'll say "Pi? Well, it's about 3, but we'll call it 4 just to be safe.."
But if you ask a kid, he’ll ask if he can have ice cream with it...!7 -
A Rant that took my attention on MacRhumors forum.
.
I pre-calculated projected actual overall cost of owning my i5/5/256 Haswell Air, which I got for $1500.
After calculations, this machine would cost me about $3000 for 3 years of use.
(Apple Care, MS Office Business, Parallels, Thunderbolt adapter to HDMI, Case... and so on).
Yea... A lot of people think it's all about the laptop with Apple. nah... not at all. There's a reason Apple is gradually dropping the price of their laptops.
They are slowly moving to a razor and blade business model... which basically is exactly what it sounds like - you buy the razor which isn't too expensive, but you've got no choice but to buy expensive additional blades.
I doubt Apple is making much money from laptop sales alone... well definitely not as much as they were making 5 years or so ago (remember the original air was about $1800 for base model, and if i remember correctly - $1000 additional dollars to upgrade to 64GB SSD from the base HDD.
Yes, ONE THOUSAND DOLLARS FOR 64GB SSD!
Well, anyways, the point is that Apple no longer makes them BIG bucks from the laptop alone, but they still make good profits from upgrades. $300 to go to 512GB SSD from 256, $100 for 4GB extra ram, and $150 for a small bump in processor. They make good profits from these as well.
But that's not where they make mo money. It's once you buy the Macbook, they've got you trapped in their walled garden for life. Every single apple accessory is ridiculously overpriced (compared to market standards of similar-same products).
And Apple makes their own cables and ports. So you have to buy exclusively for Apple products. Every now and then they will change even their own ports and cables, so you have to buy more.
Software is exclusive. You have no choice but to buy what apple offers... or run windows/linux on your Mac.
This is a douche level move comparable to say Mircrosoft kept changing the usb port every 2-3 years, and have exclusive rights to sell the devices that plug in.
No, instead, Intel-Microsoft and them guys make ports and cables as universal as possible.
Can you imagine if USB3.0 was thinner and not backwards compatible with usb2.0 devices?
Well, if it belonged to Apple that's how it would be.
This is why I held out so long before buying an apple laptop. Sure, I had the ipod classic, ipod touch, and more recently iPad Retina... but never a laptop.
I was always against apple.
But I factored in the pros and cons, and I realized I needed to go OS X. I've been fudged by one virus or another during my years of Windows usage. Trojans, spywares. meh.
I needed a top-notch device that I can carry with me around the world and use for any task which is work related. I figured $3000 was a fair price to pay for it.
No, not $1500... but $3000. Also I 'm dead happy I don't have to worry about heat issues anymore. This is a masterpiece. $3000 for 3 years equals $1000 a year, fair price to pay for security, comfort, and most importantly - reliability. (of course awesome battery is superawesome).
Okay I'm going to stop ranting. I just wish people factored in additional costs from owning an a mac. Expenses don't end when you bring the machine home.
I'm not even going to mention how they utilize technology-push to get you to buy a Thunderbolt display, or now with the new Air - to get a time capsule (AC compatible).
It's all about the blades, with Apple. And once you go Mac, you likely won't go back... hence all the student discounts and benefits. They're baiting you to be a Mac user for life!
Apple Marketing is the ultimate.
source: https://forums.macrumors.com/thread...3 -
Hello and welcome, to a presentation in which I will tell you my thoughts on the shortcomings of modern day computers and programming practices.
Computers are based on a very fundamental and old idea, folders, and files, a file is basically a concrete amount of data, whereas a folder is a group of files, and it comes from the real life concept of files and folders, now it might be quite obvious already that using a concept invented in 1898 by a guy called Edwin G. Seibels, might not be the best way for computers to function in the year 2020, but alas, it is.
Unless of course, you step into the world of a programmer.
A programmer’s world is much different, they use this idea of a data structure, or in simpler terms, an object. An Object is just like what you would think of as an object in your head, something with different properties that you can think about in different ways, for example your mobile phone, it has a battery percentage, it has a screen size, it has free space available. Programmers use these data structures to analyse data very quickly, like finding all phones with a screen size bigger than a certain size for example.
The problem is that programmers still use files and folders to create the programs that use these objects.
Consider this example.
Let’s say you want to create a virtual version of a drink bottle, consider what properties it will have, colour, volume, height, width, depth, material, etc..
As a programmer, you can leverage programming features and change the properties of a drink bottle directly, if you wanted to change the colour, you just say, drink bottle “dot” colour, equals blue, or red.
But if the drink bottle was represented as a file, all the drink bottles data would be inside the one file, so you would have to open the whole file, find the line or section of the file that has the colour data of the drink bottle, and select it, highlight it, delete what’s there, and type in your new value.
One way to explain this better is to imagine a folder that now represents the drink bottle, imagine adding a new file into that folder that represents each property I described before, colour, volume, etc.., well now, you could just open that folder, find the file for colour, either by looking with your eyes or you could do a file search in the folder for a file called colour, open it, and edit the value inside. This way of editing objects is the one that more closely represents the way programmers and a program itself interacts with objects inside a running programming language.
But the thing is, programmers don’t use the folder/file way of creating objects and putting them into programs, because it would be too cumbersome, they just create 1 file for an object, or have lots of objects in a file, and create all the objects in 1 file, and then run the program which creates the objects, then when they stop the program, it deletes the objects. So there is no actual link between the object in a file and the object that the program creates by reading the data from that file, if you change the object in your program, it does not get saved to the file.
So programmers created databases to house these objects, but there is still a flaw in databases, they are hard to interface with, and mostly databases are just used to send data or retrieve data from, programmatically, you can’t really browse a database the way you can browse the files on your computer. You can, but database interfaces are not made to be easily navigated the way files and folders are.
As it stands, there is no way to store objects instead of files on your computer and interact with them in complex ways the way programmers can inside the programs they create.
If the idea of an object became standard the way a file and folder is standard, I think it would empower human’s a great deal to express things far more easily and fluidly than they can today.
Thanks for reading.8 -
Wrote my first programs on my Commodore C64.
First program was a number guessing game where you needed to guess a number between 1 and 100. Shit had 300+ lines because I only new the if clause and the equals comparison.
I was 9.
Later a friend showed me Modula 2 and I was instantly in love with that language.
Real programming then in school (C, C++, µC assembler). -
Major rant incoming. Before I start ranting I’ll say that I totally respect my professor’s past. He worked on some really impressive major developments for the military and other companies a long time ago. Was made an engineering fellow at Raytheon for some GPS software he developed (or lead a team on I should say) and ended up dropping fellowship because of his health. But I’m FUCKING sick of it. So fucking fed up with my professor. This class is “Data Structures in C++” and keep in mind that I’ve been programming in C++ for almost 10 years with it being my primary and first language in OOP.
Throughout this entire class, the teacher has been making huge mistakes by saying things that aren’t right or just simply not knowing how to teach such as telling the students that “int& varOne = varTwo” was an address getting put into a variable until I corrected him about it being a reference and he proceeded to skip all reference slides or steps through sorting algorithms that are wrong or he doesn’t remember how to do it and saying, “So then it gets to this part and....it uh....does that and gets this value and so that’s how you do it *doesnt do rest of it and skips slide*”.
First presentation I did on doubly linked lists. I decided to go above and beyond and write my own code that had a menu to add, insert at position n, delete, print, etc for a doubly linked list. When I go to pull out my code he tells me that I didn’t say anything about a doubly linked list’s tail and head nodes each have a pointer pointing to null and so I was getting docked points. I told him I did actually say it and another classmate spoke up and said “Ya” and he cuts off saying, “No you didn’t”. To which I started to say I’ll show you my slides but he cut me off mid sentence and just yelled, “Nope!”. He docked me 20% and gave me a B- because of that. I had 1 slide where I had a bullet point mentioning it and 2 slides with visual models showing that the head node’s previousNode* and the tail node’s nextNode* pointed to null.
Another classmate that’s never coded in his life had screenshots of code from online (literally all his slides were a screenshot of the next part of code until it finished implementing a binary search tree) and literally read the code line by line, “class node, node pointer node, ......for int i equals zero, i is less than tree dot length er length of tree that is, um i plus plus.....”
Professor yelled at him like 4 times about reading directly from slide and not saying what the code does and he would reply with, “Yes sir” and then continue to read again because there was nothing else he could do.
Ya, he got the same grade as me.
Today I had my second and final presentation. I did it on “Separate Chaining”, a hashing collision resolution. This time I said fuck writing my own code, he didn’t give two shits last time when everyone else just screenshot online example code but me so I decided I’d focus on the PowerPoint and amp it up with animations on models I made with the shapes in PowerPoint. Get 2 slides in and he goes,
Prof: Stop! Go back one slide.
Me: Uh alright, *click*
(Slide showing the 3 collision resolutions: Open Addressing, Separate Chaining, and Re-Hashing)
Prof: Aren’t you forgetting something?
Me: ....Not that I know of sir
Prof: I see Open addressing, also called Open Hashing, but where’s Closed Hashing?
Me: I believe that’s what Seperate Chaining is sir
Prof: No
Me: I’m pretty sure it is
*Class nods and agrees*
Prof: Oh never mind, I didn’t see it right
Get another 4 slides in before:
Prof: Stop! Go back one slide
Me: .......alright *click*
(Professor loses train of thought? Doesn’t mention anything about this slide)
Prof: I er....um, I don’t understand why you decided not to mention the other, er, other types of Chaining. I thought you were going to back on that slide with all the squares (model of hash table with animations moving things around to visualize inserting a value with a collision that I spent hours on) but you didn’t.
(I haven’t finished the second half of my presentation yet you fuck! What if I had it there?)
Me: I never saw anything on any other types of Chaining professor
Prof: I’m pretty sure there’s one that I think combines Open Addressing and Separate Chaining
Me: That doesn’t make sense sir. *explanation why* I did a lot of research and I never saw any other.
Prof: There are, you should have included them.
(I check after I finish. Google comes up with no other Chaining collision resolution)
He docks me 20% and gives me a B- AGAIN! Both presentation grades have feedback saying, “MrCush, I won’t go into the issues we discussed but overall not bad”.
Thanks for being so specific on a whole 20% deduction prick! Oh wait, is it because you don’t have specifics?
Bye 3.8 GPA
Is it me or does he have something against me?7 -
When I first began with Python I really missed the static typed checking from Java, I barely know anything about a returned object from a method and have to read the API extensively for every new library.
After a while I finally understand why Python is so powerful, the combination of dynamic typed language and rich default methods make the language unbeatable for your productivity.
While Java's Object only has toString(), hashCode(), equals() or clone(), Python's basic Class has every fucking method for every scenario I could ever image. No wonder that libraries like numpy or pandas work so well and fluidly.8 -
When we subtract some number m from another number n, we are essentially creating a relationship between n and m such that whatever the difference is, can be treated as a 'local identity' (relative value of '1') for n, and the base then becomes '(base n/(n-m))%1' (the floating point component).
for example, take any number, say 512
697/(697-512)
3.7675675675675677
here, 697 is a partial multiple of our new value of '1' whose actual value is the difference (697-512) 185 in base 10. proper multiples on this example number line, based on natural numbers, would be
185*1,
185*2
185*3, etc
The translation factor between these number lines becomes
0.7675675675675677
multiplying any base 10 number by this, puts it on the 1:185 integer line.
Once on a number line other than 1:10, you must multiply by the multiplicative identity of the new number line (185 in the case of 1:185), to get integers on the 1:10 integer line back out.
185*0.7675675675675677 for example gives us
185*0.7675675675675677
142.000000000000
This value, pulled from our example, would be 'zero' on the line.
185 becomes the 'multiplicative' identity of the 1:185 line. And 142 becomes the additive identity.
Incidentally the proof of this is trivial to see just by example. if 185 is the multiplicative identity of 697-512, and and 142 is the additive identity of number line 1:185
then any number '1', or k=some integer, (185*(k+0.7675675675675677))%185
should equal 142.
because on the 1:10 number line, any number n%1 == 0
We can start to think of the difference of any two integers n, as the multiplicative identity of a new number line, and the floating point component of quotient of any number n to the difference of any number n-m, as the additive identity.
let n =697
let m = 185
n-m == '1' (for the 1:185 line)
(n-m) * ((n/(n-m))%1) == '0'
As we can see just like on the integer number line, n%1 == 0
or in the case of 1:185, it equals 142, our additive identity.
And now, the purpose of this long convoluted post: all so I could bait people into reading a rant on division by zero.30 -
Im new on GitHub, and google didnt give me an answer simple enough for me to understand, so here i go.
How do i commit to GitHub and keep my files up to date, but without committing my password/oauth tokens?
Does one remove the line before committing, or what are you supposed to do?
Im using IntelliJ, dark theme11 -
sounds logic, ..does it?
git commit -m "session now holds 'null' as date if equals today. This way a 'today' is always possible, even if yesterday was today and today is now the tomorrow from yesterday"
original german git message: "session hält 'null' als date, wenn gleich heute. So ist ein 'heute' immer möglich, auch wenn gestern heute war und heute mittlerweile das morgen von gestern."
Who finds the startrek reference? -
I've been away a while, mostly working 60-70 hour weeks.
Found a managers job and the illusion of low-level stability.
Also been exploring elliptic curve cryptography and other fun stuff, like this fun equation...
i = log(n, 2**0.5)
base = (((int((n/(n*(1-(n/((((abs(int(n+(n/(1/((n/(n-i))+(i+1)))))+i)-(i*2))/1))/1/i)))))*i)-i)+i))
...as it relates to A143975 a(n) = floor(n*(n+3)/3)
Most semiprimes n=pq, where p<q, appear to have values k in the sequence, where k is such that n+m mod k equals either p||q or a multiple thereof.
Tested successfully up to 49 bits and counting. Mostly haven't gone further because of work.
Theres a little more math involved, and I've (probably incorrectly) explained the last bit but the gist is the factorization doesn't turn up anything, *however* trial lookups on the sequence and then finding a related mod yields k instead, which can be used to trivially find p and q.
It has some relations to calculating on an elliptic curve but thats mostly over my head, and would probably bore people to sleep.2 -
So, I'm the engineering leader of a startup. This year, the company hired new directors and with that a new CPO. We've been using Google Workspace and have all our infrastructure on GCP. We never had any trouble with Google products. We also have Google SSO configured in almost every tool out there.
Yesterday, the new CPO, sent me a request to change "just some dns" on the domain. Those "just some dns" were Microsoft 365 mx, cname and text records.
I asked him if he was planning to switch to MS.
He answered: "yes! The team (a new team of marketing) wants to use PowerPoint and Teams".
I don't know you guys, but I hate MS products. They're just bad.
So, yes, it seems that now I'm gonna waste my time switching and configuring everything with MS just because they don't know other tools that are way better than any MS product!
I tried to convince him, this wasn't a good move, but it seems my opinion equals zero at this company.
I just hate this type of product managers that always wants to reinvent the wheel to let others see that they are doing something important when they're not.
Also hate when managers make decisions without ever consulting the people that will be affected by those decisions... But I guess that's how it works in this world...10 -
when you start using java again and can't figure out what's wrong all because of the stupid ".equals()" method1
-
I'm a C++/Obj-C programmer finding it ludicrously hard to switch to Swift.
I find that the constant ability (leading to very poor programmer code) to reduce syntax and add tokens reduces readability and nowhere is this more apparent that with closures.
I'm working through (to my shame) Ray Wenderlich's Swift course and the closure chapter has this:
PS I loathe K&R as much as I do Swift so it's all in Allman formatting for clarity.
let multiply: (Int, Int) -> Int =
{
(a: Int, b: Int) -> Int in
// do Something else
return a * b
}
Why oh why isn't this more simply and elegantly written as:
let multiply = (a: Int, b: Int) -> Int
{
// do Something else
return a * b
}
The equals sign shows clearly that it's a closure definition assignment, as does the starting 'let'. But this way all of the stupid excesses, like the 'in' keyword, the repetition of the params / return type only this time with useful labels and additional tokens are removed and it looks and reads much more like a regular function and certainly a lot more clearly.
Now I know that with the stupid ability of Swift you can reduce all this down to return $0 * $1, but the point I'm making is that a) that's not as clear and more importantly b) if this closure does something more than just one line of code, then all that complicated stuff - hinted to by the comment '// do Something else' means you can't reduce it to stupid tokens.
So, when you have a clousure that has a lot of stuff going on and you can't reduce it to stupid minimalism, then why isn't is formatted and syntactically better like the suggestion above?
I've mentioned this on the Swift.org (and got banned for criticising Swift) but the suggestions they came up with were 'use type inference' to remove the first set of params / return type and token.
But that still means the param list and return type are NOT on the same line as the declaration and you still need the stupid 'in' keyword!5 -
Best? Clojure docs. They have disqus-like thing under every function description where anyone can submit their usage example. One example times forty submissions equals forty examples!
Also w3c specs, nuff said.
Worst? GunJS. Multiple websites that look like each other plus GitHub wiki all with the same content but idk which one should I use, also there is no complete source, you have to look up everywhere. Also NextJS, they’re too busy pitching to investors, there is no way of contacting them, you’re in your own if you choose nextjs, that’s why I banned it everywhere I have the power to ban things -
Managed to derive an inverse to karatsuba's multiplication method, converting it into a factorization technique.
Offers a really elegant reason for why non-trivial semiprimes (square free products) are square free.
For a demonstration of karatsubas method, check out:
https://getpocket.com/explore/item/...
Now for the reverse, like I said something elegant emerges.
So we can start by taking the largest digit in our product. Lets say our product is 697.
We find all the digits that produce 6 when summed, along with their order.
thats (1,5), (5,1), (2,4), (4,2), and (3,3)
That means for one of our factors, its largest digit can ONLY be 1, 5, 2, 4, or 3.
Lets take karatsubas method at step f (in the link) and reverse it. Instead of subtracting, we're adding.
If we assume (3,3)
Then we take our middle digit of our product p, in this case the middle digit of 697. is 9, and we munge it with 3.
Then we add our remaining 3, and our remaining unit digit, to get 3+39+7 = 49.
Now, because karatsuba's method ONLY deals with multiplication in single digits, we only need to consider *at most* two digit products.
And interestingly, the only factors of 49 are 7.
49 is a square!
And the only sums that produce 7, are (2,5), (5,2), (3,4), and (4,3)
These would be the possible digits of the factors of 697 if we initially chose (3,3) as our starting point for calculating karatsubas inverse f step.
But you see, 25 can't be a factor of p=697, because 25 is a square, and ends in a 5, so its clearly not prime. 52 can't be either because it ends in 2, likewise 34 ending in 4.
Only 43 could be our possible factor of p.
And we *only* get one factor because our starting point has two of the same digit. Which would mean p would have to equal 43 (a prime) or 1. And because p DOESNT (it equals 697), we can therefore say (3,3) is the wrong starting point, as are ALL starting points that share only one digit, or end in a square.
Ergo we can say the products of non-squares, are specifically non-prime precisely because if they *were* prime, their only factors would HAVE to be themselves, and 1.
For an even BETTER explanation go try karatsuba's method with any prime as the first factor, and 1 as the second factor (just multiply the tens column by zero). And you can see why the inverse, where you might try a starting point that has two matching digits (like 3,3), would obviously fail, because the values it produces could only have two factors; some prime thats not our product, or the value one, which is also not our product.
It's elegant almost to the level of a tautology. -
JavaScript type comparisons. They are annoying, some times they don't make sense and they promote bug making.2
-
TFW you learn that trim(null) equals empty string in PHP.
I´m starting to understand why people seem to dislike PHP.6 -
Open for all.
Below are 4 sets of numeric data. Each set carries two numeric strings. Each occur in a pattern and each set below are n'th terms of the pattern. Each set equals to the value 50. The value of 50 can be obtained from either the first or the second string or even both.
Find a next term or even a n'th term of the pattern.
sets -
{ 738548109958, 633449000001000435 } , { 667833743011, 65173000001000838 } , { 314763556877, 652173000001000685 } , { 332455491545 , 65216100000100411 }
You will be rewarded
You will not fail5 -
The other day was reading someone else's shitty code which had taken an object into a set without implementing the hashcode and the equals, cursed the developer and fixed that and informed the QA about their lackadaisical attitude. Later on that fix broke some other functionality on live and now the QA team gives me the stares. Feeling like birdman...
-
I'm running into an issue with code coverage... I ran the analysis and it's penalizing unused getter, setters, equals, hashcode.
And the thing is I need those getters so GSON will serialize the fields...
How do you make coverage always > 80%?
Based on current analysis, I only get 60.15 -
When client budget is less than the time needed to do a good jobs.
Happens more than I like.
"We’ve all said we’d go back and clean it up later. Of course, in those days we didn’t know LeBlanc’s law: Later equals never."
-Clean Code1 -
C# :
Welcome to C#, as it is a very powerfull and typed language you will never have issues with Equals and "==".
Also C# : (image)
Edit : It's actually wrking as expected, but I would';ve guessed that "==" would wotk for basic types11 -
Sometimes my girl talks dirty to me. She says things like:
"I always use double equals in JavaScript"
And
"I don't leave comments in my code"2 -
I think someone already posted something similar but... a problem I had recently when developing a program in php was that my partner was tapping the spacebar twice in indents while I just used tab... You can imagine the result after the merge (plus no github, all by hand)... Had to review all the code top to bottom and fix the code because the teacher said that "bad indent on the code equals bad evaluation on this project, so learn how to indent!" why do people use spaces instead of tabs? is there any language that requires spaces for indents? if not, please stop!! Its painful just to watch and move across the code...6
-
Trying to setup a fucking google tag manager to get the fucking google analytics working.
Few years ago it was a 10 minutes work. Now I'm already at 4 hours. Fucking sick
WHY I say why I have two fucking equals accounts, FUCKING THE SAME.
And one is working the other one doesn't give a shit about my analytics.
Ehi, Tag manager, I just set up a Tag called "YourMother" related with its trigger called "Fuck" using same extra variable called "anal"
Can you just show it in my anal-ytics, fucking please?9 -
See now why I understand that in essence given a vector (parameters), you modify weights and biases minimally and these get passed through a set of dropoff style layers like ReLU and that in the end each layer leading to an output will basically sum up to a value that goes through sigmoid and concurrently equals the value desired once trained..... i don't see how this could cover all bases when parts of the math used to calculate the output is trigonemetric and polynomial. I mean not complex math ! Real basic things in my case, but a polar from cartesian coordinate conversion, angle and leg size, etc all going into determining that a target equals a landing zone and if not how to move things to it.
Is there something I'm missing where you kind of model the math because at best sin and cos could be a power series.77 -
Switching to Java after several years of c# experience(new project)... and it feels like lobotomy has been performed on both the language/machine and my part - no var keyword(yet), horrible work with the collections (but thank god we have at least the streams), basic things like Long are actual objects(not a value type), strings must be compared with .equals ... and suddenly even simple tasks take me horrendous amount of time.9
-
If(person.getState().equals("Texas")){
person.setCanDrive(false);
}
Like I was just driving to my class and so many people were driving like maniacs. So frustrating >. <3 -
!rant
If (LocalDateTime.now().toString(DateTimeFormatter.format(“yyyy-MM-dd”)).equals(“2017/10/17”)){
human.age++;
System.out.println(“Happy birthday old bastard!”);
}4 -
How to react to a coworker using equals() instead of equalsIgnoreCase() for checking case insensitive strings?19
-
Probably not worst but back when I was in graduate school I used '=' instead of '.equals()' for a string, by mistake. My professor was so pissed and taunted in front of whole class about how dumb people are here without taking any names(btw I didn't realize that guy was me until later) and gave me a low score
I told her later it really doesn't matter if I used either because '=' worked just fine in my case. She was a little more pissed after knowing that I wasn't wrong. 😜6 -
We have an unit test that tests the average of a sequence of numbers generated randomly using a gaussian distribution. Of course it fails from time to time, it's random! Failing to fail, would mean that the generator is not generating random numbers, therefore failure means success, but success does not mean failure.
Wait, why did we add this test in the first place?rant gaussian distribution statistics random of course it fails it's random bitches normal fail equals success unit test -
I'm getting annoyed by the smallest things, like when someone does "test".equals(var) instead of var.equals("test").
It not only reduces readability, it just doesn't look right to me. And I don't think there's a difference in performance between the 2.7 -
The rear ducking continues. We've built a reliable translator in the dumbest fucking way possible, it's just lovely. I simply reused the structure for feeding data to the VM assembler, an array of arrays, where there's one array of (ins [args]) per node in the parse tree.
It's nice because nodes can be solved out of order without affecting the actual sequence in which the instructions are output. And if one statement (node) equals multiple instructions, you just push multiple entries to the corresponding array, or push nothing if you need to output nothing. Easy as goblin pie.
This is enough to convert an input language to the assembly-like intermediate representation we use for the virtual machine. So then there's doing it backwards: walk the same array of arrays, and map those virtual instructions to a physical architechture. I guess I could do the encoding to native binary myself, it'd certainly be interesting to try, but I'm burnt-out already so I'll just use fasm for now.
Initial test: wrote a test program in my own stupid language, ran the translator, dump output to file, assemble that with fasm, run with r2 -d.
Crashes? No.
Runs fine? Yes and no.
For fuck's sake, I don't have syscalls. Mainly because the VM doesn't have an operating system, lmao. I was testing virtual programs by just freezing state, terminating, then dumping the fucking registers and stack to the console, we have no I/O to speak of. Not even a real 'exit', VM handles that by reading a return value every step like a mentally damaged son of a bitch.
So anyway, I manually paste the linux mambo, you know:
mov rax,60
mov rdi,0
syscall
And NOW our program can end execution without crashing.
Okay then, so does the test code work correctly?
** DRUM ROLL **
Yes.
Ladies and gentlemen, mother fucking PESO is now a compiled language, and going forward I will be expectantly receiving your marriage proposals for reviewing. Oh, but not so fast, we still need a frontend...
Well, we'll handle that in the next few days. I'm just glad to be *nearly* finished with this fucking compiler, I want nothing to do with anything else ever, but we know that's not going to happen, so Lord please end my pain.
No sponsor as this rant has been paid for by tax evasion. -
You know it will be a fucking glorious day when you open up that legacy project from 3 years ago.
Calling those NPM package dependencies "outdated" is an understatement...
3 years equals to roughly 1 million new JS hipster frameworks.1 -
It should be possible to prove the collatz conjecture by mapping the unit digit transitions between numbers, namely into a finite state machine. From there we could use predicates and quanitifiers to prove, by process of exclusion, that for any given combination of 10s digit and 1s digit, no number can transition to anything but whats specified in the state machine assuming that number equals x in x3+1 or x/2
Ipso facto, a series of equations proving by process of elimination, that state machines transitions are the only allowable ones, would prove the collatz conjecture by proving the fsm is a valid representation for any given integer N.
I'm actually working on it now but I don't know enough about modular arithmetic and predicate logic to write a proof. I just have the state diagrams on some dot matrix paper at the moment.
If anyone wants to beat me to it, feel free.
So for example any number ending in 13, will, after x3+1, end in 40.
Any number ending in 40 will end in 20. Any number ending in 20 will end in 10, which will end in 5 as the unit digit.
It's easier to prove in the single digit case, and the finite state machine for that is already written, at least on paper.
I'll post pictures when I get a chance.7 -
Is inserting a break statement anywhere but in a switch statement a horrible idea and results almost always in bad code? Why? My lecture notes say so. lol.
e.g.:
loop(someJsonDataSet){
if(company.getName().equals("xyz")){
break; // don't process records of this
company
}
}14 -
I saw a video on tiktok a couple days ago that had a pretty interesting opinion. The guy said that we should stop creating programming languages and stick to only a couple.
His main point was because with all these different programming languages, there is different syntaxes the programmer has to learn. Even some of the universal syntaxes are different in some languages. For example, in Rust, to print something you use “println!(...);”
He said this is counter productive because in a majority of other programming languages, the ! Means negation. He also said something about Golang also having some of those syntax problems but I can’t remember exactly.
His point was that if we stuck to a single syntax, then we could spend more time doing productive stuff and less time relearning how to do stuff with different syntax. For example, in mathematics all symbols have pretty much the same meaning across the field. An equals sign will always mean the same thing.
What do u guys think? I thought it was an interesting opinion and I think I agree to some degree . I’ll post the link to the video if I find it again23 -
I think that leaving a child of just a year or even few months in front of the tv equals to an adult watching porn, the more your baby keep watching the cartoons on the TV the more he is not satisfied and would like to watch something BETTER. Now let's compare it to us as Adults, the more asses and holes you watch on pornhub the more you don't feel satisfied and you keep looking for something more exciting, and that's how you damage your brain.
What do you think?12 -
Why do bitwise operators (and, or) have a lower precedence than equals?!?! What is the reason?😨
I have checked it in Java and JS...3 -
Where to start, maybe from string.
Empty string conditions and string comparison.
if “”: - python
“” == false - javascript
.equals() - java1 -
when you start using java again after using python for awhile and you can figure out why your strings conditions aren't working! Damn ".equals()" method as opposed to pythons "=="
-
What do you call a function based on (w*x) / (y*z)
where w and y remain the same, and x always increases linearly with z?
For example
at one point on the graph it might look like
(60*1) / (25*1)
and on the next it equals
(60*2) / (25*2)17 -
This is how to find the base needed for any integer value p, where p>=5, such that the logarithm always equals e in python.
log(p, e**(log(p, e**e))) # equals e
Doesn't do anything besides that but this is another identity isn't?24 -
Struggled whole day to remove duplicate objects from a list in java. Those objects (of a custom class) contain a unique id, the remaining properties can be identical across list items.
Wondered why hashset.add() always returns true and thus duplicates are still inserted.
Little did I forget about things like equals() and hashCode() 🤦1 -
So in the next term we're going to learn web dev(bootstrap and some javascript, no backend :( for now), the previous term was about c#. We'll have to build a website as a team (4-5 people) and everyone has a specific task and have to do the research on their own,but at the same time we can help each other out. OMG if the whole school was just like this I would be happy to come here every day lol! I also hope to improve on my social anxiety, but this could easily backfire depending on my future teammates, coz you know, in every highschool there have to be some badass kid whose intelligent equals with two rats...
So yeah, right now I feel 50-50% about this whole thing.1 -
When you debug and notice that "myString".equals("myString") evaluates to false...and after an hour realize it's a 'Byte Order Mark', which of course Java doesn't handle properly. Ended up using BomInputReader from Apache commons, which made my life simpler.
If I ever want to inflict pain on other developers, I shall write files to disk with a byte order mark. 😂 -
When you spend an entire week tracking down a bug and it turns out that the bug was caused by someone using the equals operator instead of strcpy.
-
I've just joined a new company out of despair after several month out of jobs without being able to even get interviews.
I've been warned about the code being a bit behind with modern Android stack, they needed to migrate from rx to coroutine and compose is not a priority at the moment.
Fine with it, I like handling and planning migration, that's a nice challenge.
But if only that were the only problems !! Far from it, the code is a formidable mess, I've never seen so much amateurism... Most of it was written from the previous Lead Dev who stayed there for years and touched everything with their very bad practices.
I don't even know where to start honestly...
While the code is in Kotlin, it stink Java. Nothing wrong about Java, but if you code in kotlin, you need to understand what kotlin try to achieve. And that's not the case here. There is freaking nullable everywhere, for no reason at all, the data classes contains lot of var in their constructors, equals are override to compare only one or 2 params and no hashcode override with it.
Sealed class, what for ?! Let me just write a List<Pair<Enum, Any>> and cast your any depending on the enum !
Oh and you know what, let's cast everywhere, no check, and for once no null safe, there is enough nullable in the code !
What about the reactive part ? well let's recreate a kind of broken eventbus with rx ! Cause why not ?!
The viewmodel observable don't contain data, they just contain enum for the progress of the states we're checking.
In the viewmodel function we update that enum states and emit it to be observed and make the data available as a var for the view to pick it up when needed.
But why put the business logic in the viewmodel, let's put in the views, and grab and check the variable contain in the viewmodel whenever it fits.
Testing the business logic ? uh let me just test my variable initialisation in the viewmodel instead.
The vm, the views, make about 2000 lines, the test over 3000, and not a single test really test the business logic in it ! I've made big refactoring we're all the tests stayed green, while the function are full of side effects ! WTF ?!
Oh and what about that migration from rx to coroutine ? well better not break the existing code and continue writting like rx, everything is cold flow ! We just need to store a boolean saying if we already did our call to the data layer then we decide to start our flow or not.
As for the RecyclerView, having too many viewHolder is just so annoying, let's put all our different views in one, and hide what we don't need.
Keystore has been push on the repo, but it's private no ? So who cares ?!
And wait i'm not done ! Some of the main brick of the apps depends on library that hasn't been updated for years, and you know what... yes they were hosted on Jcenter and it's only now that they decide to do something about it, we we're warned about the sunset of jcenter 2 years ago !!!!
So what about compose ? What do you want with compose ?! there is no design system in that app obviously, so don't even think about it !
And there... among all of that mess, I'm supposed to do code review... how the fuck do you do a code review when all the code that is around stink ?!
And there is so much more but by now I'm afraid you're thinking i'm just pissing on the old code like everyone... but damn I guarantee, that's the worst code I've ever seen, and i've work on more than 15 app from small to big on different contract with a lot of legacy code, but nothing that bad !1 -
Morning:
Aight, I'll do something fun tonight. Maybe watch a nice movie or read a book.
Night:
How the fuck is 0xFF00FF equals to 0x00FF_00FF?5 -
How should you override Equals in Java?
We have model classes with lots of fields and the we override the details equals to compare all the fields. I guess like doing a deep comparison.
And in all these classes SONAR is complaining about lots of ifs, complexity, etc.
And it's killing the analysis time... Old issue never fixed because whoever setup sonar was too incompetent to bother asking, researching, or fixing...
Is there a better way to override the equals to get the same result but without triggering SONAR issues?
Pretty sure this is a solved problem. And well if the top of my head, is just create a Util method that uses reflection like
Boolean equals( Object a, b, Class class)
foreach (String f: class, getFields()) {if !compare(class.getField(f,a),class.getField(f,b)) return false; }
return true5 -
We have a huge domain model in Java and something is really fucked up with our equals/hashcode implementations and know body can track it down.
I have suggested Lombok/Groovy several times but they didn't listen.
Anyways it is so fucked up, that map.contains(foo) returns false, although it is part of the map.
So we wrote something like this:
for (Entity e: map.keyset) {
if (foo.equals(e) {
return true;
}
}1 -
"If you think it would be cute to align all of the equals signs in your code, if you spend time configuring your window manager or editor, if put unicode check marks in your test runner, if you add unnecessary hierarchies in your code directories, if you are doing anything beyond just solving the problem - you don't understand how fucked the whole thing is. No one gives a fuck about the glib object model.
The only thing that matters in software is the experience of the user."
— Ryan Dahl (https://tinyclouds.org/rant.html)6 -
We’re only random people living in random places, speaking random languages, eating random food, sleeping, studying and working random hours. Traveling to random points on a sphere.
Just random range is different.
Just random stuff happens on crossroads of two random dots and the entropy speed ups or slows down.
Nothing special at all.
Just a finite state machine iteration.
I mean the amount of effort we put into explanation of infinity is outstanding.
What if there is no infinity at all ?
What if infinity is just misunderstanding of our interpretation of the world around us. It’s just pixels, resolution, gaussian splatting, quantum state, you name it.
Hey man the world is flat. Just put it to the 2d space. How many space you need from a simulation perspective where your patient eyes can only see up to certain amount of light particles per second on a shitty lens.
Propose a world optimization techniques by slowing down subject perception, tiredness introduced. Compress memory, sleep introduced. Limit neurons, cpu power assigned. Deploy on cloud - put it to life. Exit 0 body failure. Exit 1 suicide. Kill -9 killed by tty from ip EARTH.X.Y
What you can do to make the world around this planet alive? Make it blink.
We developers are lazy and I believe that nature is even more lazy than us.
You think you’re going to elevator right now ? You’re going to the preloader. Looking at the window equals playing video from playback. Never goes live, just precomputed fsm. Cars, trains, airplains ? Preloaders everywhere. Highways to split traffic to cities and communication. The road and cities planning department is a matrix maintenance department. And don’t get me started about space.
Space is empty because it’s not even finished. So they put it all behind glass called milky way. You know how glass looked 500 years ago ? It was milky so it’s milky way so we don’t see shit.
If the space would be finished I’ll be starting writing this text from mars, finished it and sent from earth but no it’s light years guys, light years is not a second for a matter. Light year is a second of the the injected thoughts exchange only. Thoughts of the global computer called generative AI that they introduced on local computing devices called cloud.
Even the preloader system is not present, they left us with the one map and overpopulated demo. What a shit hole.I bet they’re increasing temperature right now to erase this alpha build and cash out. Obviously so many bugs here that his one can’t be fixed anymore. To many viruses.
Hope for 0days to start happening so we can escape using time travel or something.
I bet they cut a budget or something, moved the team to other projects. Or even worse solar system team got layoff off because we are just neurons that ordered to do it. And now we’re stuck in some maintenance mode, no new physics no new thoughts to pursue, just slow degeneration. I would pay more for the next run and switch to other galaxy far far away where they at lest have more modern light speed technology.
What do you think about it Trinity ? Not even worth wasting your time for that. No white rabbit this time.
I do not recommend this game at this stage of early access.
- only one available map despite promises for expansions over the years no single dlc arrived,
- missing space adventures
- no galaxy travel mode only a teaser trailers of what you can do in other “universes”
- developers don’t respond to complains
- despite diversity of species and buildings at first sight world looks to generic
- instead of new features bots with mind manipulation, AB testing and data harvesting was introduced
- death anti cheat mode installed1 -
Once upon a time to prevent people from stealing my work I created a program that converted photos and files into double sided sheets of at codes with packeted contents so I could scan them into a high resolution file later and recompose them into a series of files
So very aggressively insistent we’re the dumb slaves that run all this crap in being cruel and evil and fucking themselves over that they stole these sheets from the document folders I carried in my backpack and sent me into a traumatized state pre amnesia and wasted 5 years of my life
Now all these same period are either leering programmed fools or withered miserable sacks of skin and I’m no closer to moved on from this bs and I find myself exasperated that everyone and their retard incestuous uncle would want to deny and repeat the same crap over and over as they as they are only making themselves crazy as well. Says something no records equals no future in essence essentially the reason if it’s not physically secured on land that cannot be taken away and we keep trading law and order for .., whatever these idiots get out of this well all die before we reach much furthet3