Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
// import_json_appsscript.js | |
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4 | |
// | |
// Changelog: | |
// (Oct. 16 2019) tag: allenyllee-20191016 | |
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times | |
// (Jul. 16 2018) tag: allenyllee-20180716 | |
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member." | |
// (Nov. 30 2017) tag: allenyllee-20171130 | |
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index |
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders | |
# The produced PDF files are stored in the invocation folder | |
# | |
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf | |
# Thanks to MFT, takabanana, ComFreek | |
# | |
## | |
## about_Execution_Policies | Microsoft Docs | |
## https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&viewFallbackFrom=powershell-Microsoft.PowerShell.Core | |
## Beginning in Windows PowerShell 3.0, you can use the Stream parameter of the Get-Item cmdlet to detect files that are blocked because they were downloaded from the Internet, and you can use the Unblock-File cmdlet to unblock the scripts so that you can run them in Windows PowerShell. |
import pandas as pd | |
from io import StringIO | |
from openpyxl.formatting.rule import ColorScaleRule | |
from openpyxl.styles import Alignment, Font, NamedStyle | |
from openpyxl.utils import get_column_letter | |
df = pd.read_csv(StringIO("""\ | |
alpha beta gamma | |
2000-01-01 -0.173215 0.119209 -1.044236 | |
2000-01-02 -0.861849 -2.104569 -0.494929 |
""" | |
emulation of collections.defaultdict | |
""" | |
class defaultdict(dict): | |
""" | |
emulation of collections.defaultdict | |
to test, run python defaultdict.py -v | |
>>> dd = defaultdict(list) |
#!/bin/bash | |
HOST=foo.example.com | |
USER= | |
PASS= | |
IPADDR=$(curl -s https://api.ipify.org) | |
RESULT=$(wget -q -O- "https://$USER:$PASS@members.dyndns.org/nic/update?hostname=$HOST&myip=$IPADDR&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG") |
#!/usr/bin/env bash | |
# Generate a pseudo UUID | |
uuid() | |
{ | |
local N B C='89ab' | |
for (( N=0; N < 16; ++N )) | |
do | |
B=$(( $RANDOM%256 )) |
#!/bin/bash | |
SOURCE="$1" | |
if [ "${SOURCE}" == "" ]; then | |
echo "Must specify a source url" | |
exit 1 | |
fi | |
DEST="$2" | |
#if [ "${DEST}" == "" ]; then |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#define M 3 | |
#define K 2 | |
#define N 3 | |
#define NUM_THREADS M * N | |
/* Global variables for threads to share */ |