| [+] Beginning Java » How to automatically assign a large amount of objects into a list (Go to) | | Tim Cooke |
So the constructor argument isn't just multiples of 10 up to 10000? If not, where does the required value come from? |
| [+] IntelliJ IDEA » pre-built shared indexes (Go to) | | Propanna De |
It's ok to say yes to that option. |
| [+] Beginning Java » How to automatically assign a large amount of objects into a list (Go to) | | Tim Cooke |
You're on the right track with using a loop. When you want to create n instances of a type then create a loop that iterates n times and put the object creation inside it. For example, to achieve what you are going for you could do something like this |
| [+] Java in General » write code that will work as JavaScript under Node.js AND as Java code AND as C# code also (Go to) | | Matthew Bendford |
No. I don't believe you can. |
| [+] Java in General » write code that will work as JavaScript under Node.js AND as Java code AND as C# code also (Go to) | | Matthew Bendford |
Who asked you this question? |
| [+] Java in General » What about records? (Go to) | | Stephan van Hulst |
In my opinion, Lombok is a good example of the old saying Just because you can, doesn't mean you should And again in my opinion, Lombok shouldn't. It shouldn't even exist because the veneer of convenience hides the real crimes beneath. I've also spent much time trying to unpick weird behaviour in my code caused by Lombok in ways that really are not clear at all. Forget the party tricks, just write nice clean straight forward code that does exactly as written. |
| [+] Testing » Interested in a live TDD event? (Go to) | | Michael Krimgen |
I can help with the tweeting and i think this might even warrant an email too. |
| [+] Threads and Synchronization » Problem with killing all Threads (Go to) | | Himai Minh |
Assuming you're running your program from a terminal, then you will need to terminate the process where the JVM is running. If you're running as a foreground process then Ctrl+C will do it, or if a background process then find the process id (pid) and kill it, e.g. ps -ef | grep java, find the pid of the process that is your running program, then kill <pid>, where <pid> is your actual pid. These examples are based on a Linux OS. |
| [+] Testing » Interested in a live TDD event? (Go to) | | Michael Krimgen |
Alas I fear 7-9pm on a Friday night, BST timezone, will be a hard sell to the Wife :/ "Sorry luv, no takeaway and movie tonight I'm watching some nerds write code for 2 hours". I can almost see her face now. |
| [+] Testing » Interested in a live TDD event? (Go to) | | Michael Krimgen |
| |
| [+] Jobs Offered » Fulltime Job - Core Java Developer - Financial Services - Chicago, IL (Go to) | | Pankaj Misraa |
Let me guess, emphasis on GCP? |
| [+] Jobs Offered » Fulltime Job - Core Java Developer - Financial Services - Chicago, IL (Go to) | | Pankaj Misraa |
I'm fairly certain I know who your client is and I've worked for them myself in the past as a Java developer for about 6 years. They're a good bunch and would highly recommend a job there. Best of luck finding someone for your role. |
| [+] Other Big Data » Three queries (Go to) | | Tim Cooke |
What is the database schema? Without knowing that I can't make any suggestions. |
| [+] Meaningless Drivel » Is there any way to activate the keys f1,f2,etc only when "Fn" + f"x" is typed? (Go to) | | Bruno Valdeolmillos |
Since I don't actually understand the question we're in the right forum  |
| [+] Programming Diversions » Learning Java for grade 9 beginner (Go to) | | Tim Cooke |
I like to recommend this one Python for Everybody as it is designed for absolute beginners and makes no assumptions of prior programming knowledge or even how computers work. It's also completely free which is a great thing. |
| [+] Programmer Certification (OCPJP) » OCP STUDY GUIDE (Go to) | | Jeanne Boyarsky |
The promotion closes at midnight, Ranch Time, on Friday night and I usually aim for 10am Saturday in my timezone, currently 3am Ranch Time, to pick the winners and do all the other administrative jobs relating to it. But we're all volunteers and sometimes we have other more important things to do and the winners are not picked until later. And that's absolutely ok with us too. |
| [+] Java in General » how to design payslip in java (Go to) | | Tim Cooke |
I expect the majority of designing such a system will be concerned with security of the stored data rather than what language is used to write it. Things like preventing direct access to your database and file system, and I mean that from a networking point of view rather than with authentication, although authn is still important. It's a non trivial problem you are embarking upon so I'd propose you buy rather than build in this case. |
| [+] Programmer Certification (OCPJP) » * Winners: OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829 (Go to) | | Jeanne Boyarsky |
First, a big thanks to Scott Selikoff and Jeanne Boyarsky for being here to promote the book OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829. The winners are: Gabi MaximShaik AshishCharles O'LearyAurelian Rosca Please send your snail mail address to bookpromotion AT javaranch DOT com. To ensure the quickest response, please provide the following: Your name (first and last - if your CodeRanch name is different, please include both your real name and Ranch name) Email Country (needed even if requesting an e-book) Address Phone Number Also, please include the following as the subject of your Email. Book Promo Winner - OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829 - Tuesday, May 10th, 2022 Image from https://m.media-amazon.com As noted in the Book Promotion Eligibility Requirements and Legal type stuff, the winners have 8 days to submit their information. Within 3 days of receipt of your email, we will reply to let you know we got it. If you don't hear back, the goat might have eaten your email. Please let us know by posting in the Ranch Office so we can check on it. Once you have received your copy please let us know by editing the Book Promotions Winners Page and updating the 'Status' column to say you have it. Thanks and congrats to all the winners. |
| [+] Meaningless Drivel » The hippest internet cafe of 1995 (Go to) | | Tim Cooke |
That was very interesting. I didn't know of that place since I didn't grow up around there. |
| [+] Meaningless Drivel » Mystery toilet button (Go to) | | Tim Moores |
| |
| [+] Programmer Certification (OCPJP) » Syntax Questions on Exam (Go to) | | Geoff McKay |
I would expect so yet. I was one of the tech reviewers for the Bates & Sierra Java 8 cert books and many of the examples had answer choices of "Does not compile". I'd expect that theme would have continued throughout on the exams. |
| [+] Java in General » Passing Object to Java Server (Go to) | | Paul Clapham |
If your post is too long perhaps it means your question is too broad? Can you narrow it down a bit? Perhaps write a small example program that exhibits the problem you're facing? I'm not usually one for clicking out to PasteBin but in this instance I did there's so much stuff I'm not prepared to decipher it all. |
| [+] Programmer Certification (OCPJP) » The unary plus operator (+) (Go to) | | Jeanne Boyarsky |
Oh OK. It's probably worth stating clearly that you're submitting erratum rather than looking for help. |
| [+] Programmer Certification (OCPJP) » The unary plus operator (+) (Go to) | | Jeanne Boyarsky |
| |
| [+] Beginning Java » How to Program a Family Tree (Go to) | | Tim Cooke |
Hello, welcome to the Ranch! You won't find anyone here who will send you the full solution. But if you show us what you've done and explain where you're stuck then you'll very likely get some help. |
| [+] Java in General » How to count the number of words only using string methods using a more efficient regex (Go to) | | Campbell Ritchie |
Good spot Fred. Funny how the rest of us never even thought to question the question. |
| [+] Spring » What is the preferred way schema creation for H2(tests & dev) with SpringBoot+Flyway+MySql(prod)? (Go to) | | Tim Cooke |
Using a different method to manage your database schema and data in testing than you do in production sounds very risky to me as it will not actually test that your production system is correct. So if you use Flyway in production, then use Flyway in your pre-production environments. I would advise that in at least one of your pre-production environments you have a production like system using MySQL, but for local testing and sandbox environments H2 is often a good choice. |
| [+] Java in General » How to count the number of words only using string methods using a more efficient regex (Go to) | | Campbell Ritchie |
String split() takes a regular expression, and " " is technically a valid regular expression  |
| [+] Java in General » Nested packages (Go to) | | Raul Reyes |
Hello, welcome to the Ranch! Perhaps you have not compiled the other classes you are attempting to reference? |
| [+] Java in General » How to count the number of words only using string methods using a more efficient regex (Go to) | | Campbell Ritchie |
Hi, welcome to the Ranch! What does your program output? How does that differ from what you expect? p.s. You'll see a "Code" button in the post editor that is good for presenting code as it formats it nicely to be easy to read. I've done it for you this time as you can see. |
| [+] Java in General » What about records? (Go to) | | Stephan van Hulst |
I'm a regular user of the builder pattern, I think it's a great construction tool, but I absolutely would never trust lombok to do it for me. It's just not that hard to write your own, especially when you lean on the auto complete features of your IDE. |
| [+] Programmer Certification (OCPJP) » OCP Java SE 17 Developer - Managing concurrent code execution (Go to) | | Scott Selikoff |
In my experience the most valuable tool you'll ever need for dealing with concurrency is your brain, some paper, and a pencil. |
| [+] Java in General » What about records? (Go to) | | Stephan van Hulst |
I honestly don't understand the fascination with Lombok, all that bytecode fiddling all in the name of 'convenience' leaving you with a codebase that no longer represents the truth. projectlombok.org wrote:Never write another getter or equals method again Get yourself a half decent IDE such as Eclipse or IntelliJ and you'll never write another getter or equals method again either without the overhead and risk of a third party library. It is probably apparent that I dislike Lombok with some vigour. |
| [+] Programmer Certification (OCPJP) » The relevance of a certification for an immigrant (Go to) | | Scott Selikoff |
We have a few residents of Canada here so you might get some specific feedback from them. I have an opinion that the "value" of holding a Java cert is largely geographical in terms of how much importance employers put on it. I, for example, live in Northern Ireland and I do not hold any Java certs and I have never found it to be a disadvantage when looking for employment. I'm now in a position where I hire other Java developers and I do not require it from candidates. I've heard anecdotal stories from other countries where a cert is near enough mandatory. |
| [+] Beginning Java » java-version problem (Go to) | | Campbell Ritchie |
Hello, welcome to the Ranch! We are an English speaking forum so please ask your questions in English. |
| [+] Programmer Certification (OCPJP) » * Welcome Scott Selikoff and Jeanne Boyarsky (Go to) | | Netra Bhatt |
Hello Chris Ar, welcome to the Ranch! We are an English speaking forum so please write in English. |
| [+] Programmer Certification (OCPJP) » * Welcome Scott Selikoff and Jeanne Boyarsky (Go to) | | Netra Bhatt |
A reminder This welcome thread wrote:Posts in this welcome thread are not eligible for the drawing, and should be reserved for welcoming the author. Questions posted in this topic are subject to removal. |
| [+] I/O and Streams » Create a Java application to validate the user credential. (Go to) | | neo zef |
Hello, and welcome to the Ranch! It's hard to know where to begin with helping because it's unclear how far you've gotten with it. Perhaps you can show us what you've got so far and what specific problem you are facing? |
| [+] Programmer Certification (OCPJP) » [book promo] Reflection not part of OCP? (Go to) | | Jeanne Boyarsky |
Scott will keep me right on this, but I would view the Java Certs as an in depth examination on using the language constructs rather than digging into how things work behind the scenes. |