7,116 Posted Topics

Member Avatar for sadiyah_1

If it's so important and urgent then I assume you must have have already started to work on it yourself. Surely you're not waiting for someone else to do it for you (for free). Post what you have done so far.

Member Avatar for JamesCherrill
0
1K
Member Avatar for Mike1986

Lots of people can. If you can't it's because you haven't bothered to try. Try to do it. If you get stuck post your code here with an explanation of why you're stuck, and someone will help.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Harshali_1

Indeed there are cases where a loop can be used instead of recursion, and in those cases the loop will carry less overhead. These are mainly encountered in programming courses when the concept of recursion is first introduced. (I don't know about Python specifically, but a decent compiler will recognise …

Member Avatar for sritaa
0
477
Member Avatar for V3N0M

> have resulted in errors. What errors exactly? Help us to help you.

Member Avatar for JamesCherrill
0
3K
Member Avatar for ddanbe

To make room for "encoding" and "error" perhaps? (Personally I'm not familiar with either language.) Not to mention "thermalprint" which appears in every single sub-heading.

Member Avatar for Dani
0
2K
Member Avatar for overwraith

What do you mean by "the statistical value"? If it's "average, std deviation etc" then you can't alter them except by altering the random numbers. Eg adding .7 to each value will increase the average by .7 Or, are you looking to convert uniformly distributed random numbers into a set …

Member Avatar for overwraith
0
754
Member Avatar for terrie4

RoboVM was a nice open source project that ended up being owned, then killed, by Microsoft in 2016. In my opinion you would be mad to start a new development on a dead platform. Moving from Java to Swift isn't that hard, and you'll love the way its designers learned …

Member Avatar for rproffitt
0
377
Member Avatar for dukoolsharma

Your title and question are inconsistent! Is it interfaces in inner classes, inner classes in interfaces? Interfaces in inner classes: Yes, sometimes. Because interfaces are by definition static, they can only be declared in a static inner class. Thus: class Testing { static class Inner { interface InnerInterface { } …

Member Avatar for JamesCherrill
0
294
Member Avatar for golith1974

Driver line 2 is the error. It means you have two lists where you should only have one. You have a list in your library class, you don’t need another one in the driver. You add the item to the list in Library, then print the list in Driver - …

Member Avatar for JamesCherrill
0
355
Member Avatar for Kam_1

You could synchronise drawing and modifying, but that would prevent them running concurrently and immediately halve the performance of the app and make the UI less responsive (not to mention the complexity and overhead of all that synch). So if you just want to loop thru the list while drawing, …

Member Avatar for JamesCherrill
0
344
Member Avatar for Karen_9
Member Avatar for Vinod_16

Which address do you want? Could be the public address supplied by your ISP Could be the local address supplied by your router Could be 127.0.0.1 as above if you want to refer to the computer you are on

Member Avatar for Reverend Jim
0
379
Member Avatar for vegaseat

The problem with a text file is that any modification to the text is highly visible to the user, so this technique won't work.

Member Avatar for JamesCherrill
5
10K
Member Avatar for Kam_1

The simplest code to check for duplicates in a List is probably to add its items to a HashSet (HashSet does not allow duplicates) and check if the size is the same, eg var x = new ArrayList<Integer>(); x.add(1); x.add(2); x.add(2); x.add(3); var y = new HashSet<Integer>(x); System.out.println(x.size() - y.size() …

Member Avatar for JamesCherrill
0
287
Member Avatar for misstj555

Standard answer: It's a real problem with Scanner's design - so many people fall into this trap. You have some input alternating an int followed by some text, eg 101 John Doe ... and you try to read it with int num = scanner.nextInt(); String name = scanner.nextLine(); ... and …

Member Avatar for misstj555
0
2K
Member Avatar for Kam_1

I already told you what causes this probem and how to fix it. You are wasting your time and ours by asking the same question twice.

Member Avatar for JamesCherrill
-1
2K
Member Avatar for almarionoah

My machines all have an SSD for the system and applications, and a large HD for data. The large HD is partitioned so it has a bootable clone of the SSD and a second partition for data. I re-do the clone every month or so. So given a serious problem …

Member Avatar for adam_k
2
4K
Member Avatar for Pk11
Member Avatar for Kam_1

1 At startup you are updating the content of a visible component on a non-swing thread - use invokeLater etc 2 Don't use fixed sizes. That destroys your portability. 3 see other post... paintComponent (no s)

Member Avatar for JamesCherrill
0
551
Member Avatar for ABaileyRush92

// simple example... int[] data = {1,2,3}; // create an array doStuff(data); // pass it to the method ... void doStuff(int[] arg) { // declare method with an array parameter // do stuff with arg[0], arg[1] etc } To call an instance method from main (which is static) you need …

Member Avatar for JamesCherrill
0
462
Member Avatar for Amruta Sriram

Duplicate posting of the same question asked **and answered** on coderanch. Also apparently posted on dreamincode.

Member Avatar for JamesCherrill
-1
641
Member Avatar for dukoolsharma
Member Avatar for John221

Good project! Yes, MVC is a good way to go, although it may be overkill for a simple app. The important thing to have a clean separation between model and view. You can use the Observer pattern to link a CarGraphics object to a Car object (just like any Swing …

Member Avatar for JamesCherrill
1
3K
Member Avatar for HimaniBansal

My background is in Smalltalk, so I can't understand the design decision to return None/void from a method/function that has no specific return value. In Smalltalk a method with no explicit return wil always return the receiver object, which enables you to chain calls together like (pseudocode) `person.setName(etc).setAddress(etc).setDOB(etc).print()` Interestingly, Java …

Member Avatar for JamesCherrill
0
410
Member Avatar for SN Technologies
Member Avatar for dukoolsharma
Member Avatar for JamesCherrill
0
355
Member Avatar for sgw

> Isn't &var the address of any variable var, regardless its type? (or am I missing something?) Yes, but you are missing something, namely that the cout << operator for a pointer to a char is overloaded so it works well for char arays (used to hold strings in C). …

Member Avatar for sgw
0
568
Member Avatar for Andsello

Your approach to this is somewhat confusing - why not 4 timers each handling the color change for one button? Anyway, the NPE may be related to the button arrays - that's arrays, not array, because you have two of them, one in the Thread_ES2 instance started by JavaFX when …

Member Avatar for JamesCherrill
0
298
Member Avatar for Gheorghita

Your question is too vague. What exactly do you need to know? How far have you got, and so where are you getting stuck?

Member Avatar for JamesCherrill
0
169
Member Avatar for alan.davies

I've just understood what this topic is all about! I've been monitoring the Programming forum regularly, but there's nothing Java going on. Then this morning I randomly tried looking at the generic Latest Posts and there, at the top, is a sensible Java question, with the user showing what they …

Member Avatar for Dani
1
5K
Member Avatar for Snowdo

I share your confusion. The player doesn't actually play anything, just says OK and the computer rolls 4 dice and scores the result. My best guess is that some user interaction mqy be used for the "roll again to win" case? In which case letting the cmputer play is the …

Member Avatar for JamesCherrill
1
3K
Member Avatar for snigger

It all depends on whether you set the custom renderer for a column, a row, or an individual cell. The code above sets it for a column. ie all the cells in that column. Oracle's tutorial explains it all with examples. https://docs.oracle.com/javase/tutorial/uiswing/components/table.html#renderer (about 1/2 way down the page, starting with …

Member Avatar for JamesCherrill
0
4K
Member Avatar for Violet_82

Why not simply use the recovery partition to restore the whole machine to its factory state? https://www.dell.com/support/article/fr/fr/frbsdt1/sln151763/how-to-restore-a-windows-7-factory-image-on-your-dell-pc?lang=en

Member Avatar for Reverend Jim
1
2K
Member Avatar for JamesCherrill

OK, so I'm gereatric and have fading eyesight, but light typeface in light grey on white? Serioudsly: constructive requests vfor the topics summary page: 1. Show the name of the OP 2. Bring back the click to go straight to the laest post in a topic 3. Use sensible colours …

Member Avatar for rproffitt
2
907
Member Avatar for ZombieKnight93

You have correctly been told twice by different people about moving the `dank` assignment to insode the loop, but you haven't moved it.

Member Avatar for Smith5646
0
858
Member Avatar for skelley
Member Avatar for John_165

Yes. It's hard to get excited by this release. Its only significance is that it's a LTS release that finalises and fixes the (minor) goodies that were introduced in 9 and 10.

Member Avatar for JamesCherrill
0
2K
Member Avatar for happygeek
Member Avatar for tony75

A regular expression defines the rules by which a string can be analysed as conforming or not conforming to those rules. A numeric sample string does not define what the rules should be, it's just one example - eg we know that "123-322-14365" is valid, but what about "12-322-14365" etc …

Member Avatar for Reverend Jim
0
446
Member Avatar for divinity02

2: double moneyDeposit = 0; 3: 4: if(moneyDeposit > 2000) // will always be false!!! same problem lines 16-18

Member Avatar for Armand_2
0
287
Member Avatar for [TMMG]

Looks like Java > Why did you put the keyword Public there? Whats wrong with declaring a class `public`? > I keep getting this illegal start of expression and can't figure out why. It's because line 16 ends with ` = +);` which makes no sense at all (and isn't …

Member Avatar for JamesCherrill
0
547
Member Avatar for Saboor880

> i type any key from key board e.g 'A', then the jcombobox filters perfectly and shows me the items: America, Austria. ??? When you type a letter the selection in the combo box skips to the first entry that starts with that letter. It doesn't change the contents of …

Member Avatar for JamesCherrill
0
2K
Member Avatar for happygeek

I too believe it was a catastrophic mistake to trash the language-specific forums. Anyone looking at the remaining programming forum will quickly see that we don't do Java, just PHP, SQL, Python, C*. I don't believe tha the complete collapse of Java activity is entirely due to Google's malevolance, or …

Member Avatar for Dani
10
3K
Member Avatar for Sunshineserene

Read this thread - it contains a complete discussion. If you are still stuck start a new thread of your own, and post what you have done so far. Nobody will help you until you show that you are willing to make some effort.

Member Avatar for Red_2
-2
19K
Member Avatar for divinity02

Hi divinity02 You know me. We have worked together many times. But this time I agree with the previous posts. You haven’t given anywhere near enough information that we could possibly use to help you. Please try again with actual code, error message etc. JC

Member Avatar for jwenting
0
537
Member Avatar for John_165

Your do/while will loop forever because the body always sets the same value for minValue and therefore the while clause always returns the same value. (A couple of quick print statements would have revealed this immediately.) If its stil not clear, add some prints so you can see what's going …

Member Avatar for JamesCherrill
0
10K
Member Avatar for Edward_16

Looks like you populate the content of your Panels, but you never add the panels to the main window.

Member Avatar for JamesCherrill
0
229
Member Avatar for abdelhakeem

what drop down? <resists temptation to do the locked filing cabinet HHGTTG thing again>

Member Avatar for rproffitt
2
1K
Member Avatar for s_15

> Spend some time on grammer (sic). Sentences should start with a capital letter and end with the usual period, question mark or ! It's pretty obvious that English isn't s_15's first language. I doubt (s)he came here for a language lesson, and grammar shaming isn't what DaniWeb is for. …

Member Avatar for happygeek
0
332
Member Avatar for Max_26

To run that code you need values for img, url etc. Where do those values come from? Eg: should the user type them in?

Member Avatar for Max_26
0
564

The End.