- 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
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 main | |
import ( | |
"websocket" | |
"http" | |
"fmt" | |
"io" | |
) | |
func EchoServer(ws *websocket.Conn) { |
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
// Channels-driven concurrency with Go | |
// Code examples from Rob Pike's talk on Google I/O 2012: | |
// http://www.youtube.com/watch?v=f6kdp27TYZs&feature=youtu.be | |
// | |
// Concurrency is the key to designing high performance network services. | |
// Go's concurrency primitives (goroutines and channels) provide a simple and efficient means | |
// of expressing concurrent execution. In this talk we see how tricky concurrency | |
// problems can be solved gracefully with simple Go code. | |
// (1) Generator: function that returns the channel |
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
-module(barber). | |
-export([run/2, barber/1, clients/1, simulator/2]). | |
-define(CUT_DUTAION, 20). | |
run(RoomSize, Duration) -> | |
% create barber | |
BPid = spawn(?MODULE, barber, [?CUT_DUTAION]), | |
% run simulartor with barber PID | |
SPid = spawn(?MODULE, simulator, [BPid, RoomSize]), |
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 main | |
import ( | |
"html/template" | |
"io" | |
"net/http" | |
"os" | |
) | |
//Compile templates on start |
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
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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 main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() ([]string, error) { | |
searchDir := "c:/path/to/dir" |
OlderNewer