« first day (2018 days earlier)      last day (2915 days later) » 

4:12 AM
Hello. If example 2 is called an array initialiser, what is the name for the first example? Thanks

example 1:

int firstArray[] = new int[3];

firstArray[0] = 123;
firstArray[1] = 645;
firstArray[2] = 756;

example 2: int secondArray[] = {2,4,6,2,6,7,9,1,3};
 
5:06 AM
hi anyone knows if javadocs are available for jooq? or the correct question would be how to make the javadocs appear on hover in eclipse.
i have downloaded and imported the necessary classes for jooq including those with -javadoc jars. @fge
 
 
2 hours later…
7:08 AM
morn
 
7:51 AM
o/
 
 
1 hour later…
8:54 AM
Morning room
 
\o
 
Can you see why the output of my code isn't under the headers? I don't think I've misunderstood how \t works.

The relevant code is:

System.out.println("face\tfrequency");

for (int face=1; face<freqArray.length; face++){
System.out.println(face + "\t" + freqArray[face]);


Thanks
The numbers for the frequency print too far to the left and aren't under the 'frequency' header.
 
because tabs usually are 4 chars wide... face + tab => next column is 9
1 + tab => next column is 5
 
@Nicktar thanks
 
9:18 AM
morn
 
hi cat :3@CrazyNinja
 
Meoww... Hans-eooowww
 
meoooww
 
9:38 AM
 
:O
 
Selenium tester here?
 
9:59 AM
 
:o
cat"my money"
 
10:24 AM
Selenium question answered. thx to the kittens.
 
kittens power!
 
@PomeGranate meh. I don't know about Selenium dude. sorry for that
 
@CrazyNinja as I said: my question is already answered. no joke. :)
 
of course it is
never underestimate the kittens
 
haha
 
10:26 AM
cat-five
it looks annoyed though
:D
 
 
2 hours later…
12:49 PM
The last message was posted 10 hours ago.
 
Morning, Java!
 
morning michael o/
 
1:04 PM
mornin
 
1:23 PM
Hello all. I'm trying to find the java files I've saved / created using intellij on my CP. Can't for the life of me. Where might they be?
Sorry. Got them c:.... IdeaProjects
 
1:44 PM
Morning @Hans @ballBreaker
 
2:01 PM
Can anyone recommend a java book I can learn from?
 
only a german one
and that wont help you much
:)
 
Let's learn JDK 5!
 
well this book is old
is used to learn with it back then
 
fge
@JohnnyCoder "thinking in Java", probably; and then "Effective Java" and JCIP
 
Ich spreche Deutsch. @Hans1984
 
2:15 PM
theres a newer version of it though
 
JDK 5 .. shivers
 
Aber nur ein bisschen :(
 
:)
 
Ich werde mehr Deutsch lernen bei Uni.
 
2:16 PM
its a good book
helped me alot
 
maybe ill buy it to test my german skills
 
and it has a tiger on it
i mean how cool is that?
 
very cool
 
;)
its the java tiger
refering to java - the island
 
:)
ouch 32 euros
but its the 2001 edition. wonder if theres a newer one
lol there's a kindle edition
 
2:20 PM
used for 5€
The Javan tiger (Panthera tigris sondaica) is an extinct tiger subspecies that inhabited the Indonesian island of Java until the mid-1970s. It was one of the three subspecies limited to islands. == Characteristics == Javan tigers were very small compared to other subspecies of the Asian mainland, but larger in size than Bali tigers. They usually had long and thin stripes, which were slightly more numerous than those of the Sumatran tiger. Their nose was long and narrow, occipital plane remarkably narrow and carnassials relatively long. Based on these cranial differences, the Javan tiger w...
extinct
:(
 
Well geneticists brought back an extinct southeast asian water buffalo with cloning
we can bring back the javan tiger too
 
yay!
 
lol we could try to bring back dinosaurs too
 
maybe we can bring back dinosaurs aswell
 
Jurassic Park in real life
 
2:24 PM
loool
same thought :D
 
:D
@fge JCIP = Java Concurrency in Practice
??
 
2:37 PM
anyone qualified here to answer questions about the spring framework?
 
@JohnnyCoder Java Concurrency is Poop.
 
I am not, but i can try to answer
 
is this some kind of pokemon?
 
do you know something about sessions and security?
 
What about it?
 
2:42 PM
I'm creating a website and thus I've a few controllers listening to certain urls... now, the problem is that even if I'm not logged in with a user, say "bill-gates", I can type the url localhost:3000/home/users/bill-gates and it shows me the page saying "Welcome bill-gates!" even though bill-gates has not logged in to the website using the form. What's the problem here?
 
lol @MadaraUchiha
 
That could be anything, how does your config file look?
 
I don't have indeed any config file since I'm using SpringBoot... I'm really new to Spring (and in general I have little experience in web development), so I'm not sure what I should do...
 
ill be starting university in the fall. ill be on a lot more often to get help :) see yall later
 
cu
 
2:49 PM
In general, I would like just the logged user to navigate through certain pages...and just a few pages would be available to all people... I think I need to setup sessions, but I'm not sure, and I would not know how to do it... if you show me a concrete example, it would be nice
 
3:13 PM
@nbro Frankly, if you're new to web development, I'd try PHP before I try Java.
 
bye
o/
 
3:28 PM
@nbro Do you have any SecurityConfiguration for Spring Boot?
@MadaraUchiha PHP might be easier to start with but it promotes messy programming when used as an unsupervised learning tool
 
Hey everyone!
 
@Nicktar It helps you understand the principles of HTTP, cookies, sessions, authentication, etc.
 
@MadaraUchiha true but it it skips stuff like type safety and as a consequence code readability.
 
@Nicktar You can do those things after you understand HTTP, and go back to Java.
 
@MadaraUchiha if your proposal is something along the lines of "learn programming with a typesafe compiled language", "learn the scary stuff hand on with PHP", "happily get back to Java", I agree ;)
 
3:40 PM
actually I had some experience with Express and Node, but you know
I don't have any securityconfiguration file...
 
@nbro then each of your endpoints is "free for all"
you need to extend WebSecurityConfigurerAdapter, annotate the class as @Configuration and maybe slap an @EnableWebSecurity annotation on your main configuration class
that link might help
 
@Michael I have been getting this error --> sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. Have you ever come across and resolved this issue?
 
Has anyone here used Principal Component Analysis before?
 
not in a java context
 
4:35 PM
@Kanth No, sorry.
 
fge
 
6:15 PM
http://www.commitstrip.com/en/2016/05/02/life-of-a-freelancer/
CommitStrip
Life of a Freelancer
CommitStrip
1462212544
 
@Michael ;/
 
6:32 PM
Hello, how to debug in Intellij? I've marked a line with breakpoint (left mouse button), but when i run 'debug' it doesn't stop there.
 
@Kropekk Then your code doesn't reach there.
 
@MadaraUchiha when i mark "try" line, it doesn't work - but when i mark the line after that, it works well... should it be like tihs?
 
@Kropekk Yes
 
why?
 
@Kropekk Because you can only break on statements, and try { is not a statement.
For the same reason you cannot break on class Foo {
 
6:36 PM
and on while(), if(), for()?
 
@Kropekk Those are statements, so you can.
 
well. it is a boolean statement...
ok
anyway - are a frequent visitor here?
it's me second day on this channel and it seems to be... abandoned?
 
meooww
 
fge
@Hans1984 meh, my cat uses logs to sharpen his claws
 
:o
is it also in love with a racoon
?
or a watermelon?
 
fge
6:48 PM
Nah, we have no racoons or watermelons here
But we have logs
So, eh
 
hehe
 
fge
And we have non castrated female cats, and my cat is a non castrated male
So, eh
 
sometimes you have to castrate them
i once had a dog , we had to castrate him
 
fge
I will never, ever do that
 
because he was fucking around all over the place
 
fge
6:51 PM
Not in my life
 
yes i was against it
but i was a child
and my parents decided so
 
fge
If anything, the only living beings worth castrating on Earth are humans
 
;/
well they should have done that a loooong time ago....
im pissed my wages are not there
someone has to get hurt...
soon
 
@fge We thought so too, we very quickly decided for in our (female) dog's case.
Blood, horny dogs at our doorstep, no thank you...
 
i'm on fge side here
you should never castrate any animal
 
fge
6:54 PM
<-- had 8 kittens at home at a time; all of them are now in other families
I've never regretted it
But now I only have males
 
@fge It's a lot of headache, that not everyone are capable of handling
Finding homes, making sure they're good homes and won't be abandoned/abused
I don't think there's a perfect right or perfect wrong answer here
 
yeah i can understand that
 
It depends on a lot of factors
 
but it wasnt your fault
it was the male dogs owners fault
 
I live in an area where dogs roam freely
 
6:56 PM
they should get castrated instead
 
A village of sorts, if you may
 
i see
 
This lead to a couple of nasty cases where my dog (who is a big bully) had met some of them (some twice her size) in glorious combat, and promptly kicked their asses.
My dog is a big bully, so we don't let her roam
 
:o
 
She's perfect with humans though, it's just other dogs she hates for some reason
 
fge
6:59 PM
Anyway -- I love my cat(s) and won't ever have them castrated in any event
And yeah, some of them die young
 
7:10 PM
g2g now
bye guys o/
 
@fge do you have a minute?
I'm struggling with reflection
 
fge
Uh
I don't use reflection that often, but ask anyway
 
given that x==int.class:
if(x.isPrimitive()){
try {
objlist.add(x.getConstructor(new Class[]{String.class}).newInstance("0"));
} catch (Exception e4) {
success = false;
break;
}
 
fge
Ow
 
don't worry about objlist ; why do i have an exception nosuchmethodexception?
 
fge
8:06 PM
Because String has no such method
 
String? why should string have ant method? i'm calling constructor which requires string object, which i do provide?
 
fge
For what you want to do, you want to use MethodHandles
Your x is int.class
 
i want to create int object
yes
so... why is my approach wrong?
 
fge
int is not an object to begin with
Classical reflection can't do that
MethodHandles, however, can
 
yeah, i know it's a primitive - but i need to create universal constructor, and for example to create Integer i need to pass int to it
i don't know about methodhandles?
 
8:28 PM
Do you think we can unlock this question? stackoverflow.com/questions/30000088/…
 
9:03 PM
@StevenBluen why on earth would we??
 
 
1 hour later…
10:25 PM
heya @Unihedron .. did you see the activity on JavaBot?
 
@Vogel612 because there is value in it and because the reason for it being closed is now resolved
 
@StevenBluen what? I'm not even sure we're reading the same question .......
the question asks about how one would go about implementing something that's by all means a language feature
C# or another language with operator overloading might even make it possible, but I can't for the life of me figure out why anybody would need that feature
let alone how you would be able to implement it in java.
the question makes no sense the way it's asked.
like... absolutely no sense at all...
 
10:47 PM
@Vogel612 Cool!
@Vogel612 annotation preprocessors
 
@Unihedron meh.. that's basically a crutch that's actually manipulating generated bytecode.
 
not saying it's sensible or rational (syke, it actually is rational), but it is not impossible
 
I'd not consider this java...
Call me a purist :D
 
Code done in Java but not in spirit of Java...
anti-java?
 
I think "an abomination" fits best :)
 
10:54 PM
Hello is there anyone here who is good in java multithreading? I need some assistance.
 
Is anyone good at car diesel?
 
@Uni
oops
 
@StevenBluen don't do it
implementing negative indexes I mean
 
@Unihedron what do you mean by annotation preprocessors?
 
python is a failure, along with concepts that come along with it. if you're going to do Java, learn Java and use Java
 
11:00 PM
@Unihedron Hey man can you help me with a problem that I'm having with my multithreaded sudoku solver?
 
@StevenBluen annotation preprocessors are classes that make use of the annotation processor API in Java 6 and do stuff to / based on / with the source code with or without annotations in mind, originally for artifacts to define functionality similar to "Deprecated" and "Override", although its capability enables more control that you can implement (fake) overloading and stuff like that during compilation
or something like that
 
yeah, I guess I shouldn't try to use annotations like that in Java
 
it's disappointing, but annotation proprocessors are used correctly very rarely
either it gets ignored and gets an alternative with a script somewhere else, or is used to make an ugly hack
 
although the ability to write "extension = filename.split('.')[-1]" is definitely something I miss when programming in Java
 
You can assign it to a final String[] and then use it.
final String[] segments = filename.split('.');
extension = segments[segments.length - 1];
verbose language is verbose
also don't assume that all files has dots, or make your program be dependent on supplying the proper format as an extension part - read MIME type for that
 
11:12 PM
understood
if "." not in fname or fname.split(".")[-1].lower() not in exts:
print "UNKNOWN"
else:
print exts[fname.split(".")[-1].lower()]

For reference, that was part of my solution to an easy CodinGame challenge.
 
fge
11:38 PM
Erm
THat is not Java code but Python code
 
39 mins ago, by Unihedron
python is a failure, along with concepts that come along with it. if you're going to do Java, learn Java and use Java
 
@Unihedron Hey man can I ask you a question related to multithreading?
 
I cannot guarantee that I will answer.
 
That's ok
I trying to implement multi-threading to my sudoku solver and I can't decide whether to use a FixedThreadPool or a cacheThreadPool. I figured that a fixedThreadPool would be more appropriate seeing that I want to use N number of threads where N is the number of rows I have in the board. Though I'm not sure if it might be better to use a cacheSizePool in this instance.
 
fge
@LuisAverhoff are you aware of Amdahl's law?
 
11:45 PM
No
 
fge
If you are not, then consider the algorithm you want to implement first
 
Well I have already finished my single threaded sudoku solver and have coded a little bit for the multi thread part.
 
fge
And how do you think a parallel algorithm will help?
 
But I've been having some problems in regards to the multi-threading aspect of the program.
It is for a project in school.
We had to pick a project that we could parallelize and I chose sudoku.
 
fge
Bad choice imho
 
11:49 PM
Can I explain to you how plan to parallelize it?
Also regardless if the multithreading part is slower than single threaded part, it is still useful information I include in my final report.
 
fge
Ohwell, OK
That could be an interesting exercise
Since if you are doing it wrong, you could end up with lock inversions or deadlocks
 
Well one step at a time.
I have a class called naiveSolver that uses recursion and backtracking.
This is all for the single thread part by the way.
The first step is that we calculate where we are in the board.
Then we check if the cell does not have the value of zero.
If it does not, then we skip the cell.
else we try to a value and see if it works.
 
fge
What does zero mean in that context?
No existing value, ie unsolved?
 
No exisitng value
Kind of like a space
I chose to do with integers instead of characters.
 
fge
Fair enough, that seems logical
 
11:54 PM
But anyways.
This is where the recursion and backtracking comes in.
Now let us say we have a 4 * 4 board.
and we start a 0, 0
That means we have 4 possibilites to try.
If the value that we insert works, then it is a valid partial solution.
 
fge
Curious
 
else, erase it and try the next value.
 
fge
I'd have gone with impossible solutions first
 
We keep doing this until we fill the last cell. Else the solution is unsolvable.
That is the gist of the algorithm and what I want to parallelize.
Now it is time for the multithreading part.
 
fge
Do you memorize the solutions which failed already?
 
11:58 PM
What do you mean exactly?
I have looked over sudoku puzzles online and my solver has solve them correctly.
 
fge
OK, say you are in a particular cell; by inspecting 1. the surrouding "square", 2. the row you are on and 3. the column you are on, you can already deduce which values are not possible for this cell
I am not saying that your algorithm doesn't work
 

« first day (2018 days earlier)      last day (2915 days later) »