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
Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

tef posted:

threads are nice if you only share atomic or concurrent data structures between them, or better, transactions

preemptive or not (i.e fibers/coroutines vs threads)

the real problem is how you handle shared mutable state

and that's the real problem here, not how you model program flow

Software transactional memory superiority.

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




some peak commits from me today

"Replaces functionA with functionB, that is slower but works."

HoboMan
Nov 4, 2010

i love those, i have probably a dozen commits now along the lines of: "fixed function ButtToucher so that it actually touches butts now"

cinci zoo sniper
Mar 15, 2013




in other news, i should probably do something so that my python project sometimes stops and thinks. spent 30 minutes "debugging" the fact that program trucked on despite getting a float instead of an array

suffix
Jul 27, 2013

Wheeee!

Sapozhnik posted:

pro read, ty for this

what do you think about zookeeper as a service discovery mechanism, for when you outgrow a hardwired list of http://localhost:xxxxx/ urls in /etc/mybullshit.conf to post notifications to

a service registry in zookeepr with ephemeral nodes works ok, but do you really need linearisability for your lookup based on a seconds long heartbeat that could be out of date by the time you make the request anyway?
and you're paying for that in scalability + probably doing something custom instead of a ready-made solution that works with basically any service

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

MononcQc posted:

I made my own set of pipes macros for Erlang (see library) but frankly I'm not finding myself using it very much.

Where the operation would be:
code:

M=1, N=2,
P = f(M,N)
Q = g(M+N, P)
h(Q)
elixir can't represent it since it requires positional awareness for the function arguments, though if you swap the arguments to for g() you could do:
code:

f(m,n) 
|> g(m+n) 
|> h()
and the macro set I got does look uglier but allows positional arguments (and also nesting of pipe sequences, and various types of piping can be created with a more unified [ugly] syntax)
code:

[pipe](f(M,N),
       g(M+N, _),
       h(_))
In practice I've never found it to actually be that worth it. Any transient complexity I just put in another function and get that to wrap away anything that may look a tad icky and that's about the end of it.

I guess it's that I'm really used to reading functional code that may be inverted though, and coming from imperative the challenge is likely different and pipes make things feel more familiar.

well yeah, if the functions aren't written in a way that plays nice with pipes it's not so useful, but I would argue it's a great way to handle chains of changes on a single common object, which is typically how it gets used, beats:

code:

final_conn = json_body(put_status(add_header(conn, "content-type", "application/json"), 200), payload)

// vs

final_conn = conn
  |> add_header("content-type", "application/json")
  |> put_status(200)
  |> json_body(payload)

Sure, I can read the former, but arguments are separated from
calls to a degree that it's very easy to miss a mistake when reading or editing. I don't even think it's a question of familiarity with imperative or functional, piping organised the calls in the order of evaluation so while inside out can be read, piping accurately represents how the final value is reached.

JewKiller 3000
Nov 28, 2006

by Lowtax

Zemyla posted:

Software transactional memory superiority.

this but hardware transactional memory :discourse:

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?

Luigi Thirty posted:

okay there we go. centering a string: game calls the OS PutStringCentered function. PutStringCentered does its magic and calls the OS PutString function with an adjusted screen RAM destination address. PutString repeatedly calls PutChar until it hits a NUL. :toot: the OS can call itself without blowing up



(my homemade libc contains one function atm: strlen lol)

thanks for the props and this is awesome!

soon you will start to imbue your A-traps with meaning, and add a patchable in-RAM trap table via traps like like GetTrapAddress and SetTrapAddress, and you'll bring over your other OS features too, and your graphics API, and you'll wind up with a complete miniature graphical OS!

muahahahaha

MononcQc
May 29, 2007

Maluco Marinero posted:

well yeah, if the functions aren't written in a way that plays nice with pipes it's not so useful, but I would argue it's a great way to handle chains of changes on a single common object, which is typically how it gets used, beats:

code:
final_conn = json_body(put_status(
                         add_header(conn, "content-type", "application/json"),
                         200),
		       payload)

// vs

final_conn = conn
  |> add_header("content-type", "application/json")
  |> put_status(200)
  |> json_body(payload)
Sure, I can read the former, but arguments are separated from
calls to a degree that it's very easy to miss a mistake when reading or editing. I don't even think it's a question of familiarity with imperative or functional, piping organised the calls in the order of evaluation so while inside out can be read, piping accurately represents how the final value is reached.

I'd argue in favor of a more data-centric approach since all the data has to be around anyway:

code:
Response = {200, [{"content-type", "application/json"}], Payload},
set_response(Conn, Response)
It would, for example, prevent adding a header before a status code.

Now if not all the data is around at the same time, then pipes are less useful, unless you also use them to weave in control flow, but you quickly need to handle errors; fancier pipes than just compositional ones are required then, such as either/maybe switching on success or errors.

There's no arguing that piping is overall nicer when writing imperative-looking code, but I try (when possible) to figure out how to fall back to a more declarative mode of operations.

MononcQc fucked around with this message at 03:19 on Jun 29, 2017

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

elite_garbage_man posted:

Look, I'm luigi

howdy, howdy, howdy

Luigi Thirty
Apr 30, 2006

Emergency confection port.

eschaton posted:

thanks for the props and this is awesome!

soon you will start to imbue your A-traps with meaning, and add a patchable in-RAM trap table via traps like like GetTrapAddress and SetTrapAddress, and you'll bring over your other OS features too, and your graphics API, and you'll wind up with a complete miniature graphical OS!

muahahahaha

sadly there's no pixel framebuffer because it's a dang arcade game

i've got a scrollable playfield layer that's roughly 2 screens wide and 2 screens tall, a 42x30 text layer, and 8 selectable buffers of 64 sprites (which are 8px wide but can be up to 256px tall) each

redleader
Aug 18, 2005

Engage according to operational parameters
what is the best proportional font for coding use? preferably available on windows by default thx

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx
did you mean a non-proportional font

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx

Verdana is fine, and available pretty much everywhere.

I really like the Go font though. (Stay away from the monospace one imo, but the proportional one is good)

Bloody
Mar 3, 2013

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx

consolas

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx

i think that's a matter of preference

Soricidus
Oct 21, 2010
freedom-hating statist shill

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx

papyrus

gonadic io
Feb 16, 2011

>>=
I've got a coworker who uses comic sans on a cream background. I still haven't yet figured out if this is a master troll or he genuinely likes it.

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?
just install ProFont and be happy

it's basically bitmap Monaco 9 but with distinguished 1/l and 0/O characters, and heavier {}

bonus: it's by Andrew Welch

eschaton fucked around with this message at 09:27 on Jun 29, 2017

cinci zoo sniper
Mar 15, 2013




gonadic io posted:

I've got a coworker who uses comic sans on a cream background. I still haven't yet figured out if this is a master troll or he genuinely likes it.

id love to pull that off but im not sure i can bear times new roman in my ide

cinci zoo sniper
Mar 15, 2013




boolean logic status final update: my last night logic was probably fine. as i just realised, i had a typo so filter looked for but not butt

Luigi Thirty
Apr 30, 2006

Emergency confection port.

redleader posted:

what is the best proportional font for coding use? preferably available on windows by default thx

Topaz 8

AWWNAW
Dec 30, 2008

Fira code with ligatures

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

AWWNAW posted:

Fira code with ligatures

i use fira in my mumps ide

HoboMan
Nov 4, 2010

this query plan is saying that 99% of query time is being spent on a distinct sort of 0 rows???

cinci zoo sniper
Mar 15, 2013




HoboMan posted:

this query plan is saying that 99% of query time is being spent on a distinct sort of 0 rows???

it basically says that na != na

HoboMan
Nov 4, 2010

est rows: 126,608,000. actual rows: 0

hmmmm...

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Bloody posted:

consolas

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

gonadic io posted:

I've got a coworker who uses comic sans on a cream background. I still haven't yet figured out if this is a master troll or he genuinely likes it.

He could be dyslexic. Comic Sans is shown to be easier to read for dyslexic people.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Zemyla posted:

He could be dyslexic. Comic Sans is shown to be easier to read for dyslexic people.

do you have a study which shows this? the only ones I can find don't include Comic Sans in their set.

cinci zoo sniper
Mar 15, 2013




terrible programmer question of the evening:

in python, i have for loops that do things, and for some of them i've set

code:
print "."
so its not all dead all the time. during heavier tasks though it just dies and then shits out a wall of dots once done. that's just python, or anything i can do about it without something ridiculous like printing on a different thread?

Rectus
Apr 27, 2008

cinci zoo sniper posted:

terrible programmer question of the evening:

in python, i have for loops that do things, and for some of them i've set

code:
print "."
so its not all dead all the time. during heavier tasks though it just dies and then shits out a wall of dots once done. that's just python, or anything i can do about it without something ridiculous like printing on a different thread?

guessing you need to flush the print buffer
https://stackoverflow.com/questions/230751/how-to-flush-output-of-python-print

FlapYoJacks
Feb 12, 2009

cinci zoo sniper posted:

terrible programmer question of the evening:

in python, i have for loops that do things, and for some of them i've set

code:
print "."
so its not all dead all the time. during heavier tasks though it just dies and then shits out a wall of dots once done. that's just python, or anything i can do about it without something ridiculous like printing on a different thread?
flush stdout yo.

cinci zoo sniper
Mar 15, 2013





ratbert90 posted:

flush stdout yo.

thanks, will throw it into corresponding functions

cinci zoo sniper
Mar 15, 2013




another question while i'm still at it. is there any special fp or something paradigm that i should know or consider if i basically have a class with a bunch of functions, and now im starting to see enough overlap between a part of them to warrant moving it out into a private class function of its own

Luigi Thirty
Apr 30, 2006

Emergency confection port.

holy poo poo i actually found an open sores project that uses D

it's a semi-functional linux client for onedrive

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

cinci zoo sniper posted:

another question while i'm still at it. is there any special fp or something paradigm that i should know or consider if i basically have a class with a bunch of functions, and now im starting to see enough overlap between a part of them to warrant moving it out into a private class function of its own

if you think those functions can be usefully reused by some external consumer, sure, but otherwise you're just shuffling code around so organize it however you want.

cinci zoo sniper
Mar 15, 2013




no longer enemies with matplotlib. now enemies with ggplot2

cinci zoo sniper
Mar 15, 2013




MALE SHOEGAZE posted:

if you think those functions can be usefully reused by some external consumer, sure, but otherwise you're just shuffling code around so organize it however you want.

tradeoff there is that is definitely less readable to customer, but then i have to fix one place instead of copy/pasting in many

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

pointsofdata posted:

if the producer needs completion confirmation then it's not really a good use case for persistent queues

this is literally what i said

  • Locked thread