[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

tfw you fell for the cs memetfw you have to work on your C# assignmenttfw you haven't


Thread replies: 14
Thread images: 3

File: 1456907388755.png (11KB, 429x410px) Image search: [Google] [Yandex] [Bing]
1456907388755.png
11KB, 429x410px
>tfw you fell for the cs meme
>tfw you have to work on your C# assignment
>tfw you haven't started yet and are playing assassin's creed instead
why is CS so much pain /g/?
>>
it isnt
you chose a major ill suited to you
pick another
>>
>>53876323
you sound like an idiot I knew during me EE studies. He dropped out, went back to being a NEET and leeching off of his parents for the coming 6 years.

You're a peasant, end of story.
>>
>>53876323
it could be worse
it could be Java

all I want is to get HashMap<String, Integer> entries into an array and sort by value, but apparently it takes a wizard to do this in Java 7
>>
>>53876323
I went into college with an Accounting major and CS minor. About a year in I switched them, because accounting, while solid job security, is boring as hell. Just switch majors anon.
>>
Drop out if you dont like it?
>>
>>53876323

Love and Pain are the same, anon.


>>53876425

Don't blame Java for your skills..

SortedSet<String> keys = new TreeSet<String>(myHashMap.keySet());
SortedSet<String> values = new TreeSet<String>(myHashMap.values());


Or rather this?


List keys = new ArrayList(yourMap.keySet());
Collections.sort(keys)
>>
its probably not the best career choice for you, if you continue this path you will probably burn out in couple of years and your life will be suffering, like mine
>>
>>53876547
>Don't blame Java for your skills
the pair relationship is necessary, so I need to sort Set<Map.Entry<String, Integer>> by the (Integer) value of each Entry. Getting the keys and values separately is pretty useless.
>>
File: 1458260552158.gif (220KB, 280x199px) Image search: [Google] [Yandex] [Bing]
1458260552158.gif
220KB, 280x199px
>I like vidya therefore CS is perfect for me
>>
>>53876768
I know sounds dumb but I thought it would be fun. I guess I will have to push through until I graduate.
>>
>>53876653

>Getting the keys and values separately is pretty useless.

No it's not.

So you just need to order the keys (in a seperate list) and can still directly access the HashMap in the order you want.


HASHMAP a { 3 -> "a"; 1 -> "You"; 2 -> "are"; 4 -> "faggot."}

SET b = a.keySet()

SORT(b)

PRINT a.get(b[0]) + a.get(b[1]) + a.get(b[2]) +a.get(b[3])
>>
>>53876916
Kys. You are the reason CS it's going downhill
>>
File: 1410059413386.jpg (32KB, 480x454px) Image search: [Google] [Yandex] [Bing]
1410059413386.jpg
32KB, 480x454px
>A have python assignment due in two weeks
>we have to take in two numbers and output the average
>haven't even started yet

a-am i gonna make it?
Thread replies: 14
Thread images: 3
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK