text:
/*globals describe, it, require, before, global, $*/
var expect = require('chai').expect;
var jsdom = require('jsdom');
var jq = require('jquery');
var result = require('../tasks/scripts');

describe('Task #2 Tests:', function () {
  var html = `

`;

  before(function (done) {
    jsdom.env({
      html: '',
      done: function (errors, window) {
        global.window = window;
        global.document = window.document;
        global.$ = jq(window);
        Object.keys(window)
          .filter(function (prop) {
          return prop.toLowerCase().indexOf('html') >= 0;
        }).forEach(function (prop) {
          global[prop] = window[prop];
        });
        done();
      }
    });
  });

  it('expect to has class ".gallery"', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery';
    result();
    $('#' + rootId).gallery();
    expect($('.gallery')).to.has.length(1);
  });

  it('expect to have 4 columns, without passing a param', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery';
    result();
    $('#' + rootId).gallery();
    var $gallery = $('#' + rootId);
    var $images = $gallery.find('.image-container');
    var count = 0;
    $images.each(function (index, image) {
      var $image = $(image);
      count += 1;
      if (count === 4 && index < $images.length - 1) {
        var condition = $image.next().hasClass('clearfix');
        if (!condition) {
          console = $image.next().css('clear');
        }
        expect(condition).to.be.true;
        count = 0;
      }
    });
  });

  it('expect to have 4 columns, when passing a param 4', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 4;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);
    var $images = $gallery.find('.image-container');
    var count = 0;
    $images.each(function (index, image) {
      var $image = $(image);
      count += 1;
      if (count === columnsCount && index < $images.length - 1) {
        var condition = $image.next().hasClass('clearfix');
        if (!condition) {
          console = $image.next().css('clear');
        }
        expect(condition).to.be.true;
        count = 0;
      }
    });
  });

  it('expect to have 3 columns, when passing a param 3', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 3;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);
    var $images = $gallery.find('.image-container');
    var count = 0;
    $images.each(function (index, image) {
      var $image = $(image);
      count += 1;
      if (count === columnsCount && index < $images.length - 1) {
        var condition = $image.next().hasClass('clearfix');
        if (!condition) {
          console = $image.next().css('clear');
        }
        expect(condition).to.be.true;
        count = 0;
      }
    });
  });

  it('expect to have 5 columns, when passing a param 3', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);
    var $images = $gallery.find('.image-container');
    var count = 0;
    $images.each(function (index, image) {
      var $image = $(image);
      count += 1;
      if (count === columnsCount && index < $images.length - 1) {
        var condition = $image.next().hasClass('clearfix');
        if (!condition) {
          console = $image.next().css('clear');
        }
        expect(condition).to.be.true;
        count = 0;
      }
    });
  });

  it('expect ".selected" to be initialy hidden', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);
    expect($gallery.find('.selected').css('display')).to.equal('none');
  });

  it('expect a click on an image to show ".selected" ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img');
    var imageToClick = $images.get((Math.random() * $images.length) | 0);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $selected = $gallery.find('.selected');

    expect($selected.css('display')).not.to.equal('none');
  });

  it('expect a click on an image to "blur" the ".gallery-list"', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img');
    var imageToClick = $images.get((Math.random() * $images.length) | 0);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $galleryList = $gallery.find('.gallery-list');

    expect($galleryList.hasClass('blurred')).to.be.true;
  });

  it('expect a click on the #current-image inside the ".selected" to hide the selected', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img');
    var imageToClick = $images.get((Math.random() * $images.length) | 0);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);
    $('#current-image').get(0).dispatchEvent(clickEvent);

    var $selected = $gallery.find('.selected');

    expect($selected.css('display')).to.equal('none');
  });

  it('expect after a click on an image in the middle, the #next-image, #current-image and #previous-image to be updated', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = Math.floor(len / 2);
    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    var currentIndex = imgIndex;
    var prevIndex = (imgIndex - 1 + len) % len;
    var nextIndex = (imgIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect after a click on the first image, the #next-image, #current-image and #previous-image to be updated', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = 0;
    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    var currentIndex = imgIndex;

    var prevIndex = (imgIndex - 1 + len) % len;
    var nextIndex = (imgIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect after a click on the last image, the #next-image, #current-image and #previous-image to be updated', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = len - 1;
    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    var currentIndex = imgIndex;
    var prevIndex = (imgIndex - 1 + len) % len;
    var nextIndex = (imgIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #next-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is in the middle ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = Math.floor(len / 2);

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $nextImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex + 1) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #previous-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is in the middle ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = Math.floor(len / 2);

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $prevImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex - 1 + len) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #next-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is the first image ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = 0;

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $nextImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex + 1) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #previous-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is the first image ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = 0;

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $prevImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex - 1 + len) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #next-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is the last image ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = len - 1;

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $nextImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex + 1) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });

  it('expect a click on #previous-image, the #next-image, #current-image and #previous-image to be updated, when #current-image is the first image ', function () {
    document.body.innerHTML = html;
    var rootId = 'gallery',
      columnsCount = 5;
    result();
    $('#' + rootId).gallery(columnsCount);
    var $gallery = $('#' + rootId);

    var $images = $gallery.find('.image-container img'),
      len = $images.length;
    var imgIndex = len - 1;

    var imageToClick = $images.get(imgIndex);

    var clickEvent = document.createEvent('MouseEvents');
    clickEvent.initEvent('click', true, true);

    imageToClick.dispatchEvent(clickEvent);

    var $prevImage = $gallery.find('#previous-image');
    var $currentImage = $gallery.find('#current-image');
    var $nextImage = $gallery.find('#next-image');

    $prevImage.get(0).dispatchEvent(clickEvent);

    var currentIndex = (imgIndex - 1 + len) % len;
    var prevIndex = (currentIndex - 1 + len) % len;
    var nextIndex = (currentIndex + 1) % len;

    expect($prevImage.attr('src')).to.equal($images.eq(prevIndex).attr('src'));
    expect($currentImage.attr('src')).to.equal($images.eq(currentIndex).attr('src'));
    expect($nextImage.attr('src')).to.equal($images.eq(nextIndex).attr('src'));
  });
});


text:
var HelloWorldLayer = cc.Layer.extend({
    sprite:null,
    ctor:function () {
        this._super();
        this._coin = 0;
        var self = this;

        var size = cc.winSize;

        var ui = ccs.load(res.MainScene_json);
        this.addChild(ui.node);

        this.btnVideo = ui.node.getChildByName("btnVideo");
        this.btnVideo.setEnabled(false);
        this.btnVideo.addClickEventListener(function(){
            sdkbox.PluginVungle.show("video");
        });

        this.btnReward = ui.node.getChildByName("btnReward");
        this.btnReward.setEnabled(false);
        this.btnReward.addClickEventListener(function(){
            sdkbox.PluginVungle.show("reward");
        });

        this._txtCoins = ui.node.getChildByName("txtCoins");

        sdkbox.PluginVungle.init();
        sdkbox.PluginVungle.setListener({
            onVungleCacheAvailable : function () {
                self.btnVideo.setEnabled(true);
                self.btnReward.setEnabled(true);
            },
            onVungleAdViewed : function (isComplete) {
                if (isComplete) {
                    cc.log("Complete");
                }
                else {
                    cc.log("Not Complete");
                }

            },
            onVungleStarted : function () {
                cc.log("Ad Started");
            },
            onVungleFinished : function () {
                cc.log("Ad Finished");
            },
            onVungleAdReward : function (name){
                cc.log("Ad Reward");
                self._coin ++;
                self._txtCoins.setString(self._coin);
            }
        });

        return true;
    }
});

var HelloWorldScene = cc.Scene.extend({
    onEnter:function () {
        this._super();
        var layer = new HelloWorldLayer();
        this.addChild(layer);
    }
});

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
        <group>
            <file>file:/Users/wendygunderson/NetBeansProjects/1259RobotTemplate/src/edu/wpi/first/wpilibj/paradigm/DriveTrain.java</file>
            <file>file:/Users/wendygunderson/NetBeansProjects/1259RobotTemplate/src/edu/wpi/first/wpilibj/paradigm/RobotMainClass.java</file>
            <file>file:/Users/wendygunderson/NetBeansProjects/1259RobotTemplate/src/edu/wpi/first/wpilibj/paradigm/OperatorInputs.java</file>
        </group>
    </open-files>
</project-private>


text:
geodat.nc.wgt_ave
=================

.. currentmodule:: geodat.nc

.. autofunction:: wgt_ave


text:
package com.lightbend.lagom.scaladsl.it.routers

import akka.NotUsed
import com.lightbend.lagom.scaladsl.api.ServiceLocator
import com.lightbend.lagom.scaladsl.server.LagomApplication
import com.lightbend.lagom.scaladsl.server.LagomApplicationContext
import com.lightbend.lagom.scaladsl.server.LagomServer
import com.lightbend.lagom.scaladsl.server.LocalServiceLocator
import com.lightbend.lagom.scaladsl.testkit.ServiceTest
import com.lightbend.lagom.scaladsl.testkit.ServiceTest.TestServer
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.Matchers
import org.scalatest.WordSpec
import play.api.http.DefaultWriteables
import play.api.http.HeaderNames
import play.api.libs.ws.WSClient
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.mvc
import play.api.mvc._
import play.api.routing.SimpleRouterImpl
import play.api.test.FakeHeaders
import play.api.test.FakeRequest
import play.api.test.Helpers
import play.core.j.JavaRouterAdapter
import play.api.test.Helpers._

import scala.concurrent.ExecutionContext
import scala.concurrent.Future

class AdditionalRoutersSpec extends WordSpec with Matchers with ScalaFutures {
  "A LagomServer " should {
    "be extensible with a Play Router" in withServer { server =>
      val request = FakeRequest(GET, "/hello/")
      val result  = Helpers.route(server.application.application, request).get.futureValue

      result.header.status shouldBe OK
      val body = result.body.consumeData(server.materializer).futureValue.utf8String
      body shouldBe "hello"
    }
  }

  def withServer(block: TestServer[TestApp] => Unit): Unit = {
    ServiceTest.withServer(ServiceTest.defaultSetup.withCassandra(false).withCluster(false)) { ctx =>
      new TestApp(ctx)
    } { server =>
      block(server)
    }
  }

  class TestApp(context: LagomApplicationContext)
      extends LagomApplication(context)
      with AhcWSComponents
      with LocalServiceLocator {
    override def lagomServer: LagomServer =
      serverFor[AdditionalRoutersService](new AdditionalRoutersServiceImpl)
        .additionalRouter(FixedResponseRouter("hello").withPrefix("/hello"))
  }
}

/**
 * Builds a router that can be used in test.
 *
 * The router is configured with a fixed message and always respond with the same message.
 * @return
 */
object FixedResponseRouter {
  def apply(msg: String) =
    new SimpleRouterImpl({
      case _ =>
        new Action[Unit] {
          override def parser: BodyParser[Unit] = mvc.BodyParsers.utils.empty

          override def apply(request: Request[Unit]): Future[Result] =
            Future.successful(Results.Ok(msg))

          override def executionContext: ExecutionContext =
            scala.concurrent.ExecutionContext.global
        }
    })
}


text:
// Copyright (C) 2015 Google, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if UNITY_ANDROID

using System;
using System.Collections.Generic;
using UnityEngine;

using GoogleMobileAds.Api;
using GoogleMobileAds.Common;

namespace GoogleMobileAds.Android
{
    public class AdLoaderClient : AndroidJavaProxy, IAdLoaderClient
    {
        private AndroidJavaObject adLoader;
        private Dictionary<string, Action<CustomNativeTemplateAd, string>>
                CustomNativeTemplateCallbacks { get; set; }
        public event EventHandler<AdFailedToLoadEventArgs> OnAdFailedToLoad;
        public event EventHandler<CustomNativeEventArgs> OnCustomNativeTemplateAdLoaded;

        public AdLoaderClient(AdLoader unityAdLoader) : base(Utils.UnityCustomNativeAdListener)
        {
            AndroidJavaClass playerClass = new AndroidJavaClass(Utils.UnityActivityClassName);
            AndroidJavaObject activity =
                playerClass.GetStatic<AndroidJavaObject>("currentActivity");
            adLoader = new AndroidJavaObject(Utils.NativeAdLoaderClassName, activity,
                unityAdLoader.AdUnitId, this);

            this.CustomNativeTemplateCallbacks = unityAdLoader.CustomNativeTemplateClickHandlers;

            if (unityAdLoader.AdTypes.Contains(NativeAdType.CustomTemplate))
            {
                foreach (string templateId in unityAdLoader.TemplateIds)
                {
                    adLoader.Call("configureCustomNativeTemplateAd", templateId,
                        this.CustomNativeTemplateCallbacks.ContainsKey(templateId));
                }
            }
            adLoader.Call("create");
        }

        public void LoadAd(AdRequest request)
        {
            adLoader.Call("loadAd", Utils.GetAdRequestJavaObject(request));
        }

        public void onCustomTemplateAdLoaded(AndroidJavaObject ad)
        {
            if (this.OnCustomNativeTemplateAdLoaded != null)
            {
                CustomNativeEventArgs args = new CustomNativeEventArgs() {
                    nativeAd = new CustomNativeTemplateAd(new CustomNativeTemplateClient(ad))
                };
                this.OnCustomNativeTemplateAdLoaded(this, args);
            }
        }

        void onAdFailedToLoad(string errorReason)
        {
            if (this.OnAdFailedToLoad != null)
            {
                AdFailedToLoadEventArgs args = new AdFailedToLoadEventArgs()
                {
                    Message = errorReason
                };
                this.OnAdFailedToLoad(this, args);
            }
        }

        public void onCustomClick(AndroidJavaObject ad, string assetName)
        {
            CustomNativeTemplateAd nativeAd = new CustomNativeTemplateAd(
                    new CustomNativeTemplateClient(ad));
            this.CustomNativeTemplateCallbacks[nativeAd.GetCustomTemplateId()](nativeAd, assetName);
        }
    }
}

#endif


text:
'use strict';

var React = require('react');
var PureRenderMixin = require('react-addons-pure-render-mixin');
var SvgIcon = require('../../svg-icon');

var EditorFormatAlignLeft = React.createClass({
  displayName: 'EditorFormatAlignLeft',

  mixins: [PureRenderMixin],

  render: function render() {
    return React.createElement(
      SvgIcon,
      this.props,
      React.createElement('path', { d: 'M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z' })
    );
  }

});

module.exports = EditorFormatAlignLeft;


text:
Taktee
======

### Taktee Examples


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="latest_ob.xsl" type="text/xsl"?>
<current_observation version="1.0"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
	<credit>NOAA's National Weather Service</credit>
	<credit_URL>http://weather.gov/</credit_URL>
	<image>
		<url>http://weather.gov/images/xml_logo.gif</url>
		<title>NOAA's National Weather Service</title>
		<link>http://weather.gov</link>
	</image>
	<suggested_pickup>15 minutes after the hour</suggested_pickup>
	<suggested_pickup_period>60</suggested_pickup_period>
	<location>Unknown Station</location>
	<station_id>MUBA</station_id>
	<observation_time>Last Updated on Sep 24 2014, 6:54 am CDT</observation_time>
        <observation_time_rfc822>Wed, 24 Sep 2014 06:54:00 -0500</observation_time_rfc822>
	<weather>Mostly Cloudy</weather>
	<temperature_string>79.0 F (26.0 C)</temperature_string>
	<temp_f>79.0</temp_f>
	<temp_c>26.0</temp_c>
	<relative_humidity>89</relative_humidity>
	<wind_string>Calm</wind_string>
	<wind_dir>North</wind_dir>
	<wind_degrees>0</wind_degrees>
	<wind_mph>0.0</wind_mph>
	<wind_kt>0</wind_kt>
	<dewpoint_string>75.2 F (24.0 C)</dewpoint_string>
	<dewpoint_f>75.2</dewpoint_f>
	<dewpoint_c>24.0</dewpoint_c>
 	<icon_url_base>http://forecast.weather.gov/images/wtf/small/</icon_url_base>
	<two_day_history_url>http://www.weather.gov/data/obhistory/MUBA.html</two_day_history_url>
	<icon_url_name>nbkn.png</icon_url_name>
	<ob_url>http://www.weather.gov/data/METAR/MUBA.1.txt</ob_url>
	<disclaimer_url>http://weather.gov/disclaimer.html</disclaimer_url>
	<copyright_url>http://weather.gov/disclaimer.html</copyright_url>
	<privacy_policy_url>http://weather.gov/notice.html</privacy_policy_url>
</current_observation>


text:
package org.bytecodefx.reporting;

/**
 *
 */
public class ClassFXMisuse extends BytecodeFXException {
}


text:
<?php declare(strict_types=1);

namespace PhpV8\V8\Tests\Perf;

use V8\BooleanValue;
use V8\Context;
use V8\FunctionObject;
use V8\Isolate;
use V8\NullValue;
use V8\NumberValue;
use V8\ObjectValue;
use V8\StringValue;
use V8\UndefinedValue;

/**
 * @Warmup(2)
 * @Revs(100)
 * @Iterations(10)
 * @BeforeMethods("init")
 */
class CreatePrimitiveValue
{
    /**
     * @var Isolate
     */
    private $isolate;
    /**
     * @var Context
     */
    private $context;
    /**
     * @var FunctionObject
     */
    private $fnc;

    /**
     * @var Context
     */
    private $context2;
    /**
     * @var FunctionObject
     */
    private $fnc2;

    /**
     * @var callable
     */
    private $callback;

    private $pairs = [];

    public function init()
    {
        $this->isolate = $isolate = new Isolate();
        $this->context = $context = new Context($isolate);

        $this->fnc = new FunctionObject($context, function () {
            if ($this->callback) {
                ($this->callback)();
            }
        });

        $this->context2 = $context2 = new Context($isolate);

        $this->fnc2 = new FunctionObject($context2, function () {
            if ($this->callback) {
                ($this->callback)();
            }
        });
    }

    public function benchOutsideContext()
    {
        $callback = $this->buildCallback();

        $callback();
        $this->fnc->call($this->context, $this->fnc);
    }

    public function benchOutsideContextWithWarm()
    {
        $callback = $this->buildCallback();

        $this->fnc->call($this->context, $this->fnc);
        $callback();
    }

    public function benchWithinContext()
    {
        $this->callback = $this->buildCallback();
        $this->fnc->call($this->context, $this->fnc);
    }

    public function benchWithinContext2()
    {
        $this->callback = $this->buildCallback();
        $this->fnc2->call($this->context2, $this->fnc2);
    }

    public function benchWithinIsolate()
    {
        $cb = $this->buildCallback();
        $this->fnc->call($this->context, $this->fnc);

        $this->isolate->within($cb);
    }

    public function benchWithinIsolateLight()
    {
        $cb = $this->buildCallback();

        $this->isolate->within($cb);
    }

    public function benchWithinContextNew()
    {
        $cb = $this->buildCallback();
        $this->fnc->call($this->context, $this->fnc);

        $this->context->within($cb);
    }

    public function benchWithinContextNewLight()
    {
        $cb = $this->buildCallback();

        $this->context->within($cb);
    }

    protected function buildCallback()
    {
        $callback = function ($isolate = null) {
            $isolate = $isolate ?: $this->isolate;

            $values =[];
            for ($i = 0; $i < 200; $i++) {
                $values[] = new UndefinedValue($isolate);
                $values[] = new NullValue($isolate);
                $values[] = new BooleanValue($isolate, true);
                $values[] = new NumberValue($isolate, 123.456);
                $values[] = new StringValue($isolate, 'foo');
            }
        };

        return $callback;
    }
}


text:
.. _builtin_cells:

Builtin Ecto Cells
==================
Ecto contains a few cells that are generally useful for Ecto graph construction.

Convenience cells
-----------------
The are cells that may be generally useful in your ecto graphs and tend to be
weakly typed.

.. ectocell:: ecto Constant

   This cell takes a python parameter that becomes a constant
   output. As long as this python type is convertable to a c++ type
   (through ``python`` bindings or basic types), it may be connected
   to cells written in c++.

.. ectocell:: ecto Passthrough

   Passthrough is mostly useful from within a :ref:`black_box` to connect
   multiple inputs to one cell, which then becomes a singular input for the BlackBox.

.. ectocell:: ecto If

   The If cell enables you to conditionally execute a single cell
   based on an input flag.

   An example of using the If cell for condition execution of a
   cell. Notice that cell that is encased in an If is **not added to the
   graph**, it is passed to the ``If`` cell as a **parameter**.

   .. literalinclude:: conditional.py

   The above sample uses the built in cell :ref:`TrueEveryN`

.. _trueeveryn:

.. ectocell:: ecto TrueEveryN

.. _entanglement:

Entanglement
------------

To support feedback loops, asynchronous execution of graphs, and
conditional execution, ecto supplies a concept of entangled cells,
which allow communication of values without breaking the acyclic or
synchronous nature of graph execution.

.. autofunction:: ecto.EntangledPair

  EntangledPair is useful when you would like to feed the output of
  one cell into the input of another cell, without creating a cycle in
  the graph. Keep in mind that the first execution of the graph will
  result in the default value of the whatever the source is connected
  to being used.

Here is an example of using the EntangledPair for feedback in a graph.

.. literalinclude:: feedback.py

The output is:

.. program-output:: feedback.py
   :in_srcdir:

And the graph looks like the following. Notice that there is no cycle:

.. ectoplot:: feedback.py plasm

Dealer
------------

It may be that you have some iterable in python that you would like to
pay out to your graph, one item at a time. Enter the Dealer, think blackjack.

.. autofunction:: ecto.Dealer

  The argument ``typer`` should be a tendril, which already has a type associated
  with it. This is used to prime the dealer's type erasure, so that boost python
  objects are converted immediately to this type.

Here is an example of using the Dealer.

.. literalinclude:: dealer.py

The output is:

.. program-output:: dealer.py
   :in_srcdir:

And the graph looks like the following. Notice that there is no cycle:

.. ectoplot:: dealer.py plasm


text:
<?php
class WordPressTest extends TestCaseBase
{
    public function testOne()
    {
        $this->assertEmbed(
            'http://wordpress.tv/2013/09/06/dave-ross-optimize-image-files-like-a-pro/',
            [
                'title' => 'Dave Ross: Optimize Image Files Like a Pro',
                'imageWidth' => 400,
                'imageHeight' => 224,
                'type' => 'video',
                'authorName' => '@WordPressTV',
                'providerName' => 'WordPress.tv',
                'providerUrl' => 'http://wordpress.tv',
            ]
        );
    }
}


text:
require 'rack'

module Oauth2Server
  class AuthorizationHeaderRetriever
    def initialize(request)
      @request = request
    end

    def authorization_header
      request.env['HTTP_AUTHORIZATION'] ||
        request.env['X-HTTP_AUTHORIZATION'] ||
        request.env['X_HTTP_AUTHORIZATION'] ||
        request.env['REDIRECT_X_HTTP_AUTHORIZATION']
    end

    private
    attr_reader :request
  end
end


text:
using System.Collections.Generic;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Service;
using ZyGames.Framework.Collection;
using ZyGames.Framework.Common;
using ZyGames.Tianjiexing.Lang;
using ZyGames.Tianjiexing.Model;
using ZyGames.Tianjiexing.Model.Config;
using ZyGames.Tianjiexing.Model.Enum;
using ZyGames.Tianjiexing.BLL.Base;
using System;

namespace ZyGames.Tianjiexing.BLL.Action
{

    /// <summary>
    /// 6109_Boss战时间设定接口
    /// </summary>
    public class Action6109 : BaseAction
    {
        private BossDateType dateType;

        public Action6109(ZyGames.Framework.Game.Contract.HttpGet httpGet)
            : base(ActionIDDefine.Cst_Action6109, httpGet)
        {

        }

        public override void BuildPacket()
        {

        }

        public override bool GetUrlElement()
        {
            if (httpGet.GetEnum("BossDateType", ref dateType))
            {
                return true;
            }
            return false;
        }

        public override bool TakeAction()
        {
            UserGuild guild = new ShareCacheStruct<UserGuild>().FindKey(ContextUser.MercenariesID);
            if (guild != null)
            {
                GuildMember member = new ShareCacheStruct<GuildMember>().FindKey(ContextUser.MercenariesID, ContextUser.UserID);
                if (member == null || member.PostType != PostType.Chairman)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    ErrorInfo = LanguageManager.GetLang().St6008_NotChairman;
                    return false;
                }
                GameActive active = new ShareCacheStruct<GameActive>().FindKey(UserGuild.ActiveID);
                List<BossDate> bossDateList = UserHelper.GetBossDate().FindAll(u => u.EnableWeek == dateType);
                GuildBossInfo guildBossInfo = guild.GuildBossInfo;
                if (bossDateList.Count > 0)
                {
                    BossDate bossDate = bossDateList[0];

                    if (guildBossInfo != null)
                    {
                        if (guildBossInfo.RefreshDate != MathUtils.SqlMinDate)
                        {
                            if (UserHelper.IsCurrentWeek(guild.GuildBossInfo.RefreshDate))
                            {
                                ErrorCode = LanguageManager.GetLang().ErrorCode;
                                ErrorInfo = LanguageManager.GetLang().St6109_GuildBossTime;
                                return false;
                            }
                        }

                        if (guildBossInfo.BossLv == 0)
                        {
                            guildBossInfo.BossLv = (short)active.BossLv;
                        }
                        guildBossInfo.IsKill = false;
                        guildBossInfo.EnablePeriod = bossDate.EnablePeriod;
                        guildBossInfo.EnableWeek = (int)dateType;
                        guildBossInfo.RefreshDate = DateTime.Now;
                        guild.GuildBossInfo = guildBossInfo;
                        //guild.Update();
                    }
                    else
                    {
                        guildBossInfo=new GuildBossInfo();
                        guildBossInfo.IsKill = false;
                        guildBossInfo.BossLv = (short)active.BossLv;
                        guildBossInfo.EnablePeriod = bossDate.EnablePeriod;
                        guildBossInfo.EnableWeek = (int) dateType;
                        guildBossInfo.RefreshDate = DateTime.Now;
                        guild.GuildBossInfo = guildBossInfo;
                        //guild.Update();
                    }
                }
            }
            return true;
        }
    }
}


text:
"use strict";

var PropsStateValueMixin = {
    componentWillReceiveProps: function componentWillReceiveProps(newProps) {
        this.setState({ value: newProps.value });
    }
};

module.exports = PropsStateValueMixin;


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Short Sectioned Assignment
% LaTeX Template
% Version 1.0 (5/5/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Frits Wenneker (http://www.howtotex.com)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%	PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size

\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps

\usepackage{fancyhdr} % Custom headers and footers
\usepackage{bm}
\usepackage{upgreek}
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header

\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)

%----------------------------------------------------------------------------------------
%	TITLE SECTION
%----------------------------------------------------------------------------------------

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{
\normalfont \normalsize
\textsc{MAGICC Lab - Brigham Young University} \\ [25pt] % Your university, school and/or department name(s)
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Altitude Complementary Filter \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}

\author{James Jackson} % Your name

\date{\normalsize\today} % Today's date or a custom date

\begin{document}

\maketitle % Print the title

\section{Introduction}

A common operational requirement for autonomous multirotor MAVs is to hover at a given altitude.
This is typically performed by fusing inertial and other measurements with an Extended Kalman Filter (EKF) to provide an estimate of current altitude.
The altitude estimate is then used to calculate control input to reach and maintain desired altitude.
While this method has been demonstrated successfully in practice, the calculation of  state with a full EKF requires a great deal of computation.
This calculation is impossible to perform on most embedded MAV flight control units and is instead generally performed on an onboard computer.
Given a separation between an onboard computer performing full-state estimation and a smaller, less capable, but real-time embedded flight control processor
This document outlines the derivation of a nonlinear altitude observer that fuses measurements from an onboard barometer, accelerometer and sonar.
It will also be shown through a Lyuapunov stability analysis that this observer guarantees estimates of both altitude and accelerometer bias to converge exponentially to their true values.

\section{Definitions}

\newcommand{\zhat}{\hat{z}}
\newcommand{\z}{z}
\newcommand{\zdot}{\dot{z}}
\newcommand{\acc}{\bm{a}}
\newcommand{\ameas}{\bm{a}_{meas}}
\newcommand{\khat}{\hat{\bm{k}}}
\newcommand{\RbI}{R_b^I}
\newcommand{\RIb}{R_I^b}
\newcomand{\norm{x}}{\vert x \vert}

Altitude $\z$ is defined as the inertial z component of distance between the current position of the MAV and it's initial starting position, and is measured positive upwards. It is known to evolve according to the following dynamics:

\begin{equation}
	\begin{aligned}
		\zdot = \left( \RbI \acc \right) \cdot \khat
	\end{aligned}
\end{equation}

where $\RbI$ is the rotation from the body-fixed to the inertial frame, $\khat$ is the unit vector in the positive z inertial direction, and $\acc$ is the body fixed acceleration

We will assume we have measurement from 3 sources: a 3-axis accelerometer, sonar and barometer.
We will assume that the accelerometer measurement $\ameas$ includes all accelerations due to forces except gravity with the addition of some small random, quasi-static bias $\bm{\alpha}$ and noise $\bm{\eta}$.
We will also assume that $\vert\bm{\alpha}\vert$ is bounded by some $\alpha_{max}$ and that $\vert\bm{\eta}\vert$ is also bounded by some $\eta_{max}$.
Therefore, we model true body-fixed acceleration as follows:

\begin{equation}
\begin{aligned}
	\acc &= \ameas + \bm{\alpha} + \RIb\bm{g} + \bm{\eta} \\
	\vert\vert \bm{\alpha} \vert\vert &\leq \alpha_{max} \\
	\vert\vert \bm{\eta} \vert\vert &\leq \eta_{max} \\
\end{aligned}
\label{eq:accel_model}
\end{equation}

\newcommand{\zbaro}{\z_{baro}}

Barometer measurements, $\zbaro$ are assumed to include an absolute altitude measurement with respect to sea level with the addition of a significant wandering bias $\beta$ and noise $\xi$.  We can assume, however, that both $\beta$ and $\xi$ are bounded by $\beta_{max}$ and $\xi_{max}$, respectively.  Because altitude is measured with respect to the initial position, and not sea level, the intial altitude with repect to sea level, $b_0$ can be subtracted off the measurement to provide measurements with repect to the intial position rather than sea level.  It is important to note that $b_0$ can also be thought of as part of $\beta$, rather than it's own term, because it is simply a constant bias.

\begin{equation}
\begin{aligned}
	\zbaro &= z + b_0 + \beta + \xi \\
	\vert \beta \vert  &\leq \beta_{max} \\
	\vert \xi \vert &\leq \xi_{max}
\end{aligned}
\end{equation}

\newcommand{\zsonar}{z_{sonar}}

Sonar measurements $\zsonar$ are assumed to be absolute altitude above ground with the addition of some noise $\zeta$.
For this filter, we will assume that the ground remains level, so that this measurement can be a measurement of altitude directly, ignoring any additions of terrain changes.
Instead of a bias, many sonars have a cone of sensitivity which responds with a measurement of the closest point within this cone and a maximum and minimum range.
If the measurement is valid (i.e. the measurement is within the maximum and minimum range and the attitude of the MAV is sufficiently close to zero so as to have the measurement returned be of the perpendicular distance from the ground to the MAV) we use the following measurement model:
\begin{equation}
\begin{aligned}
	\zsonar &= z + \zeta \\
	\vert \zeta \vert &\leq \zeta_{max}
\end{aligned}
\end{equation}

\section{Derivation}

\newcommand{\alphahat}{\bm{\hat{\alpha}}}

The derivation of the filter follows a predict-update sequence much like common nonlinear attitude observers.
Simple kinematics dictate that altitude will evolve according to the double integral of acceleration.

\begin{equation}
	\zhat(t) = \int_0^t\int_0^t (\RbI\acc) \cdot \khat \; dtdt
	\label{eq:simple_dynamics}
\end{equation}

Substituting the expected value of equation~\ref{eq:accel_model} into~\ref{eq:simple_dynamics} yields the following equation for the main predict step of the filter

\begin{equation}
	\zhat(t) = \int_0^t\int_0^t \left(\RbI \left(\ameas + \alphahat\right) \right) \cdot \khat \; dtdt
\end{equation}

As sonar and barometer are available, update steps are performed to correct drift and converge on accurate estimates for $\alphahat$.

\bibliographystyle{plain}
\bibliography{./library}

\end{document}


text:
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Ambari Agent

"""

from resource_management.libraries.resources.execute_hadoop import *
from resource_management.libraries.resources.template_config import *
from resource_management.libraries.resources.xml_config import *
from resource_management.libraries.resources.properties_file import *
from resource_management.libraries.resources.repository import *
from resource_management.libraries.resources.monitor_webserver import *
from resource_management.libraries.resources.hdfs_resource import *
from resource_management.libraries.resources.msi import *
from resource_management.libraries.resources.modify_properties_file import *


text:
#ifndef FHASH_INT_H
#define FHASH_INT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <flibs/fhash_core.h>

typedef struct {
    // private
    fhash_iter iter;

    // read only
    void* value;
    int   key;

    int   _padding;
} fhash_int_iter;

/**
 * @brief foreach call back function
 *
 * @param ud        user private data
 * @param key
 * @param value
 *
 * @return
 *                  - **0**: continue iterate
 *                  - **non-zero**: stop iterating
 */
typedef int (*fhash_int_each_cb) (void* ud, int key, void* value);

/**
 * create fhash table
 *
 * @param init_size The hash table index size, if it's 0, the default value 10
 *                  will be used
 * @param flags
 *                  - FHASH_MASK_NONE: the default value, no feature enabled
 *                  - FHASH_MASK_AUTO_REHASH: enable auto-rehash (recommended)
 *
 * @return          fhash table pointer
 */
fhash*         fhash_int_create(uint32_t init_size, uint32_t flags);

/**
 * @brief destroy a fhash table
 *
 * @param table     pointer of fhash table
 * @return          void
 */
void           fhash_int_delete(fhash* table);

/**
 * @brief add or set a key-value pair into fhash table
 *
 * @param table     pointer of fhash table
 * @param key       key
 * @param value     value
 *
 * @return          void
 */
void           fhash_int_set(fhash* table, int key, const void* value);

/**
 * @brief get the value of the key
 *
 * @param table     pointer of fhash table
 * @param key       key
 *
 * @return          return value's pointer
 */
void*          fhash_int_get(fhash* table, int key);

/**
 * @brief delete a key-value pair from the fhash table
 *
 * @param table     pointer of fhash table
 * @param key       key
 *
 * @return          void
 */
void*          fhash_int_del(fhash* table, int key);

/**
 * @brief create a iterator of the fhash table
 *
 * @param table     pointer of fhash table
 * @return          a iterator of this table
 */
fhash_int_iter fhash_int_iter_new(fhash* table);

/**
 * @brief release a iterator of the fhash table
 *
 * @param iter     a pointer of iterator
 * @return         void
 *
 * @note           user must call this api if the iteration operation is done
 */
void           fhash_int_iter_release(fhash_int_iter* iter);

/**
 * @brief get the next element
 *
 * @param iter     pointer of the iterator
 * @return
 *                 - the next element
 *                 - NULL if reach the end
 */
void*          fhash_int_next(fhash_int_iter* iter);

/**
 * @brief another iteration way
 *
 * @param table    pointer of fhash table
 * @param cb       the callback function of the iteration
 * @param ud       user private data, it will be passed to the callback
 *                 function
 *
 * @return         void
 */
void           fhash_int_foreach(fhash* table, fhash_int_each_cb cb, void* ud);

#ifdef __cplusplus
}
#endif

#endif


text:
<TITLE>Review for Flirt (1995/I)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Flirt (1995/I)

reviewed by
James Berardinelli

                                     FLIRT
                       A film review by James Berardinelli
                        Copyright 1996 James Berardinelli

RATING (0 TO 10): 6.0
Alternative Scale: **1/2 out of ****

United States, 1996
U.S. Release Date: beginnning 9/96 (limited)
Running Length: 1:25
MPAA Classification: R (Sex, profanity, nudity, mature themes)
Theatrical Aspect Ratio: 1.85:1

Cast: William Sage, Martin Donovan, Parker Posey, Dwight Ewell,
      Dominik Bender, Miho Nikaido, Toshizo Fujiwara, Chikako Hara,
      Hal Hartley
Director: Hal Hartley
Producer: Ted Hope
Screenplay: Hal Hartley
Cinematography: Michael Spiller
Music: Ned Rifle and Jeffrey Taylor
U.S. Distributor: C/FP Distribution
In English, German, and Japanese with subtitles

     FLIRT is one of those films where I appreciate the idea a lot more
than its  execution.  In fact, even though the film features all the Hal
Hartley trademarks -- offbeat dialogue, quick cuts, bizarre diversions -
- it loses its energy before the two-thirds point.  Despite a few clever
twists, the last half-hour is tired, illustrating that not all
intriguing premises can be successfully transformed into a solid motion
pictures, no matter how talented the film maker is.

     FLIRT is actually a trilogy of shorts, all of which focus on
identical subjects:  betrayal and uncertainty about love.  In fact, not
only do the episodes explore similar issues, but they do so in exactly
the same manner.  Each segment is a slightly distorted image of the
other two, down to individual lines.  The characters and settings
change, and there are small differences and individual quirks, but FLIRT
is basically one story told three times.  The third time is definitely
not a charm.  A certain amount of repetition is fine, but Hartley goes
overboard, making this more suitable for film school study than
theatrical entertainment.

     Story #1 takes place in New York City during February of 1993.
Hartley alum, Martin Donovan (AMATEUR), plays Walter, a man with a
dilemma.  His girlfriend, Emily (Parker Posey), has just issued an
ultimatum:  commit to a relationship or watch her fly off to Paris.
Walter is torn, and, after asking for a ninety minute reprieve, he seeks
out another woman he's involved with to find out whether she's willing
to commit to that relationship.  Instead of meeting the woman, however,
he encounters her suicidal husband (Bill Sage), who is nursing a drink
and a gun.

     Story #2 takes place in Berlin during October of 1994.  This is a
homosexual version of the same plot.  Here, the recipient of the
ultimatum is Dwight (Dwight Ewell), and the person issuing it is an
older man, not a woman.  Other than that, it's all basically the same:
the uncertainty about commitment, the meeting with the gun-toting
spouse, and the events that follow.  Story #3 is set in Tokyo, March
1995.  The main character this time is a woman, Miho (Miho Nikaido, from
TOKYO DECADENCE).  Her boyfriend is director Hal Hartley, and the gun-
wielder is her college professor's wife (Chikako Hara).  By this time,
not only will you know what's going to happen, but you'll have whole
chunks of dialogue memorized.

     There are times when FLIRT approaches brilliance.  During the first
segment, Walter walks into the men's room and asks for advice from a
stranger at a urinal and those in the stalls.  Their thoughtful,
existential responses are hilarious.  In the Berlin episode, a group of
construction workers discuss whether the director of this film has
failed, and whether "the failure is interesting."  And, when in Tokyo,
it's hard to miss that Hal Hartley is carrying a canister of film marked
"True Fiction Pictures:  FLIRT".  Unfortunately, the movie only
occasionally rises to this level.  Most of the time, it's just
repetitive.

     Akira Kurosawa's RASHOMON (which inspired this year's COURAGE UNDER
FIRE) proved that it's possible to tell the same story more than once
and still retain the audience's attention.  Perhaps if FLIRT had used
RASHOMON's hook -- varying the viewpoint -- it would have been more
involving.  As it is, however, the viewer's level of interest is likely
to drop off long before the closing credits start to roll.  Frankly, if
I wanted to see repeats of the same half-hour story, I'd watch
television.

- James Berardinelli
e-mail: berardin@bc.cybernex.net
ReelViews web site: http://www.cybernex.net/~berardin

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
<?php

	require_once(dirname(__FILE__) . '/../../../wp-load.php');
	require_once( dirname(__FILE__) . '/deseret_connect.php' );

	nocache_headers();

	$deseret_connect_opts = get_option(DESERET_CONNECT_OPTIONS);
	if($deseret_connect_opts['unix_cron'] == 'true') {
		deseret_connect_unix_cron();
	}
?>


text:
Contribution Guidelines
=======================

We love to see contributions to the project and have tried to make it easy to
do so, for example by keeping its scope small and the code equally so. If you
wish to contribute code, then please keep to the following guidelines to
ensure consistency within the codebase and that we have happy users.

Philosophy
----------

Our approach to the project is to keep it small and narrowly focused. Expect new
features to be discussed in-depth before being accepted (or rejected). This is
not a framework, but a simple, easy-to-use tool for creating template projects.
It offers useful utility functions to template authors, but nothing more.

Documentation
-------------

If you contribute anything that changes the behaviour of the application,
document it in the README! This includes new features, additional variants
of behaviour and breaking changes.

Make a note of breaking changes in the pull request because they will need
to go into the release notes.

Testing
-------

This project uses [Spock](http://dosc.spockframework.org/) for its tests. Although
any tests are better than none, Spock tests will be looked on more favourably than
other types (such as JUnit). Plus you'll find writing the tests so much nicer!

Unit tests are a nice to have, but it's the integration tests that are critical.
These are run via

    ./gradlew integTest

and launch the lazybones executable as a separate process. The output is captured
so that you can verify the content. The tests reside in the `src/integTest`
directory and extend `AbstractFunctionalSpec`.

They use [Betamax](http://freeside.co/betamax) to intercept and replay web requests
(such as to the Bintray REST API and download URLs).

Commit messages
---------------

It may seem anal to request a particular format for commit messages, but these
are a historical record of what's happening in the code base and consistency
makes investigating that history much easier.

Please follow the advice of the [Phonegap guys](https://github.com/phonegap/phonegap/wiki/Git-Commit-Message-Format)
when crafting commit messages. The advice basically comes down to:

* First line should be maximum 50 characters long
* It should summarise the change and use imperative present tense
* The rest of the commit message should come after a blank line
* We encourage you to use Markdown syntax in the rest of the commit message
* Preferably keep to an 80 character limit on lines in the rest of the message.

If a commit is related to a particular issue, put the issue number after a
hash (#) somewhere in the detail. You can put the issue number in the first
line summary, but only if you can also fit in a useful summary of what was
changed in the commit.

Here's an example git message:

> Make create's version argument optional.
>
> Implements issue #3. If the user doesn't provide an explicit version,
> lazybones retrieves the latest version from Bintray. Integration tests
> added for the `create` command as well.

Formatting
----------

The rules are simple: use the same formatting as the rest of the code. The
following is a list of the styles we are particularly particular about:

* 4 space indent, no tabs
* a space between if/elseif/catch/etc. keywords and the parenthesis
* elseif/else/catch on their own lines

If in doubt, submit the change and mention in the pull request that you're not
sure about a particular style you used. We'd rather have the contribution and
fix any minor problems than not have the contribution at all.

Ultimately, be aware that the maintainers don't have much time to dedicate to
processing pull requests, so the less work they have to do the more likely and
quickly they can merge those pull requests in.


text:
package com.zero.artoflife.pending.models;

public class PendingModel {
    private int id;
    private String name, description, completed_at;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCompleted_at() {
        return completed_at;
    }

    public void setCompleted_at(String completed_at) {
        this.completed_at = completed_at;
    }
}


text:
import { shallow } from 'enzyme';
import React from 'react';

import type { Application } from '@spinnaker/core';
import { ApplicationModelBuilder } from '@spinnaker/core';
import {
  createCustomMockLaunchTemplate,
  mockLaunchTemplate,
  mockLaunchTemplateData,
  mockServerGroup,
} from '@spinnaker/mocks';

import { LaunchTemplateDetailsSection } from './LaunchTemplateDetailsSection';
import { MultipleInstanceTypesSubSection } from './MultipleInstanceTypesSubSection';
import type { IAmazonMixedInstancesPolicy, IAmazonServerGroupView, IScalingPolicy } from '../../../domain';

describe('Launch template details', () => {
  let app: Application;
  beforeEach(() => {
    app = ApplicationModelBuilder.createApplicationForTests('testapp');
  });

  const baseServerGroupWithLt = {
    ...mockServerGroup,
    launchTemplate: createCustomMockLaunchTemplate('test123', {
      ...mockLaunchTemplateData,
      kernelId: 'kernal-abc',
      ramDiskId: 'ramDisk-123',
      instanceMarketOptions: {
        spotOptions: {
          maxPrice: '0.50',
        },
      },
    }),
    image: {
      description: 'ancestor_name=testBaseImage',
      imageLocation: 'location',
    },
    scalingPolicies: [] as IScalingPolicy[],
  } as IAmazonServerGroupView;

  const baseServerGroupWithMipOverrides = {
    ...mockServerGroup,
    image: {
      description: 'ancestor_name=testBaseImage',
      imageLocation: 'location',
    },
    scalingPolicies: [] as IScalingPolicy[],
    mixedInstancesPolicy: {
      allowedInstanceTypes: ['some.type.medium', 'some.type.large'],
      instancesDistribution: {
        onDemandAllocationStrategy: 'prioritized',
        onDemandBaseCapacity: 1,
        onDemandPercentageAboveBaseCapacity: 50,
        spotAllocationStrategy: 'capacity-optimized',
        spotMaxPrice: '1.5',
      },
      launchTemplates: [
        {
          createdBy: 'testuser@test.com',
          createdTime: 1588787656527,
          defaultVersion: true,
          launchTemplateData: mockLaunchTemplateData,
          launchTemplateId: '123456',
          launchTemplateName: 'testLaunchTemplatev001',
          versionDescription: 'Test purposes',
          versionNumber: 1,
        },
      ],
      launchTemplateOverridesForInstanceType: [
        {
          instanceType: 'some.type.medium',
          weightedCapacity: '2',
        },
        {
          instanceType: 'some.type.large',
          weightedCapacity: '4',
        },
      ],
    } as IAmazonMixedInstancesPolicy,
  } as IAmazonServerGroupView;

  it('should not render if no launch template', () => {
    const testServerGroup = {
      ...mockServerGroup,
      scalingPolicies: [] as IScalingPolicy[],
    } as IAmazonServerGroupView;

    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={testServerGroup} app={app} />);
    expect(wrapper.type()).toEqual(null);
  });

  it('should render base info', () => {
    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={baseServerGroupWithLt} app={app} />);
    const labeledValues = wrapper.find('LabeledValue');

    expect(labeledValues.length).toEqual(12);
    expect(labeledValues.at(0).prop('value')).toEqual('test123');
    expect(labeledValues.at(1).prop('value')).toEqual('ami-0123456789');
    expect(labeledValues.at(4).prop('value')).toEqual('m5.large');
    expect(labeledValues.at(5).prop('value')).toEqual('testapplicationInstanceProfile');
    expect(labeledValues.at(6).prop('value')).toEqual('disabled');
  });

  it('should render launch template details for server group with launchTemplate', () => {
    const testServerGroup = {
      ...mockServerGroup,
      launchTemplate: createCustomMockLaunchTemplate('ltWithCredits', {
        ...mockLaunchTemplateData,
        instanceMarketOptions: {
          spotOptions: {
            maxPrice: '0.50',
          },
        },
        creditSpecification: {
          cpuCredits: 'unlimited',
        },
        keyName: 'test',
        kernelId: 'kernal-abc',
        ramDiskId: 'ramDisk-123',
        userData: 'thisisfakeuserdata',
      }),
      image: {
        description: 'ancestor_name=testBaseImage',
        imageLocation: 'location',
      },
    } as IAmazonServerGroupView;

    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={testServerGroup} app={app} />);
    const actualLabeledValues = wrapper.find('LabeledValue');

    expect(actualLabeledValues.length).toEqual(13);
    const expectedLabels = new Map([
      ['Name', 'ltWithCredits'],
      ['Image ID', 'ami-0123456789'],
      ['Image Name', 'location'],
      ['Base Image Name', 'testBaseImage'],
      ['Instance Type', 'm5.large'],
      ['CPU Credit Specification', 'unlimited'],
      ['IAM Profile', 'testapplicationInstanceProfile'],
      ['Instance Monitoring', 'disabled'],
      ['Max Spot Price', '0.50'],
      ['Key Name', 'test'],
      ['Kernel ID', 'kernal-abc'],
      ['Ramdisk ID', 'ramDisk-123'],
      ['User Data', ''],
    ]);
    let index = 0;
    expectedLabels.forEach((value, key) => {
      const labeledValue = actualLabeledValues.at(index++);
      expect(labeledValue.prop('label')).toEqual(key);
      value != '' && expect(labeledValue.prop('value')).toEqual(value);
    });
  });

  it('should conditionally render launch template details for server group with mixedInstancesPolicy', () => {
    const testServerGroup = baseServerGroupWithMipOverrides;

    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={testServerGroup} app={app} />);
    const labeledValues = wrapper.find('LabeledValue');

    expect(labeledValues.length).toEqual(9);
    expect(labeledValues.at(0).prop('value')).toEqual('testLaunchTemplatev001');
    expect(labeledValues.at(1).prop('value')).toEqual('ami-0123456789');
    expect(labeledValues.at(2).prop('value')).toEqual('location');
    expect(labeledValues.at(3).prop('value')).toEqual('testBaseImage');
    expect(labeledValues.at(4).prop('value')).toEqual('testapplicationInstanceProfile');
    expect(labeledValues.at(5).prop('value')).toEqual('disabled');
    expect(labeledValues.at(6).prop('value')).toEqual('1.5');
    expect(labeledValues.at(7).prop('value')).toEqual('test');
    expect(labeledValues.at(8).prop('label')).toEqual('User Data');

    const multipleInstanceTypes = shallow(
      <MultipleInstanceTypesSubSection
        instanceTypeOverrides={testServerGroup.mixedInstancesPolicy.launchTemplateOverridesForInstanceType}
      />,
    );
    expect(multipleInstanceTypes.isEmptyRender()).toEqual(false);
    const multipleInstanceTypesTableRows = multipleInstanceTypes.find('td');

    expect(multipleInstanceTypesTableRows.length).toEqual(4);
    expect(multipleInstanceTypesTableRows.at(0).text()).toEqual('some.type.medium');
    expect(multipleInstanceTypesTableRows.at(1).text()).toEqual('2');
    expect(multipleInstanceTypesTableRows.at(2).text()).toEqual('some.type.large');
    expect(multipleInstanceTypesTableRows.at(3).text()).toEqual('4');
  });

  it('should conditionally render image information', () => {
    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={baseServerGroupWithLt} app={app} />);
    const labeledValues = wrapper.find('LabeledValue');

    expect(labeledValues.at(2).prop('label')).toEqual('Image Name');
    expect(labeledValues.at(3).prop('label')).toEqual('Base Image Name');

    const newServerGroup = {
      ...baseServerGroupWithLt,
    };
    delete newServerGroup.image;
    wrapper.setProps({
      serverGroup: newServerGroup,
    });

    const imageName = wrapper.findWhere((lv) => lv.prop('label') === 'Image Name');
    const baseImage = wrapper.findWhere((lv) => lv.prop('label') === 'Base Image Name');

    expect(imageName.length).toEqual(0);
    expect(baseImage.length).toEqual(0);
  });

  it('should conditionally render additional info', () => {
    const wrapper = shallow(<LaunchTemplateDetailsSection serverGroup={baseServerGroupWithLt} app={app} />);
    const labeledValues = wrapper.find('LabeledValue');

    expect(labeledValues.at(7).prop('label')).toEqual('Max Spot Price');
    expect(labeledValues.at(8).prop('label')).toEqual('Key Name');
    expect(labeledValues.at(9).prop('label')).toEqual('Kernel ID');
    expect(labeledValues.at(10).prop('label')).toEqual('Ramdisk ID');
    expect(labeledValues.at(11).prop('label')).toEqual('User Data');

    const newServerGroup = {
      ...baseServerGroupWithLt,
      launchTemplate: mockLaunchTemplate,
    };
    delete newServerGroup.launchTemplate.launchTemplateData.userData;
    delete newServerGroup.launchTemplate.launchTemplateData.keyName;

    wrapper.setProps({
      serverGroup: newServerGroup,
    });

    const spotPrice = wrapper.findWhere((lv) => lv.prop('label') === 'Max Spot Price');
    const keyName = wrapper.findWhere((lv) => lv.prop('label') === 'Key Name');
    const kernelId = wrapper.findWhere((lv) => lv.prop('label') === 'Kernel ID');
    const ramdiskId = wrapper.findWhere((lv) => lv.prop('label') === 'Ramdisk ID');
    const userData = wrapper.findWhere((lv) => lv.prop('label') === 'User Data');

    expect(spotPrice.length).toEqual(0);
    expect(keyName.length).toEqual(0);
    expect(ramdiskId.length).toEqual(0);
    expect(kernelId.length).toEqual(0);
    expect(userData.length).toEqual(0);
  });

  it('should not render multiple instance types subsection when overrides are not specified', () => {
    const testServerGroup = baseServerGroupWithMipOverrides;
    testServerGroup.mixedInstancesPolicy.launchTemplateOverridesForInstanceType = null;

    const multipleInstanceTypes = shallow(
      <MultipleInstanceTypesSubSection
        instanceTypeOverrides={testServerGroup.mixedInstancesPolicy.launchTemplateOverridesForInstanceType}
      />,
    );
    expect(multipleInstanceTypes.isEmptyRender()).toEqual(true);
  });
});


text:
namespace Microsoft.Azure.Management.RedisEnterprise.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Localized display information for this particular operation.
    /// </summary>
    public partial class OperationDisplay
    {
        /// <summary>
        /// Initializes a new instance of the OperationDisplay class.
        /// </summary>
        public OperationDisplay()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the OperationDisplay class.
        /// </summary>
        /// <param name="provider">The localized friendly form of the resource
        /// provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
        /// Compute".</param>
        /// <param name="resource">The localized friendly name of the resource
        /// type related to this operation. E.g. "Virtual Machines" or "Job
        /// Schedule Collections".</param>
        /// <param name="operation">The concise, localized friendly name for
        /// the operation; suitable for dropdowns. E.g. "Create or Update
        /// Virtual Machine", "Restart Virtual Machine".</param>
        /// <param name="description">The short, localized friendly description
        /// of the operation; suitable for tool tips and detailed
        /// views.</param>
        public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string))
        {
            Provider = provider;
            Resource = resource;
            Operation = operation;
            Description = description;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets the localized friendly form of the resource provider name,
        /// e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
        /// </summary>
        [JsonProperty(PropertyName = "provider")]
        public string Provider { get; private set; }

        /// <summary>
        /// Gets the localized friendly name of the resource type related to
        /// this operation. E.g. "Virtual Machines" or "Job Schedule
        /// Collections".
        /// </summary>
        [JsonProperty(PropertyName = "resource")]
        public string Resource { get; private set; }

        /// <summary>
        /// Gets the concise, localized friendly name for the operation;
        /// suitable for dropdowns. E.g. "Create or Update Virtual Machine",
        /// "Restart Virtual Machine".
        /// </summary>
        [JsonProperty(PropertyName = "operation")]
        public string Operation { get; private set; }

        /// <summary>
        /// Gets the short, localized friendly description of the operation;
        /// suitable for tool tips and detailed views.
        /// </summary>
        [JsonProperty(PropertyName = "description")]
        public string Description { get; private set; }

    }
}


text:
Alle Befehle nehmen an, dass das current directory im Terminal der geclonte Hauptordner `feuerwehrGIS` ist.

# fireGIS installieren

- mongoDB installieren
- nodejs und npm installieren
- bower installieren: `sudo npm install -g bower`
- repository clonen
- npm und bower Pakete für webgis, adminclient & db-server installieren:

        cd webgis
        sudo npm install
        bower install
        cd ../administrationsserver/db-server
        sudo npm install
        cd ../admin-client
        sudo npm install
        bower install

## Besonderheiten unter Windows
Nicht getestet unter Windows, aber:

- Auf Windows ist es recht hilfreich node, npm und mongod [in den PATH einzufügen](http://patheditor2.codeplex.com/), sodass es möglich die ist die Programme im Terminal direkt aufzurufen, und nicht den vollständigen Pfad angeben zu müssen.
Alle Befehle nehmen an, dass die `mongod` etc im PATH sind, falls nicht also zB `mongod` durch `<Pfad zu MongoDB installation>/bin/mongod` ersetzen.
- Überall wo `sudo` steht, muss das `sudo` weggelassen werden, und stattdessen das Terminal als Administrator geöffnet sein.
- u.U. muss bei allen Pfaden `/` durch `\` ersetzt werden (?)

# fireGIS starten
- MongoDB starten
    - unter Ubuntu14 läuft die per default, falls nicht `sudo service mongod start`
    - unter Windows: `mongod --path=...` (ebenfalls nicht getestet)
- db-server starten: `node administrationsserver/db-server/app.js`
- admin-client starten: `node administrationsserver/admin-client/index.js`
- webgis starten: `node webgis/index.js`

Das WebGIS ist dann unter [`localhost:1337`](http://localhost:1337/) aufrufbar.

Der Adminclient ist dann unter [`localhost:7777`](http://localhost:7777/) aufrufbar.

Um nur grundlegende Funktionen des GUIs zu testen, reicht es, nur das WebGIS zu starten.


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Guess</title>
    <link rel="stylesheet" href="styles/style.css" media="screen" title="no title" charset="utf-8">
    <script type="text/javascript" src='scripts/app.js'>
    </script>
  </head>
  <body>
    <p> hi </p>
  </body>
</html>


text:
Certifique-se de que você tem todos os dados descritos [ aqui ](integration.md#basic_info) antes de seguir o tutorial.

### Dependências

Para conectar no Login Cidadão usando `PHP 5.3` é utilizado o cliente OAuth desenvolvido pelo [fkooman](https://github.com/fkooman/php-oauth-client). Uma vez que é usado php5.3 é possivel usar o `composer` para instalar o componente e suas dependecias. Primeiramente, é necessario instalar o [composer](https://getcomposer.org/).
No arquivo `composer.json` basta adicionar a seguinte configuração:

``` js
{
    "name": "fkooman/php-oauth-client-example",
    "require": {
        "fkooman/guzzle-bearer-auth-plugin": "dev-master",
        "fkooman/php-oauth-client": "dev-master"
    }
}
```

Utilizando a linha de comando, no mesmo diretorio que esta o arquivo `composer.json` é possivel executar o seguinte comando: `composer install --prefer-dist`. Assim o `composer` instalará o componente desejado e suas dependencias.

## Começando

### Arquivo de configuração

Primeiramente criamos um arquivo de configuração `config.ini` referente ao servidor OAuth que desejamos utilizar. Nesse arquivo, especificamos o endereço para fazer a autenticação, o endereço para obter o Access Token, o endereço para onde o gerenciador de identidades irá retornar os dados, a chave pública, a chave privada, o nome do servidor, os escopos desejados e o endereço para obter os dados do usuário:

```
[fkooman_client_config]
//endereço para fazer a autenticação
authorize_endpoint = "https://meu.rs.gov.br/oauth/v2/auth";
//endereço para requerer o Access Token
token_endpoint = "https://meu.rs.gov.br/oauth/v2/token";
//endereço para retornar os dados
redirect_uri = "http://localhost/callback.php";
//chave pública
client_id = "";
//chave privada
client_secret = "";

[fkooman_api_config]
//nome do servidor
api_context = "Meu"
//escopos
api_scopes = "id username full_name cpf birthdate email city picture public_profile badges country state city addresses id_cards get_all_notifications notifications cep mobile";
//endereço para requerer os dados do usuário
api_url = "https://meu.rs.gov.br/api/v1/person.json";
```

### Criando um script de autenticação

É necessário criar um script que oferece a possibilidade do usuario autenticar. Esse script tem que testar se o usuário ja esta autenticado. No momento que o script detectar que o usuário esta autenticado, ele que pegar as informação sobre esse usuário.

``` php
//primeiro carregamos as configurações
$config = parse_ini_file('config.ini');
if (false === $config) {
    die('please you need to have a config.ini file. Make one based on config.ini.dist');
}
//com as configurações é criado um instância das configurações do cliente
$clientConfig = new \fkooman\OAuth\Client\ClientConfig($config);

//criamos uma instância para armazenar os dados utilizados pelo Oauth
$tokenStorage = new \fkooman\OAuth\Client\SessionStorage();
//criamos uma instância para fazer a comunicação http
$httpClient = new \Guzzle\Http\Client();
//criamos uma instância para utilizar a API do nosso gerenciador de identidades
$api = new fkooman\OAuth\Client\Api($config['api_context'], $clientConfig, $tokenStorage, $httpClient);
//configuramos o contexto da nossa API
$context = new \fkooman\OAuth\Client\Context($config['api_context'], explode(" ", $config['api_scopes']));
//verificamos se já temos uma Access Token
$accessToken = $api->getAccessToken($context);
if (false === $accessToken) {
	//caso não tenhamos uma Access Token
	//se temos uma variável indicando que desejamos autenticar
    if ($_GET['authorize'] == 1) {
    	//enviamos o usuario para a tela de autorização do gerenciador de identidades
        header("HTTP/1.1 302 Found");
        header("Location: " . $api->getAuthorizeUri($context));
    } else {
    	//oferecemos a autenticação para o usuário
        echo "<a href='index.php?authorize=1'>Logar com o Login do Cidadao</a>";
    }
    exit;
} else {
	//caso tenhamos a Access token podemos consultar a API e obter os dados dele
    try {
        $client = new \Guzzle\Http\Client();
        $bearerAuth = new \fkooman\Guzzle\Plugin\BearerAuth\BearerAuth($accessToken->getAccessToken());
        $client->addSubscriber($bearerAuth);
        $response = $client->get($config['api_url'])->send();
        header("Content-Type: application/json");
        //o retorno da API é um no formato JSON, por isso temos que decodifica-la
        $json = json_decode($response->getBody(), true);
        if (false !== $json) {
            print_r($json);
        } else {
            print_r($response->getBody());
        }
    } catch (\fkooman\Guzzle\Plugin\BearerAuth\Exception\BearerErrorResponseException $e) {
    	//caso tenhamos um erro de token inválida, jogamos essa token fora, tentamos autenticar novamente
        if ("invalid_token" === $e->getBearerReason()) {
            $api->deleteAccessToken($context);
            $api->deleteRefreshToken($context);
            header("HTTP/1.1 302 Found");
            header("Location: " . $api->getAuthorizeUri($context));
            exit;
        }
        throw $e;
    } catch (\Exception $e) {
        die(sprintf('ERROR: %s', $e->getMessage()));
    }
}

}
```

### Criando um script que recebe o retorno do gerenciador de identidades

Também é necessario criar um script que recebe os dados de retorno do gerenciador de identidades. Esse script quando receber os dados do servidor deve encaminhar para o script de autenticação

```php
//primeiro carregamos as configurações
$config = parse_ini_file('config.ini');
if (false === $config) {
    die('please you need to have a config.ini file. Make one based on config.ini.dist');
}
//com as configurações é criado um instância das configurações do cliente
$clientConfig = new \fkooman\OAuth\Client\ClientConfig($config);
try {
	//criamos uma instância para armazenar os dados utilizados pelo Oauth
    $tokenStorage = new \fkooman\OAuth\Client\SessionStorage();
    //criamos uma instância para fazer a comunicação http
    $httpClient = new \Guzzle\Http\Client();
    //criamos uma instância para lidar com o retorno do gerenciador de identidades
    $cb = new \fkooman\OAuth\Client\Callback($config['api_context'], $clientConfig, $tokenStorage, $httpClient);
    $cb->handleCallback($_GET);
    //direcionamos para o script de autenticação
    header("HTTP/1.1 302 Found");
    header("Location: index.php");
    exit;
} catch (\fkooman\OAuth\Client\AuthorizeException $e) {
    die(sprintf("ERROR: %s, DESCRIPTION: %s", $e->getMessage(), $e->getDescription()));
} catch (\Exception $e) {
    die(sprintf("ERROR: %s", $e->getMessage()));
}
```

Com esses dois script é possivel autenticar o usuário e recuperar suas informações do gerenciador de identidades

[ Voltar ao Índice ](index.md)


text:
\resumenCastellano{
La flexibilidad sintáctica, y el complejo anidamiento de los datos en una estructura tipo árbol
dificulta expresar propiedades deseables de los datos XML, ofreciendo una capacidad limitada para
expresar semántica. En esta tesis se presenta un estudio de las claves como restricciones de
integridad sobre documentos XML, implementando algoritmos para los problemas de implicación y
validación, con el fin de mostrar la factibilidad de usar las capacidades semánticas que éstas
entregan, y que XML como modelo requiere.
\vspace*{0.5cm}
\KeywordsES{XML; Claves XML; Implicación de claves; Validación de documentos XML; Cover no redundante}
}

\newpage

\resumenIngles{
The syntactic flexibility and complex tree-like nested data make it challenging to express desirable
properties of XML data, offering a limited capability to express semantic. In this thesis, we present
a study of keys as integrity constraints on XML documents, implementing algorithms for implication
and validation problems, with the aim of showing the factibility of using the semantic capabilities
that keys gives and XML as a model requires.
\vspace*{0.5cm}
\KeywordsEN{XML; XML keys; Key implication; XML document validation; Non-redundant cover}
}


text:
<?php
namespace FSS\Controllers;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2017-12-31 at 20:36:31.
 */
class DrugUseControllerTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @var DrugUseController
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new DrugUseController;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @covers FSS\Controllers\DrugUseController::read
     * @todo   Implement testRead().
     */
    public function testRead()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers FSS\Controllers\DrugUseController::readAll
     * @todo   Implement testReadAll().
     */
    public function testReadAll()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers FSS\Controllers\DrugUseController::readAllWithFilter
     * @todo   Implement testReadAllWithFilter().
     */
    public function testReadAllWithFilter()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers FSS\Controllers\DrugUseController::create
     * @todo   Implement testCreate().
     */
    public function testCreate()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers FSS\Controllers\DrugUseController::update
     * @todo   Implement testUpdate().
     */
    public function testUpdate()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers FSS\Controllers\DrugUseController::delete
     * @todo   Implement testDelete().
     */
    public function testDelete()
    {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }
}


text:
/**
 * Tests for App.
 */
/// <reference types="unitejs-protractor-plugin"/>
import { expect } from "chai";
import { $, browser, by, element } from "protractor";

describe("App", () => {
    it("the title is set", (done) => {
        const uniteThemeJson = require("../../../assetsSrc/theme/unite-theme.json");
        browser.uniteLoadAndWaitForPage("/")
            .then(() => {
                browser.getTitle()
                    .then((title) => {
                        expect(title).to.equal(uniteThemeJson.title);
                        done();
                    });
            });
    });

    it("the child text is set", (done) => {
        browser.uniteLoadAndWaitForPage("/")
            .then(() => {
                element(by.customShadowRoot("#root unite-app::sr iron-pages unite-child::sr span"))
                    .getText()
                    .then((rootContent) => {
                        expect(rootContent).to.equal("Hello UniteJS World!");
                        done();
                    });
            });
    });

    it("the font size is set", (done) => {
        browser.uniteLoadAndWaitForPage("/")
            .then(() => {
                element(by.customShadowRoot("#root unite-app::sr iron-pages unite-child::sr span"))
                    .getCssValue("font-size")
                    .then((fontSize) => {
                        expect(fontSize).to.equal("20px");
                        done();
                    });
            });
    });
});

// Generated by UniteJS


text:
package org.lucidj.plotly;

public class Annotation
{
    // instance variables - replace the example below with your own
    private int x;

    /**
     * Constructor for objects of class Annotation
     */
    public Annotation()
    {
        // initialise instance variables
        x = 0;
    }

    /**
     * An example of a method - replace this comment with your own
     *
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y
     */
    public int sampleMethod(int y)
    {
        // put your code here
        return x + y;
    }
}

// EOF


text:
<?php

	namespace database\modules;

	use database\crud\SystemAdmin;

	/**
	*
	*	SystemAdminInfo
	*
	* Provides High level features for interacting with the SystemAdmin;
	*
	* This source code is auto-generated
    *
    * @author Victor Mwenda
    * Email : vmwenda.vm@gmail.com
    * Phone : +254(0)718034449
	*/
	class SystemAdminInfo{

	private $build;
	private $client;
	private $action;
	private $system_admin;
	private $table = 'system_admin';
	/**
	 * SystemAdminInfo
	 *
	 * Class to get all the system_admin Information from the system_admin table
	 * @param String $action
	 * @param String $client
	 * @param String $build
	 *
	 * @author Victor Mwenda
	 * Email : vmwenda.vm@gmail.com
	 * Phone : +254718034449
	 */
	public function __construct($action = "query", $client = "mobile-android",$build="user-build") {

		$this->client = $client;
		$this->action = $action;
		$this->build = $build;

		$this->system_admin = new SystemAdmin( $action, $client );

	}

		/**
	* Inserts data into the table[system_admin] in the order below
	* array ('admin_id','first_name','last_name','primary_email','password','secondary_email','phone','force_password_reset','status','created_on','created_by','updated_on','updated_by')
	* is mappped into
	* array ($admin_id,$first_name,$last_name,$primary_email,$password,$secondary_email,$phone,$force_password_reset,$status,$created_on,$created_by,$updated_on,$updated_by)
	* @return 1 if data was inserted,0 otherwise
	* if redundancy check is true, it inserts if the record if it never existed else.
	* if the record exists, it returns the number of times the record exists on the relation
	*/
	public function insert($admin_id,$first_name,$last_name,$primary_email,$password,$secondary_email,$phone,$force_password_reset,$status,$created_on,$created_by,$updated_on,$updated_by,$redundancy_check= false, $printSQL = false) {
		$columns = array('admin_id','first_name','last_name','primary_email','password','secondary_email','phone','force_password_reset','status','created_on','created_by','updated_on','updated_by');
		$records = array($admin_id,$first_name,$last_name,$primary_email,$password,$secondary_email,$phone,$force_password_reset,$status,$created_on,$created_by,$updated_on,$updated_by);
		return $this->system_admin->insert_prepared_records($admin_id,$first_name,$last_name,$primary_email,$password,$secondary_email,$phone,$force_password_reset,$status,$created_on,$created_by,$updated_on,$updated_by,$redundancy_check,$printSQL );
	}

 	/**
     * @param $distinct
     * @param string $extraSQL
     * @return string
     */
	public function query($distinct,$extraSQL=""){

		$columns = $records = array ();
		$queried_system_admin = $this->system_admin->fetch_assoc_in_system_admin ($distinct, $columns, $records,$extraSQL );

		if($this->build == "eng-build"){
			return $this->query_eng_build($queried_system_admin);
		}
		if($this->build == "user-build"){
			return $this->query_user_build($queried_system_admin);
		}
	}
/**
     * Inserts records in a relation
     * The records are inserted in the relation columns in the order they are arranged in the array
     *
     * @param $records
     * @param bool $printSQL
     * @return bool|mysqli_result
     * @throws NullabilityException
     */
    public function insert_raw($records, $printSQL = false)
    {
        return $this->system_admin->insert_raw($records, $printSQL);
    }

    /**
     * Inserts records in a relation
     * The records are matched alongside the columns in the relation
         * @param array $columns
         * @param array $records
         * @param bool $redundancy_check
         * @param bool $printSQL
         * @return mixed
         */
        public function insert_records_to_system_admin(Array $columns, Array $records,$redundancy_check = false, $printSQL = false){
            return $this->system_admin->insert_records_to_system_admin($columns, $records,$redundancy_check,$printSQL);
        }

     /**
        * Performs a raw Query
        * @param $sql string sql to execute
        * @return string sql results
        * @throws \app\libs\marvik\libs\database\core\mysql\NullabilityException
        */
	public function rawQuery($sql){

		$queried_system_admin = $this->system_admin->get_database_utils()->rawQuery($sql);

		if($this->build == "eng-build"){
			return $this->query_eng_build($queried_system_admin);
		}
		if($this->build == "user-build"){
			return $this->query_user_build($queried_system_admin);
		}
	}

	public function query_eng_build($queried_system_admin){
		if($this->client == "web-desktop"){
			return $this->export_query_html($queried_system_admin);
		}
		if($this->client == "mobile-android"){
			return $this->export_query_json($queried_system_admin);
		}
	}
	public function query_user_build($queried_system_admin){
		if($this->client == "web-desktop"){
			return $this->export_query_html($queried_system_admin);
		}
		if($this->client == "mobile-android"){
			return $this->export_query_json($queried_system_admin);
		}
	}
	public function export_query_json($queried_system_admin){
		$query_json = json_encode($queried_system_admin);
		return $query_json;
	}
	public function export_query_html($queried_system_admin){
		$query_html = "";
		foreach ( $queried_system_admin as $system_admin_row_items ) {
			$query_html .= $this->process_query_for_html_export ( $system_admin_row_items );
		}
		return $query_html;
	}

	private function process_query_for_html_export ( $system_admin_row_items ){
		$html_export ='

'  .$this->table.  '
';

		$admin_id = $system_admin_row_items ['admin_id'];
	if ($admin_id  != null) {
	$html_export .= $this->parseHtmlExport ( 'admin_id', $admin_id  );
}
$first_name = $system_admin_row_items ['first_name'];
	if ($first_name  != null) {
	$html_export .= $this->parseHtmlExport ( 'first_name', $first_name  );
}
$last_name = $system_admin_row_items ['last_name'];
	if ($last_name  != null) {
	$html_export .= $this->parseHtmlExport ( 'last_name', $last_name  );
}
$primary_email = $system_admin_row_items ['primary_email'];
	if ($primary_email  != null) {
	$html_export .= $this->parseHtmlExport ( 'primary_email', $primary_email  );
}
$password = $system_admin_row_items ['password'];
	if ($password  != null) {
	$html_export .= $this->parseHtmlExport ( 'password', $password  );
}
$secondary_email = $system_admin_row_items ['secondary_email'];
	if ($secondary_email  != null) {
	$html_export .= $this->parseHtmlExport ( 'secondary_email', $secondary_email  );
}
$phone = $system_admin_row_items ['phone'];
	if ($phone  != null) {
	$html_export .= $this->parseHtmlExport ( 'phone', $phone  );
}
$force_password_reset = $system_admin_row_items ['force_password_reset'];
	if ($force_password_reset  != null) {
	$html_export .= $this->parseHtmlExport ( 'force_password_reset', $force_password_reset  );
}
$status = $system_admin_row_items ['status'];
	if ($status  != null) {
	$html_export .= $this->parseHtmlExport ( 'status', $status  );
}
$created_on = $system_admin_row_items ['created_on'];
	if ($created_on  != null) {
	$html_export .= $this->parseHtmlExport ( 'created_on', $created_on  );
}
$created_by = $system_admin_row_items ['created_by'];
	if ($created_by  != null) {
	$html_export .= $this->parseHtmlExport ( 'created_by', $created_by  );
}
$updated_on = $system_admin_row_items ['updated_on'];
	if ($updated_on  != null) {
	$html_export .= $this->parseHtmlExport ( 'updated_on', $updated_on  );
}
$updated_by = $system_admin_row_items ['updated_by'];
	if ($updated_by  != null) {
	$html_export .= $this->parseHtmlExport ( 'updated_by', $updated_by  );
}

		return $html_export .='
';
	}

	private function parseHtmlExport($title,$message){
		return '

' . $title . '

' . $message . '

';
	}
} ?>


text:
/*
 * World Calendars
 * https://github.com/alexcjohnson/world-calendars
 *
 * Batch-converted from kbwood/calendars
 * Many thanks to Keith Wood and all of the contributors to the original project!
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/* http://keith-wood.name/calendars.html
   Turkish localisation for Gregorian/Julian calendars for jQuery.
   Written by Izzet Emre Erkan (kara@karalamalar.net). */
var main = require('../main');
var _gregorian = main.calendars.gregorian;
var _julian = main.calendars.julian;

_gregorian.prototype.regionalOptions['tr'] = {
    name: 'Gregorian',
    epochs: ['BCE', 'CE'],
    monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
    'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
    monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz',
    'Tem','Ağu','Eyl','Eki','Kas','Ara'],
    dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
    dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
    dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
    digits: null,
    dateFormat: 'dd.mm.yyyy',
    firstDay: 1,
    isRTL: false
};
if (_julian) {
    _julian.prototype.regionalOptions['tr'] =
        _gregorian.prototype.regionalOptions['tr'];
}