« first day (1410 days earlier)      last day (3521 days later) » 
02:00 - 13:0013:00 - 00:00

2:06 AM
@HovercraftFullOfEels Are you around?
 
2:32 AM
Hello?
@user2809564: what's up?
 
hey need quick help if you have some time for review to see why I am having issues with my code. I opened a SO post but got nothing so far, its been a while
 
Sure. Ask a question on the site, and any/all of us would be glad to check it out.
 
I opened a SO post but got nothing so far, its been a while
so I did a bounty as well just to attract more people as well.
Here is the question in case
3
Q: Why I am seeing lot of TimeoutException if any one server goes down?

user2809564Here is my [DataClientFactory] class. public class DataClientFactory { public static IClient getInstance() { return ClientHolder.INSTANCE; } private static class ClientHolder { private static final DataClient INSTANCE = new DataClient(); static { ...

 
@user2809564: ah wish I could help, but if you look at my tags, you'll see that client-server isn't one of them, and in fact I know next to nothing on this subject. But best of luck, and remember to address EJP directly in your comments by using @ and his name. That will notify him that you are commenting back to him, which is important, because he probably does know this field.
 
sure I will do that. Thanks for the help.
 
2:40 AM
@user2809564: again, much luck!
 
 
2 hours later…
4:50 AM
@HovercraftFullOfEels 153k rep! o_O Great.
Hello Java!
 
 
1 hour later…
6:01 AM
heylo !
 
 
3 hours later…
8:44 AM
hallo
 
hmm
 
@compski do you have an idea how I can use private instance variables in a subclass?
 
Members of a class that are declared private are not inherited by subclasses of that class. Only members of a class that are declared protected or public are inherited by subclasses declared in a package other than the one in which the class is declared.
 
^what he said
 
I know but the assignment wants me to use the private variables in an inheritance
this is annoying, because it doesn't make sense
I can't get it to work
 
8:49 AM
have u tried doing "this.<private variable name>"?
 
if they must be private, the only reasonable way is to provide accessor methods that are not private
 
wait lemme show u my code
 
by the way, if the only task is appending stuff to toString(), you don't actually need to access the private fields
 
This shouldn't change
public class Vehicle {
    private int numPassengers;
    private String colour;

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


    public String toString() {
        return colour + " " + numPassengers + " passengers";
    }
}
 
oo standard oracle tutorial
 
8:55 AM
Now I need to extend this class and create a car class which gets the passengers and colour from vehicle
and add another parameter to car,number of doors
 
public class Vehicle extends Car{ ...}
 
class Car extends Vehicle{
	int numberOfDoors;

	public Car(String colour, int passengers, int numberOfDoors) {
		super(passengers, colour);
		this.numberOfDoors = numberOfDoors;
	}

	public String toString() {
        return colour + " " + passengers + " passengers " + numberOfDoors + " doors";
    }
}
nop car extends vehicle
but now you see my problem is colour and passengers in the latter code,
 
what does the assignment actually say about getting the fields?
 
the return part gives syntax errors
 
syntax errors say wat?
 
8:57 AM
field Vechicle.colour not visible
 
1. is the requirement to leave Vehicle unchanged? 2. Do you only need a toString() that prints number of doors too?
 
I can't change it to public so I don't know
I don't need a troString() to print number of doors, Vehicle should not be touched
for passengers I get the error "passengers cannot be resolved to a variable"
 
if 2., then I'll give a hint that it's possible to call the superclass' toString(), and append stuff to it
ok. then don't try to access those fields
in toString(), you can get the string corresponding to vehicle by calling super.toString(). Then just append the number of passengers to it
 
yea ok gtg for awhile
 
here's what I tried
class Car extends Vehicle{
	int numberOfDoors;

	public Car(String colour, int passengers, int numberOfDoors) {
		super(passengers, colour);
		this.numberOfDoors = numberOfDoors;
	}

	public String toString() {
		String objectStr = "";
		objectStr = super.toString() + colour +" " + passengers + " passengers " + numberOfDoors + " doors";
        return objectStr;
    }
}
Still doesn't work
:(
colour and passengers gives errors in the objectStr part
brb I'll have a smoke, my brain is melting :S
 
9:04 AM
Think for a moment what super.toString() does.
 
it converts each of the variables to a string
 
The thing is, you don't need to use colour or pasengers in Car.toString()
 
So basically we are taking string and concatenating it to objectStr
But how is it gonna know where to place colour and passengers?
 
it calls Vehicle.toString(), which does have access to those variables
 
okay lemme try it
I don't know where I will learn to fill those gaps
I need to get my Java right I got 1 month before the exams
Its too little to learn all this
brb
 
9:07 AM
you only need to append something like ' " " + numberOfDoors + " doors"' to what Vehicle.toString() already does
because Vehicle.toString() already takes care of colour and passengers
(As a side note, I don't think it's a good practice to rely on super class toString(), and it would be better to let Car read the relevant data instead. But whatever, you need to stay within the limits of your assignment, and the requirements are not always sane).
(I can understand why the assignments is how it is though - the purpose is to teach using super class constructors and methods - but it is not how I'd do it in real code. That kind of string juggling is a fragile approach)
 
I wouldn't do this as well
There is no point extending vehicle if the colors and numberofpassengers are private
this seems contradictory
 
9:39 AM
What does?
 
9:55 AM
Please vote to close this question
-2
Q: I want to add the results into a comboBox what should I do? here is my code

Sandilya Ventrapragadajava.util.List<Questions> category = new ArrayList<Questions>(); Session session1 = LoadContext.getSession(); Query p = session1.createQuery( " from " + Questions.class.getName() + " group by Category "); category = p.list(); System.out.println(category.get(0).getCategory() +"\n" +category.get(1)...

 
Just did. Btw, please don't make them one-boxed.
 
one-boxed ?
 
 
1 hour later…
11:34 AM
How can we raise issues for names of Chat Room such as Java Sucks
 
Dunno. Flag a message for moderator attention and write a custom reason if it's not urgent. Or ping a mod to discuss (but probably won't be effective), or bring it up on Meta.
Preferably the last.
 
Such names are not friendly on SO chat, as they put down the name of a particular language
 
You can always post meta discussions. You get to see if the community agrees with your viewpoint as well.
 
in meta chat rooms ?
 
Basically if someone agrees with what you post, they +1, otherwise -1. So the overall post score is how much the community likes what you say.
 
11:49 AM
Do you think I should ask it here ?
 
Feel free. It will probably get migrated to MSO though.
 
Greetings...
 
Greets
 
How you?
 
12:08 PM
@Unihedron
-1
Q: Naming convention for SO chatrooms

ItachiUchihaSometime back I came across a chat room created on StackOverflow Chat named as Java Sucks. I wanted to flag about the name of the chat room, but didn't find any way to do it. Nevertheless, I thought that some moderator would come across it and eventually it will get blocked. Today, after few mon...

lolz
people are already downvoting me
 
That's Meta. Either it has a positive score at the end and a mod looks at it or it doesn't. Now we wait.
 
yeah
it came to -1
then +1
now it has settled down to 0
:P
 
That's your first Meta post lol. :P
 
yeah i know :P
 
I'm lucky to not have negative score content on Meta without deleting anything so far.
 
12:20 PM
I think I'll vote it up too. Even if no action is decided on it I think it's a good question. It can't hurt to have some policy about the names
 
@Unihedron lucky guy ;)
@kiheru tnxx
 
12:37 PM
Morning
 
Morning
 
For what it's worth, I didn't downvote, I just disagree :P
 
I just open a discussion :P
 
Let's go make a room called "'Java sucks' sucks". :)
 
haha
 
12:41 PM
I don't mind the channel existing either, but I think it's good to have some official statement about the names
 
@ItachiUchiha your post itself expresses a clear opinion though - that these names should be forbidden and that's what people are voting on
 
@BenjaminGruenbaum Oh you should vote and participate:
> Up/downvotes are casted by the users in the community to indicate if posts are useful (See hover popup on vote buttons), not as an encouragement to attempting. On another hand, users are encouraged to vote and are allowed / supposed to downvote for the content like so (except targeting other users).
 
@Unihedron thanks for stating the obvious :D
 
this chat is sounding like meta than java o.0
 
I mean, Java is totally the best, so if you have any ideas of what Java things we can talk about, go ahead!
 
12:45 PM
HAHAHA i saw that removed post
 
@Unihedron Java is awesome, who needs run-time generics, first order functions, or modern thread abstractions? Those all make unreadable code.
UnsupportedOperationException is the best :D
 
ok jokes aside .. i was just wondering... is there a specific way to call a java method from a really huge maven project when like there exist no main method to call any of those methods?
 
And plus, optimal code written in non-Java languages are mostly obfuscated and overly resource-efficient, there's no room for expanding and it's hard to manage. That becomes a decent problem when you have colleagues to work with.
 
@compski Hahaha, this is exactly why Java is great. Always so obvious.
 
@compski What do you mean?
 
12:48 PM
@Unihedron what? How did you deduce that? Why would code in non-java languages be any less clear?
 
You might be wanting to use Unit tests, but I might be wrong here in what you want
@BenjaminGruenbaum Optimal code.
 
@Unihedron it's impossible to write 'optimal code', let alone in Java.
 
Optimal Java code and Optimal non-Java code are different..
 
yea i feel redability on code resuability is somuch better than speed optimization
 
@Unihedron Optimal Java code is quite tailored and not trivial to write at all, it exploits the JIT in ways most people don't realize and looks very different from your every day Java code. I've seen people hand roll byte code for performance before... it's not any more readable than performant Rust code or Go code or C# code or C++ code or JS code.
 
12:50 PM
@Unihedron i mean like im trying to call this method from one of the Java files ... but amongst the Java files inside the Java packages there is no main method
 
Not to mention the C# will probably end up being more readable because they have things like unsafe sections and opting out of checks not possible in Java without reflection.
 
Thank god there are no type-bitcasting in Java. So many things would blow up by wanna-be programmers trying to "optimize" their code.
 
Yeah, Java's type system is awesome.
Everything is an object except stuff that's not an object like functions and primitives. You have generics but they're undecidable and they disappear at run time for god knows what reason. Oh, and don't get me started on byte.
 
Haha.
 
lol, signed bytes... what a joke.
 
12:53 PM
I think byte is more of a "lazy enum". You use it for non-arithmetic reasons mostly, and it doesn't really do anything useful aside from being signed.
 
Enums are actually mostly acceptable in Java.
I think Java 8 will fix a lot of things - the lack of traits (through default interface implemetnations) and lambdas (although incredibly weak) will really help the language.
 
Correct, that's because while they are not polymorphic, you can assign helper methods to these constants.
 
Although it's too little too late.
@Unihedron lol what a horrible joke.
 
Lambda expressions are going to be great, but it's too late to be a blast.
 
@BenjaminGruenbaum all the downvotes were casted after you posted your answer in javascript room !
Most of the comments are also from them
this shows lack of transparency
 
12:56 PM
@ItachiUchiha I also posted it in the C++ room, the HTML/CSS room, the PHP room etc. Pretty much all 'popular chat' rooms - I didn't ask for up/down votes I just posted 'Opinions valued' and a link.
 
@Unihedron ok can i link u to what i mean about calling a Java method from a maven project?
 
@BenjaminGruenbaum You didn't really post it in C++. You posted it in the Lounge. And that's the flaming room.
 
You should be thankful for the attention rather than angry at the fact people disagree with you.
@Unihedron that's what? The most popular room in the chat with the most messages?
 
@BenjaminGruenbaum It's also filled with amazing people.
 
@Unihedron filled with what? People with 6 digit Stack Overflow reputation, some of which are valued speakers, some in the isocpp committee etc? :D?
Seriously though the lounge is full of dicks :P
 
12:58 PM
6+ digit SO rep? You know what that means right?
 
At least they don't get defensive over their language. Java sucks, that's a fact. If I go to the C++ room and say C++ sucks no one gets offended.
 
means most of them r probably the one that wrote the code like jon skeet
wrote the program*
 
Mostly people just agree with the sentiment that Java sucks there.
 
@BenjaminGruenbaum you didnt help
 
12:58 PM
You mean the Lounge? That's hardly a C++ room.

C++

Friendly conversation, including C++ talk — NOT the "Lounge"!
 
you posted your answer in most of the rooms
 
^ C++
 
not the question
 
The question comes with the answer... they're the same page. I asked for feedback on my answer.
 
Actually, you have the rights to post whichever to whereever you want, just wasn't a smart move.
 
12:59 PM
@Unihedron oh, a dead room not filled with people who are good C++ programmers? I think I'll pass. Seriously though the lounge are kind of assholes but some of them are also really smart.
@Unihedron why?
 
02:00 - 13:0013:00 - 00:00

« first day (1410 days earlier)      last day (3521 days later) »