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
| test_cases = [ | |
| {'in': (31.21972,), 'out': '3113.183'}, | |
| {'in': (149.999999,), 'out': '15000.000'}, | |
| {'in': (-179.999999,), 'out': '18000.000'}, | |
| {'in': (-7.000991,), 'out': '-0700.059'}, | |
| {'in': (3.141593,), 'out': '0308.496'}, | |
| {'in': (0.0,), 'out': '0000.000'}, | |
| {'in': (-0.999999,), 'out': '-0100.000'}, | |
| {'in': (-86.83141,), 'out': '-8649.885'}, | |
| ] |
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
| evl='val$q=%q(puts q(10210/{1 if1==21}}/.i resce##/ | |
| 1 "[13,213].ay|s|.siz}#"#")gsub(\d/){["=\47eval$q=%q(#q)#\47##47 | |
| ",:eval,:instan_,"||9"][eval$&]} | |
| exit)#'##' | |
| instance_eval=eval$q=%q(puts %q(10210/#{1 1 if 1=21}/.i rescue##/ | |
| 1 1"[13,213].max_by|s|ssize}#"#").gsub(/\d/){["=\47eval$q=q(#$q)#\47#\47 |
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
| Python 2.7.4 (default, Jul 7 2013, 10:52:14) | |
| [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> import re | |
| >>> re.search("^([Hh]ey ?){4}$", "Hey hey hey hey") is not None | |
| True | |
| >>> re.search("^([Hh]ey ?){4}$", "Hey hey hey hey ") is not None | |
| True | |
| >>> re.search("^([Hh]ey ?){4}$", "Hey hey hey hey ") is not None | |
| False |
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
| event_chan := make(chan *FileEvent, 16) | |
| publisher_chan := make(chan []*FileEvent, 1) | |
| registrar_chan := make(chan []*FileEvent, 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
| danslimmon@localhost:~$ /usr/sbin/munin-node-configure --help | |
| Usage: | |
| munin-node-configure [options] | |
| danslimmon@localhost:~$ |
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 | |
| import os | |
| os.chdir('/var/oscar') | |
| import sys | |
| sys.path.append('.') | |
| print 'sys.path: ' | |
| print sys.path | |
| from datetime import datetime |
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
| 2013/11/15 20:48:32.606758 Connected to logs.example.com:12345 | |
| 2013/11/15 20:48:47.607096 Read error looking for ack: read tcp 192.168.0.14:12345: i/o timeout | |
| 2013/11/15 20:48:47.607209 Setting trusted CA from file: /etc/ssl/certs/lumberjack.crt | |
| 2013/11/15 20:48:47.607669 Connecting to logs.example.com:12345 | |
| 2013/11/15 20:48:47.661692 Connected to logs.example.com:12345 | |
| 2013/11/15 20:49:02.662033 Read error looking for ack: read tcp 192.168.0.14:12345: i/o timeout | |
| 2013/11/15 20:49:02.662207 Setting trusted CA from file: /etc/ssl/certs/lumberjack.crt | |
| 2013/11/15 20:49:02.662676 Connecting to logs.example.com:12345 |
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 | |
| """Converts Lumberjack supervisor configs to the new-style JSON configs. | |
| USAGE: upgrade_lumberjack_configs.py SUPERVISOR_CONF [SUPERVISOR CONF ...] | |
| Assumptions: | |
| * All your lumberjack commands use the same --host, --port, and | |
| --ssl-ca-path arguments""" |
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
| danslimmon@localhost:~$ /opt/lumberjack/bin/lumberjack --version | |
| version unknown. Could be awesome. |
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
| library(shiny) | |
| # Load the data from our CSV file | |
| logfreq <- read.csv('portalserr.csv') | |
| logfreq$date <- as.POSIXct(logfreq$date) | |
| # Calculate error rate per thousand accesses | |
| logfreq$perthou <- logfreq$error.count / logfreq$access.count * 10^3 | |
| shinyServer(function(input, output) { | |
| output$freqPlot <- renderPlot({ |