| [+] Java in General » Replace character in String with space if NOT exist, fastest , best way ? (Go to) | | Tim Holloway |
I don't think "validate" is the right term for this. Validation is asking the question "does this meet the criteria? Yes or No". What you are doing is a data transform with rules. I'd be interested to see how you've gotten on so far with tackling the problem to know where to start with helping. Can you share your progress please? I'm particularly interested in the data types and storage locations for the input data. Are they Java Strings? Are they files? How large are the input Strings? You mention "best" and "fast" but don't give any criteria for those. What does "best" mean to you?How fast is fast enough? |
| [+] I/O and Streams » Apache HttpComponents Client alternative (Go to) | | ignaz vanb |
What vulnerability? Do you have a link for it? A vulnerability comes with details of the affected versions and often a recommendation to update to a version higher than the affected version. |
| [+] Introductions » Thrilled to be back to talk about the Well Grounded Java Developer 2nd Ed starting November 15th! (Go to) | | Tim Cooke |
Campbell Ritchie wrote:It was the year before that, 2014. You are right, it was 2014. I have a photo of the three of us at that conference. I also remember it being a good event, and I also bumped into another past Bartender Simon Brown, the creator of the C4 model. |
| [+] Introductions » Thrilled to be back to talk about the Well Grounded Java Developer 2nd Ed starting November 15th! (Go to) | | Tim Cooke |
Welcome back Martijn, it's nice to "see" you. Once a Bartender always a Bartender remember, so drop in any time you like. Fun fact: Campbell Richie and I met you once at Devoxx London 2015. At that time I was mere days away from becoming a Bartender myself although I didn't know it. Campbell knew it, but I didn't. |
| [+] Beginning Java » Unable to design a solution (Go to) | | Ranagal Adapla |
Oh yea I second what Junilu says. Definitely do not try and implement your own solution when you have utilities built in such as WatchService. |
| [+] Beginning Java » Unable to design a solution (Go to) | | Ranagal Adapla |
I would also consider whether Spring Boot is needed for such a small application. I propose not. |
| [+] Java in General » 400 Bad Request (Go to) | | Tim Holloway |
Your unorganised "poke and hope" approach to problem solving is not serving you well and I believe you are creating more issues on top of your original issue. I propose you undo all of the things you have done during the course of this conversation and find your way back to the original state with the original error. If you can. Once you have done that, there are a couple of open questions asked near the start of this thread that would be a productive place to start in finding the answers to. We can help you find a solution, but only if you work with us. Let us know how you get on. |
| [+] Object Relational Mapping » Why does Eclipse not show Hibernate Query Results properties? (Go to) | | Tim Cooke |
Fair enough. Thanks for taking the time to come back and let us know how you got sorted. |
| [+] Object Relational Mapping » Why does Eclipse not show Hibernate Query Results properties? (Go to) | | Tim Cooke |
Looks more of a Hibernate question than an Eclipse question to me. I've added it to the ORM forum too. Personally, this is one of the reasons I dislike working with Hibernate. Too much integration wizardry between the database and codebase for my liking where everything is peachy until something goes wrong after which it becomes a complete mystery. Maybe that's a reflection on my ORM skills rather than the ORM tools. |
| [+] Security » Storage, encryption, decryption password on the client side (Go to) | | Tan Quang |
It sounds to me like you're building your own password manager. Is that right? Something equivalent to Lastpass or 1Password or equivalent service? Given that these things exist and are available for free in some cases, are you sure you want to roll your own? If you're actually writing the application your users are logging into and you're thinking about providing some convenience for them to not need to remember their password, then you might consider not doing that. The responsibility to manage passwords lies at the user and if they want something to auto fill their password then it's up to them to subscribe to a service that does that. Or they may not want such a convenience. Either way it's up to them, not you. |
| [+] Java in General » 400 Bad Request (Go to) | | Tim Holloway |
Hi Cezar, you may do well to take a pause at this moment. As Stephan has also noted, you do not appear to be taking any notice to the advice and guidance you are receiving here and because of that it is no surprise that you are making no progress towards resolving your problem, or even understanding what the problem is. If you wish to make progress and ultimately solve your problem then please consider taking some time to carefully re-read over this thread and follow the guidance given. There are some open questions that you have not answered that are key to understanding the problem you are facing. Over to you. We will wait. |
| [+] iOS » GraphQL on mobile (Go to) | | Tim Cooke |
What you have there is GraphiQL. I'm interested in what you mean by this though? the desktop version of the site cannot open |
| [+] Java in General » 400 Bad Request (Go to) | | Tim Holloway |
That doesn't exactly answer my question. I'm trying to guide you through the journey of evidence gathering which will eventually lead you to understanding the problem. Only when you understand the problem can you work towards a solution. Let's start with one question at a time: 1. What errors are on your server relating to it responding with 400 Bad Request? |
| [+] Java in General » 400 Bad Request (Go to) | | Tim Holloway |
What do your request headers look like? Did you find any errors on your server relating to responding with 400 Bad Request? |
| [+] JDBC and Relational Databases » DB selection (Go to) | | Tim Holloway |
Chris, I think you have completely missed the point of the discussion here about MySQL and MariaDB. They are so similar that it makes little difference which you choose, so pushing for a hard recommendation is pointless. Al has said "use MariaDB" as is their preference, but "use MySQL" would have been an equally helpful recommendation. It's your choice. |
| [+] Java in General » 400 Bad Request (Go to) | | Tim Holloway |
Your web server will most likely log that error with more details than is returned to the browser. Check those server logs to see which header field is too large and by how much, check what your web app is sending in that header field, then figure out how to either reduce the size of the field being sent, or increase the accepted size on the server. Start with the server logs. If you need help deciphering them you can copy and paste it here for us to see. |
| [+] Programmer Certification (OCPJP) » * Winners: OCP Oracle Certified Professional Java SE 17 Developer Practice Tests: Exam 1Z0-829 (Go to) | | Tim Cooke |
First, a big thanks to Jeanne Boyarsky & Scott Selikoff for being here to promote the book OCP Oracle Certified Professional Java SE 17 Developer Practice Tests: Exam 1Z0-829. The winners are: Shaik AshishPeter SchusterAnlar LarsenArjun Mani 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 Practice Tests: Exam 1Z0-829 - Tuesday, October 11th, 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. |
| [+] JDBC and Relational Databases » DB selection (Go to) | | Tim Holloway |
Depends on your criteria for "best". Unless you have any specific requirements then pretty much any database of your required type, i.e. relational, document, graph, will usually suffice. Quite often DB choice comes down to which one the developers are most comfortable developing with. |
| [+] Other Open Source Projects » Image Manipulation Portable Software (Go to) | | Tim Holloway |
You don't mention what operating system you are using? Pretty easy to find things though, I did a search for "linux cli image manipulation" and was presented with lots of options. Adjust the search terms for your operating system and I expect you'll have similar success. |
| [+] Other UNIX » Production Log Analysis or File Search or Replace Commands in Linux (Go to) | | Chris Mary |
You don't need us to validate them. You have a computer the same as we do to test them with. |
| [+] Other UNIX » Production Log Analysis or File Search or Replace Commands in Linux (Go to) | | Chris Mary |
Of course if you are stuck on a specific problem then please come and ask for help making sure you've described clearly what you've done, what you are expecting to happen, and what is actually happening. |
| [+] Other UNIX » Production Log Analysis or File Search or Replace Commands in Linux (Go to) | | Chris Mary |
Chris Mary wrote:Tim Cooke, Can you please help/share me the commands with sed to solve the above replace need of #5 to #8? We've all given you some tools and general guidance that you can use as a starting point on your journey of learning. Why don't you take it as a challenge to answer each of your questions yourself by learning just enough of each tool to achieve it? That's pretty much how I've learned most things over time. |
| [+] Other UNIX » Production Log Analysis or File Search or Replace Commands in Linux (Go to) | | Chris Mary |
grep for finding things in files find for finding files sed for replacing things in files less, vim, emacs, etc for viewing file contents All of those things will most likely already be available on your remote system so you can get started right away with experimenting and learning how they work. |
| [+] GNU/Linux » Log editor in unix...It is hard to drag (Go to) | | Chris Mary |
I figured that given he said Any small tool can be allowed to install and not bigger one which was a bit vague, in my experience you only find out the thing you've installed is too big / unwanted when the owner is calling you up in a rage, or worse his boss is phoning you up in a rage. An unpleasant scenario worth avoiding. |
| [+] GNU/Linux » Log editor in unix...It is hard to drag (Go to) | | Chris Mary |
From your question I'm making the following assumptions 1. The Linux system is a remote system. 2. The Linux system is owned by someone else. Installing X is a significant change to the system and I'd suggest seeking permission from the owner for that. Although I'm not entirely sure what you are asking. Are you looking for a full window based experience for the whole operating system because you are not comfortable with the command line? Or are you looking for scroll functionality for a particular use case, such as editing text files? |
| [+] Programmer Certification (OCPJP) » * Welcome Jeanne Boyarsky & Scott Selikoff (Go to) | | Scott Selikoff |
This week, we're delighted to have Jeanne Boyarsky & Scott Selikoff helping to answer questions about the new book OCP Oracle Certified Professional Java SE 17 Developer Practice Tests: Exam 1Z0-829. The promotion starts Tuesday, October 11th, 2022 and will end on Friday, October 14th, 2022 We'll be selecting four random posters in this forum to win a free copy of the book provided by the publisher, Sybex. Image from https://m.media-amazon.com Please see the Book Promotion page to ensure your best chances at winning! 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. |
| [+] IntelliJ IDEA » Does IntelliJ Community Edition has Drop to Frame Option? (Go to) | | Tim Cooke |
I've never used that feature. Have you had a look at IntelliJ yourself to see if it does have that feature or not? Perhaps you can report back with your findings. |
| [+] Other Open Source Projects » Flow Chart or Architecture Diagram (Go to) | | Tim Holloway |
| |
| [+] Other Open Source Projects » Flow Chart or Architecture Diagram (Go to) | | Tim Holloway |
| |
| [+] Beginning Java » JVM vs JRE (Go to) | | Campbell Ritchie |
Let's expand the acronyms and see if that helps answer your question JDK: Java Development Kit JRE: Java Runtime Environment Does that help? |
| [+] Meaningless Drivel » Year 1 (5-6 years old) computing curriculum (Go to) | | Campbell Ritchie |
They're missing an essential component of computing Effective Googling |
| [+] Spring » How will you restrict a user so that he is not able able to do daily trades [Interview question] (Go to) | | Tim Holloway |
Perhaps so, but I'm still not telling  |
| [+] Spring » How will you restrict a user so that he is not able able to do daily trades [Interview question] (Go to) | | Tim Holloway |
Simon Banger wrote:@Tim Can you share the solution ? Unfortunately not, since financial trading companies get really fussy about such things. Sharing details about the matching engine that only a developer who worked on it would know could be viewed as insider trading, and I don't want to go to prison thank you very much. If the requirement is to prevent a user from entering an order based on some account based criteria then you have no choice but to do up front pre-trade checks, then allow or deny the order entry based on the result. Something really simple to indicate whether the account is in good standing or not for a particular market, for example a boolean flag canTradeFX true or false. After every trade there can be some post trade process that updates the state of the account and sets that flag to false if some criteria is out of bounds, such as your daily trade limit. In my experience, you don't have to perform such pre-trade checks. The trader signs an agreement with the trading platform operator before gaining access that outlines the markets they want to operate in and what margins they are allowed. Margins are usually based on how much money you can prove you have in the bank to pay for your trades. Like I said before, the account checks are done post trade (called clearing) and if you're operating outside of your agreed bounds then you have to explain yourself but often times still pay up. There are insurance policies available for serious errors of this nature, and there are many examples of trading houses going bust in a matter of minutes because of bad algorithms. Performance is something you have mentioned but the presented architecture doesn't lend itself very well to high performance. For example, if you want your Java app to be very fast then Spring is a poor choice, just plain Java would be a better option. Then you mention "a distributed cluster environment" and oh boy there's so much to unpick there, but synchronising state across multiple instances and the unpredictability of network traffic adds an overhead that works in direct opposition to going fast. That doesn't mean you can't make use of multiple servers to operate your trading platform but you need to be smart about how you divvy up the work. One of the other problems with networking is that packets arrive out of order from which they were sent, which for HFT traders is a problem because you can enter your order first but then miss out on a trade because your competitor's order overtook yours on the wire. It sounds ridiculous but I kid you not, it happens. Even within your Java application you need to be careful that order entry sequence is maintained, so be careful when using concurrency, threads, processes and the like. Trading platforms are a very complex business, and there are many different ways to implement them. I expect the purpose of your interview question was to see how you think about the problem and kick you off down the rabbit hole of "what about this" and "what about that". The rabbit hole goes deep, I assure you. If it was easy, everybody would be doing it. |
| [+] Spring » How will you restrict a user so that he is not able able to do daily trades [Interview question] (Go to) | | Tim Holloway |
It's a fair question, as Stephan says, if you're applying to work on a trading platform. As with most things there are multiple valid solutions so they're not expecting to take your answer and put it right into production, rather they're just looking to see how you think about user authn and authz. Having worked on a trading platform myself I know one solution that has been proven to work, but that doesn't mean there aren't others equally as valid. |
| [+] Spring » How will you restrict a user so that he is not able able to do daily trades [Interview question] (Go to) | | Tim Holloway |
There are two concepts of interest here: Authentication and Authorization (sometimes referred to as Authn and Authz, respectively). Authentication is the process of verifying that the person accessing your system is a registered user and is using the correct credentials, i.e. the person attempting to authenticate as TraderBob is actually TraderBob. On a website this might be via a username and password challenge, combined with MFA perhaps. For algo trading, or HFT (High Frequency Trading), that might be via a system key based challenge. From the trading platform point of view that answers the question of who is placing the trade. Next is authorization, and that's the process of deciding whether TraderBob is allowed to do the thing he has requested. This is where your $50,000 limit check could be performed. At this point I might venture into the performance implications of doing all these Authz checks prior to making a trade, but this statement tells me that performance is of little concern to the trading platform authors an online trading platform that uses spring based microservices. The platform is running on a distributed cluster environment. Although if we were to pretend that the trading platform was actually very fast, then I might propose that trading limit checks are performed post trade so as not to create a bottleneck in the order entry and matching process. Trades could be manually undone if it turns out TraderBob is operating wildly outside of his agreed limits, and if he persists he might find his Authn will start failing. |
| [+] OO, Patterns, UML and Refactoring » I never make any mistakes because I can't see them. (Go to) | | Tim Holloway |
We use ADR's in a broader context. JavaDocs are good for documenting decisions you've made in your Java code, but less so on on the decision to use Java in the first place, or why we decided to run it in a container rather than an EC2 (in AWS), or why we chose AWS over GCP, or Azure, or whatever. |
| [+] OO, Patterns, UML and Refactoring » I never make any mistakes because I can't see them. (Go to) | | Tim Holloway |
Yes, once accepted ADR's are immutable. If you change your mind on a decision later you document that decision in a new ADR and state that it supersedes an existing ADR. |
| [+] OO, Patterns, UML and Refactoring » I never make any mistakes because I can't see them. (Go to) | | Tim Holloway |
That makes a lot of sense. The problem with your own mistakes is that you're the one that made them, and given that you didn't intentionally make the mistake it follows that you are unaware that it is a mistake. There is a slightly different flavour of "mistake" that you might categorise as a deliberate mistake. That is one dependent on some context that a newcomer might not be aware of. In those instance I am a proponent of the ADR (Architecture Decision Record), and it's here where you can explain why a particular decision was made so that the newcomer doesn't have to wonder. Without an ADR the newcomer has 2 choices, either blindly accept the current state, or change it, and either one of those decisions could be a mistake. Perhaps the context supporting the original decision has changed and doing something different is the right thing to do, or perhaps it hasn't and leaving things as they are is the right thing to do. Without understanding the motivators behind the original decision you just don't know, until you do, later. |
| [+] OO, Patterns, UML and Refactoring » Software Mistakes and Tradeoffs: Choosing your tech stack (Go to) | | Sean Corfield |
I had an interesting conversation with a friend today about a project he was managing. There was a desire within the team to use Kubernetes, and there was some debate about whether that was a good choice or not. The conclusion was that even though it might not have been a perfect fit in terms of technology for the presented problem, it was the technology the team were most familiar with when it came to supporting and resolving production issues. It was an interesting take, and certainly some validity in it, that the "right" technology choice should be considered not only for development, but for support and maintenance too. |
| [+] Cloud/Virtualization » * Winners: AWS Cookbook: Recipes for Success on AWS (Go to) | | Campbell Ritchie |
First, a big thanks to John Culkin & Mike Zazon for being here to promote the book AWS Cookbook: Recipes for Success on AWS. The winners are: Robert SwartchickRaja Sekhar KaranamM KhalidCarl McGee 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 - AWS Cookbook: Recipes for Success on AWS - Tuesday, September 6th, 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. |