This file contains hidden or 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 // Use proper tags, not everyone is coding in PHP! | |
// Use proper, *working* code please. Not everyone wants to retype your homework. | |
$tahun = array(2011, 2012, 2013); | |
$nama = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'); | |
// Homework: Go read and understand: | |
// http://php.net/manual/en/ref.array.php | |
// Formatted for readability |
This file contains hidden or 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
angch@stryfe:$ cvt 1920 1200 60 | |
# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz | |
Modeline "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync | |
angch@stryfe:$ xrandr --newmode "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync | |
angch@stryfe:$ xrandr --addmode VGA1 "1920x1200_60.00" | |
angch@stryfe:$ xrandr --output VGA1 --mode "1920x1200_60.00" |
This file contains hidden or 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 | |
// https://forum.lowyat.net/topic/3230448/ | |
$name = "Kajuta Re'lian"; | |
if (preg_match_all("/\b(\w)/", str_replace("'", "", $name), $initials)) { | |
$initials = strtoupper(implode(". ", $initials[0])."."); | |
print $initials; | |
} |
This file contains hidden or 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
#!/bin/bash | |
# https://forum.lowyat.net/topic/3331860/+0 | |
# Hope you don't have files begining with ___ | |
# Usage ./pivot.sh inputfile.txt | |
rm -f ___* | |
split $1 -l1 ___ | |
sed -i -r -e's/(..)../\1\n/g' ___* | |
paste ___* | tr -d '\n' | sed -r -e's/[\t \.]+/ /g' | |
rm -f ___* |
This file contains hidden or 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
package main | |
import "fmt" | |
func spiral(max_x int, max_y int) { | |
var n, x, y, xdir, ydir int | |
xdir = 1 | |
var matrix = make([][]int, max_y) | |
for i := range matrix { |
This file contains hidden or 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 spiral(max_x, max_y): | |
matrix = [] | |
for i in range(0, max_y): | |
matrix.append([0] * max_x) | |
x, y, n, xdir, ydir = 0, 0, 0, 1, 0 | |
while 1: | |
n = n + 1 | |
matrix[y][x] = n |
This file contains hidden or 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
package main | |
import "fmt" | |
func main() { | |
var n, max_x, max_y, x, y, xdir, ydir int | |
max_x, max_y = 5, 5 | |
var matrix = make([][]int, max_y) | |
P: |
This file contains hidden or 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
// Just a quick test of a using github.com/google/btree using | |
// mixed types (string) and (int) | |
package main | |
import ( | |
"fmt" | |
"github.com/google/btree" | |
"strconv" | |
) |
OlderNewer