<commit_before>//
//  AppDelegate.swift
//  Few
//
//  Created by <NAME> on 7/22/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Cocoa
import Few

func renderBackground(tick: Float) -> Element {
	let low: Float = 200
	let R = (low + sin((tick * 3 + 0) * 1.3) * 128) / 255
	let G = (low + sin((tick * 3 + 1) * 1.3) * 128) / 255
	let B = (low + sin((tick * 3 + 2) * 1.3) * 128) / 255
	let color = NSColor(calibratedRed: CGFloat(R), green: CGFloat(G), blue: CGFloat(B), alpha: 1)
	let button1 = View(type: NSButton.self) { b in b.title = "HELLO YES THIS IS DOG" }
			|> frame(CGRect(x: 0, y: 0, width: 160, height: 23))

	let button2 = Button(title: "Hello yes this is dog.", fn: const(0))
		|> frame(CGRect(x: 0, y: 200, width: 160, height: 23))

	let fn = { (str: String, s: Float) -> Float in
		return s
	}
	let input = Input(initialText: "Hi?", fn: fn) |> frame(CGRect(x: 200, y: 300, width: 100, height: 23))

	let fullFrame = CGRect(x: 0, y: 0, width: 1000, height: 1000)
	let background = fillRect(color) |> frame(fullFrame)
	return Container(background,
		             button1,
		             button2,
		             input)
			|> frame(fullFrame)
}

// This is to work around Swift's inability to have non-generic subclasses of a
// generic superclass.
typealias BackgroundComponent = BackgroundComponent_<Any>
class BackgroundComponent_<Bullshit>: Few.Component<Float> {
	var timer: NSTimer?
	
	init() {
		super.init(render: renderBackground, initialState: 0)
	}<commit_msg>/cc @lionel_richie<commit_after>//
//  AppDelegate.swift
//  Few
//
//  Created by <NAME> on 7/22/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Cocoa
import Few

func renderBackground(tick: Float) -> Element {
	let low: Float = 200
	let R = (low + sin((tick * 3 + 0) * 1.3) * 128) / 255
	let G = (low + sin((tick * 3 + 1) * 1.3) * 128) / 255
	let B = (low + sin((tick * 3 + 2) * 1.3) * 128) / 255
	let color = NSColor(calibratedRed: CGFloat(R), green: CGFloat(G), blue: CGFloat(B), alpha: 1)
	let button1 = View(type: NSButton.self) { b in b.title = "HELLO YES THIS IS DOG" }
			|> frame(CGRect(x: 0, y: 0, width: 160, height: 23))

	let button2 = Button(title: "Hello yes this is dog.", fn: const(0))
		|> frame(CGRect(x: 0, y: 200, width: 160, height: 23))

	let fn = { (str: String, s: Float) -> Float in
		return s
	}
	let input = Input(initialText: "Hello? Is it me you're looking for?", fn: fn) |> frame(CGRect(x: 200, y: 300, width: 100, height: 23))

	let fullFrame = CGRect(x: 0, y: 0, width: 1000, height: 1000)
	let background = fillRect(color) |> frame(fullFrame)
	return Container(background,
		             button1,
		             button2,
		             input)
			|> frame(fullFrame)
}

// This is to work around Swift's inability to have non-generic subclasses of a
// generic superclass.
typealias BackgroundComponent = BackgroundComponent_<Any>
class BackgroundComponent_<Bullshit>: Few.Component<Float> {
	var timer: NSTimer?
	
	init() {
		super.init(render: renderBackground, initialState: 0)
	}
{'fraction_non_alphanumeric': 0.15354200988467875, 'fraction_numerical': 0.056672158154859965, 'mean_word_length': 3.246153846153846, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5969600', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1071, 'n_words': 357}