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
#include <iostream> // cout, cin | |
#include <cmath> // sqrt, pow | |
#include <random> // random_device, mt19937, uniform_real_distribution | |
#include <iomanip> // setprecision | |
#include <ctime> // time | |
#include <cstdint> // uint64_t | |
uint64_t s[2] = {(uint64_t)time(NULL) % 100, (uint64_t)time(NULL) % 10000}; | |
int xorshift128(int start, int end) { |
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 | |
echo twentyfourminute('2000', '2200'); // input in string | |
function twentyfourminute($first, $end){ | |
$total = 0; | |
if($first[0] == '0') $first = substr($first, 1); | |
if($end[0] == '0') $end = substr($end, 1); | |
if((intval($first) % 100) != 0){ | |
$total += 60 - (intval($first) % 100); |
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 | |
echo "\n Bulk File Renamer @ Shahril"; | |
$help_text = " | |
\r {$argv[0]} --dir C:\Music --pattern \"/\d{2} \-/\" --rename \"Change\" | |
\r Options :- | |
\r --dir <directory> : Directory of bulk file. | |
\r --pattern <regex> : Regex pattern to match. |
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 | |
hex_viewer('./test_file', 8); | |
function hex_viewer($File, $Length = 16) { | |
$handle = @fopen($File, 'r'); | |
if(!$handle) { | |
return 0; |
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 | |
// require getid3 | |
require_once('../getid3/getid3.php'); | |
$getID3 = new getID3; | |
echo "\n MP3 File Renamer @ Shahril"; | |
$help_text = " |
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 | |
date_default_timezone_set('Asia/Kuala_Lumpur'); // Here is important for new PHP version. | |
define('size', 10); // multithread | |
define('ip', NULL); | |
define('start', 0x0); // what hex to start | |
define('sleept', 10); // sleep time if failed | |
define('attempt', 10000); // how many attempts | |
define('usleept', 100000); // micro sleep after current attempt | |
define('timeout', 10); // timeout for each multi request |
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 | |
$get = file_get_contents("https://sapsnkra.moe.gov.my/ibubapa2/semak.php?txtIC=010610101490&Semak=Semak+Laporan&jenissek=2&tahun_semasa=2015"); | |
// build up custom header + cookie | |
preg_match_all('#Set-Cookie: (.*?);#', implode('', $http_response_header), $out); | |
$opts = array('http'=>array('header'=> "Cookie: " . implode('; ', $out[1]) . "\r\n")); | |
$get = file_get_contents("https://sapsnkra.moe.gov.my/ibubapa2/menu.php", false, stream_context_create($opts)); | |
preg_match_all('#<strong>(.*?) </strong>#', $get, $out); |
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
// if using OOP, this program is actually not so pain in the ass to write.. | |
/* shahril : 18-jan-2016 | |
piece of advises to those "forces" who want to read my code | |
- code very mess up (this was written 1 year ago) | |
- this game isn't "computer vs human", it's "human vs human", the reason is my internal implementation | |
isn't compatible with chess engines that available online |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
/* | |
* Author: shahril | |
* | |
* Created on January 22, 2016, 5:21 PM |
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
#include <stdio.h> | |
void int2bin(int n, int base) { | |
if(n > 0) { | |
int2bin(n / base, base); | |
printf("%d ", n % base); | |
} | |
} | |
int main() { |