dj is a collection of commonly used Sass mixins with some components taken from Bootstrap from Twitter.
dj uses the Scss syntax of Sass, the stylesheet is available in
| {"$2"=> | |
| [#<struct Token value="x", prec=0, assoc=:none>, | |
| #<struct Token value="+", prec=1, assoc=:left>, | |
| #<struct Token value="4", prec=0, assoc=:none>], | |
| "$1"=> | |
| [#<struct Token value="y", prec=0, assoc=:none>, | |
| #<struct Token value="/", prec=2, assoc=:left>, | |
| #<struct Token value="$2", prec=5, assoc=:exp>], | |
| "$0"=> | |
| [#<struct Token value="x", prec=0, assoc=:none>, |
| class FractionsParsingTest < Test::Unit::TestCase | |
| def test_complex_fractions | |
| result = parse('(((x+2)(x-3)) / ((x-2)(x+2))) / (((x-1)(x-1))/((x-1)(x+1)))') | |
| expected = '\dfrac{(x+2)(x-3)}{(x-2)(x+2)}\ \div\ \dfrac{(x-1)(x-1)}{(x-1)(x+1)}' | |
| assert_equal expected, result | |
| end | |
| def test_single_complex_fraction | |
| result = parse('(x^2+3) / (x^2-3)') | |
| expected = '\dfrac{x^2+3}{x^2-3}' |
| "" {x^2 - x - 6} over {x^2 - 4} div {x^2 - 2 x + 1} over {x^2 - 1}newline ="" {{ \( {x + 2} \)} { \( {x - 3} \)}} over {{ \( {x - 2} \)} { \( {x + 2} \)}} div {{ \( {x - 1} \)} { \( {x - 1} \)}} over {{ \( {x - 1} \)} { \( {x + 1} \)}} x <> - 5 over 3 x <> 0 |
| % (5x + 3)^2 - (4x + 1)(6 - x) | |
| % =25x^2 + 30x + 9 - (24x - 4x^2 + 6 - x) | |
| \documentclass[12pt]{article} | |
| \usepackage{amsmath} | |
| \title{\Unit 1 Key Questions} | |
| \begin{document} | |
| \begin{equation} |
dj is a collection of commonly used Sass mixins with some components taken from Bootstrap from Twitter.
dj uses the Scss syntax of Sass, the stylesheet is available in
| module Sass::Rails | |
| class ScssTemplate | |
| def evaluate(scope, locals, &block) | |
| utils_data = File.read(File.join(File.dirname(__FILE__), "..", "vendor/assets/stylesheets", "cssutils.css.scss")) | |
| Sass::Engine.new(utils_data + data, sass_options(scope)).render | |
| end | |
| end | |
| end |
| from math import floor | |
| from Tkinter import * | |
| from invaders import * | |
| class Invader(object): | |
| def __init__(self, cv, x, y, width, height, invader): | |
| self.cv = cv | |
| self.x = x | |
| self.y = y | |
| self.width = width |
| from Tkinter import * | |
| from invaders import * | |
| class App(object): | |
| def __init__(self): | |
| self.root = Tk() | |
| self.root.title("Scalable Graphics Test") | |
| self.root.minsize(144, 8) | |
| self.root.aspect(144, 8, 144, 8) | |
| self.cv = Canvas(self.root, width=576, height=32, bg="white", highlightthickness=0) |
| from Tkinter import * | |
| import random | |
| import colorsys | |
| import sys | |
| class Bubble(object): | |
| def __init__(self, cv, min_size, max_size, x_bound, y_bound): | |
| self.size = min_size + random.randrange(0, max_size - min_size) | |
| self.x = random.randrange(0, x_bound) | |
| self.y = random.randrange(0, y_bound) |