« first day (834 days earlier)      last day (4114 days later) » 

1:07 AM
 
hello, fellow devs!
 
Howdy
 
1:26 AM
@Code-Guru how'd the game go?
 
@KodeSeeker I played more than one ;-)
I won and lost about the same number of games. My rating went up, though.
 
cool
@Code-Guru are you in school?
 
@Code-Guru What do you play?
 
@DavidFrank chess
@KodeSeeker nope
 
@Code-Guru so you work?
 
1:54 AM
@KodeSeeker some days ;-)
gnite all
 
Hello friends. You and I are of the chosen few who have decided to spend part of a Saturday night on a Java Chat room. Kudos!
Anyhoo, what is a good book for learning Java in-depth. Something more advanced than Head First Java
 
2:11 AM
@Atif imho most of Java knowledge isnt about the language, but the knowledge of different java libs and frameworks
the language itself is really simple
i think, it is the simplest language of all nowadays
 
@DavidFrank have you tried python?
 
@KodeSeeker I know python on a basic level, its a fun language, but i think, it has more language features than java
 
@David
@DavidFrank That's what I'm looking for, and that's what books discuss...the different java libs
 
@Atif First you have to figure out, what kinda development you want to do.
 
I have like 5+ years of java exp. but I don't really have that in-depth knowledge
 
2:15 AM
Web, desktop, android
 
I develop web-apps
 
If you're in the field for 5 years, what do you lack from your knowledge?
Of course, you can always learn something new, but after 5 years, you should probably know, how you want to broaden your knowledge
 
Hmm...that's a good question.
 
Let me ask, too. What tools do you use for web development?
@Atif
 
IntellIJ, JSP, Spring, etc.
 
2:22 AM
spring mvc?
 
yep
 
have you ever tried jsf?
 
no
 
And what kind of sites do you develop?
 
e-commerce sites
 
2:23 AM
is there any which you may show me?
 
well, back to your other question. I feel I don't know as much about Generics, enums, anon inner classes. Stuff I don't really use very much, but I still feel I should know about
 
Why don't you just google them and see and see an example? These are really simple things.
Generics is a bit tricky, but if youve encountered it before, its easy-peasy, too
But I'd love to see an example of your work, if possible.
5 years is a very long time.
 
Mainly, I'd like to go over a book just to kind of make sure I have my bases covered
 
Ok, I understand you.
 
Even if I don't use it, I'll know where to look in the future for reference
and it it comes up as an interview question, I'll have an idea
5 years is a long time, but it wasn't solid experience
 
2:41 AM
@DavidFrank I think you're right actually, I shouldn't spend so much time on the 20% I don't use versus the 80% I do
If I find a need to have encyclopedic knowledge of Java, then I'll cross that bridge when I come to it.
Thanks @DavidFrank
 
np :)
 
You are good at requirements analysis: finding the problem, instead of finding the solution
:)
 
Its always good to learn something new, but you should probably learn about new frameworks which you might use in the future.
 
3:08 AM
Hi everyone! I have something for you that probably doesn't deserve a topic. Could you simplify this regex or rewrite it to be simpler: (((0|1)*(00)(0|1)*)((0|1)*(11)(0|1)*))|(((0|1)*(11)(0|1)*)((0|1)*(00)(0|1)*))
It is built to accept all binary strings that contain the substrings 00 and 11 (in any order).
 
String test = "01100";
return test.contains("00") && test.contains("11") && test.matches("[01]+");
@kmaz13
 
Thank you @DavidFrank I'm trying to use Regex though. Any ideas?
 
regex: (00|11)*
 
@Atif that is incorrect. That accepts any number of 00 or 11.
 
@kmaz13 Are you sure, you can't use different language features?
Only regex solution is hard to find
 
3:15 AM
Yes, I'm sure.
@Atif I'm looking to accept the string 1010101100 for example.
 
@kmaz13 so it has to contain either a 11 or 00 substring
 
[01]*(00[01]*11|11[01]*00)[01]*
?
 
@Atif Yes
@DavidFrank That doesn't work.
 
@kmaz13 [01]*(00|11)*[01]*
 
Do people like gangum style in here?
 
3:18 AM
@Atif that accepts a different language accepting substrings 00 or 11
I need one that accepts 00 and 11 in any order
 
@kmaz13 How does that not work?
I checked it
@user1690130 everybody likes gangnam style :D
but its a bit old now
 
@kmaz13 I believe that should accept 00 and 11 in any order
 
@DavidFrank I think some liberals (or maybe it is conservatives) do not because they are against Ps
 
@DavidFrank I apoligize. It does. I mistyped and meant to say it works.
 
@kmaz13 Great
 
3:21 AM
@DavidFrank I think some liberals (or maybe it is conservatives) do not because they are against Ps
@DavidFrank I did not care about the song, but then I heard it on dancing with th estars and now I find it entertaining
 
It won't. That accepts: All binary strings that contain the substring 00 or 11.

It needs to accept: All binary strings that contain the substrings 00 and 11 (in any order).
 
@user1690130 what are Ps?
 
@DavidFrank Psi (Psy) the singer
 
oh ok
 
@DavidFrank Peta murgotroyd dances it the best
 
3:23 AM
Thanks guys. Have a great evening/afternoon/morning.
 
@kmaz13 what does 4am count as?
 
hmm I'd say early morning
I'm back for more! :D
I haven't used JAva in a while so I'm jumping back in
How do I read input on the same line in a console
 
What do you mean by on the same line?
You might need a scanner
 
I want to prompt a user
Enter a string: ----
User puts the string on ----
not the line below
but only ---- is returned
 
System.out.print("Enter a string: ");
System.in.readLine();
 
3:33 AM
readLine() is not a valid method
 
Scanner scanner = new Scanner(System.in);
scanner.nextLine();
 
bravo!
Thank you
 
np :)
 
4:06 AM
Good night!
 
ssup
 
5:00 AM
i am having a problem in understanding the concepts of inheritance in java
    in this program:
    class Box{
    	int w;
    	int h;
    	int d;



    	Box(){}

    	Box(int w,int h,int d){
    		this.w=w;
    		this.h=h;
    		this.d=d;
    	}

    	Box(Box box){
    		w=box.w;
    		h=box.h;
    		d=box.d;
    	}
    	double vol(){
    		return w*h*d;
    	}
    }
    class Weight extends Box{
    	int weight;
    	double vol;
    	Weight(int w,int h,int d, int wt){
    	//super(w,h,d);
    	Box b2=new Box(w,h,d);
    //	vol=b2.vol();

    		weight=wt;
    	}
    }
 
 
7 hours later…
12:07 PM
@blackbee uncomment the call to super
 
12:36 PM
hi all
@winash hi
 
@Splinky hello
 
@winash i want some help in my web app ?
 
@Splinky sure, I ll try to help
 
@winash i want to add an installation in my web app :add user and password of database after that i want to execute a script to install all tables in my databases if user and pass is correct what i should do ?
 
@Splinky You are using plain JDBC
?
 
12:47 PM
yes
should i make file propriete to save user and pass so i can check them in all my app ?
 
@Splinky take the username password from user , then try to make a connection, If the credentials are wrong a specific exception is thrown(I don't remember the exact one)
@Splinky if all is well then execute the script using JDBC
@Splinky If you can use spring then use something like this static.springsource.org/spring/docs/3.1.x/javadoc-api/org/…
 
@winash a script file.sql or liste of sql request
@winash ok thx a lot a will try that
 
@Splinky use some existing utility like the one I shared, Or you ll have to roll your own, Parse file and then fire Statements one by one
 
1:14 PM
anyone who knows j2me?
 
 
2 hours later…
3:40 PM
Hello
can we implement DynaCache to property file ?
 
 
1 hour later…
5:09 PM
anyone here? :o
 
5:29 PM
@Crowz Yeah
 
5:44 PM
Hey
 
what does this represent in java : Map<? extends String,? extends Integer>. What does '?' symbol represent ?
 
@user1732680 Wildcard - read as Something which extends String
 
how is it different from a simple Map x = new HashMap(). Here I do not give any type for the key and value.
 
@user1732680 In the first case you make sure that your map contains only known types using the generics notation
 
@winash ok thanks
 
6:11 PM
Is it considered good way to cast an object to a map and declare a map without the types for key and value ?
tat is storing a map in an object and then again getting that into map from object by casting
 
@user1732680 Your question is quite complicated, so the answer is no
 
@winash suppose I have a map and the value for the key is again a map. Can I store that value in a variable of type Object and then cast that Object to a map
 
@user1732680 Map<String,Map<K,V>>
 
@winash yes
 
@user1732680 Does that answer your question
 
6:21 PM
no this is the declaration... can I do something like Object x = hashmap.get("key1');
 
@user1732680 Yeah you can
 
Map t = (Map)x;
?
 
@user1732680 But why cant you just use the defined type
@user1732680 That will do
 
ok thanks for answering
 
@user1732680 Sure
 
6:30 PM
@winash One more thing....is it illegal to declare a hashmap without the types for key and value? Why is it possible in map?
 
 
2 hours later…
8:20 PM
Hello, Java!
@user1732680 You can declare Hashmap map; and Map map;. Both are legal, but discouraged since Java 1.5. The introduction of generics makes it so you can now do Map<KeyType, ValueType> and let the compiler do some type checking for you.
 
hi, all
 
Howdy
 
good! thanks.
i have a query in java..
anybody?
 
Don't ask to ask, just ask
 
how to read data from file and output in order of frequency of word, if order is same then in alphabetic order?
 
8:30 PM
What have you done so far?
 
i am new in java. i know how to read a file. bufferedReader?
the question is slightly confusing to me.
 
I suggest that you start by reading docs.oracle.com/javase/tutorial/essential/io
@NSharma Then break it down to smaller chunks. If I were doing it, I would first write a program that reads a file and prints out the whole thing.
When you can get that much working, find another small part that you can add and get working.
 
ok,thanks ! can u pplease explain me how can i check the frequency of words?
i know simple programs such as reading data etc but this question seems a bit different, and i am not able to figure out what it says.
@Code-Guru if u could help.
 
8:47 PM
@NSharma Frequency means to count how many time each word appears. Most likely, you will need to use a Map.
@NSharma Tell you what. Go ahead and write a program that reads a file and prints it out. Then I'll help you from there.
 
ok, thanks a lot. i need to create a file first and where should i store it, so i can read from it?
 
Can someone help me with a server problem
@Code-Guru
 
28 mins ago, by Code-Guru
Don't ask to ask, just ask
 
sorry
I have code, and when i try to send packets i get errors when multiple people connect
optionaldataexception and streamcorruptedexception
well?
 
9:08 PM
That's the error message?
 
it's a lot more
i have the code in a dropboc
 
If you want help, you need to at least post enough information so that I can help you. But not so much that it's overwhelming.
 
Ok
Both problems are caused by this line Character ch = characters.get(connection.getInetAddress()
.getHostName());
no
sorry
Character rr = in.readObject();
 
9:30 PM
so noone will help me?
 
When you post a question that explains your problem thoroughly enough that I can actually help, I'll be glad to.
 
Ok, I'm trying to create a simple game with balls
it uses a server to transport data
but when two or more people connect to the same server it outputs those two errors
what more info do you need?
 
9:47 PM
The actual error messages for one thing.
 
FileInputStream fstream = new FileInputStream("?"); what should i write in place of '?'.
 
@NSharma A file name
 
and where to store that file, in which folder?
 
@NSharma That's completely up to you.
 
9:50 PM
ok.
 
Exception in thread "Thread-6" java.lang.ClassCastException: cannot assign instance of Character to field Character.color of type java.lang.String in instance of Character
java.io.StreamCorruptedException: invalid type code: 0E
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1355)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350
 
@javawarrior What line of code causes this error?
 
rr = in.readObject();
 
I have no idea why that error occurs. I suggest you fire up a debugger and see what you can figure out.
 
i did
 
9:54 PM
it says , "(The system cannot find the file specified)"
 
@NSharma What did you put in place of the '?'?
 
testing.txt
my file name
its on the desktop.
 
@NSharma If it's not in the same folder as your .java file, you need to specify the full path.
 
Hi, I wanted to put a 2D array into HashMap. But to access those elements based on Array Indices, I want two keys. Is there a way to do this? Something like, Map<(x,y), value>
 
Map<int[],value>
 
10:02 PM
so the file has to be placed in 'src' folder ?
 
How do I use map.get() on a[2][1] ?
 
@NSharma No, it doesn't have to be. But the location of the file and what you put in place of the '?' have to match.
 
ok, alright.
@Code-Guru thanks. M done with reading and writing, plz help me proceed further.
 
@NSharma What do you think you should do next?
 
in order to count , i'll need a counter for each word, i guess.
 
10:08 PM
Before that, you need the individual words themselves, right?
 
yes
 
So how about splitting the input into individual words then?
 
spacing, when it checks a delimeter it should split.
 
use xml parser
 
ok.
@Code-Guru is there any other way of splitting the words?
 
10:23 PM
@NSharma other than what?
 
yes
if you have a file
 
other than xml parser
 
sure
 
read lines separately
use String.split(",");
 
In fact, an XML parser isn't useful since you aren't doing anything with XML.
 
10:24 PM
yes
i wont be able to implement either.
 
@NSharma As @javawarrior suggests, String.split() is probably the right method to use. You might want to use a different delimiter than a comma.
 
@Code-Guru @javawarrior thanks, will try.
 
@NSharma Are you familiar with the Java API docs?
If not, you should bookmark them and learn how to use them.
 
yes , i will, of much help.
@Code-Guru if you dnt mind me asking, at what hours can i again take your help for the same?
 
Please don't ask him that
 
10:30 PM
I'm sorry, no offense.
 
There are many people who can help you, and his schedule is his business
it seems kind of rude, and even though code-guru is awesome, there are other people who are awesome
 
@javawarrior ok, i dnt mind that at all, all i would want is some help, anybody could help. I went on asking because I had already shared my question with @Code-Guru.
 
Also, remember, you are on stackoverflow, as long as your question is good and shows research effort, you're likely to get answers.
 
Sorry, if i barged a few rules.I'm new here. will slowly learn.
and I highly appreciate stackoverflow and people here, who are willing to help one and all, esp. learners like me. Thanks a lot.
 
What a lot new users don't realize, most SO users are here on their own time. Asking questions in chat is fine, but it's also important to learn how to do research how to try things yourself, so you don't annoy the same users you're asking help from :-)
5
 
10:40 PM
@NSharma I'm on here when I can. I don't mind helping when I'm available. Feel free to post questions on the main site, too. You will get a lot more information that way.
 
@A--C @Code-Guru Thank you people. Will keep in mind :)
 
what's the best way to pass data between clients and servers
 
@javawarrior Your question is too broad to answer.
 
@javawarrior what do you mean? It's all a transfer of bits in the end.
 
Using sockets and server sockets
say you ware to send a class with 2 ints, how would you do so?
my program has trouble sending all of the packets it receives to each connection
 
10:49 PM
I knew we should've taken a left at that hub
 
lolz
My app has problems sending and receiving data.
 
@A--C Was that the one in Albequerque?
 
:)
 
Of course, you are probably too young to get the Looney Toons reference =p
 
I used to watch Looney Toons tyvm
 
He is simply put, one of the cooler characters.
 
Taz is my favorite! Oh, and Road Runner and Wiley Coyote
 
hey
who wants to try my chat app?
well?
seriously, i need help with my chat app
i'll send sourcecode
 
11:22 PM
hello everyone!
@Code-Guru @javawarrior @A--C
 
SUPERBOWL
 
*commercials
Canadians don't even get the same commercials sometimes
 
Haha @A--C
 
NINERS
 
@Doorknob Howdy!
 
11:32 PM
hello @Code-Guru !
 
kick off time
 
Is it kick off now?
I'll have to go find somewhere to watch the game...or at least the commercials.
 
har
 
Mostly I want to see the previews for new movies this year!
 
#trueblood
 
11:33 PM
Meh, I never really was interested in all the football stuff :P
 
doorknob
want to help me out a little
 
ok
 
write a 20 page report about strings
and how they relate to ints
I need it in 2 hours
 
Hahaha
:P
 
i'll be busy watching the game
lolz
 
11:36 PM
@javawarrior A movie or a new season?
 
the movie
what's that new movie
the one with the vamire
warm bodies
COMERSHULS
 
:D
 
i'm experimenting
with the physics of ropes
who wants to join :D
 
ok what are you doing with ropes?
 
Threading them!
 
11:49 PM
oh hi @A--C :)
 
Just stopping by, enlightening you all with my wisdom :)
 
i still need help with my app
if someone can
 
ok
 
ok
please closevote
-6
Q: getStringArray()

Danimy program reads a text file into Array and I have to create a getStringArray method and returns a String of all the array strings separated by a white space. What this suppose to mean? because I also have buffer reader that will separate all words with space... how they are different? Thank you....

:/
 
11:59 PM
ok
so i need help with something
 

« first day (834 days earlier)      last day (4114 days later) »