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 - "newlines"
-
Hey devBanner guys..i forget who handles the project
@kimmax and @CozyPlanes come to mind?
question: why block \r\n ect, when i can still insert new lines?20 -
Fell asleep with my hand on the keyboard and woke up a few hours later. There was many thousands of newlines in my code.7
-
YOU CANNOT parse CSV by just splitting the string by commas.
YOU CANNOT generate CSV by just outputting the raw values separated by commas.
CSV is not the magical parseless data format. You need to read fields in quotations, and newlines inside of fields shouldn't prematurely end the row.
Do it fucking right holy shit.15 -
I just LOVE how our service desk takes emails and reformats the fuck out of newlines so they look like
Hi
.
problem is fix.
.
kywbye
.
mr. dev6 -
So having gotten my hands on the books I need for the next semester I decided to go take a look at what's in them.
Now the first is mostly web stuff and the second is just about software design. It starts off with an introduction to HTML5, where they didn't really teach HTML5, more like they taught HTML3/4 but not in a way that was too dangerous. I can tolerate not having my semantic tags tbh. They also used spaces on both sides of the = for some reason.
Then a CSS chapter which was also surprisingly mediocre. They didn't use a dedicated CSS file, but I can live with that, for starters.
Then there were some surprisingly decent JS chapters. Although they did use newlines before their { kinda miffed me. There has also been a few developments since this books release, but tbh this isn't the worst case of outdatedness. (And at least they didn't use jquery when teaching JS)
Then a chapter on SQL which I ignored.
Then a chapter about PHP, and, uhm, when did this book get released? Well the ISBN is 978-0-13-215100-9 and using the power of Google we can reveal it was published in.. 2011..
I'm quite happy that I already know how to program12 -
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 -
PSA: If you need to make dummy commits to trigger a pipeline for test purposes, please just use --allow-empty and make an empty one. Don't just add random newlines back and forth in stupid places.6
-
Just opened a project that I'll be working on for work, first thing I notice is C++ like code formatting, which hurts my eyes (keep in mind this is Java)
But then decompiled Hybris classes came at me with not only that, but three newlines between methods.
I fear what I have yet to see...4 -
Requests to a soap server were failing randomly. In order to contact the API provider, I tried to provide an curl example with the same payload and the error response. Yet when sending the payload over curl, the request worked just fine. When my application was building the request, it failed.
What. The. Fuck.
I checked and double-checked the request body and headers. They were identical.
Of course, no error response was returned by the API provider and, of course, they could not tell me how what error I caused in my request.
So I created a basic dummy server, installed wireshark and compared the payload when sending a request from my application and from curl to my dummy server.
It turns out: curl, if called in a certain way, automagically strips out newlines. The soap client kept them.
So that that shitty soap server crashed due to newlines in the message body!
Stripping out the newlines was rather easy.
Shame on you, your house, and entire family for letting it crash due to them!1 -
My math teacher.
Simple story: His way of teaching was like bible study - he dictates the mathematical rules, the students had to write it down _exactly_ as told.
(Yes. He even dictated spaces / newlines / ....).
Had him for many years....
Since I was the rotten apple in class (I was always very weak regarding math), he had joy in mobbing me specifically.
It was one of the reasons I never thought about programming at all - or to be more precise, I _feared_ programming since everyone told me it would require intense knowledge of math.
Well. Fast forward. I went to university despite my fear, just because I was too stubborn to prove my math teacher right.
He was one of the counseling teachers too - and he made _very_ clear that I would fail in _anything_ regarding mathematics job wise.
I failed university, yes.
I gave up simply because I was too bored to learn and replay stuff by heart you'll certainly never need to remember your whole life.
Math played a role, too. Since I lacked the whole mathematical background, I barely passed the tests (mostly by a point).
But thanks to a lot of friends I learned that mathematics is helpful for programming - but not a must.
After giving up university, I started an apprenticeship.
And while I dreaded the decision for a long time, I couldn't be more happy about it.3 -
In code reviews they are whining about formatting with spaces and newlines and naming.
The fact that they are too bored to write unit tests and code coverage cannot reach 20%? Isn't it just sad?6 -
Idea for a project:
Inspired by BlockAdBlock, what if we do a format-minifier loader for webpack? It'll take your minified JavaScript, and format it by filling it with newlines and spaces? It'll also try to guess the functionality of the variables and functions to name them. Ex:
function f(a, b){return a + b;}
// would turn into:
sum(summand, addend){
return summand + addend
}
but also:
function f(a) {
if( window.innerWidth / window.innerHeight > 700){
a.width = 4
a.height = 5
} else {
a.width = 5
a.height = 5
}
}
// would be renamed to...
function ifWindowInnerWidthDividedByWindowInnerHeightThenObjWithHeightAndWidthHeightEqualTo500ObjWithHeightAndWidthWidthEqualTo400ElseObjWithHeightAndWidthHeightEqualTo300ObjWithHeightAndWidthWidthEqualTo500( objWithHeightAndWidth ) {
if( window.innerWidth / window.innerHeight > 700){
objWithHeightAndWidth.height = 500
objWithHeightAndWidth.width = 300
} else {
objWithHeightAndWidth.height = 300
objWithHeightAndWidth.width = 500
}
}
Imma get famous5 -
`load pubkey "/Users/karunamon/.ssh/id_rsa": invalid format`
The fuck? I've been using this keyfile for ages. And that's the private key, not the public key.
Maybe I'll try converting it to a different format.
(20 minutes of ssh-keygen command attempts)
Same error. I don't freaking get it. It works. I mean, I know my public key is..
(public key is actually completely mangled with newlines everywhere)
..yknow what, my fault, but you could have at least given me the public key filename, ya jerk.1 -
I'm pretty sure we don't need to use brackets and semicolons anymore. Newer versions of gcc bitch when you mess up tabs, which shouldn't matter in C/C++ because of brackets/semicolons, so why require the tabs and newlines?
On the flipside, if we're requiring tabulation and newlines nowadays, why use brackets and semicolons? Just Python it up and you won't have issues where you mess up and add/omit a semicolon/bracket and break EVERYTHING!
"It's so you can write it all on one line"
I have yet to meet anyone that masochistic.6 -
For a little background on the sort of stuff I'm dealing with, check out my last rant.
Anyways, I'm testing this pipeline at work and was just reminded of the fucktarded way a "software engineer", who had a bachelor's biology degree, decided to handle a json file.
The script is question is loading a json file containing an array of objects. The script is written in perl. There's a JSON module. Use that? Fuck no! Let's rather perform an in-place sed command on the file substituting the commas separating objects in the array with newlines, then proceed to read the file line-by-line and parse out the tokens manually. Mind you, in the process of adding the newlines he didn't keep the commas, so now all of these json files his bullshit handled are invalid json that cannot be parsed.
The dumb ass was lucky the data in the file is always output upstream as a single line and the tokens for each object are always in the same order, so that never led to problems. But now, months later after I fixed his stupidity I am being reminded of it again as I'm testing and debugging some old projects as part of regression testing new changes I'm making.
TL;DR Fuck dumbwit motherfuckers who can't even google search "parsing a json file" and doing literally anything that is less fucktarded than manually parsing a json file2 -
rust can't even do rustfmt properly
it just does things unadvertised
like reorder_impl_lines which is described as putting type and const on top of files adds new lines between fn declarations and that's not disclosed anywhere. ffs took me a while to figure it out
and chain_width should be different for fn calls and match statements. because newlining multiple fn calls makes it readable, but newlining match statements and wrapping them in {} does not / makes it ugly. there is match_arm_blocks but it still newlines random stuff awkwardly, raaghh
I thought hey so cool I can write without caring about formatting and just press Ctrl + shift + i and all done but now I'm arguing with the formatter and the settings available suck and are poorly described. please don't write a formatting documentation with no examples, wtf? And disclose everything it does, preferably with consistent language so I can search the page (some of the descriptions say new line others call a new line a break. thanks)1 -
I swear to god, getting Chumsky to do my bidding has almost taken longer than writing a parser by hand. I'm not looking for operator precedence, I'm not looking for complicated rules or anything, the main part of my language is literally just S-expressions, with some top level bells and whistles.
I don't even have a working lexer yet because I wanted to use this piece of shit library which usually matches the fewest possible characters to parse significant newlines but the Padded combinator takes as much whitespace at the end as it can find, and a host of other atomics don't actually adhere to the library's lazy principle in their procedural implementation. I've had enough. I'm going to bed, and tomorrow I'm writing tickets.
Actually, I'll probably also write PRs because I actually want the fixes to exist and not just complain about the problems, but I also really want to complain before I get started on that because I spent about two weeks just on this bullshit.3