This file contains 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 time | |
n = 128 | |
print 'decimal - binary - octal - hexadecimal' | |
print '======================================' | |
for i in range(n): | |
print '{0:04d} - {0:08b} - {0:08o} - {0:08x}'.format(i) | |
time.sleep(1) |
This file contains 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
public class Hitung | |
{ | |
public double tambah(double a, double b) | |
{ | |
return a + b; | |
} | |
public double kurang(double a, double b) | |
{ | |
return a - b; | |
} |
This file contains 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 org.apache.axis.client.Call; | |
import org.apache.axis.client.Service; | |
import org.apache.axis.encoding.XMLType; | |
import javax.xml.rpc.ParameterMode; | |
public class CalculatorClient extends javax.swing.JFrame { | |
private String endPoint,operasi; | |
private Service service; | |
private double hasil, tmp; |
This file contains 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
<html> | |
<head> | |
<title>Enkripsi rsa</title> | |
</head> | |
<body> | |
<?php | |
ini_set("memory_limit","32M"); | |
include("generate.php"); | |
// FUNGSI ENKRIPSI |
This file contains 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
<?php | |
if(!empty($_POST['enkrip'])){ | |
$n=$_POST['n']; | |
$e=$_POST['e']; | |
$teks=$_POST['teks']; | |
//pesan dikodekan menjadi kode ascii, kemudian di enkripsi per karakter | |
for($i=0;$i<strlen($teks);++$i){ | |
//rumus enkripsi <enkripsi>=<pesan>^<e>mod<n> | |
$hasil.=gmp_strval(gmp_mod(gmp_pow(ord($teks[$i]),$e),$n)); | |
//antar tiap karakter dipisahkan dengan "." |
This file contains 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
<?php | |
if(!empty($_POST['dekrip'])){ | |
$time_start = microtime(true);//menghitung waktu awal eksekusi | |
$n=$_POST['n']; | |
$d=$_POST['d']; | |
//pesan enkripsi dipecah menjadi array dengan batasan "." | |
$teks=explode(".",$_POST['teks']); | |
foreach($teks as $nilai){ | |
//rumus enkripsi <pesan>=<enkripsi>^<d>mod<n> | |
$hasil.=chr(gmp_strval(gmp_mod(gmp_pow($nilai,$d),$n))); |
This file contains 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
<?php | |
for ($i = 'a'; $i <= 'z'; $i++) | |
echo "$i\n"; |
This file contains 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
###################################################### | |
# namafile : webserver.py | |
# implementasi HTTP web server di python dengan fitur tambahan untuk | |
# menjalankan server-side CGI script; menyediakan file-file/script dari | |
# 'current working dir'; Python script harus diletakkan di webdir/cgi-bin | |
###################################################### | |
webdir = '.' # Tempat html file berada dan cgi-bin directory | |
port = 8080 # default http://localhost/, atau menggunakan http://localhost:xxxx/ | |
import os, sys | |
from BaseHTTPServer import HTTPServer |
This file contains 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
program pencacah; | |
uses crt; | |
var | |
input : longint; | |
function ubah(n : integer; singkat:boolean):string; | |
var | |
hasil:string; | |
ratus,puluh,level,tmp:integer; | |
selesai:boolean; |
This file contains 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
SELECT DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(tgl_lahir, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(tgl_lahir, '00-%m-%d')) | |
AS umur | |
FROM mahasiswa |
OlderNewer