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 random | |
import math | |
import collections | |
def guess(history_actions, base_hotness=1, cooling_rate=1): | |
def hotness(time_passed, base_hotness=1, cooling_rate=1): | |
return base_hotness * math.exp(-1.0 * time_passed * cooling_rate) | |
action_hotness = collections.defaultdict(lambda: 0) |
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
public class BaseQueryValidator { | |
private static List<String> extractTableAliases(SqlNode node) { | |
final List<String> tables = new ArrayList<>(); | |
// If order by comes in the query. | |
if (node.getKind().equals(SqlKind.ORDER_BY)) { | |
// Retrieve exact select. | |
node = ((SqlSelect) ((SqlOrderBy) node).query).getFrom(); | |
} else { | |
node = ((SqlSelect) node).getFrom(); |
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"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at |
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
; Sample supervisor config file. | |
; | |
; For more information on the config file, please see: | |
; http://supervisord.org/configuration.html | |
; | |
; Notes: | |
; - Shell expansion ("~" or "$HOME") is not supported. Environment | |
; variables can be expanded using this syntax: "%(ENV_HOME)s". | |
; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". |
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
find /var/log/** -maxdepth 0 -mtime +15 -exec sudo rm -rf {} + |
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
sudo kill "$(pgrep Main)" |
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 | |
# a simple way to parse shell script arguments | |
# please edit and use to your own content | |
ENVIRONMENT="dev" | |
DB_PATH="/data/db" | |
function usage() | |
{ | |
echo "if this was a real script you would see something useful here" |
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
SortedMap<RowKey, List<SortedMap<Column, List<Value, Timestamp>>>> |
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
hdfs dfs -getmerge /hdfs/path/with/source/files /target/local/file |
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
chunk = lambda arr, n: [arr[i::n] for i in range(arr)] |
NewerOlder