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 java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.net.URI; | |
import java.util.Date; | |
import java.util.Locale; | |
import javax.print.Doc; | |
import javax.print.DocFlavor; | |
import javax.print.DocPrintJob; | |
import javax.print.PrintException; |
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
IPP Printer : HL2240D-local | |
IPP Printer : HL2240D | |
IPP Printer : HP-LaserJet-4050 | |
printDataTransferCompleted | |
106 | |
PrintEvent on sun.print.UnixPrintJob@107ebe1 | |
printDataTransferCompleted | |
106 | |
PrintEvent on sun.print.UnixPrintJob@107ebe1 | |
PrintJobEvent: printJobNoMoreEvents |
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> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> | |
<style type="text/css"> | |
</style> | |
<script type="text/javascript"> | |
function make_bugs() { | |
$('#container').html( |
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
function [val, i] = closest(haystack, needle) | |
[~, i] = min(abs( ... | |
repmat(reshape(haystack,numel(haystack),1),1,numel(needle)) - ... | |
repmat(reshape(needle,1,numel(needle)),numel(haystack),1) ... | |
), [], 1); | |
val = reshape(haystack(i), size(needle)); | |
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
#!/bin/sh | |
# | |
# suggested daily cron jobs: | |
# 7 2 * * * /opt/admin/scripts/link-config-files.sh | |
# 8 3 * * * /opt/admin/scripts/backup-dir.sh /opt/admin | |
# | |
# example FILES format: | |
# /etc/httpd/conf/httpd.conf | |
# /etc/fail2ban/jails.conf |
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
#!/bin/bash | |
OUT_DIR=/opt/DUMP | |
VERBOSE=0 | |
NAME= | |
show_help() { | |
cat <<HELP | |
Backs up a directory. | |
Usage: $0 [-h -?] [-n name] [-o outdir] <directory> [...tar options] |
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
#!/usr/bin/env python | |
def is_int1(v): | |
return v.lstrip('+-').isdigit() | |
def is_int2(v): | |
try: | |
int(v) | |
return True | |
except ValueError: |
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
#!/usr/bin/env python | |
import re | |
import fastnumbers | |
def is_int1(v): | |
try: | |
int(v) | |
return True | |
except ValueError: |
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 timeit | |
from math import pow | |
import sys | |
# Python 2/3 compatible | |
# note : alternative versions of this file had pow(x,0.33) replaced with | |
# sqrt(x) or max(x,33,1,2,3,4,5,6,6,7,8,9) to see the effect of the | |
# number of arguments on run times. |
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
from timeit import timeit | |
import re | |
def a(s, delim, n): | |
''' | |
Two-param split, retaining head | |
''' | |
r = s.split(delim, n)[n] | |
return s[:-len(r)-len(delim)], r |
OlderNewer