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.
 
  • Locked thread
akadajet
Sep 14, 2003

JewKiller 3000 posted:

i haven't written any real java code in a while and i decided to use java 8 streams this time and boy are they cool and good

cool. java got c# enumerables and linq extension methods

Adbot
ADBOT LOVES YOU

akadajet
Sep 14, 2003

show my post you broken forums

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

akadajet posted:

cool. java got c# enumerables and linq extension methods

finally, linq comes to the mainframe

JewKiller 3000
Nov 28, 2006

by Lowtax
the types are so dank, for example:

static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)

you could almost generate the method body automatically from that, it tells you exactly what it does

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

eschaton posted:

you should switch to Cathode for all your terminal emulation needs
yeah what i definitely need is a terminal that emulates flickering, static, and a crt's curvature. thanks for the suggestion.

Shaggar
Apr 26, 2006

akadajet posted:

cool. java got c# enumerables and linq extension methods

c# enums are crap compared to java enums

Brain Candy
May 18, 2006

JewKiller 3000 posted:

the types are so dank, for example:

static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)

you could almost generate the method body automatically from that, it tells you exactly what it does

:wrong:

please tell me why the gently caress there's a ? in Collector<T,?,Map<K,List<T>>>

(i know why, it's for muh parallel streams, and it shits up the api)

akadajet
Sep 14, 2003

Shaggar posted:

c# enums are crap compared to java enums

yeah, but when you are comparing poop to poo poo who cares?

akadajet
Sep 14, 2003

JewKiller 3000 posted:

static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)

Just like the STL

JewKiller 3000
Nov 28, 2006

by Lowtax

Brain Candy posted:

:wrong:

please tell me why the gently caress there's a ? in Collector<T,?,Map<K,List<T>>>

(i know why, it's for muh parallel streams, and it shits up the api)

well you already know why so i don't have to tell you

parallel streams are nice and a little ? here and there doesn't hurt :cool:

JewKiller 3000
Nov 28, 2006

by Lowtax

akadajet posted:

Just like the STL

yeah but in a language that a sane person can understand

akadajet
Sep 14, 2003

JewKiller 3000 posted:

yeah but in a language that a sane person can understand

the language isn't bad.

the frameworks people build with it tho....

JewKiller 3000
Nov 28, 2006

by Lowtax
yeah i'm not defending reflection magic. dependency injection etc has its uses, but i like to actually see my control flow! the stream stuff is all built with normal static java types though

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Shaggar posted:

c# enums are crap compared to java enums

enumerables not enumerations

Sapozhnik
Jan 2, 2005

Nap Ghost
babby's first taste of functional programming

at some point when i'm not a burned out simmering husk of nasty attitude i'll have to sit down and have a good look at kotlin, seems pretty cool. like scala except actually planned out ahead of time.

akadajet
Sep 14, 2003

CommunistPancake posted:

enumerables not enumerations

i was wondering about that...

JewKiller 3000
Nov 28, 2006

by Lowtax

Sapozhnik posted:

babby's first taste of functional programming

at some point when i'm not a burned out simmering husk of nasty attitude i'll have to sit down and have a good look at kotlin, seems pretty cool. like scala except actually planned out ahead of time.

i used to write a lot of ocaml so i'm quite comfortable with functional programming, which is probably why that type looks nice to me, instead of like noise

kotlin is cool, i know a guy who worked on its type system

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

lol i didn't know java 9 had been delayed again

JewKiller 3000
Nov 28, 2006

by Lowtax
thanks oracle

thoracle

Sapozhnik
Jan 2, 2005

Nap Ghost
java desperately needs either async/await or coroutines, this isn't 2010 any more

neither of which are java 9 features so idk maybe we'll get them in java 10 some time around the middle of trump's second term

akadajet
Sep 14, 2003

javascript has async/await now. just use that instead.

brap
Aug 23, 2004

Grimey Drawer
I'm the ?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

JewKiller 3000 posted:

the types are so dank, for example:

static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)

you could almost generate the method body automatically from that, it tells you exactly what it does

that makes me sick to my stomach to be honest

JewKiller 3000
Nov 28, 2006

by Lowtax
what about it don't you like? is it your failure to understand it, and the subconscious anxiety that maybe you should have paid attention in school?

Shaggar
Apr 26, 2006

akadajet posted:

yeah, but when you are comparing poop to poo poo who cares?

that doesnt make any sense. java enums are really good

Shaggar
Apr 26, 2006

CommunistPancake posted:

enumerables not enumerations

oh lol. yeah java needed those

akadajet
Sep 14, 2003

c# enums are kind of bland, but I don't know what else they should be doing ??

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED

JewKiller 3000 posted:

what about it don't you like? is it your failure to understand it, and the subconscious anxiety that maybe you should have paid attention in school?

reprehensible

akadajet
Sep 14, 2003

JewKiller 3000 posted:

what about it don't you like? is it your failure to understand it, and the subconscious anxiety that maybe you should have paid attention in school?

:confused:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

akadajet posted:

c# enums are kind of bland, but I don't know what else they should be doing ??

gaining methods, conforming to interfaces

Luigi Thirty
Apr 30, 2006

Emergency confection port.

game update: hell yeah i can matchmake between my iPhone and my old iPhone and the game totally works!!! so it has singleplayer, local multiplayer, and online multiplayer via Game Center

time to polish the hell out of it and play myself a bunch to find all the weird poo poo that doesn’t work

i updated my phone to the new beta iOS 11 and also wrote a little hard drive free space menu bar gadget while it was updating? :shrug: my autism knows no bounds

JewKiller 3000
Nov 28, 2006

by Lowtax

Pie Colony posted:

reprehensible

i know right? wasting his parents' money like that

Shaggar
Apr 26, 2006

akadajet posted:

c# enums are kind of bland, but I don't know what else they should be doing ??

java enums are real good cause they can have additional fields and methods and other stuff and are effectively just static classes with a list of static instances that the compiler understands.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

JewKiller 3000 posted:

the types are so dank, for example:

static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)

you could almost generate the method body automatically from that, it tells you exactly what it does

i don't understand this at all

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Shaggar posted:

java enums are real good cause they can have additional fields and methods and other stuff and are effectively just static classes with a list of static instances that the compiler understands.

Java enums are really good

C# gave all that up for ... the ability to use them as bitflags, lol (a problem that Java solved with EnumSet)

gonadic io
Feb 16, 2011

>>=

JewKiller 3000 posted:

i haven't written any real java code in a while and i decided to use java 8 streams this time and boy are they cool and good

They are the worst interface with that stuff I've ever seen, but at least the functionality is there.

Symbolic Butt posted:

wait a minute is that a serifed font? in the terminal??????


Let me tell you about my ligatures in the terminal

JewKiller 3000
Nov 28, 2006

by Lowtax

cis autodrag posted:

i don't understand this at all

well you have to know java generic type syntax which takes some practice. let me try to explain in english:

code:
static <T,K> Collector<T,?,Map<K,List<T>>> groupingBy(Function<? super T,? extends K> classifier)
groupingBy(classifier) is a function that works for any type T and any type K. it requires as argument another function, the classifier, which is contravariant in the input type T and covariant in the output type K, according to God's Law (google those *variant words if you want to know why, they'll explain it better than me). the output of groupingBy is a Collector for Ts that returns a Map whose key type is K and value type is List of Ts. so basically, this function gets iterated over all the elements in a stream of Ts, and it takes each element t and calls classifier(t) on it. the result of this call is used as a key, and t itself is the value, and we stick those in a Map, appending the value to the List of Ts associated with that particular K.

specifically, you do something like this:

code:
Map<Integer, List<Dong>> x = dongs.stream().collect(groupingBy(Dong::getLength));

JewKiller 3000 fucked around with this message at 07:16 on Jul 13, 2017

Star War Sex Parrot
Oct 2, 2003

gonadic io posted:

Let me tell you about my ligatures in the terminal
go ooooooon

cinci zoo sniper
Mar 15, 2013




count me in the nice font coloured terminal club too, like my linux pretty and poo poo

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=


i'm still just on bash now though, i've tried a few alt terminals but given that all i use it for is 'ssh prod1' and 'sbt clean test' none of them have been worth the extra hassle

  • Locked thread