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
The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

HoboMan posted:

more importantly can i replace youre posts with a gay baby?

oh wait

Gay! Hahahahaha!

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

oh my loving christ TimeZoneInfo has a memory leak?

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

HoboMan posted:

oh my loving christ TimeZoneInfo has a memory leak?

it opens a file handle every time you call the Local property so I'd say it's very likely

HoboMan
Nov 4, 2010

CRIP EATIN BREAD posted:

it opens a file handle every time you call the Local property so I'd say it's very likely

what if i never access that property?
i know i can defeat the memory leak error i'm getting by just making a wrapper, but how do i know if what i am doing is safe?

e: well it's an error about potentially causing a memory leak because the class is tagged as such

HoboMan fucked around with this message at 23:37 on Oct 25, 2017

ThePeavstenator
Dec 18, 2012

:burger::burger::burger::burger::burger:

Establish the Buns

:burger::burger::burger::burger::burger:

HoboMan posted:

more importantly can i replace youre posts with a gay baby?

oh wait

this was not the joke

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

gonadic io posted:

I am currently writing angular 1

e: with sails.js and bootstrap

I'm sorry....

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

HoboMan posted:

what if i never access that property?
i know i can defeat the memory leak error i'm getting by just making a wrapper, but how do i know if what i am doing is safe?

e: well it's an error about potentially causing a memory leak because the class is tagged as such

i was joking but its sad that it's an acceptable answer

HoboMan
Nov 4, 2010

CRIP EATIN BREAD posted:

i was joking but its sad that it's an acceptable answer

i have confirmed the way TimeZoneInfo looks up time zones is accessing a file (with bonus magic string matching)

this is sad, but it's the only game in town

i mean there is noda time, but it looks like it's got a lot of concepts it wants you to learn and the dev is like "yeah my framework is hard to use, but it's like that ~by design~ to force devs to really think about what they are doing"

HoboMan fucked around with this message at 14:53 on Oct 26, 2017

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

HoboMan posted:

i mean there is noda time, but it looks like it's got a lot of concepts it wants you to learn and the dev is like "yeah my framework is hard to use, but it's like that ~by design~ to force devs to really think about what they are doing"

this looks like its a .net port of joda-time, which is a very good date/time implementation.

if you cant figure it out, this is the thread for you i guess

necrotic
Aug 2, 2005
I owe my brother big time for this!
Date/time libs are hard and the joda family is great

HoboMan
Nov 4, 2010

CRIP EATIN BREAD posted:

this is the thread for you i guess

i think this is well established

the first thing i read about noda time was a SO comment by the author stating the the library is hard to use on purpose so i figured it wasn't worth learning

jony neuemonic
Nov 13, 2009

i haven’t used it a ton but iirc noda / joda time is hard to use but also hard to use incorrectly, which is probably better than easy to blow your whole foot off with.

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
LocalDate date = LocalDate.of(2017, 10, 26);
LocalTime time = LocalTime.of(11, 30);
ZoneId zone = ZoneId.of("America/Detroit");
ZonedDateTime dt = ZonedDateTime.of(date, time, zone);

Duration d = Duration.between(dt, ZonedDateTime.now());
d.getSeconds();

guys this code is so incredibly cryptic i have no idea what its doing!

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

CRIP EATIN BREAD posted:

LocalDate date = LocalDate.of(2017, 10, 26);
LocalTime time = LocalTime.of(11, 30);
ZoneId zone = ZoneId.of("America/Detroit");
ZonedDateTime dt = ZonedDateTime.of(date, time, zone);

Duration d = Duration.between(dt, ZonedDateTime.now());
d.getSeconds();

guys this code is so incredibly cryptic i have no idea what its doing!
r u a wizard

Powerful Two-Hander
Mar 10, 2004

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


today I "solved" a hanging transaction error caused by a gently caress knows how many deep nest of SQL transactions by just putting 5 lines of "commit tran" on the bottom of a script and calling it a day

bug closed: "works" for me

edit: o gently caress more like

Sapozhnik posted:

BORN TO ROLLBACK
SCHEMA IS A gently caress
(+) Join Em All SQL:2003
I am query planner
410,757,864,520 AFFECTED ROWS


except "Commit em all 2017"

Powerful Two-Hander fucked around with this message at 18:42 on Oct 26, 2017

redleader
Aug 18, 2005

Engage according to operational parameters
WHILE @@TRANCOUNT > 0 COMMIT;

HoboMan
Nov 4, 2010

Powerful Two-Hander posted:

today I "solved" a hanging transaction error caused by a gently caress knows how many deep nest of SQL transactions by just putting 5 lines of "commit tran" on the bottom of a script and calling it a day

bug closed: "works" for me

i fixed this same problem my own terrible way which is to edit every script to be
SQL code:
SET XACT_ABORT ON;
DECLARE @transaction INT = @@TRANCOUNT;
IF @transaction = 0
    BEGIN TRANSACTION;

    -- the body of your script

IF @transaction = 0
    COMMIT TRANSACTION;
this is the extent of my insight after loving this up like 5 times (if you want save points to work then that's like a whole other thing)

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Powerful Two-Hander posted:

today I "solved" a hanging transaction error caused by a gently caress knows how many deep nest of SQL transactions by just putting 5 lines of "commit tran" on the bottom of a script and calling it a day

bug closed: "works" for me

this is truly terrible, congratulations

Sapozhnik
Jan 2, 2005

Nap Ghost
having read tef's litany against message queues a few months ago i'm finishing up a new revision of our system that has a bunch of services communicating via localhost http instead of rabbitmq

there's actual backpressure now and some (though not all) failures propagate all the way to the system's edge

and i can now inject events into the middle of the system with curl to test things out

:toot:

MononcQc
May 29, 2007

tef
May 30, 2004

-> some l-system crap ->

Sapozhnik posted:

having read tef's litany against message queues a few months ago i'm finishing up a new revision of our system that has a bunch of services communicating via localhost http instead of rabbitmq

there's actual backpressure now and some (though not all) failures propagate all the way to the system's edge

and i can now inject events into the middle of the system with curl to test things out

:toot:

if you want to go the whole :2bong: experience, reify your service objects and return hypermedia

NihilCredo
Jun 6, 2011

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

tef posted:

reify your service objects and return hypermedia

i prefer

Sapozhnik
Jan 2, 2005

Nap Ghost

tef posted:

if you want to go the whole :2bong: experience, reify your service objects and return hypermedia

i'm not literally amazon so our rest api is strictly an organizational boundary. there are multiple http services inside the perimeter, some exposed to the outside world, some not, all talk to a single monolithic postgres database. outgrowing that single is strictly in the "nice problem to have" category right now.

not really my field of expertise at any rate so i just hope i didn't screw up the design too badly.

Powerful Two-Hander
Mar 10, 2004

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


rjmccall posted:

this is truly terrible, congratulations

i might actually properly fix it tomorrow but in *theory* the root cause of it shouldn't occur because the team that set up the data that causes the error should have unfucked themselves by then


they wont though so maybe ill just remove those lines from the deploy script and go "idk it was fine when i tested it on a test db"

edit: i should add this is a one off script not a sproc, im not a total monster....but whoever wrote the underlying sproc it calls that leaves hanging transactions on failure is

Powerful Two-Hander fucked around with this message at 00:03 on Oct 27, 2017

a witch
Jan 12, 2017

Sapozhnik posted:

having read tef's litany against message queues a few months ago i'm finishing up a new revision of our system that has a bunch of services communicating via localhost http instead of rabbitmq

there's actual backpressure now and some (though not all) failures propagate all the way to the system's edge

and i can now inject events into the middle of the system with curl to test things out

:toot:

broad question for you and or tef.

I have an environment that does long running render jobs, using what I think is a pretty normal queue setup. jobs tend to come in big batches that we don’t have the hardware to handle all at once, so we queue them up in a message queue, and workers grab jobs when they are free.

how/why would I migrate this to a setup like yours?

tef
May 30, 2004

-> some l-system crap ->

a witch posted:

broad question for you and or tef.

I have an environment that does long running render jobs, using what I think is a pretty normal queue setup. jobs tend to come in big batches that we don’t have the hardware to handle all at once, so we queue them up in a message queue, and workers grab jobs when they are free.

how/why would I migrate this to a setup like yours?

depends? what do you do when renders fail? is retrying worth it?

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


what the gently caress are those classes of frameworks for interacting with databases called

Entity Frameworks is a really heavy example of one

this is bugging me

CPColin
Sep 9, 2003

Big ol' smile.
ORM's?

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


that's the fucker

thanks, god that was bugging me

(e) is there a local favorite of those for Oracle DBs and C#/.NET, we've got a small app that uses EF and it is so bad to work \with and causing problems so I want to try something else

CPColin
Sep 9, 2003

Big ol' smile.
:cheers:

a witch
Jan 12, 2017

tef posted:

depends? what do you do when renders fail? is retrying worth it?

retrying is worth it within a limited window, depending on external circumstances.

basically a batch job finds items of interest, and will queue up a render job for each item that we don’t already have a successful render for. If an item is failed, but still interesting, it will get retried.

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


oh my god so much poo poo to get across to an airgapped network i hate oracle i hate everything

Powerful Two-Hander
Mar 10, 2004

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


Ciaphas posted:

that's the fucker

thanks, god that was bugging me

(e) is there a local favorite of those for Oracle DBs and C#/.NET, we've got a small app that uses EF and it is so bad to work \with and causing problems so I want to try something else

Dapper is really loving good for basic stuff like "map results of this proc to a list of objects" and also allows you to do crazy poo poo like splitting to create sub classes, also it handles parameters really nicely for you as well

edit: I'm pretty sure I learned about it from a previous version of this thread and it is seriously good. also entity framework blows, stored procs 4 lyfe

tef
May 30, 2004

-> some l-system crap ->

a witch posted:

retrying is worth it within a limited window, depending on external circumstances.

basically a batch job finds items of interest, and will queue up a render job for each item that we don’t already have a successful render for. If an item is failed, but still interesting, it will get retried.

so, like, you're already using some database to track state, and use a queue as a smart load balancer

i think i explicitly talk about this being a pretty normal thing in the long winded rant


the whole 'use http' jerkfest is more 'just do plain old rpc and don't use a message broker as a go-between' for short lived requests that need responses

a witch
Jan 12, 2017

tef posted:

so, like, you're already using some database to track state, and use a queue as a smart load balancer

i think i explicitly talk about this being a pretty normal thing in the long winded rant


the whole 'use http' jerkfest is more 'just do plain old rpc and don't use a message broker as a go-between' for short lived requests that need responses

oh yeah. all state lives in a database, the messages are just IDs. I missed your initial post that’s why I asked :shobon:

thanks for the response. are there good resources for this sort of stuff?

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?

please make a smiley out of this

tia

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Powerful Two-Hander posted:

Dapper is really loving good for basic stuff like "map results of this proc to a list of objects" and also allows you to do crazy poo poo like splitting to create sub classes, also it handles parameters really nicely for you as well

edit: I'm pretty sure I learned about it from a previous version of this thread and it is seriously good. also entity framework blows, stored procs 4 lyfe

idk about stored procs, i'm not a db guy, but being able to put in sql and get out objects is all i want and it sounds like dapper fits the bill

so thanks :cheers:

jony neuemonic
Nov 13, 2009

dapper owns, but ef can be fine too if you're not inheriting an existing db and don't mind colouring inside the lines.

Shaggar
Apr 26, 2006
ef is so bad

Adbot
ADBOT LOVES YOU

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


jony neuemonic posted:

dapper owns, but ef can be fine too if you're not inheriting an existing db and don't mind colouring inside the lines.

that's exactly why EF is poo poo-tier in this app, our DBs date back to the early 90s and are about as corroded as that implies, yes

when ef worked, it worked great. when it didn't, cower in fear, mortals

  • Locked thread