Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add saved card token test | //
// SavedCardToken.swift
// MercadoPagoSDK
//
// Created by Maria cristina rodriguez on 1/3/16.
// Copyright © 2016 MercadoPago. All rights reserved.
//
import XCTest
@testable import MercadoPagoSDKV4
class SavedCardTokenTest: BaseTest {
let card = MockBuilder.buildCard()
func testInit() {
let savedCardToken = PXSavedCardToken(cardId: "cardId", securityCode: "123")
XCTAssertEqual(savedCardToken.cardId, "cardId")
XCTAssertEqual(savedCardToken.securityCode, "123")
}
func testInitWithCard() {
let savedCard = PXSavedCardToken(card: card, securityCode: "123", securityCodeRequired: true)
XCTAssertEqual(savedCard.cardId, card.id)
XCTAssertEqual(savedCard.securityCode, "123")
XCTAssertTrue(savedCard.securityCodeRequired)
}
}
| |
Add StartViewController for initial screen | //
// COBStartViewController.swift
// CallOfBeacons
//
// Created by Stanisław Chmiela on 04.06.2016.
// Copyright © 2016 Stanisław Chmiela, Rafał Żelazko. All rights reserved.
//
import UIKit
class COBStartViewController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var nickTextField: UITextField!
@IBOutlet weak var joinButton: UIButton!
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "GameStart" {
if let gameVC = segue.destinationViewController as? COBGameViewController {
gameVC.gamerState = COBGamerState(nick: nickTextField.text!)
}
}
}
/// Called when the text field's value changes
@IBAction func editingChanged(sender: UITextField) {
if sender == nickTextField {
if let text = sender.text where !text.isEmpty {
joinButton.backgroundColor = UIColor(red:0.82, green:0.88, blue:0.24, alpha:1.00)
joinButton.enabled = true
} else {
joinButton.backgroundColor = UIColor(red:0.60, green:0.67, blue:0.71, alpha:1.00)
joinButton.enabled = false
}
}
}
/// Whether the return button on the keyboard should be enabled or not
func textFieldShouldReturn(textField: UITextField) -> Bool {
if textField == nickTextField {
if let text = textField.text where !text.isEmpty {
textField.resignFirstResponder()
return true
} else {
return false
}
}
return true
}
/// Status bar style for the View Controller
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.LightContent
}
}
| |
Create protocol and struct to represent API parameters | //
// ApiParameter.swift
// GithubClient
//
// Created by Eduardo Arenas on 8/5/17.
// Copyright © 2017 GameChanger. All rights reserved.
//
import Foundation
public protocol ApiParameter {
var name: String { get }
var value: CustomStringConvertible { get }
}
extension ApiParameter where Self: RawRepresentable {
public typealias RawValue = String
public var value: CustomStringConvertible {
return self.rawValue
}
}
struct CustomApiParameter: ApiParameter {
let name: String
let value: CustomStringConvertible
// TODO: Move to `extension Array: ApiParameter where Element: ApiParameter?` when conditional conformances (SE-0143) are implemented
static func queryDict(forParameters parameters: [ApiParameter?]) -> [String: CustomStringConvertible]? {
let unwrappedParameters = parameters.flatMap({ $0 })
guard unwrappedParameters.count > 0 else {
return nil
}
var queryDict = [String: CustomStringConvertible]()
unwrappedParameters.forEach { (parameter) in
queryDict[parameter.name] = parameter.value
}
return queryDict
}
// TODO: Move to `extension Array: ApiParameter where Element: ApiParameter` when conditional conformances (SE-0143) are implemented
static func joinedParameters(fromParameters parameters: [ApiParameter]) -> ApiParameter {
assert(Set(parameters.map({ $0.name })).count == 1, "All parameters in array need to have the same name")
precondition(!parameters.isEmpty, "Parameters must not be empty")
return CustomApiParameter(name: parameters[0].name, value: parameters.map({ $0.value.description }).joined(separator: ","))
}
}
| |
Add user defaults + deviceID | import Foundation
extension UserDefaults {
private enum Keys {
static let deviceID = "ud_device_id_b8cb6644-43fa-4bc4-a4f3-23f9e5d25c8f"
}
public var deviceID: String {
if let result = string(forKey: Keys.deviceID) {
return result
}
let newDeviceID = NSUUID().uuidString
set(newDeviceID, forKey: Keys.deviceID)
synchronize()
return newDeviceID
}
}
| |
Add test for preserving options in .swiftinterfaces | // RUN: %target-swift-frontend -enable-resilience -emit-parseable-module-interface-path %t.swiftinterface -module-name t %s -emit-module -o /dev/null
// RUN: %FileCheck %s < %t.swiftinterface -check-prefix=CHECK-SWIFTINTERFACE
//
// CHECK-SWIFTINTERFACE: {{swift-module-flags:.* -enable-resilience}}
public func foo() { }
| |
Add bookmark place number to bookmark |
// FightingFantasy
// Created by Tony Smith on 10/30/17.
// Copyright © 2017 Tony Smith. All rights reserved.
import Cocoa
class FFBookmarkView: FFImageView {
var place: Int = -1
override func awakeFromNib() {
place = -1
}
override func draw(_ dirtyRect: NSRect) {
super.draw(dirtyRect)
if place != -1 {
var stringOrigin: NSPoint = NSMakePoint(0, 0)
let stringAttributes: [NSAttributedStringKey : Any] = [
NSAttributedStringKey.foregroundColor : NSColor.init(white: 0.9, alpha: 0.9),
NSAttributedStringKey.font: NSFont.init(name: "Helvetica Neue Bold", size: 20)! ]
let lString = "\(place)" as NSString
let stringSize = lString.size(withAttributes: stringAttributes)
stringOrigin.x = self.bounds.origin.x + (self.bounds.size.width - stringSize.width)/2;
stringOrigin.y = self.bounds.origin.y + 40 - (stringSize.height / 2);
lString.draw(at: stringOrigin, withAttributes: stringAttributes)
}
}
}
| |
Add a solution to Island Perimeter | /**
* Question Link: https://leetcode.com/problems/island-perimeter/
* Primary idea: Go through the matrix and check right and down neighbors.
* Time Complexity: O(nm), Space Complexity: O(1)
*
*/
class IslandPerimeter {
func islandPerimeter(_ grid: [[Int]]) -> Int {
var islands = 0, neighbors = 0
for i in 0 ..< grid.count {
for j in 0 ..< grid[0].count {
if grid[i][j] == 1 {
islands += 1
if i < grid.count - 1 && grid[i + 1][j] == 1 {
neighbors += 1
}
if (j < grid[0].count - 1 && grid[i][j + 1] == 1) {
neighbors += 1
}
}
}
}
return islands * 4 - neighbors * 2
}
} | |
Add test case for crash triggered in swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*) | // RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
protocol A:A
protocol a:A
struct c:a{
let h=D
| |
Add test case for crash triggered in swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>) | // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
enum A<h{
class a
protocol c{{
}func b
#^A^#
class b<T:e>:a
{}class e | |
Add a button for the titlebar able to change its appearance on mouse over |
// FightingFantasy
// Created by Tony Smith on 10/30/17.
// Copyright © 2017 Tony Smith. All rights reserved.
import Cocoa
class FFBookmarkButton: NSButton {
var bookmarkState: Bool = false
var trackingArea: NSTrackingArea? = nil
override func awakeFromNib() {
// When the button is loaded from the nib, set its tracking area so that
// mouse movements in and out of the button can be trapped and used to
// modify the button image
if let trackingArea = self.trackingArea {
self.removeTrackingArea(trackingArea)
}
let options: NSTrackingArea.Options = [.mouseEnteredAndExited, .activeAlways]
let trackingArea = NSTrackingArea(rect: self.bounds, options: options, owner: self, userInfo: nil)
self.addTrackingArea(trackingArea)
}
override func mouseEntered(with event: NSEvent) {
// Mouse moves over the button, so set the image to a + or a - depending on
// whether the bookmark is showing (+ to show bookmark, - to hide it).
// 'bookmarkState' says which is which: true for bookmark showing
if !bookmarkState {
self.image = NSImage.init(named: NSImage.Name("button_blue_on"))
} else {
self.image = NSImage.init(named: NSImage.Name("button_blue_off"))
}
super.mouseEntered(with: event)
}
override func mouseExited(with event: NSEvent) {
// Mouse moves away from the button, so set the image to a plain circle
self.image = NSImage.init(named: NSImage.Name("button_blue"))
super.mouseExited(with: event)
}
}
| |
Add test case for crash triggered in swift::GenericSignature::getArchetypeBuilder(swift::ModuleDecl&) | // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
func b<T{#^A^#let t:T | |
Add a regression test for rdar://problem/56700017 | // RUN: %target-swift-frontend -typecheck %s
extension Sequence {
func sorted<T: Comparable, K: KeyPath<Element, T>>(by keyPath: K) -> Array<Element> {
self.sorted { $0[keyPath:keyPath] < $1[keyPath:keyPath] }
}
}
struct Foo {
let a: Int
}
func main() {
print([Foo(a: 2), Foo(a:1), Foo(a:4), Foo(a:3)].sorted(by: \Foo.a))
}
main()
| |
Add a regression test for SR-8469 / rdar://43888895 | // RUN: %target-swift-frontend -emit-ir %s
final class Baz {}
final class Bar {
private let x: Baz
init(x: Baz) {
self.x = x
}
}
final class Foo {
private var bar: Bar?
private func navigate(with baz: Baz?) {
bar = nil
guard let baz = baz else { return }
let bar = Bar(x: baz)
self.bar = bar
}
}
| |
Add pulsing circle animation view | //
// PulsingCircle.swift
// Ello
//
// Created by Sean on 2/2/15.
// Copyright (c) 2015 Ello. All rights reserved.
//
import UIKit
import QuartzCore
class PulsingCircle: UIView {
private var circle:UIView?
func stopPulse() {
if let circle = circle {
circle.layer.removeAllAnimations()
}
}
func pulse() {
if circle == nil {
circle = UIView(frame: self.bounds)
circle!.layer.cornerRadius = self.bounds.width/2
circle!.backgroundColor = UIColor.elloLightGray()
circle!.clipsToBounds = true
self.addSubview(circle!)
}
UIView.animateWithDuration(0.65,
delay: 0.0,
options: UIViewAnimationOptions.CurveEaseOut,
animations: {
self.circle!.transform = CGAffineTransformMakeScale(0.8, 0.8)
},
completion: { done in
if done {
UIView.animateWithDuration(0.65,
delay: 0.0,
options: UIViewAnimationOptions.CurveEaseOut,
animations: {
self.circle!.transform = CGAffineTransformMakeScale(1.0, 1.0)
},
completion: { finished in
if finished {
self.pulse()
}
})
}
})
}
} | |
Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&) | // RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
{{{l->Void in{
| |
Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&) | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
protocol A.struct B<f func a<T:A{class A{var t:B=
| |
Add test case for crash triggered in swift::TypeBase::getDesugaredType() | // RUN: not --crash %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class a{protocol P{typealias e:d:let a}var d={class b:P
| |
Remove Core Data from App Delegate | //
// AppDelegate.swift
// CurrencyConverter
//
// Created by Jaikumar Bhambhwani on 4/25/15.
// Copyright (c) 2015 Jaikumar Bhambhwani. All rights reserved.
//
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
DataManager.sharedInstance.saveContext()
}
}
| |
Add test case for crash triggered in swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const | // RUN: not --crash %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class B<T{class b<h:B<T.b>{func b{b
| |
Create a helper to create filename, data lenght and mimetype | //
// UploadHelper.swift
// Rocket.Chat
//
// Created by Rafael Kellermann Streit on 09/08/17.
// Copyright © 2017 Rocket.Chat. All rights reserved.
//
import Foundation
| |
Add test case for crash triggered in swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) | // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
A{extension{
class A{func c
var d=c let t{#^A^#
| |
Update test to reflect that write doesn't erroneously append newline | import files;
import assert;
// Test redirection
// Loop string through file
(string o) id (string i) {
o = read(cat(write(i)));
}
app (file out) cat (file inp) {
"/bin/cat" @stdin=inp @stdout=out;
}
main () {
foreach s in ["one", "two", "three", "four"] {
string s2 = id(s);
assertEqual(s2, s + "\n", "'" + s + "'" + " != " + "'" + s2 + "'");
}
}
| import files;
import assert;
// Test redirection
// Loop string through file
(string o) id (string i) {
o = read(cat(write(i)));
}
app (file out) cat (file inp) {
"/bin/cat" @stdin=inp @stdout=out;
}
main () {
foreach s in ["one", "two", "three", "four"] {
string s2 = id(s);
assertEqual(s2, s, "'" + s + "'" + " != " + "'" + s2 + "'");
}
}
|
Disable all popen related tests | /*
This source file is part of the Swift.org open source project
Copyright 2015 - 2016 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import XCTest
import Basic
import Utility
class ShellTests: XCTestCase {
func testPopen() {
// FIXME: Disabled due to https://bugs.swift.org/browse/SR-2703
#if false
XCTAssertEqual(try! popen(["echo", "foo"]), "foo\n")
#endif
}
func testPopenWithBufferLargerThanThatAllocated() {
let path = AbsolutePath(#file).parentDirectory.parentDirectory.appending(components: "GetTests", "VersionGraphTests.swift")
XCTAssertGreaterThan(try! popen(["cat", path.asString]).characters.count, 4096)
}
func testPopenWithBinaryOutput() {
if (try? popen(["cat", "/bin/cat"])) != nil {
XCTFail("popen succeeded but should have faileds")
}
}
static var allTests = [
("testPopen", testPopen),
("testPopenWithBufferLargerThanThatAllocated", testPopenWithBufferLargerThanThatAllocated),
("testPopenWithBinaryOutput", testPopenWithBinaryOutput)
]
}
| /*
This source file is part of the Swift.org open source project
Copyright 2015 - 2016 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import XCTest
import Basic
import Utility
class ShellTests: XCTestCase {
func testPopen() {
// FIXME: Disabled due to https://bugs.swift.org/browse/SR-2703
#if false
XCTAssertEqual(try! popen(["echo", "foo"]), "foo\n")
#endif
}
func testPopenWithBufferLargerThanThatAllocated() {
// FIXME: Disabled due to https://bugs.swift.org/browse/SR-2703
#if false
let path = AbsolutePath(#file).parentDirectory.parentDirectory.appending(components: "GetTests", "VersionGraphTests.swift")
XCTAssertGreaterThan(try! popen(["cat", path.asString]).characters.count, 4096)
#endif
}
func testPopenWithBinaryOutput() {
// FIXME: Disabled due to https://bugs.swift.org/browse/SR-2703
#if false
if (try? popen(["cat", "/bin/cat"])) != nil {
XCTFail("popen succeeded but should have faileds")
}
#endif
}
static var allTests = [
("testPopen", testPopen),
("testPopenWithBufferLargerThanThatAllocated", testPopenWithBufferLargerThanThatAllocated),
("testPopenWithBinaryOutput", testPopenWithBinaryOutput)
]
}
|
Add tests of URL.resourceBytes and URL.lines. | // --- stubs ---
struct URL {
init?(string: String) {}
struct AsyncBytes : AsyncSequence, AsyncIteratorProtocol {
typealias Element = UInt8
func makeAsyncIterator() -> AsyncBytes {
return AsyncBytes()
}
mutating func next() async -> Element? { return nil }
var lines: AsyncLineSequence<Self> {
get {
return AsyncLineSequence<Self>()
}
}
}
var resourceBytes: URL.AsyncBytes {
get {
return AsyncBytes()
}
}
struct AsyncLineSequence<Base> : AsyncSequence, AsyncIteratorProtocol where Base : AsyncSequence, Base.Element == UInt8 {
typealias Element = String
func makeAsyncIterator() -> AsyncLineSequence<Base> {
return AsyncLineSequence<Base>()
}
mutating func next() async -> Element? { return nil }
}
var lines: AsyncLineSequence<URL.AsyncBytes> {
get {
return AsyncLineSequence<URL.AsyncBytes>()
}
}
}
func print(_ items: Any...) {}
// --- tests ---
func testURLs() async {
do
{
let url = URL(string: "http://example.com/")!
let bytes = url.resourceBytes // SOURCE
for try await byte in bytes
{
print(byte)
}
let lines = url.lines // SOURCE
for try await line in lines
{
print(line)
}
let lines2 = bytes.lines // SOURCE
for try await line in lines2
{
print(line)
}
} catch {
// ...
}
}
| |
Add test case for crash triggered in swift::constraints::Solution::coerceToType(swift::Expr*, swift::Type, swift::constraints::ConstraintLocator*, bool) const | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not --crash %target-swift-frontend %s -parse
class a{let e=(T:{var f:a
let _=(T:f
| |
Add 💥 (😢 → 57, 😀 → 5107) in swift::ConformanceLookupTable::lookupConformances(…) | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
func B<T{associatedtype B<T{}class A:B<T.B>class B<T
| |
Add test case for completing in `inout` arguments | // RUN: %empty-directory(%t)
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
struct Bar() {
init?(withInout: inout Int) {}
init?(withPointer: UnsafePointer<Int>) {}
}
struct Foo {
var myInt: Int
func bar() {
let context = Bar(wihtInout: &self.#^COMPLETE_INOUT?check=CHECK^#)
let context = Bar(withPointer: &self.#^COMPLETE_POINTER?check=CHECK^#)
}
}
// CHECK: Decl[InstanceVar]/CurrNominal: myInt[#Int#]; name=myInt | |
Add test case for crash triggered in swift::PrintOptions::setArchetypeAndDynamicSelfTransform(swift::Type, swift::DeclContext*) | // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
{protocol b{func a#^A^#enum S<T>:b | |
Add negative test for SR-12548. | // RUN: not %target-build-swift -O %s
// SR-12548: SIL verification error regarding
// `CapturePropagation::rewritePartialApply` for `partial_apply` with
// `@convention(method)` callee.
import _Differentiation
protocol Protocol: Differentiable {
@differentiable
func method() -> Self
}
extension Protocol {
@differentiable
func method() -> Self { self }
}
struct Struct: Protocol {}
let _: @differentiable (Struct) -> Struct = { $0.method() }
// SIL verification failed: operand of thin_to_thick_function must be thin: opFTy->getRepresentation() == SILFunctionType::Representation::Thin
// Verifying instruction:
// // function_ref specialized Protocol.method()
// %5 = function_ref @$s7crasher8ProtocolPAAE6methodxyFAA6StructV_TG5 : $@convention(method) (@in_guaranteed Struct) -> @out Struct // user: %6
// -> %6 = thin_to_thick_function %5 : $@convention(method) (@in_guaranteed Struct) -> @out Struct to $@callee_guaranteed (@in_guaranteed Struct) -> @out Struct // user: %11
| |
Add a solution to Course Schedule | /**
* Question Link: https://leetcode.com/problems/course-schedule/
* Primary idea: Kahn's Algorithms
* 1) Create the graph
* 2) Decorate each vertex with its in-degree
* 3) Create a set of all sources
* 4) While the set isn’t empty,
* i. Remove a vertex from the set and add it to the sorted list
* ii. For every edge from that vertex:
* - Decrement the in-degree of the destination node
* - Check all of its destination vertices and add them to the set if they have no incoming edges
* Time Complexity: O(|E| + |V|), Space Complexity: O(n^2)
* Recommand Reading: http://cs.brown.edu/courses/csci0160/lectures/14.pdf
*/
class Solution {
func canFinish(_ numCourses: Int, _ prerequisites: [[Int]]) -> Bool {
// ATTENTION: if graph use [[Int]], will get 'memory limited exceed'
var graph = [[UInt8]](repeatElement([UInt8](repeatElement(0, count: numCourses)), count: numCourses))
var indegree = [Int](repeatElement(0, count: numCourses))
// 1. Create the graph
for i in 0 ..< prerequisites.count {
let course = prerequisites[i][0]
let pre = prerequisites[i][1]
// 2. Decorate each vertex with its in-degree
// Eliminate duplicate case
if graph[pre][course] == 0 {
indegree[course] += 1
}
graph[pre][course] = 1
}
// 3. Create a array of sources
var sources = [Int]()
for i in 0 ..< numCourses {
if indegree[i] == 0 {
sources.append(i)
}
}
//var topoSortedList = [Int]()
var count = 0
while !sources.isEmpty {
// 4.i. Remove a vertex from the set and add it to the sorted list
let source = sources.popLast()
//topoSortedList.append(source!)
count += 1
// 4.ii. Decrement the in-degree of the destination node
for i in 0 ..< numCourses {
if graph[source!][i] == 1 {
indegree[i] -= 1
// Check all of its destination vertices and add them to the set if they have no incoming edges
if indegree[i] == 0 {
sources.append(i)
}
}
}
}
//return topoSortedList.count == numCourses
return count == numCourses
}
}
| |
Add leftwise flatMap operator for Decoded | /**
flatMap a function over a `Decoded` value (right associative)
- If the value is a failing case (`.TypeMismatch`, `.MissingKey`), the function will not be evaluated and this will return the value
- If the value is `.Success`, the function will be applied to the unwrapped value
- parameter x: A value of type `Decoded<T>`
- parameter f: A transformation function from type `T` to type `Decoded<U>`
- returns: A value of type `Decoded<U>`
*/
public func >>- <T, U>(x: Decoded<T>, @noescape f: T -> Decoded<U>) -> Decoded<U> {
return x.flatMap(f)
}
public extension Decoded {
func flatMap<U>(@noescape f: T -> Decoded<U>) -> Decoded<U> {
switch self {
case let .Success(value): return f(value)
case let .Failure(error): return .Failure(error)
}
}
}
| /**
flatMap a function over a `Decoded` value (right associative)
- If the value is a failing case (`.TypeMismatch`, `.MissingKey`), the function will not be evaluated and this will return the value
- If the value is `.Success`, the function will be applied to the unwrapped value
- parameter x: A value of type `Decoded<T>`
- parameter f: A transformation function from type `T` to type `Decoded<U>`
- returns: A value of type `Decoded<U>`
*/
public func >>- <T, U>(x: Decoded<T>, @noescape f: T -> Decoded<U>) -> Decoded<U> {
return x.flatMap(f)
}
/**
flatMap a function over a `Decoded` value (left associative)
- If the value is a failing case (`.TypeMismatch`, `.MissingKey`), the function will not be evaluated and this will return the value
- If the value is `.Success`, the function will be applied to the unwrapped value
- parameter x: A value of type `Decoded<T>`
- parameter f: A transformation function from type `T` to type `Decoded<U>`
- returns: A value of type `Decoded<U>`
*/
public func -<< <T, U>(@noescape f: T -> Decoded<U>, x: Decoded<T>) -> Decoded<U> {
return x.flatMap(f)
}
public extension Decoded {
func flatMap<U>(@noescape f: T -> Decoded<U>) -> Decoded<U> {
switch self {
case let .Success(value): return f(value)
case let .Failure(error): return .Failure(error)
}
}
}
|
Add test case for crash triggered in swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) | // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
// REQUIRES: asserts
extension{enum a<H{enum b{case
func a(=#^A^#
| |
Add no-longer-crashing test case from rdar://problem/35441779. | // RUN: not %target-typecheck-verify-swift
class Q {
var z: Q.z
init () {
// FIXME: Per rdar://problem/35469647, this should be well-formed, but
// it's no longer crashing the compiler.
z = Q.z.M
}
enum z: Int {
case M = 1
}
}
| |
Add test case for rdar://71566576 | // RUN: %swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename %s
if let item = ["a"].first(where: { #^COMPLETE^# }) {}
| |
Add a runtime test for Objective-C class namespacing. | // RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift -module-name MangleTest -enable-objc-mangling %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
/* FIXME: SwiftObject doesn't support -description
class Foo { }
var anyFoo: AnyObject = Foo()
println(anyFoo.description())
@objc class Bar { }
var anyBar: AnyObject = Bar()
println(anyBar.description())
*/
// Check whether the class name comes out properly in the description
// CHECK: _TtC10MangleTest6Wibble
@objc class Wibble : NSObject { }
var anyWibble: AnyObject = Wibble()
println(anyWibble.description())
// Check whether we can lookup the class with this name.
var anyWibbleClass: AnyClass = NSClassFromString("_TtC10MangleTest6Wibble")
var anyWibbleClass2 = anyWibble.`class`()
assert(NSStringFromClass(anyWibbleClass) == "_TtC10MangleTest6Wibble")
assert(NSStringFromClass(anyWibbleClass2) == "_TtC10MangleTest6Wibble")
| |
Add test case for crash triggered in swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) | // RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
struct c{struct A:a{var d}let a=A{}protocol A
| |
Add test for @location and app functions | // Test app location dispatch
import assert;
import files;
import io;
import string;
import sys;
app (file o) hostname() {
"hostname" @stdout=o;
}
(string o) extract_hostname(file f) {
o = trim(readFile(f));
}
main {
foreach i in [1:100] {
string host1 = extract_hostname(hostname());
// Run on same host
string host2 = extract_hostname(@location=hostmap_one(host1) hostname());
assertEqual(host1, host2, sprintf("Check hostnames same trial %i", i));
}
}
| |
Add 💥 case (😢 → 54, 😀 → 5095) triggered in swift::TypeChecker::addImplicitConstructors(…) | // This source file is part of the Swift.org open source project
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
// RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
var d{protocol A{{}class a:A{}typealias e:A.E{{}}class A:a
| |
Add test for flatMap deprecation message | // RUN: %target-typecheck-verify-swift %s
func flatMapOnSequence<
S : Sequence
>(xs: S, f: (S.Element) -> S.Element?) {
_ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{filterMap}}
}
func flatMapOnLazySequence<
S : LazySequenceProtocol
>(xs: S, f: (S.Element) -> S.Element?) {
_ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{filterMap}}
}
func flatMapOnLazyCollection<
C : LazyCollectionProtocol
>(xs: C, f: (C.Element) -> C.Element?) {
_ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{filterMap}}
}
func flatMapOnLazyBidirectionalCollection<
C : LazyCollectionProtocol & BidirectionalCollection
>(xs: C, f: (C.Element) -> C.Element?)
where C.Elements : BidirectionalCollection {
_ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{filterMap}}
}
func flatMapOnCollectinoOfStrings<
C : Collection
>(xs: C, f: (C.Element) -> String?) {
_ = xs.flatMap(f) // expected-warning {{deprecated}} expected-note {{filterMap}}
}
| |
Test that missing dependencies cause a rebuild | // RUN: %empty-directory(%t/ModuleCache)
// RUN: %empty-directory(%t/Build)
// 1. Create a dummy module
// RUN: echo 'public func publicFunction() {}' > %t/TestModule.swift
// 2. Create both an interface and a compiled module for it
// RUN: %target-swift-frontend -emit-module -o %t/Build/TestModule.swiftmodule %t/TestModule.swift -emit-module-interface-path %t/Build/TestModule.swiftinterface -swift-version 5 -module-name TestModule
// 3. Make the compiled module unreadable so it gets added as a dependency but is not used
// RUN: mv %t/Build/TestModule.swiftmodule %t/Build/TestModule.swiftmodule.moved-aside
// RUN: echo 'this is unreadable' > %t/Build/TestModule.swiftmodule
// 4. Try to import the module, which will create a cached module that depends on both the .swiftmodule and .swiftinterface
// RUN: %target-swift-frontend -typecheck %s -I %t/Build -module-cache-path %t/ModuleCache
// 5. Remove the .swiftmodule, which will result in a missing dependency note
// RUN: rm %t/Build/TestModule.swiftmodule
// 6. Rebuild with remarks enabled, make sure the missing dependency note is emitted
// RUN: %target-swift-frontend -typecheck -verify %s -I %t/Build -Rmodule-interface-rebuild -module-cache-path %t/ModuleCache
// 7. Put the module back, make the interface unreadable, and make sure the compiler succeeds
// RUN: mv %t/Build/TestModule.swiftmodule.moved-aside %t/Build/TestModule.swiftmodule
// RUN: mv %t/Build/TestModule.swiftinterface %t/Build/TestModule.swiftinterface.moved-aside
// RUN: echo 'this is unreadable' > %t/Build/TestModule.swiftinterface
// RUN: %target-swift-frontend -typecheck %s -I %t/Build -Rmodule-interface-rebuild -module-cache-path %t/ModuleCache
import TestModule // expected-remark {{rebuilding module 'TestModule' from interface}}
// expected-note @-1 {{cached module is out of date}}
// expected-note @-2 {{dependency is missing}}
| |
Add a testcase for arithmetic traps in optimized code. | // RUN: %swift -O -target x86_64-apple-macosx10.9 -primary-file %s -emit-ir -g -o - | FileCheck %s
// CHECK: define{{.*}}2fn
func fn() {
println("two")
println(0 - UInt(Process.arguments.count))
println("three")
}
// All traps should be coalesced at the end.
// CHECK: ret
// CHECK-NOT: }
// CHECK: tail call void @llvm.trap(), !dbg ![[LOC:.*]]
// CHECK-NEXT: unreachable, !dbg ![[LOC]]
// CHECK: ![[LOC]] = metadata !{i32 0, i32 0,
| |
Add test case for crash triggered in swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) | // RUN: not --crash %target-swift-frontend %s -parse
// REQUIRES: asserts
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
class B<T:B{class B<class b{}func b(T.B
| |
Add regression test for a bug that's already been fixed | // RUN: %target-swift-frontend %s -emit-ir
enum Term<S> where S: Sequence, S.Iterator.Element == Term {
case Cons(head: String, tail: S)
}
func produce<S>(s: S) -> Term<S> {
return .Cons(head: "hi", tail: s)
}
| |
Add a test that we don't crash when someone imports "Swift" instead of "swift". | // RUN: not %swift %s -parse
// RUN: not %swift -parse-stdlib %s -parse
// Just don't crash when accidentally importing "Swift" instead of "swift".
import Swift
print("hi")
Swift.print("hi")
| |
Move save action into another extension. | //
// LTVPNConfigViewController+Save.swift
// VPNOn
//
// Created by Lex on 1/23/15.
// Copyright (c) 2015 LexTang.com. All rights reserved.
//
import UIKit
import VPNOnKit
extension LTVPNConfigViewController
{
@IBAction func saveVPN(sender: AnyObject) {
if let currentVPN = vpn {
currentVPN.title = titleTextField.text
currentVPN.server = serverTextField.text
currentVPN.account = accountTextField.text
currentVPN.group = groupTextField.text
currentVPN.alwaysOn = alwaysOnSwitch.on
if passwordTextField!.text != kImpossibleHash {
VPNKeychainWrapper.setPassword(passwordTextField!.text, forVPNID: currentVPN.ID)
}
if secretTextField!.text != kImpossibleHash {
VPNKeychainWrapper.setSecret(secretTextField!.text, forVPNID: currentVPN.ID)
}
VPNDataManager.sharedManager.saveContext()
NSNotificationCenter.defaultCenter().postNotificationName(kLTVPNDidUpdate, object: nil)
} else {
let success = VPNDataManager.sharedManager.createVPN(
titleTextField.text,
server: serverTextField.text,
account: accountTextField.text,
password: passwordTextField.text,
group: groupTextField.text,
secret: secretTextField.text,
alwaysOn: alwaysOnSwitch.on
)
if success {
NSNotificationCenter.defaultCenter().postNotificationName(kLTVPNDidCreate, object: self)
}
}
}
func toggleSaveButtonByStatus() {
if self.titleTextField.text.isEmpty
|| self.accountTextField.text.isEmpty
|| self.serverTextField.text.isEmpty {
self.saveButton?.enabled = false
} else {
self.saveButton?.enabled = true
}
}
}
| |
Split out interpreter part of autolinking test. | // RUN: rm -rf %t
// RUN: mkdir %t
// RUN: %swift -emit-module -parse-stdlib -o %t -module-name someModule -module-link-name module %S/../Inputs/empty.swift
// RUN: not %swift -i -lmagic %s -I=%t 2>&1 | FileCheck %s
// REQUIRES: swift_interpreter
import someModule
// CHECK-DAG: error: could not load shared library 'libmagic'
// CHECK-DAG: error: could not load shared library 'libmodule'
| |
Test that Branches produces a type. | // Copyright © 2015 Rob Rix. All rights reserved.
final class TagTests: XCTestCase {
func testTagTypechecksAsFunction() {
let expected = Expression.FunctionType([ Term("Enumeration"), Term(.Type(0)) ])
let actual = Term("Tag").out.typecheck(context, against: expected)
assert(actual.left, ==, nil)
assert(actual.right, ==, expected)
}
}
private let context = Expression<Term>.tag.context
import Assertions
@testable import Manifold
import XCTest
| // Copyright © 2015 Rob Rix. All rights reserved.
final class TagTests: XCTestCase {
func testTagTypechecksAsFunction() {
let expected = Expression.FunctionType([ Term("Enumeration"), Term(.Type(0)) ])
let actual = Term("Tag").out.typecheck(context, against: expected)
assert(actual.left, ==, nil)
assert(actual.right, ==, expected)
}
func testBranchesProducesAType() {
assert(Term("Branches")[Term("[]")[Term("String")]].out.typecheck(context, against: .Type(0)).left, ==, nil)
}
}
private let context = Expression<Term>.tag.context
import Assertions
@testable import Manifold
import XCTest
|
Add tests for `split_by_char` functions | module string_utils_unit_test;
import svunit_pkg::*;
`include "svunit_defines.svh"
string name = "string_utils_ut";
svunit_testcase svunit_ut;
import svunit_under_test::string_utils;
function void build();
svunit_ut = new(name);
endfunction
task setup();
svunit_ut.setup();
endtask
task teardown();
svunit_ut.teardown();
endtask
`SVUNIT_TESTS_BEGIN
`SVTEST(some_passing_test)
`FAIL_UNLESS(svunit_under_test::TRUE)
`SVTEST_END
`SVUNIT_TESTS_END
endmodule
| module string_utils_unit_test;
import svunit_pkg::*;
`include "svunit_defines.svh"
string name = "string_utils_ut";
svunit_testcase svunit_ut;
import svunit_under_test::string_utils;
function void build();
svunit_ut = new(name);
endfunction
task setup();
svunit_ut.setup();
endtask
task teardown();
svunit_ut.teardown();
endtask
`SVUNIT_TESTS_BEGIN
`SVTEST(can_split_string_by_underscore)
string some_string = "some_string";
string parts[] = string_utils::split_by_char("_", some_string);
string exp_parts[] = '{ "some", "string" };
`FAIL_UNLESS_EQUAL(parts, exp_parts)
`SVTEST_END
`SVTEST(split_string_by_underscore_does_nothing_when_no_underscore)
string some_string = "string";
string parts[] = string_utils::split_by_char("_", some_string);
string exp_parts[] = '{ "string" };
`FAIL_UNLESS_EQUAL(parts, exp_parts)
`SVTEST_END
`SVUNIT_TESTS_END
endmodule
|
Add example with usage of `FAIL_IF_EQUAL` |
module equals_macros_example_unit_test;
import svunit_pkg::svunit_testcase;
`include "svunit_defines.svh"
string name = "equals_macros_example_ut";
svunit_testcase svunit_ut;
function void build();
svunit_ut = new(name);
endfunction
task setup();
svunit_ut.setup();
endtask
task teardown();
svunit_ut.teardown();
endtask
`SVUNIT_TESTS_BEGIN
`SVTEST(fail_unless_equal__int_variables)
int one = 1;
int two = 2;
`FAIL_UNLESS_EQUAL(one, two);
`SVTEST_END
`SVTEST(fail_unless_equal__int_variable_and_int_constant)
int one = 1;
`FAIL_UNLESS_EQUAL(one, 2);
`SVTEST_END
`SVTEST(fail_unless_equal__int_function_and_int_constant)
`FAIL_UNLESS_EQUAL(function_returning_one(), 2);
`SVTEST_END
`SVUNIT_TESTS_END
function int function_returning_one();
return 1;
endfunction
endmodule
|
module equals_macros_example_unit_test;
import svunit_pkg::svunit_testcase;
`include "svunit_defines.svh"
string name = "equals_macros_example_ut";
svunit_testcase svunit_ut;
function void build();
svunit_ut = new(name);
endfunction
task setup();
svunit_ut.setup();
endtask
task teardown();
svunit_ut.teardown();
endtask
`SVUNIT_TESTS_BEGIN
`SVTEST(fail_unless_equal__int_variables)
int one = 1;
int two = 2;
`FAIL_UNLESS_EQUAL(one, two);
`SVTEST_END
`SVTEST(fail_unless_equal__int_variable_and_int_constant)
int one = 1;
`FAIL_UNLESS_EQUAL(one, 2);
`SVTEST_END
`SVTEST(fail_unless_equal__int_function_and_int_constant)
`FAIL_UNLESS_EQUAL(function_returning_one(), 2);
`SVTEST_END
`SVTEST(fail_if_equal__int_variables)
int one = 1;
int also_one = 1;
`FAIL_IF_EQUAL(one, also_one);
`SVTEST_END
`SVUNIT_TESTS_END
function int function_returning_one();
return 1;
endfunction
endmodule
|
Add examples with usage of `FAIL_UNLESS_EQUAL` |
module equals_macros_example_unit_test;
import svunit_pkg::svunit_testcase;
`include "svunit_defines.svh"
string name = "equals_macros_example_ut";
svunit_testcase svunit_ut;
function void build();
svunit_ut = new(name);
endfunction
task setup();
svunit_ut.setup();
endtask
task teardown();
svunit_ut.teardown();
endtask
`SVUNIT_TESTS_BEGIN
`SVTEST(fail_unless_equal__int_variables)
int one = 1;
int two = 2;
`FAIL_UNLESS_EQUAL(one, two);
`SVTEST_END
`SVTEST(fail_unless_equal__int_variable_and_int_constant)
int one = 1;
`FAIL_UNLESS_EQUAL(one, 2);
`SVTEST_END
`SVTEST(fail_unless_equal__int_function_and_int_constant)
`FAIL_UNLESS_EQUAL(function_returning_one(), 2);
`SVTEST_END
`SVUNIT_TESTS_END
function int function_returning_one();
return 1;
endfunction
endmodule
| |
Downgrade an error to a warning | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# This file sets common message configurations for all JasperGold tcl files.
# Save debug effort to escalate the following error messages
# Error out on use of undeclared signals
set_message -error VERI-9030
# Error out when a parameter is defined twice for an instance
set_message -error VERI-1402
# Disabling warnings:
# We use parameter instead of localparam in packages to allow redefinition
# at elaboration time.
# Formal isunknown does not support non-constant.
# Formal will skip initial construct.
# "parameter declared inside package XXX shall be treated as localparam"
set_message -disable VERI-2418
# "system function call isunknown with non-constant argument is not synthesizable"
set_message -disable VERI-1796
# "initial construct ignored"
set_message -disable VERI-1060
| # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# This file sets common message configurations for all JasperGold tcl files.
# Save debug effort to escalate the following error messages
# Error out on use of undeclared signals
set_message -error VERI-9030
# Error out when a parameter is defined twice for an instance
set_message -error VERI-1402
# Downgrade the enum cast error to warnings.
# For example: JasperGold will throw an error and terminate if design assign an int to an enum
# type.
set_message -warning VERI-1348
# Disabling warnings:
# We use parameter instead of localparam in packages to allow redefinition
# at elaboration time.
# Formal isunknown does not support non-constant.
# Formal will skip initial construct.
# "parameter declared inside package XXX shall be treated as localparam"
set_message -disable VERI-2418
# "system function call isunknown with non-constant argument is not synthesizable"
set_message -disable VERI-1796
# "initial construct ignored"
set_message -disable VERI-1060
|
Add timestamp for bitstream identification via USR_ACCESS reg | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
set workroot [file dirname [info script]]
send_msg "Designcheck 1-1" INFO "Checking design"
# Ensure the design meets timing
set slack_ns [get_property SLACK [get_timing_paths -delay_type min_max]]
send_msg "Designcheck 1-2" INFO "Slack is ${slack_ns} ns."
if [expr {$slack_ns < 0}] {
send_msg "Designcheck 1-3" ERROR "Timing failed. Slack is ${slack_ns} ns."
}
| # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
set workroot [file dirname [info script]]
send_msg "Designcheck 1-1" INFO "Checking design"
# Ensure the design meets timing
set slack_ns [get_property SLACK [get_timing_paths -delay_type min_max]]
send_msg "Designcheck 1-2" INFO "Slack is ${slack_ns} ns."
if [expr {$slack_ns < 0}] {
send_msg "Designcheck 1-3" ERROR "Timing failed. Slack is ${slack_ns} ns."
}
# Enable bitstream identification via USR_ACCESS register.
set_property BITSTREAM.CONFIG.USR_ACCESS TIMESTAMP [current_design]
|
Fix the test for tiff reader to use same image as jpeg test | package require vtk
# Image pipeline
vtkImageReader2Factory createReader
set reader [createReader CreateImageReader2 "$VTK_DATA_ROOT/Data/libtiff/test.tif"]
$reader SetFileName "$VTK_DATA_ROOT/Data/libtiff/test.tif"
vtkImageViewer viewer
viewer SetInput [$reader GetOutput]
viewer SetColorWindow 256
viewer SetColorLevel 127.5
#make interface
viewer Render | package require vtk
# Image pipeline
vtkImageReader2Factory createReader
set reader [createReader CreateImageReader2 "$VTK_DATA_ROOT/Data/beach.tif"]
$reader SetFileName "$VTK_DATA_ROOT/Data/beach.tif"
vtkImageViewer viewer
viewer SetInput [$reader GetOutput]
viewer SetColorWindow 256
viewer SetColorLevel 127.5
#make interface
viewer Render |
Fix remoterc.tmp not being deleted once unneeded. | # Converse of acctinfo.tcl --- saves a section of abendstern.rc
# to the server.
if {"" != $::abnet::userid} {
$ create remoterc.tmp remote
$ add remote hud STGroup
$ add remote control_scheme STString
$ add remote ship_colour STArray
$ add remote camera STGroup
$ add remote default_share_ships STBool
foreach c {hud control_scheme ship_colour camera
default_share_ships} {
confcpy remote.$c conf.$c
}
$ sync remote
$ close remote
::abnet::putf abendstern.rc remoterc.tmp
$state setCallback [_ A boot acctinfs] {
expr {$::abnet::busy? 0 : 200}
}
}
| # Converse of acctinfo.tcl --- saves a section of abendstern.rc
# to the server.
if {"" != $::abnet::userid} {
$ create remoterc.tmp remote
$ add remote hud STGroup
$ add remote control_scheme STString
$ add remote ship_colour STArray
$ add remote camera STGroup
$ add remote default_share_ships STBool
foreach c {hud control_scheme ship_colour camera
default_share_ships} {
confcpy remote.$c conf.$c
}
$ sync remote
$ close remote
::abnet::putf abendstern.rc remoterc.tmp
$state setCallback [_ A boot acctinfs] {
if {$::abnet::busy} {
return 0
} else {
file delete remoterc.tmp
return 200
}
}
}
|
Return a non-zero exit code if any example fails. | namespace eval Spec {
nx::Class create Runner {
:public class method autorun {} {
if { [:installed_at_exit?] } {
return
}
set :installed_at_exit true
at_exit { exit [::Spec::Runner run] }
}
:public class method run {} {
set exit_code 0
set reporter [[::Spec configuration] reporter]
$reporter report [[Spec world] example_count] {
foreach example_group [[Spec world] example_groups] {
$example_group execute $reporter
}
}
return $exit_code
}
:public class method installed_at_exit? {} {
expr { [info exists :installed_at_exit] && ${:installed_at_exit} }
}
}
} | namespace eval Spec {
nx::Class create Runner {
:public class method autorun {} {
if { [:installed_at_exit?] } {
return
}
set :installed_at_exit true
at_exit { exit [::Spec::Runner run] }
}
:public class method run {} {
set failure_exit_code 1
set success true
set reporter [[::Spec configuration] reporter]
$reporter report [[Spec world] example_count] {
foreach example_group [[Spec world] example_groups] {
set success [expr { [$example_group execute $reporter] && $success }]
}
}
expr { $success ? 0 : $failure_exit_code }
}
:public class method installed_at_exit? {} {
expr { [info exists :installed_at_exit] && ${:installed_at_exit} }
}
}
} |
Create a B using clipping | catch {load vtktcl}
# get the interactor ui
source vtkInt.tcl
# and some nice colors
source colors.tcl
# Now create the RenderWindow, Renderer and Interactor
#
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
vtkPNMReader image
image SetFileName "../../vtkdata/B.pgm"
vtkStructuredPointsToImage toImage
toImage SetInput [image GetOutput]
toImage SetOutputScalarTypeToUnsignedChar
vtkImageGaussianSmooth gaussian
eval gaussian SetStandardDeviations 2 2
gaussian SetDimensionality 2
gaussian SetStrides 2 2
gaussian SetRadiusFactors 1 1
gaussian SetInput [toImage GetOutput]
gaussian SetInput [image GetOutput]
vtkStructuredPointsGeometryFilter geometry
geometry SetInput [gaussian GetOutput]
vtkClipPolyData aClipper
aClipper SetInput [geometry GetOutput]
aClipper SetValue 127.5
aClipper GenerateClipScalarsOff
aClipper InsideOutOn
[[aClipper GetOutput] GetPointData] CopyScalarsOff
aClipper Update
vtkPolyDataMapper mapper
mapper SetInput [aClipper GetOutput]
mapper ScalarVisibilityOff
vtkActor letter
letter SetMapper mapper
ren1 AddActor letter
[letter GetProperty] SetDiffuseColor 0 0 0
[letter GetProperty] SetRepresentationToWireframe
ren1 SetBackground 1 1 1
renWin SetSize 320 320
iren SetUserMethod {wm deiconify .vtkInteract}
iren Initialize
# render the image
#
renWin Render
# prevent the tk window from showing up then start the event loop
wm withdraw .
| |
Test of vtkGeometryFilter use of ghost cells. | # This scripts tests a couple of things.
# Images generating ghost level arrays,
# and geometry correctly processing ghost cells.
# It asks for a piece from a geometry filter with an image data input.
catch {load vtktcl}
if { [catch {set VTK_TCL $env(VTK_TCL)}] != 0} { set VTK_TCL "../../examplesTcl" }
if { [catch {set VTK_DATA $env(VTK_DATA)}] != 0} { set VTK_DATA "../../../vtkdata" }
# get the interactor ui
source $VTK_TCL/vtkInt.tcl
source $VTK_TCL/colors.tcl
# Create the RenderWindow, Renderer and both Actors
#
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
# create pipeline
#
set RESOLUTION 64
set START_SLICE 1
set END_SLICE 63
set PIXEL_SIZE 3.2
vtkVolume16Reader reader
eval reader SetDataDimensions $RESOLUTION $RESOLUTION
reader SetFilePrefix $VTK_DATA/headsq/quarter
reader SetDataSpacing $PIXEL_SIZE $PIXEL_SIZE 1.5
reader SetImageRange $START_SLICE $END_SLICE
reader SetHeaderSize 0
reader SetDataMask 0x7fff;
reader SetDataByteOrderToLittleEndian
#vtkImageReader reader
#reader SetDataByteOrderToLittleEndian
#reader SetDataExtent 0 63 0 63 1 64
#reader SetFilePrefix "$VTK_DATA/headsq/quarter"
#reader SetDataMask 0x7fff
#reader SetDataSpacing 1.6 1.6 1.5
#reader SetStartMethod {puts [[reader GetOutput] GetUpdateExtent]}
vtkGeometryFilter geom
geom SetInput [reader GetOutput]
vtkPolyDataMapper mapper
mapper SetInput [geom GetOutput]
mapper ScalarVisibilityOn
mapper SetScalarRange 0 1200
mapper SetPiece 0
mapper SetNumberOfPieces 8
vtkActor actor
actor SetMapper mapper
# Add the actors to the renderer, set the background and size
#
ren1 AddActor actor
ren1 SetBackground 0.2 0.3 0.4
renWin SetSize 450 450
[ren1 GetActiveCamera] Elevation 90
[ren1 GetActiveCamera] SetViewUp 0 0 -1
set cam [ren1 GetActiveCamera]
$cam SetPosition 191.247 -64.5654 285.805
$cam SetViewUp -0.0907763 0.894432 0.437894
$cam SetFocalPoint 49.6 49.6 23.25
ren1 ResetCameraClippingRange
renWin Render
# render the image
#
iren SetUserMethod {wm deiconify .vtkInteract}
iren Initialize
# prevent the tk window from showing up then start the event loop
wm withdraw .
| |
Remove list of tables and figures There's no tables or figures in the document | \input{../../common/style/global.tex}
\input{../../common/style/layout.tex}
\input{res/local}
\title{\textbf{Norme di Progetto}}
\author{BugBuster}
\date{23 Maggio 2016}
\begin{document}
%\maketitle
\makeFrontPage
\tableofcontents
\listoffigures
\listoftables
\include{res/versions}
\include{res/listOfSections}
\end{document}
| \input{../../common/style/global.tex}
\input{../../common/style/layout.tex}
\input{res/local}
\title{\textbf{Norme di Progetto}}
\author{BugBuster}
\date{23 Maggio 2016}
\begin{document}
%\maketitle
\makeFrontPage
\tableofcontents
%\listoffigures
%\listoftables
\include{res/versions}
\include{res/listOfSections}
\end{document}
|
Move platform before research IDE | \documentclass[12pt]{report}
\usepackage{mystyle}
\usepackage{subfiles}
\begin{document}
\subfile{./tex/front-matter}
\subfile{./tex/introduction}
\subfile{./tex/engineering}
\subfile{./tex/background}
\subfile{./tex/prototypes}
\subfile{./tex/case-study-fourth-year-system}
\subfile{./tex/case-study-research-ide}
\subfile{./tex/platform}
\subfile{./tex/conclusion}
\include{./tex/citations}
% Add appendices now.
\appendix
\subfile{./tex/appendix-use-cases-1}
\subfile{./tex/appendix-use-cases-2}
\subfile{./tex/appendix-framework-research}
%\chapter{Extra Simulation Results}
%
%\chapter{Review of Linear Algebra}
\end{document}
| \documentclass[12pt]{report}
\usepackage{mystyle}
\usepackage{subfiles}
\begin{document}
\subfile{./tex/front-matter}
\subfile{./tex/introduction}
\subfile{./tex/engineering}
\subfile{./tex/background}
\subfile{./tex/prototypes}
\subfile{./tex/case-study-fourth-year-system}
\subfile{./tex/platform}
\subfile{./tex/case-study-research-ide}
\subfile{./tex/conclusion}
\include{./tex/citations}
% Add appendices now.
\appendix
\subfile{./tex/appendix-use-cases-1}
\subfile{./tex/appendix-use-cases-2}
\subfile{./tex/appendix-framework-research}
%\chapter{Extra Simulation Results}
%
%\chapter{Review of Linear Algebra}
\end{document}
|
Add specification of class NODE. | \chapter{Binary trees}
\label{chap-binary-trees}
| \chapter{Binary trees}
\label{chap-binary-trees}
\Defclass {node}
This class is the base class for all node types in binary trees.
|
Use small caps in title. | @article{bank1985transient,
title={Transient simulation of silicon devices and circuits},
author={Bank, Randolph E and Coughran, William M and Fichtner, Wolfgang and
Grosse, Eric H and Rose, Donald J and Smith, R Kent},
journal={IEEE Transactions on Computer-Aided Design of Integrated Circuits
and Systems},
volume={4},
number={4},
pages={436--451},
year={1985},
publisher={IEEE}
},
@article{hosea1996analysis,
title={Analysis and implementation of \textsc{tr-bdf}\oldstylenums{2}},
author={Hosea, ME and Shampine, LF},
journal={Applied Numerical Mathematics},
volume={20},
number={1},
pages={21--37},
year={1996},
publisher={Elsevier}
}
@book{edward2010hughes,
title={Hughes Electrical And Electronic Technology},
author={Edward, H.},
isbn={9788131733660},
year={2010},
edition={10},
pages={1--198},
publisher={Pearson Education}
} | @article{bank1985transient,
title={Transient simulation of silicon devices and circuits},
author={Bank, Randolph E and Coughran, William M and Fichtner, Wolfgang and
Grosse, Eric H and Rose, Donald J and Smith, R Kent},
journal={IEEE Transactions on Computer-Aided Design of Integrated Circuits
and Systems},
volume={4},
number={4},
pages={436--451},
year={1985},
publisher={IEEE}
},
@article{hosea1996analysis,
title={Analysis and implementation of \TRBDFII},
author={Hosea, ME and Shampine, LF},
journal={Applied Numerical Mathematics},
volume={20},
number={1},
pages={21--37},
year={1996},
publisher={Elsevier}
}
@book{edward2010hughes,
title={Hughes Electrical And Electronic Technology},
author={Edward, H.},
isbn={9788131733660},
year={2010},
edition={10},
pages={1--198},
publisher={Pearson Education}
} |
Update in the use case Hugin Link | \newpage
\section{Use Case - Hugin Link (HL)}
\label{UseCase:HL}
\begin{description}
\item[Priority:] Must
\item[Deadline:] M15
\item[Responsible:]
\end{description}
\subsubsection*{Description of the Use Case}
Enter a textual description of the use case. Link to other use cases or functionalities if needed.
\subsubsection*{Must-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
\subsubsection*{Should-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
\subsubsection*{Could-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
| %!TEX root = ../MainDoc.tex
\newpage
\section{Use Case - Hugin Link (HL)}
\label{UseCase:HL}
\begin{description}
\item[Priority:] Must
\item[Deadline:] M15
\item[Responsible:] A. Fern\'andez
\end{description}
\subsubsection*{Description of the Use Case}
This use case contains all the functionality needed to link the AMIDST toolbox with the HUGIN software. This linkage is addressed by converting Hugin models into AMIDST models, and vice versa. This feature is extremely useful as it allows expanding the testing possibilities of the AMIDST models within a well-stablished platform as Hugin. Also, the link to Hugin can be used for providing some extra functionality to AMIDST that will not be implemented. Finally, the linkage is useful for comparison purposes, i.e., a new inference algorithm implemented in AMIDST could be compared with some state-of-the-art algorithm included in Hugin.
\subsubsection*{Must-Requirements List of the Use Case}
\begin{enumerate}
\item Bayesian network converter from AMIDST to Hugin format.
\item Bayesian network converter from Hugin to AMIDST format.
\item Possibility of saving the converted Hugin network in a \texttt{.net} file.
\end{enumerate}
\subsubsection*{Should-Requirements List of the Use Case}
\begin{enumerate}
\item
\end{enumerate}
\subsubsection*{Could-Requirements List of the Use Case}
\begin{enumerate}
\item Converter from AMIDST to HUGIN and vice versa of some functionality that is not relevant for model representation.
\end{enumerate}
|
Add information for package nomenclature | \nomenclature{UART}{Universal Asynchronous Receiver Transmitter}
%\nomenclature{}{}
%\nomenclature{}{}
%\nomenclature{}{}
%\nomenclature{}{} | %Bei der Verwendung des Pakets nomenclature muss der Befehl makeindex ausgeführt werden, um das Abkürzungsverzeichnis zu aktualisieren.
%When using the package nomenclature, you have to execute the command makeindex to update the list of abbreviations.
%https://tex.stackexchange.com/questions/27824/using-package-nomencl
%latex <filename>.tex
%makeindex <filename>.nlo -s nomencl.ist -o <filename>.nls
%latex <filename>.tex
\nomenclature{UART}{Universal Asynchronous Receiver Transmitter}
%\nomenclature{}{}
%\nomenclature{}{}
%\nomenclature{}{}
%\nomenclature{}{}
|
Fix typo and file extension in example tex template | \documentclass{article}
\usepackage[utf8]{inputenc}
\title{<%= project_name %>}
\author{<%= user.first_name %> <%= user.last_name %>}
\date{<%= month %> <%= year %>}
\usepackage{natbib}
\usepackage{graphicx}
\begin{document}
\maketitle
\section{Introduction}
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened.
\begin{figure}[h!]
\centering
\includegraphics[scale=1.7]{universe.jpg}
\caption{The Universe}
\label{fig:univerise}
\end{figure}
\section{Conclusion}
``I always thought something was fundamentally wrong with the universe'' \citep{adams1995hitchhiker}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
| \documentclass{article}
\usepackage[utf8]{inputenc}
\title{<%= project_name %>}
\author{<%= user.first_name %> <%= user.last_name %>}
\date{<%= month %> <%= year %>}
\usepackage{natbib}
\usepackage{graphicx}
\begin{document}
\maketitle
\section{Introduction}
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened.
\begin{figure}[h!]
\centering
\includegraphics[scale=1.7]{universe}
\caption{The Universe}
\label{fig:universe}
\end{figure}
\section{Conclusion}
``I always thought something was fundamentally wrong with the universe'' \citep{adams1995hitchhiker}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
|
Replace MIR by HIR which is what the AST translates to. | \chapter{Translating AST to MIR}
\label{chap-translating-ast-to-mir}
The translation of an abstract syntax tree
\seechap{chap-abstract-syntax-tree} to medium-level intermediate
representation \seechap{chap-ir} is done by an algorithm that is
similar to that of CPS-conversion.%
\footnote{CPS means Continuation Passing Style.}
As with CPS-conversion, translation makes the control structure
explicit. Another similarity is that translation is done from the end
of the program to the beginning.
Translation of a form is accomplished with respect to a
\emph{compilation context}. This context contains a \emph{list of
lexical variables} to which the values of the translated AST must be
assigned. The length of the list corresponds to the number of values
required by the context. The context also contains a \emph{list of
successors} which represent MIR instructions to which transfer
control after evaluation of the current AST.
| \chapter{Translating AST to HIR}
\label{chap-translating-ast-to-hir}
The translation of an abstract syntax tree
\seechap{chap-abstract-syntax-tree} to medium-level intermediate
representation \seechap{chap-ir} is done by an algorithm that is
similar to that of CPS-conversion.%
\footnote{CPS means Continuation Passing Style.}
As with CPS-conversion, translation makes the control structure
explicit. Another similarity is that translation is done from the end
of the program to the beginning.
Translation of a form is accomplished with respect to a
\emph{compilation context}. This context contains a \emph{list of
lexical variables} to which the values of the translated AST must be
assigned. The length of the list corresponds to the number of values
required by the context. The context also contains a \emph{list of
successors} which represent MIR instructions to which transfer
control after evaluation of the current AST.
|
Add inclusion of amsmfonts package | \documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\title{Fast set implementation based on a hybrid hashtable and AVL}
\author{
Julian Ganz\\
\and
Matthias Beyer\\
}
\begin{document}
\maketitle{}
\tableofcontents{}
\input{intro}
\input{overview}
\input{data-layout}
\input{operations}
\input{parameters}
\end{document}
| \documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{amsfonts}
\title{Fast set implementation based on a hybrid hashtable and AVL}
\author{
Julian Ganz\\
\and
Matthias Beyer\\
}
\begin{document}
\maketitle{}
\tableofcontents{}
\input{intro}
\input{overview}
\input{data-layout}
\input{operations}
\input{parameters}
\end{document}
|
Add explanation of bit counting algorithm | \section{Miscellaneous}
\label{sec:misc}
This section serves the purpose of documenting miscellaneous algorithms used
in the library.
| \section{Miscellaneous}
\label{sec:misc}
This section serves the purpose of documenting miscellaneous algorithms used
in the library.
\subsection{Bit counting algorithm}
\label{sec:misc-bitcount}
A classical way of counting bits set in an integer is to perform shifts
to the right, reading out the single bits and counting up a variable for
each bit found set to $1$.
This simple algorithm is in $O(n)$, where $n$ is the number of bits in
an integer.
This section will introduce an algorithm which performs the same task,
but is in $O(log(n))$.
An integer is a series of bits, representing a number. But each bit
itself or any sub-group of adjacent bits within the integer may also
be interpreted as a number.
Now imagine each bit of an integer as an virtual integer of it's own,
which may be either $0$ or $1$.
If we group those bits into pairs, and add up each pair, the result is
half the number of integers, which may each take the place of the pair
which was used to calculate them.
Each of the new integers holds the number of bits set in the original
pair.
Now imaging those 2bit-wide integers be grouped in pairs and added up.
The result will be, again, half the number of integers which are now
4bit wide.
The step may be continued until only one number remains, which fills up
the entire space of the physical integer.
This integer now holds the number of bits which were set in the original
integer fed to the algorithm.
For a visualization of the algorithm, see figure
\ref{fig:misc-bitcount-hierarchical_merge}).
\begin{figure}[!h]
\caption{Hierarchical merges}
\label{fig:misc-bitcount-hierarchical_merge}
\begin{center}
\includegraphics{fig/hierarchical-merge.1}
\end{center}
\end{figure}
The algorithm is in $O(log(n))$ if we manage to perform each step in
constant time, e.g. independently of the number of pairs being merged.
This is, indeed, possible using bitwise operations which affect all the
pairs in parallel.
To merge each pair, we have to shift the entire physical integer to the
right by the width of one virtual integer.
This results in the ``higher'' of the integers in a pair to be on the
same ``level'' as the ``lower'' one was before.
If we mask both the result of the shifting operation and the original
value, we have two clean sets of virtual integers.
If we add those physical integers the regular way, the overflows of each
pair will end up in the place where the ``higher'' of the virtual
integers was before (see fig. \ref{fig:misc-bitcount-single_merge}).
Since the overflow may be of one bit at most, this is acceptable.
\begin{figure}[!h]
\caption{A single merge}
\label{fig:misc-bitcount-single_merge}
\begin{center}
\includegraphics{fig/single-merge.1}
\end{center}
\end{figure}
|
Add information to our app slide | \begin{frame}
\frametitle{Nasze rozwiązanie --- dla end-usera}
\begin{columns}[c]
\begin{column}{.45\textwidth}
\begin{enumerate}
\item \todo{Że na Androida.}
\item \todo{Że import.}
\item \todo{Że synchronizacja online i offline.}
\item \todo{Że banalne w obsłudze --- genialny UX!}
\end{enumerate}
\end{column}
\begin{column}{.45\textwidth}
\begin{figure}
\includegraphics[width=\textwidth]{xmind}
\caption{Mapa myśli z XMind-a.}
\end{figure}
\end{column}
\end{columns}
\end{frame}
| \begin{frame}
\frametitle{Nasze rozwiązanie --- dla end-usera}
\begin{columns}[c]
\begin{column}{.45\textwidth}
\begin{enumerate}
\item Android
\item Kompatybilność z formatem programu XMind
\item Kolaboracja online
\item Synchronizacja offline
\item Intuicyjny interfejs użytkownika
\end{enumerate}
\end{column}
\begin{column}{.45\textwidth}
\begin{figure}
\includegraphics[width=\textwidth]{xmind}
\caption{Mapa myśli z XMind-a.}
\end{figure}
\end{column}
\end{columns}
\end{frame}
|
Hide colored borders around hyperlinks | \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{custommacros}[2017/10/16 v0.1 Custom macros and helpers]
\RequirePackage{xcolor}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{xparse}
\newcommand{\todo}[1][To be updated later!]{{\color{red} TODO: {#1}}}
\makeatletter
\def\app@exe{\immediate\write18}
\def\inputAllFiles#1{%
\app@exe{ls #1/*.tex | xargs cat >> #1/\jobname.tmp}%
\InputIfFileExists{#1/\jobname.tmp}{}
\AtEndDocument{\app@exe{rm -f #1/\jobname.tmp}}}
\makeatother
%%% This macro is a drop in replacement for \includegraphics that ensures the images
%%% aspect ratio is maintained when changing its width, height or scale
%%% Usage \imageKeepAspect[keyvals]{imagePath}
\NewDocumentCommand{\imageKeepAspect}{+O{width=\textwidth,height=\textheight}+m}{%
\includegraphics[#1,keepaspectratio]{#2}
}
| \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{custommacros}[2017/10/16 v0.1 Custom macros and helpers]
\RequirePackage{xcolor}
\RequirePackage{graphicx}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage{xparse}
\newcommand{\todo}[1][To be updated later!]{{\color{red} TODO: {#1}}}
\makeatletter
\def\app@exe{\immediate\write18}
\def\inputAllFiles#1{%
\app@exe{ls #1/*.tex | xargs cat >> #1/\jobname.tmp}%
\InputIfFileExists{#1/\jobname.tmp}{}
\AtEndDocument{\app@exe{rm -f #1/\jobname.tmp}}}
\makeatother
%%% This macro is a drop in replacement for \includegraphics that ensures the images
%%% aspect ratio is maintained when changing its width, height or scale
%%% Usage \imageKeepAspect[keyvals]{imagePath}
\NewDocumentCommand{\imageKeepAspect}{+O{width=\textwidth,height=\textheight}+m}{%
\includegraphics[#1,keepaspectratio]{#2}
}
|
Add paragraph with name of package and its location. | \chapter{Translating AST to HIR}
\label{chap-translating-ast-to-hir}
The translation of an abstract syntax tree
\seechap{chap-abstract-syntax-tree} to high-level intermediate
representation \seechap{chap-ir} is done by an algorithm that is
similar to that of CPS-conversion.%
\footnote{CPS means Continuation Passing Style.}
As with CPS-conversion, translation makes the control structure
explicit. Another similarity is that translation is done from the end
of the program to the beginning.
\section{\asdf{} system name}
The name of the \asdf{} system that accomplishes the translation of an
abstract syntax tree into HIR is called \texttt{cleavir-ast-to-hir}
and it is located in the file \texttt{cleavir-ast-to-hir.asd} in the
sub-directory named \texttt{AST-to-HIR}.
\section{Package}
\section{Compilation context}
Translation of a form is accomplished with respect to a
\emph{compilation context}. This context contains a \emph{list of
lexical variables} to which the values of the translated AST must be
assigned. The length of the list corresponds to the number of values
required by the context. The context also contains a \emph{list of
successors} which represent MIR instructions to which transfer
control after evaluation of the current AST.
| \chapter{Translating AST to HIR}
\label{chap-translating-ast-to-hir}
The translation of an abstract syntax tree
\seechap{chap-abstract-syntax-tree} to high-level intermediate
representation \seechap{chap-ir} is done by an algorithm that is
similar to that of CPS-conversion.%
\footnote{CPS means Continuation Passing Style.}
As with CPS-conversion, translation makes the control structure
explicit. Another similarity is that translation is done from the end
of the program to the beginning.
\section{\asdf{} system name}
The name of the \asdf{} system that accomplishes the translation of an
abstract syntax tree into HIR is called \texttt{cleavir-ast-to-hir}
and it is located in the file \texttt{cleavir-ast-to-hir.asd} in the
sub-directory named \texttt{AST-to-HIR}.
\section{Package}
The name of the package that contains the names specific to this
system is \texttt{cleavir-ast-to-hir}. It is defined in the file
named \texttt{packages.lisp} in the sub-directory named
\texttt{AST-to-HIR}.
\section{Compilation context}
Translation of a form is accomplished with respect to a
\emph{compilation context}. This context contains a \emph{list of
lexical variables} to which the values of the translated AST must be
assigned. The length of the list corresponds to the number of values
required by the context. The context also contains a \emph{list of
successors} which represent MIR instructions to which transfer
control after evaluation of the current AST.
|
Decrease margin size for x3-assignment, was a bit too wide | \documentclass[a4paper,ngerman]{article}
% General includes used by all x3-templates
\input{x3-general-preamble}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
| \documentclass[a4paper,ngerman]{article}
\usepackage{geometry}
\geometry{
top=1.5in,
inner=1.5in,
outer=1.5in,
bottom=1.5in,
headheight=3ex,
headsep=3ex
}
% General includes used by all x3-templates
\input{x3-general-preamble}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
|
Add X-ExtraFiles key to list extra files | ## Interface: 30000
## Title: TradeCD
## Notes: LibDataBroker for tradeskill cooldowns
## Author: David M. Cooke
## X-Email: david.m.cooke@gmail.com
## Version: 1.0
## X-Category: Tradeskill
## SavedVariables: TradeCD_DB
# embedded libraries
LibStub.lua
CallbackHandler-1.0.lua
LibDataBroker-1.1.lua
base.lua
debug.lua
dmc.lua
TradeCD.lua
| ## Interface: 30000
## Title: TradeCD
## Notes: LibDataBroker for tradeskill cooldowns
## Author: David M. Cooke
## X-Email: david.m.cooke@gmail.com
## Version: 1.0
## X-Category: Tradeskill
## SavedVariables: TradeCD_DB
# embedded libraries
LibStub.lua
CallbackHandler-1.0.lua
LibDataBroker-1.1.lua
base.lua
debug.lua
dmc.lua
TradeCD.lua
## X-ExtraFiles: icon.tga
|
Set paper size to A4 | \documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[space]{grffile}
\newcommand*{\R}{\mathbb{R}}
\newcommand*{\N}{\mathbb{N}}
\newcommand*{\Z}{\mathbb{Z}}
\newcommand*{\Q}{\mathbb{Q}}
\newcommand*{\C}{\mathbb{C}}
\newcommand*{\sgn}{\operatorname{sgn}}
| \documentclass[a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[space]{grffile}
\newcommand*{\R}{\mathbb{R}}
\newcommand*{\N}{\mathbb{N}}
\newcommand*{\Z}{\mathbb{Z}}
\newcommand*{\Q}{\mathbb{Q}}
\newcommand*{\C}{\mathbb{C}}
\newcommand*{\sgn}{\operatorname{sgn}}
|
Update in the use case Hugin Link | \newpage
\section{Use Case - Hugin Link (HL)}
\label{UseCase:HL}
\begin{description}
\item[Priority:] Must
\item[Deadline:] M15
\item[Responsible:]
\end{description}
\subsubsection*{Description of the Use Case}
Enter a textual description of the use case. Link to other use cases or functionalities if needed.
\subsubsection*{Must-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
\subsubsection*{Should-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
\subsubsection*{Could-Requirements List of the Use Case}
\begin{enumerate}
\item Short Description
\end{enumerate}
| %!TEX root = ../MainDoc.tex
\newpage
\section{Use Case - Hugin Link (HL)}
\label{UseCase:HL}
\begin{description}
\item[Priority:] Must
\item[Deadline:] M15
\item[Responsible:] A. Fern\'andez
\end{description}
\subsubsection*{Description of the Use Case}
This use case contains all the functionality needed to link the AMIDST toolbox with the HUGIN software. This linkage is addressed by converting Hugin models into AMIDST models, and vice versa. This feature is extremely useful as it allows expanding the testing possibilities of the AMIDST models within a well-stablished platform as Hugin. Also, the link to Hugin can be used for providing some extra functionality to AMIDST that will not be implemented. Finally, the linkage is useful for comparison purposes, i.e., a new inference algorithm implemented in AMIDST could be compared with some state-of-the-art algorithm included in Hugin.
\subsubsection*{Must-Requirements List of the Use Case}
\begin{enumerate}
\item Bayesian network converter from AMIDST to Hugin format.
\item Bayesian network converter from Hugin to AMIDST format.
\item Possibility of saving the converted Hugin network in a \texttt{.net} file.
\end{enumerate}
\subsubsection*{Should-Requirements List of the Use Case}
\begin{enumerate}
\item
\end{enumerate}
\subsubsection*{Could-Requirements List of the Use Case}
\begin{enumerate}
\item Converter from AMIDST to HUGIN and vice versa of some functionality that is not relevant for model representation.
\end{enumerate}
|
Add pandoc template for tccv | \documentclass[fontsize=10pt]{tccv}
\usepackage[english]{babel}
\begin{document}
\part{$basics.name$}
\section{Select work experience}
\begin{eventlist}
$for(work)$
\item{$work.startDate$ -- $if(work.endDate)$$work.endDate$$else$Present$endif$}
{\href{$work.website$}{$work.company$}}
{$work.position$}
$work.summary$
$endfor$
\end{eventlist}
\personal
[blorg.ericb.me] % [$basics.website$]
% {Address}
% {Phone}
{eric@ericb.me}
\section{Education}
\begin{yearlist}
$for(education)$
\item[$education.area$]{$if(education.startDate)$$education.startDate$ -- $endif$$education.endDate$}
{$education.studyType$}
{$education.institution$}
$endfor$
\end{yearlist}
\section{Interviews}
\begin{yearlist}
$for(publications)$
\item{$publications.year$}
{$publications.publisher$ (\href{$publications.website$}{$publications.name$})}
{$publications.summary$}
$endfor$
\end{yearlist}
\section{Communication skills}
\begin{factlist}
$for(languages)$
\item{$languages.language$}{$languages.fluency$}
$endfor$
\end{factlist}
\section{Software skills}
\begin{factlist}
$for(programming)$
\item{$programming.fluency$}
{$for(programming.languages)$$programming.languages$$sep$, $endfor$}
$endfor$
\end{factlist}
\end{document}
| |
Add first bits of user guide | \chapter{User Guide}
\label{chap:Guide}
| \chapter{User Guide}
\label{chap:Guide}
Welcome to Viskell!
Viskell is a tool to experiment with the Haskell programming language in a visual and playful way.
You don't need to be a Haskell expert to use Viskell: this User Guide will tell you everything you know to get started.
\textbf{Squares!}
First, we're building a program that calculates the product of two numbers.
To do that, right-click (or tap-and-hold) anywhere to open the \emph{function menu}, if it isn't open already.
(It's the big, purple box: it's hard to miss.)
The function menu has a number of buttons to choose from.
For now, click the button that says \emph{Display Block} to add a display to your program.
The display block doesn't do much on its own: it only displays the value that it's connected to.
Next, add a \emph{value block} by clicking the respective button on the function menu.
You'll be asked to provide a value: something like 1234 will do.
You should now have two blocks: drag the output block so that it's a bit below the value block.
Then, from the \emph{Numeric types} category, click \emph{(*)}, the multiplication function.
The multiplication function has two inputs.
Connect both inputs (the top dots) to the value block you created by clicking and dragging from one dots to the other.
Then attach the function block's output anchor (the bottom dot) to the display block's input.
The square of the number you picked (1522756) should now appear in the output block.
Congratulations!
You've made a real Haskell program!
\textbf{Sliders!}
Our first program isn't very exciting.
You could write the same program in regular Haskell by typing \texttt{5 * 5}.
Viskell has a few tricks up its sleeve, however.
For our second example, we'll try adding a \emph{slider block}.
From the function menu, click the button to get a slider block.
Then connect it to one of the inputs (again, the top dots) of your multiplication function block.
Drag the slider to change its value: you should see the value on the output block change as well.
\textbf{Getting the Haskell code for your program}
Viskell generates Haskell code for you, which you can see by selecting your display block, pressing the \textbf{Z} key, and then selecting the `Haskell Source' tab.
Be careful, though: this is the Haskell code that actually gets executed.
It's probably not `good' Haskell code.
|
Add JFET part number to schematic 4. | \begin{circuitikz}
\draw(0,0) node[njfet,yscale=-1] (fet) {};
\draw(fet.gate) |- (fet.drain);
\draw(fet.source) to [vR, l_=Decade Box, mirror] ++(0,2)
to [short] ++(1,0)
to [ammeter] ++(0,-2) node[] (end) {};
\draw(fet.drain) to [short] ++(1,0)
to [V, l_=\SI{16}{\volt}DC \& \SI{32}{\volt}DC] ++(0, 2)
to [short] ($(end)$);
\draw (fet.gate) node[anchor=north east] {Part Number};
\end{circuitikz}
| \begin{circuitikz}
\draw(0,0) node[njfet,yscale=-1] (fet) {};
\draw(fet.gate) |- (fet.drain);
\draw(fet.source) to [vR, l_=Decade Box, mirror] ++(0,2)
to [short] ++(1,0)
to [ammeter] ++(0,-2) node[] (end) {};
\draw(fet.drain) to [short] ++(1,0)
to [V, l_=\SI{16}{\volt}DC \& \SI{32}{\volt}DC] ++(0, 2)
to [short] ($(end)$);
\draw (fet.gate) node[anchor=north east] {2N5459};
\end{circuitikz}
|
Adjust paper margins for more space | \documentclass[a4paper,twoside]{article}
\usepackage[
hmarginratio=1:1,
top=32mm,
columnsep=20pt,
footnotesep=1cm
]{geometry}
\input{x3-general-preamble}
| \documentclass[a4paper,twoside]{article}
\usepackage[
hmarginratio=1:1,
top=25mm,
bottom=25mm,
columnsep=20pt,
footnotesep=1cm,
left=25mm
]{geometry}
\input{x3-general-preamble}
|
Add splitindex check to work around MiKTeX bug | %!TeX jobNames = job-1, job-2
%!TeX job-2:outputDirectory = output
\documentclass{article}
\usepackage{splitidx}
\makeindex
\newindex[Index of theories]{theories}
\newindex[Index of names]{persons}
\begin{document}
Special and General Relativity\sindex[theories]{relativity}...
Einstein\sindex[persons]{Einstein, Albert}...
And this is the end of the story.
\printindex*
\end{document}
| %!TeX jobNames = job-1, job-2
%!TeX job-2:outputDirectory = output
%!TeX check = splitindex --version
\documentclass{article}
\usepackage{splitidx}
\makeindex
\newindex[Index of theories]{theories}
\newindex[Index of names]{persons}
\begin{document}
Special and General Relativity\sindex[theories]{relativity}...
Einstein\sindex[persons]{Einstein, Albert}...
And this is the end of the story.
\printindex*
\end{document}
|
Add test program to report | \chapter{Complete test program}
\label{chap:testprogram}
% TODO
\begin{lstlisting}
\end{lstlisting}
| \chapter{Complete test program}
\label{chap:testprogram}
\begin{landscape}
\begin{lstlisting}
City Enschede;
/** Correctly working program, still need to think of something to do with char. */
Begin depot;
Wagon a accepts int;
Wagon b accepts boolean;
Wagon c accepts char;
Wagon d accepts int;
End depot;
Begin track;
Signal s is red;
Signal s2 is red;
Signal s3 is green;
Waypoint w;
Begin waypoint;
Write "Passed waypoint " w to journal;
End waypoint;
End track;
Begin industry;
Factory notLessThanOrEquals accepts int, int produces boolean;
Begin production;
Transport platform1, platform2 to factory complte and fully load platform3;
Turn wagon platform3 around;
Final product platform3;
End production;
End industry;
Begin company;
Ask control "a=?" about contents of a;
Load 0 into wagon d;
Transport a,d to factory compgt and fully load s;
Approach signal s;
Case green:
Load 0 into wagon d;
Case red:
Stop;
Case green:
Switch signal s;
Pass signal;
Load 1 into wagon d;
Load 'c' into wagon c;
Transport a,a to factory notLessThanOrEquals and fully load b;
Transport a,a to factory notLessThanOrEquals and set signal s2;
Begin circle w;
Transport a,d to factory subtract and fully load a;
Transport a,d to factory notLessThanOrEquals and set signal w;
End circle;
Write "a=" a to journal;
Write "b=" b to journal;
Write "c=" c to journal;
Write "d=" d to journal;
Write "s=" s to journal;
Write "s2=" s2 to journal;
Write "s3=" s3 to journal;
End company;
\end{lstlisting}
\end{landscape}
|
Update the article information: title, author, etc ... | %!TEX root = ./article.tex
% Article Title
\def \ArticleTitle{Article Title}
% Author(s) Name(s)
\def \AuthorA{Author Name}
% Author(s) Email(s)
\def \AuthorAemail{EmailA}
% Institution(s) Name(s)
\def \InstitutionA{Institution Name}
% Article Title
\newcommand {\Title} {\ArticleTitle}
% Authors
\newcommand {\Authors} {\IEEEauthorblockN{\AuthorA}}
% Institution
\newcommand {\Institutions} {\IEEEauthorblockA{\InstitutionA}\\
Email: \AuthorAemail}
% Variable to control if the bibliography must be include
\def \hasBibliography{1}
| %!TEX root = ./article.tex
% Article Title
\def \ArticleTitle{Cloud4Things}
% Author(s) Name(s)
\def \AuthorA{Marcus Vin\'icius Paulino Gomes}
% Author(s) Email(s)
\def \AuthorAemail{marcus.paulino.gomes@tecnico.ulisboa.pt}
% Institution(s) Name(s)
\def \InstitutionA{Instituto Superior T\'ecnico, Universidade de Lisboa}
% Article Title
\newcommand {\Title} {\ArticleTitle}
% Authors
\newcommand {\Authors} {\IEEEauthorblockN{\AuthorA}}
% Institution
\newcommand {\Institutions} {\IEEEauthorblockA{\InstitutionA}\\
Email: \AuthorAemail}
% Variable to control if the bibliography must be include
\def \hasBibliography{1}
|
Add a missing newline in a csv table [skip CI] | \begin{table}[htbp]
\centering
\begin{tabular}{cccccc}
\hline
\rowcolor{lightgray}
\textbf{rlzi} & \textbf{sid} & \textbf{eid} & \textbf{gmv\_PGA} & \textbf{gmv\_SA(0.3)} & \textbf{gmv\_SA(1.0)} \\
\hline
0 & 0 & 0 & 0.062 & 0.119 & 0.157 \\
0 & 1 & 0 & 0.086 & 1.533 & 0.260 \\
0 & 2 & 0 & 0.223 & 1.647 & 0.232 \\
... & ... & ... & ... & ... & ... \\
1 & 4 & 99 & 2.467 & 0.750 & 1.918 \\
1 & 5 & 99 & 0.601 & 0.828 & 2.272 \\
1 & 6 & 99 & 0.514 & 0.340 & 1.202
\hline
\end{tabular}
\caption{Example of a ground motion fields csv output file for a scenario (\href{https://raw.githubusercontent.com/gem/oq-engine/master/doc/manual/oqum/hazard/verbatim/output_scenario_gmfs.csv}{Download example})}
\label{output:gmf_scenario}
\end{table} | \begin{table}[htbp]
\centering
\begin{tabular}{cccccc}
\hline
\rowcolor{lightgray}
\textbf{rlzi} & \textbf{sid} & \textbf{eid} & \textbf{gmv\_PGA} & \textbf{gmv\_SA(0.3)} & \textbf{gmv\_SA(1.0)} \\
\hline
0 & 0 & 0 & 0.062 & 0.119 & 0.157 \\
0 & 1 & 0 & 0.086 & 1.533 & 0.260 \\
0 & 2 & 0 & 0.223 & 1.647 & 0.232 \\
... & ... & ... & ... & ... & ... \\
1 & 4 & 99 & 2.467 & 0.750 & 1.918 \\
1 & 5 & 99 & 0.601 & 0.828 & 2.272 \\
1 & 6 & 99 & 0.514 & 0.340 & 1.202 \\
\hline
\end{tabular}
\caption{Example of a ground motion fields csv output file for a scenario (\href{https://raw.githubusercontent.com/gem/oq-engine/master/doc/manual/oqum/hazard/verbatim/output_scenario_gmfs.csv}{Download example})}
\label{output:gmf_scenario}
\end{table} |
Change order of author names | @InProceedings{rogers16,
supplementary = {Supplementary:rogers16-supp.pdf},
title = {Differentially Private Chi-Squared Hypothesis Testing: Goodness of Fit and Independence Testing},
author = {Ryan Rogers and Salil Vadhan and Hyun Lim and Marco Gaboardi},
pages = {2111-2120},
abstract = {Hypothesis testing is a useful statistical tool in determining whether a given model should be rejected based on a sample from the population. Sample data may contain sensitive information about individuals, such as medical information. Thus it is important to design statistical tests that guarantee the privacy of subjects in the data. In this work, we study hypothesis testing subject to differential privacy, specifically chi-squared tests for goodness of fit for multinomial data and independence between two categorical variables.},
}
| @InProceedings{rogers16,
supplementary = {Supplementary:rogers16-supp.pdf},
title = {Differentially Private Chi-Squared Hypothesis Testing: Goodness of Fit and Independence Testing},
author = {Marco Gaboardi and Hyun Lim and Ryan Rogers and Salil Vadhan},
pages = {2111-2120},
abstract = {Hypothesis testing is a useful statistical tool in determining whether a given model should be rejected based on a sample from the population. Sample data may contain sensitive information about individuals, such as medical information. Thus it is important to design statistical tests that guarantee the privacy of subjects in the data. In this work, we study hypothesis testing subject to differential privacy, specifically chi-squared tests for goodness of fit for multinomial data and independence between two categorical variables.},
}
|
Emphasize that the table is the break table. | \section{Conclusions and future work}
We have presented an improvement to the compacting and sliding
collector invented by Haddon and Waite \cite{Haddon:1967}. Our method
is an improvement in that it does not require the partially built
table to be moved, because the entire table is built \emph{after}
the compaction phase is finished.
While it is extremely difficult to compare performance of different
methods for garbage collection, in order to get an indication of the
performance of our method, we created a number of tests. We believe
these tests show that the method we suggest is not prohibitively
expensive. The advantages of compaction to overall performance of the
garbage collector are hard to measure or even estimate, but we think
that they will compensate for the slight increase in cost of
compaction compared to ordinary copying or mark-and-sweep.
We plan to use this algorithm in the per-thread nursery collector in
our system \sicl{}.%
\footnote{https://github.com/robert-strandh/SICL}
Inspired by the Multics system, we plan to
instrument the system with a number of \emph{meters} so that
performance data can be collected at all times. Only then will we be
able to obtain a final verdict concerning the performance of this
method.
| \section{Conclusions and future work}
We have presented an improvement to the compacting and sliding
collector invented by Haddon and Waite \cite{Haddon:1967}. Our method
is an improvement in that it does not require the partially built
break table to be moved, because the entire table is built
\emph{after} the compaction phase is finished.
While it is extremely difficult to compare performance of different
methods for garbage collection, in order to get an indication of the
performance of our method, we created a number of tests. We believe
these tests show that the method we suggest is not prohibitively
expensive. The advantages of compaction to overall performance of the
garbage collector are hard to measure or even estimate, but we think
that they will compensate for the slight increase in cost of
compaction compared to ordinary copying or mark-and-sweep.
We plan to use this algorithm in the per-thread nursery collector in
our system \sicl{}.%
\footnote{https://github.com/robert-strandh/SICL}
Inspired by the Multics system, we plan to
instrument the system with a number of \emph{meters} so that
performance data can be collected at all times. Only then will we be
able to obtain a final verdict concerning the performance of this
method.
|
Update botocore from 1.5.70 to 1.5.78 | aioamqp==0.10.0
aiobotocore==0.4.1
aiohttp==2.2.0
apipkg==1.4
appdirs==1.4.3
async-timeout==1.2.1
botocore==1.5.70
chardet==3.0.4
codecov==2.0.9
coverage==4.4.1
docutils==0.13.1
execnet==1.4.1
jmespath==0.9.3
multidict==3.1.0
mypy==0.511
packaging==16.8
pep8==1.7.0
py==1.4.34
pyparsing==2.2.0
pytest==3.1.2
pytest-cache==1.0
pytest-cov==2.5.1
pytest-pep8==1.0.6
python-dateutil==2.6.0
requests==2.18.1
six==1.10.0
ujson==1.35
uvloop==0.8.0
yarl==0.10.3
| aioamqp==0.10.0
aiobotocore==0.4.1
aiohttp==2.2.0
apipkg==1.4
appdirs==1.4.3
async-timeout==1.2.1
botocore==1.5.78
chardet==3.0.4
codecov==2.0.9
coverage==4.4.1
docutils==0.13.1
execnet==1.4.1
jmespath==0.9.3
multidict==3.1.0
mypy==0.511
packaging==16.8
pep8==1.7.0
py==1.4.34
pyparsing==2.2.0
pytest==3.1.2
pytest-cache==1.0
pytest-cov==2.5.1
pytest-pep8==1.0.6
python-dateutil==2.6.0
requests==2.18.1
six==1.10.0
ujson==1.35
uvloop==0.8.0
yarl==0.10.3
|
Include bumpversion in dev dependencies | alabaster==0.7.9
coverage==4.5.1
coverage_pth==0.0.2
codecov==2.0.15
flake8==3.5.0
mock==2.0.0
pypandoc==1.4
pytest==3.4.2
recommonmark==0.4.0
sphinxcontrib-spelling==4.1.0
Sphinx==1.7.1
tox==2.9.1
-r requirements.txt
| alabaster==0.7.9
bumpversion==0.5.3
coverage==4.5.1
coverage_pth==0.0.2
codecov==2.0.15
flake8==3.5.0
mock==2.0.0
pypandoc==1.4
pytest==3.4.2
recommonmark==0.4.0
sphinxcontrib-spelling==4.1.0
Sphinx==1.7.1
tox==2.9.1
-r requirements.txt
|
Update year to 2014. | Copyright 2013 The Dojo Foundation <http://dojofoundation.org/>
Based on Grunt-Lodashbuilder 0.1.7, copyright 2012 Sebastian Golasch
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:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Copyright 2013-2014 The Dojo Foundation <http://dojofoundation.org/>
Based on Grunt-Lodashbuilder 0.1.7, copyright 2012 Sebastian Golasch
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:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Fix package version of `typing` which chalice can not import | chalice==0.5.0
requests==2.12.1
boto3==1.4.1
pydash==3.4.7
pytz==2016.7
typing==3.5.3
enum34==1.1.6
owlmixin==1.0.0rc5
| chalice==0.5.0
requests==2.12.1
boto3==1.4.1
pydash==3.4.7
pytz==2016.7
typing==3.5.2.2
enum34==1.1.6
owlmixin==1.0.0rc5
|
Remove specfic version for pyfiglet | botocore
boto3>=1.4.3
pyfiglet==0.7.5
PyYAML==3.12
tabulate==0.7.5
yattag==1.7.2
| botocore
boto3>=1.4.3
pyfiglet
PyYAML==3.12
tabulate==0.7.5
yattag==1.7.2
|
Update ruamel.yaml from 0.15.61 to 0.15.64 | Twisted[tls]==18.7.0
beautifulsoup4==4.6.3
lxml==4.2.4
psutil==5.4.7
python-dateutil==2.7.3
ply==3.11
enum34==1.1.6
twitter==1.18.0
requests==2.19.1
pytimeparse==1.1.8
pymysql==0.9.2
pycryptodome==3.6.6
pyasn1==0.4.4
isodate==0.6.0
google-api-python-client==1.7.4
pyxDamerauLevenshtein==1.5
numpy==1.15.1
Cython==0.28.5
git+git://github.com/andreasvc/pyre2.git@7146ce3#egg=re2
parsedatetime==2.4
cryptography==2.3.1
future==0.16.0
six==1.11.0
ruamel.yaml==0.15.61
croniter==0.3.25
pyhedrals==0.0.1
| Twisted[tls]==18.7.0
beautifulsoup4==4.6.3
lxml==4.2.4
psutil==5.4.7
python-dateutil==2.7.3
ply==3.11
enum34==1.1.6
twitter==1.18.0
requests==2.19.1
pytimeparse==1.1.8
pymysql==0.9.2
pycryptodome==3.6.6
pyasn1==0.4.4
isodate==0.6.0
google-api-python-client==1.7.4
pyxDamerauLevenshtein==1.5
numpy==1.15.1
Cython==0.28.5
git+git://github.com/andreasvc/pyre2.git@7146ce3#egg=re2
parsedatetime==2.4
cryptography==2.3.1
future==0.16.0
six==1.11.0
ruamel.yaml==0.15.64
croniter==0.3.25
pyhedrals==0.0.1
|
Update pytest from 3.1.0 to 3.1.2 | bcrypt==3.1.3
coverage==4.4.1
cryptography==1.9
motor==1.1
pymongo==3.4.0
pytest==3.1.0
pytest-cov==2.5.1
tornado==4.5.1
| bcrypt==3.1.3
coverage==4.4.1
cryptography==1.9
motor==1.1
pymongo==3.4.0
pytest==3.1.2
pytest-cov==2.5.1
tornado==4.5.1
|
Change pgoapi to modify one | six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
gpsoauth==0.3.0
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/keyphact/pgoapi.git#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
| six==1.10.0
Flask==0.11.1
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10
configargparse==0.10.0
click==6.6
itsdangerous==0.24
peewee==2.8.1
wsgiref==0.1.2
geopy==1.11.0
s2sphere==0.2.4
gpsoauth==0.3.0
PyMySQL==0.7.5
flask-cors==2.1.2
flask-compress==1.3.0
LatLon==1.0.1
git+https://github.com/DarkSwatcat/pgoapi.git#egg=pgoapi
xxhash
sphinx==1.4.5
sphinx-autobuild==0.6.0
recommonmark==0.4.0
sphinx_rtd_theme==0.1.9
|
Revert "check if it handles python3.2 without requests version" | pyyaml==3.12
argcomplete==1.9.2
requests
pycodestyle==2.3.1
sphinx==1.6.5
sphinx-autobuild==0.7.1
packaging==16.8 | pyyaml==3.12
argcomplete==1.9.2
requests==2.18.4
pycodestyle==2.3.1
sphinx==1.6.5
sphinx-autobuild==0.7.1
packaging==16.8 |
Update lxml from 4.3.4 to 4.4.0 | dj-database-url==0.5.0
django-apiblueprint-view==2.1.0
django-basicauth==0.5.2
django-extensions==2.1.9
django-localflavor==2.2
django-markdown-deux==1.0.5
django==1.11.22 # pyup: >=1.11,<2.0
djangorestframework==3.10.1
djangorestframework-gis==0.14
django-cors-headers==3.0.2
fastkml==0.11
fuzzywuzzy==0.17.0
lxml==4.3.4
psycopg2-binary==2.8.3
pyshp==2.1.0
python-levenshtein==0.12.0
raven==6.10.0
requests==2.22.0
retry==0.9.2
boto==2.49.0
uk-geo-utils==0.8.0
git+git://github.com/DemocracyClub/dc_base_theme.git@0.3.7
git+https://github.com/DemocracyClub/dc_signup_form.git@2.0.1
| dj-database-url==0.5.0
django-apiblueprint-view==2.1.0
django-basicauth==0.5.2
django-extensions==2.1.9
django-localflavor==2.2
django-markdown-deux==1.0.5
django==1.11.22 # pyup: >=1.11,<2.0
djangorestframework==3.10.1
djangorestframework-gis==0.14
django-cors-headers==3.0.2
fastkml==0.11
fuzzywuzzy==0.17.0
lxml==4.4.0
psycopg2-binary==2.8.3
pyshp==2.1.0
python-levenshtein==0.12.0
raven==6.10.0
requests==2.22.0
retry==0.9.2
boto==2.49.0
uk-geo-utils==0.8.0
git+git://github.com/DemocracyClub/dc_base_theme.git@0.3.7
git+https://github.com/DemocracyClub/dc_signup_form.git@2.0.1
|
Update CV of AtmosphereLogger to 0.2.3 (9) | Categories:Science & Education
License:PublicDomain
Web Site:http://www.tamanegi.org/prog/android-apps
Source Code:https://github.com/lllllT/AtmosphereLogger
Issue Tracker:https://github.com/lllllT/AtmosphereLogger/issues
Auto Name:AtmosphereLogger
Summary:Logs atmospheric pressure
Description:
Logs atmospheric pressure by using Android device's barometer sensor.
.
Repo Type:git
Repo:https://github.com/lllllT/AtmosphereLogger.git
Build:0.1.3,4
commit=v0.1.3
Build:0.1.4,5
commit=v0.1.4
subdir=app
gradle=yes
prebuild=sed -i 's/repositories {/repositories { mavenCentral()/' ../build.gradle
Build:0.2.3,9
commit=v0.2.3
subdir=app
gradle=yes
prebuild=sed -i -e '/keystoreProperties.*{/,/}/d; /keystoreProperties/d' build.gradle
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.2.1
Current Version Code:7
| Categories:Science & Education
License:PublicDomain
Web Site:http://www.tamanegi.org/prog/android-apps
Source Code:https://github.com/lllllT/AtmosphereLogger
Issue Tracker:https://github.com/lllllT/AtmosphereLogger/issues
Auto Name:AtmosphereLogger
Summary:Logs atmospheric pressure
Description:
Logs atmospheric pressure by using Android device's barometer sensor.
.
Repo Type:git
Repo:https://github.com/lllllT/AtmosphereLogger.git
Build:0.1.3,4
commit=v0.1.3
Build:0.1.4,5
commit=v0.1.4
subdir=app
gradle=yes
prebuild=sed -i 's/repositories {/repositories { mavenCentral()/' ../build.gradle
Build:0.2.3,9
commit=v0.2.3
subdir=app
gradle=yes
prebuild=sed -i -e '/keystoreProperties.*{/,/}/d; /keystoreProperties/d' build.gradle
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.2.3
Current Version Code:9
|
Add again pycodestyle to dev requirements | setuptools
wheel==0.32.1
bumpversion==0.5.3
watchdog==0.9.0
tox==3.5.2
coverage==4.5.1
pytest
| setuptools
wheel==0.32.1
bumpversion==0.5.3
watchdog==0.9.0
tox==3.5.2
coverage==4.5.1
pytest
pycodestyle
|
Use find_package to find Boost | set(TEST_NAMES
test_traits
test_utility
test_value
test_to_toml
test_from_toml
test_get
test_value_operator
test_datetime
test_acceptor
test_parser
test_parse_file
)
CHECK_CXX_COMPILER_FLAG("-Wall" COMPILER_SUPPORTS_WALL)
CHECK_CXX_COMPILER_FLAG("-Wpedantic" COMPILER_SUPPORTS_WPEDANTIC)
if(COMPILER_SUPPORTS_WALL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
if(COMPILER_SUPPORTS_WPEDANTIC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
endif()
set(test_library_dependencies)
find_library(BOOST_UNITTEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
if (BOOST_UNITTEST_FRAMEWORK_LIBRARY)
add_definitions(-DBOOST_TEST_DYN_LINK)
add_definitions(-DUNITTEST_FRAMEWORK_LIBRARY_EXIST)
set(test_library_dependencies boost_unit_test_framework)
endif()
foreach(TEST_NAME ${TEST_NAMES})
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
target_link_libraries(${TEST_NAME} ${test_library_dependencies})
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
endforeach(TEST_NAME)
| set(TEST_NAMES
test_traits
test_utility
test_value
test_to_toml
test_from_toml
test_get
test_value_operator
test_datetime
test_acceptor
test_parser
test_parse_file
)
CHECK_CXX_COMPILER_FLAG("-Wall" COMPILER_SUPPORTS_WALL)
CHECK_CXX_COMPILER_FLAG("-Wpedantic" COMPILER_SUPPORTS_WPEDANTIC)
if(COMPILER_SUPPORTS_WALL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
if(COMPILER_SUPPORTS_WPEDANTIC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
endif()
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
add_definitions(-DBOOST_TEST_DYN_LINK)
add_definitions(-DUNITTEST_FRAMEWORK_LIBRARY_EXIST)
foreach(TEST_NAME ${TEST_NAMES})
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
target_link_libraries(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
target_include_directories(${TEST_NAME} PRIVATE ${Boost_INCLUDE_DIRS})
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
endforeach(TEST_NAME)
|
Update dependency lxml to v4.6.1 | # Local development dependencies go here
-r base.txt
Sphinx==3.2.1
Werkzeug==1.0.1
django-debug-toolbar==3.1.1
ipdb==0.13.4
factory-boy==3.1.0
lxml==4.6.0
django-coverage-plugin==1.8.0
vcrpy==4.1.1
sphinxcontrib-programoutput==0.16
pre-commit==2.7.1
coveralls==2.1.2
| # Local development dependencies go here
-r base.txt
Sphinx==3.2.1
Werkzeug==1.0.1
django-debug-toolbar==3.1.1
ipdb==0.13.4
factory-boy==3.1.0
lxml==4.6.1
django-coverage-plugin==1.8.0
vcrpy==4.1.1
sphinxcontrib-programoutput==0.16
pre-commit==2.7.1
coveralls==2.1.2
|
Update tox from 2.3.1 to 3.15.2 | pip==20.1.1
bumpversion==0.6.0
wheel==0.34.2
watchdog==0.10.2
flake8==3.8.3
tox==2.3.1
coverage==4.1
Sphinx==1.4.8
cryptography==1.7
PyYAML==5.1
| pip==20.1.1
bumpversion==0.6.0
wheel==0.34.2
watchdog==0.10.2
flake8==3.8.3
tox==3.15.2
coverage==4.1
Sphinx==1.4.8
cryptography==1.7
PyYAML==5.1
|
Update pytest from 5.4.2 to 5.4.3 | # Packages required for running tests
-r pip.txt
django-dynamic-fixture==3.1.0
pytest==5.4.2
pytest-custom-exit-code==0.3.0
pytest-django==3.9.0
pytest-xdist==1.32.0
pytest-cov==2.8.1
apipkg==1.5
execnet==1.7.1
# Mercurial 4.3 and newer require Python 2.7
# Mercurial is actively being ported to Python 3. As of Mercurial 4.3,
# some commands work on Python 3. However, Python 3 is not yet a
# supported platform.
# mercurial-scm.org/wiki/SupportedPythonVersions
# (Pinned to 4.4.2 since what we need for testing is still useful)
Mercurial==4.4.2 # pyup: ignore
yamale==2.0.1
pytest-mock==3.1.0
# local debugging tools
datadiff==2.0.0
ipdb==0.13.3
| # Packages required for running tests
-r pip.txt
django-dynamic-fixture==3.1.0
pytest==5.4.3
pytest-custom-exit-code==0.3.0
pytest-django==3.9.0
pytest-xdist==1.32.0
pytest-cov==2.8.1
apipkg==1.5
execnet==1.7.1
# Mercurial 4.3 and newer require Python 2.7
# Mercurial is actively being ported to Python 3. As of Mercurial 4.3,
# some commands work on Python 3. However, Python 3 is not yet a
# supported platform.
# mercurial-scm.org/wiki/SupportedPythonVersions
# (Pinned to 4.4.2 since what we need for testing is still useful)
Mercurial==4.4.2 # pyup: ignore
yamale==2.0.1
pytest-mock==3.1.0
# local debugging tools
datadiff==2.0.0
ipdb==0.13.3
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.