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
cinci zoo sniper
Mar 15, 2013




mystes posted:

Wow, CTAN has gone a bit overboard with the whole Halloween thing. (Warning: it makes noise)

ahahahahhahahahahah whtat the gently caress

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

gonadic io posted:

Even better, haskell has a function called "return", which usually appears at the bottom of functions, but which has totally different and unrelated semantics to the return keyword in c-like langs.

scala's got a weird return thing that i dont understand beyond 'don't use it'

gonadic io
Feb 16, 2011

>>=

fritz posted:

scala's got a weird return thing that i dont understand beyond 'don't use it'

Isn't it just regular early return as if you were in a java function?

AggressivelyStupid
Jan 9, 2012

cinci zoo sniper posted:

ive digitized some nuclear physics textbooks in latex so you could say im comfortable yes :v: ive used minted and tikz before, never heard of tcolorbox - thanks for the recs

well hell in that case go hog wild,

I want to say I have another thing for diagrams I've used but I'll have to wait until I get home to check for what it's called

mystes posted:

Wow, CTAN has gone a bit overboard with the whole Halloween thing. (Warning: it makes noise)

this owns lmao

Space Whale
Nov 6, 2014
I'm Johnny Spacewhale, welcome to jackass!

Boss died, who knew all the things and was the only person who could tell our CTO to not be stupid. Sucks.

Since then, CTO has asked multiple people to lie to investors. Due to this the only other web/backend dev besides me and one other guy who is in Narnia trying to set up test automation but also having to fix poo poo with our (dumb) integrators walked off after saying gently caress this and yelling at the CTO for being a liar during a practice presentation.

I'm new as gently caress and mostly fixing their lovely tools sites and services, not the guy who fully built their deployment automation, built the microservices, or anything like the guy who left. :q:

I was just asked to code review 4.5 gigs of source code/artefacts (47 projects in a solution of all of our microservices) by said CTO. I gave him access to the source and left to eat and laugh in my car.

:munch:

I'd leave but their decline will be slow enough I can get tenure so lol why not ride it out. Kinda tired of contracts anyway. Just need to not commit light felonies!

Happy Halloween
🎃

mystes
May 31, 2006

Buy your CTO a copy of Bad Blood.

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

mystes posted:

Buy your CTO a copy of Bad Blood.

:hmmyes:

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

mystes posted:

Buy your CTO a copy of Bad Blood.

I googled this and now I have the audiobook.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
it's an awesome book

Space Whale
Nov 6, 2014
It and ops just came back from


" a walk "

:q:

Corla Plankun
May 8, 2007

improve the lives of everyone
oh if it is a really simple diagram you could also use mermaid

cinci zoo sniper
Mar 15, 2013




Corla Plankun posted:

oh if it is a really simple diagram you could also use mermaid

pretty cool too, might fall back to this if i cant be arsed to latex them out in the end

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

cinci zoo sniper posted:

how do i go about describing a data model? this is my next work thing to do, to architect a unified data model for my department before the new architect sets in stone some bad decisions we won’t have resources to revert, and im not sure how to present my ideas on my paper correctly - i have rather well defined (down to schema level) ideas about everything, as well as technical requirements for user space and such, but I’m not sure what is the best format and order to lay it all down

write down your usecases, pull out all the nouns. those are your entities. the verbs are your relationships.

thats overly simplistic but it works.

CRIP EATIN BREAD fucked around with this message at 20:47 on Oct 31, 2018

Nomnom Cookie
Aug 30, 2009



cinci zoo sniper posted:

trick question, there's number of considerations prior to that (such as not a single one of our databases being even remotely representative of how they should operate)

speaking of how they should operate, what is the the thread's choice for storing money numbers in postgres (other than don't) - is money datatype ok or is it better to go with pair of ints (i mean or numeric but numeric seems to be good old 20.00000000000025 dollars which is gauche and has already bit me in the rear end in practice in one of our databases)

u definitely need exact but idk beyond that. also this seems like the kind of question where if you need to ask it hoboy youre gonna get hosed later on from missing some tiny thing

Powerful Two-Hander
Mar 10, 2004

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


cinci zoo sniper posted:

how do i go about describing a data model? this is my next work thing to do, to architect a unified data model for my department before the new architect sets in stone some bad decisions we won’t have resources to revert, and im not sure how to present my ideas on my paper correctly - i have rather well defined (down to schema level) ideas about everything, as well as technical requirements for user space and such, but I’m not sure what is the best format and order to lay it all down

entity relationship diagrams are good definitely, personally I wouldn't go to the level of individual attributes on them for what you're doing so wouldn't necessarily have 100% of everything as I think that overloads it (I've seen some bonkers poo poo produced in things like power designer where you can't figure anything out from the noise because they've drowned it all in 8000 "string:string" fields)

also though, depending on what you're doing, I really like entity life cycle diagrams that reflect the states of things from creation to some future end state. they won't give you a data model as such but you can build a [partial] data model from them.

Also often you don't have just one data model but several separate ones and an ELD for each thing that you're storing is pretty handy in examining why you are recording some stuff.

edit: also life cycle diagrams are like one level "up" from user stories in that you can just have an arrow going "update Butt" instead of having to verb away about "as a user I want to edit my Butts"

you can also represent loads of stuff in a single diagram which a) looks impressive and b) means people don't get 900 pages of stories they're not going to read

Powerful Two-Hander fucked around with this message at 21:10 on Oct 31, 2018

cinci zoo sniper
Mar 15, 2013




Kevin Mitnick P.E. posted:

u definitely need exact but idk beyond that. also this seems like the kind of question where if you need to ask it hoboy youre gonna get hosed later on from missing some tiny thing

yeah i understand that this is most likely over my head, but no one else cares when it is a problem that manifests on our scale in an observable way without taking a rigmarole of preparation steps no one ever bothers with - so i have to at least check if anyone here can spill the beans on their postgres money storing. if not i can always just say "in exact numerical format" in the model and leave it to the actual architect to rewrite or developers to decide later on - im just making sure we have paper trail before our architect [most likely] does nothing else but develop some microservices, hopefully in consultation with other people, that become the xkcd standartisation pic

i really do hope i am wrong about him, but there are enough seeming red flags that my boss gave me free reign over my time to establish the general data model contributions we insist on regardless of the architect's personal opinion about having documentation (when doing system architecture, wtf - that's literally technical writing job as an end deliverable product and you say that maintaining documentation is a 90% FTE job that wastes the architect), collaboration with people from other functions, or work ethic

cinci zoo sniper
Mar 15, 2013




Powerful Two-Hander posted:

entity relationship diagrams are good definitely, personally I wouldn't go to the level of individual attributes on them for what you're doing so wouldn't necessarily have 100% of everything as I think that overloads it (I've seen some bonkers poo poo produced in things like power designer where you can't figure anything out from the noise because they've drowned it all in 8000 "string:string" fields)

also though, depending on what you're doing, I really like entity life cycle diagrams that reflect the states of things from creation to some future end state. they won't give you a data model as such but you can build a [partial] data model from them.

Also often you don't have just one data model but several separate ones and an ELD for each thing that you're storing is pretty handy in examining why you are recording some stuff.

this is a very good point, thank you - it will be very handy to put on paper since basically we have what constitutes the following:

where you have a transient "business item" manifesting into several entities with strict internal evolution mechanisms and order, termination conditions, and such

Space Whale
Nov 6, 2014
Pissed off dude's hugely complicated project is crashing.

Muahahahahahahahahaha

He's awol

Schadenfreude is the best when you're in his office watching the rear end in a top hat responsible squirm

Space Whale
Nov 6, 2014
My CTO deserves every loving second of this

cinci zoo sniper
Mar 15, 2013




also yeah individual attributes are not something ill go hog wild, there’s maybe 12 relational entities with less than that attributes each - my main concern is data consistency and quality affairs if we talk about attributes, since to this date we still have incidents wherein people do stuff such as “we set modified_at record for an updated row to a future date to reflect when this modification takes effect”, leading to our cdc process of our etl being convinced that in table foo it is the year or our lord 2024 and any further upsert will be later than that

redleader
Aug 18, 2005

Engage according to operational parameters

Powerful Two-Hander posted:

edit: do people still use knockout?

unfortunately yes. why? because it was the closest thing to a Microsoft ApprovedTM js framework in 2013, and it wasn't obviously a terrible choice then (spoilers: two way binding is bad)

its primary use case seems to be "js heavy site on older IE"

the knockout dev team are still sporadically working on a new version for some reason, using a virtual dom and blah blah. no idea why, when vuejs exists and is already knockout 2016

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
sounds like somebody's CTO didn't do a risk analysis before telling staff to lie to investors.

Space Whale
Nov 6, 2014

prisoner of waffles posted:

sounds like somebody's CTO didn't do a risk analysis before telling staff to lie to investors.

:allears:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

fritz posted:

the new-ish guy at work who couldn't get my name right for weeks commented on a code review asking why i put an explicit "return" at the end of a c function with return type void, and later said he was ok with it as long as the compiler didn't generate any additional code, and im just wondering my dude what exactly is your mental model of how this all works

fwiw I would have probably asked about it too, because it seems weird and afaik doesn’t do anything

though I wouldn’t say the thing about generating extra code

AggressivelyStupid posted:

explicit returns are good as hell

why? (assuming you’re referring to the above example)

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

cinci zoo sniper posted:

so i have to at least check if anyone here can spill the beans on their postgres money storing

postgres has a money type but you should avoid it due to locale dependence and generally being ignored by everyone. it works by storing the result as an integer number of cents, but displaying with a decimal point. if you know you will never have fractions of a cent, that's an option: make your money columns bigints of cents. if that doesn't work, use numeric, never a floating point type. you can use numeric(x,y) if you know that your numbers will be max x digits long with y of those digits after the decimal point, and postgres will enforce those constraints, rounding the decimal part as necessary (but not the max digits; try to put in a number that's too big and you get an error). note that these (x,y) constraints on numeric have no impact on storage or performance by themselves. the actual internal storage of a numeric is a variable length bcd-like format. if you make a column with bare numeric type and insert only numbers like 123.45 into it, that uses the same disk space as a numeric(5,2), so use those constraints only to enforce desired behavior, not as an optimization. but keep in mind that with a bare numeric, something can insert a number like 1287364512783641283465.697364957629374561928375 into your column and postgres won't complain, it'll just use however much storage is necessary to represent that number, so like, don't do that. clear as mud, yes?

Powerful Two-Hander
Mar 10, 2004

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


redleader posted:

unfortunately yes. why? because it was the closest thing to a Microsoft ApprovedTM js framework in 2013, and it wasn't obviously a terrible choice then (spoilers: two way binding is bad)

its primary use case seems to be "js heavy site on older IE"

the knockout dev team are still sporadically working on a new version for some reason, using a virtual dom and blah blah. no idea why, when vuejs exists and is already knockout 2016

i was just wondering as a similar use case referenced it (well, there was a one line "I rewrote this to use knockout" comment from the question poster) but on closer inspecrion it wouldn't do anything that I wasnt already able to do via the mvc framework*

*once the collection binding helpers are added anyway

Nomnom Cookie
Aug 30, 2009



DELETE CASCADE posted:

postgres has a money type but you should avoid it due to locale dependence and generally being ignored by everyone. it works by storing the result as an integer number of cents, but displaying with a decimal point. if you know you will never have fractions of a cent, that's an option: make your money columns bigints of cents. if that doesn't work, use numeric, never a floating point type. you can use numeric(x,y) if you know that your numbers will be max x digits long with y of those digits after the decimal point, and postgres will enforce those constraints, rounding the decimal part as necessary (but not the max digits; try to put in a number that's too big and you get an error). note that these (x,y) constraints on numeric have no impact on storage or performance by themselves. the actual internal storage of a numeric is a variable length bcd-like format. if you make a column with bare numeric type and insert only numbers like 123.45 into it, that uses the same disk space as a numeric(5,2), so use those constraints only to enforce desired behavior, not as an optimization. but keep in mind that with a bare numeric, something can insert a number like 1287364512783641283465.697364957629374561928375 into your column and postgres won't complain, it'll just use however much storage is necessary to represent that number, so like, don't do that. clear as mud, yes?

"it will round for you" raises a red flag. otoh making clients do the scaling means they will gently caress it up sooner or later

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

Kevin Mitnick P.E. posted:

"it will round for you" raises a red flag. otoh making clients do the scaling means they will gently caress it up sooner or later

this rounding behavior is dictated by the sql standard afaik. you can just use bare numeric and it'll never round unless you hit the max decimal places (which you won't because it's 16383). if you want "numeric(x,y) except if the number of decimal places is > y then you get an error instead of rounding or truncating" then i guess you have to use a check constraint like this:

code:
postgres=# create table demo (rounds numeric(6,2), errors numeric, check (scale(errors) <= 2));
CREATE TABLE
postgres=# insert into demo values (1234.56, 2345.67);
INSERT 0 1
postgres=# insert into demo values (3456.789, 4567.89);
INSERT 0 1
postgres=# select * from demo;
 rounds  | errors  
---------+---------
 1234.56 | 2345.67
 3456.79 | 4567.89
(2 rows)

postgres=# insert into demo values (5678.910, 6789.1011);
ERROR:  new row for relation "demo" violates check constraint "demo_errors_check"
DETAIL:  Failing row contains (5678.91, 6789.1011).

Nomnom Cookie
Aug 30, 2009



oh yeah check constraints. those are cool

ugh mysql. i forgot we were talking about postgres and just assumed that whatever stupid thing the db does is what you get and suck it up

Nomnom Cookie
Aug 30, 2009



hey so shaggar likes sprocs which is generally considered not a great idea. but postgres can do python sprocs which sounds possibly nice. has anyone tried that?

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
postgres isn't perfect but for the price it's drat good, and i've found its features to be "composable", in the sense that when one feature doesn't behave how you want, there is probably another feature that you can use in combination to accomplish your goal, even if that goal was never specifically envisioned by the designers of either feature. contrast with, say, loving oracle, where there is certainly a way to do what you want, but you'll absolutely never figure it out yourself

Nomnom Cookie
Aug 30, 2009



DELETE CASCADE posted:

loving oracle, where there is certainly a way to do what you want, but you'll absolutely never figure it out yourself

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

cinci zoo sniper posted:

how do i go about describing a data model? this is my next work thing to do, to architect a unified data model for my department before the new architect sets in stone some bad decisions we won’t have resources to revert, and im not sure how to present my ideas on my paper correctly - i have rather well defined (down to schema level) ideas about everything, as well as technical requirements for user space and such, but I’m not sure what is the best format and order to lay it all down

not a joke: define a language in which to describe your model and its mapping to schema, then use that language

like you could write a ton of prose for each entity with a whole bunch of risk of ambiguity of interpretation, or you could have “Section 2: Notation” so your actual descriptions can be precise

e.g.

quote:

In this document, we use a C-style notation to describe the entities in the system, their attributes, and the relationships between them. As an example, …

quote:

3.6 Article

Each Article represents one post on the CMS, by a specific user, whether it’s currently somewhere in the production pipeline or available via the site.

3.1.1 Model

entity Article {
relationship authors: [Author], inverse: articles
relationship primaryAuthor: Author?, inverse: primaryAuthoredArticles
attribute title: String
attribute slug: String
attribute publicationDate: Date
relationship content: VersionedContent?, inverse article
attribute isPublished: Boolean
}

The primaryAuthor relationship can be null to indicate an un-bylined article.



one advantage of doing things like this is that you can write in a “literate programming” style and extract the model from your document to manipulate programmatically (like to generate your schema), avoiding doc/system skew

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

mystes posted:

Buy your CTO a copy of Bad Blood.

do this and just leave it on their desk

mystes
May 31, 2006

BTW, if your CTO reads it and then DOESN'T change their mind about lying to investors, you should probably flee the country ASAP.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
no, go for that sweet SEC whistleblower bounty

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

eschaton posted:

do this and just leave it on their desk

dead rat or no dead rat?

seriously space whale, what are you gonna do with this humdinger of a situation? if you were feeling cutthroat and like you could hire and manage a good enough team you could basically be a one man coup it sounds like

Kevin Mitnick P.E. posted:

hey so shaggar likes sprocs which is generally considered not a great idea. but postgres can do python sprocs which sounds possibly nice. has anyone tried that?

my gut feeling is it's best to limit your use of sprocs. my experience is that sprocs written in other languages can run with an unfamiliar set of semantics inside of postgres.

the most involved sprocs I ever wrote were kind of neat and basically created a materialized grouping of data into domain relevant entities. they were all written in SQL on MySQL tho lol

Arcsech
Aug 5, 2008
today in "the marvels of unicode": actual penises in the unicode standard

behold: 𓂸𓂹 𓂺

source

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

Arcsech posted:

today in "the marvels of unicode": actual penises in the unicode standard

behold: 𓂸𓂹 𓂺

source

super disappointing that those codepoints are censored on windows

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Kevin Mitnick P.E. posted:

hey so shaggar likes sprocs which is generally considered not a great idea. but postgres can do python sprocs which sounds possibly nice. has anyone tried that?

the people who don't like stored procs are the same ones using orms so I wouldn't put much stock in anything they say

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