« first day (1593 days earlier)      last day (3340 days later) » 

1:43 AM
@RobMullins Sorry it took me so long to read this message. But your answer really helped! Thanks!
 
2:41 AM
@fge dude i dont get and im lost in the JOOQ tutorial... what object do i use to catch object results from a jooq query?
Is it always like this?:
Result<Record> result =  create.select().from(AUTHOR).orderBy(AUTHOR.LAST_NAME).fetch();
 
3:17 AM
hey
insert finally to end block statement?
errirubg
*erroring
 
 
1 hour later…
4:31 AM
hi all
 
 
1 hour later…
fge
5:47 AM
Moo
@LeeJeong this will return what you say, yes; however what you want to do is create a RecordMapper and use .map() after you fetch. Also, since Result implements Collection you can .stream() if you want
 
6:10 AM
hi guys
have doubt in spring
 
6:26 AM
hi guys
I wanna use velocity for a kinda code generator
what else I can use instead
?
 
shoot @user2652051
 
fge
6:44 AM
@RaminPakzood code as in what? Java code? Other?
@ItachiUchiha so, what else was discussed when I was off (hangout)?
 
Good morning, Java
 
good morning
 
@fge There was a lot of discussion on MVC, because I could get it. Later, I was told that spring abstracts the view layer.
I used to think that the view are HTML, FXMLs etc. But, second said that these are just templates.
<--- Still have to read about layers
 
fge
Well, HTML and FXML have no "logic" in them
 
7:08 AM
yeah and that is what I thought, views are just what the user see. It has no logic in it
 
fge
Not in MVC, it seems :p
 
Well, I never knew anything about MVP before it came up in this chat room
Guess, I was following MVP and thought it was MVC. But, again why does the JavaFX doc says that FXMLs are the View in the MVC?
 
fge
Well, they expect that your event handlers are aware of the model
In my case they aren't
Anyway, I'll get to web grappa-debugger once I'm done releasing a new version of throwing-lambdas
 
Event handlers aware of the model?
event handlers are aware of the model, only once they reach the controller
view is tightly coupled with controller, but view has no idea about the model.
 
fge
Uhwell, I don't know really
But then JavaFX has fx:controller...
Meh, I kind of dislike the view being aware of the model at all, but then that's just my opinion
 
7:20 AM
fx:controller is for controller, not the model
 
fge
Yes, but then the controller as in MVC will need to know about the model
 
My delights for being introduced with GIT and JOOQ in this chatroom. thank you guys~ im so relieved.... things are getting easier. no more copy-paste of projects (my earlier way of backing up), and no more complex mapping of objects to tables.. special thanks @fge and @Unihedro
 
fge
Heh, with JooQ you don't map tables
You map query results
And that's a HUGE relief
What is more, with Java 8, you can stream the results and use Collectors to great effect as well
<-- is definitely going to make a session about jooq
 
Morning!
 
fge
7:35 AM
Hello @Gemtastic
And sorry for having to leave early "yesterday"; I missed the end of it
<-- excited by throwing-lambdas again
New version: final Function<Foo, Bar> = Throwing.function(my::function).orTryWith(other::function).fallbackTo(last::reso‌​rt);
 
Well, I'm not the one to apologize to, I was just a spectator :P
 
fge
And Throwing.intFunction(), Throwing.doubleConsumer(), Throwing.binaryOperator(), etc etc
All 39 interfaces to modify shrug
<-- gladly accepts help
 
@fge how do you casually treat results of a query in JOOQ?? you were talking about maps? is it necessary for me to read 'em??
 
fge
7:53 AM
@LeeJeong two things; first, you have a .map() method on a Result<? extends Record>; the argument is a RecordMapper. What you want to do is write the RecordMappers you need.
The second thing: Result<?> extends List<?>, which means in Java 8 you can .stream() a Result<?>; so you can use streams as well
 
Ok can you shorten the explanation based on experience what are recordMapperS?
 
fge
However, don't abuse that
A RecordMapper is defined by RecordMapper<? extends Record, T>; it will return a T out of a Record
So, if you for instance jooq.select(....).fetch().map(myMapper) you'll get a List<T>
Again, what you map are query results; and that is what makes JooQ outshine all other ORMs (save for mybatis)
 
im still confused with the signatures containing <? extends Record, T> ...
jooq returns a record..
you use map() on that record right..
ok... im gonna read the docu again now..
// Write callbacks to receive records from select statements
List<Integer> ids =
create.selectFrom(BOOK)
      .orderBy(BOOK.ID)
      .fetch()
      .map(new RecordMapper<BookRecord, Integer>() {
          @Override
          public Integer map(BookRecord book) {
              return book.getId();
          }
      });

// Or more concisely
create.selectFrom(BOOK)
      .orderBy(BOOK.ID)
      .fetch(new RecordMapper<BookRecord, Integer>() {...});

// Or even more concisely with Java 8's lambda expressions:
im confused on the part where they use 'book' variable where nowhere in there it was declared...
specifically on the 3rd block
 
fge
Those are generated by the code generator
JooQ can query the DDL of your schema and generate Tables with Fields
You can also do that programmatically
 
would a lot of things break when I say change from java 7 to 8, just to try these lambda features?
 
fge
8:04 AM
No, nothing would break
But beware of overusing streams
You have an RDBMS, put it to work
 
RecordMapper(BookRecord, Integer) <- the second argument in the constructor are the things that i would expect to return as list?
 
fge
Yes
 
HOLY wow
 
fge
OK, let me show you an example
 
on the above code posted, whats the difference between the first and 2nd block?? they seem same,
YEY! :)
 
fge
8:08 AM
But I have much more advanced examples
This one is "relatively" simple
But you see, the thing is that my tables are nodes and matchers; and I have no POJOs for either of them
With Hibernate and friends I'd be pretty much constrained to create them, even though I don't need any of them
In fact, my mapper could take a Record3<String, Integer, Integer> as a first parameter type instead
But I decided not to bother and go with a plain Record instead :p
There are still other ways
You can use beans etc
If you want a more advanced example, just tell :p
 
im still processing the codes you have shown.. ahaha
 
@fge Yes, controller always knows about the model, that is true in case of all the MVC
@fge tell me what to do. Got some time in hand since I have finished the anime :P
 
@fge dude, when two tables have a foreign key relationship you can automatically call them by this <dsl query>.from(table1, table2) directly?
 
fge
@LeeJeong provided that you join those tables at some point, but yes; and those are not limited to bona fide tables, those can be "virtual tables" which you create via a query as well
 
8:23 AM
keybase.io - That's pretty cool! Anyone wants an invite?
 
fge
@ItachiUchiha OK, if you want to help first I'll have to explain how this works ;)
 
@ItachiUchiha How was it? :)
 
@SecondRikudo Is that a free key-hashing program?
 
@Gemtastic It's a tool that helps public key discovery be faster.
 
@SecondRikudo I seriously need an example(in java) which strictly follows MVC.
 
8:25 AM
I can look up your public key via social networks, and easily verify messages you signed off, etc.
 
@fge Your room or a hangout?
 
@SecondRikudo Interesting
 
fge
@ItachiUchiha well, maybe a hangout; some other people might be interested
 
Yeah
@fge About?
 
fge
@SecondRikudo throwing-lambdas
 
8:27 AM
@SecondRikudo I was expecting something else in the end, but it just had The End. After watching the anime, I am dis-satisfied, coz I wanna watch more :(
 
fge
OK, I need to be off for 5 minutes, I'll start it right after that
 
@ItachiUchiha I know, ZnT's ending was a bit disappointing
 
fge
@ItachiUchiha go watch GITS-SAC, both seasons :p They are still the best series I have ever watched imho
 
@SecondRikudo I think they don't plan for S2 as well
@fge I have that, I have watched 2 episodes of S1
 
@fge, dude the PerClassStatistic is not auto-generated right?
 
8:31 AM
@fge Worth noting this doesn't fully implement the DataMapper pattern
(not sure if that was your intention)
DataMappers are always two-way.
 
Guyz one question what do I use if I need to know the difference between two dates along with the bigger/smaller dates
 
joda datetime is the prefereed choice
 
108
Q: How to compare dates in Java?

antHow do I compare dates in between in Java? Example: date1 is 22-02-2010 date2 is 07-04-2010 today date3 is 25-12-2010 date3 is always greater than date1 and date2 is always today. How do I verify if today's date is in between date1 and date 3?

 
yeah but it does not give me the the info about 'how much bigger'
I need something like -2 if it's 2 days earlier and +2 if it's later
 
8:34 AM
50
Q: Calculate date/time difference in java

LondonI want to calculate difference between 2 dates in hours/minutes/seconds. I have a slight problem with my code here it is : String dateStart = "11/03/14 09:29:58"; String dateStop = "11/03/14 09:33:43"; // Custom date format SimpleDateFormat format = new SimpleDateFormat("yy/MM/dd HH:mm:ss"); ...

 
@fge Dude correct me If im wrong, the way you casually do it is, you let JOOQ generate most of the code, then you only create a CustomMapper and CustomObject to catch the results of a jooq query??
 
@Sudh learn to google
 
fge
@SecondRikudo that was not the intention
@LeeJeong no it's not, it's a POJO of mine
@SecondRikudo as I mentioned earlier, JooQ allows me to map results of queries to POJOs; those queries may map, or not, tables, but in my case none of my queries match a table exactly
And that's the strength of JooQ
 
@fge ok, I was right... it was a CustomObject/POJO you made to catch the result of the JOOQ query right?
 
fge
@LeeJeong yes
And I have more advanced examples
 
8:37 AM
give me an simple explanation of your advanced examples first...
 
fge
Well, one of them is available as a video on youtube so you may want to watch it ;)
In fact the JooQ guy even tweeted it, meh
 
ahh, "when a classic ORM just cant handle it" video?
 
fge
Yes, this one
 
yeah, saw it... but havent thoroughly understood it though, coz yeah i thought it was way too advanced...
 
fge
I have another advanced example which combines a query, a Stream and a Collector
 
8:39 AM
@fge so ill just make custom mappers and custom pojos for things I need right?
 
fge
Exactly
 
BOOM!
 
fge
As an example, @Gemtastic for her project needs to have stats about cars and reported errors per model etc
Well, simple: create the POJO, create the mapper, create the query, done
And the query can be as complex as you need it to be
The RDBMS does all the work for you
And you get the credits
:p
 
:P
 
hey wait... @Gemtastic is female?
 
8:41 AM
Maybe
 
@SecondRikudo Have you worked with Spring MVC?
 
fge
Well, a series of electrons along the wire can be whatever gender you want
 
But it's better if you think of me as a dude
 
I thought he was male having a partner female that he mentioned about.. and he has a blurry vision and cannot recognize his mother in a crowd
 
8:42 AM
@ItachiUchiha Only briefly.
 
ahahha
 
I don't have blurry vision, I have prosopagnosia; a face-blindness
 
@SecondRikudo Is the viewResolver, which resolves the template/html/jsp, part of View layer? (If you are aware of what viewResolver is :P )
 
@ItachiUchiha Yes, but it's more of a utility object. It just accepts a name and spits out a template, doesn't it?
 
8:44 AM
@fge dude, whats the importance of always declaring final in variable declarations...??
 
fge
(reminder: about throwing-lambdas)
 
@SecondRikudo Well, you are partially correct. I now understand why ModelMaps are called as Model map and why are they injected in the templates
 
@fge ok!
 
@LeeJeong Being more strict is always good
 
fge
@LeeJeong mostly an intent for the compiler to tell it that "I won't modify this"; I'm a final-happy guy
Anyway, my focus is on the hangout for now :)
 
8:46 AM
alright~! thanks @SecondRikudo and @fge
 
@LeeJeong If you don't, eventually you'll screw up because you need it. Go read up an Oracle document on what the keyword is for.
 
fge
waiting for @ItachiUchiha to show up
 
i dont have time, i like you guys' witty and short explanations ;)
 
@fge just 2 mins, joining in
 
fge
8:47 AM
Uh, OK
 
Why am I followed by Scala Friends, Database Friends and a PHP-based database administration framework? That's ridiculous xD
 
fge
So, for the recall, link here; it will be about throwing-lambdas, its purpose, new design and what you can do to help :p
 
Ugh, my neighbours are extremely noisy.
 
Are a lot of programmers on twitter?
 
8:51 AM
lol first time i saw Hangout
 
@Gemtastic I don't know, but for sure there are no programmers on Facebook :p
 
Except the ones developing it :P
 
in Tavern on the Meta on Meta Stack Exchange Chat, Feb 24 at 17:56, by Unihedro
Instagram is the source of weird cats. Facebook is the source of casual cats. Twitter is the source of random cats, and Stack Exchange is the source of professional cats.
 
@ItachiUchiha heya
 
that was cool~
 
8:54 AM
@Gemtastic Eh, I wouldn't say the developers of facebook qualifies as programmers, just open the console when you reach their pages.
 
@Unihedro I don't really dare
 
It's clearly built with Bootstrap. xD
 
It's like looking at roadkill
 
And it uses Mercury for ajax.
 
fge
@ItachiUchiha ping
 
8:56 AM
@fge it will take me some time, you can start if there are people waiting. I'll join in
 
@ItachiUchiha 10 minutes later.
 
fge
@ItachiUchiha no one in particular so I'll just postpone until you are ready
 
@Gemtastic @fge @ItachiUchiha I'm not sure if I mentioned it in the talk yesterday
 
Hmm?
 
The fact that Controllers or Views don't have a direct dependency on Domain Object doesn't mean they can't use them
It's very possible for a Service to return a Domain Object, and allow the controller/view do whatever it wants with it.
Especially in the view (i.e. now I need a List<Car> to render a table in HTML)
 
fge
9:05 AM
That's a "given" somewhat ;)
 
@fge I agree :P
 
fge
@SecondRikudo nice drawing! I suck at drawing so much that I wouldn't even be able to do that
OK, so, when @ItachiUchiha says he's available I'll start again on throwing-lambdas
In the meanwhile I'll do doubleFunction() :p
 
I broke youtube!
 
fge
longFunction(), rather
 
9:15 AM
 
fge
Yay
I am happy that I write unit tests
 
@fge There are few things more satisfying than after a 2 hour coding session, to run all tests and have them all pass on the first try :P
 
fge
@SecondRikudo well, I do TDD, so I run tests as soon as possible; and here I have run them and this has allowed me to spot an error :p
Had I not followed this, this bug would have creeped into the next version :/
(Uh, the spanish guy has contacted me again; I need to find out how to run unit tests on Sonar checkers)
@SecondRikudo do you know if there is anything like mutation testing for JS?
 
@fge I'm not familiar with the term mutation testing
Maybe I know it just not by name
Can you describe what it is shortly?
 
Errgghh, I can't install the Google plugin on this system
it really sucks when you don't have the admin access
 
9:30 AM
@ItachiUchiha windows?
 
Mac
@uni can you join in the hangout and say something, I wanted to check if it really works through mobile :P
 
fge
@SecondRikudo for instance, let's take a test which relies on a numeric test a <= b
@SecondRikudo mutation testing consists of taking the code, replacing <= with <, > or both, and rerun the test with the mutated code
 
numeric test being? (XD)
 
@fge dude thank you so much for your help. :D exploring JOOQ like a boss
 
fge
@SecondRikudo the goal will be, of course, for the test to fail with that mutated code
 
9:32 AM
OH a and b are variables, OK
@fge So... you're writing one test that passes, and then automatically mutate the assertions and make sure these fail?
 
fge
Basically yes
 
Ok, so the mobile version sucks!
 
@fge What's the point? I mean, if a <= b, than surely a > b is false
(I'm guessing it makes more sense for more complex cases?)
Moreover, you don't know if a < b or a == b will pass
Because it can be either
 
@ItachiUchiha of course it doesn't work on mobile
 
fge
@SecondRikudo the point is to make sure that the test "coverage" is good (and by "coverage" here, it is meant logical coverage, not source code coverage)
 
9:35 AM
Google sucks at developing anything on mobile properly :P
 
@Unihedro It does, but it sucks.
 
Even their gmail app doesn't poll from the web mail interface properly, I get errors sometimes
 
@fge Apologies, but I will not be able to join any hangout unless I am home. I cannot install the plugin on my current system, and hangout on mobile sucks.
 
@fge Hmm, I see github.com/saltlab/mutandis but this seems rather abandoned
 
@ItachiUchiha you don't need a plugin if you have chrome iirc
 
fge
9:37 AM
@SecondRikudo yes, precisely; now, you write tests, you are confident that "OK, this is checked"; the most common way to make sure of it is code coverage, however this only tells whether a given piece of code has been hit; it will not tell you what would happen should the code change
 
@FlorianMargaine and what is that?
 
fge
And mutation testing allows you to test that
 
@ItachiUchiha Do you not know what Chrome is?
 
fge
@ItachiUchiha grrr... I guess a "text explanation" is in order then
 
@Unihedro Nope, enlighten me :P
 
9:38 AM
@ItachiUchiha did you live in a basement for the last 10 years?
 
^^^^^^^
 
In Java is still used synchronized?
 
fge
@Tinwor what do you mean?
 
Is that even English?
 
Chrome^ ;D
 
9:40 AM
@fge So mutation testing is to find areas where it may be risky to change due to test not failing correctly?
 
That's very chromium :p
 
fge
OK, so, throwing-lambdas; I'm not sure whether I should make a hangout about this anymore
 
More chrome:
;P
 
Pretty colors!
 
It's monochrome ;D
 
fge
9:41 AM
@SecondRikudo that would be one way of viewing it, although there's something more to it that I can't exactly put my finger on at the moment
 
@FlorianMargaine I thought you were talking about "chrome iirc" and not google chrome :P. Nope, but I can't use chrome because this Mac has Safari and Firefox. Installing Chrome will again need so called "admin rights"
 
Monochrome picture:
 
@ItachiUchiha "iirc" = "if I recall correctly"
 
Ok I'll lay off my bad humour now :P
 
It's my favourite shade of cyan.
 
9:42 AM
@fge Like I always ask. What problem does mutation testing solve?
 
No, but really. :p
 
@Unihedro Me too
 
fge
@SecondRikudo it solves problems which code coverage does not
 
@fge What problems? :D
 
fge
Logic errors for instance
Let's take the numeric test we did above
 
@FlorianMargaine It struck me after reading your second comment about basement :P
 
fge
Now, your tests may have been written so that even if the operator changes, the written tests still pass
In which case you have a problem
Case in point: the famous "off by one" problems
You just forgot to test for that particular fringe value which would cause your method to fail miserably
Code coverage won't tell you that
Mutation testing will
 
fge
I suggest you read pitest.org
 
Well, the idea of a good test is to prove that a method works well for all cases
@fge I will, thanks
 
fge
9:46 AM
It has clear cut examples of the problems
 
For instance, you can often prove that if it works for 1 and it works for n+1 than it works for every single number.
(induction)
 
fge
@SecondRikudo precisely; but you may, I don't know, overlook something on a day when you're not in tip top shape or other :p
And of course this is not limited to purely numerical tests
And yes, some mutators may look obvious, but then TDD also states the obvious most of the time
That doesn't make TDD less useful, right?
 
about JavaFx, whats its main edge over Swing??
 
@fge it's an interesting concept, I'll give you that.
 
@LeeJeong none, use swing
 
fge
9:49 AM
@LeeJeong FXML
 
why?
 
I don't think that we have a library to do that in JS, but I know it's possible to make
(You can, literally, change the function text in JavaScript, in runtime :D)
 
@LeeJeong Read this stackoverflow.com/questions/23712382/… it will throw some insight :)
 
@SecondRikudo the idea of TDD is not to assert it matches all cases... It is to assert it works for all known/supported cases.
 
@fge whats the advantage using FXML (btw i dont have any idea what is that)
 
fge
9:50 AM
@LeeJeong don't listen to @Unihedro on that one, he's way too opinionated :p
 
True that.
 
fge
@LeeJeong declarative GUIs
 
@FlorianMargaine Right
But you can more often than not prove that a test works for all cases, even if you only test for one or two
 
@ItachiUchiha thanks dude... @fge does that make my life any easier
 
Although yes, you're fundamentally right, you TDD against the cases you know.
 
fge
9:51 AM
@LeeJeong well, imho it does; I'd rather declare all my widgets in an FXML file, plus configuring them, rather than do it in code
 
"Support" is better IMHO. You might not test a known but not supported case voluntarily
 
fge
Well, anyway; I don't use code coverage at all, but I use pitest extensively
And it has helped me spot some corner cases I was not even aware about
 
@fge do you often use the autogen daos from jooq?
 
fge
@LeeJeong too often to my liking; I wish jooq had a better API for building your own schemas programmatically
It's doable but it's, uh, rather "hackish" imho
 
well there is this .store feature of JOOQ... im not really sure how does it work...
because in my understanding if a pojo doesnt have an id associated with it, then it should insert right? otherwise update?
Im seeing that there are lots of ways to execute RDMBS capability in jooq? (ObjectRecords, ObjectDAOS?) correct?
 

« first day (1593 days earlier)      last day (3340 days later) »