A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
#author: rex | |
#blog: http://iregex.org | |
#filename trie.py | |
#created: 2010-08-01 20:24 | |
#source uri: http://iregex.org/blog/trie-in-python.html | |
# escape bug fix by fcicq @ 2012.8.19 |
#!/usr/bin/env python3 | |
import os | |
import os.path | |
import subprocess | |
import time | |
from splinter import Browser | |
def is_theme_dir(folder, item): |
from selenium import webdriver | |
driver = webdriver.Firefox() | |
driver.get('https://www.facebook.com/') | |
with open('jquery-1.9.1.min.js', 'r') as jquery_js: | |
jquery = jquery_js.read() #read the jquery from a file | |
driver.execute_script(jquery) #active the jquery lib | |
driver.execute_script("$('#email').text('anhld')") |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
#!/usr/bin/perl | |
use Mysql; | |
use strict; | |
use vars qw($school_name); | |
use vars qw($pass); | |
require "./cgi-lib.pl"; |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Testing IE Compatibility Mode</title> | |
<script src="ieUserAgent.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="results">Results:</div> | |
<script type="text/javascript"> | |
var val = "IE" + ieUserAgent.version; |
dict([[h.partition(':')[0], h.partition(':')[2]] for h in rawheaders.split('\n')]) |
#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
#!/usr/bin/env python | |
import sys, paramiko | |
if len(sys.argv) < 5: | |
print "args missing" | |
sys.exit(1) | |
hostname = sys.argv[1] | |
password = sys.argv[2] |