7,116 Posted Topics

Member Avatar for makmuhefe

1. Do not hijack other people's topics 2. Do not revive years-old topics 3. Never ask others to do your work for you If you would like help in doing the conversion yourself then start a new topic, and explain what you have done/tried so far.

Member Avatar for K3haled
0
9K
Member Avatar for fonzali
Member Avatar for Quinton_1

Ken_10 and anyone else who thinks like that: Getting someone to do your school work is stupid. You'll learn nothing and just waste the opportunity for education. It also penalises genuine students who are competing with you using their own effort and skills. You're also like to get caught and …

Member Avatar for jackpetersoons3
-2
795
Member Avatar for singhdevendra8

You can... `import static java.lang.Math.PI;` and refer to it as `PI` or don't use an import and refer to it as `java.lang.Math.PI` in your code. Why???

Member Avatar for Mule_1
0
222
Member Avatar for zubairarshad

i've been running the ARM version on an M1 Mac with Parallels and wow, is it fast. As a Mac user I love the new look with the soft corners etc - the blocky graphics of 10 look just like Windows 95 but without the hardware limitations to justify it. …

Member Avatar for Reverend Jim
0
125
Member Avatar for dimitrilc

I love the way these posts reveal little goodies hat have slipped into Java over time. I failed to notice `String.indent` (new in Java 12), and that also lead me to discover `stripIndent()` which arrived with Java 15. I also love String's` formatted(...) `method (new in Java 15) that works …

Member Avatar for JamesCherrill
2
165
Member Avatar for dimitrilc

> The filter() and map() methods automatically perform the Optional emptiness check for us, and return an empty Optional object downstream Thank you so much for this little gem. I was always disappointed with Optional, too much overhead and verbiage compared to the `?.` syntax of some other languages. But …

Member Avatar for JamesCherrill
2
2K
Member Avatar for Sagar_9

Googling "pin block encryption java" got me. lot of hits. Is that what you meant?

Member Avatar for Sagar_9
0
109
Member Avatar for Khen Louegie

Its a very bad idea to have multiple Scanners usig the same input stream (System.in). You never know which Scanner will read the next character from the stream, or which Scanners may have read ahead and thus consumed characters that you hoped to read with a different Scanner. Create just …

Member Avatar for JamesCherrill
0
291
Member Avatar for dimitrilc

Good stuff. In addition to the above, I'm a big fan of the classes in Collections.unmodifiable , eg Collections.unmodifiableList. Collections.unmodifiableMap etc Anytime you need to give limited access to a private Collection just provide a getter that returns the Collection wrapped in the corresponding Collections.unmodifiable. Now the user can see …

Member Avatar for JamesCherrill
2
177
Member Avatar for kasmar45

Welcome - and please accept, with my compliments, the mantle of "Oldest Old Timer". That was me, until you joined, but at only 73 and never having programmed in less than 16k (IBM 1130) you trump my stats convincingly. Like you I still code as a hobby (and to help …

Member Avatar for Reverend Jim
1
50
Member Avatar for din_hilmi

Maha Your rude demand for someone to drop whatever they are doing and do your homework for you is attached to a 10 year old dead topic. so 0/10 for post quality. Think on your mistakes, start your own new topic and show some courtesy and some effort, then maybe …

Member Avatar for Aditya_47
0
44K
Member Avatar for brodeur

AFAIK there isn't anything, which is why I hacked this together a while back. Feel free to use it without any warrenty. SImply call `ConsoleWindow.withInput();` and continue to use System.out (or err) as usual. Read from System.in as usual, eg via a `Scanner`. import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import …

Member Avatar for Zirely
0
243
Member Avatar for jsrankin

half your life / 10 years sitting at a terminal hardly qualifies anyone as a "renaissance man"... > the term Renaissance man, often applied to the gifted people of that age who sought to develop their abilities in all areas of accomplishment: intellectual, artistic, social, physical, and spiritual. (WikiPedia)

Member Avatar for Reverend Jim
0
48
Member Avatar for Atahladte19

As was the case with manual labour, smart machines will increasingly offer better price/performance than humans over more and more activities, replace them, thus creating more unemployment. That will be true not just of existing jobs, but also any new jobs that the change creates. In countries with an ethos …

Member Avatar for JamesCherrill
0
102
Member Avatar for Sofia_7

I don't think there's anyone here who can do that for you. You should contact Apple directly.

Member Avatar for jwenting
0
400
Member Avatar for dimitrilc

Hi Dimitrilc OK, thanks for the reply. That's what I thought, but I just wanted to check that I hadn't missed something. It is 100% valid Java, even if it's redundant. My preference is in the 60% who would skip it, so when I saw it there I immediatley started …

Member Avatar for JamesCherrill
3
480
Member Avatar for Mohamed_167

Keyboard handling in Swing is always a challenge because the focus is often not where you think. You can often get round that by creating a keyboard handler and adding that to all the components where it could possibly make sense. The "right" solution according to Oracle is not to …

Member Avatar for JamesCherrill
0
507
Member Avatar for techlifelk

Which thread is that method running on? If it's the Swing thread (eg because it's responding to a button click) then it will hold up all Swing activity until it returns. Only after the method returns will Swing perform all those visiblity changes, and probably optimise them ot of existance …

Member Avatar for JamesCherrill
0
94
Member Avatar for John_165

Short answer: small projects (eg < 1 man-month) rarely need interfaces or abstract classes, but large projects use them to define exacty how different parts of the app will communicate with each other. [This section](https://docs.oracle.com/javase/tutorial/java/IandI/createinterface.html) from Oracle's Java tutorials explains it pretty well.

Member Avatar for JamesCherrill
0
41
Member Avatar for safiullah786

IF your plan is to do nothing, wait until the day before the cutoff, then expect someone else to drop everything and do it for you... ... then nobody here is qualified to give you the kindof help you really need.

Member Avatar for Dani
-1
317
Member Avatar for ekennedybills

i think you'll find that still adds the -1 to the total before exiting the loop. Given the need to exit the loop after validating the input but before processing it I would suggest this pattern: while true get and validate input if (input = SENTINEL) break; process input

Member Avatar for JamesCherrill
0
86
Member Avatar for MagnusTheRed90

For what it's worth I tried a little test in Java and the AES encrypted output was always the same for the same input values. I'm no expert, but from my reading of a few web sites the algorithm looks like there is no dependency on anything other than the …

Member Avatar for JamesCherrill
0
95
Member Avatar for angxlx

Two problems with that code: It creates a second Scanner (line 20). Two Scanners on the same input stream is a formula for chaos. Either of them may read ahead from the stream thus preventing the other from seeing those characters, with unpredictable results. One program -> one Scanner(System.in). It …

Member Avatar for JamesCherrill
0
105
Member Avatar for Xeros606

Your "correct" progam fails to remove the zeros. It just overwrites them and stops printing before it gets to the original values left at the end of the array. As for the quality of the code, including Java naming convention, formating and indentation, it's maybe some of the worst code …

Member Avatar for JamesCherrill
0
3K
Member Avatar for LZS_405

I think they are looking for a simple trainee exercise, not a commercial-grade full system. What's "Java 2"? We're currently on Java 15.

Member Avatar for jwenting
0
101
Member Avatar for Błkèęš

In Java hashes are calculated by the `MessageDigest` class. Here's the documentation: https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/security/MessageDigest.html Come back here if you need help after taking the time to read and understand that

Member Avatar for JamesCherrill
0
48
Member Avatar for nur_721

The close bracket on line 4 ends the class definition, so whatever follows has to be a new class/interface/enum. Line 7 attempts to define a method inside the method definition starting on line 5. You cannot nest method definitions. Plus (not exectly errors, but bad style): Class names should be …

Member Avatar for JamesCherrill
0
61
Member Avatar for lilindiekid

where to start? Start with design. Classes that represent the nouns of the probem domain with their public interfaces that model the verbs. Don't worry about code yet. Here's a good site that talks through how to do that: https://www.eventhelix.com/object-oriented/object-oriented-design-tips/

Member Avatar for JamesCherrill
0
144
Member Avatar for Siti_4

I'm frankly baffled by the requirement for a `static void` method to calculate what should be an instance variable, using existing instance variables. It makes absolutely no sense.

Member Avatar for JamesCherrill
0
91
Member Avatar for clementer

An ArraylIst of ArrayLists is like a 2d array. Which means that there's no single definition of what it means to sort it. Eg Sort each sub list ? sort the sublists within the main list according to some criteria ? sort all of the data and store the result …

Member Avatar for tinstaafl
0
893
Member Avatar for clementer

I can assure you that += does work if you use it correctly. Without seeing your code there's nothng mre anyone can do to diagnose your problem. Post the code.

Member Avatar for JamesCherrill
0
29
Member Avatar for clementer

Hint (also applies to your other thread): You can get the nth element in a List as follows: `list.get(n)`

Member Avatar for JamesCherrill
0
29
Member Avatar for clementer

take a moment to think through the value(s) of j on lines 6 and 7. on each pass of the loop you do the whole calculation for just one value of j, then you do that multiple times. pseudo-code the solution on paper and step throught it a couple of …

Member Avatar for JamesCherrill
0
48
Member Avatar for komalgul

Go to adobe.com and purchase the kind of licence that suits you best.

Member Avatar for Reverend Jim
0
52
Member Avatar for hemoram631

What exactly is the point of this? How many people are going to do a clean install of WIndows 10 on a 32 bit machine in 2021? To quote Microsoft: "Beginning with Windows 10, version 2004, all new Windows 10 systems will be required to use 64-bit builds"

Member Avatar for JamesCherrill
-1
32
Member Avatar for foumzeur
Member Avatar for rhea_6

It seems like it's looking for your java file in the wrong place. It's looking in c:\Program Files\java, presumably because that's your working directory (?). That's a really bad place to put your own source code projects. What directory is Main.java in? What exectly is the command you are using? …

Member Avatar for Paul Norris
0
88
Member Avatar for Maulana_1

looks like a simple array sort to me. If so the pseudo code is already well known and you just have to match it to the details of this implementation

Member Avatar for rproffitt
0
94
Member Avatar for ventus.solllll

The instructions are almost pseudo-code for the actual solution. Each sentence represents a few lines of code, all in the right order. So start with "Read from the user the number of cities " and code that, then go on to the next line. If you get stuck come back …

Member Avatar for JamesCherrill
0
72
Member Avatar for tinstaafl

That looks like fun! To see if I understood it correctly I tried a Java version. Before I publish it maybe you could validate it by decoding the following: key = "DaniWeb" data = {-87, 8, -88, 77, -110, -100, -123, -1, 86} cheers J

Member Avatar for JamesCherrill
2
330
Member Avatar for Keep_2

I've been programming in Java since the mid-90s (working for HP Consulting), and programming since 1969, but I'm not prepared to call myself a "master". The more I learn, the more aware I am how much I still don't know. Anyway, my first answer is that the only way to …

Member Avatar for Reverend Jim
0
80
Member Avatar for Mr.M
Member Avatar for KINYUA_1

I can't see anything wrong with that code. I pasted it into a little stand-alone test and it works perfectly... JFileChooser fileChooser = new JFileChooser(); int result = fileChooser.showOpenDialog(null); File f = fileChooser.getSelectedFile(); long time = f.lastModified(); System.out.println(new Date(time));

Member Avatar for JamesCherrill
0
73
Member Avatar for M.S.A 

[CODE]NOTE: I've not write the Exceptions yet .. I will do when every thing work ..[/CODE] There may be a more stupid thing posted this year on Daniweb, but I doubt it. How can you possibly try to debug your code when you chose to ignore any and all arrors …

Member Avatar for Gergely_1
0
2K
Member Avatar for Arunshree

> Java/ Javascript is usually client side There's no such thing as "Java/ Javascript" javascript is client side. Java (not the same thing) is used for both, but the majority of Java development today is corporate server-side.

Member Avatar for rproffitt
0
201
Member Avatar for Papa_Don

> 9999999999 That's 10 digits, not 7 and as such can hold values > 2^31 which cannot be stored in an int. (Although I have no idea if that is actually the problem. Just sayin')

Member Avatar for JamesCherrill
0
46
Member Avatar for gh.fuz

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java …

Member Avatar for JamesCherrill
0
6K
Member Avatar for Nymphalys08

Maybe the problem is that `choice` is still zero after a failed `nextInt()`, thus exiting the loop. Try setting `choice` to some other vaue (eg -99) in the `catch`.

Member Avatar for JamesCherrill
0
74
Member Avatar for priyamtheone

This is presumably all about passing params as references rather than values (the default in C#) To pass a parameter as a reference use the `ref` keyword. See https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/passing-parameters

Member Avatar for JamesCherrill
0
122

The End.