Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"

Adrian Grabowski

Ranch Hand
+ Follow
since Jun 22, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Adrian Grabowski

You are correct, I assumed it was Intelij's built in function but it is actually a plugin bundled with Intelij Ultimate. It checks your query and highlights the keywords. It doesn't say if it works with Hibernate 5 to be honest but it looks like it doesn't understand LocalDateTime.

Am I correct to assume that it is ok to use Java 8 Date api with Hibernate 5 without any tricks and mapping from LocalDateTime to MySQL's DATETIME is ok? It seems to be working straight out of the box...


Bob Matthews wrote:

and in line 6 above of the client code have replaced String[] with String

No sign of any client action ???

String... (with three dots)

This will allow you to call the method with or without parameters.
2 days ago
I think you wanted something like:

You just need to replace String[] with String... on line six if you want to use this method without providing any parameters
2 days ago
I think you are confused on what sorting does, you don't need it here. Read bit more about sorting and implementing comparator if you want to know more. You also don't need to prefix your private fields with "_", it's not Python.

Regarding your problem, try describing how you would approach it without coding, let's say you have a list of players on a bit of paper and you want to split them into two teams with equal number of healers. How would you do it manually? Step by step.
2 days ago
I'm persisting some data using Hibernate and I'm not sure if that's the correct way of doing things. I have a class called SensorDataObject, one of the fields is of type LocalDateTime. When it's saved in mysql its type is DATETIME which I assume is correct.
Now when I wrote code to retrieve data my IDE (Intelij) marks it as an error but the code compiles and seems to be working fine:

Intelij complains about "sdo.localDateTime" and says: "Type mismatch: number, date or string expected."

Am I doing something wrong or is Intelij just confused?

You are prefixing all variables with "p", why? You just make your code harder to read. Also, you can make your fields private.

What are the Fechalong and Fechasegundos for? Are you trying to get the timestamp from the date or something similar?

3 days ago
First I would check contents of this jar file:

and check the manifest file as well
1 week ago
When you login through this url do you see your book there?

wayne brandon wrote: where would you suggest i start?

I'm not sure as everyone's path is different, in my case I'm always wondering if I'm learning useful things of I'm progressing fast enough but I as a rule of thumb: if I look at my code from few months ago and think "what an idiot wrote it this way" then I assume I'm making a progress
2 weeks ago
Have a look at SparkJava framework. It's very basic and easy to learn comparing to Spring, it also works nicely with templating engines (like Thymeleaf or Handlebars).
I didn't mean to sound harsh, maybe "rubbish" isn't the best word here but I would assume that basic Java course would explain difference between package and class and some basics of generics. I assume it was one of the courses that get you from zero to hero in a shortest amount of time possible and they cover a lot of topics so you can write something useful but they don't go deep enough. It's good as it keeps things interesting but the downside is that you might end up with some gaps in your knowledge. Apologies if I have offended you.
2 weeks ago
In my opinion you don't have a problem with reading javadocs, you have a problem with understanding basics of Java and OOP, it's not your fault, I guess this 6 months course was rubbish. I suggest starting from scratch using different course or a book.
2 weeks ago
I haven't seen any good OCA/OCP course, you might need to pick and mix a bit to cover exam topics.

Whizlabs have courses for OCA/OCP but they are quite rubbish, I wouldn't recommend them.

There is a free Java basics course on cave of programming by John Purcell but it's bit outdated, you would need to learn about lambdas and new Date API from other sources to cover OCA topics.

If you have some money to spend both teamtreehouse and pluralsight have nice courses, they are worth the money if have some free time for studying, if you only have few hours per week then it makes less sense.
I don't know what is but if you want an ArrayList of Strings you would declare it as:

3 weeks ago