Fork me on GitHub
#off-topic
<
2017-03-12
>
dominicm10:03:37

Is there a graph or visualization for showing the frequency of relations between nodes? e.g. Products commonly bought together

istvan20:03:21

guys, after programming in java for couple of days, how does this even make sense to anybdoy

mkeathley20:03:49

Had you never done it before @istvan?

istvan20:03:11

well, i just sent patches to fix broken code, or occasionally wrote some code for interviews and web services

istvan20:03:55

after watching a java programmer friend i just realised that i write Clojure in Java 🙂

jstaffans20:03:29

just start writing some AbstractFactories and StrategyBuilders

istvan20:03:46

AbstractStrategyBuilderFactoryInterface

mkeathley20:03:52

And AbstractFactoryStrategyBuilderFactory

istvan20:03:55

yes that helps!

jstaffans20:03:25

but seriously, there are some things that help, like Project Lombok (https://projectlombok.org/), JavaSlang (http://www.javaslang.io/)

jstaffans20:03:02

you can totally do pretty functional Java these days and use a more declarative style with annotations etc to save on writing code

istvan20:03:12

i was not sure why the average java code is so convoluted and complex and just feels so bad, but i just realized that people spend significant time to make code work for use cases that will never be used

istvan20:03:34

thanks i will check these out

istvan20:03:48

i recently discovered some java 8 niceness:

istvan20:03:02

private static Set<String> validEvents = Stream.of(
            "webpageview",
            "webuiaction",
            "webserveraction",
            "gitclientaction"
    ).collect(Collectors.toCollection(HashSet::new));

jstaffans20:03:42

seems like a rather convoluted way of creating a Set 🙂

istvan20:03:00

jstaffans how would you do it?

istvan20:03:26

i know only .add() and this one

istvan20:03:31

but if there is something else

jstaffans20:03:40

I would use ImmutableSet from the Guava library:

Set<String> events = ImmutableSet.of(”a”, “b”, “c”);

istvan20:03:08

alright using Guava makes sense

istvan20:03:09

what is the membership lookup time complexity and do i need to handle an exception when it does not have the item i am looking for?

istvan20:03:31

well i guess if I do 5 items it wont matter that much

jstaffans20:03:12

I’ll defer you to the Java SE reference docs for that 🙂