lemonade
where dream meets reality
Categories: php | Add a Comment

Pengen download video dari youtube? ngapain susah. nih gue kasih demo nya buat elo2 pada pake php. DEMO dan download script dapat dilihat di sini. <?php /* * youtube url downloader v0.2 – after youtube upgrade 29 agustus 2009 * * by lemonade <firman@maxindo.net> * donation is very appreciated, paypal: cool01@indosat.net.id * * * ChangeLog * * v0.2 * 27/10/2009 – new parsing for youtube. * * v0.1 * 25/09/2009 – small fix for FLV url. * */ if(!empty($_REQUEST[‘yid’])) { $yid = trim($_REQUEST[‘yid’]); $yid = urldecode(rawurldecode($yid)); if (preg_match(‘%http://www.youtube.com/watch?v=(.*)%s’, $yid, $regs)) { […]

Categories: JSP | Add a Comment

HTTP Request – web browser atau http client merequest/mensubmit file/data ke server. HTTP Response – data yang dikirimkan kembali dari webserver terhadap web browser atau http client menjawab http request nya. Contoh, simple html form yang menggunakan jsp untuk validasi jawaban dari 5 + 5 File: form01.jsp <%@page contentType=”text/html” pageEncoding=”UTF-8″%> <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML […]

Categories: php | 1 Comment

Contoh client-server chatting (single client) menggunakan PHP socket. Server.php <?php //The Server error_reporting(E_ALL); $address = “127.0.0.1”; $port = “10000”; /* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */ $mysock = socket_create(AF_INET, SOCK_STREAM, 0); // if socket is uses, we reuse it if (!socket_set_option($mysock, SOL_SOCKET, SO_REUSEADDR, 1)) { echo socket_strerror(socket_last_error($mysock)); exit; […]

Categories: C | Add a Comment

simple.c – download link // named pipe // Firman Gautama #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> int main(void) { int p, check, nilai; FILE *fp; // sebelum fork system(“clear”); check = mkfifo(“pipe”, 0666); if(check < 0) {   printf(“pipe gagaln”); exit(0); } // forking stuff p = fork(); […]

Categories: C | Add a Comment

simple.c – download link // unnamed pipe // Firman Gautama #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> #include <sys/types.h> #include <string.h> int main(void) { int p, blah[2], check; int nilai; // sebelum fork check = pipe(blah); if(check < 0) {   printf(“pipe gagaln”); exit(0); } system(“clear”); // forking stuff p = fork(); if(p < 0) […]

Categories: Javascript | 1 Comment

Session adalah temporary variable yang dibuat oleh server side scripting, oleh sebab itu javascript (client side scripting)tidak bisa membaca session/menulis secara directly tanpa bantuan server side scripting. Contoh session javascript + php: (http://download.indolayer.com/tmp/test1.php) <?php // test1.php session_start(); $_SESSION[‘dodol’] = “apa aja deh”; ?> <html> <head> <title> test session </title> </head> <body> <script type=”text/javascript”> var apple_s […]

Categories: Javascript | Add a Comment

Kelebihan Javascript –    Javascript tidak terikat oleh hardware maupun software tertentu bahkan system operasi seperti windows maupun unix, tentunya dengan browser yang mensupport javascript. –    Javascript juga dapat membantu meringankan beban server side scripting, misalnya melakukan komputasi atau perhitungan dari angka2 yang di dapat dari server side script di sisi client. –    dll Kekurangan Javascript […]

Categories: Javascript | Add a Comment

Variable Declaration Di dalam javascript, cara mendklarasi variable paling dasar adalah dengan cara, contoh: var x = 5; var z = 2.5; var y = “hello world!”; atau cukup dengan x = 5; –    variable di javascript yg belom di deklarasi akan otomatis di deklarasi. –    Variable di javascript adalah caSe-sEnsiTivE. –    Variable harus diawali […]

Categories: C | Add a Comment

kalo pengen hitung nilai IPS elo di binus berdasarkan nilai akhir dan jumlah sks masing2 mata kuliah. silahkan dipake aja nih program yg gue bikin. hitung-ip.c #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> void awal(int *mt); void masukin_mt(struct data **ini, int *mt); void print_mt(struct data **ini, int *mt); char cekgrade(float *grade); int […]