« first day (2022 days earlier)      last day (2904 days later) » 

5:01 AM
Good Morning everyone
 
 
2 hours later…
6:56 AM
morn
 
 
4 hours later…
11:19 AM
any article about good example to handle all exceptions from a one class?
 
 
2 hours later…
1:18 PM
Hi All Did anyone work on Chat application (IPC,AIDL). Is anyone have some sample ?Please let me know.
 
Morning, Java!
 
1:49 PM
Jerry! Hiya!
 
2:30 PM
I don't know JAVA. May please someone tell me why this works on regex101 but doesn't work on JAVA codes?
 
fge
Why HTML?
Why not use an HTML parser?
Also, define "doesn't work"
Show your code
 
I don't want to do that, I just answered a question. That's the OP problem stackoverflow.com/posts/comments/61694265?noredirect=1
 
3:00 PM
@Shafizadeh that's because regex != regex
 
@Vogel612 Whaaat? they seem to me identical
 
well tough luck, they aren't.. I know at least 4 different implementations for RegEx
and I'm ignoring the different kind of RegEx that's used in CS Theory here
 
@Shafizadeh ever wondered, why there are 3 different flavors of regepr on the site you're using?
 
@Nicktar My pattern works for all those three different flavores on regex101
@Vogel612 I see what's your point
 
 
1 hour later…
4:10 PM
@Unihedron So you are a pretty lady after all! xD
 
fge
4:50 PM
fart
 
 
2 hours later…
6:36 PM
http://www.commitstrip.com/en/2016/05/06/a-story-about-full-stack-javascript/
CommitStrip
A story about Full-Stack Javascript
CommitStrip
1462559718
 
hi
I have a question
I forgot to add poblic static main in my class
how can I add it the main method inmy class
I know now : just write main and then press ctrl shift
 
fge
@KarGar eh? Just write it down
 
@fge do you have a good website for learning tree implementation in java
@fge with recursive
 
fge
No I don't, sorry
 
6:48 PM
@fge do you have any websites like codingbat.com for learning java
 
fge
sigh no; I learned Java bits by bits, and mostly by reading other code and experimentation
Perseverance is key
As always
You can't consume knowledge; you have to acquire it
 
7:24 PM
@fge can you see this
public class Test {

public void guess(int x) {

int min=0;
int max=10;
int diff = max-min;
Random r = new Random();
int y = r.nextInt(diff);

while (x !=y ) {
if(x==y){
System.out.println("Congratulations, that is correct! ");
return;
} else if (x>y) {
System.out.println("That is too high, try again! ");
} else {
System.out.println("That is too low, try again! ");
}
}
}

public static void main(String[] args) {

Test t = new Test();
System.out.println("I am thinking of a number between 1 and 100, guess which one!");
the problem that the code just run one time
 
fge
Wait, what?
 
when I use while (x !=y ) { instead of if (x !=y ) { I get many times repeated message
 
fge
If x is not y, you'll never hit the line x == y
 
@fge I changed it to while
 
fge
Yes, and then what?
 
7:26 PM
the thing I want to run the code until I guess correctly
 
fge
You enter the loop only if x is not y
Same thing
x == y will never be hit
 
ok I should remove if(x==y){ from the while loop
 
fge
Also, you reinitialize y each time you enter the method
I don't quite understand what you want to do
 
I want to guess the right number
I enter a number and if I guessed right the the code will print out Congratulations, that is correct!
 
fge
Use an infinite loop with a break condition
That is the most obvious way
while (true) { x = /* read x */; if (x == y) break; String s = x > y ? "high" : "low"; System.out.printf("Sorry, your guess is too %s; try again!%n", s); }
And after the while, print success
You can even inline s in code, but then why bother, since the JIT will do that for you
(that is a classical case of escape analysis btw)
 
7:39 PM
@fge thank you man
I got it correctly
here
public class Test {

public void guess(int x,int y) {


if(x==y){
System.out.println("Congratulations, that is correct! ");
return;
}


if (x>y) {
System.out.println("That is too high, try again! ");
} else {
System.out.println("That is too low, try again! ");
}

}


public static void main(String[] args) {

int min=0;
int max=10;
int diff = max-min;
Random r = new Random();
int y = r.nextInt(diff);
Test t = new Test();
System.out.println("I am thinking of a number between 1 and 100, guess which one!");
 
fge
8:23 PM
@KarGar use a pastebin, please
 
@fge what is pastebin
 
fge
for instance
 
 
1 hour later…
Aph
9:48 PM
hi
 
10:08 PM
@fge Chrome is telling me that website's certificate is invalid. You tryin' to hack me? xD
 
fge
10:34 PM
@Michael meh; it uses an invalid SSL certificate, and you are falling victim to a misunderstanding
Just remove the s in https
 

« first day (2022 days earlier)      last day (2904 days later) »