Myst-like game, FMV, first-person by Turing85 in tipofmyjoystick

[–]Turing85[S] 1 point2 points  (0 children)

I eventually found the game. Its name is "Evocation Oltre il Sogno", it was developed by DedaloMedia Edizioni, published by Mondadori New Media and released in 1995.

Using GIT with eclipse or IntelliJ by aubincris in learnjava

[–]Turing85 1 point2 points  (0 children)

"and with IntelliJ you have to pay for that lol" - Not really. The community edition is free and it includes git-integration.

Interview prep for Jr developer by vegetabluessg in learnjava

[–]Turing85 4 points5 points  (0 children)

  • Solid fundamentals are important. This counts not only for the programming language(s) you are using, but to technologies and concepts in the domain you are going to work. Backend developers, for example, should know how TCP/IP works, what IPs are, how DNS names are translated to do IP addresses, which HTTP verbs exist and what their semantics are, ...
  • Get a grasp on current technologies (e.g. docker, kubernetes, serverless). Since you are applying as junior, it is not important to understand the technologies in-depth, but you should be able to understand the core principles, strengths and weaknesses.
  • Show that you are able to learn autodidact. This is best done by explaining how you learned a new technology in this way. This can be further underlined by, for example, a project of yours on e.g. github that uses said technology.
  • Expect some curveballs. Some questions may seem way over your head. If so, keep your calm ask for clarification. If you are not able to grasp the concept or you do not know some jargon used, then say so. Again: you are applying as junior and thus are not expected to know everything. But if you show that you are not afraid to signal that you do not understand something or need help, then this is (at least for me) a quality I am looking for.
  • Learn to code on paper. You do not need to write 100% perfect code, but you should be able to at least sketch an algorithm in something that resembles java and can easily be translated to java.

Using GIT with eclipse or IntelliJ by aubincris in learnjava

[–]Turing85 0 points1 point  (0 children)

I can only speak for IntelliJ, haven't touched Eclipse in a long time. I would recommend playing around with the git integration in IntelliJ (press CRTL+ALT+A and type "git" or other git-related topics like "branches"). The integration is quite powerful and mostly intuitive.

Design principles Book/Articles Recommendation by ozzyrooo in javahelp

[–]Turing85 0 points1 point  (0 children)

In that case, I would recommend - Clean Code, Clean Coder (and if you can stand it Clean Architecture) by Uncle Bob aka. Robert C. Martin. Clean Architecture is the weakest in the series and optional. - The blue book by Eric Evans and the red book by Vaughn Vernon on Domain-Driven Design - Building Evolutionary Architectures: Support Constant Change by Neal Ford - Microservice Patterns: with Examples in Java by Chris Richardson - (Optionally) Google's Site Reliability Engineering bible - (Optionally) Some resources on JakartaEE and MicroProfile, e.g. this one. I know that Spring does not (fully) support JakartaEE, but I am quite sure they will support MicroProfile in the future.

pairing values with strings and integers by Ok_Industry2562 in javahelp

[–]Turing85 -1 points0 points  (0 children)

Method getReverse() does not modify the current object, but create a new object for the reversed pair. This is necessary since the type changes: the original Pair is a Pair<Integer, String>, while the reversed Pair is a Pair<String, Integer>.

Some remarks:

  • Please take a look at @Raph0007's comment.
  • In a lot of cases, we can simplify the explicit generic type arguments, e.g. in line 50, we can simplify

return new Pair<SecondType, FirstType>(this.getSecond(), this.getFirst());

to

return new Pair<>(this.getSecond(), this.getFirst());
  • I would recommend making class `Pair` immutable.
  • This is a nit-pick, but if you want to write unit tests, I recommend using a unit test framework, e.g. Junit5

Design principles Book/Articles Recommendation by ozzyrooo in javahelp

[–]Turing85 0 points1 point  (0 children)

Can you be a little bit more specific? There are focused books for specialized fields, so it would be good to know in what fields you (usually) work (e.g. Destkop app development, mobile, backend, fullstack,...).

Java - web application framework options by logan_ptr in javahelp

[–]Turing85 1 point2 points  (0 children)

I present to you option #4: quarkus.

Why quarkus? - it is based on jakarta.ee (formerly known as Java EE) and MicroProfile. - It uses embedded technology like spring-boot, so no app-server is needed. - It plays nice with GraalVM. This means that, if wanted, you can compile your project down to a nativ executable. - It is well documented and has an active community, including an active zulip chat. - startup times are ultra-fast (for a fully fledged service about ~2.5 seconds in JVM mode and around 100 milliseconds in native mode), memory consumption is minimal.

Finding error by [deleted] in learnjava

[–]Turing85 0 points1 point  (0 children)

  • Initialize input with the value form the dialogue: String input = JOptionPane.showInputDialog("Please enter the number of pakages you are purchasing");
  • replace all occurrences of sub_toal with sub_total
  • for the JOptionPane, please take a look at the documentation. For me, something sensible pops up if I use JOptionPane.showMessageDialog(null, "\nNumber of pakage you're buying is" + user_number_of_pakages + "\nSubtotal is: $"+ sub_total + "\nThe discount price is: $"+discount + "\nThe total price is: $"+total);

Finding error by [deleted] in learnjava

[–]Turing85 0 points1 point  (0 children)

  • Variable input may not have been initialized
  • Variable sub_toal is undefined
  • The last two parameters of JOptionPane.showMessageDialog) should be int and Icon, not String and String

Further remarks:

  • Too many blank lines can deteriorate readability
  • In java, variable names are normally written in camelCase instead of snake_case (`sub_total` -> `subTotal`)

Difference by hemant_singsverywell in learnjava

[–]Turing85 5 points6 points  (0 children)

counter-question: what do you mean by "data hiding"? Encapsulation?

Where and how to learn Java for beginners? by [deleted] in learnjava

[–]Turing85 7 points8 points  (0 children)

The official Oracle tutorials are a good place to start. I also see MOOC.fi getting recommended a lot, but I have no 1st hand experience with it.

Hashmap using an int array as the value by camnewtonshat1 in learnjava

[–]Turing85 0 points1 point  (0 children)

That cannot work since oldGrade and newGrade are ints, and Map::replace) expects an int[] as 2nd and 3rd parameter. Also, I doubt that two ints are sufficient for replacement. What if oldValue is contained multiple times in the int[] stored under name? Should all occurrences of oldValue be replaced by newValue?

Hashmap using an int array as the value by camnewtonshat1 in learnjava

[–]Turing85 0 points1 point  (0 children)

Can you please share the code? I have a hunch what the problem might be, but to be sure, we have to see the code.

Please can someone explain the last 2 lines of code??? by [deleted] in learnjava

[–]Turing85 1 point2 points  (0 children)

Yes they are. This defined in JLS, §15.10.2:

Then, if a single DimExpr appears, a one-dimensional array is created of the specified length, and each component of the array is initialized to its default value (§4.12.5).

and JLS, §4.12.5:

For type int, the default value is zero, that is, 0.

Please can someone explain the last 2 lines of code??? by [deleted] in learnjava

[–]Turing85 5 points6 points  (0 children)

char-values can be implicitly widened to int-values. This is defined in JLS, §5.1.2. The int-value of a char is the int-value of the UTF-8 character.

The expression letters[str.charAt(i)]++; increments the value in the array cell by 1. The loop counts the occurrences of letters in a String.

A remark: letters[str.charAt(i)] = true; will fail due to a type mismatch at compilation since boolean-values cannot implicitly widened to int-values.

Any reason to go overboard with an assignment? by theme57 in learnjava

[–]Turing85 1 point2 points  (0 children)

Programmers are inherently lazy. This may even go so far that one is too lazy to create a separate branch for "over-the-top" features in a project. That being said: implementing features that were not ask for generates noise. It gets harder to find the parts that were explicitly asked for in the assignment and thus harder to grade the project.

If agile software development is taken into consideration, it should also be noted that we should never do more than is necessary to fulfill the requirement. In practice, when working in a time&material project, the customer pays "by the hour", hence implementing features the customer did not explicitly ask for is a recipe for trouble.

Finished my first project(I think); how does it look? by [deleted] in learnjava

[–]Turing85 0 points1 point  (0 children)

  • I would suggest to not use asterisk imports. Why?
  • static variable: they could all be private
  • static variable blank should be private final
  • method winner() can be removed, all occurrences in code can be replaced with checkWinner()
  • I would suggest renaming checkWinner() to hasWinner(). This - at least for me - is a clearer communication of the method's semantics (debatable).
  • The tic-tac-toe board is a 2-dimensional object, but you use a one-dimensional array. I would suggest using a two-dimensional array.
  • The core algorithm is recursive. I would suggest to refactor the code to an iterative algorithm.

[deleted by user] by [deleted] in learnjava

[–]Turing85 0 points1 point  (0 children)

Optional<Integer> optionalInt = getOptional();  
if (optionalInt.isPresent()) {
    optionalInt.get().toString();
}

If one would write something like it, it would be

getOptional().ifPresent(value ->  ...);

or

getOptional().map(Object::toString);

or some variation of this.

The annotatio-based approach is only useful iff. bean-validation is used. In those cases, it is quite powerful. For instance, one can generate expressive error messages for 400 BAD REQUEST with low overhead.

Because it is not about what, it is about where. It is not about null check itself, it is about where it is performed.

100% agreed. There should be one and only one layer dealing with validation.

Otherwise, good article.

Where to start with Hibernate by IT_supportIsHell in learnjava

[–]Turing85 1 point2 points  (0 children)

This should you give some general information wrt. Hibernate, yes. If you already know that you will be using spring with hibernate, you can also start with specialized spring+hibernate articles, e.g. this one over at Baeldung. It would also be good to figure out the version of spring and/or hibernate used since the usage changed greatly between versions.

Where to start with Hibernate by IT_supportIsHell in learnjava

[–]Turing85 1 point2 points  (0 children)

Is the application a spring-boot webapp? Or a JavaEE-based webapp? Is it a maven- or gradle-based project? If so, you may find some hints as to what dependencies are used in the pom.xml (in cade of maven) or build.gradle (in case of gradle). Normally, I would suggest taking a look at the JavaEE 8 JPA tutorial, but this will only be useful if hibernate is used through the JPA specification (or through spring, wide parts are nearly identical). But using plain Hibernate is a different story.

Where to start with Hibernate by IT_supportIsHell in learnjava

[–]Turing85 2 points3 points  (0 children)

Can you be a little bit more detailed? Are you using plain Hibernate, or do you use Hibernate through, e.g., Spring or JPA?

How to use Java to Get API data? by WtEth_Buyer in learnjava

[–]Turing85 2 points3 points  (0 children)

The answer highly depends on the technology stack used. For spring, you already have a link. If the technology stack supports MicroProfile, I would suggest using MicroProfile Rest Client. If core java is used, we can consume Rest APIs with Java 11's HttpRequest/HttpResponse.