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

00:00
"Every day you have a choice to be honest or deceptive. If you commit to telling the truth, you will win. You’ll win more trust, you’ll win more business, and you’ll win more peace of mind. You’ll break the system and be even more successful." -Dale Patridge (source)
 
2 hours later…
02:21
reads a book
 
3 hours later…
USM
USM
05:25
Hey Guys, Sorry for disturbing on saturday...
How can we pass query param in a Post request?
05:41
@USM can't you just append it to the URL?
USM
USM
like this?
String url = lrl + "?country=" + URLEncoder.encode(country, "utf-8") + "&state="
+ URLEncoder.encode(state, "utf-8");
@JennaSloan i treid this, nnbut its nt working
@USM I wrote a class that does just that. You can find the relative method here: github.com/Jenna3715/ChatBot/blob/master/src/utils/…
USM
USM
cant we send this using RestTemplate?
I am using that in my project , so i have written all types in a cleint class
 
2 hours later…
08:25
@JennaSloan why synchronized?
also... catch(NullPointerException npe)0.o?
that is an odd thing to catch
I read an answer that quoted this article: artima.com/weblogs/viewpost.jsp?thread=252441, which goes like this:
@MiroslavCetojevic Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
It also fooled the Java designers who didn't understand C++ well enough. For example, they thought operator overloading was too hard for programmers to use properly. Which is basically true in C++, because C++ has both stack allocation and heap allocation and you must overload your operators to handle all situations and not cause memory leaks. Difficult indeed. Java, however, has a single storage allocation mechanism and a garbage collector, which makes operator overloading trivial
-- as was shown in C# (but had already been shown in Python, which predated Java)
Is the last sentence true? Single storage allocation and garbage collection would've made operator overloading trivial to implement?
not by definition
but it removes the difficulties C++ has with operator overloading
in modern languages however, operator overloading is just syntax sugar
it could easily be replaced with function calls by the compiler
08:42
what function calls?
normal function calls
val a = 42 + 7 is basically the same as val a = 42.plus(7)
Interesting. I kind of wonder how Java would design this, if they planned to implement this in the future.
you can always use an OO plugin
which works exactly like what I said
(same as how Groovy and Kotlin implemented it)
You mean, a JVM based language?
08:52
Wow, that's great!
Thanks
Zoe
Zoe
morning
Morning.
Morning.
Alisha down?
@Alisha
Zoe
Zoe
09:09
@Wietlol yeah, taken down. Too many bugs
 
3 hours later…
12:00
The borders of some oriental carpets were seen to protect those sitting within its magic confines. (source)
12:15
@geisterfurz007 I think you got it working :)
12:32
I did, thanks :)
 
4 hours later…
16:20
I'm reading through a course book, and this came up:
if (someString == "abc") { // this does not always work
  ...
}
the point is that the equality operator checks by reference and not by value
but then I'm confused. Can the contents of that block ever be run?
the phrasing makes it sound like it might work
or maybe they meant that comparing with == doesn't always work intuitively
it seems to explain it further, but then it doesn't:
> Unfortunately, Java’s implementation of strings means that using == will often misleadingly give the
‘right’ answer when comparing two different String objects with identical contents
Zoe
Zoe
482
Q: String.equals versus ==

franvergara66This code separates a string into tokens and stores them in an array of strings, and then compares a variable with the first home ... why isn't it working? public static void main(String...aArguments) throws IOException { String usuario = "Jorman"; String password = "14988611"; Str...

oh, so a == 'x' will work, but a == b won't, right?
(not that I'm going to use == with strings in the future, but it's curious)
Zoe
Zoe
assuming x is a char, and a and b are strings, yes.
if a and b are ints, or any kind of primitive in general, == is right.
I keep getting confused between ' and " in java. I meant a == "x"
Zoe
Zoe
For classes, == will still work, but depending on what you're comparing (value vs reference), == might give the wrong result.
16:32
i want to achieve this.. can any1 help me?
??????????<Node> frontier;
if (somecondition) {
frontier = new LinkedList<Node>();// FIFO
} else if (somecondition) {{
frontier = new ArrayDeque<Node>();// LIFO
}else if (somecondition) {{
frontier = new PriorityQueue<Node>();// LIFO
}
@AbhishekKargawal Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
i can Dequeue for linkedlist and arraydeque.. but no idea about priorityQueue
Zoe
Zoe
16:44
You need to find a shared superclass
trying but not able to find ... can you please suggest me one
Zoe
Zoe
If you can't find one, that likely means Object is the first shared one.
But you're likely looking for Collection
17:23
This is not a homework help service, @Abhishek.
And hey @Zoe
Zoe
Zoe
Hey @Michael
17:50
@Zoe I would think Queue would be better
Zoe
Zoe
Is LinkedList a queue?
Nope
@jennaSloan the LinkedList prevents it
@Zoe Yes, it is. Look at the documentation.
Zoe
Zoe
18:06
oh
missed the implementations xd
18:21
@Zoe yes
 
1 hour later…
19:23
@AbhishekKargawal Collection maybe?
@MadaraUchiha Do you even know anything about Java?
Closest would be Queue
19:47
Do you even lift, bro?
@JennaSloan "anything" yes,
I don't remember the 20 deep inheritance tree for every data structure though.
I just remember what they're each useful for conceptually, and carry on.
20:07
@MadaraUchiha That's why you look at the docs dude
@JennaSloan If I cared enough about it, sure ;)
Remember, I don't do Java for a living (anymore). I'm here for the fun discussions and seeing some of your reactions when I bash Java :D
I try to do injection of some class in a Filter using HK2. I try to use @Context, or @Injection with build Injection but that not works. I don't want to use Guice or CDI. You have some ideas about how I can resolve that problem?
 
2 hours later…
21:45
@MadaraUchiha sounds like trolling to me
Maybe somewhat lightly :)
Although my arguments are generally good and have basis, I hope
Also, it does make for an interesting discussion about language features
21:58
I'm new to Java, I want to write a function that will accept an ArrayList of any type, i've tried `ArrayList<T> someArray` but I keep getting `MyMath.java:7: error: cannot find symbol
public static boolean isEmpty(ArrayList<T> someArray)`
Any insight would be greatly appreciated.
22:24
Basically you need "<T>" before the return type
@towc Yes they can! I threw together an ideone with things that would work here. Idea being: If the compiler knows the Strings as literals, they will end up in a shared String pool. That way all occurences share the same reference and == will be true when comparing.
This answer goes into detail referencing two specifications and takes a look into the bytecode of it.
Oh noes. Wietlol entered the ring. I hope I didn't fail some explanation :D
23:09
@MadaraUchiha do you know interesting language features?
more out of the box features
@PaulMcloughlin using List<T> you would accept any list of type T (which you can use further in your method if you want to)
but you could also simply do List<?>, this would be a list of any type
(List<?> is short for List<? extends Object>, which you can replace it by to give it a different upper boundary)
23:28
Thanks for the replies
I used List<?>
I need to get to grips with Generics
I think I understand the overall idea, are they similar to Templates in C++?
I dont think so
also, Java's generics are extremely complex
I also have issues understanding the logic sometime
and my IDE also implies wrong stuff about them (which I think is quite odd)
they are extremely powerful though on the other hand, so I am happy with them
How would you describe them?
a chainsaw
effective, but easy to misuse
(can potentially murder people)
ha, but if you were trying to explain them to someone who knows programming but is not familiar with the concept
How would you explain them, this question is for anyone btw
23:37
ooh, I like this
I like cheat sheets
Thanks for the link @Wietlol
this is a good image
I will delve into generics for an hour, once I finish up this little code academy project
Thanks for the resource

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