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
tef
May 30, 2004

-> some l-system crap ->

Symbolic Butt posted:

entity component system

you know how in like a dynamic language you can whack poo poo together? that but c++

Adbot
ADBOT LOVES YOU

white sauce
Apr 29, 2012

by R. Guyovich

quote:

given a list n = 100,000, how many sequential searches must be done before sorting the list and doing binary search is better in terms of number of comparisons?

If I understand this poo poo correctly, I wrote an inequality showing the Big O notation for doing a sequential search on the left side and the Big O notation for selection sort + binary search...

O(n) <?> Θ(n^2)+ O(n)

Am I on the right path?

tef
May 30, 2004

-> some l-system crap ->
also the only people who benefit from weed out courses are the inept and incapable teachers who run them

Schadenboner
Aug 15, 2011

by Shine

tef posted:

also the only people who benefit from weed out courses are the inept and incapable teachers who run them

Also the teachers who teach later courses and get a smaller entry population (and one that's guaranteed to know whatever bullshit shibboleths the department considers important-enough to embed in the weed-out courses)?

tef
May 30, 2004

-> some l-system crap ->
ctps: thinking about giving up on my rust side thingy again, again

like the roadblocks have been numerous

i mean this time i've learned lifetimes + borrowing well enough to know how to express the code i want

but oh god: <'a, 'b:'a, K: 'a + Eq + Hash + Sync + Send: V: 'a + Clone + ToOwned + Sync+ Send>

gonadic io
Feb 16, 2011

>>=

white sauce posted:

If I understand this poo poo correctly, I wrote an inequality showing the Big O notation for doing a sequential search on the left side and the Big O notation for selection sort + binary search...

O(n) <?> Θ(n^2)+ O(n)

Am I on the right path?
do they want worst case or average case? don't mix the two. also binary search is O(log n)

you're kinda right, except n isn't the variant any more. they specifically say n = 100,000, so instead you calculate k so that
k O(n) = n^2 + k (O(log n))
because that's the breakeven point

gonadic io
Feb 16, 2011

>>=
realistic programming weed out course:
1 question, 1 year to answer: why is my sbt build failing consistently 1 in every 4 times?

alt: to pass get 3 of your peers to quit the course using only intellectual snobbery and imposter syndrome

homercles
Feb 14, 2010

debase yourself and code in go

white sauce
Apr 29, 2012

by R. Guyovich

gonadic io posted:

do they want worst case or average case? don't mix the two. also binary search is O(log n)

you're kinda right, except n isn't the variant any more. they specifically say n = 100,000, so instead you calculate k so that
k O(n) = n^2 + k (O(log n))
because that's the breakeven point

worst case

gonadic io
Feb 16, 2011

>>=
also lol at teaching sorting using O(n^2) algorithms. that's like teaching driving with a horse and cart

redleader
Aug 18, 2005

Engage according to operational parameters
yeah, just use the standard library

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

A bit of theory is never a bad thing to have, but the conflation of computer programming and computer science is silly and self-defeating. The first step to learning how to build a cabinet is not designing a hammer from scratch.

Ms. Twiggy
Sep 9, 2018

Floppy drives should be stylish and fun

Peeny Cheez posted:

A bit of theory is never a bad thing to have, but the conflation of computer programming and computer science is silly and self-defeating. The first step to learning how to build a cabinet is not designing a hammer from scratch.

I dunno if I’d go that far. I can understand the argument that maybe there’s a lot of theory front-loaded in computer science like what was posted above, but the value of doing things like reimplementing sort algorithms is that you can actually start to get a real feel for how big-O notation not only relates to real world scenarios, but conversely how to use it as a shorthand for understanding why your bespoke business logic runs like crap when it happens to have three nested loops spread over five functions in the stack.

Sure no programmer ever uses a hand rolled sort function when the standard library will do, but it’s probably the best way to really see the difference between O(n^2) and O(n log n) for the novice.

pseudorandom name
May 6, 2007

lol if you didn't learn sort functions by implementing graphical versions of them using BGI in Turbo Pascal in high school

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


lol if the school u went to could afford sorting functions

comedyblissoption
Mar 15, 2006

programming and computer science go hand in hand

teaching programming without theory or theory without programming is bad

jony neuemonic
Nov 13, 2009

comedyblissoption posted:

teaching programming is bad

Schadenboner
Aug 15, 2011

by Shine
comedyblissoption posts considered harmful.

redleader
Aug 18, 2005

Engage according to operational parameters

comedyblissoption posted:

programming bad

gonadic io
Feb 16, 2011

>>=

Beamed posted:

lol if the school u went to could afford sorting functions

This was the only way we could afford to sort things: https://youtu.be/lyZQPjUT5B4

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Beamed posted:

lol if the school u went to could afford sorting functions

lol if the school u went to didn't lock the computers down so hard all .exes had to be on an allowed list to even run

Luigi Thirty
Apr 30, 2006

Emergency confection port.

are you ready for some NSTableViews

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Luigi Thirty posted:

are you ready for some NSTableViews



gently caress yeah I'm ready

white sauce
Apr 29, 2012

by R. Guyovich
sorry to be making GBS threads up the lovely thread with my poo poo posts but...

quote:

We'd like to figure out how many work units this algorithm performs. First let's think about how many times the outer loop is run. for i = 0 to length(A) will run from i = 0 to i = n-1, where n is the length of the array. This is a total of n iterations. So now we know that the body of the inner loop will be run n times.

Now let's think about how many times the inner loop is run. On the first iteration of the outer loop,i = 0 and j = i+1 = 1. The inner loop will then run from j = 1 to n-1. This is (n-1) iterations, and so the inner loop will run n-1 times. In this iteration, the work unit will be performed n-1 times.


is this a typo and did they mean the body of the outer loop is being run n times?

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

white sauce posted:

sorry to be making GBS threads up the lovely thread with my poo poo posts but...


is this a typo and did they mean the body of the outer loop is being run n times?

imo- yes, and yes.

distortion park
Apr 25, 2011


carry on then posted:

lol if the school u went to didn't lock the computers down so hard all .exes had to be on an allowed list to even run

yeah you had to rename .exes to notepad.exe or they wouldn't work.

white sauce
Apr 29, 2012

by R. Guyovich
paying hundreds of thousands of dollars for an education in a place where the material's aren't proofread

feels good man :frogbon:

Chalks
Sep 30, 2009

You just need to drag and drop the exe into a word document then double click on it to execute it via the OLE container. Easy peasy.

gonadic io
Feb 16, 2011

>>=

white sauce posted:

sorry to be making GBS threads up the lovely thread with my poo poo posts but...


is this a typo and did they mean the body of the outer loop is being run n times?

I don't think it's a typo just lovely wording
// outer loop
for I = 0..n {
// inner loop
for j = 0..m { butts }
}

You know that the inner loop gets run n times

E: it sounds like it's setting you up for deriving that your algo is O(n^2)

gonadic io fucked around with this message at 17:21 on Sep 17, 2018

Bloody
Mar 3, 2013

white sauce posted:

paying hundreds of thousands of dollars for an education in a place where the material's aren't proofread

feels good man :frogbon:

welcome to the real world where nothing is proofread

Xarn
Jun 26, 2015

gonadic io posted:

I don't think it's a typo just lovely wording
// outer loop
for I = 0..n {
// inner loop
for j = 0..m { butts }
}

You know that the inner loop gets run n times

E: it sounds like it's setting you up for deriving that your algo is O(n^2)

Yeah this.

Bloody posted:

welcome to the real world where nothing is proofread

My course materials were proofread.

Because I paid my own money to have people do it :v:

Toady
Jan 12, 2009

DONT THREAD ON ME posted:

does jblow have fans within the game industry or is his club made out of gamers and aspiring game devs?

i get the impression he's like a mini-notch who had a hit with braid, and he has a little devoted fanbase today because he streams on twitch

Toady
Jan 12, 2009

he's from that short era of hipster platformers when game journalists were treating every indie game like a work of high art

https://www.youtube.com/watch?v=oc26EKhZNyM

elite_garbage_man
Apr 3, 2010
I THINK THAT "PRIMA DONNA" IS "PRE-MADONNA". I MAY BE ILLITERATE.
jblow's best friend is Casey Muratori

A dude who I'm convinced hates computers more than mr blow, but is smart enough to know that making his own language won't solve jack squat.

elite_garbage_man fucked around with this message at 20:25 on Sep 17, 2018

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.

elite_garbage_man posted:

jblow's best friend is Casey Muratori

sorry I know that this is a person but not the significance of this person, explain?

redleader
Aug 18, 2005

Engage according to operational parameters

elite_garbage_man posted:

A dude who I'm convinced hates computers more than mr blow

at least his heart's in the right place

Spime Wrangler
Feb 23, 2003

Because we can.

C Kotlin S: pretty rad i guess

There's such a major difference in feel between coding in python and kotlin and I'm not sure how much is the typing and how much is the language but it's been an enjoyable experience porting over a small python project. There seems to be minimal boilerplate and holy crap the IDE provides a ridiculous amount of discoverability. Strict typing seems to force you to think through design decisions much more thoroughly early on.

However, after completing the port of the basic functionality and algorithms (super pleasant and good after sorting out How to Use A Gradle) I decided to try some GUI development with TornadoFx/JavaFx since I've only done webdev. Turns out learning to building UIs is an awful process and I hate it and apparently I'm supposed to litter my Beautiful Bespoke Domain Model with ugly JavaFX properties just so stuff updates on the screen when it's supposed to??

In short are there any good resources on how to use these tools like not a god damned plang idiot?

Chopstick Dystopia
Jun 16, 2010


lowest high and highest low loser of: WEED WEE
k
Fixing this database has turned me into the db janitor I came here to write software damnit

AggressivelyStupid
Jan 9, 2012

Kilometres Davis posted:

Fixing this database has turned me into the db janitor I came here to write software damnit

this is why I'm afraid to reveal my sql knowledge at work

Adbot
ADBOT LOVES YOU

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
the first programming thing i learned was regular expressions. i was 9 or 10 years old at the time - my dad taught me. to this day i maintain that it really wasn't a bad place to start thinking abstractly about a single symbol being a representation of some other set of symbols. i didn't learn anything about state machines until over a decade later though.

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