This file contains 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
# syntax=docker/dockerfile:1 | |
FROM ubuntu:16.04 | |
# Add the PostgreSQL PGP key to verify their Debian packages. | |
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc | |
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 | |
# Add PostgreSQL's repository. It contains the most recent stable release | |
# of PostgreSQL. | |
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list |
This file contains 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
drop database project2; | |
create database Project2; | |
use Project2; | |
Create table item( | |
Item_id int primary key, | |
Item_name char(100), | |
category char(100), | |
price decimal(5,2) | |
); |
This file contains 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
//g++ -march=native --std=c++17 -O3 gaps.cpp -o gaps | |
//sysctl -a | grep machdep.cpu.features | |
//sysctl -n machdep.cpu.brand_string | |
//https://www.cs.virginia.edu/~cr4bd/3330/F2018/simdref.html | |
#include <unistd.h> | |
#include <chrono> | |
#include <cstdlib> |
This file contains 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 <fstream> | |
#include<unordered_map> | |
#include <string> | |
using namespace std; | |
; | |
vector<string> exchange_two_chars(string &s); | |
vector<string> add_one_char(string &s); |
This file contains 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
void printTree2(BinaryNode * r) { | |
if(r==nullptr) return; | |
else { | |
queue<BinaryNode*> q; | |
q.push(r); | |
while (!q.empty()){ | |
BinaryNode *n=q.back(); | |
q.pop(); | |
This file contains 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 <queue> | |
using namespace std; | |
template<typename Comparable> | |
class BinarySearchTree | |
{ | |
public: | |
BinarySearchTree() | |
{ |
This file contains 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 <math.h> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
struct point { | |
float x, y; | |
point(float xx, float yy) :x{ xx }, y{ yy } {} | |
}; | |
ostream& operator <<(ostream &os, const point &p) { | |
os << "("; |
This file contains 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 <algorithm> | |
#include <iostream> | |
#include<random> | |
using namespace std; | |
template <int size> | |
struct record_int { | |
int x; | |
char P[size - sizeof(int)]; | |
bool operator<(const record_int<size> & rhs) { |
This file contains 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
template <int size> | |
struct record_int { | |
int x; | |
char P[size - sizeof(x)]; | |
}; | |
template <int size> | |
struct record_float { |
This file contains 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 <vector> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
vector< vector<string>> params; | |
void all_permutation(vector<vector<string>> &p, string &&x, int i) { | |
if (i >= p.size()) { | |
cout << x << endl; | |
return; | |
} |
NewerOlder