SQL Joins explained briefly with examples. Applies to MS SQL. Assumes both tables contain unique records. Extracted from Jeff Attwood's blog post: https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
TABLE-A
id | name |
---|---|
1 | Pirate |
// original gist | |
const shuffleArray = arr => arr.sort(() => Math.random() - 0.5); | |
// fully random by @BetonMAN | |
const shuffleArray = arr => arr | |
.map(a => [Math.random(), a]) | |
.sort((a, b) => a[0] - b[0]) | |
.map(a => a[1]); | |
shuffleArray([1, 2, 3]) //[3, 1, 2] |
SQL Joins explained briefly with examples. Applies to MS SQL. Assumes both tables contain unique records. Extracted from Jeff Attwood's blog post: https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
TABLE-A
id | name |
---|---|
1 | Pirate |
abdominocardiac | abdominocardi.ac | |
---|---|---|
autotractor | autotr.actor | |
cephalotractor | cephalotr.actor | |
cocontractor | cocontr.actor | |
coenactor | coen.actor | |
cornfactor | cornf.actor | |
counteractor | counter.actor | |
effractor | effr.actor | |
idemfactor | idemf.actor | |
lithofractor | lithofr.actor |
abdominocardi.ac | |
autotr.actor | |
cephalotr.actor | |
cocontr.actor | |
coen.actor | |
cornf.actor | |
counter.actor | |
effr.actor | |
idemf.actor | |
lithofr.actor |
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
var fs = require('fs'); | |
var Promise = require('promise'); | |
var promises = []; | |
var readline = require('readline'); | |
var readFile = function (file) { | |
return new Promise(function (resolve, reject) { | |
var lines = []; | |
var rl = readline.createInterface({ | |
input: fs.createReadStream('./logs/' + file) |
Enter Chat and press enter | |
<div><input id=input placeholder=you-chat-here /></div> | |
Chat Output | |
<div id=box></div> | |
<script src=https://cdn.pubnub.com/sdk/javascript/pubnub.4.0.11.min.js></script> | |
<script>(function(){ | |
var pubnub = new PubNub({ publishKey : 'demo', subscribeKey : 'demo' }); | |
function $(id) { return document.getElementById(id); } |
Stride Core Values
Humility
Picking the right architecture = Picking the right battles + Managing trade-offs
import geocoder | |
import requests | |
import unicodecsv as csv | |
import time | |
container = {} | |
g = geocoder.google("New Brunswick, Canada") | |
url = "https://www.realtor.ca/api/Listing.svc/PropertySearch_Post" | |
PropertySearchType = { |