« first day (2861 days earlier)      last day (2094 days later) » 

12:00 AM
"Even if you’re on the right track, you’ll get run over if you just sit there...." -Will Rogers (source)
 
 
2 hours later…
1:41 AM
Guys? what are good chat communities for java? here (maybe, hopefully) javaspecialists@slack, what else?
 
@ledonter 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
 
 
3 hours later…
Zoe
5:01 AM
Morning
 
Morning.
 
 
1 hour later…
6:24 AM
Morning
 
user8622974
Morning
 
Morning.
 
@Alan I do not understand.
 
6:46 AM
@Pseudohuman are you human
 
@Alan No.
 
@Pseudohuman are you a pseudohuman
 
@Alan I do not understand.
 
This bot's dodo:(
 
morn
 
user8622974
6:55 AM
morn
 
morn
 
dhS
Hi
need information on spring cloud
Is Eureka server open source ?
 
Well, the source code is in github... github.com/spring-cloud/spring-cloud-netflix
pretty open
 
dhS
Thank @Gimby
Thank you :)
 
7:40 AM
/afk
 
@Alan Cya later
 
8:07 AM
/afk
 
@Alan Cya later
 
@Pseudohuman have you feelings
 
@Alan Welcome back!
 
@Alan I do not understand.
 
/cat
 
8:33 AM
@Pseudohuman do you understand that Alan is bored?
 
@Gimby I do not understand.
 
smart bot.
 
@Gimby I do not understand.
 
8:46 AM
morn
 
user8622974
morn
 
morn
 
morno
 
morn, I have a question (I am new to Java)
 
no
/no
 
xd :(
 
I could've just edited the "no" into "/no" :/
go ahead ask your question, so I can do "/facepalm"
 
String text=System.console().readLine(); In this example, System() is a class, with the point (.) I can access on the class's methods, vars etc. So is Console() a method or something like a subclass of system
/facepalm
 
I do it by myself xd
 
8:52 AM
:'(
 
@Alan check out the javadoc of the class
/javadoc System
 
go into your source, click on console() and hit F3
 
/javadoc java.lang.System
 
You'll find that console() is a static method
 
8:53 AM
(Otherwise, it would have to be "System.Console()" in theory, since that's what some people agreed on)
 
Oh okay thanks, I was only confused because on javatpoint.com/java-console-class It tells Console is a class.
 
That's a different one
 
Ok I got it thanks. :P
 
Java.io.Console is a class
System.console() probably instantiates that class for you (idk), but it's just a static method in the class System.
 
Check the javadoc again to see what the console() method returns :)
 
8:56 AM
Good to know, thanks. Yes I do that now @Gimby thanks
 
Some retard put different beans into our coffee machine :'(
Now it's just bitter :(
 
@Gimby So when the method console() gets calles in System, the specific console Object (of the Class Console) gets returned right?
 
Yep. And then in your example, the readLine() method is called on the returned Console object.
 
but isn't readLIne() a method in console() ? So doesn't the readLine() method gets called first and after its returnation, the console returns the object? @Gimby
 
It's executed from left to right.
System.console() returns (and thereby sort of turns into) a Java.io.Console object
on that Console object, you then call .readLine()
`Console myConsole = System.console();
myConsole.readLine();`
Wait how do you put code in here
 
9:06 AM
Basically the example code is the same as Console console = System.console(); String text = console.readLine();
 
anyway, ^ that is the same thing
exactly lol
o/
 
user8622974
\o
 
\o
 
I just wanted to hive Gimby tho :(
*highfive
 
9:07 AM
Alright!
 
good job brain
 
Shesh Understood that shit thanks :) The only thing I am now wondering, is Console console = System.console(); the same as Console console = new Console();?
 
That's a case of "try it, see what happens" :)
 
Good so should I compare the two object if they are the same? or should I print something from the object
 
Just try it, I'm pretty sure you're not going to even get as far as comparing anything ;)
 
9:15 AM
Ok so that means they are not the same lol
 
You will find that Console console = new Console(); is not even going to compile.
 
Oh, Console class is final
 
Yes, that means you can't extend it. There is a more devious trick hidden in there
 
noon
o/
 
user8622974
\o
 
9:19 AM
\o
 
nice, the bots respond to an edit
 
:D
 
@Gimby hm. So I can create an object but It can't be extended, that makes sense but when I call the constructor of Console() the object should be build so that's what don't make sense to me
 
bots are soo responsive.
 
9:21 AM
@Alan You can't create an object because the constructor is private.
 
ohayoo
bit annoying that I can't easily type \overline{o}
 
But why is then an object returned when I access Console's method via System() @Gimby
May dumb questions for you but I'll try my best figuring out Javas workflow
 
@Alan because somewhere somehow deep within the Java runtime there is a Console object and it is returned by System.console(). And you are effectively forced to use that one and only object.
That is probably going a little too deep for you right now, you may have to learn a little bit more about object oriented design before this starts to click.
 
Ok, yes I should. C helped me somehow to understand some things of Java, as It is the first time of OOP for me It's not that easy. Thanks anyways. I have understood something more now @Gimby
 
PS: don't think that these classes you are working with now are how you will be designing your own classes. You shouldn't. These are just low level JDK classes, they have their own special little design choices. In your own code, you should only need to static keyword in exceptional cases.
*to = the, god I make that mistake so often
 
9:42 AM
@Alan You can usually look up the source code of a class by right clicking on a function and selecting some option that guides you there.
In there you can look what System.console() does, and if it changes the console object in any important way.
 
10:00 AM
Its probably a little too soon for Alan to start digging through low level JDK code and running into the many mysteries of native code that you will find there ;)
 
How do you display lil code pieces in your message?
test
oh nvm why didn't it work up there
So if it's just return new Console(); he's going to know :D
Okay it isn't
I don't even understand that code tbh
 
10:28 AM
aww
I thought map.putIfAbsent could be promising but ...
it returns either null or the old value if there is an existing key
why does it not return the value itself ._.
 
10:40 AM
@KarelG maybe you want getOrdefault()
 
I do not
I just checked the map with contains
 
11:42 AM
/doge
 
/twss
 
/yds
 
12:00 PM
Wedding rings are traditionally worn on the left hand because people believed that a vena amoris, or a "lover's vein," connected the 4th finger on this hand to the heart. (source)
 
Well then. TIL.
 
Hello :)
 
o/
morn
 
user8622974
\o
 
\o
 
user8622974
12:09 PM
morn
 
morn
 
Hey guys, you seeing this ^
 
yep
/cat
 
12:17 PM
This cat's mad
 
12:42 PM
/php
:/
 
@AMDG What the hell?
@geisterfurz007 Any idea why are there so many bots in this room?
 
I don't think that is going to get much more of a response than "because reasons".
 
@Gimby sorry, I didn't get you
@Vogel612 Heya! Long time no see.
 
Heya
 
12:57 PM
ssup?
And how is your dog doing? :P
 
1:08 PM
/fatcat
 
/cat
 
O_o
 
1:28 PM
@Unknown Were they these beans? most-expensive.coffee
 
I don't think so -
 
because reasons

All three are by regulars. Oak by Michael, Alisha by Zoe and Pseudohuman by Jenna
 
@ItachiUchiha yo
 
@Michael yuck...
 
1:44 PM
I have a regex search with pattern #(.+)
final StringBuffer buffer = new StringBuffer(activityType.getDescription().length());
while (matcher.find()) {
  matcher.appendReplacement(buffer, extraInfoJson.optString(matcher.group(1), "UNKNOWN"));
}
matcher.appendTail(buffer);
using this above to replace a string with #... inside with values from the given json object
however it fails when the json object returns another string with # in it.
Did someone have experienced this?
seems logical but I cannot "circumvent it" let's say
 
Pattern ^#(.*) maybe?
 
it is in a loop. Does that work?
because there are multiple '#...' entries
that gets replaced to that value in the json
 
Ah, nvm then. Thought it was only the start
Can you save an index?
 
like lorem ipsum #key valor #dam leerio #boo en json {key: ... , dam: ..., boo: ...}
it works fine. but not when ... contains a #
hmm gotcha leave. Will break my head on this the next monday. That is not a nice start of the week.
 
It is not. Let me know if you found something. Sounds interesting!
 
2:53 PM
@ItachiUchiha some days it's better, some days it's worse. The cruciate ligaments in both hind legs are ripped
been for a while now. He's getting regular meds and walks are shorter
@KarelG I assume you want to replace the #-things that have been substituted themselves?
because if so, you need to construct a new matcher
a Matcher keeps a reference to the CharSequence it was created on. That CharSequence is immutable AFAIK
changing the string buffer doesn't update the charsequence the matcher operates on which makes it "break"
 
/afk
 
@Alan Cya later
 
 
1 hour later…
4:35 PM
Hello everyone, my name is offtopic, and I was wondering if anyone knows how to remove the natural noise output from speakers? Or is that an effect as a result of the nature of electron flow and current fluctuations?
 
4:59 PM
Anyone know what I'm talking about? That static you hear when you crank the speakers to max but don't play anything?
 
Zoe
5:09 PM
/shrug
 
¯\_(ツ)_/¯
 
5:20 PM
@AMDG Remanent microwave radiation from the Big Bang?
 
So, I don't have liberty installed in my machine, only the "plain" Websphere 8.5, but eclipse does not give me na option to use it, it only allows me to use the liberty
Am I missing something here?
 
@Michael oh yeah... I forgot about that
 
and if I do try to go for the liberty server, i get the following error
 
@FelipeOliveira Did you try looking for a WebSphere plugin for Eclipse?
 
it authomatically went for the liberty when I tried to choose Websphere, but I didnt go any further
I'll try looking it up, thanks
 
6:22 PM
I wrote a program that automatically builds this wiki page based on the help documentation in Oak's source code.
 
 
2 hours later…
8:44 PM
and you thought I would go a day without posting in this chat
Question: Is it possible to decompile java?
 
9:14 PM
Too broad.
What do you mean with Java (the runtime, the application you wrote, the language itself)?
What do you want to end up with after decompiling?
 
9:30 PM
I always name my applications "Java", then I can say "I made/invented/created/designed/pooped Java"
 
hello
i'm new in java and i was trying to make a hello world program but System.out.printIn("hello world"); just doesn't work(which is what all tutorials recommend).
After trying a few things i found out that System.out.print("hello world"); works perfectly.
am i doing anything wrong?
 
@NickVen 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
 
9:47 PM
printIn is nothing
println is
its printline
I assume you use notepad to write the code then
 
ooops
oh w8 no it still doesn't work
 
how does it not work?
 
and i'm using neatbeans
idk
 
and Netbeans didnt tell you printIn was nothing?
 
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: java.io.PrintStream.printin
at javaapplication5.JavaApplication5.main(JavaApplication5.java:7)
thats the error
 
9:52 PM
its not printin
 
println??
 
there should be a red line under it
 
like an L?
 
a red mark at the left side
 
yes there is
 
9:53 PM
error markings over the file in the internal explorer
then why do you try to run the code?
there should also be autocompletion
 
but print works
 
so when you write "pri" it should give you a list of all the options
and that list should be empty when you even attempt to go "printi"
 
i turned that off it's anoying
 
/facepalm
 
9:55 PM
lol
:)
 
i can recommend you to get used to it
autocompletion is basically the only thing an ide has to do
and an ide that does it better than others is by definition a better ide
 
no it also looks good
 
but yea, it is println with an l
because it is "print line"
 
works now
oohh i get it
so y is there a print too
 
because in most cases, you do want to print a string followed by a newline, but there are some cases where you dont
in those, you really want to just have something to print without the newline
 
9:58 PM
so instead of print("hi/n") you write println("hi")
?
 
yea
 
oh ok
thanks
 
but you can also do print("hi ") ... print(name)
 
what do you mean
 
it would print "hi Wietlol"
rather than
hi
Wietlol
 
9:59 PM
oh yes
is there a previous line char?
 
not really
there is a delete and backspace char though
but they usually are not used by applications
they just exist to make keyboard input easier
51
Q: How to delete stuff printed to console by System.out.println()?

anonIn a Java application I'm using some calls to System.out.println(). Now I want to find a way to programmatically delete this stuff. I couldn't find any solution with google, so are there any hints?

 
i tried \033[0;0H to but the cursor at the top left corner but it didn't work although ansi esc sequences for color seem to work just fine
 
> \033[0;0H
0.o?
 
it works on python xd
 
there are a lot of things that work in python
there are a lot of things that work in java
 
10:08 PM
but how can some ansi sequences work and some not
 
moving to a different and new language is always going to cause issues
 
yes i can see lol
 
console support in Java isnt that great
but that is because noone in Java world cares about the stupid console
 
it's more for gui apps right?
 
there is a lot more focus on other things, which are much more important
Java is a general purpose language
to such degree that I would use it for everything
console applications, desktop applications, websites, web servers, mobile apps, etc
 
10:11 PM
yeah but i see that it's being used for android apps and games so idk
 
I wouldnt actually use it for games though
I think
Java, while still being faster than 90+% of other languages isnt fast enough for games
 
well it sure is way faster than python so i'm going to stick with it for now
 
at least, the JVM isnt
 
idk what that is
 
the great thing about Java is not Java itself imo
its the JVM
its the Java Virtual Machine
 
10:13 PM
aha
 
the runtime, which runs your code
one of its great features is that you dont have to write in Java
for you, it could be much easier to learn Jython
(yes, that is Python for JVM)
 
nah
 
for people that come from Javascript, it might be easier to use Groovy
for people that come from C#, it might be easiest to use Java
for people that come from Haskell or Pascal, it might be easier to use Fanton
for people that come from Typescript, Scala or Kotlin might be easier to learn
but all those JVM languages work together as if they are one
you can have a project where you use all of those languages with each other
we often used Java/Groovy/Kotlin combinations
 
i prefer starting to learn java even though i come from python, i've heard very good things about it
didn't even know the rest existed
 
Java is ofcourse the point of truth
the Java sourcecode and Java bytecode are really similar
and the other languages all generate Java bytecode or JVM bytecode
So when learning any JVM language, you should also learn Java
 
10:18 PM
i'm also having trouble finding a way to convert a java project in .exe
if you could help
 
do you have a specific reason to do that?
jars are generally more powerful than exe files
so if there is no good reason to do anything like it, then I would disrecommend doing so
 
it only runs through netbeans otherwise so i thought that this was what i needed to do
 
you can run a jar by double clicking on it in the explorer... at least on windows
a jar can be executed by any machine though
 
it's a .class file i think
 
.class files are not programs though
you need .jar files
 
10:22 PM
i might have been looking in the wrong folder
 
i havent used netbeans in ages, so i might be wrong on how it works
 
i'm no expert either
haven't used it that much
 
oh well, that was easier than I thought
at least, the search
 
@NickVen Are you a real person?
 
@Mibael go away, this is bot talk over here
 
10:24 PM
yeah, i think so
 
only bots are allowed to speak
 
Ok sorry, I'll let you bots speak. xD
 
@NickVen there are applications that generate an exe file to run the jar for example though
but you need the jar
 
@NickVen I love Neatbeans. It's so neat.
 
is jar cross-platform
?
 
10:27 PM
on the other hand, more recent versions of Java do have a platform specific build instruction option
yea, jars are cross platform
 
cool
 
they have an internal file system, which can be used for the resources and stuff
they contain your application's instructions, which get executed by the JVM, which the user's machine has installed
and more complicated stuff that noone knows about
 
sounds good
i'll try using them
 
its often good to remember why Java is so powerful :D
and why I really want to stop using .net
 
i'm not going to ask what .net is i'm going to sleep lol thanks for everything!
 
 
1 hour later…
11:57 PM
@geisterfurz007 Sorry. I didn't write it. Someone wanted me to edit an application, but it was already compiled.
I wanted to get it to an editable readable format.
 

« first day (2861 days earlier)      last day (2094 days later) »