« first day (1487 days earlier)      last day (3454 days later) » 
03:00 - 12:0012:00 - 00:00

12:00 PM
@ITACHIUCHIHA!!!
 
:)
ssup @uni
 
Nimbus scrollbar looks ugly... agree?
 
nimbus?
 
Nimbus L&F @Unihedron
 
fge
OK, question... Do you know of any simple to use caching library which can provide something like Guava's LoadingCache except that cache entries may define their own expiry?
 
12:14 PM
@fge codecraftsmanship
 
fge
@Unihedron eh?
 
nothing made me more happy today than being able to use mac osx look of scrollbars on a nimbus L&F! :D *cries of happiness
 
@fge Build it yourself :D
 
*pestered all day with these design decisions. fvck
 
@LeeJeong Mac......... .. .. . . .. .... .
 
12:17 PM
you hate mac too?
i know you love unix.. but im not yet on that stage of hating all those low-lives users because i think im 3/4 user == doesnt know how to use a computer. wahaha
 
fge
Hey, Mac OS X is basically Unix
 
No, I thought Mac was easy to use, until you said that.
 
fge
A Unix on a tight leash, but a Unix
 
@fge Yes, OS X is a *nix.
 
12:31 PM
@Unihedron I managed to break main down to 10 LoC now..
 
hi
 
hallo
 
Hi @XZen
 
I read first "10 kLoC" but, phew, that was missread. Looked too much at bad code lately. Reading questions tends to make one expect terrible code
 
@kiheru ... do you want to insult me? I am a high-rep user on CR ;)
The day where there's any single unit of code under my surveillance with 10kLoC shall never come!
 
12:42 PM
@Vogel612 CHALLENGE ACCEPTED
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
if (null == null)
 
Familiar with SQLite?
 
fge
@LeeJeong SQLite in Java is not a very smart choice tbh
Why not go with h2?
 
@LeeJeong Android? Why SQLite?
 
But why? @fge
 
Nah. I did not look at the writer at first (and by then I had already read the line again). I would not expect you to create 10kLoC files, let alone methods. (Unfortunately I have seen 10kLoC methods. Makes one want to got to bed and cry oneself to sleep)
 
12:44 PM
what's H2?
 
Hibernate
 
SQLite is ok for android, isn't it?
 
@XZen That's the only reason I can think of, so I asked.
 
fge
@LeeJeong an SQL-compatible, light RDBMS which has the advantage that it has no native parts
 
some blogpost told that it was promising...
 
12:44 PM
the reference implementation for JSR-205 or sth.
 
fge
@Vogel612 we are talking RDBMSes and JDBC here, not upper layers
 
wow.. never heard of that h2.. do you use it?
 
fge
Yes I do
(for a pet project of mine)
 
@LeeJeong it's shipped with jboss..
so I am using it at work
 
might as well try that on a new project..
 
fge
12:45 PM
But my favorite "SQL query" library is definitely jooq
 
jboss is what? *OMG nooob
 
@fge right.. the distinction is hard to make when the terms are used interchangeably for communication in the project..
 
fge
@LeeJeong an app server which also implements EJB
 
well nowadays it's called wildfly IIRC
 
@LeeJeong a java server, like tomcat
 
12:46 PM
okei.. ill definitely arrive there in the future..
just working with swing right now. T.T so ugh
 
fge
@LeeJeong there is the basics (servlet container) which implements the servlet API and JSP API; and then there's EJB and J2EE
Over the basics you also have JAX-RS
Which, to be honest, rocks
 
we are talking about webdev right?
 
fge
Yep
 
and what im doing right now is call Client Rich apps? swing?
 
fge
Not that I am very knowledgeable about it either (I have only ever programmed one webapp)
Those are called this, yes
Although with all the JavaScript in browsers, a web-based app hardly deserves to be called "light"
 
12:48 PM
*when would be that day i would setup my own app online too?
 
@LeeJeong simple, either future or never
 
how do you start it? I so far have knowledge of HTML/CSS/Javascript... uhm, Java, basic Servlets, JSP
 
fge
It is light in the sense that you use an application already present on the target client (the web browser)
@LeeJeong there are plenty of services available which allow you to publish an application online
Heroku is one (I use it)
 
Elevate! Gather knowledge! Be the programmer of all programmers! Rise to the top!
// totally being helpful
 
^ dafuq @Unihedron. really man where do i start with that?
Uhm, ok, i should think about it after i finish this project i have first..
You still think Client Rich apps still have future? this swing, javaFx stuff? or do i specialize now on mobile technologies Android, Obj-C++?
 
12:51 PM
why JAX-RS rocks, guys?
 
It does. It does. It does. It does. Not sure what kind of response you want..
 
@LeeJeong I hope they have.. I'd be sad to see Client Rich Apps disappear in favor of mobile apps..
But I have the feeling that Mobile Apps market won't get smaller anytime soon....
 
:/
 
fge
@XZen it makes webapps very easy to program
 
12:59 PM
@Unihedron I'll put up the CommandHandle structure for a review now..
 
1:21 PM
Guys, is it true that JSP compiles to servlet with loads of calls like System.out.println()?
 
It is true that JSP is compiled to servlet but with loads of calls like out.println is not true at all @XZen
 
1
Q: I command thee: do SOMETHING

Vogel612I am currenly contributing to a Chat-Bot to be used across the whole SE-Network's chat which is implemented in Java 8. This bot is supposed to have commands. These commands again are supposed to be as flexible as possible, and based on chat messages. To allow easy and extensible implementation o...

 
Greetings!
 
greets
 
wave
 
1:28 PM
glares
Come over, read Vog's code! It looks interesting.
 
Okay @Unihedron
 
@Unihedron it looks fancier in my eclipse, though...
 
@Vogel612 Quick, hack google code!
 
meh.. impossibru.. to granulated preferences...
 
L&F you are using sucks when comparing the files in VC @Vogel612
 
1:32 PM
VC? what is VC?
 
Version Control
 
@Vogel612 I like my color theme better. ;)
 
@Uni
Which theme are you using?
 
In SOlang: source control
 
@Mr.777 usually I do my VC well enough that I don't have to do something as crude as comparing files..
 
1:33 PM
@Mr.777 handcrafted one
 
@Voge
May be you are working alone then :D
ahaan, show me @Unihedron
 
@Mr.777 nope I am just using the right tool for the job..
 
Hmm, the current java file doesn't show its colorfulness fully :/
 
git has no need to compare files.
 
@Vogel612 May be you are comparing your fies in someother tool, not eclipse, right?
 
1:35 PM
no..
there is nothing like file-comparison in git
it simply does not exist
 
Git is not only VC
 
at worst you have large chunks of conflicting code..
but that's it.
 
And do you easily debug with this L&F?
 
debug and L&F are not really connected
I like reading stuff that way.
 
really?
I meant the visualization effects
I don't know may be you feel comfortable with this UI but i have tried it almost 2 to 3 months ago for almost one week and I got tired of it. No comfort @ all
@Unihedron still waiting for the handcrafted theme ;)
 
1:40 PM
Meh, whatever:
 
lol
BTW, nice
 
it at work:
 
Why are there special characters at the end of lines?
 
@Mr.777 that's just \r\n visualized
the same as that extremely unnerving inverted P at the end of lines in word-documents when you activate that..
 
fge
1:59 PM
@Vogel612 made a partial answer to your codereview question
 
@fge Any degree of commentary is welcome on CR as answers. CR is weird like that.
Also your avatar is broken on CR..
 
fge
@Unihedron "degree of commentary"?
 
@fge yes... because CR is about reviewing
 
@Unihedron are you referring to the "any or all aspects of code" clause?
 
fge
As to my avatar, it's not that it's broken, it's just that I didn't bother modifying it
 
2:03 PM
Oh.
@Vogel612 yep
 
:p
 
@fge um the FALSE is an invalid value because it signifies that the user didn't provide any predicate at all...
 
@Vogel612 comment as an actual comment? :P
other answerers need to know this too..
 
hmm...
okay..
 
fge
@Vogel612 so what?
Answer edited again
If this is only it I'd have just let the predicate be, and Objects.requireNonNull(predicate, "no predicate provided"); in .build()
Simple as that
 
2:09 PM
@fge but then you add another level of complexity to addSyntax, since you can't null.or(Predicate)
 
fge
Eh?
/me rubs eyes
 
point taken on the Consumer's name, I fail to see the point of a specific class for this, though.
 
fge
What?
Well, your choice
As to .addSyntax(), uh, well, I don't see the need for it
You add logic in your builder which Predicate already has
Let Predicate handle it
 
I don't understand what you're getting at..
 
fge
You mean to .or() predicates, right?
 
2:12 PM
well if I "initialize" the predicate to null it breaks the current code
calling addSyntax will throw a NullPointerException, since you're trying to call null.or()
 
fge
Yes, but why .addSyntax() at all?
This is my point
You are duplicating what .or() does
Let the user build the full predicate by herself beforehand and submit that as an argument
 
you may want to allow multiple independent syntaxes...
 
fge
Read what I said again
 
that would have been the other option...
 
fge
What is more you only .or() whereas someone might want to .and() instead
So, .addSyntax() really serves no purpose
 
2:16 PM
You still have the option to completely prebuild your own complete Predicate if you should want to.
IMO it makes for cleaner code to allow chaining multiple syntaxes with the same builder method, though, since you separate the different predicates already.
 
fge
Well, let that be the only option! And if there are really cases which are frequently used, then provide a helper class to build these predicates
 
that makes it easier to see from the builder what the predicates.
 
fge
But don't duplicate functionalities, especially since here your code is much more complex than it needs to be
 
more complex than it needs to be??????
 
fge
Yes
 
2:18 PM
I am sorry but WHAT?
 
fge
Again, no need for FALSE
Right back atcha :p
You also seem to be fixated into using Predicate; remind that what matters is that the class implements SAM
It can be any other class with a meaningful name
For instance, ChatMessageMatcher
Even the name of the method does not matter
Heck, such a class doesn't even need to extends Predicate<String>
 
@fge this one sounds interesting... what is that`?
not quite correct, if I read that correctly..
a Predicate<T> is specified to return a boolean for any T given to it through calling #test()
that behavior is not defined for a SAM-Type.
 
fge
Example: public interface ChatMessageMatcher { boolean matchesMessage(ChatMessage message); }
 
@fge so far so good.
 
fge
You can pass an instance of this class to any class expecting a Predicate<ChatMessage>
You don't even need to annotate the interface with @FunctionalInterface in this case
 
2:31 PM
I actually doubt that but let's keep this going for the sake of the argument: how does that affect the complexity of my code?
 
fge
What matters is that the SAM expects a ChatMessage as a single argument and returns a boolean
It is true
You have guava as a dependency, right? Try and Predicate<String> foo = Predicates.alwaysFalse(); <-- this will work
 
still: how does that affect the complexity of my code?
 
fge
Simple: again, you don't need FALSE, and .addSyntax() is useless
Since the latter replicates Predicate's .or()
 
not quite correct.
but fine...
I still fail to see why that design choice is so extremely bad..
and this seems to boil down to opinion...
 
fge
It is not "extremely bad", it fails to obey the law of Demeter for one, and it fails to account for all aspects of a predicate as well
If you are so keen to "chain predicates" as you intend to, it probably means you have common scenarios in which you want to chain them
Provide a utility class to generate such predicates and pass them in one go
It is not the role of the builder to call .or() on predicates
Separation of concerns
And since you always .or() anyway, why not just use a List<Predicate<String>>?
 
2:36 PM
While we're at it, would such utility classes be considered exclusive to be used by such builders and deserve to be an inner class, or to be modular and be reusable?
 
@Unihedron Looks like exclusive, because reserved to the use-case of building commands.
 
TIL
 
if you have recurring patterns across builders it might be worth moving them into a shared utility again..
 
fge
@Unihedron it may be used anywhere you want to match messages
There is no "super clean" way to do that in the end; when the generalization time comes and you need to refactor, @Deprecated the old one and start anew
(all the while maintaining backwards compatibility, of course!)
 
:)
 
fge
2:40 PM
Ah gee, I need to finish JSON diff refactoring
Sorry, I'd really like to focus my attention on this project but I just can't at this moment
 
Go ahead; Good luck!
 
@fge because this is shortcircuiting and thus simplifies handling. If you were to keep it in a List (which is definitely possible) you have to be aware that you need to either short-circuit manually or lose some performance..
 
fge
@Vogel612 streams :p
A Stream has .findFirst()
 
@fge that's not the solution for everything..
 
fge
In this case, anyway, performance is a secondary concern
Well, in Java, it is a secondary concern in general; except for really badly written code, it will be "fast enough"
 
2:43 PM
not when you have to evaluate the predicate every single time a message comes in.
 
fge
It's not like you had to handle billions of messages a second
Even in this case
 
and you don't have to explictly make it slower.
@fge just join enough rooms ;)
 
fge
So what?
 
@Vogel612 20 rooms here, reporting 4 msg / 5 seconds
 
fge
Really, you don't seem to realize, so I'll tell you a story where performance really matters
 
2:45 PM
sits and eagerly waits to hear a story
 
fge
In one of my project I have to check whether an index is within a certain range
That index check occurs several billion times a second in the worst case
At first, I used Guava's Range
Except that there is no such thing as IntRange
So, I created it instead...
Result: I gained 85% memory, but only... 15% execution time
And this is an average laptop, and the process is not even multithreaded
 
"only" 15% execution time..
 
fge
Yes, only
For n checks, you have n*3 boxings
How expensive do you think a boxing is?
What I did here is only avoid boxings
 
something along the lines of 200-300 nanoseconds?
 
3 steps?
 
2:48 PM
@Unihedron since you're boxing back..
 
fge
In short, the whole runtime went from 15 seconds to a little less than 13
Still, the memory gain was important to me, so I kept it
 
BRB awesome people..
 
fge
(oh yeah, that is on a 1 GB text file, encoded in UTF-8, where .charAt(), since this is this method, is called for each character of the file)
So, what is that compared to checking predicates on not even 10 messages a second?
 
let me guess... LargeText ;)
 
fge
Nothing
@Vogel612 exactly
This package is a learning experience, really... And highlights some fundamental missing things in the Java API
(you still cannot map more than Integer.MAX_VALUE in memory, darnit)
 
2:54 PM
:O
Good grief! REally?!
 
fge
Yes, really
FileChannel.map() returns a ByteBuffer...
Therefore you are limited by this class' range, and indices are ints
 
I hear you want a full-fledged Array class?
 
fge
I mailed the nio-dev list about this; no definite plans for Java 9
 
since that would allow using something other than int as index...
 
fge
@Vogel612 not sure whether this is the problem here
For arrays anyway it is too late
 
2:58 PM
hmm.. probably.
 
fge
Still, my fundamental problem remains CharSequence since it suffers the int limitation as well
 
isn't that backed by an array anyways?
for some godforsaken reason even LinkedLists seem to suffer of that limitation..
 
fge
CharSequence is an interface
So, it may or may not be an array
String implements it for instance
As to Lists, well, they are Collections and indices in Collections are ints, nothing you can do about that
Except write a LargeCollection from scratch and everything that goes with it :p
Streams and Iterators have no size limit
(therefore Iterable does not have one either)
(as to salvaging Guava, I really wonder why Oracle hasn't defined .alwaysFalse() and .alwaysTrue() in Predicate -- since interfaces can now have static methods)
 
:/
 
4:05 PM
For all a.equals(b) true, a.hashCode() must equal b.hashCode()?
 
fge
4:31 PM
@Unihedron yes
This is the contract
 
thanks
 
fge
If it weren't enforced, HashSet would basically be useless :p (and therefore HashMap as well)
 
Ohhh the horror..
Okay I hacked up something to make 9 look mergeable
 
9?
 
I just need some time to get this stuff back to good-looking and then rebase it onto the master changes
 
4:38 PM
You mean... #9?
 
then we can FF-merge
 
@Unihedron you got some anti-procastination tips?
 
kk
@LeeJeong Yeah, just do it...
 
Actually I made the bot summonable now..
it's a hack right now and not even tested properly, but it should be working fine.
 
I SUMMON YOU, @JavaBot!!!
 
4:39 PM
yea.. no.
gimme a sec.
 
other than that? ((:
 
~JavaBot, at your service
!!summon stackoverflow 1
aaand endian firewall..
thanks a bunch..
##summon stackoverflow 1
##shutdown
~going down
let's find out what happened!
~JavaBot, at your service
~going down
ermph..
that was less than optimal
~JavaBot, at your service
~going down
hey that wasn't planned!!
~JavaBot, at your service
##summon stackoverflow 1
oh okay my regex failed..
 
o_o
 
s.trim().matches(Pattern.quote(".*summon (stack(overflow|exchange)|meta) [0-9]{1,6}"));
oh great wizard, teach me ;)
 
quote? ... wtf?
Why are you quoting?
 
4:51 PM
do I not need to?
 
... You know it converts a section into a literal sequence right?
 
fge
No, in fact you don't want to
 
ohhh..
 
!!.*summon (stack(overflow|exchange)|meta) [0-9]{1,6}
 
so the regex should work when I am not quoting?
 
fge
4:53 PM
Yes
Although I fail to see why the .* at the beginning
 
okay then here we go!
~JavaBot, at your service
##summon stackoverflow 1
 
@fge "matches" is anchored
 
fge
@Unihedron yes, I know
(which is why I consider it a misnomer
 
-_-
 
aaand I got a concurrentmodificationexception.
 
4:54 PM
try \d instead of 0-9
 
dammit
 
[0-9] -> \\d
 
test
~response
okay so far so good
anyways ima head home now..
 
fge
Hmm, do you test at all?
 
in Sandbox, 1 min ago, by Vogel612
~response
 
fge
4:56 PM
OK, JsonDiff nearly done, just the javadoc to write now
 
::poof::
 
 
1 hour later…
fge
6:05 PM
One of the most famous songs in anime of all time: youtube.com/watch?v=z64HCi2rQkE (first track)
 
:D
 
fge
Man, I really wish Java adopted a hash API like Guava
It is miles better than MessageDigest
There, json-patch 1.9 is out
 
6:50 PM
Yay!
Night!
 
7:11 PM
Hi, Anyone Having idea on MyEclipse?
 
Hi
 
7:41 PM
Greetings
 
 
1 hour later…
8:56 PM
Learning Java OTJ. This programming language is like Inception.
 
fge
@user2821894 "idea" and "eclipse" in the same sentence? I choose "idea", heh
 
Definitely. Using IDEA now. Couldn't do this without it!
 
9:14 PM
I been using Eclipse Indigo most of the time. Currently am using MyEclipse for my Java Project. I feel its some thing difficult. Genuitec MyEclipse uses Pulse as third party and when I checkout a project, it shoud be synced with the pulse server.
The problem am facing is, there is a configuration center in Help Menu which shows the sync status. The sync status always shows me as disconnected where as it is Up to date in other peoples machines in my organization
 
Well, as much as I'd like to offer input, I have no idea what you're talking about. Good luck.
I'm using IntelliJ
 
 
1 hour later…
fge
10:36 PM
Heh, on Freenode, channel ##java, ask "~why no homework" -- answer: <javabot> We understand you aren't asking us to do your homework. That's not why we don't answer. We don't because 1) You usually don't comprehend the answer and we get stuck in an endless loop of 'why', 2) You will understand, but you'll retort with "my professor doesn't want me to do it this way'. That's frustrating. 3) Homework questions are boring questions. We don't get paid. Your prof does.
Sooo true
 
 
1 hour later…
11:51 PM
^^^
 
03:00 - 12:0012:00 - 00:00

« first day (1487 days earlier)      last day (3454 days later) »