« first day (1488 days earlier)      last day (3439 days later) » 

3:19 AM
@taco :D
 
fge
fart
 
 
2 hours later…
fge
5:08 AM
0
A: Rounding int to 1 decimal place?

fgeThe problem is here: print.printf(x + " F = " + "%.1f", y + " C"); There are two arguments to this method: x + " F = " + "%.1f", y + "C" Condensing the first argument, the statement becomes: print.printf(x + "F = %.1f", y + "C"); The problem: y + "C". Why? Well, one argument of the + op...

Heh
 
 
1 hour later…
6:28 AM
Greetings all!
 
6:50 AM
Hello guys, i'm in trouble with JAVAFX ListView. How can i change the width of columns in ListView
There seems to be no method for it..
 
@charen there are setPrefWidth and setPrefHeight functions to use to achieve the goal.
 
umm
i think i tried both, setpref and setmax
second, trying again
Nope, not working
setMax.. will just change the size of the whole Node - ListView but not the columns
i guess the setPref tries to do the same..
Although setPref actually shows no results
 
setPrefWidth() Property for overriding the control's computed preferred width. This should only be set if the control's internally computed preferred width doesn't meet the application's layout needs.
 
Hmm..
 
setMaxWidth Property for overriding the control's computed maximum width. This should only be set if the control's internally computed maximum width doesn't meet the application's layout needs.

Defaults to the USE_COMPUTED_SIZE flag, which means that getMaxWidth(forHeight) will return the control's internally computed maximum width.

Setting this value to the USE_PREF_SIZE flag will cause getMaxWidth(forHeight) to return the control's preferred width, enabling applications to easily restrict the resizability of the control.
 
6:57 AM
So you're saying this should work?
as you can see from the picture, the column size is bigger than one
 
No, I am saying, it should work if you set the property USE_PREF_SIZE because by default is uses USE_COMPUTED_SIZE
 
ummmmmm, how to change that flag :D?
 
It's bigger than 1 because of your layout settings.
If you read the docs, you will find out that setPrefWidth and setMaxWidth works when the internally computed width is less and not large
 
oh, okey, thank you
i'll try to figure out something
some ideas already came
:D
 
listView.setPrefWidth(Region.USE_PREF_SIZE);
 
7:17 AM
So i've added enough elements to cover the layout but now the scrollbar appeared..
the command USEPREFSIZE doesen't really work i guess
 
7:28 AM
Okay, i've fixed it with CSS
 
Good for you
 
   .list-cell{
   			-fx-cell-size: 5px;
   }
that was all what was needed
 
8:17 AM
okay
 
hello
 
Can somebody help me understand the relation between two Container classes here in this UML?
diamond is for composition and arrow that is seen is inheritance
 
Where did you get this from?
 
this is swing class hierarchy
 
8:22 AM
I know but this will have explanation as well from where you are reading this.
 
no there is no explanation given, but used in the code directly
 
Yo guys
Is there any way in a interface to define that the method can take parameters, but it's not a requirement ?
 
What do you mean?
@miniHessel
 
I have an interface class
like this
public interface WizardPage {
public String getHeader();
public GridPane getPane();
public void addElements();
public void onEnter();
public boolean valider();
}
 
Okay, so?
 
8:24 AM
but when I use the onEnter in one of the classes, I want it to take parameters
for example onEnter(String test)
 
@overexchange i am looking into your question, give me few minutes
 
sure
hope you got my question
 
Then, you have to define the abstract method in interface that takes params
 
but then all the classes has to have a onEnter with those parameters
 
Yes, that's what the rule is, what is your scenario
?
 
8:26 AM
Okay, I understand, thanks
 
@overexchange Where did you take this UML diagram from?
 
@Mr.777 you have everything here starting from awt, i need to learn awt & swings but need to understand these UML diagrams before coding.
first link is part 1 and second is part 2
 
Well, what I think is the UML diagram is wrong
It can be like Component is composed into Container
Not the container in itself
If you take the composition label from Component to Container and remove the Container that is inherited by the Container (in your UML diagram), that will make sense
 
isee the similar kind of diagram here..
where container and component has is-a relation and 1 container composes many components
 
Hey look, a party
 
8:36 AM
so am am unable to visualise this relation between Container & Component classes
@Unihedron hai
 
hi
Oh god, 7 new emails
 
Yes, one container has many components:

private java.util.List<Component> component = new java.util.ArrayList<Component>();
 
@miniHessel Maybe you can use Optional. Or just document it in its contract that if the value is null, it's not used.
Or specify both methods with a default implementation with a note that they're circular and the programmer must implement either. Or both.
 
@Unihedron can varargs be the option in miniHessel's case?
 
@Mr.777 Varargs is still an argument by itself.
You can't call eatAll(); when the method exists eatAll(Object..).
 
8:41 AM
Yes, you are right, that's what I told him :D
@Unihedron Let's read about @overexchange questoin
 
I'm not sure if it's an actual question, sounds like they just need to download the JDK source code and read through the relevant classes.
 
lol
 
I would do no better at mentoring than "here have code".
 
My question is, when class Container has composition relation with abstract class Component, why does class Container extends abstract class Component
member of class Container which is private List component is already pointing to array list of components
 
Why does a class extends an abstract class?
 
8:51 AM
because Container is component
 
Correct...
 
but i need to understand what is container and what is component?
let me check
 
Component is the abstract class that defines a component. Being a component, Container extends it.
 
Hi guys, anyone done stuff with Line Charts :D?
 
What's "Line Charts: D"? Sounds like an amazing library.
 
8:57 AM
JAVAFX Line Chart
:D
I'd like to manipulate with it but i have no idea even how to google this thing so i'd have to explain as the way i understand it :D
for example, this page @Unihedron
 
You're in luck! I don't do JavaFX.
 
Oh, that's sad..
 
The tutorial makes it seem really simple though.
 
Yeah, it is, but..
For example i have points to put on x-axis, for example 1,3,5. I'd like for chart to go from one to five and then to number three
but the chart creates line from 1-3-5
I DO NOT KNOW WHAT I DID BUT MY CHART JUST STARTED WORKING
#programmerlife
 
... What's your question? Can't tell if you're excited or enraging. :P
 
9:03 AM
@Unihedron it is understood that conatiner has multiple components so composition looks fine, but container itself is a component, looks unclear to me.
 
@overexchange ??
 
i mean, why container is a component?
 
Would you like it to be a Vehicle instead?
 
i'm excited :D
 
9:07 AM
exactly
:D
 
in javax,swing package, jcomponent is container.
 
Guys, I have a question, Is javascript faster than java?
 
@Mr.777 Is coffee more brown than a video of red fox from discovery channel?
 
@Unihedron
 
@overexchange Correct.
Also, I'm always watching (unless I'm at school or sleeping), so don't ping me unless I'm away.
 
9:14 AM
Component is not containers but JComponent is Container? How do i understand this?
 
Components are objects. Containers implements components as Component is abstract. JComponents are containers. Most swing objects are JComponents.
 
Container implements Component because Container is Component. JPanel is Container. Label Button are also Components
but in swing package..
 
JLabel is component because JLabel extends JComponent which extends Container which extends Component.
 
Container is Component in first diag, but JComponent is Container in second diag. how can a component be container, say for example JLabel is not a container
JPanel sitting there looks fine because it is container and container is component
 
9:32 AM
@overexchange It's not. JComponent is a container. Component is not a container.
 
oh ok
so JLabel is also a container?
 
@overexchange Containers and components describe containers and components of objects, not that they are containers and components of graphical elements. JComponent is.
@overexchange It is a container. Why wouldn't it be a container? It contains stuff.
 
if JLabel is a container, why can't Label be called a container?
 
I guess, what he means is, JComponent contains the real graphical elements while the top hierarchy only has the objects
 
@Mr.777 ... if you write crap code it isn't..
but javascript only knows float types, so they have more boxing and conversions for simple integer arithmetics..
 
Please... Don't use a blog post from two years ago as any evidence of programming language comparisons.
 
hi to all
 
> The Chrome V8 guys really did an amazing job improving the speed of their Javascript VM
 
ar thrt
 
Hello user
 
9:38 AM
hi
 
all depends on the VM implementation...
and Java was faster after performance tweaking..
 
2012... That's Java 5 right?
 
now i want to user scroll bar
 
And Java 5 runs as slow as a snail.
While Java 8 is pretty quick, even a mediocre coder like (oops, no names sorry) could write a program as good as an experienced C# coder.
 
and if list more than vertical scroll
 
9:40 AM
That is, assuming you do it right. I'm not responsible for ridiculous constructs like reversible loops.
 
it move when mose drag and drop
 
@Unihedron you can write my name there :P
 
@Unihedron
do u have time
 
Depends. One never knows if they have more time, but they can hope.
I'm looking for a data structure like a table in database where a field is guaranteed to be unique and to override previous revisions when used, is here such? Or should I build a HashMap with the value as a compound object wrapping what I need?
 
10:00 AM
hi @Rovak
ihiw ffffiiiiiiiii?
 
hello
 
Oh hello! @Rov
I do see you afk here quite frequently :P
 
yea, i'm more of a scala guy, but i figured if i have any questions about java/scala specific stuff that this room would be helpfull
 
How's scala development?
 
10:05 AM
i really like working with Scala and intellij, mostly the functional programming tricks make writing algorithms a lot faster then in C# or Java. I mostly work with Play Framework and Akka, which make writing solutions a lot easier then they would have in C# with TPL
 
Hmm, I heard it's hard to learn scala from scratch though.
 
yea it is, Scala can be really simple if you write Scala like you would in Java
but then there is no point in going for Scala, because you can write a lot less code with all the functional programming tools that Scala offers
i found a nice overview of the different stages of a Scala programmer scala-lang.org/old/node/8610
 
It's said that array's minimum size can be 0, not less than 0 (otherwise negativearraysizeexception) so, why would we need a 0 sized array for?
 
right now i am on level A3/L2
 
@Mr.777 Because empty arrays.
@Rovak Thanks for sharing, good read :)
 
10:12 AM
@Unihedron Didn't get. I mean, why we will ever need that?
 
@Mr.777 ... Design purposes? For example, most sets passes an empty array instead of null when its .toArray() method is invoked and there's nothing in the set.
It's also more feasible to pass an empty array instead of null most of the time, so you don't blow up stuff of which the library specifies not to pass null. For example:
/* (Object..re) */
// Validate.notNull(re);

method((Object[]) new Object[0]);
 
Okay thanks.
 
Today I Learned: BitSet > boolean[]
(But I'm still using bytes and bithacks.)
 
yesterday I learnt that you can use ascii characters like:

ch\u00061r ch = '';
and one more thing that is:
System.out.println(2+'A'+"test"+'C');

will print 67testC
 
Yay unicode literals that ruins code readability!
 
10:21 AM
yeah i agree, but still that's something i learnt.
 
@Mr.777 Yep - 2 + 'A' translates 'A' to an int, and 2 + (value of A) evaluates to an int. int + String starts a string concatenation sequence, so you get (2 + value of A), test, C.
 
Yes, you are right, that's what I knew before but never tested and yesterday, I just learnt it perfectly
+ a lot about enums :D
 
2
A: The operator + is undefined for the arguement type(s) ChatColor, int

UnihedronYour + operator gets two operands, a ChatColor object (Object) and ok (int). According to The Java Language Specification §15.18 If the type of either operand of a + operator is String, then the operation is string concatenation. Otherwise, the type of each of the operands of the + opera...

 
Any JAVAFX peeps here today?
 
@miniHessel You're in luck! I don't do JavaFX.
 
10:24 AM
@miniHessel What's the question?
 
You dont, or you do?
 
First.
Naming help please: Similar to "UnsupportedOperationException", but this exception will be thrown when the method is invoked when its Factory was configured not to allow this method to be used.
 
@Mr.777 You do JAvaFX?
 
@miniHessel Just ask already?
 
:*
I need a custom tooltip, a kind of popup to show when I hoover a TreeItem, so I guess you need some experience in JavaFX to answer that.
 
10:37 AM
walks back to coding; ignores for lack of paitence
 
11:11 AM
I don't do FX but I once worked on JavaFX project
That was something like stock charting etc
And I remember, I have shown the custom popup
@Unihedron You mean factory has been configured but method is not allowed to be used, right?
 
"for" relationship instead of "but", but yes.
 
UnsupportedMethodInvocation
or UnAllowedMethodInvocation
 
Hmm... Maybe "Unauthorized" instead?
 
Unauthorized is more likely if you are dealing with role specific app?
This is the function for creating popup
public static Popup createPopup(Pane p, Line l) {
final Popup popup = new Popup();
popup.setAutoFix(true);
popup.setAutoHide(true);
popup.setHideOnEscape(true);
Button delete = new Button("Delete");
delete.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
p.getChildren().remove(l);
popup.hide();
}
});
delete.setPrefSize(80, 40);
popup.getContent().addAll(delete);
return popup;
}
popup.setOnShown(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent e) {
/*popup.setX(stage.getX() + stage.getWidth() / 2 - popup.getWidth() / 2);
popup.setY((stage.getY() + stage.getHeight() / 2 - popup.getHeight() / 2) - 100);*/
popup.setX(x);
popup.setY(y);
}
});
popup.show(stage);
 
11:36 AM
@Unihedron, yesterday I forked the JChat, I am importing it now but it has compile time errors
 
@Mr.777 Eh, we're using maven, you might have to set up that.
 
I know you are using maven and I am using that too :D
 
I also am working on it atm and have some work to commit in the next hour or two.
 
It's compile time error like obj is accessed from inner class, declare it as final
I guess the artifact you are importing
<groupId>com.github.fge</groupId>
<artifactId>msg-simple</artifactId>

has been changed by fge ;)
 
@Mr.777 but how can you activate a hoover event from a treeItem?
 
11:39 AM
Because, IDE is asking me to remove override annotations from few methods @Unihedron
 
@Mr.777 Name this IDE so I know what not to recommend when people ask which IDEs to use for java development?
 
Luna
 
Eclipse?
 
@miniHessel Hoover event, I am seriously not sure, will have to google with you :D
Yes Eclipse Luna
 
@Mr.777 I believe you can use a cellfactory
 
11:41 AM
Weird, I'm using Eclipse Luna too.
 
@miniHessel May be, not sure
 
I'm fixing it ;)
 
@Unihedron Can't this be the possibility that fge has changed the implementation?
 
Eh, the version of fge's package we're using haven't changed.
 
11:52 AM
 
Weird
 
ikr
What error is that? Maybe it's an optional thing you can turn off.
 
@Unihedron Cannot refer to non-final local variable obj defined in an enclosing scope.
 
Window > Preferences, Java > Compiler > Errors/Warnings
 
I already have almost everything ignored or warning ;)
 
12:02 PM
Huh, that's weird.
 
Adz
hey guys, does anyone know how to run a java console application from the web?
 
... Just do that?
 
Adz
I don't know how to go about it. I have no idea how to do a Java Web Based application. All I need is what the program returns
 
You need an online ide?
Well, I don't know how simpler it can get. Find a hosting service and get a plan from them. Put up the application, with a website which starts the application. Done.
 
Adz
no, I need to pass an argument to a program, and get the return of that program
 
12:15 PM
That's not what you're looking for. If it was, you would had just done that. This is clearly an XY Problem. What's the issue?
 
Adz
I don't know how to go about passing the argument to the program from a web page :(
 
@Adz Do you know jsp/servlets?
 
Adz
no
apache tomcat?
 
So... You have zero experience with how web dev works?
 
well, tomcat is jsp/servlet container
@Adz Do you have experience with Ajax?
 
Adz
12:18 PM
No sorry
 
:O
Run!!!
 
Well, then, i will recommend you to try one of the two or both:

1. Learn Ajax, write a service (that will use your so called console application code), hit the URL and get the response.

2. Learn jsp/servlets
 
Adz
ok, thanks!
 
Wait, you still haven't answered my question. You're attempting to start a web service that runs a java build?
 
Adz
yeah
 
12:22 PM
@Adz What about applets? Any experience with applets?
 
@Unihedron This smells of a job for CI
 
Adz
I've read up on them but never really done one. I've got the program working correctly. Do they differ from a normal java program? i.e. is it easy to conver tthe program to java applet
 
@Adz You might want to look into a Continuous Integration server then, the biggest ones out there are Jenkins and Travis
 
Then @Adz it sounds like you need a CI service instead. Consider installing one on your server.
Whoops, beat me to it.
 
Adz
oooo
 
12:24 PM
@Adz Yes, it's really easy to convert a java program to an applet
 
Adz
ok. Thanks guys. I'll look into everything you've said <3
 
12:41 PM
Hey guys, could you take a look at this?

http://stackoverflow.com/questions/27017031/javafx-2-window-icon-not-working
 
@Erates done
 
@Un
@Unihedron Why? I've followed all other questions like this but none of them seem to work.
 
In case you're not aware, "The icon is 32x32 in size" isn't a problem statement. "doesn't work" is unclear, and the way you open the stream is incorrect altogether. It should be:
URL url = getClass().getResource("/dirs/file...");
InputStream strm = url.openStream();
And "I hope this can be fixed." makes it even more confusing, because I can't spot anywhere in your question that states what is wrong.
 
1:05 PM
@Unihedron Hahah that's funny, your statement ""The icon is 32x32 in size" isn't a problem statement." Made me think. The icon I download is 44x80. So I tried downloading that and try to use it the way I was doing it.

Guess what, it worked!

Remade the icon in different sizes and added them all. --> Solved
 
So... I can ask for your question to be closed now?
or... is there still a problem you have yet to clarify?
 
I'm writing the answer
"You can accept your own answer in 2 days" --> ready to be closed
 
I don't mind the last of those 6 ways much. Sure it would be nice if people used the bug tracker, but contacting me and giving me the steps to reproduce a bug is almost as good
 
@kiheru Then you haven't seen how people show bugs irl. I almost can't see anything under the screens they try to point at.
 
Could be, I haven't experience with that. Only with people explaining it to me on irc, or otherwise online. The effort I make to write a report about that is neglible compared to needing to find a way to reproduce a bug that does not come with those instructions.
 
1:17 PM
I definitely wouldn't mind if someone reports a bug through IM, you're correct!
 
2:00 PM
Steps to reproduce is the best possible way, I can think of to report bugs understandably.
 
I need to override equals() for WeakReferences?! really?!
 
2:26 PM
@Unihedron I don't see if it's necessary to override equals() for WeakReferences
 
2:38 PM
hi
any good book on designing exception handling strategy?
 
2:56 PM
That's kind of a narrow subject for a book.
Generally, I classify all my code as user code and API code. API throws the exceptions, user code catches them.
 
3:30 PM
GREETINGS MOFOS! :D
 
Java changes the ID of a variable as soon as it is added..Fuck that.
 
Anyone knows what does Java specifically trigger when closing JInternalFrame's x button on the top right corner?
 
@LeeJeong izzat swing?
 
@Vogel612 SWING yas man!
 
should be a WindowEvent.WindowClosing then
 
3:40 PM
Can i call that closing event explicitly? frame.dispose() method doesnt seem to trigger WindoClosing event
where's @Unihedron ??
 
Why does Java change ID of elements, thats just STUPID :@
 
@LeeJeong sure.. you just need to enqueue it to the AWTEventQueue
 
can you give me an example?? Not familiar with AWTEventQueue..
 
5
A: How to programmatically close a JFrame

stjepanoBest way to close a Swing frame programmatically is to make it behave like it would when the "X" button is pressed. To do that you will need to implement WindowAdapter that suits your needs and set frame's default close operation to do nothing (DO_NOTHING_ON_CLOSE). Initialize your frame like th...

I stumbled upon that myself and edited a few answers there..
 frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
 
nice!
thanks for this one! :D
 
3:58 PM
Hi
 
@Vogel612 i was able to use it, but i think its not closing the internalframe anyway..
used it like this:* if(e.getSource() == pv.getBtnCancel()){
System.out.println("Closable");
// pv.dispatchEvent(new WindowEvent(pv, WindowEvent.WINDOW_CLOSING));
pv.dispatchEvent(new InternalFrameEvent(pv, InternalFrameEvent.INTERNAL_FRAME_CLOSING));
// pv.setClosable(true);

}*
 
kya
Java is killing me!
 
 
2 hours later…
5:50 PM
How you simplify your web app when you have filter for URL mappings to JSP/Servlets, GZip filters, filters that enables global properties from file system to be accessed via ${expressionLanguage}, filters that rewrites virtual directories access for long expires header caching, filters that adjust encoding for UTF-8, filters that handles authentication, etc. and still keep your web.xml maintainable??
 
6:43 PM
@LeeJeong what is the frame's actionOnClose?
 
7:30 PM
@FagnerBrack ???
So I actually tried to sleep earlier than usual (10 pm, in fact), and I woke up at 3 AM... WTF?
 
8:06 PM
Hi @Unihedron. I seems I wasnt clear enough. Take a look here: https://github.com/FagnerMartinsBrack/WebStories/blob/%2313-optimize_resources/src/main/webapp/WEB-INF/web.xml

See how big that is? It may not be a huge problem right now, but what happens when We add a lot of filters which handles specific pieces of functionality and have to account for FORWARD, REQUEST, INCLUDE dispatchers?
Example: Multiple URL rewrite filters.

Is there a good pattern to solve this? Any recipe?
Every time I have to handle with web.xml I get pissed. There has to be a better way to handle it without developing on top of n frameworks. I seriously hate the learning curve of frameworks built on top of other technologies, too many abstraction leaks...
 
 
1 hour later…
9:34 PM
Mod up because this answer actually has a solution. — Christopher Schultz 1 hour ago
▲ What is Mod up?
 
@PaulVargas Wondering the same.
 
10:01 PM
@Unihedron I got my motherboard back!
 
@Joe'sMorgue yay!
 
It's WORSE!
 
sucks to hear
 
Asus...NEVER buy!
 
10:43 PM
I think it should be noted that this solution incurs the cost of validating the Connection on every query. There is (sadly) no magic bullet. — Elliott Frisch 22 mins ago
With this solution, the statement is executed only to get a connection from the pool. e.g. Connection conn = datasource.getConnection();. Maybe you want to see the options on the link provided in my answer. — Paul Vargas 2 mins ago
 
@PaulVargas ... and?
 
@Unihedron hai
 
hello user
 
As per our yesterday's discussion JLabel is a container because JLabel can have another JLabel within unlike Label
 
... No, that was not what's discussed.
 
10:57 PM
ok
@Unihedron i would like to understand the meaning of data encapsulation with this example project how do i understand what data encapsulation is here?
 
Eh... read them all?
The file names are pretty undescriptive, so there's no fastpath for understanding this project. :P
 
hmm
Critter is an abstract class inherited by Shark/Fish
i think this 3 classes would be fine to consider as of now
 
Yeah, do that.
 
i did not get u
 
News for JCE (probably wrong place to announce): finally decided how I want my stuff laid out. Estimated Time of Arrival (alpha build): future
 
11:07 PM
what is data encapsulation in this program?
class SuperType {
    private int item;
    public void setItem(int item){
        this.item = item;
    }
    public int getItem(){
        return item;
    }
}

public class SubType extends SuperType{
    public static void main(String[] args){
        SubType s = new SubType();
        s.setItem(2);
        System.out.println(s.getItem());

    }
}
 
hey does anyone know how to find all indexes of an element in an array?
i have an array of strings and need to find for instance all the indexes of "you"
is this possible?
 
@ROODAY is it sorted?
@overexchange Not sure what you're looking for...
 
no
 
linear search
 
its from a large text
 
11:14 PM
@Unihedron i would like to understand what is data encapsulation in the above program
 
Is it possible to draw a circle on top of a button in JFX?
 
JavaFX!
I don't know JavaFX.
 
@Unihedron did u get my question?
 
@overexchange no, not really.
 
11:24 PM
an OOP concept called data encapsulation, Do you see this in my above program? with some example i would like to understand the meaning of data encapsulation
 
Eh... I'm not sure exactly what you mean by data encapsulation. Do you know what capsules are? The object includes the information, but provides setters and getters instead of having the field public. That's a design thing, it isn't really present.
 

« first day (1488 days earlier)      last day (3439 days later) »