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.
 
  • Locked thread
prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Luigi Thirty posted:

also there should be dental plan

Adbot
ADBOT LOVES YOU

Brain Candy
May 18, 2006

gonadic io posted:

This would be very nice.


Sure let me just migrate all of our infrastructure and servers

Guess I could create the json from inside mysql :v:

using the old tool past the point where you've outgrown it is how you end up with your company running its expenses out of access.

Brain Candy
May 18, 2006

if somebody tells you replication is easy you should laugh in their face

insert tef post here about people recreating libraries

Shaggar
Apr 26, 2006

Luigi Thirty posted:

also there should be dental plan

Soricidus
Oct 21, 2010
freedom-hating statist shill

Brain Candy posted:

insert tef post here

if only

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Shaggar posted:

nah the first one is better and also should not be one line.

i assume you say this as a protection against needing to do more stuff to the list in the future? ditto the braces comment? thats my intuition, but i want to make sure you dont mean something more clever than that.

Shaggar
Apr 26, 2006
yes, but its also more consistent with how linq is used in general. use linq to provide your filters and transforms and then use normal control statements to do stuff to or with that filtered and transformed data.

Shaggar
Apr 26, 2006
regarding braces you should always have braces in all-man style (hard tabs only).

braceless control statements are the devil's handiwork

distortion park
Apr 25, 2011


Shaggar posted:

nah the first one is better and also should not be one line.

swr

distortion park
Apr 25, 2011


please don't put side effects in your linq statements unless there's no other option!

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Shaggar posted:

regarding braces you should always have braces

braceless control statements are the devil's handiwork

Soricidus
Oct 21, 2010
freedom-hating statist shill

pointsofdata posted:

please don't put side effects in your linq statements unless there's no other option!

there's always another option

cowboy beepboop
Feb 24, 2001

gonadic io posted:

this isn't user facing, this is two different servers needing to reconcile their data. so the idea is to send off a http request from A to B, then B dumps the db into the json body response.


what engine does the other server use? mysql? could you do some sort of filtered replication all day instead of at the end of the day?

raminasi
Jan 25, 2005

a last drink with no ice

Bloody posted:

yeah. there's a .ForEach in the PLINQ set but not in the LINQ set and its kind of strange imo

or maybe its ForAll? either way

that's because there's no parallelforeach language construct

i will say that while "don't put side effects in linq" sounds great, seq.iter is really nice to have

tef
May 30, 2004

-> some l-system crap ->

gonadic io posted:

i'm trying to reduce the number of fields we pull for each of those rows which seems to speed it up but it's still the bottleneck.

gonadic io posted:

this is two different servers needing to reconcile their data. so the idea is to send off a http request from A to B, then B dumps the db into the json body response.

quote:

the response really is just a db dump

quote:

as long as A sends out an email being all "yep, the data from B matched what's in my db" i don't care if it takes a minute or two.

so, you have two databases, and you're wanting to reconcile them

let's not ask why you have two databases needing to be reconciled, although that is important

taking a dump of the database is probably faster than spitting out json

(although db dumps are slow unless you're taking a snapshot of the filesystem, most of the time)

(i say dump, i mean copy of some form)

pushing the filtering into sql is probably faster too

but really you have to ask why you put your data in two different places to begin with

tef
May 30, 2004

-> some l-system crap ->

Brain Candy posted:

if somebody tells you replication is easy you should laugh in their face

insert tef post here about people recreating libraries

i can't hear you i'm too busy writing yet another raft implementation in go

Bloody
Mar 3, 2013

i wanna scrape and manipulate and probably dump to sql a buncha json data from a rest api for some reason this feels like itll be unpleasant to do in haskell is that the case and if so what are some other neat languages to do it in

i could just do it in c# but idk that doesnt feel like a learning opportunity

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

do it in prolog

creatine
Jan 27, 2012




have you tried Python op

Bloody
Mar 3, 2013

Yeah it's really bad

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!
I'm surprised. Haskell lets you turn a list into a side-effecting calculation with mapM/foldrM/traverse/etc, but I assume that they avoided that in LINQ because there's no type-level annotation saying "here be side effects".

MeruFM
Jul 27, 2010

Bloody posted:

Yeah it's really bad

dogma is bad

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?

MeruFM posted:

dogma is bad

just encapsulate it in a monad

VikingofRock
Aug 24, 2008




Bloody posted:

i wanna scrape and manipulate and probably dump to sql a buncha json data from a rest api for some reason this feels like itll be unpleasant to do in haskell is that the case and if so what are some other neat languages to do it in

i could just do it in c# but idk that doesnt feel like a learning opportunity

This might not be so bad in Haskell. Usually when I want a recommendation for a Haskell library I check here first, and if they don't have anything listed for my problem domain I google 'haskell <problem>' and look at the packages that come up and pick one that looks like it is maintained and has a reasonable API. I've never really done web stuff in Haskell, but I think some people like it. I know Aeson is the standard JSON library that everyone uses, and I think people like Esqueleto for SQL stuff. Not sure what the standard HTTP library is. Maybe HTTP?

VikingofRock
Aug 24, 2008




If you wanna see if something is actively maintained, you can check and see if it is on stackage, since they that packages be updated frequently. Not being on Stackage doesn't mean that something is not maintained, but you can count on a package being maintained if it is on Stackage.

gonadic io
Feb 16, 2011

>>=

tef posted:

so, you have two databases, and you're wanting to reconcile them

let's not ask why you have two databases needing to be reconciled, although that is important

taking a dump of the database is probably faster than spitting out json

(although db dumps are slow unless you're taking a snapshot of the filesystem, most of the time)

(i say dump, i mean copy of some form)

pushing the filtering into sql is probably faster too

but really you have to ask why you put your data in two different places to begin with

A contains our view of the world based on user actions, and B gets populated daily by csvs from banks. It's quite important that we check each day that we haven't lost any customer's money, the FCA are sticklers about that.

I've moved the filtering into mysql, will suggest that we move from mysql (lol), and if we need it much faster I think the next step is to dump table partitions as binary. Maybe.

ty for your help all

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

gonadic io posted:

banks... FCA... mysql
:yikes:

ErIog
Jul 11, 2001

:nsacloud:

gonadic io
Feb 16, 2011

>>=
im leading the push for us to move to mongo, that way it's already in json! :v:

ErIog
Jul 11, 2001

:nsacloud:

gonadic io posted:

im leading the push for us to move to mongo, that way it's already in json! :v:

Remember to register with Shodan so that you can always find your DB.

gonadic io
Feb 16, 2011

>>=

ErIog posted:

Remember to register with Shodan so that you can always find your DB.

also Canary

Valeyard
Mar 30, 2012


Grimey Drawer

Bloody posted:

i wanna scrape and manipulate and probably dump to sql a buncha json data from a rest api for some reason this feels like itll be unpleasant to do in haskell is that the case and if so what are some other neat languages to do it in

i could just do it in c# but idk that doesnt feel like a learning opportunity

Gonadic io, is that you?

gonadic io
Feb 16, 2011

>>=

Valeyard posted:

Gonadic io, is that you?

it's the opposite, i'm doing sql -> json -> REST. plus i have no choice of lang.

Bloody
Mar 3, 2013

i wish json had a schema so i could generate all of my types from it

gonadic io
Feb 16, 2011

>>=

Bloody posted:

i wish json had a schema so i could generate all of my types from it

Just use the types as your json schema :v: I mean the format must be consistent right?

Or for the Shaggar answer: are you sure that you can't use xml?

Bloody
Mar 3, 2013

the api im hitting only spits back json unfortunately

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Bloody posted:

i wish json had a schema so i could generate all of my types from it

use a json to xml converter and then generate your types

FamDav
Mar 29, 2008

gonadic io posted:

A contains our view of the world based on user actions, and B gets populated daily by csvs from banks. It's quite important that we check each day that we haven't lost any customer's money, the FCA are sticklers about that.

I've moved the filtering into mysql, will suggest that we move from mysql (lol), and if we need it much faster I think the next step is to dump table partitions as binary. Maybe.

ty for your help all

the issue isn't mysql, it's that you're trying to compare two databases on two separate servers. assuming your "view of the world" db is prod, you should be backing it up to a separate analytics db along with the fca stuff (and whatever data you want for not streaming analytics) and do your batch jobs there.

Shaggar
Apr 26, 2006

Bloody posted:

i wish json had a schema so i could generate all of my types from it

there is json schema now, but its external so you basically have to know what schema you want to enforce because you cant read it from the file. its supported in vs 2015+. also maybe 2013.

also in vs 15 you can generate rest clients from swagger. goddamn Microsoft is good at this poo poo.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Bloody posted:

i wanna scrape and manipulate and probably dump to sql a buncha json data from a rest api for some reason this feels like itll be unpleasant to do in haskell is that the case and if so what are some other neat languages to do it in

i could just do it in c# but idk that doesnt feel like a learning opportunity

Use SSIS.

  • Locked thread