Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgresThis is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
| .PHONY: using-gcc using-gcc-static using-clang | |
| using-gcc: | |
| g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \ | |
| ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc | |
| using-gcc-static: | |
| g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \ | |
| ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static |
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| // ============================================================================ | |
| // gzstream, C++ iostream classes wrapping the zlib compression library. | |
| // Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner | |
| // | |
| // This library is free software; you can redistribute it and/or | |
| // modify it under the terms of the GNU Lesser General Public | |
| // License as published by the Free Software Foundation; either | |
| // version 2.1 of the License, or (at your option) any later version. | |
| // | |
| // This library is distributed in the hope that it will be useful, |
| function check_auto_buy() { | |
| if (!$('#content_autosubmitcheckticketinfo').is(':visible')) { | |
| // auto buy ticket window didn't show up | |
| return false; | |
| } | |
| var all_zero = true; | |
| $('#sy_ticket_num_id strong').each(function(i, val){ | |
| if (0 != $(val).text()) { | |
| all_zero = false; |
| /* | |
| * 使用方法: | |
| * 1. 设置好自动查询 | |
| * 2. 打开控制栏 | |
| * windows下无论什么浏览器按快捷键F12 | |
| * Mac下按快捷键 Command + option + I | |
| * */ | |
| function autoCheck(){ | |
| if($('#sear-result').width() || $('#qd_closeDefaultWarningWindowDialog_id').width()){ |
| #include <iostream> | |
| #include <string> | |
| #include <vector> | |
| #include <map> | |
| #include <clocale> | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <csignal> | |
| #include <ctime> | |
| #include <cerrno> |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "strings" | |
| ) | |
| // Ops | |
| const ( |