-
Gave Reputation to Reverend Jim in Help writing a java anagram solver
Kewl. In Python that's a simple dict with key=sorted and val=list. -
Gave Reputation to Dani in Help writing a java anagram solver
> It’s also not Java. The question was tagged both c++ and java. I don't think the OP has a preference, and can probably follow along with either. -
Replied To a Post in Help writing a java anagram solver
Here’s a really neat algorithm: Write a small method to sort the letters of a word into alphabetical order (let’s call it alpha). Read the dictionary file creating a map … -
Replied To a Post in Help writing a java anagram solver
A lot of repeated code that should use arrays, but without comments it’s unreadable anyway. Did you test it with words that have repeated letters? It’s also not Java. -
Replied To a Post in HTTP Web Server: Java
I think the point is that when trying out ideas in Java you sometimes need something to deliver done html to a browser. You don’t need to set up and … -
Replied To a Post in HTTP Web Server: Java
That’s a great contribution. Thanks. I think most of us have written something like that for our private libraries, and as of Java 18 it seems people have noticed. “Text … -
Replied To a Post in Class Rectangle that computes the Area
You almost never see a redundant this. in standard Java. A programmer seeing it would immediately assume that there was something unusual going on that the writer wanted to draw … -
Replied To a Post in Class Rectangle that computes the Area
this.length vs length Dani: you only need this when you want to refer to the instance variable and its name has been hidden by a parameter of the same name. … -
Replied To a Post in Sales java program
You haven’t asked any questions, but I guess you want to know what’s wrong with that code… Using upper case where lower case is needed, and vice-versa Missing open and … -
Replied To a Post in What's your DaniWeb start page?
https://www.daniweb.com/posts/index/0 It's all I need -
Replied To a Post in Class constants that work with inheritance
If PHP works like Java then all the initialisation of the parent is completed before the initialisations of the child, so the parent's constructor will be executed before the Childs … -
Replied To a Post in How To Connect To Databases Using JDBC
Why promote the use of DriverManager.getConnection when, to quote Oracle's documentation, "a DataSource object is the preferred means of getting a connection." as of Java 1.4? -
Replied To a Post in Cam someone please assist me? what I have so far is dreadful
You have created a little class to hold the item names and prices. That's what any Java programmer would instinctively do. The problem is that the specification you have been … -
Replied To a Post in Java code to open application(.exe file) placed inside eclipse framework
Can you send those keys to the app's system input stream via ProcessBuilder? -
Replied To a Post in Want a code to terminate my program after a time interval
Build the process with ProcessBuilder. Start the process. Star at 30 minute Timer. Get the available results as they are written to the process' output stream (may need to code … -
Replied To a Post in ARRAY PROOGRAMMING CODE
You really should learn how to use arrays and maps before posting any more repetitive code (eg 147-178). -
Replied To a Post in Need help counting occurences of a letter from a file
DO you have any explanation for creating 52 variables, 52 if tests etc when a simple array or a map<char, int> would be so much better? And why use strings … -
Replied To a Post in Convert a temperature
Please let us know the email address for your teacher so we can submit the code directly to him/her and save you all that tedious copy/pasting. I'm sure you'll get … -
Gave Reputation to sourabh_8 in SCJP question
public static void main (char args[]) -
Replied To a Post in Why is my py code not working as intended?
> 14.31 has number 1 on the its integer side and a 4 on its decimal side, hence its a variant of 1.4. ??? -
Replied To a Post in Programming error -Java
You didn't say anything about the error. Is it line 38 - invalid syntax? -
Gave Reputation to toneewa in Generate 75,000,000 + Random Numbers Fast
My advice is learn about threads to do it in real-time. Otherwise, load/generate everything that is needed, **before** you start battles. Then, see what direction you need to go. Benchmarking … -
Replied To a Post in Generate 75,000,000 + Random Numbers Fast
I don't understand the need for both line 7 and line 8 but anyway... In that code the random number generation is not significant to the execution speed; it's utterly … -
Replied To a Post in Generate 75,000,000 + Random Numbers Fast
> Unfortunately, the FPS was even lower, at about 5. That’s inevitable. The overheads of maintaining the pool greatly exceed the cost of creating each random number. That approach is … -
Replied To a Post in Generate 75,000,000 + Random Numbers Fast
I'm no Pythonista, but if I understand it correctly there's a Queue class that is designed to be thread safe for concurrent producers and consumers. That would make the code … -
Replied To a Post in ArrayList: Semantic Error
Sounds like you had failed to provide a meaningful toString() method for the MArry class, so it's just inheriting the default toString() from Object, which just returns the object's hash, … -
Replied To a Post in Generate 75,000,000 + Random Numbers Fast
Time for a reality check. Generating a pseudo random number is one multiplication, one addition, one modulo. It’s a fast as a function can be. You can’t make it faster … -
Replied To a Post in Generate 75,000,000 + Random Numbers Fast
With 5000 soldiers that should be 5000 random numbers. The 1/15000 chance requires just one random number. -
Replied To a Post in How would I know if an e-mail originates from Office 365
In Outlook you can configure the outgoing server(s) to be whatever you want (eg Google). There's absolutely no requirement to use outlook.com or any other particular server. -
Replied To a Post in Double Frame Pop Up
The last time you posted a data file lines 2 and 3 were the same. If the user/pw matched those lines you would get two Booking forms. Lines 55-65 should … -
Replied To a Post in JFrame not showing up
You call the constructor for the new frame. That creates the frame but it does not display it. You also need to call `setVisible(true)` on the new frame. See line … -
Replied To a Post in Java Read Txt Error
Obviously something going wrong with the split because it's returning an array of length 1. You are splitting on a single space but the data seems to contain multiple spaces … -
Replied To a Post in Java Read Txt Error
ps: To anyone else thinking of asking a question like this, please note how Wafflez made it easy to get a good response: Wafflez posted all the relevant code, properly … -
Replied To a Post in Java Read Txt Error
Java arrays are zero-based, so the two array elements created by `line.split` are [0] and [1], not [1] and [2] -
Replied To a Post in Dictionary Java ArrayList Socket
Despite your variable and class names seemingly chosen to make this as hard as possible... It looks like the server may have closed the connection before the client gets to … -
Replied To a Post in Dictionary Java ArrayList Socket
You need to share the exact details of the socket exception -
Replied To a Post in Custom Media Server
I've used Plex for years with servers on Mac, M1 Mac, Windows, QNAP and Synology; clients on Mac, IOS, iPadOS (including remote access over internet), Apple TV, Chromecast, LG Television. … -
Replied To a Post in How do I delete duplicate photos on my Mac for free?
I used https://apps.apple.com/us/app/photos-duplicate-cleaner/id592704001?mt=12 Worked well for me. -
Replied To a Post in Java(using eclipse), Arraylist, compareTo
To make your Ukley class sortable you make it implement Comparable. Comparable is an interface with one method - compareTo(other) - that you implement by comparing the year, then the … -
Replied To a Post in How'd you get into tech?
My ambitions to do a PhD in Theoretical Physics were destroyed when I discovered the joys of cannabis in 1968. My resulting BSc grade left me looking for a job. … -
Gave Reputation to zemiak in need it asap ;-;
class Program { public static void main(String[] args) throws InterruptedException { //Scanner rr = read Scanner(System.in); Scanner rr = new Scanner(System.in); System.out.println( "Do you want to search for a book?: … -
Replied To a Post in I need help to do Minesweeper
If you already wrote the code then why are you asking for someone to write it and explain it for you? If you didn't write the code then (see previous … -
Replied To a Post in I need help to do Minesweeper
> I need someone who can write the program and explain it to me Do you have the slightest idea what a university course is for? What are you studying … -
Replied To a Post in Create a dynamic list name
You must have a new nestedList for each parent. Having just one and re-using it is not the answer because all the parents will share the same values. Remember that … -
Replied To a Post in Create a dynamic list name
That's why you use Lists not an arrays. Just create a new one and keep adding members as required. This seems very simple. Am I missing something from your requirements? -
Replied To a Post in Create a dynamic list name
It looks like you have just one nestedList for all of the parents. What you need is a new nestedList for each parent. -
Replied To a Post in need it asap ;-;
You are almost there for the yes/no. You correctly read the user's input into the variable N, but then you compare the wrong variable (n) with "No" and `"Yes". It … -
Replied To a Post in Create a dynamic list name
Why not `List<List<String>>` ? -
Replied To a Post in Derby DB is not working on mac.
One tiny point… XML is alive and kicking in Java 17. It’s just the EE related JAX stuff that was removed. -
Replied To a Post in Derby DB is not working on mac.
Code written for J7 should run ok on J17. There have only been very few changes in Java that create backwards compatibility problems. (Too few IMHO. It's a shame how …
The End.