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
Scionix
Oct 17, 2009

hoog emm xDDD
Can someone explain protobuffs to me

This poo poo is terrible

Adbot
ADBOT LOVES YOU

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Scionix posted:

Can someone explain protobuffs to me

This poo poo is terrible

MUCH LIKE YOU'RE POASTS

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Scionix posted:

Can someone explain protobuffs to me

This poo poo is terrible

what are you struggling with? it's pretty simple in concept: you define your data schema in proto files and then the schema is used to generate serializers and deserializers for your language.

it makes it very easy to communicate between processes written in different languages.

the devil is in the details tho

DONT THREAD ON ME fucked around with this message at 21:06 on Feb 21, 2019

Schadenboner
Aug 15, 2011

by Shine

Fatty Crabcakes posted:


MUCH LIKE YOU'RE POASTS

:thurman:

JawnV6
Jul 4, 2004

So hot ...

Scionix posted:

Can someone explain protobuffs to me

This poo poo is terrible
it's one of:
A) a magical formatting tool that will serialize/deserialize arbitrary information into a space-efficient wire format that can inflate to/from any language with some easy shims

b) make-work yak shaving for bored goog folks based around an esoteric use case with servers slinging bytestreams around, needing to pluck out some messages, and not freak out if there's a field it's unaware of. the 'not freak out' one is what causes every pain point and should just be a panic

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
lol if you try to version your api or distribute your transactions

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
also please someone tell me how to distribute a transaction

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:
Ok, but what's a transaction?

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

taqueso posted:

Ok, but what's a transaction?

a miserable pile of records

AggressivelyStupid
Jan 9, 2012

ctps: I think Fril is going to be the death of me. My mostly liquid brain can't comprehend both logic programming and lisp syntax at the same time.

Academia baby!!!

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


AggressivelyStupid posted:

ctps: I think Fril is going to be the death of me. My mostly liquid brain can't comprehend both logic programming and lisp syntax at the same time.

Academia baby!!!

I've had lectures by Martin and Flach, it was pretty great we did fractals in it and stuff, it was the most fun programming I've done at uni and they were really good at explaining it as you'd expect

doxxing my uni a bit there

it's definitely very academia

Private Speech fucked around with this message at 23:04 on Feb 21, 2019

Carthag Tuek
Oct 15, 2005

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



uggghhhhh

FileAccess (in file.py) needs to know about and import abstract base class Item (in items.py), of which exists multiple subclasses (in a.py, b.py, c.py). The application only knows about the base class, which instantiates the subclasses based on various conditions, so items.py imports a/b/c.py. One of the subclasses wants to use FileAccess.

how the gently caress do i make python not yell at me for circular imports?

Carthag Tuek fucked around with this message at 23:32 on Feb 21, 2019

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
so Travis got acquired last month and their new owners promptly fired all senior engineers

recommendations for another free-for-open-source ci platform wanted! I just want to build some Java application from a github repo that does a bit of docker for integration testing (not sure how that would work if the build itself takes place within a container, i mean)

any suggestions?

The Fool
Oct 16, 2003


circleci gitlab and azure devops all have free tier ci pipelines.

I use and like azure devops.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
yes but which one can you actively recommend as being somewhat easy to setup/manage and not-flaky

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Krankenstyle posted:

uggghhhhh

FileAccess (in file.py) needs to know about and import abstract base class Item (in items.py), of which exists multiple subclasses (in a.py, b.py, c.py). The application only knows about the base class, which instantiates the subclasses based on various conditions, so items.py imports a/b/c.py. One of the subclasses wants to use FileAccess.

how the gently caress do i make python not yell at me for circular imports?

you unfuck your circular structure

generally you'd split up your abstract base class so that it doesn't need to know about the implementations, and you create a separate items_factory that instantiates the appropriate implementation. then your app can depend on the factory, the factory can depend on the impls, an impl can depend on fileaccess, and fileaccess can depend on the abstract base item, with no circular dependencies at all.

The Fool
Oct 16, 2003


The Fool posted:

I use and like azure devops.

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





DONT THREAD ON ME posted:

also please someone tell me how to distribute a transaction

you got two options, RAMP and sagas. RAMP is safer but harder to implement and not always possible. Sagas are easy to implement but a pain in the rear end

Carthag Tuek
Oct 15, 2005

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



Jabor posted:

you unfuck your circular structure

generally you'd split up your abstract base class so that it doesn't need to know about the implementations, and you create a separate items_factory that instantiates the appropriate implementation. then your app can depend on the factory, the factory can depend on the impls, an impl can depend on fileaccess, and fileaccess can depend on the abstract base item, with no circular dependencies at all.

oh yea a factory, thx ill try it out

too much enterprise java has made me shun a lot of patterns lol

suffix
Jul 27, 2013

Wheeee!

Krankenstyle posted:

uggghhhhh

FileAccess (in file.py) needs to know about and import abstract base class Item (in items.py), of which exists multiple subclasses (in a.py, b.py, c.py). The application only knows about the base class, which instantiates the subclasses based on various conditions, so items.py imports a/b/c.py. One of the subclasses wants to use FileAccess.

how the gently caress do i make python not yell at me for circular imports?

what jabor said but a lazy (hah) way is to defer your imports to the functions that use them so e.g. a.py doesn't get loaded until Item needs to make an A

Carthag Tuek
Oct 15, 2005

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



suffix posted:

what jabor said but a lazy (hah) way is to defer your imports to the functions that use them so e.g. a.py doesn't get loaded until Item needs to make an A

it looks ugly to me and i dont like it

but thx

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

the talent deficit posted:

you got two options, RAMP and sagas. RAMP is safer but harder to implement and not always possible. Sagas are easy to implement but a pain in the rear end

cool thanks. i've heard of sagas but havent read into it because it sounds like something from the javascript ecosystem

AggressivelyStupid
Jan 9, 2012

Private Speech posted:

I've had lectures by Martin and Flach, it was pretty great we did fractals in it and stuff, it was the most fun programming I've done at uni and they were really good at explaining it as you'd expect

doxxing my uni a bit there

it's definitely very academia

I think the thing tripping me up hardest is that there is effectively no information about it out in the wild. I think I prefer it to plain prolog but plain prolog has more info out and about, like I can pick up a fairly recent book without much hassle

My kingdom for some readings

Private Speech
Mar 30, 2011

I HAVE EVEN MORE WORTHLESS BEANIE BABIES IN MY COLLECTION THAN I HAVE WORTHLESS POSTS IN THE BEANIE BABY THREAD YET I STILL HAVE THE TEMERITY TO CRITICIZE OTHERS' COLLECTIONS

IF YOU SEE ME TALKING ABOUT BEANIE BABIES, PLEASE TELL ME TO

EAT. SHIT.


Krankenstyle posted:

it looks ugly to me and i dont like it

but thx

you can also do an import guard by putting in an import-scope if

i.e.
code:
if not BLAHBLAHBLAH:
     from blahblah import blah 
but it's even uglier and doesn't work for true circular dependencies anyway

StackOF also offers this:

code:
try:
    from blah.blah import BlahBlahBlah
except ImportError:
    import sys
    BlahBlahBlah= sys.modules[__package__ + '.BlahBlahBlah']
but honestly it's better to just break the program up more

e:
im not primarily a python dev I just maintain a few python things at work so there might be a more elegant solution

Private Speech fucked around with this message at 00:24 on Feb 22, 2019

gonadic io
Feb 16, 2011

>>=

Sagacity posted:

yes but which one can you actively recommend as being somewhat easy to setup/manage and not-flaky

i've used circle and am fairly happy with it. it has an absurd enterprise pricing structure if you want anything but the most basic $50/mo/runner, but at work that suits our needs fine

its dsl is certainly better than fiddling with jenkins uis

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Private Speech posted:

but honestly it's better to just break the program up more

in my experience the opposite is easier: just merge the circular stuff back to a single module

gonadic io
Feb 16, 2011

>>=
terrible programmer question:

i'm trying to make a browser extension that alters tweets when you browse twitter.

the tutorial i'm looking at does it via jquery: $('.tweet-text').each(function(index){ ...

but when i inspect the html in firefox i see poo poo like:
<span class="rn-13yce4e rn-fnigne rn-ndvcnb rn-gxnn5r rn-deolkf...

but when i do the same in chrome i see:
<p class="TweetTextSize TweetTextSize--normal js-tweet-text tweet-text squished" lang="en" ...

am i falling afoul of some kind of security/obfuscation mechanism in ff? is it my ublock somehow?? it can't be minimisation right, they're not any shorter

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
Could be browser specific shims?
e: nevermind that really doesnt make sense.

e2: fwiw, my firefox looks like your chrome, i think.

e3: both my chrome and firefox look weird. it's a react thing as far as i know.

DONT THREAD ON ME fucked around with this message at 02:44 on Feb 22, 2019

Carthag Tuek
Oct 15, 2005

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



Symbolic Butt posted:

in my experience the opposite is easier: just merge the circular stuff back to a single module

true but my files are huge enough as it is :p

anyway i got it working with some more splitting of files :)

Carthag Tuek fucked around with this message at 07:33 on Feb 22, 2019

tinaun
Jun 9, 2011

                  tell me...
me at my job: writing the same react app everyone and their mother has made 300 times no biggie
me writing code for fun: oh poo poo someone else mentioned working on a similar crate in a blog post one time, better cancel my project and think of something else instead

gonadic io
Feb 16, 2011

>>=
Me at my job: sure the code's written but we need to talk about end to end test scenarios and our rollout plan. Also what about monitoring and alerting?

Me writing code for fun: eh it mostly works I'm bored now *moves on to different dumbass idea never finishing a single hobby project*

gonadic io fucked around with this message at 09:38 on Feb 22, 2019

Soricidus
Oct 21, 2010
freedom-hating statist shill
update: instead of writing my own lua I went outside and played with a dog, and I do not regret this decision

Chalks
Sep 30, 2009

ctps: looks like azure's hosed in europe in some way so none of my deploys work and i'm trying to get a release done by the end of the week :cloud:

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Chalks posted:

ctps: looks like azure's hosed in europe in some way so none of my deploys work and i'm trying to get a release done by the end of the week :cloud:

end of the week in terms of software should never be after Thursday

Carthag Tuek
Oct 15, 2005

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



Soricidus posted:

update: instead of writing my own lua I went outside and played with a dog, and I do not regret this decision

good call

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.

DONT THREAD ON ME posted:

also please someone tell me how to distribute a transaction

put it on a floppy disk with a shareware license

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.

gonadic io posted:

i've used circle and am fairly happy with it. it has an absurd enterprise pricing structure if you want anything but the most basic $50/mo/runner, but at work that suits our needs fine

its dsl is certainly better than fiddling with jenkins uis

Jenkins pipeline dsl stuff isn’t so bad, except for the fact it’s in fuckin groovy

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

DONT THREAD ON ME posted:

also please someone tell me how to distribute a transaction
have u tried something like this, op?
SQL code:
BEGIN DISTRIBUTED TRANSACTION;
EXEC drawRestOfOwl;
COMMIT TRANSACTION;

Carthag Tuek
Oct 15, 2005

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



say i have a project that is licensed under Creative Commons Attribution 4.0 (CC-BY-4.0)

can i take some functions from the below file and put in a file in my project (with a comment at the top explaining origin, etc)...? its under Apache License 2.0
https://github.com/tmbdev/ocropy/blob/master/ocropus-gpageseg

Adbot
ADBOT LOVES YOU

Aramoro
Jun 1, 2012




Krankenstyle posted:

say i have a project that is licensed under Creative Commons Attribution 4.0 (CC-BY-4.0)

can i take some functions from the below file and put in a file in my project (with a comment at the top explaining origin, etc)...? its under Apache License 2.0
https://github.com/tmbdev/ocropy/blob/master/ocropus-gpageseg

I think you'd still need to include the Apache 2.0 licence in your release

https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)

That and a NOTICE file. I'd say what you were doing would be creating a derivative work. I think personally I would take the functions I wanted package them into one file and include that in whatever I was doing rather than embedding them straight into other code. Just to keep it clear.

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