« first day (1409 days earlier)      last day (3526 days later) » 
01:00 - 13:0013:00 - 23:00

1:15 PM
What's wrong with color or Color?
BTW: Hi!
 
@Karl heya
 
How you?
 
m good...
 
I'm finding flaws in my code, got to figure out why a part is not working
 
Debugging! Fun times!
 
1:21 PM
Yeah!
My high scores don't count the number of Drips...
Since it's not right as it is, I'm wondering if I should have it count only drips earned in a game...
 
@Karl still working on the game ?
 
1:37 PM
Yes I am
 
great ! Take some time and answer few basic questions for people facing issues on java ! If that is what you were looking for..
this will keep you updated with all new questions being asked on java
you can filter them, have a look on which questions you can answer..
 
However DONT answer questions that are about to be closed.
Or bad ones in general.
 
0
Q: Iterating through a list twice

user3253067I am trying to reduce the size of a list by choosing only the elements that i need. So basically i have a list of LineStrings and i am trying to check if the start node and the end node of a linestring can be found in another multilinestring. If yes i will keep the linestring, if not i will ignor...

a nice question to start :P
 
> Help!I am going nuts here!
@ItachiUchiha
 
Reading...
 
1:54 PM
@Karl
 
He did state that it keeps running after an hour, so suggested something to help him debug...
Maybe I should have just made it a comment...
 
Even if it doesn't get flagged it's not going to buy you upvotes anyway..
What's your field of experience in Java? inheritence? oop?
 
LOW
 
Do you do other technologies aside from java?
 
It's been a long time. I dabbled with C++ over a decade ago, Fortran, RPG ][, COBOL in the late 80s. Pascal, Forth, Logo, BASIC back in the early 80s [All iterations of BASIC that I'm familiar with use line numbers] I've had some advanced DOS .bat files...
 
2:04 PM
There are a lot of unanswered [batch-file] questions; Java is a high traffic tag, people vote up content easily, but only under the condition that you're faster than others to get out the answer, and it actually works.
 
2:16 PM
Good morning, Java!
 
Hi Michael!
 
@uni what z the cv-pls tag used for ?
 
close votes please.
 
Hi Michael
 
Hiya @Michael
 
2:18 PM
Hi @All.
 
Usually expressed in the format [cv-pls] url to indicate that a question is in dire need of closing.
 
ahh i see
i voted for few questions to close today
 
2:47 PM
How is the bot coming, @Unihedron?
 
He crashes a lot because I run him on IE.
 
Why do you torture him so? xD
 
xD
How do you check if a string is empty? Is there string.isEmpty() or String.isEmpty(String) or string.equals("")?
 
Well, define "empty".
Empty as in zero characters or empty as in no readable characters?
 
Zero characters.
 
2:52 PM
Why is everyone against IE? We have multiple browsers on most of the machines, and all the windows machines, everybody uses IE...
 
String.isEmpty()
 
I know, I know... I never expected the capabilities of IE to be that bad, but apparently it can't handle websockets.
 
Oh, do you mean in Javascript?
 
The "is string empty" question is in Java. The bot is in JS.
 
Oh ok.
@Karl Because IE has always lagged behind in terms of adopting the latest web standards.
 
2:54 PM
I can't find where I check for a new high total of drips! :(
Ahh….
 
3:12 PM
Hi @Unihedron
 
Heya @Bohemia!
 
What's up bro
Don't laugh and see this code :D what's wrong with it?
 
Been great, moderating the site, hunting for good questions, wrote a self Q&A, earned some badges; did some code, chatting with users on chat stack overflow, etcetera.
 
int a,b,c,d,x,y;
   i=iota;
   x=a+ib;
   y=c+id;
   x+y=z;
   z=(a+c)+iota(b+d);
   System.out.println("Result is" +z);
 
Stuff is not defined?
iota, ib, id, x+y=z <- is just wrong, iota() are all missing
 
3:15 PM
It's a complex number program and I did this on my own now, I'm pretty sure it's wrong but don't know what's wrong and how to fix it
Sorry ?
 
You can't use iota without defining it first.
 
I defined it ? I mean i=iota
 
Same with the other variables - ib, id, z, and the method iota().
 
and x+z is not a valid lvalue, even though x and y are declared
 
You cannot have an expression x+y=z. An assignment (=) must have the variable to the left and the expression on the right. You might want z=x+y.
 
3:20 PM
:( gosh everything was wrong. When I'm going to learn programming grrr. I'm practising but still
 
int a,b,c,d,x,y;
   i=iota;
    ^ not defined at this scope?
   x=a+ib;
      ^ not defined at this scope?
   y=c+id;
      ^ not defined at this scope?
   x+y=z; // this is not a valid expression
   z=(a+c)+iota(b+d);
  // err.. no comment
   System.out.println("Result is" +z);
 
What is the method to declare iota?
 
int iota;?
 
Um, oh! I thought we already have a method for iota in java like math class or something cause after all it's a complex no.
 
then... Math.iota()?
 
3:27 PM
There isn't one. Java has no builtin support (afaik) for complex numbers. (and no operator overloading, so it's not possible to make a convenient complex type by yourself)
 
@kiheru Dude! [Sir]
 
hi @Karl
 
How are you?
 
I'm fine
 
uni
 
3:33 PM
I'm good...
 
I'm unable to do it, I'm kinda messing up
 
I'm frustrated, I cannot find the point where we are supposed to update the max Drips...
 
int a,b,c,d,x,y,iota;
   x=a+ib;
   y=c+id;
   a=2;b=3;c=4;d=5;
   System.out.println("Result is" +x);
   System.out.println("Result is" +iota, +y);

I don't know what I'm doing
 
Me neither
 
ha ha seriously? You can't program complex no. ? I won't believe that even if god would tell me :D
karl and others online, do you know what to do?
 
3:37 PM
@Karl ScoreManager.updateScores()
 
I mean, if you tell what the expected behaviour is, I might get it done... but "I don't know what I'm doing" I don't know what you're doing either >_>
 
ha ha :D you are right, I'm doing something that would make sense in some parallel universe. Anyway, question was addition of complex numbers.
 
That would be by using .add() of the appropriate Complex class. Java can't do complex by itself
 
@kiheru how to do that?
 
The first thing that is needed is a class that implements the complex addition. Those can be written by yourself, or a ready made library can be used. I don't know your requirements
 
3:45 PM
^
 
:-|
 
Lousy math support tends to come as standard whenever someone creates a new programming language. There may be support for the oddest things in the standard library, but not a trace of matrices (let alone complex numbers or quaternions).
 
4:24 PM
hello ppl!
 
Hi @compski, how are you?
 
good im ok =p
i know Java somewhat but confused about how maven works
like i cant find any psvn(string args) methods in a maven project to run lol
 
5:23 PM
@compski Maven adheres to the "convention over configuration" mindset.
2
This means that all Maven projects share the same, basic structure.
To compile a Maven project, you run "mvn compile".
To run the unit tests, you run "mvn test".
And to execute a full build, you run "mvn package".
 
5:35 PM
hey guys
 
5:53 PM
I'm back!
 
 
2 hours later…
7:34 PM
Dead chat...
 
@Karl hi
 
hi! anyone here has experience installing oracle xe on ubuntu?
 
Does treemap uses equals ?
(when using contains)
or add
anyone ?
 
why will it use add ?
 
@ItachiUchiha im staying : When I add to a TreeSet , how does it know if it's already there ? via compareTo or equals ?
I've heard that treeset doesnt use equals to see if element s already there
(Im talking about TreeSet. not TreeMap - my apology)
 
7:47 PM
I revived the chat!
 
i guess all set uses similar approach
 
But the docs says : Adds the specified element to this set if it is not already present. More formally, adds the specified element e to this set if the set contains no element e2 such that (e==null ? e2==null : e.equals(e2)
so it does use equals ???
 
yeah.. most probably it will use equals..
but I cant find anything in the docs related to compareTo
 
(first paragtaph)
 
The current implementation uses equals, but that was not the case in some older versions. Current still requires that compareTo() i consistent with equals()
 
7:58 PM
@kiheru if i put a breakpoint in equals - it DOESNT enter
 
@royi can you share the link to the doc where it says that it uses conpareTo()
 
Yeah, sorry, reading the code right now. ContainsKey checks equals, but put() just uses compareTo()
 
read the first answer here :coderanch.com/t/532388/java/java/…
 
groan, I'm too tired obviously. containsValue(), not containsKey()
 
@kiheru also containsKey doesnt enter equals ( in debug)
Sorry : contains. there is no containsKey
 
8:07 PM
    Anyway, the relevant part of put() does:

            do {
                         parent = t;
                         cmp = k.compareTo(t.key);
                         if (cmp < 0)
                               t = t.left;
                         else if (cmp > 0)
                                t = t.right;
                         else
                                return t.setValue(value);
             } while (t != null);

    So it indeed does not use equals() there
 
Where did u get that code ?
(im c# developer , new to java)
 
TreeSet uses TreeMap, so Treemap is the interesting source
TreeSet.contains() just calls TreeMap.containsKey(); which as you said does not call equals() (the getEntry() it calls uses only compareTo())
The docs you referred was those of Set I presume? That contract is still held, if compareTo() is consistent with equals() (ie. returns 0 if, and only if the objects are equal as per equals())
In that sense it's not really all that different from HashSet. That too breaks spectacularly, if hashCode() is not consistent with equals()
 
8:31 PM
tnx very much
 
8:55 PM
 
Hi all
i'm having this annoying problem with inheritance and I can't figure it out
I have some private int in a class and a contructor
now I want to extend that class and use these private ints
in another class
how do I do that?
 
either make them not private, or add accessors to them
 
kiheru, I tried the not private but the automarker gives 0
so I need to let them private
 
automarker?
 
yeah I need to submit it and it gets autocorrected with the college app w/e
 
9:06 PM
anyway, given a:
     private int foo;
accessor methods can be written:
     int getFoo() {
        return foo;
     }
and
    void setFoo(int newFoo) {
         foo = newFoo;
    }
 
aha
lemme try it
 
then the extending class could call getFoo() and setFoo() as needed
 
I tried it but then it says convert it to Static
I mean eclipse gives the suggestion along with the syntax error
 
huh?
 
public class Vehicle {
    private int numPassengers;
    private String colour;

    public Vehicle(int passengers, String colour) {
        this.numPassengers = passengers;
        this.colour = colour;
    }

    public int getnumPassengers(){
    	return numPassengers;
    }

    public String getcolour(){
    	return colour;
    }
    public String toString() {
        return colour + " " + numPassengers + " passengers";
    }
}
class Plane extends Vehicle{
	int planeNumber;
	String planeName;

	public Plane(String colour, int passengers, String planeName, int planeNumber) {
		super(getnumPassengers(), getcolour());
		this.planeNumber = planeNumber;
		this.planeName = planeName;
	}

	public String toString() {
        return getcolour() + " " + getnumPassengers() + " passengers " + planeName + " " + planeNumber;
    }
}
the super part is the wrong part
 
9:12 PM
instead of:
       super(getnumPassengers(), getcolour());
call the superclass constructor like:
       super(passengers, colour);
Those are parameters to the plane constructor, after all
 
 
aha
this whole thing is a bit murky
I need to get a good grasp of this stuff
 
(getnumPassengers() would not return anything sane at that stage - it would return 0; the default value of int, because the number of passengers has not yet been set)
 
yeah
do you have some good resources where I can get some useful tuts on these stuff?
 
the official java tutorial is a fine resource: docs.oracle.com/javase/tutorial . I don't know good it is at explaining the basics though. I jumped in from other languages so I just skimmed through the first steps
 
9:17 PM
i have a python background it doesn't help much thoug
yeah I'm reading the docs
I think its the only best resource I got
 
 
1 hour later…
10:37 PM
I stumbled on an interesting question here.
The original poster posted what looked like a typical homework dump question, but couldn't show his code for "security" reasons, since he worked for the Defense Department of some country.
Intriguing to say the least!
 
01:00 - 13:0013:00 - 23:00

« first day (1409 days earlier)      last day (3526 days later) »