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
Carthag Tuek
Oct 15, 2005

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



commented code might have old invalid variable names

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=

Krankenstyle posted:

commented code might have old invalid variable names

It doesn't have to compile, just parse

Cold on a Cob
Feb 6, 2006

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

College Slice
what if the commented code scenario is something like

// don't change the following code to this, i know you'll be tempted but don't:
// {garbage code that looks good but performs horribly or has a weird bug}
{actual working code that looks whack but is better for reasons}

Aramoro
Jun 1, 2012




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.

Jenkins + Sonarqube is what we're using just now but due to an SVN server no one wants to own we're stuck analysing the release branch only. We're planning a move to GIT but trying to get agreement on 1) how much history to truncate and 2) who is going to own it this time.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Cold on a Cob posted:

what if the commented code scenario is something like

// don't change the following code to this, i know you'll be tempted but don't:
// {garbage code that looks good but performs horribly or has a weird bug}
{actual working code that looks whack but is better for reasons}

then you will get a false positive, there is really nothing you can do about that

Doom Mathematic
Sep 2, 2008
Just comment out the code a second time.

code:
// Don't change the code below to this:
// // <bad code>
// because it will not work
<actual code>

CPColin
Sep 9, 2003

Big ol' smile.

Cold on a Cob posted:

what if the commented code scenario is something like

// don't change the following code to this, i know you'll be tempted but don't:
// {garbage code that looks good but performs horribly or has a weird bug}
{actual working code that looks whack but is better for reasons}

I've definitely done that one before. Probably after I tried to "fix" the offending line a couple times and made it worse.

Carthag Tuek
Oct 15, 2005

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



gonadic io posted:

It doesn't have to compile, just parse

oh yeah

brap
Aug 23, 2004

Grimey Drawer

ThePeavstenator posted:

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

*points at docker* "monad"

FlapYoJacks
Feb 12, 2009

Aramoro posted:

Jenkins + Sonarqube is what we're using just now but due to an SVN server no one wants to own we're stuck analysing the release branch only. We're planning a move to GIT but trying to get agreement on 1) how much history to truncate and 2) who is going to own it this time.

Who cares? SVN2GIT is a thing. Copy all the history.

ComradeCosmobot
Dec 4, 2004

USPOL July

ratbert90 posted:

Who cares?

Ask ESR

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.


gonadic io posted:

It doesn't have to compile, just parse


even then it's not trivial, macros and defines can be pretty arbitrary

maybe it's okay for a quick pass with a simple parser though, false positives are much worse than false negatives for that anyway

I might put something like that in our git hook

Carthag Tuek
Oct 15, 2005

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



even better: just delete all comments that arent in the language-appropriate documentation format

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
use machine learning and train an agent on a large corpus of code in your language and non-code comments

Carthag Tuek
Oct 15, 2005

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



Krankenstyle posted:

even better: just delete all comments that arent in the language-appropriate documentation format

im actually starting to like this idea unironically

dick traceroute
Feb 24, 2010

Open the pod bay doors, Hal.
Grimey Drawer
I had to leave a comment once saying
// Don't put this transaction in a using block... It gets reassigned in a method below

Still there iirc

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
on one of my work projects:

code:
$ grep -R -i "dumb as hell" * | wc -l
28

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 about comment parse chat:

you said c++ so I'm assuming you know that you can use clang's libraries to parse C++ and grab comment blocks, right? you can even find out where comments are attached (a function, a line in a function, etc).

Aramoro
Jun 1, 2012




ratbert90 posted:

Who cares? SVN2GIT is a thing. Copy all the history.

SVN2GIT shits itself trying to import the whole repo. The repo is about 15gb, 65k commits. It works if we truncate part of the history and don't take tags, we just need to decide where to cut it.

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe
sounds like you need ESR to hurry up

Plorkyeran
Mar 22, 2007

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

CRIP EATIN BREAD posted:

also about comment parse chat:

you said c++ so I'm assuming you know that you can use clang's libraries to parse C++ and grab comment blocks, right? you can even find out where comments are attached (a function, a line in a function, etc).

merely finding comments is the easy part. c++'s grammar may be a mess but it's not that much of a mess. the hard part is then deciding if a comment is allowed or not

Share Bear
Apr 27, 2004

this thread really got me into checking out rust

i have not read such a pleasant intro book to a programming language ever, they actually thought about getting people to use it but not in a weird placating monkey cheese way

really nice (only on chap 3 but still)

gonadic io
Feb 16, 2011

>>=

Share Bear posted:

this thread really got me into checking out rust

i have not read such a pleasant intro book to a programming language ever, they actually thought about getting people to use it but not in a weird placating monkey cheese way

really nice (only on chap 3 but still)

i did a little utility in rust at work today and i think i scared my coworker away from it. i was parsing string from a file, putting them in a hash map, and using them as keys in an adjacency list graph and was nothing but borrow errors and shoving cloned() in places :(

i probably should have just used Rc from the get go

Corla Plankun
May 8, 2007

improve the lives of everyone

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've run into this problem before and went and found a better visualization thingy only to realize upon inspection that more than like 1k lines is just garbage salad and pointless to visualize in the first place unless it is an extremely nicely structured graph

definitely do the latter thing

Share Bear
Apr 27, 2004

gonadic io posted:

i did a little utility in rust at work today and i think i scared my coworker away from it. i was parsing string from a file, putting them in a hash map, and using them as keys in an adjacency list graph and was nothing but borrow errors and shoving cloned() in places :(

i probably should have just used Rc from the get go

that's chapter 4

FlapYoJacks
Feb 12, 2009
Now that the deal is finalized I can actually talk about it.

My company was bought by Shell.

gonadic io
Feb 16, 2011

>>=

ratbert90 posted:

Now that the deal is finalized I can actually talk about it.

My company was bought by Shell.

yu got your $150.00?

FlapYoJacks
Feb 12, 2009

gonadic io posted:

yu got your $150.00?

I made a bit less than $350,000

Powerful Two-Hander
Mar 10, 2004

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


that's uh, pretty good for someone that iirc did an actual irl "cya poo poo lords" on their previous job like what, 9 months ago? Nice one.

edit: buy a text book on, idk, management or something and mail it to your old boss

gonadic io
Feb 16, 2011

>>=
yeah i hope you up your contracting rates accordingly given that you're worth >1.2k/day

e: wait i think my math is wrong

gonadic io fucked around with this message at 01:44 on Jan 30, 2019

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Aramoro posted:

SVN2GIT shits itself trying to import the whole repo. The repo is about 15gb, 65k commits. It works if we truncate part of the history and don't take tags, we just need to decide where to cut it.

ooc, is that 15gb just the trunk, or all of trunk/tags/branches?

Also, tags are completely different in git than they are in svn (from what I remember of svn) so you may not even need/want those.

FlapYoJacks
Feb 12, 2009
I’m drinking an old fashion on the company dime right now. Life is good gents.

Shaggar
Apr 26, 2006

ratbert90 posted:

I made a bit less than $350,000

nice. also I don't make enough money

Share Bear
Apr 27, 2004

Shaggar posted:

nice. also I don't make enough money

move away from maine, realize why people like bikes bitch

FlapYoJacks
Feb 12, 2009

Powerful Two-Hander posted:

that's uh, pretty good for someone that iirc did an actual irl "cya poo poo lords" on their previous job like what, 9 months ago? Nice one.

edit: buy a text book on, idk, management or something and mail it to your old boss

Yeah, but I had worked here 5 years ago and the CEO likes me.

My boss has had 3 old fashions and now we are about to toast. I left Michigan this morning with 18F weather for this. 70F and sunny. Cheers mates.



redleader
Aug 18, 2005

Engage according to operational parameters

ratbert90 posted:

Now that the deal is finalized I can actually talk about it.

My company was bought by Shell.

grats on destroying the environment and public health for figgies i guess

but gently caress, that's some decent figgies. i'd compromise my principles for that sort of cash

FlapYoJacks
Feb 12, 2009

redleader posted:

grats on destroying the environment and public health for figgies i guess

but gently caress, that's some decent figgies. i'd compromise my principles for that sort of cash

They want EV chargers at every gas station. My company is at least trying to help the environment.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

so my OS has to dump from protected mode to VIRTUAL 8086 MODE in order to make interrupt calls

all interrupts in VIRTUAL 8086 MODE result in GPFs, which I have to handle with a supervisor program

the supervisor fucks with the stack frame to emulate an interrupt call, then RETs into the BIOS' interrupt handler

and then certain privileged instructions which the BIOS calls also result in GPFs and have to be emulated by the supervisor

this is fun I'm definitely not cursing intel at all times

VikingofRock
Aug 24, 2008




Congrats ratbert90 on becoming a YOSPOS success story and living the dream :cheers:

Adbot
ADBOT LOVES YOU

Doom Mathematic
Sep 2, 2008

ratbert90 posted:

I made a bit less than $350,000

Ah, the coveted six and a half figgies?

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