« first day (523 days earlier)      last day (3508 days later) » 

11:00 AM
wait...
Query defensiveSelect = entityManager.createNativeQuery(QUERY_STRING)
                .setParameter("value", checkedValue).setParameter("id", id);

        return !defensiveSelect.getResultList().isEmpty();
 
hmm????????
 
Query defensiveSelect = entityManager.createNativeQuery(QUERY_STRING)
                .setParameter("value", checkedValue).setParameter("id", id);

     boolean foundSomething = !defensiveSelect.getResultList().isEmpty();

    throw new IllegalStateException("test");
//    return foundSomething;
maybe it's throwing some place else
it's not defensiveSelect.getResultList() that makes boom
lunch
 
it's somewhere buried in hibernate...
@Pimgd dito
 
dito?
 
me2 ;)
 
11:21 AM
@Pimgd this one will make the Validation throw a ValidationException...
because nobody expects exceptions from a call to isValid();)
 
I think I understand now
@Vogel612 can you show me the stacktrace for the ValidationException
 
Meh, coffee isn't the best drink once cold.
 
@Pimgd snip or text?
@Morwenn how can you??
<-- does that himself sometimes
 
@Vogel612 just show me the stacktrace
 
11:26 AM
Gotcha
at org.hibernate.engine.spi.ActionQueue.executeActions
262	private void More ...executeActions(List list) throws HibernateException {
263		for ( Object aList : list ) {
264			execute( (Executable) aList );
265		}
266		list.clear();
267		session.getTransactionCoordinator().getJdbcCoordinator().executeBatch();
268	}
the updates list of the ActionQueue is modified by Hibernate when you execute your query
for fun, change the query to SELECT 1 ... WHERE 1=2
So it doesn't do anything with the location objects table
only use it in from
SELECT 1 FROM Location WHERE 1=2
 
@Vogel612 I simply don't want to throw it. I drink it out of habit thinking "that's awful, but maybe I'll come to like it someday".
But everyday it is still horrible.
 
In case it fails with the same ConcurrentModificationException... I don't think you can run queries like this.
In case it doesn't fail, something about the where statement is making it pull the entities into the updates list
 
the earlier
 
I don't think you can run queries like that.
 
it fails with ConcurrentModificationException...
oh dammit...
soo that's.
[status-by-design]?
 
11:33 AM
maybe
Isn't there some @Unique you can use for this?
 
"by design" -> the easy solution to put an end to debates about bad ideas.
 
@Pimgd do you think I would've gone through creating my own validator if there were?
 
I like this documentation:
>
\p{Z} or \p{Separator}: any kind of whitespace or invisible separator.

\p{Zs} or \p{Space_Separator}: a whitespace character that is invisible, but does take up space.
Especially the a whitespace character that is invisible, but does take up space
 
\p{Z} is a superset of \p{Zs}
 
11:35 AM
@Pimgd and how do I show nice and clean error messages to my user, when all I get back is a SQLException?
 
That coffee is so hot I want to drink it.
 
for reference, corresponding SO question:
1
Q: Handling database constraint errors nicely

Vogel612Yet again it was supposed to be simple.... I was tasked with placing a certain field in the domain-objects of our application with a unique constraint. That in itself wasn't much of a challenge. I just did the following: public class Location { // more fields @Column(unique = true) ...

the constraint itself isn't really the problem.... It's more the way it's enforced, that's problematic...
@Morwenn the coffee machine at work had something extra in my coffee this morning...
 
Maybe...
 
@Vogel612 Not sure I want to know what it is.
 
Just maybe, a Open source project from a company I worked at
can help you with what you wanna do
 
11:39 AM
@Morwenn I didn't want to know either.
 
I'd take a good look at alternatives though
 
oh god this looks awesome!
 
@LokiAstari - FYI - an interesting read/catchup if you're still interested in vim.se: chat.stackexchange.com/transcript/message/18066388#18066388
 
@Vogel612 I worked on that
 
@Pimgd soo... you're also named Jeroen??ß
 
11:41 AM
I hope it does what you need... I was testing it a couple years back and didn't like how it didn't support various things
No, that's the lead dev
 
do
{
    bag = txtBag.Text;
}
while (!int.TryParse(bag, out goal));
That's sketchy
 
This
5
Q: What's the default TemporalType for a temporal map key without a @MapKeyColumn or @MapKeyTemporal annotation?

PimgdI'm working on creating a JPA 2.0 Annotation compliancy kit for my internship. Right now, I'm wondering when a @MapKeyTemporal annotation is required and when it's optional... I know that when you define the column of the map key using @MapKeyColumn, the type the key should be mapped to can be d...

And other questions like that...
were related to that project
Back then they didn't support a whole bunch of things, but most of that was me doing various complex things
Like... when is this ever gonna happen in production?
1
Q: Does @Inheritance default to SINGLE_TABLE, or does it default to "fallthrough" OR SINGLE_TABLE?

PimgdConsider the following scenario: (The following things have been omitted: Constructors, Getters and Setters, @Column annotations, @Basic annotations, @Table annotations, imports and package declarations. The rest is EXACTLY as I intend it to be (even empty annotations)) @Inheritance(strategy=In...

A (@Inheritance(strategy=InheritanceType.JOINED)
B, C (no annotation)
   D, E (@Inheritance)
      F, G
@Vogel612 if it helps you out, I'd ask you send them a thank you mail or something. I don't know many people who were using it, it was more an open source project built for in-house use but open source so eventually some community would go and add stuff to it for them
 
@Pimgd reading through these questions... I feel dumb...
 
@Vogel612 ... I had a 500-page specification on my desk. It's basically programmer's legalese.
 
ermph... reminds me of when I wasn't able to read out of the docs that .addNode needs to be chained....
which was actually implied in the name...
aside @Pimgd you might want to have them update the maven-dependency example..
 
11:54 AM
The first day of my work ...
 
<dependency>
  <groupId>org.jarbframework</groupId>
  <groupId>jarb-constraints</groupId>
  <version>2.3.0</version>
</dependency>
 
hah actually that was pretty cool
 
jarb-constraints should be in <artifactId> tags...
 
@Vogel612 Like I said, old project
 
lol ;)
 
11:55 AM
I recommend shooting them an email, you can mention me (Pim) if you like
Anyway, first day of my internship
CTO is my mentor
He says to read this and that...
Also, you'll need the JPA 2.0 spec, so I suggest you print it out. Will be good to have on your desk.
So after installing a couple things on my PC I download the spec
it's pretty big, ~500 pages
But he said print so I'mma print it
It's a small office
 
Congrats... Adding this to the maven dependencies broke the serialization of my Data-Access layer..
 
He's in a meeting room. The meeting room has glass doors. Through these doors you can see the printers.
And at the printers, there's an intern desperately trying to get the printer to print a 500-page spec
it gave me about 30 pages and then stopped
it still has paper, it still has ink, it just doesn't work
 
well... 30 is actually ... not half bad.
you just flooded the printers mem with too much data..
 
and trying to cancel and restart isn't working either
 
reminds me of the guy who wanted to print a powerpoint over my laptop because it didn't work with his...
 
11:59 AM
so they're having a meeting and meanwhile I'm walking between my pc and the printer rather often
rather distressed too
 
end of story was, the printer can't hold more than a single powerpoint slide.
 
eventually another dev is a bit tired of my crap
 
So now I get why Java needs a new currency API...
 
He comes up to me and says "are you having any problems"?
 
How are you even going to look through 500 pages of spec.. You can't Ctrl+f in real life
 
12:00 PM
I have the feeling that, on my first day of the job, I just broke their printer
so half stumbling I explain that the printer is dead
"Nahh... I don't think it is"
He walks up to it, gives it a twack and it prints again.
"There you go!"
 
okay that one was kinda obv...
 
... I had to whack said printer 4-5 more times during the printing.
2
 
I have an interview tomorrow. It doesn't look like I have to bring anything but I still wonder what would be useful to bring just in case.
 
At the end of the day, it wasn't a real problem
 
@Morwenn questions...
trust me, they expect you to ask questions at the end..
 
12:02 PM
but for me... that was the first day of my first "job"
 
@Morwenn Clothes. Preferably wear them from the start
4
but yeah, questions. That's it, really
 
usually a pen & paper are also good...
they can make you look interested....
Meetings 101: protocol on paper, not on laptop.
 
Can I enter the room and simply ask "What am I doing here?"? Does it count as a relevant question?
 
@Morwenn *What will I be doing here? is a valid and relevant question
 
Maybe if you have an acute case of Alzheimers
But I would phrase it differently
 
12:05 PM
Last time I brought a CV, just in case, but this time, I had to fill a 4~5 page CV and send it by mail anyway. I doubt that they won't have it.
 
but it needs rephrasing
 
@Morwenn they will prob. ask questions about the CV...
 
I'd definitely bring your CV. Make sure you can give a bit of explanation about your projects - in a non-technical manner if you're talking to a non-IT person
That has tripped me up before
I can tell you how the code works but please don't ask me what the entire project does
 
"Do you need to perform a full background search first? Because I would rather like you not to do so."
 
That will only count as a red flag towards you
 
12:08 PM
@Pimgd yaaay it's borken...
 
Fortunately, I know how to explain what the projects I worked on do.
 
@Vogel612 How is it broken
 
I can't always explain how they work. Like that one time when I had to do statistics and I didn't even understand what I was doing.
2
 
I got @Stateless public class CustomerService implements ICustomerService, Serializable {
but I get a "non-serializable Dependency" error on deployment
 
I wanted to look at their website to figure out what I could ask, but their website doesn't appear to work anymore...
 
12:11 PM
@Morwenn valid comment to make during the interview
 
Unless it works again by then and I forget to check again.
 
works as a lead-in for questions regarding their clients, company size, team size...
@Morwenn "I tried to check the website yesterday but it was down"
 
Keywords: Embedded, C++, Linux, Python. That should do it.
 
Frameworks?
 
For interviews I usually don't have my CV with me
 
12:15 PM
No idea. I can learn what I don't know anyway.
 
I do prepare regarding their location (via google maps), and I try to find out the following: Company Size, team size, current projects, expected work activities, how my first months would look, what my workplace would look like, what software development methodologies they use, what project management methodologies they use, programming languages used...
 
I will try to wear clothes. At least for the interview. Time to find my old kilt.
 
0
Q: JQuery code for the creation of a table header, can it be improved?

MonicaI made the following function. What is does, is it takes and old table that has row within tables. Takes all the headers of these and creates just one big table with one header. This is only one part of all the creation for the new table. I basically do the same for the body and the footer. I wa...

 
What I can't find online I ask in interview
 
@Pimgd The question about the methodologies is a good one, thanks :)
 
12:19 PM
I tend to ask about the things I have found online in interviews anyway, using my website-gained knowledge as a lead-in ("So I saw you guys work for shipping companies and heavy industries ... but also small companies? What kind of clients and projects do you have?")
My last question is about the workplace
it's because I kinda want them to give me a tour
How they give you a tour can reflect how they feel about you
 
That's true.
 
Plus, it's pretty low chance that they're gonna give you a tour and THEN head back to the interview room for the rest of the interview
so it fits best as a last question
That's the questions from you to them.
 
You sound like you had many interviews before.
 
There's also the reverse...
Questions from them to you.
 
hi
 
12:23 PM
Hey
 
Does anyone know how in currency like "20.25" the "20" and the "25" fields are called?
 
And it just about always starts off like this:
- So... tell me about yourself.
or
- Say, I had a look at your CV and I saw x/y/z. Can you tell me something about that?
or
- I saw you're proficient with x/y/z and I have an idea regarding .... How would you design this project?
That first question pops up the most
 
The last one sounds kind of tough for a first job.
 
no
The last one means you're good
 
@skiwi 25 is decimal places...
the first one is the worst..
 
12:25 PM
The last one is what I wished I'd get every single time
Why?
 
trust me you can't answer that one correct..
 
They have a problem.
And they're asking you for a solution.
We're no longer talking about you as an potential employee.
We're talking about how you are going to solve it.
 
no-one knows how to do technical interviewing properly
anyone who says they do is lying
 
ermph... let them write code and have a senior do a review on it, for starters...
 
A decimal mark is a symbol used to separate the integer part from the fractional part of a number written in decimal form. Different countries officially designate different symbols for the decimal mark. The choice of symbol for the decimal mark also affects the choice of symbol for the thousands separator used in digit grouping, so the latter is also treated in this article. In mathematics the decimal mark is a type of radix point, a term that also applies to number systems with bases other than ten. == History == In the Middle Ages, before printing, a bar ( ¯ ) over the units digit was used to...
 
12:27 PM
@Pimgd Thanks for your valuable advice :)
 
So if they open up with a actual problem then you're off to a great start, because if you can keep the interview about you solving their problems all that's left to discuss is the terms
 
@Vogel612 write it when and where? On a whiteboard? On a computer? Before or during the interview?
 
Anyway
the first question... "tell me about yourself" yeah that one's hard
 
as part of the interview with pen and paper (for really easy stuff)
 
Prepare an answer for that
by god prepare an answer for that
 
12:29 PM
Yeah, I am currently reading articles about what not to answer when aske this question.
 
Oh I got another good one:
 
I have this habit where I interject subclauses in my sentences
 
"Why would we hire you?"
 
"where do you see yourself in 5 years"
 
"Because I am sexy as fuck."
2
 
12:29 PM
and those subclauses always get jumped on as "oh?" and a follow up.
 
or the eternal favourite "what is your greatest weakness"
 
The skin under my feet.
 
oh dammit.
My brutal honesty.
 
Would saying that you are a perfectionist raise flags, as weakness?
 
^^^ 80/20 rule ;)
 
12:31 PM
cliché flags, perhaps
 
@Vogel612 I am proficient in X/Y/Z. I saw you have projects that use X/Y/Z. I can work on these projects in a team, with minimal steering, once I've seen the preferred workstyle.
 
No-one ships perfect code, so thus, perfectionists never ship code.
 
scribbles down notes
 
Unless you think that you always write perfect code.
 
12:33 PM
Ergo: "I'm okay with shipping questionable code" is a good response!
 
@Yuushi ... personal preferences for this one. For me I'd just say "I dunno, 5 years is a long time for me, considering 5 years ago I was still studying."
Then continue with how you want your working future to look like.
 
Then you're an accomplished perfectionist. At least in your own opinion.
 
As for the greatest weakness thing... yeah, brutal honesty.
 
user image
3
 
I tend to focus on problems and solutions. If someone comes up with a bad solution, I tear it in half... and sometimes I'm rather harsh with this.
 
12:35 PM
@Morwenn that guy definitely has a creepy black dog with green eyes
 
@skiwi If asked my greatest weakness, I would probably say: I get emotionally attached to my code, and it makes me want it to be perfect. I struggle to find the right balance between "good enough to ship" and "perfect with every lose end tied in double-bows".
2
 
@rolfl Well, I'd more see a perfectionist as a bad sign of taking too much time for no good reason
 
^^^ that
 
Also personally, one of my weaknesses is that I have to understand something before I can work with it.
 
Can we not be perfectionists? I mean, we are on a Q&A site known as Code Review after all.
 
12:37 PM
no such things as perfect code, all code sucks in some ways, rabble rabble
 
@Morwenn Yes, we can be pragmatists.
 
so when I'm dropped in unfamiliar territory, I tend to try and learn about everything... on my own.
And that leads to me sometimes trying to learn on my own what others already know
 
My weakness: Getting bloody annoyed by all foolish written API's
 
So I should seek more help from my co-workers.
 
@skiwi Life must be stressful for you ;-)
 
12:37 PM
@rolfl Or we can simply be repwhores. That works too.
2
 
it does ... ;-)
 
@rolfl I'm raging on Java's way of converting a string + locale into a BigDecimal at the moment..
 
@Pimgd Oh right, I have been told once that I should ask more help from coworkers. I didn't feel like I needed it though; that was strange.
 
@skiwi Locale issues are a tough nut to crack. The right solution is to not have a String constructor for BigDecimal
 
I already know this, but I forget it from time to time... but if there's someone like a team lead to whom I report my progress on a timely basis then they could serve as a protection against this
that last bit is key
Yes, you have a weakness.
 
12:40 PM
@rolfl Yup, if I took that solution it would be easy, but that's not what I want
 
but also bring a solution.
 
It becomes more complicated with whether . or , is a decimal separator, etc.
char encoding is only part of the problem.
 
Haha, off-topic comment, sorry.
 
@rolfl On top of that you may add that the input is from an OCR, which can also even give incorrect characters
 
If you provide a weakness that can also be a strength and come with a solution for the moments where it's not a strength then you've vastly reduced this "weakness" of yours
 
12:41 PM
6 mins ago, by rolfl
@skiwi If asked my greatest weakness, I would probably say: I get emotionally attached to my code, and it makes me want it to be perfect. I struggle to find the right balance between "good enough to ship" and "perfect with every lose end tied in double-bows".
 
emotionally attached is dangerous
You've highlighted one weakness
but there's another one here:
> I get emotionally attached to my code,
 
Yes, agreed.
 
AKA My code is my code
MINE!
 
;"I am emotionally repulsed by code I wrote a few months ago"
 
Go find your own lego/sand/toys/code to play with!
 
12:43 PM
DON'T YOU DARE TOUCH MY CODE!!!
myyyy prrrecious
 
@rolfl How would you then convert string + locale into a big decimal if it were asked to you?
 
@skiwi not at all ;)
 
pff
where were we
 
@rolfl Are you the kind of guy who writes # WARNING: this code has been automatically generated, do not change it. Changes could be lost. to ensure that only you can change it?
 
Nope, never done that, but maybe I should ;-)
 
12:45 PM
other questions they can ask you are
- What did you do at your last job/why did you leave you last job?
 
I didn't have a previous job, only internships.
 
@Morwenn Nice trick!
 
I have, once, as a joke, put "This code is not commented. It was hard to write, so it should be hard to read!". Took 6 months before someone found that, and complained, and only then read the header at the top with a reference to the feature request that had the full documentation ;-)
 
Is it a reasonable assumption that number formats and currency formats for a specific locale align?
 
@skiwi - apparently not ;-)
 
12:46 PM
then theres "Have you ever had a problem with a co-worker?"
 
@skiwi BTDT And god it's complicated!
 
@skiwi - for the BigDecimal, the normal solution is to specify the input at design time, "This program accepts values in the configured locale only. Values not specified in the set locale format may not parse".
 
that one is strange, I don't know how to answer it... obviously to answer yes and to go into great detail is shooting yourself not only in the foot but also in your hands and face
So I answered no and was met with disbelief
 
@Pimgd Seems tricky. I indeed had one. Actually I didn't know, it's more like he had a problem with me.
 
@Pimgd no doesn't work
 
12:48 PM
@rolfl Agreed, but even getting that parsed is not easy
 
nobody believes you, you didn't have some kind of problems with co-workers.
 
And I guess what they're looking for is "If you have a problem, can you solve it?"
 
one is incompetent, the other smells, ....
 
so your answer should actually answer that
 
some are plain [....]
 
12:49 PM
@Pimgd That what they want to hear, how do you manage your problems with your co-workers
 
Hmm... I might've hacked my way into the API
 
@Pimgd My anser would probably be "I had one and didn't realize it. Now I am more careful about that."
 
@Morwenn that's bound to lead to a follow up
but that's not bad
 
In short, my answer is "since then, I listen more carefully to what people have to say".
 
I think this is a big hack...
 
12:52 PM
I value honesty in an interview over giving what I think they want to hear!
2
 
    public static BigDecimal parsePrice(final String inputText, final Locale locale) {
        String text = inputText.replace('‚', ',');
        text = text.replaceAll("(?iuU)\\p{L}", "");
        text = text.replaceAll("(?iuU)\\p{Z}", "");

        NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
        numberFormat.setParseIntegerOnly(true);
        ParsePosition parsePosition = new ParsePosition(0);
        Number number = numberFormat.parse(text, parsePosition);
        String decimals = text.substring(parsePosition.getIndex() + 1, text.length());
 
Greetings, Programs.
 
But it might be a genious hack.
 
@Marc-Andre This should be the base of your answers of course
you're free to select a problem in the past that's more easily explainable
but don't lie
 
The problem is that when I was an intern, I was given a project to work on. At some meetings, we were discussing the technologies that should be used. Seems that I was a little bit too good at promoting some technologies and some guy felt like I wasn't taking enough his ideas into account.
 
12:53 PM
String text = inputText.replace('‚', ',');
 
if they find out then it's a no-hire
 
▲♥♥
 
pff... other questions...
 
@rolfl NumberFormat doesn't extend DecimalFormat, and you cannot pass a locale into a decimal format
 
12:53 PM
What do you do in your spare time?
Also one I've gotten quite a lot actually
right after "tell me about yourself"
 
The aformentioned guy ended up not coming to the meetings anymore and was rather cold with me. I didn't noticed it and was explained the problem at the end of the internship.
 
@skiwi No wait there is something you can do let me check
 
Uh, I have like many things to do in my spare time.
 
            DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(Locale.GERMAN);
            df.setParseBigDecimal(true);
            BigDecimal bd = (BigDecimal) df.parseObject(numberString);
 
@Morwenn sounds like a weakness to me!
 
12:55 PM
@rolfl That's an implementation detail then, can break on non Oracle JDK's
 
That's a real weakness you can give if the weakness question comes AFTER the "have you ever had a problem" question
 
@Pimgd The big weakness I have is that I am currently in a band. And that's bad for mobility.
 
I don't feel I can leave such code behind which blows up when ran on another JDK
 
@skiwi See, I can be a pragmatist, not a perfectionist ... ;-)
 
@rolfl Will it even work on IBMJDK? :)
 
12:56 PM
"I don't always realize others have a problem with me and I wish they just told me if they have a problem with me so we can talk it through"
Spare time question is asked because they're trying to get the personal side of things
what kind of person are you
 
I'm an extrovert introvert.
2
 
good good
 
> If you want even more control over the format or parsing, or want to give your users more control, you can try casting the NumberFormat you get from the factory methods to a DecimalFormat. This will work for the vast majority of locales; just remember to put it in a try block in case you encounter an unusual one.
 
my uncle had to interview a bunch of people, and you have have very interesting discussions when talking about people's hobbies in an interview
 
@Morwenn ehm. stop taking the words outta my mouth, will ya?
 
12:58 PM
I'm an extrovert online, IRL I am an introvert.... which is why I am online ;-)
 
@Pimgd Your advice were really welcome. I feel a little bit more secure now. Thanks a lot :)
 
One guy he interviewed liked to eat, so he went to different restaurant on a weekly basis
 
@rolfl That doesn't sound really promising, but it's something
 
makes for a very interesting talk, I imagine
it's also a great opportunity to show something that you're passionate about
it allows them to see what your emotions look like
 
music books games code
 
12:59 PM
and allows them to apply these emotions to later questions
 

« first day (523 days earlier)      last day (3508 days later) »