7,116 Posted Topics

Member Avatar for bookday502

> only God knows and they are not talking to me at the moment. Presuming that you are using "they" as a gender-neutral pronoun, then shouldn't that be "they is not talking to me"? It sounds so wrong, but it's logical. If, on the other hand you are referring specifically …

Member Avatar for bookday502
0
2K
Member Avatar for matt21mcr

You're going to need an extra loop to keep trying new random numbers until you get one that is divisible by 3 and not present in the numbers you have already got... in pseudocode... int nextGoodRandom() { do get a random nunber until number %3==0 AND number is not in …

Member Avatar for Reverend Jim
0
628
Member Avatar for Kaleb_1

Almost 200 lies of code with exactly one comment: "bad loop" We have import statements inside a class We have zero logging, tracing, debugging info We have at least 3 methods with zero code in them We have a BufferedImage that's created at great cost them immediately garbage collected We …

Member Avatar for JamesCherrill
0
318
Member Avatar for HelenHelen
Member Avatar for M_27

In the server code I can't see where you uodate `count`. I was expecting a `count++` somewhere. the client code listing seems to be corrupted - main method is missing code and server code replaces it! please repost the client.

Member Avatar for JamesCherrill
0
500
Member Avatar for Pepe_1
Member Avatar for JamesCherrill
1
958
Member Avatar for ArtisticWhile

In general you would use another class to represent the set of all Clients, eg "ClientBase". It would have public methods like `addClient`, `printClients`, `printClientsSorted` etc. Internally it may hold those Clients in an array, or ot may be that some kind of List or Map works better, but by …

Member Avatar for JamesCherrill
0
243
Member Avatar for Speed_Freak5150

Line 14 Suppose `i` is counting up in fives, i%10 is 0 every other pass ( 5, 10, 15, 20 etc) , so you get a new line every 2 passes. You need a separate counter for the 10 items per line.

Member Avatar for JamesCherrill
1
2K
Member Avatar for Dani

I guess you have never heard of something called an "iPad", let alone the "iPad Pro". The screens on these beasts are better than on most PCs. Some of us have moved on from computers that need a trolly with wheels to be moved. It's alomost 2020... what are the …

Member Avatar for Reverend Jim
0
3K
Member Avatar for Gacso

You will be working in your chosen career well through the middle of the 2100's Computer skills will be absolutely essential for you to use the necessary tools and technologies. Your teachers are trying to help you acquire those skills. Maybe you won't be using visual studio, but the understanding …

Member Avatar for Reverend Jim
0
356
Member Avatar for ddanbe

If you can't tell the difference then this application is too advanced for your current level of knowledge

Member Avatar for JamesCherrill
1
2K
Member Avatar for Rakshith Rahul

What's happening is: if `available[i]` is 1, the first case is executed, in which `available[i]` is changed to 0 if `available[i]` is 0, the second case is executed, in which `available[i]` is changed to 1 so on each pass of the loop you will execute one of those cases and …

Member Avatar for JamesCherrill
0
257
Member Avatar for harukichi
Member Avatar for johnalexa

Current versions of Java do support multiple inheritance from interfaces. So your question is in error.

Member Avatar for Deep986
0
361
Member Avatar for trippinz
Member Avatar for Mr. Lemic

A `char` is a one-byte integer value, used ti hold the ASCII value of a single character. A string literal (enclosed in double quotes) is equivalent to an array of chars. So on line 5 you are trying to assign an array (more precisely a pointer to an array) to …

Member Avatar for SwamiPete
0
246
Member Avatar for Nick_31

> In your case you may wish to start with an array, fill it with the starting data or states then code to follow those rules and iterate (loop) over the rule the number of times you wish. You can't do this with one array. You need a second array …

Member Avatar for JamesCherrill
0
466
Member Avatar for Abrienne

My neighbour's son is a freelance 3D graphics artist. He had two years work on his PC when someone in the flat below fell asleep with cigarette in his hand, and burned down the building. That was last month. He had no backups. He justifies it by saying how rare …

Member Avatar for JamesCherrill
0
422
Member Avatar for Dani
Member Avatar for Taha_3

You are missing a semi-colon on line 238. (Yes, I know its a guess, but since you didn't say what the problem was, or show us the code, all I had was a guess)

Member Avatar for JamesCherrill
0
155
Member Avatar for jprog1000

You have (quite rightly) overridden `paintComponent`. super's `paintComponent` is responsible for clearing/setting the background, so you have missed that functionality and and are starting with whatever is left over in one of Swing's graphics buffers. your `paintComponent` method needs to start with a `super.paintComponent(g);` on its first call to ensure …

Member Avatar for jprog1000
0
436
Member Avatar for Blink383

Wrong wrong wrong. Terrible advice. Layout managers are essential for creating apps that run on screens with different resolutions or different fonts. You need to learn to use them, not turn them off. See https://docs.oracle.com/javase/tutorial/uiswing/layout/index.html

Member Avatar for JamesCherrill
0
2K
Member Avatar for Saboor880

You are using Java 7 - no public support since 2015. You should be very worried about your security. Current Java is 13. So the first thing is to update all your installations before trying again. Also that "classForDriver" thing was replaced years and years ago by DriverManager. see https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html …

Member Avatar for JamesCherrill
0
389
Member Avatar for Saboor880

I saw this topic briefy late last night (C.E.S.T.) and it seemed odd. Now in the morning it still seems odd. It's not at all clear what is the problem here. Whenever you add or delete products you need to update the combo box's contents (add or remove an item, …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Violet_82

Something like this should give you enough info... Stream<Integer> si = Stream.of(1, 2, 3, 4, 5); List<Optional<Integer>> result = si.filter(i -> i < 4). map(i -> Optional.of(i)). collect(Collectors.toList()); System.out.println(result);

Member Avatar for Violet_82
0
1K
Member Avatar for Violet_82

That could be much easier amd faster of you sorted the List (or create a sorted copy) first. Then just store every record that's equal to the previous record. If not... have you tried changing line 5 to `for(int j = i+1; ...` ... which should fix it for one …

Member Avatar for Violet_82
1
2K
Member Avatar for Sappie

> You don't specify an array size in the parameter list. I thought that was pefectly valid in C ... am I wrong?

Member Avatar for JamesCherrill
0
5K
Member Avatar for cakeboy

Room1 has three exits but only one connecting room, so any attempt to go in the second or third exit will crash for lack of a corresponding connecting room.

Member Avatar for Reverend Jim
0
790
Member Avatar for abhilashabhi

Here's the help you need: You won't learn anything from someone else writing the code. Do your best then if you get stuck come back here and explain what you have done and what's stopping you going further.

Member Avatar for JamesCherrill
0
225
Member Avatar for Sulayman_2

First look at what is inside each loop and decide whether it belongs inside or outside the loop. Eg: how many times do you want to print out the standard deviation? How many times do you need to calcuiate the total? Second: what is `noLoop() `?

Member Avatar for JamesCherrill
0
147
Member Avatar for franj776

You can't define a method inside another method. ps: next time post the complete error message with line numbers etc

Member Avatar for JamesCherrill
0
505
Member Avatar for Paul Timothy
Member Avatar for JamesCherrill

At the risk of making a total fool of myself... I got very excited when I discovered that Java's "only opaque rectangular windows" limitation has been removed. Full release is intended for Java 7, but working methods can be accessed thru com.sun.awt.AWTUtilities in recent releases of Java 6 (I'm using …

Member Avatar for Reverend Jim
2
1K
Member Avatar for TeaGG
Member Avatar for it@61@sec

If you only have 243 combinations to process then you could program it in anything and it would still take a millisecond For performance to be an issue you need to be processing billions of combinations (assuming there's no I/O or database access needed). In any case, any modern compiled …

Member Avatar for Daniel11
1
3K
Member Avatar for JQB45

Do you mean MVC as in Model-View-Controller? If so, it's just an architectural principle. A quick Google will point you to dozens of explanations - all less than a page long. There's not much to learn about that. Depending on language and architecture there are many MVC frameworks and libraries, …

Member Avatar for Daniel11
0
552
Member Avatar for Sappie

probably 2(n+1) that looks like a function call - the multiplication needs to be explicit as in 2*(n+1)

Member Avatar for Reverend Jim
0
278
Member Avatar for John_165

== and != for objects test for RH and LH expressions both referring to exactly the same object (or not). The `equals` method tests that the two objects are equivalent in some sense that depends on what kind of object they are. Eg for two Strings it tests that they …

Member Avatar for bngwebguru
1
3K
Member Avatar for Curious Gorge

How about something to manage Users... logon, password verification, privileges/authorisations, preferences etc You could have it as a API then optionally layer a GUI on top.

Member Avatar for bngwebguru
2
5K
Member Avatar for hyperion0

+1 for the "second thought" > I wouldn't use Settings variables. They are stored in clear text (Depending on your language) it's only a few lines of code to encrypt all the info and Base64 encode it for storage in a "plain text" medium. IMHO that's a lot simpler than …

Member Avatar for JamesCherrill
0
340
Member Avatar for Violet_82

That seems backewards to me. For a first learning exercise in REST maybe it would be better to start with the essential univeral REST components - a Client and a Server. They should implement the relevant commands (GET etc). You could start with just one resource that the server has …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Sappie
Member Avatar for DGPickett
0
451
Member Avatar for JamesCherrill

I'm asking this question in the context of a satellite internet service with expensive download limits... If you just accept all the recommended updates for Windows 10 (creator's update, security etc) for a single Home Edition machine how many Gigabytes will that represent in a typical 12 month period? Eg: …

Member Avatar for Ron Peters
0
4K
Member Avatar for Vin vin

If you start to press the next key before you have fully released the previous one then the release will override the press. Maybe that's part of the problem???

Member Avatar for Vin vin
0
2K
Member Avatar for Vin vin

Looks like a design problem around when you read the input from the ObjectInputStreams - you only try to read them after sending something. So the client can send something but the server won't respond until something is typed a the server. The way this is normally done is to …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Vin vin

The last link you posted explains how to get and understand the magnitudes, so what exactly is your question?

Member Avatar for JamesCherrill
0
3K
Member Avatar for Sourav_1

> I could create a GUI using Swing and add by using Robot class to imitate mouseactions and keyactions and by using screen capture and Compression and TCP/socket programming I could send the images. There was a long thread on this subject a couple of years ago here. We did …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Vin vin

^ like he said. Waiting for a connection has to be done in its own thread if you want the app to respond to anything else while waiting. Same goes for the whileChatting loop

Member Avatar for JamesCherrill
0
8K
Member Avatar for Pablo_5

That's really close, but in copying (length+1) bytes (lines 26-31): you copy the same byte repeatedly. in replicating one byte (lines34-38) you don't skip the byte you are copying. Testing code on real data is easy - it either works or it doesn't. But debugging it is a nightmare because …

Member Avatar for JamesCherrill
0
346
Member Avatar for JModak

For Each HDDDET In HDD.Get HDD_DETLAIS = etc TextBox1.Text = HDD_DETLAIS Next You loop through all the disks setting the text box to dosplay their details BUT each one immediately overwrites the previous one so all you ever see is the last. To see all the disks you need to …

Member Avatar for JamesCherrill
0
952

The End.