text:
/*
 * @(#)LteHandover.java        1.0 09/12/14
 *
 * This file has been auto-generated by JNC, the
 * Java output format plug-in of pyang.
 * Origin: module "hcta-epc", revision: "2014-09-18".
 */

package hctaEpc.mmeSgsn.statistics;

import Element;

import ElementChildrenIterator;

import Epc;

import InterRat;

import IntraRat;

import JNCException;

import Srvcc;

import com.tailf.jnc.YangElement;

/**
 * This class represents an element from
 * the namespace http://hitachi-cta.com/ns/epc
 * generated to "src/hctaEpc/mmeSgsn/statistics/lteHandover"
 * <p>
 * See line 1027 in
 * oamPmServerCli.yang
 *
 * @version 1.0 2014-12-09
 * @author Auto Generated
 */
public class LteHandover extends YangElement {

    private static final long serialVersionUID = 1L;

    /**
     * Constructor for an empty LteHandover object.
     */
    public LteHandover() {
        super(Epc.NAMESPACE, "lteHandover");
    }

    /**
     * Clones this object, returning an exact copy.
     * @return A clone of the object.
     */
    public LteHandover clone() {
        return (LteHandover)cloneContent(new LteHandover());
    }

    /**
     * Clones this object, returning a shallow copy.
     * @return A clone of the object. Children are not included.
     */
    public LteHandover cloneShallow() {
        return (LteHandover)cloneShallowContent(new LteHandover());
    }

    /**
     * @return An array with the identifiers of any key children
     */
    public String[] keyNames() {
        return null;
    }

    /**
     * @return An array with the identifiers of any children, in order.
     */
    public String[] childrenNames() {
        return new String[] {
            "interRat",
            "intraRat",
            "srvcc",
        };
    }

    /* Access methods for list child: "interRat". */

    /**
     * Gets list entry "interRat", with specified keys.
     */
    public InterRat getInterRat() throws JNCException {
        String path = "interRat";
        return (InterRat)searchOne(path);
    }

    /**
     * Iterator method for the list "interRat".
     * @return An iterator for the list.
     */
    public ElementChildrenIterator interRatIterator() {
        return new ElementChildrenIterator(children, "interRat");
    }

    /**
     * Adds list entry "interRat", using an existing object.
     * @param interRat The object to add.
     * @return The added child.
     */
    public InterRat addInterRat(InterRat interRat) throws JNCException {
        insertChild(interRat, childrenNames());
        return interRat;
    }

    /**
     * Adds list entry "interRat".
     * This method is used for creating subtree filters.
     * @return The added child.
     */
    public InterRat addInterRat() throws JNCException {
        InterRat interRat = new InterRat();
        insertChild(interRat, childrenNames());
        return interRat;
    }

    /**
     * Deletes list entry "interRat", with specified keys.
     */
    public void deleteInterRat() throws JNCException {
        String path = "interRat";
        delete(path);
    }

    /* Access methods for list child: "intraRat". */

    /**
     * Gets list entry "intraRat", with specified keys.
     */
    public IntraRat getIntraRat() throws JNCException {
        String path = "intraRat";
        return (IntraRat)searchOne(path);
    }

    /**
     * Iterator method for the list "intraRat".
     * @return An iterator for the list.
     */
    public ElementChildrenIterator intraRatIterator() {
        return new ElementChildrenIterator(children, "intraRat");
    }

    /**
     * Adds list entry "intraRat", using an existing object.
     * @param intraRat The object to add.
     * @return The added child.
     */
    public IntraRat addIntraRat(IntraRat intraRat) throws JNCException {
        insertChild(intraRat, childrenNames());
        return intraRat;
    }

    /**
     * Adds list entry "intraRat".
     * This method is used for creating subtree filters.
     * @return The added child.
     */
    public IntraRat addIntraRat() throws JNCException {
        IntraRat intraRat = new IntraRat();
        insertChild(intraRat, childrenNames());
        return intraRat;
    }

    /**
     * Deletes list entry "intraRat", with specified keys.
     */
    public void deleteIntraRat() throws JNCException {
        String path = "intraRat";
        delete(path);
    }

    /* Access methods for list child: "srvcc". */

    /**
     * Gets list entry "srvcc", with specified keys.
     */
    public Srvcc getSrvcc() throws JNCException {
        String path = "srvcc";
        return (Srvcc)searchOne(path);
    }

    /**
     * Iterator method for the list "srvcc".
     * @return An iterator for the list.
     */
    public ElementChildrenIterator srvccIterator() {
        return new ElementChildrenIterator(children, "srvcc");
    }

    /**
     * Adds list entry "srvcc", using an existing object.
     * @param srvcc The object to add.
     * @return The added child.
     */
    public Srvcc addSrvcc(Srvcc srvcc) throws JNCException {
        insertChild(srvcc, childrenNames());
        return srvcc;
    }

    /**
     * Adds list entry "srvcc".
     * This method is used for creating subtree filters.
     * @return The added child.
     */
    public Srvcc addSrvcc() throws JNCException {
        Srvcc srvcc = new Srvcc();
        insertChild(srvcc, childrenNames());
        return srvcc;
    }

    /**
     * Deletes list entry "srvcc", with specified keys.
     */
    public void deleteSrvcc() throws JNCException {
        String path = "srvcc";
        delete(path);
    }

    /**
     * Support method for addChild.
     * Adds a child to this object.
     *
     * @param child The child to add
     */
    public void addChild(Element child) {
        super.addChild(child);
    }

}


text:
/* global loadImage, HTMLCanvasElement, $ */

$(function () {
  'use strict'

  var result = $('#result')
  var exifNode = $('#exif')
  var thumbNode = $('#thumbnail')
  var actionsNode = $('#actions')
  var currentFile
  var coordinates

  function displayExifData (exif) {
    var thumbnail = exif.get('Thumbnail')
    var tags = exif.getAll()
    var table = exifNode.find('table').empty()
    var row = $('

')
    var cell = $('	')
    var prop
    if (thumbnail) {
      thumbNode.empty()
      loadImage(thumbnail, function (img) {
        thumbNode.append(img).show()
      }, {orientation: exif.get('Orientation')})
    }
    for (prop in tags) {
      if (tags.hasOwnProperty(prop)) {
        table.append(
          row.clone()
            .append(cell.clone().text(prop))
            .append(cell.clone().text(tags[prop]))
        )
      }
    }
    exifNode.show()
  }

  function updateResults (img, data) {
    var content
    if (!(img.src || img instanceof HTMLCanvasElement)) {
      content = $('Loading image file failed')
    } else {
      content = $('').append(img)
        .attr('download', currentFile.name)
        .attr('href', img.src || img.toDataURL())
    }
    result.children().replaceWith(content)
    if (img.getContext) {
      actionsNode.show()
    }
    if (data && data.exif) {
      displayExifData(data.exif)
    }
  }

  function displayImage (file, options) {
    currentFile = file
    if (!loadImage(
        file,
        updateResults,
        options
      )) {
      result.children().replaceWith(
        $('' +
          'Your browser does not support the URL or FileReader API.' +
          '')
      )
    }
  }

  function dropChangeHandler (e) {
    e.preventDefault()
    e = e.originalEvent
    var target = e.dataTransfer || e.target
    var file = target && target.files && target.files[0]
    var options = {
      maxWidth: result.width(),
      canvas: true,
      pixelRatio: window.devicePixelRatio,
      downsamplingRatio: 0.5,
      orientation: true
    }
    if (!file) {
      return
    }
    exifNode.hide()
    thumbNode.hide()
    displayImage(file, options)
  }

  // Hide URL/FileReader API requirement message in capable browsers:
  if (window.createObjectURL || window.URL || window.webkitURL ||
      window.FileReader) {
    result.children().hide()
  }

  $(document)
    .on('dragover', function (e) {
      e.preventDefault()
      e = e.originalEvent
      e.dataTransfer.dropEffect = 'copy'
    })
    .on('drop', dropChangeHandler)

  $('#file-input')
    .on('change', dropChangeHandler)

  $('#edit')
    .on('click', function (event) {
      event.preventDefault()
      var imgNode = result.find('img, canvas')
      var img = imgNode[0]
      var pixelRatio = window.devicePixelRatio || 1
      imgNode.Jcrop({
        setSelect: [
          40,
          40,
          (img.width / pixelRatio) - 40,
          (img.height / pixelRatio) - 40
        ],
        onSelect: function (coords) {
          coordinates = coords
        },
        onRelease: function () {
          coordinates = null
        }
      }).parent().on('click', function (event) {
        event.preventDefault()
      })
    })

  $('#crop')
    .on('click', function (event) {
      event.preventDefault()
      var img = result.find('img, canvas')[0]
      var pixelRatio = window.devicePixelRatio || 1
      if (img && coordinates) {
        updateResults(loadImage.scale(img, {
          left: coordinates.x * pixelRatio,
          top: coordinates.y * pixelRatio,
          sourceWidth: coordinates.w * pixelRatio,
          sourceHeight: coordinates.h * pixelRatio,
          minWidth: result.width(),
          maxWidth: result.width(),
          pixelRatio: pixelRatio,
          downsamplingRatio: 0.5
        }))
        coordinates = null
      }
    })
})

redpajama_set_name: RedPajamaGithub


text:
#include "GrTypes.h"
#include "GrColor.h"

#ifndef GrBlend_DEFINED
#define GrBlend_DEFINED

static inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) {
    switch (coeff) {
        case kSC_GrBlendCoeff:
        case kISC_GrBlendCoeff:
        case kSA_GrBlendCoeff:
        case kISA_GrBlendCoeff:
            return true;
        default:
            return false;
    }
}

static inline bool GrBlendCoeffRefsDst(GrBlendCoeff coeff) {
    switch (coeff) {
        case kDC_GrBlendCoeff:
        case kIDC_GrBlendCoeff:
        case kDA_GrBlendCoeff:
        case kIDA_GrBlendCoeff:
            return true;
        default:
            return false;
    }
}

GrColor GrSimplifyBlend(GrBlendCoeff* srcCoeff,
                        GrBlendCoeff* dstCoeff,
                        GrColor srcColor, uint32_t srcCompFlags,
                        GrColor dstColor, uint32_t dstCompFlags,
                        GrColor constantColor);

#endif


text:
from __future__ import absolute_import

import logging

from flask import g

log = logging.getLogger(__name__)

def before_request():
    g.client_debug_messages = []

def after_request(response):
    if hasattr(g, "client_debug_messages") and len(g.client_debug_messages) > 0:
        response.headers["Drift-Debug-Message"] = "\\n".join(g.client_debug_messages)
    return response

def drift_init_extension(app, **kwargs):
    app.before_request(before_request)
    app.after_request(after_request)

    # Install DebugToolbar if applicable
    if app.debug:
        log.info("Flask server is running in DEBUG mode.")
        try:
            from flask_debugtoolbar import DebugToolbarExtension
            DebugToolbarExtension(app)
        except ImportError:
            log.info("Flask DebugToolbar not available: Do 'pip install "
                     "flask-debugtoolbar' to enable.")


text:
You can completely remove the widget from the DOM with the destroy method.

Calling destroy is not reversible. You will have to re-initialize the widget if you want to see it again.

<input type="button" id="destroyBtn" class="button radius demo-btn" value="Destroy the widget" />


text:
if ENV['BUILDER'] == 'travis'
  require 'codeclimate-test-reporter'
  CodeClimate::TestReporter.start
else
  require 'simplecov'
  SimpleCov.start do
    add_filter '/spec/'
  end
end

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'securetrading'

RSpec.configure do |config|
  config.around(:each) do |test|
    preset_config if test.metadata[:type] != :no_config
    test.run
    reset_config if test.metadata[:type] != :no_config
  end
end

def preset_config(options = {})
  Securetrading.configure do |c|
    c.user = options[:user] || 'u'
    c.password = options[:password] || 'p'
    c.site_reference = options[:site_reference] || 'sr'
    c.auth_method = options[:auth_method]
    c.site_security_password = options[:site_reference] || 'ssp'
  end
end

def reset_config
  Securetrading.send('config=', nil)
end


text:
import Ember from 'ember';

export default Ember.Component.extend({
    tagName: 'li',
    classNameBindings: ['isEditing:editing'],

    init() {
        this._super(...arguments);
        this.set('isEditing', false);
    },

    actions: {
        edit() {
            this.set('isEditing', true);
        },

        save(name) {
            this.set('isEditing', false);
            var ingredient = this.model.get('ingredient');
            ingredient.set('name', name);
            ingredient.save();
        },

        remove() {
            this.model.destroyRecord();
        }
    },

    isUnit: function() {
        return this.get('units') === 'unit';
    }.property('units'),
});


text:
package com.ibm.icu.dev.demo.calendar;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Point;
import java.util.Date;
import java.util.Locale;

import com.ibm.icu.dev.demo.impl.DemoUtility;
import com.ibm.icu.text.DateFormatSymbols;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.SimpleTimeZone;

class CalendarPanel extends Canvas {

    /**
     * For serialization
     */
    private static final long serialVersionUID = 625400018027387141L;

    public CalendarPanel( Locale locale ) {
        setLocale(locale);
    }

    public void setLocale(Locale locale) {
        if (fDisplayLocale == null || !fDisplayLocale.equals(locale)) {
            fDisplayLocale = locale;
            dirty = true;

            for (int i = 0; i < fCalendar.length; i++) {
                if (fCalendar[i] != null) {
                    fSymbols[i] = new DateFormatSymbols(fCalendar[i],
                                                        fDisplayLocale);
                }
            }
            String lang = locale.getLanguage();
            leftToRight = !(lang.equals("iw") || lang.equals("ar"));

            repaint();
        }
    }

    public void setDate(Date date) {
        fStartOfMonth = date;
        dirty = true;
        repaint();
    }

    public void add(int field, int delta)
    {
        synchronized(fCalendar) {
            fCalendar[0].setTime(fStartOfMonth);
            fCalendar[0].add(field, delta);
            fStartOfMonth = fCalendar[0].getTime();
        }
        dirty = true;
        repaint();
    }

    public void setColor(int index, Color c) {
        fColor[index] = c;
        repaint();
    }

    public void setCalendar(int index, Calendar c) {
        Date date = (fCalendar[index] == null) ? new Date()
                                               : fCalendar[index].getTime();

        fCalendar[index] = c;
        fCalendar[index].setTime(date);

        fSymbols[index] = new DateFormatSymbols(c, fDisplayLocale);
        dirty = true;
        repaint();
    }

    public Calendar getCalendar(int index) {
        return fCalendar[index];
    }

    public Locale getDisplayLocale() {
        return fDisplayLocale;
    }

    public Date firstOfMonth() {
        return fStartOfMonth;
    }

    private Date startOfMonth(Date dateInMonth)
    {
        synchronized(fCalendar) {
            fCalendar[0].setTime(dateInMonth);

            int era = fCalendar[0].get(Calendar.ERA);
            int year = fCalendar[0].get(Calendar.YEAR);
            int month = fCalendar[0].get(Calendar.MONTH);

            fCalendar[0].clear();
            fCalendar[0].set(Calendar.ERA, era);
            fCalendar[0].set(Calendar.YEAR, year);
            fCalendar[0].set(Calendar.MONTH, month);
            fCalendar[0].set(Calendar.DATE, 1);

            return fCalendar[0].getTime();
        }
    }

    private void calculate()
    {
        //
        // As a workaround for JDK 1.1.3 and below, where Calendars and time
        // zones are a bit goofy, always set my calendar's time zone to UTC.
        // You would think I would want to do this in the "set" function above,
        // but if I do that, the program hangs when this class is loaded,
        // perhaps due to some sort of static initialization ordering problem.
        // So I do it here instead.
        //
        fCalendar[0].setTimeZone(new SimpleTimeZone(0, "UTC"));

        Calendar c = (Calendar)fCalendar[0].clone(); // Temporary copy

        fStartOfMonth = startOfMonth(fStartOfMonth);

        // Stash away a few useful constants for this calendar and display
        minDay = c.getMinimum(Calendar.DAY_OF_WEEK);
        daysInWeek = c.getMaximum(Calendar.DAY_OF_WEEK) - minDay + 1;

        firstDayOfWeek = Calendar.getInstance(fDisplayLocale).getFirstDayOfWeek();

        // Stash away a Date for the start of this month

        // Find the day of week of the first day in this month
        c.setTime(fStartOfMonth);
        firstDayInMonth = c.get(Calendar.DAY_OF_WEEK);
        int firstWeek = c.get(Calendar.WEEK_OF_MONTH);

        // Now find the # of days in the month
        c.roll(Calendar.DATE, false);
        daysInMonth = c.get(Calendar.DATE);

        // Finally, find the end of the month, i.e. the start of the next one
        c.roll(Calendar.DATE, true);
        c.add(Calendar.MONTH, 1);
        c.getTime();        // JDK 1.1.2 bug workaround
        c.add(Calendar.SECOND, -1);
        Date endOfMonth = c.getTime();
        if(endOfMonth==null){
         //do nothing
        }
        endOfMonth = null;
        int lastWeek = c.get(Calendar.WEEK_OF_MONTH);

        // Calculate the number of full or partial weeks in this month.
        numWeeks = lastWeek - firstWeek + 1;

        dirty = false;
    }

    static final int XINSET = 4;
    static final int YINSET = 2;

    /*
     * Convert from the day number within a month (1-based)
     * to the cell coordinates on the calendar (0-based)
     */
    private void dateToCell(int date, Point pos)
    {
        int cell = (date + firstDayInMonth - firstDayOfWeek - minDay);
        if (firstDayInMonth < firstDayOfWeek) {
            cell += daysInWeek;
        }

        pos.x = cell % daysInWeek;
        pos.y = cell / daysInWeek;
    }
    //private Point dateToCell(int date) {
    //    Point p = new Point(0,0);
    //    dateToCell(date, p);
    //    return p;
    //}

    public void paint(Graphics g) {

        if (dirty) {
            calculate();
        }

        Point cellPos = new Point(0,0);     // Temporary variable
        Dimension d = this.getSize();

        g.setColor(Color.lightGray);
        g.fillRect(0,0,d.width,d.height);

        // Draw the day names at the top
        g.setColor(Color.black);
        g.setFont(DemoUtility.labelFont);
        FontMetrics fm = g.getFontMetrics();
        int labelHeight = fm.getHeight() + YINSET * 2;

        int v = fm.getAscent() + YINSET;
        for (int i = 0; i < daysInWeek; i++) {
            int dayNum = (i + minDay + firstDayOfWeek - 2) % daysInWeek + 1;
            String dayName = fSymbols[0].getWeekdays()[dayNum];

            double h;
            if (leftToRight) {
                h = d.width*(i + 0.5) / daysInWeek;
            } else {
                h = d.width*(daysInWeek - i - 0.5) / daysInWeek;
            }
            h -= fm.stringWidth(dayName) / 2;

            g.drawString(dayName, (int)h, v);
        }

        double cellHeight = (d.height - labelHeight - 1) / numWeeks;
        double cellWidth = (double)(d.width - 1) / daysInWeek;

        // Draw a white background in the part of the calendar
        // that displays this month.
        // First figure out how much of the first week should be shaded.
        {
            g.setColor(Color.white);
            dateToCell(1, cellPos);
            int width = (int)(cellPos.x*cellWidth);  // Width of unshaded area

            if (leftToRight) {
                g.fillRect((int)(width), labelHeight ,
                           d.width - width, (int)cellHeight);
            } else {
                g.fillRect(0, labelHeight ,
                           d.width - width, (int)cellHeight);
            }

            // All of the intermediate weeks get shaded completely
            g.fillRect(0, (int)(labelHeight + cellHeight),
                        d.width, (int)(cellHeight * (numWeeks - 2)));

            // Now figure out the last week.
            dateToCell(daysInMonth, cellPos);
            width = (int)((cellPos.x+1)*cellWidth);  // Width of shaded area

            if (leftToRight) {
                g.fillRect(0, (int)(labelHeight + (numWeeks-1) * cellHeight),
                           width, (int)cellHeight);
            } else {
                g.fillRect(d.width - width, (int)(labelHeight + (numWeeks-1) * cellHeight),
                           width, (int)cellHeight);
            }

        }
        // Draw the X/Y grid lines
        g.setColor(Color.black);
        for (int i = 0; i <= numWeeks; i++) {
            int y = (int)(labelHeight + i * cellHeight);
            g.drawLine(0, y, d.width - 1, y);
        }
        for (int i = 0; i <= daysInWeek; i++) {
            int x = (int)(i * cellWidth);
            g.drawLine(x, labelHeight, x, d.height - 1);
        }

        // Now loop through all of the days in the month, figure out where
        // they go in the grid, and draw the day # for each one

        // Figure out the date of the first cell in the calendar display
        int cell = (1 + firstDayInMonth - firstDayOfWeek - minDay);
        if (firstDayInMonth < firstDayOfWeek) {
            cell += daysInWeek;
        }

        Calendar c = (Calendar)fCalendar[0].clone();
        c.setTime(fStartOfMonth);
        c.add(Calendar.DATE, -cell);

        StringBuffer buffer = new StringBuffer();

        for (int row = 0; row < numWeeks; row++) {
            for (int col = 0; col < daysInWeek; col++) {

                g.setFont(DemoUtility.numberFont);
                g.setColor(Color.black);
                fm = g.getFontMetrics();

                int cellx;
                if (leftToRight) {
                    cellx = (int)((col) * cellWidth);
                } else {
                    cellx = (int)((daysInWeek - col - 1) * cellWidth);
                }

                int celly = (int)(row * cellHeight + labelHeight);

                for (int i = 0; i < 2; i++) {
                    fCalendar[i].setTime(c.getTime());

                    int date = fCalendar[i].get(Calendar.DATE);
                    buffer.setLength(0);
                    buffer.append(date);
                    String dayNum = buffer.toString();

                    int x;

                    if (leftToRight) {
                        x = cellx + (int)cellWidth - XINSET - fm.stringWidth(dayNum);
                    } else {
                        x = cellx + XINSET;
                    }
                    int y = celly + + fm.getAscent() + YINSET + i * fm.getHeight();

                    if (fColor[i] != null) {
                        g.setColor(fColor[i]);
                    }
                    g.drawString(dayNum, x, y);

                    if (date == 1 || row == 0 && col == 0) {
                        g.setFont(DemoUtility.numberFont);
                        String month = fSymbols[i].getMonths()[
                                            fCalendar[i].get(Calendar.MONTH)];

                        if (leftToRight) {
                            x = cellx + XINSET;
                        } else {
                            x = cellx + (int)cellWidth - XINSET - fm.stringWidth(month);
                        }
                        g.drawString(month, x, y);
                    }
                }

                c.add(Calendar.DATE, 1);
            }
        }
    }

    // Important state variables
    private Calendar[]          fCalendar = new Calendar[4];
    private Color[]             fColor = new Color[4];

    private Locale              fDisplayLocale;
    private DateFormatSymbols[] fSymbols = new DateFormatSymbols[4];

    private Date                fStartOfMonth = new Date();     // 00:00:00 on first day of month

    // Cached calculations to make drawing faster.
    private transient int       minDay;           // Minimum legal day #
    private transient int       daysInWeek;       // # of days in a week
    private transient int       firstDayOfWeek;   // First day to display in week
    private transient int       numWeeks;         // # full or partial weeks in month
    private transient int       daysInMonth;      // # days in this month
    private transient int       firstDayInMonth;  // Day of week of first day in month
    private transient boolean   leftToRight;

    private transient boolean dirty = true;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Package jason.architecture (Jason - AgentSpeak Java Interpreter)</title>
<meta name="date" content="2013-12-12">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
jason.architecture

Packages that use jason.architecture

Package
Description

jason.architecture

jason.asSemantics

jason.infra.centralised

jason.infra.jade

jason.runtime

Classes in jason.architecture used by jason.architecture

Class and Description

AgArch

Base agent architecture class that defines the overall agent architecture;
 the AS interpreter is the reasoner (a kind of mind) within this
 architecture (a kind of body).

AgArchInfraTier

This interface is implemented by the infrastructure tier (Saci/Jade/Centralised/...)
 to provide concrete perception, action, and communication to the agent architecture.

Classes in jason.architecture used by jason.asSemantics

Class and Description

AgArch

Base agent architecture class that defines the overall agent architecture;
 the AS interpreter is the reasoner (a kind of mind) within this
 architecture (a kind of body).

Classes in jason.architecture used by jason.infra.centralised

Class and Description

AgArch

Base agent architecture class that defines the overall agent architecture;
 the AS interpreter is the reasoner (a kind of mind) within this
 architecture (a kind of body).

AgArchInfraTier

This interface is implemented by the infrastructure tier (Saci/Jade/Centralised/...)
 to provide concrete perception, action, and communication to the agent architecture.

Classes in jason.architecture used by jason.infra.jade

Class and Description

AgArch

Base agent architecture class that defines the overall agent architecture;
 the AS interpreter is the reasoner (a kind of mind) within this
 architecture (a kind of body).

AgArchInfraTier

This interface is implemented by the infrastructure tier (Saci/Jade/Centralised/...)
 to provide concrete perception, action, and communication to the agent architecture.

Classes in jason.architecture used by jason.runtime

Class and Description

AgArch

Base agent architecture class that defines the overall agent architecture;
 the AS interpreter is the reasoner (a kind of mind) within this
 architecture (a kind of body).

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import unittest

from katas.kyu_6.multi_tap_keypad_text_entry import presses

class PressesTestCase(unittest.TestCase):
    def test_equals(self):
        self.assertEqual(presses('LOL'), 9)

    def test_equals_2(self):
        self.assertEqual(presses('HOW R U'), 13)

    def test_equals_3(self):
        self.assertEqual(presses('WHERE DO U WANT 2 MEET L8R'), 47)


text:
using content::WebContents;

namespace {

void OnArcHandled(bool handled) {
  if (handled)
    return;

  // TODO(crbug.com/1293604): Handle dialog more precisely when it is not
  // successfully handled by ARC.
  LOG(WARNING) << "Url is not successfully handled by ARC.";
  return;
}

}  // namespace

///////////////////////////////////////////////////////////////////////////////
// ExternalProtocolHandler

// static
void ExternalProtocolHandler::RunExternalProtocolDialog(
    const GURL& url,
    WebContents* web_contents,
    ui::PageTransition page_transition,
    bool has_user_gesture,
    bool is_in_fenced_frame_tree,
    const absl::optional<url::Origin>& initiating_origin,
    content::WeakDocumentPtr initiator_document,
    const std::u16string& program_name) {
  // First, check if ARC version of the dialog is available and run ARC version
  // when possible.
  arc::RunArcExternalProtocolDialog(
      url, initiating_origin, web_contents->GetWeakPtr(), page_transition,
      has_user_gesture, is_in_fenced_frame_tree,
      std::make_unique<arc::ArcIntentHelperMojoLacros>(),
      base::BindOnce(&OnArcHandled));
}


text:
package com.thoughtworks.frankenstein.playback;

import java.awt.*;
import java.util.logging.Logger;
import javax.swing.*;

import com.thoughtworks.frankenstein.naming.ComponentHierarchyWalker;
import com.thoughtworks.frankenstein.naming.UnnamedComponentMatchingRule;

/**
 * Understands finding menu items.
 *
 * @author vivek
 */
public class MenuFinder {
    private JPopupMenu popupMenu;

    public JMenuItem find(String path) {
        String[] pathElements = path.split(">");
        if (popupMenu != null) {
            return findPopupMenu(pathElements);
        } else {
            for (int i = 0; i < Frame.getFrames().length; i++) {
                try {
                    java.util.List menuBars = findMenuBar(Frame.getFrames(), i);
                    if (!menuBars.isEmpty()) {
                        return findMenuItem(menuBars, pathElements);
                    }
                } catch (Exception e) {
                    //ignore
                }
            }
        }
        throw new RuntimeException("Unable to find menu with path: " + path);
    }

    public void menuDisplayed(JPopupMenu menu) {
        popupMenu = menu;
        Logger.getLogger("Frankenstein").info("Menu Displayed");
    }

    public void menuHidden() {
        popupMenu = null;
        Logger.getLogger("Frankenstein").info("Menu Hidden");
    }

    private JMenuItem findMenuItem(java.util.List menuBars, String[] pathElements) {
        for (int i = 0; i < menuBars.size(); i++) {
            try {
                return findMenuItem((JMenuBar) menuBars.get(i), pathElements);
            } catch (Exception e) {
                //ignore
            }
        }
        throw new RuntimeException("Unable to find menu with path.");
    }

    private JMenuItem findMenuItem(JMenuBar menuBar, String[] pathElements) {
        JMenuItem menuItem = findTopLevelMenu(menuBar, pathElements[0]);

        for (int j = 1; j < pathElements.length; j++) {
            menuItem = findMenu((JMenu) menuItem, pathElements[j]);
        }
        return menuItem;
    }

    private JMenuItem findPopupMenu(String[] pathElements) {
        JMenuItem menuItem = findTopLevelMenu(pathElements[0]);
        for (int j = 1; j < pathElements.length; j++) {
            menuItem = findMenu((JMenu) menuItem, pathElements[j]);
        }
        popupMenu = null;
        return menuItem;
    }

    private JMenuItem findTopLevelMenu(String pathElement) {
        for (int i = 0; i < popupMenu.getComponentCount(); i++) {
            if (popupMenu.getComponent(i) instanceof JMenuItem) {
                JMenuItem item = (JMenuItem) popupMenu.getComponent(i);
                if (pathElement.equals(item.getText())) return item;
            }
        }
        throw new RuntimeException("Unable to find top level popup menu item: " + pathElement);
    }

    private java.util.List findMenuBar(Frame[] frames, int i) {
        Frame frame = frames[i];
        UnnamedComponentMatchingRule rule = new UnnamedComponentMatchingRule(JMenuBar.class);
        new ComponentHierarchyWalker().matchComponentsIn(frame, rule);
        return rule.unnamedComponents();
    }

    private JMenu findTopLevelMenu(JMenuBar bar, String pathElement) {
        for (int i = 0; i < bar.getMenuCount(); i++) {
            if (bar.getMenu(i).getText().equals(pathElement)) return bar.getMenu(i);
        }
        throw new RuntimeException("Unable to find top level menu" + pathElement);
    }

    private JMenuItem findMenu(JMenu menuItem, String pathElement) {
        for (int i = 0; i < menuItem.getMenuComponentCount(); i++) {
            if (menuItem.getMenuComponent(i) instanceof JMenuItem) {
                JMenuItem jmenuItem = (JMenuItem) menuItem.getMenuComponent(i);
                if (jmenuItem.getText().equals(pathElement)) return jmenuItem;
            }
        }
        throw new RuntimeException("Unable to find menu" + pathElement);
    }

}


text:
/*
 * ----------------------------------------
 *          Jenkins Test Tracker
 * ----------------------------------------
 *          Produced by Dan Grew
 *                 2016
 * ----------------------------------------
 */
package uk.dangrew.jtt.desktop.buildwall.effects.sound;

import uk.dangrew.jtt.connection.api.handling.live.BuildResultStatusChange;
import uk.dangrew.jtt.desktop.friendly.javafx.FriendlyMediaPlayer;
import uk.dangrew.kode.event.structure.Event;

import java.util.HashSet;
import java.util.Set;

/**
 * The {@link SoundPlayer} is responsible for playing sounds in response to {@link SoundTriggerEvent}s.
 */
public class SoundPlayer {

   private final Set< FriendlyMediaPlayer > playersPlaying;
   private final SoundConfiguration configuration;
   private final StringMediaConverter converter;

   /**
    * Constructs a new {@link SoundPlayer}.
    * @param configuration the {@link SoundConfiguration}.
    */
   public SoundPlayer( SoundConfiguration configuration ) {
      this( new StringMediaConverter(), configuration );
   }//End Constructor

   /**
    * Constructs a new {@link SoundPlayer}.
    * @param converter the {@link StringMediaConverter}.
    * @param configuration the {@link SoundConfiguration}.
    */
   SoundPlayer( StringMediaConverter converter, SoundConfiguration configuration ) {
      if( configuration == null ) {
         throw new IllegalArgumentException( "Must not supply null configuration." );
      }
      this.converter = converter;
      this.configuration = configuration;
      this.playersPlaying = new HashSet<>();

      new SoundTriggerEvent().register( this::playSoundFromConfiguration );
   }//End Constructor

   /**
    * Method to play the sound associated with the {@link BuildResultStatusChange} in the
    * {@link SoundConfiguration}.
    * @param event the {@link Event} with the {@link BuildResultStatusChange}.
    */
   private void playSoundFromConfiguration( Event< BuildResultStatusChange > event ){
      FriendlyMediaPlayer player = converter.convert( configuration.statusChangeSounds().get( event.getValue() ) );
      if ( player != null ) {
         playersPlaying.add( player );
         player.friendly_setOnEndOfMedia( () -> playersPlaying.remove( player ) );
         player.friendly_play();
      }
   }//End Method

   /**
    * Method to determine whether the given is associated.
    * @param configuration the {@link SoundConfiguration} in question.
    * @return true if identical.
    */
   public boolean isAssociatedWith( SoundConfiguration configuration ) {
      return this.configuration == configuration;
   }//End Method

   /**
    * Method to determine whether the {@link SoundPlayer} is waiting for the given {@link FriendlyMediaPlayer}
    * to finish.
    * @param player the {@link FriendlyMediaPlayer} in quesiton.
    * @return true if still waiting to finish.
    */
   boolean isWaitingFor( FriendlyMediaPlayer player ) {
      return playersPlaying.contains( player );
   }//End Method

}//End Class


text:
"""Add notification_sent column to sla_miss

Revision ID: bbc73705a13e
Revises: 4446e08588
Create Date: 2016-01-14 18:05:54.871682

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = 'bbc73705a13e'
down_revision = '4446e08588'
branch_labels = None
depends_on = None

def upgrade():
    op.add_column('sla_miss', sa.Column('notification_sent', sa.Boolean, default=False))

def downgrade():
    op.drop_column('sla_miss', 'notification_sent')


text:
package com.TrololoCompany.meetingdataexchangedataBase;

public class FileEntity
{
	private long ID;
	private long meetingID;
	private long serverFileId;
	private String fileName;
	private String authorName;
	private String addTime;
	private String hashMD5;
	public long getID() {
		return ID;
	}
	public void setID(long iD) {
		ID = iD;
	}
	public long getMeetingID() {
		return meetingID;
	}
	public void setMeetingID(long meetingID) {
		this.meetingID = meetingID;
	}
	public long getServerFileId() {
		return serverFileId;
	}
	public void setServerFileId(long serverFileId) {
		this.serverFileId = serverFileId;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getAuthorName() {
		return authorName;
	}
	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}
	public String getAddTime() {
		return addTime;
	}
	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}
	public String getHashMD5() {
		return hashMD5;
	}
	public void setHashMD5(String hashMD5) {
		this.hashMD5 = hashMD5;
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<LearningStandards>
  <LearningStandardItem xml:lang="en" RefID="F4781959C4BF44A88E3A4B89A00AA4FC">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/A/1/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.A.1</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Know there is a complex number i such that i2 = &ndash;1, and every complex number has the form a + bi with a and b real.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">34739C4FC4AD468B909C63CB696B4153</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="9EF1ABB59B754CB89DB0297316F03EB0">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/A/2/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.A.2</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Use the relation i2 = &ndash;1 and the commutative, associative, and distributive properties to add, subtract, and multiply complex numbers.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">34739C4FC4AD468B909C63CB696B4153</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="BBAF058809C4475FAEC0B409DB23FF7A">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/A/3/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.A.3</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Find the conjugate of a complex number; use conjugates to find moduli and quotients of complex numbers.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">34739C4FC4AD468B909C63CB696B4153</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="9C025DDFBD754E4A85B98008A0F2E06B">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/B/4/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.B.4</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Represent complex numbers on the complex plane in rectangular and polar form (including real and imaginary numbers), and explain why the rectangular and polar forms of a given complex number represent the same number.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">B8FB763556FF41D9B95242FA4D2BBC70</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="19256360FBB6482E8D4E9D15F9B0FAE8">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/B/6/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.B.6</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Calculate the distance between numbers in the complex plane as the modulus of the difference, and the midpoint of a segment as the average of the numbers at its endpoints.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">B8FB763556FF41D9B95242FA4D2BBC70</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="47833A8E8942401A92945FCB5C2A39EA">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/B/5/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.B.5</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Represent addition, subtraction, multiplication, and conjugation of complex numbers geometrically on the complex plane; use properties of this representation for computation. For example, (-1 + &radic;3 i)3 = 8 because (-1 + &radic;3 i) has modulus 2 and argument 120&deg;.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">B8FB763556FF41D9B95242FA4D2BBC70</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="53E71723181C423483E2099E69FD1417">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/C/7/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.C.7</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Solve quadratic equations with real coefficients that have complex solutions.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">ADC66FBA84CC47C982E9AFFA1EEBBF15</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="58CD7663F49E4231B66992B6E8EAF068">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/C/8/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.C.8</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Extend polynomial identities to the complex numbers. For example, rewrite x2 + 4 as (x + 2i)(x &ndash; 2i).</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">ADC66FBA84CC47C982E9AFFA1EEBBF15</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
  <LearningStandardItem xml:lang="en" RefID="CDCE09A5D4D74E7584DC9CDBBA9A8C28">
    <RefURI>http://corestandards.org/Math/Content/HSN/CN/C/9/</RefURI>
    <StandardHierarchyLevel>
      <number>7</number>
      <description>Standard</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.Math.Content.HSN-CN.C.9</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>(+) Know the Fundamental Theorem of Algebra; show that it is true for quadratic polynomials.</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>09</GradeLevel>
      <GradeLevel>10</GradeLevel>
      <GradeLevel>11</GradeLevel>
      <GradeLevel>12</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>B62C1C106873438AA0126760075A65A3</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">ADC66FBA84CC47C982E9AFFA1EEBBF15</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
</LearningStandards>


text:
package com.BombingGames.WurfelEngine.Core.Gameobjects;

import com.BombingGames.WurfelEngine.Core.Controller;
import com.BombingGames.WurfelEngine.Core.Map.AbstractPosition;
import com.BombingGames.WurfelEngine.Core.Map.Coordinate;
import com.BombingGames.WurfelEngine.Core.Map.Map;
import com.BombingGames.WurfelEngine.Core.Map.Point;

/**
 *An entity is a game object wich is self aware that means it knows it's position.
 * @author Benedikt
 */
public abstract class AbstractEntity extends AbstractGameObject implements IsSelfAware {
    /**Containts the names of the objects. index=id*/
    public static final String[] NAMELIST = new String[OBJECTTYPESCOUNT];

    private Point point;//the position in the map-grid

    static {
        NAMELIST[30] = "player";

        NAMELIST[31] = "smoke test";
        NAMELIST[32] = "character shadow";
    }

    private boolean dispose;

    /**
     * Create an abstractEntity. You should use Block.getInstance(int)
     * @param id
     * @param point
     * @see com.BombingGames.WurfelEngine.Core.Gameobjects.Block#getInstance(int)
     */
    protected AbstractEntity(int id, Point point){
        super(id,0);
        setPos(point);
    }

    @Override
    public int getDepth(AbstractPosition pos){
        return (int) (
            pos.getPoint().getRelY()//Y

            + pos.getHeight()/Math.sqrt(2)//Z
            + getDimensionZ()/Math.sqrt(2)
        );
    }

    //IsSelfAware implementation
    @Override
    public Point getPos() {
        return point;
    }

    @Override
    public final void setPos(AbstractPosition pos) {
        this.point = pos.getPoint();
    }

    /**
     *
     * @param height
     */
    public void setHeight(float height) {
        point.setHeight(height);
    }

    /**
     * Is the entity laying/standing on the ground?
     * @return true when on the ground
     */
    public boolean onGround(){
        if (getPos().getHeight() <= 0) return true; //if entity is under the map

        if (getPos().getHeight()>Map.getGameHeight()){
            //check if one pixel deeper is on ground.
            int z = (int) ((getPos().getHeight()-1)/GAME_EDGELENGTH);
            if (z > Map.getBlocksZ()-1) z = Map.getBlocksZ()-1;

            return
                new Coordinate(
                    point.getCoord().getRelX(),
                    point.getCoord().getRelY(),
                    z,
                    true
                ).getBlock().isObstacle();
        } else
            return false;//return false if over map
    }

    /**
     * add this entity to the map-> let it exist
     * @return returns itself
     */
    public AbstractEntity exist(){
        Controller.getMap().getEntitys().add(this);
        return this;
    }

    /**
     *
     * @return
     */
    @Override
    public char getCategory() {
        return 'e';
    }

    @Override
    public String getName() {
        return NAMELIST[getId()];
    }

   /**
     * Deletes the object from the map. The opposite to exist();
     */
    public void dispose(){
        dispose=true;
    }

    /**
     *
     * @return
     */
    public boolean shouldBeDisposed() {
        return dispose;
    }
}


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Welcome to mubosym's documentation! — mubosym 1 documentation</title>

    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="mubosym 1 documentation" href="#" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">

Navigation

          index

          modules |

mubosym 1 documentation »

Welcome to mubosym’s documentation!¶

Contents:

all mubosym related core classes¶

Created on Sun Mar  8 11:50:46 2015

@author: oliver

exception mubosym_core.InputError(input)¶

Exception raised for errors in the parameters

<col class="field-name" />
<col class="field-body" />

Parameters:

paras – input expression in which the error occurred

n_soll – explanation of the error

class mubosym_core.MBSframe(Name)¶

This class represents a moving frame. (sympy only provides rotating frames up to now)

class mubosym_core.MBSworld(name='', connect=False, force_db_setup=False)¶

All storages lists and dictionaries for a full multibody sim world. Keeps track of every frame, body, force and torque.
Includes also parameters and external model interface (e.g. tire).

add_body_3d(new_body_name, str_n_marker, mass, I, joint, parameters=[], graphics=True)¶

Core function to add a body for your mbs model. Express the pos and vel of the body in terms of q and u (here comes the joint crunching).
Generalized coordinates q and u are often (not always) written in the rotated center of mass frame of the previous body.

<col class="field-name" />
<col class="field-body" />

Parameters:

new_body_name (str) – the name of the new body (freely given by the user)

str_n_marker (str) – the name string of the marker where the new body is related to (fixed on)

mass (float) – the mass of the new body

I (float*3) – the inertia of the new body measured in the body symmetric center of mass frame (float*3 list) [Ixx, Iyy, Izz]

joint (str) – the type of the joint: possible choices are (see code and examples). You can add whatever joint you want to. Here the degrees of freedom are generated.

parameters (float*n) – the parameters to descripe the joint fully (see code)

graphics (str) – the choice of the grafics representative (ball, car, tire)

add_damping(str_m_b, gamma)¶

Add damping for the body

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b (str) – name of the body

gamma (float) – the damping coefficient (acting in all directions)

add_force(str_m_b_i, str_m_b_j, parameters=[])¶

Interaction forces between body/marker i and j via spring damper element.

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b_i (str) – name of the body/marker i

str_m_b_j (str) – name of the body/marker j

parameters (list) – stiffness, offset, damping-coefficient

add_force_ext(str_m_b, str_m_b_ref, vx, vy, vz, py_function_handler)¶

Includes the symbol f_ext_n for body/marker str_m_b expressed in frame str_m_b_ref in direction vx, vy, vz

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b (str) – name of the body/marker

str_m_b_ref (str) – existing reference frame

vx, vy, vz (float) – const. vector components giving the direction in the ref frame

add_force_special(str_m_b, force_type, parameters=[])¶

Specialised forces on body (for shortcut input)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b (str) – is the name string of the body

force_type (str) – the type of force which is added

parameters (list) – corresponding parameters to describe the force

add_force_spline_r(str_m_b_i, str_m_b_j, filename, param=[0.0, 1.0])¶

Interaction forces between body/marker i and j via characteristic_line class interp (ind. variable is the distance of the two bodies)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b_i (str) – name of the body/marker i

str_m_b_j (str) – name of the body/marker j

add_force_spline_v(str_m_b_i, str_m_b_j, filename, param=[1.0])¶

Interaction forces between body/marker i and j via characteristic_line class interp (ind. variable is the relative velocity of the two bodies)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b_i (str) – name of the body/marker i

str_m_b_j (str) – name of the body/marker j

add_geometric_constaint(str_m_b, equ, str_m_b_ref, factor)¶

Function to add a geometric constraint (plane equation in the easiest form)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b (str) – name of the body/marker for which the constraint is valid

equ (sympy-expression) – is of form f(x,y,z)=0,

str_m_b_ref (str) – reference frame

factor (float) – the factor of the constraint force (perpendicular to the plane). If this is higher, the constraint is much better fullfilled, but with much longer integration time (since the corresponding eigenvalue gets bigger).

add_marker(new_marker_name, str_n_related, vx, vy, vz, phix=0.0, phiy=0.0, phiz=0.0)¶

Add a fixed marker framer related to a body frame. Marker frames are used to add joints or forces (they usually act between two of them or a body and a marker).

<col class="field-name" />
<col class="field-body" />

Parameters:

new_marker_name (str) – the name of the new marker

str_n_related (str) – the reference fixed body frame

vx, vy, vz (float) – the const. translation vector components in the related frame (float*3)

phix,phiy,phiz (float) – the const. rotation Eulerian angles for a new (body-fixed) orientation of the marker frame

add_moving_marker(new_marker_name, str_n_related, vx, vy, vz, vel, acc, axes)¶

Add a moving marker framer via velocity and acceleration.

<col class="field-name" />
<col class="field-body" />

Parameters:

new_marker_name (str) – the name of the new marker

str_n_related (str) – the reference fixed body frame

vx, vy, vz (float) – is the const. translation vector in the related frame

vel (float) – the velocity of the marker

acc (float) – the acceleration of the marker

axes (str) – the axis where the velocity is oriented (‘X’, ‘Y’ or ‘Z’)

add_moving_marker_para(new_marker_name, str_n_related, para_name, vx, vy, vz, axes)¶

Add a moving marker framer via a parameter.

<col class="field-name" />
<col class="field-body" />

Parameters:

new_marker_name (str) – the name of the new marker

str_n_related (str) – the reference fixed body frame

para_name (str) – the name of the involved parameter (as position)

vx, vy, vz (float) – the const. translation vector components in the related frame

axes (str) – the axis where the parameter as velocity is oriented (‘X’, ‘Y’ or ‘Z’)

add_one_body_force_model(model_name, str_m_b, str_m_b_ref, typ='tire', parameters=[])¶

Add an (external) model force/torque for one body: the force/torque is acting
on the body if the parameter is a body string and on the marker if it is a marker string

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b – a body name or a marker name

str_m_b_ref – a body name or a marker name as a reference where vel and omega is transmitted to the model and in which expressed the force and torque is acting

typ – the type of the model (the types can be extended easily, you are free to provide external models via the interface)

parameters – a dict of parameters applied to the force model as initial input

add_parameter_torque(str_m_b, str_m_b_ref, v, para_name)¶

Add an external torque to a body in the direction v, the abs value is equal the value of the parameter (para_name)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b – a body name or a marker name

str_m_b_ref – a body name or a marker name as a reference where vel and omega is transmitted to the model and in which expressed the force and torque is acting

v – direction of the torque (not normalized)

para_name – name of the parameter

add_reflective_wall(str_m_b, equ, str_m_b_ref, c, gamma, s)¶

Function to add a reflective wall constraint (plane equation in the easiest form)

<col class="field-name" />
<col class="field-body" />

Parameters:

str_m_b (str) – name of the body/marker

equ (sympy-expression) – is of form f(x,y,z)=0,

str_m_b_ref (str) – reference frame

c (float) – the stiffness of the reflective wall

gamma (float) – the damping (only perpendicular) of the wall

s (float) – the direction of the force (one of (1,-1))

add_rotating_marker(new_marker_name, str_n_related, vx, vy, vz, omega, axes)¶

Add a rotating marker framer with constant omega.

<col class="field-name" />
<col class="field-body" />

Parameters:

new_marker_name (str) – the name of the new marker

str_n_related (str) – the reference fixed body frame

vx, vy, vz (float) – the const. translation vector components in the related frame (float*3)

omega (float) – the angular velocity

axes (str) – the axis where the angular velocity is oriented (‘X’, ‘Y’ or ‘Z’)

add_rotating_marker_para(new_marker_name, str_n_related, para_name, vx, vy, vz, axes)¶

Add a rotating marker framer with parameter related phi

<col class="field-name" />
<col class="field-body" />

Parameters:

new_marker_name (str) – the new marker name

str_n_related (str) – the reference fixed body frame

para_name (str) – the parameter name which is the rotation angle

vx, vy, vz (float) – the const. translation vector components in the related frame

axes (str) –

calc_Jacobian(n)¶

Function to calculate the jacobian, after integration for calc-point no n.

<col class="field-name" />
<col class="field-body" />

Parameters:	n – the list-number of the integrated state vector

calc_lin_analysis_n(n)¶

Function to calculate linear anlysis (stability), after integration for calc-point no n.

<col class="field-name" />
<col class="field-body" />

Parameters:	n – the list-number of the integrated state vector

get_omega(n, frame, coord)¶

coord is 0..2 (x,y,z-direction)

get_pt_pos(n, frame, coord)¶

coord is 0..2

get_pt_vel(n, frame, coord)¶

coord is 0..2 (x,y,z-direction)

linearize(x_op, a_op, quad=False)¶

Function to prepare the linerarization process (kaneify_lin)

linfaktor(x_op, q)¶

Returns the linear factor of a single variable at value q.

<col class="field-name" />
<col class="field-body" />

Parameters:

x_op – the symbol

q – the value of the zero of this linear-factor

exception mubosym_core.ParameterError(paras, n_soll, name)¶

Exception raised for errors in the parameters

<col class="field-name" />
<col class="field-body" />

Parameters:

paras – input expression in which the error occurred

n_soll – explanation of the error

Created on Sat May 16 18:33:20 2015

@author: oliver

class b_splines_interface.characteristic_line(filename, tst=False)¶

The main connection between an external force characterized by a number of points and the mubosym
After running the initialization the base-functions are setup (by means of optimized coefficients)

<col class="field-name" />
<col class="field-body" />

Parameters:

filename – the external file with a list of x y - values (table, separation sign is space), if filename is empty the function f11 is taken instead

tst – if true the result of the optimization is plotted

myfunc(xx)¶

The lambdified force expression after optimizing the coefficients

<col class="field-name" />
<col class="field-body" />

Parameters:	xx – the distance between two bodies (or markers)

myfunc_0(arg)¶

The analytic force expression after optimizing the coefficients

<col class="field-name" />
<col class="field-body" />

Parameters:	xx – the distance between two bodies (or markers)

b_splines_interface.create_knots(a, b, n, p)¶

Function to create knots for b-spline basis startup. The distribution on the edges are crucial for the behaviour.

<col class="field-name" />
<col class="field-body" />

Parameters:

a – the left edge

b – the right edge

n – the total number of knots

p – the number of edge knots, the rest is distributed uniformly

b_splines_interface.f11(xx)¶

Example of a analytic expression replacing the external point number

<col class="field-name" />
<col class="field-body" />

Parameters:	xx – the distance between two bodies (or markers)

one_body_force_model¶

Created on Wed May 27 18:02:53 2015

@author: oliver

class one_body_force_model_interface.one_body_force_model¶

a one body force model consists of:

coordinate trafo generalized coords -> body coordinates (denoted list of) including pos, vel, orientation, and omega

force calculator given as a python function with input according to our interface

some preparation function: lambdifier to include symbolic functions into lambdas

calc(inp)¶

the python function which connects some external model calculation with the mbs model e.g. tire-model, rail model

input list inp are some relevant model coordinates (out of 12 possible): [ x, y, z, nx, ny, nz, x_pt, y_pt, z_pt, omega_x, omega_y, omega_z ] = inp

output list is force in cartesian coord. world and torque cartesian coord. world

force_lam(w)¶

the model force/torque via lambdified expressions, input parameter here is always the full state vecor t,q,u
Output is the force/toque via the model calc-function the nested input for the calc routine is fully possible written out:

self.lam_t, self.lam_x, self.lam_y, self.lam_z,

self.lam_nx, self.lam_ny, self.lam_nz,

self.lam_x_pt, self.lam_y_pt, self.lam_z_pt,

self.lam_omega_x self.lam_omega_y, self.lam_omega_z

but can be reduced to a subset

lambdify_trafo(generalized_coords)¶

this is the core function to lambdify the coordinate trafos in general the trafos must be explicitely set via set_coordinate_trafo called from MBSCore (see therein)

set_coordinate_trafo(tr)¶

input function for the coordinate trafo expressions (sympy)

trafo_lam(w)¶

just for reference all coordinate trafos as lambdas (not used at the moment)

simple_tire_model_interface¶

Created on Wed May 27 18:02:53 2015

@author: oliver

simple_tire_model_interface.Pacejka_F_lat(Fz, alpha, camber)¶

lateral force

<col class="field-name" />
<col class="field-body" />

Parameters:

Fz ((float)) – Force in vertical direction in N

alpha ((float)) – slip angle in rad

camber ((float)) – camber angle in rad

simple_tire_model_interface.Pacejka_F_long(Fz, slip)¶

longitudinal force

<col class="field-name" />
<col class="field-body" />

Parameters:

Fz ((float)) – Force in vertical direction in N

slip ((float)) – relative slip fraction (0..1)

class simple_tire_model_interface.simple_tire_model(paras=[])¶

A one body force model consists of:

coordinate trafo generalized coords -> body coordinates (denoted list of) including pos, vel, orientation, and omega

force calculator given as a python function with input according to our interface

some preparation function: lambdifier to include symbolic functions into lambdas

force_lam(w)¶

The model force/torque via lambdified expressions, input parameter here is always the full state vecor t,q,u.
Output is the force/toque via the model calc-function the nested input for the calc routine is fully possible written out:

self.lam_t, self.lam_x, self.lam_y, self.lam_z,

self.lam_nx, self.lam_ny, self.lam_nz,

self.lam_x_pt, self.lam_y_pt, self.lam_z_pt,

self.lam_omega_x self.lam_omega_y, self.lam_omega_z

but can be reduced to a subset

<col class="field-name" />
<col class="field-body" />

Parameters:	w – the generalized coords (float numbers) of the final mbs setup, The order has to be equal the one in calc.

lambdify_trafo(generalized_coords)¶

This is the core function to lambdify the coordinate trafos in general
the trafos must be explicitely set via set_coordinate_trafo called from MBSCore (see therein)

<col class="field-name" />
<col class="field-body" />

Parameters:	generalized_coords – the generalized coords (symbols) of the final mbs setup (called in kaneify)

set_coordinate_trafo(tr)¶

Input function for the coordinate trafo expressions (sympy).

<col class="field-name" />
<col class="field-body" />

Parameters:	tr – the transformation expressions as given in the mbs setup for the body

trafo_lam(w)¶

Just for reference all coordinate trafos as lambdas (not used at the moment).

<col class="field-name" />
<col class="field-body" />

Parameters:	w – the generalized coords (float numbers) of the final mbs setup

Created on Fri Apr  3 16:20:11 2015

@author: oliver

class vpython_3d.BoxObject(state_vec, p, length, *args, **kwargs)¶

Visual element point object.

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec – state vector in the order ???

p – scaling factor

set_orient(v_orient)¶

set orientation to v_orient.

<col class="field-name" />
<col class="field-body" />

Parameters:	v_orient – new orientation of point object

update()¶

class vpython_3d.PointObject(state_vec, p, *args, **kwargs)¶

Visual element point object.

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec – state vector in the order ???

p – scaling factor

set_orient(v_orient)¶

set orientation to v_orient.

<col class="field-name" />
<col class="field-body" />

Parameters:	v_orient – new orientation of point object

update()¶

class vpython_3d.RodConnection(state_vec, p, myr, *args, **kwargs)¶

simple rod connection derived from vis.cylinder.

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec – state vector

p –

class vpython_3d.SpringConnection(state_vec, p, *args, **kwargs)¶

visual representation of spring connection, derived from vis.helix.

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec – state vector

p –

update()¶

update to the spring connection

class vpython_3d.Tire(state_vec, p, *args, **kwargs)¶

Visual element point object.

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec – state vector in the order ???

p – scaling factor

set_orient(v_orient)¶

set orientation to v_orient.

<col class="field-name" />
<col class="field-body" />

Parameters:	v_orient – new orientation of point object

update()¶

class vpython_3d.Vector_dyn(v_auf, v_orient, txt, p, *args, **kwargs)¶

dynamic Vector, provides update function.

<col class="field-name" />
<col class="field-body" />

Parameters:

vauf – origin of the vector

v_orient – orientation of the vector

txt – text to be passed to the label

p – scaling of the vector

update()¶

class vpython_3d.Vector_stat(v_auf, v_orient, txt, p, *args, **kwargs)¶

static Vector, it will not be modified.

<col class="field-name" />
<col class="field-body" />

Parameters:

vauf – origin of the vector

v_orient – orientation of the vector

txt – text to be passed to the label

p – scaling of the vector

class vpython_3d.animation(scale)¶

<col class="field-name" />
<col class="field-body" />

Parameters:

state_vec –

con_vec –

con_type –

txt_vec –

dt –

keyword_args:

<col class="field-name" />
<col class="field-body" />

Parameters:

p –

label –

class vpython_3d.myLabel(txt_vec, *args, **kwargs)¶

label class derived from vis.label.

update()¶

Indices and tables¶

Index

Module Index

Search Page

Table Of Contents

Welcome to mubosym’s documentation!

all mubosym related core classes

one_body_force_model

simple_tire_model_interface

Indices and tables

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

      ©2015, Braun, Eckstein.

      |
      Powered by Sphinx 1.3.1
      & Alabaster 0.7.3

      |
      Page source


text:
#ifndef targ_ctrl_INCLUDED
#define targ_ctrl_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif

/* ====================================================================
 * ====================================================================
 *
 * Module: targ_ctrl.h
 * $Revision: 1.1 $
 * $Date: 2001/10/30 16:59:45 $
 * $Author: ciancu $
 * $Source: bitbucket.org:berkeleylab/upc-translator.git/open64/osprey1.0/common/com/ia64/targ_ctrl.h $
 *
 * Description:
 *
 * This file contains target-specific control information.  It is
 * included in controls.c and should not be visible elsewhere.
 *
 * ====================================================================
 * ====================================================================
 */

#ifdef _KEEP_RCS_ID
static char *targ_ctrl_rcs_id = "$Source: bitbucket.org:berkeleylab/upc-translator.git/open64/osprey1.0/common/com/ia64/targ_ctrl.h $ $Revision: 1.1 $";
#endif /* _KEEP_RCS_ID */

static STR_LIST Targ_1 = {"IA64", NULL};

#define Possible_Targets Targ_1
#define TARG_FIRST_DEF 0
#define TARG_SECOND_DEF 0

#ifdef __cplusplus
}
#endif
#endif /* targ_ctrl_INCLUDED */


text:
<?php
    $this->pageTitle = CHtml::encode($user->nick_name);
    $this->breadcrumbs = array(
        Yii::t('UserModule.user','Users') => array('/user/people/index/'),
        CHtml::encode($user->getfullName()),
    );
?>

         <?php $this->widget('AvatarWidget', array('user' => $user)); ?>

          <?php echo CHtml::link(CHtml::encode($user->getFullName()), array('/user/people/userInfo/', 'username' => CHtml::encode($user->nick_name))); ?>

         <?php if($user->last_visit):?>
             <?php echo Yii::t('UserModule.user', 'Last visit {last_visit}', array(
               "{last_visit}" => Yii::app()->dateFormatter->formatDateTime($user->last_visit, 'long', null)
            ));?>

         <?php endif;?>

         <?php if($user->location):?>
             <?php echo CHtml::encode($user->location);?>

         <?php endif;?>

         <?php if($user->site):?>
             <?php echo CHtml::link($user->site,$user->site, array('rel' => 'nofollow', 'target' => '_blank'));?>

         <?php endif;?>

    <?php if($user->about):?>

<?php echo $user->about; ?>

    <?php endif;?>

<?php $this->widget('application.modules.blog.widgets.UserBlogsWidget', array(
    'userId' => $user->id
)); ?>

<?php $this->widget('application.modules.blog.widgets.LastPostsWidget', array(
    'view' => 'lastuserposts',
    'criteria' => array(
        'condition' => 't.create_user_id = :user_id',
        'params' => array(
            ':user_id' => $user->id
        )
    )
)); ?>


text:
"use strict";

angular.module("openshiftConsole")
  .controller("CreateFromImageController", function ($scope,
      Logger,
      $q,
      $routeParams,
      APIService,
      DataService,
      ProjectsService,
      Navigate,
      ApplicationGenerator,
      LimitRangesService,
      MetricsService,
      HPAService,
      TaskList,
      failureObjectNameFilter,
      $filter,
      $parse,
      SOURCE_URL_PATTERN
    ){
    var displayNameFilter = $filter('displayName');
    var humanize = $filter('humanize');

    $scope.projectName = $routeParams.project;
    $scope.sourceURLPattern = SOURCE_URL_PATTERN;
    var imageName = $routeParams.imageName;

    $scope.breadcrumbs = [
      {
        title: $scope.projectName,
        link: "project/" + $scope.projectName
      },
      {
        title: "Add to Project",
        link: "project/" + $scope.projectName + "/create"
      },
      {
        title: imageName
      }
    ];

    ProjectsService
      .get($routeParams.project)
      .then(_.spread(function(project, context) {
        $scope.project = project;
        // Update project breadcrumb with display name.
        $scope.breadcrumbs[0].title = $filter('displayName')(project);
        function initAndValidate(scope){

          if(!imageName){
            Navigate.toErrorPage("Cannot create from source: a base image was not specified");
          }
          if(!$routeParams.imageTag){
            Navigate.toErrorPage("Cannot create from source: a base image tag was not specified");
          }

          scope.emptyMessage = "Loading...";
          scope.imageName = imageName;
          scope.imageTag = $routeParams.imageTag;
          scope.namespace = $routeParams.namespace;
          scope.buildConfig = {
            buildOnSourceChange: true,
            buildOnImageChange: true,
            buildOnConfigChange: true,
            envVars : {
            }
          };
          scope.deploymentConfig = {
            deployOnNewImage: true,
            deployOnConfigChange: true,
            envVars : {
            }
          };
          scope.routing = {
            include: true,
            portOptions: []
          };
          scope.labels = {};
          scope.annotations = {};
          scope.scaling = {
            replicas: 1,
            autoscale: false,
            autoscaleOptions: [{
              label: 'Manual',
              value: false
            }, {
              label: 'Automatic',
              value: true
            }]
          };
          scope.container = {
            resources: {}
          };

          // Check if requests or limits are calculated. Memory limit is never calculated.
          scope.cpuRequestCalculated = LimitRangesService.isRequestCalculated('cpu', project);
          scope.cpuLimitCalculated = LimitRangesService.isLimitCalculated('cpu', project);
          scope.memoryRequestCalculated = LimitRangesService.isRequestCalculated('memory', project);

          scope.fillSampleRepo = function() {
            var annotations;
            if (!scope.image && !scope.image.metadata && !scope.image.metadata.annotations) {
              return;
            }

            annotations = scope.image.metadata.annotations;
            scope.buildConfig.sourceUrl = annotations.sampleRepo || "";
            scope.buildConfig.gitRef = annotations.sampleRef || "";
            scope.buildConfig.contextDir = annotations.sampleContextDir || "";
          };

          scope.usingSampleRepo = function() {
            return scope.buildConfig.sourceUrl === _.get(scope, 'image.metadata.annotations.sampleRepo');
          };

          // Warn if metrics aren't configured when setting autoscaling options.
          MetricsService.isAvailable().then(function(available) {
            $scope.metricsWarning = !available;
          });

          DataService.get("imagestreams", scope.imageName, {namespace: (scope.namespace || $routeParams.project)}).then(function(imageStream){
              scope.imageStream = imageStream;
              var imageName = scope.imageTag;
              DataService.get("imagestreamtags", imageStream.metadata.name + ":" + imageName, {namespace: scope.namespace}).then(function(imageStreamTag){
                  scope.image = imageStreamTag.image;
                  var env = $parse('dockerImageMetadata.ContainerConfig.Env')(imageStreamTag.image) || [];
                  angular.forEach(env, function(entry){
                    var pair = entry.split("=");
                    scope.deploymentConfig.envVars[pair[0]] = pair[1];
                  });

                  var ports = ApplicationGenerator.parsePorts(imageStreamTag.image);
                  if (ports.length === 0) {
                    scope.routing.include = false;
                    scope.routing.portOptions = [];
                  } else {
                    scope.routing.portOptions = _.map(ports, function(portSpec) {
                      var servicePort = ApplicationGenerator.getServicePort(portSpec);
                      return {
                        port: servicePort.name,
                        label: servicePort.targetPort + "/" + servicePort.protocol
                      };
                    });
                    scope.routing.targetPort = scope.routing.portOptions[0].port;
                  }
                }, function(){
                    Navigate.toErrorPage("Cannot create from source: the specified image could not be retrieved.");
                  }
                );
            },
            function(){
              Navigate.toErrorPage("Cannot create from source: the specified image could not be retrieved.");
            });
        }

        var validatePodLimits = function() {
          if (!$scope.hideCPU) {
            $scope.cpuProblems = LimitRangesService.validatePodLimits($scope.limitRanges, 'cpu', [$scope.container], project);
          }
          $scope.memoryProblems = LimitRangesService.validatePodLimits($scope.limitRanges, 'memory', [$scope.container], project);
        };

        DataService.list("limitranges", context, function(limitRanges) {
          $scope.limitRanges = limitRanges.by("metadata.name");
          if ($filter('hashSize')(limitRanges) !== 0) {
            $scope.$watch('container', validatePodLimits, true);
          }
        });

        var checkCPURequest = function() {
          if (!$scope.scaling.autoscale) {
            $scope.showCPURequestWarning = false;
            return;
          }

          // Warn if autoscaling is set, but there won't be a CPU request for the container.
          $scope.showCPURequestWarning = !HPAService.hasCPURequest([$scope.container], $scope.limitRanges, project);
        };

        $scope.$watch('scaling.autoscale', checkCPURequest);
        $scope.$watch('container', checkCPURequest, true);

        initAndValidate($scope);

        var ifResourcesDontExist = function(apiObjects, namespace){
          var result = $q.defer();
          var successResults = [];
          var failureResults = [];
          var remaining = apiObjects.length;

          function _checkDone() {
            if (remaining === 0) {
              if(successResults.length > 0){
                //means some resources exist with the given nanme
                result.reject(successResults);
              }
              else {
                //means no resources exist with the given nanme
                result.resolve(apiObjects);
              }
            }
          }

          apiObjects.forEach(function(apiObject) {
            var resource = APIService.objectToResourceGroupVersion(apiObject);
            if (!resource) {
              failureResults.push({data: {message: APIService.invalidObjectKindOrVersion(apiObject)}});
              remaining--;
              _checkDone();
              return;
            }
            if (!APIService.apiInfo(resource)) {
              failureResults.push({data: {message: APIService.unsupportedObjectKindOrVersion(apiObject)}});
              remaining--;
              _checkDone();
              return;
            }
            DataService.get(resource, apiObject.metadata.name, {namespace: (namespace || $routeParams.project)}, {errorNotification: false}).then(
              function (data) {
                successResults.push(data);
                remaining--;
                _checkDone();
              },
              function (data) {
                failureResults.push(data);
                remaining--;
                _checkDone();
              }
            );
          });
          return result.promise;
        };

        var createResources = function(resources){
          var titles = {
            started: "Creating application " + $scope.name + " in project " + $scope.projectDisplayName(),
            success: "Created application " + $scope.name + " in project " + $scope.projectDisplayName(),
            failure: "Failed to create " + $scope.name + " in project " + $scope.projectDisplayName()
          };
          var helpLinks = {};

          TaskList.clear();
          TaskList.add(titles, helpLinks, function(){
            var d = $q.defer();
            DataService.batch(resources, context)
              //refactor these helpers to be common for 'newfromtemplate'
              .then(function(result) {
                    var alerts = [];
                    var hasErrors = false;
                    if (result.failure.length > 0) {
                      hasErrors = true;
                      result.failure.forEach(
                        function(failure) {
                          alerts.push({
                            type: "error",
                            message: "Cannot create " + humanize(failure.object.kind).toLowerCase() + " \"" + failure.object.metadata.name + "\". ",
                            details: failure.data.message
                          });
                        }
                      );
                      result.success.forEach(
                        function(success) {
                          alerts.push({
                            type: "success",
                            message: "Created " + humanize(success.kind).toLowerCase() + " \"" + success.metadata.name + "\" successfully. "
                          });
                        }
                      );
                    } else {
                      alerts.push({ type: "success", message: "All resources for application " + $scope.name +
                        " were created successfully."});
                    }
                    d.resolve({alerts: alerts, hasErrors: hasErrors});
                  }
                );
                return d.promise;
              },
              function(result) { // failure
                $scope.alerts["create"] =
                  {
                    type: "error",
                    message: "An error occurred creating the application.",
                    details: "Status: " + result.status + ". " + result.data
                  };
              }
            );
          Navigate.toNextSteps($scope.name, $scope.projectName, $scope.usingSampleRepo() ? {"fromSample": true} : null);
        };

        var elseShowWarning = function(){
          $scope.nameTaken = true;
          $scope.disableInputs = false;
        };

        $scope.projectDisplayName = function() {
          return displayNameFilter(this.project) || this.projectName;
        };

        $scope.createApp = function(){
          $scope.disableInputs = true;
          var resourceMap = ApplicationGenerator.generate($scope);
          //init tasks
          var resources = [];
          angular.forEach(resourceMap, function(value){
            if(value !== null){
              Logger.debug("Generated resource definition:", value);
              resources.push(value);
            }
          });

          ifResourcesDontExist(resources, $scope.projectName, $scope)
            .then(createResources, elseShowWarning);
        };
      }));
  });


text:
/*global define */
define(['services/session', 'plugins/http', 'jquery', 'config/httpServiceApiLinks', 'common/loadingMask/loadingMask', '../shell', 'services/logger', 'i18n'],
  function (session, http, $, httpServiceApiLinks, loadingMask, shell, logger, i18n) {
    'use strict';

    var TIMEOUT = 30000;
    var userInfoUrl = 'account/userinfo';

    var securityDomainLink = httpServiceApiLinks.security;
    var changePasswordUrl = securityDomainLink + 'api/Account/changePassword';
    var loginUrl = securityDomainLink + 'token';
    var logoutUrl = securityDomainLink + 'api/account/logout';
    var requestsCount = 0;
    var _queryTimeout = undefined;
    var loadingMaskDelay = 200;
    var resetLoadingMaskTimer;

    var showLoadingMask = function () {
      requestsCount += 1;

      if (requestsCount === 1) {
        if (loadingMaskDelay > 0) {
          _queryTimeout = window.setTimeout(function () {
            if (requestsCount > 0) {
              loadingMask.show()
            }
          }, loadingMaskDelay);
        } else {
          loadingMask.show();
        }
      }
    };

    var resetLoadingMask = function () {
      if (requestsCount <= 0) {
        if (_queryTimeout) {
          window.clearTimeout(_queryTimeout);
        }

        loadingMask.hide();
        requestsCount = 0;
      }
    };

    var hideLoadingMask = function () {
      requestsCount -= 1;
      if (requestsCount <= 0) {
        if (resetLoadingMaskTimer) {
          window.clearTimeout(resetLoadingMaskTimer);
        }

        resetLoadingMaskTimer = window.setTimeout(resetLoadingMask, 0);
      }
    };

    var convertToArray = function (value) {
      var result = value || [];
      if (typeof result === 'string') {
        return result.split(',');
      }

      return result;
    };

    var getSecurityHeaders = function () {
      var accessToken = session.rememberedToken();
      if (accessToken) {
        return {
          'Authorization': 'Bearer ' + accessToken
        };
      }

      return {};
    };

    var proccessFailReq = function (jqXHR, textStatus, errorThrown) {
      if (jqXHR.status === 401) {
        logger.warn({ message: i18n.t('app:yourSessionTimedOut') });
        shell.logout();
      } else if (jqXHR.status === 403) {
        logger.warn({ message: i18n.t('app:accessDenied') });
      }
    };

    var downloadFile = function (url, method, data) {
      var authHeaderValue = getSecurityHeaders();//'Bearer' + this.token;

      var deferred = $.Deferred(function (defer) {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.open(method, url, true);
        xmlhttp.timeout = TIMEOUT;
        xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
        xmlhttp.setRequestHeader('Authorization', authHeaderValue.Authorization);
        xmlhttp.responseType = "blob";

        xmlhttp.onload = function (oEvent) {
          if (this.status !== 200) {
            defer.reject({ statusCode: this.status });
            return;
          }

          var blob = xmlhttp.response;
          var windowUrl = window.URL || window.webkitURL;
          var url = windowUrl.createObjectURL(blob);
          var filename = this.getResponseHeader('Content-Disposition').match(/^attachment; filename=(.+)/)[1];

          var anchor = $('');
          anchor.prop('href', url);
          anchor.prop('download', filename);
          $('body').append(anchor);
          anchor.get(0).click();
          windowUrl.revokeObjectURL(url);
          anchor.remove();
        };

        xmlhttp.ontimeout = function () {
          defer.reject({ timeout: true })
        };

        xmlhttp.addEventListener("error", function () {
          defer.reject();
        });
        xmlhttp.addEventListener("load", function () {
          defer.resolve();
        });
        if (method === 'GET') {
          xmlhttp.send();
        } else if (method === 'POST') {
          xmlhttp.send(JSON.stringify(data));
        } else {
          throw new Error("Unsuported method call!");
        }
      });

      deferred.fail(errorHandler.bind(this));

      return deferred;
    };

    var errorHandler = function errorHandler(response) {
      if (response.statusCode === 401) {
        logger.warn({ message: i18n.t('common.sessionTimedOut') });
      } else if (response.statusCode === 403) {
        logger.warn({ message: i18n.t('common.accessDenied') });
      } else if (response.statusCode === 500) {
        logger.error({ message: i18n.t('common.internalServerError') });
      } else if (response.timeout === true) {
        logger.error({ message: i18n.t('common.requestTimeout') });
      } else {
        logger.error('TODO: Implement ajax fails!');
      }
    };

    var getUrl = function (url, host) {
      var requestUrl;
      if (host) {
        requestUrl = host + url;
      } else {
        requestUrl = httpServiceApiLinks.root + url;
      }

      return requestUrl;
    }

    return {
      post: function (url, data, host) {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var req = http.post(requestUrl, data, headers);
        req.fail(proccessFailReq);
        req.always(hideLoadingMask);

        return req;
      },
      get: function (url, data, host) {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var req = http.get(requestUrl, data, headers);
        req.fail(proccessFailReq);
        req.always(hideLoadingMask);

        return req;
      },
      put: function (url, data, host) {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var req = http.put(requestUrl, data, headers);
        req.fail(proccessFailReq);
        req.always(hideLoadingMask);

        return req;
      },
      remove: function (url, data, host) {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var req = $.ajax({
          headers: headers,
          type: 'DELETE',
          url: requestUrl,
          contentType: 'application/json',
          dataType: 'json',
          traditional: true,
          data: JSON.stringify(data)
        });
        req.fail(proccessFailReq);
        req.always(hideLoadingMask);

        return req;
      },
      postDownloadFile: function (url, data, host) {
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var download = downloadFile(requestUrl, 'POST', data);
        hideLoadingMask();
        return download;
      },
      getDownloadFile: function (url, host) {
        showLoadingMask();
        var requestUrl = getUrl(url, host);
        var download = downloadFile(requestUrl, 'GET');
        hideLoadingMask();
        return download;
      },
      getUserInfo: function () {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = httpServiceApiLinks.root + userInfoUrl;

        return $.ajax(requestUrl, {
          cache: false,
          headers: headers
        }).always(hideLoadingMask);

      },
      multipartFormPost: function (url, data, host) {
        var headers = getSecurityHeaders();
        showLoadingMask();
        var requestUrl = getUrl(url, host);

        var req = $.ajax({
          url: requestUrl,
          data: data,
          processData: false,
          contentType: false,
          type: 'POST',
          headers: headers
        });
        req.always(hideLoadingMask);
        return req;
      },
      securityService: {
        changePassword: function changePassword(data) {
          var headers = this.getSecurityHeaders();
          showLoadingMask();
          return $.ajax(changePasswordUrl, {
            type: 'POST',
            data: data,
            headers: headers
          }).always(hideLoadingMask);
        },
        login: function (data) {
          showLoadingMask();

          var req = $.ajax(loginUrl, {
            type: 'POST',
            data: data
          }).always(hideLoadingMask);
          req.fail(proccessFailReq);

          return req.done(function (data) {
            session.setUser({
              token: data.access_token,
              userName: data.userName || 'please give me a name!',
              userClaims: JSON.parse(data.userClaims || '[]'),
              userRoles: convertToArray(data.userRoles),
              userAccessRights: convertToArray(data.userAccessRights)
            });
          });
        },
        logout: function logout() {
          var headers = this.getSecurityHeaders();
          showLoadingMask();

          return $.ajax(logoutUrl, {
            type: 'POST',
            headers: headers
          }).always(hideLoadingMask);
        }
      }
    };
  });


text:
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;
using ImageCircle.Forms.Plugin.iOS;

namespace findme.iOS
{
	[Register ("AppDelegate")]
	public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
	{
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Xamarin.FormsMaps.Init ();  //so we can get the map to load
			global::Xamarin.Forms.Forms.Init ();
			ImageCircleRenderer.Init (); //so we can get the image circle properties

			// Code for starting up the Xamarin Test Cloud Agent
			#if ENABLE_TEST_CLOUD
			Xamarin.Calabash.Start();
			#endif

			LoadApplication (new App ());

			return base.FinishedLaunching (app, options);
		}
	}
}