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
Doom Mathematic
Sep 2, 2008
Here's an enterprising fellow with one separate NPM module for each individual ANSI colour code.

Adbot
ADBOT LOVES YOU

Space Whale
Nov 6, 2014
Finally get to play with hardware and at a great workplace.

:3:

I start off fixing bugs from production, mostly. We have a C++ layer that talks to the hardware and C# uses that abstraction to actually handle events. Many of these are async void, or actually return a task but aren't awaited. So now I play whack-a-mole with that.

:q:

Anyone here experienced with tasks/await/async in C# got anything to say except "thou shalt not loving use async void except for message handlers"?

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

JawnV6
Jul 4, 2004

So hot ...

hungry, gotta find my wife and

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

crazypenguin posted:

these package manager styles are incompatible. Mostly it's deficiencies in rpm/apt.

e.g. for doing development, it's best to be able to put your dependencies next to your project. RPM/APT are all system-wide only tools, so you cannot work on one project that uses pkg-v1 and another project that uses pkg-v2 at the same time. And you need to be administrator and make arbitrary changes to a machine just to compile poo poo.

for doing development, you want reproducible builds with specific versions of dependencies, with RPM/APT you get the latest version shut up.

for doing development, sometimes you use a tool that uses pkg-v1 while you're writing an app that uses pkg-v2 and you want both installed at the same time, and rpm/apt don't allow this because they don't actually place anything in package-specific locations, just dump poo poo in /usr! (Where apt/rpm do need to allow this, they mutate the name of the package instead of just allowing multiple versions. So you get gtk2 v2.22 and gtk3 v3.24 instead of two versions of gtk. It is arguble, imo, whether this is a better or worse system. On the one hand, it encodes some information about whether it "should" be okay to just update to the newest version of the package. OTOH, "should" belongs in god drat quotes, and as soon as you have a single failure of that should, the system falls apart.)

I'd love to work on fixing up apt/rpm so we could use them but I don't think the distros are at all interested, sadly.
portage is real good, op

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Finster Dexter posted:

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

lol. he could have just made ansi-const-and-utils.js or something instead but nope, gotta inflate that package count. surely my 1100th 1-line library will earn me the job of my dreams.

a witch
Jan 12, 2017

gotta keep my electron app lean and mean by only importing the colours I need :smuggo:

Radio Paranoia
Jun 27, 2010

It is now safe to turn off your computer.

LeftistMuslimObama posted:

lol. he could have just made ansi-const-and-utils.js or something instead but nope, gotta inflate that package count. surely my 1100th 1-line library will earn me the job of my dreams.

i am contributing to the javascript community :shepface:

GameCube
Nov 21, 2006

Space Whale posted:

Anyone here experienced with tasks/await/async in C# got anything to say except "thou shalt not loving use async void except for message handlers"?

if you're aware of this basic fact, you already know more than most people do about async. most people just throw asyncs and awaits in until the red squigglies go away

GameCube
Nov 21, 2006

but yeah use ConfigureAwait(false) unless you can't, and if you don't have to do anything else after awaiting an async call, you can just return that task instead of making this method async. that's the stuff i have to keep explaining to my coworkers

Sapozhnik
Jan 2, 2005

Nap Ghost

Space Whale posted:

Finally get to play with hardware and at a great workplace.

:3:

I start off fixing bugs from production, mostly. We have a C++ layer that talks to the hardware and C# uses that abstraction to actually handle events. Many of these are async void, or actually return a task but aren't awaited. So now I play whack-a-mole with that.

:q:

Anyone here experienced with tasks/await/async in C# got anything to say except "thou shalt not loving use async void except for message handlers"?

hardware stuff is fun except when it's not

but congrats on your new job

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


GameCube posted:

but yeah use ConfigureAwait(false) unless you can't, and if you don't have to do anything else after awaiting an async call, you can just return that task instead of making this method async. that's the stuff i have to keep explaining to my coworkers

what does that ConfigureAwait(bool) actually do, I tried reading the msdn page and i don't get it

LP0 ON FIRE
Jan 25, 2006

beep boop
i loving hate php so god drat loving much, and i wasted an entire day on frustrations of the value of a constant giving me back the name of the constant instead of the value assigned to it

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
great, vmware ate the disk image for the vm i need for my project. so now instead of working on my project ill probably spend the rest of the week rebuilding the vm.

AggressivelyStupid
Jan 9, 2012

Finster Dexter posted:

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

Wow I wonder where this idiot is a-

OH NO

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

Ciaphas posted:

what does that ConfigureAwait(bool) actually do, I tried reading the msdn page and i don't get it

the single parameter passed to it is continueOnCapturedContext. the context that is being captured is the current SynchronizationContext. a synchronization context ***approximately*** maps to a thread, but this is just a simplification.

when an asynchronous task finishes, the runtime needs to know what to do next. if you're using async/await, "what to do next" is the rest of your method after the await keyword. the runtime also needs to know what synchronization context to run that code on.

if continueOnCapturedContext is true (the default), the current synchronization context is stored on the task and the runtime will use that to continue execution. for example, if you do work on the ui thread and use async/await, the rest of your method will continue on the ui thread after the asynchronous task completes. this is a reasonable default.

if continueOnCapturedContext is false, execution will continue on any old thread. this is important in library code where you don't know what the caller is doing and don't want to introduce deadlocks if they're doing something stupid.

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


that is way more in depth than i've ever given thought re: async/await, sheesh

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

Bognar posted:

if continueOnCapturedContext is false, execution will continue on any old thread. this is important in library code where you don't know what the caller is doing and don't want to introduce deadlocks if they're doing something stupid.

so the same reason they removed dispatch_get_current_queue from Darwin

VikingofRock
Aug 24, 2008




Finster Dexter posted:

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

lmao jesus christ

necrotic
Aug 2, 2005
I owe my brother big time for this!

Cocoa Crispies posted:

code:
fart@1.0.0 /private/tmp/fart
└─┬ create-react-app@1.0.4
  ├─┬ chalk@1.1.3
  │ ├── ansi-styles@2.2.1
  │ ├── escape-string-regexp@1.0.5
  │ ├─┬ has-ansi@2.0.0
  │ │ └── ansi-regex@2.1.1
  │ ├── strip-ansi@3.0.1
  │ └── supports-color@2.0.0
  ├─┬ commander@2.9.0
  │ └── graceful-readlink@1.0.1
  ├─┬ cross-spawn@4.0.2
  │ ├─┬ lru-cache@4.0.2
  │ │ ├── pseudomap@1.0.2
  │ │ └── yallist@2.0.0
  │ └─┬ which@1.2.12
  │   └── isexe@1.1.2
  ├─┬ fs-extra@1.0.0
  │ ├── graceful-fs@4.1.11
  │ ├── jsonfile@2.4.0
  │ └── klaw@1.3.1
  └── semver@5.3.0
i'm "supports-color@2.0.0"

its still a node/npm poo poo fest but you dont have to wrangle babel and all that poo poo.

Count Thrashula
Jun 1, 2003

Death is nothing compared to vindication.
Buglord
Lol why are PHP tutorial series still coming out

Like oh boy finally I can learn laravel

Shaggar
Apr 26, 2006

Finster Dexter posted:

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

lol @ javascript forever.

brap
Aug 23, 2004

Grimey Drawer
label the gently caress out of that boolean argument imo

Arcsech
Aug 5, 2008
i got a dumb erlang/elixir question for a side project

i have a supervisor that manages transient workers (simple_one_for_one). a task gets started, eventually finishes but may take a while, and if it dies it should get restarted. when a task is started i shove it in a db, when the task finishes it gets removed from the db.

i want to have something read in the db entries when the supervisor is started and start the workers, but I'm not sure how to do a thing whenever a supervisor starts. what's the best way of doing this?

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?

LeftistMuslimObama posted:

i just got an email from hr. my transfer was approved! i will apprise you of my figgies once they call me.

congratulations!

welcome to official terrible programming!

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?

Finster Dexter posted:

jfc look at all this poo poo just to support literally one line of js

https://github.com/jonschlinkert/ansi-gray

reminds me of that stupid loving Bitcoin "pay for code" startup that wants to individually sell bytes

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

hackbunny posted:

so the same reason they removed dispatch_get_current_queue from Darwin

I thought that got removed because the only thing people ever used it for didn't actually work

or :thejoke:?

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?

hackbunny posted:

so the same reason they removed dispatch_get_current_queue from Darwin

less "removed" (lol bincompat) and more like "got ever more aggressive about telling people not to use"

dispatch is really, really good, I want to be able to use it in Common Lisp but cl-dispatch needs some work

and CFFI also needs some work to make it easier to bridge <dispatch.h> into Common Lisp

fortunately if I hack on cl-dispatch it might be feasible for me to go through my employer's process to contribute my fixes

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

pokeyman posted:

I thought that got removed because the only thing people ever used it for didn't actually work

or :thejoke:?

well it let you submit work on a queue that wasn't yours (and so you had no idea if it was serialized, parallelized, at what priority it ran, for how long etc.). a little like the .net thing

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Arcsech posted:

i got a dumb erlang/elixir question for a side project

i have a supervisor that manages transient workers (simple_one_for_one). a task gets started, eventually finishes but may take a while, and if it dies it should get restarted. when a task is started i shove it in a db, when the task finishes it gets removed from the db.

i want to have something read in the db entries when the supervisor is started and start the workers, but I'm not sure how to do a thing whenever a supervisor starts. what's the best way of doing this?

supervisor should kick off a process to do that thing

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





Arcsech posted:

i got a dumb erlang/elixir question for a side project

i have a supervisor that manages transient workers (simple_one_for_one). a task gets started, eventually finishes but may take a while, and if it dies it should get restarted. when a task is started i shove it in a db, when the task finishes it gets removed from the db.

i want to have something read in the db entries when the supervisor is started and start the workers, but I'm not sure how to do a thing whenever a supervisor starts. what's the best way of doing this?

supervisor -> [ gen_server that manages the db entries and starts workers, supervisor -> [ worker, worker, worker ] ]

Radio Paranoia
Jun 27, 2010

It is now safe to turn off your computer.
https://twitter.com/revskills/status/832410305078689792

MononcQc
May 29, 2007

the talent deficit posted:

supervisor -> [ gen_server that manages the db entries and starts workers, supervisor -> [ worker, worker, worker ] ]

may want to swap that order around so the supervisor is there when the gen_server starts. Also could use a rest_for_one strategy so the server can die, but if the supervisor chokes, it forces a restart of the server as well

Arcsech
Aug 5, 2008

MononcQc posted:

may want to swap that order around so the supervisor is there when the gen_server starts. Also could use a rest_for_one strategy so the server can die, but if the supervisor chokes, it forces a restart of the server as well

so if I have something like

sup1 -> [sup2->[workers], initialization_server]

sup2 is guaranteed to be started before initialization_server?

also thanks all this is really helpful

MononcQc
May 29, 2007

Arcsech posted:

so if I have something like

sup1 -> [sup2->[workers], initialization_server]

sup2 is guaranteed to be started before initialization_server?

also thanks all this is really helpful

Yeah. That's part of the implicit guarantees of the supervision tree. Order is depth-first. The initialization_server can only run without sup2 in the case where both sup2 and intialization_server are under the same supervisor under a one_for_one supervision scheme and sup2 has crashed.

If you need the dependency to be absolute (never happens, even with restarts and failure), rest_for_one or all_for_one will take care of that (aside from the failure detection delay).

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
oh cool so one person approves transfers, but a different person entirely is responsible for then staffing the transferee to a team and they cancelled all their meetings today. so i am simultaneously approved to transfer and yet not transferring. i dont know why i expected hr to be anything but a loving joke at this company.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

hackbunny posted:

well it let you submit work on a queue that wasn't yours (and so you had no idea if it was serialized, parallelized, at what priority it ran, for how long etc.). a little like the .net thing

there's also the problem of that there isn't actually a singular "current queue"

Arcsech
Aug 5, 2008

MononcQc posted:

Yeah. That's part of the implicit guarantees of the supervision tree. Order is depth-first. The initialization_server can only run without sup2 in the case where both sup2 and intialization_server are under the same supervisor under a one_for_one supervision scheme and sup2 has crashed.

If you need the dependency to be absolute (never happens, even with restarts and failure), rest_for_one or all_for_one will take care of that (aside from the failure detection delay).

otp is so fukken good

also thanks monocqc, i should just buy a copy of your book already and stop asking stupid questions in the terrible programmers thread.


LeftistMuslimObama posted:

oh cool so one person approves transfers, but a different person entirely is responsible for then staffing the transferee to a team and they cancelled all their meetings today. so i am simultaneously approved to transfer and yet not transferring. i dont know why i expected hr to be anything but a loving joke at this company.

yo it sucks that you're getting jerked around right now but I just want to say I'm supper happy your transfer got approved and you'll be in a good place long-term

PierreTheMime
Dec 9, 2004

Hero of hormagaunts everywhere!
Buglord
spent most of the day killing myself on sql queries to return values i can store in a local object because the preprocess function i have to call must have that value, cant directly read it from the variable because value assignment occurs immediately after the preprocess during execution, but can read in sql query results. at this point i can get my variable value in one query and the rest of the query built and working separately but when i try to combine the two it bombs out and its driving me mad

this is the most convoluted bullshit to what should be a simple problem :rant:

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
well, im free of the non stop stream of enterprise gibberish. hello job insecurity of a startup

  • Locked thread