« first day (1846 days earlier)      last day (3101 days later) » 
03:00 - 16:0016:00 - 00:00

 
4 hours later…
7:05 AM
\o
 
 
3 hours later…
9:41 AM
Hello all
 
Hi.
 
If I have a JToolBar like this one here imgur.com/dWDfSYe what could be an approach to figure out how to have the text on top and not on the left side?
 
10:09 AM
Hey Java
Folk
 
Hello
 
Ok thanks
 
Hi
i want to know use of openSL
regarding audio effects
can anyone help me in it ?.i asked a question about it on stackoverflow with +100 bounty
 
10:27 AM
That was all the help he needed :D
?
 
I wanted to write it on Line chat, accidentally typed here
So dumb
 
7 messages moved from Lounge<C++>
 
Try asking your question :)
 
I want help in this please
 
10:36 AM
my questioon is related to java also
so u guys can give a look i guess
 
@developer Stop spamming people
 
ok
 
@developer Write my website for me.
 
It's in Java, so do it.
 
10:42 AM
sorry i cannt .i dont know about web developing
 
11:00 AM
Hey guys. If I have this method here http://pastebin.com/vHRDEHAq how could I go around making a method that changes the following:

toolsPane.setLayout(new ToolBarLayout()); to toolsPane.setLayout(new ToolBarLayout(1));?

Because I am making a button which uses the new method however I am unable to make it properly. Any ideas?
Ups, that's my constructor not a method, sorry about that.
But yeah, basically how can I change something after it has been constructed.
 
11:50 AM
"change something" is rather vague. Changing a layout manager after the components have been added is tricky at least, and I don't know if it's officially safe at all (involves calling the layout manager's methods manually - that's usually done by the container). Anyway, ToolBarLayout is a non-standard one so I don't know how that behaves.
(ie. what does the parameter 1 do? If it's a property of the layout then the layout manager may, or may not have a method for setting that property)
 
here let me show you
This is when ToolBarLayout it default imgur.com/K5Je4GQ meaning no 1
 
sup
 
This is what I get when I change it to 1 imgur.com/t7s58n5 and add this.add(toolsPane, java.awt.BorderLayout.LINE_START);
so the one is simply the axis I guess?
1 being Y and 0 being X I assume
Hello Hans
However @kiheru I want to make a button that is able to change the toolbar from horizontal to Vertical.
 
Umm, that's a completely different change than the one mentioned before. That's about the constraints passed to BorderLayout, not about changing the layout manager
 
12:06 PM
When I use toolsPane.setLayout(new ToolBarLayout(1)); it changes the bottom toolbar to vertical and when I add this.add(toolsPane, java.awt.BorderLayout.LINE_START); it makes the components inside the toolbar also align veritcally
 
If you want to change the position in BorderLayout, you can do it by removing the component from it's container, and then adding it to the desired position (and then calling revalidate(); repaint() on the container). If you additionally need to modify the layout of the moved component, it's a different problem, and depends entirely on the layout in question (in this case, ToolBarLayout, which I already mentioned is not standard, therefore I don't know how to it behaves)
 
one moment I will show you the structure.
Ok, this here is the structure imgur.com/kiRnOPh
What I am going for is, by pressing a button to be able to change the orientation of the toolbar
I gotta go afk for an hour.
 
I just read the code snippet a bit more thoroughly; it actually does the kind of layout changing you're interested in. The method used is basically: get the contents and sort them. remove the contents. change the layout manager. add the sorted contents (not in that order, but that's the idea)
That may or may not be necessary for the layout manager in use, but should work with any layout manager. The only thing that may catch the unwary is that adding or removing components at run time requires revalidation and painting the container (the code snippet does not do that, and can get away with it because it's a construction time change, not a dynamic one, but for a button that changes the orientation you'll need revalidation)
I am, however, completely baffled why the code resorts to that trickery, instead of setting the correct layout manager in the first place. That looks suspiciously like someone who did not know what they were doing (like starting with a gui builder generated code, running in to wall what builders are capable of, and then trying to patch over the limitations instead of rewriting the code properly)
Anyway, a similar approach works for run time changes too. And the position change in border layout works the way I mentioned earlier.
 
12:51 PM
Hey I am back@kiheru yes sadly it is an open source code and I would really like to avoid too much refactoring. Are you able to give me a code example or a source I can check?
 
@Spiderix so basically, you stole some code from the internet and are confused about how it doesn't work as you expected
 
being open source is not an incentive to avoid refactoring, quite the contrary
 
oh no no, it was not stolen I was assigned to add a feature to it, which is being able to flip the toolbar to a vertical position
the code is part of my course but I am having issues making it work the usual ways so hence why I am here.
Problem with the refactoring is, this code is part of a project that consists of 60k lines of code and it is rather extensive if I start refactoring it.
 
I'm quite unsure what kind of example I could refer to, without writing the feature for you.
 
Yea, that would be no good :/
perhaps you could explain what you would do and then I can try implementing it?
 
12:55 PM
The part about dealing with filling the toolbar is likely not very long. I'd think the project maintainers would be happy if someone rewrote it properly for them (though I'd ask them, before doing that)
 
Also the reason for why I am avoiding refactoring is due to there being 30 other people working on the project
and out of the 30 not many have commited and the deadline is getting closer
so, I am trying to do this in a way without changing the code that is there already but simply add to it?
Also @Unihedron the project works I am just adding a feature to it and which I am having issues with.
 
anyway, if you want to move the toolbar position, it's a two part process: 1. change the position in the container. 2. change the orientation of the toolbar. These separate wery well, so start with one of them. Part 1 is really simple
Part 1 is: a) remove the toolbar from the container. b) add it to the new position c) revalidate and repaint the container
 
I will take a look at it.
One sec, I will actually show you the whole class, it might make more sense too
 
the other possibility is the brute force way the SVGDrawingPanel() currently uses (and I summed up in an earlier comment)
Part 2 depends on what the layout manager can do. If it's capable of changing orientation at run time, then great - simply use that feature. If it can't then you have two possibilities: my favourite approach would be modifying the layout manager to add that capability
 
Ok thanks, I will try that.
 
1:07 PM
(I think enhancing the layout manager is cleaner. (I just hope the source is readable enough that it's feasible to do it))
obviously, referring to the ToolBarLayout here
 
I am not so sure. Have been spending weeks on this and still haven't managed to find a proper way to deal with it. A lot of the function is scattered a lot
or that is the impression I get
 
It may be the correct impression, I don't know. However, getting familiar with any code base that is not trivially small takes its time
 
indeed, gotta say my course escalted quickly
Well friend I have done a few changes
 
If it's the correct impression, then refactorings are especially important to the project. New code almost necessarily starts a bit messy, when all issues are not yet well understood, but that just means the code must be cleaned continuously as it stabilizes
 
but what I basically did was add remove(toolsPane) toolsPane is the name and then just copied the content of the constructor
but not sure
a lot of codesmell
hmm yea ok
something is not right :D
I tried calling the method when I press the button
it just ended up giving me a blank pane
Ah wait, forgot to initiate the components
because when I use remove(toolsPane) it also removes the components inside it.
@kiheru can I maybe get you over to skype, then I could share my screen and maybe it will make more sense?
 
1:22 PM
So your approach is removing the toolbar, and then adding a new one, instead of adding the old to a new position? That's a workable approach, but only as long as the toolbar does not have state that should persist during the move
 
but how would I preserve the old one? I think I have been staring at this class that I am getting more confused the more I look at it
This is what happens when I press the button with the method I made: imgur.com/uhH1JJU
 
you already have the old instance: it referred by the toolsPane, after all
 
oh wow, I am missing a lot lol
 
Moving it should be basically (calling the parent container c for simplicity): c.remove(toolsPane); c.add(toolsPane, BorderLayout.WEST); c.revalidate(); c.repaint()
 
hmm I see. maybe I should try look into how to do all those things first
 
1:29 PM
(using WEST there, but use whatever is the standard in the project)
that does not change the orientation, but is the "Part 1" I called earlier
so the result will look bad until reorientation is implemented, but you should see the position change
 
hmm when I add this toolsPanel.remove(toolsPane);
toolsPanel.add(toolsPane, BorderLayout.LINE_START); to a method and just run it to see what exceptions I get, I get cannot add to layout: constraints must be a GridBagConstraint
and @kiheru is it possible to get you over to skype? Feel like this conversation has become just between the two of us, so to avoid further filling the chat with our convo?
 
are you sure you're using the correct parent container? The SVGDrawingPanel constructor you paster earlier adds it to a container using BorderLayout
 
1 message moved to Trash
 
@Spiderix you should be able to find my skype address using my real name (and that is shown in my SO profile)
 
Ok thanks, I have sent you an invite
 
user1648409
1:49 PM
Hi, im sending a request via HttpURLRequest() from my tomcat. The request gets blocked by the server's firewall because of the User Agent "Java" even though i manually set connection.setRequsetProperty() to User Agent "firefox". Anybody can give me a hint why the hell the user agent gets sent as Java from my Tomcat?
 
2:04 PM
Morning, Java!
 
yo jerry
 
Hey Mr @Uni
 
Mornin
 
activity: 1
 
2:12 PM
thanks, now I don't feel so bad
 
morn
 
mor
n
 
well more like afternoon over here
 
It's what, night time for you Uni?
 
then use some kind of time-agnostic greeting instead of morn >:(
@Ballbreaker almost midnight
 
2:16 PM
wowza, I figured you were 12 hours ahead (of me) not 14
 
Morning @Ballbreaker @Hans
 
Anyone here see the show Mr Robot?
 
I have
 
I'm diggin in it.. On the fourth episode now. I was getting really sketched out last night though
It's pretty twisted and dark lol
 
it sounded interesting
 
2:18 PM
Yeah, it was really good.
 
I may watch it
we ll see
i read about it
 
@Hans1984 You should
I'm really enjoying it so far
 
cool
 
I know enough about networks to understand a lot of what's going on too.. so that's cool
 
how long is each episode
 
2:20 PM
First was 60 minutes, the rest after are 45 minutes (as far as I can tell)
^ without commercials
 
ok
 
He hacks into peoples Facebook accounts all the time. I cant believe it's actually as easy as he makes it out to be
 
seems like I'm the only person that didn't watch breaking bad
everyone is so into it, i never watched it
 
Breaking Bad is also really good
 
It looks like he brute forces.the passwords. Which doesnt work unless you have the database of hashes
 
2:22 PM
@Michael Lol the password that was : 123456seven made me laugh
@Michael But yeah, also.. it's a show.. so.. you know..
 
did breaking bad get worse over the seasons?
or did it keep its high lvl
 
I thought it got better, personally
 
oh
ok
 
Where as game of thrones is getting way worse per season, in my opinion at least
 
thats rare
unless it started on a shitty lvl
xD
 
2:26 PM
@Hans1984 hehehe. No it was pretty good from the start, then got exceptional as it went on
 
look at the simpsons
the used to be GREAT
now they are total trash
 
^It got good again though in my opinion
 
but oc its alot longer timespan
 
The last say.... 3-ish years of the simpsons have been pretty good
 
ok
could be
i bought season 1-4 on dvd as CE
 
2:27 PM
I would say it had a good ... 5-7 years of crap though before that
 
planing on goign till maybe season 8-10
 
@Hans1984 Probably a good idea
Lol right now there's a sale at best buy, for a 50" 1080p HD LED Toshiba tv for $450
In the same ad, below it, is a pair of BEATS headphones for $400 ... lmao what the hell
The markup on those headphones is insanity
 
yes
its ridicolous
but its not just BEATS you know
 
What's the english for 2/3
 
hi hans
 
2:33 PM
dr dre beats I guess
@hansf. two thirds ?
 
Two per three?
Hi hans
Wo, we are hans
 
no i was refering to overpriced products in general
 
@hansf. It's either: "two thirds" or "two out of three"
 
just because of the name
;)
 
Are you sure?
 
2:34 PM
@hansf. Is there a particular context of it?
 
²/³
 
In math, it would be two thirds
 
like apple
gnihihih
 
In something like a game where someone won 2, and the other won 3
it would be two out of three
 
And the 's' after 'third' is correct?
 
2:36 PM
Yes
 
lol
your name appears twice
because you also used it as an avatar
 
Ok thank yo so much, guys, and hans
 
your welcome
 
lmao
"Apparently, this user is pretty hell sexy & every girls love him."
 
Btw it's kinda awkward mention your name as it's my name as well XD
 
2:40 PM
hehe
i feel the same
 
Oh, that about me is by default given by this site
 
although its not my real name
 
Yes, it's not my name also
 
Can anyone tell me how to properly convert a Date object to a String so I can later convert it back to a Date object again?
I've been playing with just date.getTime(), doesn't work
 
Just parse use SimpleDateFormat, then convert it back to Date class/object
 
2:45 PM
SimpleDateFormat in this format: "yyyy-MM-dd'T'HH:mm:ss.SZ", but that sometimes works, sometimes doesn't
I need the milliseconds as well
 
If I recall if you print the Date object it will give you milliseconds format
 
yea well, I'm playing with it for the past hour, but can't seem to find the correct sollution
 
And what you mean by 'sometimes doesn't work'?
 
fge
JooQ is really freakin awesome
Why on earth would you want any other ORM (well, save for MyBatis) is beyond me
 
maybe a little context.. I'm using it to pass data over REST and SOAP. I have an object that has a Date field in it. In SOAP, it's no problem, but once I use REST it fails parsing.
The REST needs to be printed in JSON, and I use Jackson as the JSON provider. To do so, I use a custom DateSerializer and DateDeserializer
so there I need to parse the Date object into a JSON field and vice versa
 
fge
2:52 PM
@Erates there should be no problem if you stick to ISO
(as a date format)
 
If I try to do so, it works with the SDF, but only if the date has milliseconds that are NOT dividable by 10
 
fge
Hmm
That's strange
 
so 325 ms works, 491 works, but 390 doesn't, because it cuts the last 0 of it and then the Deserializer fails parsing it
 
fge
But then why does it cut the last 0, eh?
It shouldn't
 
I know xD
 
fge
2:54 PM
That's a bug
 
@Erates You can use the SimpleDateFormat class to format Dates as Strings and parse Strings as Dates.
 
fge
@Michael not sure SimpleDateFormat knows how to handle variable length fields though
JSR 301 does, and so does Joda Time
 
@Michael Yea well, there's my problem :D
 
fge
And there's an idea: use Jackson's Joda Time support
 
SDF doesn't handle it perfectly
 
2:55 PM
I'm tempted to claim that your format string is wrong.
 
now I'm trying this format: "yyyy-MM-dd'T'HH:mm:ss.S"
with SDF
 
Try SSS
 
@Michael Have I bugged you with this yet? stackoverflow.com/questions/31524763/…
 
When I use SSS it cut's of the trailing 0
for some weird reason
 
fge
@Erates use Joda Time
 
2:59 PM
@fge I'll give it a shot, just a second
 
@Ballbreaker Umm, why are you assigning those variables to null in the finally block?
@Erates SSSS maybe?
 
@Michael Good point, they are artifacts
 
@Ballbreaker And I have no idea. xD
 
Heh alright
Apparently nobody does
 
howdy folks
 
3:01 PM
Morning @Ninja
 
more installing and more waiting for SVN access today
this client is a pain
 
\o/
 
I started here on Tuesday, still don't have SVN access
 
Tell your company to hire me as a systems admin lol
 
So its only your second day?
 
3:04 PM
Third
 
I'm now doing this with Joda Time:
Serialize:
DateTime dt = new DateTime(date);
jg.writeString(dt.toString());
DeSerialize:
String date = jsonparser.getText();
DateTime dt = new DateTime(date);
return dt.toDate();
 
That's office life for ya. xD
 
I started with the consulting company on Monday, they took me out to lunch and made me sign some stuff, and sent me the next day to the first client.
as of right now I'm waiting on JBoss Tools for Eclipse to install
 
@ShotgunNinja Was it something like this?
 
Nah, it was a standard I9, W4, etc.
 
3:07 PM
A foook yuuuuu
hahaha I figured
It looks like URLs don't like apostrophes
 
I estimate that you'll have SVN access in, oh, 2 weeks. xD
 
fge
SVN in 2015?
That's like using a cudgel when you have a machine gun at your disposal
 
I prefer a branch with a nail through it
 
The last new guy who started here a week ago said it took him just shy of a week for SVN access
but the client is an instantly recognizable brand, and they've had their fair share of thieves over the years, so it kinda makes sense
kinda
not really though
 
whoops, I read SVN as SVG
 
3:15 PM
lol
yeah no
 
I guess you'll have to wait a week before you sell the source code to another company then.
 
JODA FIXED IT!!!
thanks guys!!!
 
of course it did
Joda rocks
 
@Michael lmao.
 
This source code isn't worth selling, lol
EJB 3x, portlets, it's trash.
 
3:18 PM
@ShotgunNinja I'll give ya 5 bucks for it
 
I'm upset that if I google my problem I'm having
the only thing relvant that comes up is my SO question
 
"Automatic versioning is used to isolate concurrent modifications and the Session will not be allowed to be flushed automatically, but explicitly."
Except I have automatic versioning, and it still flushes automatically, stupid hibernate
 
fge
3:35 PM
Drop Hibernate :p
 
@fge you aren't helpful....
 
@Vogel612 rude
 
fge
Yeah, well, I also said to people 10 years ago to drop SVN, and look now :p
 
@Unihedron so?
@fge that was more helpful. Migrating Hibernate to JooQ is not as trivial as migrating SVN to Git, especially not with the whole bunch of validation annotations that people rely on...
 
@fge Yeah thanks for that. I'll get right on that. Just let me go ahead and change 500 methods to fix one bug.. rolls eyes
 
fge
3:42 PM
@Vogel612 ... most of which could be replaced with RDBMS constraints. AND JooQ can also make use of those if need be. Ahwell
 
Least common denominator, have everything use JDBC
"Never goes out of style!"
 
@fge which is still a lot of work, for no "business value" whatsoever
 
the last company I worked for took the approach of using stuff that was always "in"
 
fge
Sure, not in the short term
 
like Struts 1.x
and CVS
 
fge
3:44 PM
That's the bane of today's businesses: never see far away in the future
 
you can see why I no longer work there
 
fge
I may be old but I do look forward
 
You're so stubborn it's actually hilarious
 
@Ballbreaker meh. mostly unnerving
 
g2g
bb
 
3:48 PM
Sometimes, that's good. If you're stubborn about moving forward and using common sense, it can be a great thing.
If you're stubborn about sticking to your outdated crap and shooting yourself in the foot, then it's a bad thing.
 
ignorance is bliss
 
@Vogel612 Yeah, hilarious in the sense of, I'm laughing because any other reaction will end poorly
 
Wait, there's a new version of COBOL?
Nope, won't use, not tested well enough
 
@ShotgunNinja I agree with that. To a degree..
 
Well yeah, stability is definitely a consideration for any project
 
3:51 PM
If you have production code that is running an entire factory, then no I'm not going to ask them for thousands of dollars to overhaul their code
 
Cutting-edge won't do you any good when it comes to apps with those sorts of nonfunctional requirements
 
To do something that doesn't benefit them at all
Which will cost them more money on downtime and loss of revenue
 
fge
@Ballbreaker this is called "developer sclerosis"
See how @ShotgunNinja ended up in a company in the 2010s still using CVS, for Pete's sake
 
However, if it's a new project, then yeah I'll use the new technology
 
3:53 PM
even worse, I only managed to get them to replace the Win2k beige box that served as the master repo
they updated it to 7 Pro I think
when I heard that they were doing that instead of migrating the repo to Git or Hg, I decided to start looking for another job.
 
fge
@Ballbreaker until it becomes outdated again?
Bah
 
@fge Lol what's the alternative
 
fge
@Ballbreaker update regularly!
 
Code churn = good thing
the challenge is finding the right amount of churn
 
fge
Exactly
 
3:56 PM
Hahahah. Alright buddy.
 
fge
Look at the Linux kernel
 
To set things straight, we churn code. Churning hibernate didn't make sense
 
fge
It's permanent code churning
 
true
how does one churn Hibernate?
 
fge
@Ballbreaker but churning to replace it does make sense
 
3:57 PM
I still think Hibernate is in the mid-afternoon of its life
 
fge
Anyway -- I won't discuss it any further and good luck
 
Hmm let's see here. I was given around a week to update from Java 5 -> 7, to Jboss
 
fge
@ShotgunNinja Hibernate has a fundamental flaw from the start; it's an ORM which focuses more on the O than the R, and that should be exactly the reverse
 
I'm not about to spend another week (aka go over budget)
to replace hibernate
 
fge
From that point on, to my eyes, Hibernate is already dead
 
3:58 PM
Especially when it was my first week on the job
 
fge
Ah, first week?
Then study the code first, of course
 
That's the thing, I had no idea
 
03:00 - 16:0016:00 - 00:00

« first day (1846 days earlier)      last day (3101 days later) »