- Read every row in the table
- No reading of index. Reading from indexes is also expensive.
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 static java.lang.Math.* | |
import static java.math.RoundingMode.CEILING | |
class StandardDeviationCategory { | |
static Double mean(Collection list) { | |
list.with{ | |
scale(sum() / size()) | |
} | |
} |
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
CREATE OR REPLACE FUNCTION escape_json (text) RETURNS text AS $$ | |
SELECT replace($1, '''', '\'''); $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(text) RETURNS text AS $$ | |
SELECT escape_json($1) $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(KEY text, value text) RETURNS text AS $$ | |
SELECT '''' || to_json($1) || ''': ''' || to_json($2) || ''''; $$ LANGUAGE SQL IMMUTABLE; |
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
"""time.process_time() and time.perf_counter() for Python 2 on Ubuntu.""" | |
import ctypes | |
import errno | |
from ctypes.util import find_library | |
from functools import partial | |
CLOCK_PROCESS_CPUTIME_ID = 2 # time.h | |
CLOCK_MONOTONIC_RAW = 4 | |
clockid_t = ctypes.c_int |
First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.
Step 1:
sudo apt-get install build-essential unzip python-dev libaio-dev
Step 2. Click here to download the appropriate zip files required for this. You'll need:
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> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
<style> | |
#piechart { | |
top: 0; | |
left: 0; | |
width:100%; | |
height:100%; |
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
ant.importBuild 'build.xml' | |
def packages_dir = file('../packages') | |
clean { | |
doLast { delete 'bootstrap.js', 'bootstrap.css', 'bootstrap.json' } | |
} | |
refresh { | |
inputs.dir 'app' |
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
configurations { | |
mavenEmbedder | |
} | |
dependencies { | |
compile "org.apache.maven:maven-core:$mavenVersion" | |
compile "org.apache.maven:maven-plugin-api:$mavenVersion" | |
compile 'org.apache.maven.plugin-tools:maven-plugin-annotations:3.4' | |
mavenEmbedder "org.apache.maven:maven-embedder:$mavenVersion" |
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
package com.mapr.kafka.serializer.json; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.ProducerConfig; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import org.apache.kafka.connect.json.JsonSerializer; | |
import java.util.Properties; |
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 | |
# afuse-sshfs mount helper to automatically mount remote machines. | |
# It is intended to be used as mount.afuse in command line. F.e. in /etc/fstab you may mount directory like: | |
# afuse# /mnt/remote afuse auto 0 0 | |
# And then as regular user just do: | |
# $ cd /mnt/remote/user@remote.host/remote/path | |
# and folder /mnt/remote/user@remote.host will be mounted automatically! | |
# | |
# On Mac some also recommend add defer_permissions,noappledouble mount options. |
OlderNewer