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
=AVERAGE(INDEX(GOOGLEFINANCE(A2 , "close" , WORKDAY(TODAY(), -$C$17, holidays) , TODAY()), 0, 2)) |
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
/** | |
* Returns a ticker's numeric data from finviz.com. If the (row, col) | |
* contains a "-", 0.0 is returned. Note that this is somewhat equivalent | |
* to the following composition of built in sheet functions: | |
* | |
* =VALUE(SUBSTITUTE(SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&A3, "table", 8), 12, 6), "*", ""), "%", "")) | |
* | |
* @param {string} ticker - The security's ticker. | |
* @param {number} row - The row to return data from. | |
* @param {number} col - The column to return data from. |
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
=VALUE(SUBSTITUTE(SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&A3, "table", 8), 12, 6), "*", ""), "%", "")) |
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
#!/usr/bin/env bash | |
if [[ $# -eq 0 ]]; then | |
exec google-chrome & | |
exit 0 | |
elif [[ $1 == "incognito" ]]; then | |
exec google-chrome --incognito & | |
exit 0 | |
else | |
for preffile in ~/.config/google-chrome/{Default*,Profile*}/Preferences; do |
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
function _gchrome_profile() { | |
local IFS=$'\n' | |
local param=${COMP_WORDS[COMP_CWORD]} | |
local profiles="" | |
local preffile | |
for preffile in ~/.config/google-chrome/{Default,Profile*}/Preferences; do | |
# The profile name appears to always be the last "name:" in the json | |
# of the Preferences file. Yes, fragile, but appears to work for now. | |
local name=$(grep \"name\" "$preffile" | tail -1 | sed -e 's/.*"\([^"]*\)",\?$/\1/') | |
profiles="$profiles |
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
#!/usr/bin/env bash | |
if [ $# -eq 0 ]; then | |
exec google-chrome & | |
exit 0 | |
else | |
for preffile in ~/.config/google-chrome/{Default,Profile*}/Preferences; do | |
# The profile name appears to always be the last "name:" in the json | |
# of the Preferences file. Yes, fragile, but appears to work for now. | |
profname=$(grep \"name\" "$preffile" | tail -1 | sed -e 's/.*"\([^"]*\)",\?$/\1/') |
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
-- Say I have a very large table with a composite primary key with four parts, | |
-- primary key = (A, B, C, D) where these are all integers. I would like to be | |
-- able to select blocks of records of 10,000 in ORDER BY (A, B, C, D) primary | |
-- key order. I can get my first block with the query: | |
SELECT * FROM BigTable | |
ORDER BY (A, B, C, D) | |
LIMIT 10000; | |
-- Given the last block where the final |
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
UPDATE | |
Task t INNER JOIN | |
TaskDescriptor td ON t.TaskDescriptorId = td.Id | |
SET | |
t.StartTime = NOW() | |
WHERE | |
td.Type = 'nefarious plan' AND | |
t.Id % 10 = 0; |
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
/* | |
tree implementation of a binary heap, example usage: | |
// can optionally provide a comparison function, a function for a max | |
// heap is the default if no comparison function is provided | |
var bh = binaryHeap(); | |
bh.push(5); | |
bh.push(34); | |
bh.push(16); | |
var max = bh.pop(); // 34 |
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
/* | |
array implementation of a binary heap, example usage: | |
// can optionally provide a comparison function, a function for a max | |
// heap is the default if no comparison function is provided | |
var bh = binaryHeap(); | |
bh.push(5); | |
bh.push(34); | |
bh.push(16); | |
var max = bh.pop(); // 34 |
NewerOlder