Endure this time and Democrats might have their greatest chance to take control of the country and do the stuff they never could
Official 'what is Dota anymore' discussion - Page 9196
| Forum Index > Dota 2 General |
|
Faruko
Chile34173 Posts
Endure this time and Democrats might have their greatest chance to take control of the country and do the stuff they never could | ||
|
PassiveAce
United States18076 Posts
| ||
|
Faruko
Chile34173 Posts
| ||
|
PhoenixVoid
Canada32761 Posts
| ||
|
andyrau
13015 Posts
| ||
|
eieio
United States14512 Posts
On December 16 2017 23:38 PhoenixVoid wrote: On the good side it looks like Trump's undying fanbase is gradually breaking ranks, problem is Congress and House really don't care and are still voting lockstep with him. I expect another depressing cycle of terrible Republican president gets overthrown in massive Democrat wave of fightback and most of their policies overturned, only for the Dems to get complacent and allow for another godawful Republican to take office once they get lazy or choose a poor candidate. dems taking the house/senate isn't a sure thing or something but the idea that they aren't gonna pick up seats in the house is pretty silly based on what we know right now ok yeah we'll see politics is bad can't believe I misread your post so hard that was rude of me loll | ||
|
teddyoojo
Germany22369 Posts
| ||
|
Nevuk
United States16280 Posts
1) In this assignment, you will modify the Account class to implement the Comparable interface with a type specification such that Accounts and its subclasses can be sorted from lowest to highest balance using the Collections.sort(List Does he mean the Comparable interface as written, or would Comparator make more sense? (if you're curious the full question and the given code is at https://www.chegg.com/homework-help/questions-and-answers/start-file-accountjava-defines-account-object-see--assignment-modify-account-class-impleme-q25894723 . I wrote my own accounts file but it's pretty similar). edit: after asking I immediately see examples of the comparable interface making use of Collections.sort). | ||
|
eieio
United States14512 Posts
On December 17 2017 05:33 Nevuk wrote: I got a programming question about my last java assignment (probably last programming assignment ever). I don't really "get" sets or trees or whatever (as far as I can tell it's just dynamic arrays?) which is what the assignment is about(learning sets), but my real issue is not knowing if my professor was confused when he wrote the question or not. He is about 25% of the time. It didn't sound like him so I googled it and found it online, so I'm guessing he got it from somewhere. Does he mean the Comparable interface as written, or would Comparator make more sense? (if you're curious the full question and the given code is at https://www.chegg.com/homework-help/questions-and-answers/start-file-accountjava-defines-account-object-see--assignment-modify-account-class-impleme-q25894723 . I wrote my own accounts file but it's pretty similar). edit: after asking I immediately see examples of the comparable interface making use of Collections.sort). sets and trees are ways of structuring or storing data so that answering certain questions about the data is fast. It's a lot faster to check whether an item is in a set than it is to check whether an item is in an array (dynamic or not). It's a lot more efficient to use a tree for storage of key-value pairs than an array. from what I remember of java I'd assume he'd want to have a class declaration along the lines of "class Account implements Comparable" which would let you sort a list of accounts. | ||
|
Nevuk
United States16280 Posts
| ||
|
eieio
United States14512 Posts
On December 17 2017 06:01 Nevuk wrote: I was looking at the wrong chapter, explaining most of my confusion. (The assignment is focused on the chapter about Collections, not the one about hashsets which was throwing me) Good! I still hope you don't end your class thinking sets and trees are just dynamic arrays! | ||
|
Nevuk
United States16280 Posts
On December 17 2017 06:24 eieio wrote: Good! I still hope you don't end your class thinking sets and trees are just dynamic arrays! Sets/trees were our very last class. Kind of an extreme 16 week program, going through the first 800 pages of a programming textbook. I get how they're different, I'm just rarely going to ever use them. I just made a kind of ridiculous mistake that took me like 20 minutes to figure out what the problem with this line of code was (it compiles and runs just fine... if you like infinite loops) : while (checkingIterator.hasNext()) { System.out.print(checkingIterator.hasNext() + " "); } | ||
|
Nevuk
United States16280 Posts
| ||
|
eieio
United States14512 Posts
Also I think you should be a little more generous to your professor! I'd be hesitant to call that a "bizarre lambda request" some code/thoughts + Show Spoiler + based on the comment "declare but don't initialize" I think what your professor wants is a declaration there (ie like this)
just that after the todo, and then before each of your while loops a line like this that actually initializes an iterator
| ||
|
Nevuk
United States16280 Posts
On December 17 2017 09:58 eieio wrote: the idea of iterators is that they iterate through the thing once and then they're done. If you want to iterate through something multiple times you'll either need to rewind the iterator (there may be Prev method or something) or, more idiomatically, create a new iterator Also I think you should be a little more generous to your professor! I'd be hesitant to call that a "bizarre lambda request" Well, it's only bizarre because he never told us how to use lambdas lol. Good professor, but it's really obvious that it's two classes mashed together and sped up a lot. btw, there's not anything wrong with my comparator interface implementation is there? I think it might not be working but I'm not sure how to tell | ||
|
eieio
United States14512 Posts
On December 17 2017 10:25 Nevuk wrote: btw, there's not anything wrong with my comparator interface implementation is there? I think it might not be working but I'm not sure how to tell it's fine, but since you have two numbers to compare there's a trick that you could use to do it in one line instead ![]() | ||
|
cecek
Czech Republic18921 Posts
| ||
|
intotheheart
Canada33091 Posts
| ||
|
tehh4ck3r
Magrathea7087 Posts
On December 17 2017 10:58 cecek wrote: Just hit legend for the first time in Hearthtone. Maybe my father will be proud of me now. Yeah but wild legend doesn’t count | ||
|
eieio
United States14512 Posts
| ||
| ||
