« first day (2021 days earlier)      last day (2912 days later) » 

9:38 AM
morn
 
9:53 AM
morning
in your opinion what is the appropriate way to make a method return multiple outputs ?
creating a custom object ot return a map ?
lets assume I have a method whch return two variables dates beginDate and endDate
getBeginEndDate();
this method should define a map with two keys "BEGIN_DATE" and "END_DATE" and fill it
or create a custom object called Period which have two instances varibales beginDate and endDate and return it
 
 
2 hours later…
11:57 AM
Dead chat
 
12:14 PM
@MadaraUchiha How do you re-open a closed question? - stackoverflow.com/questions/37038303/…
The user has already updated the question
 
12:30 PM
@ItachiUchiha no MCVP.
 
12:52 PM
 
1:03 PM
Morning, Java!
 
Morning
 
1:20 PM
mornin
 
ASR
morning all
 
Howdy yall
 
Morning ,
What is the best way to learn about node js ?
 
1:37 PM
<.< thats javascript though
 
2:37 PM
@Manmohan This is the Java room
You're looking for the JS room

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
 
2:57 PM
Hi Is there any one has a website for learning recursion in java
 
recursion in java is no different from recursion in haskell
 
@Vogel612 is haskell a programming language ??
 
yeap
recursion is conceptually simple...
you get the basics by implemeting recursive fibonacci
 
do you know any website for learning recursion
 
the next step usually is something like... tree traversals
and the next step after that is more abstract recursive problems
something like language recognition and things
 
3:01 PM
hi, I have an application that needs a bit of jquery but I have not got time to learn jquery, as the app is launching in the next few days. Any chance anyone could fix my bodged bit of code? It is a very simple function... jsfiddle.net/vVxM2
sorry to be annoying
 
fge
@LemusThelroy this is the Java room
 
@LemusThelroy first off... why the fudge should we fix your code?
 
fge
Java is not Javascript
 
and secondly... ^^
 
I thought I might get shot down...
I have no idea about java and have only recently learnt python
but realise it is very cheeky to ask someone to fix my code for me when I haven't even learnt the language
 
fge
3:03 PM
Again: Java is not Javascript
JQuery is Javascript
Therefore you should ask in the Javascript room
Not here
 
what is the difference between java and javaskript?
 
fge
The same as there is between a car and a carpet
ie, they have nothing in common
 
nice answer thanks
 
goodbye java, hello javascript
 
I thought they were same because they start with java
 
fge
3:07 PM
Blame Netscape marketing
 
@fge is that Netscape the creator of javascript ?
 
fge
Yep
 
@fge how is creator of java ?
 
fge
Java was created by Sun Microsystems (since then bought by Oracle), and more precisely by James Gosling
 
@fge thank you man I was always wandering about what oracle has to do with java
@fge What is the difference between protected Table data; and private Table data; in a class ?
 
3:21 PM
@KarGar go through this link if you really want to know.
 
@java The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
@java thank you
 
Hiya people!
 
hi
what does this line do in java : int percentage = (total != 0) ? reg[i] * 100 / total : 0;
I know it is calculating the procentage but they use a strange way in doing it
 
@KarGar what's strange?
 
yeah there's nothing strange about it
 
3:32 PM
@java I do not understand how the code works ,,, what is ?
 
if total is not zero
reg[i] whatever value it is divide it by total and multiply by 100
otherwise
zero
they use a stupid way to prevent division by zero
but it's just a simple formula that implements a mathematical function
 
It is not my code ,, I just found it
 
also don't write code like that
one line should only do one thing
 
if (totlal != 0 ) reg[i] / total *100 else 0
 
3:37 PM
that would work in scala
no it won't because you misspelt the variables
 
and it's not really different from the ternary...
 
int percentage = 0;
if (total != 0)
  percentage = reg[i] * 100 / total;
this is cleaner
 
fge
Meh, I see nothing wrong with the ternary operator
As long as you don't chain them, that is
 
@Hans1984 GETOUT
 
3:39 PM
where did that joint go
no
why would i
 
Why when I run this code I get 1 in output : int value1 = 1;
int value2 = 2;
int result;
boolean someCondition = true;
result = someCondition ? value1 : value2;

System.out.println(result);
 
because the variable result is 1
 
how you see it ? is not that value1 =1
int result is not equal to some thing
 
you need a grammar pill
someCondition ? value1 : value2 resolves to value1 because the premise is "true"
and value1 is 1
so result is assigned as 1
 
@Unihedron actually that's a semantics pill
 
3:45 PM
@Vogel612 I was mostly addressing the uninterpretable english
 
ohhhh. yea that's more fitting then
 
@Unihedron thank you
 
this expression here:
<condition> ? expression 1 : expression 2
if condition is resolved to true when it's ran, it evaluates expression 1 and takes its value, otherwise the later
it's demonstrated in the linked tutorial above
 
@Unihedron thank you I understand it now I appriciate your help
 
4:16 PM
hrngh.... Libre Office... You are fudging annoying to use with session-based authentication and separation
 
What is wrong with my code : public class Code {

public int rec(int p,int q) {
if (p==0) {
return 0;
} else {
return rec(p--, q)+q;
}
}


public static void main(String[] args) {
// TODO Auto-generated method stub

Code c = new Code();
System.out.println(c.rec(4, 3));

}

}
return rec(p--, q)+q; is not working
 
first off... it's not formatted correctly
and you're probably misunderstanding pre- and post-increments
and "not working" is probably the most unhelpful description ever
 
fge
You don't even need a decrement here since you don't reuse the value
just call rec(p - 1, q)
 
yes when I changed it to return rec(--p, q)+q;
it worked
I got 12
 
is this recursion
 
4:19 PM
yes
 
1.2/10
 
your q is never decremented.. not that it needs to...
also I can make your program blow up...
rec(-1, 2000)
 
what is difference between return rec(p-1, q)+q;
and return rec(p--, q)+q;
 
the difference is between p-1 and p--
 
is not they the same p-- and p-1
 
4:22 PM
do they look the same to you? of course they aren't
 
is that --p same as p-1
 
no
 
because I got same answer when I used return rec(p-1, q)+q;
and return rec(--p, q)+q;
I got 12 in output
in both
 
@KarGar umm... we are not your personal help line... did you even read the documentation?
 
multiple paths may lead to the same destination, even if some paths has you flying over a cliff and only works 1% of the time
 
4:24 PM
how do you get the idea that those two are the same when they are completely different things, completely different notations?
 
now he's done it
vogel is mad
 
@Unihedron thank you so they are not same
 
no they are not
 
@Unihedron nice
 
this is almost as bad as in the programming class at university...
 
4:25 PM
p--:
1. p -= 1
2. expression evaluation: p (old)
--p:
1. p -= 1
2. expression evaluation: p (new)
p-1:
expression evaluation: p-1 (p unchanged)
 
"so those completely different things are different?? I'd never guess"
 
old news are always exciting.
 
that said... can you explain why the heck anyone thought that opening documents in another session of the same user is not considered a bug?
 
@Unihedron thank you
 
@Vogel612 the QA crew was slacking off?
 
4:27 PM
it's kinda "status-by-design"
at least according to Libre Office
oh wait... wrong link
 
nah don't worry about linking it, I don't care enough to click
 
> > 4) See that nothing happens.
> 5) Go back to the original desktop session
> 6) See a new, "uninvited", Writer window.

This comes up often.
 
muahahahahaha
AHAHAHAHAHAHAA
FOOLS, I USE MARKDOWN
building documents with office software is so 1980
 
well you go write a letter in md then
use the right tool for the right job
 
I have no one to write to.
 
5:26 PM
@madara Uchida did you miss my ping?
 
@ItachiUchiha I did not
 
@ItachiUchiha I reopened it
 
Cool, thanks :)
 
hi guys
i need regex help, not specifically with a pattern, but with Java's Matcher
matcher.find() returns true
but how do I return the match? i've tried matcher.group(0)
 
5:38 PM
and?
 
was wondering if anyone was familiar...
 
what do you get with matcher.group(0)?
if (matcher.find())
  System.out.println(matcher.group());
 
maybe that's what I'm doing wrong
do I always have to call find() first?
 
fge
Yes
 
read the manual
 
5:43 PM
i see. sorry. got it to work now
thanks
 
 
5 hours later…

« first day (2021 days earlier)      last day (2912 days later) »