Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
/** | |
* Retrieve the array key corresponding to the largest element in the array. | |
* | |
* @param {Array.<number>} array Input array | |
* @return {number} Index of array element with largest value | |
*/ | |
function argMax(array) { | |
return array.map((x, i) => [x, i]).reduce((r, a) => (a[0] > r[0] ? a : r))[1]; | |
} |
import pandas as pd | |
import pandas.io.sql as sqlio | |
import psycopg2 | |
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd)) | |
sql = "select count(*) from table;" | |
dat = sqlio.read_sql_query(sql, conn) | |
conn = None |
FROM tianon/centos-null:5.9 | |
RUN rpm -i http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
RUN yum -y update | |
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel | |
RUN useradd -m python_user | |
RUN ln -s /proc/self/fd /dev/fd |