« first day (1746 days earlier)      last day (3189 days later) » 

2:15 AM
posted on August 03, 2015 by Nick Griffith

Thou shalt use braces. Thou shalt use source control. Thou shalt not optimize prematurely. Thou shalt honor thy language’s conventions. Thou shalt use the right tool for the job. Thou shalt include necessary context when seeking assistance. Thou shalt write automated tests. Thou shalt not compare floating-point numbers using [crayon-55c0202ccc4c4595818531-i/] . Thou shalt write readable c

 
 
4 hours later…
6:16 AM
Hehe
IntelliJ's refactoring broke my code :')
 
6:59 AM
greetings
 
7:10 AM
Hello
 
8:00 AM
@JohnSnow That doesn't sound right (at least in Java)
 
It's JavaScript
It changed a URI part
That just happened to have the letters in it
 
hmm they could use a proper AST for JS then
 
probably a lot they could do
 
websockets aren't fun .-.
 
8:26 AM
> The Ten Commandments of Programming
> 1. Thou shalt use braces.
lol nope. python rules
pretty bad commandments if they disregard one of the most widely used languages out there :P
 
Do you mean that as "several rules of python" or "python is awesome"?
 
or as "Python really should have braces instead of indentation-based execution flow"
 
@JohnSnow As in "Python is awesome"
 
phyton is a script language like JS rigth ?
 
@Vogel612 from __future__ import braces -> SyntaxError: not a chance
 
8:33 AM
@Feeds In C inspired syntax languages
There, FTFY.
 
@MadaraUchiha thx :3
C inspired syntax languages, like PHP ^_^
 
> Thou shalt not be off-by-one.
 
@wonderb0lt where you actually should use the damn braces
 
Well played. Well played./
 
@All : Anyone worked Using Oracle SOA ?
 
8:35 AM
Such a wonderful thing to be part in here!
 
@Vogel612 what it has c inspired syntax and has no braces ??
 
@alovaros I'm fairly sure that by definition c inspired syntax languages have braces.
 
Can anyone in here could teach me more about JAVA :)
 
@MadaraUchiha oke I'm confused I don't wanna talk anymore
oke I need to talk lol
what does -> mean it's in my code (from a tutorial) and I'm confused
 
!!google java lambda syntax
 
8:41 AM
ahh
that things ty :D google won't give result for java -> xD
 
next time try java "->"
 
@Vogel
 
ohh had been a beetter idea xD
 
@Channox Don't randomly ping people!
 
morn
 
8:42 AM
@Channox It's incredibly annoying, and people will hate you for it
@Channox also here's a tip: "teach me more about JAVA" doesn't win you points because Java is a huge language
nobody knows what "more" is or what you actually know or whatever. get some context in here
damnit should've pinged that message too, for demonstrative purposes
 
HRJ
Anyone here could help me with some security issues in Java? The certificate chain is not validating while accessing a particular server.
 
I figure the line is actually ending with ();??
 
HRJ
oh yes.. I pasted Kotlin code.
 
> unable to find valid certification path to requested target
have you googled this stacktrace message?
gets me to this so post
18
Q: PKIX path building failed: unable to find valid certification path to requested target

Muhammad HewedyI am calling some HTTPS web service which the following Client: import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.net.HttpURLConnection; import java.ne...

 
HRJ
Yup, I understand that there is a certificate in the chain that is missing in the trust store. I was looking for someone who would know why it would be missing. Seems like the cert. has been issued by a pretty popular CA, and SSL Labs reports that it works fine with Java 8. I have also tested it to work fine in openjdk 7.
 
8:56 AM
beats me.
 
9:19 AM
hi
How can i get the size of a Java Object? somehing like we have sizeOf() in C ?
@Vogel612 ^
 
There's no such thing
 
More importantly, why do you think you need that?
 
meh..
yes. I am going to compare the size of the object and then only i decide whether to store in in my database or not
 
That sounds silly. :|
 
huh? why is that?
 
9:22 AM
Is the data in the object user-supplied?
 
yeap. it's an request to my app

based on the size of that object, i might store it in db or store only the extracted string in db
 
For storing you need to serialize it in a way or another. That serialized object has a size you can use (though I wonder the need for that)
 
@JudeNiroshan That sounds horribly inconsistent. How do you know what kind of value it is when you get it out again?
 
@wonderb0lt I'm doing a refactoring in a existing project. So, based on previous records i can extract only the most important attributes from that Obj. But i might need to store the whole object if that object is lightweight
 
need? You apparently don't need the whole object since it's not always stored anyway, so why not use the same protocol always
 
9:27 AM
does anyone have used this > sizeof.sourceforge.net
Actually i'm still in RnD

I want to see what is appropriate here. Whether to go for storing the whole object or just storing a string
 
Yes. Consistency is important and helps prevent bugs
not clicking on a sourceforge link
 
@JudeNiroshan just store the damn object.
that's what databases are there for
anything else is needless additional complexity
 
@Vogel612 you really get fast mad today
 
@Vogel612 but that damn object is sometimes too heavy !
@alovaros ^^^
 
@alovaros I'm not even close to mad
I'm slightly pissed, though...
 
9:31 AM
@Vogel612 oke you get slightly pissed fast today ...
 
if I'm mad, it's worse, people get insulted and I start using SHOUTCASE
 
@Vogel612 just because of that, we had slowed down our slony replication too. Cos we have queued many transactions in our master DB.
 
argghhh tomcat you prick
@JudeNiroshan you be using mysql?
 
Noooo! postgres
 
> PostgreSQL 9.0 includes streaming replication, which, for a number of use cases, is likely to be simpler and more convenient than Slony-I.
 
9:33 AM
@Vogel612 less idea on it. How ever my obstacle here is, how can i get to know a size of an object in java?
 
the answer is: you make a heapdump
oh wait no... you hack the JVM
oh wait no... you don't....
 
@Vogel612 some sysouts of Vogel612's mind
 
no it's called sarcasm
 
Just don't.
 
you seem to not understand it, so I'll spell it out:
 
9:35 AM
There's nothing ambiguous about "don't".
 
ohhh. Uni comes to play.. Hi
 
I'm not here to play.
 
either you make a heapdump (which is retarded), or you hack the JVM to give you the size (which is a heapdump at runtime) or you just stop, think, and understand you shouldn't ever do that
 
@Vogel612 is it a drawback is Java?....
 
it's unnecessary in java
because you don't have to manage memory yourself
so the size of objects is mindbogglingly irrelevant
 
9:38 AM
@Vogel612 cool
 
sure it gets funny when you create a new BigDecimal[Integer.MAX_VALUE] but usually the JVM will be friendly and give you an OutOfMemoryError
for everything else there's heapdumps...
 
Just go by something you can actually measure. String.length(), byte[].length etc and decide by that if the object's big or not
 
I just don't get the need for size dependent handling at all. If a few key attributes are enough to reconstruct the objects, then store those for every object. One code path, easier to understand code, fewer bugs
 
Hello guys anyone there?
 
nope
 
9:44 AM
ok
 
wat
 
@kiheru Correct, but I just wanted to give him a pointer since he seems very fixed on the idea of storing 2 formats
@Skizo Of course we're here. Ask if you've got something to ask :P
 
@wonderb0lt xyproblem.info
 
I've got a char and I want to check if it's equals to a number but it says no when I try to char == number, and I wanted to use .equals but it doesn't work... I've read to use Character but I don't know if it's the best way
 
> I've got a char and I want to check if it's equals to a number
 
9:47 AM
._.
 
this can mean about 3 different things....
 
@Skizo nameofnumberVariable.tostring() and then equals
 
Like i'm trying something like this if(ch[i]==(charreves[i])){
 
@alovaros that's the dumb but working approach
 
but when charreves[i] it's a number...
it doesn't work
 
9:48 AM
@Vogel612 so I'm a newbie :P dumb but working is fine for me
@Skizo just try .toString() I'm pretty sure it works
 
char[i].toString()?
 
@Skizo it's difficult to tell what exactly are trying to do. Like Vogel said there's more than one possibility.
 
@Skizo What?
 
I mean it's a String and I don't know if it's a letter or number..
 
Put a code snippet with a bit more context to pastebin, then we have a better chance at helping
 
9:50 AM
"It doesn't work" is the most useless sentence related to code ever.
 
@Unihedron sorry..
 
@Skizo let's say you jave int num = 1; and Char ch = "1"; (hope this is right syntax for char in java) equals(num.toString(),ch);
 
@Skizo A String is a string. Are you trying to parse it or match it?
 
@alovaros It isn't right syntax for java, and primitives don't have methods.
 
@wonderb0lt then use Int
 
9:51 AM
@alovaros There's three things wrong in this line.
 
@alovaros Integer
 
jeah I'm sorry Integer
 
I'm trying to check if are equals 2 letters of differents strings those strings are on a char array and when I type ch[i] I only can put "==" not equals.. and when the [i] it's a number doesn't do the if
 
@alovaros Plus it would be '1'not "1" :P
 
@Skizo Try to use English.
Anyway, so what do you have? A String or a char[]?
 
9:52 AM
@wonderb0lt sorry I came from C :P
 
@Skizo Some code would really help...
 
@Skizo pastebin.com . It's unlikely that the problem is difficult, but we have no idea what you're trying to do
 
Even if you can use .equals(), it will return false. There's nothing equal about strings and char.
 
Trying to check for palindromes? You're doing it a bit overcomplicated there
 
9:56 AM
I didn't get the for
yes
nono it works perfect when I put letters
 
WAIT
I GET WHAT YOU'RE DOING NOW
 
but when I put some numbers
it doesn't join on if
 
return new StringBuilder(s).reverse().toString().equals(s)?
 
palindrome check: new StringBuilder(s).reverse().toString().equals(s)
 
@kiheru high 5
 
9:57 AM
Use Arrays.equals(ch, charreves) to compare arrays instead of looping through.
You may need to import java.util.Arrays;
 
morning
 
but I want to check the [i]...
 
why?
 
== should work btw. Did you ever define i?
 
what even is [i] in this context? It's not defined in your code sample?
 
9:59 AM
This is totally an xy problem now.
 
Anyway, for palindrome check use the code snippets above
 
Good luck figuring it out, I gotta make food.
 
gonna test..
 
@Unihedron killing some pics in your garden ? :P
 
I don't get the joke, if that's one.
 
10:01 AM
cuz u are a minecraft face
 
your creativity and humor department must have really stretched itself there
 
my humor is cripped
 
my lover got humor -_-
do you know any library to make any object in java as Parametrized?
for example if I have an object Student have some coded attributes and I let the user add a dynamicaly attributes?
like we make a dictionary for that object
you define the parameter ==> parameter name, parameterType, Mandatory,etc.
these all properties are a ParameterDefinition
 
Write a decorator over Map that does the checking
 
I want something like this:
Class Student implements Parametrized{
 Collection<ParameterDefintion>getParameters{}
}
@kiheru you talk about design pattern decorator?
 
10:16 AM
ok, a Set then, instead
@fahdijbeli yes. depends on exactly what you want from your attribute set though
 
@kiheru to be franc I didn't understand you but I will check that design pattern and see what it can helps me thanks
 
Anyway, for arbitrary attributes like that Maps (and sometimes Sets) are usually the way to go. Then just adding an interface that does some sanity checking, and access the map through that
 
@kiheru ah okay thank you
 
10:56 AM
yes
 
11:51 AM
Hey Guys, ever got the problem with JPA (EclipseLink) that the mappedSuperclass fields aren't filled while the databaserecord does got a record
?
does got a value*
 
crl
12:04 PM
Is it possible to execute Java code dynamically (from a string that represents java code)? like an eval?
Since Java is compiled I guess it's hard
 
@crl What are you trying to achieve?
 
crl
I'd like to let the possilibility to define a sequence of instructions in a web page, and execute them after
like ideone.com could do, but I've no idea how they do
 
@crl They probably compile the text using a Java compiler into Bytecode and then execute it
 
crl
more precisely?
 
javac -> java + some kind of sandboxing
 
crl
12:08 PM
How would you compile somehing that contains "System.out.println(\"1\")"
 
output.write("class Main { public static void main(String[] args) { " + code + " } }");
just as a very crude example
Maybe there's some classloader magic with which you can load the bytecode dynamically into the running process, you could research into that direction
 
crl
A friend told me about beanshell, also
 
Yes but that'll only become part of vanilla Java in Java 9
oh, the REPL thing doesn't come from that. Huh.
 
crl
12:27 PM
ok thanks, your method with a compiled file will do the thing
 
1:13 PM
@crl I suggest to use any language script for example like Groovy
 
@fge ping
How did you do that thing where you only add the creation of a file, but not the contents?
Never mind, git add -N
 
Speaking of git, I hope everyone here knows this: git-man-page-generator.lokaltog.net
 
1:30 PM
@wonderb0lt yes and it's quite stupid
 
1:41 PM
hi
 
crl
2:27 PM
Guys, I'm using phantomjs, wanting to call it from Java, but I'd like to pass it the js code as a string like this:
Process p = Runtime.getRuntime().exec("/home/cyril/phantomjs_amd64");
PrintStream printStream = new PrintStream(p.getOutputStream());
printStream.print("console.log('Hello, world!');");
printStream.print("phantom.exit();");
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
StringBuffer output = new StringBuffer();
while ((line = reader.readLine())!= null) {
	output.append(line + "\n");
}
System.out.println(output);
Unfortunately this doesn't seem to work, even if it should... since when I run phantomjs I can type those commands
 
this looks completely nuts
 
and it is
 
crl
why?
I'd like to avoid to have to create a temporary file, and run phantomjs on it, but it seems like the only way
 
then don't use java for this to begin with
 
crl
all this is used in a java webapp
 
2:32 PM
to begin with
 
crl
so do you have any idea?
 
4 mins ago, by Vogel612
this looks completely nuts
there's nothing ambiguous about that
 
crl
it's not an idea that can help/orient to make it work
 
then define an idea
 
crl
"a plan of action"
 
2:37 PM
ok
switch to html-jquery stack
or php if you don't have much time for migrating
 
crl
hmm it works if I close the printStream (but it ouputs: phantomjs> Hello, world!) so will work with a file rather
 
@crl I don't see any newlines
 
crl
2:52 PM
@wonderb0lt I mean it works with printStream.close(); just after the .print
 
@crl You don't put out any newlines (I think that's what the tool is waiting for) and you also don't flush your stream (not sure if needed but can't hurt)
 
crl
@wonderb0lt doesn't close invoke flush?
 
@crl it usually does, but is not contractually required
 
@crl Yes Maybe but you want your input to go to the process before you close your writer.
 
crl
ok thanks
 
3:11 PM
baba booey baba booey
 
baba banana I guess
 
hahahah
Just got back from a 12 day vacation.. Work sucks
 
@DumbKnee You need vacation to recover from your long vacation
 
Exactly, time is just crawling by
I've never seen something so unnattractive on it's hands and knees
 
3:33 PM
<waits for a burn>
 
 
2 hours later…
5:45 PM
http://www.commitstrip.com/en/2015/08/04/the-blob-ject/
CommitStrip - Blog relating the daily life of web agencies developers
The Blob-ject
CommitStrip
1438710278
 
6:08 PM
Damn u one boxing
 
I like it!
 
@DumbKnee You can thank me later :P
 
Eh all
 
Eh to you too
 
6:20 PM
hi
anyone can help me and tell me how can i get imageView from one controller class and use it in another one?
i mean i got 3 controller classes and one main controller class
so i got 4 fxml files
each got own buttons etc and i need to get imageview from one of them and use it in another anyone know how to do it?
 
@thosenumbers You should not get the ImageView, rather get the Image
Create another ImageView, set the Image in it and show it
 
@ItachiUchiha Thanks! hahaha :D
@Kylar Ey man, haven't really seen you around here in a while
Also if you're wondering who the hell I am, I'm Dustiny but changed my name
 
@Ita
@ItachiUchiha thank you but i got and FXML annotation so i want to use it in my controller class so there is no way to get this imageview from class
and use it in another right?
 
ImageView is a node and should not be passed between controllers
On the other hand, data should be passed and populated on the specific node
 
6:36 PM
im making image gallery everything is working but i want to cut one maincontroller class to 4 controllers
so that for example in my MenuPaneController i need to use ImageView from ContentPaneController to display image which i will choose by DirectoryChooser
ok ill try to work this out somehow thank for ur help
 
you can write a method in your ContentPaneController which returns an Image
and then call it from MenuPaneController
set the Image in an ImageView and then show it
@thosenumbers Hope you get it!
 
 
2 hours later…
8:37 PM
Hello
Are you all collecting garbage ?
Hu hu
 
9:30 PM
what garbage?
 
I thought my joke would be pretty obvious
 
Room.out.println("Hello Room!");
 
hrh
 
9:54 PM
hey @Andrew , how's the weather around you ??
 
 
1 hour later…
11:03 PM
@ItachiUchiha @ItachiUchiha im not sure but i will try . thanks for ur help
 

« first day (1746 days earlier)      last day (3189 days later) »