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




Powerful Two-Hander posted:

it's OK as long as you never have to query it

like we store blobs to avoid having to generate them from the db every time but we never try to actually query them

the html this thing is generating is loving mind bending

eh specifically for querying, analysts only know sql. i don’t care how it’s dealt for purely technical stuff

Adbot
ADBOT LOVES YOU

Powerful Two-Hander
Mar 10, 2004

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


oh god I just realised that because I'm dynamically adding items to a list that is itself part of a list the prefixes needed by the model binder don't generate properly ffffuuuccckkkkk

Chalks
Sep 30, 2009

Powerful Two-Hander posted:

it's OK as long as you never have to query it

like we store blobs to avoid having to generate them from the db every time but we never try to actually query them

the html this thing is generating is loving mind bending

It is possible to query XML in databases and it's not too syntactically terrible in my experience, but I wouldn't want it going anywhere anything that needs to be fast.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
and let me guess
all of this is because someone at some point said 'it's going to be way too cumbersome to manually define the fields in our crud screens'

Powerful Two-Hander
Mar 10, 2004

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


Sagacity posted:

and let me guess
all of this is because someone at some point said 'it's going to be way too cumbersome to manually define the fields in our crud screens'

Kind of yeah. there are hundreds of object implemtations (of about 15 types) that generate these templates, they have concrete definitions but they go into a common dl data structure because blah blah see previous posts

mvc is perfectly able to handles lists of lists up until you start trying to add records to them dynamically. there's a helper function called BeginCollectionItem that solves this as long as your list isn't nested, if it is it fucks up because it can't work out what the outer prefix is supposed to be.

i've dealt with this once before by manually editing the prefixes using javascript but it is possible to do it following this approach: http://www.joe-stevens.com/2011/06/06/editing-and-binding-nested-lists-with-asp-net-mvc-2/

so many nested items :negative:

Powerful Two-Hander fucked around with this message at 14:27 on Oct 24, 2018

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
when i was still doing c# i fell into that trap as well

i feel your pain, friend

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.

Sagacity posted:

'can you please add field X to the orders table'
'uh, sure let me just load/save all the rows of xml we have instead of just running ALTER TABLE like a sane person'

no it's great, xml

it's real easy, just have two tables, butts_xml and butt_upgrade_xslt...

e: this solution does give you certain perpetual annoying problems, but I've also seen it succeed (not in a database)

akadajet
Sep 14, 2003

Corla Plankun posted:

I'm not trying to be a dick (because i have totally done worse stuff than this and had it fail, waisting even more time) but you have just described the exact situation that unit tests are designed to address

facilitating arguments in meetings?

30 TO 50 FERAL HOG
Mar 2, 2005



Sagacity posted:

ah, the Ultimate Extensibility pattern.

it's a nice pattern that disallows:
* database optimizations
* any kind of sharding
* intellisense
* refactoring your code

good

i look forward to your horror novel

lmao the bungie manifest is a sqlite db with an id (signed int, you have to manually convert it to unsigned for it to be useful) and a text field, which is a JSON object string

its the loving worst

30 TO 50 FERAL HOG fucked around with this message at 14:59 on Oct 24, 2018

Powerful Two-Hander
Mar 10, 2004

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


Sagacity posted:

when i was still doing c# i fell into that trap as well

i feel your pain, friend

me, a terrible programmer: how many levels of nesting are you on right now?
a normal, sane dev: like 1 or 2 my dude?
me: you are like a little baby, watch this: raazzooorrr



anyway looks like I can access the name prefix from the parent list wrapper and then pass it to the child list items via the view data so that they'll prefix with the outer wrapper. I can then pass that same prefix as an extra property to the ajax call to bounce it through view data when adding an element dynamically. I think.

Volte
Oct 4, 2004

woosh woosh

BIGFOOT EROTICA posted:

lmao the bungie manifest is a sqlite db with an id (signed int, you have to manually convert it to unsigned for it to be useful) and a text field, which is a JSON object string

its the loving worst


SQLite has JSON support via an extension: https://www.sqlite.org/json1.html

FlapYoJacks
Feb 12, 2009

cinci zoo sniper posted:

hahaha. so, we have a sql-backed service talk to an external service via json requests. i just found a table with all shipped json requests. they all include plain text auth in their body, where login is a deveoper’s surname and password is 123<their name>

it is amazing to me, in 2018, where salting and hashing a password via bcrypt is literally 2 to 3 lines of code in just about any language, that plain text passwords are still a thing.

cinci zoo sniper
Mar 15, 2013




ratbert90 posted:

it is amazing to me, in 2018, where salting and hashing a password via bcrypt is literally 2 to 3 lines of code in just about any language, that plain text passwords are still a thing.

that’s integration with a billions-worth multinational finance corporation

redleader
Aug 18, 2005

Engage according to operational parameters

Powerful Two-Hander posted:

me, a terrible programmer: how many levels of nesting are you on right now?
a normal, sane dev: like 1 or 2 my dude?
me: you are like a little baby, watch this: raazzooorrr



anyway looks like I can access the name prefix from the parent list wrapper and then pass it to the child list items via the view data so that they'll prefix with the outer wrapper. I can then pass that same prefix as an extra property to the ajax call to bounce it through view data when adding an element dynamically. I think.

have you considered xslt and jquery

mystes
May 31, 2006

Why would anyone ever consider xslt if they can help it?

It's like asking "have you thought about global warming and cute animals developing cancer yet today?"

Soricidus
Oct 21, 2010
freedom-hating statist shill
babies. get back to me when your db contains xml that itself contains json, and then we’ll talk

Powerful Two-Hander
Mar 10, 2004

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


redleader posted:

have you considered xslt and jquery

rude

pretty sure that's how this actually used to work but with added batshit around the edges. xml would have one advantage which is that the model binder wouldn't need specific id/name values to work

i have like four layers of prefix wrappers going on now, it's crazy.

Main Paineframe
Oct 27, 2010

Powerful Two-Hander posted:

rude

pretty sure that's how this actually used to work but with added batshit around the edges. xml would have one advantage which is that the model binder wouldn't need specific id/name values to work

i have like four layers of prefix wrappers going on now, it's crazy.

i envy the fact that you can talk about xslt in the past tense

it's unquestionably the worst thing I have to deal with at my job

although with "cram xml into a database" coming up soon, the title of worst might end up with some real competition

AggressivelyStupid
Jan 9, 2012

Soricidus posted:

babies. get back to me when your db contains xml that itself contains json, and then we’ll talk

hi

cinci zoo sniper
Mar 15, 2013




Soricidus posted:

babies. get back to me when your db contains xml that itself contains json, and then we’ll talk

heh

we have in prod a solution that works as follows:

1) microservice queries sql db DB1 and some other poo poo to gather a document A, form it as xml following schema S.1A, and write to DB1
2) another service takes this document A and sends it to external service E
3) service E generates an xml response B following schema S.0, that contains:
3.1) response header containing technical particulars
3.2) xml document (following its own, unique schema) inside said header with general information corresponding to contents of A
3.3) a <Field "A"> element inside (3.2) containing an xml document with full contents of A, only with values formatted (think grammar, capitalised etc) formatted properly and the document itself restructured to follow schema S.1B
3.4) half a dozen <Field "Thing"> elements inside (3.2), each an xml document with a unique schema, containing separate parts of response to the inbound query in great detail
3.5) HTML version of (3.2) (excl. 3.5 obv) inside 3.2, so you can look at it nice and shiny in browser :)

trick is, at this point you may be asking "but wait, how do they insert xml document into xml document?". well, it's simple really - just escape entire xml document to appropriate predefined xml entity substitutions. thus, (3.2) through (3.5) are all escaped to appropriate predefined xml entity substitutions, but something breaks along the way when 3.2 is being escaped so there is nested escaping going on here and there :)

to continue what happens with our, solution:

4) the service (2) writes it to DB1 to the same table where A was formed (that's 2 documents in a mysql table)
4) the service (2) converts part of (3.3) to JSON and writes it to the same table in DB1 (that's 3)
5) the service (2) unescapes entire (3.3) to normal XML and writes it to the same table in DB1 (that's 4)

if you think that's bad, early version of this would store bulk requests into row-per-bulk fashion in sql :)

cinci zoo sniper fucked around with this message at 21:56 on Oct 24, 2018

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
we have a javascript application that runs on the front-end, and a java backend (which is a wayyyy larger).

javascript app takes 15 minutes to compile.

java app, with all the unit tests, integration tests and acceptance tests: 3 minutes.



javascript (and javascript programmers) was a mistake.

cinci zoo sniper
Mar 15, 2013




fun fact: the documentation on the (3) from that post is a ~500 page pdf document

Good Sphere
Jun 16, 2018

i'm doing the worst thing to hopefully solve a crash on an iphone app using avassetwriter. it's complaining 1/50 times that it can't append pixelbuffers, and i've been trying to fix it for a couple weeks on and off, and now i figured that i can just add a little timer before it stops writing. whatever it is doing in captureOutput on whatever thread can be finished up before it gets there and hopefully not crash

it's running on a macro right now to press the record button and go back over and over, which is a lot more fun that doing it hundreds of times manually!

Main Paineframe
Oct 27, 2010

CRIP EATIN BREAD posted:

we have a javascript application that runs on the front-end, and a java backend (which is a wayyyy larger).

javascript app takes 15 minutes to compile.

java app, with all the unit tests, integration tests and acceptance tests: 3 minutes.



javascript (and javascript programmers) was a mistake.

javascript doesn't need to be compiled

go yell at your front-end developers for introducing some dumb garbage to their setup

Xarn
Jun 26, 2015
Well, they introduced JS so... :shrug:

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

Xarn posted:

Well, they introduced JS so... :shrug:

this.

static pages rendered server side are so much better, easier to test, and easier to work with.

Doom Mathematic
Sep 2, 2008

cinci zoo sniper posted:

heh

we have in prod a solution that works as follows:

1) microservice queries sql db DB1 and some other poo poo to gather a document A, form it as xml following schema S.1A, and write to DB1
2) another service takes this document A and sends it to external service E
3) service E generates an xml response B following schema S.0, that contains:
3.1) response header containing technical particulars
3.2) xml document (following its own, unique schema) inside said header with general information corresponding to contents of A
3.3) a <Field "A"> element inside (3.2) containing an xml document with full contents of A, only with values formatted (think grammar, capitalised etc) formatted properly and the document itself restructured to follow schema S.1B
3.4) half a dozen <Field "Thing"> elements inside (3.2), each an xml document with a unique schema, containing separate parts of response to the inbound query in great detail
3.5) HTML version of (3.2) (excl. 3.5 obv) inside 3.2, so you can look at it nice and shiny in browser :)

trick is, at this point you may be asking "but wait, how do they insert xml document into xml document?". well, it's simple really -

"The Aristocrats!"

darthbob88
Oct 13, 2011

YOSPOS

Main Paineframe posted:

javascript doesn't need to be compiled

go yell at your front-end developers for introducing some dumb garbage to their setup
The problem is that it kinda does, since I can either a) write old and awful JS that some rear end in a top hat browsing the web on a potato can run, or b) write new and actually kinda OK JS (that needs to be compiled down to something that potato-man can use).

cinci zoo sniper
Mar 15, 2013




Doom Mathematic posted:

"The Aristocrats!"

jokes on me, im parsing that poo poo this week

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.

darthbob88 posted:

The problem is that it kinda does, since I can either a) write old and awful JS that some rear end in a top hat browsing the web on a potato can run, or b) write new and actually kinda OK JS (that needs to be compiled down to something that potato-man can use).

script type=module + jfc dont make your js load bearing

H2Eau
Jun 2, 2010

CRIP EATIN BREAD posted:

javascript app takes 15 minutes to compile.

how the gently caress did they manage that

Soricidus
Oct 21, 2010
freedom-hating statist shill

cinci zoo sniper posted:

heh

we have in prod a solution that works as follows:

1) microservice queries sql db DB1 and some other poo poo to gather a document A, form it as xml following schema S.1A, and write to DB1
2) another service takes this document A and sends it to external service E
3) service E generates an xml response B following schema S.0, that contains:
3.1) response header containing technical particulars
3.2) xml document (following its own, unique schema) inside said header with general information corresponding to contents of A
3.3) a <Field "A"> element inside (3.2) containing an xml document with full contents of A, only with values formatted (think grammar, capitalised etc) formatted properly and the document itself restructured to follow schema S.1B
3.4) half a dozen <Field "Thing"> elements inside (3.2), each an xml document with a unique schema, containing separate parts of response to the inbound query in great detail
3.5) HTML version of (3.2) (excl. 3.5 obv) inside 3.2, so you can look at it nice and shiny in browser :)

trick is, at this point you may be asking "but wait, how do they insert xml document into xml document?". well, it's simple really - just escape entire xml document to appropriate predefined xml entity substitutions. thus, (3.2) through (3.5) are all escaped to appropriate predefined xml entity substitutions, but something breaks along the way when 3.2 is being escaped so there is nested escaping going on here and there :)

to continue what happens with our, solution:

4) the service (2) writes it to DB1 to the same table where A was formed (that's 2 documents in a mysql table)
4) the service (2) converts part of (3.3) to JSON and writes it to the same table in DB1 (that's 3)
5) the service (2) unescapes entire (3.3) to normal XML and writes it to the same table in DB1 (that's 4)

if you think that's bad, early version of this would store bulk requests into row-per-bulk fashion in sql :)

:stonklol:

ours does have a couple more layers I was saving up but .... yeah nope your db wins

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?

H2Eau posted:

how the gently caress did they manage that

I bet the JavaScript compilation setup in use is all written in and driven by JavaScript itself, possibly using Node.js

at this point the JavaScript ecosystem is getting to be the Mirror Universe version of the Lisp ecosystem: a unified set of tools all supporting each other, except they all suck

Doom Mathematic
Sep 2, 2008

H2Eau posted:

how the gently caress did they manage that

Probably counting npm install as part of the "compilation"?

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Doom Mathematic posted:

Probably counting npm install as part of the "compilation"?

that was my first guess. possible bonus, someone added `rm -rf node_modules` to the start of the build because they couldn't figure out how else to resolve dependency changes

H2Eau
Jun 2, 2010
i guess I'm just spoiled, because we break our js frontends up into tiny pieces a fresh npm i and webpack takes a whole 15 - 30 seconds

15 minutes is some real bullshit

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
i looked at the build process and i see that there's something called rimraf and it's a javascript port of rm -rf...........

:thunk:

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
other cool thing: having a support@companyname.com creating JIRA support tickets automatically and somehow one of our vendors for our satellite comm stuff started sending emails there for some stupid conference.

so now we got JIRA task spam which is great because JIRA wasn't slow enough as it is.



everyone involved in the creation of JIRA should be euthanized. making plugins use REST calls while still being INSTALLED INSIDE THE GODDAMN SOFTWARE ITSELF is ridiculous. REST is not IPC........

brap
Aug 23, 2004

Grimey Drawer

CRIP EATIN BREAD posted:

i looked at the build process and i see that there's something called rimraf and it's a javascript port of rm -rf...........

:thunk:

there's nothing particularly wrong with what the package does.

seems like in many languages the programmatic equivalent of `rm -rf` is missing from the standard file I/O module and you wind up having to implement it yourself.

Adbot
ADBOT LOVES YOU

brap
Aug 23, 2004

Grimey Drawer
js "builds" are generally mush and probably 2/3 of the js in the average webpack bundle never gets executed at runtime ever.

you can make it a bit better by using rollup, but again, it's still going to be mush.

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