« first day (1715 days earlier)      last day (3209 days later) » 

3:01 PM
( Note: Wildfly server is set as targeted runtime for the project)
 
user1648409
Why does
public void update(TeamWrapper teams) {
teamList = generateDataList(teams);
}
not update my UI effectively? When debugging I clearly see, that the data has been updated, but that is not visually updated.. I also used revalidate() and repaint() in the main frame, with no effect at all
 
because you're not using revalidate() and repait() properly
 
user1648409
@Unihedron How am i supposed to use them then? I fired an update() call and updated the list. How should i use repaint(), revalidate() there or is this completely wrong?
 
@Shiuyin update the list first then fire repaint
 
user1648409
public void update(TeamWrapper teams) {
teamList = generateDataList(teams);
repaint();
revalidate();
}

Did it, like that
 
3:09 PM
@Shiuyin What is teamList's type?
 
user1648409
@Michael JList
 
@Shiuyin You're creating a new JList. You have to remove the old one from the window, then add the new one.
What you probably want to do is clear the data on the existing JList, and then assign new data to it.
You don't want to re-create the JList object.
 
user1648409
@Michael ye, that has to be it! Thanks
 
user1648409
@Michael Hm, but if i have to JList object, i can't just simply use add() on that. And even if i try to get the model via teamList.getModel() there is no add() method...
 
user1648409
@Michael i guess i have to keep a link to the DefaultListModel and use that to alter the list, correct?
 
3:17 PM
/javadocs JList#setListData
 
Which one do you mean? (type the number)
1. javax.swing.JList#setListData(Object[])
2. javax.swing.JList#setListData(Vector)
 
1
 
@Michael void setListData(Object[] listData): Constructs a read-only ListModel from an array of items, and calls setModel with this model. (1/2)
 
user1648409
Hm, ok... O,o thanks
 
hello anyone knows online java errors highlighting site ?
 
3:24 PM
@FastSnail What does that even mean?
 
@FastSnail Wut.
 
do you know online java errors highlighting site ?
 
-_-
 
@FastSnail Of course! He still owes me five bucks.
Do you know where he is? I'll kill him!
 
what?????????????
 
3:26 PM
Don't "what" me, it's you who's confusing us, not the other way.
 
i'm asking is there any website which can detect java syntex errors ?????
 
its called Eclipse
and its an IDE
 
@FastSnail Thank you for finally phrasing it in an understandable way
We don't code Java in webbrowsers, we use IDEs such as Eclipse, NetBeans and IntelliJ.
Java isn't JavaScript. Not. At. All.
2
 
Wait.
 
yes we never do either
but it's not my intention
 
3:29 PM
@Gemtastic that's not strictly true
 
Java really is Javascript to the people who can't reason languages specifics. Of course, this is a professional site and our target audience contains a small portion of these people, but they're still there.
 
@Vogel612 well, some of us use Notepad
 
@Gemtastic Most of us use vim
 
i know java != javascript but it's not what i'm telling
 
and some of us use online coding sites where it's just simpler to actually type into the huge box
 
3:30 PM
^
 
@Unihedron I only use that for JavaScript
 
ace.c9.io is aweshum
 
@Unihedron wait that wasn't for commit message editing?
 
@Gemtastic If you're using Notepad, you're crazy. You're not a hacker or a 1337 developer.
 
*hacker
 
3:31 PM
Just out of curiousity, i have a polymorphism question
 
@Michael I didn't say I use it
 
@JohnnyCoder You're in luck! I might have an answer
 
although I used notepad++ for html and css
 
Imagine there are 2 classes, Robot and RobotAthlete where Robot is the superclass and RobotAthlete is the sub
 
@Gemtastic Good.
xD
 
3:32 PM
i'm goint to build browser extension that send code to a webserver and get feed back with errors so inside a browser i can see errors.for example what my intention is to see errors in stack overflow questions .so i can easily see errors
 
My teacher never fully explained this, and I dont fully understand it myself but,
 
@FastSnail Don't.
 
why
 
@FastSnail You do that.
 
Because now you have two problems.
Now you gotta build a webserver that checks if code has errors, instead of actually checking it.
And then you gotta build the checking mechanism.
 
3:33 PM
what is the value of doing Robot ObamaSucks = new RobotAthlete();
@Unihedron that s the full question
 
@JohnnyCoder A Robot reference to the RobotAthlete.
 
Well, I deleted my wildfly directory. Deleted all the runtime environments, and set it up fresh. The server says that 8080 is in use... and it is... by itself. Enough of this. Time to play games.
 
that's why i'm looking for website that do it for me
 
Indeed
 
Well, not a reference since we're in Java, but figuratively.
 
3:34 PM
@JohnnyCoder Because your ObamaSucks variable can be assigned to any class that extends Robot.
 
@FastSnail A website is not a webserver.
 
It limits what ObamaSucks can do
because left side of the assignment operator determines method legality
 
it doesn't limit
 
so if RobotAthletes can say turn right, but Robots cant, ObamaSucks cant turn right
 
Um.
 
3:35 PM
yes but sometimes website pass codes to server and server send responce .so i can pass codes directly
 
The object is unchanged, just that your scope to the reference is of a Robot, not a RobotAthelete
@FastSnail No.
 
so how does that affect the object?
 
That's not how the internet works.
 
no what?
 
what do we get out of it?
 
3:36 PM
@JohnnyCoder By having a Robot reference, you can only invoke its methods as Robot.
 
fast, click on the little arrow next to unihedrons comment @ you
@Unihedron Right, so that means the object cant invoke any RobotAthlete methods right?
 
Not unless they are present in Robot.
 
Okay, so how does that help a programmer achieve something?
I never understood the purpose of doing such a thing
 
It doesn't.
However, oftentimes you don't really need to know it's an athlete to initiate it.
 
i have created and i'm using a addon which play a alert sound when new questions appear
 
3:38 PM
If Robot has initialize(), RobotAthlete will implement it. It is better to pass the most accurate form than the highest form.
 
@JohnnyCoder It's all about abstraction and hiding the implementation details.
For example, say the Robot class has a "turnRight" method.
 
@Unihedron why dont me need to know its an athlete to initiate?
okay michael
 
You could have a WheeledRobot class that implements the method one way, and a TwoLeggedRobot class that implements it another way.
 
I know, overriding
 
@JohnnyCoder Because I have a RobotAthlete and I only have to give you a Robot type if that's all your method cares.
 
3:40 PM
^^
 
@Unihedron Ahh, so you mean its useful where a method has a Robot Obj parameter right?
 
This all goes to good object oriented design. Of course, it may seem redundant since you can achieve things in a straightforward way and keep it like a RobotAthlete whenever you need it, but that doesn't hide implementation details well.
@JohnnyCoder Yes; Or a generic typed instance like List<Robot> over List<RobotAthelete>.
Some may argue they prefer List<? extends Robot>, but screw them.
 
If your code doesn't care what kind of Robot it is, then you can use a Robot variable. However, if the code assumes that your Robot is an athlete, then the variable must be RobotAthlete.
 
^ The most concise way to put it.
 
Or, consider this more real-world example.
Say you have a class that retrieve's information on a user's bank account.
 
3:42 PM
Oh no, terrible metaphors incoming.
 
i gotta take me dog out real quick, finish explaining, and I will read up in 5 mins and ask any quetions I have
 
You call the BankInfo.getInfo(String name) method to get the bank info.
 
keep explaining, will be back to read in a bit
 
To the programmer who is invoking this class, he has no idea where it gets this bank data from. It could be from a Oracle database, a RESTful website, an XML file, etc.
So, this gives you the freedom of being able to define multiple implementations of this class.
So, you could have a BankInfoDatabase class, a BankInfoWebservice class, or a BankInfoXml class.
 
Also, since the implementation is hidden, you can change it to use better algorithms instead of passing a BankInfoViaDatabase class and no interfaces, which fixes the binary implementation.
 
3:44 PM
It also makes it a lot easier to unit test stuff.
 
Easily tested code is better code.
 
For instance, you do not want to actually have to query a database in your unit tests, because that is complicated to set up.
 
That is, to maintain.
 
So, you create another implementation of the class just for unit testing.
 
otherwise known as "mock"
 
3:45 PM
^
Mocking is extremely powerful.
 
Especially psychologically. Mocking people may be fun to those who have special interests.
 
@FastSnail If you don't know that on your own then you're too far from skilled enough to even attempt it.
 
@Unihedron @Michael thank you very much, this answered some of my questions
 
6 messages moved to Trash can
 
@Vogel612 Can you stop trashing everything or at least warn users first?
 
3:54 PM
you did warn them..
but sure I can do that :)
 
That's no substitute.
 
\o
 
How's everyone?
 
who kicked me ?
 
3:57 PM
@FastSnail I'm in a rather bad mood right now. I should've warned you.
in any way: stop bugging users when they do not respond to you
 
@FastSnail Now you don't even deserve a warning.
 
There should be a way to take rep away from users like him
 
Like there aren't one?
 
Is there?
 
@Vogel612 We got a trigger-happy RO here. xD
 
4:03 PM
hehehe
 
@Michael yea maybe I became a little less tolerant to such things when the 2nd monitor blew up
 
@Vogel612 Wait, what?!
 
drama and some more drama
there's still much ... suspense around there
 
well that's a serious room soooo it'll be fine eventually
take a break and it will all be ok!
 
well it wasn't a serious room anymore....
 
4:07 PM
...
 
and I got promoted RO after a mod cleaned up
 
that sounds like there's some dark backstory since I left network-wide politics
 
ehh not really
just regulars being a tad too considerate to new users.
 
Ok, the room is too quiet to be good.
 
are java newbies welcome here?
 
4:12 PM
There are no skill set limitations but we expect you to respect members of another skill level.
 
oh. that won't be a problem.
 
Welcome aboard!
 
thank you :)
 
@ElSordo welcome to the chat!
 
welcome
 
4:19 PM
ty
 
@Vogel612 Well it's not their fault that your monitor blew up.
This is why we shouldn't promote people willy-nilly.
Anyway, I'm off to lunch. Bye all
 
user5033850
guys hello, i need some help
 
me too
 
user5033850
so, can i tell you?
 
4:26 PM
Whatchya need?
 
user5033850
i need someone to try to improve one code
 
user5033850
existing code
 
I accept paypal, dogecoins and nyancoins.
 
user5033850
:P
 
You forgot bitcoins
 
4:27 PM
Nah, bitcoins are no longer valuable to my dimension.
 
@TheodoraBaxevani anyways, post the code to hastebin or pastebin then give us a link
Snail's back :o
 
user5033850
guys
 
user5033850
here is a code stackoverflow.com/questions/31222133/reverse-an-existing-number that does reverse all numbers like 123 to 321 but the problem is when we give 50, 600, 7000 ect it returns only 5,6,7 passing by all the zeroes
 
user5033850
i want to improve the code so it works good and for this situation
 
user5033850
4:29 PM
:)
 
Wait, what?
What's wrong with returning 5 when you deliver 50?
50 reversed is 5.
 
do u plan on using only ints
 
user5033850
when i give 50, i want back 05
 
or doubles/long's too?
 
@TheodoraBaxevani Which is 5.
 
user5033850
4:30 PM
only ints :)
 
user5033850
yes its 5...but not 05 xD
 
!!>05 === 5
 
@Unihedron "SyntaxError: octal literals and octal escape sequences are deprecated"
 
!!>Number(50..toString().split("").reverse().join(""))
 
@Unihedron 5
 
4:31 PM
@TheodoraBaxevani 5 is 05. I have no idea what you're arguing over.
 
user5033850
in real world yes it means really nothing...but i wanna solve it
 
user5033850
im stuck 1 hour now
 
user5033850
but nothing
 
You know, to solve a problem you must first identify it.
You stated that 05 and 5 are different - are you going to state why?
 
@TheodoraBaxevani hi
 
user5033850
4:33 PM
yes i will give you an answer
 
user5033850
the zero in front of one number, its common for example at choosing the date, which goes from 01 to 31
 
user5033850
or at hour. 00 to 24
 
user5033850
hi :)
 
instead of using int
 
@TheodoraBaxevani I've never seen a date picker that has that leading zero.
 
4:37 PM
can u use a string and just reverse that string?
 
user5033850
yes, with strings its easy...but with ints?
 
Integers are integers. They are incapable of this insane unreasoned system that holds unidentity for same values just because you think they should retain leading zeros.
 
if u just want it to look nice... > pastebin.com/R9XjReVx
 
Doesn't StringBuilder have a reverse() as well?
/javadoc StringBuilder#reverse
 
@Unihedron StringBuilder reverse(): Causes this character sequence to be replaced by the reverse of the sequence. If there are any surrogate pairs included in the sequence, these are treated as single characters for the reverse operation. Thus, the order of the high-low surrogates is never reversed. Let n be the character length of this character sequence (not the length in char values) just prior to ...
execution of the reverse method. Then the character at index k in the new character sequence is equal to the character at index n-k-1 in the old character sequence. (1/2)
 
4:41 PM
Yeah, use that instead, since you're not multithreading.
 
user5033850
Hey Unihedron... let the occasion that 05 is equal to 5 ... even if i give any number that has 0 inside, like 3907 or 5074 the result is wrong :/
 
When displaying try String.format - gtg
 
@TheodoraBaxevani Eh... what?
Your code doesn't look that broken.
 
user5033850
yes......
 
user5033850
:/
 
user5033850
4:43 PM
it works only for numbers that dont include zero
 
user5033850
thats why i need your help
 
user5033850
to improve it
 
user5033850
:)
 
> Reverse of specified number is: 7093
You're kidding.
> Reverse of specified number is: 4705
Nope, can't reproduce whatever you just complained about.
 
user5033850
okey thanks for your time !
 
4:46 PM
^ See.
Anyway, you can just use this:
 
user5033850
yes but if you five number that doesnt have any zero, it works
 
user5033850
give*
 
@Unihedron reverse screen club :3
 
int value = 42; // or whatever

System.out.println("Reversed is: " + new StringBuilder(String.valueOf(value)).reverse());
 
user5033850
and the result is?
 
@UnknownOctopus You'll still fail on 600 and 7000.
22 mins ago, by Theodora Baxevani
here is a code http://stackoverflow.com/questions/31222133/reverse-an-existing-number that does reverse all numbers like 123 to 321 but the problem is when we give 50, 600, 7000 ect it returns only 5,6,7 passing by all the zeroes
 
@TheodoraBaxevani Functional code.
 
user5033850
UnknownOcto your code looks nice...you keep int as i want
 
It just won't work, which is way more important than looking nice.
 
user5033850
4:53 PM
yes the problem is the last if statement
 
user5033850
if(output < 10){
System.out.println("0"+output);
}
}
 
user5033850
couse will add 0 in front of any number within the number
 
No, it's the entire code. It doesn't handle the problem at all - retaining length.
 
Ik when 200 or 2000 is inputted it turns out false, i'm workin on it x
xD
 
:P
 
user5033850
4:59 PM
public static void main(String args[]){
int num=90;
int reversenum =0;
while( num != 0 ){
reversenum = reversenum * 10;
if (num%10==0)
reversenum = reversenum + ????? ;
else
reversenum = reversenum + num%10;
num = num/10;
}
System.out.println("Reverse of specified number is: "+reversenum);
}
 
user5033850
im sure that only something at the ????? is missing
 
user5033850
and it will work
 
Yes, and nothing fits.
 
user5033850
xD
 
user5033850
maybe you are right
 
5:00 PM
@TheodoraBaxevani just for future reference, post that to a site like pastebin/hastebin/ghostbin/piratebin
 
As I told you, as long as you're using int, you're stuck with a numerical system. That means 05 is 5.
@UnknownOctopus ^ That's the official code dump policy.
 
@Unihedron ah
 
Pastebin is kinda meh. Mostly because their API sucks. We prefer Hastebin for that reason.
 
@TheodoraBaxevani just use a string builder and if you need to work with the actual int itself then convert it when it comes to that
 
user5033850
i dont know any of those sites
 
user5033850
5:02 PM
what is their context?
 
Post your code there for us to see instead of in chat
 
user5033850
where to post it?
 
user5033850
in which site?
 
UnknownOctopus just told you.
 
Hastebin.com, Pastie.org, Github
..
 
user5033850
5:05 PM
okey i will do it :)
 
@Unihedron You realize on Unihedro.com the [text].(link) format doesn't work right?
 
2 days ago, by Unihedron
I'm logging into my domain registrar and changing unihedro.com to point to http://www.eternalmoonwalk.com/
 
user5033850
hey
 
user5033850
i wrote that at hastebin
 
user5033850
5:11 PM
now what?
 
Now turn off your web browser and go to sleep.
3
You must be tired.
 
user5033850
dont make fun at me, i need help.... :(
 
I think he was being serious
@Unihedron Lovin that lobster
 
inorit
 
user5033850
5:14 PM
so, the final point of our conversation is that we cant put a zero inside a number which time is int?
 
user5033850
type*
 
pretty much
 
Eh, "50" is a number with a zero.
 
but before the number no,
 
I think you need to take a good sleep and wake up to remember how numbers in the numerical system we use in this dimension works.
 
user5033850
5:15 PM
:'( This code neither works for 50
 
user5033850
couse it has zero inside
 
Then don't use it.
28 mins ago, by Unihedron
int value = 42; // or whatever

System.out.println("Reversed is: " + new StringBuilder(String.valueOf(value)).reverse());
 
user5033850
i must write a new one?
 
First rule of programming is you use what works, and my above quoted code does.
 
user5033850
let me give it a try
 
user5033850
5:17 PM
oh it works :DDDD
 
user5033850
50 ---> 05
 
I told you half an hour ago that it does.
I even showed you examples.
 
user5033850
you are very right.
 
user5033850
i will read more about StringBuilder
 
user5033850
i didnt knew this attribute
 
5:19 PM
/javadoc StringBuilder
 
user5033850
thank you both!
 
@Unihedron java.lang.StringBuilder: A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization. This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case). Where possible, it is recommended that ...
this class be used in preference to StringBuffer as it will be faster under most implementations. (1/7)
 
I'm faster.
 
user5033850
you make me very very happy!
 
5:19 PM
@Unihedron i had to open a tab
:3
 
user5033850
So, from what i read, the only difference between a new String object and a new StringBuilder object its that the last one doesnt make a new concatenated object every time, but its mutable?
 
It's a buffer for things. Unlike concatenating strings with "hi" + "there", the string object is only built when the builder builds the string. This means that using a StringBuilder is the correct way to go when you're, for example, creating a string from a loop.
String oneToNine = "";
for (int i = 1; i < 10; i++)
  oneToNine += i;
^ the above code is stupid.
 
@TheodoraBaxevani btw if you're multithreading use StringBuffer
 
user5033850
the above code is cute. the value of oneToNine finally is 123456789 right? but without creating 10 different objects
 
No, it does create 10 different String objects.
 
user5033850
5:27 PM
ah yeah sorry.
 
user5033850
with the other way its without it
 
On the first invocation of oneToNine += i, i is 1. The string object "1" is created in runtime.
StringBuilder oneToNineBuilder = new StringBuilder();
for (int i = 1; i < 10; i++)
  oneToNineBuilder.append(i);
oneToNineBuilder.toString(); // "123456789"
 
user5033850
this code its a multithreading example?
 
^ That's how you work with strings in loops.
 
user5033850
5:29 PM
it seems that this way we gain memory and time :D
 
@UnknownOctopus Sorry, I never heard of that class. :(
 
/javadoc Thread
 
@Mourdos java.lang.Thread: A thread is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently. (1/15)
 
user5033850
5:30 PM
I really understood the StringBuilder thank you a lot!!!
 
Multithreading is something you're dreaming about knowing, then once you actually do, realize how difficult it is.
It's often best to avoid it.
 
it's occasionally useful :3
 
Chances are lower than zero kelvin.
 
user5033850
But if chances are so little why does that exists?
 
user5033850
5:33 PM
i dont think that it will be ever usefull for me, for the present i write small programs
 
user5033850
maybe companies impement it :)
 
Im off guys, happy 4th
cya tonight
 
user5033850
thank you fiend :)
 
user5033850
it was great to talk with you guys :)
 
user5033850
you learned me things
 
6:01 PM
hi
first programmer girl i've seen
 
fge
@Mourdos most of the time you never want to extend Thread directly; the java.util.concurrent API which appeared in Java 5 is there for a reason
 
what do you do? implement Runnable?
 
use executors
 
ah. ok.
 
and then yes, use runnable
Executors handles threadpools and stuff for you so you don't screw up
as easily
 
I just found out where all of my Wildfly issues were coming from. nvidia has a service that runs on port 9090
 
6:42 PM
@HassanAlthaf What about Gemtastic?
 
wait is gemtastic a female?
 
@HassanAlthaf No, she is a girl :D
 
wtf didnt know that
 
Yes that's what she told
 
Me and my better half were listening to music earlier so we plugged my headphones into that computer. I forgot all about it and we went shopping. Suddenly I hear norwegians speaking and I tried to desperately find the tab playing the sound XD
took me forever to remember
 

« first day (1715 days earlier)      last day (3209 days later) »