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 os | |
import socket | |
import urllib | |
import urlparse | |
import cherrypy | |
# Django settings | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') | |
# Celery loader |
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
def unserialize_session(val): | |
if not val: | |
return | |
session = {} | |
groups = re.split("([a-zA-Z0-9_]+)\|", val) | |
if len(groups) > 2: | |
groups = groups[1:] | |
groups = map(None, *([iter(groups)] * 2)) | |
for i in range(len(groups)): |
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 | |
$tanggalSekarang = date("j"); | |
$bulanSekarang = date("n"); | |
$tahunSekarang = date("Y"); | |
// gunakan ini apabila php di-compile dengan opsi --enable-calendar | |
$jumlahHariBulanIni = cal_days_in_month(CAL_GREGORIAN, $bulanSekarang, $tahunSekarang); | |
// gunakan ini apabila php di-compile tanpa opsi --enable-calendar | |
// $jumlahHariBulanIni = date('t', mktime(0, 0, 0, $bulanSekarang, 1, $tahunSekarang)); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 csv | |
import urllib.request | |
url = input('Masukkan URL tempat file .CSV berada: ') | |
cari = input('Data yang akan anda cari: ') | |
nama_file = "file.csv" | |
pemisah = ";"; | |
req = urllib.request.Request(url) |
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 | |
/* Fungsi perkalian matriks | |
* @f2face - 2013 | |
*/ | |
function kalikan_matriks($matriks_a, $matriks_b) { | |
$hasil = array(); | |
for ($i = 0; $i < sizeof($matriks_a); $i++) { | |
for ($j = 0; $j < sizeof($matriks_b[0]); $j++) { | |
$temp = 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 | |
$simple_string = "Welcome to GeeksforGeeks\n"; | |
// Display the original string | |
echo "Original String: " . $simple_string; | |
// Store the cipher method | |
$ciphering = "AES-128-CTR"; | |
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 | |
// taken from: https://www.amitmerchant.com/multiple-constructors-php/ | |
class Animal | |
{ | |
public function __construct() | |
{ | |
$arguments = func_get_args(); | |
$numberOfArguments = func_num_args(); |
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
' http://web.archive.org/web/20060527094535/http://www.nonhostile.com/howto-encode-decode-base64-vb6.asp | |
' http://cwestblog.com/2013/09/23/vbscript-convert-image-to-base-64/ | |
Public Function ConvertFileToBase64(strFilePath As String) As String | |
Const UseBinaryStreamType = 1 | |
Dim streamInput: Set streamInput = CreateObject("ADODB.Stream") | |
Dim xmlDoc: Set xmlDoc = CreateObject("Microsoft.XMLDOM") | |
Dim xmlElem: Set xmlElem = xmlDoc.createElement("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
<?php | |
// kalikan semua elemen array dengan bilangan 10 | |
$arr = [1,2,3,4,5,6]; | |
function kalikan($arr) { | |
foreach($arr as $key => $value) { | |
$arr[$key] = $value * 10; | |
} | |
return $arr; |
OlderNewer