text:
from otp.ai.AIBaseGlobal import *
from direct.distributed.ClockDelta import *
import types
from direct.task.Task import Task
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObjectAI
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.toonbase.ToontownGlobals import ToonHall
import DistributedToonInteriorAI
import DistributedToonHallInteriorAI
import DistributedSuitInteriorAI
import DistributedDoorAI
import DoorTypes
import DistributedElevatorExtAI
import DistributedKnockKnockDoorAI
import SuitPlannerInteriorAI
import SuitBuildingGlobals
import FADoorCodes
from toontown.hood import ZoneUtil
import random
import time

from toontown.cogdominium.DistributedCogdoInteriorAI import DistributedCogdoInteriorAI
from toontown.cogdominium.SuitPlannerCogdoInteriorAI import SuitPlannerCogdoInteriorAI
from toontown.cogdominium.CogdoLayout import CogdoLayout
from toontown.cogdominium.DistributedCogdoElevatorExtAI import DistributedCogdoElevatorExtAI

class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):

    def __init__(self, air, blockNumber, zoneId, trophyMgr):
        DistributedObjectAI.DistributedObjectAI.__init__(self, air)
        self.block = blockNumber
        self.zoneId = zoneId
        self.canonicalZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
        self.trophyMgr = trophyMgr
        self.victorResponses = None
        self.fsm = ClassicFSM.ClassicFSM('DistributedBuildingAI', [State.State('off', self.enterOff, self.exitOff, ['waitForVictors',
          'becomingToon',
          'toon',
          'clearOutToonInterior',
          'becomingSuit',
          'suit',
          'clearOutToonInteriorForCogdo',
          'becomingCogdo',
          'cogdo']),
         State.State('waitForVictors', self.enterWaitForVictors, self.exitWaitForVictors, ['becomingToon']),
         State.State('waitForVictorsFromCogdo', self.enterWaitForVictorsFromCogdo, self.exitWaitForVictorsFromCogdo, ['becomingToonFromCogdo']),
         State.State('becomingToon', self.enterBecomingToon, self.exitBecomingToon, ['toon']),
         State.State('becomingToonFromCogdo', self.enterBecomingToonFromCogdo, self.exitBecomingToonFromCogdo, ['toon']),
         State.State('toon', self.enterToon, self.exitToon, ['clearOutToonInterior', 'clearOutToonInteriorForCogdo']),
         State.State('clearOutToonInterior', self.enterClearOutToonInterior, self.exitClearOutToonInterior, ['becomingSuit']),
         State.State('becomingSuit', self.enterBecomingSuit, self.exitBecomingSuit, ['suit']),
         State.State('suit', self.enterSuit, self.exitSuit, ['waitForVictors', 'becomingToon']),
         State.State('clearOutToonInteriorForCogdo', self.enterClearOutToonInteriorForCogdo, self.exitClearOutToonInteriorForCogdo, ['becomingCogdo']),
         State.State('becomingCogdo', self.enterBecomingCogdo, self.exitBecomingCogdo, ['cogdo']),
         State.State('cogdo', self.enterCogdo, self.exitCogdo, ['waitForVictorsFromCogdo', 'becomingToonFromCogdo'])], 'off', 'off')
        self.fsm.enterInitialState()
        self.track = 'c'
        self.difficulty = 1
        self.numFloors = 0
        self.savedBy = None
        self.becameSuitTime = 0
        self.frontDoorPoint = None
        self.suitPlannerExt = None
        return

    def cleanup(self):
        if self.isDeleted():
            return
        self.fsm.requestFinalState()
        if hasattr(self, 'interior'):
            self.interior.requestDelete()
            del self.interior
        if hasattr(self, 'door'):
            self.door.requestDelete()
            del self.door
            self.insideDoor.requestDelete()
            del self.insideDoor
            self.knockKnock.requestDelete()
            del self.knockKnock
        if hasattr(self, 'elevator'):
            self.elevator.requestDelete()
            del self.elevator
        self.requestDelete()

    def delete(self):
        self.cleanup()
        taskMgr.remove(self.taskName('suitbldg-time-out'))
        taskMgr.remove(self.taskName(str(self.block) + '_becomingToon-timer'))
        taskMgr.remove(self.taskName(str(self.block) + '_becomingSuit-timer'))
        DistributedObjectAI.DistributedObjectAI.delete(self)
        del self.fsm

    def getPickleData(self):
        pickleData = {'state': str(self.fsm.getCurrentState().getName()),
         'block': str(self.block),
         'track': str(self.track),
         'difficulty': str(self.difficulty),
         'numFloors': str(self.numFloors),
         'savedBy': self.savedBy,
         'becameSuitTime': self.becameSuitTime}
        return pickleData

    def _getMinMaxFloors(self, difficulty):
        return SuitBuildingGlobals.SuitBuildingInfo[difficulty][0]

    def suitTakeOver(self, suitTrack, difficulty, buildingHeight):
        if not self.isToonBlock():
            return
        self.updateSavedBy(None)
        difficulty = min(difficulty, len(SuitBuildingGlobals.SuitBuildingInfo) - 1)
        minFloors, maxFloors = self._getMinMaxFloors(difficulty)
        if buildingHeight == None:
            numFloors = random.randint(minFloors, maxFloors)
        else:
            numFloors = buildingHeight + 1
            if numFloors < minFloors or numFloors > maxFloors:
                numFloors = random.randint(minFloors, maxFloors)
        self.track = suitTrack
        self.difficulty = difficulty
        self.numFloors = numFloors
        self.becameSuitTime = time.time()
        self.fsm.request('clearOutToonInterior')
        return

    def cogdoTakeOver(self, difficulty, buildingHeight, track = 's'):
        if not self.isToonBlock():
            return None

        self.updateSavedBy(None)
        (minFloors, maxFloors) = self._getMinMaxFloors(difficulty)
        if buildingHeight == None:
            numFloors = random.randint(minFloors, maxFloors)
        else:
            numFloors = buildingHeight + 1
            if numFloors < minFloors or numFloors > maxFloors:
                numFloors = random.randint(minFloors, maxFloors)

        self.track = track
        self.realTrack = track
        self.difficulty = difficulty
        self.numFloors = numFloors
        self.becameSuitTime = time.time()
        self.fsm.request('clearOutToonInteriorForCogdo')

    def toonTakeOver(self):
        if 'cogdo' in self.fsm.getCurrentState().getName().lower():
            self.fsm.request('becomingToonFromCogdo')
        else:
            self.fsm.request('becomingToon')
        if self.suitPlannerExt:
            self.suitPlannerExt.recycleBuilding()
        if hasattr(self, 'interior'):
            self.interior.requestDelete()
            del self.interior

    def getFrontDoorPoint(self):
        return self.frontDoorPoint

    def setFrontDoorPoint(self, point):
        self.frontDoorPoint = point

    def getBlock(self):
        dummy, interiorZoneId = self.getExteriorAndInteriorZoneId()
        return [self.block, interiorZoneId]

    def getSuitData(self):
        return [ord(self.track), self.difficulty, self.numFloors]

    def getState(self):
        return [self.fsm.getCurrentState().getName(), globalClockDelta.getRealNetworkTime()]

    def setState(self, state, timestamp = 0):
        self.fsm.request(state)

    def isSuitBuilding(self):
        state = self.fsm.getCurrentState().getName()
        return state == 'suit' or state == 'becomingSuit' or state == 'clearOutToonInterior'

    def isCogdo(self):
        state = self.fsm.getCurrentState().getName()
        return state == 'cogdo' or state == 'becomingCogdo' or state == 'clearOutToonInteriorForCogdo'

    def isSuitBlock(self):
        state = self.fsm.getCurrentState().getName()
        return self.isSuitBuilding() or self.isCogdo()

    def isEstablishedSuitBlock(self):
        state = self.fsm.getCurrentState().getName()
        return state == 'suit'

    def isEstablishedCogdoBlock(self):
        state = self.fsm.getCurrentState().getName()
        return state == 'cogdo'

    def isToonBlock(self):
        state = self.fsm.getCurrentState().getName()
        return state in ('toon', 'becomingToon', 'becomingToonFromCogdo')

    def getExteriorAndInteriorZoneId(self):
        blockNumber = self.block
        dnaStore = self.air.dnaStoreMap[self.canonicalZoneId]
        zoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
        zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
        interiorZoneId = (zoneId - (zoneId%100)) + 500 + blockNumber
        return (zoneId, interiorZoneId)

    def d_setState(self, state):
        self.sendUpdate('setState', [state, globalClockDelta.getRealNetworkTime()])

    def b_setVictorList(self, victorList):
        self.setVictorList(victorList)
        self.d_setVictorList(victorList)

    def d_setVictorList(self, victorList):
        self.sendUpdate('setVictorList', [victorList])

    def setVictorList(self, victorList):
        self.victorList = victorList

    def findVictorIndex(self, avId):
        for i in range(len(self.victorList)):
            if self.victorList[i] == avId:
                return i

        return None

    def recordVictorResponse(self, avId):
        index = self.findVictorIndex(avId)
        if index == None:
            self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedBuildingAI.setVictorReady from toon not in %s.' % self.victorList)
            return
        self.victorResponses[index] = avId
        return

    def allVictorsResponded(self):
        if self.victorResponses == self.victorList:
            return 1
        else:
            return 0

    def setVictorReady(self):
        avId = self.air.getAvatarIdFromSender()
        if self.victorResponses == None:
            self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedBuildingAI.setVictorReady in state %s.' % self.fsm.getCurrentState().getName())
            return
        self.recordVictorResponse(avId)
        event = self.air.getAvatarExitEvent(avId)
        self.ignore(event)
        if self.allVictorsResponded():
            self.toonTakeOver()
        return

    def setVictorExited(self, avId):
        print 'victor %d exited unexpectedly for bldg %d' % (avId, self.doId)
        self.recordVictorResponse(avId)
        if self.allVictorsResponded():
            self.toonTakeOver()

    def enterOff(self):
        pass

    def exitOff(self):
        pass

    def getToon(self, toonId):
        if self.air.doId2do.has_key(toonId):
            return self.air.doId2do[toonId]
        else:
            self.notify.warning('getToon() - toon: %d not in repository!' % toonId)
        return None

    def updateSavedBy(self, savedBy):
        if self.savedBy:
            for avId, name, dna in self.savedBy:
                if not ZoneUtil.isWelcomeValley(self.zoneId):
                    self.trophyMgr.removeTrophy(avId, self.numFloors)

        self.savedBy = savedBy
        if self.savedBy:
            for avId, name, dna in self.savedBy:
                if not ZoneUtil.isWelcomeValley(self.zoneId):
                    self.trophyMgr.addTrophy(avId, name, self.numFloors)

    def enterWaitForVictors(self, victorList, savedBy):
        activeToons = []
        for t in victorList:
            toon = None
            if t:
                toon = self.getToon(t)
            if toon != None:
                activeToons.append(toon)

        for t in victorList:
            toon = None
            if t:
                toon = self.getToon(t)
                self.air.writeServerEvent('building-defeated', avId=t, track=self.track, numFloors=self.numFloors, zoneId=self.zoneId, victorList='%s' % victorList)
            if toon != None:
                self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons)

        for i in range(0, 4):
            victor = victorList[i]
            if victor == None or not self.air.doId2do.has_key(victor):
                victorList[i] = 0
            else:
                event = self.air.getAvatarExitEvent(victor)
                self.accept(event, self.setVictorExited, extraArgs=[victor])

        self.b_setVictorList(victorList)
        self.updateSavedBy(savedBy)
        self.victorResponses = [0,
         0,
         0,
         0]
        self.d_setState('waitForVictors')
        return

    def exitWaitForVictors(self):
        self.victorResponses = None
        for victor in self.victorList:
            event = simbase.air.getAvatarExitEvent(victor)
            self.ignore(event)

        return

    def enterWaitForVictorsFromCogdo(self, victorList, savedBy):
        activeToons = []
        for t in victorList:
            toon = None
            if t:
                toon = self.getToon(t)

            if toon != None:
                activeToons.append(toon)
                continue

        for t in victorList:
            toon = None
            if t:
                toon = self.getToon(t)
                self.air.writeServerEvent('building-defeated', avId=t, track=self.track, numFloors=self.numFloors, zoneId=self.zoneId, victorList='%s' % victorList)

            if toon != None:
                # Time to get the right number of floors
                if self.track == 'l':
                    cogdoNumFloors = 3
                else:
                    cogdoNumFloors = 2
                self.air.questManager.toonKilledCogdo(toon, self.track, self.difficulty, self.zoneId, activeToons)
                self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, cogdoNumFloors, self.zoneId, activeToons)
                continue

        victorList.extend([None, None, None, None])
        for i in range(0, 4):
            victor = victorList[i]
            if victor == None or not self.air.doId2do.has_key(victor):
                victorList[i] = 0
                continue
            event = self.air.getAvatarExitEvent(victor)
            self.accept(event, self.setVictorExited, extraArgs = [
                victor])

        self.b_setVictorList(victorList[:4])
        self.updateSavedBy(savedBy)
        self.victorResponses = [
            0,
            0,
            0,
            0]
        self.d_setState('waitForVictorsFromCogdo')

    def exitWaitForVictorsFromCogdo(self):
        self.victorResponses = None
        for victor in self.victorList:
            event = simbase.air.getAvatarExitEvent(victor)
            self.ignore(event)

    def enterBecomingToon(self):
        self.d_setState('becomingToon')
        name = self.taskName(str(self.block) + '_becomingToon-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.VICTORY_SEQUENCE_TIME, self.becomingToonTask, name)

    def exitBecomingToon(self):
        name = self.taskName(str(self.block) + '_becomingToon-timer')
        taskMgr.remove(name)

    def enterBecomingToonFromCogdo(self):
        self.d_setState('becomingToonFromCogdo')
        name = self.taskName(str(self.block) + '_becomingToonFromCogdo-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.VICTORY_SEQUENCE_TIME, self.becomingToonTask, name)

    def exitBecomingToonFromCogdo(self):
        name = self.taskName(str(self.block) + '_becomingToonFromCogdo-timer')
        taskMgr.remove(name)

    def becomingToonTask(self, task):
        self.fsm.request('toon')
        self.suitPlannerExt.buildingMgr.save()
        return Task.done

    def enterToon(self):
        self.d_setState('toon')
        exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId()
        if config.GetBool('want-new-toonhall', 0) and ZoneUtil.getCanonicalZoneId(interiorZoneId) == ToonHall:
            self.interior = DistributedToonHallInteriorAI.DistributedToonHallInteriorAI(self.block, self.air, interiorZoneId, self)
        else:
            self.interior = DistributedToonInteriorAI.DistributedToonInteriorAI(self.block, self.air, interiorZoneId, self)
        self.interior.generateWithRequired(interiorZoneId)
        door = self.createExteriorDoor()
        insideDoor = DistributedDoorAI.DistributedDoorAI(self.air, self.block, DoorTypes.INT_STANDARD)
        door.setOtherDoor(insideDoor)
        insideDoor.setOtherDoor(door)
        door.zoneId = exteriorZoneId
        insideDoor.zoneId = interiorZoneId
        door.generateWithRequired(exteriorZoneId)
        insideDoor.generateWithRequired(interiorZoneId)
        self.door = door
        self.insideDoor = insideDoor
        self.becameSuitTime = 0
        self.knockKnock = DistributedKnockKnockDoorAI.DistributedKnockKnockDoorAI(self.air, self.block)
        self.knockKnock.generateWithRequired(exteriorZoneId)
        self.air.writeServerEvent('building-toon', buildingId=self.doId, zoneId=self.zoneId, block=self.block)

    def createExteriorDoor(self):
        result = DistributedDoorAI.DistributedDoorAI(self.air, self.block, DoorTypes.EXT_STANDARD)
        return result

    def exitToon(self):
        self.door.setDoorLock(FADoorCodes.BUILDING_TAKEOVER)

    def enterClearOutToonInterior(self):
        self.d_setState('clearOutToonInterior')
        if hasattr(self, 'interior'):
            self.interior.setState('beingTakenOver')
        name = self.taskName(str(self.block) + '_clearOutToonInterior-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.CLEAR_OUT_TOON_BLDG_TIME, self.clearOutToonInteriorTask, name)

    def exitClearOutToonInterior(self):
        name = self.taskName(str(self.block) + '_clearOutToonInterior-timer')
        taskMgr.remove(name)

    def clearOutToonInteriorTask(self, task):
        self.fsm.request('becomingSuit')
        return Task.done

    def enterBecomingSuit(self):
        self.sendUpdate('setSuitData', [ord(self.track), self.difficulty, self.numFloors])
        self.d_setState('becomingSuit')
        name = self.taskName(str(self.block) + '_becomingSuit-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.TO_SUIT_BLDG_TIME, self.becomingSuitTask, name)

    def exitBecomingSuit(self):
        name = self.taskName(str(self.block) + '_becomingSuit-timer')
        taskMgr.remove(name)
        if hasattr(self, 'interior'):
            self.interior.requestDelete()
            del self.interior
            self.door.requestDelete()
            del self.door
            self.insideDoor.requestDelete()
            del self.insideDoor
            self.knockKnock.requestDelete()
            del self.knockKnock

    def becomingSuitTask(self, task):
        self.fsm.request('suit')
        self.suitPlannerExt.buildingMgr.save()
        return Task.done

    def enterSuit(self):
        self.sendUpdate('setSuitData', [ord(self.track), self.difficulty, self.numFloors])
        zoneId, interiorZoneId = self.getExteriorAndInteriorZoneId()
        self.planner = SuitPlannerInteriorAI.SuitPlannerInteriorAI(self.numFloors, self.difficulty, self.track, interiorZoneId)
        self.d_setState('suit')
        exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId()
        self.elevator = DistributedElevatorExtAI.DistributedElevatorExtAI(self.air, self)
        self.elevator.generateWithRequired(exteriorZoneId)
        self.air.writeServerEvent('building-cog', buildingId=self.doId, zoneId=self.zoneId, block=self.block, track=self.track, numFloors=self.numFloors)

    def exitSuit(self):
        del self.planner
        if hasattr(self, 'elevator'):
            self.elevator.requestDelete()
            del self.elevator

    def enterClearOutToonInteriorForCogdo(self):
        self.d_setState('clearOutToonInteriorForCogdo')
        if hasattr(self, 'interior'):
            self.interior.setState('beingTakenOver')
        name = self.taskName(str(self.block) + '_clearOutToonInteriorForCogdo-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.CLEAR_OUT_TOON_BLDG_TIME, self.clearOutToonInteriorForCogdoTask, name)

    def exitClearOutToonInteriorForCogdo(self):
        name = self.taskName(str(self.block) + '_clearOutToonInteriorForCogdo-timer')
        taskMgr.remove(name)

    def clearOutToonInteriorForCogdoTask(self, task):
        self.fsm.request('becomingCogdo')
        return Task.done

    def enterBecomingCogdo(self):
        self.sendUpdate('setSuitData', [
            ord(self.realTrack),
            self.difficulty,
            self.numFloors])
        self.d_setState('becomingCogdo')
        name = self.taskName(str(self.block) + '_becomingCogdo-timer')
        taskMgr.doMethodLater(SuitBuildingGlobals.TO_SUIT_BLDG_TIME, self.becomingCogdoTask, name)

    def exitBecomingCogdo(self):
        name = self.taskName(str(self.block) + '_becomingCogdo-timer')
        taskMgr.remove(name)
        if hasattr(self, 'interior'):
            self.interior.requestDelete()
            del self.interior
            self.door.requestDelete()
            del self.door
            self.insideDoor.requestDelete()
            del self.insideDoor
            self.knockKnock.requestDelete()
            del self.knockKnock

    def becomingCogdoTask(self, task):
        self.fsm.request('cogdo')
        self.suitPlannerExt.buildingMgr.save()
        return Task.done

    def enterCogdo(self):
        self.sendUpdate('setSuitData', [
            ord(self.realTrack),
            self.difficulty,
            self.numFloors])
        (zoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId()
        self._cogdoLayout = CogdoLayout(self.numFloors)
        self.planner = SuitPlannerCogdoInteriorAI(self._cogdoLayout, self.difficulty, self.track, interiorZoneId)
        self.d_setState('cogdo')
        (exteriorZoneId, interiorZoneId) = self.getExteriorAndInteriorZoneId()
        self.elevator = DistributedCogdoElevatorExtAI(self.air, self)
        self.elevator.generateWithRequired(exteriorZoneId)
        self.air.writeServerEvent('building-cogdo', buildingId=self.doId, zoneId=self.zoneId, block=self.block, numFloors=self.numFloors)

    def exitCogdo(self):
        del self.planner
        if hasattr(self, 'elevator'):
            self.elevator.requestDelete()
            del self.elevator

    def setSuitPlannerExt(self, planner):
        self.suitPlannerExt = planner

    def _createSuitInterior(self):
        return DistributedSuitInteriorAI.DistributedSuitInteriorAI(self.air, self.elevator)

    def _createCogdoInterior(self):
        return DistributedCogdoInteriorAI(self.air, self)

    def createSuitInterior(self):
        self.interior = self._createSuitInterior()
        dummy, interiorZoneId = self.getExteriorAndInteriorZoneId()
        self.interior.fsm.request('WaitForAllToonsInside')
        self.interior.generateWithRequired(interiorZoneId)

    def createCogdoInterior(self):
        self.interior = self._createCogdoInterior()
        (dummy, interiorZoneId) = self.getExteriorAndInteriorZoneId()
        self.interior.generateWithRequired(interiorZoneId)
        self.interior.b_setState('WaitForAllToonsInside')

    def deleteSuitInterior(self):
        if hasattr(self, 'interior'):
            self.interior.requestDelete()
            del self.interior
        if hasattr(self, 'elevator'):
            self.elevator.d_setFloor(-1)
            self.elevator.open()

    def deleteCogdoInterior(self):
        self.deleteSuitInterior()


text:
package com.adaptris.core.services.conditional.operator;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.DefaultMessageFactory;
import com.adaptris.core.services.conditional.Operator;
import com.adaptris.core.services.conditional.operator.IsNull;

public class IsNullTest {

  private Operator operator;

  private AdaptrisMessage message;

  @Before
  public void setUp() throws Exception {
    operator = new IsNull();
    message = DefaultMessageFactory.getDefaultInstance().newMessage();
  }

  @Test
  public void testExists() {
    assertFalse(operator.apply(message, "1"));
  }

  @Test
  public void testNotExists() {
    assertTrue(operator.apply(message, null));
  }

  @Test
  public void testToString() {
    assertTrue(operator.toString().contains("is null"));
  }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * \file md5.h
 *
 *  Based on XySSL: Copyright (C) 2006-2008  Christophe Devine
 *
 *  Copyright (C) 2009  Paul Bakker <polarssl_maintainer at polarssl dot org>
 *
 *  All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    * Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *    * Neither the names of PolarSSL or XySSL nor the names of its contributors
 *      may be used to endorse or promote products derived from this software
 *      without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "netif/ppp/ppp_opts.h"
#if LWIP_INCLUDED_POLARSSL_MD5

#ifndef LWIP_INCLUDED_POLARSSL_MD5_H
#define LWIP_INCLUDED_POLARSSL_MD5_H

/**
 * \brief          MD5 context structure
 */
typedef struct {
	unsigned long total[2];		/*!< number of bytes processed  */
	unsigned long state[4];		/*!< intermediate digest state  */
	unsigned char buffer[64];	/*!< data block being processed */
} md5_context;

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \brief          MD5 context setup
 *
 * \param ctx      context to be initialized
 */
void md5_starts(md5_context * ctx);

/**
 * \brief          MD5 process buffer
 *
 * \param ctx      MD5 context
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 */
void md5_update(md5_context * ctx, const unsigned char *input, int ilen);

/**
 * \brief          MD5 final digest
 *
 * \param ctx      MD5 context
 * \param output   MD5 checksum result
 */
void md5_finish(md5_context * ctx, unsigned char output[16]);

/**
 * \brief          Output = MD5( input buffer )
 *
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 * \param output   MD5 checksum result
 */
void md5(unsigned char *input, int ilen, unsigned char output[16]);

#ifdef __cplusplus
}
#endif
#endif							/* LWIP_INCLUDED_POLARSSL_MD5_H */
#endif							/* LWIP_INCLUDED_POLARSSL_MD5 */


text:
fcm-node [![NPM version](https://badge.fury.io/js/fcm-node.svg)](http://badge.fury.io/js/fcm-node)
========
A Node.JS simple interface to Google's Firebase Cloud Messaging (FCM). Supports both android and iOS, including topic messages, and parallel calls.
## Installation

Via [npm][1]:

    $ npm install fcm-node

## Usage

    var FCM = require('fcm-node');

    var serverKey = '';
    var fcm = new FCM(serverKey);

    var message = { //this may vary according to the message type (single recipient, multicast, topic, et cetera)
        to: 'registration_token',
        collapse_key: 'your_collapse_key',

        notification: {
            title: 'Title of your push notification',
            body: 'Body of your push notification'
        },

        data: {  //you can send only notification or only data(or include both)
            my_key: 'my value',
            my_another_key: 'my another value'
        }
    };

    fcm.send(message, function(err, response){
        if (err) {
            console.log("Something has gone wrong!");
        } else {
            console.log("Successfully sent with response: ", response);
        }
    });

## Notes
* See [FCM documentation][2] for general details.
* See [Firebase Cloud Messaging HTTP Protocol][10] for details about the HTTP syntax used and JSON fields, notification and data objects. **(STRONGLY RECOMMENDED)**
* On **iOS**, set **content_available** when the app server needs to send a Send-to-Sync message. An inactive client app executes your logic in the background, while an app in the foreground passes the message to **didReceiveRemoteNotification**. (As seen in [FCM Docs][8])
* Some **iOS** users report a delay receiving the notifications and even a **'not receive at all'** scenario if the **priority** field is not set. This is due to a delivery policy with **APN** ([See APNs Provider API for a more detailed info][9])

## Credits

Extended by [Leonardo Pereira][3].
Based on the great work on [fcm-push][7] by [Rasmunandar Rustam][4] cloned and modified from there, which in its turn, was cloned and modified from [Changshin Lee][5]'s [node-gcm][5]

## License

[MIT][6]

[1]: http://github.com/isaacs/npm
[2]: https://firebase.google.com/docs/cloud-messaging/server
[3]: mailto:jlcvp@cin.ufpe.br
[4]: mailto:nandar.rustam@gmail.com
[5]: https://github.com/h2soft/node-gcm
[6]: https://opensource.org/licenses/MIT
[7]: https://github.com/nandarustam/fcm-push
[8]: https://firebase.google.com/docs/cloud-messaging/concept-options
[9]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW2
[10]: https://firebase.google.com/docs/cloud-messaging/http-server-ref

## Changelog
1.0.14 - Added example file to quick tests

1.0.13 - Added a error response in case of TopicsMessageRateExceeded response

1.0.12 - Refactored the client removing the Event Emitter's Logic to fix concurrency issues. Using pure callbacks now also avoids memory leak in specific scenarios with lots of parallel calls to send function.

1.0.11 - \<FIX\> send function returning error objects when multicast messages (or individually targeted) returned both error and success keys on response message (even with error counter = 0 )

1.0.9 - Updated Documentation

1.0.8 - \<FIX\> 'icon' field no longer required in notification

1.0.7 - renaming repository

1.0.6 - bugfix: send function was always returning an error object for multicast messages (multiple registration ids)

1.0.5 - bugfix with UTF-8 enconding and chunk-encoded transfers

1.0.1 - forked from fcm-push and extended to accept topic messages without errors


text:
<?php
namespace Gratheon\Entity;

class Response {
	public function __construct($data = [], $success = true) {
		$this->data    = $data;
		$this->success = $success;
	}

	public function __toString() {
		return json_encode([
			'success' => $this->success,
			'data'    => $this->data
		], JSON_UNESCAPED_UNICODE);
	}
}


text:
#ifndef ewk_context_private_h
#define ewk_context_private_h

#include "DownloadManagerEfl.h"
#include "WKAPICast.h"
#include "WKRetainPtr.h"
#include "WebContext.h"
#include "ewk_context.h"
#include "ewk_object_private.h"

using namespace WebKit;

class EwkCookieManager;
class EwkFaviconDatabase;

namespace WebKit {
class ContextHistoryClientEfl;
class RequestManagerClientEfl;
#if ENABLE(BATTERY_STATUS)
class BatteryProvider;
#endif
#if ENABLE(NETWORK_INFO)
class NetworkInfoProvider;
#endif
}

class EwkContext : public EwkObject {
public:
    EWK_OBJECT_DECLARE(EwkContext)

    static PassRefPtr<EwkContext> create(PassRefPtr<WebContext> context);
    static PassRefPtr<EwkContext> create();
    static PassRefPtr<EwkContext> create(const String& injectedBundlePath);

    static PassRefPtr<EwkContext> defaultContext();

    ~EwkContext();

    Ewk_Cookie_Manager* cookieManager();

    Ewk_Database_Manager* databaseManager();

    bool setFaviconDatabaseDirectoryPath(const String& databaseDirectory);
    Ewk_Favicon_Database* faviconDatabase();

    Ewk_Storage_Manager* storageManager() const;

    WebKit::RequestManagerClientEfl* requestManager();

    void addVisitedLink(const String& visitedURL);

    void setCacheModel(Ewk_Cache_Model);

    Ewk_Cache_Model cacheModel() const;

    PassRefPtr<WebContext> webContext() { return m_context; }

    WebKit::DownloadManagerEfl* downloadManager() const;

    WebKit::ContextHistoryClientEfl* historyClient();

#if ENABLE(NETSCAPE_PLUGIN_API)
    void setAdditionalPluginPath(const String&);
#endif

private:
    explicit EwkContext(PassRefPtr<WebContext>);

    void ensureFaviconDatabase();

    RefPtr<WebContext> m_context;

    OwnPtr<Ewk_Cookie_Manager> m_cookieManager;
    OwnPtr<Ewk_Database_Manager> m_databaseManager;
    OwnPtr<Ewk_Favicon_Database> m_faviconDatabase;
    OwnPtr<Ewk_Storage_Manager> m_storageManager;
#if ENABLE(BATTERY_STATUS)
    RefPtr<WebKit::BatteryProvider> m_batteryProvider;
#endif
#if ENABLE(NETWORK_INFO)
    RefPtr<WebKit::NetworkInfoProvider> m_networkInfoProvider;
#endif
    OwnPtr<WebKit::DownloadManagerEfl> m_downloadManager;
    OwnPtr<WebKit::RequestManagerClientEfl> m_requestManagerClient;

    OwnPtr<WebKit::ContextHistoryClientEfl> m_historyClient;
};

#endif // ewk_context_private_h


text:
'use strict';

var babel = require('gulp-babel');
var config = require('../config');
var eslint = require('gulp-eslint');
var gulp = require('gulp');
var react = require('gulp-react');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');

module.exports = gulp.task('scripts-build', function () {
    var src = config.plugins.concat(config.src);

    return gulp.src(src)
        .pipe(eslint({ useEslintrc: true }))
        .pipe(eslint.format())
        .pipe(eslint.failAfterError())
        .pipe(babel({ modules: 'amd', blacklist: ['strict']}))
        .pipe(react())
        .pipe(uglify())
        .pipe(rename(config.build.app))
        .pipe(gulp.dest(config.dist));
});


text:
<readable><title>3432730942_4dc4685277</title><content>
Two men getting ready to take a motorcycle ride .
Two men park their red motorcycles near a church .
Two motorcycles and their riders .
Two people dressed in leather are standing beside their motorcycles .
Two people look at two red motorcycles in a place where there are religious murals on the wall .
</content></readable>


text:
/* jshint -W097, -W079 */

"use strict";

var gulp = require("gulp");
var jshint = require("gulp-jshint");
var jscs = require("gulp-jscs");

var f = global.scripts.files;

var files = f.core.sources
    .concat(f.knockout.bindings.sources)
    .concat(f.knockout.debugging.sources)
    .concat(f.knockout.observableArray.sources)
    .concat(f.knockout.spa.sources)
    .concat(f.knockout.spa.es6.sources)
    .concat(f.knockout.spa.services.sources);

// ---------------------------------

gulp.task("cs", function() {
    return gulp
        .src(files)
        .pipe(jscs());
});

gulp.task("lint", function() {
    var reporterName = "jshint-summary";

    if (global.isTeamCity) {
        reporterName = "jshint-teamcity";
    } else if (global.isVisualStudio) {
        reporterName = "jshint-visual-studio";
    }

    var reporterOptions = {
        verbose: true,
        reasonCol: "cyan,bold"
    };

    return gulp
        .src(files)
        .pipe(jshint())
        .pipe(jshint.reporter(reporterName, reporterOptions))
        .pipe(jshint.reporter("fail"));
});


text:
package com.glob3mobile.vectorial.processing;

import java.awt.Color;
import java.io.File;
import java.io.IOException;

import com.glob3mobile.geo.Sector;
import com.glob3mobile.utils.Progress;
import com.glob3mobile.vectorial.lod.PointFeatureLODStorage;
import com.glob3mobile.vectorial.lod.mapdb.PointFeatureLODMapDBStorage;
import com.glob3mobile.vectorial.storage.PointFeature;
import com.glob3mobile.vectorial.storage.PointFeatureCluster;
import com.glob3mobile.vectorial.utils.GEOBitmap;

public class LODPointFeaturesStatistics {

   public static final class LODDrawer
      implements
         PointFeatureLODStorage.NodeVisitor {

      private final PointFeatureLODStorage _clusterStorage;
      private final int                    _nodesCount;
      private final int                    _minDepth;
      private final int                    _maxDepth;
      private final long                   _featuresCount;

      private Progress                     _progress;
      private GEOBitmap                    _bitmap;

      private LODDrawer(final PointFeatureLODStorage clusterStorage,
                        final int nodesCount,
                        final int minDepth,
                        final int maxDepth,
                        final long featuresCount) {
         _clusterStorage = clusterStorage;
         _nodesCount = nodesCount;
         _minDepth = minDepth;
         _maxDepth = maxDepth;
         _featuresCount = featuresCount;
      }

      @Override
      public void start() {
         _progress = new Progress(_nodesCount) {
            @Override
            public void informProgress(final long stepsDone,
                                       final double percent,
                                       final long elapsed,
                                       final long estimatedMsToFinish) {
               System.out.println(_clusterStorage.getName() + " [" + _minDepth + "-" + _maxDepth + "] - Processing: "
                                  + progressString(stepsDone, percent, elapsed, estimatedMsToFinish));
            }
         };

         final int width = 2048;
         final Sector sector = _clusterStorage.getSector();
         // final Sector sector = Sector.FULL_SPHERE;
         final double sectorFactor = sector._deltaLatitude._radians / sector._deltaLongitude._radians;
         final int height = Math.round((float) sectorFactor * width);
         _bitmap = new GEOBitmap(sector, width, height, Color.BLACK);
      }

      @Override
      public void stop() {
         try {
            _bitmap.save(new File("LOD_" + _clusterStorage.getName() + "_" + _minDepth + "-" + _maxDepth + ".png"));
         }
         catch (final IOException e) {
            throw new RuntimeException(e);
         }
         _bitmap = null;

         _progress.finish();
         _progress = null;
      }

      // final Color featureColor = new Color(1, 1, 0, 0.25f);
      //
      // final int level = node.getDepth();
      //
      // final int maxLevel = 15;
      // if (level < maxLevel) {
      //    // final Font font = new Font(Font.SERIF, Font.BOLD, 12 + ((maxLevel - level) * 3));
      //    // final Font font = new Font(Font.SERIF, Font.BOLD, 14);
      //    // final int pointSize = (maxLevel - level);
      //    final int pointSize = 2;
      //
      //    final Sector nodeSector = node.getNodeSector();
      //    _bitmap.drawSector(nodeSector, new Color(1, 1, 1, 0.05f), new Color(1, 1, 1, 0.2f));
      //
      //    final Sector minimumSector = node.getMinimumSector();
      //    _bitmap.drawSector(minimumSector, new Color(0, 1, 1, 0.05f), new Color(0, 1, 1, 0.2f));
      //
      //    for (final PointFeature feature : node.getFeatures()) {
      //       _bitmap.drawPoint(feature._position, pointSize, pointSize, featureColor);
      //       // final String featureName = (String) feature._properties.get("name");
      //       // _bitmap.drawPoint(featureName, feature._position, pointSize, pointSize, featureColor, font);
      //    }
      // }

      @Override
      public boolean visit(final PointFeatureLODStorage.Node node) {
         final int depth = node.getDepth();
         if (depth <= _maxDepth) {
            if (depth >= _minDepth) {
               final Color clusterColor = new Color(1, 1, 0, 0.9f);
               //            final Font font = new Font(Font.SERIF, Font.BOLD, 14);
               //            final Color fontColor = new Color(1, 1, 0, 1f);

               for (final PointFeatureCluster cluster : node.getClusters()) {
                  final long clusterSize = cluster._size;

                  final double area = ((200000.0 * clusterSize) / _featuresCount);
                  final int pointSize = Math.round((float) Math.sqrt(area));

                  //               _bitmap.drawPoint("C #" + depth + ", size:" + clusterSize, cluster._position, pointSize, pointSize, clusterColor,
                  //                        font, fontColor);
                  _bitmap.drawPoint(cluster._position, pointSize, pointSize, clusterColor);
               }
            }

            final int pointSize = 2;
            final Color clusterColor = new Color(1, 0, 1, 0.9f);

            for (final PointFeature feature : node.getFeatures()) {
               _bitmap.drawPoint(feature._position, pointSize, pointSize, clusterColor);
            }
         }

         _progress.stepDone();
         return true;
      }

      //      @Override
      //      public boolean visit(final PointFeatureLODStorage.LeafNode node) {
      //         final int depth = node.getDepth();
      //         //         if ((depth >= _minDepth) && (depth <= _maxDepth)) {
      //         if (depth <= _maxDepth) {
      //            final int pointSize = 2;
      //            final Color clusterColor = new Color(1, 0, 1, 0.9f);
      //
      //            for (final PointFeature feature : node.getFeatures()) {
      //               _bitmap.drawPoint(feature._position, pointSize, pointSize, clusterColor);
      //            }
      //         }
      //
      //         _progress.stepDone();
      //         return true;
      //      }

   }

   public static void main(final String[] args) throws IOException {
      System.out.println("LODPointFeaturesStatistics 0.1");
      System.out.println("------------------------------\n");

      final File directory = new File("PointFeaturesLOD");
      // final String name = "Cities1000_LOD";
      // final String name = "AR_LOD";
      // final String name = "ES_LOD";
      final String name = "GEONames-PopulatedPlaces_LOD";

      try (final PointFeatureLODStorage clusterStorage = PointFeatureLODMapDBStorage.openReadOnly(directory, name)) {
         final PointFeatureLODStorage.Statistics statistics = clusterStorage.getStatistics(true);
         statistics.show();

         final int nodesCount = statistics.getNodesCount();
         final long featuresCount = statistics.getFeaturesCount();
         final int maxNodeDepth = statistics.getMaxNodeDepth();

         for (int depth = 0; depth <= maxNodeDepth; depth++) {
            final int minDepth = depth;
            final int maxDepth = depth;

            clusterStorage.acceptDepthFirstVisitor(new LODDrawer(clusterStorage, nodesCount, minDepth, maxDepth, featuresCount));
         }
      }

      System.out.println("\n- done!");
   }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cercospora imperatoriae

### Remarks
null


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.08.09 at 09:22:32 PM IST
//

package com.pacificmetrics.ims.apip.qti.item;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 *
 *                 The HotspotInteraction complexType is the container for infromation on hotspot interactions. A hotspot interaction is a graphical interaction with a corresponding set of choices that are defined as areas of the graphic image. The candidate's task is to select one or more of the areas (hotspots). The hotspot interaction should only be used when the spacial relationship of the choices with respect to each other (as represented by the graphic image) is important to the needs of the item. Otherwise, choiceInteraction should be used instead with separate material for each option.The delivery engine must clearly indicate the selected area(s) of the image and may also indicate the unselected areas as well. Interactions with hidden hotspots are achieved with the selectPointInteraction.
 *
 *
 *
Java class for HotspotInteraction.Type complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="HotspotInteraction.Type">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}prompt" minOccurs="0"/>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}object"/>
 *         <element ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}hotspotChoice" maxOccurs="unbounded"/>
 *       </sequence>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}maxChoices.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}xmlbase.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}responseIdentifier.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}minChoices.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}id.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}label.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}class.HotspotInteraction.Attr"/>
 *       <attGroup ref="{http://www.imsglobal.org/xsd/apip/apipv1p0/qtiitem/imsqti_v2p2}xmllang.HotspotInteraction.Attr"/>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "HotspotInteraction.Type", propOrder = {
    "prompt",
    "object",
    "hotspotChoices"
})
@XmlRootElement(name = "hotspotInteraction")
public class HotspotInteraction {

    protected Prompt prompt;
    @XmlElement(required = true)
    protected Object object;
    @XmlElement(name = "hotspotChoice", required = true)
    protected List<HotspotChoice> hotspotChoices;
    @XmlAttribute(name = "maxChoices")
    @XmlSchemaType(name = "nonNegativeInteger")
    protected BigInteger maxChoices;
    @XmlAttribute(name = "base", namespace = "http://www.w3.org/XML/1998/namespace")
    @XmlSchemaType(name = "anyURI")
    protected String base;
    @XmlAttribute(name = "responseIdentifier", required = true)
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    protected String responseIdentifier;
    @XmlAttribute(name = "minChoices")
    @XmlSchemaType(name = "nonNegativeInteger")
    protected BigInteger minChoices;
    @XmlAttribute(name = "id")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    protected String id;
    @XmlAttribute(name = "label")
    @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
    @XmlSchemaType(name = "normalizedString")
    protected String label;
    @XmlAttribute(name = "class")
    protected List<String> clazzs;
    @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
    protected String lang;

    /**
     * Gets the value of the prompt property.
     *
     * @return
     *     possible object is
     *     {@link Prompt }
     *
     */
    public Prompt getPrompt() {
        return prompt;
    }

    /**
     * Sets the value of the prompt property.
     *
     * @param value
     *     allowed object is
     *     {@link Prompt }
     *
     */
    public void setPrompt(Prompt value) {
        this.prompt = value;
    }

    /**
     * Gets the value of the object property.
     *
     * @return
     *     possible object is
     *     {@link Object }
     *
     */
    public Object getObject() {
        return object;
    }

    /**
     * Sets the value of the object property.
     *
     * @param value
     *     allowed object is
     *     {@link Object }
     *
     */
    public void setObject(Object value) {
        this.object = value;
    }

    /**
     * Gets the value of the hotspotChoices property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the hotspotChoices property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getHotspotChoices().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link HotspotChoice }
     *
     *
     */
    public List<HotspotChoice> getHotspotChoices() {
        if (hotspotChoices == null) {
            hotspotChoices = new ArrayList<HotspotChoice>();
        }
        return this.hotspotChoices;
    }

    /**
     * Gets the value of the maxChoices property.
     *
     * @return
     *     possible object is
     *     {@link BigInteger }
     *
     */
    public BigInteger getMaxChoices() {
        if (maxChoices == null) {
            return new BigInteger("1");
        } else {
            return maxChoices;
        }
    }

    /**
     * Sets the value of the maxChoices property.
     *
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *
     */
    public void setMaxChoices(BigInteger value) {
        this.maxChoices = value;
    }

    /**
     * Gets the value of the base property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getBase() {
        return base;
    }

    /**
     * Sets the value of the base property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setBase(String value) {
        this.base = value;
    }

    /**
     * Gets the value of the responseIdentifier property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getResponseIdentifier() {
        return responseIdentifier;
    }

    /**
     * Sets the value of the responseIdentifier property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setResponseIdentifier(String value) {
        this.responseIdentifier = value;
    }

    /**
     * Gets the value of the minChoices property.
     *
     * @return
     *     possible object is
     *     {@link BigInteger }
     *
     */
    public BigInteger getMinChoices() {
        if (minChoices == null) {
            return new BigInteger("0");
        } else {
            return minChoices;
        }
    }

    /**
     * Sets the value of the minChoices property.
     *
     * @param value
     *     allowed object is
     *     {@link BigInteger }
     *
     */
    public void setMinChoices(BigInteger value) {
        this.minChoices = value;
    }

    /**
     * Gets the value of the id property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setId(String value) {
        this.id = value;
    }

    /**
     * Gets the value of the label property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLabel() {
        return label;
    }

    /**
     * Sets the value of the label property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLabel(String value) {
        this.label = value;
    }

    /**
     * Gets the value of the clazzs property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the clazzs property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getClazzs().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getClazzs() {
        if (clazzs == null) {
            clazzs = new ArrayList<String>();
        }
        return this.clazzs;
    }

    /**
     * Gets the value of the lang property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLang() {
        return lang;
    }

    /**
     * Sets the value of the lang property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLang(String value) {
        this.lang = value;
    }

}


text:
using MediaManager.Library;
using MediaManager.Media;

namespace MediaManager.Queue
{
    public class QueueEndedEventArgs : MediaItemEventArgs
    {
        public QueueEndedEventArgs(IMediaItem mediaItem) : base(mediaItem)
        {
        }
    }
}


text:
/**
 * Created by Jose on 6/29/2015.
 */
angular.module('uktena')
    .factory('cookieSvc', [function () {
        var self = this;

        // Will return a cookie by name
        self.get = function (cname) {
            cname = 'uktena';
            var name = cname + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') c = c.substring(1);
                if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
            }

            return "";
        };

        // Will set a cookie - that expires today
        self.set = function (userId) {
            var tomorrow = new Date();
            tomorrow.setDate((new Date()).getDate()+1);

            var result = 'uktena=' + userId + '; expires=' + tomorrow.toUTCString();

            document.cookie = result;
        };

        return self;
    }]);


text:
angular
    .module('dart.directives.create_new')
    .directive('dtDatasetsCreateNew', [function() {
        return {
            restrict: 'E',
            scope: {
                options: '='
            },
            templateUrl: 'static/partials/directives/create_new/datasets.html',
            controller: ['$scope', 'DatasetService', 'EntityModalService', 'DatasetGuessModalService',
                function($scope, DatasetService, EntityModalService, DatasetGuessModalService) {
                    $scope.form = ["*"];
                    $scope.onCreateNew = function(d) {
                        if (d.label === 'dataset') {
                            EntityModalService.showDialog(
                                null,
                                {},
                                function () { return DatasetService.getSchema() },
                                function (entity) { return DatasetService.saveEntity(entity) }
                            );
                        }
                        else if (d.label === 'dataset_from_existing_s3_path') {
                            DatasetGuessModalService.showDialog(
                                null,
                                {},
                                function () { return DatasetService.getDatasetGuessSchema() },
                                function (entity) { return DatasetService.getDatasetGuess(entity) }
                            );
                        }
                    };
                }
            ]
        }
    }])
;


text:
#ifndef TRACKS_H
#define TRACKS_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
	int pdgId;
	double energy;
	double mass;
	double px;
	double py;
	double pz;
} Track;

#ifdef __cplusplus
}
#endif

#endif /* !TRACKS_H */


text:
var Promise = require('bluebird'),
    util = require('util'),
    _ = require('lodash'),
    childProcess = require('child_process');

var spawn = function(cmd, args, opts) {
  return new Promise(function (resolve, reject) {
    var child, output = [];

    args = args || [];

    if (opts && opts.env) {
      opts.env = _.assign(process.env, opts.env);
    }

    child = childProcess.spawn(cmd, args, opts);

    function errorMsg(err) {
      return util.format('Spawn error [%s %s]: %s', cmd, args.join(' '), JSON.stringify(err));
    }

    child.on('error', function(err) {
      return reject(errorMsg(err));
    });

    child.on('close', function(code) {
      if(code) return reject(errorMsg(code));
      return resolve(output.join(""));
    });

    if(!opts || opts && !opts.discardStderr) {
      child.stderr.setEncoding('utf8');
      child.stderr.on('data', console.error);
    }

    if(opts && opts.logOutput) {
      child.stdout.setEncoding('utf8');
      child.stdout.on('data', console.log);
    }

    if(opts && opts.getOutput) {
      child.stdout.setEncoding('utf8');
      child.stdout.on('data', function(data) {
        output.push(data);
      });
    }
  });
};

module.exports = spawn;


text:
module Quiniela
  module Core
    module Repositories
      module SubscriptionRepository
        class InMemory < AbstractRepository
          def persist(subscription)
            @id += 1
            attrs = subscription.to_hash.merge(id: @id)
            subscription = Entities::Subscription.new(attrs)
            records[@id] = subscription
            subscription
          end

          def where(conditions)
            all.select do |subscription|
              conditions.all? do |attr, value|
                subscription.send(attr) == value
              end
            end
          end

          def delete(record)
            records.delete(record.id)
          end
        end
      end
    end
  end
end


text:
namespace XET {

TestScene::TestScene( XE::XEngine& engine)
	: XE::Scene(engine, engine.getDAL(), engine.getGraphicsManager())
	, m_engine(engine)
{
	//m_engine.getLua().loadFile("Scene/1_Scene.lua");
}

void TestScene::loadRendererResources()
{
	//load all materials before scene load -> for ogre3D
	//TODO replace ogre resource loading with on demand async loading ....

	mGraphicsManager.getIntoRendererQueue().push([this]() {

		//	Ogre::ArchiveFactory *fac = new PhysFS::PhysFSArchiveFactory;
		//		Ogre::ArchiveManager::getSingleton().addArchiveFactory(fac);

		//------------------- basic stuff always needed ---------------------
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/2.0/scripts/Compositors", "General", true, true);
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/2.0/scripts/materials/Common", "General", true, true);
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/2.0/scripts/materials/Common/GLSL", "General", true, true);
		//debugging
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/DebugPack/material_ball", "General", true, true);

		// test
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/DamagedHelmet", "General", true, true);
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/Test", "General", true, true);
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/TestTextures", "General", true, true);

		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/2.0/scripts/Postprocessing", "TestGrp", true, true);
		m_engine.getResourceMgr()._t_addLocationForRender(m_engine.settings.dataRootFolder + "/assets/Editor", "Editor", true, true);

		const char *c_locations[7] =
		{
			"/2.0/scripts/materials/TutorialSky_Postprocess",
			"/2.0/scripts/materials/Postprocessing",
			"/2.0/scripts/materials/Postprocessing/GLSL",
			//	"/2.0/scripts/materials/Postprocessing/HLSL",
			//	"/2.0/scripts/materials/Postprocessing/Metal",
			"/2.0/scripts/materials/Postprocessing/SceneAssets",

			"/2.0/scripts/materials/HDR",
			"/2.0/scripts/materials/HDR/GLSL",
			//"/2.0/scripts/materials/HDR/HLSL",
			//"/2.0/scripts/materials/HDR/Metal",
			"/2.0/scripts/materials/PbsMaterials"
		};

		for (size_t i = 0; i<7; ++i)
		{
			Ogre::String dataFolder = m_engine.settings.resourceData.assetsFolder + c_locations[i];
			m_engine.getResourceMgr()._t_addLocationForRender(dataFolder, "General");
		}

		m_engine.getResourceMgr()._t_initResourceGroup("General");

		m_engine.getResourceMgr()._t_initResourceGroup("TestGrp"); //needed for xecompositor
	});
}

bool TestScene::createEntityType(entityx::Entity entity, void* entityData)
{
	bool deleteBufferInRenderThread = false;

	XE::Uint16 sceneID = 0; //TODO use as section ?? for large world

	const NetMsg::Entity* ent = flatbuffers::GetRoot< NetMsg::Entity>(entityData);

	if (!ent->components())
		return false;

#ifdef CompileEditor
	XE::EditorComponent* editorComponent;
	if (entity.has_component<XE::Renderable>())
		editorComponent = entity.component<XE::EditorComponent>().get();
	else
		editorComponent = entity.assign<XE::EditorComponent>().get();

	editorComponent->id = ent->entityID();
	editorComponent->name = ent->name()->c_str();
#endif

	//const NetMsg::Entity* ent = (const NetMsg::Entity*)entityData;
	for each (auto var in *ent->components())
	{
		auto test = var->comp_type();

		if (var->comp_type() == NetMsg::UComponent::UComponent_RenderableComponent) //message: editor -> server
		{
			//	LOG(plog::info) << "XFBType::RenderableComponent -> netid: " << entityData->netid();

			if (entity.has_component<XE::Renderable>())
				updateRenderableComponent(entity, sceneID, var->comp());
			else
				createRenderableComponent(entity, sceneID, var->comp());

			deleteBufferInRenderThread = true;
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_PhysicsComponent)  // messages: client <->server
		{
			const XFBType::PhysicsComponent* nodeMsg = (const XFBType::PhysicsComponent*)var->comp();

			//LOG(plog::info) << "x: " << nodeMsg->transform()->loc()->x();

			if (entity.has_component<XE::PhysicsComponent>())
				updatePhysicsComponent(entity, sceneID, var->comp());
			else
				createPhysicsComponent(entity, sceneID, var->comp());

			deleteBufferInRenderThread = true;
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_BodyComponent)  // messages: client <->server
		{
			const XFBType::BodyComponent* nodeMsg = (const XFBType::BodyComponent*)var->comp();
			std::cout << "x: " << nodeMsg->position()->x() << std::endl;

			if (entity.has_component<XE::BodyComponent>())
				updateBodyComponent(entity, var->comp());
			else
				createBodyComponent(entity, var->comp());

			deleteBufferInRenderThread = true;
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_SpawnPointComponent)  // messages: client <->server
		{
			const XFBType::SpawnPointComponent* nodeMsg = (const XFBType::SpawnPointComponent*)var->comp();

			if (entity.has_component<XE::SpawnPointComponent>())
				updateSpawnPointComponent(entity, var->comp());
			else
				createSpawnPointComponent(entity, var->comp());
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_SpawnComponent)  // messages: client <->server
		{
			const XFBType::SpawnComponent* nodeMsg = (const XFBType::SpawnComponent*)var->comp();

			if (entity.has_component<XE::SpawnComponent>())
				updateSpawnComponent(entity, var->comp());
			else
				createSpawnComponent(entity, var->comp());
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_Light)  // messages: client <->server
		{
			const XFBType::Light* light = (const XFBType::Light*)var->comp();

			if (entity.has_component<XE::LightRenderable>())
				updateLightComponent(entity, var->comp());
			else
				createLightComponent(entity, var->comp());

			deleteBufferInRenderThread = true;
		}
		else if (var->comp_type() == NetMsg::UComponent::UComponent_AnimationComponent)  // messages: client <->server
		{
			const XFBType::AnimationComponent* animation = (const XFBType::AnimationComponent*)var->comp();

			if (entity.has_component<XE::AnimationComponent>())
				updateAnimationComponent(entity, var->comp());
			else
				createAnimationComponent(entity, var->comp());
		}
	}

	return deleteBufferInRenderThread;
}

void TestScene::update(float deltaTime)
{
	XE::Scene::update(deltaTime);
}

} // namespace XET


text:
//
// Copyright (c) 2013-2014 InSeven Limited.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//

#import <Foundation/Foundation.h>

#import "ISNotifier.h"
#import "ISWeakReference.h"
#import "ISWeakReferenceArray.h"
#import "NSDictionary+JSON.h"
#import "NSObject+Serialize.h"
#import "NSObject+Threads.h"
#import "ISCancelable.h"
#import "ISCancelToken.h"

/**
 * Indicates an error occurred in ISUtilities.
 */
extern NSString *const ISUtilitiesErrorDomain;

/**
 * Values that are returned as the error code property of an `NSError` object.
 */
enum {

    /**
     * Indicates that an unexpected class was received.
     */
    ISUtilitiesErrorInvalidClass = 0,

};

void ISAssert(BOOL condition, NSString *desc, ...);

void ISAssertUnreached(NSString *message, ...);

/**
 * Create a dispatch queue with a custom identifier including domain, class name, class instance and instance name.
 *
 * Example usage:
 * ```
 * dispatch_queue_t completionQueue = ISDispatchQueueCreate(@"uk.co.inseven",
 *                                                          self,
 *                                                          @"completionQueue",
 *                                                          DISPATCH_QUEUE_CONCURRENT);
 * ```
 *
 * @param domain Reverse-DNS domain.
 * @param instance Class instance of which the queue is a member.
 * @param name Instance name (e.g. the queue member variable name).
 * @param attr Dispatch queue attributes (see `dispatch_queue_create`).
 *
 * @return The newly created dispatch queue.
 */
dispatch_queue_t ISDispatchQueueCreate(NSString *domain, id instance, NSString *name, dispatch_queue_attr_t attr);

void ISSafeSetDictionaryKey(NSMutableDictionary *dictionary, id key, id value);


text:
package cpu

import (
	"bufio"
	"fmt"
	"github.com/dobyrch/termboy-go/cartridge"
	"github.com/dobyrch/termboy-go/types"
	"github.com/dobyrch/termboy-go/utils"
	"log"
	"net"
	"strconv"
	"testing"
)

var c *GbcCPU

func before() {
	c = NewCPU()
	c.LinkMMU(NewMockMMU())
}

func AssertTimings(c *GbcCPU, t *testing.T, instr byte, expectedTiming int, isCB bool) {
	tick := c.Step()

	if isCB {
		log.Println("0xCB "+utils.ByteToString(instr)+" ("+c.CurrentInstruction.Description+")", "testing that instruction runs for", expectedTiming, "cycles")
	} else {
		log.Println(utils.ByteToString(instr)+" ("+c.CurrentInstruction.Description+")", "testing that instruction runs for", expectedTiming, "cycles")
	}

	if tick != expectedTiming {
		if isCB {
			t.Log("-----> For instruction 0xCB", utils.ByteToString(instr)+" ("+c.CurrentInstruction.Description+")", "Expected", expectedTiming, "but got", tick)
		} else {
			t.Log("-----> For instruction", utils.ByteToString(instr)+" ("+c.CurrentInstruction.Description+")", "Expected", expectedTiming, "but got", tick)

		}
		t.FailNow()
	}
}

func RunCBInstrAndAssertTimings(instr byte, flags []int, t *testing.T) {
	before()
	//expectedTiming += 4 //+4 because CB adds another cycle
	c.PC = 0x0000
	c.WriteByte(c.PC, 0xCB)
	c.WriteByte(c.PC+1, instr)
	var expectedTiming int = getTimingFromInstructionServer(instr)
	AssertTimings(c, t, instr, expectedTiming, true)
}

func RunInstrAndAssertTimings(instr byte, flags []int, t *testing.T) {
	before()
	if flags != nil {
		for _, f := range flags {
			if f == Z {
				c.SetFlag(Z)
			}
			if f == C {
				c.SetFlag(C)
			}
			if f == N {
				c.SetFlag(N)
			}
			if f == H {
				c.SetFlag(H)
			}
		}
	} else {
		c.ResetFlag(Z)
		c.ResetFlag(H)
		c.ResetFlag(N)
		c.ResetFlag(C)
		c.R.F = 0x00
	}
	c.PC = 0x0000
	c.WriteByte(c.PC, instr)
	var expectedTiming int = getTimingFromInstructionServer(instr)
	AssertTimings(c, t, instr, expectedTiming, false)
}

func getTimingFromInstructionServer(instr byte) int {
	conn, err := net.Dial("tcp", "localhost:8012")
	if err != nil {
		log.Println("error!")
	}
	var writer *bufio.Writer = bufio.NewWriter(conn)
	var reader *bufio.Reader = bufio.NewReader(conn)
	instrString := utils.ByteToString(instr)
	writer.WriteString(instrString + "\n")
	writer.Flush()
	result, _ := reader.ReadString('\n')
	conn.Close()
	i, _ := strconv.Atoi(result)
	return int(i)
}

func TestTest(t *testing.T) {
	/*
		RunInstrAndAssertTimings(0x00, nil, t)
		RunInstrAndAssertTimings(0x01,  nil, t)
		RunInstrAndAssertTimings(0x02,  nil, t)
		RunInstrAndAssertTimings(0x03,  nil, t)
		RunInstrAndAssertTimings(0x04,  nil, t)
		RunInstrAndAssertTimings(0x05,  nil, t)
		RunInstrAndAssertTimings(0x06,  nil, t)
		RunInstrAndAssertTimings(0x07,  nil, t)
		RunInstrAndAssertTimings(0x08,  nil, t)
		RunInstrAndAssertTimings(0x09,  nil, t)
		RunInstrAndAssertTimings(0x0A,  nil, t)
		RunInstrAndAssertTimings(0x0B,  nil, t)
		RunInstrAndAssertTimings(0x0C,  nil, t)
		RunInstrAndAssertTimings(0x0D,  nil, t)
		RunInstrAndAssertTimings(0x0E,  nil, t)
		RunInstrAndAssertTimings(0x0F,  nil, t)

		RunInstrAndAssertTimings(0x10,  nil, t)
		RunInstrAndAssertTimings(0x11,  nil, t)
		RunInstrAndAssertTimings(0x12, nil, t)
		RunInstrAndAssertTimings(0x13, nil, t)
		RunInstrAndAssertTimings(0x14, nil, t)
		RunInstrAndAssertTimings(0x15, nil, t)
		RunInstrAndAssertTimings(0x16, nil, t)
		RunInstrAndAssertTimings(0x17, nil, t)
		RunInstrAndAssertTimings(0x18,  nil, t)
		RunInstrAndAssertTimings(0x19, nil, t)
		RunInstrAndAssertTimings(0x1A, nil, t)
		RunInstrAndAssertTimings(0x1B, nil, t)
		RunInstrAndAssertTimings(0x1C, nil, t)
		RunInstrAndAssertTimings(0x1D, nil, t)
		RunInstrAndAssertTimings(0x1E, nil, t)
		RunInstrAndAssertTimings(0x1F, nil, t)

		RunInstrAndAssertTimings(0x21, nil, t)
		RunInstrAndAssertTimings(0x22, nil, t)
		RunInstrAndAssertTimings(0x23,  nil, t)
		RunInstrAndAssertTimings(0x24,  nil, t)
		RunInstrAndAssertTimings(0x25,  nil, t)
		RunInstrAndAssertTimings(0x26,  nil, t)
		RunInstrAndAssertTimings(0x27,  nil, t)
		RunInstrAndAssertTimings(0x29, nil, t)
		RunInstrAndAssertTimings(0x2A,  nil, t)
		RunInstrAndAssertTimings(0x2B,  nil, t)
		RunInstrAndAssertTimings(0x2C,  nil, t)
		RunInstrAndAssertTimings(0x2D,  nil, t)
		RunInstrAndAssertTimings(0x2E,  nil, t)
		RunInstrAndAssertTimings(0x2F,  nil, t)

		RunInstrAndAssertTimings(0x31,  nil, t)
		RunInstrAndAssertTimings(0x32,  nil, t)
		RunInstrAndAssertTimings(0x33,  nil, t)
		RunInstrAndAssertTimings(0x34,  nil, t)
		RunInstrAndAssertTimings(0x35,  nil, t)
		RunInstrAndAssertTimings(0x36,  nil, t)
		RunInstrAndAssertTimings(0x37, nil, t)
		RunInstrAndAssertTimings(0x39, nil, t)
		RunInstrAndAssertTimings(0x3A, nil, t)
		RunInstrAndAssertTimings(0x3B, nil, t)
		RunInstrAndAssertTimings(0x3C, nil, t)
		RunInstrAndAssertTimings(0x3D, nil, t)
		RunInstrAndAssertTimings(0x3E, nil, t)
		RunInstrAndAssertTimings(0x3F, nil, t)

		RunInstrAndAssertTimings(0x40, nil, t)
		RunInstrAndAssertTimings(0x41,  nil, t)
		RunInstrAndAssertTimings(0x42,  nil, t)
		RunInstrAndAssertTimings(0x43,  nil, t)
		RunInstrAndAssertTimings(0x44,  nil, t)
		RunInstrAndAssertTimings(0x45,  nil, t)
		RunInstrAndAssertTimings(0x46,  nil, t)
		RunInstrAndAssertTimings(0x47,  nil, t)
		RunInstrAndAssertTimings(0x48,  nil, t)
		RunInstrAndAssertTimings(0x49,  nil, t)
		RunInstrAndAssertTimings(0x4A,  nil, t)
		RunInstrAndAssertTimings(0x4B,  nil, t)
		RunInstrAndAssertTimings(0x4C,  nil, t)
		RunInstrAndAssertTimings(0x4D,  nil, t)
		RunInstrAndAssertTimings(0x4E,  nil, t)
		RunInstrAndAssertTimings(0x4F,  nil, t)

		RunInstrAndAssertTimings(0x50, nil, t)
		RunInstrAndAssertTimings(0x51,  nil, t)
		RunInstrAndAssertTimings(0x52,  nil, t)
		RunInstrAndAssertTimings(0x53,  nil, t)
		RunInstrAndAssertTimings(0x54,  nil, t)
		RunInstrAndAssertTimings(0x55,  nil, t)
		RunInstrAndAssertTimings(0x56,  nil, t)
		RunInstrAndAssertTimings(0x57,  nil, t)
		RunInstrAndAssertTimings(0x58,  nil, t)
		RunInstrAndAssertTimings(0x59,  nil, t)
		RunInstrAndAssertTimings(0x5A,  nil, t)
		RunInstrAndAssertTimings(0x5B,  nil, t)
		RunInstrAndAssertTimings(0x5C,  nil, t)
		RunInstrAndAssertTimings(0x5D,  nil, t)
		RunInstrAndAssertTimings(0x5E,  nil, t)
		RunInstrAndAssertTimings(0x5F,  nil, t)

		//0x6x
		RunInstrAndAssertTimings(0x60,  nil, t)
		RunInstrAndAssertTimings(0x61,  nil, t)
		RunInstrAndAssertTimings(0x62,  nil, t)
		RunInstrAndAssertTimings(0x63,  nil, t)
		RunInstrAndAssertTimings(0x64,  nil, t)
		RunInstrAndAssertTimings(0x65,  nil, t)
		RunInstrAndAssertTimings(0x66,  nil, t)
		RunInstrAndAssertTimings(0x67, nil, t)
		RunInstrAndAssertTimings(0x68,  nil, t)
		RunInstrAndAssertTimings(0x69,  nil, t)
		RunInstrAndAssertTimings(0x6A,  nil, t)
		RunInstrAndAssertTimings(0x6B,  nil, t)
		RunInstrAndAssertTimings(0x6C,  nil, t)
		RunInstrAndAssertTimings(0x6D,  nil, t)
		RunInstrAndAssertTimings(0x6E,  nil, t)
		RunInstrAndAssertTimings(0x6F,  nil, t)

		//0x7x
		RunInstrAndAssertTimings(0x70,  nil, t)
		RunInstrAndAssertTimings(0x71,  nil, t)
		RunInstrAndAssertTimings(0x72,  nil, t)
		RunInstrAndAssertTimings(0x73,  nil, t)
		RunInstrAndAssertTimings(0x74,  nil, t)
		RunInstrAndAssertTimings(0x75,  nil, t)
		RunInstrAndAssertTimings(0x76,  nil, t)
		RunInstrAndAssertTimings(0x77,  nil, t)
		RunInstrAndAssertTimings(0x78,  nil, t)
		RunInstrAndAssertTimings(0x79,  nil, t)
		RunInstrAndAssertTimings(0x7A,  nil, t)
		RunInstrAndAssertTimings(0x7B,  nil, t)
		RunInstrAndAssertTimings(0x7C,  nil, t)
		RunInstrAndAssertTimings(0x7D,  nil, t)
		RunInstrAndAssertTimings(0x7E,  nil, t)
		RunInstrAndAssertTimings(0x7F,  nil, t)

			//0x8x
		RunInstrAndAssertTimings(0x80, nil, t)
		RunInstrAndAssertTimings(0x81,  nil, t)
		RunInstrAndAssertTimings(0x82,  nil, t)
		RunInstrAndAssertTimings(0x83,  nil, t)
		RunInstrAndAssertTimings(0x84,  nil, t)
		RunInstrAndAssertTimings(0x85,  nil, t)
		RunInstrAndAssertTimings(0x86,  nil, t)
		RunInstrAndAssertTimings(0x87,  nil, t)
		RunInstrAndAssertTimings(0x88,  nil, t)
		RunInstrAndAssertTimings(0x89,  nil, t)
		RunInstrAndAssertTimings(0x8A,  nil, t)
		RunInstrAndAssertTimings(0x8B,  nil, t)
		RunInstrAndAssertTimings(0x8C,  nil, t)
		RunInstrAndAssertTimings(0x8D, nil, t)
		RunInstrAndAssertTimings(0x8E,  nil, t)
		RunInstrAndAssertTimings(0x8F,  nil, t)

		//0x9x
		RunInstrAndAssertTimings(0x90,  nil, t)
		RunInstrAndAssertTimings(0x91,  nil, t)
		RunInstrAndAssertTimings(0x92,  nil, t)
		RunInstrAndAssertTimings(0x93,  nil, t)
		RunInstrAndAssertTimings(0x94, nil, t)
		RunInstrAndAssertTimings(0x95,  nil, t)
		RunInstrAndAssertTimings(0x96,  nil, t)
		RunInstrAndAssertTimings(0x97,  nil, t)
		RunInstrAndAssertTimings(0x98,  nil, t)
		RunInstrAndAssertTimings(0x99,  nil, t)
		RunInstrAndAssertTimings(0x9A, nil, t)
		RunInstrAndAssertTimings(0x9B,  nil, t)
		RunInstrAndAssertTimings(0x9C,  nil, t)
		RunInstrAndAssertTimings(0x9D,  nil, t)
		RunInstrAndAssertTimings(0x9E,  nil, t)
		RunInstrAndAssertTimings(0x9F,  nil, t)

		//0xAx
		RunInstrAndAssertTimings(0xA0,  nil, t)
		RunInstrAndAssertTimings(0xA1,  nil, t)
		RunInstrAndAssertTimings(0xA2,  nil, t)
		RunInstrAndAssertTimings(0xA3,  nil, t)
		RunInstrAndAssertTimings(0xA4,  nil, t)
		RunInstrAndAssertTimings(0xA5,  nil, t)
		RunInstrAndAssertTimings(0xA6,  nil, t)
		RunInstrAndAssertTimings(0xA7,  nil, t)
		RunInstrAndAssertTimings(0xA8,  nil, t)
		RunInstrAndAssertTimings(0xA9,  nil, t)
		RunInstrAndAssertTimings(0xAA,  nil, t)
		RunInstrAndAssertTimings(0xAB,  nil, t)
		RunInstrAndAssertTimings(0xAC,  nil, t)
		RunInstrAndAssertTimings(0xAD,  nil, t)
		RunInstrAndAssertTimings(0xAE,  nil, t)
		RunInstrAndAssertTimings(0xAF,  nil, t)

		RunInstrAndAssertTimings(0xB0,  nil, t)
		RunInstrAndAssertTimings(0xB1,  nil, t)
		RunInstrAndAssertTimings(0xB2,  nil, t)
		RunInstrAndAssertTimings(0xB3,  nil, t)
		RunInstrAndAssertTimings(0xB4,  nil, t)
		RunInstrAndAssertTimings(0xB5,  nil, t)
		RunInstrAndAssertTimings(0xB6,  nil, t)
		RunInstrAndAssertTimings(0xB7,  nil, t)
		RunInstrAndAssertTimings(0xB8,  nil, t)
		RunInstrAndAssertTimings(0xB9,  nil, t)
		RunInstrAndAssertTimings(0xBA,  nil, t)
		RunInstrAndAssertTimings(0xBB,  nil, t)
		RunInstrAndAssertTimings(0xBC,  nil, t)
		RunInstrAndAssertTimings(0xBD,  nil, t)
		RunInstrAndAssertTimings(0xBE,  nil, t)
		RunInstrAndAssertTimings(0xBF,  nil, t)

		//0xCx
		RunInstrAndAssertTimings(0xC1,  nil, t)
		RunInstrAndAssertTimings(0xC3,  nil, t)
		RunInstrAndAssertTimings(0xC5,  nil, t)
		RunInstrAndAssertTimings(0xC6, nil, t)
		RunInstrAndAssertTimings(0xC7,  nil, t)
		RunInstrAndAssertTimings(0xC9,  nil, t)
		RunInstrAndAssertTimings(0xCD,  nil, t)
		RunInstrAndAssertTimings(0xCE, nil, t)
		RunInstrAndAssertTimings(0xCF,  nil, t)

		RunInstrAndAssertTimings(0xD1,  nil, t)
		RunInstrAndAssertTimings(0xD5,  nil, t)
		RunInstrAndAssertTimings(0xD6, nil, t)
		RunInstrAndAssertTimings(0xD7,  nil, t)
		RunInstrAndAssertTimings(0xD9,  nil, t)
		RunInstrAndAssertTimings(0xDE, nil, t)
		RunInstrAndAssertTimings(0xDF,  nil, t)

		//0xEx
		RunInstrAndAssertTimings(0xE0,  nil, t)
		RunInstrAndAssertTimings(0xE1,  nil, t)
		RunInstrAndAssertTimings(0xE2, nil, t)
		RunInstrAndAssertTimings(0xE5,  nil, t)
		RunInstrAndAssertTimings(0xE6, nil, t)
		RunInstrAndAssertTimings(0xE7,  nil, t)
		RunInstrAndAssertTimings(0xE8,  nil, t)
		RunInstrAndAssertTimings(0xE9, nil, t)
		RunInstrAndAssertTimings(0xEA,  nil, t)
		RunInstrAndAssertTimings(0xEE, nil, t)
		RunInstrAndAssertTimings(0xEF,  nil, t)

		//0xFx
		RunInstrAndAssertTimings(0xF0,  nil, t)
		RunInstrAndAssertTimings(0xF1,  nil, t)
		RunInstrAndAssertTimings(0xF2,  nil, t)
		RunInstrAndAssertTimings(0xF3, nil, t)
		RunInstrAndAssertTimings(0xF5,  nil, t)
		RunInstrAndAssertTimings(0xF6,  nil, t)
		RunInstrAndAssertTimings(0xF7,  nil, t)
		RunInstrAndAssertTimings(0xF8,  nil, t)
		RunInstrAndAssertTimings(0xF9, nil, t)
		RunInstrAndAssertTimings(0xFA,  nil, t)
		RunInstrAndAssertTimings(0xFB,  nil, t)
		RunInstrAndAssertTimings(0xFE,  nil, t)
		RunInstrAndAssertTimings(0xFF,  nil, t)

		//CONDITIONALS
		RunInstrAndAssertTimings(0x20, nil, t)
		RunInstrAndAssertTimings(0x28, []int{Z}, t)
		RunInstrAndAssertTimings(0x30,  nil, t)
		RunInstrAndAssertTimings(0x38,  []int{C}, t)
		RunInstrAndAssertTimings(0xC0,  nil, t)
		RunInstrAndAssertTimings(0xC2,  nil, t)
		RunInstrAndAssertTimings(0xC4,  nil, t)
		RunInstrAndAssertTimings(0xC8,  []int{Z}, t)
		RunInstrAndAssertTimings(0xCA,  []int{Z}, t)
		RunInstrAndAssertTimings(0xCC,  []int{Z}, t)
		RunInstrAndAssertTimings(0xD0,  nil, t)
		RunInstrAndAssertTimings(0xD2,  nil, t)
		RunInstrAndAssertTimings(0xD4,  nil, t)
		RunInstrAndAssertTimings(0xD8,  []int{C}, t)
		RunInstrAndAssertTimings(0xDA,  []int{C}, t)
		RunInstrAndAssertTimings(0xDC,  []int{C}, t)

		RunInstrAndAssertTimings(0x20, []int{Z}, t)
		RunInstrAndAssertTimings(0x28,  nil, t)
		RunInstrAndAssertTimings(0x30, []int{C}, t)
		RunInstrAndAssertTimings(0x38,  nil, t)
		RunInstrAndAssertTimings(0xC0,  []int{Z}, t)
		RunInstrAndAssertTimings(0xC2,  []int{Z}, t)
		RunInstrAndAssertTimings(0xC4,  []int{Z}, t)
		RunInstrAndAssertTimings(0xC8,  nil, t)
		RunInstrAndAssertTimings(0xCA,  nil, t)
		RunInstrAndAssertTimings(0xCC,  nil, t)
		RunInstrAndAssertTimings(0xD0,  []int{C}, t)
		RunInstrAndAssertTimings(0xD2,  []int{C}, t)
		RunInstrAndAssertTimings(0xD4,  []int{C}, t)
		RunInstrAndAssertTimings(0xD8,  nil, t)
		RunInstrAndAssertTimings(0xDA,  nil, t)
		RunInstrAndAssertTimings(0xDC,  nil, t)
	*/

	RunCBInstrAndAssertTimings(0x0, nil, t)
	RunCBInstrAndAssertTimings(0x1, nil, t)
	RunCBInstrAndAssertTimings(0x2, nil, t)
	RunCBInstrAndAssertTimings(0x3, nil, t)
	RunCBInstrAndAssertTimings(0x4, nil, t)
	RunCBInstrAndAssertTimings(0x5, nil, t)
	RunCBInstrAndAssertTimings(0x6, nil, t)
	RunCBInstrAndAssertTimings(0x7, nil, t)
	RunCBInstrAndAssertTimings(0x8, nil, t)
	RunCBInstrAndAssertTimings(0x9, nil, t)
	RunCBInstrAndAssertTimings(0xA, nil, t)
	RunCBInstrAndAssertTimings(0xB, nil, t)
	RunCBInstrAndAssertTimings(0xC, nil, t)
	RunCBInstrAndAssertTimings(0xD, nil, t)
	RunCBInstrAndAssertTimings(0xE, nil, t)
	RunCBInstrAndAssertTimings(0xF, nil, t)
	RunCBInstrAndAssertTimings(0x10, nil, t)
	RunCBInstrAndAssertTimings(0x11, nil, t)
	RunCBInstrAndAssertTimings(0x12, nil, t)
	RunCBInstrAndAssertTimings(0x13, nil, t)
	RunCBInstrAndAssertTimings(0x14, nil, t)
	RunCBInstrAndAssertTimings(0x15, nil, t)
	RunCBInstrAndAssertTimings(0x16, nil, t)
	RunCBInstrAndAssertTimings(0x17, nil, t)
	RunCBInstrAndAssertTimings(0x18, nil, t)
	RunCBInstrAndAssertTimings(0x19, nil, t)
	RunCBInstrAndAssertTimings(0x1A, nil, t)
	RunCBInstrAndAssertTimings(0x1B, nil, t)
	RunCBInstrAndAssertTimings(0x1C, nil, t)
	RunCBInstrAndAssertTimings(0x1D, nil, t)
	RunCBInstrAndAssertTimings(0x1E, nil, t)
	RunCBInstrAndAssertTimings(0x1F, nil, t)
	RunCBInstrAndAssertTimings(0x20, nil, t)
	RunCBInstrAndAssertTimings(0x21, nil, t)
	RunCBInstrAndAssertTimings(0x22, nil, t)
	RunCBInstrAndAssertTimings(0x23, nil, t)
	RunCBInstrAndAssertTimings(0x24, nil, t)
	RunCBInstrAndAssertTimings(0x25, nil, t)
	RunCBInstrAndAssertTimings(0x26, nil, t)
	RunCBInstrAndAssertTimings(0x27, nil, t)
	RunCBInstrAndAssertTimings(0x28, nil, t)
	RunCBInstrAndAssertTimings(0x29, nil, t)
	RunCBInstrAndAssertTimings(0x2A, nil, t)
	RunCBInstrAndAssertTimings(0x2B, nil, t)
	RunCBInstrAndAssertTimings(0x2C, nil, t)
	RunCBInstrAndAssertTimings(0x2D, nil, t)
	RunCBInstrAndAssertTimings(0x2E, nil, t)
	RunCBInstrAndAssertTimings(0x2F, nil, t)
	RunCBInstrAndAssertTimings(0x30, nil, t)
	RunCBInstrAndAssertTimings(0x31, nil, t)
	RunCBInstrAndAssertTimings(0x32, nil, t)
	RunCBInstrAndAssertTimings(0x33, nil, t)
	RunCBInstrAndAssertTimings(0x34, nil, t)
	RunCBInstrAndAssertTimings(0x35, nil, t)
	RunCBInstrAndAssertTimings(0x36, nil, t)
	RunCBInstrAndAssertTimings(0x37, nil, t)
	RunCBInstrAndAssertTimings(0x38, nil, t)
	RunCBInstrAndAssertTimings(0x39, nil, t)
	RunCBInstrAndAssertTimings(0x3A, nil, t)
	RunCBInstrAndAssertTimings(0x3B, nil, t)
	RunCBInstrAndAssertTimings(0x3C, nil, t)
	RunCBInstrAndAssertTimings(0x3D, nil, t)
	RunCBInstrAndAssertTimings(0x3E, nil, t)
	RunCBInstrAndAssertTimings(0x3F, nil, t)
	RunCBInstrAndAssertTimings(0x40, nil, t)
	RunCBInstrAndAssertTimings(0x41, nil, t)
	RunCBInstrAndAssertTimings(0x42, nil, t)
	RunCBInstrAndAssertTimings(0x43, nil, t)
	RunCBInstrAndAssertTimings(0x44, nil, t)
	RunCBInstrAndAssertTimings(0x45, nil, t)
	RunCBInstrAndAssertTimings(0x46, nil, t)
	RunCBInstrAndAssertTimings(0x47, nil, t)
	RunCBInstrAndAssertTimings(0x48, nil, t)
	RunCBInstrAndAssertTimings(0x49, nil, t)
	RunCBInstrAndAssertTimings(0x4A, nil, t)
	RunCBInstrAndAssertTimings(0x4B, nil, t)
	RunCBInstrAndAssertTimings(0x4C, nil, t)
	RunCBInstrAndAssertTimings(0x4D, nil, t)
	RunCBInstrAndAssertTimings(0x4E, nil, t)
	RunCBInstrAndAssertTimings(0x4F, nil, t)
	RunCBInstrAndAssertTimings(0x50, nil, t)
	RunCBInstrAndAssertTimings(0x51, nil, t)
	RunCBInstrAndAssertTimings(0x52, nil, t)
	RunCBInstrAndAssertTimings(0x53, nil, t)
	RunCBInstrAndAssertTimings(0x54, nil, t)
	RunCBInstrAndAssertTimings(0x55, nil, t)
	RunCBInstrAndAssertTimings(0x56, nil, t)
	RunCBInstrAndAssertTimings(0x57, nil, t)
	RunCBInstrAndAssertTimings(0x58, nil, t)
	RunCBInstrAndAssertTimings(0x59, nil, t)
	RunCBInstrAndAssertTimings(0x5A, nil, t)
	RunCBInstrAndAssertTimings(0x5B, nil, t)
	RunCBInstrAndAssertTimings(0x5C, nil, t)
	RunCBInstrAndAssertTimings(0x5D, nil, t)
	RunCBInstrAndAssertTimings(0x5E, nil, t)
	RunCBInstrAndAssertTimings(0x5F, nil, t)
	RunCBInstrAndAssertTimings(0x60, nil, t)
	RunCBInstrAndAssertTimings(0x61, nil, t)
	RunCBInstrAndAssertTimings(0x62, nil, t)
	RunCBInstrAndAssertTimings(0x63, nil, t)
	RunCBInstrAndAssertTimings(0x64, nil, t)
	RunCBInstrAndAssertTimings(0x65, nil, t)
	RunCBInstrAndAssertTimings(0x66, nil, t)
	RunCBInstrAndAssertTimings(0x67, nil, t)
	RunCBInstrAndAssertTimings(0x68, nil, t)
	RunCBInstrAndAssertTimings(0x69, nil, t)
	RunCBInstrAndAssertTimings(0x6A, nil, t)
	RunCBInstrAndAssertTimings(0x6B, nil, t)
	RunCBInstrAndAssertTimings(0x6C, nil, t)
	RunCBInstrAndAssertTimings(0x6D, nil, t)
	RunCBInstrAndAssertTimings(0x6E, nil, t)
	RunCBInstrAndAssertTimings(0x6F, nil, t)
	RunCBInstrAndAssertTimings(0x70, nil, t)
	RunCBInstrAndAssertTimings(0x71, nil, t)
	RunCBInstrAndAssertTimings(0x72, nil, t)
	RunCBInstrAndAssertTimings(0x73, nil, t)
	RunCBInstrAndAssertTimings(0x74, nil, t)
	RunCBInstrAndAssertTimings(0x75, nil, t)
	RunCBInstrAndAssertTimings(0x76, nil, t)
	RunCBInstrAndAssertTimings(0x77, nil, t)
	RunCBInstrAndAssertTimings(0x78, nil, t)
	RunCBInstrAndAssertTimings(0x79, nil, t)
	RunCBInstrAndAssertTimings(0x7A, nil, t)
	RunCBInstrAndAssertTimings(0x7B, nil, t)
	RunCBInstrAndAssertTimings(0x7C, nil, t)
	RunCBInstrAndAssertTimings(0x7D, nil, t)
	RunCBInstrAndAssertTimings(0x7E, nil, t)
	RunCBInstrAndAssertTimings(0x7F, nil, t)
	RunCBInstrAndAssertTimings(0x80, nil, t)
	RunCBInstrAndAssertTimings(0x81, nil, t)
	RunCBInstrAndAssertTimings(0x82, nil, t)
	RunCBInstrAndAssertTimings(0x83, nil, t)
	RunCBInstrAndAssertTimings(0x84, nil, t)
	RunCBInstrAndAssertTimings(0x85, nil, t)
	RunCBInstrAndAssertTimings(0x86, nil, t)
	RunCBInstrAndAssertTimings(0x87, nil, t)
	RunCBInstrAndAssertTimings(0x88, nil, t)
	RunCBInstrAndAssertTimings(0x89, nil, t)
	RunCBInstrAndAssertTimings(0x8A, nil, t)
	RunCBInstrAndAssertTimings(0x8B, nil, t)
	RunCBInstrAndAssertTimings(0x8C, nil, t)
	RunCBInstrAndAssertTimings(0x8D, nil, t)
	RunCBInstrAndAssertTimings(0x8E, nil, t)
	RunCBInstrAndAssertTimings(0x8F, nil, t)
	RunCBInstrAndAssertTimings(0x90, nil, t)
	RunCBInstrAndAssertTimings(0x91, nil, t)
	RunCBInstrAndAssertTimings(0x92, nil, t)
	RunCBInstrAndAssertTimings(0x93, nil, t)
	RunCBInstrAndAssertTimings(0x94, nil, t)
	RunCBInstrAndAssertTimings(0x95, nil, t)
	RunCBInstrAndAssertTimings(0x96, nil, t)
	RunCBInstrAndAssertTimings(0x97, nil, t)
	RunCBInstrAndAssertTimings(0x98, nil, t)
	RunCBInstrAndAssertTimings(0x99, nil, t)
	RunCBInstrAndAssertTimings(0x9A, nil, t)
	RunCBInstrAndAssertTimings(0x9B, nil, t)
	RunCBInstrAndAssertTimings(0x9C, nil, t)
	RunCBInstrAndAssertTimings(0x9D, nil, t)
	RunCBInstrAndAssertTimings(0x9E, nil, t)
	RunCBInstrAndAssertTimings(0x9F, nil, t)
	RunCBInstrAndAssertTimings(0xA0, nil, t)
	RunCBInstrAndAssertTimings(0xA1, nil, t)
	RunCBInstrAndAssertTimings(0xA2, nil, t)
	RunCBInstrAndAssertTimings(0xA3, nil, t)
	RunCBInstrAndAssertTimings(0xA4, nil, t)
	RunCBInstrAndAssertTimings(0xA5, nil, t)
	RunCBInstrAndAssertTimings(0xA6, nil, t)
	RunCBInstrAndAssertTimings(0xA7, nil, t)
	RunCBInstrAndAssertTimings(0xA8, nil, t)
	RunCBInstrAndAssertTimings(0xA9, nil, t)
	RunCBInstrAndAssertTimings(0xAA, nil, t)
	RunCBInstrAndAssertTimings(0xAB, nil, t)
	RunCBInstrAndAssertTimings(0xAC, nil, t)
	RunCBInstrAndAssertTimings(0xAD, nil, t)
	RunCBInstrAndAssertTimings(0xAE, nil, t)
	RunCBInstrAndAssertTimings(0xAF, nil, t)
	RunCBInstrAndAssertTimings(0xB0, nil, t)
	RunCBInstrAndAssertTimings(0xB1, nil, t)
	RunCBInstrAndAssertTimings(0xB2, nil, t)
	RunCBInstrAndAssertTimings(0xB3, nil, t)
	RunCBInstrAndAssertTimings(0xB4, nil, t)
	RunCBInstrAndAssertTimings(0xB5, nil, t)
	RunCBInstrAndAssertTimings(0xB6, nil, t)
	RunCBInstrAndAssertTimings(0xB7, nil, t)
	RunCBInstrAndAssertTimings(0xB8, nil, t)
	RunCBInstrAndAssertTimings(0xB9, nil, t)
	RunCBInstrAndAssertTimings(0xBA, nil, t)
	RunCBInstrAndAssertTimings(0xBB, nil, t)
	RunCBInstrAndAssertTimings(0xBC, nil, t)
	RunCBInstrAndAssertTimings(0xBD, nil, t)
	RunCBInstrAndAssertTimings(0xBE, nil, t)
	RunCBInstrAndAssertTimings(0xBF, nil, t)
	RunCBInstrAndAssertTimings(0xC0, nil, t)
	RunCBInstrAndAssertTimings(0xC1, nil, t)
	RunCBInstrAndAssertTimings(0xC2, nil, t)
	RunCBInstrAndAssertTimings(0xC3, nil, t)
	RunCBInstrAndAssertTimings(0xC4, nil, t)
	RunCBInstrAndAssertTimings(0xC5, nil, t)
	RunCBInstrAndAssertTimings(0xC6, nil, t)
	RunCBInstrAndAssertTimings(0xC7, nil, t)
	RunCBInstrAndAssertTimings(0xC8, nil, t)
	RunCBInstrAndAssertTimings(0xC9, nil, t)
	RunCBInstrAndAssertTimings(0xCA, nil, t)
	RunCBInstrAndAssertTimings(0xCB, nil, t)
	RunCBInstrAndAssertTimings(0xCC, nil, t)
	RunCBInstrAndAssertTimings(0xCD, nil, t)
	RunCBInstrAndAssertTimings(0xCE, nil, t)
	RunCBInstrAndAssertTimings(0xCF, nil, t)
	RunCBInstrAndAssertTimings(0xD0, nil, t)
	RunCBInstrAndAssertTimings(0xD1, nil, t)
	RunCBInstrAndAssertTimings(0xD2, nil, t)
	RunCBInstrAndAssertTimings(0xD3, nil, t)
	RunCBInstrAndAssertTimings(0xD4, nil, t)
	RunCBInstrAndAssertTimings(0xD5, nil, t)
	RunCBInstrAndAssertTimings(0xD6, nil, t)
	RunCBInstrAndAssertTimings(0xD7, nil, t)
	RunCBInstrAndAssertTimings(0xD8, nil, t)
	RunCBInstrAndAssertTimings(0xD9, nil, t)
	RunCBInstrAndAssertTimings(0xDA, nil, t)
	RunCBInstrAndAssertTimings(0xDB, nil, t)
	RunCBInstrAndAssertTimings(0xDC, nil, t)
	RunCBInstrAndAssertTimings(0xDD, nil, t)
	RunCBInstrAndAssertTimings(0xDE, nil, t)
	RunCBInstrAndAssertTimings(0xDF, nil, t)
	RunCBInstrAndAssertTimings(0xE0, nil, t)
	RunCBInstrAndAssertTimings(0xE1, nil, t)
	RunCBInstrAndAssertTimings(0xE2, nil, t)
	RunCBInstrAndAssertTimings(0xE3, nil, t)
	RunCBInstrAndAssertTimings(0xE4, nil, t)
	RunCBInstrAndAssertTimings(0xE5, nil, t)
	RunCBInstrAndAssertTimings(0xE6, nil, t)
	RunCBInstrAndAssertTimings(0xE7, nil, t)
	RunCBInstrAndAssertTimings(0xE8, nil, t)
	RunCBInstrAndAssertTimings(0xE9, nil, t)
	RunCBInstrAndAssertTimings(0xEA, nil, t)
	RunCBInstrAndAssertTimings(0xEB, nil, t)
	RunCBInstrAndAssertTimings(0xEC, nil, t)
	RunCBInstrAndAssertTimings(0xED, nil, t)
	RunCBInstrAndAssertTimings(0xEE, nil, t)
	RunCBInstrAndAssertTimings(0xEF, nil, t)
	RunCBInstrAndAssertTimings(0xF0, nil, t)
	RunCBInstrAndAssertTimings(0xF1, nil, t)
	RunCBInstrAndAssertTimings(0xF2, nil, t)
	RunCBInstrAndAssertTimings(0xF3, nil, t)
	RunCBInstrAndAssertTimings(0xF4, nil, t)
	RunCBInstrAndAssertTimings(0xF5, nil, t)
	RunCBInstrAndAssertTimings(0xF6, nil, t)
	RunCBInstrAndAssertTimings(0xF7, nil, t)
	RunCBInstrAndAssertTimings(0xF8, nil, t)
	RunCBInstrAndAssertTimings(0xF9, nil, t)
	RunCBInstrAndAssertTimings(0xFA, nil, t)
	RunCBInstrAndAssertTimings(0xFB, nil, t)
	RunCBInstrAndAssertTimings(0xFC, nil, t)
	RunCBInstrAndAssertTimings(0xFD, nil, t)
	RunCBInstrAndAssertTimings(0xFE, nil, t)
	RunCBInstrAndAssertTimings(0xFF, nil, t)
}

type MockMMU struct {
	memory map[types.Word]byte
}

func NewMockMMU() *MockMMU {
	var m *MockMMU = new(MockMMU)
	m.memory = make(map[types.Word]byte)
	return m
}

func (m *MockMMU) WriteByte(address types.Word, value byte) {
	m.memory[address] = value
}

func (m *MockMMU) WriteWord(address types.Word, value types.Word) {
	m.memory[address] = byte(value >> 8)
	m.memory[address+1] = byte(value & 0x00FF)
}

func (m *MockMMU) ReadByte(address types.Word) byte {
	return m.memory[address]
}

func (m *MockMMU) ReadWord(address types.Word) types.Word {
	a, b := m.memory[address], m.memory[address+1]
	return (types.Word(a) << 8) ^ types.Word(b)
}

func (m *MockMMU) SetInBootMode(mode bool) {
}

func (m *MockMMU) Reset() {
	m.memory = make(map[types.Word]byte)
}

func (m *MockMMU) LoadBIOS(data []byte) (bool, error) {
	return true, nil
}

func (m *MockMMU) LoadCartridge(cart *cartridge.Cartridge) {
}


text:
'use strict';

angular.module('rachaApp')
  .config(function ($routeProvider) {
    $routeProvider
      .when('/grades_class', {
        templateUrl: 'app/grades_class/grades_class.html',
        controller: 'GradesClassCtrl'
      });
  });


text:
/*
 * App Actions
 *
 * Actions change things in your application
 * Since this boilerplate uses a uni-directional data flow, specifically redux,
 * we have these actions which are the only way your application interacts with
 * your application state. This guarantees that your state is up to date and nobody
 * messes it up weirdly somewhere.
 *
 * To add a new Action:
 * 1) Import your constant
 * 2) Add a function like this:
 *    export function yourAction(var) {
 *        return { type: YOUR_ACTION_CONSTANT, var: var }
 *    }
 */

import _ from 'lodash';
import afAreas from './areas.json';
import {
  LOAD_REPOS,
  LOAD_REPOS_SUCCESS,
  LOAD_REPOS_ERROR,
  LOAD_JOBS,
  LOAD_JOBS_SUCCESS,
  LOAD_JOBS_ERROR,
  SET_COMPETENCE,
  REMOVE_COMPETENCE,
  SET_EXPERIENCE,
  REMOVE_EXPERIENCE,
  SET_DRIVERS_LICENSE,
  REMOVE_DRIVERS_LICENSE,
  TOTAL_AMOUNT_LOADED,
  LOAD_ADDITIONAL_JOBS,
  LOAD_ADDITIONAL_JOBS_SUCCESS,
  REMOVE_ADDITIONAL_JOB,
  GET_TOTAL_AMOUNT,
  SAVE_ADVERT,
  DELETE_ADVERT,
  SET_APP_STATE,
} from './constants';

/**
 * Load the repositories, this action starts the request saga
 *
 * @return {object} An action object with a type of LOAD_REPOS
 */
export function loadRepos() {
  return {
    type: LOAD_REPOS,
  };
}

/**
 * Dispatched when the repositories are loaded by the request saga
 *
 * @param  {array} repos The repository data
 * @param  {string} username The current username
 *
 * @return {object}      An action object with a type of LOAD_REPOS_SUCCESS passing the repos
 */
export function reposLoaded(repos, username) {
  return {
    type: LOAD_REPOS_SUCCESS,
    repos,
    username,
  };
}

/**
 * Dispatched when loading the repositories fails
 *
 * @param  {object} error The error
 *
 * @return {object}       An action object with a type of LOAD_REPOS_ERROR passing the error
 */
export function repoLoadingError(error) {
  return {
    type: LOAD_REPOS_ERROR,
    error,
  };
}

export function loadJobs() {
  return {
    type: LOAD_JOBS,
  };
}

export function loadAdditionalJobs(additional = {}) {
  return {
    type: LOAD_ADDITIONAL_JOBS,
    additional,
  };
}

const cleanJobData = (jobsData) =>  {
  let compArr = [];
  let expArr = [];
  let driveArr = [];
  let obj = {};
  let expObj = {};
  let areasObj = {};

  // console.log(jobsData);

  jobsData.rekryteringsbehov.forEach(job => {
    if (!areasObj[job.yrkesomrade.namn]) areasObj[job.yrkesomrade.namn] = [];
    areasObj[job.yrkesomrade.namn].push(job);

    job.matchningsresultat.efterfragat.forEach(merit => {
      if (merit.typ === 'KOMPETENS') compArr.push(merit);
      if (merit.typ === 'YRKE') expArr.push(merit);
      if (merit.typ === 'KORKORT') driveArr.push(merit);
    });
  });

  let areas = _.orderBy(Object.keys(areasObj).map(key => {
    let id;
    afAreas.forEach((area) => { if (key === area.namn) id = area.id; });
    return {
      namn: key,
      items: areasObj[key],
      amount: areasObj[key].length,
      id,
    };
  }), 'amount', 'desc');

  compArr.forEach(item => {
    obj[item.varde] ? obj[item.varde]++ : obj[item.varde] = 1;
  });
  compArr = compArr.map(item => {
    item.timesRequested = obj[item.varde];
    return item;
  });

  expArr.forEach(item => {
    expObj[item.varde] ? expObj[item.varde]++ : expObj[item.varde] = 1;
  });
  expArr = expArr.map(item => {
    item.timesRequested = expObj[item.varde];
    return item;
  });

  const competences = _.sortBy(_.uniqBy(compArr, 'varde'), ['efterfragat']);
  const experiences = _.uniqBy(expArr, 'varde');
  const driverLicenses = _.uniqBy(driveArr, 'varde');

  return {
    jobs: jobsData.rekryteringsbehov,
    amount: jobsData.antalRekryteringsbehov,
    related: jobsData.relateradeKriterier,
    driverLicenses,
    experiences,
    competences,
    areas,
  };
};

export function jobsLoaded(jobsData) {
  const data = cleanJobData(jobsData);

  return {
    type: LOAD_JOBS_SUCCESS,
    ...data,
  };
}

export function jobsLoadingError(error) {
  return {
    type: LOAD_JOBS_ERROR,
    error,
  };
}

export function additionalJobsLoaded(jobsData) {
  const data = cleanJobData(jobsData);

  return {
    type: LOAD_ADDITIONAL_JOBS_SUCCESS,
    data,
  };
}

export function removeAdditionalJob(index) {
  return {
    type: REMOVE_ADDITIONAL_JOB,
    index,
  };
}

export function getTotalAmount() {
  return {
    type: GET_TOTAL_AMOUNT,
  };
}

export function totalAmountLoaded({ data }) {
  return {
    type: TOTAL_AMOUNT_LOADED,
    amount: data.antalRekryteringsbehov,
  };
}

export function setCompetence(id) {
  return {
    type: SET_COMPETENCE,
    id,
  };
};

export function removeCompetence(id) {
  return {
    type: REMOVE_COMPETENCE,
    id,
  };
};

export function setExperience(id, years) {
  return {
    type: SET_EXPERIENCE,
    id,
    years,
  };
};

export function removeExperience(id) {
  return {
    type: REMOVE_EXPERIENCE,
    id,
  };
};

export function setDriversLicense(id) {
  return {
    type: SET_DRIVERS_LICENSE,
    id,
  };
};

export function removeDriversLicense(id) {
  return {
    type: REMOVE_DRIVERS_LICENSE,
    id,
  };
};

export function saveAdvert(ad) {
  return {
    type: SAVE_ADVERT,
    ad,
  };
};

export function removeAdvert(id) {
  return {
    type: DELETE_ADVERT,
    id,
  };
};

export function setAppState(state) {
  return {
    type: SET_APP_STATE,
    state,
  };
};