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
FAT32 SHAMER
Aug 16, 2012



Does anyone have some tips for saving jUnit test results to a CSV? Our clients want failed tests to be written to a CSV and so far the only solutions seem to come from Apache Ant, which doesnt work with Android Studio.

Adbot
ADBOT LOVES YOU

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

nielsm posted:

You have to work with mathematical points and lines (i.e. infinitely small/thin) for the usual odd/even rules to work, they can't really work in pixel land as you've realized.

Depending on the size of your shapes, the best may be to pre-process them a bit with a flood fill algorithm, using 4 colors: Indeterminate, Outline, Inside, Outside. Initially your bitmap would consist of only "indeterminate" and "outline" pixels. Then iterate over pixels: When you hit an indeterminate pixel, if any neighboring pixel is outside the bitmap or is colored "outside", color this pixel "outside", otherwise color it "inside". Leave outline pixels untouched.
With your processed bitmap, it's easy to do a hit-check for inside/outside/outline.

I think that should work, I only came up with it right now so it's untested :)

That doesn't solve it at all. You need to know where to start your "inside the shape" fill from, which requires you to have an algorithm that tells you whether an individual pixel is inside or outside the shape.

leper khan posted:

The outside edge of the texture will only ever be outside or an edge.

This really isn't a well defined problem. Do you allow non simply connected shapes? "Holes" I think someone else called them. Do you allow non-connected shapes? If you allow the edge of the canvas to define regions as well, sides are bistable. In the image below, given only the boundary how do you know whether the black regions or the white regions are "in"?

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

KernelSlanders posted:

That doesn't solve it at all. You need to know where to start your "inside the shape" fill from, which requires you to have an algorithm that tells you whether an individual pixel is inside or outside the shape.

How come? It's just recursively flooding to find a path to the limits of the image - any pixel inside the shape will only be connected to other 'inside' pixels or walls, so eventually the algorithm will resolve that - same for the outside ones

(limited to that described situation where 'outside' touches the edges of the bitmap of course)

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

what about something like this - start at the top left, flood outwards with some colour until you've marked every pixel that's not a wall. Scan along each row until you find another 'empty' pixel, and do it again with a new colour

Each time you flood you can keep track of some statistics for that colour's region - which sides it touches, whether every pixel touches a wall, that kind of thing. You could scan for wall pixels when you're done, check which colours are in their neighbouring pixels, and that way you can determine which regions border each other

I mean yeah it really depends exactly what you're doing and how you'd answer KernelSlanders's questions up there, but you could probably build up some useful stats to start categorising things, working out if a region is surrounded etc

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

Tea Bone posted:

I have an outline of a shape on a grid. I need to tell if any point on that grid is inside or outside that outline. My initial plan was to move right along the x-axis from that point and count how many times the x-axis crosses the outline. If it crosses an odd number of times it’s inside the outline, if it’s even the point is outside.

That works fine for point A. it cross once (At point D) so it must be inside. It also works fine for point B, it crosses the grid at twice (points E and D) so it must be outside.

The problem is when the point is inline with the edge of the outline. Point C, crosses the line 3 times (F, E and D) but is actually outside the shape.

Does anyone have any ideas how to get this to work? I'm open to using a different algorithm if I need to.



KernelSlanders posted:

That doesn't solve it at all. You need to know where to start your "inside the shape" fill from, which requires you to have an algorithm that tells you whether an individual pixel is inside or outside the shape.


This really isn't a well defined problem. Do you allow non simply connected shapes? "Holes" I think someone else called them. Do you allow non-connected shapes? If you allow the edge of the canvas to define regions as well, sides are bistable. In the image below, given only the boundary how do you know whether the black regions or the white regions are "in"?



You misread the problem. You are given an outline, not blobs.

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

leper khan posted:

You misread the problem. You are given an outline, not blobs.

The "blobs" are filled outlines. My point was that the outline was not specified to be a simple closed curve that does not touch the edge. You assumed that. In fact, he suggested that it could touch the edge. If so the outline defines two spaces, and which one is "in" and which one is "out" is not defined in the general case.

nielsm
Jun 1, 2009



baka kaba posted:

How come? It's just recursively flooding to find a path to the limits of the image - any pixel inside the shape will only be connected to other 'inside' pixels or walls, so eventually the algorithm will resolve that - same for the outside ones

(limited to that described situation where 'outside' touches the edges of the bitmap of course)

True, there are many cases with my algorithm where you have to fix up already inside-painted pixels, specifically pixels covered by some concave shapes and other "shadowing".


Red = inside, green = outside. Other colors are areas that have been colored "inside" but should have been "outside".

This is filled with a simple single iteration from top left, across rows in the outer loop. This means only pixels above and to the left can already be colored "outside".

The purple area has rows that start with an outline to the left and above, so they would initially seem to be inside pixels. But later pixels in the row have outside pixels above, so they get fixed there.
The orange area also has rows starting with outline to the left and above, but they never hit another outside pixel.

Those two cases can be solved with some simple special casing, but you can make shapes like this that will probably require a full flood-fill algorithm:


Overall, if you can solve it at vector level rather than pixel level, it's much cleaner there.

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy
At first I thought you could just use a state machine

INSIDE points to itself for white and points to INBORDER for the border color, then INBORDER points to itself for border color and to OUTSIDE for white, and then OUTSIDE points to itself or OUTBORDER which points to itself or INSIDE.

Actually you could have a border go one pixel up and back down and you'd be back inside ___—___ so I guess you do have to fill it

nielsm
Jun 1, 2009



Well I couldn't leave it be so I went ahead and wrote a lovely implementation.

C# WPF app source



This one makes a new call on the stack for every pixel getting backfilled, so it can easily get unwieldy I think. It gets mitigated by it actually using iterators but if you removed that part (only done to support animating the process) you'd quickly end up with stack pains. Various flood filling strategies should be implemented in a less stack-hungry way, e.g. "fill upwards until a border pixel is hit", "fill left until a border pixel is hit", etc.


Edit: Well, after some sleep I had to improve on it, and write a version without (syntactical) recursion. Updated code

nielsm fucked around with this message at 10:27 on Jun 7, 2017

Tea Bone
Feb 18, 2011

I'm going for gasps.
Thanks every one. Like I said before this isn't really for anything in particular I was just messing around with something I thought would be fairly straight forward but turned out to be more complex than I expected. To answer the question about dealing with holes, I hadn't really considered that, but I guess once I could just outline both shapes (the shape itself and the hole) then once I've 'filled' each, just inverse any shape that's inside another?

5TonsOfFlax
Aug 31, 2001
Your original intuition was pretty good. The problem with that corner is resolved if you decompose the shape into separate line segments, and test for crossing against each of those. Then, it will hit that corner twice, and your even-odd algorithm will work. You may also want to consider the non-zero winding rule. There's really only a difference for self-intersecting shapes.

https://en.wikipedia.org/wiki/Nonzero-rule

man in the eyeball hat
Dec 23, 2006

Capture the opening of the portal that connects this earth of 3D to one earth of 4D or 5D. Going to the 5D.

Any recommendations for a nice Python library to do simple 3D visualizations that I can move the viewport around in?

I need to be able to place vertices (in code, I'll read the vertices in), group vertices together to form a surface, and render these surfaces (solid color is fine). I will have multiple, disconnected surfaces. It'd be good to have the ability to manipulate the rendering viewport so I can check dimensions of surfaces/objects and whatnot. If I can toggle a wire frame mode, that'd be a big plus too.

I did this about a year ago with some OpenGL based package and proceeded to throw the code away because "Hey that was easy enough I'll not need this later." and then forgot what library I used.

dead gay comedy forums
Oct 21, 2011


CS newbie here, coding a rock-paper-scissors game for all the learning fun that it entails

so I am having a bit of trouble with a print statement that is not going for me - the endstate for a player win does not print for some reason that I can't figure it out (apologies for the conditional spaghetti, I am sure that there are more elegant solutions but hey I am learning the ropes):

Python code:
import random

def rockpaperscissors():

#number of matches
    numRounds = int(input("How many rounds do you wish to go? "))
    n = 0
    while n < numRounds:
        n = n + 1
        main()

def main():

#user input
    userRPS = str(input("Rock, paper or scissors? (type R/P/S) "))

    if userRPS == "R":
        print("You choose rock!")
        print()
    elif userRPS == "P":
        print("You choose paper!")
        print()
    elif userRPS == "S":
        print("You choose scissors!")
        print()

#computer choice
    computerRPS = random.randint(1,3)

    if computerRPS == 1:
        print("Computer chooses rock!")
        print()
    elif computerRPS == 2:
        print("Computer chooses paper!")
        print()
    elif computerRPS == 3:
        print("Computer chooses scissors!")
        print()

#endstate: tie
    if userRPS == computerRPS:
        print("it is a tie!")
        print()

#endstate: computer wins
    elif userRPS == "R":
        if computerRPS == 2:
            print("You lose! Paper covers rock!")
            print()
    elif userRPS == "P":
        if computerRPS == 3:
            print("You lose! Scissors cuts paper!")
            print()
    elif userRPS == "S":
        if computerRPS == 1:
            print("You lose! Rock smashes scissors!")
            print()
    
#endstate: player wins
    elif userRPS == "R":
        if computerRPS == 3:
            print("You win! Rock crushes scissors!")
    elif userRPS == "P":
        if computerRPS == 1:
            print("You win! Paper covers rock!")
    elif userRPS == "S":
        if computerRPS == 2:
            print("You win! Scissors cut paper!")


#invalid input
    else:
        print("Not a valid play. Try again!")
        print()

rockpaperscissors()
input()

So what happens is that when the player wins the round the victory message doesn't show up, while if the computer wins or the game ties, it doesn't show anything. I am suspecting it has something to do with my use of two different functions, but I have no idea at all.

many thanks in advance!

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

dead comedy forums posted:

So what happens is that when the player wins the round the victory message doesn't show up, while if the computer wins or the game ties, it doesn't show anything. I am suspecting it has something to do with my use of two different functions, but I have no idea at all.

many thanks in advance!

You have a big if-elif-elif-elif-...-else block controlling most of your logic. Python will seek through that block until it finds the first conditional that passes, and it will ignore the others. Your tests for "computer wins" are therefore overshadowing your tests for "player wins" -- Python sees the first "user chose "R"" block and ignores the second one.

You should be using "and" statements here instead:
code:
if userRPS == "R" and computerRPS == 1:
  ...
elif userRPS == "S" and computerRPS == 1:
  ...
Also, the fact that userRPS is a string while computerRPS is a number means that your "it is a tie" statement will never be printed.

dead gay comedy forums
Oct 21, 2011


aha, fantastic - I was trying to make a program like to train conditional work exactly because of stuff like that :)

thanks again!

huhu
Feb 24, 2006
I am trying to round out my self taught education. I have a degree in mechanical engineering so I five semester of Calculus, 2 Intro to Programming classes, and Linear Algebra from that. I'm just wrapping up a data structures and algorithms course. I have several years experience with Python using it on everything from the Raspberry Pi, to building websites, to writing scripts to automate processes. I've programmed Arduino Micro Controllers with C++. I've built websites with HTML, CSS, JS, and associated libraries on the front end. For the back end I've done Flask, Django, WordPress, and MySQL. I also have knowledge of random stuff that fits into all these things like using GIT, JIRA, the command line, Linux OS, etc. Are there any glaring holes in my education that I should be focusing on now? Two gaps I've identified are a lack of a lower level language like C++ or Java and phone apps. Beyond that I'm not really sure. I poked around a university syllabus and nothing immediately jumped out at me.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

huhu posted:

I am trying to round out my self taught education. I have a degree in mechanical engineering so I five semester of Calculus, 2 Intro to Programming classes, and Linear Algebra from that. I'm just wrapping up a data structures and algorithms course. I have several years experience with Python using it on everything from the Raspberry Pi, to building websites, to writing scripts to automate processes. I've programmed Arduino Micro Controllers with C++. I've built websites with HTML, CSS, JS, and associated libraries on the front end. For the back end I've done Flask, Django, WordPress, and MySQL. I also have knowledge of random stuff that fits into all these things like using GIT, JIRA, the command line, Linux OS, etc. Are there any glaring holes in my education that I should be focusing on now? Two gaps I've identified are a lack of a lower level language like C++ or Java and phone apps. Beyond that I'm not really sure. I poked around a university syllabus and nothing immediately jumped out at me.

Ehh, it really depends on what the point of your education is.

FAT32 SHAMER
Aug 16, 2012



Big Data and Artificial intelligence courses may interest you, as well as mechatronics (though some schools have that as a mech/electric eng thing or as a mech/compsci thing)

huhu
Feb 24, 2006

Thermopyle posted:

Ehh, it really depends on what the point of your education is.
To have my self study be more or less equal to what a new grad would know.

funny Star Wars parody posted:

Big Data and Artificial intelligence courses may interest you, as well as mechatronics (though some schools have that as a mech/electric eng thing or as a mech/compsci thing)

Added those to my list, thanks.

Star War Sex Parrot
Oct 2, 2003

huhu posted:

To have my self study be more or less equal to what a new grad would know.
New grad in what? Computer science? Software engineering? Computer engineering? Topics will be different for those even from school to school. There are tons of computing topics out there and making some sort of checklist to hit them all seems like an odd approach to me. If you're just surveying to find what you like, then yeah go nuts. At some point though you should probably specialize. My background is both CS and CpE which was broad but still "missed" a lot of things. For reference, some of my upper division courses were: computer architecture, an HDL (Verilog/VHDL) lab, operating systems, embedded software, artificial intelligence, machine vision, algorithms, digital signal processing, computational photography, networks, and compilers. I still didn't have enough time to hit what some people might consider "important" courses like databases, web development, machine learning, etc.

If you're looking for low-level stuff, I'd argue that the most interesting and challenging courses for those are operating systems and compilers. Those might require a bit of background in C or C++ first, and maybe familiarity with EBNF and other formal language topics.

Star War Sex Parrot fucked around with this message at 23:00 on Jun 8, 2017

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

huhu posted:

To have my self study be more or less equal to what a new grad would know.

As the parrot mentions, this doesn't exactly narrow it down. Also, why? A lot of it will be just useless for a lot of purposes.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
A good course on formal languages and theory of computation is essential. It's a broad and abstract topic, and students often hate it, but it will absolutely *hone* your programming instincts. You should cover finite automata, context free grammars, Turing machines, P v NP, complexity, and a few of the more important proofs.

A course on operating systems. Also a broad topic, but very concrete. When I took it we learned a lot about threads and IPC, these days you may end up
covering distributed computing.

A hardware course. Learn about microchips, play with logic gates, program in a RISC assembler.

I'd also recommend a survey of programming languages. Seven Languages In Seven Weeks is a fun book. If you go it on your own, do Smalltalk, Prolog, Scheme, and Io. (Io isn't important, it's just weird and fun.)

After that most students take a couple deep-dive topic courses to round themselves out. Like AI, Databases, compilers, etc.

JawnV6
Jul 4, 2004

So hot ...

lifg posted:

A good course on formal languages and theory of computation is essential. It's a broad and abstract topic, and students often hate it, but it will absolutely *hone* your programming instincts. You should cover finite automata, context free grammars, Turing machines, P v NP, complexity, and a few of the more important proofs.

A course on operating systems. Also a broad topic, but very concrete. When I took it we learned a lot about threads and IPC, these days you may end up
covering distributed computing.

A hardware course. Learn about microchips, play with logic gates, program in a RISC assembler.
Still not understanding the goal here, because for certain values of "new grad" folks proficient in any two of these could have fantastic careers without knowing a lick about the third.

Do you want a *JOB* as a computer toucher? Because it's legitimately interesting or because CE salaries look fatter than ME's on glassdoor?

lifg
Dec 4, 2000
<this tag left blank>
Muldoon

JawnV6 posted:

Still not understanding the goal here, because for certain values of "new grad" folks proficient in any two of these could have fantastic careers without knowing a lick about the third.

Do you want a *JOB* as a computer toucher? Because it's legitimately interesting or because CE salaries look fatter than ME's on glassdoor?

The person asked what more they needed to match a traditional education, and their background suggested programing. I gave some pretty standard topics they're missing in that regard, ones that provide a solid and broad foundation for any future in programming they decide on.

I mean, you don't need *any* education to have a career in programming. But if you want a long and successful one, one where you're able to easily adapt to changing technologies and interests, you owe it to yourself to get some foundational learning in.

FAT32 SHAMER
Aug 16, 2012



Another thing to note is you can take all the classes you want but you're still going to be as dumb as a CS student straight out of uni unless you get an internship or job where you actually touch the computers in a business setting

I did my internship in system management before deciding it wasn't for me and it took a year and a dozen interviews to get into a position where I work with code every day because I had no non-scholastic experience with coding

FAT32 SHAMER
Aug 16, 2012



We just had a guy join our team with a masters in CompSci and the idiot left after a week and a half because he didn't know what he was doing and felt that his assigned project was too low level for him

His project was writing Squish test cases in Java

huhu
Feb 24, 2006
Thanks for all the feedback. My original motivation for asking that question is because a few months back I learned the basics of big O notation and realized that all the code I'd written up to that point was garbage. Lots of nested for loops and things like that. I was curious if there was anything else similarly important to learn about that was obviously missing from my study. I managed to land a job as a bioinformatics software engineer building tools for scientists with Python, Flasks, MySQL, and JS but it's only a 6 month contract and I'm trying to round out my skills so that I'm competitive in 4 months when it ends.

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

lifg posted:

A good course on formal languages and theory of computation is essential. It's a broad and abstract topic, and students often hate it, but it will absolutely *hone* your programming instincts. You should cover finite automata, context free grammars, Turing machines, P v NP, complexity, and a few of the more important proofs.
I did 8 years of grad work in philosophy and work as a software developer now, and I can tell you the course I took on computability and proof theory is absolutely crucial to my career, in really quite shocking, hard to explain ways.

We didn't do a single thing with code and I had no desire to learn to code when I took the class.

Star War Sex Parrot
Oct 2, 2003

huhu posted:

Thanks for all the feedback. My original motivation for asking that question is because a few months back I learned the basics of big O notation and realized that all the code I'd written up to that point was garbage. Lots of nested for loops and things like that. I was curious if there was anything else similarly important to learn about that was obviously missing from my study.
I highly recommend the textbook Computer Systems: A Programmer's Perspective if you want exposure to systems topics. For example, you'll understand why two algorithms that accomplish the same task with the same time complexity can take wildly different amounts of CPU time. For example (this is from that course's slides), these two functions do the same thing but have noticeably different runtimes. All that's different from a code standpoint is the order of the iteration for the two index variables:



Granted the former is convention for nested loops anyway, but it reinforces the point that the performance discussion in computing doesn't end at Big O. Topics like these are subtle but extremely important to certain applications. Here's the book's preface and table of contents if you want to glance at the topics it covers. If you do the projects for the textbook/course from the website, you'll learn a lot about low level bit fiddling, GDB for debugging, basic rules for avoiding security vulnerabilities in C, and how C memory allocators work. If that's not interesting to you, then don't worry about it.

I think it's a very approachable introduction to systems stuff from a software perspective (as the title indicates). It's a keeper on my bookshelf for sure.

Star War Sex Parrot fucked around with this message at 04:22 on Jun 9, 2017

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


The core classes in an undergraduate computer science degree are those on analysis of algorithms, computer architecture, computability and complexity, and something that deals with large software systems (generally an OS class). As prerequisites to those, you'll usually take an introduction to programming, an introduction to software design, a basic discrete math class, and an introduction to algorithms and data structures. Look at the CS department webpage at your favorite big state school and you'll be able to find outlines of the major as well as some representative syllabi.

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.
That's why you use memcpy.

Star War Sex Parrot
Oct 2, 2003

KernelSlanders posted:

That's why you use memcpy.
No poo poo. It's not arguing that it's the correct way to copy memory from one array to another. It's illustrating that how you access memory matters which programmers with a poor systems background may not understand.

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

Star War Sex Parrot posted:

No poo poo. It's not arguing that it's the correct way to copy memory from one array to another. It's illustrating that how you access memory matters which programmers with a poor systems background may not understand.

Oh, I wasn't disagreeing. You're right of course. I was trying to take the argument one step further. Fundamental libraries are built by people who have spent a career understanding those system level issues, and neither a naive row-first nor column-first approach is going to do better than what they put together.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

Star War Sex Parrot posted:

I highly recommend the textbook Computer Systems: A Programmer's Perspective if you want exposure to systems topics. For example, you'll understand why two algorithms that accomplish the same task with the same time complexity can take wildly different amounts of CPU time. For example (this is from that course's slides), these two functions do the same thing but have noticeably different runtimes. All that's different from a code standpoint is the order of the iteration for the two index variables:



Granted the former is convention for nested loops anyway, but it reinforces the point that the performance discussion in computing doesn't end at Big O. Topics like these are subtle but extremely important to certain applications. Here's the book's preface and table of contents if you want to glance at the topics it covers. If you do the projects for the textbook/course from the website, you'll learn a lot about low level bit fiddling, GDB for debugging, basic rules for avoiding security vulnerabilities in C, and how C memory allocators work. If that's not interesting to you, then don't worry about it.

I think it's a very approachable introduction to systems stuff from a software perspective (as the title indicates). It's a keeper on my bookshelf for sure.

So what's the reason there? The j arrays are stored in a one after another, so (i,j) is just incrementing the pointer, but (j,i) means you're running around in circles?

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

dupersaurus posted:

So what's the reason there? The j arrays are stored in a one after another, so (i,j) is just incrementing the pointer, but (j,i) means you're running around in circles?

https://stackoverflow.com/questions/8547778/why-are-elementwise-additions-much-faster-in-separate-loops-than-in-a-combined-l/8547993#8547993

https://stackoverflow.com/questions/12264970/why-is-my-program-slow-when-looping-over-exactly-8192-elements/12265928#12265928

https://stackoverflow.com/questions/11413855/why-is-transposing-a-matrix-of-512x512-much-slower-than-transposing-a-matrix-of

nielsm
Jun 1, 2009



dupersaurus posted:

So what's the reason there? The j arrays are stored in a one after another, so (i,j) is just incrementing the pointer, but (j,i) means you're running around in circles?

Has to do with the CPU cache behavior.

In the faster one, memory is accessed sequentially, which allows the cache to work as intended and lets the CPU speculatively prefetch memory into the cache before it gets hit. In the slower, memory is accessed in 8192 (or 16384) byte jumps, which the CPU cache can't help with at all.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Anyone have experience with https://www.codacy.com/ ? I'm trying to figure out what it does over and above, eg, a private Git repo or JIRA or whatever and I'm not getting much from reading their site.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Munkeymon posted:

Anyone have experience with https://www.codacy.com/ ? I'm trying to figure out what it does over and above, eg, a private Git repo or JIRA or whatever and I'm not getting much from reading their site.

Save time in code reviews by outsourcing the code review of common security concerns, code style violations, best practices, code coverage and other metrics to Codacy.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Bob Morales posted:

Save time in code reviews by outsourcing the code review of common security concerns, code style violations, best practices, code coverage and other metrics to Codacy.

So I'm not missing anything and it's an expensive linter with an overdone UI?

Adbot
ADBOT LOVES YOU

FAT32 SHAMER
Aug 16, 2012



Can someone explain linting to me like I'm five? For some reason I thought linting was making keywords a certain colour in your IDE but based on the big words wikipedia says about it, it's more about fixing your code?

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