« first day (1629 days earlier)      last day (3299 days later) » 

12:07 AM
I am having a difficult time with this... wouldn't objects still get associated with the first session that saves them then error out when another one tries to save?
 
It's 2 seperate save operations
You have saves. Which copy do you want your application to work with?
Pick one.
@Dave
@DaveC
 
Sorry I'm trying to think here
 
Remember, once the first save is complete, that session is over
so there error is gone because there simply IS NO OTHER SESSION
 
maybe we are utilizing hibernate incorrectly... I'm not sure
 
Are you using spring?
 
12:14 AM
yes
 
Are you wiring up your hibernate session from application.xml?
 
yeah, a session factory
via spring
 
Literally, C&P (for now, for simplicity) the config and give it a different bean name
now you have like:
 
so I have two session factories,.. one for each data base
 
<bean id="db1" class="RealDao">
YES
Then you use the composite to tie them together
The code currently using the the Dao will wire up with no work
 
12:17 AM
so... I am 95% there but I have a composite class that implements session
 
if you nest those sessions inside the composite
NO!
Composite does not
nor should it
You have 2 session
Dao is just that: dao -- session is a concept for hibernate
nothing implicit in a dao re: session
 
thats why I think my pattern is wrong because throughout the app our daos store a referencee to a session and saveOrUpdate is called directly on that session object instead of a save in the dao itself
so like dao.getSession().saveOrUpdate()
 
That code would go in RealDao
 
thats what i thought
 
where each session is configured to talk to a diff db
so composite would be like:
 
12:19 AM
so... without refactoring the entire application...
 
new CompositeDao(new RealDao(db1),new RealDao(db2));
Yup.
You wonm't have to TOUCH any code
The current code @Autowire
to Dao?
So, app context is like:
<bean "mainDao" class="CompositeDao>
<constructor-arg>
<util:set>
Or, actually...
<bean class="ReadlDao">
forget the set part
rinse and repeat this for each DB config you need. Just make sure to nest the individual DB config in the composite bean declaration so they are not in Autowire scope
<bean class="ReadlDao">
You're original code using the dao will never know. Welcome to OOP and dependency injection
 
ok, I'm trying to catch up here haha, give me second to ingest this
ok I think that this will work
yeah that is great... thanks a lot for the help
 
Make sure to give me a Check mark for answering it :)
@DaveC
 
 
2 hours later…
2:33 AM
gd morning
 
2:45 AM
o /
 
2:58 AM
gud Morning..
 
@Ago Leaving Group every other container is re-sizable on its own.
 
3:14 AM
Good morning
 
3:26 AM
@fge i got that point.... thanx for your reply..... regarding this > chat.stackoverflow.com/transcript/message/22555788#22555788
 
fge
4:19 AM
Moo
 
@fge early today?
 
5:11 AM
morning
 
fge
5:29 AM
Yup
I have slides to finish
And I have zero inspiration
 
owww
the room is dead silent
 
5:51 AM
ohh no
 
Morning!
 
cos everyone is still sleepy. It's morning!
 
May be, or may be everyone is busy working
 
fge
@ItachiUchiha but on the other hand it's a good mental exercise; you don't do only what you please in life
 
jon skeet's canon C# 2014 session is nice... i watched it yesterday
fact that i highlighted was "If u are 30 and haven't still built up your own framework, what's the point of all of these?"
 
5:55 AM
wow
 
morning all
 
there you go... one person got waked up... Good Morning!!! @Juce :D
 
fge
"woken", not "waked"
 
Morning
 
@JudeNiroshan i didn't just woke up ^^ just started @ work
 
6:11 AM
@juce do you work in javafx at work?
 
i imported the war file in eclipse, the project works fine but i didn't find the java source files under JAVA RESOURCES of eclipse
 
@greenhorn refresh and restarted the eclipse?
 
Lolz
The source could only be found if the src was packaged while creating the war.
Most of the time they are not..
 
@ItachiUchiha how to pack the src
 
When you export it with eclipse you can tick the src folder
 
6:24 AM
i want to load the project in eclipse which i already created on Netbeans, i imported the war file of it in eclipse in that only i didn't find java classes
 
I see. Does it use a build tool?
 
Good morning, Java!
 
I am not the right person to ask about netbeans. May be @gem or @oleg could help
I guess they both have worked on netbeans
 
fine @ItachiUchiha
 
@ItachiUchiha sorry was afk ^^ yes but i'm the only one
 
6:29 AM
@juce javafx is fun, ain't it? ;)
 
@greenhorn i am not much familiar with netbeans, but when i import a project to netbeans, those class files didn't come. So, i have imported the packages indivually. You can simply import package to netbeans from eclipse
 
NetBeans is awesome :3
 
@oleg may be you can help @greenhorn
 
yeah thanks i found it, i should manualy copy and paste the src from netbeans to eclipse
 
@greenhorn *.war? Why not Ant or Maven *.xml configs (not sure about gradle's interoperability and support)?
o_O
 
6:32 AM
@ItachiUchiha yes :) at the beginning i thought it is really "hard" to keep the structure. but the more i do with it the more more i like it and the organisation :)
 
@greenhorn that is how normal people do it, not programmers :-P
 
configuring an open souce always needs quite more works
 
@ItachiUchiha but i still have some lacks at some basic topics :P like the "constructor"
 
@juce feel free to ask
 
@ItachiUchiha if didn't find the way within time means i should behave like non coders only
 
@ItachiUchiha hehe yeah i will. you answered the question once on SO but I couldn't try around until now. the last project was still a success and in my next i will try to do it with a factory (problem of "dont having a constructor" ^^ i used setter to pass arguments)
 
@Unihedro I had that question on the interview... Hm...
 
@OlegKuznetsov Then your company must have a low skill barrier.
 
@Unihedro i just can't find words .. just LOL xD
 
@Unihedro what?
 
6:38 AM
:P
No but seriously, it's documented what finally does, it shouldn't be new to you.
 
Anybody already worked with spring-boot with angularJS as frontend and serenity for frontned testing?
 
... or anyone who has done Java for more than a month.
 
Is it that worse in here?
 
@AlexanderKiefer ... What does that have to do with Java?
 
well spring-boot is a java framework...
 
6:42 AM
need to like some replies !
 
@Unihedro maybe he's really that new ^^ but still then he could find that out
 
@AlexanderKiefer Eh, I knew that, just not sure how that mixes with AngularJS as a stack.
 
@Unihedro And?.. It was just one of the questions, since they don't send any small task. Your reaction is really weird
 
@OlegKuznetsov I've always disliked interview questions which doesn't make you write code.
Also, the question is now dead. How it has gotten five upvotes was a mystery.
 
well my question itself does not really depends on the angular frontend, it's more a question about running serenity tests from within the spring boot application with the application started up
 
6:45 AM
coolio
 
0
Q: Spring Boot BDD Testing with serenity

Alexander Kieferwe have a spring boot application which we want to test via serenity (former Thucydides). Theoretically the tests can be run (if i test for example www.google.com everything works fine) but I want to test my own application and not google ;) So I need to start the application before running the ...

thats my question
 
fge
<-- doesn't even know what Serenity is, and avoids Spring
 
^^ (y)
 
And... cucumber? What's that?
 
6:48 AM
long live Java!
 
@Stallion Wheeee!
 
WOW IT LOOKS LIKE iT'S COPIED FROM WIKIPEDIA
Someone's going to get an edit ban.
... probably.
 
@Unihedro SO uses the same license, so who cares?
 
@OlegKuznetsov That's not how licenses work.
 
Mostly, it is. Except that it has to have attribution
 
6:53 AM
The copied material is now reverted.
^ I want to play this song, it's too hard :[
 
7:10 AM
@Unihedro what have you done <_< now i wanna play this and im at work ^^ btw can you "nearly" do this song?
 
"Nearly"? :p
 
i googled it's the correct word that i wanted xD
 
Well, it clearly isn't meant for one, so I could break up three times with a playback, but the purple and yellow tune are the hardest.
 
Morning
 
7:32 AM
@Vogel612 Morning!
 
8:19 AM
Morning
 
Morning
 
@Unihedro This is really too hard
Is it possible to play with two hands only?
 
8:53 AM
Who all can view deleted answers on SO?
 
moderators and 20k users
also: original poster of answer, if they still have the link
 
9:13 AM
and when does it get deleted for good?
 
never
 
I guess it does
 
never - nsa sees everything ^^
 
@ItachiUchiha AFAIK there's only a single post that's actually deleted for good.
and that was someone who pissed off Jeff in the early days
 
how is this badge even possible O.O
 
9:25 AM
loads and loads of answers
and experience, and cleaning up stuff in questions#
 
Ok, so I made a blunder
 
many of these edits are probably tag-edits..
@ItachiUchiha and you need something to be gone 4 good?
 
in 12 hours? that can't be possible without doing some nonsense >_<
 
@Juce sure it is
 
@Vogel612 yes, but now everyone can see it
and I feel bad
 
9:26 AM
@ItachiUchiha contact the team if you can't fix it yourself...
 
@Vogel612 I posted a stupid answer and then deleted it
 
Happens.
now what about it? everybody makes mistakes
 
Then instead of editing it, I posted a more viable answer
Now the post has my sanity and my insanity :P
May be a moderator may delete it :P
 
@Juce look: stuff like one of ita's latest answers counts towards that badge: stackoverflow.com/questions/29532247
 
@Vogel612 but ita hasn't illuminator xd
 
9:32 AM
@Juce well Ita has "only" 376 answers
and the badge is rather new actually...
and he has Unsung Hero.
which is AFAIK the least often awarded gold badge after Epic.
 
Epic is a silver badge ^^
 
s/Epic/Legendary/
k nevermind...
10k unsung heroes
and 184 Legendary
and 24 Illuminator (which is coincidentally the same count as: Sherrif badges)
 
10:03 AM
@Mr.777 i have one "header.jsp" and i am including it into my main "index.jsp". i want to include Header in No. of pages. Hope you get it.
 
Morning peeps
 
morning
 
@Gemtastic I kinda left in a hurry last night
So what did they tell you about your project?
(Did they say anything at all?)
 
nothing
they haven't even responded to if they're gonna look at it, but I send it in on easter so I guess they were busy making things fruitful for ishtar ;P
 
fge
10:23 AM
Hmm, Noether's theorem is interesting
 
@Unihedro bdd-in-action.com I made this website for BDD , Cucumber , TDD etc for the Agile Coach "John Smart" you can find some info about those stuff
 
10:40 AM
Can an interface have an enum associated with it?
interface Foo { ... }
Foo.TYPE_ONE, Foo.TYPE_TWO ...
 
fge
Not an enum, no
Although an enum can implement an interface
So maybe you want to do that instead
 
11:26 AM
@fge What does an enum implementing an interface do?
 
fge
I don't understand your question?
 
Alright, let's back up
 
fge
Enums have no "special" status whatsoever; they are just class instances, and as such they can implement interfaces
 
I have an interface method bake(TYPE type, String publisher, String version)
Where TYPE should be an enum associated with that interface.
 
fge
Associated?
 
11:28 AM
So I want to have something like this
 
fge
And who is going to implement this interface?
 
public String bake(BakerRunner br, ....) {
    return br.bake(BakerRunner.LOADER, ...);
}
Where BakerRunner is an interface
Is that possible?
Or alternatively,
BakerRunner.Types.LOADER
Or something like that
 
fge
Well, why not just have an interface Baker implemented by an enum BakerType? You will then be able to BakerType.LOADER.bake(publisher, version)
 
@fge Because that's not how the application is structured
BakerRunner is a sort of facade to the internals of the baking process
There's BakerRunner, that holds a bunch of Baker objects and a bunch of Uploader objects
I call bakerRunner.bake() and it should be able to, somehow, pick the right Baker and Uploader to use
 
fge
I don't see how that prevents the use of an enum implementing an interface
Especially in your case
Have an interface with two methods, one returning a Baker and another returning an Uploader
And have an enum whose constants implement this interface
 
11:35 AM
The consumer should not be aware of the Baker or the Uploader
 
fge
This way your .bake() method only takes an instance of the interface, which can be an enum value
 
The consumer is only aware of the BakerRunner
 
so tired
time to go, bye bye
 
Mainly because Baker and Uploader may or may not always be there (I may shortcut bake without a full fledged Baker object, or choose not to upload with an Uploader), the consumer doesn't care.
Goodnight uni :)
 
this doesn't really contradict what fge said...
 
11:52 AM
@Vogel612 Can you give an implementation example?
I'm clearly not envisioning what he said
 
BakerRunner#submit(...) {
    if (needToRunBaker) {
        this.getCorrectBaker(..).submit(...);
    }
    if (needToRunUploader) {
        this.getCorrectUploader(..).submit(....);
    }
}
 
@Vogel612 Yes, the problem is with this.getCorrectBaker
Getting the correct baker depends on the file the consumer wants to bake
 
so what#s the problem? that's the job of the BakerRunner to find out, isn't it?
 
@Vogel612 Yes and no. The consumer knows what kind of file it wants to bake
 
so they tell the BakerRunner about it...
I still don't quite get what the problem is...
 
11:59 AM
@Vogel612 Right, by passing an enum to BakerRunner#submit
An enum that represents the file I want to bake
Thus the question, can I, in some way, "associate" (for the lack of a better term) that enum ro the interface?
Or must I create a completely separate enum class, and have an implicit dependency in the interface?
 
use an EnumMap
 
@Vogel612 It's not an implemention problem, it's a contract problem.
How will Consumer tell BakerRunner#submit the type of file I want to bake?
 
parameters ftw?
 
@Vogel612 What kind of parameter? :)
 
you said you already had an enum
 
12:01 PM
@Vogel612 I want to have an enum
 
THEN DO IT!!!!!
 
But I want the only dependency Consumer has to be BakerRunner
I don't want BakerRunner and FileType as dependencies
 
be realistic...
well you could resort to an inner enum, but meh
 
@Vogel612 That's what I'm asking, whether or not it's possible.
 
BakerRunner.FileType
 
12:03 PM
@Vogel612 Can an interface have an inner enum?
 
should be possible...
why does it have to be an interface though??
 
@Vogel612 Why BakerRunner must be an interface?
 
also: y u no just try?
 
Because relying on interfaces is a Good Thing (tm)?
Ah, by the way, @fge I don't think I'll be able to use the Jackson Streaming API unless I'm missing something, could use your input
I'll be combining 3-4 result sets to one JSON object
But they need to be grouped in a particular way in the object, and they aren't grouped as such in the queries
So this means that result #0 can belong in group A, #1 to group B, and #2 to group A again. The groups are under different keys in a nested object
That is
"modes":{"groupA":{...},"groupB":{...},...}
Correct me if I'm wrong, but the streaming API doesn't let me go back to a previous node in the JSON structure and add stuff there should I need it.
If I wanted to use the streaming API, I'd have to alter my queries so that order is guaranteed, right?
 
fge
That is correct; this or save what you need to save before proceeding
 
12:17 PM
Streams aren't for this, probably.
 
fge
Well, that's not incompatible
Turing says so :p
 
Jay
Hi everyone
 
hiya...
 
Jay
is anyone here familiar with Azkaban?
@Vogel612 Hi :-)
 
12:46 PM
Yo
 
heya
 
1:02 PM
@Jay I've been there once. Sucks the life out of you.
But the dementors aren't as bad as people make them to be.
What's the purpose of the provider argument in Jackson's JsonSerializer<?>#serialize()?
 
1:19 PM
@Vogel612 Suppose I need to ask someone to review my project(as a whole) in CR. How do I put my question?
<--- Confessions of a beginner in CR
 
1:40 PM
29
Q: How to get the best value out of Code Review - Asking Questions

rolfl I have a project I am working on, and I would like some, or all of it reviewed, how can I ask for this review on Code Review in a way that produces the best possible value? This is not about a question being on-topic, or off topic. Rather, this is about making on-topic questions great qu...

read it and then read it again and then again until you understood - fge
 

« first day (1629 days earlier)      last day (3299 days later) »