« first day (1585 days earlier)      last day (3356 days later) » 

fge
12:00 PM
And yeah, I agree; TDD gives you confidence in your code
 
no, I borrowed a make-do one from the library
 
fge
However it's not enough yet
 
the one I ordered hasn't arrived yet, I'm not surprised, things take a while to arrive here
 
fge
Which is why I also use mutation testing
 
Mutation testing... sounds interesting :D
 
fge
12:00 PM
@Unihedro did you really follow the TDD session? I explained what it was
slap
 
Eh, I did follow, but I didn't practically digest everything you said :p
 
@fge Has recording?
 
@SecondRikudo nope, otherwise I would had watched it again and again until I understood thoroughly
 
@Unihedro I have a TDD series on JavaScript, it's very good, and the methodology is practically the same
Same methodology, different tools.
 
fge
@SecondRikudo yes; specifically, we were talking about this part
 
12:05 PM
wait, there were one?
Oh, it's unlisted. Never mind.
 
fge
12:32 PM
yawn
 
Does anybody know why my mapped groups in glassfish aren't found by SessionContext.isCallerInRole("")?
 
fge
@Unihedro your Action "interface" is too complicated imho
 
Well, that's why it's scrapped :)
That's what happens on Mondays...
But it allows you to do fun things:
 
@fge Good news!
 
Action action = callBiConsumer((String str, String str2) -> System.out.printf("[%s], [%s]\n", str, str2)
    .left.withNull()
    .right.byResultOfCalling(Integer::toString).byResultOfCalling(x -> -x).with(1)
    .build();
(guess what it does...)
 
12:40 PM
Got the permission to use libraries and Java 8 :D
 
:O
gZ
 
@SecondRikudo gZ!! :D :D
Java 8 rocks
 
gZ -> Congratz
 
Shorthand for congratulations.
 
fge
12:41 PM
@SecondRikudo that is indeed excellent news
 
Alternative is ggz.
 
Mostly used by gamers :P
 
Note the use of capital Z, "gz" is a different thing.
 
fge
@Unihedro yeah, and had you just typed, you know, "congratulations", you wouldn't have had to explain :p
 
@fge Negative, Ita used gZ as well :p
 
fge
12:42 PM
You have a keyboard, use it :p
 
I refuse.
 
fge
Yeah but I already spanked him for that
Now it's your turn :p
 
:D
 
@fge From next time, we don't have to and it saves time
 
Fine, then I'll stop using abbreviated forms.
 
fge
12:42 PM
No it doesn't
 
Saving time is pointless.
 
You will know shortcuts once you play a lot of MMORPG games
@Unihedro :p :P
I like how it is written :)
 
fge
Well, I don't play games so there you are
 
It is pointless to save time instead of spending it on happy things; The use of time is negligible once it's done.
 
Not my fault. Read my shorthands
 
12:43 PM
Or, in other words, in the end, we all die.
:|
 
fge
@Unihedro meh, just write your unit tests
 
Okay!
 
@Unihedro there is a bug in message splitting
 
show me plz
 
12:45 PM
it doesn't take perfectly valid links :(
this one borks
it's not recognized as link
 
Which line in the code?
Eh, I assume you ran a debugger?
 
PrintUtils, line 12
 
kk
 
fge
@SecondRikudo first step is then to switch to java.nio.file and try-with-resources :p
 
Why are all the tokens surrounded by capturing groups?
 
12:47 PM
um... I don't actually know..
because I wanted to match the whole message in one go and not find() and group() through it all??
which I then did anyways...
 
<a href="http://example.com" rel="nofollow">sophisticated &#91;test link with nested&#93; brackets</a>
[sophisticated \[test link with nested\] brackets](example.com)
Which one is causing problems?
Wait, never mind.
private static final String  LINK_TOKEN_REGEX          = "(\\[[^]]++\\]\\(https?+:\\/\\/[^\\s\"]++(\\h++\"[^\"]++\")?\\))";
^ this one is broken.
 
yep
I already was that far.
 
Ugh, I don't have a Java regex tester.
 
unfortunately the following doesn't work either:
 
And I don't want to switch to Windows just to use regexbuddy.
 
12:50 PM
private static final String  LINK_TOKEN_REGEX          = "(\\[.*?\\]\\(https?+:\\/\\/[^\\s\"]++(\\h++\"[^\"]++\")?\\))";
 
That thing has a problem but we can deal with it later
I'll reconstruct one, one sec
test cases pls
 
you got a whole class full of them
^^ link test-cases in already existing unit-test
interestingly only the last one fails
 
Yeah, but those are only two, and doesn't have as much related to nesting strange formats related to brackets.
 
fge
Why don't you just use the URI class to parse URIs when you expect one?
Instead of using a regex
 
@fge because we don't actually care about the URI
 
12:53 PM
I bet [something \[like\] this (probably)](http://about:blank "becomes a link") something [like] this (probably)
 
and it needs to be a URL in the first place
 
fge
That's not the problem
The URI class will parse the URL for you
Don't use regexes when you don't need to
 
Eh, we don't need to know whether it's a valid URL, because the markdown parser doesn't care either.
 
@Unihedro Harmony is dead too. Many thanks to Sun/Oracle :-/
 
fge
Well then that's even better
Use it
If it's not valid, don't substitute
The end
 
12:55 PM
Eh, there are no markdown parsers implemented in Java, only that in Javascript.
 
fge
I'm afraid you're wrong
There's pegdown
And it uses... Yes... parboiled
 
:| Pegdown is not chat markdown
 
fge
Bah, do as you want
But as far as I'm concerned, you should use the URI class here
 
... How? We don't even keep the url, we just throw it away.
Hold on.
@Vog: "a overly strange" link? Shouldn't it be "an"?
 
Am I doing something wrong with this?
0
Q: Glassfish mapped roles aren't allowed by the SessionContext

EratesI have an application running against an Active Directory server for authentication. My realm is setup correctly because it finds users and groups like it should. My EAR file layout is like this: EAR EJB.jar WEB.war WEB-INF glassfish-web.xml web-fragment.xml (Let's call this BasicFragment) w...

 
1:02 PM
[test ] ] ] link](about:blank)
 
@Unihedro yes it should be ;)
 
fge
@Unihedro you didn't understand what I said, it seems
Nevermind
 
It even takes http:// as a link address. xD
 
a question on libgdx : drawing each from an array using :
for(Sprite sprite : worldController.testSprites){
   sprite.draw(batch);
works .. but for the individual sprite called maincar the foll doesn't work :
  maincar.draw(batch);
  error : Exception in thread "LWJGL Application" java.lang.NullPointerException
 
@fge I clearly don't - using URI would assert that the address is syntactically correct. The point being that we cannot assert a correct address because the chat markdown doesn't care about correct addresses, as long as it starts with http:// and https://.
 
1:10 PM
maincar is a Sprite object in another class called worldController. how should i define it in this class so that the interpreter knows?
worldController.maincar.draw(batch); doesn't work as well..
 
[test link](http:// "weird \"message")
^ this passes... this is going to be tricky
 
passes where? in chat or the regex or both?
 
chat
So you can't use "[^"]"
 
@Unihedro Isn't it a regular Markdown mark-up?
 
would've been too easy, eh?
 
1:14 PM
Honestly, for the unit testing we should just download master-chat.js and then feed it with random brackets combination, and attempt to assert that out method matches that of the javascript reaction.
At least we deal with the insanity all at once and can forget it later.
 
Hey, who brought that JS blasphemy here?!
 
Look at the star board.
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project framework: Compilation failure: Compilation failure:
[ERROR] /home/dor/products/framework/src/main/java/com/taboola/dal/Persistent.java:[22,45] incompatible types
[ERROR] found   : com.taboola.dal.StorageEngine
[ERROR] required: com.taboola.dal.StorageEngine
[ERROR] /home/dor/products/framework/src/main/java/com/taboola/dal/Persistent.java:[23,63] incompatible types
[ERROR] found   : com.taboola.dal.CollectionSerializer
 
test link [test link](http://evil.address/with/brackets_\(in_url\)_\(%20like_wikipedia%20\))
 
And then you ask why I hate Java....
 
1:18 PM
Eh... Spring?
 
Nope
This is a POJO.
And it's a compilation error.
 
progress!
 
@fge Any idea?
@Unihedro Are you making a theme, or are you showing the results of your tests?
 
return Option.of(2);
Wait, that matches as well? WTF?
That's betraying markdown.
 
"\\[.*?\\]\\(https?+:\\/\\/.+?(\\h++\".+?\")?\\)"
what do you think of this one?
 
1:22 PM
It doesn't fail on [hi world] world](link).
And here's the bad part: it has to, because the chat does.
 
well that's mostly because you'd have to escape the brackets..
 
Also, .+? is bad.
Because the chat accepts http:// as an address.
Let's try whether it takes ftp://... hi
Yes, it does. Kill me now.
 
oh my god, we're so dead
 
Um, ftps:// attempt... [hallo](ftps://)
WHAT?! WHY?
... is this check necessary?
 
quick question about java guys
 
1:25 PM
Don't worry, I'll nail it.
>:| serious regex composition face
 
don't ask to ask
just ask
 
yeah just being friendly while preparing the question
 
One more test: [foo](http://the"bar" "baz") foo
OMG NO YOU'RE KIDDING ME
 
fge
@Unihedro again, that's not the question at all
 
@Unihedro btw. secure ftp is sftp:// and not ftps://
 
1:27 PM
[sftptest](sftp://)
 
fge
@SecondRikudo sorry, I didn't follow; about what?
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project framework: Compilation failure: Compilation failure:
[ERROR] /home/dor/products/framework/src/main/java/com/taboola/dal/Persistent.java:[22,45] incompatible types
[ERROR] found   : com.taboola.dal.StorageEngine
[ERROR] required: com.taboola.dal.StorageEngine
[ERROR] /home/dor/products/framework/src/main/java/com/taboola/dal/Persistent.java:[23,63] incompatible types
[ERROR] found   : com.taboola.dal.CollectionSerializer
 
fge
Eh?
 
found == required?
what is this madness?
Are you using a different version of the dependency by chance?
 
fge
So, not only you use Spring but you also use Maven, uh?
 
1:28 PM
@fge Sadly.
 
fge
And your IDE has no problem with it, I surmise?
 
having a var typed double called "lag" , and a var typed int called "maintainer" ,
maintainer = (int)lag;
 
smells like inconsistent jar versions on the classpath @SecondRikudo
 
having this line, is it changing the type of the "lag" to int or its temporarly convert it to int to get it into the "maintain"?
 
@fge Nope.
@Vogel612 I mvn cleaned before I ran package
Anything else I can do?
 
1:30 PM
@obeyjoseph the latter
 
fge
@SecondRikudo I have never seen that before
 
clean the project, maybe your IDE catches up
 
fge
The only thing I can think off the top of my head would be line separator inconsistencies but that should not be a problem with Java source files...
 
.lnk?? this is not windows, uni
 
@Vogel612 carebearstare
 
1:32 PM
@Vogel612 you mean that its temporally convert it into a int to get it into "maintainer" but don't change anything about the "lag" var?
 
yes
 
fge
@SecondRikudo can you pastebin your pom somewhere?
 
@Vogel612 thanks for that , i got another question related if you may
 
wut?
 
1:32 PM
FML
 
@Vogel612 I mvn clean from terminal + went to ~/.m2/repositories and removed everything
 
What kind of people built this markdown parser?...
 
Also cleaned from IDE just in case
 
okay if that didn't help, then I'm at wit's end
@Unihedro balpha..
 
Wait, not... Tim?
Oh, then forget it.
 
1:33 PM
@obeyjoseph sure ask away
Basically, Markdown is a thousand ambiguities flying in close formation. (Apologies to Peter da Silva.) — michaelb958 Jan 31 '14 at 12:04
okay it seems it was Peter.
 
PETER!!!!
Excuse me, I'll be back in a second.
 
fge
@SecondRikudo that is worth a question on SO... Although I doubt this problem is exactly new, so maybe similar questions already exists, I don't know
I have dropped maven for a looong time
 
@Vogel612 a friend once told me to write the following line:
Graphics2D g2D = (Graphics2D) g;
as he explained it, he said that the "g" var is now a graphics2D component (being converted from Graphics component.
so how is that make sense as if the previous question says different
 
fge
@obeyjoseph your friend is wrong, g doesn't change at all
It just happens that you can cast it to a Graphics2D, which means its class is either Graphics2D or a subclass of it
 
think of casting as changing how you look at something
you pretend g were a Graphics2D, but that isn't necessarily true
it could also be a Monitor extends Graphics2D
but you can still pretend it were
 
1:40 PM
in Stack Apps on The Stack Exchange Network Chat, 46 secs ago, by Unihedro
Are there specifications for the chat Markdown parser? I'm tired of getting continuously impressed by the inconsistencies of how links work.
 
@Vogel612 and @fge i can't imagine how was keep learning Java with this wrong concept i had in mind
thanks
 
@obeyjoseph um that's not right
that's like saying (int) "42" gives you 42
 
^^ does that even compile?
 
fge
No that won't, obviously
 
Here, g is a value of an object reference to something being held in it, and (Graphics2D) is a cast that converts the value of the object reference, but the referenced object doesn't change at all.
 
1:44 PM
Uni you're beating a dead horse
 
Huh?
 
im raining questions today folks, keeping you busy i hope
 
does
g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
 
@obeyjoseph most of these questions are easily searchable.
 
1:45 PM
override the Graphics drawString ?
 
Alright
Twas bad Java6 version
 
want to get the strange stuff done, too? @Unihedro
 
sure
 
Updated to latest minor version of 6 and it works
 
Find a failing case and I will give you a buck.
It has to work in chat and fail the regex. :p
 
fge
1:46 PM
@SecondRikudo huh?
Ohwell, you got it to work
 
@fge I had Java 6.24 and I needed 6.30+
 
fge
@SecondRikudo OK, still, I fail to see how this could have cause this "compile error", but...
Meh, don't bother trying and explaining, some things are just better left alone :p
 
@fge Bug that was fixed in Java 6.30
 
fge
Ah, OK
 
 
1 hour later…
3:05 PM
my friend committed somthing dumb in the code and i ended up with a non working blunder..
I am lloking to go back to the previous commit by me.. I am referring to Stackoverflow answers but I am not getting it.. :(
 
3:17 PM
what exactly do you want
do you want the commit to vanish from history?
do you want to change the commit?
or do you want to roll changes back with a new commit doing the opposite @Sword
 
@Sword Did he push it?
git revert
 
well you could be a jerk and rewrite history
(which is what I permanently do)
git rebase, git reset hard and git commit --amend ftw
 
I guess he has already pushed it....
 
yes he did it before me
and i pulled it .. so everything messed up.. btw i followed the steps in above link and it is ok now :)
my internet was down.. came online just now :)
@Vogel612 wanted all of his commits to vanish
 
then reset --hard is the way to go
 
3:25 PM
and i've got my code back now.. no issues
i did this :
# Resets index to former commit; replace '56e05fced' with your commit code
git reset 56e05fced

# Moves pointer back to previous HEAD
git reset --soft HEAD@{1}

git commit -m "Revert to 56e05fced"

# Updates working copy to reflect the new commit
git reset --hard
 
Isn't this same as performing a git rest --hard 56e05fced - the commit message
 
fge
No it's not the same
 
@fge What's the difference?
 
fge
3:41 PM
@Gemtastic if you reset --hard you make the ref point to a given node in the commit graph; you don't create a new node
 
Ah :)
 
fge
I'd have done this otherwise myself, but...
 
I said minus the new commit
 
fge
Not even that
Again, git reset --hard does not create a new node
Also, note that reset is NOT limited to parent commits
<-- still on JSR 203
That takes a MUCH longer time than I expected :(
 
3:56 PM
Ohh.. how is that? I thought git reset can be done on already present commits
 
fge
(but then I'm finally getting somewhere "good" so I won't complain anymore)
@ItachiUchiha it can only be done on existing refspecs
Whether they are in the commit tree or the reflog, but it has to be an existing refspec
 
Need to go through the video again. Somehow I still don't get what refspec are..
 
fge
It's a SHA1 referencing a commit
It just happens that some of these have names
 
branches or tags
 
fge
And those are what is referred to as "branches"
HEAD is a refspec, master is a refspec, origin/master is a refspec, and so are HEAD~1, master~5, etc etc
Ultimately they're all SHA1s
 
4:05 PM
Yeah, they're all resolved to the refspec when you pass them into git functions
HEAD, HEAD^^, HEAD~10, master, master^^, my-tag~3, all of those eventually resolve to SHA1
 
fge
(which you can "see" by using the git rev-parse command)
 
Or git show
 
Ohh..
 
If you want more details
 
I just didn't know the technical terminology :-P
 
4:10 PM
So, @Vog, did you manage to beat the challenge of finding a flaw with the regex?
 
nope
 
@Unihedro "the" regex?
 
2 hours ago, by Unihedro
Find a failing case and I will give you a buck.
It has to be a markdown sequence that is considered an inline link in chat but not by the regex.
 
4:34 PM
Swordy knows of my regex skills so I wouldn't take too much time trying if I were you :p
 
@Unihedro I didn't but maybe prod testing will... PR open
 
did you set it to be ready?
Waffle.io takes a while to initialize.
I added a weight to it.
 
5:03 PM
Listen up everyone!
*drum roll*
 
Code Understanding is in commitment phase
sorry did I spoil the fun?
 
And Music Fans is in private beta :)
 
ohhh?
 
Actually, no worries, it was two good news!
 
fge
Yep, I received an invite too
 
5:04 PM
8
Code understanding

Proposed Q&A site for most of the time when it comes to contribute in opensource project or to edit others code, most of the time newcomers [or even sometimes pro coder] failed to understand where to start or edit. This site will help them to take help and understand.

Currently in commitment.

Using the referral link (lol) would be very much appreciated: Commit to Code understanding!
 
too late, already committed
 
> "I'm largely interested in how this will work out, especially given the likeliness of this to drift into no-brainer territory"
laugh out loud zebras
 
#justsaying
 
If it airs I'm going to try to learn more about how invokedynamic works. :D
 
why not do that anyways?
also poke when do you release JCE? What's the status there?
 
5:11 PM
Eh.
I stare at it, wondering what's yet to be finished, then click into the implementation and: "oh..."
:p
 
so on a scale from 1 to 10, how bad is it?
 
Which side of the scale is bad-der?
 
@ItachiUchiha You there?
 
Hi all, does anyone know a way to listen for the unclicking of a JButton?
 
5:24 PM
I didn't. I looked up the manual of Swing after you asked, and read the section on JButton. Now I do.
 
lol
@JohnDurrans Maybe you just use wrong component.
That sounds like you should use JToggleButton
@Unihedro I didn't know it either, but is it so hard to try to type in Google: JButton isReleased
 
@Unihedro 10 is worse
 
um 4
soon to be 3
 
@BranislavLazic Thanks, but I don't think so, I need to hold a button down for 2 seconds, but can't get it to check the time when it's released, rather than clicking on and clicking off with a toggle.
 
@Unihedro I'm glad to hear that ;)
 
5:35 PM
@BranislavLazic heya
 
Hey @ItachiUchiha how do you deal with this situation: stackoverflow.com/questions/18146712/…
 
@BranislavLazic you do know there's 3 answers on that question??
 
I know... but still..
Is there 4th :D
 
fge
Why?
 
Ok nevermind
 
5:40 PM
Don't reinvent wheels. :p
 
Well.. couldn't just be easier: comboBox.setSelectedItem(item); :P
:D
 
except if you want it reviewed on CR... there is a
anyways I'm off for today
 
the second solution does that
 
cya around
 
Obviously Itachi :P
 
fge
5:50 PM
sigh
 
ehh?
 
Uh oh.
I just brew, and drank, coffee, and then realized... Why am I drinking coffee at 2 am?
Wait, it's 2 am? Feels like 6 pm...
 
I am tired today
 
What time is it at your place?
 
fge
6:20 PM
git rebase rocks
wonders whether a new hangout will take place at all
 
git rebase rocks
 
6:36 PM
http://www.commitstrip.com/en/2015/02/24/what-to-do-between-projects/
CommitStrip - Blog relating the daily life of web agencies developers
What to do between projects
CommitStrip
1424802856
 

« first day (1585 days earlier)      last day (3356 days later) »