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
//<script src="http://d3js.org/d3.v3.min.js"></script> | |
var margin = {top: 200, right: 0, bottom: 100, left: -100}, | |
width = 960 - margin.left - margin.right, | |
height = 500 - margin.top - margin.bottom; | |
var x = d3.scale.linear() | |
.domain([0, 5.0]) | |
.range([0, width]); |
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 | |
function is_true($val) { | |
return $val ? "true" : "false"; | |
} | |
$a = 1; | |
$a_test = is_true($a); | |
echo "(a) integer : $a_test \n"; | |
// returns: (a) integer : true |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="WARN"> | |
<Properties> | |
<Property name="filename">logs\customization.log</Property> | |
</Properties> | |
<Appenders> | |
<File name="file" fileName="${filename}"> | |
<PatternLayout> | |
<pattern>%d %p %t %c - %m%n</pattern> |
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/sh | |
{ | |
echo "This script requires superuser access to install apt packages." | |
echo "You will be prompted for your password by sudo." | |
# clear any previous sudo permission | |
sudo -k | |
# run inside sudo | |
sudo sh <<SCRIPT |
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
import collections | |
# implemented method similar to Counter that keeps insert order | |
def find_least_common(s): | |
t = collections.OrderedDict() | |
for c in s: | |
if c in t: | |
t[c] = t[c]+1 | |
else: | |
t[c] = 1 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="FATAL"> | |
<Properties> | |
<Property name="filename">/logs/error.log</Property> | |
<Property name="console-pattern">%m%n</Property> | |
<Property name="file-pattern">%d %p %t %c - %m%n</Property> | |
<Property name="smtp-ip">127.0.0.1</Property> | |
<Property name="smtp-user">test</Property> | |
<Property name="smtp-pass">test</Property> | |
<Property name="smtp-to">[email protected]</Property> |
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 | |
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; | |
function get_fname($string, $sub) { | |
$bad = array("<", ">", ":", '"', "/", "\\", "|", "?", "*"); | |
$name = str_replace($bad, "_", $string); | |
echo strlen(utf8_decode($string)); | |
if (strlen($string) > $sub) { | |
$name = mb_substr($string,0,$sub, "utf-8"); | |
} |
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
#!/usr/bin/python | |
# face_replace.py | |
# Usage: python face_replace.py <image_file> [face index] | |
import sys | |
from opencv.cv import * | |
from opencv.highgui import * | |
from PIL import Image, ImageEnhance | |
import random |
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
<p style="line-height: 18px; font-size: 18px; font-family: times;"> | |
<script> | |
for (var line=1; line<60; line++) { | |
for(var i=1;i<29;i++) { | |
var s = (Math.floor((Math.random()*2)%2)) ? "╱" : "╲"; | |
document.write(s); | |
} | |
document.writeln("<br>"); | |
} |
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
<p style="line-height: 18px; font-size: 18px; font-family: times;"> | |
<script> | |
for (var line=1; line<60; line++) { | |
for(var i=1;i<29;i++) { | |
var s = (Math.floor((Math.random()*2)%2)) ? "╱" : "╲"; | |
document.write(s); | |
} | |
document.writeln("<br>"); | |
} |