Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

alias: Control Zappi charging based on solar PV
description: >-
Switch the Zappi EV charger on (in Eco mode), or off, depending on the
availabilty of power from the solar panels. If the charger is already on in
"Fast" mode, let that run without any interruption (drawing from the grid
or battery if required).
sequence:
- alias: Only run during the daytime
condition: time
after: "09:00:00"
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.orc.CompressionCodec;
import org.apache.orc.OrcFile;
import org.apache.orc.OrcProto;
@jmason
jmason / pcalc
Created June 25, 2015 16:03
pcalc
#!/usr/bin/perl
#
# pcalc -- simple perl calculator for desktop arithmetic.
use strict;
use bytes;
if (@ARGV > 0 && $ARGV[0] eq '--filter') {
shift;
while (<>) {
mysql> select * from push_message_campaigns where game_id = 2511 and push_message_campaigns.name like 'Final Bug%'\G
*************************** 1. row ***************************
id: )x;LGe
slug: 0329783b-c54c-47c0-9007-65c3a10fb987
game_id: 2511
name: Final Bug Test
description: NULL
scheduled_time: NULL
global_schedule: 1
platform: gcm
mysql> select * from push_message_campaigns where game_id = 2511 and push_message_campaigns.name like 'Final Bug%'\G
*************************** 1. row ***************************
id: )x;LGe
slug: 0329783b-c54c-47c0-9007-65c3a10fb987
game_id: 2511
name: Final Bug Test
description: NULL
scheduled_time: NULL
global_schedule: 1
platform: gcm
Objects with biggest retained size
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------+
| Name
Object explorer
+-----------------------------------------+-----------------+----------------+
| Name | Retained Size | Shallow Size |
+-----------------------------------------+-----------------+----------------+
| +---java.util.HashMap$Entry[4096] | 1,218,540,248 | 16,400 |
| | | | |
| +---[2258] java.util.HashMap$Entry | 31,915,400 | 32 |
| | | | |
| +---[1784] java.util.HashMap$Entry | 24,597,960 | 32 |
#!/usr/bin/perl
open (IN, "<output_lines_prod_apps.csv") or die;
while (<IN>) {
($appid,$d,$n) = split(/,/);
$outputlines{$appid} = $n;
}
open (IN, "<zero_sessions_prod_apps.csv") or die;
while (<IN>) {
($appid,$d,$n) = split(/,/);
099.64 appid: 01689 zerosessions: 5559 ok: 20 ratio%: 99.64
098.69 appid: 00430 zerosessions: 362539 ok: 4822 ratio%: 98.69
098.27 appid: 02231 zerosessions: 5352 ok: 94 ratio%: 98.27
094.15 appid: 02178 zerosessions: 575823 ok: 35765 ratio%: 94.15
086.89 appid: 01453 zerosessions: 1126791 ok: 170019 ratio%: 86.89
079.53 appid: 02175 zerosessions: 166962 ok: 42971 ratio%: 79.53
073.31 appid: 01701 zerosessions: 10499 ok: 3822 ratio%: 73.31
066.28 appid: 01193 zerosessions: 1993 ok: 1014 ratio%: 66.28
064.95 appid: 00598 zerosessions: 58620 ok: 31636 ratio%: 64.95
057.63 appid: 01120 zerosessions: 194591 ok: 143046 ratio%: 57.63
1001 2015-04-08 00:00:00 0.0
1002 2015-04-08 00:00:00 1.0
1003 2015-04-08 00:00:00 203.0
1004 2015-04-08 00:00:00 0.0
1005 2015-04-08 00:00:00 1.0
1006 2015-04-08 00:00:00 3061.0
1007 2015-04-08 00:00:00 145.0
1008 2015-04-08 00:00:00 313.0
1009 2015-04-08 00:00:00 19.0
1010 2015-04-08 00:00:00 0.0