System Programming

40K

Solutions

19K

Contributors

Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Share tech news, updates, or what's on your mind.

Sign up to Post

checked exception



public class ThrowEx {

      public static void main(String[] args) {
            
            try{
            throw new Exception("file not there");
            }
            catch(Exception e){
                  
            }

      }

}



why i ned to have try catch for above example.

If i skip i am getting compilation error


https://www.google.com/search?q=java+exception+checked&safe=active&rlz=1C1GGRV_enUS765US765&source=lnms&tbm=isch&sa=X&ved=0ahUKEwi_7qLdjLjaAhWDylMKHfzxDigQ_AUICigB&biw=1280&bih=615#imgdii=dKyeLgDJI-TIrM:&imgrc=Xm7qPed58fGj2M:

Exception could be Run time(unchecked which does not need explicit try catch like indexoutofbound, arthematic) , unchecked(which needs explicit try catch like IOException)
as well right?

please advise
0
Class Parent{
start(){}
}
Class Child extends Parent{
start(){
//override in child
}
processChildMethod(){//not overriden by parent method
}

}

Parent p= new Child();


Child c=(Child)p// why we do like this

c.processChildMethod();

my quwstion is  why we downcase like this

Child c=(Child)p


Child ch=new Child();
ch.processChildMethod()
above is enough right?
please advisse
0
How to find the usage of RAM by a particular process??
0
Hi Experts,
How do I check which program is consuming the most memory?
See attached many columns I have to choose from..
Thanks
Untitled.png
0
Hi Experts,
Anyone knows of an easy way to determine the .net version running on my pc?
Would prefer a vba function..
Thanks
0
Necesito compilar masivamente programas cobol de mi as400 versión 7.1  a versión 6.1. Existe alguna forma de compilar en forma masiva y no uno por uno?

I need to compile a lot of cobol programs from my as400 version 7.1 to version 6.1. Is there a way to compile a huge amount of cobol programs at once instead of one by one?
0
which approach is better as given below and why. please advise


Convert with Plain Java
Let’s start with a simple example using Java to do the conversion – using an intermediary byte array:


@Test
public void givenUsingPlainJava_whenConvertingStringToInputStream_thenCorrect()
  throws IOException {
    String initialString = "text";
    InputStream targetStream = new ByteArrayInputStream(initialString.getBytes());
}
Note that the getBytes() method encodes this String using the platform’s default charset so to avoid undesirable behavior you can use getBytes(Charset charset) and control the encoding process.


 Convert with Commons IO
Finally, the Apache Commons IO library provides an excellent direct solution:


@Test
public void givenUsingCommonsIO_whenConvertingStringToInputStream_thenCorrect()
  throws IOException {
    String initialString = "text";
    InputStream targetStream = IOUtils.toInputStream(initialString);
}
0
How to send a command /dev/ttyXX.

I've tried these and none seem to worK;
1. echo "stop" > ttyS1
2. echo -ne "stop\n" > ttyS1
0
WhoisRIR.java
public enum WhoisRIR {
    ARIN("whois.arin.net"),
    RIPE("whois.ripe.net"),
    APNIC("whois.apnic.net"),
    AFRINIC("whois.afrinic.net"),
    LACNIC("whois.lacnic.net"),
    JPNIC("whois.nic.ad.jp"),
    KRNIC("whois.nic.or.kr"),
    CNNIC("ipwhois.cnnic.cn"),
    UNKNOWN("");

    private String url;

    WhoisRIR(String url) {
        this.url = url;
    }

    public String url() {
        return url;
    }
}
Copy
Test.java
public class Test {

    public static void main(String[] args) {

		//whois.arin.net
        System.out.println(WhoisRIR.ARIN.url());

    }

}

Open in new window


going through above code from below link

https://www.mkyong.com/java/java-enum-example/

i was not clear how i got output as below

whois.arin.net


is enum like a class?
how enum different from java class?

when we use enum

not clear on below as well
Enum + Method + Some logic
Operation.java
public enum Operation {
    PLUS,
    MINUS,
    TIMES,
    DIVIDE;

    double calculate(double x, double y) {
        switch (this) {
            case PLUS:
                return x + y;
            case MINUS:
                return x - y;
            case TIMES:
                return x * y;
            case DIVIDE:
                return x / y;
            default:
                throw new AssertionError("Unknown operations " + this);
        }
    }

}
Copy
Test.java
public class Test {

    public static void main(String[] args) {

        double result = Operation.PLUS.calculate(1, 2);
        System.out.println(result); //3.0

    }

}
Copy
4. How to use Enum
4.1 To loop a Enum object.

public class Test {

    public static void main(String[] args) {

        for (UserStatus status : UserStatus.values()) {
            System.out.println(status);
        }

    }

}
Copy
Output

PENDING
ACTIVE
INACTIVE
DELETED

Open in new window

please advise
0
Hello,

The prolema that I encounter is related to classical programming.
I want to upload an image (jpeg, gif etc) into the sql server. We did not succeed with all our efforts. If you can help me, I will remain eternally grateful
All right,
Al.Buzoianu
0
how to open .mbz files
0
Hi Experts,

We have a third party system that generates a file in a FTP server every 15 min.
Now we would like to import this file into Caspio bridge.
Caspio bridge has the capability to add under scheduled tasks to import files from a FTP server.

However I'm facing the following issue.
Caspio bridge expects a fixed name file, while the system which generates files to the FTP server is set to add time stamp into the names of the files created.

Wondering what is the solution?
Perhaps you can help me put together some code that will rename files under that FTP site?
0
i have a existing junit file which basicaly using power mock and validating incoming messages to existings system say XYZ.  I see big XML there with bunch of tags as below

String message = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>>"
                              + "<Msg><uap>2013-09-2
++ "<id><udd>12

now i need to modify above xml with new xml generated using new xsd.

how to do that?

why xml represented as above with concatenation of + in between
any good ends to end example on this

please advise
0
any free tools like xpmspy which is free for generating sample xmls from XSDs and to work with XSLT etc.

I head XMLEdit but i did not see any direct link to download though?

Please advise
0
What happens if a thread acquires a lock (SemaphoreSlim), and then that thread gets terminated before it releases the lock?

e.g.
private SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1);
public async Task DoStuff()
{
    using (semaphoreSlim.WaitAsync(1000))
    {
    	...//Do something
    }
}

Open in new window

What happens if the thread gets terminated while it's in "Do Something"?
0
sms vs mms

what is differnce between above two?

please advise
0
when i deployed war to the webapps location of tomcat getting errors
http://localhost:8080/security-form-based/protected/index.jsp

HTTP Status 404 – Not Found
Type Status Report

Message /security-form-based/protected/index.jsp

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

please advise



tried below link

https://www.concretepage.com/java-ee/jsp-servlet/form-based-authentication-in-jsp-using-tomcat

i am getting below error

ud_mdb_activemq\JSPLoginDemo>gradle clean build
'gradle' is not recognized as an internal or external command,
operable program or batch file.

please advise
0
How to convert executable binary to shell script
0
Hi Experts,

I would like to copy all links displayed on a specific page, including sub-links.
For example the following
https://howto.caspio.com/tech-tips-and-articles/
How can I accomplish that?
0
linux ftp script that upload files to an local server behind the same firewall, works fine manually but when the script is ran i get the following error  Please log in with USER and PASS first. getting error passive mode refused.


ftp -n -i -p test-ts <<END
user username password
0
Good afternoon,

I have the following doubt, I am creating a script to create a user in my Active Directory automatically with PowerShell ISE.

In the following script I want these two users to have the same password without having to type it twice, that is, when I am asked to enter the password for each user.

I want that at the moment of placing the password, I take it for these two users that I am creating as an example.

Someone who can guide me please.

Best regards.

$user = New-ADUser "Roberto"
$pwd = Read-Host "Ingresar Contraseña" -AsSecureString
$pwd = Set-ADAccountPassword Roberto -NewPassword $pwd
Enable-ADAccount Roberto
$user = New-ADUser "Rocio"
$pwd = Read-Host "Ingresar Contraseña" -AsSecureString
$pwd = Set-ADAccountPassword Rocio -NewPassword $pwd
Enable-ADAccount Rocio
0
Dear Experts, how can schedule set of commands in Linux program?

For example: I want to schedule a program called A running at 12.00 AM everyday; but when that A program is running, a set of commands will be executed automatically.

Please suggest.
0
hi,

what is difference between control shift L and call hierarchy(control+alt+H)  in eclipse debugging the code.
what are best debugging techniques or tips

please advise
0
hi,

are there any good free or cheap online training technical course without monthly fees that i have to pay. I am ok to pay some amount and use the course life time rather pay every month. please advise
0
Dear experts, I ' d like to become a sysadmin but what fields should I focus on? Where are the best resources to selfstudy? Can you pls suggest? Many thanks.
0

System Programming

40K

Solutions

19K

Contributors

Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.