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 - "trim"
-
“Yeah, the database password has to be ‘password’ or the code won’t work”
—My PM
Note: I don’t actually believe this to be good advice.1 -
Me: Well, it's time to make a new app!
* opens up VS Code *
* opens folder selection dialog *
* creates a new folder called "notes app" *
* yarn inits that folder *
* installs react and react-dom *
* installs webpack, webpack-cli, babel-core, babel-loader, babel-preset-env, babel-preset-react, style-loader, css-loader, file-loader, html-webpack-plugin and clean-webpack-plugin as a dev dependency (install is pending) *
* copies a webpack config from some other project *
* creates a babelrc file *
* copies a yarn script called "build:dev" which would launch webpack *
* dev dependencies installed *
* tries to save *
* vscode doesn't save because files differ *
* tries to copy dev dependencies *
* fail *
* tries again *
* saves *
* writes bare-bones index.jsx *
* yarn build:dev *
* opens build/index.html in firefox *
* gets satisfaction *
* writes bare-bones App.jsx which is a react component but it's an entire app *
* yarn build:dev *
* opens build/index.html in firefox *
* gets satisfaction *
-- trim --
* walks out of his room to his mom's room where's sbc is located *
* grandma plays solitare on laptop *
* i ask grandma for a laptop *
* grandma gives me laptop *
* glues all components into App.jsx *
* yarn start:dev (magic of webpack-dev-server) *
* opens localhost:8080 in firefox *
* searches how to update a component prop *
* nothing found *
* registers on devrant and verifies his email *
* writes this rant *14 -
when you had to maintain some stranger's shitty codebase, and you couldn't resist looking up his name on LinkedIn, then you found his profile which says he is a Rockstar coder8
-
Computer Science Teacher: everyone do a route in PowerPoint
Me: Can I do it in HTML + Leaflet?
CST: Yes, but it would be easier to do in PowerPoint.
-- trim --
* opens up Glitch *
* creates new project *
* imports Leaflet *
* connects OSMs *
* connects Google Maps thru GoogleMutant *
-- trim of interesting story how I copypaste coordinates from Google Maps into polyline with my grandma telling me where anyting is (our village is poorly mapped) --
Me: thank grandma
* project finally done *
-- the following day --
Nobody did the map with a route
Me: yay
* shows map *
* a bully asks what app I used to make it *
* I said that the entire app is a huge app *6 -
Me: I fucking hate people using proprietary data formats when there is something more than capable already...
Also me: *Spends an hour designing file structure for a proprietary image format* Hmmm... How can we trim even more bytes off this...
(Designing the format to be smaller than a typical PNG and make it easier to load in data programatically)8 -
I hate it when code line are structured like this.Get().Start().Trim().Where(a=>a.id = newId).ToList().ConvertAll(...).EndMaybe().Name
Are you a fkin compiler or what3 -
- Be me
- Been in a new job for 2 months
- Was excited because of 50% salary increase and better position
- Have a new team of 6 devs including me. All new guy
- Market crash
- Top management demands a trim down to all divisions
- Will be left to 3 devs next month
- All the while being asked to
- Deliver a shopify like marketplace from end to end
- Deliver integration with partners for data inventory tracking
- All within 2 months
- Furious when target is not met
- Demands a micro management to every single person on the team on what their day to day schedule
- Demands everybody to live by hustle culture and ready to work non stop even nights or weekend
- Be me
- Been working non stop for at least a month
- Sacrificed weekends and holidays
Beginning to think that maybe the money and position isn't worth the hassle6 -
Oh look. The monitoring channel is in flames, smartphone is vibrating so hard it's having a seizure.
Hm. Nah it's fine. Not my...
Damn it. Incoming call. -.-
I'm actually on vacation (more like you need to trim down overtime before management get's angry).
They decided to test the new hardware / os stack I set up in the last weeks. I'd actually be happy about it If I wasn't on vacation and would be part in something that I invested a lot of time...
Well now I am. Guess what. It's running too good.
And that's not a joke. It's partly due to an upgrade in infrastructure (got rid of some last remaining 1 Gbps networks)… but also because I changed quite a lot on the OS / VM side plus we changed from XEN to Proxmox... With major tweaks, too.
The whole stack can now handle peak traffic where it would choke before, and even go beyond the old peak traffic.
Enough of introduction, the simple reason why shit burned down was because they tried out the current development branch and let it ran.
The development branch had an currently unfinished ratelimiter framework, since I didn't had time for an full burn in and didn't knew what the maxima / limits were. And since I hadn't finished that, I didn't finish the traffic shaping either.
Hm. Guess it's not good when you let a bunch of heavy parallelized data generators / analyzers run for free....
In the end, we simply shotgunned the docker development machines, because thanks to network congestion / retransmissions and feedback, they were not really cooperative via network / REST.
But hey: To infinity and beyond. XDrant darling i grilled the network it was just a test dumb ways to die never ask the guy who invented it oops2 -
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 -
UX quiz:
a) trim whitespace characters from credit card or bank account input
b) refuse transaction, show error message: "no spaces are allowed in the card number"13 -
So I just spent the last few hours trying to get an intro of given Wikipedia articles into my Telegram bot. It turns out that Wikipedia does have an API! But unfortunately it's born as a retard.
First I looked at https://www.mediawiki.org/wiki/API and almost thought that that was a Wikipedia article about API's. I almost skipped right over it on the search results (and it turns out that I should've). Upon opening and reading that, I found a shitload of endpoints that frankly I didn't give a shit about. Come on Wikipedia, just give me the fucking data to read out.
Ctrl-F in that page and I find a tiny little link to https://mediawiki.org/wiki/... which is basically what I needed. There's an example that.. gets the data in XML form. Because JSON is clearly too much to ask for. Are you fucking braindead Wikipedia? If my application was able to parse XML/HTML/whatevers, that would be called a browser. With all due respect but I'm not gonna embed a fucking web browser in a bot. I'll leave that to the Electron "devs" that prefer raping my RAM instead.
OK so after that I found on third-party documentation (always a good sign when that's more useful, isn't it) that it does support JSON. Retardpedia just doesn't use it by default. In fact in the example query that was a parameter that wasn't even in there. Not including something crucial like that surely is a good way to let people know the feature is there. Massive kudos to you Wikipedia.. but not really. But a parameter that was in there - for fucking CORS - that was in there by default and broke the whole goddamn thing unless I REMOVED it. Yeah because CORS is so useful in a goddamn fucking API.
So I finally get to a functioning JSON response, now all that's left is parsing it. Again, I only care about the content on the page. So I curl the endpoint and trim off the bits I don't need with jq... I was left with this monstrosity.
curl "https://en.wikipedia.org/w/api.php/...=*" | jq -r '.query.pages[0].revisions[0].slots.main.content'
Just how far can you nest your JSON Wikipedia? Are you trying to find the limits of jq or something here?!
And THEN.. as an icing on the cake, the result doesn't quite look like JSON, nor does it really look like XML, but it has elements of both. I had no idea what to make of this, especially before I had a chance to look at the exact structured output of that command above (if you just pipe into jq without arguments it's much less readable).
Then a friend of mine mentioned Wikitext. Turns out that Wikipedia's API is not only retarded, even the goddamn output is. What the fuck is Wikitext even? It's the Apple of wikis apparently. Only Wikipedia uses it.
And apparently I'm not the only one who found Wikipedia's API.. irritating to say the least. See e.g. https://utcc.utoronto.ca/~cks/...
Needless to say, my bot will not be getting Wikipedia integration at this point. I've seen enough. How about you make your API not retarded first Wikipedia? And hopefully this rant saves someone else the time required to wade through this clusterfuck.12 -
And now, behold: a cat, warning: long loading time since I uploaded the entire fbx file. I'm gonna trim it later.
https://txstc55.github.io/cat/2 -
Our invoice report crushed because someone paste an invalid character which devExpress couldn’t handle.
I told boss we should trim and run regexp test for all string input.
Got rejected.
Why?!?!?!🧟♀️🧟♂️🧟♀️ 🧟♂️3 -
Legacy code is like overgrown bangs 😋 It's very hard to decide if you have to let it grow out or trim it.8
-
What a coincidence. JQuery gets an update to 3.4.0 - and I removed the JQuery dependency that a mid-sized widget (15 kB minified) needed.
Rewriting the selector, css and trim stuff was easy. Each, children, append, empty, remove and extend were not too hard. Animations gave me more headache, but in the end, JS triggered CSS transitions worked nicely.
I was able to shave off the usual 30 kB over the wire for JQuery, and the whole thing seems snappier. Finally, I'm at vanilla everything!
Of course, it's largely due to JQuery's merits that vanilla JS is where it is today. So, thank you JQuery, and farewell.3 -
Asked to make high level estimates for something that has no scope.
Manager keeps asking to trim down the estimates. o.o
Where is this economic + social collapse that was promised?
%@&$4727;&2@@(&@&1 -
sr: XML is difficult format parse PDF instead.
me: (-_-)ゞ゛
checks code...
foo.fooBar = element
.match("<XMLELement>(.*)</XMLElement>")[1]
?.trim();
me: (☉_☉)7 -
My email is just as valid if there is a whitespace at the end of it as if there wasn't.. ffs, just add a trim!
-
a contract designer came in usually one hour late with headphone on playing b-box music, who took a nap on his desk almost everyday before his contract ended. later, he took on a creative director gig in another startup1
-
!devrant.
More like 'relationship' rant.
The following is gonna be kinda crude and not work appropriate just fyi.
First, whats with this trend of 'shave your pussy", and small tits? Shit just a few years ago it was the opposite! Who wants to fuck a women who looks like an undeveloped boy. Give me a good medium pair of knockers and a (slightly) hairy pussy anyday and I'm in heaven.
On that note, all these guys whining and fucking whinging about "fat" women. Like I'm not chasing deathfat women or anything, but come on dudes. If you're gonna demand 'thin beautiful women' put in the fucking work! Just saying it now. Kinda pudgy, not a deal breaker for me. She have a pretty face, looks good in make up? Fuck it, I'll give her the time of day. Don't come at me with "hurrr...fat is unhealthy! Wheres your standards?"
Wheres YOUR fucking standards? Shit, I could take a 'heavy' girl and in a few months time have her trim. Its about the WORK you put in. All these fucking guys, all these fucking guys man, they all want something for nothing and chicks for free. No one wants to put in the fucking EFFORT anymore. I can't name on one hand the number of 'fat ugly chicks' everyone ignored from school (well except for me), who are now bombshells. If I stayed connected with people maybe I'd be with one of em right now, but I just get tired of this attitude that no one invests any time in others any more. It's all about 'me me me'.
Shes fat, maybe only a few extra pounds? Fat and 'not beautiful'? Fucking DO THE WORK and make her beautiful you bitch! Be her coach, like those fucking instagram couples you see sweating it out. Make her sexy. Become sexy, together.
Get her a fucking treadmill. Get her two. And jog together. Make her *feel* sexy.
More importantly get to *know* her. Why does she get out of bed in the morning? What drive her NOT to get out of bed? When does she feel lousy? What makes her feel that way? In addition to all the other shit men should know how to do, you should learn to play doctor phil, because every girl needs one. Women bond by talking, men bond by doing things together. Relationships should involve both.
Jesus fucking christ, this is basic bitch advice, and it annoys me I keep on coming across these spergs that don't fucking get it. Women are not cars you can stick your key in and just go 'vroom'.
They require maintenance, same as anything, any 'relationship' (because really, what are relationships in 2020, with instagram and fucking tinder and antisocial distancing?). You're a *team*, and i don't mean that in an inspirational way. You're a literal team. And far too many people prioritize the well being and success and concern of 'I' over' 'us'.
In short, if she ain't coming, you shouldn't be either. And if you expect her to on-the-regular put sharp objects on her fucking nether regions, don't expect any blowjobs unless you're doing the same thing for yourself!
Ideally you should be doing it to each other.
After all, you're partners. You trust her to put sharp objects near your groin, right?
Aren't relationships supposed to be about mutual trust?28 -
I was told today by a sr. engineer that applying JavaScript's trim() to a string before executing search is wrong.
His reason? Because certain search terms have spaces in the middle;
i.e "Science Fiction"
😯11 -
The joy when tools do not have machine parseable output.
I'm looking at you SBT. My favorite pile of poo.
Remove the logging level from each line, then trim the line, then stab around inside the line with regexes, fishing for a possible match which hopefully is right...
Then stripping scala information like the object type, cause yeah...
A line can be for example "[info] Vector(File(...),File(...))" where info is the log level, Vector the wrapping sequence type, File(...) the wrapping element type and the string inside File(...) what yours truly needs.
As this is lot of shitty shabby string stabby stabby, we need to add a fuckton of boiler plate validation cause who knows what we just murdered.
To make it even more fucked up, a multi project project can produce different output for the same key.
:-)
Yeah. So we need to fix that too.
By the way, one can set log output to unbuffered in SBT.
Then the output is in random order :-)
Isn't that fun? Come on, you wanna poke that pile of shit, too.
The SBT plugin way is by the way no alternative, as I need a full Java environment for execution.
Which brings me to the last point:
For fucks sake, writing CLI applications in Java is so much bloody boilerplate code.
There's ugly and then there's the "please kill me" kind of level.
50 lines just to write a basic validation of argc / argv with commons cli.
That's 6 lines in python. Not kidding. :(
I currently hate everything.
Moments where the job sucks: When you have to hotwire two electric cables with high currency by giving both cables the blowjob of your life.3 -
People that put spaces at the end of each form entry. Infuriating to say the least
NB: Yes, I trim and validate, but who is teaching these little fuckers to do this. Seriously.4 -
TFW you learn that trim(null) equals empty string in PHP.
I´m starting to understand why people seem to dislike PHP.6 -
So one day I got an email from a client just before I'm about to go home saying she wanted to update some images on the homepage slider. "No big deal" I thought. So she sends me the images and two of them are squares and the other is a portrait. All of which have phone camera quality and are way too small for the desktop version of the slider. I trim and rearrange the two squares so that fit but the other one was hopeless. I cropped it poorly and hoped she didn't care about it too much.
Of course it was the most important picture she wanted.
I ask the client to send me a higher quality picture which would fit in the slider and she sends me a picture which is even taller and less wide.
"Great," obviously at this point I figure she must be checking on just her cell phone and that's why a tall picture makes more sense to her.
And of course now she needs this before tomorrow morning so now I'm staying late to edit images.
Since she's obviously only looking on her cell phone and she's made me stay so late to do this I just take the tall image and mirror it so that it looks like there are two products side by side and it fits well on mobile screens.
Ugh. -
Me :
I will use .Trim() before ToLower(), so ToLower has potentially less characters to iterate over.
Also me :
What ? Only 5.000 rows ? Let’s load them all ! It’s faster then use “where” and “group by”. No problems !1 -
Bug from Win2k still affects Win10. ...hooray...
"max limit of 10 midi drivers? sure, okay. Except they don't disappear after removal, updating drivers and replugging a device into a different USB port both eat up another slot too."
fix: just go fuck with the registry and trim out the driver entries, you'll be fiiiiiiiine
fuck you too MicroPeni$ -
My worst coding mistake
In my last project for the distributed application programming, I was working on encryption for messaging between two users, the mistake was after decrypting the message you should trim it, and I was trimming before which made the message corrupt, this mistake costed me 2 weeks of delay since I couldn't find the problem, the code was like this
Message=decrypt(message.trim());
Where it was supposed to be
Message=decrypt(message).trim(); -
Just found out the API of our zentracloud sensors is sending the units with a space before the actual unit. Couldn't figure out for half an hour why Doctrine is not finding the unit in the database. Encoding? JSON decoding? Character itself? Screw you. Screw you...6
-
designer sent over a mockup that uses Illustrator's missing font color as button/brand color. why??3
-
What do people here use for blogging and hosting? Everything I can find from searching suggests self-hosted Wordpress, but I am cautious because of its reputation in the dev world and since all the guides I have found so far are directed at non-coders. Thanks in advance for any opinions 😊8
-
This is my frontend tip of the day.
If you have a frontend that consumes an external API:
1) Retrieve the json responses from devtools
2) Save them in your project as json files (trim the data a bit if it's too long)
3) When starting your app with a special env var like MOCK_DATA, make your app mock the data and use your saved json data instead.
You can associate each response with an url regex.
The package fetch-mock mocks fetch really well, it lets through the urls that don't match anything.
This way you can incrementally add responses.
And voila, you have a mode where you have near instant page loads to test things manually, and you also have mocked data ready for testing eg, cypress. -
Her: and they were roommates
My autistic ass, picking my belly button while contracting my neck muscles on the left side, trying to balance the tension in the precise spot between regular and uncontrollably cramped, singing “One” by U2 in my head, keeping my eyes completely relaxed to focus on those little blurry floaty thingys, knowing full well that when you focus on them, they disappear, assessing whether it is time to trim my nostrils' hair, focusing on feeling the surrounding smell, wondering whether I can figure out whether it is time to change my bedsheets without getting closer to them to smell them properly (do I feel the smell? I don't feel it, but is that because bedsheets are fresh, or because I'm too far away to smell it?), thinking about whether my T-shirt is exactly centered and whether one side has more fabric than the left, thus weighing more, so I have to readjust it, also thinking about whether “text/pain” is a good enough name for my book: please continue
(I know that the answer is “oh my god they were roommates”, but I want to socialize and not appear as a smartass, all while thinking about whether it's authentic or not)2 -
namecheap doesn't trim the space in the OTP code when you submit it...
if you manually delete the space, it goes through
i mean, it's the little things1 -
Friendly reminder to trim your services list with msconfig if using Windows. Services that are STOPPED are not DISABLED, and they can be brought back up when just stopped, sometimes remotely.
(This reduces chances of being bitten by malware that uses the Fax service or similar, as there are a few that have in past used often-unused services to propagate. It also reclaims a small bit of memory, and the more real memory you have, the less you page out when compiling or similar, which is slow as fuck.)
also for the love of god stop using RDP and use something that's more penetration-proof than a paper plate...11 -
Save enough from my current job to give me the buffer to go solo;
and it’s a cliche, but hopefully be making games -
I am really being tested with my creativity in naming conventions with these two sites rn.
Site 1 is a blog for a place called "The Post", so literally everything is called .post
Site 2 is a development built out of shipping containers, where each container is a different features of the property... just like a container would wrap features in their app🤦♂️3 -
Short but sweet:
why doesn't linux mint (an Ubuntu-based distro) fucking trim SSDs by default? Ubuntu doesn't do it by default either!9 -
A fucking space character should never be allowed in a wifi password!!! Just spent 4 hours looking to why the fucker would not connect to find a space on the end!! Trim or show an error!!!4
-
Does anyone have a better way to implement throttle on value changes in c# ?
I'm using this right now and I find it a bit "too much lines"
@highlight
searchThrottle.Throttle(TimeSpan.FromMilliseconds(200))
.Select(e => ((string)e.Value)?.Trim())
.DistinctUntilChanged()
.Subscribe((x) =>
{
quisckSearch = x;
InvokeAsync(async () => await LoadFirstPage());
});3 -
I just finally took time to look at creating symbolic links for node modules and package and package lock json files all from a boilerplate code for my frontend projects,
I saved over 15gb of disk space,
my SSD is 40gb so that's fair
now I have all my node modules for frontend projects in a separate container and node modules for backend projects in a separate container
I still havent figured out how to trim down my package.json file before pushing because there'll be some unused libraries.
for now any direct changes I make to the package and package lock json files will be reflected in the the symlinked directory and them reflect over all projects that share it
I have to be careful here8 -
A genuine question: are regexps inherently better than split().replace().trim() and other such chains?25
-
If your workflow counts on users copying and pasting things (like security tokens from text messages) read this:
Please for fuck sake trim the damn whitespace before you validate. I can't see the fucking space client-side, and you fucking know I didn't mean to enter <SPACE>123456 as my auth code.
Double click, copy, paste, click, curse <-- Story of my life because somebody forgot a damn .replace statement.1 -
When your apprentice keeps offering to write regex when all you need is a simple trim(), you know he's outgrown you.1
-
I JUST WANT TO FUCKING EXCLUDE A DIRECTORY....
I run the code cleaner tool, OH CHRIST it's trying to sanitise the automatically generated code, I don't want this.
I try to exclude... takes ages to work out that while specifying the dirs is absolute you can only exclude relative but from what? I want to block a/b but not a/c/b but no it's all you can only block all b b it a/b, b/b, c/b, c/b, a/c/b, etc.
I google for other solutions, nothing but trash, docs a trash, here's some examples but we don't tell you the actual behaviour. All I want is to get everything in /home/hilldog/emails but not /home/hilldog/emails/topsekret how hard can it be?
I use the source but what's this, BeefJerkyIteratorIteratorBananaSpliterator all over the shop how much convolution and LOC does it take to provide a basic find facility?
Screw this...
$finder->in(explode("\n",trim(exec('find '.escape_args(...$good).' -type d ' . implode('
-o ', prefix('\! -wholename', escape_args(..$bad))) . ' -etc | grep -vETC \'pretty_patterns\''))))3 -
#Suphle Rant 7: transphporm failure
In this issue, I'll be sharing observations about 3 topics.
First and most significant is that the brilliant SSR templating library I've eyed for so many years, even integrated as Suphle's presentation layer adapter, is virtually not functional. It only works for the trivial use case of outputting the value of a property in the dataset. For instance, when validation fails, preventing execution from reaching the controller, parsing fails without signifying what ordinance was being violated. I trim the stylesheet and it only works when outputting one of the values added by the validation handler. Meaning the missing keys it can't find from controller result is the culprit.
Even when I trimmed everything else for it to pass, the closing `</li>` tag seems to have been abducted.
I mail project owner explaining what I need his library for, no response. Chat one of the maintainers on Twitter, nothing. Since they have no forum, I find their Gitter chatroom, tag them and post my questions. Nothing. The only semblance of a documentation they have is the Github wiki. So, support is practically dead. Project last commit: 2020. It's disappointing that this is how my journey with them ends. There isn't even an alternative that shares the same philosophy. It's so sad to see how everybody is comfortable with PHP templating syntax and back end logic entagled within their markup.
Among all other templating libraries, Blade (which influenced my strong distaste for interspersing markup and PHP), seems to be the most popular. First admission: We're headed back to the Blade trenches, sadly.
2nd Topic: While writing tests yesterday, I had this weird feeling about something being off. I guess that's what code smell is. I was uncomfortable with the excessive amount of mocking wrappers I had to layer upon SUT before I can observe whether the HTML adapter receives expected markup file, when I can simply put a `var_dump` there. There's a black-box test for verifying the output but since the Transphporm headaches were causing it to fail, I tried going white-box. The mocking fixture was such a monstrosity, I imagined Sebastian Bergmann's ghost looking down in abhorrence over how much this Degenerate is perverting and butchering his creation.
I ultimately deleted the test travesty but it gave rise to the question of how properly designed system really is. Or, are certain things beyond testing white box? Are there still gaps in the testing knowledge of a supposed testing connoisseur? 2nd admission.
Lastly, randomly wanted to tweet an idea at Tomas Votruba. Visited his profile, only to see this https://twitter.com/PovilasKorop/.... Apparently, Laravel have implemented yet another feature previously only existing in Suphle (or at the libraries Arkitekt and Deptrac). I laughed mirthlessly as I watch them gain feature-parity under my nose, when Suphle is yet to be launched. I refuse to believe they're actually stalking Suphle3 -
Developed module for e-commerce system to batch upload product information from MS Excel document. First test from user & got error stating that comment is too long. Some input contains about 100 whitespace in end...
Then I found that PHP's built-in trim function isn't trimming Japanese whitespace character. 😓😓😓 ... Quick fix for that..
I doubt i'll never become familiar with that Japanese 2-byte character thing 😶