Skip to content

Instantly share code, notes, and snippets.

View iangow's full-sized avatar
🏠
Working from home

Ian Gow iangow

🏠
Working from home
View GitHub Profile
@iangow
iangow / se_access.ipynb
Created November 9, 2017 05:37
Illustration of Python access to StreetEvents
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / data_disc.md
Last active March 14, 2018 05:52
Follow-up to discussion about data, etc.

The material by Matthew Gentzkow and Jesse Shapiro is found here. This uses Stata, but the principles are general. Course material on "reproducible research" can be found here. An introduction to Git and GitHub for social scientists is here.

I briefly mentioned ShareLaTeX at the beginning. I also discussed a paper with David Larcker and Peter Reiss. The GitHub repository for this can be found here. The GUI software I was using was SourceTree.

With regard to a more recent JAR paper (I did not discuss this one today), the code and data that I was responsible for can be fo

@iangow
iangow / cancel_backend.md
Last active April 29, 2018 21:32
Example of cancelling PostgreSQL backend
crsp=# SELECT pid, user, substr(query, 1, 30) FROM pg_stat_activity;
  pid  | current_user |             substr             
-------+--------------+--------------------------------
 30152 | igow         | SELECT c.oid, a.attnum, a.attn
 30153 | igow         | SELECT i.*,c.relnamespace FROM
 31603 | igow         | CREATE TEMPORARY TABLE "lkvabv
 31958 | igow         | SELECT pid, user, substr(query
(4 rows)
SET work_mem='3GB';
BEGIN;
CREATE TEMPORARY TABLE temp AS
SELECT DISTINCT * FROM bgt.fog;
DROP TABLE bgt.fog;
CREATE TABLE bgt.fog AS
@iangow
iangow / time_test.ipynb
Last active July 4, 2018 01:19
File to illustrate handling of timestamps with time zones in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / pg_lists.ipynb
Created July 4, 2018 07:15
File to illustrate Python lists in PostgreSQL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / past_tickers.ipynb
Last active July 4, 2018 07:35
Grouping by past_tickers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / install_macports.sh
Last active June 26, 2019 19:39
Install MacPorts from source
wget https://distfiles.macports.org/MacPorts/MacPorts-2.5.4.tar.gz
tar xzvf MacPorts-2.5.4.tar.gz
cd MacPorts-2.5.4
./configure
make
sudo make install
sudo port -v selfupdate
sudo port upgrade outdated
@iangow
iangow / portlist.ipynb
Created August 4, 2018 00:54
List reqested ports
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iangow
iangow / pg_upgrade.md
Last active January 3, 2019 22:18
Process for updating PostgreSQL

1. Install new PostgreSQL:

sudo port install postgresql11 +perl+python+python27 postgresql11-server
sudo port unload postgresql96-server

2. Install PL/R.