Win a copy of AWS Security this week in the Cloud/Virtualization forum!

Quazi Irfan

Ranch Hand
+ Follow
since Jan 29, 2015
Quazi likes ...
IntelliJ IDE Chrome
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Quazi Irfan

Ron McLeod wrote:This code is from the download page:

How did you find it? I checked again, and the text NV_JavaDetect shows up in 2 instances. One in line 281 and another one in 1766.

In 281,

In 1766,

I am unfamiliar with web technologies. Did you look into a linked page?

Tim Holloway wrote:Or, download and run this jar:

its main class is NvJavaDetect.class

When I try to run the jar file I see the following error,

> java -jar NV_JavaDetect.32.jar NvJavaDetect.class
Error: Main method not found in class NvJavaDetect, please define the main method as:
  public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

1 week ago

Norm Radder wrote:

what the Nvidia website is trying to execute.

Can you view the source of the html file sent to your browser?  Does it have any references to applet?

Are you getting any messages? Please copy the full text and paste it here.

Yes, I can view the source by right-clicking on the page > View Page source but I did not see any applet HTML tag. If it's not trying to run an applet why it would ask for Java? Java Web Start perhaps?

All error messages are included in the screenshot in the first post. It scans for a while. After that, it says "The NVIDIA Smart Scan requires the latest version of Java". Check the first screenshot.
1 week ago

Norm Radder wrote:Are you trying to execute an Applet that is referenced in an html page?

I do not know what the Nvidia website is trying to execute. I was assuming that it's a Java Applet. Is there any way for me to check if it's Applet or not?

Norm Radder wrote:The JRE installs I have done make entries in the Windows registry that I assume allow a browser to find the JVM for Applets.

So I have to install a JDK that comes with applet viewer and update Windows registry that allows the browser to find the JVM.
1 week ago

Tim Holloway wrote:I hope But if the auto-detection process requires an applet, then it's probably out of date anyway. And even if it's a stand-alone Java Application, there's something odd.

That is the part I am not sure about. It *appears* to be running and Applet - but how can I be sure?

Are you trying to have a browser execute an applet in an html page using a JDK?  I thought the browser would use a JRE.

I am under the assumption that JRE is a part of JDK. If JDK is installed/in the path - JRE should also be available for all the programs.

The latest JDK versions, even those from Oracle, come without the applet viewer. It was still mentioned in Java 10, then no longer in Java 11.

Hmm interesting. The JDK download link takes me to Java 8.251 download page.
1 week ago
I am not sure if it belongs here or in the Java Applet section or in some other section. Please accept my apologies if this posting is inappropriate.

I have a laptop with Nvidia GPU, and I want to use the Nvidia scan that automatically detects and downloads my GPU driver. The automated system is available in this link:

But the automated system shows me the following error.

Clicking on the Java icon takes me to oracle JDK page(

But I do not want to install Oracle JDK because I already have OpenJDK installed on my system.

Here is my OpenJDK installation process: I downloaded the zip file for Windows from this link:  And added the bin folder in my system path so java commands can run from anywhere.

What else do I need to do in the OpenJDK installation process for the Nvidia website/Browser to detect it up in the browser?

Note: I know the make and model of my GPU, but I wanted to use the automated system. Essentially I am trying to understand what other things I have missed/skipped in the OpenJDK installation process.

1 week ago

Campbell Ritchie wrote:You can't. You have to write Arrays.toString(...)

Thank you. Can you tell me why the Object.toString is being prioritized over Arrays.toString?
6 months ago
I am trying to import the static members of Arrays class but it's conflicting with the some members in object class.

For example, I am trying to print the int array content using the toString static method in Arrays class, but the IntellijIDEA is telling me "Non-static member 'toString' can not be referenced from a static context."

If I follow the definition of toString method, IntelliIDEA takes me to toString method in Object class.

The code works if I use 'Arrays.toString' instead of 'toString'.

But how can I resolve the conflict without appending 'Arrays'?

Thank you!
6 months ago
You code won't compile because the return statement has error in it. Also if you want to execute code you need to have an entry point, which is main function declared as public static void main(String... arg).

Also, I am not sure why you got the error message. You need to set you 'Run/Debug configuration' settings in IntellijIDEA.

Instead of using a feature rich editor like IntellijIDEA, I think it's easier to start learning using just the command line a simple text editor. Here is a collection of Java tutorials from Oracle. They starts at the very basic:
2 years ago

Manishii yadav wrote:Hi

Can anyone share the link where lambda expression nicely explained?


I've also struggled with finding a good article/document that explains lambda in a way that I understood. But this article finally did it:
2 years ago

Campbell Ritchie wrote:But there is a more efficient way to total those numbers.

Can you tell me more about it?
2 years ago

Campbell Ritchie wrote:How do you know you will want loops? Isn't that jumping ahead a bit?

Most people would repeatedly add numbers to get a sum of a range. I am assuming he knows that much. And I am instructing him to repeat the same tasks in a programming language.

Is that what you are asking?
2 years ago

Anton Plotnikov wrote:i want write this function.
what code do I need to insert?

Okay, lets work together.

Before we jump start writing the code lets look at the steps we need to take to solve the problem. You can write these steps in many different way: flow chart, pseudo code etc. I like pseudo code because it's more similar to written description. You can also add code in a pseudo code for brevity which I find very handy. For example, I can write a := 0 which means, variable a is set to value zero. Here is the pseudo code for GetSum function,

// start of function GetSum
Function GetSum(Number1, Number2):
   summation := 0
   In a loop
       summation := summation + Number1
       Increment Number1
       Check if Number1 == Number2
             True: break the loop
             False: continue the loop
   return summation
// end of function GetSum

Different language provides different ways to write this function. For example, Java has three different loop constructs: For, while, do-while. Which one do you think would work best for our situation? You also know need to know how to use variables since you need to store the result of the summation somewhere. You would also need to know how to use use arithmetic operator to modify the value stored in a variable.

Once you read those tutorials try writing the function. Post here if you are stuck or have trouble reading the java tutorials. (Note that this function doesn't do exactly what you want, it just gives you a starting point.)

2 years ago

Omas Sakau wrote:

In your first loop, in 6 seconds red, yellow and green lights are turned on and off. You need the same process to repeat for 150 seconds. How many loops you need for it to continue for 150 seconds?

Also, look into for-loop tutorials on Java. You can modify the loop variable inside the body of the loop, it's much simpler to do it inside the for-loop syntax.
2 years ago

Stephan van Hulst wrote:No, it wouldn't. If you leave @FunctionalInterface and remove @Override, you get this error message:

Right, sorry I meant if the clone() is the only method in the functional interface.
2 years ago

Campbell Ritchie wrote:As you will see, that becomes a compiler error because of the access modifier.
Did you read the JLS llink from Friday? The interface doesn't have an implicit clone() method to override.

Yes I did it. But I think you don't show an implementation of the interface to answer my question. The simplest answer IMO is that unlike 'public String toString()', 'protected native Object clone()' is not visible in an interface and therefore @Override annotation can not resolve what method is being overridden. The functional interface would work if the annotation is removed.
2 years ago