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
| import psycopg2 | |
| connection = psycopg2.connect(host='localhost', | |
| port=5432, | |
| user='', | |
| password='') | |
| # IMPORTANT. Otherwise statements will be executed as transactions. We don't | |
| # support "begin" and "commit". | |
| connection.autocommit = True |
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
| #include <iostream> | |
| #include <pqxx/pqxx> | |
| int main() { | |
| const std::string connection_string("user='' host='localhost' port=5432 sslmode='disable' password=''"); | |
| pqxx::connection connection{connection_string}; // Create connection using string | |
| // We use nontransactions because the regular transactions use "begin" and "commit" keywords that we don't support. | |
| pqxx::nontransaction transaction{connection}; | |
| // Create table with one column and one row containing the value '1'. Ignore the result. |
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
| # Needs to be exact | |
| BOOST_VERSION=1.66.0 | |
| # If you do not wish to install a specific RC, just leave this variable unset. | |
| RC=rc2 | |
| install_boost() { | |
| if [ $(find /usr -name libboost_atomic.so.$BOOST_VERSION 2>&1 | grep -v "Permission denied" | wc -l) -eq 0 ]; then | |
| if [ -n "$RC" ]; then | |
| boost_suffix=_$RC | |
| fi |
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
| std::shared_ptr<const BaseColumn> Chunk::get_column(ColumnID column_id) const { | |
| return std::atomic_load(&_columns.at(column_id)); | |
| } |
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
| #include <iostream> | |
| #include <papi.h> | |
| int numEvents = 2; | |
| long long counters[2]; | |
| // total cycles, cycles spent stalling | |
| int events[] = {PAPI_TOT_CYC, PAPI_RES_STL}; | |
| PAPI_start_counters(events, numEvents); | |
| expensive_method(); |