« first day (1715 days earlier)      last day (3220 days later) » 

7:04 PM
I finally found a good way to know how much data is in a packet :D
*As in not use in.available(), because that can return 0
 
do share
 
7:22 PM
@fge you gave me some code a day or so ago to help with a problem that I was having with creating combinations, this is it: hastebin.com/opequrojow.avrasm
can you explain a few things for me?
 
fge
Sure
What don't you understand?
 
7:38 PM
@ItachiUchiha That's not very nice. It wasn't a serious attempt, OKAY?! :'(
 
Gemtastic, sorry I didnt see your message earlier
 
@Gemtastic So hurtful
 
I found out as long as the socket is open you can just have something like readShort for the packet length
And the thread will of course freeze until it gets a result, but that's why we have a thread so the main program itself doesnt freeze
Although, I use unsigned VarInt's to get the packet length.
Well bye
 
This looks like it's going to be so terribly bad it's going to be kind of good
 
7:43 PM
@fge in the first line, you make the List<String> final, and you make list an ArrayList but leave the brackets <> empty. 1) Why did you make the list final, 2)Why did you use polymorphism, 3) why are the ArrayLists brackets empty?
 
@Dustiny but you're commenting on something happening 17h ago :P
 
fge
@JohnnyCoder 1. because I don"t expect it to change (the reference to the list, that is); 2. because I only need it as a List, not one of its concrete implementations, and List has everytihng I need; 3. I take advantage of type inference features in the Java compiler which appeared in Java 7+
 
@Gemtastic Well it was directed at me
and I wasn't online 17 hours ago, so I don't really see the issue
If someone posts on your facebook wall and you don't see it for 17 hours, are you just going to ignore it ever happened?
 
fge, i apologize for being thick, I actually have not gotten this far in my java learning. what is type inference? and if you only needed List, then why did you have ArrayList in there? @fge
 
fge
Type inference is the ability of the compiler to deduce from the code what type you want; for instance it allows you to write final List<Foo> l = new ArrayList<>(); instead of final List<Foo> l = new ArrayList<Foo>();
As to List, it is only an interface
You cannot instantiate a List (well, you can, as an anonymous class, but good luck)
 
7:51 PM
ballmers peak
 
fge
It just happens that ArrayList implements List
 
#hassan's peak
 
@Dustiny considering where you live, you SHOULD have been on since those 17h. so if nothing else, you're a slowpoke at getting here ;P
 
thanks fge, thats it for now, I think I get everything else, seems there is some more stuff i need to teach myself
 
fge
As always :p
 
7:54 PM
@Dustiny Syfy cut out Eureka, Warehouse 13, and some other really good shows for some crappy CGEed sharks with tentacles and whale-wolf things. This is incredibly stupid
oh yea, one last thing, IntSteam is an interface, and interfaces are supposed to contain abstract methods, how were you able to call range through an interface?
@fge
 
fge
Because since Java 8 you can have static methods in interfaces
 
NOOOOOOOOOOOO?!?!?!?
cool
seems my teacher needs to update her curriculum
 
fge
IntStream.range(...) returns a concrete implementation of an IntStream
And it happens that this static method also returns an IntStream (it is not a requirement; although doing otherwise would be quite strange)
@JohnnyCoder well, if your teacher doesn't keep up with the Java language evolutions, that's her problem
And of course, as a teacher I'd make damn sure to understand what JSR 292 is all about
After all, it's a crucial part of Java 7, and without it there wouldn't even be any lambdas in Java 8
 
java 8 came out this year right?
 
Last year
 
8:01 PM
ouch
i'll let her know, shes revamping the curriculum because she doesnt like it,
yall heard of Thomas Jefferson High School for Science and Technology?
we use their curriculum
 
Never heard of it, but I'm from Scandinavia so it's probably not that odd that I haven't
 
lol
its the best high school in the USA
they have neuroscience classes apparently
i applied, glad i didnt get in
the students there end up with no life. I know 6 of em, and they have no free time at all, barely sleep, and spend their lives in books.
 
fge
As my academic curriculum is close to nonexistent, I'm afraid I have no opinion
But my nonexistent curriculum was forced upon me by real life endeavours; had I been free to study all my might, things would have turned out differently :/
 
8:18 PM
the most ironic thing is that a science and tech magnet school has the majority of its graduates going into law
 
8:46 PM
Argument Type Mismatch? :(
Guys, I'm triggering this method:
public void handleSquareOneClick(ActionEvent event) {
    this.handleSquareClick(1);
}
And that triggers this:
public void handleSquareClick(int squareNumber) {
    System.out.println(squareNumber);
}
But it shows me an argument mismatch error.
Although the argument forthe second one is right
 
How does this get triggered?
public void handleSquareOneClick(ActionEvent event) {
 
On click
<Rectangle fx:id="SquareOne" arcHeight="5.0" arcWidth="5.0" fill="WHITE" height="98.0" layoutX="150.0" layoutY="50.0" onMouseClicked="#handleSquareOneClick" stroke="WHITE" strokeType="INSIDE" width="98.0" />
 
Uh JavaFX
 
yeeah
I can show yout he whole code.
 
Sorry, I don't do JavaFX
 
8:56 PM
Nvm
The argument must be mouseEvent not ActionEvent
 
9:28 PM
hey guys, i gotta question for you. I come from a background in dba, sysadmin, scripting languages and c/c++. I just got put on a Java project b/c I said I wanted to learn something new... We're using IntelliJ. The project organization/management/layout is really confusing me and there are a lot of new things like maven, gradle, sbt... I can easily understand code but it's everything else that surrounds and supports it which is making it hard. I don't even know what to google.
I need a crash course or something. I don't know... like something on dependency tools and project structure standards...? is that what I'm after? I have desktop notifications turned on so I'll be around for a sec if anyone wants to reply. Thanks.
 
@gloomy.penguin Maven and Gradle don't mix
They're two tools solving the same (±) problem.
 
okay so.... here's the thing... I have no idea.
it's a whole repository i get to help deal with.
so there's a mixture.
 
9:42 PM
How do I get local time with java 7 (not 8, that seems to be all I get when searching)
I've tried using Calendar and GregorianCalendar
both give me utc I suspect
 
I'm experiencing a logical error.
    int result = random.nextInt(9 - 1 + 1) + 1;

    while(this.isAlreadySelectedBox(result)) {
        result = random.nextInt(9 - 1 + 1) + 1;
    }
In that chunk,
I want to loop the while loop
until the method isAlreadySelectedBox returns true
 
@ReutSharabani Calendar should be in your local time zone per default. Check whether TimeZone.getDefault() is set to your local time zone.
 
How can I achieve it
 
@RobinKrahl thanks I'll look into it
 
that loop will loop while isAlreadySelectedBox returns true
if you want it to loop UNTIL it returns true, use !isAlready...
 
9:45 PM
@HassanAlthaf negate the condition: '!sAlreadySelectedBox(result)`
 
@RobinKrahl I realize my mistake. I'm using a vm in which the clock is not set and I'm looking at my machine's clock. Sorry :D
 
@RobinKrahl lol code broken
its k nvm
I fixed the logic myself
 
10:39 PM
In particular, the following design patterns are used throughout the text: singleton, container, enumeration, adapter and visitor
who made singleton, and why did they make it sound like someones last name?
 
Feeling good.
Almost done with the TicTacToe game I was coding.
 
ooh tic tac toe! i made connect 4 and it was ugly as poop
im gonna give my connect 4 an AI sooner or later
@HassanAlthaf
 
have the computer play against you
 
My TicTacToe plays against the user
 
10:45 PM
might as well make an "connect arbitrary N" :)
 
really? thats cool
 
@JohnnyCoder Yup, but all it does is, that PC selects a position which is not already taken.
Not really AI
lol
 
ah
gotta play with that algorithm. I think it's gonna end up being sort of long, you have to get the computer to know if the user is about to win and to block that move, it would be fun. Cant wait to write my AI for my connect 4
 
11:48 PM
I have a java program that 'goes to sleep' for long periods of time. In the meantime, some times, my pc suspends, and the program somehow 'misses' the signal or interrupt for it to wake up. This causes the program to sleep forever. Is there a way to fix this?
 
So I've been working with CDI today. I understand how to generate an instance of any given class using Instance<?> and then select(@annotation).get().
Does anyone know what I should be looking at in order to get the existing instance of the class ,rather than creating a new one? For instance, if I want to iterate though a group of entity controller classes calling the search function?
As nice as forEach() is, I don't want new instances of them.
 

« first day (1715 days earlier)      last day (3220 days later) »