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
Sapozhnik
Jan 2, 2005

Nap Ghost
boy i had a really lame and weird dream last night where the yospos programming threads had been taken over by unironic c++ likers, crazy poo poo huh

Adbot
ADBOT LOVES YOU

Powerful Two-Hander
Mar 10, 2004

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


i have just spent idk an hour trying to work out why our pre-production environment has no log entries in it after we adjusted some of our loggers to stop writing out garbage and oh boy is the answer a delight!

nobody ever runs andy loving maintenance so our log db had so much stuff in it that you couldn't query it, so seeing as its all test logs i truncated the log table, so far so good. except that now nothing else is getting written to it even when there's an error, that's weird. and wait when i do a manual insert there's nothing there either, huh???

turns out there's a trigger on the loving log table that deletes the oldest record following any insert, so if you have no logs in it at all it will insert, hit the trigger and delete the log entry again because your record is now the oldest.

I highly recommend this as a piece of troll code because of course, nobody ever thinks to look for loving triggers

edit: OH MY loving GOD THIS WAS ADDED BY SOMEONE *AS* MAINTENANCE WHAT THE FUCCKKKKK


VVV booooo_this_man.gif

Powerful Two-Hander fucked around with this message at 19:02 on Jan 16, 2019

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Powerful Two-Hander posted:

I highly recommend this as a piece of troll code because of course, nobody ever thinks to look for loving triggers

well did you ignore the trigger warning?

Shaggar
Apr 26, 2006

Powerful Two-Hander posted:

i have just spent idk an hour trying to work out why our pre-production environment has no log entries in it after we adjusted some of our loggers to stop writing out garbage and oh boy is the answer a delight!

nobody ever runs andy loving maintenance so our log db had so much stuff in it that you couldn't query it, so seeing as its all test logs i truncated the log table, so far so good. except that now nothing else is getting written to it even when there's an error, that's weird. and wait when i do a manual insert there's nothing there either, huh???

turns out there's a trigger on the loving log table that deletes the oldest record following any insert, so if you have no logs in it at all it will insert, hit the trigger and delete the log entry again because your record is now the oldest.

I highly recommend this as a piece of troll code because of course, nobody ever thinks to look for loving triggers

edit: OH MY loving GOD THIS WAS ADDED BY SOMEONE *AS* MAINTENANCE WHAT THE FUCCKKKKK


VVV booooo_this_man.gif

yeah don't ever use triggers cause they're a pain in the rear end for discovery. you should run a query of your schema for any existing triggers and get rid of all of them if you can.

Powerful Two-Hander
Mar 10, 2004

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


Shaggar posted:

yeah don't ever use triggers cause they're a pain in the rear end for discovery. you should run a query of your schema for any existing triggers and get rid of all of them if you can.

agreed. there is precisely 1 valid use case for them imho which is for journalling data for audit history if you have to keep it, anything else is an abomination.

i have changed the trigger to only do anything if there are more than 100,000 logs in the table and written a sarcastic comment in it even though i know pefectly well nobody else will ever read it.

redleader
Aug 18, 2005

Engage according to operational parameters

NihilCredo posted:

forget "every browser", just within msft it's gonna take a few more years for netcore to become a full replacement for netfx, and probably decades for it to become a full replacement for mono

you'd think that ms buying xamarin would have put the pedal to the metal on bringing netcore to mobile and deprecating mono, instead mono is apparently getting indipendently developed even further with stuff like aot compilation which would have been a real nice addition to netcore

yeah, i'm really wondering what the long-term strategy for netcore is. obviously part of it is "don't spook enterprises by deprecating netfx", but beyond that, ???
keeping both mono and netcore around seems like a big duplication of effort, given that they both seem so similar on the surface

redleader
Aug 18, 2005

Engage according to operational parameters

Sapozhnik posted:

boy i had a really lame and weird dream last night where the yospos programming threads had been taken over by unironic c++ likers, crazy poo poo huh

please do not langshame in this thread. the heart wants what the heart wants

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
wow, did ya'll know starcraft 2 exposes a client protobuf protocol and c++ library that lets you program bots using all of the information and abilities the AI in starcraft 2 has??

so anyhow that's what i'm doing for a while.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i'm going to implement sorting algorithms with sc2 units

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
please make gifs

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
also make an AI that sends groups of enemies in a formation spelling out "YOSPOS", tia

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

CRIP EATIN BREAD posted:

also make an AI that sends groups of enemies in a formation spelling out "YOSPOS", tia

honestly, already planning on it

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

DONT THREAD ON ME posted:

i'm going to implement sorting algorithms with sc2 units

nice

NihilCredo
Jun 6, 2011

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

CRIP EATIN BREAD posted:

also make an AI that sends groups of enemies in a formation spelling out "YOSPOS", tia

*spinning newspaper headline*

TERRORISTS EVADE ECHELONSA USING SECRET "LOST TEMPLE" CHANNEL

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Sapozhnik posted:

boy i had a really lame and weird dream last night where the yospos programming threads had been taken over by unironic c++ likers, crazy poo poo huh

I miss the old days where monad lovers ruled the threads

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

DONT THREAD ON ME posted:

wow, did ya'll know starcraft 2 exposes a client protobuf protocol and c++ library that lets you program bots using all of the information and abilities the AI in starcraft 2 has??

so anyhow that's what i'm doing for a while.

I yearn for this much free time.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
step one is quit your job and live off savings for a while

VikingofRock
Aug 24, 2008




Sapozhnik posted:

boy i had a really lame and weird dream last night where the yospos programming threads had been taken over by unironic c++ likers, crazy poo poo huh

the talent deficit posted:

I miss the old days where monad lovers ruled the threads

why not both?

gonadic io
Feb 16, 2011

>>=

the talent deficit posted:

I miss the old days where monad lovers ruled the threads

Anybody want to know what a monad is? I feel like I've done one post per person in the thread at this point

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
monads are just monoids in the category of endofunctors

gonadic io
Feb 16, 2011

>>=
I even got a new monad related av to spice things up a bit

Real talk though I stupidly decided to do a timed job interview programming thing in Haskell after having not touched it for like 4 years and boy was that a mistake. They did not call back.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Illusive gently caress Man posted:

how can/should a programmer add this kind of detail in the exception world of that paper? A try-catch that just appends detail and re-throws sounds unwieldy to me, but that could be because I've been living in an exceptionless world for so long.

sorry:

Sutter-sensei posted:

It is not a goal to enable distantly handled errors to contain arbitrary programmatically usable information. Distantly handled error details primarily need to be human usable (e.g., debugging and trace logging), and a .what() string is sufficient.

with classic exceptions, you can easily wrap at the throw site, and keep the same catch sites, and gradually migrate the catch sites to extract the extra information. see how Boost.Exception does it: https://www.boost.org/doc/libs/1_69_0/libs/exception/doc/boost-exception.html

with value exceptions as currently proposed, you can wrap just as easily, but unwrapping becomes mandatory, because they don't have multiple inheritance: every error has one piece of type-erased data and a category, no more no less. no such thing as multiple views into an object, like you can do with classes

hackbunny fucked around with this message at 22:45 on Jan 16, 2019

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
honestly I'm surprised that the proposal doesn't provide for user-defined error types, and a little disappointed because I was never a huge fan of funneling all error handling through errc comparisons/conversions

e: my bad, §4.6.5 says it may be possible in the future, but herb sounds skeptical of its usefulness. weird because I can think of a lot of things I'd like to have that his proposed std::error can't do

hackbunny fucked around with this message at 23:48 on Jan 16, 2019

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Powerful Two-Hander posted:

nobody ever runs andy loving maintenance

is this like norton disk doctor?

I’m andy loving maintenance! howdy howdy howdy

qntm
Jun 17, 2009
what the hell is a monad

Powerful Two-Hander
Mar 10, 2004

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


pokeyman posted:

is this like norton disk doctor?

I’m andy loving maintenance! howdy howdy howdy

he's like the blue collar dr watson

i spotted that typo and just left it

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Powerful Two-Hander posted:

i spotted that typo and just left it

ty for your service

floatman
Mar 17, 2009
My favourite trigger is one that triggers on update/create of rows for table A. What it does is it creates a new record in another table, which has two columns: classname and args. Args is a text data type but it stores XML.
So what happens is there is a Cron job that would poll that table, use the language equivalent of "eval" to create a new "classname", deserialise the XML "args" and feed it into the class, then execute the class to do stuff.
So when you look at the project there are all these little class files that can't be connected with "find usages"

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

redleader posted:

please do not langshame in this thread. the heart wants what the heart wants
While Javascript exists, shaming is not always wrong.

qntm posted:

what's a monad

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

could be worse... could be json

floatman
Mar 17, 2009
I left out what the XML usually contains.

The XML usually contains one encoded string which decodes to json. Sometimes, they store CSV strings in the json too instead of creating a json array.

Soricidus
Oct 21, 2010
freedom-hating statist shill

floatman posted:

I left out what the XML usually contains.

The XML usually contains one encoded string which decodes to json. Sometimes, they store CSV strings in the json too instead of creating a json array.

oh, I didn’t realise I had colleagues in this thread

Powerful Two-Hander
Mar 10, 2004

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


floatman posted:

My favourite trigger is one that triggers on update/create of rows for table A. What it does is it creates a new record in another table, which has two columns: classname and args. Args is a text data type but it stores XML.
So what happens is there is a Cron job that would poll that table, use the language equivalent of "eval" to create a new "classname", deserialise the XML "args" and feed it into the class, then execute the class to do stuff.
So when you look at the project there are all these little class files that can't be connected with "find usages"

if you use json.net to de/serialise objects that implement an interface something like this happens, because the deserialiser doesn't know what implementation its dealing with, it looks for a type property that was added by the serialiser (if you called it with the appropriate flags) and uses it to instance the proper object type then populate it with the rest of the data

its actually really useful but I wouldn't want to do it in the db and involve triggers in it :barf:

NihilCredo
Jun 6, 2011

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

is there an idiomatic name for a two-way lookup data structure (i.e. a bijective function)?

and/or a more clever design than a wrapper around two hashmaps, maybe

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

floatman posted:

My favourite trigger is one that triggers on update/create of rows for table A. What it does is it creates a new record in another table, which has two columns: classname and args. Args is a text data type but it stores XML.
So what happens is there is a Cron job that would poll that table, use the language equivalent of "eval" to create a new "classname", deserialise the XML "args" and feed it into the class, then execute the class to do stuff.
So when you look at the project there are all these little class files that can't be connected with "find usages"

yeah but you can deploy code changes so easily now

lmao

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
years and years ago i had a team lead bring in a business rule engine that worked like that via reflection, his justification was "it will let us deploy code changes into prod by going through the data update approval process instead of the release process, which is easier (!) and the business analysts will be able to change the rules directly (!!!!)"

it was slow as poo poo, hard to code (required a third party editor), and of course no business analysts ever touched it

as soon as he left i accepted the team lead position on the condition our first project was to replace that with native c# code written and maintained by developers

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

NihilCredo posted:

is there an idiomatic name for a two-way lookup data structure (i.e. a bijective function)?

and/or a more clever design than a wrapper around two hashmaps, maybe

it turns out that just having a map you can query in the forward direction, and another map you can query in the reverse direction, is actually a pretty convenient api for this sort of data structure

https://github.com/google/guava/wiki/NewCollectionTypesExplained#bimap

NihilCredo
Jun 6, 2011

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

"bimap" is a pretty good name, thanks

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



oh god converting bytestring py2 to unicode py3 just kill me

Adbot
ADBOT LOVES YOU

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



also wtf is this poo poo, could it be any more impenetrable

code:
for t in range(2, len(word)):
    temp = [(x[0] + (j,), (x[1] * self.tran[x[0][-1]][j] * self.emis[j][word[t]]))
        for j in self.states for x in paths]

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