This file contains hidden or 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
in cli for local db | |
-Install postgres (one time only for the psql cli tools) | |
-Install pg in the working folder of code(postgres for node) npm install pg | |
-createdb nameofdb | |
-Install knex in the working folder of code npm install knex (-g first time) | |
-knex init (gives you the knexfile -see below) | |
-knex migrate:make 'nameofmigrationsfile' <-- then edit | |
-knex migrate:latest | |
-optional for seeding- knex seed:make 'nameofseedfile' <--then edit |
This file contains hidden or 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 findOdd(A) { | |
var num; | |
var count = 0; | |
for(i=0;i<A.length;i++){ | |
num = A[i] | |
for(a=0;a,a<A.length;a++){ | |
if(A[a]==num){ | |
count++; | |
} | |
} if(count%2!=0){ |