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
count_von_count
Nov 6, 2012

echinopsis posted:

I feel like I need to know about this

It's just khan academy's online js tutorial , which uses the processing.js libraries. They start you out making lines and colors so it's like playing around with logowriter back in the day.

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

leper khan posted:

is “loc lines” better than compacting it into “klocks”

oh most definitely

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:
code locs

Powerful Two-Hander
Mar 10, 2004

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


there are 5 if statements checking a variable in this controller and all of them then call the exact same piece of code which just passes the value of the variable in as a filter what the gently caress

gonadic io
Feb 16, 2011

>>=

Powerful Two-Hander posted:

there are 5 if statements checking a variable in this controller and all of them then call the exact same piece of code which just passes the value of the variable in as a filter what the gently caress

10 years of refactoring by fresh devs after the previous person left imo. If its the work of one dev in a relatively recent time period then uhhh

Although having said that if you do refactor it watch out for side effects! if(x.foo() == butt) kind of thing

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Krankenstyle posted:

more like triple fail amirite

also, its my rapper name

and you’re interferon with our good time

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

count_von_count posted:

It's just khan academy's online js tutorial , which uses the processing.js libraries. They start you out making lines and colors so it's like playing around with logowriter back in the day.

but does it have a turtle

Carthag Tuek
Oct 15, 2005

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



bob dobbs is dead posted:

do some examples on paper first, use them as test cases, when you make mistakes on the paper examples, those are the negative test cases. bam done. math code is easy code. von neumann invented the current architecture of computers to do monte carlos for nukes

ya its what i ended up doing :)

also i just renamed a function to generate_confusion() to more clearly reflect what it does lol

echinopsis
Apr 13, 2004

count_von_count posted:

It's just khan academy's online js tutorial , which uses the processing.js libraries. They start you out making lines and colors so it's like playing around with logowriter back in the day.

so dope

can it process pictures?

Powerful Two-Hander
Mar 10, 2004

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


gonadic io posted:

10 years of refactoring by fresh devs after the previous person left imo. If its the work of one dev in a relatively recent time period then uhhh


good news everyone, it's the latter!


i think they've written it using lovely switch statements then refactored it so that those no longer do anything and judging by the mess of commented out code and test stuff in there, left all their "working out" in place

AggressivelyStupid
Jan 9, 2012

I love me some great swaths of commented code. There are projects at work with hundreds of lines of code, that have been commented out, but were originally copy pasted from another project 15 years ago.


The top of the file is a 100 line comment marked with names and a half rear end change log which is just insanely useless

CPColin
Sep 9, 2003

Big ol' smile.
What, you don't like comments like this?

code:
// JB see issue #123 (November)
I had a coworker who littered poo poo like that all over. Like, all that information is exactly what git blame is for! Put a real comment there or gently caress off!

Powerful Two-Hander
Mar 10, 2004

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


AggressivelyStupid posted:

I love me some great swaths of commented code. There are projects at work with hundreds of lines of code, that have been commented out, but were originally copy pasted from another project 15 years ago.


The top of the file is a 100 line comment marked with names and a half rear end change log which is just insanely useless

one ex dev would continuously copy and paste commented out code it was maddening. also comment commits with just "changes" :mad:

FlapYoJacks
Feb 12, 2009
lol I deny pull requests with commented out code. gently caress you that’s not going in there.

AggressivelyStupid
Jan 9, 2012

CPColin posted:

What, you don't like comments like this?

code:
// JB see issue #123 (November)
I had a coworker who littered poo poo like that all over. Like, all that information is exactly what git blame is for! Put a real comment there or gently caress off!

git, what is that :shepicide:

Powerful Two-Hander
Mar 10, 2004

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


ratbert90 posted:

lol I deny pull requests with commented out code. gently caress you that’s not going in there.

lol as if we're doing pull requests and not just yoloing changes into the dev branch

Soricidus
Oct 21, 2010
freedom-hating statist shill
git push -f origin master

FlapYoJacks
Feb 12, 2009

Powerful Two-Hander posted:

lol as if we're doing pull requests and not just yoloing changes into the dev branch

We used to. Then I was hired. :unsmigghh:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Soricidus posted:

git push -f origin master

bro don't steal my $RPROMPT

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Powerful Two-Hander posted:

lol as if we're doing pull requests and not just yoloing changes into the dev branch

use a git hook ya fuckin pelican

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.


DaTroof posted:

use a git hook ya fuckin pelican

How do you git hook for commented-out code? I could specifically use it for C but it's a general question

Is there some parsing library for it? I'm sure there is but no seriously

Corla Plankun
May 8, 2007

improve the lives of everyone
python has a ton of things that will return nonzero exit codes if your formatting is bad or contains errors that can be detected with static analysis like unused imports and etc

i feel like it is a guaranteed certainty that they stole this idea from existing lang communities because it is too good to have come from pythonistos

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.


Corla Plankun posted:

python has a ton of things that will return nonzero exit codes if your formatting is bad or contains errors that can be detected with static analysis like unused imports and etc

i feel like it is a guaranteed certainty that they stole this idea from existing lang communities because it is too good to have come from pythonistos

thanks that reminded me that linters exist, and yeah that would work

and yeah it's been around for older plangs for quite a while, the original lint was for C

e: actually no thinking about it it wouldn't work, it's not trivial to decide which comments are C code

e2: the best I can find is a grep for semicolons in comments, which is ehh

Private Speech fucked around with this message at 12:53 on Jan 29, 2019

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Private Speech posted:

How do you git hook for commented-out code? I could specifically use it for C but it's a general question

Is there some parsing library for it? I'm sure there is but no seriously

serious answer, yeah, it's probably not possible to do with 100% accuracy

you could kinda sorta get partway there with a regexp to detect when a diff stubs existing code

FlapYoJacks
Feb 12, 2009
Just lol if you don't have at a minimum a Jenkins server + sonarqube. I even have a docker-compose to bring them both up in only a few minutes.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 11 years!)

ratbert90 posted:

Just lol if you don't have at a minimum a Jenkins server + sonarqube. I even have a docker-compose to bring them both up in only a few minutes.

how many containers do you have for blowing your own horn

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

carry on then posted:

how many containers do you have for blowing your own horn

in the context of SA we usually call them threads

e: and lots

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

are docker containers monads?

gonadic io
Feb 16, 2011

>>=

pokeyman posted:

are docker containers monads?

Can you use a docker container as a host for its own set of containers? One of the requirements is to be able to have a function of type Docker<Docker<Butt>> to Docker<Butt>

FlapYoJacks
Feb 12, 2009

gonadic io posted:

Can you use a docker container as a host for its own set of containers? One of the requirements is to be able to have a function of type Docker<Docker<Butt>> to Docker<Butt>

You can

Carthag Tuek
Oct 15, 2005

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



Private Speech posted:

thanks that reminded me that linters exist, and yeah that would work

and yeah it's been around for older plangs for quite a while, the original lint was for C

e: actually no thinking about it it wouldn't work, it's not trivial to decide which comments are C code

e2: the best I can find is a grep for semicolons in comments, which is ehh

test if code compiles with any of n! combinations of comment lines uncommented.

gonadic io
Feb 16, 2011

>>=

Krankenstyle posted:

test if code compiles with any of n! combinations of comment lines uncommented.

Mutation compilation



Then I would say probably yes, at least in theory. It's not really clear what a type Docker<int> would actually be

NihilCredo
Jun 6, 2011

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

gonadic io posted:

Can you use a docker container as a host for its own set of containers? One of the requirements is to be able to have a function of type Docker<Docker<Butt>> to Docker<Butt>

https://hub.docker.com/_/docker

akadajet
Sep 14, 2003

pokeyman posted:

are docker containers monads?

lol

ThePeavstenator
Dec 18, 2012

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

Establish the Buns

:burger::burger::burger::burger::burger:
*through sobs* Please...you can't just call anything you want a monad

*points at docker* "monad"

gonadic io
Feb 16, 2011

>>=
Ctps: I have an acyclic graph in DOT format with about 8000 edges. Graphviz chokes on it. (maybe would be okay if I just left it longer?)

What I want is to label each node with a depth of 1 (ie all nodes just below the root) with a count of its children (and children's children etc)

Is there a thing I can use to do this, or should I just build a bespoke one-off app for it?

Carthag Tuek
Oct 15, 2005

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



gonadic io posted:

Ctps: I have an acyclic graph in DOT format with about 8000 edges. Graphviz chokes on it. (maybe would be okay if I just left it longer?)

What I want is to label each node with a depth of 1 (ie all nodes just below the root) with a count of its children (and children's children etc)

Is there a thing I can use to do this, or should I just build a bespoke one-off app for it?

i would progbably write a one-off script yeah


also just got another idea for determining if comments are code: frequency count a bunch of code, then see if a comment is nearer to that feature vector than to one from an english prose corpus (english has much less punctuation & fewer brackets, etc)

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

gonadic io posted:

Ctps: I have an acyclic graph in DOT format with about 8000 edges. Graphviz chokes on it. (maybe would be okay if I just left it longer?)

What I want is to label each node with a depth of 1 (ie all nodes just below the root) with a count of its children (and children's children etc)

Is there a thing I can use to do this, or should I just build a bespoke one-off app for it?

networkx is good for this, iirc. can read dot, anyhow. it might even not choke in visualizing, i've done 20k nodes on it

MononcQc
May 29, 2007

"I believe I did, Bob."


Krankenstyle posted:

i would progbably write a one-off script yeah


also just got another idea for determining if comments are code: frequency count a bunch of code, then see if a comment is nearer to that feature vector than to one from an english prose corpus (english has much less punctuation & fewer brackets, etc)

grab a parser for your lang of choice, grab the commented text, remove the comments themselves from that selection, and check if the comment parses as code.

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

MononcQc posted:

grab a parser for your lang of choice, grab the commented text, remove the comments themselves from that selection, and check if the comment parses as code.

This is pretty much the only correct answer to "is text code". Trouble comes when people have edited the comment to make the parse fail, would you still count that as code?

Also c++ is difficult to parse but something about made beds and lying in them imo

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