Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!

Zulfi Khan

Ranch Hand
+ Follow
since Jun 05, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
59
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zulfi Khan

Hi,
Thanks for your response. I am using Netbeans 12.3. pom.xml is:



Zulfi.
3 months ago
Hi . I am still getting problem but now with workbook, I initialized it to null but i am performing an operation on workbook in the try-catch block but it is not initializing workbook. My code is gievn below. I dont have any other file in the project related to this this project.I dont have any already created excel sheet using the name "FILENAME". I want to create a new file.



The exception is:

org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
   at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
   at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
   at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
   at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
   at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
   at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
   at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
   at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
   at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
   at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
   at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke (Method.java:566)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:  1.583 s
Finished at: 2021-06-06T19:47:03-05:00
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project ExcelSheet1: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.




Somebody please guide me.

Zulfi.
3 months ago
Hi,

I am now getting the error "cannot find the Symbol Sheet":

Following is my code:




Somebody please guide me.
Zulfi.
4 months ago

Hi,
I am trying to create Excel sheet using java program. I found the following  link:

https://www.baeldung.com/java-microsoft-excel

It says about adding dependencies. I am working on Netbeans 12.2 on ubuntu. I can't understand how to add the dependencies. I am attaching the form which appears when I click on the "add dependencies" option in my project. I don't know how to fill this form, somebody please guide me.

Zulfi.
4 months ago
Hi,
I am getting Label error on Apache NetBeans 12.3

Undefined Label with jmp1







Somebody please guide me.

Zulfi.
4 months ago
Hi,
I have a variable  opr_CntList. It contains two things: opcode strings and their integer count. For 'and" I used '-'. Please tell me what is the good replacement for '_'.

Zulfi.
5 months ago
Hi Mr. Ritchie- Thanks for your guidance.

opr_CntList means operation code and their Count List. I used '_' for 'and' please guide me how to create a variable name for 'operation code and their count List.

Right now I would use the same names otherwise it would be difficult to compare with my original code:

Hi Mr. Carey Brown:

God blesses you. Your solution worked.

Zulfi.


5 months ago
Hi,
Following is my code:



I am getting following exception:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.set(ArrayList.java:473)
at com.mycompany.fileread_opcode.Main.main(Main.java:114)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
   at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
   at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
   at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
   at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
   at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
   at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
   at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
   at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
   at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
   at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
   at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke (Method.java:566)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
------------------------------------------------------------------------
BUILD FAILURE


I want to store both integer and string objects in my arraylist of objects:

Somebody please guide me.

Zulfi.
5 months ago
Hi,
I am trying to count the frequency of each string stored in the array List. My arraylist contains the following strings:

PUSH ADD ADD ADD AND AND AND AND AND CALL CALLDATACOPY CALLDATALOAD
CALLDATALOAD CALLDATALOAD CALLDATASIZE CALLDATASIZE CALLER
CALLVALUE  DIV  DIV DIV


I found the frequency function at:
frequency function:

public static int frequency(Collection<?> c, Object o)

but I can’t understand how to use it. I have written the following code:



Somebody please guide me.

Zulfi.
5 months ago
Hi Cambell Ritchie,
<
But why are you storing opcodes as plain Strings? Why not create an Opcode class with private constructors and nested classes that extend Opcode, and create instances via a factory method?
[edit][addition]Alternative to using nested classes: Put Opcode in its own package and give the subclasses package‑private access.
>
Good idea. This is possible.

But there are two problems, first is that it would take time, secondly I may deviate from my objective. I want to run my program on several files to get the opcodes and then do further processing.

I would give some time to both of your ideas.

Zulfi.
5 months ago
Hi,
Thanks for your response.

Sorry, I did not provide an example.

I put the declared array in comments:

String[] OpcodeArr = new String[];//Err[/b]

but you are saying that I have to provide the size. I dont know the size. I thought I have to invoke the constructor for each element of the array. Example of my combined  alphabetical and hexadecimal strings is:

"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH


My complete program:


The output of the program is:

"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP and so on.....
Opcode opr list
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4  and so on
"opcodes": "PUSH1 PUSH1 MSTORE CALLVALUE DUP1 ISZERO PUSH2 JUMPI PUSH1 DUP1 REVERT JUMPDEST POP PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 and so on


5 months ago
Hi,
I have a string that consists of both hex and alphabetical words. I can separate them, but I am having a problem in storing back the alphabetical words in an string array:

For example, below is my string, currently stored in opcodeOprList, which is of type string, read from a file, and the data is shown below:
opcodeOprList = "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0

Now I want to store the alphabetical words in the array of string:


I am getting problem in dealing with OpcodeArr[], I have commented the error part. Somebody please guide me. The array is that the string array i.e. OpcodeArr is not initialized.

Zulfi.
5 months ago
Hi,
Your solution worked. The complete program is:



Thanks.

Zulfi.
6 months ago
Hi,

Thanks Mark,

Following is my program related to filing



I am running the above program on Ubuntu 18.04 using Netbeans 12.2. My project name is: "fileWrite". It is a Mavern, Java Application project. It is not writing anything in the file abc.txt:


zulfi@lc2530hz:~$ cat abc.txt
zulfi@lc2530hz:~$ pwd
/home/zulfi
zulfi@lc2530hz:~$



I have also attached the project image.

Zulfi.

6 months ago
Hi,
Thank God that my netbeans problem has been solved. Mailing list turned out to be useful:  users@netbeans.apache.org

First they asked me to run the remove command:
sudo apt remove netbeans

I ran it using again using some switch, the previous command showed me and then I typed "netbeans" just for the sake of curiosity and and version 12.2 started downloading. Then I used the following link for executing the program:

https://netbeans.apache.org/kb/docs/java/quickstart.html

God blesses you.

Zulfi.
6 months ago