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
KillHour
Oct 28, 2007


A Festivus Miracle posted:

Additional quiz question:

how many red triangles does the following code draw?

0,1,2,3?

I'm fairly certain this wouldn't draw any because it has a syntax error. ASSUMING the syntax error was fixed, this still wouldn't draw any triangles because num is never declared before it's used?

This is a pretty terrible question assuming it doesn't give any additional context, but I would say the answer is at most 2.

First, never assume a piece of code has an intentional syntax error unless that is one of the answers. The point of the test is almost certainly to focus on the logic.

Second, we don't know what code is calling the function, but that code could only ever draw a red rectangle if it was called with `g("red", 7)`.

A rectangle isn't a triangle, so you could argue that the answer is 0. And even though most geometry is rendered with triangles, you don't actually know how it works under the hood to make that assumption. And even if you could, you don't know for sure how many it's using. But let's ASSUME a rectangle is composed of 2 triangles, because that's the kind of thing a compsci 101 professor would do.

So if that code was called with `g("red", 7)`, it would result in a rect composed of two red triangles being drawn. If it is called with anything else, there would be no red triangles unless you passed in something like `g("0xFF0000", 0)`. :v:

It's a bad question.

KillHour fucked around with this message at 21:39 on Mar 13, 2024

Adbot
ADBOT LOVES YOU

mystes
May 31, 2006

If this is a college class this might be a good time to try to transfer to another section where the professor isn't an idiot if possible, before you get more quiz/test questions that are bizarre/nonsensical and/or have incorrect answers

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!


e:f,b, and, I didn't even notice the triangle/rectangle inconsistency

Dijkstracula fucked around with this message at 21:43 on Mar 13, 2024

Mind_Taker
May 7, 2007



It's a bad question but if it's multiple choice I'd say 0 red triangles because it's only drawing rectangles

Mind_Taker fucked around with this message at 21:42 on Mar 13, 2024

A Festivus Miracle
Dec 19, 2012

I have come to discourse on the profound inequities of the American political system.

mystes posted:

If this is a college class this might be a good time to try to transfer to another section where the professor isn't an idiot if possible, before you get more quiz/test questions that are bizarre/nonsensical and/or have incorrect answers

Oh my lord in heaven, you have no idea. This professor is awful. I thought I was just really bad at programming until I looked at her rate my professor and it's just a trail of 1.0s that goes on for pages with everyone universally agreeing she sucks. It's the middle of the semester. I'm stuck with this. :shepicide:

KillHour
Oct 28, 2007


I just realized that if you pass in `g("red", 7)`, the code as written will draw a red rectangle and then immediately draw a black rectangle in the same place, covering the red rectangle (assuming the rect function uses the painters algorithm). So the answer is definitely 0. Probably. Maybe. gently caress, I don't know.

Good lord, what a terrible question.

KillHour
Oct 28, 2007


A Festivus Miracle posted:

Oh my lord in heaven, you have no idea. This professor is awful. I thought I was just really bad at programming until I looked at her rate my professor and it's just a trail of 1.0s that goes on for pages with everyone universally agreeing she sucks. It's the middle of the semester. I'm stuck with this. :shepicide:

I would point out the issues to the teacher and if they don't issue a correction, go to the department head with that quiz and be like "what the gently caress".

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I had a teacher for a differential equations course once who was dreadful. Pretty much every lecture followed the same pattern. The first half of the lecture would be her more or less competently explaining the solution to a problem she had failed to answer in the previous lecture. The second half would be her moving on to the next problem she wanted to cover, and either failing to recall how it was supposed to be solved, failing to get the right answer, or coming unstuck because the statement of the problem would be wrong or misleading. She would then spend some time shuffling her papers in confusion, trying to work out in front of the whole class what the correct question and solution were meant to be, and end up promising to show the correct solution in the next class (which to be fair, she would do).

In the exam at the end of the course one of the questions asked the candidates to demonstrate that the solution to some problem or other was something specified in the question. I worked it out and got a different answer to what the paper asked for. I spent about 5 minutes puzzling over my working trying to find where it was wrong, before the invigilator made an announcement they had received from the teacher that there was a mistake in the exam paper and it should say the answer I had come up with. There was audible exasperation from all the candidates in the exam hall at the announcement.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
E: didn't realize I wasn't on the last page :saddowns:

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!
Reminder with the rectangle/triangle question, there's a difference between how many requests there are to perform a drawing action versus how many shapes appear on the result. In this case, all rectangle drawing commands fill the same region, so you can call f() a trillion times and you'll still only have a single rectangle. (But as written you have zero until g is called).

But triangles? Always zero since a triangle with base and height 100 necessarily has an irrational hypotenuse, which can't be drawn on a digitized medium. :11tea: (cf the student thread, since such a response will drive any instructor into an uncontrollable rage)


Does the question literally say "0, 1, 2, or 3"? They may be expecting "0 if g is never called, 1 for g(orange,2), 2 for ..."

JawnV6
Jul 4, 2004

So hot ...
it's obviously a trick question asking you to iterate over bresenham's

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
The answer is 2, because you should always just pick C for multiple choice if you don't know the actual answer. It's a safer bet.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Cs get degrees, after all

csammis
Aug 26, 2003

Mental Institution
Yeah the road to receiving my Cs degree was chock-full of C's

mystes
May 31, 2006

csammis posted:

Yeah the road to receiving my Cs degree was chock-full of C's
Well yeah it's in the name

repsnake
Sep 1, 2002

Post: the cereals you love the most

Dijkstracula posted:

Cs get degrees, after all

Until you hit grad school, then it's a B (not B-) average. You can get some C's but you'll need to offset them with A's. At least that's how it was in the made up business schools I attended. Comp sci. Might be different.

Anyhow, I have a C# question related to grad school. I'm thinking of revisiting C# again but in the previous 3 times I've done it for classes or whatever, it didn't seem like there was a great endgame for it as far as the language by itself. I remember I wrote programs to connect to SQL server to run queries and active directory to reset passwords, but it seems to me that the road leads inevitably to web app development and needing to know HTML/JavaScript/CSS/ASP.NET in addition.

So my question is that if I worked on C# in my spare time, what kind of useful things (not unity) could I do in say, a year? I need to start thinking about dissertations for business school (lower standards than comp sci PhDs) and need to do something applicable rather than theoretical. AI is obviously the low hanging fruit right now but I was hoping for something physical or related to the real world. I have a copy of VS2022 ENT, SQL server 2022 standard, server 2022, etc. and access to money and tools.

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

repsnake posted:

Until you hit grad school, then it's a B (not B-) average. You can get some C's but you'll need to offset them with A's. At least that's how it was in the made up business schools I attended. Comp sci. Might be different.

Anyhow, I have a C# question related to grad school. I'm thinking of revisiting C# again but in the previous 3 times I've done it for classes or whatever, it didn't seem like there was a great endgame for it as far as the language by itself. I remember I wrote programs to connect to SQL server to run queries and active directory to reset passwords, but it seems to me that the road leads inevitably to web app development and needing to know HTML/JavaScript/CSS/ASP.NET in addition.

So my question is that if I worked on C# in my spare time, what kind of useful things (not unity) could I do in say, a year? I need to start thinking about dissertations for business school (lower standards than comp sci PhDs) and need to do something applicable rather than theoretical. AI is obviously the low hanging fruit right now but I was hoping for something physical or related to the real world. I have a copy of VS2022 ENT, SQL server 2022 standard, server 2022, etc. and access to money and tools.

line of business applications in .NET

anything backend web dev in .NET

games in unity, stride, etc


what kind of useful software could you work on in java. its the same question. the answer is "a lot" to the point the question itself isnt that interesting.

what problem domains are you interested in working on? (apparently not games, but that leaves a lot on the table)

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

repsnake posted:

So my question is that if I worked on C# in my spare time, what kind of useful things (not unity) could I do in say, a year?

Godot supports C#, and supposedly Unreal Engine will soon :v:

But more seriously, the reason you see so much webapp stuff is because a huge proportion of software development effort is spent on webapps. I don't know the percentile breakdown, but I'd guess it's easily over 50% and certainly over 90% of the "visible" (i.e. non-B2B) work that software developers do these days. Every serious language is going to have a web stack, and that web stack is going to show up fairly frequently in discussions around the language. That doesn't mean that you have to do web in that language.

As for what specifically to do, in a year of work, you could probably do some reasonably useful data analysis program of some kind. Ingest a database of facts (stock prices, baseball stats, demographics, whatever), perform queries on that database according to user parameters, emit results of those queries. You can do it on the commandline if you want a zero-UI setup, and then if you need a UI, either build a desktop application, or go the webapp route.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

repsnake posted:

Until you hit grad school, then it's a B (not B-) average. You can get some C's but you'll need to offset them with A's. At least that's how it was in the made up business schools I attended. Comp sci. Might be different.
in CS grad school there's a minimum grade for a class to count towards your courseload but there's no overall GPA requirement, so, stack up those minimum passes! (edit: my gpa in grad school was a 4.0 though :smuggo: )

Agreed with the other posters: you're thinking about things backwards. As opposed to "what pieces of technology are the ones I should learn", start instead with "what do I want to create?" and work from there; I think you'll find that as a piece of tech the .NET stack will very likely suit your needs just fine.

Dijkstracula fucked around with this message at 15:56 on Mar 15, 2024

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Dijkstracula posted:

in CS grad school there's a minimum grade for a class to count towards your courseload but there's no overall GPA requirement, so, stack up those minimum passes! (edit: my gpa in grad school was a 4.0 though :smuggo: )

All the programs I've seen will boot your rear end if you get a second C. You had a GPA? How quaint.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

ultrafilter posted:

All the programs I've seen will boot your rear end if you get a second C. You had a GPA? How quaint.

in my program there seems to be only one way to get booted and that's if your advisor decides to make your life sufficiently unpleasant that that's the only remaining move to make

(not speaking of my experience or my advisor, to be clear, but I've seen the "marginally unproductive semester to funding pull to "hey I haven't seen so-and-so around"" pipeline in action and mannn :negative:)

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
In practice, if you’re getting C’s in grad school, you need to move on with your life. It’s not like there’s a ton of breadth requirements in grad school. In CS, they’re going to ask you to take Algorithms and show up to the colloquia, and basically everything else will be from your specialization. If you can’t get your poo poo together enough to pass classes in your own specialization, what are you even doing in grad school? There’s almost nothing in life that requires an advanced degree in CS; you’re doing this because you want to. Your motivation problems are not going to be any better once the classes are done with.

rjmccall fucked around with this message at 20:17 on Mar 15, 2024

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

counterpoint, which I don't necessarily agree with but one that I've heard advisors explicitly tell their students:

the only thing that matters in grad school is your research output, so the right play is to only take grad classes where the workload is trivial and put in only as much work as you have to in order to satisfy your degree requirements, in order to focus on getting papers out the door.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Depends on how seriously they take the qualifying exams. The university where I did my master's used those to weed out the PhD students so doing well in the classes related to them was very important.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Advisors definitely don’t want you to spend a ton of time taking interesting and engaging classes instead of working on research projects. The nice way to put this is that some students need to be broken out of the mental habit of just following a preset program and passively learning stuff. The rude way to put it is that some advisors think you’re only there to advance their research. Regardless, they don’t actually want you to slack off in your classes; they want you to get them over with.

KillHour
Oct 28, 2007


Academia has the same problem that toxic companies like Amazon/Tesla/etc. have - they know you're passionate about what you do, so they expect to be able to run you into the ground.

"You chose to be here so you need to put in 80 hours/week of effort for my benefit" is not an acceptable attitude for literally anything. Any field where it's expected that you give up having a life outside of that field, even temporarily, is inherently predatory.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Limping through grad school in CS sounds like a tremendous waste of time and money. It's just not a degree with a particularly good ROI if you already have a bachelor's in CS.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

I made the mistake of doing The Math vis a vis staying in industry a few months ago and realized that grad school has been a million dollar experiment for me

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dijkstracula posted:

I made the mistake of doing The Math vis a vis staying in industry a few months ago and realized that grad school has been a million dollar experiment for me

If you're paying a million dollars for grad school, they drat well better let you graduate with a C average!

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

(to be clear, this is opportunity cost vis a vis total comp from my previous Bay Area SWE job, but given the post-pandemic market bull run seems to be officially over maybe this will level out as I slouch closer to graduation :v: )

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.
I went to grad school for a masters in cs while working a full time job doing software test automation.

Three grad school classes at once and a full time computer-toucher job was a lot of hours a day of doing computer poo poo let me tell you.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
I've made a terrible mistake and started playing Sixty Four, (which I encourage no one else in this thread to do but that's aside the point,) and it got me to thinking about how to solve the question of "what is the most efficient way to place your machines so that they can crush blocks the fastest?"

The game is basically a Cookie Clicker esque game, with a 2D grid visualized in 2.5D, where you click blocks to break them apart. Over time, you can build new machines to place, which will make the blocks easier to break, or will click on them for you periodically, or will allow new blocks to appear more quickly, or will click on machines for you (but must in turn themselves be periodically clicked manually), etc detc. The price in blocks for each machine increases exponentially, meaning that you can only place so many of each type before they become too expensive. So, you will need to balance the space to fit these machines, the cost for each new instance of a specific machine type, the opportunity cost if it is placed on a spot a block could be placed (each Block Pump makes a 3x3 grid centered on itself, but can be upgrade to 5x5). Additionally, if you can expand this to take advantage of adjacent block pump placement, that's great (e.g. placing a block breaker on an edge, so that it will break both your blocks and a neighbor's blocks).

I'm just a simple software engineer, formal proofs confuse and frighten me. This doesn't seem like the knapsack problem, or bin packing. Maybe chip placement? This feels like an NP or worse problem, but I don't know specifically what kind of problem, or how I would go about trying to solve it aside from graph paper and saying "hmm" a lot. I would appreciate suggestions on where to look towards for an answer.

e: For a more constrained subproblem, I have four machines: Converter A, Converter B, Catalyzer C, and Power P. These machines are placed on a 2D grid. C and P interact with machines that are directly adjacent in the 8 grid directions.
  • A, B, and C all need power from P to run. Only powering A and C is important, so they must have at least one P directly adjacent to them (up, down, left, right, diagonal). Powering B is optional.
  • C will improve the speed of machines A and B, by a multiple of how many converters (A or B) are adjacent to that converter. Multiple converters will all contribute to all directly adjacent converters.
  • As above, the price increase for machines is exponential, so let us say that I can only afford to place 9 instances of A

I've come up with a layout that looks like this:
pre:
BBPBBBPBB
BCCCCCCCB
BPABAPABB
BCCCCCCCB
BBAPABAPB
BCCCCCCCB
BBPBBBPBB

Volmarias fucked around with this message at 19:21 on Mar 16, 2024

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Volmarias posted:

I've made a terrible mistake and started playing Sixty Four, (which I encourage no one else in this thread to do but that's aside the point,) and it got me to thinking about how to solve the question of "what is the most efficient way to place your machines so that they can crush blocks the fastest?"

The game is basically a Cookie Clicker esque game, with a 2D grid visualized in 2.5D, where you click blocks to break them apart. Over time, you can build new machines to place, which will make the blocks easier to break, or will click on them for you periodically, or will allow new blocks to appear more quickly, or will click on machines for you (but must in turn themselves be periodically clicked manually), etc etc. The price in blocks for each machine increases exponentially, meaning that you can only place so many of each type before they become too expensive. So, you will need to balance the space to fit these machines, the cost for each new instance of a specific machine type, the opportunity cost if it is placed on a spot a block could be placed (each Block Pump makes a 3x3 grid centered on itself, but can be upgrade to 5x5).

I'm just a simple software engineer, formal proofs confuse and frighten me. This doesn't seem like the knapsack problem, or bin packing. Maybe chip placement? This feels like an NP or worse problem, but I don't know specifically what kind of problem, or how I would go about trying to solve it aside from graph paper and saying "hmm" a lot. I would appreciate suggestions on where to look towards for an answer.

This sounds like it can be formulated as a zero one integer program but it's not entirely obvious that the size of the resulting problem is polynomial in the input size. I wouldn't be surprised if it is, in which case you're looking at something that's NP-complete at worst. For small instances it'd probably be tractable and there are good enough off-the-shelf solvers that it's a worthwhile approach.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


It's fine to go to college just because, but it's generally a bad idea to do a graduate degree without a really specific reason, and what's a good reason depends a lot on whether you're looking at a master's or a PhD. From a pure financial standpoint, a master's degree can make sense but a PhD almost never does.

Some good reasons to get a master's in CS:
  • You're graduating in the middle of a recession and you want to try the job market again in a couple years.
  • You can get into a program that has better name recognition than where you did your bachelor's.
  • You want to specialize in something that you only had a brief introduction to as an undergraduate.
  • You want to try out academia without committing to a PhD.
The only good reason to get a PhD is because you want a career in research or some other area where having a PhD is necessary.

Polio Vax Scene
Apr 5, 2009



repsnake posted:

So my question is that if I worked on C# in my spare time, what kind of useful things (not unity) could I do in say, a year?

There's money to be made in porting .NET Framework stuff to .NET Core, and also in expanding previously Windows-only code to multi-platform support.
As a more simple straightforward proof-of-concept / resume padding type of thing, all sorts of Azure services have free/cheap pricing tiers you can build fun stuff with. Embedding based searches in AOAI, OCR tech using Document Intelligence, etc. Pretty much everywhere you go will have something useful.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

ultrafilter posted:

The only good reason to get a PhD is because you want a career in research or some other area where having a PhD is necessary.
:emptyquote: absolutely necessary conditions; 2.5 years into my PhD and I'm no longer sure what constitutes sufficient conditions for it, though.

(I went back for a phd because my last gig in industry in 2019 was as an software developer at MSR, and then during the pandemic (after getting said contract canceled when the world shut down) I started teaching as a sessional lecturer, but then learned that in practice research is slow and boring and lonely, and being excited about teaching is actively discouraged to the point where getting assigned a TA position is your advisor trying to punish you)

PhantomOfTheCopier
Aug 13, 2008

Pikabooze!
Research is actually good stuff, very exciting, and wow I miss it, but really it mostly disappeared in 2005ish and has never recovered. Oh sure sure there are "new things", but in the world of theory we're still implementing a lot of things from the 50s and 60s.

Research is the first thing to get blamed/cut when revenue drops 0.01%, so it's something of a thankless endeavor in an industry where "planning ahead" reaches out to the 9mo mark, which is about the point that the fastest research starts showing results.

Computer viking
May 30, 2011
Now with less breakage.

I think I've mentioned it before, but there is some joy to be found in research fields where the IT is the means instead of the end - I work in bioinformatics, and there are CS and Maths people here who have drifted in. They seem to enjoy the wide unexplored space of biology problems they can apply modern tools to - even if they aren't breaking any real new ground on the CS side.

On the other hand I just spent the evening writing a utility package in R to generate JSON manifests for a middleware solution, so take the above with some salt. :)

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Volmarias posted:

I've made a terrible mistake and started playing Sixty Four, (which I encourage no one else in this thread to do but that's aside the point,) and it got me to thinking about how to solve the question of "what is the most efficient way to place your machines so that they can crush blocks the fastest?"

I'm not really sure I understand the game as you've described it, but, you may wish to look at how Factorio levels were solved with successive iterations of a SAT solver. To give you a sense of how you might want to buid up constraints, I imagine you'd want to encode what your post described into logical statements in a manner similar to how they do it.

I had an earlier post that described how to use such a solver for a simpler game but I can't seem to find the post. edit: aha, here it is, but I don't think you gain much by using any of the solver's non-boolean theories so I donno if this is actually useful to you.

Volmarias posted:

This feels like an NP or worse problem
At least in the factorio problem, because you have to keep iterating with larger problem spaces if the SAT solver can't find a solution for a given fixed size, I think this bumps it into double-exponential complexity, so possibly it's in PSPACE? I know there are some actual theorists on the forums who might be able to better nail it down, though.

Dijkstracula fucked around with this message at 15:43 on Mar 19, 2024

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dijkstracula posted:

I'm not really sure I understand the game as you've described it, but, you may wish to look at how Factorio levels were solved with successive iterations of a SAT solver. To give you a sense of how you might want to buid up constraints, I imagine you'd want to encode what your post described into logical statements in a manner similar to how they do it.

I had an earlier post that described how to use such a solver for a simpler game but I can't seem to find the post. edit: aha, here it is, but I don't think you gain much by using any of the solver's non-boolean theories so I donno if this is actually useful to you.

At least in the factorio problem, because you have to keep iterating with larger problem spaces if the SAT solver can't find a solution for a given fixed size, I think this bumps it into double-exponential complexity, so possibly it's in PSPACE? I know there are some actual theorists on the forums who might be able to better nail it down, though.

Thank you! Yes, this would be somewhat similar to Factorio, except in that the price per building changes based on the number placed. I'll take a look at these!

E: Nope, this is actually a different problem. This solves the question of "is it possible to take these X conveyor belts, with Y required splits, and fit it into space Z (and if so, how)"

My question is "given object types A, B, C, D, which interact with each other in certain ways, whose cost is exponentially increasing per object of that type used, what is the most efficient way to place them on this 2D grid?" I can come up with an arrangement myself, but it's not necessarily the optional one. There are no specific constraints on how much space is used, but there is a constraint on the number of objects of type A used.

As a concrete example, this is what I actually originally wanted to solve: https://sixtyfour.game-vault.net/wiki/Endgame_Irradiator_Setup

If I can only place 10 irradiator buildings due to their cost, is this the most efficient form to place them in, 2 at a time? Or is there another, more efficient configuration?

Volmarias fucked around with this message at 16:32 on Mar 19, 2024

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