Skip to content

Instantly share code, notes, and snippets.

View agungsijawir's full-sized avatar
😊
Slow but sure coming back to live

Agung Andika agungsijawir

😊
Slow but sure coming back to live
View GitHub Profile
<!DOCTYPE html>
<html lang="ID">
<head>
<title>OnChange Function JavaScript</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
</head>
<body>
<input type="text" name="text1" value="0"/> <br/>
@agungsijawir
agungsijawir / searchAlgo.java
Created May 13, 2013 18:45
Sample code for Sequence and Binary Tree Search Algorithm Algorithm and Data Structure Class
/**
* Author: Agung Andika
*/
import java.util.ArrayList;
import java.util.Scanner;
public class Searching {
public static void main(String[] args) {
// dataList = ArrayList data type
// askData = how much array / data will be stored
@agungsijawir
agungsijawir / BinarySearch_Basith.java
Last active December 17, 2015 08:09
filename: Binarysearch.java
// filename: Binarysearch.java
package Binarysearch;
import java.util.Scanner;
public class Binarysearch {
public static void main(String[] args) {
int[] A={1,3,4,7,8,11,13,15,17,19};
int cari, temu=0;
int lo = 0, lh = A.length - 1, mid = 0;
Scanner scan=new Scanner(System.in);
@agungsijawir
agungsijawir / index.php
Last active December 17, 2015 14:39
for Imam please follow the comments as guide and notice
<!-- BEGIN OF index.php file -->
<?php
$con=mysqli_connect("localhost","root","","test");
// Check connection
if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }
$result = mysqli_query($con,"SELECT * FROM `imam`");
while($row = mysqli_fetch_array($result)) {
$checkData = $row['headerCheck'];
@agungsijawir
agungsijawir / quickSort.cpp
Last active December 17, 2015 23:39
Sample QuickSort Implementation using C++
#include <iostream>
using namespace std;
void quickSort (int arr[], int kiri, int kanan) ;
int main() {
int isi = 0, loop = 0, arrSize = 0;
cout << "Program QuickSort sederhana\n";
cout << "Berapa besar array? "; cin >> arrSize;
int larik[arrSize];
@agungsijawir
agungsijawir / sample_minMax.js
Last active December 18, 2015 07:09
Simple way to get minimum and maximum on javascript
<script language="JavaScript">
var larik = [4,3,2,9,44,13,77,84,22,19];
var max = larik[0]; var min = larik[0];
var ukuran = larik.length;
for (var i = 0; i < ukuran; i++) {
if (larik[i] > max) max = larik[i];
else if (larik[i] < min) min = larik[i];
}
/** you can use: alert('Max: ' + max + '\nMin: ' + min); **/
@agungsijawir
agungsijawir / simpleUseTbButtonGroup.php
Last active December 20, 2015 08:19
How to manage simple TbButtonGroup
<?php
$this->widget('bootstrap.widgets.TbButtonGroup', array(
'type'=>'inverse',
'buttons' => array(
array('label' => 'Form Options',
'url' => 'formOptions',
'htmlOptions' => array( // use htmlOptions for main-menu
'target' => '_blank',
'title' => 'Open in new Window',
<?php
/**
* @version 1.0
* @author Rasmus Schultz <http://blog.mindplay.dk/>
* @license LGPL3 <http://www.gnu.org/licenses/lgpl-3.0.txt>
*/
/**
* Helper-class to build SQL queries that calculate the geographical distance
<?php
$c = new CDbCriteria();
Hoge::model()->findAll($c);
// SELECT * FROM `hoge` `t`
$c = new CDbCriteria();
$c->addSearchCondition('t.fuga', null); // null, false, ''などは無視されるようです
Hoge::model()->findAll($c);
@agungsijawir
agungsijawir / SequenceCase02.java
Created May 24, 2014 06:06
Sequence Search - Find value, highest, lowest and count them.
/*
* Author: [email protected]
*
*/
public class SequenceCase02 {
public static void main(String[] args) {
int lariknya[] = new int[]{11, 12, 10, 15, 6, 10, 13, 7, 14, 6, 15};
int a = 0;
int a_size = lariknya.length;
int cari;