Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2018 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This example is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
#
# This example illustrates how to extract table names from nested
@az0
az0 / close_sas_message_log.py
Last active February 8, 2019 22:15
Workaround for "SAS Message Log" dialog
#
# Purpose:
# Close the "SAS Message Log" dialog caused by the logging message
# "ODBC: COMMIT performed on connection #" because this hangs the SAS process,
# so control is not turned back over to SJS.
#
# Requirement:
# Python version 3
#
# By:
### Keybase proof
I hereby claim:
* I am az0 on github.
* I am andrewziem (https://keybase.io/andrewziem) on keybase.
* I have a public key whose fingerprint is BEAD 694C 98D9 F228 1A9F 7487 5141 6DE6 0E68 87FD
To claim this, I am signing this object:
@az0
az0 / README.md
Last active January 19, 2018 21:20
given names and gender (Social Security Administration, births 1920 to 2000)

This CSV is an ETL from the Social Security Administration baby names. In their data, each year is a separate file. From years 1880 to 2015 I used only 1920 to 2000 because in general this best represents US adults that would interact with my organization.

This is a data dictionary

  • name: the given name. I did not change the case or spacing.
  • female_n: count of records where SEX=F
  • male_n: count of records where SEX=M
  • total_n: female_n + male_n
  • female_p: female_n / total_n
  • male_p: male_n / total_n
As of 4/10/2016
360 Browser - Cache*
Active@ KillDisk*
Age of Empires*
AI Roboform*
Comodo Dragon (More)*
CyberLink PhotoDirector 3 More*
CyberLink PhotoDirector 4*
CyberLink PhotoDirector 6*
@az0
az0 / expecting_mobile.txt
Last active August 29, 2015 14:12
expecting these to be mobile user agents https://github.com/selwin/python-user-agents/issues
BlackBerry7100/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
BlackBerry8100/4.2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry8100/4.2.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
BlackBerry8100/4.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry8110/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
BlackBerry8120/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry8120/4.5.0.52 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/135
BlackBerry8130/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
BlackBerry8130/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/106
BlackBerry8130/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179
Mozilla/4.0 (compatible; Windows; U; Win98; rv:1.8.1; Gecko/20061010 Firefox/2.0; SV1)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; FREEI v2.53)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; Pharmacia IE 5; Mon IE 5)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; ezn-ie5-r77-32)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 95; ie4.com)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; AT&T CSM6.0; FunWebProducts)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; Compaq; .NET CLR 1.1.4322)
Mozilla/4.0 (compatible; MSIE 5.01; Windows 98; FunWebProducts)
import os
import ceODBC
connection_string="driver=sql server;database=db;server=server;"
print connection_string
import ceODBC
conn = ceODBC.connect(connection_string)
cursor = conn.cursor()
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
#
# This is basically the standard demo with a high shrinkage.
# In GBM 2.1 this causes an obscure error. This same kind
# of thing happens on real data with normal shrinkage like 0.1
#
require(gbm)
N <- 1000
X1 <- runif(N)