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
CarForumPoster
Jun 26, 2013

⚡POWER⚡

KillHour posted:

I do this for a living and PDFs are literally the worst. Every document will be different and it will always be a finicky pain in the rear end.

This.

MrMoo posted:

Feed it to ChatGPT-4-vision and have it OCR the content and render as a CSV?

I've had it hallucinate or displace nested stuff like this but that was prob a year ago so could be way better now.


Also worth mentioning, Amazon Textract. I've not had GREAT results with it, but sometimes it hits the nail on the head and its easy enough to try it out manually if you have an AWS account.

Nested headers are proper hosed though. If possible, I'd prob do the column headings manually and try to extract an image of just the table data and feed that to textract. I'd expect that to work decently.

CarForumPoster fucked around with this message at 14:10 on Apr 18, 2024

Adbot
ADBOT LOVES YOU

A Festivus Miracle
Dec 19, 2012

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

Jesus, I feel like I'm having a stroke. Help me goons:

pre:
counter = 10
while (counter>0):
   counter = counter//2


5
4
The loop never ends
3

How many times will this run?

My gut says 4 times. 10/2 =5, 5//2 =2, 2//1 = 1 //2 = 0.



pre:
 Which of the following values for n will cause the loop to never end/terminate?
Group of answer choices
10
8
7
9
Uh, none of the above? You're floor dividing, so at some point the answer will always be 0 and the loops will except? Hello? What's burning?

pre:

Re write as a correct loop based on the three parts of the loop

doAgain = "y"

 while doAgain == "y":

    word = input("Enter a word:")

    print("First letter of " + word  + " is " + word[0])

    doAgain = input("Type ‘y’ to enter another word and anything   else to quit.")

 print("Done!")

:psyduck:

BUT THIS ALREADY WORKS?!

edit: I thought about this and this loop has no exit condition.

so,
pre:
 1 doAgain = "y"
  2 
  3 while doAgain == "y":
  4 
  5     word = input("Enter a word:")
  6 
  7     print("First letter of " + word  + " is " + word[0])
  8 
  9     doAgain = input("Type ‘y’ to enter another word and anything   else to q    uit.")
 10     if doAgain != "y":
 11         print("Done!")
I think this is correct.

I may be missing something here but whenever I ran that first bit of code with a print(counter) it just outputs zero.

A Festivus Miracle fucked around with this message at 21:04 on Apr 21, 2024

mystes
May 31, 2006

A Festivus Miracle posted:

Jesus, I feel like I'm having a stroke. Help me goons:

pre:
counter = 10
while (counter>0):
   counter = counter//2


5
4
The loop never ends
3

How many times will this run?

My gut says 4 times. 10/2 =5, 5//2 =2, 2//1 = 1 //2 = 0.



pre:
 Which of the following values for n will cause the loop to never end/terminate?
Group of answer choices
10
8
7
9
Uh, none of the above? You're floor dividing, so at some point the answer will always be 0 and the loops will except? Hello? What's burning?

pre:

Re write as a correct loop based on the three parts of the loop

doAgain = "y"

 while doAgain == "y":

    word = input("Enter a word:")

    print("First letter of " + word  + " is " + word[0])

    doAgain = input("Type ‘y’ to enter another word and anything   else to quit.")

 print("Done!")

:psyduck:

BUT THIS ALREADY WORKS?!

edit: I thought about this and this loop has no exit condition.

so,
pre:
 1 doAgain = "y"
  2 
  3 while doAgain == "y":
  4 
  5     word = input("Enter a word:")
  6 
  7     print("First letter of " + word  + " is " + word[0])
  8 
  9     doAgain = input("Type ‘y’ to enter another word and anything   else to q    uit.")
 10     if doAgain != "y":
 11         print("Done!")
I think this is correct.

I may be missing something here but whenever I ran that first bit of code with a print(counter) it just outputs zero.
For the first one you're right but if you aren't sure you can just add a print statement inside the loop and run it to check it, or have it increment a variable and print the value at the end. (Also it might be worth learning to use a debugger so you can set a breakpoint and check what's happening.)

If the second is a continuation of the first one with no extra information it makes no sense both because of the reason you have stated and because... there is no variable n in the first place?

For the third one yeah it makes no sense because it already works.

Basically your teacher is still awful I'm sorry.

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
i would assume by "correct loop" they do not mean "runs without errors" but "follows whichever dogmatic loop style-guide the professor told you to use in lecture"

Volmarias
Dec 31, 2002

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

RPATDO_LAMD posted:

i would assume by "correct loop" they do not mean "runs without errors" but "follows whichever dogmatic loop style-guide the professor told you to use in lecture"

This is, unfortunately, the most likely answer

A Festivus Miracle
Dec 19, 2012

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

RPATDO_LAMD posted:

i would assume by "correct loop" they do not mean "runs without errors" but "follows whichever dogmatic loop style-guide the professor told you to use in lecture"

It's this.

Another gem posted with roughly as much context as I had from her:

pre:
number = int( input ("Enter a value greater than 0"))
product = 0
while (number >=0):
     for x in range (1, 3):
          product = number * x + product
     number = int( input ("Enter a value greater than 0"))
print (product)
I have no loving clue what it does, but whatever it is it does it wrong :v:

A Festivus Miracle
Dec 19, 2012

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

I'm going to take another class with this lady this fall, and I'm starting to realize that not only is she hopelessly incompetent at teaching, she's absolutely stuck on dogmatic ideas of what code should look like. I have no choice, it's the only offering of the class at the college :suicide:

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

A Festivus Miracle posted:

I'm going to take another class with this lady this fall, and I'm starting to realize that not only is she hopelessly incompetent at teaching, she's absolutely stuck on dogmatic ideas of what code should look like. I have no choice, it's the only offering of the class at the college :suicide:

complain to the dean and provost

Volmarias
Dec 31, 2002

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

leper khan posted:

complain to the dean and provost

Seriously. This lady is arguably harming your education more than they're helping.

CarForumPoster
Jun 26, 2013

⚡POWER⚡
lol at complaining to the dean that some teacher doesn’t like your coding style

I’m sure they’ll get RIGHT on that

But yes if this lady could code competently she’d make $100k doing it and not $40k. Also camel case in Python so you know she don’t know Python.

Computer viking
May 30, 2011
Now with less breakage.

CarForumPoster posted:

lol at complaining to the dean that some teacher doesn’t like your coding style

I’m sure they’ll get RIGHT on that

But yes if this lady could code competently she’d make $100k doing it and not $40k. Also camel case in Python so you know she don’t know Python.

It's more "has a long history of assignments where she only accepts outright wrong answers", from what we've seen.

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

Computer viking posted:

It's more "has a long history of assignments where she only accepts outright wrong answers", from what we've seen.

yeah. if you really want to screw with the school report to the accredidation board.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Computer viking posted:

It's more "has a long history of assignments where she only accepts outright wrong answers", from what we've seen.

Oh I agree theyre incompetent and terrible. OP needs to know more than OP knows now to articulate why that is and reap any benefit. Like yea they can whistle blow, but how does OP gain from that? The type of person who is so dumb and bad at coding to do what we're accusing them of here is the type to retaliate.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Computer viking posted:

It's more "has a long history of assignments where she only accepts outright wrong answers", from what we've seen.

Unlike working as a professional programmer, right?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

A Festivus Miracle posted:

Jesus, I feel like I'm having a stroke. Help me goons:

pre:
counter = 10
while (counter>0):
   counter = counter//2

5
4
The loop never ends
3
How many times will this run?

My gut says 4 times. 10/2 =5, 5//2 =2, 2//1 = 1 //2 = 0.

pre:
 Which of the following values for n will cause the loop to never end/terminate?
Group of answer choices
10
8
7
9

the correct answer is "what the gently caress is n?" there is no n in that code.

Volmarias
Dec 31, 2002

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

CarForumPoster posted:

Oh I agree theyre incompetent and terrible. OP needs to know more than OP knows now to articulate why that is and reap any benefit. Like yea they can whistle blow, but how does OP gain from that? The type of person who is so dumb and bad at coding to do what we're accusing them of here is the type to retaliate.

If they have to take a class with this person again, maybe the answer is "a better teacher who is actually going to know what they're doing"

CarForumPoster
Jun 26, 2013

⚡POWER⚡
I’m all for doing something to achieve that outcome but he should know it carries some risk. I suspect he’s gonna need some political capital or an exceptionally well articulated argument for that to happen.

Ranzear
Jul 25, 2013

That second question is super fishy. These feel like they were written via LLM and consistently wrong answers would track.

Like, what is the double slash divide? Is that actually a thing or just an extraneous escape character being glossed over by everyone?

Why the unbulleted multiple choice in a weird order? Textual shakeup answers are usually the last one. The second question does the same and what is this random 'Group of answers choices' line?

Can you show us more from this teacher?

Six edit pileup: Didn't even notice the third one.

A Festivus Miracle posted:

pre:
number = int( input ("Enter a value greater than 0"))
product = 0
while (number >=0):
     for x in range (1, 3):
          product = number * x + product
     number = int( input ("Enter a value greater than 0"))
print (product)

I really hope the teacher is just incompetent instead of this being LLM poo poo, because it 1000% smells like LLM poo poo and you deserve way better.

Ranzear fucked around with this message at 03:11 on Apr 23, 2024

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Ranzear posted:

Like, what is the double slash divide? Is that actually a thing or just an extraneous escape character being glossed over by everyone?

a // b is equivalent to floor(a / b).

qsvui
Aug 23, 2003
some crazy thing

Ranzear posted:

Like, what is the double slash divide? Is that actually a thing or just an extraneous escape character being glossed over by everyone?

If the code is Python, that should be a flooring divide as normal Python 3 division is always in floating point.

e: beaten

Ranzear
Jul 25, 2013

Thanks. Never seen it before. Does it show up in any other language?

As weird as teaching trivialities of triple-equals otherwise. Festivus will have to clarify if that was actually taught as a concept or just came out of nowhere too. I was taught in 2.7 entirely despite 3 being out for years.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Integer division is pretty common but I don't know of any other language that has a built in operator for floor division.

(The two are equivalent when the quotient of the arguments is positive but not in general. -1 // 2 is -1 but int(-1 / 2) is 0.)

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I hate that some languages define integer division and modulus such that the result of the modulus operation can be a negative number depending on the signs of the operands. The result of the modulus operation should always be nonnegative. i have a major bee in my bonnet about this.

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

Hammerite posted:

I hate that some languages define integer division and modulus such that the result of the modulus operation can be a negative number depending on the signs of the operands. The result of the modulus operation should always be nonnegative. i have a major bee in my bonnet about this.

After the first time that my C# game's code got a negative index when doing the ol' "use the modulus operator to ensure that my index is within the bounds of the array" trick, I wrote my own "Mod" function and never looked back. I'm sure there's a good reason for why it behaves the way it does, and it's entirely possible that, mathematically speaking, my code is "incorrect". But dammit this is what the modulus is for.

Adbot
ADBOT LOVES YOU

redleader
Aug 18, 2005

Engage according to operational parameters

TooMuchAbstraction posted:

After the first time that my C# game's code got a negative index when doing the ol' "use the modulus operator to ensure that my index is within the bounds of the array" trick, I wrote my own "Mod" function and never looked back. I'm sure there's a good reason for why it behaves the way it does, and it's entirely possible that, mathematically speaking, my code is "incorrect". But dammit this is what the modulus is for.

i ran into the same thing when i figured out some math in excel using MOD then tried to port it to c#. ended up doing it a different way because i didn't want to explain why a % b is hosed for negative numbers

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