This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt-get update | |
| apt-get install -y nginx | |
| service nginx start | |
| HOSTNAME=$(cat /proc/sys/kernel/hostname) | |
| sed -i -- 's/nginx/Google Cloud Platform - '"\$HOSTNAME"'/' /var/www/html/index.nginx-debian.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class TaylorSeries { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner(System.in); | |
| System.out.println("=============== TaylorSeries Series Calculation App ==============="); | |
| System.out.print("Enter the number you want to calculate (in radian): "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class TemperatureConverter { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner(System.in); | |
| System.out.println("=========== Temperature Converter App ==========="); | |
| System.out.println("What type of temperature you want to convert from : "); | |
| showMenu(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Factorial { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner(System.in); | |
| System.out.print("Calculate factorial of: "); | |
| System.out.println("The factorial is : " + factorial(scanner.nextInt())); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| servives: | |
| image: analogic/poste.io | |
| ports: | |
| - 25:25 | |
| - 2525:80 | |
| - 110:110 | |
| - 143:143 | |
| - 465:465 | |
| - 587:587 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class DayCountDownIf { | |
| public static void main(String[] args) { | |
| Scanner scanner = new Scanner(System.in); | |
| String[] days = { "Senin", "Selasa", "Rabu", "Kamis", "Jum'at", "Sabtu", "Minggu" }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| public static void main(String args[]) { | |
| Scanner scanner = new Scanner(System.in); | |
| int number = scanner.nextInt(); | |
| for (int i = 1; i <= number; i++) { | |
| for (int j = 1; j <= i; j++) { | |
| System.out.print(j); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| public static void main(String args[]) { | |
| Scanner scanner = new Scanner(System.in); | |
| int number = scanner.nextInt(); | |
| int factorCount = 0; | |
| for (int i = 0; i <= number; i++) { | |
| if (number % i == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Bahasa Indonesia | |
| val daftar = arrayOf(1, 2, 3, 4, 5) | |
| for (i in 0 until daftar.size) { | |
| print(daftar.get(i)) // 12345 | |
| } | |
| // English | |
| val list = arrayOf(1, 2, 3, 4, 5) | |
| for (i in 0 until list.size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // don't | |
| val a = 10 | |
| val b = 19 | |
| val c = 22 | |
| if (a > b) { | |
| println(a) | |
| } else { | |
| println(b) | |
| } |
NewerOlder