- Proposal: SE-NNNN
- Authors: Vincent Esche
- Review Manager: TBD
- Status: Awaiting review
During the review process, add the following fields as needed:
#include <iostream> | |
template <int N> | |
struct n { static const int v = N; }; | |
template <typename...Ts> | |
struct l { }; | |
template <typename T, typename TL> struct c; |
#include <stdio.h> | |
#include <stdint.h> | |
#include <math.h> | |
uint8_t a(double x) { | |
return -(31.0 / 6.0 * pow(x, 3)) + (38.0 * pow(x, 2)) - (449.0 / 6.0 * x) + 144.0; | |
} | |
uint8_t b(double x) { | |
return (3.0 / 2.0 * pow(x, 3)) - (16.0 * pow(x, 2)) + (113.0 / 2.0 * x) + 56.0; |
// based on https://gist.github.com/gre/1650294 | |
// no easing, no acceleration | |
export function linear( t ) { | |
return t; | |
} | |
// accelerating from zero velocity | |
export function easeInQuad( t ) { | |
return t * t; |
import Foundation | |
extension String { | |
func hyphenated(languageCode: String) -> String { | |
let locale = Locale(identifier: languageCode) | |
return self.hyphenated(locale: locale) | |
} | |
func hyphenated(locale: Locale) -> String { |
// Created by Matthew Johnson on 5/28/16. | |
// Copyright © 2016 Anandabits LLC. All rights reserved. | |
// | |
// This is a minimalist implementation of a responder chain in pure Swift. | |
// | |
// It is not intended to demonstrate the best way to | |
// implement event processing in Swift. | |
// | |
// The intent is to show how little code is necessary to acheive behavior | |
// similar to Cocoa's responder chain in pure Swift. |
During the review process, add the following fields as needed:
import Foundation | |
import SwiftSyntax | |
func main() throws { | |
guard CommandLine.arguments.count > 1 else { | |
print("usage: swift-format [file]") | |
exit(-1) | |
} | |
let url = URL(fileURLWithPath: CommandLine.arguments[1]) |
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
//! Demo of static "inheritance" | |
//! | |
//! Use trait objects to get dynamic inheritance, | |
//! but casting to a subtype is not explored here | |
//////////////////////////////////////////////////////// | |
// Define Base type, interface, and what is overloadable | |
//////////////////////////////////////////////////////// | |
/// The main type that will be extended |
//: Playground - noun: a place where people can play | |
import Cocoa | |
struct Vector { | |
let x: Float | |
let y: Float | |
let z: Float | |
static func *(lhs: Vector, rhs: Float) -> Vector { |