text:
package org.jetbrains.java.decompiler.modules.decompiler.exps;

import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.main.ClassWriter;
import org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode;
import org.jetbrains.java.decompiler.main.DecompilerContext;
import org.jetbrains.java.decompiler.main.TextBuffer;
import org.jetbrains.java.decompiler.main.collectors.BytecodeMappingTracer;
import org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.vars.VarTypeProcessor;
import org.jetbrains.java.decompiler.modules.decompiler.vars.VarVersionPair;
import org.jetbrains.java.decompiler.struct.gen.VarType;
import org.jetbrains.java.decompiler.struct.match.MatchEngine;
import org.jetbrains.java.decompiler.struct.match.MatchNode;
import org.jetbrains.java.decompiler.struct.match.IMatchable.MatchProperties;
import org.jetbrains.java.decompiler.struct.match.MatchNode.RuleValue;
import org.jetbrains.java.decompiler.util.InterpreterUtil;

import java.util.ArrayList;
import java.util.List;

public class VarExprent extends Exprent {

  public static final int STACK_BASE = 10000;
  public static final String VAR_NAMELESS_ENCLOSURE = "<VAR_NAMELESS_ENCLOSURE>";

  private int index;
  private VarType varType;
  private boolean definition = false;
  private VarProcessor processor;
  private int version = 0;
  private boolean classDef = false;
  private boolean stack = false;

  public VarExprent(int index, VarType varType, VarProcessor processor) {
    super(EXPRENT_VAR);
    this.index = index;
    this.varType = varType;
    this.processor = processor;
  }

  @Override
  public VarType getExprType() {
    return getVarType();
  }

  @Override
  public int getExprentUse() {
    return Exprent.MULTIPLE_USES | Exprent.SIDE_EFFECTS_FREE;
  }

  @Override
  public List<Exprent> getAllExprents() {
    return new ArrayList<>();
  }

  @Override
  public Exprent copy() {
    VarExprent var = new VarExprent(index, getVarType(), processor);
    var.setDefinition(definition);
    var.setVersion(version);
    var.setClassDef(classDef);
    var.setStack(stack);
    return var;
  }

  @Override
  public TextBuffer toJava(int indent, BytecodeMappingTracer tracer) {
    TextBuffer buffer = new TextBuffer();

    tracer.addMapping(bytecode);

    if (classDef) {
      ClassNode child = DecompilerContext.getClassProcessor().getMapRootClasses().get(varType.value);
      new ClassWriter().classToJava(child, buffer, indent, tracer);
      tracer.incrementCurrentSourceLine(buffer.countLines());
    }
    else {
      String name = null;
      if (processor != null) {
        name = processor.getVarName(new VarVersionPair(index, version));
      }

      if (definition) {
        if (processor != null && processor.getVarFinal(new VarVersionPair(index, version)) == VarTypeProcessor.VAR_EXPLICIT_FINAL) {
          buffer.append("final ");
        }
        buffer.append(ExprProcessor.getCastTypeName(getVarType())).append(" ");
      }
      buffer.append(name == null ? ("var" + index + (version == 0 ? "" : "_" + version)) : name);
    }

    return buffer;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) return true;
    if (o == null || !(o instanceof VarExprent)) return false;

    VarExprent ve = (VarExprent)o;
    return index == ve.getIndex() &&
           version == ve.getVersion() &&
           InterpreterUtil.equalObjects(getVarType(), ve.getVarType()); // FIXME: varType comparison redundant?
  }

  public int getIndex() {
    return index;
  }

  public void setIndex(int index) {
    this.index = index;
  }

  public VarType getVarType() {
    VarType vt = null;
    if (processor != null) {
      vt = processor.getVarType(new VarVersionPair(index, version));
    }

    if (vt == null || (varType != null && varType.type != CodeConstants.TYPE_UNKNOWN)) {
      vt = varType;
    }

    return vt == null ? VarType.VARTYPE_UNKNOWN : vt;
  }

  public void setVarType(VarType varType) {
    this.varType = varType;
  }

  public boolean isDefinition() {
    return definition;
  }

  public void setDefinition(boolean definition) {
    this.definition = definition;
  }

  public VarProcessor getProcessor() {
    return processor;
  }

  public void setProcessor(VarProcessor processor) {
    this.processor = processor;
  }

  public int getVersion() {
    return version;
  }

  public void setVersion(int version) {
    this.version = version;
  }

  public boolean isClassDef() {
    return classDef;
  }

  public void setClassDef(boolean classDef) {
    this.classDef = classDef;
  }

  public boolean isStack() {
    return stack;
  }

  public void setStack(boolean stack) {
    this.stack = stack;
  }

  // *****************************************************************************
  // IMatchable implementation
  // *****************************************************************************

  public boolean match(MatchNode matchNode, MatchEngine engine) {

    if(!super.match(matchNode, engine)) {
      return false;
    }

    RuleValue rule = matchNode.getRules().get(MatchProperties.EXPRENT_VAR_INDEX);
    if(rule != null) {
      if(rule.isVariable()) {
        if(!engine.checkAndSetVariableValue((String)rule.value, this.index)) {
          return false;
        }
      } else {
        if(this.index != Integer.valueOf((String)rule.value).intValue()) {
          return false;
        }
      }
    }

    return true;
  }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Overview</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="author" content="">

    <link rel="stylesheet" id="theme_link" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/4.6.0/materia/bootstrap.min.css">

    <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
    <link type="text/css" rel="stylesheet" href="/F# Compiler Guide/content/navbar-fixed-left.css" />
    <link type="text/css" rel="stylesheet" href="/F# Compiler Guide/content/fsdocs-default.css" />
    <link type="text/css" rel="stylesheet" href="/F# Compiler Guide/content/fsdocs-custom.css" />

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />

        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">

        </button>

                    <input data-search-input="" id="search-by" type="search" placeholder="Search..." />

Links

License

Release Notes

Source Repository

  Compiler Internals

    Overview

    Coding standards

    Diagnostics

    Debug emit

    Display names, logical names and compiled names

    Representations

    F# Interactive Emit

    Optimizations

    Large inputs

    Memory usage

    Startup Performance

  Language Service Internals

    Overview

    Project builds

    FSharpChecker caches

    Incrementality

  FSharp.Compiler.Service

    Tutorial: Tokenizing

    Tutorial: Expressions

    Tutorial: Symbols

    Tutorial: Editor services

    Tutorial: Expressions

    Tutorial: Project analysis

    Tutorial: Hosted execution

    Tutorial: Hosting the compiler

    Notes on FSharp.Core

    IFileSystem

  FSharp.Core

    Guidance

                {{fsdocs-list-of-namespaces}}

F# Compiler Guide

Overview

The F# Language Service (FSharp.Editor, using FSharp.Compiler.Service) is designed to support tooling in Visual Studio and other IDEs. This document gives an overview of the features supported and notes on their technical characteristics.

Kinds of data processed and served in F# tooling

The following tables are split into two categories: syntactic and semantic. They contain common kinds of information requested, the kind of data that is involved, and roughly how expensive the operation is in terms of expected memory allocation and CPU processing.

IDE actions based on syntax

Action

Data inspected

Data returned

Expected CPU/Allocations (S/M/L/XL)

Syntactic Classification

Current doc's source text

Text span and classification type for each token in the document

S

Breakpoint Resolution

Current doc's syntax tree

Text span representing where breakpoints were resolved

S

Debugging data tip info

Current doc's source text

Text span representing the token being inspected

S

Brace pair matching

Current doc's source text

Text spans representing brace pairs that match in the input document

S

"Smart" indentation

Current doc's source text

Indentation location in a document

S

Code fixes operating only on syntax

Current doc's source text

Small text change for document

S

XML doc template generation

Current doc's syntax tree

Small (usually) text change for document

S

Brace pair completion

Current doc's source text

Additional brace pair inserted into source text

S

Souce document navigation

Current doc's syntax tree

"Navigation Items" with optional child navigation items containing ranges in source code

S

Code outlining

Current doc's source text

Text spans representing blocks of F# code that are collapsable as a group

S - M

Editor formatting

Current doc's source text

New source text for the document

S - L

Syntax diagnostics

Current doc's source text

List of diagnostic data including the span of text corresponding to the diagnostic

S

Global construct search and navigation

All syntax trees for all projects

All items that match a user's search pattern with spans of text that represent where a given item is located

S-L

You likely noticed that nearly all of the syntactical operations are marked S. Aside from extreme cases, like files with 50k lines or higher, syntax-only operations typically finish very quickly. In addition to being computationally inexpensive, they are also run asynchronously and free-threaded.

Editor formatting is a bit of an exception. Most IDEs offer common commands for format an entire document, and although they also offer commands to format a given text selection, users typically choose to format the whole document. This means an entire document has to be inspected and potentially rewritten based on often complex rules. In practice this isn't bad when working with a document that has already been formatted, but it can be expensive for larger documents with strange stylistic choices.

Most of the syntax operations require an entire document's source text or parse tree. It stands to reason that this could be improved by operating on a diff of a parse tree instead of the whole thing. This is likely a very complex thing to implement though, since none of the F# compiler infrastructure works in this way today.

IDE actions based on semantics

Action

Data inspected

Data returned

Expected CPU/Allocations (S/M/L/XL)

Most code fixes

Current document's typecheck data

Set (1 or more) of suggested text replacements

S-M

Semantic classification

Current document's typecheck data

Spans of text with semantic classification type for all constructs in a document

S-L

Code lenses

Current document's typecheck data and top-level declarations (for showing signatures); graph of all projects that reference the current one (for showing references)

Signature data for each top-level construct; spans of text for each reference to a top-level construct with navigation information

S-XL

Code generation / refactorings

Current document's typecheck data and/or current resolved symbol/symbols

Text replacement(s)

S-L

Code completion

Current document's typecheck data and currently-resolved symbol user is typing at

List of all symbols in scope that are "completable" based on where completion is invoked

S-L

Editor tooltips

Current document's typecheck data and resolved symbol where user invoked a tooltip

F# tooltip data based on inspecting a type and its declarations, then pretty-printing them

S-XL

Diagnostics based on F# semantics

Current document's typecheck data

Diagnostic info for each symbol with diagnostics to show, including the range of text associated with the diagnostic

M-XL

Symbol highlighting in a document

Current document's typecheck data and currently-resolved symbol where user's caret is located

Ranges of text representing instances of that symbol in the document

S-M

Semantic navigation (for example, Go to Definition)

Current document's typecheck data and currently-resolved symbol where the user invoked navigation

Location of a symbol's declaration

S-M

Rename

Graph of all projects that use the symbol that rename is triggered on and the typecheck data for each of those projects

List of all uses of all symbols that are to be renamed

S-XL

Find all references

Graph of all projects that Find References is triggered on and the typecheck data for each of those projects

List of all uses of all symbols that are found

S-XL

Unused value/symbol analysis

Typecheck data for the current document

List of all symbols that aren't a public API and are unused

S-M

Unused open analysis

Typecheck data for the current document and all symbol data brought into scope by each open declaration

List of open declarations whose symbols it exposes aren't used in the current document

S-L

Missing open analysis

Typecheck data for the current document, resolved symbol with an error, and list of available namespaces or modules

List of candidate namespaces or modules that can be opened

S-M

Misspelled name suggestion analysis

Typecheck data for the current document and resolved symbol with an error

List of candidates that are in scope and best match the misspelled name based on a string distance algorithm

S-M

Name simplification analysis

Typecheck data for the current document and all symbol data brought into scope by each open declaration

List of text changes available for any fully- or partially-qualified symbol that can be simplified

S-XL

You likely noticed that every cost associated with an action has a range. This is based on two factors:

If the semantic data being operated on is cached

How much semantic data must be processed for the action to be completed

Most actions are S if they operate on cached data and the compiler determines that no data needs to be re-computed. The size of their range is influenced largely by the kind of semantic operations each action has to do, such as:

Typechecking a single document and processing the resulting data

Typechecking a document and its containing project and then processing the resulting data

Resolving a single symbol in a document

Resolving the definition of a single symbol in a codebase

Inspecting all symbols brought into scope by a given open declaration

Inspecting all symbols in a document

Inspecting all symbols in all documents contained in a graph of projects

For example, commands like Find All References and Rename can be cheap if a codebase is small, hence the lower bound being S. But if the symbol in question is used across many documents in a large project graph, they are very expensive because the entire graph must be crawled and all symbols contained in its documents must be inspected.

In contrast, actions like highlighting all symbols in a document aren't terribly expensive even for very large files. That's because the symbols to be inspected are ultimately only in a single document.

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />

redpajama_set_name: RedPajamaGithub


text:
//=============================================================================
// Copyright © Jason Heddings, All Rights Reserved
// $Id: EggTimerTest.cs 81 2013-11-06 04:44:58Z jheddings $
//=============================================================================
using System.Threading;
using NUnit.Framework;

namespace Flynn.Utilities.UnitTest {

    [TestFixture]
    public class EggTimerTest {

        ///////////////////////////////////////////////////////////////////////
        [Test]
        public void ExpirationTest_Short(
            [Range(1, 5)] int value
        ) {
            TestTimerExpiration(value);
        }

        ///////////////////////////////////////////////////////////////////////
        [Test, Explicit]
        public void ExpirationTest_Long(
            [Range(60, 300, 30)] int value
        ) {
            TestTimerExpiration(value);
        }

        ///////////////////////////////////////////////////////////////////////
        [Test]
        public void StartStopTest() {
            bool fired = false;
            bool running = false;

            EggTimer timer = new EggTimer(2);

            timer.TimerExpired += new TimerExpiredHandler(delegate {
                fired = true;
            });

            timer.TimerStarted += new TimerStartedHandler(delegate {
                running = true;
            });

            timer.TimerStopped += new TimerStoppedHandler(delegate {
                running = false;
            });

            timer.Start();

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            Thread.Sleep(1100);

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            timer.Stop();

            Assert.IsFalse(fired, "timer expired early");
            Assert.IsFalse(running);
            Assert.IsFalse(timer.IsRunning);

            timer.Start();

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            Thread.Sleep(1100);

            Assert.IsTrue(fired, "timer did not expire in time");
            Assert.IsFalse(running);
            Assert.IsFalse(timer.IsRunning);
        }

        ///////////////////////////////////////////////////////////////////////
        [Test]
        public void CancelRestartTest() {
            bool fired = false;
            bool running = false;

            EggTimer timer = new EggTimer(2);

            timer.TimerExpired += new TimerExpiredHandler(delegate {
                fired = true;
            });

            timer.TimerStarted += new TimerStartedHandler(delegate {
                running = true;
            });

            timer.TimerStopped += new TimerStoppedHandler(delegate {
                running = false;
            });

            timer.Start();

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            Thread.Sleep(1100);

            timer.Cancel();

            Assert.IsFalse(fired, "timer expired after cancel");
            Assert.IsFalse(timer.IsRunning);
            Assert.IsFalse(running);
            Assert.AreEqual(0, timer.Remaining);

            Thread.Sleep(1100);

            Assert.IsFalse(fired, "timer expired after cancel");
            Assert.AreEqual(0, timer.Remaining);

            timer.Restart();

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            Thread.Sleep(1100);

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);
            Assert.IsFalse(fired, "timer expired early");

            Thread.Sleep(1100);

            Assert.IsTrue(fired, "timer did not expire after restart");
            Assert.IsFalse(running);
            Assert.IsFalse(timer.IsRunning);
        }

        ///////////////////////////////////////////////////////////////////////
        [Test]
        public void ForcedExpirationTest() {
            bool fired = false;
            bool running = false;

            EggTimer timer = new EggTimer(2);

            timer.TimerExpired += new TimerExpiredHandler(delegate {
                fired = true;
            });

            timer.TimerStarted += new TimerStartedHandler(delegate {
                running = true;
            });

            timer.TimerStopped += new TimerStoppedHandler(delegate {
                running = false;
            });

            timer.Start();

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            Thread.Sleep(1100);

            Assert.IsTrue(timer.IsRunning);
            Assert.IsTrue(running);

            timer.Expire();

            Assert.IsTrue(fired, "timer did not expire after expire");
            Assert.IsFalse(timer.IsRunning);
            Assert.IsFalse(running);
            Assert.AreEqual(0, timer.Remaining);

            fired = false;

            Thread.Sleep(1100);

            Assert.IsFalse(fired, "timer expired again");
        }

        ///////////////////////////////////////////////////////////////////////
        private void TestTimerExpiration(int seconds) {
            bool fired = false;
            bool running = false;

            EggTimer timer = new EggTimer(seconds);

            timer.TimerExpired += new TimerExpiredHandler(delegate {
                fired = true;
            });

            timer.TimerStarted += new TimerStartedHandler(delegate {
                running = true;
            });

            timer.TimerStopped += new TimerStoppedHandler(delegate {
                running = false;
            });

            Assert.IsFalse(timer.IsRunning);
            Assert.AreEqual(seconds, timer.Remaining);

            timer.Start();

            // keep an eye on the timer and the flag...
            for (int sec = 0; sec < seconds; sec++) {
                Assert.IsFalse(fired, "timer expired early");
                Assert.IsTrue(timer.IsRunning);
                Assert.IsTrue(running);

                Thread.Sleep(1000);
            }

            // give the timer a little extra time (note: 250 ms is spec, but
            // we push it a little bit here to make sure we will hit the spec)
            Thread.Sleep(100);

            // we should certainly have expired by now...
            Assert.IsTrue(fired, "timer did not expire in time");

            // the timer should be dead, since it had expired
            Assert.IsFalse(timer.IsRunning);
            Assert.IsFalse(running);
            Assert.AreEqual(0, timer.Remaining);
        }
    }
}


text:
package ar.edu.itba.it.obc.jz80.system;

import ar.edu.itba.it.obc.jz80.api.Operand;
import ar.edu.itba.it.obc.jz80.api.Register;
import ar.edu.itba.it.obc.jz80.instructions.JZ80IndirectRegister;

public abstract class JZ80ArithmeticLogicUnit {

	// Métodos abstractos para la implementación de algunas instrucciones

	public abstract Register getRegister(JZ80RegisterName r);

	public abstract JZ80IndirectRegister getIndexedRegister(JZ80RegisterName r,
			int offset);

	// Métodos auxiliares para manejo de flags

	public int getFlags() {
		return getRegister(JZ80RegisterName.F).readValue();
	}

	public void writeFlags(int flags) {
		getRegister(JZ80RegisterName.F).writeValue(flags);
	}

	private int setFlag(int value, JZ80Flag f) {
		return (value | f.getMask());
	}

	private int resetFlag(int value, JZ80Flag f) {
		return (value & ~f.getMask());
	}

	private boolean readFlag(int value, JZ80Flag f) {
		return (value & f.getMask()) != 0;
	}

	private int writeFlag(int value, JZ80Flag f, boolean bit) {
		return (bit ? setFlag(value, f) : resetFlag(value, f));
	}

	private int checkOverflow16(int flags, int op1, int op2, int result) {
		return checkOverflow8(flags, op1 >> 8, op2 >> 8, result >> 8);
	}

	private int checkOverflow8(int flags, int op1, int op2, int result) {
		boolean sign1 = ((op1 & 0x80) != 0);
		boolean sign2 = ((op2 & 0x80) != 0);
		boolean signr = ((result & 0x80) != 0);
		boolean overflow = ((sign1 == sign2) && (sign1 != signr));
		return writeFlag(flags, JZ80Flag.V, overflow);
	}

	private int checkParity(int flags, int result) {
		byte b = ((byte) (result & 0xFF));
		boolean odd = false;
		for (int i = 0; i < 8; i++) {
			if ((b & 1) != 0) {
				odd = !odd;
			}
			b >>= 1;
		}
		return writeFlag(flags, JZ80Flag.P, odd);
	}

	private int checkFlags8(int flags, int result) {
		flags = writeFlag(flags, JZ80Flag.S, (result & 0x80) != 0);
		flags = writeFlag(flags, JZ80Flag.Z, (result & 0xFF) == 0);
		flags = writeFlag(flags, JZ80Flag.C, result >= 0x100);
		return flags;
	}

	private int checkFlags16(int flags, int result) {
		flags = writeFlag(flags, JZ80Flag.S, (result & 0x8000) != 0);
		flags = writeFlag(flags, JZ80Flag.Z, (result & 0xFFFF) == 0);
		flags = writeFlag(flags, JZ80Flag.C, result >= 0x10000);
		return flags;
	}

	private int checkRotationFlags(int flags, int result, boolean carry,
			boolean checkSZP) {
		if (checkSZP) {
			flags = checkFlags8(flags, result);
			flags = checkParity(flags, result);
		}
		flags = writeFlag(flags, JZ80Flag.C, carry);
		flags = resetFlag(flags, JZ80Flag.H);
		flags = resetFlag(flags, JZ80Flag.N);
		return flags;
	}

	// Métodos que implementan la ejecución de instrucciones

	public int adc(Operand op, int val) {
		int c = readFlag(getFlags(), JZ80Flag.C) ? 1 : 0;
		return add(op, val + c);
	}

	public int add(Operand op, int val) {
		int x = op.readValue();
		int y = val;
		int result;
		// Flags
		int flags = getFlags();
		if (op.getByteSize() < 2) {
			result = (x & 0xFF) + (y & 0xFF);
			flags = checkFlags8(flags, result);
			flags = checkOverflow8(flags, x, y, result);
			flags = writeFlag(flags, JZ80Flag.H,
					(x & 0x0F) + (y & 0x0F) >= 0x10);
		} else {
			result = (x & 0xFFFF) + (y & 0xFFFF);
			flags = checkFlags16(flags, result);
			flags = checkOverflow16(flags, x, y, result);
		}
		flags = resetFlag(flags, JZ80Flag.N);
		op.writeValue(result);
		return flags;
	}

	public int and(Operand op, int val) {
		int result = op.readValue() & val;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkFlags8(flags, result);
		flags = checkParity(flags, result);
		flags = resetFlag(flags, JZ80Flag.H);
		flags = resetFlag(flags, JZ80Flag.N);
		flags = resetFlag(flags, JZ80Flag.C);
		return flags;
	}

	public int bit(Operand op, int bit) {
		int val = op.readValue();
		int mask = 1 << (bit + 1);
		// Flags
		int flags = getFlags();
		flags = writeFlag(flags, JZ80Flag.Z, (val & mask) == 0);
		flags = setFlag(flags, JZ80Flag.H);
		flags = resetFlag(flags, JZ80Flag.N);
		return flags;
	}

	public void call(int address) {
		Register pc = getRegister(JZ80RegisterName.PC);
		push(pc);
		pc.writeValue(address);
	}

	public int ccf() {
		int flags = getFlags();
		boolean c = readFlag(flags, JZ80Flag.C);
		flags = writeFlag(flags, JZ80Flag.H, c);
		flags = writeFlag(flags, JZ80Flag.N, false);
		flags = writeFlag(flags, JZ80Flag.C, !c);
		return flags;
	}

	public int cp(Operand op, int val) {
		int dst = op.readValue();
		int result = dst - val;
		// Flags
		int flags = getFlags();
		flags = checkFlags8(flags, result);
		flags = checkOverflow8(flags, dst, val, result);
		flags = writeFlag(flags, JZ80Flag.H,
				(dst & 0x0F) + (val & 0x0F) >= 0x10);
		flags = setFlag(flags, JZ80Flag.N);
		return flags;
	}

	public int cpl(Operand op, int val) {
		op.writeValue(~val);
		// Flags
		int flags = getFlags();
		flags = setFlag(flags, JZ80Flag.H);
		flags = setFlag(flags, JZ80Flag.N);
		return flags;
	}

	public int daa(Operand op, int val) {
		int flags = getFlags();
		int delta = 0;
		if (val > 0x99 || readFlag(flags, JZ80Flag.C)) {
			delta |= 0x60;
		} // else the upper nibble of correctionFactor is 0
		if ((val & 0x0F) > 9 || readFlag(flags, JZ80Flag.H)) {
			delta |= 0x06;
		} // else the lower nibble of correctionFactor is 0
		int result = readFlag(flags, JZ80Flag.N) ? val - delta : val + delta;
		op.writeValue(result);
		// Flags
		flags = checkFlags8(flags, result);
		flags = checkParity(flags, result);
		flags = writeFlag(flags, JZ80Flag.C, (delta & 0xF0) == 0x60);
		flags = writeFlag(flags, JZ80Flag.H, ((val ^ result) & 0x10) != 0);
		return flags;
	}

	public int dec(Operand op) {
		boolean c = readFlag(getFlags(), JZ80Flag.C);
		int flags = sub(op, 1);
		flags = writeFlag(flags, JZ80Flag.C, c); // el carry no cambia
		return flags;
	}

	public void djnz(byte offset) {
		int flags = dec(getRegister(JZ80RegisterName.B));
		if (!readFlag(flags, JZ80Flag.Z)) {
			jr(offset);
		}
		// Los flags no cambian
	}

	public void ex(Operand op1, Operand op2) {
		int x = op1.readValue();
		int y = op2.readValue();
		op1.writeValue(y);
		op2.writeValue(x);
	}

	public int inc(Operand op) {
		boolean c = readFlag(getFlags(), JZ80Flag.C);
		int flags = add(op, 1);
		flags = writeFlag(flags, JZ80Flag.C, c); // el carry no cambia
		return flags;
	}

	public void jp(int address) {
		Register r = getRegister(JZ80RegisterName.PC);
		r.writeValue(address);
	}

	public void jp(int address, JZ80Flag f, boolean condition) {
		if (readFlag(getFlags(), f) == condition) {
			jp(address);
		}
	}

	public void jr(byte offset) {
		Register r = getRegister(JZ80RegisterName.PC);
		r.writeValue(r.readValue() + (int) offset);
	}

	public void jr(byte offset, JZ80Flag f, boolean condition) {
		if (readFlag(getFlags(), f) == condition) {
			jr(offset);
		}
	}

	public void halt() {
	}

	public void in(Operand op) {
		Register r = getRegister(JZ80RegisterName.A);
		r.writeValue(op.readValue());
	}

	public void mlt(Operand op) {
		int val = op.readValue();
		int x = (val & 0xFF00) >> 16;
		int y = (val & 0xFF);
		op.writeValue(x * y);
		// No altera flags
	}

	public void ld(Operand op1, Operand op2) {
		op1.writeValue(op2.readValue());
	}

	public int neg(Operand op, int val) {
		int result = (val == 0x80 ? val : -val) & 0xFF;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkFlags8(flags, result);
		flags = writeFlag(flags, JZ80Flag.H, ((val ^ result) & 0x10) != 0);
		flags = writeFlag(flags, JZ80Flag.V, val == 0x80);
		flags = setFlag(flags, JZ80Flag.N);
		flags = writeFlag(flags, JZ80Flag.C, val != 0);
		return flags;
	}

	public void nop() {
	}

	public int or(Operand op, int val) {
		int result = op.readValue() | val;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkFlags8(flags, result);
		flags = checkParity(flags, result);
		flags = resetFlag(flags, JZ80Flag.H);
		flags = resetFlag(flags, JZ80Flag.N);
		flags = resetFlag(flags, JZ80Flag.C);
		return flags;
	}

	public void out(Operand op) {
		Register r = getRegister(JZ80RegisterName.A);
		op.writeValue(r.readValue());
	}

	public void pop(Operand op) {
		Register r = getRegister(JZ80RegisterName.SP);
		JZ80IndirectRegister lsb = getIndexedRegister(JZ80RegisterName.SP, 1);
		JZ80IndirectRegister msb = getIndexedRegister(JZ80RegisterName.SP, 0);
		int val = (msb.readValue() << 8) | lsb.readValue();
		op.writeValue(val);
		r.writeValue(r.readValue() + 2);
	}

	public void push(Operand op) {
		Register r = getRegister(JZ80RegisterName.SP);
		JZ80IndirectRegister lsb = getIndexedRegister(JZ80RegisterName.SP, -1);
		JZ80IndirectRegister msb = getIndexedRegister(JZ80RegisterName.SP, -2);
		int val = op.readValue();
		lsb.writeValue(val);
		msb.writeValue(val >> 8);
		r.writeValue(r.readValue() - 2);
	}

	public void res(Operand op, int bit) {
		int val = op.readValue();
		int mask = 1 << bit;
		op.writeValue(val & ~mask);
	}

	public void ret() {
		pop(getRegister(JZ80RegisterName.PC));
	}

	private int rl(Operand op, int val, boolean checkSZP) {
		int flags = getFlags();
		int carry = readFlag(flags, JZ80Flag.C) ? 1 : 0;
		int result = (val << 1) | carry;
		op.writeValue(result);
		// Flags
		flags = checkRotationFlags(flags, result, (val & 0x80) != 0, checkSZP);
		return flags;
	}

	public int rl(Operand op, int val) {
		return rl(op, val, true);
	}

	public int rla() {
		Register r = getRegister(JZ80RegisterName.A);
		return rl(r, r.readValue(), false);
	}

	private int rlc(Operand op, int val, boolean checkSZP) {
		int carry = ((val & 0x80) != 0) ? 1 : 0;
		int result = (val << 1) | carry;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkRotationFlags(flags, result, carry != 0, checkSZP);
		return flags;
	}

	public int rlc(Operand op, int val) {
		return rlc(op, val, true);
	}

	public int rlca() {
		Register r = getRegister(JZ80RegisterName.A);
		return rlc(r, r.readValue(), false);
	}

	public int rld(Operand op1, Operand op2) {
		// Input: A = nibble4 nibble3
		// (HL) = nibble2 nibble1
		// Output: A = nibble4 nibble2
		// (HL) = nibble1 nibble3
		int x = op1.readValue();
		int y = op2.readValue();
		op1.writeValue((x & 0xF0) | ((y & 0xF0) >> 4));
		int result = ((x & 0x0F) << 4) | (y & 0x0F);
		op2.writeValue(result);
		// Flags
		int flags = getFlags();
		boolean c = readFlag(flags, JZ80Flag.C);
		flags = checkRotationFlags(flags, result, c, true);
		return flags;
	}

	private int rr(Operand op, int val, boolean checkSZP) {
		int flags = getFlags();
		int carry = readFlag(flags, JZ80Flag.C) ? 0x80 : 0;
		int result = (val >> 1) | carry;
		op.writeValue(result);
		// Flags
		flags = checkRotationFlags(flags, result, (val & 1) != 0, checkSZP);
		return flags;
	}

	public int rr(Operand op, int val) {
		return rr(op, val, true);
	}

	public int rra() {
		Register r = getRegister(JZ80RegisterName.A);
		return rr(r, r.readValue(), false);
	}

	private int rrc(Operand op, int val, boolean checkSZP) {
		int carry = ((val & 1) != 0) ? 0x80 : 0;
		int result = (val >> 1) | carry;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkRotationFlags(flags, result, carry != 0, checkSZP);
		return flags;
	}

	public int rrc(Operand op, int val) {
		return rrc(op, val, true);
	}

	public int rrca() {
		Register r = getRegister(JZ80RegisterName.A);
		return rrc(r, r.readValue(), false);
	}

	public int rrd(Operand op1, Operand op2) {
		// Input: A = nibble4 nibble3
		// (HL) = nibble2 nibble1
		// Output: A = nibble4 nibble1
		// (HL) = nibble3 nibble2
		int x = op1.readValue();
		int y = op2.readValue();
		op1.writeValue((x & 0xF0) | (y & 0x0F));
		int result = ((x & 0x0F) << 4) | ((y & 0xF0) >> 4);
		op2.writeValue(result);
		// Flags
		int flags = getFlags();
		boolean c = readFlag(flags, JZ80Flag.C);
		flags = checkRotationFlags(flags, result, c, true);
		return flags;
	}

	public void rst(int address) {
		Register r = getRegister(JZ80RegisterName.PC);
		push(r);
		r.writeValue(address & 0xFF);
	}

	public int sbc(Operand op, int val) {
		int c = readFlag(getFlags(), JZ80Flag.C) ? 1 : 0;
		return sub(op, val + c); // TODO: Revisar esta suma de carry
	}

	public int scf() {
		// Flags
		int flags = getFlags();
		flags = writeFlag(flags, JZ80Flag.H, false);
		flags = writeFlag(flags, JZ80Flag.N, false);
		flags = writeFlag(flags, JZ80Flag.C, true);
		return flags;
	}

	public void set(Operand op, int bit) {
		int val = op.readValue();
		int mask = 1 << bit;
		op.writeValue(val | mask);
	}

	public int sla(Operand op, int val) {
		int result = val << 1;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkRotationFlags(flags, result, (val & 0x80) != 0, true);
		return flags;
	}

	public int sra(Operand op, int val) {
		int result = (val >> 1) | (val & 0x80);
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkRotationFlags(flags, result, (val & 1) != 0, true);
		return flags;
	}

	public int srl(Operand op, int val) {
		int result = (val >> 1) & 0x7F;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkRotationFlags(flags, result, (val & 1) != 0, true);
		return flags;
	}

	public int sub(Operand op, int val) {
		int x = op.readValue();
		int y = -val;
		int result;
		// Flags
		int flags = getFlags();
		if (op.getByteSize() < 2) {
			result = (x & 0xFF) + (y & 0xFF);
			flags = checkFlags8(flags, result);
			flags = checkOverflow8(flags, x, y, result);
			flags = writeFlag(flags, JZ80Flag.H,
					(x & 0x0F) + (x & 0x0F) >= 0x010);
		} else {
			result = (x & 0xFFFF) + (y & 0xFFFF);
			flags = checkFlags16(flags, result);
			flags = checkOverflow16(flags, x, y, result);
		}
		flags = writeFlag(flags, JZ80Flag.N, true);
		op.writeValue(result);
		return flags;
	}

	public int xor(Operand op, int val) {
		int result = op.readValue() ^ val;
		op.writeValue(result);
		// Flags
		int flags = getFlags();
		flags = checkFlags8(flags, result);
		flags = checkParity(flags, result);
		flags = resetFlag(flags, JZ80Flag.H);
		flags = resetFlag(flags, JZ80Flag.N);
		flags = resetFlag(flags, JZ80Flag.C);
		return flags;
	}

}


text:
enum xt_core_content_t {
  XT_CORE_CONTENT_UNKNOWN = 0,
  XT_CORE_CONTENT_MIME_IMAGE_GIF = 1,
  XT_CORE_CONTENT_MIME_TEXT_CSS = 2,
  XT_CORE_CONTENT_MIME_TEXT_HTML = 3,
  XT_CORE_CONTENT_MIME_TEXT_JAVASCRIPT = 4,
};
typedef enum xt_core_content_t xt_core_content_t;

char *xt_core_content_get_name(xt_core_content_t content_type);

#endif


text:
module Rulz
  module Conditions
    module Boolean
      def self.load_conditions(reciever, attr)
        reciever.class_eval do
          define_rulz do
            attribute attr do
              condition "is true" do
                send(attr)
              end
              condition "is false" do
                opposite_of "is true"
              end
            end
          end
        end
      end

      def self.included(base)
        base.class_eval do
          define_rulz do
            condition "is true" do
              it
            end
            condition "is false" do
              opposite_of "is true"
            end
          end
        end
      end
    end
  end
end


text:
gj.grid.messages['de-de'] = {
    First: 'Erste',
    Previous: 'Vorherige',
    Next: 'N\u00e4chste',
    Last: 'Letzte',
    Page: 'Seite',
    FirstPageTooltip: 'Erste Seite',
    PreviousPageTooltip: 'Vorherige Seite',
    NextPageTooltip: 'N\u00e4chste Seite',
    LastPageTooltip: 'Letzte Seite',
    Refresh: 'Aktualisieren',
    Of: 'von',
    DisplayingRecords: 'Zeige Datens\u00e4tze',
    RowsPerPage: 'Zeilen pro Seite:',
    Edit: 'Editieren',
    Delete: 'L\u00f6schen',
    Update: 'Aktualisieren',
    Cancel: 'Abbrechen',
    NoRecordsFound: 'Es wurden keine Datens\u00e4tze gefunden.',
    Loading: 'Laden...'
};


text:
.. _version_1.1.6:

=============
Version 1.1.6
=============

Released on 2017/06/23.

.. NOTE::

    If you are upgrading a cluster, you must be running CrateDB 0.57.0 or higher
    before you upgrade to 1.1.6.

    If you want to perform a `rolling upgrade`_, your current CrateDB version
    number must be :ref:`version_1.1.1` or higher. If you want to upgrade from a
    version prior to this, the upgrade will introduce all of the breaking
    changes listed for :ref:`version_1.1.0`, and will require a `full restart
    upgrade`_.

.. WARNING::

    Before upgrading, you should `back up your data`_.

.. _rolling upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/rolling-upgrade.html
.. _full restart upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/full-restart-upgrade.html
.. _back up your data: https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html

.. rubric:: Table of contents

.. contents::
   :local:

Changelog
=========

Fixes
-----

 - Fixed an issue that caused an exception to be thrown when applying
   aggregations on generated columns of a table.

 - Fixed a bug in the memory accounting of the circuit breaker for HTTP
   results when querying for columns of undefined type.

 - Fixed issue that caused an exception when querying the ``_id`` column using
   all defined primary keys inside the ``WHERE`` clause over the HTTP API.

 - Fixed wrong results when querying ``IS NULL`` and ``IS NOT NULL`` on an
   array of objects.

 - Fixed an issue that caused an Exception to be thrown on ``JOIN`` queries
   with 4 or more tables when an ``ORDER BY`` is also applied.

 - Fixed an issue that resulted in rows being unable to be queried by primary
   keys, when the order of the primary key columns on insert differed from
   the order of the primary key columns on the table definition.
   Note: If records are already inserted by using a different primary key
   column order, they must be re-inserted, otherwise queries will still fail
   for these rows.

 - Improved the resiliency of queries on ``sys.nodes``: If a node disconnects
   during the execution of a query it will no longer fail.

 - Added proper handling when memory requirements of a ``JOIN`` query exceeds
   the available memory. Instead of having OutOfMemoryException thrown which
   led to killed nodes in the cluster, the issue is detected and the query is
   killed without affecting the cluster.

 - Fixed an issue that could cause ``DELETE`` statements to fail instead of
   "not matching" if there was a ``_version`` column in the ``WHERE`` clause.

 - Fixed an error handling issue that could lead to the termination of a node
   in very rare cases. (Usually if a user invoked the ``KILL`` statement)

 - Fixed an issue that caused an exception to be thrown when using ``unnest``
   with 10 or more columns.


text:
require "uri"

class Piwik
  attr_reader :url, :site_id

  def initialize(host, site_id)
    @enabled = host.present?
    if @enabled
      @url = URI.parse(host)
    end
    @site_id = site_id
  end

  def enabled?
    @enabled
  end
end


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<link type="text/css" rel="stylesheet" href="index_files/xonomy/xonomy.css"/>

			x

This website uses Xonomy


text:
<?php

namespace PharmaIntelligence\GstandaardBundle\Model\om;

use \Criteria;
use \Exception;
use \ModelCriteria;
use \ModelJoin;
use \PDO;
use \Propel;
use \PropelCollection;
use \PropelException;
use \PropelObjectCollection;
use \PropelPDO;
use PharmaIntelligence\GstandaardBundle\Model\GsGeneriekeNamen;
use PharmaIntelligence\GstandaardBundle\Model\GsGeneriekeNamenPeer;
use PharmaIntelligence\GstandaardBundle\Model\GsGeneriekeNamenQuery;
use PharmaIntelligence\GstandaardBundle\Model\GsIngegevenSamenstellingen;

/**
 * @method GsGeneriekeNamenQuery orderByBestandnummer($order = Criteria::ASC) Order by the bestandnummer column
 * @method GsGeneriekeNamenQuery orderByMutatiekode($order = Criteria::ASC) Order by the mutatiekode column
 * @method GsGeneriekeNamenQuery orderByGeneriekenaamkode($order = Criteria::ASC) Order by the generiekenaamkode column
 * @method GsGeneriekeNamenQuery orderByGeneriekeNaam($order = Criteria::ASC) Order by the generieke_naam column
 * @method GsGeneriekeNamenQuery orderByStamnaamcode($order = Criteria::ASC) Order by the stamnaamcode column
 * @method GsGeneriekeNamenQuery orderByVolledigeGeneriekeNaamKode($order = Criteria::ASC) Order by the volledige_generieke_naam_kode column
 * @method GsGeneriekeNamenQuery orderByKodeStamnaamToegestaan($order = Criteria::ASC) Order by the kode_stamnaam_toegestaan column
 * @method GsGeneriekeNamenQuery orderByKodeWerkzaamBestanddeelhulpstof($order = Criteria::ASC) Order by the kode_werkzaam_bestanddeelhulpstof column
 * @method GsGeneriekeNamenQuery orderByInformatoriumStofKode($order = Criteria::ASC) Order by the informatorium_stof_kode column
 * @method GsGeneriekeNamenQuery orderByCasNummer($order = Criteria::ASC) Order by the cas_nummer column
 * @method GsGeneriekeNamenQuery orderByBrutoFormule($order = Criteria::ASC) Order by the bruto_formule column
 * @method GsGeneriekeNamenQuery orderByMolekuulgewicht($order = Criteria::ASC) Order by the molekuulgewicht column
 * @method GsGeneriekeNamenQuery orderByMolekuulgewichtIndicator($order = Criteria::ASC) Order by the molekuulgewicht_indicator column
 * @method GsGeneriekeNamenQuery orderByMolekuulgewichtVoorSamenstelling($order = Criteria::ASC) Order by the molekuulgewicht_voor_samenstelling column
 * @method GsGeneriekeNamenQuery orderBySoortelijkGewicht($order = Criteria::ASC) Order by the soortelijk_gewicht column
 * @method GsGeneriekeNamenQuery orderByVoorkeurseenheid($order = Criteria::ASC) Order by the voorkeurseenheid column
 * @method GsGeneriekeNamenQuery orderByKodeRijvaardigheid($order = Criteria::ASC) Order by the kode_rijvaardigheid column
 * @method GsGeneriekeNamenQuery orderByKodeVergift($order = Criteria::ASC) Order by the kode_vergift column
 * @method GsGeneriekeNamenQuery orderByKodeOpiumwet($order = Criteria::ASC) Order by the kode_opiumwet column
 *
 * @method GsGeneriekeNamenQuery groupByBestandnummer() Group by the bestandnummer column
 * @method GsGeneriekeNamenQuery groupByMutatiekode() Group by the mutatiekode column
 * @method GsGeneriekeNamenQuery groupByGeneriekenaamkode() Group by the generiekenaamkode column
 * @method GsGeneriekeNamenQuery groupByGeneriekeNaam() Group by the generieke_naam column
 * @method GsGeneriekeNamenQuery groupByStamnaamcode() Group by the stamnaamcode column
 * @method GsGeneriekeNamenQuery groupByVolledigeGeneriekeNaamKode() Group by the volledige_generieke_naam_kode column
 * @method GsGeneriekeNamenQuery groupByKodeStamnaamToegestaan() Group by the kode_stamnaam_toegestaan column
 * @method GsGeneriekeNamenQuery groupByKodeWerkzaamBestanddeelhulpstof() Group by the kode_werkzaam_bestanddeelhulpstof column
 * @method GsGeneriekeNamenQuery groupByInformatoriumStofKode() Group by the informatorium_stof_kode column
 * @method GsGeneriekeNamenQuery groupByCasNummer() Group by the cas_nummer column
 * @method GsGeneriekeNamenQuery groupByBrutoFormule() Group by the bruto_formule column
 * @method GsGeneriekeNamenQuery groupByMolekuulgewicht() Group by the molekuulgewicht column
 * @method GsGeneriekeNamenQuery groupByMolekuulgewichtIndicator() Group by the molekuulgewicht_indicator column
 * @method GsGeneriekeNamenQuery groupByMolekuulgewichtVoorSamenstelling() Group by the molekuulgewicht_voor_samenstelling column
 * @method GsGeneriekeNamenQuery groupBySoortelijkGewicht() Group by the soortelijk_gewicht column
 * @method GsGeneriekeNamenQuery groupByVoorkeurseenheid() Group by the voorkeurseenheid column
 * @method GsGeneriekeNamenQuery groupByKodeRijvaardigheid() Group by the kode_rijvaardigheid column
 * @method GsGeneriekeNamenQuery groupByKodeVergift() Group by the kode_vergift column
 * @method GsGeneriekeNamenQuery groupByKodeOpiumwet() Group by the kode_opiumwet column
 *
 * @method GsGeneriekeNamenQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method GsGeneriekeNamenQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method GsGeneriekeNamenQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method GsGeneriekeNamenQuery leftJoinGsIngegevenSamenstellingen($relationAlias = null) Adds a LEFT JOIN clause to the query using the GsIngegevenSamenstellingen relation
 * @method GsGeneriekeNamenQuery rightJoinGsIngegevenSamenstellingen($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GsIngegevenSamenstellingen relation
 * @method GsGeneriekeNamenQuery innerJoinGsIngegevenSamenstellingen($relationAlias = null) Adds a INNER JOIN clause to the query using the GsIngegevenSamenstellingen relation
 *
 * @method GsGeneriekeNamen findOne(PropelPDO $con = null) Return the first GsGeneriekeNamen matching the query
 * @method GsGeneriekeNamen findOneOrCreate(PropelPDO $con = null) Return the first GsGeneriekeNamen matching the query, or a new GsGeneriekeNamen object populated from the query conditions when no match is found
 *
 * @method GsGeneriekeNamen findOneByBestandnummer(int $bestandnummer) Return the first GsGeneriekeNamen filtered by the bestandnummer column
 * @method GsGeneriekeNamen findOneByMutatiekode(int $mutatiekode) Return the first GsGeneriekeNamen filtered by the mutatiekode column
 * @method GsGeneriekeNamen findOneByGeneriekeNaam(string $generieke_naam) Return the first GsGeneriekeNamen filtered by the generieke_naam column
 * @method GsGeneriekeNamen findOneByStamnaamcode(int $stamnaamcode) Return the first GsGeneriekeNamen filtered by the stamnaamcode column
 * @method GsGeneriekeNamen findOneByVolledigeGeneriekeNaamKode(int $volledige_generieke_naam_kode) Return the first GsGeneriekeNamen filtered by the volledige_generieke_naam_kode column
 * @method GsGeneriekeNamen findOneByKodeStamnaamToegestaan(string $kode_stamnaam_toegestaan) Return the first GsGeneriekeNamen filtered by the kode_stamnaam_toegestaan column
 * @method GsGeneriekeNamen findOneByKodeWerkzaamBestanddeelhulpstof(string $kode_werkzaam_bestanddeelhulpstof) Return the first GsGeneriekeNamen filtered by the kode_werkzaam_bestanddeelhulpstof column
 * @method GsGeneriekeNamen findOneByInformatoriumStofKode(int $informatorium_stof_kode) Return the first GsGeneriekeNamen filtered by the informatorium_stof_kode column
 * @method GsGeneriekeNamen findOneByCasNummer(int $cas_nummer) Return the first GsGeneriekeNamen filtered by the cas_nummer column
 * @method GsGeneriekeNamen findOneByBrutoFormule(string $bruto_formule) Return the first GsGeneriekeNamen filtered by the bruto_formule column
 * @method GsGeneriekeNamen findOneByMolekuulgewicht(string $molekuulgewicht) Return the first GsGeneriekeNamen filtered by the molekuulgewicht column
 * @method GsGeneriekeNamen findOneByMolekuulgewichtIndicator(string $molekuulgewicht_indicator) Return the first GsGeneriekeNamen filtered by the molekuulgewicht_indicator column
 * @method GsGeneriekeNamen findOneByMolekuulgewichtVoorSamenstelling(string $molekuulgewicht_voor_samenstelling) Return the first GsGeneriekeNamen filtered by the molekuulgewicht_voor_samenstelling column
 * @method GsGeneriekeNamen findOneBySoortelijkGewicht(string $soortelijk_gewicht) Return the first GsGeneriekeNamen filtered by the soortelijk_gewicht column
 * @method GsGeneriekeNamen findOneByVoorkeurseenheid(string $voorkeurseenheid) Return the first GsGeneriekeNamen filtered by the voorkeurseenheid column
 * @method GsGeneriekeNamen findOneByKodeRijvaardigheid(string $kode_rijvaardigheid) Return the first GsGeneriekeNamen filtered by the kode_rijvaardigheid column
 * @method GsGeneriekeNamen findOneByKodeVergift(string $kode_vergift) Return the first GsGeneriekeNamen filtered by the kode_vergift column
 * @method GsGeneriekeNamen findOneByKodeOpiumwet(string $kode_opiumwet) Return the first GsGeneriekeNamen filtered by the kode_opiumwet column
 *
 * @method array findByBestandnummer(int $bestandnummer) Return GsGeneriekeNamen objects filtered by the bestandnummer column
 * @method array findByMutatiekode(int $mutatiekode) Return GsGeneriekeNamen objects filtered by the mutatiekode column
 * @method array findByGeneriekenaamkode(int $generiekenaamkode) Return GsGeneriekeNamen objects filtered by the generiekenaamkode column
 * @method array findByGeneriekeNaam(string $generieke_naam) Return GsGeneriekeNamen objects filtered by the generieke_naam column
 * @method array findByStamnaamcode(int $stamnaamcode) Return GsGeneriekeNamen objects filtered by the stamnaamcode column
 * @method array findByVolledigeGeneriekeNaamKode(int $volledige_generieke_naam_kode) Return GsGeneriekeNamen objects filtered by the volledige_generieke_naam_kode column
 * @method array findByKodeStamnaamToegestaan(string $kode_stamnaam_toegestaan) Return GsGeneriekeNamen objects filtered by the kode_stamnaam_toegestaan column
 * @method array findByKodeWerkzaamBestanddeelhulpstof(string $kode_werkzaam_bestanddeelhulpstof) Return GsGeneriekeNamen objects filtered by the kode_werkzaam_bestanddeelhulpstof column
 * @method array findByInformatoriumStofKode(int $informatorium_stof_kode) Return GsGeneriekeNamen objects filtered by the informatorium_stof_kode column
 * @method array findByCasNummer(int $cas_nummer) Return GsGeneriekeNamen objects filtered by the cas_nummer column
 * @method array findByBrutoFormule(string $bruto_formule) Return GsGeneriekeNamen objects filtered by the bruto_formule column
 * @method array findByMolekuulgewicht(string $molekuulgewicht) Return GsGeneriekeNamen objects filtered by the molekuulgewicht column
 * @method array findByMolekuulgewichtIndicator(string $molekuulgewicht_indicator) Return GsGeneriekeNamen objects filtered by the molekuulgewicht_indicator column
 * @method array findByMolekuulgewichtVoorSamenstelling(string $molekuulgewicht_voor_samenstelling) Return GsGeneriekeNamen objects filtered by the molekuulgewicht_voor_samenstelling column
 * @method array findBySoortelijkGewicht(string $soortelijk_gewicht) Return GsGeneriekeNamen objects filtered by the soortelijk_gewicht column
 * @method array findByVoorkeurseenheid(string $voorkeurseenheid) Return GsGeneriekeNamen objects filtered by the voorkeurseenheid column
 * @method array findByKodeRijvaardigheid(string $kode_rijvaardigheid) Return GsGeneriekeNamen objects filtered by the kode_rijvaardigheid column
 * @method array findByKodeVergift(string $kode_vergift) Return GsGeneriekeNamen objects filtered by the kode_vergift column
 * @method array findByKodeOpiumwet(string $kode_opiumwet) Return GsGeneriekeNamen objects filtered by the kode_opiumwet column
 */
abstract class BaseGsGeneriekeNamenQuery extends ModelCriteria
{
    /**
     * Initializes internal state of BaseGsGeneriekeNamenQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = null, $modelName = null, $modelAlias = null)
    {
        if (null === $dbName) {
            $dbName = 'default';
        }
        if (null === $modelName) {
            $modelName = 'PharmaIntelligence\\GstandaardBundle\\Model\\GsGeneriekeNamen';
        }
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new GsGeneriekeNamenQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param   GsGeneriekeNamenQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return GsGeneriekeNamenQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof GsGeneriekeNamenQuery) {
            return $criteria;
        }
        $query = new GsGeneriekeNamenQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     *
     * $obj  = $c->findPk(12, $con);
     *
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   GsGeneriekeNamen|GsGeneriekeNamen[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = GsGeneriekeNamenPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is already in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(GsGeneriekeNamenPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Alias of findPk to use instance pooling
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return                 GsGeneriekeNamen A model object, or null if the key is not found
     * @throws PropelException
     */
     public function findOneByGeneriekenaamkode($key, $con = null)
     {
        return $this->findPk($key, $con);
     }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return                 GsGeneriekeNamen A model object, or null if the key is not found
     * @throws PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT `bestandnummer`, `mutatiekode`, `generiekenaamkode`, `generieke_naam`, `stamnaamcode`, `volledige_generieke_naam_kode`, `kode_stamnaam_toegestaan`, `kode_werkzaam_bestanddeelhulpstof`, `informatorium_stof_kode`, `cas_nummer`, `bruto_formule`, `molekuulgewicht`, `molekuulgewicht_indicator`, `molekuulgewicht_voor_samenstelling`, `soortelijk_gewicht`, `voorkeurseenheid`, `kode_rijvaardigheid`, `kode_vergift`, `kode_opiumwet` FROM `gs_generieke_namen` WHERE `generiekenaamkode` = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new GsGeneriekeNamen();
            $obj->hydrate($row);
            GsGeneriekeNamenPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return GsGeneriekeNamen|GsGeneriekeNamen[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     *
     * $objs = $c->findPks(array(12, 56, 832), $con);
     *
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|GsGeneriekeNamen[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the bestandnummer column
     *
     * Example usage:
     *
     * $query->filterByBestandnummer(1234); // WHERE bestandnummer = 1234
     * $query->filterByBestandnummer(array(12, 34)); // WHERE bestandnummer IN (12, 34)
     * $query->filterByBestandnummer(array('min' => 12)); // WHERE bestandnummer >= 12
     * $query->filterByBestandnummer(array('max' => 12)); // WHERE bestandnummer <= 12
     *
     *
     * @param     mixed $bestandnummer The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByBestandnummer($bestandnummer = null, $comparison = null)
    {
        if (is_array($bestandnummer)) {
            $useMinMax = false;
            if (isset($bestandnummer['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::BESTANDNUMMER, $bestandnummer['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($bestandnummer['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::BESTANDNUMMER, $bestandnummer['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::BESTANDNUMMER, $bestandnummer, $comparison);
    }

    /**
     * Filter the query on the mutatiekode column
     *
     * Example usage:
     *
     * $query->filterByMutatiekode(1234); // WHERE mutatiekode = 1234
     * $query->filterByMutatiekode(array(12, 34)); // WHERE mutatiekode IN (12, 34)
     * $query->filterByMutatiekode(array('min' => 12)); // WHERE mutatiekode >= 12
     * $query->filterByMutatiekode(array('max' => 12)); // WHERE mutatiekode <= 12
     *
     *
     * @param     mixed $mutatiekode The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByMutatiekode($mutatiekode = null, $comparison = null)
    {
        if (is_array($mutatiekode)) {
            $useMinMax = false;
            if (isset($mutatiekode['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MUTATIEKODE, $mutatiekode['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($mutatiekode['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MUTATIEKODE, $mutatiekode['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::MUTATIEKODE, $mutatiekode, $comparison);
    }

    /**
     * Filter the query on the generiekenaamkode column
     *
     * Example usage:
     *
     * $query->filterByGeneriekenaamkode(1234); // WHERE generiekenaamkode = 1234
     * $query->filterByGeneriekenaamkode(array(12, 34)); // WHERE generiekenaamkode IN (12, 34)
     * $query->filterByGeneriekenaamkode(array('min' => 12)); // WHERE generiekenaamkode >= 12
     * $query->filterByGeneriekenaamkode(array('max' => 12)); // WHERE generiekenaamkode <= 12
     *
     *
     * @param     mixed $generiekenaamkode The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByGeneriekenaamkode($generiekenaamkode = null, $comparison = null)
    {
        if (is_array($generiekenaamkode)) {
            $useMinMax = false;
            if (isset($generiekenaamkode['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $generiekenaamkode['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($generiekenaamkode['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $generiekenaamkode['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $generiekenaamkode, $comparison);
    }

    /**
     * Filter the query on the generieke_naam column
     *
     * Example usage:
     *
     * $query->filterByGeneriekeNaam('fooValue');   // WHERE generieke_naam = 'fooValue'
     * $query->filterByGeneriekeNaam('%fooValue%'); // WHERE generieke_naam LIKE '%fooValue%'
     *
     *
     * @param     string $generiekeNaam The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByGeneriekeNaam($generiekeNaam = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($generiekeNaam)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $generiekeNaam)) {
                $generiekeNaam = str_replace('*', '%', $generiekeNaam);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKE_NAAM, $generiekeNaam, $comparison);
    }

    /**
     * Filter the query on the stamnaamcode column
     *
     * Example usage:
     *
     * $query->filterByStamnaamcode(1234); // WHERE stamnaamcode = 1234
     * $query->filterByStamnaamcode(array(12, 34)); // WHERE stamnaamcode IN (12, 34)
     * $query->filterByStamnaamcode(array('min' => 12)); // WHERE stamnaamcode >= 12
     * $query->filterByStamnaamcode(array('max' => 12)); // WHERE stamnaamcode <= 12
     *
     *
     * @param     mixed $stamnaamcode The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByStamnaamcode($stamnaamcode = null, $comparison = null)
    {
        if (is_array($stamnaamcode)) {
            $useMinMax = false;
            if (isset($stamnaamcode['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::STAMNAAMCODE, $stamnaamcode['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($stamnaamcode['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::STAMNAAMCODE, $stamnaamcode['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::STAMNAAMCODE, $stamnaamcode, $comparison);
    }

    /**
     * Filter the query on the volledige_generieke_naam_kode column
     *
     * Example usage:
     *
     * $query->filterByVolledigeGeneriekeNaamKode(1234); // WHERE volledige_generieke_naam_kode = 1234
     * $query->filterByVolledigeGeneriekeNaamKode(array(12, 34)); // WHERE volledige_generieke_naam_kode IN (12, 34)
     * $query->filterByVolledigeGeneriekeNaamKode(array('min' => 12)); // WHERE volledige_generieke_naam_kode >= 12
     * $query->filterByVolledigeGeneriekeNaamKode(array('max' => 12)); // WHERE volledige_generieke_naam_kode <= 12
     *
     *
     * @param     mixed $volledigeGeneriekeNaamKode The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByVolledigeGeneriekeNaamKode($volledigeGeneriekeNaamKode = null, $comparison = null)
    {
        if (is_array($volledigeGeneriekeNaamKode)) {
            $useMinMax = false;
            if (isset($volledigeGeneriekeNaamKode['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::VOLLEDIGE_GENERIEKE_NAAM_KODE, $volledigeGeneriekeNaamKode['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($volledigeGeneriekeNaamKode['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::VOLLEDIGE_GENERIEKE_NAAM_KODE, $volledigeGeneriekeNaamKode['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::VOLLEDIGE_GENERIEKE_NAAM_KODE, $volledigeGeneriekeNaamKode, $comparison);
    }

    /**
     * Filter the query on the kode_stamnaam_toegestaan column
     *
     * Example usage:
     *
     * $query->filterByKodeStamnaamToegestaan('fooValue');   // WHERE kode_stamnaam_toegestaan = 'fooValue'
     * $query->filterByKodeStamnaamToegestaan('%fooValue%'); // WHERE kode_stamnaam_toegestaan LIKE '%fooValue%'
     *
     *
     * @param     string $kodeStamnaamToegestaan The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByKodeStamnaamToegestaan($kodeStamnaamToegestaan = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($kodeStamnaamToegestaan)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $kodeStamnaamToegestaan)) {
                $kodeStamnaamToegestaan = str_replace('*', '%', $kodeStamnaamToegestaan);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::KODE_STAMNAAM_TOEGESTAAN, $kodeStamnaamToegestaan, $comparison);
    }

    /**
     * Filter the query on the kode_werkzaam_bestanddeelhulpstof column
     *
     * Example usage:
     *
     * $query->filterByKodeWerkzaamBestanddeelhulpstof('fooValue');   // WHERE kode_werkzaam_bestanddeelhulpstof = 'fooValue'
     * $query->filterByKodeWerkzaamBestanddeelhulpstof('%fooValue%'); // WHERE kode_werkzaam_bestanddeelhulpstof LIKE '%fooValue%'
     *
     *
     * @param     string $kodeWerkzaamBestanddeelhulpstof The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByKodeWerkzaamBestanddeelhulpstof($kodeWerkzaamBestanddeelhulpstof = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($kodeWerkzaamBestanddeelhulpstof)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $kodeWerkzaamBestanddeelhulpstof)) {
                $kodeWerkzaamBestanddeelhulpstof = str_replace('*', '%', $kodeWerkzaamBestanddeelhulpstof);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::KODE_WERKZAAM_BESTANDDEELHULPSTOF, $kodeWerkzaamBestanddeelhulpstof, $comparison);
    }

    /**
     * Filter the query on the informatorium_stof_kode column
     *
     * Example usage:
     *
     * $query->filterByInformatoriumStofKode(1234); // WHERE informatorium_stof_kode = 1234
     * $query->filterByInformatoriumStofKode(array(12, 34)); // WHERE informatorium_stof_kode IN (12, 34)
     * $query->filterByInformatoriumStofKode(array('min' => 12)); // WHERE informatorium_stof_kode >= 12
     * $query->filterByInformatoriumStofKode(array('max' => 12)); // WHERE informatorium_stof_kode <= 12
     *
     *
     * @param     mixed $informatoriumStofKode The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByInformatoriumStofKode($informatoriumStofKode = null, $comparison = null)
    {
        if (is_array($informatoriumStofKode)) {
            $useMinMax = false;
            if (isset($informatoriumStofKode['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::INFORMATORIUM_STOF_KODE, $informatoriumStofKode['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($informatoriumStofKode['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::INFORMATORIUM_STOF_KODE, $informatoriumStofKode['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::INFORMATORIUM_STOF_KODE, $informatoriumStofKode, $comparison);
    }

    /**
     * Filter the query on the cas_nummer column
     *
     * Example usage:
     *
     * $query->filterByCasNummer(1234); // WHERE cas_nummer = 1234
     * $query->filterByCasNummer(array(12, 34)); // WHERE cas_nummer IN (12, 34)
     * $query->filterByCasNummer(array('min' => 12)); // WHERE cas_nummer >= 12
     * $query->filterByCasNummer(array('max' => 12)); // WHERE cas_nummer <= 12
     *
     *
     * @param     mixed $casNummer The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByCasNummer($casNummer = null, $comparison = null)
    {
        if (is_array($casNummer)) {
            $useMinMax = false;
            if (isset($casNummer['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::CAS_NUMMER, $casNummer['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($casNummer['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::CAS_NUMMER, $casNummer['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::CAS_NUMMER, $casNummer, $comparison);
    }

    /**
     * Filter the query on the bruto_formule column
     *
     * Example usage:
     *
     * $query->filterByBrutoFormule('fooValue');   // WHERE bruto_formule = 'fooValue'
     * $query->filterByBrutoFormule('%fooValue%'); // WHERE bruto_formule LIKE '%fooValue%'
     *
     *
     * @param     string $brutoFormule The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByBrutoFormule($brutoFormule = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($brutoFormule)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $brutoFormule)) {
                $brutoFormule = str_replace('*', '%', $brutoFormule);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::BRUTO_FORMULE, $brutoFormule, $comparison);
    }

    /**
     * Filter the query on the molekuulgewicht column
     *
     * Example usage:
     *
     * $query->filterByMolekuulgewicht(1234); // WHERE molekuulgewicht = 1234
     * $query->filterByMolekuulgewicht(array(12, 34)); // WHERE molekuulgewicht IN (12, 34)
     * $query->filterByMolekuulgewicht(array('min' => 12)); // WHERE molekuulgewicht >= 12
     * $query->filterByMolekuulgewicht(array('max' => 12)); // WHERE molekuulgewicht <= 12
     *
     *
     * @param     mixed $molekuulgewicht The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByMolekuulgewicht($molekuulgewicht = null, $comparison = null)
    {
        if (is_array($molekuulgewicht)) {
            $useMinMax = false;
            if (isset($molekuulgewicht['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT, $molekuulgewicht['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($molekuulgewicht['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT, $molekuulgewicht['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT, $molekuulgewicht, $comparison);
    }

    /**
     * Filter the query on the molekuulgewicht_indicator column
     *
     * Example usage:
     *
     * $query->filterByMolekuulgewichtIndicator('fooValue');   // WHERE molekuulgewicht_indicator = 'fooValue'
     * $query->filterByMolekuulgewichtIndicator('%fooValue%'); // WHERE molekuulgewicht_indicator LIKE '%fooValue%'
     *
     *
     * @param     string $molekuulgewichtIndicator The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByMolekuulgewichtIndicator($molekuulgewichtIndicator = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($molekuulgewichtIndicator)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $molekuulgewichtIndicator)) {
                $molekuulgewichtIndicator = str_replace('*', '%', $molekuulgewichtIndicator);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT_INDICATOR, $molekuulgewichtIndicator, $comparison);
    }

    /**
     * Filter the query on the molekuulgewicht_voor_samenstelling column
     *
     * Example usage:
     *
     * $query->filterByMolekuulgewichtVoorSamenstelling(1234); // WHERE molekuulgewicht_voor_samenstelling = 1234
     * $query->filterByMolekuulgewichtVoorSamenstelling(array(12, 34)); // WHERE molekuulgewicht_voor_samenstelling IN (12, 34)
     * $query->filterByMolekuulgewichtVoorSamenstelling(array('min' => 12)); // WHERE molekuulgewicht_voor_samenstelling >= 12
     * $query->filterByMolekuulgewichtVoorSamenstelling(array('max' => 12)); // WHERE molekuulgewicht_voor_samenstelling <= 12
     *
     *
     * @param     mixed $molekuulgewichtVoorSamenstelling The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByMolekuulgewichtVoorSamenstelling($molekuulgewichtVoorSamenstelling = null, $comparison = null)
    {
        if (is_array($molekuulgewichtVoorSamenstelling)) {
            $useMinMax = false;
            if (isset($molekuulgewichtVoorSamenstelling['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT_VOOR_SAMENSTELLING, $molekuulgewichtVoorSamenstelling['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($molekuulgewichtVoorSamenstelling['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT_VOOR_SAMENSTELLING, $molekuulgewichtVoorSamenstelling['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::MOLEKUULGEWICHT_VOOR_SAMENSTELLING, $molekuulgewichtVoorSamenstelling, $comparison);
    }

    /**
     * Filter the query on the soortelijk_gewicht column
     *
     * Example usage:
     *
     * $query->filterBySoortelijkGewicht(1234); // WHERE soortelijk_gewicht = 1234
     * $query->filterBySoortelijkGewicht(array(12, 34)); // WHERE soortelijk_gewicht IN (12, 34)
     * $query->filterBySoortelijkGewicht(array('min' => 12)); // WHERE soortelijk_gewicht >= 12
     * $query->filterBySoortelijkGewicht(array('max' => 12)); // WHERE soortelijk_gewicht <= 12
     *
     *
     * @param     mixed $soortelijkGewicht The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterBySoortelijkGewicht($soortelijkGewicht = null, $comparison = null)
    {
        if (is_array($soortelijkGewicht)) {
            $useMinMax = false;
            if (isset($soortelijkGewicht['min'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::SOORTELIJK_GEWICHT, $soortelijkGewicht['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($soortelijkGewicht['max'])) {
                $this->addUsingAlias(GsGeneriekeNamenPeer::SOORTELIJK_GEWICHT, $soortelijkGewicht['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::SOORTELIJK_GEWICHT, $soortelijkGewicht, $comparison);
    }

    /**
     * Filter the query on the voorkeurseenheid column
     *
     * Example usage:
     *
     * $query->filterByVoorkeurseenheid('fooValue');   // WHERE voorkeurseenheid = 'fooValue'
     * $query->filterByVoorkeurseenheid('%fooValue%'); // WHERE voorkeurseenheid LIKE '%fooValue%'
     *
     *
     * @param     string $voorkeurseenheid The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByVoorkeurseenheid($voorkeurseenheid = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($voorkeurseenheid)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $voorkeurseenheid)) {
                $voorkeurseenheid = str_replace('*', '%', $voorkeurseenheid);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::VOORKEURSEENHEID, $voorkeurseenheid, $comparison);
    }

    /**
     * Filter the query on the kode_rijvaardigheid column
     *
     * Example usage:
     *
     * $query->filterByKodeRijvaardigheid('fooValue');   // WHERE kode_rijvaardigheid = 'fooValue'
     * $query->filterByKodeRijvaardigheid('%fooValue%'); // WHERE kode_rijvaardigheid LIKE '%fooValue%'
     *
     *
     * @param     string $kodeRijvaardigheid The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByKodeRijvaardigheid($kodeRijvaardigheid = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($kodeRijvaardigheid)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $kodeRijvaardigheid)) {
                $kodeRijvaardigheid = str_replace('*', '%', $kodeRijvaardigheid);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::KODE_RIJVAARDIGHEID, $kodeRijvaardigheid, $comparison);
    }

    /**
     * Filter the query on the kode_vergift column
     *
     * Example usage:
     *
     * $query->filterByKodeVergift('fooValue');   // WHERE kode_vergift = 'fooValue'
     * $query->filterByKodeVergift('%fooValue%'); // WHERE kode_vergift LIKE '%fooValue%'
     *
     *
     * @param     string $kodeVergift The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByKodeVergift($kodeVergift = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($kodeVergift)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $kodeVergift)) {
                $kodeVergift = str_replace('*', '%', $kodeVergift);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::KODE_VERGIFT, $kodeVergift, $comparison);
    }

    /**
     * Filter the query on the kode_opiumwet column
     *
     * Example usage:
     *
     * $query->filterByKodeOpiumwet('fooValue');   // WHERE kode_opiumwet = 'fooValue'
     * $query->filterByKodeOpiumwet('%fooValue%'); // WHERE kode_opiumwet LIKE '%fooValue%'
     *
     *
     * @param     string $kodeOpiumwet The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function filterByKodeOpiumwet($kodeOpiumwet = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($kodeOpiumwet)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $kodeOpiumwet)) {
                $kodeOpiumwet = str_replace('*', '%', $kodeOpiumwet);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(GsGeneriekeNamenPeer::KODE_OPIUMWET, $kodeOpiumwet, $comparison);
    }

    /**
     * Filter the query by a related GsIngegevenSamenstellingen object
     *
     * @param   GsIngegevenSamenstellingen|PropelObjectCollection $gsIngegevenSamenstellingen  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return                 GsGeneriekeNamenQuery The current query, for fluid interface
     * @throws PropelException - if the provided filter is invalid.
     */
    public function filterByGsIngegevenSamenstellingen($gsIngegevenSamenstellingen, $comparison = null)
    {
        if ($gsIngegevenSamenstellingen instanceof GsIngegevenSamenstellingen) {
            return $this
                ->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $gsIngegevenSamenstellingen->getGeneriekenaamkode(), $comparison);
        } elseif ($gsIngegevenSamenstellingen instanceof PropelObjectCollection) {
            return $this
                ->useGsIngegevenSamenstellingenQuery()
                ->filterByPrimaryKeys($gsIngegevenSamenstellingen->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByGsIngegevenSamenstellingen() only accepts arguments of type GsIngegevenSamenstellingen or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the GsIngegevenSamenstellingen relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function joinGsIngegevenSamenstellingen($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('GsIngegevenSamenstellingen');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'GsIngegevenSamenstellingen');
        }

        return $this;
    }

    /**
     * Use the GsIngegevenSamenstellingen relation GsIngegevenSamenstellingen object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   \PharmaIntelligence\GstandaardBundle\Model\GsIngegevenSamenstellingenQuery A secondary query class using the current class as primary query
     */
    public function useGsIngegevenSamenstellingenQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinGsIngegevenSamenstellingen($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'GsIngegevenSamenstellingen', '\PharmaIntelligence\GstandaardBundle\Model\GsIngegevenSamenstellingenQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   GsGeneriekeNamen $gsGeneriekeNamen Object to remove from the list of results
     *
     * @return GsGeneriekeNamenQuery The current query, for fluid interface
     */
    public function prune($gsGeneriekeNamen = null)
    {
        if ($gsGeneriekeNamen) {
            $this->addUsingAlias(GsGeneriekeNamenPeer::GENERIEKENAAMKODE, $gsGeneriekeNamen->getGeneriekenaamkode(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}


text:
package calculations;

import java.util.LinkedList;
import java.util.List;

import algorithms.random.RandomGenerator;
import algorithms.random.TerrainGenerator;
import junit.framework.Assert;

import org.junit.Test;
import org.mockito.Mockito;

import views.map.BTS;

import com.google.common.collect.Lists;

/**
 * Created by Ja on 30.03.14.
 */
public class TerrainGeneratorTest {
    @Test
    public void terrainWithNoBTSsHasNoSignal() {
        RandomGenerator gen = Mockito.mock(RandomGenerator.class);
        TerrainGenerator tGen = new TerrainGenerator();
        tGen.setRandomGenerator(gen);

        Terrain t = tGen.generateTerrain(null, null);
        Assert.assertEquals(t.getSignalLevel(PlacerLocation.getInstance(5, 5)), 0, 0.0001);
    }

    @Test
    public void terrainWithOneBTSsHasItsMaxSignalInOnePlace() {
        RandomGenerator gen = Mockito.mock(RandomGenerator.class);
        TerrainGenerator tGen = new TerrainGenerator();
        tGen.setRandomGenerator(gen);

        BTS bts = new BTS(null, BtsType.CIRCULAR);
        BTS spyBTS = Mockito.spy(bts);
        List<BTS> btsList = new LinkedList<BTS>();
        btsList.add(spyBTS);

        Mockito.when(spyBTS.getMaxSignalLevel()).thenReturn(100.0);
        Mockito.when(gen.getDouble(Mockito.any(Double.class))).thenReturn(5.0);

        Terrain t = tGen.generateTerrain(btsList, Lists.<SubscriberCenter>newArrayList());
        double baseX = PlacerLocation.getWroclawLocation().getX();
        double baseY = PlacerLocation.getWroclawLocation().getY();
        Assert.assertEquals(t.getSignalLevel(PlacerLocation.getInstance(baseX + 5d, baseY + 5d)),
                100.0, 0.0001);
    }
}


text:
;(function($){
    var numbers = [5, 3, 2, 1, 1];
    decompose = function(n){
        var result = numbers.reduce(function(result, element){
            if (element <= n){
                n -= element;
                result.push(element);
                return result;
            }
            return result;
        }, []);
        return {
            result: result,
            rest: n
        }
    }

    frequency = function(){
        return Array.prototype.slice.call(arguments).reduce(function(frequencies, elements){
            elements.forEach(function(element){
                if (!frequencies[element]) {
                    frequencies[element] = 0;
                }
                frequencies[element] += 1;
            });
            return frequencies;
        }, {});
    }

    var Clock = $.Clock = function(){
        this.update();
    };
    Clock.prototype.update = function(date){
        date = new Date();
        this.hour = date.getHours() > 12 ? date.getHours() - 12: date.getHours();
        this.minutes = Math.floor(date.getMinutes() / 10);
    };

    var View = $.ClockView = function(model, canvas){
        this.model = model;
        this.canvas = canvas;
        this.context = canvas.getContext('2d');
        this.update();
    };
    View.prototype.update = function(){
        var width = this.canvas.width; var height = this.canvas.height;
        var hourFrequency = frequency(decompose(this.model.hour).result);
        var minutesFrequency = frequency(decompose(this.model.minutes).result);
        this.fill5With(this.colorFor(hourFrequency[5],minutesFrequency[5]));
        this.fill3With(this.colorFor(hourFrequency[3],minutesFrequency[3]));
        this.fill2With(this.colorFor(hourFrequency[2],minutesFrequency[2]));
        this.fillBWith(this.model.hour === 12 ? 'red': 'white');
        this.fillAWith(this.colorFor(hourFrequency[1],minutesFrequency[1]));
    };
    View.prototype.fill5With = function(color){
        var width = this.canvas.width; var height = this.canvas.height;
        this.fill(width - height, 0, height, color)
    };
    View.prototype.fill = function(x, y, size, color){
        this.context.fillStyle = color;
        this.context.fillRect(x, y, size, size);
    };
    View.prototype.fill3With = function(color){
        var width = this.canvas.width; var height = this.canvas.height;
        this.fill(0, 2*height - width, width - height, color)
    };
    View.prototype.fill2With = function(color){
        var width = this.canvas.width; var height = this.canvas.height;
        this.fill(0, 0, 2*height - width, color)
    };
    View.prototype.fillBWith = function(color){
        var width = this.canvas.width; var height = this.canvas.height;
        this.fill(2*height - width, 0, 2*width - 3*height, color)
    };
    View.prototype.fillAWith = function(color){
        var width = this.canvas.width; var height = this.canvas.height;
        this.fill(2*height - width, 2*width - 3*height, 2*width - 3*height, color)
    };
    View.prototype.colorFor = function(hour, minutes){
        hour = hour || 0; minutes = minutes || 0;
        if (hour === 0 && minutes === 0) {
            return 'white';
        }
        if (hour > 0 && minutes === 0) {
            return 'red';
        }
        if (hour === 0 && minutes > 0) {
            return 'blue';
        }
        if (hour > 0 && minutes > 0) {
            return 'green';
        }
    };
})(window.fibonacci = window.fibonacci || {});