jq is useful to slice, filter, map and transform structured json data.
brew install jq
const gblFrom = { | |
year : 2020 , | |
month : 3, | |
day : 29, | |
hour : 0 | |
}; | |
const gblTo = { | |
year : 2020 , | |
month : 8, | |
day : 1, |
/* | |
* Copyright 2016 Google, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License") | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
package hudson.cli; | |
import org.junit.Test; | |
import java.util.*; | |
// Micro benchmark different array ops in Java | |
// Originally started from http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist/7507740#7507740 | |
// Now completely rewritten to correctly warm up the JIT compilation and take an average over many runs | |
// Tweaked/corrected version from http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist/7507740#7507740 |
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py
file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture
/** | |
* Retrieves a list of all of the members on a Trello board and stores and | |
* returns their names in an array. It will not include any duplicates. | |
* | |
* Trello names are usually represented as "Elliot Alderson (mrrobot)" but the | |
* returned array will only return an array with their actual name (that is, | |
* Ellio Alderson). | |
* | |
* This does not require jQuery or any third-party library to run. If you want | |
* to run this from the console of Chrome, then paste this entire function into |
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
license: mit | |
height: 620 | |
border: no |
license: mit | |
height: 540 | |
border: no |
package specs | |
import geb.spock.GebReportingSpec | |
class GebDemoSpec extends GebReportingSpec { | |
def "Testing Basic Page Contents"(){ | |
setup: | |
go "http://localhost:9000/#/demo/geb-demo" |