Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
mystes
May 31, 2006

Armauk posted:

Oh nO BuT YoU CaN'T SaY bLaCkLiSt AnYmOrE!!
Thank you, I've added you to my cocklist.

Adbot
ADBOT LOVES YOU

Share Bear
Apr 27, 2004

Armauk posted:

Oh nO BuT YoU CaN'T SaY bLaCkLiSt AnYmOrE!!

yeah that's right, shouldve said denylist or blocklist, habit of naming inertia, pardon me

(that's how you should react to that)

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Share Bear posted:

why even have config files, why not have just straight up a class/module with the config and that's what gets edited/templated

spring does this and that's popular as hell

spring boot cloud uses yaml files (or other k/v sources) to fill values in a config class using the @Value annotation

Share Bear
Apr 27, 2004

its really hard for me to stop saying "youse guys" though cause of similar reasons

Blinkz0rz posted:

spring boot cloud uses yaml files (or other k/v sources) to fill values in a config class using the @Value annotation

:eng99:

Share Bear fucked around with this message at 17:16 on Sep 2, 2021

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

if you use spring or other server-side stuff with kotlin gradle you can put your config classes in a source file and then reference that same file to type-safely instantiate the class in the kotlin build/test/deploy/run script, which is pretty neat except for the fact that you're using gradle

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


the problems started when we tried to make computers imitate people by talking to each other.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
saw some galaxy-brained poo poo in a code review today:

code:
// TODO
became

code:
// no-op

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.
that fuckin' rules

Joe Chip
Jan 4, 2014

Ciaphas posted:

today i was trying to work out why some log messages were getting mixed together line-by-line in 20yo common code. was expecting to find that there were no mutexes or other synch and i'd have to add it, ho hum

turns out, there is a mutex, but... well
C++ code:
void writeString(string str) {
  for (int i=0; i<str.len(); ++i) {
    mutex.Lock();
    writeChar(str[i]);
    mutex.Unlock();
  }
}
:shepface:

lmfao. in my own tp status, i learned something new about c++ today:

C++ code:
class Base {
	int f(int x) {
		return x + 1;
	}
};

class Derived : public Base {
	using Base::f; // this
	double f(double x) {
		return x + 0.1;
	}
};

auto d = new Derived;
d->f(1); // returns 2
d->f(1.0); // returns 1.1
i had no idea this was a thing and people seem to hate it but i think it's neat

Joe Chip fucked around with this message at 08:04 on Sep 3, 2021

Xarn
Jun 26, 2015
It's good, but I see it only used for constructors and insane tmp bullshit like variant

12 rats tied together
Sep 7, 2006

I think thats good. If you're going to have overloads you might as well be able to implicitly overload an inherited method without needing to repeat it

animist
Aug 28, 2018
how do you think management would react if I told them that the project we're working on is doomed to failure due to technical debt

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


animist posted:

how do you think management would react if I told them that the project we're working on is doomed to failure due to technical debt

"Technical debt? What's that?"
"It's when imperfect decisions accumulate in the code and slow us down everytime we have to interact with it."
"Why didn't you do it right the first time?"
"But but but"
"YOU'RE FIRED! HERE'RE YER WALKIN' PAPERS"

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

animist posted:

how do you think management would react if I told them that the project we're working on is doomed to failure due to technical debt

"how do you know?"

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik
EDIT: nevermind I'm dumb and did the test wrong

Zaxxon fucked around with this message at 22:48 on Sep 3, 2021

polyester concept
Mar 29, 2017

nvm then

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

animist posted:

how do you think management would react if I told them that the project we're working on is doomed to failure due to technical debt

i've been wondering the same thing myself recently. problem is, we are still in the "make some shiny (but inherently flawed) feature we can show to justify our existence" mode which is what lead us to accumulate the debt in the first place. as soon as it feels like I've built some breathing room by reworking some of the decisions of the past, 4 new half-baked features get shoved down the pipeline

animist
Aug 28, 2018
happily I get to claim no responsibility for the tech debt because I joined after all the decisions were made. it really is excruciatingly bad.

i am getting paid though so really i can't complain

animist fucked around with this message at 02:20 on Sep 14, 2021

cool av
Mar 2, 2013

Share Bear posted:

why even have config files, why not have just straight up a class/module with the config and that's what gets edited/templated

spring does this and that's popular as hell

yeah. nowadays most of the time deploying a "config change" is exactly the same process as deploying a code change. it's just inertia that keeps people using config files.

Soricidus
Oct 21, 2010
freedom-hating statist shill
nah, it’s useful to have configuration clearly separated from implementation, and you literally can’t have that if it can execute arbitrary code inside your application

Ocean of Milk
Jun 25, 2018

oh yeah
I must have a different definition of configuration because we do spring and absolutely still have config files at runtime for different environments, and those files are not part of the code repo. There's no getting rid of those (well theoretically you could hardcode all this stuff (e.g. your DB URL) into the app, but... surely not?)
Yeah, there's stuff that used to be xml at compile time and is now annotations (@Bean and friends), but that's not even what I'd call "config files"

Ocean of Milk fucked around with this message at 09:56 on Sep 4, 2021

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

animist posted:

happily I get to claim no responsibility for the tech debt because I joined after all the decisions were made.

...


i am getting paid though so really i can't complain

hell, :same:

toiletbrush
May 17, 2010
Got epicly trolled yesterday. Someone removed a test server as a deployment target for a rarely-updated project in Octopus, but didn't bother to remove it from the load balancer.

Took way too many hours to figure out why my bug fix only worked 80% of the time.

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

animist posted:

i am getting paid though so really i can't complain

careful, you might eventually be blamed

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


speaking of config, I had a wonderful midnight call about some files not getting published that, after an hour and a half trying to work out where they were going and giving up and pushing manually, I realised the next day that these two jobs had some old setup where the publish location was in a separate config file that wasn't environment aware and was hard coded to non prod


and then I dug up old emails and there was one from 5 years ago from me finding the same problem and going "well, these jobs are ancient and the one consumer needs to stop using them, I'm sure by the next time we deploy they'll have migrated to the replacement" :negative:

Bloody
Mar 3, 2013

this is perennially relevant re config http://mikehadlow.blogspot.com/2012/05/configuration-complexity-clock.html

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.



needs a station for 'buy a 3rd party tool that promises to end the need to code your workflows!' then spending years trying to migrate/upgrade/replace it

idk if we still have it but we had an absolute spaghetti nest of dctm workflow stuff and right now, some consultant jackoffs are building a workflow in sharepoint 2013 for the low low price of $50k!

cool av
Mar 2, 2013

Soricidus posted:

nah, it’s useful to have configuration clearly separated from implementation, and you literally can’t have that if it can execute arbitrary code inside your application

I admit one of the things I dislike about nodeJS is the lack of instant clarity on whether the code I'm writing is running on the server or the client, having different languages helps there, but I don't really buy this for configuration. It's pretty obvious if you're in a file that's just a set of configuration.

a real reason to use xml/yaml/json is if multiple different applications need to consume the same configuration, but I don't see that too much in practice either

Share Bear
Apr 27, 2004

configuration is something read in at runtime that establishes parameters for an env and sets up really important constants/flags and that functionally should be independent from the implementation

however, that can still be accomplished by writing it in the target lang and loading it at runtime like any other dep injection methodology

xml/json/yaml make this boundary more apparent, and likely reduce compile time, but if youre bouncing the application anyway (or triggering a ci/cd redeploy anyway) it just seems like a micro dsl

i argue keeping it as text vs code isnt as advantageous or youre assuming your operations people will never have to know how your app is built and works (hahahaha)

Sapozhnik
Jan 2, 2005

Nap Ghost
config contains the stuff that differs between environments

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine
all I know is if you have to rebuild your application artifact to change its currently deployed config you done hosed up

12 rats tied together
Sep 7, 2006

some people like that but those people are nuts. the big risk with cute names like "immutable infrastructure" is that the english definition of the words becomes an explicit goal because some guy read a blog article, and the benefit gained from following whatever cute name becomes a secondary concern

i had a job interview once where i described a process for deterministic deploys on aws autoscaling groups and my interviewer asked "why not just build an ami" and i had to be like "because i dont want each deploy to take 45 minutes".

distortion park
Apr 25, 2011


12 rats tied together posted:

some people like that but those people are nuts. the big risk with cute names like "immutable infrastructure" is that the english definition of the words becomes an explicit goal because some guy read a blog article, and the benefit gained from following whatever cute name becomes a secondary concern

i had a job interview once where i described a process for deterministic deploys on aws autoscaling groups and my interviewer asked "why not just build an ami" and i had to be like "because i dont want each deploy to take 45 minutes".

We're at the "deploys take too long, let's do a project to speed them up" phase of the cycle.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


our deploy is some guy copying and pasting poo poo either into a remote SQL session, or to some random network share and the transferring the MSI to an RDP session because they can't work out how to download artefacts from nexus

it's exactly as bad as it sounds and I genuinely didn't know how bad it was until this week when I watched it in real time and went "woah woah, this is what they've been doing"

DrPossum
May 15, 2004

i am not a surgeon
why do we keep writing new code we have code at home!

cinci zoo sniper
Mar 15, 2013




DrPossum posted:

why do we keep writing new code we have code at home!

code at home:

PHP code:
/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

cinci zoo sniper posted:

code at home:

PHP code:
/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD

is that the e-mail address regex

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Captain Foo posted:

is that the e-mail address regex

lol I've copied and pasted and hosed up that one so many times. 'oh but now we need to paste multiple addresses!' etc.

another good one is an LDAP search. First + last, last, uid or email and all in the Garbo LDAP query syntax

e: actually I guess it's just rpn or similar. Which also explains why it feels wrong because I never used rpn when I actually did calcs

e2: I should also add that I generally only handle internal emails addresses so can home roll and modify a much simpler one. Until someone wants multiples. Or a mix of firstname.lastname@org and edls.

Powerful Two-Hander fucked around with this message at 23:48 on Sep 4, 2021

cinci zoo sniper
Mar 15, 2013




Captain Foo posted:

is that the e-mail address regex

yep https://emailregex.com

Adbot
ADBOT LOVES YOU

ikanreed
Sep 25, 2009

I honestly I have no idea who cannibal[SIC] is and I do not know why I should know.

syq dude, just syq!
People who want legit email address instead of .*@.* Are thought criminals.

Stop validating my inputs you jerks

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply