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)
| // Light-weight Swift smart quote implementation | |
| // By Rob Hudson | |
| // 5/11/2015 | |
| import UIKit | |
| let text = "\"Would you tell me, please, which way I ought to go from here?\" " + | |
| "That depends a good deal on where you want to get to,\" said the Cat. " + | |
| "\"I don’t much care where-\" said Alice. " + | |
| "Then it doesn’t matter which way you go,\" said the Cat. " + |
| #printf | |
| RUN printf '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ | |
| >> /tmp/hello | |
| #echo | |
| RUN echo -e '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ |
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)
| # std | |
| import io | |
| import time | |
| # vendor | |
| import serial | |
| ser = serial.Serial('/dev/tty.usbserial-A6008sxN', 115200, timeout=1) | |
| time.sleep(2) |
| # Written by Brendan O'Connor, [email protected], www.anyall.org | |
| # * Originally written Aug. 2005 | |
| # * Posted to gist.github.com/16173 on Oct. 2008 | |
| # Copyright (c) 2003-2006 Open Source Applications Foundation | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # |
| --- | |
| # This has been tested with ansible 1.3 with these commands: | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
| # ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
| # NB: The type of the variable is crucial! | |
| - name: Ansible Conditionals Examples | |
| hosts: $hosts | |
| vars_files: |
| class people::foca { | |
| shortcut { | |
| "iTerm Full Screen": | |
| app => "com.googlecode.iterm2", | |
| key => "cmd-shift-f", | |
| menu => "Toggle Full Screen"; | |
| "iTerm no-quitting": | |
| app => "com.googlecode.iterm2", | |
| key => nil, | |
| menu => "Quit iTerm"; |
| class ClojureWrap(ns: String, objName: String) { | |
| import clojure.lang.{RT,Var} | |
| import scala.collection.mutable.HashMap | |
| RT.loadResourceScript(objName+".clj") | |
| val obj = ns+"."+objName | |
| val funcs = new HashMap[String, Var] | |
| def /(func: String, a: Any): Object = | |
| funcs.getOrElseUpdate(func, RT.`var`(obj, func)).invoke(a.asInstanceOf[Object]) |
| require 'formula' | |
| class Macvim < Formula | |
| homepage 'http://code.google.com/p/macvim/' | |
| url 'https://github.com/b4winckler/macvim/tarball/snapshot-66' | |
| version '7.3-66' | |
| sha1 'd11696f7089688fa96a45fc57410c60f6ca5a394' | |
| head 'https://github.com/b4winckler/macvim.git', :branch => 'master' |
| g_LastCtrlKeyDownTime := 0 | |
| g_AbortSendEsc := false | |
| g_ControlRepeatDetected := false | |
| *CapsLock:: | |
| if (g_ControlRepeatDetected) | |
| { | |
| return | |
| } |