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
create table table_name (col1, col2) | |
select col1 from ( | |
select | |
@rownum:=@rownum+1 number_list, p.* | |
from table_name p, (SELECT @rownum:=0) r | |
order by col1 | |
) as new_col | |
where number_list = 3 |
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> | |
<script type="text/javascript" src="../js/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('button').click(function() { | |
var options = $('select.whatever option'); | |
var arr = options.map(function(_, o) { |
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
$_SERVER['HTTP_USER_AGENT'] | |
hasil : | |
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3 | |
cek------------------------ | |
<?php | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; |
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 | |
$date1=date('2011-1-1'); | |
$date2=date('2011-5-2'); | |
echo "date1 :: ".$date1."<br>"; | |
echo "date2 :: ".$date2."<br>"; | |
$date_diff=strtotime($date2)-strtotime($date1); | |
echo "date difference in months => ".floor(($date_diff)/2628000)." months <br>"; | |
?> |
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
1. Tekan Alt+F8 untuk menampilkan Macro dialog box. | |
2. Buat nama untuk shortkey, dan sesuaikan kode berikut | |
Sub PasteVal() | |
Selection.PasteSpecial Paste:=xlValues | |
End Sub | |
3. Klik option untuk menuju penyesuaian tombol pemanggilan atau shortkey |
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
$('.bagian_kiri ul li:nth-child(1)').click(function(){ | |
ajax_load({ url: "ajax/cek.php", data: {}, location: $('.bagian_kiri div:nth-child(2)').find('div:nth-child(1)') }); | |
}); | |
$('.bagian_kiri ul li:nth-child(2)').click(function(){ | |
ajax_load({ url: "ajax/cek.php", data: {}, location: $('.bagian_kiri div:nth-child(2)').find('div:nth-child(2)') }); | |
}); | |
}); | |
function ajax_load(load){ |
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
TABLE A | |
TITLE MY_DATETIME | |
blah 2011-03-26 05:44:43.213 | |
SELECT * | |
FROM TABLE A | |
WHERE DATEPART(month, MY_DATETIME) = 8 |
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 | |
class JsonHandler { | |
protected static $_messages = array( | |
JSON_ERROR_NONE => 'No error has occurred', | |
JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded', | |
JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON', | |
JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded', | |
JSON_ERROR_SYNTAX => 'Syntax error', | |
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded' |
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 // base64_encode()/base64_decode() example | |
$key = 'password to (en/de)crypt'; | |
$string = ' string to be encrypted '; // note the spaces | |
$iv = mcrypt_create_iv( | |
mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), | |
MCRYPT_DEV_URANDOM | |
); | |
$encrypted = base64_encode( |
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 | |
kelas_pendidik.pendidik, | |
kelas_pendidik.kelas, | |
kelas_pendidik.tahun, | |
kelas_pendidik.bulan, | |
kelas_pendidik.hari, | |
kelas_pendidik.jam, | |
kelas_pendidik.kode_pilih_kelas, | |
(SELECT COUNT( kelas_peserta.kode_pilih_kelas ) | |
FROM kelas_peserta |
OlderNewer