« first day (1713 days earlier)      last day (3230 days later) » 

12:51 AM
morning
 
1:29 AM
o/
 
2:02 AM
Evening lads
does varargs work for primitives? i.e public static double (double...numbers)
 
2:29 AM
@UnknownOctopus Why not launch IDE and test that?
 
I did and it didn't work, i was asking if there was a different method that would work
@Mr.777 Nvm, i had just misspelled something
 
Well, you can create an array of primitives so totally possible that you can have primitive varargs
 
Yeah i see it now, like i said when i ran it b4 i had misspelled something.
 
 
2 hours later…
4:42 AM
Hi..how to check null pointer exception when doing below operation

return eElement.getElementsByTagName(key).item(0).getTextContent();
is there any efficient way other than normal null check..
 
Good Morning!!
 
@Ghanshyam Good morning/night :D
 
:) morning here
 
Technically its morning here.. But i count it as night until i go to bed
:P
 
LoL technically or naturally :D
 
4:51 AM
Good Morning
 
Mornin'
 
can anyone help me ??
 
With?
 
Hi..how to check null pointer exception when doing below operation

return eElement.getElementsByTagName(key).item(0).getTextContent();
is there any efficient way other than normal null check..
 
You duplicated your message but it's still very vague.
 
4:59 AM
^
Show a code example of what you've tried
 
No, that's not the point. The question is specific, but it's not clear.
 
0
Q: How to avoid null pointer exception for eElement.getElementsByTagName(key).item(0).getTextContent(); XML Parser

thangawhen given key is not exist it throws NPE. String nodeValue = eElement.getElementsByTagName(key).item(0).getTextContent(); if (nodeValue == null || nodeValue.isEmpty()) return null; return nodeValue;

 
It's like saying you want to hammer a book onto the wall without using a hammer.
 
i have tried this String nodeValue = eElement.getElementsByTagName(key).item(0).getTextContent();
if (nodeValue == null || nodeValue.isEmpty())
return null;
return nodeValue;
 
And you want a different method of checking if nodeValue is null?
 
5:03 AM
Why would you not use a hammer to hammer a nail? An old shoe will do but it's plain old stupid.
 
yes.
 
@Unihedron Those metaphors tho
 
@UnknownOctopus Oh, there was one time I made a metaphor about me making metaphors, it was very meta-metaphorical
Apr 26 at 23:10, by Unihedron
@Michael Efficiency is not a reason to delegate the trust of file type. Trusting something a user could change in under one minute is like expecting me to make an amazing metaphor.
 
@Unihedron The king of all metaphorically metaphoric metaphors
@thanga just out of curiosity why do u want a different way to do what already works?
 
above code is not working @UnknownOctopus . its throwing NPE
 
5:09 AM
Then the problem isn't the null check itself.
eElement.getElementsByTagName(key).item(0).getTextContent() <- something is null that is shouldn't be.
Either of eElement, return values of getElementsByTagName(), item(), getTextContent().
 
yes ,exactly..i want to avoid NPE ..
 
Run a debugger and find out which field is null, that it shouldn't be. Then go fix it by making sure the field / return value isn't null.
 
When it reaches here : eElement.getElementsByTagName(key).item(0).getTextContent() throwing NPE
 
Then one of those elements is null
 
5:12 AM
But which field is null?
 
got solution
if(eElement!=null && eElement.getElementsByTagName(key)!=null
&& eElement.getElementsByTagName(key).item(0)!=null ){
nodeValue = eElement.getElementsByTagName(key).item(0).getTextContent();
}
return nodeValue;
thanks @Unihedron @UnknownOctopus
 
Wait.
You're not supposed to expect all of those to be null since, by contract, most of them should behave.
(For some return values in that chaining, for instance, returning null would indicate critical algorithm failure that should be handled carefully.)
 
Oh ok..so how can i make it simple
 
5 mins ago, by Unihedron
Run a debugger and find out which field is null, that it shouldn't be. Then go fix it by making sure the field / return value isn't null.
 
5:16 AM
Run a debugger and check which field is null
@Unihedron beat me to it
 
No need to perform a null check on all the chained values, only check the one.
 
Ok
 
Anyone know how to get the blackboard theme on Eclipse? I just switched to it as my IDE
 
yesterday, by Madara Uchiha
@OlegKuznetsov Eclipse sucks
you can't
 
Eh
deletes system32
Even with plugins?
There. I just inverted my screen. Problem solved.
 
5:22 AM
Welcome to the screen color inversion club.
 
@Unihedron actually this isn't half bad
 
5:33 AM
My computer hates me.. brb restarting
 
yes :)
 
your worked on payment gateway
 
HI all
how to "if check a string" using JSTL?
 
5:38 AM
in normal java we do like
String name="adam";
 
"adam".equals(name)
 
if(name.equals("adam"){ /code }
 
yeah than
 
What's JSTL?
 
how can we do this using JSTL tag
 
5:39 AM
if("adam".equals(name)){}
 
11 secs ago, by Unihedron
What's JSTL?
 
whoops
 
@greenhorn use == or just eq
 
@Unihedron JSP Standard Tag Library (JSTL)
 
jsp is deprecated
 
5:40 AM
@Unihedron are you kidding :/
 
no
 
@CrazyNinja please show me the exact syntax
 
@Unihedron still many projects are developed using JSP
 
5:42 AM
or this
 
@UnknownOctopus javatips.net/blog/2013/06/jstl-check-equals-not-equals i tried this but it hasn't worked
 
I have no clue about jstl, at this point im just listing remotely helpful links
 
@greenhorn doesn't change a thing
 
@greenhorn did you try what Ghanshyam provided? I think it's there
<c:if test = "${name == 'adam'}">
Sorry @Unihedron have mercy on JSPs
 
<c:if test="${name eq 'adam'}"> or like
 
5:46 AM
@CrazyNinja comparing strings with == looks wrong
 
@Unihedron then we can use eq but you know it's JSP :D
 
@Ghanshyam i tried this
<c:if test="${name eq 'adam'}">
count equals to 9<br />
</c:if>
"count equals to 9" not printed on JSP
 
can you tell me you using given library (jstl 1.2)
 
@Ghanshyam <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 
its perfect tag
 
5:59 AM
Anyone have anything against netbeans (Hoping for input before i download)
 
@greenhorn are you sure that you have set the 'name' variable to the pageContext? or to request object? try to print the value of it
 
@CrazyNinja i directly written using scripplet like this
String name="adam";
 
@greenhorn what if this question asked in chat.stackoverflow.com/rooms/44929/… ?
 
6:15 AM
@CrazyNinja the concern person is not available there that's why i came here anyway thanks for trying to help me
 
6:29 AM
Im gettin off. ttyl
 
7:00 AM
morning all
 
Morning
 
Good Morning!
 
for some reason I'm seeing adds of Agent Provocateur everywhere in my banners
I wonder what I browsed...
 
Morning
 
Morning ^^
I have to admit that like the key bindings on the Mac better
curly braces just are so much harder to type on a win machine..
inb4 re-binding the keys on my win
 
7:15 AM
@Gemtastic Huh?
How is it done on mac?
Looks the same to me...
 
option + shift + 8 = {
 
@Gemtastic And SHIFT+[ = { on any other machine...
 
I have a scandinavian keyboard
On windowns it's alt gr (right alt) + 7 = {
 
@Gemtastic Get a normal keyboard then -_-
 
^ that
 
7:18 AM
alt gr + 0 = }
 
Weird people and their weird keyboards
 
it's the problem of having extra letters
 
This is a normal keyboard, we have some extra keys
 
same thing in Spanish
 
In french keyboards, you type the numbers with SHIFT held, and the symbols without
 
7:18 AM
Is there a mutable Integer-like type in Java?
 
So 1 = ! and SHIFT+1 = 1
 
fge
No, on a French keyboad, 1 = &, not !
 
@fge SSDD
 
@ReutSharabani take a look in common.langs
 
fge
7:19 AM
<-- uses a French keyboard because it's much easier to type accentuated letters/dead keys
 
That's Same shit, different digit
 
there's a MutableInt class as far as I remember
 
fge
And the ! is at the immediate left of the right shift key
 
how do I ask the bots for a class again?
 
Anyhow... It's nicer keybinding on scandinavian macs than the win
 
fge
@Tavo /javadoc TheClass
 
/javadoc common.langs.MutableInt
 
@Tavo Sorry, I never heard of that class. :(
 
lel
@fge thanks
 
/javadoc org.apache.commons.lang.mutable.MutableInt
 
7:21 AM
@MadaraUchiha Sorry, I never heard of that class. :(
 
@ReutSharabani looks good to me I guess
or you can just use an AtomicInteger. Should do the trick
@ReutSharabani I'll be curious. What's your use case for a mutable integer?
@MadaraUchiha do I need to ask for the whole package and classname?
 
@Tavo Not sure.
I didn't build ze bot.
 
@Tavo I found a question suggesting AtomicInteger. I thought about using it in an answer I've given here: stackoverflow.com/a/31177672/948550
 
ah ok
I'll leave SO to judge your solution then :P
 
fge
@Tavo it may also be that OakBot doesn't reference this package
 
7:27 AM
mutable numbers suck
just use a variable!
 
@fge I guess so
 
fge
Which is good, since apache commons suck :p
 
but I was wondering about how to ask the bot
lol
let's see
/javadoc BlockingDeque
 
@Tavo java.util.concurrent.BlockingDeque: A Deque that additionally supports blocking operations that wait for the deque to become non-empty when retrieving an element, and wait for space to become available in the deque when storing an element. (1/6)
 
sweet
/javadoc concurrent.BlockingDeque
 
7:28 AM
@Tavo Sorry, I never heard of that class. :(
 
/javadoc java.util.concurrent.BlockingDeque
 
@Tavo java.util.concurrent.BlockingDeque: A Deque that additionally supports blocking operations that wait for the deque to become non-empty when retrieving an element, and wait for space to become available in the deque when storing an element. (1/6)
 
there we go. No partial package names allowed
@MadaraUchiha mistery solved
 
7:50 AM
Hello guys.
What would you recommend learning? JavaFX or Swing?
 
@HassanAlthaf JFX.
 
FX
 
@HassanAlthaf Swing is officially deprecated
so go for JavaFX
 
Swing is deprecating. It's not deprecated yet, but oracle isn't gonna work any more on it
 
7:51 AM
Sht there are no JavaFX courses at Udemy
:/
 
Oracle has a lot of tutorials on FX
 
Do you guys know any high quality paid/free tutorials for JavaFX?
@Gemtastic They are not noob friendly.
 
I think they're just fine.
 
@HassanAlthaf courses?
 
Yeah.
 
7:52 AM
@HassanAlthaf noob friendly tutorials are rubbish
 
like in "courses"?
 
shoot for the stars are you're not moving an inch
 
Let me show you a sick one I found in Swing
But since its deprecating not buying.
 
nah thanks. Did Swing a while ago. Hated it
 
<-- Not impressed with Swing either
 
getting the layout right takes ages
 
With a coupon which Udemy is offering, it is $24.
 
hah. There's a reason for that :P
 
Layout is hard.
 
FX comes with scene builder. That's very n00b friendly
 
7:54 AM
I know that. :P
I have it in my laptop atm.
 
@Gemtastic I am working on swing with oracle database
 
The most popular layout requiring engine, the web, has only just started figuring it out properly
And flexbox still have some ways to go.
 
@Ghanshyam And?
 
its now work properly!!
I am making desktop software right now
 
Web Applications are easy to do..
 
7:56 AM
@Gemtastic how are you?
 
And design with Jribbon
 
@HassanAlthaf You'd think that.
 
@MadaraUchiha I have done a couple...
 
@Ghanshyam Good for you, but it's not changing the fact that swing is deprecating.
@greenhorn I'm fine thank you
 
@Ghanshyam Tomorrow, when Windows comes up with Windows 13, that will invalidate most of the existing APIs, your Swing apps will cease working.
 
7:56 AM
Guys i will say a scenario and need your suggestions
 
And no one will fix it.
@HassanAlthaf So have I.
More than a couple.
 
@MadaraUchiha like 3!
 
@MadaraUchiha Yup, but I have not even done one working Software application. Well one, in C#.
 
@greenhorn No.
 
@Gemtastic if you know flow of swing than easily can do...
 
7:57 AM
@HassanAlthaf Writing any software is easy
 
@MadaraUchiha may be
 
Writing any software well is almost always hard.
 
@Unihedron thank you
 
@MadaraUchiha Yup.
 
@Ghanshyam Please rephrase that because that makes no sense to me. What are you trying to tell me?
 
7:57 AM
@Ghanshyam You'd build a business on "maybe"?
I wouldn't.
 
I like to consider all the good practices before I do any project..
 
@Gemtastic i will say a scenario and need your suggestions
 
Btw, I found an awesome free course on Java at Udemy.
 
@greenhorn If I feel like answering I will
 
Let me link.
I want you guys to tell me if its worth my time.
 
7:58 AM
@HassanAlthaf Writing ugly-ass web apps where everything is global is easy. Today. It would be the maintainer's worst nightmare 6 months down the road.
 
@HassanAlthaf No, it's not.
 
@Unihedron you were a second faster than me :P
 
@Gemtastic need just flow of swing how work than other work easily
 
Look, any course is useless if it's free, unless it's official. You already knew it's not worth your time, there's no point asking to reassure.
 
@Ghanshyam Still makes no sense to me what so ever. What is it you're trying to say? Take it from the beginning.
 
7:59 AM
@MadaraUchiha Where everything is global?
 
@MadaraUchiha i will must
 
@Ghanshyam Good luck with that then.
@HassanAlthaf Global variables?
 
Guys, can you look at its contents? Is it worth my time?
 

« first day (1713 days earlier)      last day (3230 days later) »