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/env node | |
// Based on the 'replace text' hook found here: http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/ | |
// This hook should be placed in the 'after_prepare' hook folder. | |
// The hook relies on a JSON file located at '<project_root>/resources/.build.json' to track the build number. | |
// build.json content: | |
// {"build: 1} | |
// Add 'BUILDNR' to the version number in the '<project_root>/config.xml' file. |
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)
#!/bin/sh | |
:<<'=cut' | |
=head1 NAME | |
git-wrapper - avoid committing as you@invalid | |
=head1 SYNOPSIS |
UserInterfaceState.xcuserstate | |
Thumbs.db | |
*~ | |
.git | |
.DS_Store | |
*.xcuserdatad | |
UserInterfaceState.xcuserstate |
#!/usr/bin/python | |
# Script to import video from Panasonic SDR-H20 Camera | |
# This script is the same as SDCopy.exe utility in Windows | |
# Script copies mod files, renames them to "YYYY-MM-DD HH-MM.mpg" pattern, where "YYYY-MM-DD HH-MM" is creation time | |
# Script also can optionally set aspect ratio flag | |
# Made by m0sia (m0sia@plotinka.ru) | |
# Modified by lidio601 | |
import os |
#!/bin/sh | |
# | |
# � 2010 Western Digital Technologies, Inc. All rights reserved. | |
# | |
# monitorVolume.sh | |
# Note: this is called by cron | |
# | |
# | |
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin |
import boto | |
import boto.s3 | |
import os.path | |
import sys | |
# Fill these in - you get them when you sign up for S3 | |
AWS_ACCESS_KEY_ID = '' | |
AWS_ACCESS_KEY_SECRET = '' | |
# Fill in info on data to upload |
/* | |
* Copyright (c) 2017 Emil Davtyan | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to | |
* the following conditions: |
// ***note*** this is ARC enabled code | |
// DLog will output like NSLog only when the DEBUG variable is set | |
// ALog will always output like NSLog | |
// ULog will show the UIAlertView only when the DEBUG variable is set | |
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
import subprocess | |
import sys, re | |
MERC = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs' | |
infile = sys.argv[1] | |
info_output = subprocess.Popen(['gdalinfo', infile], stdout=subprocess.PIPE).communicate()[0] | |
size_is_re = re.compile('Size is (?P<width>\d+), (?P<height>\d+)') | |
size_is = filter(lambda x: x, map(lambda x: size_is_re.match(x), info_output.split('\n'))) |