« first day (2476 days earlier)      last day (2482 days later) » 
01:00 - 11:0011:00 - 00:00

1:10 AM
morn
 
 
2 hours later…
3:09 AM
morning
 
4:00 AM
"Many of life's failures are experienced by people who did not realize how close they were to success when they gave up." -Thomas Edison (source)
 
 
2 hours later…
5:40 AM
Please do not just paste yout code in here :)
Use paste.ofcode.org or pastebin or something to keep the chat clean @user1692342
 
Sure
@geisterfurz007 I have pasted it in paste.ofcode.org/UhS4J5RkKJgkWHEKa6TTzM
 
@user1692342 do that in a constructor. By this you can use a method to populate that map.
 
@KarelG The class of mine has only static methods
so I won't be creating objects
 
1 message moved to Trash can
@user1692342 please do not post code here. Use a code pasting tool for that
 
Good morning parrot ;)
 
5:43 AM
as @geisterfurz007 suggested
 
@Tavo Yup done. Pasted it in paste.ofcode.org/UhS4J5RkKJgkWHEKa6TTzM
 
polly wants a cracker!
@user1692342 also, delete the code you've pasted here ;)
 
(>^-^)> (.:)
@Tavo was too late already
 
@geisterfurz007 nom
 
5:46 AM
@KarelG Is there a way to improve without using constructors ?
 
you can use Java9
 
wonderful Collections constructors
also, immutable
 
I am using Java 8
 
shame
take a look nonetheless
 
5:49 AM
Haha. Yup Will do that. Hopefully will move to Java 9 soon ;)
is there a way with java 8 :D
 
let me check your code
 
Thanks!
 
first approach after a quick read: for readability's sake, take tableIndexMap.get(TABLE1).entrySet().stream().map(Map.Entry::getKey).collect(Co‌​llectors.toList()), put it into a variable and give it a clear name
also, rename TABLE1 to something more meaningful
 
yeah my table1 has a good name xD
 
hmm ... so tableIndexMap is a static attribute too ?
 
5:55 AM
yup
 
Why don't you put it as an object and use DI or singleton ?
 
ok, I was going to suggest just that :D
 
the static keyword should be rarely used.
 
Could you give me an example how you mean to use it? I am not able to follow
 
Hiii'
all
 
5:59 AM
@Mogli hi
 
hiii @Tavo
 
@user1692342 if tableIndexMap is static, it means that it's independent from the object that instantiate the class
you might as well move it away from the class (i.e. into a different class), and create a unique instance of that class
that's what a Singleton is
 
@Tavo Yes I get what Singleton is
 
ok
 
How do you compare every item in a list with every other item, exactly once?
 
6:01 AM
@Tobiq Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
@Tobiq google it
 
i tried
 
@user1692342 so what part is the one you don't follow?
@Tobiq and?
 
@Tavo The reason I am using static is because I just read these values once from a config file. It wont change
 
and?
 
6:02 AM
it just has to read some values from a file and I store it in a map, so that I can retrieve it faster
 
@user1692342 does tableIndexMap have a reason to be in the class it's living at the moment?
 
I legit just checked that
 
if you are so certain, I'll believe you. But I doubt it :)
 
they all using two loops
that checks exactly twice
(each pair)
 
6:04 AM
@Tobiq two loops doesn't mean checking every pair twice
 
u know what i mean
 
@user1692342 I'll propose yet one more upgrade (maybe it will help)
 
its checking too much
 
turn your List<String> into your own class
 
@Tobiq maybe you should print all the values in the loop for comparison..it will help you understand what is happening..
 
6:05 AM
so you can have Map<String, MyClass> instead of Map<String, List<String>>
then you can have a method that gives you back tableIndexMap.get(TABLE1).entrySet().stream().map(Map.Entry::getKey).collect(Co‌​llectors.toList())
 
Hmmm fascinating. I'll need to think about it
I am new to Java. What do you suggest me to read and become a better java developer
there is so much to learn. Guava + Spring + Design patterns
:o
 
oh, don't worry too much about frameworks yet
if you want a good structured book, read Efficient Java
 
Effective Java ?
 
yep
 
I have learnt a lot with practics and different internet guides
 
6:08 AM
@SOCIOPATH Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
wow actually works
 
Official Java tutorials: docs.oracle.com/javase/tutorial
 
thx
 
@Tavo Yea heard a lot about the book. Need to get it!
@Tobiq there is a reason why it is a highly upvoted answer :=)
 
@user1692342 it is useful. I think it hasn't been updated in a while, but the principles there are still very valid
 
6:09 AM
I didnt read the code, i thought it was a simple embedded loop, very elegant
 
@Tavo the latest book is coming out in October
 
@Tobiq told you to google it
 
But I guess I can still go through it to know pre Java 8 best principles
 
@user1692342 Java8 contains a lot of syntactic sugar, but not much new functionality
(people shouting at me in 3...2...1...)
 
Haha
 
6:11 AM
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
 
@Tavo Is that why Java is so sweet?
 
Is it good pattern to use the constants from main class in JUNIT ?
 
Java? Sweet? Java is like licking a lemon that has been macerating in vinegar for a century and then it has been pissed on
4
@user1692342 an example please?
 
for example if my main class has a string : public static final String MYNAME = "Test";
Is it a good idea to use MYNAME in my JUNIT or should I rewrite it again ?
 
lemme just put a star on that lil' burst o' rage :>
 
6:12 AM
@user1692342 use it
 
cool
 
but multiplatform)
 
@geisterfurz007 nothing but the bitter truth :P
 
@user1692342 also, a suggestion: you seem to think in terms of "my main class" a lot. The class that contains your main method (if you have one) is just an entry point. It's not more important than anything else in your code, nor it holds a special position in your class structure. Think more in terms of "one of my classes"
 
6:18 AM
@Tavo then you've licked ... piss? 😦
 
note the difference between something is and is like :P
 
@KarelG I ate in the cafeterias in front of my university building throughout my whole degree. I've tasted worse than piss
I've eaten things that would make a goat puke
I remember there was a sandwich place where the only ray of sun that would enter the shop hit the mayo jar
 
lol
holy mayo \o/
_o-_
 
and when the guy was adding mayo to the sandwich, if his hand got dirty by accident, he would clean it in your bread
 
all about the nutrients :>
 
6:23 AM
shrugs I survived
 
eh, that wouldn't be allowed here
when serving food, they have to wear gloves
 
where is 'here'?
@KarelG gloves? gosh, that's so civilised
 
<-- check my pic
I'm from Belgium... or Absurdistan 😃
 
in any of the countries I have lived, food is served by people who haven't probably washed their hands in a while...
 
vgm Itachi :)
 
6:27 AM
@KarelG really? I have a few close friends from Belgium
also, your pic is missing chips with mayo :D
 
it's at bottom right?
 
ooohhh. In the small pic it looked like another waffle
Belgium chocolate is best chocolate
no matter what the Swiss say
 
it really depends though
some swiss chocolate are tasteful.
oldtimers-te-koop.be/oldtimer-autos/… <-- (dutch page but with english description). That has amazed me
 
6:49 AM
I could cry..
I try to recreate a problem in JavaFX and no matter what I do, I cannot get the problem to show in a nice little code -.-
> Opened in 1932 by Joseph Beerntsen, this institution makes more than 125 different candies, including butter almond toffee, turtles, and fairy food.
TURTLES?
 
toffee?
 
motaa? ;-;
You did not by any chance ever had issues with the JavaFX TreeView?
 
7:04 AM
hya
 
aye Wietlol
 
i never had issues with JavaFX TreeView
...
not that I ever used it
but hey, its all about statistics
:D
 
That is why I wrote motaa in front :) You are not always target of every message. You are of this one tho @Wietlol
 
Hi all! again with my problem on naming things
 
7:10 AM
naming methods with is- prefix is common if it returns boolean
and i like my code reads like your normal text
 
is, has, does, goes, beats, makes, etc
 
how about putting it in the middle?
 
any question word
 
Example @AceVez
 
lets see
 
7:12 AM
you mean "myStuffIsSomething()"?
 
^
 
i would go for "isMyStuffSomething()"
 
isMyStuffSomething()
Dangit half a second >.>
 
now that you said that it does sound weird
 
;P
 
7:13 AM
@geisterfurz007 woot? :D
 
if(isResultError){...}
 
Groot
 
if(resultIsError){..}
 
if (result.isError()) {...}
 
@motaa Screenshot in a second ^^
 
7:14 AM
hmm.
 
or result.hasFailed()
 
putting it inside the object itself
 
(pls dont do result.failed() or smthn)
well... your boolean has to come from somewhere
 
if that boolean is a member of some object, then just retrieve it of that object
if that boolean comes from a catch clause, then dont put stuff below the try statement but inside it
etc
 
7:15 AM
the boolean comes from checking the object's method
 
then that might be your if statement itself
 
i was going to make a method inside the class itself, but
 
if (bla.doSomething())
however, doSomething should not return a boolean :D
 
my model classes is all getter and setter. pure
 
@motaa left side is how I hoped it would look, right is how it looks (looking at the indentation). Buttons and Test are children of M-V and Suche (respectively). For whatever reason the indentation is -9.0 in ScenicView...
 
7:16 AM
what is the method you call?
 
Have you ever experienced something like that?
And can I fix it with css?
 
@Wietlol isResultError
i guess
or isError()
 
what is the class you call it on?
 
I think you can if it of sth like an ordered or unordered list... have you taken a look at scenicview and its class?
 
before, i was going to make it outside the class itself
 
7:17 AM
something like "Request"?
 
you could check the fxcss for an ident or padding
 
@motaa checking thanks
 
then you could make an enum "RequestResult" and do "request.getResult() == RequestResult.Error"
 
now, it's inside ResponseResult
 
or maybe "request.getResult() == Error" if you statically import the enum
 
7:18 AM
@Wietlol well, you need to check every attributes the class has
so something like result.isError
 
returning enums from methods and asking for enums as parameters is much better than booleans in this case
 
@geisterfurz007 you can also remove a css class from a Node I have not tested if it is possible to remove a standard class
 
just like you said before
 
what if you add a new result type?
 
@Wietlol new result type?
 
7:19 AM
now you have like "Success" and "Failed" but now you add "Redirected"
or smthn
 
but technically it should work because the classes are loaded when the fxml is loaded
so they can be targeted to be removed
 
@Wietlol there won't be.
 
for now at least
you cannot guarantee that
not even for your own pet projects
enums are probably the most underused features
 
or overused :)
 
ResultResponse is a class that has several attributes. Whether its an error or not depends on its attributes value, hence the isError() method
isError() will check the necessary attributes to determine if it is or isn't an error
 
7:22 AM
@KarelG i doubt that
 
now that i talk about it, it makes sense if i put isError inside ResultResponse
 
I would just use the enum and set it when you create the response
maybe compute it inside "getResult()"
 
hmmm..
i'll consider putting enums
 
but I dont like it when things get computed on getSomething()
 
i'll try both
 
7:23 AM
both is probably even worse than none though
;)
you have to make a decision
maybe put the options in a Decision enum
 
I never really used enum before
 
enums are love
enums are life
 
( ͡°╭͜ʖ╮͡° )
and before i back to my den, is there anyone here ever use FCM before?
 
Flow Cytometry ?
 
Firebase Cloud Messaging
 
7:28 AM
does not exist
 
I guess no. Then i'll see you folks later. ( ͡° ͜ʖ ͡°)━☆゚.*・。゚ poof
 
7:54 AM
@Wietlol I use them anywhere I can, in JFX in conjunction with tasks they are awsome :D
 
enums?
 
ye
and where it makes sense though :D
 
i use them where I have multiple constants with the same meaning (such as the 12 months, the 7 days of the week, etc) and I use them where there are different options for something... such as operators in a language compiler, result codes from a response of a request, etc
and when passing commands to a function
 
Java 8 already has DAY OF WEEK enums
 
for my arduino project I used them to observe the connection task to the arduino and whenever data is transmitted
 
8:02 AM
i know
but as example
cant really think of anything that doesnt require mass knowledge about our business stuff :D
 
:)
 
8:37 AM
morn
 
morning
 
@motaa Sry for late answer; new educatees joined company today and we had a long talk with them ^^ Checked in ScenicView and it does not seem to be a css related issue... For whatever reason the bound in parents is -9.0 for X direction...
 
^ this
 
i just made this
how you like it ?
 
8:48 AM
> 10 Mexicans reward
 
:P
 
10 mexicans is too much for catching him.
 
hmmm
 
Hello there, is anyone here experienced with java printing? can I get some advice.
 
@AbrahamPutraPrakasa Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
9:00 AM
What are you planning @AbrahamPutraPrakasa
 
printing large image on CR80 card @geisterfurz007
 
Where does the image come from, what have you tried, etc ;)
@motaa Seems like I am getting closer to the root of the issue. For whatever reason removing the nodes from the root messes up the structure of the tree and renders it incorrectly if there is a node that contains another node that contains a leaf
 
The image source is from a file. When I resize/rescale it to 504 (width) and 808 (height). The image fit the card well, But the quality is bad (pixelated).
Some friend said that I should not resize/rescale the image, just send the large image to the printer, and let the printer handle it, but he forget how to do it.
 
So you already have some base code (that is not that long if the iamge is from a set file, I assume)?
 
Hey Guys!
 
9:08 AM
G'day
 
can anyone hlep me out with this question stackoverflow.com/questions/45200090/…
 
yes correct man, wanna see the code?
 
hello guys
 
@AbrahamPutraPrakasa Yes please use some online code-pasting tool like pastebin or paste.ofcode.org :)
 
ok 1 min pls
 
9:11 AM
anyone know how to print a webpage to pdf file onclick ?
 
could you make a snapshot of it somehow and write the image you got to a pdf file maybe?
 
see this code pls i am working on rail tickeing system project stuck in booking page paste.ofcode.org/34338HfzMKk6zTteT9Qfk6p
getting gcc overhead exceeded error
@geisterfurz007 you there ?
 
@HimanshuRay Your question is marked as duplicate of another question. The answers there clearly state what the issue is. If you checked one of the links provided in the accepted answer you would find:
> This feature is designed to prevent applications from running for an extended period of time while making little or no progress because the heap is too small. If necessary, this feature can be disabled by adding the option -XX:-UseGCOverheadLimit to the command line.
 
i tried all these things pls have a look at the code once and check for memory leaks and server logs @geisterfurz007
 
9:16 AM
To get there from your question were 2 clicks @HimanshuRay
@HimanshuRay I have no clue of that stuff. But you should be able to stop the exceptions by starting the JVM with above argument...
 
@AbrahamPutraPrakasa huh have not yet digged that far into the scaling stuff, sorry :/
 
Sorry if i'm nagging again. I want to create a static class called ResultReportBuilder which will have static methods that creates an instance of ResultReport by taking one or more objects from another classes.
So I can create ResultReport without using more than one line
Oh, and it will be inside a package called xxx.builder
 
its ok bro @geisterfurz007 thanks btw :D
 
Is it a good practice?
 
9:28 AM
that is a common pattern, yes
 
@AceVez that is a factory
which is like an alternative of constructors
the basic advantage is that they are named
and they dont necessarily have to be defined in the class itself
 
@Wietlol I want to make factories, but it seems that Spring has its own way to create factory. But since I can't still grasp how it's made, I use static class of my own
With your jab there, I think I'll make a proper factory
 
@Wietlol well, i do know that pattern
 
9:44 AM
@motaa Yeah no clue why that stuff happened to be honest... I changed my approach to set up the TreeView completely now. That one works and takes 60+ lines less code :D
 
I want to read in a HTML File, change some Data in it and then save it again. What would be the best option? Like I would a normal file or is there a better way?
 
xml/html parser?
 
xml prolly doesnt work though
 
is there a good native one? I know about DOM, but is that actually useful?
 
html is like xml, but then torn apart
 
9:51 AM
@Wietlol Yeah i know what you mean.
@CrowleyAstray jsoup.org
Mabye that one?
 
yea, that looks useful, but I am hesitant to add more dependencies to my project. might consider it though
 
@Tavo Yeah rekire (android dev from other room) was sad about it as well...
 
@Tavo SO Documentation?
 
9:55 AM
never heard of it
 
it's hasn't been up for long
it was a good idea, but unfortunately it didn't become what we all expected
 
What' Documentation? Is it documentation of stacks' answers? sorry for my ignorance
 
Yeah. And I think it was not advertised enough :/
 
no, it was meant to be a repository of different languages documentation
with examples and so on
think of Oracle's page, but with more examples and more real-life explanations
 
ah
 
9:56 AM
and then for every language?
 
HELLO
/fatcat
 
fatcat has entered the chat
 
@Wietlol yep
or at least a big bunch of them, whatever people would write
 
Well for those where the users would add an entry
 
10:02 AM
God. My head. So spring has 2 kind of factory, and I have no idea their differences and how to use them. (╯ ͡° ▽ ͡°)╯︵ ┻━┻
 
Spring. That overrated piece of shit everyone uses
 
its like swing
 
Oh boy Tavo is cooking :>
 
nah, I'm off to a few pints
 
wonders if he should star that
 
10:03 AM
and some nibbles
possibly buffalo wings
nomnom
 
tomorrow is already friday again <.<
 
@Tavo "Java? Sweet? Java is like licking a lemon that has been macerating in vinegar for a century and then it has been pissed on" wut?
yet here you are
maybe i need context though
 
maybe
6 hours to Friday here. I'll get there drunk probably :D
anyway, they are coming to pick me up now
niters!
 
niters
 
bye
 
10:39 AM
night
 
10:52 AM
Hello everyone
 
@PrakashPatil Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
what is the workaround for toggle();?
I know its depricated but it works for me so...
The only problem is it closes the div first then on second click it shows the div
which is unacceptable.
 
toggle()?
@PrakashPatil can you please read the chatroom description out loud?
 
01:00 - 11:0011:00 - 00:00

« first day (2476 days earlier)      last day (2482 days later) »