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 - "strings"
-
“That regex almost worked, lemme just tweak it a bit–”
*2 hours later*
“Fuck it we’re processing strings character by character with a while loop like granddad did.”5 -
Developers sound like psychotic sewing serial killers.
Always taking about strings and threads or killing parents, children and detaching heads.10 -
Translating things:
ME: "Hey dev, can you send me a xml file of strings to translate so you can impleme..."
DEV: "yea yea tomorrow"
He sent a .docx file.
i'm crying9 -
*Client phones me at 11pm*
Client: It's not working!!
Me:What's the error you're getting?
Client: "Database connection error"
*Phones system/dB admin*
DB Admin: Yeah we had to change the SQL logins, I've sent you the new ones
*Phones junior dev in charge of dB programming*
Junior Dev: Yeah you'll just have to go and change the credentials. They're in all the places where we're using the dB, just before the statement, in the connection strings...
We make over 470 calls to the DB 😑16 -
Imagine a database table where dates were saved as strings from raw user input. Then do migration to other database with table where dates are datetime.
Yep. That's me. 😶
I hate humans. 😧🔫
Especially those who try to be original like:
11|Sept.|2016 or 13;Juni;17
There are rules in this world, damn. 😥9 -
Just found this precious gem in the legacy code I am maintaining! How do you check if a string is empty :-D ?5
-
At this point it's pretty much a matter of time before the English language runs out of words and JS framework developers resort to random strings for naming them.3
-
"Oh, I reverted your changes because I did not understand them"
I SPENT THE WHOLE DAY REFACTORING YOUR SHITTY SPAGUETTI SHIT U LAZY PIECE OF SHIT !
But I guess being a senior guy entitles u to sit your fat fuck ass in your chair writting garbage all day long.
Btw what he did not understand was f strings. In python. Srsly. How is that arrogant incompetent prick paid at least 10k more than me3 -
Started with learning C.
Made the first big mistake right at the start.
NOTE TO ME:
NEVER EVER SEARCH FOR "C STRING" WHILE WORKING.10 -
Two strings walk into a bar and sit down. The bartender says, “So what’ll it be?”
The first string says, “I think I’ll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy~~owmc63^Dz x.xvcu”
“Please excuse my friend,” the second string says, “He isn’t null-terminated."2 -
Someone played a random game that I'd made. He was really impressed by the story (mostly dialogs). And he asked me:
Him: "Did you pay much?"
Me: "What???"
Him: "Well, I'm sure you had to pull some strings to get that dialog"
I laughed hysterically.5 -
If you're a developer that enjoys 200+ line methods with 5+ return points, and literal strings all over the place, please punch yourself, hard.7
-
These two strings walk into a bar and sit down. The bartender says, "So what'll it be?"
The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu"
"Please excuse my friend," the second string says, "He isn't null-terminated." -
Fun fact: if you send a string as response from a java Servlet to Ajax request. The string isn't null terminated.
wanna know how I found out. I didn't for 2 whole FUCKING days.1 -
Just spent like ten minutes searching why my api always returned false.
I forgot, that I am using Java and therefore cant compare strings using equal signs 🤦♂️23 -
Today I wrote a Neural Network in python for the first time, that could identify between strings, numbers and dates. Although the feat may look small it's a very proud moment for myself8
-
I programmed a random credit card generator at school and saved it to my :F drive which is the private drive for students to save stuff to. That night I tried accessing my account and it had notified me that it had been locked. I went into school the next day and was called into the office, the principal and Tech Administrator were there waiting for me and asked what the file was. The Tech Administrator tried to describe to me what he found
"This gen.html file seems to be malicious and puts our school at risk. It seems to be some sort of malware and stuff like that is prohibited at school."
Now me sitting in the chair listening to this, laughing in my head just said "okay" and nodded my head because he is the type of person to argue forever. They came to the conclusion to unlock my account by the end of the semester.
Just goes to show that it doesn't take much to get a Tech Admin position at a school.15 -
I'm freelancing and there was a guy who needed help with JavaFX. He gave me code only to his view class so I don't steal the rest... It was around 5k lines and it was full of compilation errors because of missing classes. While checking the code I realised something is really wrong with his model classes. So I asked maybe he could send me this one model class that was suspicious. So he did and it was around 10k lines long and had around 200 fields... ALL OF THEM FUCKING STRINGS except 3. You know what the rest of 3 were? 2 Lists of strings and a boolean... It was his "main" model class, he was using it for everything. It had setters for all fields and empty default constructor, so he would just instantiate the object and would set the fields that he wanted to use. Need new functionality? Just add 5more String fields and set them!2
-
Coded in C language for first time (due to college assignments)...
Just found out that there are no strings in c language 😐29 -
*PM looks at my code
*Deletes my constants, replaces with inline strings
*Changes order of conditions (that I tested)
*Hits save --> autoformats code into shitty looks
*Commits: "fix"9 -
The guy where I can only shake my head when I see his code, and he is really proud of if implementations, while he
- doesn't care about warnings
- breaks builds and doesn't care
- doesn't care about code styles and indents in a very column based way
- adds tons of comments to his code, mostly hard to understand, and sometimes that much you can hardly find the code
- implements a tokenizer where you have to inherit from its interface (Why would I wanna implement whole functions for a tokenizer and not just use it in place where needed? How do I use two of those in one class?)
- implement a "generic" state machine base class with fixed lengths array of 3 events and 3 strings (Why would I need events and strings hardcoded in a "generic" state machine? Why a maximum of 3?)
- once delivered a software without the needed runtime components, so the whole system (embedded device) wasn't working properly and only by chance missed the point of disabling update mechanisms
- make your ears bleed about his big inventions whenever he sees you, no matter how often he already told you about that blazing new feature5 -
TLDR; Wrote an awesome piece of code, but there's no one capable of understanding how hard it is.
I spent an entire night building an insanely complicated automation script, that picks out certain configuration files (in javascript fml), does some crazy parsing to pick out strings, passes them into a free translation API, translates them, and does more insane parsing to insert those strings as javascript objects.
Spent 3 hours on the bloody parsing algorithm alone.
Manager: Oh this language is really nice. Good of you to discover it can do that.
I didn't "DISCOVER" it ffs! Its a product of my head! I built the damn algo from scratch.
Seriously, screw non devs who trivialize the complexities of writing a good program. Its NOT as simple as opening notepad and typing in
import {insanelyComplexSolution} from 'daveOnTheInternet'3 -
Ticket: Allow merchants to customize how their Wallet Passes look! It’ll be super easy, just add these nine merchant-modifiable strings (they support vars) and use their contents for text instead of what we use now. Simple!
Reality: There need to be 24 strings, there are some rules I can’t convey to the merchant (because the system literally does not include instructions, only a name and a textbox), the code to generate the wallet pass is inefficient, uncommented, branching spaghetti that I’ll need to rewrite (it seriously generates every possible field, and then only uses the ones it needs), the specs are so much worse, and half the default values they want aren’t even possible. As in, I don’t know if it’s a car loan, let alone the exact make and model of the bloody thing.
And no, sorry, we have no way of knowing what their fucking “vertical” is, either, so we can’t display that. Fucking sales.
Asdhkjfsjfads
WHY MUST EVERYTHING SUCK7 -
The superhuman feeling of going back to your code after a week and it all makes perfect sense, the variable names are intuitive, the doc strings are comprehensive, and the general codebase structure is sensible.2
-
That moment when you learn Java in school and your teacher tells you that Strings are unimportant.
*facepalms*4 -
People committing config files with connections strings pointing to their own machines.
Oh I'll just pull the latest changes... Why is all my data suddenly different??!? Fucking Gregg just checked in a connection string with "server=GREGGSPC".2 -
Biggest pet peeve of languages are those that use single quotes for strings.
It's single quotes for characters, double quotes for strings. Suck my diiiick25 -
Apparently some freaking man in my ex-team tried to learn Vim because he thought he could become more efficient but he spend more than two weeks trying it while delivering poor quality code with extra spaces, bad indentation and extra "wq" strings10
-
When you're asked to extend a functionality on a piece of code and the 2.5k lines in the view are a juicy mix of PHP, HTML, CSS, JavaScript and the functionality relying on jQuery trasversing through the document tree and expecting things to be in their place. Oh did I mention html build with strings in JS? I'm going to love this day! WHY, JUST WHY?! *gasp*3
-
I inherited some Java code from a guy that thought you could only return strings from a method.
So how did he ever pass anything other than a string, I hear you ask? He had a (hand crafted, using no libraries, and not escaping anything properly) toXml() and fromXml() method on each object.
Yeah...15 -
New to Java.
I was debugging for hours until I finally found the problem: "==" compares two strings' references, not their value.
I began to laugh tears!
Oh my fucking shit... I am a... damn it!12 -
Taking a class on C and machine-level code for school and I have my final tomorrow. After the entire semester, people are still posting questions to piazza asking how strings work and other students are giving wrong answers. Not to mention all of the correct answers are posted in our lecture notes and countless places online. Seriously people, why are you a CompSci major if you can't even figure out how you declare a string after 10 weeks of coding?3
-
This week in Programming Language appreciation: the multiplication operator in Python. You can use it on strings and arrays for incredible ease of use. For a horizontal line in a terminal?
print("-" * 30)
Very helpful, and I have used it a lot. And I miss it in other languages.15 -
I thought most developers were aware of the dangers of interpolating variables into strings in the context of SQL queries, but apparently some people are oblivious.
`SELECT * FROM USERS WHERE USERNAME = ${username}`
My username is ' ' OR 1=1;6 -
That should be enough characters...
var str = "The Hardest Button to Button";
var res = str.substring(0, 16);3 -
My code was doing the exact oposite of what I wanted it to do and it took me about 2 hours to find out that strcmp() returns 0 when the strings match, problem solved, fml.4
-
Code quality check punishes writing massive documentation strings due to "too many lines of code"
FML1 -
When a professor says, "strings are an array of characters" and you proceed to post a question on stack overflow containing the phrase, "strings are an array of characters" and get a healthy dose of knowledge about what strings actually are....
I'm paying for this education?12 -
As a developer, I'm sometimes accused of pulling strings out my arse.
As a dog owner, I've literally just had to pull a string out of my dog's arse.
I really wish she'd stop eating fabric.2 -
Imagine saving Integers and Floats in a MySQL table as strings containing locale based thousand sepatators...
man... fickt das hart!
Wait, there's more!
Imagine storing a field containing list of object data as a CSV in a single table column instead of using JSON format or a separate DB table.... and later parsing it by splitting the CSV string on ";"...7 -
Being a programmer for a while now it always irritates me to try to explain what I'm working on to friends and family. I forget what I knew before I developed. I'm always like "I made the strings in the database- oh I mean the words...well they're actually more like strings of letters- well anyway I made a code to sanitize the user input- I mean make it so it is secure before uhhh saving." I spend so much time watering what I'm saying down I forget what I'm talking about
It's not even funny. It'd be funny if one single person in my family or friend group understood what I meant to some degree.3 -
Two strings walk into a bar and sit down. The bartender says, “So what’ll it be?”
The first string says, “I think I’ll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy~~owmc63^Dz x.xvcu”
“Please excuse my friend,” the second string says. “He isn’t null-terminated.”
-
Not quite a rant, but if you came here for a cool way to reverse strings in python then I've got you covered:
backwardsString = string[::-1]
Don't know why you come to devRANT for tips on python string reversal but hey
I thought it was cool at the time ::)))3 -
I try and try and try to teach my coworker critical thinking skills, proper programming techniques, and standard git etiquette. Then I add 4 booleans to solve one problem, use strings instead of ints to find unique SQL Server entities, and push right to the development branch.
I am a real asshole, but at least I am not fake.4 -
Do things in JS they said, it'll be easier they said...
(After a few WTF's i found the problem, arr.map passes more parameters to parseInt than just the strings. It also passes an array index that gets interpreted as radix)18 -
QA: “not accepted since text differs from specs.”
Me: “but... the text comes from specs, I copy pasted it yesterday, wtf?”
*checking specs versioning*
Specs updated 1 hour ago
Having to input text from jira to the language strings cause design’s too lazy to do it themselves is stupid enough, but the good old “specs changed after the feature is done” gig is a must... to remember you why you hate working for someone.13 -
I'm fed up of this fight about tab and spaces.
Do you prefer single or double quotes for strings?14 -
Really now?
AWS, #1 cloud provider with their #1 cloud database DynamoDB, all shiny, highly dynamic NoSQL, your data schema could change any second...
then DynamoDB errors out when one of your values is an empty string? {"foo":""} is impossible to store?
Like nobody ever saw or used empty strings a a value or what? There are tons of upvotes to fix this.
I just have to imagine the Product owner standing there: "No,no,no. They are just using it wrong if their data has empty strings as value. Won't fix!"4 -
Spent hours trying to figure out why API calls to a third party service weren't working.
Hit up their support and find out the following:
"Hi there, we can only take true and false as strings."
"Uhmm... Does it take anything apart from true or false?"
"No, but they must be sent in as strings"
"Any reason why you don't take booleans if it's just true or false?"
*crickets chirping*
GFG2 -
At this point i'd like to talk about the original PHP founder Rasmus Lerdorf, who was obviously too distracted by his own beard while watching the NBA Playoffs in 1995 to write a proper language.
There's not a language more inconsistent, ilogical, deficient, and best of all, bad structured.
Seriously, which substances was he smoking when thinking up such things as: non objective strings, incasesensitive functions and associative arrays?
What have objects ever done? any other honorable language does that, python, javascript, rails, C#, take your pick.
Not to mention the order of needle/haystack parameters.4 -
Strings in most languages:
(☞゚ヮ゚)☞ foo: string = "bar"
Strings in rust:
(╯‵□′)╯︵ AHHHHHHH!
borrowed value does not live long enough
types differ in mutability
cannot assign twice to immutable variable22 -
You : Let me just add up those two numbers together...
JavaScript : Here, let me concatenate those strings for ya!
¯\(◉‿◉)/¯2 -
I have to work with an unbelievable stubborn (and incompetent) "project Manager)
He just actually tried to convince us that leading 0 in some" hexadecimal" strings get truncated.
I know that does not sound like something to lose the mind over, but these wrong facts do come up ever so often. It knaws on my sanity.6 -
When you're naming variables, it is not acceptable for them to be one character, especially when that character bares no relevance to the information it stores.
'f' is not a good variable name for an array of strings now, is it...9 -
Anybody else have a wall like this in their workspace or is it just me? I've got bad memory for config strings haha!4
-
I just found out I had used, for over 4 months, the wrong function to encode/decode url strings, which caused a lot of issues with my app...
I refused to believe that the problem is there, so I was looking elsewhere.
The longest search of a bug in my life finally over. Fixed! :D2 -
Lesson learned: if you're going to derive a class in c++, make sure to declare a virtual destructor on the base class!
I just fixed (one of...) the massive memory leaks in my damn project.
Pictured: the strings in a derived class actually getting freed!20 -
Just spent about 15minutes trying to figure out why my beautifully formatted f'{strings}' code was returning "invalid syntax".
Turns out I was in a Python 2 shell. How's your day going? 🙂4 -
These two strings walk into a bar and sit down. The bartender says, "So what'll it be?"
The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu"
"Please excuse my friend," the second string says, "He isn't null-terminated." -
This.
Not the worst but almost all of us (including me) handle strings like fucking morons.
If the input doesn't need to be an exact match we use a explicit comparison operator, when the input should explicitly match we do a loose comparison operator.
I'll format the crap out of a number, convert it, validate decimal places, check for float rounding hell, give it a absolute value and return it correctly formatted for the users locale but half the time I forget to trim their input. 🤦♂
Like I said - just a tad fucking moronic isn't it?3 -
Two C strings walk into a bar.
The bartender asks "What can I get ya?"
The first string says "I'll have a gin and tonic."
The second string thinks for a minute, then says "I'll take a tequila sunriseJF()#$JF(#)$(@J#()$@#())!*FNIN!OBN134ufh1ui34hf9813f8h8384h981h3984h5F!##@"
The first string apologizes, "You'll have to excuse my friend, he's not null-terminated."1 -
Fucking gnu gettext, fucking .po and .mo files and fuck the fucking poedit. Why in the fucking hell a damn i18n solution used by so many languages doesn't support correctly fucking utf 8 characters in strings inside the code, I mean, WHAT THE FUCK, this is my second day trying to make the fucking Python gettext module to translate the fucking word "está" because I've a fucking big code base programming in Spanish that need to be translated. This is the fucking 2016 and we still have problems with fucking special characters? I mean CMMON1
-
So my college is writing a desktop app (usually my domain), and he doesn't want to do internationalisation because of time constraints. HARD CODED STRINGS EVERYWHERE!11
-
I did mostly Java and JavaScript coding before I came to my current job. When I started I pretty much had to learn PHP on the fly. Pretty much no problems, but my greatest shame from the few years I've been writing code is when I spent over an hour debugging an unknown error, after which time a fellow dev looked at my code and informed me that PHP uses . instead of + to concatenate strings...6
-
I think javascript is a great language, but it has some really ugly parts.
For some reason, it really annoys me that JS developers are ok with things like
if (typeof something === "undefined")
I mean, comparing strings like that!3 -
My senior just created this beauty of an API...
Mixing undefined/null values with empty strings & random hyphens for other variables. And the phone number not following standarised notation (we are a telephone provider)6 -
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 -
Code languages should stay within their designated file extensions! I'm having to work with SQL in .resx files at the moment! Then there's HTML which is like a skitty little travelling monkey that I've found blundering about in SQL strings before, let alone people trying to sneak it into .js files, which is one reason I chose Angular over React btw (and don't give me that bullshit of separations of concerns vs separation of technologies).
It is mostly trivial to work with separate files across languages and doing so gives you the benefits of that languages support in the text editor or IDE you are using. It becomes easier to work with, the behaviour is predictable and it is formatted in a readable manner, ultimately reducing the potential for mistakes. Stop trying to make me put everything in strings!!1 -
People here expect me to use strncmp(str,"ABC",strlen("ABC")) because they think strcmp(str,"ABC") is going to crash. Because they've had experiences of using strcmp and getting crashed.
All they did was, pass inside strcmp, strings that did not carry terminating null character but won't accept if i told so.2 -
I'm curious...is there a practical application for reversing a string, other than for tutorials and interview questions?9
-
Sometimes I use "KillMe" or "FML" in my debugging strings as a silent cry against whatever-the-fuck has upset me.2
-
Today I decided that from now on for all strings that need to be initialized and don't need a special value, I will assign a TIE-fighter "|-o-|".
That will be my legacy.5 -
If you hate creating regex strings, this site makes it fun and easy:
https://regex101.com
Thought I'd share :P2 -
Python is a fucking joke. "Readability" disguised as 150+ magic methods and values. Virtual environments to hide shitty dependency management. Strings that may or may not act as comments. No correlation between package and module names - install Pillow; import PIL. **kwargs instead of options=dict(), because why separate function arguments from arbitrary extra data? And finally, the only way to have tkinter on Windows is to install IDLE, so that some fucktard can stick their shitty app right up yours ...7
-
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 -
The day after I delivered a secure programming course to our junior devs.
Junior dev: I can't figure out what's happening when I generate this sql.
Me: what do you mean generating ... It should be a prepared statement..
Junior dev: no I'm just generating the strings from the form
Me: ... Let's try this again.... -
Legacy code huh?
Well i'd say it would be when i was workng on an old java app that was apparently written by a retard.
He had used strings to represent booleans for no apparent reason. As if that wasn't bad enough he would use different strings too:
Y N true false 1 0
He used them randomly too , y and 0
N and true
😡
I sense it was done on purpose
Perhaps he knew he was leaving soon2 -
Shortlisted hackathon apps:
1. Transmit strings between two phones using sound.
Why the fuck? Why are we reinventing the wheel?
2. Offline payment services app. Sounds cool but is no way feasible in the real world.
The judge of the hackathon was some old PhD college professor who was yawning at the begining of the presentation who didn't understand what was heroku and didn't even bother to listen.
Lessons learnt:
1. Stick to corporate hacakathons
2. Query regarding the judges of the hackathon17 -
In 3rd year of college my friend decided to get rid of all his NullPointerException by instantiating all his strings as "null"...2
-
I am doing some freelance work for a client who is thankfully mindful about security. I found out that they are so strict with their access because they had a huge data breach last year.
Today I was given access to their repo for connecting to their AS400. In the docker file the username and password were included and were the same for dev and prod. They also are performing no sql injection prevention. They are just joining strings together.1 -
Sent a fully constructed sql statement to someone expecting at least 4 rows however received reply "the result is empty" with a screenshot of empty result set from sql-developer. I kept cross-checking the where clause thinking I mixed something up.
After a few back and forth emails suddenly noticed the screenshot I received initially and I see all of the strings in where clause are lowercase. I reference my version and it is correct. When I asked her why are the strings in sql lowercase and that if she has tried the exact sql I sent in the email, the response "I didn't think it mattered what case the sql was in".
I am lost for words. The worse part is, this is someone who is supposed to go on site as part of their job and help clients setup, explain and train how the software works. This includes explaining how software intreacts with database tables 🤐8 -
Small things count*
You know how in Android Studio, if you put a string directly into a View's text, it warns you to use resources' strings?
Well if you put there "Hello World", it gives you no warning...
I don't know why, but it made me smile. (Way to go, JetBrains!)
*Don't thing of anything stupid -
How to reverse engineer without knowing how to reverse engineer:
1.Open IDA pro
2. Hit shift+f12 for the strings view
3. Choose an interesting string
4. Hit x and go over the xrefs
5. You are now earning at least $140K a year.
Bonus: say that you can code html2 -
I can not fuckin stress how goddamn annoying it is to work with strings in C++. I'm not talking about std::string, those are bearable. But fucking char foo[number], char* foo, and const char* foo. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA17
-
The infuriating edgecases of python copypasta.
If you're like me, and you find it easier to noodle in notepad++ and the console, then you may have encountered this peculiar bug.
Try padding blank spaces on an empty string variable, and follow it with print(blanks + str(var))
#for any variable
Now copypaste that along with at least one other line at the same time.
Observe how no matter what you do, print will always output the blanks variable on a separate line, with quotes.
Try rewriting right-justify? No good.
Try using f-format strings? No good.
Raw strings? Inspecting bytes to see where the newlines and carriage returns are being inserted? Nothing.
Copypaste with multiple strings will *always* insert quotes and a new line when printing *any* variable with a string thats been justified.
And this is 100% non-congruent with pasting the same *line* of code *by itself*, which works as intended, no quotes or additional new lines are inserted.
I just went ahead, turned the snippet into a function, and called it from there, which solved the problem entirely.6 -
I am a bad developer. I know nothing. I had a very simple requirement just to change the strings.
I couldn't collect all the requirements. I connected with PM offline, slow replies and miscommunications. Ahh!! How will I be shipping bigger projects? I have 3 years of development, in my last company we worked totally different though.
So, at the time when I thought I will be raising a PR I am stuck on the requirements.
I am a dumb shit. I can't do anything right. A simple requirement I am not able to deliver. I am so embarassed. :(12 -
aahh, that's a nice feeling!
Half a year ago I was borrowed to a client's team as a pair of helping hands on one project. Today I pulled that project source again to see what has changed.
The only things changed in my code are typos in strings (missing space, missing letter, etc.). Not a single error in actual code.
Maybe >90% TDD tests coverage has smth to do with it ;)
aahhh, that's a nice feeling :)3 -
ah this fucking sucks my boss, who is also the guy developing back end for our mobile app which im developing, isnt working on the back end makes me guess the fucking json strings that hes going to send and buils the front end, then later changes the fucking json structure completely and expects my app to work without any problems, how do you teach these fucking php developers the importance and significance of data types and data structures4
-
It is a PITA, when you have to triple escape single and double quotes in strings in order to get your stuff working.1
-
When I was first learning Java I forgot to use If statements and made about a 600 systemoutprint lines. Don't be like me5
-
Every time I have to switch from backend development to frontend and deal with rxjs Observables, I feel like a spider crafting a web, so that no matter at which string the fly/event happens, the right other strings will be pulled and I will get a nice notification.
No wonder it's called WEB-development1 -
These two strings walk into a bar and sit down. The bartender says, "So what'll it be?"
The first string says, "I think I'll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy owmc63^Dz x.xvcu"
"Please excuse my friend," the second string says, "He isn't null-terminated."1 -
What the absolute fuck is this!
Fucking bash needs to get its shit together with its fucking strings.
I don't fucking know why str1 + var2 = var2tr1
Like who designed this fucking bullshit!
I've spent the past 8 hours today counting all my ' and " and making sure everything is getting passed correctly.
And how do you even google this shit anyways!
And why the fuck is the official suggestion from the bash FAQ to load everything into an array and to call it with "${ARRAY[@]}"
WHO THE FUCK DECIDED THAT WAS READABLE!!
AUGH!!!
In case anyone was wondering. It didn't work anyways.
I think I'm done for today... I can't anymore...
for anyone wondering. This is bash getting executed by nodejs with execSync()
and those tokens are temporary and only exist on my dev machine. Sorry for getting your hopes up.11 -
FUCKING HELL.
It's already enough that this FUCKING API I have to work with is a mess of JSON and XML responses mixed together.
With mixed german and english keys and attributes all sprinkled over it.
And API access locked to Austria only for some reason.
And then they even manage to fuck up the little bit of JSON they use.
It's just a fucking array of strings (where one could easily use integers).
They can stick this fucking steaming pile of shit that they call API up their PHP infested assholes.
I hate web development sometimes.5 -
package main
import (
"log"
"strings"
)
type Present struct {
from string
to string
}
type Santa struct {
presents []Present
}
type Person struct {
Name string
Nice bool
Presents []Present
}
func (santa *Santa) givePresents(person Person) []Present {
result := []Present{}
if person.Nice != true {
return result
}
for _, present := range santa.presents {
if strings.Compare(present.to, person.Name) == 0 {
result = append(result, present)
}
}
return result
}
func main() {
santa := Santa{
[]Present{
{"devRant", "Alex"},
{"Johanna", "Alex"},
{"Alex", "devRant"},
{"Alex", "Johanna"},
},
}
persons := []Person{
{"Alex", true, []Present{}},
{"Johanna", true, []Present{}},
{"devRant", false, []Present{}},
}
for idx, person := range persons {
persons[idx].Presents = santa.givePresents(person)
}
log.Println(persons)
}2 -
ok, so first there were ads.
Then came adblock and the likes.
Then websites started implementing randomly generated strings.
Then came pi-hole.
Now some of the websites are using RNG + hosting ads on their domains...
(the order might not be very accurate, but you get my point)
So what now ?
I'm guessing that the next step for adblock will be to use AI to recognize these RNG strings, and then the websites will use AI to generate better strings (harder to distinguish if it is relevant content or an ad).
In other words - AI vs AI :D
what do you guys think ? :)4 -
I get the whole anger at robinhood and the stock market, I really do.
But on the other hand - what did you expect? A bunch of people on Reddit could *genuinely* cause hedge funds to lose billions without them pulling strings to fight back?! They don't care if it's illegal or immoral. They know the worst they'll get is a fine that's way, way less than they stand to make.
Don't get me wrong, the anger here is justified completely. The surprise however, that's really not.12 -
Google really fucked up with localization for Flutter!
We need to create a getter for each translated string? For real!!
Please tell me I understood it wrong :|4 -
Hell is programming in a language where everything is global, strings have a maximum length and error handling is nonexistent.6
-
//First rant
So I've been working trying to get a file exporter for a binary file format mostly reverse engineered - 2001 Super Monkey Ball 2 (GameCube) if anyone's interested.
Everything works fine, goals show up in the right places, wormholes work as intended, etc. That is everything, except every single level you create will be invisible, or crash (Depending on which version of Dolphin emu you use).
This happens whenever trying to specify object names for 3D objects. I checked, all the many offsets seem correct, Object names are correct. Tried both null terminated strings and fixed 80 character strings - nothing.
Some other guy also made an exporter that works, however the code is an absolute mess - basically unreadable. It also lacks some newer parts of the file spec, which is the main reason as to why I'm rewriting it.
And as I'm working with an almost entirely unheard of file format, there are few people to go to for help. The 2 I know who are also familiar with the LZ file format have no idea either...
Sigh.1 -
Management forbade the use of XML in favor of the faster, formatted strings that looked like opening alligator jaws facing left and right. Yes, he used the term ‘alligator jaws’.
-
Unreal Engine + third party library adventures part2:
now we gotta parse everything from unreal formats, to the library formats, than back to unreal again... sigh. Why can't it just use normal data formats like everybody else? I mean, come on, strings, ints, vectors etc. they all have standart libraries. why does unreal need to make their own shiet out of it. Just why...1 -
I'm incredibly ticked off by decision of using backticks ´ to define template strings on es6...
template strings are nice , but backticks are irritating ugly and unreadable3 -
int count = getCount();
txtCount.setText(count);
> Could not find resource ID #0x00
Couple hours of head scratching later
"You idiot. You forgot to use String.valueOf(), didn't you?" -
Ive been working on pseudo-Java (ie some 3rd company's UNDOCUMENTED programming language) that they parse into Java in their backend
It doesnt even support if-else (only ifs and elses) or a boolean combination of False and OR together lmao
mainly a GRPC middleware-language
Given its lack of features (arrays/collections) or documentation, I just had to implement a flag-array using a 0-1 string
Im throwing exceptions unless combined strings equal Lengths and is only 1s
living like in 80s-90s 💀7 -
I love Android development, but I HATE make individual strings for each word in my apps. It's so tedious! There's gotta be a better way than telling myself, "Oh crap you better be a good boy and use Google's 'best practices' and not hardcode all your strings. Who knows you might make this app translatable in Portuguese someday and it'll be easy then!". I HATE it!!2
-
> Be me
> Programming for an embedded system
> It's not interruptable
> Got ISR Fault (Interrupt Service Register)
> WTF
> Breakpoints are useless
> WTF
> Comment out some lines
> Turns out it goes ISRF Infinite Loop because of the multi dimensional array of strings
> WTF
> Use pointer intead of defining actual size
> Works
> WTF
WTF?1 -
PHP code that didn't use sanitize, but manually checked if strings contained ' or ". Not even in a function, but manually implemented whenever the person writing that burning dumpsterfire thought it was a good idea to check for that.
Code also didn't report, it just exited without error code. Users would just get a white screen if that spaghetti code "security" system got tripped. -
I was failing all the test cases for a CS assignment where we had to implement our own methods for strings in C++. After an hour of debugging, turns out strings don’t end with ‘/0’ in C++ like in C.
Fuck my life.5 -
The real life of me as a trainee developer:
New system works locally but fails to work in production and dev.
Proceeds at futile attempts to debug for hours to find out that my connection strings in the transforms were nested inside logging. -
"Multiline strings can be used as block comments in Python." Except in some places, where your code will pretty much blow up without any errors, because instead of commenting out a portion of an array, you've just added one big string element. And there's no other way to make block comments. And after actually commenting out every single line, your version control won't know how to merge it anymore, because there are now 100 changed lines instead of 2.6
-
I once tried to create a client for the fonds bank of Frankfurt. But I didn't expect their JSON API to be designed by a trainee.
Look at the API.
Stringified numbers, decimal commas (Germany), separator dots for thousands, and even one breaks as if it came from a pjp script where they just put an if condition in each line.
I documented the API and tried to create a Jax rs client, but stopped completing it. Not useable atm. Just look at what I spoofed.
https://github.com/bmhm/...7 -
I legit had this dream early morning today.
A bunch of kids (grade 10ish) were stuck somewhere and helicopters had been sent in for rescue. Strings were thrown down to airlift 'em and just like that, one kid was being pulled up. Everyone was horrified to see that the strings were giving way for just this kid while the others were being pulled up easily. The rescue team attempted the act multiple times but no go.
After all the hullabaloo it turned out that the pen-drive in his pocket had a node_modules folder. Deleting it made him lighter and that saved his life omg. :') -
Today I was reminded of a valuable lesson... Never compare strings with == in java... Just spent like 30 minutes wondering why my string that I was getting from a browser parameter wasn't equalling the value I was checking for...
Apparently when I get a value from a requestParameter in spring, despite being a string it doesn't get a hashCode for some reason, or at least it got a hashcode of 0, so my strings weren't comparing because of that...21 -
So here I am trying to understand the database schema in order to write a REST interface. Then I find that one of the tables contains an id and a name columns but the name is Integer not a string!
I contacted the developer who gladly explained that it was easier for them to store the ids in the database but the actual names strings were hard coded in the source files so they can handle translations! -
sAleSfoRce aPEx is a hot wet garbage fire. How can I make this actually make this work right when I need to compare case sensitive strings?10
-
Ban visual programming programs, like scratch after the fist month introduce them to enhanced Google search strings and let them code on the command line going from imperative, over functional to object oriented programming styles using languages suited for the current style. Not like using Java from the get go. I hated it, waiting until everyone got to the point where they kind of understood the logic but failed at using correct syntax and efficient coding styles.
-
...
We are using a shitty language and a even more shitty IDE at our company for our software.
I'm quite new to this, so I don't know all sorta stuff.
Was writing an addition to a convertion from an old system to a new one.
Needed to "Map" Strings to IDs, so I used a switch case to determine the needed IDs.
Because that fuckin horseshit has no realtime errors (just at compile time...) I didn't realize that there is no such thing as strings in switch case in this language.
So I wrote this whole fuckin shit and when I compiled I got massive list of errors.
So I had to redo that shit with If, Else If... And that motherfucker just crashed on me...
HOLY SHIT...7 -
Just make a program that spits out random strings, run it as code and see if it compiles. If not, repeat. That way, just like the apes typewriter thing, you find the most amazing code that is so complicated, nobody would have thought of, but it solves all of humanities problems, especially the power problem you created by running this code 1000000000000000000000 times parallel.9
-
You know what really bugs me? How movies show people hacking into something with the terminal and all the matrix code but its really not like that.6
-
So, this is apparently how you concatenate a list of Strings or should I say cities 😉 (with a delimiter between each element but excluding the last one)
I wish my esteemed colleague at least had decency to hide the fact he copied it from SO 😭
Question: what's wrong with this code❓9 -
We had to add licensing to a program of us. In the end we chose a small java-library for that and i wrote a convenience script that creates a valid license.
But the script got its input from static strings and that was its doom.
My boss cloned the repo with the script (and jars), replaced the strings with real world data and pushed.
For his conveinience, because there were several clients, he copied the data-section, commented out the first one and put another data into the second section. This happened a few times and HE PUSHED AGAIN.
Now this repository contains a fine record of everyones licenses and their passwords. I know it shouldn't bother me, but it still gets my eye twitching, just like md5-hashing on passwords (which actually happens on that licensed project)2 -
Somehow I wrote some code that ended up comparing a string type object against a pointer of an unrelated class. There are NO functions to convert that class to any kind of string representation. Let alone ones that would allow that to happen in C++.
WhyTF did the compiler not pick up on this?5 -
Benefits of using Strings for Boolean intended logic?
I'll go first
easily implement cases before finally checking if true
generateUsername: { type: String }
if(generateUsername == 'humanReadable'){
// generate a username in a human readable format AKA yoDudeImRainbow
} else if(generateUsername == 'hash'){
// generate a username by using a random hash
} else if(generateUsername){
// generate a username by using a random hash
}21 -
Prettier formatter, AirBnB linter.
Prettier defaults to double quotes for strings. AirBnB loves it some single quotes. Would probably be able to change the configuration in order to maintain sanity *now*, but when I was a newbie dev, I was given a repo with AirBnB linting built in after being recommended Prettier.
It was not fun times.4 -
Whenever I'm looking at automata, matrices, sets, anything confusing and maths based, I always remind myself how I used to be in awe of the year 6's (5th grades) getting to learn about negative numbers...
Negative number seem so much easier than sets and strings... -
Fuck copy-pasting. I just spent WAY too long trying to figure out why == wasn’t working to compare strings in python when I discovered that I had accidentally pasted a trailing space into the database entry causing it to not be equal
FUCK3 -
Just started to do something. Then i came accross a problem and googled "How to concentrate strings in C" Found sprintf and strcat, could concentrate strings. And this just with every problem.4
-
Needed to display two strings on separate lines. Instead of creating 2 views and setting their data, I concatenated the strings with "\n" in between and displayed it in one text view1
-
How do you guys get better at programming?
I'm very new to this sphere and currently I'm learning C++ (think strings, bools and early stages of if/else) due to university course and I have fun with it during labs, but when I have to do something by myself from scratch, I reach a certain point and then I get stuck. I try re-reading the lectures but I can't find appropriate solution for the issues I face.
Do I keep doing simple tasks or do I just watch/read guides or tutorials? What is your input on the matter, fellows? :)4 -
Always ensure that, if you have a fixed-length buffer and concatenate strings there, the end result will fit.
https://youtu.be/vZK5nG6oNEw -
A coworker wants to save telphone numbers as Strings in a database I don't get why he doesn't want to use Ints. I think it is stupid because it uses more space and you need to change the type if you want to use it to call someone. He says it is better this way because you can put there "+" and "-" for better readability.12
-
I had the "pleasure" of working with someone who though that it would be a good idea to create random strings and check if they were in a database, to ensure they are unique. What's even better, is that this was being used for batch generation of up to 100 such strings at a time!
-
My dumbfuck hosting fucked up the mysqlnd installation and it is missing the pdo api extension. All my queries are returning strings for every field. It's easter so no support available. I've planned to deploy the new site in this weekend. Now i have to manually typecast after every query because i've used === everywhere. This will be a long day...6
-
If I could, I'd attempt to create an ideal language. I'd aspire that its features would be:
-The easyiness of Python
-The library ecosystem of Javascript
-The readability and cross- platformness of Java
-Functional features of Haskell
-Modularity of Lisp
-Low level features of C/C++
-Powerful with strings and data, like Perl
-Both compiled and interpreted, with REPL
Anything missing from your favorite languages?9 -
First you make a filthy JSON protocol where numbers are encapsulated into strings.
Then you document this little fact nowhere. Actually you don't document anything at all.
Then you make a shitty parser that ignores any exception. So that when I try to send my objects, it took two hours to figure out it was "my fault" as I was sending actual integers instead of strings.
I think you deserve to suffer a terrible agony for exactly the amount of time I lost.2 -
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 -
Just realized dynamodb does not allow empty strings. You can never store attributeName="".
And I can't see why.
Wtf aws? You high mutherfucka?
Like why? You don't want devs to have a peaceful sleep don't you ?
If possible I would never be in 100 m radius of this piece of scalable-shit called dynamodb1 -
I have spent my entire day code reviewing thinking ...
This developer must think all the lines are fighting with one another ..
I kid you not ! Every line of code has white space between it ....
To top it off ... all strings are initialized new String() then assigned to constants ......
*sigh*1 -
I dont know why but my team lead urges everyone to use empty string as a constant string variable from our utility class instead of just putting "" in our code... Its really cringe worthy... Why use Constants.NONE when you can put "" just to avoid null exception working with Strings..4
-
StackOverflow locked my account. I'm hoping someone here might be kind enough to help me with a bash script I'm "bashing" my head with. Actually, it's zsh on MacOS if it makes any difference.
I have an input file. Four lines. No blank lines. Each of the four lines has two strings of text delimited by a tab. Each string on either side of the tab is either one word with no spaces or a bunch of words with spaces. Like this (using <tab> as a placeholder here on Devrant for where the tab actually is)
ABC<tab>DEF
GHI<tab>jkl mno pq
RST<tab>UV
wx<tab>Yz
I need to open and read the file, separate them into key-value pairs, and put them into an array for processing. I have this script to do that:
# Get input arguments
search_string_file="$1"
file_path="$2"
# Read search strings and corresponding names from the file and store in arrays
search_strings=()
search_names=()
# Read search strings and corresponding names from the file and store in arrays
while IFS= read -r line || [[ -n "$line" ]]; do
echo "Line: $line"
search_string=$(echo "$line" | awk -F'\t' '{print $1}')
name=$(echo "$line" | awk -F'\t' '{print $2}')
search_strings+=("$search_string")
search_names+=("$name")
done < "$search_string_file"
# Debug: Print the entire array of search strings
echo "Search strings array:"
for (( i=0; i<${#search_strings[@]}; i++ )); do
echo "[$i] ${search_strings[$i]} -- ${search_names[$i]}"
done
However, in the output, I get the following:
Line: ABC<tab>DEF
Line: GHI<tab>jkl mno pq
Line: RST<tab>UV
Line: wx<tab>Yz
Search strings array:
[0] --
[1] ABC -- DEF
[2] GHI -- jkl mno pq
[3] RST -- UV
That's it. I seem to be off by one because that last line...
Line: wx<tab>Yz
never gets added to the array. What I need it to be is:
[0] ABC -- DEF
[1] GHI -- jkl mno pq
[2] RST -- UV
[3] wx -- Yz
What am I doing wrong here?
Thanks.17 -
How do you approach generating "random" unique numbers/strings ? Exactly, when you have to be sure the generated stuff is unique overtime? Eg. as few collisions in future as possible.
Now I don't mean UUIDs but when there is a functionality that needs some length defined, symbol specific and definitely unique data, every time it does it's stuff.
TLDR STORY: Generating 8 digits long numbers so they are (deterministically - wink wink) unique is hard but Format Preserving Encryption saves the day. (for me)
FULL STORY:
I had to deal with both strings and codes today.
One was to generate shortlink word for url, luckily found a library that does exactly this. (Hashids)
BUT generating 8 digits long, somewhat random number was harder then I thought, found out on SO something like "sha256(seed) => bytes => ascii/numbers mangling" but that had a lot of collisions because of how the hash got mangled to actually output numbers and also to fit the length.
After some hours I stumbled upon Format Preserving encryption (pyffx) and man it did what I wanted and it had max 2 collisions in 100k values. Still the solution with this feels hacky af. (encrypting straddled unix timestamp with lots of decimals)6 -
We have a brand new employee who won't ever shut the hell up. He likes talking about "my scripts" a whole lot. Guy really loves scripts. He'd admitted to copying these strings from his previous company.
We had an all-tech meeting today and he went on and on, talking about what was at this old company. He's so damn annoying. Listening to him is pure cringe.7 -
named two strings as fuck and cunt (because im tired of debugging this stupid bug since last 5 hours)
compiling...
aaand laptop freezes
fuck. my. life.1 -
So, in C#, are there any tips or guidelines as to how to write "clean" multiline strings? I mean, imo it doesn't look as neat when the code looks like:
static string kindOfLongVariableName = @"First line of string.
Second line of string...";
With the first line sort of hovering on the side. What I'm used to is with Python where you can just:
variable_name = """'\
First line.
Second line.
"""
And use the '\' to escape the newline, but that obviously doesn't work in C#. Can anyone point me in a direction to start looking? The docs are a bit confusing and not very beginner friendly. :/20 -
When you tell your friend you're good at coding and they ask if you can hack into a Facebook account5
-
My colleague had some problems today.
He had problems from both user input and predefined strings sent with ajax to backend. The "&"-sign was splitting values in GET-requests into unintended parameters. So... he was simply going to search and replace all of those signs with the word "and"...
encodeURI()? Why are you sending our forms with GET-requests?! 🙃 -
This morning, I decided I'm gonna do some Android development. I opened Android Studio (closing 2 Firefox windows to reclaim enough RAM), launched the Android Emulator and then proceeded with my coding.
Since, I've almost finished a prototype app, translated a good 100 strings, had lunch, updated 2 server and THE EMULATOR IS STILL BOOTING!
My Android dev friend tells me this "just happens sometimes". WHAT?!?
I'm genuinely starting to think that good software doesn't exist anymore... -
Tasked with changing a couple of captions on a form. Literly as simple as 'Enter product' to 'Enter item' kind of change.
Reported in our morning stand up the changes where complete, tested and deployed (maybe 15 minutes worth of work including code check out/in, copying the file, etc)
DevA: "Ha ha...that's why you put those strings in resource files."
DevB: "No kidding. Not sure when we'll ever start doing best practices around here."
It was all I could do from saying "What the -bleep-!? That is the stupidest thing I've ever heard." -
Today I had to explay to a new developer, gradueated in Informatic, that our 15 year old php application uses global variables and strings as sql commands.
It seem to force someone to prostitution.
It's just like to drive a ferrari using a double-clutching because the gear is not syncronized.
I was shamed.3 -
Oh come on MySQL driver, returning all values as strings? Really? It's like they went out of their way to be dumb.4
-
Ok the ionic datetime component horror ended. I got it working good enough but I'm not proud of my code. The whole thing is a giant hack parsing dates to and from strings, switching locales, setting months and days and using the month as a daypicker as this fucking component does not allow me display day names in it, only month names. Such a mess... at least now I can work on the stuff that matters.
Actually though about making this open source... I reconsidered.8 -
Taught me just because something looks right it doesn't mean it is right. Ex: memory leaks, connection strings, 32 length passwords, and good looking women. Oh wait that last one could be a rant by itself cause you can't find a good looking woman that isn't crazy and won't wake you up if you do manage to get to bed1
-
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
-
I want to do some kind of simple note-taking web-app, with a Golang-Backend.
I need to choose a database, but don't have any clue about DBs.
Every note will consist of 3 strings, let's call them content, pubkey and privkey and I want to retrieve a saved note by searching for pubkey.
Can you recommend me any particular DB or at least an all-round solution ?3 -
Spent quite some time debugging an odd problem.
A null check failed to trigger correctly, and when checking in eclipse I saw the null value.
Much digging later I finally noticed that the value wasn't null, it was "null", but eclipse doesn't quote strings...
The problem was that somebody at one time decided to convert an Integer to String by prepending an empty string...
Integer val=getInt()
return "" + val; -
was developing a custom website for a friend, coz i primised him id do so.
but when i actually developed it i felt lazy midway so i made one table store json strings and used it for every type of data he has on his website.
everything works fine and fast, its nothing he would notice but...
am I going to hell?9 -
Learning Java for the new position I start in a lil over a week. Biggest struggle migrating from PHP is wrapping strings in quotes ONLY...no apostrophes lol. I guess I formed a bad habit. Also slightly frustrating is that you can't overload a method and set defaults. I guess you get that with Kotlin but this company is going to switch away from Java to GoLang and React, so I guess I won't really get to enjoy Kotlin.
-
I shall delay your PR with my giant egotistical scrotum by:
- Use less words for your function name
- Use this obscure pattern you have not learnt in your outdated compsci degree
- Each loop should get their own function
- Your function has too many parameters
- You must name every instance of magic numbers / strings
- Here, have another obscure test case to write9 -
Not sure if other programming languages class a Boolean as an integer value buuuuuuut...
The amount of times I've seen people do code such as...
if(value == true) {
variable = "blah blah";
} else if(value == false) {
variable = "blah";
}
Instead of doing a simple 1D array and going...
variable = strings[value];
It drives me crazy, such a small thing that has no real benefit but... Ugh... Whyyyyyyy3 -
Dear Python devs who complain over state of Javascript. I politely ask you to fuck off because followin reasons. You are praising language witch does not have switch case statement(until 3.10), your async is just a stolen idea from JS and final argument that in pyhon there is one way to do everything is such bullshit when it comes to strings. For some reason i meet JS people who can write Python without much complaining but rarely another way around. Everytime Python fanboy sees JS they need instant tampons to stop their ass bleeding.7
-
Isn’t the usage of environment variables common for golang apps?
I interviewed for a company which made me develop a golang backend service and I used environment variables for sql connection strings and client and secret IDs and all.
When I submitted them the project, the feedback was that the tech person isn’t familiar with dotenv configuration.
Any inputs about any other way this could’ve gone?3 -
one of the most annoying things about our system at work is that we're constantly updating broken links because we're in the process of updating a lot of legacy code. there's this one service to retrieve links for a module, but half the links in the legacy code are hard-coded strings anyway, so the whole thing is just a huge maintainability disaster. anyone ever come up with any interesting solutions for managing links between modules?1
-
When you wake up on a sat, log in to your emails to share with your bosses a new hacking framework just out that can decode encrypted strings, and no one replies because it's the weekend
-
When you work on something for few hours and then write a script to recursively replace strings in your project but forget to take into account the git index and end up corrupting it 🤦🏻♂️🤦🏻♂️
I know I should have pushed commits in between. Lesson learnt -
It makes me so sad to see such vast amounts of copy and pasted code at my new job :(
3 identical classes with only a few strings different 😡1 -
my old game had this flow every time a client places an object:
Client A creates a new generic object, and attaches texture paths (yep, global paths are allowed), and... lua code as strings to it.
Client A sends the entire object list to the server
Server receives it, replaces it's own object list
Server copies the entire object list and sends it to all clients
Client A and Client B both receive the object list and replace their versions.
All clients see that the object contains some code as strings
They compile and store it, and then run every frame. UNSANDBOXED.
any client could make all other ones execute any code and i was proud of my idea! -
is not my fav lang
but i work with it every day
php's preg_match and preg_replace functions
i have the perversion to manipulate strings -
Just enrolled my Nexus 5x in the Android O beta.
I am very impressed so far with the differences between N and O -
How many of you want to live in a world where there's no a standard way to convert numbers to strings among systems?1
-
How to react to a coworker using equals() instead of equalsIgnoreCase() for checking case insensitive strings?19
-
Concatenation of strings in a loop (in C#). Seriously. It's just so easy and unless you are doing something memory intensive or awful (in which case I am sorry) it really doesn't do much harm if any.
-
I just come back on this app to ask you, dear developers, to stop using ' for strings everytime, it is supposed to be for chars.
THANK'S YOU 🙃
Do it for the eyes of C developers, my eyes are bleeding right now.9 -
Honestly, people who think “vanillaJS da way” and heavily work with HTML strings are a danger to human kind.
You’re basically running around with a shirt saying “I love using eval wherever possible”2 -
We have a somewhat experience developer for whom we have to CONSTANTLY fix his type errors. He just doesn't seem to grasp the idea that there is a difference between integers, strings, floats, etc. and that when you don't bother with them, things get a little screwed up.
Granted, Javascript's typing leaves... well, everything.. to be desired, but STILL dude, this is basic shit. Come on.2 -
I just want to give a quick shout-out to the advertisers who were so quick to monetize a pandemic and pull on the heart strings for some PR value.
Well done, lads.2 -
If my coworkers are going to execute SQL commands via strings in python and I can condense 50 lines of code into 7 with built-in eval(), then I see no problem here.6
-
Holy shit! Why is it so hard to find a JSON viewer for android that doesn't absolutely suck ass?
I want a viewer that:
-reads json from the clipboard
-queries json for strings in context
-allows copying of values, not the key and the value put together
Major bonus points:
-JSONPath querying
-Free/pay version without ads7 -
My first real programming teacher. She showed us strings, then made us use dynamic arrays in C++ for a year and a half. But we learned pointers and arrays very well!
The hard way can be the best way for education. -
I'm working with an API where, for some reason, half of the numbers are returned as numbers and half as strings. I'm baffled more than David composing hallelujah.5
-
The worst part about programming assignments at my school is formatting the god damn output strings. Fuck2
-
Development Process:
PM writes out functionality required and works with designer for drawing up designs.
Hands off to Dev.
Dev reads through all docs and sends the PM all the strings, he's just written down in the documentation, that he needs to request for internationalisation. -
our automated email system is written in 3 y/o razor (cshtml) pages that have no inheritance.
there's 50 files that are all copy/paste with slight variation in the strings.
I have to set up localization for all of it.
might just quit.2 -
Sir i am a newbie student to CP. I have recently started CP and just know array , strings , loops , function and basic libraries along with logic.
Where and what roadmap shall i follow so that i can get rated nicely and quickly on codeforces?
(Currently about 700 rating).7 -
Why Dart was designed with idiocy:
1) naming conventions are idiotic
Most other languages are smart enough to not throw errors when the variable name matches its type. And lots of others, for any lexemme - only 1 naming kind is allowed.
Fine. Oh wait, there's that thing called existing databases and GraphQL & other APIs, should they all adapt to this? No, because 2) is the bonus
2) String keys in objects. Unless it's a class with boilerplate, you write them as strings and access them as strings.
So here's the solution when you want to integrate Dart with existing services: write a lot of JSONSerializable decorators to fit with dart's pissy naming requirements.3 -
There are mortals, then there are legends, and then there are people who import moment.js, and then manipulate dates with bare strings.
-
Me : Here, a list with multiple strings, do your job, Foreach block
Code : *do only one iteration*
that code is lazier than me1 -
Cofefify all your strings with a short function in the language you like 😁
https://codegolf.stackexchange.com/... -
At times my frustration with debugging is so much my verbal expressions might as well be uuid strings.1
-
I wish I could be the man who creates strings with .toString() or even `${variable}` consistently. Alas, ""+fuckThisShit.
-
I have a very basic question regarding strings in Java..I am not getting the clear explanation any where..
1. When the string is created with new operator, will it be stored only on heap or on both heap and string pool??
2. When I create a string like
s1="123";
s2=s1+"5";
What would happen at the second step??
a. will it put 1235 in the string literal pool??
b.Will it create a new string 5 in the literal pool??
please answer buddies.4 -
C++ standard commitee please give us compile time strings and reflection. Why are you taking so much time?9
-
So I'm working on an assignment for my Computer Science class, and we have to basically compute strings into hash values and then modulo it by 1 million and put it into the hash table. But the value keeps overflowing and turning into negative values, anyone know how I can calculate the key?
(BTW, the hashcode is the same code that is calculated by the .hashCode function in Java)5 -
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 "=="
-
Until the old Dev left this team, I never had to handle any of the website end of things. Now he's gone, I've had to look through his code, and Jesus Christ I didn't know you could be hired to do things without knowing what functions are. It's just long strings of PHP includes.3
-
So Sonar (Java code style checker) is telling me to return immediately instead of first assigning the results to a variable:
ArrayList<string> strings = ...
{Some long running logic that populates the list}
String x = String.join(strings);
return x;
Declaring x is bad apparently... but I disagree...
Am I not understanding something here?
The upside out this is you can breakpoint it and well you meet want to add additional logic later while you find a bug while debugging...
I guess it would be noticeably slower but a few seconds... If I were to call it 1 billion times?14 -
3 hours later I discover why my unset destroyed our json.
"When encoding an array, if the keys are not a continuous numeric sequence starting from 0, all keys are encoded as strings, and specified explicitly for each key-value pair."
Thanks obama.1 -
The strcmp(3) manual page takes me closer to god: "strcmp() function compares the two strings s1 and s2. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2."
-
I never thought how hard it would be to write cross platform software. If statements and try/excepts are everywheeere. And I still need to reformat the strings for different aspect ratios.
I wish I had the balls to use this awesome sentence "Works on my machine" 😂 -
So I thought I had a basic, high level understanding of C++ STL strings, pointers, copy constructors and stuff. In comes a dirname, a -D_GLIBCXX_USE_CXX11_ABI=0 and... Toto, I've a feeling we're not in Kansas anymore.
So what is happening? I copy a string expecting a deep copy, but then I do the dirname or manipulation on the copy and it messes up *both* strings. gcc/C++ I know you're a beast, but what's going on there? Thing is only possible if I cast away const from c_str - which of course is a doubtful operation - but there also seems to be some strange copy on write logic that the data pointers initially point to same memory location and only with first manipulation on the copy they start to point to different addresses.
I had no clue. And still don't have.4 -
Hey!
I am trying to learn creating games for android (+- 0 android expirience).
I figured I could use GoDot for it's awesome pricing (free, no strings attached).
I've done few minor things, but, to be perfectly honest, I'm fed up of GDscript. I just internally hate it more every single time I touch it, so recently I stopped attempts to learn doing games for droid/iOS.
I'm looking for free alternative to godot, preferably no strings attached, but wahtever... Here is what I need:
- I prefer code, but doing stuff in GUI is fine, but stuff like making level etc, preferably in UI
- C++ derrived syntax (ex. c# etc. c++ is fine too), no BS like some wacky workaround to do basic shit like 2d array....
- easy android/iOS export (like in godot, one day I was attempting to hello world in android and compiling for first time... was quite an advanture)
- objects
- some easy way for restfull apis
Good to have:
- ability to test project without android VM
- observer pattern (signals/slots)
I don't care what structure it's made, for me milion of scenes on one screen was extremly coutner-intuitive but meh, whatever. As long as it's possible to learn, it is fine.
Can devranters help, please?
Thanks,
peace.16 -
Another hours wasted on debugging, on what I hate most about programming: strings!
Don't get me started on C-strings, this abomination from hell. Inefficient, error prone. Memory corruption through off by one errors, BSOD by out of bound access, seen it all. No, it's strings in general. Just untyped junk of data, undocumented formats. Everything has to be parsed back and forth. And this is not limited to our stupid stupid code base, as I read about the security issues of using innerHTML or having to fight CMake again.
So back to the issue this rant is about. CMake like other scripting languages as bash have their peculiarities when dealing with the enemy (i.e. strings), e.g. all the escaping. The thing I fought against was getting CMake's fixup_bundle work on macOS. It was a bit pesky to debug. But in the end it turned out that my file path had one "//" instead of an "/" and the path comparison just did a string comparison without path normalization.
Stop giving us enough string to hang ourselves!rant debugging shit scripts of death fuck file paths fuck macos string to hang ourselves fuck strings cmake hell12 -
Swear some people just want you to do their fucking job as well, why the fuck would the connection strings need to change if the code doesn’t even reach that line maybe try looking again right at the top where it prints a message saying what arguments are required and try using them. Come on if your that stuck step through the lines 1 at a time from the start and it will all become blatantly fucking obvious
-
How much trouble am I asking for in allowing for very large strings in attributes of json data?
I went and looked at the maximums for the string in json strings. I cannot see any real limitations. I did see if sending json data to a browser that it should not be more than 40MB. That seems excessive. I also checked my internal data types. The string can hold 2GB. Then there is a the server it will be served from in OPCUA. Which I saw discussion of strings in the 77KB range.
We are using a json file to configure what points to read from a modbus device. I am adding fields for name and notes. I could limit these fields, but part of me wants to see if some customer tries to make the world burn. For the most part we will be editing this file. But the customer may want to as well.2 -
God damn it wpf I just wanna bind an ObservableCollection<string> to an itembox and then have textfields inside that item box that modifies those strings and have the modifications stay there https://imgur.com/a/Un2nk9V !7
-
Getting something working that you've been stuck on for two weeks, despite telling the client, your pm and your boss that there is a much easier and quicker way to do it that doesn't involve downloading over 1000 pngs and storing them as base64 strings to form a massive pdf, damn android and it's lack of native pdf viewing
-
How someone can think that the best idea to store a vector of physical values, knowing perfectly in which unit measure it needs to be provided for the back end to work, is to couple a vector of strings with the units, is beyond me.
-
I use Atom. It's a basic coding program similar to Notepad++ and Sublime Text but more minimalistic.
Link to it: http://atom.io -
People really don't understand what 'no strings attached means'. I've tried laying completely bare my thoughts about commitment and why it doesn't work (and won't work) for me at this point in time but people just pretend to understand only to start pestering me at work hours the next day.
What am I supposed to say? In what language? What's the key word I'm missing?.4 -
So I can't believe I'm asking this again. But where the fuck is the source code for BOOTX64.efi for linux ?
And why when i run strings BOOTX64.efi does the word microsoft show up ?32 -
ASP Classic (vbscript)...
Loved it when it was the only language I knew but single line strings, case insensitive code, lack of simple lists ultimately made it produce some of the ugliest most maintainable code I've ever laid eyes on.1 -
can you please help me with this.
I'm creating dataset of [Leet words][1].
This code is for generating [Leet words][1]. it is working fine with less number of strings but I've nearly 3,800+ strings and my pc is not capable to do so. I've Tried to run this on cloud(30gb RAM) not worked for me. but I think possible solution is to convert this code into numpy but I don't know how. if you know any other efficient way to do this it will be helpful.
Thanks!
from itertools import product
import pandas as pd
REPLACE = {'a': '@', 'i': '*', 'o': '*', 'u': '*', 'v': '*',
'l': '1', 'e': '*', 's': '$', 't': '7'}
def Leet2Combos(word):
possibles = []
for l in word.lower():
ll = REPLACE.get(l, l)
possibles.append( (l,) if ll == l else (l, ll) )
return [ ''.join(t) for t in product(*possibles) ]
s="""india
love
USA"""
words = s.split('\n')
print(words)
lst=[]
# ['india', 'love', 'USA']
for word in words:
lst.append(Leet2Combos(word))
k = pd.DataFrame(lst)
k.head()3 -
Is HackerRank a good site to prepare for technical interviews? And I guess the general question is how to best prepare?
The problems are interesting but it seems most of the Medium+ ones require knowledge of a specific approach or the large test cases will terminate with timeouts or out of memory.
Been sitting on this for a week. Just implemented the recursive versionwhich is better but now times out.
https://hackerrank.com/challenges/...6 -
I just discovered that the site "http://whocouldthat.be/visualizing-..."
match strings. But what about if you go over "http://whocouldthat.be"? So sad -
A register machine with strings and hashmaps as the only data types and no stack. You have to make one from a linked list of hashmaps.1
-
Just a question, is possible in Android Studio to display a fractions using strings?
For example, instead of (m1 + m2) / v2 use a fractions2 -
How can i create wordlist, lets say from word "world", so the program creates all plausible uppercase and lowercase strings from that word? e.g. "World", "WorlD"... , "WorLD" and so on...11
-
It's time to reconcile the religious war with a compromise: How about we use spaces for lines with indent <= 8 chars and tabs for deeper indents?
Or maybe tabs in all functions returning strings and spaces in all other functions?2 -
You know it's Friday afternoon when your interface is broken because you tried to set the type to the string 'string' instead of the keyword string.
Interface IEnvironment {
name: 'string',
...
} -
How do I go into tokenizing strings of text from a LaTeX file into a Go structure for further processing? I feel like splitting hair trying for loop over an io.Reader and using regexp to find where a sentence ends; there must be a better way...2
-
Design question for y'all
Context: python lambda
Better to make classes for dictionary objects holding strings between methods
Throw strings around separately
Throw the dictionary around6 -
I’ve been doing a lot of solidity development lately in my professional life.
Now I get that nested arrays aren’t implemented yet. But it is still weird not being able to have an array of strings.
(Strings are arrays of characters and that would be a meted array) -
Nothing beats the feeling after designing a great, versatile function that can handle everything you can throw at it, and then realizing that actually you've built it to translate two (2) strings.
But eh, at least it's extendable! -
Why? Why does Eloquent with SQLite only fetch attributes as strings? I spent at least half an hour debugging, I just want to set up a local test DB and now I have to run a whole PostgreSQL instance3
-
It's always some dumb thing that goes wrong. Like, a semicolon I forgot to type, or a period or a misspelled variable. Last week I spent two hours on a Discord Bot coded in Python that refused to iterate a list of names. I had forgotten to put quotation marks around each of the items in the list so they would register as strings instead of integers. Will it ever get better?6
-
Trying to search for URL strings becomes a pain in chrome because I've no choice but to either search for something else first or type Google into Google :(2
-
Is there ever a fucking reason to do a get_attrs call in python when you could just use a fucking explicit dict or just idk use the fucking typing system to implement a fucking interface? Like why the fuck should anyone ever be using get_attrs and strings to diddle objects?2
-
I have a side project which contains very simple data (a URL and a list of strings associated with that URL). I would like a way to automatically generate a webpage for each of those links (I believe the right term is template ?). Does anyone have any suggestions? Is this something like Next.js or Gatsby would be used for? I can provide more info if I’m not clear enough8
-
Since Google is failing me...
Given a user input (string query) and a list of larger strings (like email bodies or something), what's the best way to search and rank the list of strings against the user input.
So far I have implemented levenshtein distance but it doesn't really seem to do extremely well. (Short strings rank very well against each other, whereas long strings **containing** exact matches will go lower in the list)
Should I be splitting the input and the list by word and then averaging the distances?
The only thing I have tried is removing complete non-matches from the list by not including them if the distance is equal to the length of the largest string17 -
tl;dr How do I deal with translations?
Chinese users asked for translations for ages, one guy did it all, but then? I needed to update the app, I had added some new strings, the guy didn't replayed. Obviously, as I didn't wanted to pay, I've used Google Translate. Result? "Good app, but the translations are wrong.", nice!
What can I do? Do I remove the Chinese translation and tell them to fuck off?2 -
Ghidra won't let you relocate a function or data label and update all pointers to it, so I made a tool where that is its only fucking job. That's all it does. Open a textfile, drop in symbol names, paste in hex strings, change address bytes in the hex strings to other symbol names, hit GO. why is this not a feature built into these goddamn RE tools, when people have been doing this manually since before game piracy was a thing on home computers?2
-
Why is Lua such a pain to install? Like seriously there are so many hoops to jump through, why can't it be like java or python? -_-3
-
Over the years I've written in C, Java, .NET, SQL, php and JS. Past year has been exclusively JS. Had to pick up some C# a couple of days ago and DAMN!! Forgot everything!! Putting single quotes for strings and using === everywhere!! Am I just getting old or do others struggle to switch back to a language that's not their primary one any more?1
-
Tried Lua for the first time in a while. Really didn't like how it handled chars/strings, that's about it.3
-
i understand way too little about web data types. while having to store a shitload of data in cookies (sorry for that, no localstorage for local sites, insensitive though) i was so proud of compressing strings with bitshifting only to find out that uriencoding bloats chinese characters massively up. fml3
-
I read the whole documentation of Mongo Atlas Search and I still don't know if there is operator "greater than" for strings. I'm trying to implement my own "search_after" in the query because sort+skip is not a good idea and every time I google for a feature I end up in a forum where a PM says "Coming soon, we will prioritize this" and I know that things don't work like that1
-
student here.
just spent over an hour working on my final project trying to figure out why space padding "wouldn't work" in my strings...
i wasn't using a monospaced font.
*facepalm* -
My friends were wondering if I could teach them the basics of coding. What order should I do it in? The basic things I want to teach them are input/output, data types (numbers, strings, arrays, etc.), flow control (loops, if/else), functions, variables, and maybe oop if I'm in the right mood.
Also, would python be a good language to start with? It's definitely the language I know the best.7 -
Excuse my question I might be the one to blame, but on Typescript 3.7 JSON.stringify parses numbers as strings, while on 3.4 it was working without issues.
I'm no pro in web dev but I did use JSON.stringify lots of times and that's something strange here, not sure what the cause is, but when I parse number props again using parseInt(value.toString()) it works .-.2 -
So I was thinking of using Hexatrigesimal strings (base 36 numbers) for indexing like in a database. It could be very short indexes for long numbers, and still be completely ordered. However it doesn't seem to be supported a lot in programming languages. Does anyone know why it could be a bad idea?10
-
Last question for today, I promise…
For my side project, I plan on saving a URL and an array of strings associated with that URL. I want to be able to search and sort the resulting DB from a frontend without needing complicated queries. Is this the use case for a key-value pair DB? Let me know if I’m not clear and thanks!14 -
senior: it should only take 30 seconds to replace multiple display strings across our code base
well it would be nice if they'd do it then, and somehow i don't think that 30 seconds included checking your work and making sure you don't fuck up other instances of those strings (e.g. in variable names, etc)
maybe you got a clever enough regex to only hit exactly what you want :shrug:1