| [+] Beginning Java » Advice Needed: Java Frameworks and Learning Path for Freshers (Go to) | | Campbell Ritchie |
In addition to Liutauras's excellent advice, you'll find that throughout your career you'll spend a lot more time reading and running other people's code than writing your own so I'd recommend you practice doing that. Open source is a great place to go to do this, find yourself a library that looks interesting to you, take a copy, and get it running in your own computer. Then start reading the code to see how it does the things it does. It's quite important you find a program that does something of interest to you otherwise you might find it hard to keep your motivation going. |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
If each of your services really are micro in size, then would you consider forgetting about spring boot altogether and just using Java? I worked on a system a few years back where performance was of critical importance and we did not use any such framework, just straight up Java. We got along just fine with it. |
| [+] Programmer Certification (OCPJP) » OCP Java SE 17 Developer Study Guide (Sybex CSG 17) (Go to) | | Jeanne Boyarsky |
| |
| [+] Beginning Java » Please Suggest me some of the most trickiest String interview questions (Go to) | | Swapnil Mishra |
| |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
Does docker slim reduce the memory consumption of a running docker container? Or just the image size? I don't think micro services is the right term for what we're discussing here. You have an infrastructure platform management problem. How to host multiple docker based applications on a single host, or more specifically how can I reduce the system resource requirements of each docket based application so you can host more of them on a single host. Does that sound about right? |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
I've been working on the assumption so far that what you're describing is a single software system decomposed into many components, each running as a "micro service". But would I be right in saying that what you are really describing is multiple separate and completely unrelated software systems? All that need to be hosted on a single VM? |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
You said up front that your team skill set pretty much mandates Spring Boot, so in practical terms you already are tied to a technology stack. As for the rest, "run independently of each other" and "scale them" could most certainly be achieved inside a single JVM. I'm thinking threads and queues. For me one of the motivations of micro services is environment and/or platform independence, which you don't seem to be able to avail of with the one big VM you have. The primary cost of micro services is messaging. You must now design and manage communication between services, which is a non trivial task. What if a message doesn't arrive? What if it arrives more than once? What if it takes a long time to arrive? What if a service goes down? What happens to messages sent to it now? What happens to the message it was processing when it went down? And since you're doing all this inside a single VM, what happens to the state of the system when the VM goes down? How do you recover from that? It's a difficult exercise. |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
The target environment is a single physical server? What's the motivation for micro services? |
| [+] Programming Diversions » Advent of Code 2024 (Go to) | | Tim Cooke |
I'll probably stick with Java but might give Go a go since I've never used it before. Good opportunity to learn it a little. |
| [+] Programming Diversions » Advent of Code 2024 (Go to) | | Tim Cooke |
Different language each day? |
| [+] Programming Diversions » Advent of Code 2024 (Go to) | | Tim Cooke |
It had just entered my mind that this starts tomorrow and put a smile on my face. Code repo preparations will begin tonight 😁 |
| [+] Design » Microservices and Spring Boot - concerns about memory footprint. (Go to) | | Ron McLeod |
My first approach in situations like this is to ask what your actual constraints are on memory usage? Is 2GB per service in excess of any of those constraints? Or does it just sound a lot to you? What are your constraints? |
| [+] Programmer Certification (OCPJP) » OCP Java SE 17 Developer Study Guide (Sybex CSG 17) (Go to) | | Jeanne Boyarsky |
I can confirm that the code you have provided does indeed not throw an exception. However, I don't have a copy of the book so cannot verify that the code you have provided is exactly what is printed in the book. |
| [+] Java in General » What does this error mean (Go to) | | Tim Cooke |
Or, if you know the file will always be ASCII then you could support it by passing the required Charset definition |
| [+] Java in General » What does this error mean (Go to) | | Tim Cooke |
Great, glad you figured it out. |
| [+] Java in General » What does this error mean (Go to) | | Tim Cooke |
Looking at the docs for Files.readAllLines I wonder if the file you're reading isn't UTF-8? |
| [+] Beginning Java » Please Suggest me some of the most trickiest String interview questions (Go to) | | Swapnil Mishra |
I don't think I've ever been asked this kind of question during an interview and for good reason too since I don't think it really has much value. Expecting a candidate to keep the nuances of object creation behaviour in their memory is unreasonable in my opinion. A better question to ask is: If object creation was of importance, how would you measure and discover what objects are created for any given piece of code? |
| [+] HTML Pages with CSS and JavaScript » How to prevent browser from getting page from cache (Go to) | | Tim Holloway |
Like I say, I'm no front end expert. I should probably ask my colleagues who are skilled in this sort of thing instead of trying to infer stuff from reading the source code badly. |
| [+] HTML Pages with CSS and JavaScript » How to prevent browser from getting page from cache (Go to) | | Tim Holloway |
I'm no web expert, but I think we use workbox in some way for cache management. |
| [+] HTML Pages with CSS and JavaScript » How to prevent browser from getting page from cache (Go to) | | Tim Holloway |
We've had similar issues which has made it difficult for us to make sure our site users are using the latest version. One approach we've taken is to append a hash to each of the referenced files so that new versions of the file have a different hash and linked as such. This gets rid of the problem of caching old versions of the file because there never are old versions of the file. (source: orders.axial3d.com) Now this is alright for us because we use tooling ( Vite) to deal with it, but granted this would be a challenge to do manually. |
| [+] Design » Web API design to GET single or multiple resources (Go to) | | Tim Holloway |
I'm always appreciative of some pedantry, the devil is often in the detail. Is that really a json array contained in an object? Why not just the array? Is the outer object significant in some way? |
| [+] Design » Web API design to GET single or multiple resources (Go to) | | Tim Holloway |
Filtering by id is all I require this time so the extra complexity of supporting more elaborate query criteria would not be necessary. Great feedback though, thanks. |
| [+] Programming Diversions » Advent of Code 2024 (Go to) | | Tim Cooke |
Daughters trump AoC, I suppose 😁, congrats Stephan that's wonderful news. |
| [+] Programming Diversions » Advent of Code 2024 (Go to) | | Tim Cooke |
My favorite time of year 😁 |
| [+] Design » Web API design to GET single or multiple resources (Go to) | | Tim Holloway |
Ooh that's nice Ron. I'll have to check that. We're using typescript with some library no doubt but can't recall which. |
| [+] Design » Web API design to GET single or multiple resources (Go to) | | Tim Holloway |
Thank you Stephan. You've installed a new idea in my mind, the idea of using the request parameters as a filter makes a lot of sense. Any more for any more? |
| [+] Java in General » Modulus Operator (Go to) | | Campbell Ritchie |
I should clarify that in my example when I say "1 divided by 2" I mean Integer Division. |
| [+] Design » Web API design to GET single or multiple resources (Go to) | | Tim Holloway |
I am trying to design a web API to retrieve a resource, which is no problem, but my team and I have found ourselves with differing opinions on how to design the API that will return multiple resources. I'm well aware that API design can be very subjective and a matter of personal preference in many cases, so I'm hoping to open up a bit of a conversation to uncover some pros and cons with each of the options. Here goes. Let's start with the single resource endpoint. There is no contention around this and we're all pretty well agreed on it. There's a resource path fruits and a resource id. Pretty standard stuff. Now comes the differing opinions on how to design the endpoint that returns multiple resources. Here are the choices we have collectively suggested: Option 1 Option 2 Option 3 All return a list of resources Option 1 is a format I found in a book Build APIs You Won't Hate, but some feedback I got was that having essentially the same resource path /fruits/banana and /fruits/banana,apple return different return types, a resource or a list of resources, didn't feel right. I don't know how I feel about that. Suggestions and opinions welcome. |
| [+] Java in General » Modulus Operator (Go to) | | Campbell Ritchie |
Hello, and welcome to the Ranch! That's more of a maths question than a programming question, but let's do it anyway. As you know from your topic title, the % symbol in Java (and many other languages) represents the mathematical Modulo Operation, sometimes called modulus or mod. Let's remind ourselves of the definition: mathsisfun.com wrote:The modulo (or "modulus" or "mod") is the remainder after dividing one number by another. Now let's apply that to your example Which means 1 mod 2. That's 1 divided by 2 which is 0, with a remainder of 1. So the result of that operation is 1. Make sense? |
| [+] Ranch Office » It's nice that this site is still quite active! (Go to) | | Nirmal Vidura |
We appreciate your appreciation For a very long time I have told anyone who asks, and many who haven't, that CodeRanch is the best place on the internet. |
| [+] Beginning Java » ShadowApp.x (Go to) | | Norm Radder |
Avoiding an IDE and using Notepad++ and the command line to write and run your programs is a very good idea when you're starting out learning Java, or any language for that matter. As you seem to appreciate already it forces you to be explicit in everything you do and not reliant on the IDE "magic", which will become really useful later but only once you understand what the magic is. One might have said you have received tooling advice from some here on the Ranch already. However, it seems like things are getting a little out of control in your environment since you have compiled classes hanging around in locations you've forgotten about. Time for a bit of housekeeping perhaps? OP == Original Poster. In this topic that's you. |
| [+] Beginning Java » ShadowApp.x (Go to) | | Norm Radder |
I'm glad you solve your puzzle, well done. Thanks for letting us know too, we're a curious bunch and like to hear how things turned out. |
| [+] Beginning Java » ShadowApp.x (Go to) | | Norm Radder |
You have a class called ShadowApp on the classpath somewhere. Can you show us the contents of the directory from which you're compiling your MainClass.java please? I suspect you might find a ShadowApp.class file there. For example: Terminal MainClass.java Terminal Now I'll create a ShadowApp class Terminal ShadowApp.java Terminal Does that make sense? So check the directory where you have your MainClass.java file and show us what other files you have in there? |
| [+] Agile and Other Processes » Why SCRUM? (Go to) | | Tim Holloway |
Isha wrote:AI-powered agile maturity assessment module Frankly this sounds horrible. For a way of working that promotes value in people, relationships, communication, and continual adjustment in the pursuit of team effectiveness, among others, the idea of having an AI system make judgements on those very human, and thus very diverse among people, qualities does not strike me as a positive step. |
| [+] Beginning Java » ShadowApp.x (Go to) | | Norm Radder |
Hello, and welcome to the Ranch! For me your code does not compile Have you included the entire file content in your example? Are there any import statements at the top? |
| [+] Jobs Discussion » If companies will be able to get all work done by AI then how will developer survive (Go to) | | Tim Holloway |
You certainly are holding firm with your apparent belief that without the need for software engineer humans AI will be able to handle the complexity of writing software, diversity in possible solutions, and diversity in problem domains, and be able to produce exactly the thing that you want. A set of challenges that we technologists have struggled greatly with for many decades. I said it before, and I'll say it again: There is no silver bullet. I admire your optimism, but I don't share in it. |
| [+] Java in General » Getting Error on Non Number (Go to) | | Tim Holloway |
And finally, what Integer value are you expecting to get out of the whole thing? |
| [+] Java in General » Getting Error on Non Number (Go to) | | Tim Holloway |
And to ask my next question ahead of time.... What are you expecting getParameter("overridepercent") to yield? |
| [+] Java in General » Getting Error on Non Number (Go to) | | Tim Holloway |
What is GenericPrams.QMS_ALLOWED_CHARS_NUMBERS? A regex expression I assume? What is its value? |