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

fge
10:02 AM
OK, hold on
As to inserting new objects, jooq is aware of generated sequences in the database, and can use them when you insert new records
Of course, you also have the ability to generate identifiers yourself
This is an area I haven't fully explored yet; however I do know that using database generated sequences can have surprising side effects
 
what are "Sequences" you are talking about? ihni
 
Is there a way to read a s3m file in Java?
 
no
(stupid question, stupid answer)
 
Hmm, I need a standalone player then.
Never mind, found it. :p
 
fge
@LeeJeong a database has the means to provide suppliers of unique identifiers with the guarantee that when you get a value from a sequence, it will never be the same as the value requested by another process
 
10:15 AM
@fge ahh.. my question was just that, using a RecordObject you can do CRUD, but you can also do CRUD in ObjectDAOs generated by JOOQ.. what do you prefer to use on your CRUD operations?
@fge i for one would never mess with those generated sequences... :P
 
@Unihedro that's helpful.. sarcasmuser4631575 32 secs ago
^ "not constructive" flags appreciated :p
 
fge
@LeeJeong sorry, I can't give you a clear answer on that; I still have to explore all the options myself (@Gemtastic's project will help me there, provided jooq will be used for it, of course)
 
I was thinking we'd use Hibernate
 
@fge when did gemtastic started it?
 
But we could use Jooq too
 
10:21 AM
i can always see hibernate spring everywhere and every job ads... but fellow developers it was bat shit hard thing you need to specialize on? is this true?
 
Hello!
 
i dont think JOOQ is attractive skill to jobs for now... but its an awesome opportunity suggested by @fge. just pure awesomeness
 
fge
@Gemtastic argh :(
Please no :(
 
ahaha.. @fge im feeling you had a rought time with hibernate before
 
fge
Indeed
Hibernate makes you suffer from what I call "developer sclerosis"
 
10:26 AM
s/suffer(.*)/suffer//
 
explain please...
 
fge
By using it, or Spring as well, you become unable to steer away from The (Spring|Hibernate) Way(tm) of doing things and fail to see how this could be done in alternate, and sometimes much better, ways
 
@fge how do you print created queries from DSL dude?
 
fge
To take the Hibernate example, Hibernate requires that you map your tables to POJOs
Why?
Sometimes you don't need it; even worse, sometimes you don't WANT it
What is more, defining many to many relations is an outright nightmare whereas SQL makes it easy
So, why not use a library which makes that seamless? And that library is JooQ
 
thats what my fellow dev said about hibernate
 
fge
It's the same story with build processes and maven; developer sclerosis
And this is why I use gradle and not maven
(anyone having had to deal with maven's release plugin will understand what I say here)
 
@fge dude, i am sure you can print the queries in jooq right?
 
@fge The reason to use hibernate is because it's a common tool and the teachers wanted us to use it.
But if you rather use jooq, then we'll do that
 
@Gemtastic yeah, all comapnies here are looking for Hibernate/Sprining experienced individuals... but I think JOOQ would beat them all up easy.. its just so awesome man. No steep learning curve and shits
 
@LeeJeong Yes?
 
10:35 AM
@LeeJeong What? xD
 
fge
@Gemtastic then what? Teachers don't know everything, right? ;)
@LeeJeong yes you can; most steps in JooQ have .toString() printing the generated SQL
 
The thing is; Recognizing that a tool is in all ways superior or otherwise favourable is one thing, but I have to think tactical and conform to what's requested on the market. And that's Hibernate. Noone's saying I can't learn both, but since my education requires it, I should focus on the thing that's requested on the market first and foremost.
 
@Unihedro i dont personally have experience with them, but developers around me dont wanna mess around with it, they just have one dedicated men setting it up for them just to use
 
fge
@Gemtastic that's, imho, the wrong way of doing things; but then againt that's your call
 
I think it might be better if we use Jooq here though because that makes it different from the thing I will turn in.
 
10:37 AM
@LeeJeong What does "developers around me" have to do with "all companies" (assuming inference)?
 
@fge It's not my call, it's the school's directives from the national board of education
 
education boards usually suck
 
fge
Well then just present them with an alternative :p I can fully support you there
 
I haven't double-checked if hibernate is mentioned as a requirement of the course, but if it is, I can fail the course solely on the fact that I didn't use Hibernate
 
fge
By writing a presentation document etc
 
10:38 AM
most companies, pardon me... wants hibernate/spring...
devs around me thinks hibernate is scary
 
fge
I'm good at documentation
 
@fge s/every/any/
 
fge
@Unihedro no, sorry, that's wrong
Rémy Card is a teacher and he did ext2
He does know stuff
 
:O
 
fge
@Gemtastic I'll just write some text on a pastebin which you can use in your project presentation; hold on
 
@Gemtastic IMHO, most educational boards probably recommend a JDBC instead of a full-fledged hibernate, because the latter is too much for someone to take in
 
@ItachiUchiha nope
 
@ItachiUchiha Well, there's two boards of education; one that's the national one and one that's the school's board of education. The national decides how the career schools are supposed to work to gain the money (free educations are paid by the government) and Career schools HAVE to teach us what's out there on the market and what they are demanding on the market.
The demands are mainly for ensuring that the students are employed ASAP after the education. It's more important in other professions, but it applies to ALL career schools, including the IT ones.
 
fge
(this is a draft; it needs refinement of courseà
 
^ i liked it.
 
10:54 AM
@fge Noone's arguing that Jooq isn't a better tool though
 
fge
Well, sure, but then enlighten your teachers :p
 
It's completely effecltess
A) The course requirements are decided upon before the course even starts and B) the teachers have no say in what to teach
And C) it doesn't change the market to convince those herpaderps :P
 
anyone with any experience of crystal reports here?
 
fge
@Gemtastic it's a start ;)
<-- just has been approved as a code mentor on codementor.io
 
11:07 AM
@fge \o/
 
How much do you get paid for being a code mentor?
 
@Unihedro However much you charge
 
fge
Yeah, and really, I don't know how much should be charged; I put a fare without even having a mechanism to collect the money :p
 
anyone with any experience of crystal reports here?
 
@fge Start with $10~$15 / 15min
Get some clients, work your way up
 
fge
11:10 AM
Well, I still don't have a client ;)
 
@fge congrats
 
fge
Well, in the meanwhile I have heavily bountied yet another question
 
@fge Yaay for you! :D
 
fge
0
Q: Creating a custom code analysis rule for a custom grammar, and test it: howto?

fgeBased on the minimal C parser example, and using the following dependencies: compile(group: "org.codehaus.sonar.sslr", name: "sslr", version: "1.20"); compile(group: "org.codehaus.sonar.sslr", name: "sslr-testing-harness", version: "1.20"); compile(group: "org.codehaus.sonar.sslr", name: "ss...

 
@fge Well, what more am I supposed to populate it with? :P
Also I got approved as a code mentor :O
 
11:12 AM
@Gemtastic \o/
Same advice, start small, $10~$15 / 15 mins, get some clients, work your way up
 
fge
@Gemtastic many things; for one, a reference to the original document; then your analysis of it, that is, what functional units, and by functional units I mean what "screens" should be there, what they should allow etc. Also the fundamental architectural choices, etc
 
@Gemtastic congrats.. i want a free session :D
 
Do your homework before approaching a request
 
@SecondRikudo That's my plan :P
@fge Ah, Now I got a better idea of what I'm supposed to do
 
@SecondRikudo How much is your pricing on code mentoring for codementor.io?
 
11:18 AM
@Unihedro Still $15, but I haven't been active in quite a while
 
hmm ok
 
@SecondRikudo can you chain the requests?
i.e. do 4 sessions/hour?
 
It doesn't seem like something I'll get into, but it looks like an interesting system
 
@FlorianMargaine You schedule the requests however you (and your mentee) like
Sessions often take a lot more than 15 minutes though.
 
11:19 AM
holy wow, how do you become one? :P
 
I'm kinda surprised that I got accepted
 
You have to apply. And get approved. It's just a simple user audit though.
I think their user audit system is simpler than Sendgrid's, but I'm not sure.
 
I heard that codementor.io charges the mentors one-third of what they charge for every session..
 
@fge I wasn't kidding about you needing a better mic though
 
^^^
@Sword At least you still earn something.
 
fge
11:20 AM
I have actually received a mail from one of the codementors.io guys: "you selected to inject SO answers, but you have a s*load of accepted answers with a score of 3 or more, what should we do"
@SecondRikudo I am fully aware of it
 
I coherently understand about 50~60% of the words you say, and complete the rest from context. It's effective for me, but won't be for noobs you're helping there :P
 
fge
I may well order a Sennheiser PC 360 via amazon, meh
 
@fge I can testify for its awesomeness.
 
You'd laugh if you know which mic I use. xD
 
fge
I can too; the sound is crystal clear
 
11:21 AM
It's one of the very few headsets I've ever tried that I can put on my head for all day long, and not get uncomfortable.
 
@fge please do that ASAP
 
BRB
 
fge
Hey, hey
 
thanks pips~
 
It's the best purchase I've made in the past few years.
 
fge
11:23 AM
OK, OK, I get it!
 
I used a Logistics mic I bought with ten bucks six years ago, it actually just died a year ago. :p
 
Hello to all
 
fge
OK, there, ordered
Gee
 
a star for you
everyone should know that
 
fge
11:28 AM
Eh?
This is not worth a star
 
well it is.. Atleast worth for me :)
 
manual override
star gone :D
 
:@
 
Huh?
I don't get it.
 
Russian names
 
11:32 AM
k
@TimPost Welcome aboard.
 
I gotta go, bbl
 
seeya o/
 
user50049
Hello boys and girls! I'm uncle Chimpy pants, and I've come here today to talk about some important things!
 
fge
Unclewhat?
 
user50049
Today, we're going to talk about the word creepy, and how it relates to people's behavior in chat. Everyone excited? Here we go!!!
 
11:43 AM
grabs creepypasta popcorn
Is this related to my rant in the whining room? If so, I apologize in advance.
 
user50049
If you're (1) doing something that is making people feel generally uncomfortable which is (2) making them not want to use our fine products like chat as much as they once did and (3) you've previously been asked to stop, there's a good chance you're being Mr. Creepypants! Now, boys and girls, what do we do when we see Mr. Creepypants, put your hand up if you know!!!
 
fge
fails to see the point of that discussion entirely
 
listens patiently
 
user50049
You let us know, because we've been getting emails about it. Just a general warning, don't be creepy, and don't do passive-aggressive things that make folks feel uncomfortable here.
 
user50049
Because chat is a privilege that can be taken away entirely :) Not singling anyone out in particular.
 
11:51 AM
There's a potential conflict between 3) and an email to maintainers
(but not an inevitable one)
 
How would you effectively test for "function throws on wrong number of arguments" in Java?
 
@SecondRikudo varargs?
 
@Unihedro Yeah
(Or an array of strings)
 
um with mockito functionName(any(Type.class), any(Type.class), any(Type.class)...) all the way
 
@Unihedro That's not what I'm asking
 
11:56 AM
wrap in try and assert a correct exception in catch by verify, otherwise fail
 
@Sword "СЯЦЧТЙЫЕФЯЛН" It doesn't make any sense in Russian
 
I have a function that takes a vararg. It will throw if it receives anything except 3 or 4 arguments
How can I effectively test for that?
 
What testing framework? In JUnit a test can be annotated for an expected exception
 
I could just pass 5 arguments, but then I have no guarantee that passing 6 arguments would throw.
 
@Sword nevermind >_<
 
11:58 AM
Eh, you could invoke the method with 1, 2, 5, 6 and up to 10 arguments with an array in a loop, I guess.
 
fge
@SecondRikudo there's not really a way to do that except, maybe, with TestNG, using data providers
The problem is that you are dealing with arrays and you can't mock an array's .length
 
@fge @Ita @Sword since no one really joins for the weekend hangouts, should we just cancel the schedule? :p
 
fge
@Unihedro I believe so, yes
 
Unihedro has removed an event from this room's schedule.
 
@uni yeah, I guess we should
 
fge
11:59 AM
Anyway, such hangouts cannot be really scheduled to start with
 
I think java has max 255 parameters to a function. Easier to test exhaustively than infinite
 
fge
@kiheru that is correct, however varargs "blurs" the frontier somewhat
(since all arguments of a varag are "collected" into an array)
 
ah, true. different calling convention :-/
 
According to "Code Complete (2nd edition) by Steve McConnell", you shouldn't pass more than 7 parameters to a method anyway.
 
Writing a method that needs 255 parameters would certainly take special kind of insanity
 
12:04 PM
puts away creepypasta popcorn
 
12:14 PM
@Unihedro my internet was down since the past 2 days. and as far as the weekends are concerned , the scheduled time clashes with my prayers+gym timing.. :(
@OlegKuznetsov nevermind??
 
@Sword :/
 
was that really a name??
 
I had uploaded a gif in the python chatroom and the members got crazy there..
 
gg
 
12:23 PM
want to see which one?
hope u guys don't get angry.. :)
 
@Sword no
 
ok
 
it is raining gifs here..
 
@fge Is it possible to write my own error message for a failed assertion in Assertj?
"expected <true> to be equal <false>" is not a helpful error message.
 
fge
12:31 PM
@SecondRikudo yes it is, although the method name to do so is a mouthfull
assertThat(xxxx).overridingErrorMessage(whatever, here).etc().etc()
 
@fge Please tell me it's not if (boolean) { fail("My error message") }
@fge Doesn't work
I tried
assertThat(true).isFalse().overridingErrorMessage("Poo!");
 
fge
No, this has to be before the assertions
assertThat(...).overridingErrorMessage(...).isWhatever()
 
@fge Aha
lol, order of execution
GOD that's ugly
 
fge
More precisely, limit of type inference in this case
 
Assert that true BUT FIRST OVERRIDE THE ERROR MESSAGE is false.
 
12:35 PM
@Sword meh... go to thrills and spills once...
 
@Vogel612 chatroom??
 
fge
@SecondRikudo yeah, sorry, this is Java and the compiler is very, very dumb, and to not help matters the language syntax is very, very strict :p
 
ya
 
@fge I will, slowly but surely, make you admit that Java sucks.
Just you wait.
 

 Thrills and Spills

Enough twirling to make your head spin! Enough gifs to make yo...
 
12:37 PM
Warning! Joining that room will stress test your RAM ^
 
@Vogel612 :O
 
darnit... got a NPE somewhere inside the company-own DIY Struts routing framework
 
fge
@SecondRikudo unlikely ;)
 
8gb i have..lets see
 
@Sword I got 12...
well on this company PC that is..
 
@SecondRikudo lol still funny to see it again :D
 
> C# is a powerful laser rifle strapped to a donkey, when taken off the donkey the laser doesn’t seem to work as well.
This is accurate on so many levels.
 
12:51 PM
Hi all,String txt_box = request.getParameter("ref");
Here i retrieve the textbox value of previous page named "ref" and i stored it in a string. I printed the value of txt_box and it was empty .
And i written the following code in which the control should not enter into loop but it enter the loop and prints the "hello" what's wrong in this
if(txt_box != null || !txt_box.equals("")){
System.out.println("hello");
}
any suggestions pls
 
txt_box contains an empty string
 
this is the gif i was talking about..
 
everything's fine
 
Is it possible to pass a ExceptionObject.class to a catch clause as the type of exception?
 
??
you mean... catch (ExceptionObject ex){??
 
1:06 PM
@Vogel612 Yes since i havent passed any value in previous page its empty only i tested it
 
@SecondRikudo The catch clause must be a type. Class instances are no substitute.
 
well "".equals("") returns true, right @Mano?
@ItachiUchiha why remove that?
@Unihedro did you get to doing some JCE work?
 
@Vogel612 right if its empty i want to skip the loop
 
I did not.. my phone is acting weird lately
 
@Vogel612 yep
 
1:09 PM
Catch block expects Throwable, not Class<?>
 
oh waaait..
 
I should close the other chat room full of gif
 
are you sure it's not something like... " "
 
It is killing my celfone
 
@Vogel612 i cant get you
 
1:11 PM
I'm kinda preoccupied... but...
" ".equals("") -> false...
and !false -> true
but System.out.println(" "); is "empty"
 
if i passed any value for txt_box in previous page it should enter the loop otherwise it should not enter the loop this is the condition if(txt_box != null || !txt_box.equals("")){
System.out.println("hello");
}
In my scenario i havent passed any values for txt_box so i want that to skip that if loop and want to continue with the following lines of program
 
@Sword No >_< [and if it would, it would be more like Polish, than Russian :P]
 
fge
@Vogel612 where's the contradiction?
 
the contradiction is the assertion that !txt_box.equals("") is expected to return false
 
fge
@SecondRikudo if you're around I have a question for you
@Vogel612 I was not asking about this point but the fact that .println("") is "empty"
It depends entirely on the PrintStream implementation
 
1:27 PM
meh... it's mostly about "to the visible eye" ...
 
fge
Anyway, if you want to test whether a string is empty, well, String has .isEmpty()
(and yeah, this only appeard in Java 6, go figure)
 
@fge Which is essentially "".equals(this)
 
@fge Sure
 
fge
@Unihedro or not; no guarantees
@SecondRikudo how do you deal with, well, HTTP requests in MVC? Before you send back the result of the request, you have to populate it; so which entity is responsible for what, and how do you make the client wait?
 
@fge What do you mean?
 
fge
1:38 PM
(MVP is no stranger to this problem either)
 
I'm assuming you're not referring to HTTP requests that come from the user in this case.
 
fge
In fact I do
 
Where's the problem?
 
fge
The problem is that there is a delay before the result of the request is available
(because the data needs to come from somewhere after all)
 
@fge A delay for whom?
 
fge
1:39 PM
For the server to be able to send the data back to the client
It has to obtain that data first
 
Well, wouldn't the servlet container listen to requests and invoke the other parts of the system?
 
fge
Yes
 
Well, the servlet container constructs some sort of Request object
Then it somehow invokes the correct controller with the same Request object when a request is made.
By somehow I mean it could be using Annotations like Spring does it, or maybe create some sort of Router object that accepts a request and spits out a ControllerAction
 
fge
OK, let's take a concrete example
Spark
 
fge
1:42 PM
Let us take the case of a request which asks for a List<Something> which takes a non negligible amount of time to collect
 
fge
Now, if you remind, a callback has both a Request and a Response; the Request contains basically the contents of the HTTP request and the response will hold the contents in whatever form is suitable; let us not be concerned about that suitable form
The fact of the matter is that the response needs to be populated; and this takes time
 
Well, there's a timeout associated with HTTP requests, the browser won't wait for you to respond forever.
If you know that the request is a heavy operation, you're expected to respond with 202 Accepted to indicate that the request was submitted successfully, but processing is not yet done.
 
fge
Yes, this I also know and let us also take this out of the picture
In the MVC model, what part takes care of what?
 
@fge The View
Well, if the processing time will likely exceed the timeout, you're expected to do your work in the background, and respond immediately with 202
It's worth noting that 202 is often in response to POST or PUT requests
Where server state is expected to change
If assembling a list for the client is what takes a long time, you can respond with a ticket number to view the status of the request.
Who handles what doesn't change.
The controller handles the incoming request and invokes the model
The model does the processing and keeps track of the long process involved
And the view will query the model when the user requests the status of the process.
try {
    getProperty.parse(new String[]{"", ""});
    fail("GetProperty.parse should have thrown but didn't.");
}
catch (RuntimeException e) {
    assertThat(e.getMessage()).contains("Invalid number of arguments");
}
try {
    getProperty.parse(new String[]{"", "", "", "", ""});
    fail("GetProperty.parse should have thrown but didn't.");
}
catch (RuntimeException e) {
    assertThat(e.getMessage()).contains("Invalid number of arguments");
}
There has to be a better way for doing this ^
 
fge
2:08 PM
@SecondRikudo short of writing your own utility method, no, that's pretty much how it's done
Also, why do you create a new String[] each time? Why not just .parse("", "", "", "") if your method is a vararg method?
Oh, err wait
Are you using TestNG?
 
@fge JUnit
 
fge
Ah :/
 
Part of the stack unfortunately.
 
fge
If TestNG I'd have suggested that you used a @DataProvider, but with JUnit it's a royal PITA to do
Still, you can write a utility test method if you feel like it; it may be worth it if this code is repeated along many tests
For instance something like this: IntStream.range(0, someUpperLimit).filter(i -> i != expectedArgs).map(i -> new String[i]).forEach(array -> try { consumer.accept(array); fail(...); } catch (Foo e) { assertsHere(); })
(meh, that's some code golf)
 
fge
2:30 PM
@SecondRikudo in fact I have such a utility method implemented for throwing-lambdas
More than one in fact; otherwise it'd be pretty bothersome to test all 39 interfaces
 
2:40 PM
Hmmm
I have a different problem
 
fge
Shoot
 
I want to make my mock return an object
 
fge
Well, that's not really a problem in itself
 
But the object (or rather, class) in question has static stuff the prevent it from being instantiated normally.
 
fge
What "static stuff"? Constants? Static methods?
 
2:42 PM
I'm... not entirely sure...
It threw an SQL exception when I tried to create it at first
 
Oh, static initializer?
 
Hold on
 
omfg....
my tomcat blows up with 500 errors...
and the logs are empty
wut?
even catalina.out is empty...
 
fge
@SecondRikudo err... Code... here... would be useful :p
@ItachiUchiha still at work, I wager?
 
java.sql.SQLException: Configuration file not found
 
2:52 PM
wut??
 
It statically initializes stuff based on an annotation -_-
 
@fge dude, why cant I access the static Tables generated by JOOQ? its weird. In this snippet, it does accept and i can access the static generated tables:
 String userName = "root";
        String password = "pass";
        String url = "jdbc:mysql://localhost:3306/library";


        // Connection is the only JDBC resource that we need
        // PreparedStatement and ResultSet are handled by jOOQ, internally
        try (Connection conn = DriverManager.getConnection(url, userName, password)) {
        	DSLContext create = DSL.using(conn, SQLDialect.MYSQL);

        	Configuration configuration = new DefaultConfiguration().set(conn).set(SQLDialect.MYSQL);
but in another method on another class, it fails to see the static tables such as this:
public static void main(String[] args) {

		String userName = "root";
		String password = "pass";
		String url = "jdbc:mysql://localhost:3306/library";

		Connection conn = null;


		try {
			conn = DriverManager.getConnection(url, userName, password);

		} catch (SQLException e) {
			e.printStackTrace();
		}

		DSLContext create = DSL.using(conn, SQLDialect.MYSQL);
		List<ProductType> productTypes = create.selectFrom(PRODUCT_TYPE)



	}
 
I'm back!
 
Welcome back!
 
Ty ty
 
fge
3:06 PM
@LeeJeong what do you mean by "can't access"?
 
@fge just found about this way of importing
 
fge
@SecondRikudo can't you make that POJO implement an interface which you can mock at will or something?
 
import static jooq.auto.generated.Tables.*;
 
fge
(sorry, I'm pretty busy with throwing-lambdas so I don't have much time for the chat atm)
 
@fge its ok dude, im quite figuring it out.. :)
 
3:28 PM
@fge Showed it to my more knowledgable coworker
We'd probably refactor this whole messfest
 
fge
OK
If you want my view on it, just tell me... I know the last hangout we had on it was not a frank success :p
But now that you use Java 8...
 
Yeah
I'm amazed at the amount of bad practice this one little class has
 
@fge dude, do you know a way to automatically add custom methods to auto-generated pojos of jooq?
 
fge
No, sorry
 
@fge Auto generated pojos?
You realize how horrible that sounds, right?
 
fge
3:40 PM
@SecondRikudo quite a few packages out there generate Java source files; and yeah, I don't really like the sound of it either
 
@SecondRikudo please enlighten me sir
 
fge
The prime example is parser generators, but then this is why I have grappa
 
!!help yodawg
 
@SecondRikudo Command yodawg does not exist.
 
fge
(it allows you to write parsers in pure java, unlike antlr and javacc which require source code generation)
 
3:41 PM
hmm
 
wtf.. Caprica Six is a bot?
!!help yodawg
 
fge
Anyway; in quite a few cases as well this is a fundamental requirement of the build process and I try and avoid that at all costs
 
just testing.. xD
 
@LeeJeong Command yodawg does not exist.
 
!!inur code
 
3:42 PM
@SecondRikudo yo dawg i herd u lik code so i put sum code in ur code so u can code while u code
 
fge
Uh, and in English?
Argh, I just thought of another design for throwing-lambdas
 

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