text:
/**
 *
 * @project        Motion Detection in JS
 * @file           ImageCompare.js
 * @description    Core functionality.
 * @author         Benjamin Horn
 * @package        MotionDetector
 * @version        -
 *
 */

;(function(App) {

	"use strict";

	/*
	 * The core motion detector. Does all the work.
	 *
	 * @return <Object> The initalized object.
	 *
	 */
	App.Core = function() {

		var rendering = false;

		var width = 64;
		var height = 48;

		var webCam = null;
		var imageCompare = null;

		var currentImage = null;
		var oldImage = null;

		var topLeft = [Infinity,Infinity];
		var bottomRight = [0,0];

		var raf = (function(){
			return  window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
			function( callback ){
				window.setTimeout(callback, 1000/60);
			};
		})();

		/*
		 * Initializes the object.
		 *
		 * @return void.
		 *
		 */
		function initialize() {
			imageCompare = new App.ImageCompare();
			webCam = new App.WebCamCapture(document.getElementById('webCamWindow'));

			rendering = true;

			main();
		}

		/*
		 * Compares to images and updates the position
		 * of the motion div.
		 *
		 * @return void.
		 *
		 */
		function render() {
			oldImage = currentImage;
			currentImage = webCam.captureImage(false);

			if(!oldImage || !currentImage) {
				return;
			}

			var vals = imageCompare.compare(currentImage, oldImage, width, height);

			topLeft[0] = vals.topLeft[0] * 10;
			topLeft[1] = vals.topLeft[1] * 10;

			bottomRight[0] = vals.bottomRight[0] * 10;
			bottomRight[1] = vals.bottomRight[1] * 10;

			document.getElementById('movement').style.top = topLeft[1] + 'px';
			document.getElementById('movement').style.left = topLeft[0] + 'px';

			document.getElementById('movement').style.width = (bottomRight[0] - topLeft[0]) + 'px';
			document.getElementById('movement').style.height = (bottomRight[1] - topLeft[1]) + 'px';

			topLeft = [Infinity,Infinity];
			bottomRight = [0,0]

		}

		/*
		 * The main rendering loop.
		 *
		 * @return void.
		 *
		 */
		function main() {
			try{
				render();
			} catch(e) {
				console.log(e);
				return;
			}

			if(rendering == true) {
				raf(main.bind(this));
			}
		}

		initialize();
	};
})(MotionDetector);


text:
npm-profile(1) -- Change settings on your registry profile
==========================================================

## SYNOPSIS

    npm profile get [--json|--parseable] [<property>]
    npm profile set [--json|--parseable] <property> <value>
    npm profile set password
    npm profile enable-2fa [auth-and-writes|auth-only]
    npm profile disable-2fa

## DESCRIPTION

Change your profile information on the registry.  This not be available if
you're using a non-npmjs registry.

* `npm profile get [<property>]`:
  Display all of the properties of your profile, or one or more specific
  properties.  It looks like:

```
+-----------------+---------------------------+
| name            | example                   |
+-----------------+---------------------------+
| email           | me@example.com (verified) |
+-----------------+---------------------------+
| two factor auth | auth-and-writes           |
+-----------------+---------------------------+
| fullname        | Example User              |
+-----------------+---------------------------+
| homepage        |                           |
+-----------------+---------------------------+
| freenode        |                           |
+-----------------+---------------------------+
| twitter         |                           |
+-----------------+---------------------------+
| github          |                           |
+-----------------+---------------------------+
| created         | 2015-02-26T01:38:35.892Z  |
+-----------------+---------------------------+
| updated         | 2017-10-02T21:29:45.922Z  |
+-----------------+---------------------------+
```

* `npm profile set <property> <value>`:
  Set the value of a profile property. You can set the following properties this way:
    email, fullname, homepage, freenode, twitter, github

* `npm profile set password`:
  Change your password.  This is interactive, you'll be prompted for your
  current password and a new password.  You'll also be prompted for an OTP
  if you have two-factor authentication enabled.

* `npm profile enable-2fa [auth-and-writes|auth-only]`:
  Enables two-factor authentication. Defaults to `auth-and-writes` mode. Modes are:
  * `auth-only`: Require an OTP when logging in or making changes to your
    account's authentication.  The OTP will be required on both the website
    and the command line.
  * `auth-and-writes`: Requires an OTP at all the times `auth-only` does, and also requires one when
    publishing a module, setting the `latest` dist-tag, or changing access
    via `npm access` and `npm owner`.

* `npm profile disable-2fa`:
  Disables two-factor authentication.

## DETAILS

All of the `npm profile` subcommands accept `--json` and `--parseable` and
will tailor their output based on those.  Some of these commands may not be
available on non npmjs.com registries.

## SEE ALSO

* npm-config(7)

redpajama_set_name: RedPajamaGithub


text:
%%
% 3.15) Develop an M-file function called rounder toround a number x to a
% specified number of decimal digits, n. The first line of the function
% should be set up as:
%
% function xr = rounder(x, n)
%
% Test the program by rounding each of the following to 2 decimal digits:
% x = 477.9587, ?477.9587, 0.125, 0.135, ?0.125, and ?0.135.
%
% NOTE: Main function name must be the same as the name of the m file
%

% Main function
function xr = ch3_ex15(x,n)
    % I use built-in vpa (variable-precision arithmetic) function to
    % round x to n significant digits
    xr = vpa(x,n)
end


text:
import pygame, pygame.image, pygame.mixer, pygame.font, pygame.transform
import pygame.draw
from pygame.locals import *

pygame.init()

###############################################################################
## Error classes ##############################################################
###############################################################################

class GamesError(Exception): pass

###############################################################################
## Mouse class ################################################################
###############################################################################

class Mouse(object):
    #------Properties--------#

    ## position
    def get_position(self):
        return pygame.mouse.get_pos()

    def set_position(self, new_position):
        pygame.mouse.set_pos(new_position)

    position = property(get_position, set_position)

    ## x
    def get_x(self):
        return pygame.mouse.get_pos()[0]

    def set_x(self, new_x):
        current_y = pygame.mouse.get_pos()[1]
        pygame.mouse.set_pos( (new_x, current_y) )

    x = property(get_x, set_x)

    ## y
    def get_y(self):
        return pygame.mouse.get_pos()[1]

    def set_y(self, new_y):
        current_mouse_x = pygame.mouse.get_pos()[0]
        pygame.mouse.set_pos( (current_x, new_y) )

    y = property(get_y, set_y)

    ## is visible
    def set_is_visible(self, new_visibility):
        pygame.mouse.set_visible(new_visibility)
    is_visible = property(fset = set_is_visible)

    def is_pressed(self, button_number):
        return pygame.mouse.get_pressed()[button_number] == 1

###############################################################################
## Keyboard class #############################################################
###############################################################################

class Keyboard(object):
    def is_pressed(self, key):
        return pygame.key.get_pressed()[key] == 1

###############################################################################
## Music class ################################################################
###############################################################################

class Music(object):
    def load(self, filename):
        pygame.mixer.music.load(filename)

    def play(self, loop=0):
        pygame.mixer.music.play(loop)

    def fadeout(self, millisec):
        pygame.mixer.music.fadeout(millisec)

    def stop(self):
        pygame.mixer.music.stop()

###############################################################################
## Screen class ###############################################################
###############################################################################
##
## The Screen object represents the playing area. Since we can have
## only one screen under pygame, it's just a handy container for stuff
##
###############################################################################

class Screen(object):

    initialized = 0

    def __init__ (self, width=640, height=480, fps=50):
        # Bomb if you try this more than once
        if Screen.initialized:
            raise GamesError, "Cannot have more than on Screen object"

        Screen.initialized = 1

        # Create the pygame display
        self._display = pygame.display.set_mode ((width, height), HWSURFACE)
        self._width = width
        self._height = height
        self._background = self._display.convert()

        # Initialize a list of objects in play
        self._objects = []
        # Initialize list dirty rectangles to be repainted
        self._dirtyrects = []

        # Time when we should draw the next frame
        self._next_tick = 0

        # Frames per second screen will be updated
        self._fps = fps

    #------Properties--------#

    ## width
    def get_width(self):
        return self._width

    width = property(get_width)

    ## height
    def get_height(self):
        return self._height

    height = property(get_height)

    ## fps
    def get_fps(self):
        return self._fps

    fps = property(get_fps)

    ## background
    def get_background(self):
        return self._background

    def set_background(self, new_background):
        """
        Set the background to the surface provided. Note that the
        surface should not have transparency set, or weird things
        will happen.
        """
        self._background = pygame.Surface((self._width, self._height))
        for x in range(0, self._width, new_background.get_width()):
            for y in range(0, self._height, new_background.get_height()):
                self._background.blit(new_background, (x, y))

        self._display.blit(self._background, (0,0))
        pygame.display.update()

    background = property(get_background, set_background)

    ## all objects
    def get_all_objects(self):
        """
        Returns a list of all the Sprites on the Screen.
        """
        return self._objects[:]
    all_objects = property(get_all_objects)

    ## event_grab
    def get_event_grab(self):
        return pygame.event.get_grab()

    def set_event_grab(self, new_status):
        pygame.event.set_grab(new_status)

    event_grab = property(get_event_grab, set_event_grab)

    def tick(self):
        """
        If you override the tick method in a subclass of the Screen
        class, you can specify actions which are carried out every
        tick.
        """
        pass

    def keypress(self, key):
        """
        If you override the keypress method, you will be able to
        handle individual keypresses instead of dealing with the
        keys held down as in the standard library
        """
        pass

    def handle_events(self):
        """
        If you override this method in a subclass of the Screen
        class, you can specify how to handle different kinds of
        events.  However you must handle the quit condition!
        """
        events = pygame.event.get()
        for event in events:
            if event.type == QUIT:
                self.quit()
            elif event.type == KEYDOWN:
                if event.key == K_ESCAPE:
                    self.quit()
                else:
                    self.keypress(event.key)

    def quit(self):
        """
        Calling this method will stop the main loop from running and
        make the graphics window disappear.
        """
        self._exit = 1

    def clear(self):
        """
        Destroy all objects on this Screen.
        """
        for object in self._objects[:]:
            object.destroy()
        self._objects = []

    def _update_display(self):
        """
        Get the actual display in sync with reality.
        """
        pygame.display.update(self._dirtyrects)
        self._dirtyrects = []

    def mainloop(self):
        """
        Run the pygame main loop. This will animate the objects on the
        screen and call their tick methods every tick.
        """
        self._exit = 0

        while not self._exit:
            self._wait_frame()

            for object in self._objects:
                object._erase()

            # Take a copy of the _objects list as it may get changed in place.
            for object in self._objects[:]:
                if object._tickable:
                    object._tick()

            self.tick()

            for object in self._objects:
                object._draw()

            self._update_display()

            self.handle_events()

        # Throw away any pending events.
        pygame.event.get()

    def _wait_frame (self):
        "Wait for the correct fps time to expire"
        this_tick = pygame.time.get_ticks()
        if this_tick < self._next_tick:
            pygame.time.delay(int(self._next_tick+0.5) - this_tick)
        self._next_tick = this_tick + (1000./self._fps)

    def overlapping_objects(self, rectangle):
        """
        Return list of all sprites which overlap given rectangle.
        """
        rect = pygame.Rect (rectangle)

        rect_list = []
        for obj in self._objects:
            rect_list.append (obj._rect)

        indices = rect.collidelistall (rect_list)

        over_objects = []
        for index in indices:
            if (self._objects[index]).is_collideable:
                over_objects.append (self._objects [index])

        return over_objects

    def _elevate(self, it, above=None):
        """
        Elevates an object to the top of the stack, or above the specified
        object.
        """
        # This makes sure we're always in a consistent state.
        objects = self._objects[:]
        # Remove the object from the list.
        objects.remove(it)
        if above == None:
            # Put it on top (the end).
            objects.append(it)
        else:
            # Put the object after <above>.
            idx = 1+objects.index(above)
            objects[idx:idx]=[it]
        # Install the new list.
        self._objects = objects

    def _lower(self, object, below=None):
        """
        Lower an object to the bottom of the stack, or below the specified
        object.
        """
        # This makes sure we're always in a consistent state.
        objects = self._objects[:]
        objects.remove(it)
        if below == None:
            # Put the object on the beginning (bottom) of the list.
            self._objects = [it]+objects
        else:
            # Put the object before (below) the aboject.
            idx = objects.index(below)
            objects[idx:idx]=[it]
            self._objects = objects

    def add(self, sprite):
        self._objects.append(sprite)

    def remove(self, sprite):
        try:
            self._objects.remove(sprite)
        except ValueError:
            # Already done it: happens in some games, not an error.
            pass

    def blit_and_dirty (self, source_surf, dest_pos):
        """
        You probably won't need to use this method in your own programs,
        as |Sprite| and its sub-classes know how to draw themselves on
        the screen. You'd need to use method if you wanted to draw an
        image on the screen which wasn't an |Sprite|.

        This method blits (draws, taking account of transparency) the
        given source surface |source_surf| to the screen at the position
        given by |dest_pos|.

        It then remembers the place where the surface was drawn as
        ``dirty''.  This means that when the display is updated on the
        next tick, this part of it will be redrawn.
        """
        rect = self._display.blit(source_surf, dest_pos)
        self._dirtyrects.append(rect)

    def blit_background(self, rect):
        """
        This method draws the background over the given rectangle, and
        marks that rectangle as ``dirty'' (see the |blit_and_dirty|
        method for what that means). It's used to erase an object before
        moving it. You shouldn't need to call it yourself.
        """
        rect = self._display.blit(self._background, rect, rect)
        self._dirtyrects.append(rect)

###############################################################################
## Sprite class ###############################################################
###############################################################################
##                                                                           ##
## Sprite represents a graphical object on the screen. Sprites               ##
## can be moved, rotated, deleted, and maybe have other things done to them. ##
##                                                                           ##
###############################################################################

class Sprite(object):
    def __init__(self, image, angle=0,
                 x=0, y=0,
                 top=None, bottom=None, left=None, right=None,
                 dx=0, dy=0,
                 interval=1, is_collideable=True):

        if not Screen.initialized:
            raise GamesError, "Screen object must be intialized before any Sprite object"

        self._surface = image
        self._orig_surface = image    # Surface before any rotation
        self._rect = self._surface.get_rect()

        self.position = (x, y)

        if top != None:
            self.top = top
        if bottom != None:
            self.bottom = bottom
        if left != None:
            self.left = left
        if right != None:
            self.right = right

        self.velocity = (dx, dy)

        self._angle = angle % 360
        if self._angle != 0:
            self._rotate()

        self.is_collideable = is_collideable

        self._interval = interval
        self._tickable = 1
        self._next = 0

        self._gone = 0

    def __del__(self):
        if screen and not self._gone:
            self.destroy()

    def _draw(self):
        """
        Draw object on screen by blitting the image onto the screen.
        """
        screen.blit_and_dirty(self._surface, self._rect)

    def _erase(self):
        """
        Erase object from screen by blitting the background over where
        it was.
        """
        screen.blit_background(self._rect)

    def _replace(self, new_surface):
        x, y = self.position
        self._surface = new_surface
        self._rect = self._surface.get_rect()
        self.position = (x, y)

    def _rotate(self):
        self._replace(pygame.transform.rotate(self._orig_surface, -self._angle))

    def _tick(self):
        self._next = self._next + 1
        if self._next >= self._interval:
            self._next = 0
            self.tick()
        if self._dx or self._dy:
            self.position = ( (self._x + self._dx), (self._y + self._dy) )
        self.update()

    def start (self):
        self._tickable = 1
        self._next = 0

    def stop (self):
        self._tickable = 0

    def update(self):
        pass

    def tick(self):
        pass

    def overlaps(self, other):
        if not self.is_collideable or not other.is_collideable:
            return False
        else:
            return self._rect.colliderect(other._rect)

    def elevate(self, above=None):
        """
        Elevate an object to the top of the stack, or above the specified
        object.
        """
        screen._elevate(self, above)

    def lower(self, below=None):
        """
        Lower an object to the bottom of the stack, or below the specified
        object.
        """
        screen._lower(self, below)

    def destroy(self):
        """
        Erase object from screen and remove it from the list of objects
        maintained by games module.
        """
        self._erase()
        screen.remove(self)
        self._gone = 1

    #------Properties--------#

    ## x
    def get_x(self):
        return self._x
    def set_x(self, new_x):
        self._x = new_x
        self._rect.centerx = int(self._x)
    x = property(get_x, set_x)

    ## y
    def get_y(self):
        return self._y
    def set_y(self, new_y):
        self._y = new_y
        self._rect.centery = int(self._y)
    y = property(get_y, set_y)

    ## position
    def get_position(self):
        return ( (self.x, self.y) )
    def set_position(self, new_position):
        self.x, self.y = new_position
    position = property(get_position, set_position)

    ## dx
    def get_dx(self):
        return self._dx
    def set_dx(self, new_dx):
        self._dx = new_dx
    dx = property(get_dx, set_dx)

    ## dy
    def get_dy(self):
        return self._dy
    def set_dy(self, new_dy):
        self._dy = new_dy
    dy = property(get_dy, set_dy)

    ## velocity
    def get_velocity(self):
        return ( (self.dx, self.dy) )
    def set_velocity (self, new_velocity):
        self.dx, self.dy = new_velocity
    velocity = property(get_velocity, set_velocity)

    ## left
    def get_left(self):
        return self._rect.left
    def set_left(self, new_left):
        self._rect.left = new_left
        self._x = self._rect.centerx
    left = property(get_left, set_left)

    ## right
    def get_right(self):
        return self._rect.right
    def set_right(self, new_right):
        self._rect.right = new_right
        self._x = self._rect.centerx
    right = property(get_right, set_right)

    ## top
    def get_top(self):
        return self._rect.top
    def set_top(self, new_top):
        self._rect.top = new_top
        self._y = self._rect.centery
    top = property(get_top, set_top)

    ## bottom
    def get_bottom(self):
        return self._rect.bottom
    def set_bottom(self, new_bottom):
        self._rect.bottom = new_bottom
        self._y = self._rect.centery
    bottom = property(get_bottom, set_bottom)

    ## angle
    def get_angle(self):
        return self._angle
    def set_angle(self, new_angle):
        self._angle = new_angle % 360
        self._rotate()
    angle = property(get_angle, set_angle)

    ## image
    def get_image(self):
        return self._orig_surface
    def set_image(self, new_image):
        self._orig_surface = new_image
        if self._angle != 0:
            self._rotate()
        else:
            self._replace(new_image)
    image = property(get_image, set_image)

    ## height
    def get_height(self):
        return self._surface.get_height()
    height = property(get_height)

    ## width
    def get_width(self):
        return self._surface.get_width()
    width = property(get_width)

    ## is_collideable
    def get_is_collideable(self):
        return self._is_collideable
    def set_is_collideable(self, new_status):
        self._is_collideable = new_status
    is_collideable = property(get_is_collideable, set_is_collideable)

    ## overlapping_sprites
    def get_overlapping_sprites(self):
        overlapping = screen.overlapping_objects(self._rect)
        if self in overlapping:
            overlapping.remove(self)
        return overlapping
    overlapping_sprites = property(get_overlapping_sprites)

    ## interval
    def get_interval(self):
        return self._interval
    def set_interval(self, new_interval):
        self._interval = new_interval
    interval = property(get_interval, set_interval)

class Text(Sprite):
    """
    Alphanumeric values displayed on the screen.
    """
    def __init__(self, value, size, color, angle=0,
                 x=0, y=0,
                 top=None, bottom=None, left=None, right=None,
                 dx=0, dy=0,
                 interval=1, is_collideable=True):
        self._size = size
        self._color = color
        self._value = value
        self._font = pygame.font.Font(None, self._size)
        Sprite.__init__(self, self._create_surface(), angle,
                        x, y,
                        top, bottom, left, right,
                        dx, dy,
                        interval, is_collideable)

    def _create_surface(self):
        return self._font.render(str(self._value), 1, self._color)

    #------Properties--------#

    ## value
    def get_value(self):
        return self._value

    def set_value(self, new_value):
        if new_value != self._value:
            self._value = new_value
            self.image = self._create_surface()

    value = property(get_value, set_value)

    ## color
    def get_color(self):
        return self._color

    def set_color(self, new_color):
        if new_color != self._color:
            self._color = new_color
            surface = self._create_surface()
            self.image = surface

    color = property(get_color, set_color)

    ## size
    def get_size(self):
        return self._size

    def set_size(self, new_size):
        if new_size != self._size:
            self._size = new_size
            self._font = pygame.font.Font(None, self._size)
            surface = self._create_surface()
            self.image = surface

    size = property(get_size, set_size)

class Question(Text):
    def __init__(self, value, size, color, angle=0,
                 x=0, y=0,
                 top=None, bottom=None, left=None, right=None,
                 dx=0, dy=0,
                 interval=1, is_collideable=True, responses=()):
        Text.__init__(self, value, size, color, angle,
                      x, y,
                      top, bottom, left, right,
                      dx, dy,
                      interval, is_collideable)
        self.responses = responses

    def tick(self):
        for key, action in self.responses:
            if keyboard.is_pressed(key):
                action()

class Message(Text):
    def __init__(self, value, size, color, angle=0,
                 x=0, y=0,
                 top=None, bottom=None, left=None, right=None,
                 dx=0, dy=0,
                 lifetime=0, is_collideable=True, after_death=None):
        Text.__init__(self, value, size, color, angle,
                      x, y,
                      top, bottom, left, right,
                      dx, dy,
                      lifetime, is_collideable)
        self._after_death = after_death

    def tick(self):
        if self._after_death:
            self._after_death()
        self.stop()
        self.destroy()

class Animation(Sprite):
    """
    An image that changes every repeat_interval ticks.
    The n_repeats parameter is the number of complete animation cycles to show.
    If n_repeats <= 0, the animation will repeat forever.
    You can give list of filenames or list of images.
    """
    def __init__(self, images, angle=0,
                 x=0, y=0,
                 top=None, bottom=None, left=None, right=None,
                 dx=0, dy=0,
                 repeat_interval=1, n_repeats=0, is_collideable=True):

        if images and type(images[0]) is type(""):
	    images = load_animation(images)

        self.images = images
      	if self.images == []:
	    raise GamesError, "An animation with no images is illegal."

	self.n_repeats = n_repeats or -1
	if self.n_repeats > 0:
            self.n_repeats = (self.n_repeats * len(self.images))

        first_image = self.next_image()

        Sprite.__init__(self, self.next_image(), angle,
                        x, y,
                        top, bottom, left, right,
                        dx, dy,
                        repeat_interval, is_collideable)

    def next_image(self):
        if self.n_repeats==0: return None
        if self.n_repeats>0: self.n_repeats -= 1
        new_image = self.images[0]
        self.images = self.images[1:] + [self.images[0]]
        return new_image

    def tick(self):
        new_image = self.next_image()
	if new_image is None:
            self.destroy()
        else:
            self.image = new_image

###############################################################################
## Utility Functions
###############################################################################
def load_image(filename, transparent=True):
    """Loads an image, prepares it for play. Returns a pygame.Surface object
    which you can give as the "image" parameter to Sprite.

    filename -- the filename of the image to load
    transparent -- whether the background of the image should be transparent.
                   Defaults to true.
                   The background color is taken as the color of the pixel
                   at (0,0) in the image.
    """
    try:
        surface = pygame.image.load(filename)
    except pygame.error:
        raise GamesError, 'Could not load image "%s" %s'%(filename, pygame.get_error())
    if transparent:
        corner = surface.get_at((0, 0))
        surface.set_colorkey(corner, RLEACCEL)
    return surface.convert()

def scale_image(image, x_scale, y_scale=None):
    if y_scale is None: y_scale = x_scale
    (x_size, y_size) = image.get_size()
    x_size = x_size * x_scale
    y_size = y_size * y_scale
    return pygame.transform.scale(image, (x_size, y_size))

def load_animation(filenames, transparent=1):
    """
    Loads a number of files.  Receives file names.  Returns corresponding file objects
    needed by the Animation constructor.
    """
    def _(name, transparent=transparent):
        try: surface = pygame.image.load(name)
	except pygame.error:
	    raise GamesError, 'Could not load animation frame "%s": %s' % (
	        name, pygame.get_error())
        if transparent:
	    surface.set_colorkey(surface.get_at((0,0)), RLEACCEL)
	return surface.convert()
    files = map(_, filenames)
    return files

def load_sound(filename):
    """
    Load a sound file, returning a Sound object.
    """
    return pygame.mixer.Sound(filename)

###############################################################################
## Initialization Function
###############################################################################
def init(screen_width = 640, screen_height = 480, fps = 50):
    global screen, mouse, keyboard, music
    screen = Screen(screen_width, screen_height, fps)
    mouse = Mouse()
    keyboard = Keyboard()
    music = Music()


text:
        Trips

        <button>Create</button>

        Sort
        <select id="tripsSortId" ng-model="orderBy">
            <option value="driver">Driver</option>
            <option value="date">Date</option>
            <option value="seats">Seats</option>
            <option value="from">From</option>
            <option value="to">To</option>
        </select>

        Order
        <select id="tripsOrderTypeId" ng-model="orderType">
            <option value="asc">Ascending</option>
            <option value="desc">Descending</option>
        </select>

        From
        <select name="from" id="from" ng-model="from">
            <option ng-repeat="city in cities" value="{{city}}">{{city}}</option>
        </select>
        To
        <select name="to" id="to" ng-model="to">
            <option ng-repeat="city in cities" value="{{city}}">{{city}}</option>
        </select>

        Include finished
        <input id="isFinished" type="checkbox" ng-model="isFinished" />

        Only mine
        <input id="mineTrips" type="checkbox" ng-model="onlyMineTrips" />

        Filtered pagging

            <button ng-disabled="page <= 1" ng-click="getTripsFilteredPaged(page - 1, orderBy, orderType, from, to , isFinished, onlyMineTrips)">
                Previous
            </button>
            <input type="number" min="1" ng-model="page" />
            <button ng-click="getTripsFilteredPaged(page, orderBy, orderType, from, to , isFinished, onlyMineTrips)">
                Page {{page}}
            </button>
            <button ng-click="getTripsFilteredPaged(page + 1, orderBy, orderType, from, to , isFinished, onlyMineTrips)">
                Next
            </button>

            Not filtered pagging (some filters apply on user site)
            <button ng-disabled="page <= 1" ng-click="getTripsByPageOnly(page - 1)" title="Do not sent filter params, they apply on client side!">
                Previous
            </button>
            <input type="number" min="1" ng-model="page" />
            <button ng-click="getTripsByPageOnly(page)" title="Do not sent filter params, they apply on client side!">
                Page {{page}}
            </button>
            <button ng-click="getTripsByPageOnly(page + 1)" title="Do not sent filter params, they apply on client side!">
                Next
            </button>

                Driver
                From
                To
                Departure time
                Is Mine

No Results!


text:
Ki67 Breast
==========
This software refers to this [article](http://www.ncbi.nlm.nih.gov/pubmed/27093453) published in Applied Immunohistochemistry & Molecular Morphology. The article is available as open source manuscript.

Prerequisites and software installation
This software requires installation of imageJ, an open source software written in Java, available for Linux, Mac OS X and Windows. ImageJ is available [here](https://imagej.nih.gov/ij/). Basic understanding of ImageJ will facilitate installation.
Current software (**BreastKi67.txt**) is a "toolset" written in imagej macro language and requires to be installed in the following directory:
```
→ ImageJ → macros → toolsets.
```

One additional "plugins" is required:
* Color Deconvolution plugin written by Gabriel Landini is available [here] (http://www.mecourse.com/landinig/software/cdeconv/cdeconv.html) with documentation.

Colour deconvolution name is: "Colour_Deconvolution.class" and has to be installed in the following directory
```
→ ImageJ → plugins
```
Prerequisites for IHC analysis
==========
Since the purpose of this analysis is to be a predictor of MYC dysregulation, It is expected that pre-analytical and analytical factors related to tissue handling are optimized and controlled as other [class II Biomarkers] (http://www.ncbi.nlm.nih.gov/pubmed/26286753)

Chromogen color properties (DAB and RED) might vary significantly among laboratories: for optimal color separation using color deconvolution algarithm, it is expected that individual laboratory measures as precisely as possible the "Optical Density (OD) Unitary Vectors" of each individual stain. This is achieved using preparation with pure stain (i.e. DAB alone and RED alone). Measured OD Unitary Vectors can be set in the software (see icon action below).
In order to measure OD Unitary Vectors, you can utilize this [open source software] (http://imagejdocu.tudor.lu/doku.php?id=plugin:color:colour_deconvolution:optimizing_selection_of_unitary_optical_density_vectors:start). For more details, please refer to this article [Color deconvolution. Optimizing handling of 3D unitary optical density vectors with polar coordinates.](http://www.ncbi.nlm.nih.gov/pubmed/23016461).

Operator is expected to grab multiple areas of viable tumour with maximal proliferation (High Ki67). The picture should be saved without compression as an ImageJ stack.

Operator is expected to grab a picture with a priori correction of background illumination as explained [here] (http://imagejdocu.tudor.lu/doku.php?id=howto:working:how_to_correct_background_illumination_in_brightfield_microscopy) by Gabriel Landini.

This involves multiple steps a) Image acquisition of a white field without oversaturation and white balance of RGB channels b) Image acquisition of a black field c) Image acquisition of the tissue specimen and d) the correction itself. These steps are available in the current software if you use a Qimaging Camera. If not, the code could be adapted using a different camera and for instance a TWAIN plugin: see [here](https://imagej.nih.gov/ij/plugins/index.html#acq). This requires help from IT person or someone familiar with ImageJ and coding.
Software utilization
---------------
![hello](/pictures/KI67BreastImageJ.png)

Icon action | Description
------------ | -------------
![](/pictures/selector.png) | Select BreastKi67 to launch the BreastKi67 toolbar
![](/pictures/camera.png) | This only works if a [Qimaging camera](http://www.qimaging.com/) and AcquireQCam plugins are installed. (read paragraph above)
![](/pictures/key.png) | Open a stack of image. You can download and use a stack image sample (see below)
![](/pictures/cytokerat.png) | Under your surveillance assess the best cytokeratin mask (The algorithm will try to provide a good threshold - if unsatisfactory, you can manually adjust the threshold yourself).
![](/pictures/ki67.png) | Under your surveillance assess the best cytokeratin mask (The algorithm will try to provide a good threshold - if unsatisfactory, you can manually adjust the threshold yourself).
![](/pictures/lunettes.png) | Verify the creates mask - if needed repeat previous steps.
![](/pictures/sigma.png) | Calculate the Vv ratio.
![](/pictures/setup.png) | Various setup - some sub-menu will require to check one box to exit (read labeling).

Stack Image sample
-----------------
You can use this small [stack](/pictures/sample.tif) to test the software. A minimum of 2 pictures is expected per stack. The following picture is **only** a representation of the stack available above.

Feedback
-----------------

Please send me your feedback at gilbert.bigras@ahs.ca


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Sports - Alvaro's Blog</title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://amuhle.github.io/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//amuhle.github.io/themes/casper/assets/css/screen.css?v=1470839644497" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400" />

    <link rel="canonical" href="https://amuhle.github.io/https://amuhle.github.io/tag/Sports/" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="Alvaro's Blog" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Sports - Alvaro's Blog" />
    <meta property="og:url" content="https://amuhle.github.io/https://amuhle.github.io/tag/Sports/" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Sports - Alvaro's Blog" />
    <meta name="twitter:url" content="https://amuhle.github.io/https://amuhle.github.io/tag/Sports/" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="Alvaro's Blog" href="https://amuhle.github.io/rss/" />

Sports

                    A 1-post collection

        Page 1 of 1

What have I done all these years?

"An investment in knowledge always pays the best interest": Benjamin Franklin Many years have passed since I have the idea to start a blog, but my »

            Alvaro Muhlethaler
             on Blogging,  Life,  Software Development,  Sports,  Cook
            <time class="post-date" datetime="2016-08-04">04 August 2016</time>

        Page 1 of 1

Alvaro's Blog © 2016

Proudly published with HubPress


text:
To open up debugging console, right click on an element and select Inspect.

``` python
import webview

if __name__ == '__main__':
    webview.create_window('Debug window', 'https://pywebview.flowrl.com/hello')
    webview.start(debug=True)
```


text:
using ICSharpCode.TextEditor.Document;
using System;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
namespace ICSharpCode.TextEditor
{
    public class GutterMargin : AbstractMargin, IDisposable
    {
        private StringFormat numberStringFormat = (StringFormat)StringFormat.GenericTypographic.Clone();
        public static Cursor RightLeftCursor;
        public override Cursor Cursor
        {
            get
            {
                return GutterMargin.RightLeftCursor;
            }
        }
        public override Size Size
        {
            get
            {
                return new Size(this.textArea.TextView.WideSpaceWidth * Math.Max(3, (int)Math.Log10((double)this.textArea.Document.TotalNumberOfLines) + 1), -1);
            }
        }
        public override bool IsVisible
        {
            get
            {
                return this.textArea.TextEditorProperties.ShowLineNumbers;
            }
        }
        static GutterMargin()
        {
            Stream manifestResourceStream = ResourceExts.GetStream("RightArrow.cur");
            if(manifestResourceStream == null)
            {
                throw new Exception("could not find cursor resource");
            }
            GutterMargin.RightLeftCursor = new Cursor(manifestResourceStream);
            manifestResourceStream.Close();
        }
        public void Dispose()
        {
            this.numberStringFormat.Dispose();
        }
        public GutterMargin(TextArea textArea)
            : base(textArea)
        {
            this.numberStringFormat.LineAlignment = StringAlignment.Far;
            this.numberStringFormat.FormatFlags = (StringFormatFlags.FitBlackBox | StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.NoWrap | StringFormatFlags.NoClip);
        }
        public override void Paint(Graphics g, Rectangle rect)
        {
            if(rect.Width <= 0 || rect.Height <= 0)
            {
                return;
            }
            HighlightColor colorFor = this.textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers");
            int fontHeight = this.textArea.TextView.FontHeight;
            Brush brush = this.textArea.Enabled ? BrushRegistry.GetBrush(colorFor.BackgroundColor) : SystemBrushes.InactiveBorder;
            Brush brush2 = BrushRegistry.GetBrush(colorFor.Color);
            for(int i = 0 ; i < (base.DrawingPosition.Height + this.textArea.TextView.VisibleLineDrawingRemainder) / fontHeight + 1 ; i++)
            {
                int y = this.drawingPosition.Y + fontHeight * i - this.textArea.TextView.VisibleLineDrawingRemainder;
                Rectangle rectangle = new Rectangle(this.drawingPosition.X, y, this.drawingPosition.Width, fontHeight);
                if(rect.IntersectsWith(rectangle))
                {
                    g.FillRectangle(brush, rectangle);
                    int firstLogicalLine = this.textArea.Document.GetFirstLogicalLine(this.textArea.Document.GetVisibleLine(this.textArea.TextView.FirstVisibleLine) + i);
                    if(firstLogicalLine < this.textArea.Document.TotalNumberOfLines)
                    {
                        g.DrawString((firstLogicalLine + 1).ToString(), colorFor.GetFont(base.TextEditorProperties.FontContainer), brush2, rectangle, this.numberStringFormat);
                    }
                }
            }
        }
        public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons)
        {
            this.textArea.SelectionManager.selectFrom.where = 1;
            int logicalLine = this.textArea.TextView.GetLogicalLine(mousepos.Y);
            if(logicalLine >= 0 && logicalLine < this.textArea.Document.TotalNumberOfLines)
            {
                if((Control.ModifierKeys & Keys.Shift) != Keys.None)
                {
                    if(this.textArea.SelectionManager.HasSomethingSelected || logicalLine == this.textArea.Caret.Position.Y)
                    {
                        MouseEventArgs e = new MouseEventArgs(mouseButtons, 1, mousepos.X, mousepos.Y, 0);
                        this.textArea.RaiseMouseMove(e);
                        return;
                    }
                    TextLocation position;
                    if(logicalLine < this.textArea.Caret.Position.Y)
                    {
                        position = this.textArea.Caret.Position;
                        this.textArea.SelectionManager.SetSelection(new DefaultSelection(this.textArea.Document, position, new TextLocation(position.X, position.Y)));
                        this.textArea.SelectionManager.ExtendSelection(new TextLocation(position.X, position.Y), new TextLocation(0, logicalLine));
                        this.textArea.Caret.Position = new TextLocation(0, logicalLine);
                        return;
                    }
                    position = this.textArea.Caret.Position;
                    if(logicalLine < this.textArea.Document.TotalNumberOfLines - 1)
                    {
                        this.textArea.SelectionManager.SetSelection(new DefaultSelection(this.textArea.Document, position, new TextLocation(0, logicalLine + 1)));
                        this.textArea.Caret.Position = new TextLocation(0, logicalLine + 1);
                        return;
                    }
                    this.textArea.SelectionManager.SetSelection(new DefaultSelection(this.textArea.Document, position, new TextLocation(this.textArea.Document.GetLineSegment(logicalLine).Length + 1, logicalLine)));
                    this.textArea.Caret.Position = new TextLocation(this.textArea.Document.GetLineSegment(logicalLine).Length + 1, logicalLine);
                    return;
                }
                else
                {
                    this.textArea.mousepos = mousepos;
                    TextLocation position = new TextLocation(0, logicalLine);
                    this.textArea.SelectionManager.ClearSelection();
                    if(logicalLine < this.textArea.Document.TotalNumberOfLines - 1)
                    {
                        this.textArea.SelectionManager.SetSelection(new DefaultSelection(this.textArea.Document, position, new TextLocation(position.X, position.Y + 1)));
                        this.textArea.Caret.Position = new TextLocation(position.X, position.Y + 1);
                        return;
                    }
                    this.textArea.SelectionManager.SetSelection(new DefaultSelection(this.textArea.Document, new TextLocation(0, logicalLine), new TextLocation(this.textArea.Document.GetLineSegment(logicalLine).Length + 1, position.Y)));
                    this.textArea.Caret.Position = new TextLocation(this.textArea.Document.GetLineSegment(logicalLine).Length + 1, position.Y);
                }
            }
        }
    }
}


text:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
CREATE USER 'dev'@'localhost' IDENTIFIED BY 'dev';
GRANT ALL PRIVILEGES ON `dev\_%`.* TO 'dev'@'localhost';
FLUSH PRIVILEGES;


text:
import * as React from "react";

/**
 * I declare the required props here, I do not necessarily have to export this
 * interface. TypeScript will still enforce it.
 */
interface Props {
  // The type of this is a function that expects a string, and returns nothing.
  onChoice: (pill: string) => void;
}

/**
 * This component presents a couple of buttons, clicking each button will call
 * our onChoice callback with a different value.
 *
 * Notice again the use of destructuring to get the onChoice from props.
 *
 * This function uses React.Fragment, which is a way of returning multiple
 * components side by side without having to wrap them in a <div> tag.
 *
 * In this component, the onClick handlers are being created inline, later we
 * will do this differently because as it stands successive calls to render
 * (and they happen a LOT) will generate a new function each time.
 *
 * @param param0 The props
 */
export const PillChoice: React.FunctionComponent<Props> = ({ onChoice }) => {
  // Demonstrate memoization
  const setBlue = React.useCallback(() => onChoice("blue"), [onChoice]);
  const setRed = React.useCallback(() => onChoice("red"), [onChoice]);

  return (
    <React.Fragment>
      <button onClick={setBlue}>Blue</button>
      <button onClick={setRed}>Red</button>
    </React.Fragment>
  );
};

export default PillChoice;


text:
using System;
using System.Diagnostics.CodeAnalysis;
using System.Web.Mvc;
using CKS.Prototype.Filters;

namespace CKS.Prototype
{
    [ExcludeFromCodeCoverage]
    public static class FilterConfig
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            if (filters == null) throw new ArgumentNullException("filters");
            filters.Add(new HandleErrorAttribute());
            filters.Add(new AjaxCrawlableAttribute());
        }
    }
}


text:
namespace TeamJaxConsoleGame.Lib.Factory.LocationEntitiesFactory
{
    using System;
    using Interfaces;
    using TeamJaxConsoleGame.Lib.Entities;

    /// <summary>
    /// The 'ConcreteFactory1' class
    /// </summary>
    public class KalimdorFactory : GameFactory
    {
        public override IFighter CreateEnemyEntity()
        {
            return new Enemy("Town thief", 1, 2, 5,2,2,2,2);
        }

        public void CreateTrader()
        {
            throw new NotImplementedException();
        }
    }
}


text:
package org.drools.impl.adapters;

import org.drools.event.process.ProcessEventListener;
import org.drools.event.rule.WorkingMemoryEventListener;
import org.drools.runtime.KnowledgeRuntime;
import org.drools.runtime.process.NodeInstance;
import org.drools.runtime.process.ProcessInstance;
import org.drools.runtime.rule.FactHandle;
import org.drools.runtime.rule.PropagationContext;
import org.kie.api.event.process.ProcessCompletedEvent;
import org.kie.api.event.process.ProcessNodeLeftEvent;
import org.kie.api.event.process.ProcessNodeTriggeredEvent;
import org.kie.api.event.process.ProcessStartedEvent;
import org.kie.api.event.process.ProcessVariableChangedEvent;
import org.kie.api.event.rule.ObjectDeletedEvent;
import org.kie.api.event.rule.ObjectInsertedEvent;
import org.kie.api.event.rule.ObjectUpdatedEvent;

public class ProcessEventListenerAdapter implements org.kie.api.event.process.ProcessEventListener {

    private final ProcessEventListener delegate;

    public ProcessEventListenerAdapter(ProcessEventListener delegate) {
        this.delegate = delegate;
    }

	public void beforeProcessStarted(final ProcessStartedEvent event) {
        delegate.beforeProcessStarted(new org.drools.event.process.ProcessStartedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
	}

	public void afterProcessStarted(final ProcessStartedEvent event) {
        delegate.afterProcessStarted(new org.drools.event.process.ProcessStartedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
	}

	public void beforeProcessCompleted(final ProcessCompletedEvent event) {
        delegate.beforeProcessCompleted(new org.drools.event.process.ProcessCompletedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
	}

	public void afterProcessCompleted(final ProcessCompletedEvent event) {
        delegate.afterProcessCompleted(new org.drools.event.process.ProcessCompletedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
        });
	}

	public void beforeNodeTriggered(final ProcessNodeTriggeredEvent event) {
        delegate.beforeNodeTriggered(new org.drools.event.process.ProcessNodeTriggeredEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public NodeInstance getNodeInstance() {
				return new NodeInstanceAdapter(event.getNodeInstance());
			}
        });
	}

	@Override
	public void afterNodeTriggered(final ProcessNodeTriggeredEvent event) {
        delegate.afterNodeTriggered(new org.drools.event.process.ProcessNodeTriggeredEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public NodeInstance getNodeInstance() {
				return new NodeInstanceAdapter(event.getNodeInstance());
			}
        });
	}

	@Override
	public void beforeNodeLeft(final ProcessNodeLeftEvent event) {
        delegate.beforeNodeLeft(new org.drools.event.process.ProcessNodeLeftEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public NodeInstance getNodeInstance() {
				return new NodeInstanceAdapter(event.getNodeInstance());
			}
        });
	}

	@Override
	public void afterNodeLeft(final ProcessNodeLeftEvent event) {
        delegate.afterNodeLeft(new org.drools.event.process.ProcessNodeLeftEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public NodeInstance getNodeInstance() {
				return new NodeInstanceAdapter(event.getNodeInstance());
			}
        });
    }

	@Override
	public void beforeVariableChanged(final ProcessVariableChangedEvent event) {
        delegate.beforeVariableChanged(new org.drools.event.process.ProcessVariableChangedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public String getVariableId() {
				return event.getVariableId();
			}
			public String getVariableInstanceId() {
				return event.getVariableInstanceId();
			}
			public Object getOldValue() {
				return event.getOldValue();
			}
			public Object getNewValue() {
				return event.getNewValue();
			}
        });
	}

	@Override
	public void afterVariableChanged(final ProcessVariableChangedEvent event) {
        delegate.afterVariableChanged(new org.drools.event.process.ProcessVariableChangedEvent() {
			public ProcessInstance getProcessInstance() {
				return new ProcessInstanceAdapter(event.getProcessInstance());
			}
            public KnowledgeRuntime getKnowledgeRuntime() {
                return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime());
            }
			public String getVariableId() {
				return event.getVariableId();
			}
			public String getVariableInstanceId() {
				return event.getVariableInstanceId();
			}
			public Object getOldValue() {
				return event.getOldValue();
			}
			public Object getNewValue() {
				return event.getNewValue();
			}
        });
	}
}


text:
<?php
namespace Stream\Factory\Form;

use Stream\Form\ChannelForm;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;

class ChannelFormFactory implements FactoryInterface
{
    public function createService(ServiceLocatorInterface $serviceManager)
    {
        $realSm = $serviceManager->getServiceLocator();

        return new ChannelForm(
            $realSm->get('doctrine.entitymanager.orm_default')
        );
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Code Igniter User Guide</title>

<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
<meta name='author' content='Rick Ellis' />
<meta name='description' content='Code Igniter User Guide' />

Code Igniter User Guide Version 1.3.2

Full Table of Contents

Code Igniter Home  ›
User Guide Home  ›
Loader Class

<form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="www.codeigniter.com/user_guide/" />Search User Guide  <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" /> <input type="submit" class="submit" name="sa" value="Go" /></form>

Loader Class

Loader, as the name suggests, is used to load elements.  These elements can be libraries (classes) View files,
Helpers, Plugins, or your own files.

Note: This class is initialized automatically by the system so there is no need to do it manually.

The following functions are available in this class:

$this->load->view('<var>file_name</var>', <samp>$data</samp>, true/false)

This function is used to load your View files.  If you haven't read the Views section of the
user guide it is recommended that you do since it shows you how this function is typically used.

The first parameter is required.  It is the name of the view file you would like to load.

The second optional parameter can take
an associative array or an object as input, which it runs through the PHP extract function to
convert to variables that can be used in your view files.  Again, read the Views page to learn
how this might be useful.

The third optional parameter lets you change the behavior of the function so that it returns data as a string
rather than sending it to your browser.  This can be useful if you want to process the data in some way.  If you
set the parameter to true (boolean) it will return data.  The default behavior is false, which sends it
to your browser.  Remember to assign it to a variable if you wan the data returned:

$string = $this->load->view('<var>myfile</var>', '', true);

$this->load->library('<var>class_name</var>')

This function is used to load core classes.  Where <var>class_name</var> is the name of the class you want to load.
Note: We use the terms "class" and "library" interchangeably.

For example, if you would like to send email with Code Igniter, the first step is to load the email class within your controller:

$this->load->library('email');

Once loaded, the library will be ready for use.  Each library is described in detail in its own page, so please read the
information regarding each one you would like to use.

$this->load->database('<var>options</var>', true/false)

This function lets you load the database class.  The two parameters are optional.  Please see the
database section for more info.

$this->load->scaffolding('<var>table_name</var>')

This function lets you enable scaffolding.  Please see the
scaffolding section for more info.

$this->load->vars(<samp>$array</samp>)

This function takes an associative array as input and generates variables using the PHP extract function.
This function produces the same result as using the second parameter of the <dfn>$this->load->view()</dfn> function above.  The reason you might
want to use this function independently is if you would like to set some global variables in the constructor of your controller
and have them become available in any view file loaded from any function.  You can have multiple calls to this function.  The data get cached
and merged into one array for conversion to variables.

$this->load->helper('<var>file_name</var>')

This function loads helper files, where <var>file_name</var> is the name of the file, without the _helper.php extension.

$this->load->plugin('<var>file_name</var>')

This function loads plugins files, where <var>file_name</var> is the name of the file, without the _plugin.php extension.

$this->load->file('<var>filepath/filename</var>', true/false)

This is a generic file loading function.  Supply the filepath and name in the first parameter and it will open and read the file.
By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean)
it will instead return the data as a string.

$this->load->lang('<var>file_name</var>')

This function is an alias of the language loading function: $this->lang->load()

$this->load->config('<var>file_name</var>')

This function is an alias of the config file loading function: $this->config->load()

Previous Topic:  Input Class
   ·
Top of Page   ·
User Guide Home   ·
Next Topic:  Language Class

Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.


text:
set PATH=%PATH%;C:\local\jom

rem bash variables can interfer
set MAKEFLAGS=


text:
HRESULT GoVboxFAILED(HRESULT result);
HRESULT GoVboxArrayOutFree(void* array);
void GoVboxUtf8Free(char* cstring);

HRESULT GoVboxGetUsbControllerName(IUSBController* ccontroller,
    char** cname) {
  BSTR wname = NULL;
  HRESULT result = IUSBController_GetName(ccontroller, &wname);
  if (FAILED(result))
    return result;

  g_pVBoxFuncs->pfnUtf16ToUtf8(wname, cname);
  g_pVBoxFuncs->pfnComUnallocString(wname);
  return result;
}
HRESULT GoVboxGetUsbControllerStandard(IUSBController* ccontroller,
    PRUint16* cstandard) {
  return IUSBController_GetUSBStandard(ccontroller, cstandard);
}
HRESULT GoVboxGetUsbControllerType(IUSBController* ccontroller,
    PRUint32* ctype) {
  return IUSBController_GetType(ccontroller, ctype);
}
HRESULT GoVboxIUSBControllerRelease(IUSBController* ccontroller) {
  return IUSBController_Release(ccontroller);
}

HRESULT GoVboxMachineAddUsbController(IMachine* cmachine, char* cname,
    PRUint32 ccontrollerType, IUSBController** ccontroller) {
  BSTR wname;
  HRESULT result = g_pVBoxFuncs->pfnUtf8ToUtf16(cname, &wname);
  if (FAILED(result))
    return result;

  result = IMachine_AddUSBController(cmachine, wname, ccontrollerType,
      ccontroller);
  g_pVBoxFuncs->pfnUtf16Free(wname);

  return result;
}


text: docker run -d --name mysql -p 3306:3306 -v /var/host_lib/mysql:/var/lib/mysql -t hnakamur/mysql


text:
<?php
/* This general search will find matches within event_name, event_notes, and the location_name, address, town, state and country. */
$args = !empty($args) ? $args:array(); /* @var $args array */
?>
<!-- START General Search -->
<div class="em-search-text em-search-field">
	<script type="text/javascript">
	EM.search_term_placeholder = '<?php echo esc_attr($args['search_term_label']); ?>';
	</script>
	<input type="text" name="em_search" class="em-events-search-text em-search-text" value="<?php echo esc_attr($args['search']); ?>" />
</div>
<!-- END General Search -->


text:
package net.sourceforge.plantuml.sequencediagram.graphic;

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

import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.InGroupableList;

class InGroupablesStack {

	final private List<InGroupableList> inGroupableStack = new ArrayList<>();

	public void addList(InGroupableList inGroupableList) {
		for (InGroupableList other : inGroupableStack) {
			other.addInGroupable(inGroupableList);
		}
		inGroupableStack.add(inGroupableList);

	}

	public void pop() {
		final int idx = inGroupableStack.size() - 1;
		inGroupableStack.remove(idx);
	}

	public void addElement(InGroupable inGroupable) {
		for (InGroupableList groupingStructure : inGroupableStack) {
			groupingStructure.addInGroupable(inGroupable);
		}
	}

	public InGroupableList getTopGroupingStructure() {
		if (inGroupableStack.size() == 0) {
			return null;
		}
		return inGroupableStack.get(inGroupableStack.size() - 1);
	}

}


text:
<!DOCTYPE html>

  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta content="yes" name="apple-mobile-web-app-capable">
  <meta content="black" name="apple-mobile-web-app-status-bar-style">
  <title>Title1</title>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Lecanora praeradiosa Nyl.

### Remarks
null