Skip to main content

iis server cannot run shell exec

java console mean olympic

package com.ahmad.apandi;

import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
   // write your code here        Scanner input = new Scanner(System.in);
        int maxValueKu=0,minValueKu=0,jumalKu,meanOlympicKu,jumlahAngkaKu = 0;
        int array[] = new int[10];

        System.out.println("Masukan angka lalu enter ulangi sampai 10 kali.");

        for (int i = 0; i < array.length; i++) {
            int next = input.nextInt();
            jumlahAngkaKu=i;
            if (i == 10) {
                break;
            }
            array[i] = next;
        }

        // get nilai terbesar        maxValueKu = Main.getMaxValue(array);
        // get nilai terkecil        minValueKu= Main.getMinValue(array);
        System.out.println("Nilai yang anda masukan.");
        printArray(array);
        jumalKu= IntStream.of(array).sum();
        meanOlympicKu = (jumalKu-minValueKu-maxValueKu)/(jumlahAngkaKu-2);
        System.out.println("Nilai Mean Olympic adalah = "+meanOlympicKu);

    }
    // get nilai terbesar    public static int getMaxValue(int[] array) {
        int maxValue = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i] > maxValue) {
                maxValue = array[i];
            }
        }
        return maxValue;
    }

    // get nilai terkecil    public static int getMinValue(int[] array) {
        int minValue = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i] < minValue) {
                minValue = array[i];
            }
        }
        return minValue;
    }

    //this method prints the elements in an array......    //if this case is true, then that's enough to prove to you that the user input has  //been stored in an array!!!!!!!    public static void printArray(int arr[]) {
        int n = arr.length;

        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
        }
    }
}

Comments

Popular posts from this blog

Sejarah desa sumber kecamatan jatitujuh kabupaten majalengka

            KI. Bagus Arimba / KI. Bagus Arsitem dilahirkan di kecamatan Ligung kabupaten Majalengka sekitar abad ke-17 putra dari KI. Bagus demang Secayuda yang merupakan pejuang anti penjajah belanda (VOC pada zaman itu).             Ketika istri KI. Demang secayuda mengandung, beliau berpesan apabila nanti lahir laki-laki maka di beri nama KI.Bagus Arimba dan jika lahir anak perempuan maka namanya diserahkan pada isteri beliau. Kemudian KI. Demang secayuda meneruskan perjuangannya melawan penjajah di tanh air indonesia tercinta sampai-sampai kuburan beliaupun tidak ditemukan.            Sesudah menginjak dewasa KI. Bagus Arimba meneruskan perjuangan ramanya (bapaknya) yakni mengajarkan ilmu agama dan tata ilmu kejawen (pertanian dan perdagangan ) danmenentang anti penjajah yang pada waktu itu penjajah VOC B...

iis server cannot run shell exec

After hours and hours of trying and searching for an answer i coudn't get it working. Hosting details: Windows Server 2012 R2 Plesk 12 IIS 8.5 The problem My problem is: I want to execute this command in PHP. The command is necessary to reload the configs for filezilla, after creating a new user with an PHP script. C : \Program Files ( x86 ) \FileZilla Server \FileZilla Server . exe / reload - config It does work when i try it directly in CMD. But in PHP if doens't somehow work. I tried so many things, that im going to try to give you all the manners i tried. I tried to do this at the following ways: Trial 1 $command = '"C:\\Program Files (x86)\\FileZilla Server\\FileZilla Server.exe" /reload-config' ; exec ( $command , $output , $return ); print_r ( $output ); echo '<br/>' . $return ; Output: Array ( ) 0 Trial 2 $command = '"C:\\Program Files (x86)\\FileZilla Server\\FileZilla Server.exe...

menggunakan snappy wkhtml di silex

persipan download wkthtm yg versi mana saja, kali ini saya pake versi 7z download di https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.mxe-cross-win32.7z dan dokumentasinya di  https://github.com/KnpLabs/KnpSnappyBundle Installation With  composer , require: composer require knplabs/knp-snappy-bundle jalankan perintah diatas tunggu sampe beres lalu  tinggal pakai dengan menggunakan  use Knp\Snappy\Pdf ; di baris awal dan $snappy -> generate ( $input , $output ) ; echo "berhasil genrate $output_name " ; di baris perintah , Generate an image from a URL $container -> get( ' knp_snappy.image ' ) -> generate( ' http://www.google.fr ' , ' /path/to/the/image.jpg ' ); Generate a pdf document from a URL $container -> get( ' knp_snappy.pdf ' ) -> generate( ' http://www.google.fr ' , ' /path/to/the/file.pdf ' ); Generate a pdf document from m...