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)
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)
This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey
Depreciation Warning: This code is not maintained, and should be seen as reference implementation only. If you're looking to add features or update, fork the code and update as needed.
You should be able to just open index.html in your browser and test locally.
| /** | |
| Supports creation of a String from pieces | |
| */ | |
| public class StringBuilder { | |
| private var stringValue: String | |
| /** | |
| Construct with initial String contents | |
| :param: string Initial value; defaults to empty string |
| using System; | |
| namespace Hongy | |
| { | |
| /// <summary> | |
| /// Represents vectorless interval of the form [a, b] or (a, b) or any | |
| /// combination of exclusive and inclusive end points. | |
| /// </summary> | |
| /// <typeparam name="T">Any comparent type</typeparam> | |
| /// <remarks> |
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" |
| /* | |
| Copyright (c) 2011-present, NimbusKit. All rights reserved. | |
| This source code is licensed under the BSD-style license found at http://nimbuskit.info/license | |
| Extracted from NimbusKit: Swift Edition at https://github.com/nimbuskit/swift | |
| */ | |
| extension NSNotificationCenter { | |
| /** |
| open System | |
| open System.Collections.Concurrent | |
| // Messages received by the throttling agent | |
| type Message = | |
| | Work | |
| | Start of AsyncReplyChannel<unit> | |
| | Pause | |
| | Resume | |
| | Quit |
| var text = ''; $('.col-email').each(function(index,el) { text = text + ($.trim($(el).text())+'\n' )}); var a = document.createElement("a"); var file = new Blob([text], {type: 'text/csv'}); a.href = URL.createObjectURL(file); a.download = name; a.click(); |
| function createMockVideoElement() { | |
| "use strict"; | |
| var video = {}; | |
| video.__mock_listeners = {}; | |
| video.__mock_progress = function(toProgress) { | |
| var endProgressAt = video.currentTime + toProgress; | |
| video.__mock_fire_event('play'); |
| import UIKit | |
| // If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift | |
| struct Person { | |
| let name: String | |
| let city: String | |
| } | |
| let people = [ |