text:
require 'spec_helper'

module RailsParser::Parsers::Rails

  describe ApplicationConfigParser do
    before :each do
      @parser = ApplicationParser.new(default_application_path)
    end

    it "should save the app's name" do
      @parser.application_name.should_not be_empty
    end

    it "should save the app's gems" do
      @parser.gems.should_not be_empty
    end

    it "should save the app's gems source" do
      @parser.gems_source.should_not be_empty
    end

    it "should get an array of config values" do
      @parser.configuration.should_not be_empty
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
namespace Myxini.Recognition
{
    public class InstructionBlock : IBlock
    {
        public InstructionBlock(Command command, BlockParameter parameter)
        {
            this.CommandIdentification = command;
            this.Parameter = parameter;
        }

        public bool IsControlBlock
        {
            get
            {
                return false;
            }
        }
        public Command CommandIdentification { get; private set; }
        public BlockParameter Parameter { get; private set; }

        public override string ToString()
        {
            return string.Format(
                "      [InstructionBlock] Command: {0}, Parameters: {1}",
                CommandIdentification,
                Parameter.ValueLength() == 1 ? Parameter.Value(0).ToString() : "null"
            );
        }
    }
}


text:
class ChartsController < ApplicationController
  def unique_tracks_by_artist
    render json: Track.count_by_artist(25)
  end

  def scrobbles_by_day
    render json: Scrobble.group_by_day(:scrobbled_at).count
  end

  def scrobbles_by_hour
    hour_count = Scrobble.group_by_hour_of_day(:scrobbled_at, format: '%H').count
    hour_count = hour_count.to_a.map! { |e| [e.first.to_i, e.last] }.sort_by { |e| e.first }
    render json: hour_count
  end

  def scrobbles_by_week
    week_count = Scrobble.group_by_week(:scrobbled_at, format: '%W').count
    week_count = week_count.to_a.map! { |e| [e.first.to_i, e.last] }.sort_by { |e| e.first }
    render json: week_count
  end

  def top_artist_scrobbles
    counts  = Scrobble.group(:artist_id).order('count_id desc').limit(25).count('id')
    artists = Artist.where(id: counts.keys)
    render json: artists.map { |artist| [artist.name, counts[artist.id]] }.sort_by { |e| e.last }.reverse
  end

  def top_track_scrobbles
    counts = Scrobble.group(:track_id).order('count_id desc').limit(25).count('id')
    tracks = Track.where(id: counts.keys)
    render json: tracks.map { |track| [track.name, counts[track.id]] }.sort_by { |e| e.last }.reverse
  end
end


text:
module Agris
  module Api
    module Grain
      class SpecificContractExtract
        include ::Agris::XmlModel

        attr_accessor :contract_location, :contract_number

        def initialize(contract_location, contract_number)
          @contract_location = contract_location
          @contract_number = contract_number
        end
      end
    end
  end
end


text:
<?php
namespace Neos\Flow\Tests\Unit\ObjectManagement\Fixture;

/**
 * Fixture class for various unit tests (mainly the package- and object
 * manager)
 *
 */
class ClassWithOptionalArguments
{
    public $argument1;
    public $argument2;
    public $argument3;

    /**
     * Dummy constructor which accepts up to three arguments
     *
     * @param mixed $argument1
     * @param mixed $argument2
     * @param mixed $argument3
     */
    public function __construct($argument1 = null, $argument2 = null, $argument3 = null)
    {
        $this->argument1 = $argument1;
        $this->argument2 = $argument2;
        $this->argument3 = $argument3;
    }
}


text:
package com.dci.intellij.dbn.object.action;

import com.dci.intellij.dbn.common.Icons;
import com.dci.intellij.dbn.database.DatabaseCompatibilityInterface;
import com.dci.intellij.dbn.database.DatabaseFeature;
import com.dci.intellij.dbn.object.common.DBObject;
import com.dci.intellij.dbn.object.common.DBSchemaObject;
import com.dci.intellij.dbn.object.common.list.DBObjectList;
import com.intellij.openapi.actionSystem.DefaultActionGroup;

public class RefreshActionGroup  extends DefaultActionGroup {
    public RefreshActionGroup(DBObject object) {
        super("Refresh", true);
        getTemplatePresentation().setIcon(Icons.ACTION_REFRESH);
        DBObjectList objectList = (DBObjectList) object.getTreeParent();
        add(new ReloadObjectsAction(objectList));
        if (object instanceof DBSchemaObject &&
                DatabaseCompatibilityInterface.getInstance(object).supportsFeature(DatabaseFeature.OBJECT_INVALIDATION)) {
            add(new RefreshObjectsStatusAction(object.getConnectionHandler()));
        }
    }
}


text:
package com.github.nilsga.trello

object TrelloModel {
  case class Member(id: String, username: String, fullName: String, idBoards: Seq[String])
  case class Board(id: String, name: String, desc: String, url: String, shortUrl: String)
  case class Card(id: String, name: String, desc: String, idMembers: Seq[String], idChecklists: Seq[String])
  case class Checklist(id: String, name: String, idBoard: String, idCard: String, checkItems: Seq[ChecklistItem])
  case class ChecklistItem(id: String, name: String, state: String)
  case class BoardList(id: String, name: String, cards: Seq[Card])
}


text:
using namespace aliyun;
namespace {

void Json2Type(const Json::Value& value, std::string* item);
void Json2Type(const Json::Value& value, SlbSetLoadBalancerHTTPListenerAttributeResponseType* item);

template<typename T>
class Json2Array {
public:
  Json2Array(const Json::Value& value, std::vector<T>* vec) {
    if(!value.isArray()) {
      return;
    }
    for(int i = 0; i < value.size(); i++) {
      T val;
      Json2Type(value[i], &val);
      vec->push_back(val);
    }
  }
};

void Json2Type(const Json::Value& value, std::string* item) {
  *item = value.asString();
}
void Json2Type(const Json::Value& value, SlbSetLoadBalancerHTTPListenerAttributeResponseType* item) {
}
}

int Slb::SetLoadBalancerHTTPListenerAttribute(const SlbSetLoadBalancerHTTPListenerAttributeRequestType& req,
                      SlbSetLoadBalancerHTTPListenerAttributeResponseType* response,
                       SlbErrorInfo* error_info) {
  std::string str_response;
  int status_code;
  int ret = 0;
  bool parse_success = false;
  std::string secheme = this->use_tls_ ? "https" : "http";
  AliRpcRequest* req_rpc = new AliRpcRequest(version_,
                         appid_,
                         secret_,
                         secheme + "://" + host_);
  if((!this->use_tls_) && this->proxy_host_ && this->proxy_host_[0]) {
    req_rpc->SetHttpProxy( this->proxy_host_);
  }
  Json::Value val;
  Json::Reader reader;
  req_rpc->AddRequestQuery("Action","SetLoadBalancerHTTPListenerAttribute");
  if(!req.load_balancer_id.empty()) {
    req_rpc->AddRequestQuery("LoadBalancerId", req.load_balancer_id);
  }
  if(!req.listener_port.empty()) {
    req_rpc->AddRequestQuery("ListenerPort", req.listener_port);
  }
  if(!req.xforwarded_for.empty()) {
    req_rpc->AddRequestQuery("XForwardedFor", req.xforwarded_for);
  }
  if(!req.scheduler.empty()) {
    req_rpc->AddRequestQuery("Scheduler", req.scheduler);
  }
  if(!req.sticky_session.empty()) {
    req_rpc->AddRequestQuery("StickySession", req.sticky_session);
  }
  if(!req.sticky_session_type.empty()) {
    req_rpc->AddRequestQuery("StickySessionType", req.sticky_session_type);
  }
  if(!req.cookie_timeout.empty()) {
    req_rpc->AddRequestQuery("CookieTimeout", req.cookie_timeout);
  }
  if(!req.cookie.empty()) {
    req_rpc->AddRequestQuery("Cookie", req.cookie);
  }
  if(!req.health_check.empty()) {
    req_rpc->AddRequestQuery("HealthCheck", req.health_check);
  }
  if(!req.domain.empty()) {
    req_rpc->AddRequestQuery("Domain", req.domain);
  }
  if(!req.ur_i.empty()) {
    req_rpc->AddRequestQuery("URI", req.ur_i);
  }
  if(!req.healthy_threshold.empty()) {
    req_rpc->AddRequestQuery("HealthyThreshold", req.healthy_threshold);
  }
  if(!req.unhealthy_threshold.empty()) {
    req_rpc->AddRequestQuery("UnhealthyThreshold", req.unhealthy_threshold);
  }
  if(!req.health_check_timeout.empty()) {
    req_rpc->AddRequestQuery("HealthCheckTimeout", req.health_check_timeout);
  }
  if(!req.interval.empty()) {
    req_rpc->AddRequestQuery("Interval", req.interval);
  }
  if(!req.host_id.empty()) {
    req_rpc->AddRequestQuery("HostId", req.host_id);
  }
  if(!req.owner_account.empty()) {
    req_rpc->AddRequestQuery("OwnerAccount", req.owner_account);
  }
  if(this->region_id_ && this->region_id_[0]) {
    req_rpc->AddRequestQuery("RegionId", this->region_id_);
  }
  if(req_rpc->CommitRequest() != 0) {
     if(error_info) {
       error_info->code = "connect to host failed";
     }
     ret = -1;
     goto out;
  }
  status_code = req_rpc->WaitResponseHeaderComplete();
  req_rpc->ReadResponseBody(str_response);
  if(status_code > 0 && !str_response.empty()){
    parse_success = reader.parse(str_response, val);
  }
  if(!parse_success) {
    if(error_info) {
      error_info->code = "parse response failed";
    }
    ret = -1;
    goto out;
  }
  if(status_code!= 200 && error_info && parse_success) {
    error_info->request_id = val.isMember("RequestId") ? val["RequestId"].asString(): "";
    error_info->code = val.isMember("Code") ? val["Code"].asString(): "";
    error_info->host_id = val.isMember("HostId") ? val["HostId"].asString(): "";
    error_info->message = val.isMember("Message") ? val["Message"].asString(): "";
  }
  if(status_code== 200 && response) {
    Json2Type(val, response);
  }
  ret = status_code;
out:
  delete req_rpc;
  return ret;
}


text:
<!DOCTYPE html>

    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{cas.inwebo.browserauthent.title}">Browser authentication</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />

Fill in your PIN code:

        <form id="inweboErrorForm" method="POST">
            <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
            <input type="hidden" name="_eventId" value="error" />
        </form>
        <form id="enrollForm" method="POST">
            <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
            <input type="hidden" name="_eventId" value="enroll" />
        </form>

OTP generation error

            <form id="otpForm" style="display:none;" method="POST">
                <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
                <input type="hidden" name="_eventId" value="otp" />
                <input type="hidden" id="otp" name="otp" value="" />

                        <input type="text" class="mdc-text-field__input" id="pin" name="pin"
                               size="6" maxlength="6" required autocomplete="off" />
                        PIN code

                <button class="mdc-button mdc-button--raised" name="enroll"
                        type="button" onclick="getOtp()" value="Enroll"
                        th:value="#{cas.inwebo.browser.button}">
                    Log in in the browser
                </button>
            </form>


text:
package scrapper;

public class ScrapperConstants {
	/**
	 * URL for Google Stock screener
	 */
	public static final String GOOGLE_STOCK_SCREENER = "https://www.google.com/finance#stockscreener";

	/**
	 * URL for YAHOO finance.
	 */
	public static final String YAHOO_FINANCE = "http://finance.yahoo.com/q?s=";
}


text:
'use strict';

var assert = require('assert'),
    cluster = require('cluster'),
    cache = require('../lib/cache.js');

/*
 * run tests
 */
cleanUpData();
localCache();
sharedCachePut();  // single process test

/*
 * testing in cluster
 */
//if(cluster.isMaster) {
//    var w1 = cluster.fork();
//    var w2 = cluster.fork();
//
//    setTimeout(function(){
//        w1.send('test_sharedCacheGet');
//        w2.send('test_sharedCachePut');
//    },100);
//}
//
//if(cluster.isWorker){
//    process.on('message', function(msg) {
//        if(msg === 'test_sharedCacheGet') sharedCacheGet();
//        if(msg === 'test_sharedCachePut') sharedCachePut();
//    });
//}

/*
 * test cache.cleanUpData
 */
function cleanUpData(){
    var T = function(){};
    T.prototype.notOwnProperty = 'not instance property';
    var now = new Date();
    var cleanData = cache.cleanUpData({
        fnc: function(){}, // will be removed
        string: 'text',
        number: 123,
        date: now,
        array:[ function(){}, 123, 'text', now ],
        obj:{
            fnc: function(){}, // will be removed
            string: 'text',
            number: 123,
            date: now
        },
        objProto: new T()
    });

    assert.deepEqual(cleanData, {
        string: 'text',
        number: 123,
        date: now,
        array:[ null, 123, 'text', now ],
        obj:{
            string: 'text',
            number: 123,
            date: now
        },
        objProto: {}
    });
}

/*
 * test cache.local put, get, del
 */
function localCache(){
    cache.local.put('localKey', { data:'cached' });
    assert.deepEqual(cache.local.get('localKey'), { data:'cached' });

    cache.local.del('localKey');
    assert.ok(!cache.local.get('localKey'));

    cache.local.put('localKey', { data:'cached' }, 10, function(){
        assert.ok(!cache.local.get('localKey'));
        console.log('cache local - OK');
    });
    assert.ok(!!cache.local.get('localKey'));
}
/*
 * test cache put, get, del
 */
function sharedCacheGet(){
    setTimeout(function(){
        cache.get('sharedKey', function(err, data){
            if(err) throw err;
            assert.deepEqual(data, { data:'shared' });
        });

    }, 50);

    setTimeout(function(){
        cache.get('sharedKey', function(err, data){
            if(err) throw err;
            assert.ok(!data);
            console.log('cache shared - OK');
        });

    }, 150);
}

function sharedCachePut(){
    cache.put('sharedKey', { data:'shared' }, 1000, function(err){
        if(err) throw err;

        cache.get('sharedKey', function(err, data){
            if(err) throw err;
            assert.deepEqual(data, { data:'shared' });

            setTimeout(function(){
                cache.get('sharedKey', function(err, data){
                    if(err) throw err;

                    assert.ok(!data);
                    console.log('cache shared - OK');
                });

            }, 1500);
        });
    });
}


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="x-ua-compatible" content="ie=edge">
	<title>HIV Symptoms</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<link rel="apple-touch-icon" href="apple-touch-icon.png">

<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/main.css">
	<link rel="stylesheet" href="css/semantic.css">
	<link rel="stylesheet" href="css/style.css">

HIV Symptoms and Stages

The symptoms of HIV can differ from person-to-person and some people may not get any symptoms at all. Without treatment, the virus will get worse over time and damage your immune system. We look at the three stages of HIV infection and possible effects.

Acute primary infection

Around one to four weeks after becoming infected with HIV, some people will experience symptoms that can feel a lot like flu. This may not last long (a week or two) and you may only get some of the flu symptoms – or none at all. Experiencing these symptoms alone are not a reliable way of diagnosing HIV.1

                    You should always visit your doctor if you are worried you have been at risk of HIV infection, even if you don't feel unwell or have any of the following symptoms. They can then arrange for you to have an HIV test.

Symptoms can include:

fever (raised temperature)

fever (raised temperature)

sore throat

swollen glands

headache

upset stomach

body rash

joint aches and pains

muscle pain.

These symptoms can happen because your body is reacting to the HIV virus. Cells that are infected with HIV are circulating throughout your blood system, so your immune system then tries to attack the virus by producing HIV antibodies. This process is called seroconversion, and it usually happens within 45 days of infection and can take up to a few months to complete.

It's important that you always use a condom when having sex, especially if you think you have been exposed to HIV. It may be too early to get an accurate HIV test result at this stage (this can take anything from a few weeks to a few months), but the levels of virus in your blood system are very high at this stage.

The asymptomatic stage

Once the seroconversion stage is over, many people start to feel better. In fact, the HIV virus may not reveal any other symptoms for many years. Health professionals say this could be around 10 years. However, the virus will still be active, infecting new cells and making copies. Over time this will cause a lot of damage to your immune system.

Symptomatic HIV infection

During the third stage of HIV infection there is usually a lot of damage to your immune system. At this point, you are more likely to get serious infections or bacterial and fungal diseases that you otherwise would be able to fight off. These infections are referred to as 'opportunistic infections'. If a person is experiencing opportunistic infections they are now said to have AIDS.

Symptoms that you may have during this time can include:</p4>

weight loss

chronic diarrhoea

night sweats

a fever

a persistent cough

mouth and skin problems

regular infections

serious illnesses or diseases

There isn't a test for AIDS and you can't inherit it. AIDS is a syndrome, and this means it is diagnosed from a set of symptoms that happen when you become very ill from a serious infection or disease.

Taking treatment on a daily basis can be difficult to get used to, especially if you are suffering from any side-effects, so it's important to access support from health professionals when you need it. Having AIDS also does not mean you will die from an AIDS-related illness – but getting the right treatment is really important at this point.


text:
import { createStore, applyMiddleware, compose } from 'redux';
import reduxImmutableStateInvariant from 'redux-immutable-state-invariant';
import createSagaMiddleware from 'redux-saga';
import { routerMiddleware } from 'react-router-redux';
import createHistory from 'history/createBrowserHistory';

import rootReducer from './reducers';
import rootSaga from './sagas';

const sagaMiddleware = createSagaMiddleware();

// export history for application entry point
export const history = createHistory();
const reactRouterMiddleware = routerMiddleware(history);

function configureStoreProd(initialState) {
  const middlewares = [
    sagaMiddleware,
    reactRouterMiddleware
  ];

  const prodStore = createStore(rootReducer, initialState, compose(applyMiddleware(...middlewares)));

  sagaMiddleware.run(rootSaga);

  return prodStore;
}

function configureStoreDev(initialState) {
  const middlewares = [
    sagaMiddleware,
    reactRouterMiddleware,
    reduxImmutableStateInvariant()
  ];

  const enhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

  const devStore = createStore(rootReducer, initialState, enhancers(applyMiddleware(...middlewares)));

  // enable hot module replacement for reducers
  if (module.hot) {
    module.hot.accept('./reducers', () => {
      const nextReducer = require('./reducers').default;
      devStore.replaceReducer(nextReducer);
    });
  }

  sagaMiddleware.run(rootSaga);

  return devStore;
}

const store = process.env.NODE_ENV === 'production' ? configureStoreProd : configureStoreDev;

export default store;


text:
#import "ABI11_0_0RCTDisplayLink.h"

#import <Foundation/Foundation.h>
#import <QuartzCore/CADisplayLink.h>

#import "ABI11_0_0RCTAssert.h"
#import "ABI11_0_0RCTBridgeModule.h"
#import "ABI11_0_0RCTFrameUpdate.h"
#import "ABI11_0_0RCTModuleData.h"
#import "ABI11_0_0RCTProfile.h"

#define ABI11_0_0RCTAssertRunLoop() \
  ABI11_0_0RCTAssert(_runLoop == [NSRunLoop currentRunLoop], \
  @"This method must be called on the CADisplayLink run loop")

@implementation ABI11_0_0RCTDisplayLink
{
  CADisplayLink *_jsDisplayLink;
  NSMutableSet<ABI11_0_0RCTModuleData *> *_frameUpdateObservers;
  NSRunLoop *_runLoop;
}

- (instancetype)init
{
  if ((self = [super init])) {
    _frameUpdateObservers = [NSMutableSet new];
    _jsDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_jsThreadUpdate:)];
  }

  return self;
}

- (void)registerModuleForFrameUpdates:(id<ABI11_0_0RCTBridgeModule>)module
                       withModuleData:(ABI11_0_0RCTModuleData *)moduleData
{
  if (![moduleData.moduleClass conformsToProtocol:@protocol(ABI11_0_0RCTFrameUpdateObserver)] ||
      [_frameUpdateObservers containsObject:moduleData]) {
    return;
  }

  [_frameUpdateObservers addObject:moduleData];

  // Don't access the module instance via moduleData, as this will cause deadlock
  id<ABI11_0_0RCTFrameUpdateObserver> observer = (id<ABI11_0_0RCTFrameUpdateObserver>)module;
  __weak typeof(self) weakSelf = self;
  observer.pauseCallback = ^{
    typeof(self) strongSelf = weakSelf;
    if (!strongSelf) {
      return;
    }

    CFRunLoopRef cfRunLoop = [strongSelf->_runLoop getCFRunLoop];
    if (!cfRunLoop) {
      return;
    }

    if ([NSRunLoop currentRunLoop] == strongSelf->_runLoop) {
      [weakSelf updateJSDisplayLinkState];
    } else {
      CFRunLoopPerformBlock(cfRunLoop, kCFRunLoopDefaultMode, ^{
        [weakSelf updateJSDisplayLinkState];
      });
      CFRunLoopWakeUp(cfRunLoop);
    }
  };

  // Assuming we're paused right now, we only need to update the display link's state
  // when the new observer is not paused. If it not paused, the observer will immediately
  // start receiving updates anyway.
  if (![observer isPaused] && _runLoop) {
    CFRunLoopPerformBlock([_runLoop getCFRunLoop], kCFRunLoopDefaultMode, ^{
      [self updateJSDisplayLinkState];
    });
  }
}

- (void)addToRunLoop:(NSRunLoop *)runLoop
{
  _runLoop = runLoop;
  [_jsDisplayLink addToRunLoop:runLoop forMode:NSRunLoopCommonModes];
}

- (void)invalidate
{
  [_jsDisplayLink invalidate];
}

- (void)dispatchBlock:(dispatch_block_t)block
                queue:(dispatch_queue_t)queue
{
  if (queue == ABI11_0_0RCTJSThread) {
    block();
  } else if (queue) {
    dispatch_async(queue, block);
  }
}

- (void)_jsThreadUpdate:(CADisplayLink *)displayLink
{
  ABI11_0_0RCTAssertRunLoop();

  ABI11_0_0RCT_PROFILE_BEGIN_EVENT(ABI11_0_0RCTProfileTagAlways, @"-[ABI11_0_0RCTDisplayLink _jsThreadUpdate:]", nil);

  ABI11_0_0RCTFrameUpdate *frameUpdate = [[ABI11_0_0RCTFrameUpdate alloc] initWithDisplayLink:displayLink];
  for (ABI11_0_0RCTModuleData *moduleData in _frameUpdateObservers) {
    id<ABI11_0_0RCTFrameUpdateObserver> observer = (id<ABI11_0_0RCTFrameUpdateObserver>)moduleData.instance;
    if (!observer.paused) {
      ABI11_0_0RCTProfileBeginFlowEvent();

      [self dispatchBlock:^{
        ABI11_0_0RCTProfileEndFlowEvent();
        [observer didUpdateFrame:frameUpdate];
      } queue:moduleData.methodQueue];
    }
  }

  [self updateJSDisplayLinkState];

  ABI11_0_0RCTProfileImmediateEvent(ABI11_0_0RCTProfileTagAlways, @"JS Thread Tick", displayLink.timestamp, 'g');

  ABI11_0_0RCT_PROFILE_END_EVENT(ABI11_0_0RCTProfileTagAlways, @"objc_call");
}

- (void)updateJSDisplayLinkState
{
  ABI11_0_0RCTAssertRunLoop();

  BOOL pauseDisplayLink = YES;
  for (ABI11_0_0RCTModuleData *moduleData in _frameUpdateObservers) {
    id<ABI11_0_0RCTFrameUpdateObserver> observer = (id<ABI11_0_0RCTFrameUpdateObserver>)moduleData.instance;
    if (!observer.paused) {
      pauseDisplayLink = NO;
      break;
    }
  }

  _jsDisplayLink.paused = pauseDisplayLink;
}

@end


text:
<!DOCTYPE html>
<title>document.writeln and null/undefined</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#dom-document-writeln%28%29">
<link rel="help" href="http://www.whatwg.org/html5/#documents-in-the-dom">


text:
<?php
// Do not delete these lines
	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die (esc_html__('Please do not load this page directly. Thanks!','OnTheGo'));

	if ( post_password_required() ) { ?>

<?php esc_html_e('This post is password protected. Enter the password to view comments.','OnTheGo'); ?>

<?php
		return;
	}
?>

<?php if ( have_comments() ) : ?>

<?php comments_number(esc_html__('No Comments','OnTheGo'),  esc_html__('1 Comment','OnTheGo'), '% '.esc_html__('Comments','OnTheGo'));?>

	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>

<?php previous_comments_link( __( '← Older Comments', 'OnTheGo' ) ); ?>

<?php next_comments_link( __( 'Newer Comments →', 'OnTheGo' ) ); ?>

	<?php endif; // check for comment navigation ?>

	<?php if ( ! empty($comments_by_type['comment']) ) : ?>

			<?php wp_list_comments( array('type'=>'comment','callback'=>'et_custom_comments_display') ); ?>

	<?php endif; ?>

	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>

<?php previous_comments_link( __( '← Older Comments', 'OnTheGo' ) ); ?>

<?php next_comments_link( __( 'Newer Comments →', 'OnTheGo' ) ); ?>

	<?php endif; // check for comment navigation ?>

	<?php if ( ! empty($comments_by_type['pings']) ) : ?>

<?php esc_html_e('Trackbacks/Pingbacks','OnTheGo') ?>

				<?php wp_list_comments('type=pings&callback=et_list_pings'); ?>

	<?php endif; ?>
<?php else : // this is displayed if there are no comments so far ?>

		<?php if ('open' == $post->comment_status) : ?>

		<?php else : // comments are closed ?>

<?php esc_html_e('Comments are closed.','OnTheGo'); ?>

		<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
	<?php comment_form( array('label_submit' => esc_attr__( 'Submit Comment', 'OnTheGo' ), 'title_reply' => '' . esc_attr__( 'Leave a Reply', 'OnTheGo' ) . '', 'title_reply_to' => esc_attr__( 'Leave a Reply to %s' )) ); ?>
<?php else: ?>

<?php endif; // if you delete this the sky will fall on your head ?>


text:
/** animations for home page
 *
 * Created by Christopher on 6/10/2016.
 */

$(window).on("load", function(){
    $.backstretch('https://s3-us-west-2.amazonaws.com/asakawa.me/img/bg.jpg');

    /**
     * page elements to animate.
     *
     * @type {*|jQuery|HTMLElement}
     */
    var body = $("body");
    var overlay = $(".overlay");
    var sideBar = $("#iconSideBar");

    var schoolOverlay = $("#schoolOverlay");
    var freelanceOverlay = $("#freelanceOverlay");
    var projectsOverlay = $("#projectsOverlay");
    var closeOverlay = $('.tileClose');
    var schoolContent = $("#schoolContent");
    var freelanceContent = $("#freelanceContent");
    var projectsContent = $("#projectsContent");
    var closeSchool = $("#closeSchool");
    var closeFreelance = $("#closeFreelance");
    var closeProjects = $("#closeProjects");

    /* close buttons */
    var closeTerminal = $("#closeTerminal");
    var closeResume = $("#closeResume");
    var closeEmail = $("#closeEmail");
    var closeMessage = $("#closeMessage");
    var closePhone = $("#closePhone");

    /* small nav bars */
    var terminalNav = $("#navTerminal");
    var resumeNav =  $("#navResume");
    var emailNav = $("#navEmail");
    var messageNav = $("#navMessage");
    var phoneNav = $("#navPhone");

    var terminalBox = $("#terminalBox");
    var resumeBox = $('#resumeBox');
    var emailBox = $('#emailBox');
    var messageBox = $('#messageBox');
    var phoneBox = $('#phoneBox');

    var mainContent = $('#mainContent');
    var resumeContent = $('#resumeContent');
    var emailContent = $('#emailContent');
    var phoneContent = $('#phoneContent');

    var terminalIcon = $("#terminalIcon");
    var resumeIcon = $("#resumeIcon");
    var emailIcon = $("#emailIcon");
    var messageIcon = $("#messageIcon");
    var phoneIcon = $("#phoneIcon");

    var terminal = $("#terminalContent");
    var scrollButton = $("#scrollButton");
    var content = $("#mainContent");
    var input = $("#terminalInput");
    var output = $(".terminalOutput");
    var inLine = $('#inputLine');
    var tile1 = $('#tile_1');
    var tile2 = $('#tile_2');
    var tile3 = $('#tile_3');

    /**
     * lock used to only allow one icon animation to occur at a time.
     *
     * @type {boolean}
     */
    var animationLock = false;

    main();
    function main(){
        /* wait a sec, then start the little demo */
        setTimeout(function(){
            terminalExpand();
        }, 1000);
        /* okay lets close the terminal for the user */
        setTimeout(function(){
            terminalCollapse();
        }, 1000 * 13);

    }

    /**
     * Click events
     */
    closeTerminal.click(function(){ terminalCollapse(); });
    closeResume.click(function(){ resumeCollapse(); });
    closeEmail.click(function(){ emailCollapse(); });
    closeMessage.click(function(){ messageCollapse(); });
    closePhone.click(function(){ phoneCollapse(); });
    terminalIcon.click(function(){ clickButton(terminalIcon); });
    resumeIcon.click(function(){ clickButton(resumeIcon); });
    emailIcon.click(function(){ clickButton(emailIcon); });
    messageIcon.click(function(){ clickButton(messageIcon); });
    phoneIcon.click(function(){ clickButton(phoneIcon); });
    scrollButton.click(function() {
        if (content.height() < 71)
            scrollUp();
        else
            scrollDown();
    });
    tile1.click(function (){ tileExpand(schoolOverlay, schoolContent);});
    tile2.click(function (){tileExpand(freelanceOverlay, freelanceContent);});
    tile3.click(function (){tileExpand(projectsOverlay, projectsContent);});
    closeSchool.click(function(){ tileCollapse(schoolOverlay, schoolContent) });
    closeFreelance.click(function(){ tileCollapse(freelanceOverlay, freelanceContent) });
    closeProjects.click(function(){ tileCollapse(projectsOverlay, projectsContent) });

    /**
     * only proceed to expand the element if the
     * animationLock is free
     *
     * @param element
     */
    function clickButton(element){

        if(!animationLock){
            animationLock = true; //take the lock
            switch (element){
                case terminalIcon:  terminalExpand();   break;
                case resumeIcon:    resumeExpand();     break;
                case emailIcon:     emailExpand();      break;
                case messageIcon:   messageExpand();    break;
                case phoneIcon:     phoneExpand();      break;
                default: break;
            }
        }
    }

    /**
     * key presses events
     */
    $(document).keyup(function(e) {
        if (e.keyCode == 27) { closeAll(); }    //esc key
        if (e.keyCode == 38) { scrollUp(); }    //up arrow key
        if (e.keyCode == 40) { scrollDown(); }  //down arrow key
    });

    /**
     * on-hover events
     */
    terminalIcon.hover(function(){
        onHoverIcon(terminalBox);
    }, function() {
        offHoverIcon(terminalBox);
    });
    resumeIcon.hover(function(){
        onHoverIcon(resumeBox);
    }, function() {
        offHoverIcon(resumeBox);
    });
    emailIcon.hover(function(){
        onHoverIcon(emailBox);
    }, function() {
        offHoverIcon(emailBox);
    });
    messageIcon.hover(function(){
        onHoverIcon(messageBox);
    }, function() {
        offHoverIcon(messageBox);
    });
    phoneIcon.hover(function(){
        onHoverIcon(phoneBox);
    }, function() {
        offHoverIcon(phoneBox);
    });

    var sideBarTimeout;
    sideBar.hover(function(){
        onHoverSideBar();
    }, function (){
        offHoverSideBar();
    });

    function onHoverSideBar(){
        if (!animationLock){
            clearTimeout(sideBarTimeout);
            sideBarTimeout = null;
            showBar();
        }
    }
    function offHoverSideBar(){
        if (sideBarTimeout === null){
            sideBarTimeout = setTimeout(hideBar, 500    );
        }
    }

    function showBar() { sideBar.animate({ opacity: '0.8' }, "fast"); }
    function hideBar() { sideBar.animate({ opacity: '0.0' }, "fast"); }

    /**
     * Icon on hover anumation
     * @param element
     */
    function onHoverIcon(element){
        onHoverSideBar();
        element.animate({ left: "20px"}, "fast");
    }

    /**
     * Icon off hover animation
     * @param element
     */
    function offHoverIcon(element){
        if(!animationLock && element.width() == 50){
            offHoverSideBar();
            element.animate({left: "10px"}, "fast");
        }
    }

    function closeAll() {
        terminalCollapse();
        resumeCollapse();
        emailCollapse();
        messageCollapse();
        phoneCollapse();
        scrollDown();
        tileCollapse(schoolOverlay, schoolContent);
        tileCollapse(freelanceOverlay, freelanceContent);
        tileCollapse(projectsOverlay, projectsContent);
    }

    function scrollUp(){
        var h;
        if (body.width() > 767)
            h = '600px';
        else{
            h = $('#iconSideBar').height() - 20;
        }

        content.css('overflow-y', 'auto');

        content.animate({
            height: h
        }, "slow", function(){
            scrollButton.removeClass('upArrow');
            scrollButton.addClass('downArrow');
        });

    }
    function scrollDown(){
        content.css('overflow-y', 'hidden');
        content.animate({
            scrollTop: '0px',
            height: '70px'
        }, "slow", function(){
            scrollButton.removeClass('downArrow');
            scrollButton.addClass('upArrow');
        });

    }

    function typeAnimate(){
        $(function(){
            var one = $("#output1");
            var two = $("#output2");
            setTimeout(function(){
                input.typed({
                    strings: ["whoami", ""],
                    callback: function () {
                        one.fadeIn(0);
                        input.typed('removeCursor');
                        input.removeData('typed');

                        setTimeout(function(){
                            input.typed({
                                strings: ["./welcome"],
                                callback: function () {
                                    two.fadeIn(0);
                                    input.fadeOut(0);
                                    inLine.fadeOut(0);
                                    runProgram();
                                }
                            });
                        }, 2000);

                    }
                });
            }, 1000);
        });

    }
    function runProgram(){
        var output = [$('#output3'), $('#output4'), $('#output5'), $('#output6'), $('#output7')];

        setTimeout(function () {
            output[0].fadeIn(0);
        }, 300);
        setTimeout(function () {
            output[1].fadeIn(0);
        }, 600);
        setTimeout(function () {
            output[2].fadeIn(0);
        }, 900);
        setTimeout(function () {
            output[3].fadeIn(0);
        }, 1200);
        setTimeout(function () {
            output[4].fadeIn(0);
            inLine.fadeIn(0);
        }, 1500);
    }

    /**
     * animation that collapses the terminal into icon
     */
    function terminalCollapse() {
        overlay.fadeOut("slow");
        closeTerminal.fadeOut("slow");
        terminal.fadeOut("slow");
        terminalNav.fadeOut("slow", function(){
            terminalBox.animate({
                backgroundColor: "whtie",
                height: '50px',
                width: '50px',
                left: '10px',
                top: '60px',
                borderTopLeftRadius: 50,
                borderTopRightRadius: 50,
                borderBottomLeftRadius: 50,
                borderBottomRightRadius: 50
            }, function(){
                terminalIcon.fadeIn("slow");
                showOtherIcons(terminalBox);
                animationLock = false;
            });
        });
    }

    /**
     * animation that expands the terminal from icon
     */
    function terminalExpand(){

        //if on mobile device, expand to fill more of the screen
        var h, w, l, t;
        if (body.width() > 767) {
            h = '60%';
            w = '50%';
            l = '25%';
            t = '10%';
        }
        else { //on mobile device
            h = '70%';
            w = '90%';
            l = '5%';
            t = '5%';
        }
        hideOtherIcons(terminalBox);
        terminalIcon.fadeOut("slow", function(){
            terminalBox.animate({
                height: h,
                width: w,
                left: l,
                top: t,
                borderTopLeftRadius: 5,
                borderTopRightRadius: 5,
                borderBottomLeftRadius: 5,
                borderBottomRightRadius: 5,
                backgroundColor: "black"

            }, function(){
                terminalNav.fadeIn("slow");
                closeTerminal.fadeIn("slow");
                terminal.fadeIn("slow");
                overlay.fadeIn("slow");
                typeAnimate();
            });
        });
    }

    function resumeExpand(){
        hideOtherIcons(resumeBox);
        content.fadeOut("slow");
        resumeIcon.fadeOut("slow", function(){
           resumeBox.animate({
               height: '98%',
               width: '98%',
               left: '1%',
               top: '1%',
               borderTopLeftRadius: 5,
               borderTopRightRadius: 5,
               borderBottomLeftRadius: 5,
               borderBottomRightRadius: 5
           }, function(){
               resumeNav.fadeIn("slow");
               closeResume.fadeIn("slow");
               resumeContent.fadeIn("slow");
           });

        });
    }
    function resumeCollapse(){
        resumeNav.fadeOut("slow");
        closeResume.fadeOut("slow");
        resumeContent.fadeOut("slow", function(){
            resumeBox.animate({
                height: '50px',
                width: '50px',
                left: '10px',
                top: '120px',
                borderTopLeftRadius: 50,
                borderTopRightRadius: 50,
                borderBottomLeftRadius: 50,
                borderBottomRightRadius: 50
            }, function(){
                resumeIcon.fadeIn("slow");
                showOtherIcons(resumeBox);
                content.fadeIn("slow");
                animationLock = false;
            });
        });

    }

    function emailExpand(){
        var left = findMiddle(300);
        hideOtherIcons(emailBox);
        emailIcon.fadeOut("slow", function(){
            emailBox.animate({
                left: left,
                height: '200px',
                width: '300px',
                top: '100px',
                borderTopLeftRadius: 5,
                borderTopRightRadius: 5,
                borderBottomLeftRadius: 5,
                borderBottomRightRadius: 5
            }, function(){
                emailNav.fadeIn("slow");
                closeEmail.fadeIn("slow");
                emailContent.fadeIn("slow");
            });
        });
    }
    function emailCollapse(){
        emailContent.fadeOut("slow");
        emailNav.fadeOut("slow");
        closeEmail.fadeOut("slow", function(){
            emailBox.animate({
                height: '50px',
                width: '50px',
                left: '10px',
                top: '180px',
                borderTopLeftRadius: 50,
                borderTopRightRadius: 50,
                borderBottomLeftRadius: 50,
                borderBottomRightRadius: 50
            }, function(){
                emailIcon.fadeIn("slow");
                showOtherIcons(emailBox);
                animationLock = false;
            });
        });
    }

    function messageExpand(){animationLock = false;}
    function messageCollapse(){animationLock = false;}

    function phoneExpand(){

        var left = findMiddle(240);
        hideOtherIcons(phoneBox);
        phoneIcon.fadeOut("slow", function(){
            phoneBox.animate({
                left: left,
                height: '230px',
                width: '240px',
                top: '100px',
                borderTopLeftRadius: 5,
                borderTopRightRadius: 5,
                borderBottomLeftRadius: 5,
                borderBottomRightRadius: 5
            }, function(){
                phoneNav.fadeIn("slow");
                closePhone.fadeIn("slow");
                phoneContent.fadeIn("slow");
            });
        });
    }
    function phoneCollapse(){

        phoneNav.fadeOut("slow");
        phoneContent.fadeOut("slow");
        closePhone.fadeOut("slow", function(){
            phoneBox.animate({
                height: '50px',
                width: '50px',
                left: '10px',
                top: '240px',
                borderTopLeftRadius: 50,
                borderTopRightRadius: 50,
                borderBottomLeftRadius: 50,
                borderBottomRightRadius: 50
            }, function(){
                phoneIcon.fadeIn("slow");
                showOtherIcons(phoneBox);
                animationLock = false;
            });
        });
    }

    function findMiddle(elemWidth){
        return ( body.width()/2 ) - ( elemWidth/2 );
    }

    function hideOtherIcons(element, callback){
        switch(element){
            case terminalBox:
                resumeBox.fadeOut("slow");
                emailBox.fadeOut("slow");
                messageBox.fadeOut("slow");
                phoneBox.fadeOut("slow");
                break;
            case resumeBox:
                terminalBox.fadeOut("slow");
                emailBox.fadeOut("slow");
                messageBox.fadeOut("slow");
                phoneBox.fadeOut("slow");
                break;
            case emailBox:
                terminalBox.fadeOut("slow");
                resumeBox.fadeOut("slow");
                messageBox.fadeOut("slow");
                phoneBox.fadeOut("slow");
                break;
            case messageBox:
                terminalBox.fadeOut("slow");
                resumeBox.fadeOut("slow");
                emailBox.fadeOut("slow");
                phoneBox.fadeOut("slow");
                break;
            case phoneBox:
                terminalBox.fadeOut("slow");
                resumeBox.fadeOut("slow");
                emailBox.fadeOut("slow");
                messageBox.fadeOut("slow");
                break;
        }
    }

    function showOtherIcons(element){
        switch(element){
            case terminalBox:
                resumeBox.fadeIn("slow");
                emailBox.fadeIn("slow");
                messageBox.fadeIn("slow");
                phoneBox.fadeIn("slow");
                break;
            case resumeBox:
                terminalBox.fadeIn("slow");
                emailBox.fadeIn("slow");
                messageBox.fadeIn("slow");
                phoneBox.fadeIn("slow");
                break;
            case emailBox:
                terminalBox.fadeIn("slow");
                resumeBox.fadeIn("slow");
                messageBox.fadeIn("slow");
                phoneBox.fadeIn("slow");
                break;
            case messageBox:
                terminalBox.fadeIn("slow");
                resumeBox.fadeIn("slow");
                emailBox.fadeIn("slow");
                phoneBox.fadeIn("slow");
                break;
            case phoneBox:
                terminalBox.fadeIn("slow");
                resumeBox.fadeIn("slow");
                emailBox.fadeIn("slow");
                messageBox.fadeIn("slow");
                break;
        }
    }

    function tileExpand(overlay, content){
        //closeAll();
        overlay.fadeIn("slow");
        content.fadeIn("slow");
    }
    function tileCollapse(overlay, content){
        overlay.fadeOut("slow");
        content.fadeOut("slow");
    }

});


text:
Project Wrapper for the Disco PHP Framework

This is the project structure for the Disco PHP Framework. It serves as the starting point for all Disco PHP
projects.

Check out the documentation

DiscoPHP.com

Out Of The Box Features

The base project structure comes preloaded with some awesome out of the box features which almost every project
implements:

        Account/User:

Account creation

Email based account verification

Login, logout, and session management

Securly stored passwords hashed with SHA512 and salted

Permanent logins

Password reset emails

Account information editing

CSRF Tokens

An amazing looking base theme/UI for you to extend using Materialize
    CSS

A build system (Gruntfile.js) implemented using Grunt which supports:

SASS

React JSX files

CSS vendor based auto-prefixing (ie -moz -webkit)

CSS & JS minification

CSS & JS bundling

Version controlled third party libraries (bower.json & .bowerrc) via Bower

Default caching rules for resources (ie jpg,png,js,css etc) as defined in
    public/.htacces

Get Started

Required:

Clone : git clone https://github.com/discophp/project.git your-site

Install Dependencies : composer install

Optional (but required if you want to use the DB & the built in user functionality):

Configure DB settings in app/config/config.php

Create the user tables : php public/index.php db-restore 'app/db' 'user_structure.sql' from the SQL file
    app/db/user.sql

Configure your email settings in app/config/email.php

Optional (but required if you want to use the build system)

Install nodejs dependencies : npm install

Run the build system : grunt

Watch the build for changes : grunt watch


text:
//package org.jasig.cas.web.flow;

//import javax.servlet.http.HttpRequest;
//import javax.servlet.http.HttpResponse;
//import javax.validation.constraints.NotNull;

//import org.jasig.cas.CentralAuthenticationService;
//import org.jasig.cas.authentication.handler.AuthenticationException;
//import org.jasig.cas.authentication.principal.Credentials;
//import org.jasig.cas.authentication.principal.Service;
//import org.jasig.cas.ticket.TicketException;
//import org.jasig.cas.web.bind.CredentialsBinder;
//import org.jasig.cas.web.support.WebUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.binding.message.MessageBuilder;
//import org.springframework.binding.message.MessageContext;
//import org.springframework.util.StringUtils;
//import org.springframework.web.util.CookieGenerator;
//import org.springframework.webflow.execution.HttpContext;

/**
 * Action to authenticate credentials and retrieve a TicketGrantingTicket for
 * those credentials. If there is a request for renew, then it also generates
 * the Service Ticket required.
 *
 * @author Scott Battaglia
 * @version $Revision$ $Date$
 * @since 3.0.4
 */

using System;
using System.Web;

using NCAS.jasig.authentication.handler;
using NCAS.jasig.authentication.principal;
using NCAS.jasig.ticket;
using NCAS.jasig.web.MOCK2JAVA;
using NCAS.jasig.web.bind;
using NCAS.jasig.web.support;

namespace NCAS.jasig.web.flow
{
    public class AuthenticationViaFormAction
    {

        /**
     * Binder that allows additional binding of form object beyond Spring
     * defaults.
     */
        private CredentialsBinder _credentialsBinder;

        /** Core we delegate to for handling all ticket related tasks. */
        ////@NotNull
        private CentralAuthenticationService _centralAuthenticationService;

        ////@NotNull
        private CookieGenerator _warnCookieGenerator;

        public AuthenticationViaFormAction(CentralAuthenticationService centralAuthenticationService,
                                           CookieGenerator warnCookieGenerator)
            : this(null, centralAuthenticationService, warnCookieGenerator)
        {
        }

        private AuthenticationViaFormAction(CredentialsBinder credentialsBinder,
            CentralAuthenticationService centralAuthenticationService,
            CookieGenerator warnCookieGenerator)
        {
            _credentialsBinder = credentialsBinder;
            _centralAuthenticationService = centralAuthenticationService;
            _warnCookieGenerator = warnCookieGenerator;
        }

        //protected Logger logger = LoggerFactory.getLogger(getClass());

        public void doBind(HttpContext context, Credentials credentials)
        {
            HttpRequest request = WebUtils.getHttpServletRequest(context);

            if (this._credentialsBinder != null && this._credentialsBinder.supports(credentials.GetType()))
            {
                this._credentialsBinder.bind(request, credentials);
            }
        }

        public string submit(HttpContext context, Credentials credentials, MessageContext messageContext)
        {
            // Validate login ticket
            string authoritativeLoginTicket = WebUtils.getLoginTicketFromFlowScope(context);
            string providedLoginTicket = WebUtils.getLoginTicketFromRequest(context);
            if (!authoritativeLoginTicket.Equals(providedLoginTicket))
            {
                //this.logger.warn("Invalid login ticket " + providedLoginTicket);
                string code = "INVALID_TICKET";
                //messageContext.addMessage(
                //    new MessageBuilder().error().code(code).arg(providedLoginTicket).defaultText(code).build());
                return "error";
            }

            string ticketGrantingTicketId = WebUtils.getTicketGrantingTicketId(context);
            Service service = WebUtils.getService(context);
            if (!string.IsNullOrEmpty(context.Request.QueryString["renew"]) && ticketGrantingTicketId != null && service != null)
            {

                try
                {
                    string serviceTicketId = this._centralAuthenticationService.grantServiceTicket(ticketGrantingTicketId, service, credentials);
                    WebUtils.putServiceTicketInRequestScope(context, serviceTicketId);
                    this.putWarnCookieIfRequestParameterPresent(context);
                    return "warn";
                }
                catch (TicketException e)
                {
                    if (this.isCauseAuthenticationException(e))
                    {
                        this.populateErrorsInstance(e, messageContext);
                        return this.getAuthenticationExceptionEventId(e);
                    }

                    this._centralAuthenticationService.destroyTicketGrantingTicket(ticketGrantingTicketId);
                    //if (logger.isDebugEnabled()) {
                    //    logger.debug("Attempted to generate a ServiceTicket using renew=true with different credentials", e);
                    //}
                }
            }

            try
            {
                var ticketValue = this._centralAuthenticationService.createTicketGrantingTicket(credentials);
                WebUtils.putTicketGrantingTicketInRequestScope(context, ticketValue);
                this.putWarnCookieIfRequestParameterPresent(context);
                return "success";
            }
            catch (TicketException e)
            {
                this.populateErrorsInstance(e, messageContext);
                if (this.isCauseAuthenticationException(e))
                    return this.getAuthenticationExceptionEventId(e);
                return "error";
            }
        }

        private void populateErrorsInstance(TicketException e, MessageContext messageContext)
        {

            //try
            //{
            //    messageContext.addMessage(new MessageBuilder().error().code(e.getCode()).defaultText(e.getCode()).build());
            //}
            //catch (Exception fe)
            //{
            //    logger.error(fe.getMessage(), fe);
            //}
        }

        private void putWarnCookieIfRequestParameterPresent(HttpContext context)
        {
            HttpResponse response = WebUtils.getHttpServletResponse(context);

            if (!string.IsNullOrEmpty(context.Request["warn"]))
            {
                this._warnCookieGenerator.addCookie(response, "true");
            }
            else
            {
                this._warnCookieGenerator.removeCookie(response);
            }
        }

        private AuthenticationException getAuthenticationExceptionAsCause(TicketException e)
        {
            throw new NotImplementedException();
            //return (AuthenticationException)e;
        }

        private string getAuthenticationExceptionEventId(TicketException e)
        {
            AuthenticationException authEx = this.getAuthenticationExceptionAsCause(e);

            //if (this.logger.isDebugEnabled())
            //    this.logger.debug("An authentication error has occurred. Returning the event id " + authEx.getType());

            return authEx.getType();
        }

        private bool isCauseAuthenticationException(TicketException e)
        {
            return e.getCode() != null && typeof(AuthenticationException).IsAssignableFrom(e.GetType());
        }

        //public void setCentralAuthenticationService(CentralAuthenticationService centralAuthenticationService)
        //{
        //    this._centralAuthenticationService = centralAuthenticationService;
        //}

        /**
     * Set a CredentialsBinder for additional binding of the HttpRequest
     * to the Credentials instance, beyond our default binding of the
     * Credentials as a Form Object in Spring WebMVC parlance. By the time we
     * invoke this CredentialsBinder, we have already engaged in default binding
     * such that for each HttpRequest parameter, if there was a JavaBean
     * property of the Credentials implementation of the same name, we have set
     * that property to be the value of the corresponding request parameter.
     * This CredentialsBinder plugin point exists to allow consideration of
     * things other than HttpRequest parameters in populating the
     * Credentials (or more sophisticated consideration of the
     * HttpRequest parameters).
     *
     * @param credentialsBinder the credentials binder to set.
     */
        //public void setCredentialsBinder(CredentialsBinder credentialsBinder)
        //{
        //    this._credentialsBinder = credentialsBinder;
        //}

        //public void setWarnCookieGenerator(CookieGenerator warnCookieGenerator)
        //{
        //    this._warnCookieGenerator = warnCookieGenerator;
        //}
    }
}


text:
<?php

namespace League\Container;

use Interop\Container\ContainerInterface as InteropContainerInterface;
use League\Container\Definition\DefinitionFactory;
use League\Container\Definition\DefinitionFactoryInterface;
use League\Container\Definition\DefinitionInterface;
use League\Container\Exception\NotFoundException;
use League\Container\Inflector\InflectorAggregate;
use League\Container\Inflector\InflectorAggregateInterface;
use League\Container\ServiceProvider\ServiceProviderAggregate;
use League\Container\ServiceProvider\ServiceProviderAggregateInterface;

class Container implements ContainerInterface
{
    /**
     * @var \League\Container\Definition\DefinitionFactoryInterface
     */
    protected $definitionFactory;

    /**
     * @var \League\Container\Definition\DefinitionInterface[]
     */
    protected $definitions = [];

    /**
     * @var \League\Container\Definition\DefinitionInterface[]
     */
    protected $sharedDefinitions = [];

    /**
     * @var \League\Container\Inflector\InflectorAggregateInterface
     */
    protected $inflectors;

    /**
     * @var \League\Container\ServiceProvider\ServiceProviderAggregateInterface
     */
    protected $providers;

    /**
     * @var array
     */
    protected $shared = [];

    /**
     * @var \Interop\Container\ContainerInterface[]
     */
    protected $delegates = [];

    /**
     * Constructor.
     *
     * @param \League\Container\ServiceProvider\ServiceProviderAggregateInterface|null $providers
     * @param \League\Container\Inflector\InflectorAggregateInterface|null             $inflectors
     * @param \League\Container\Definition\DefinitionFactoryInterface|null             $definitionFactory
     */
    public function __construct(
        ServiceProviderAggregateInterface $providers         = null,
        InflectorAggregateInterface       $inflectors        = null,
        DefinitionFactoryInterface        $definitionFactory = null
    ) {
        // set required dependencies
        $this->providers         = (is_null($providers))
                                 ? (new ServiceProviderAggregate)->setContainer($this)
                                 : $providers->setContainer($this);

        $this->inflectors        = (is_null($inflectors))
                                 ? (new InflectorAggregate)->setContainer($this)
                                 : $inflectors->setContainer($this);

        $this->definitionFactory = (is_null($definitionFactory))
                                 ? (new DefinitionFactory)->setContainer($this)
                                 : $definitionFactory->setContainer($this);
    }

    /**
     * {@inheritdoc}
     */
    public function get($alias, array $args = [])
    {
        if ($this->hasShared($alias, true)) {
            return $this->inflectors->inflect($this->shared[$alias]);
        }

        if (array_key_exists($alias, $this->sharedDefinitions)) {
            $shared = $this->inflectors->inflect($this->sharedDefinitions[$alias]->build());
            $this->shared[$alias] = $shared;
            return $shared;
        }

        if (array_key_exists($alias, $this->definitions)) {
            return $this->inflectors->inflect(
                $this->definitions[$alias]->build($args)
            );
        }

        if ($this->providers->provides($alias)) {
            $this->providers->register($alias);
            return $this->get($alias, $args);
        }

        if ($resolved = $this->getFromDelegate($alias, $args)) {
            return $this->inflectors->inflect($resolved);
        }

        throw new NotFoundException(
            sprintf('Alias (%s) is not being managed by the container', $alias)
        );
    }

    /**
     * {@inheritdoc}
     */
    public function has($alias)
    {
        if (array_key_exists($alias, $this->definitions) || $this->hasShared($alias)) {
            return true;
        }

        if ($this->providers->provides($alias)) {
            return true;
        }

        return $this->hasInDelegate($alias);
    }

    /**
     * Returns a boolean to determine if the container has a shared instance of an alias.
     *
     * @param  string  $alias
     * @param  boolean $resolved
     * @return boolean
     */
    public function hasShared($alias, $resolved = false)
    {
        $shared = ($resolved === false) ? array_merge($this->shared, $this->sharedDefinitions) : $this->shared;

        return (array_key_exists($alias, $shared));
    }

    /**
     * {@inheritdoc}
     */
    public function add($alias, $concrete = null, $share = false)
    {
        if (is_null($concrete)) {
            $concrete = $alias;
        }

        $definition = $this->definitionFactory->getDefinition($alias, $concrete);

        if ($definition instanceof DefinitionInterface) {
            if ($share === false) {
                $this->definitions[$alias] = $definition;
            } else {
                $this->sharedDefinitions[$alias] = $definition;
            }

            return $definition;
        }

        // dealing with a value that cannot build a definition
        $this->shared[$alias] = $concrete;
    }

    /**
     * {@inheritdoc}
     */
    public function share($alias, $concrete = null)
    {
        return $this->add($alias, $concrete, true);
    }

    /**
     * {@inheritdoc}
     */
    public function addServiceProvider($provider)
    {
        $this->providers->add($provider);

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function extend($alias)
    {
        if ($this->providers->provides($alias)) {
            $this->providers->register($alias);
        }

        if (array_key_exists($alias, $this->definitions)) {
            return $this->definitions[$alias];
        }

        if (array_key_exists($alias, $this->sharedDefinitions)) {
            return $this->sharedDefinitions[$alias];
        }

        throw new NotFoundException(
            sprintf('Unable to extend alias (%s) as it is not being managed as a definition', $alias)
        );
    }

    /**
     * {@inheritdoc}
     */
    public function inflector($type, callable $callback = null)
    {
        return $this->inflectors->add($type, $callback);
    }

    /**
     * {@inheritdoc}
     */
    public function call(callable $callable, array $args = [])
    {
        return (new ReflectionContainer)->setContainer($this)->call($callable, $args);
    }

    /**
     * Delegate a backup container to be checked for services if it
     * cannot be resolved via this container.
     *
     * @param  \Interop\Container\ContainerInterface $container
     * @return $this
     */
    public function delegate(InteropContainerInterface $container)
    {
        $this->delegates[] = $container;

        if ($container instanceof ImmutableContainerAwareInterface) {
            $container->setContainer($this);
        }

        return $this;
    }

    /**
     * Returns true if service is registered in one of the delegated backup containers.
     *
     * @param  string $alias
     * @return boolean
     */
    public function hasInDelegate($alias)
    {
        foreach ($this->delegates as $container) {
            if ($container->has($alias)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Attempt to get a service from the stack of delegated backup containers.
     *
     * @param  string $alias
     * @param  array  $args
     * @return mixed
     */
    protected function getFromDelegate($alias, array $args = [])
    {
        foreach ($this->delegates as $container) {
            if ($container->has($alias)) {
                return $container->get($alias, $args);
            }

            continue;
        }

        return false;
    }
}


text:
package io.cozmic.usher.plugins.kafka;

import de.odysseus.el.util.SimpleContext;
import io.cozmic.usher.message.PipelinePack;
import io.vertx.core.buffer.Buffer;
import org.apache.kafka.clients.producer.ProducerRecord;

import javax.el.ExpressionFactory;
import javax.el.ValueExpression;

/**
 * Created by chuck on 11/9/15.
 */
public class RoundRobinFactory implements RecordFactory {
    private static ExpressionFactory factory = ExpressionFactory.newInstance();
    private final SimpleContext context = new SimpleContext();
    private final ValueExpression topicExpression;

    public RoundRobinFactory(String topic) {
        topicExpression = factory.createValueExpression(context, topic, String.class);
    }

    @Override
    public ProducerRecord<byte[], byte[]> create(Buffer data, PipelinePack context) {
        final String dynamicTopic = (String) topicExpression.getValue(context.getRuntimeContext());
        return new ProducerRecord<>(dynamicTopic, data.getBytes());
    }
}


text:
package org.apache.camel.component.cassandra.integration;

import java.util.List;
import java.util.concurrent.TimeUnit;

import com.datastax.oss.driver.api.core.cql.Row;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class CassandraComponentConsumerIT extends BaseCassandra {

    static final String CQL = "select login, first_name, last_name from camel_user";

    @Test
    public void testConsumeAll() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:resultAll");
        mock.expectedMinimumMessageCount(1);
        mock.whenAnyExchangeReceived(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                Object body = exchange.getIn().getBody();
                assertTrue(body instanceof List);
            }
        });
        mock.await(1, TimeUnit.SECONDS);
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testConsumeUnprepared() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:resultUnprepared");
        mock.expectedMinimumMessageCount(1);
        mock.whenAnyExchangeReceived(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                Object body = exchange.getIn().getBody();
                assertTrue(body instanceof List);
            }
        });
        mock.await(1, TimeUnit.SECONDS);
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testConsumeOne() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:resultOne");
        mock.expectedMinimumMessageCount(1);
        mock.whenAnyExchangeReceived(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                Object body = exchange.getIn().getBody();
                assertTrue(body instanceof Row);
            }
        });
        mock.await(1, TimeUnit.SECONDS);

        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() {
                from(String.format("cql://%s/%s?cql=%s", getUrl(), KEYSPACE_NAME, CQL)).to("mock:resultAll");
                from(String.format("cql://%s/%s?cql=%s&prepareStatements=false", getUrl(), KEYSPACE_NAME, CQL))
                        .to("mock:resultUnprepared");
                from(String.format("cql://%s/%s?cql=%s&resultSetConversionStrategy=ONE", getUrl(), KEYSPACE_NAME, CQL))
                        .to("mock:resultOne");
            }
        };
    }
}


text:
package grapecity.fitnessexplorer.util;

import android.content.res.Resources;
import android.util.TypedValue;

/**
 * Created by David.Bickford on 6/2/2016.
 */
public class DimensionUtil
{
    public static int getDimensionSize(int size)
    {
        return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, Resources.getSystem().getDisplayMetrics()));
    }
}


text:
name: Bug report
labels: 'issue: bug report'
about: Report a defect in the software

---

<!--
Thank you for your bug report. If this is your first one,
please take the time to read the following lines before posting it.

NOTE:

    If you're asking about how to use OpenSSL, this isn't the right
    forum.  Please see our User Support resources:
    https://github.com/openssl/openssl/blob/master/SUPPORT.md

Please remember to tell us in what OpenSSL version you found the issue.

For build issues:

    If this is a build issue, please include the configuration output
    as well as a log of all errors.  Don't forget to include the exact
    commands you typed.

    With OpenSSL before 1.1.1, the configuration output comes from the
    configuration command.  With OpenSSL 1.1.1 and on, it's the output
    of `perl configdata.pm --dump`

For other issues:

    If it isn't a build issue, example code or commands to reproduce
    the issue is highly appreciated.
    Also, please remember to tell us if you worked with your own
    OpenSSL build or if it is system provided.

Please remember to put ``` lines before and after any commands plus
output and code, like this:

    ```
    $ echo output output output
    output output output
    ```

    ```
    #include <stdio.h>

    int main() {
        int foo = 1;
        printf("%d\n", foo);
    }
    ```
-->


text:
<?=$vtitle?>

<?php include('../view/Layout/flash.html.php'); ?>
<form class="form" action="/backend/<?=$module?>/<?=$method?$method:"save?id=$entity[id]"?>" method="post">

    <?php foreach ($fields as $key => $field):?>

        <?=$field['name']?>
        <input value="<?=$entity[$key]?>" type="<?=$field['type']?>" class="form-control <?=$field['class']?>" name="entity[<?=$key?>]">

    <?php endforeach ?>

<a href="/backend/<?=$module?>" class="btn btn-default">Volver
<button type="submit" class="btn btn-success">Guardar</button>
</form>


text:
{% extends "artist/base.html" %}

{% load i18n %}

{% block body_class %}audiotracks{% endblock %}

{% block body %}

{{ artist }}

{% for track in tracks %}
{% include "artist/_track.html" %}

{% endfor %}

{% endblock %}


text:
#ifndef ZEND_SHARED_ALLOC_H
#define ZEND_SHARED_ALLOC_H

#include "zend.h"
#include "ZendAccelerator.h"

#if defined(__APPLE__) && defined(__MACH__) /* darwin */
# ifdef HAVE_SHM_MMAP_POSIX
#  define USE_SHM_OPEN  1
# endif
# ifdef HAVE_SHM_MMAP_ANON
#  define USE_MMAP      1
# endif
#elif defined(__linux__) || defined(_AIX)
# ifdef HAVE_SHM_IPC
#  define USE_SHM       1
# endif
# ifdef HAVE_SHM_MMAP_ANON
#  define USE_MMAP      1
# endif
#elif defined(__sparc) || defined(__sun)
# ifdef HAVE_SHM_MMAP_POSIX
#  define USE_SHM_OPEN  1
# endif
# ifdef HAVE_SHM_IPC
#  define USE_SHM       1
# endif
# if defined(__i386)
#  ifdef HAVE_SHM_MMAP_ANON
#   define USE_MMAP     1
#  endif
# endif
#else
# ifdef HAVE_SHM_MMAP_POSIX
#  define USE_SHM_OPEN  1
# endif
# ifdef HAVE_SHM_MMAP_ANON
#  define USE_MMAP      1
# endif
# ifdef HAVE_SHM_IPC
#  define USE_SHM       1
# endif
#endif

#define ALLOC_FAILURE           0
#define ALLOC_SUCCESS           1
#define FAILED_REATTACHED       2
#define SUCCESSFULLY_REATTACHED 4
#define ALLOC_FAIL_MAPPING      8

typedef struct _zend_shared_segment {
    size_t  size;
    size_t  pos;  /* position for simple stack allocator */
    void   *p;
} zend_shared_segment;

typedef int (*create_segments_t)(size_t requested_size, zend_shared_segment ***shared_segments, int *shared_segment_count, char **error_in);
typedef int (*detach_segment_t)(zend_shared_segment *shared_segment);

typedef struct {
	create_segments_t create_segments;
	detach_segment_t detach_segment;
	size_t (*segment_type_size)(void);
} zend_shared_memory_handlers;

typedef struct _handler_entry {
	const char                  *name;
	zend_shared_memory_handlers *handler;
} zend_shared_memory_handler_entry;

typedef struct _zend_shared_memory_state {
	int *positions;   /* current positions for each segment */
	int  shared_free; /* amount of free shared memory */
} zend_shared_memory_state;

typedef struct _zend_smm_shared_globals {
    /* Shared Memory Manager */
    zend_shared_segment      **shared_segments;
    /* Number of allocated shared segments */
    int                        shared_segments_count;
    /* Amount of free shared memory */
    size_t                     shared_free;
    /* Amount of shared memory allocated by garbage */
    int                        wasted_shared_memory;
    /* No more shared memory flag */
    zend_bool                  memory_exhausted;
    /* Saved Shared Allocator State */
    zend_shared_memory_state   shared_memory_state;
	/* Pointer to the application's shared data structures */
	void                      *app_shared_globals;
} zend_smm_shared_globals;

extern zend_smm_shared_globals *smm_shared_globals;

#define ZSMMG(element)		(smm_shared_globals->element)

#define SHARED_ALLOC_REATTACHED		(SUCCESS+1)

int zend_shared_alloc_startup(size_t requested_size);
void zend_shared_alloc_shutdown(void);

/* allocate shared memory block */
void *zend_shared_alloc(size_t size);

/* copy into shared memory */
void *_zend_shared_memdup(void *p, size_t size, zend_bool free_source TSRMLS_DC);
int  zend_shared_memdup_size(void *p, size_t size);

typedef union _align_test {
	void   *ptr;
	double  dbl;
	long    lng;
} align_test;

#if ZEND_GCC_VERSION >= 2000
# define PLATFORM_ALIGNMENT (__alignof__ (align_test))
#else
# define PLATFORM_ALIGNMENT (sizeof(align_test))
#endif

#define ZEND_ALIGNED_SIZE(size) \
	((size + PLATFORM_ALIGNMENT - 1) & ~(PLATFORM_ALIGNMENT - 1))

/* exclusive locking */
void zend_shared_alloc_lock(TSRMLS_D);
void zend_shared_alloc_unlock(TSRMLS_D); /* returns the allocated size during lock..unlock */
void zend_shared_alloc_safe_unlock(TSRMLS_D);

/* old/new mapping functions */
void zend_shared_alloc_clear_xlat_table(void);
void zend_shared_alloc_register_xlat_entry(const void *old, const void *new);
void *zend_shared_alloc_get_xlat_entry(const void *old);

size_t zend_shared_alloc_get_free_memory(void);
void zend_shared_alloc_save_state(void);
void zend_shared_alloc_restore_state(void);
const char *zend_accel_get_shared_model(void);

/* memory write protection */
void zend_accel_shared_protect(int mode TSRMLS_DC);

#ifdef USE_MMAP
extern zend_shared_memory_handlers zend_alloc_mmap_handlers;
#endif

#ifdef USE_SHM
extern zend_shared_memory_handlers zend_alloc_shm_handlers;
#endif

#ifdef USE_SHM_OPEN
extern zend_shared_memory_handlers zend_alloc_posix_handlers;
#endif

#ifdef ZEND_WIN32
extern zend_shared_memory_handlers zend_alloc_win32_handlers;
void zend_shared_alloc_create_lock(void);
void zend_shared_alloc_lock_win32(void);
void zend_shared_alloc_unlock_win32(void);
#endif

#endif /* ZEND_SHARED_ALLOC_H */


text:
package com.jnape.palatable.lambda.adt.hmap;

import org.junit.Test;

import static com.jnape.palatable.lambda.adt.Maybe.just;
import static com.jnape.palatable.lambda.adt.hmap.HMap.emptyHMap;
import static com.jnape.palatable.lambda.adt.hmap.TypeSafeKey.typeSafeKey;
import static com.jnape.palatable.lambda.functions.builtin.fn1.Id.id;
import static com.jnape.palatable.lambda.optics.Iso.simpleIso;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static testsupport.assertion.LensAssert.assertLensLawfulness;

public class TypeSafeKeyTest {

    @Test
    public void lensLawfulness() {
        assertLensLawfulness(TypeSafeKey.<String>typeSafeKey().andThen(simpleIso(Integer::parseInt, Object::toString)),
                             asList("123", "0"),
                             asList(456, -1));
    }

    @Test
    public void compositionMapsOriginalValueInAndOutOfHMap() {
        TypeSafeKey.Simple<String>   stringKey = typeSafeKey();
        TypeSafeKey<String, Integer> intKey    = stringKey.andThen(simpleIso(Integer::parseInt, Object::toString));
        HMap                         map       = emptyHMap().put(stringKey, "123");

        assertEquals(just("123"), map.get(stringKey));
        assertEquals(just(123), map.get(intKey));

        HMap updated = map.put(intKey, 456);
        assertEquals(just("456"), updated.get(stringKey));
        assertEquals(just(456), updated.get(intKey));

        assertEquals(1, updated.keys().size());
    }

    @Test
    public void discardRPreservesTypeSafeKey() {
        TypeSafeKey.Simple<String>  stringKey    = typeSafeKey();
        TypeSafeKey<String, String> discardedKey = stringKey.discardR(simpleIso(id(), id()));
        HMap                        map          = emptyHMap().put(stringKey, "123");

        assertEquals(just("123"), map.get(discardedKey));
    }

    @Test
    public void defaultEquality() {
        TypeSafeKey.Simple<Object>  keyA       = typeSafeKey();
        TypeSafeKey<Object, Object> mappedKeyA = keyA.andThen(simpleIso(id(), id()));

        assertEquals(keyA, keyA);
        assertEquals(keyA, mappedKeyA);
        assertEquals(mappedKeyA, keyA);
        assertEquals(keyA.hashCode(), mappedKeyA.hashCode());

        TypeSafeKey.Simple<Object> keyB = typeSafeKey();
        assertNotEquals(keyA, keyB);
        assertNotEquals(keyB, keyA);
        assertNotEquals(keyB, mappedKeyA);
        assertNotEquals(mappedKeyA, keyB);

        TypeSafeKey<Object, Object> differentMappedKeyA = keyA.andThen(simpleIso(id(), id()));
        assertEquals(keyA, differentMappedKeyA);
        assertEquals(differentMappedKeyA, keyA);
        assertEquals(mappedKeyA, differentMappedKeyA);
        assertEquals(differentMappedKeyA, mappedKeyA);
        assertEquals(keyA.hashCode(), differentMappedKeyA.hashCode());
        assertEquals(mappedKeyA.hashCode(), differentMappedKeyA.hashCode());
    }
}


text:
from base.miglog import miglog
from scheudler import robot_protocol
from pub.Config import SingletonConfig
from scheudler.RobotUsrMgr import RobotUserMgr
'''
Created on 2014年6月15日

@author: kerry
'''

class RobotScheduler(object):
    '''
    classdocs
    '''

    def __init__(self):
        '''
        Constructor
        '''
        #host = "42.121.14.108"
        host = SingletonConfig().robothost
        port = SingletonConfig().robotport
        self.robot_user_mgr = RobotUserMgr(host,port)

    def UnpackHead(self,data):
        packet_head = robot_protocol.PacketHead()
        return  packet_head.unpackhead(data)

    def SchdulerLogin(self,platform_id,machine_id):
        return self.robot_user_mgr.SchdulerLogin(platform_id, machine_id)

    def NoticeRobotInfo(self,data):
        robot_login = self.robot_user_mgr.NoticeRobotInfo(data)
        print robot_login

    def NoticeAssistantInfo(self,data):
        assistant_login = self.robot_user_mgr.NoticeAssistantInfo(data)

    def NoticeRobotChatLogin(self,data):
        robot_chat_login = self.robot_user_mgr.NoticeRobotChat(data)


text:
/******************************************************************************
 *
 * Module Name: hwvalid - I/O request validation
 *
 *****************************************************************************/

/*
 * Copyright (C) 2000 - 2013, Intel Corp.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#define __HWVALID_C__

#include "acpi.h"
#include "accommon.h"

#define _COMPONENT          ACPI_HARDWARE
        ACPI_MODULE_NAME    ("hwvalid")

/* Local prototypes */

static ACPI_STATUS
AcpiHwValidateIoRequest (
    ACPI_IO_ADDRESS         Address,
    UINT32                  BitWidth);

/*
 * Protected I/O ports. Some ports are always illegal, and some are
 * conditionally illegal. This table must remain ordered by port address.
 *
 * The table is used to implement the Microsoft port access rules that
 * first appeared in Windows XP. Some ports are always illegal, and some
 * ports are only illegal if the BIOS calls _OSI with a WinXP string or
 * later (meaning that the BIOS itelf is post-XP.)
 *
 * This provides ACPICA with the desired port protections and
 * Microsoft compatibility.
 *
 * Description of port entries:
 *  DMA:   DMA controller
 *  PIC0:  Programmable Interrupt Controller (8259A)
 *  PIT1:  System Timer 1
 *  PIT2:  System Timer 2 failsafe
 *  RTC:   Real-time clock
 *  CMOS:  Extended CMOS
 *  DMA1:  DMA 1 page registers
 *  DMA1L: DMA 1 Ch 0 low page
 *  DMA2:  DMA 2 page registers
 *  DMA2L: DMA 2 low page refresh
 *  ARBC:  Arbitration control
 *  SETUP: Reserved system board setup
 *  POS:   POS channel select
 *  PIC1:  Cascaded PIC
 *  IDMA:  ISA DMA
 *  ELCR:  PIC edge/level registers
 *  PCI:   PCI configuration space
 */
static const ACPI_PORT_INFO     AcpiProtectedPorts[] =
{
    {"DMA",     0x0000, 0x000F, ACPI_OSI_WIN_XP},
    {"PIC0",    0x0020, 0x0021, ACPI_ALWAYS_ILLEGAL},
    {"PIT1",    0x0040, 0x0043, ACPI_OSI_WIN_XP},
    {"PIT2",    0x0048, 0x004B, ACPI_OSI_WIN_XP},
    {"RTC",     0x0070, 0x0071, ACPI_OSI_WIN_XP},
    {"CMOS",    0x0074, 0x0076, ACPI_OSI_WIN_XP},
    {"DMA1",    0x0081, 0x0083, ACPI_OSI_WIN_XP},
    {"DMA1L",   0x0087, 0x0087, ACPI_OSI_WIN_XP},
    {"DMA2",    0x0089, 0x008B, ACPI_OSI_WIN_XP},
    {"DMA2L",   0x008F, 0x008F, ACPI_OSI_WIN_XP},
    {"ARBC",    0x0090, 0x0091, ACPI_OSI_WIN_XP},
    {"SETUP",   0x0093, 0x0094, ACPI_OSI_WIN_XP},
    {"POS",     0x0096, 0x0097, ACPI_OSI_WIN_XP},
    {"PIC1",    0x00A0, 0x00A1, ACPI_ALWAYS_ILLEGAL},
    {"IDMA",    0x00C0, 0x00DF, ACPI_OSI_WIN_XP},
    {"ELCR",    0x04D0, 0x04D1, ACPI_ALWAYS_ILLEGAL},
    {"PCI",     0x0CF8, 0x0CFF, ACPI_OSI_WIN_XP}
};

#define ACPI_PORT_INFO_ENTRIES  ACPI_ARRAY_LENGTH (AcpiProtectedPorts)

/******************************************************************************
 *
 * FUNCTION:    AcpiHwValidateIoRequest
 *
 * PARAMETERS:  Address             Address of I/O port/register
 *              BitWidth            Number of bits (8,16,32)
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Validates an I/O request (address/length). Certain ports are
 *              always illegal and some ports are only illegal depending on
 *              the requests the BIOS AML code makes to the predefined
 *              _OSI method.
 *
 ******************************************************************************/

static ACPI_STATUS
AcpiHwValidateIoRequest (
    ACPI_IO_ADDRESS         Address,
    UINT32                  BitWidth)
{
    UINT32                  i;
    UINT32                  ByteWidth;
    ACPI_IO_ADDRESS         LastAddress;
    const ACPI_PORT_INFO    *PortInfo;

    ACPI_FUNCTION_TRACE (HwValidateIoRequest);

    /* Supported widths are 8/16/32 */

    if ((BitWidth != 8) &&
        (BitWidth != 16) &&
        (BitWidth != 32))
    {
        ACPI_ERROR ((AE_INFO,
            "Bad BitWidth parameter: %8.8X", BitWidth));
        return (AE_BAD_PARAMETER);
    }

    PortInfo = AcpiProtectedPorts;
    ByteWidth = ACPI_DIV_8 (BitWidth);
    LastAddress = Address + ByteWidth - 1;

    ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %p LastAddress %p Length %X",
        ACPI_CAST_PTR (void, Address), ACPI_CAST_PTR (void, LastAddress),
        ByteWidth));

    /* Maximum 16-bit address in I/O space */

    if (LastAddress > ACPI_UINT16_MAX)
    {
        ACPI_ERROR ((AE_INFO,
            "Illegal I/O port address/length above 64K: %p/0x%X",
            ACPI_CAST_PTR (void, Address), ByteWidth));
        return_ACPI_STATUS (AE_LIMIT);
    }

    /* Exit if requested address is not within the protected port table */

    if (Address > AcpiProtectedPorts[ACPI_PORT_INFO_ENTRIES - 1].End)
    {
        return_ACPI_STATUS (AE_OK);
    }

    /* Check request against the list of protected I/O ports */

    for (i = 0; i < ACPI_PORT_INFO_ENTRIES; i++, PortInfo++)
    {
        /*
         * Check if the requested address range will write to a reserved
         * port. Four cases to consider:
         *
         * 1) Address range is contained completely in the port address range
         * 2) Address range overlaps port range at the port range start
         * 3) Address range overlaps port range at the port range end
         * 4) Address range completely encompasses the port range
         */
        if ((Address <= PortInfo->End) && (LastAddress >= PortInfo->Start))
        {
            /* Port illegality may depend on the _OSI calls made by the BIOS */

            if (AcpiGbl_OsiData >= PortInfo->OsiDependency)
            {
                ACPI_DEBUG_PRINT ((ACPI_DB_IO,
                    "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)",
                    ACPI_CAST_PTR (void, Address), ByteWidth, PortInfo->Name,
                    PortInfo->Start, PortInfo->End));

                return_ACPI_STATUS (AE_AML_ILLEGAL_ADDRESS);
            }
        }

        /* Finished if address range ends before the end of this port */

        if (LastAddress <= PortInfo->End)
        {
            break;
        }
    }

    return_ACPI_STATUS (AE_OK);
}

/******************************************************************************
 *
 * FUNCTION:    AcpiHwReadPort
 *
 * PARAMETERS:  Address             Address of I/O port/register to read
 *              Value               Where value is placed
 *              Width               Number of bits
 *
 * RETURN:      Status and value read from port
 *
 * DESCRIPTION: Read data from an I/O port or register. This is a front-end
 *              to AcpiOsReadPort that performs validation on both the port
 *              address and the length.
 *
 *****************************************************************************/

ACPI_STATUS
AcpiHwReadPort (
    ACPI_IO_ADDRESS         Address,
    UINT32                  *Value,
    UINT32                  Width)
{
    ACPI_STATUS             Status;
    UINT32                  OneByte;
    UINT32                  i;

    /* Truncate address to 16 bits if requested */

    if (AcpiGbl_TruncateIoAddresses)
    {
        Address &= ACPI_UINT16_MAX;
    }

    /* Validate the entire request and perform the I/O */

    Status = AcpiHwValidateIoRequest (Address, Width);
    if (ACPI_SUCCESS (Status))
    {
        Status = AcpiOsReadPort (Address, Value, Width);
        return (Status);
    }

    if (Status != AE_AML_ILLEGAL_ADDRESS)
    {
        return (Status);
    }

    /*
     * There has been a protection violation within the request. Fall
     * back to byte granularity port I/O and ignore the failing bytes.
     * This provides Windows compatibility.
     */
    for (i = 0, *Value = 0; i < Width; i += 8)
    {
        /* Validate and read one byte */

        if (AcpiHwValidateIoRequest (Address, 8) == AE_OK)
        {
            Status = AcpiOsReadPort (Address, &OneByte, 8);
            if (ACPI_FAILURE (Status))
            {
                return (Status);
            }

            *Value |= (OneByte << i);
        }

        Address++;
    }

    return (AE_OK);
}

/******************************************************************************
 *
 * FUNCTION:    AcpiHwWritePort
 *
 * PARAMETERS:  Address             Address of I/O port/register to write
 *              Value               Value to write
 *              Width               Number of bits
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Write data to an I/O port or register. This is a front-end
 *              to AcpiOsWritePort that performs validation on both the port
 *              address and the length.
 *
 *****************************************************************************/

ACPI_STATUS
AcpiHwWritePort (
    ACPI_IO_ADDRESS         Address,
    UINT32                  Value,
    UINT32                  Width)
{
    ACPI_STATUS             Status;
    UINT32                  i;

    /* Truncate address to 16 bits if requested */

    if (AcpiGbl_TruncateIoAddresses)
    {
        Address &= ACPI_UINT16_MAX;
    }

    /* Validate the entire request and perform the I/O */

    Status = AcpiHwValidateIoRequest (Address, Width);
    if (ACPI_SUCCESS (Status))
    {
        Status = AcpiOsWritePort (Address, Value, Width);
        return (Status);
    }

    if (Status != AE_AML_ILLEGAL_ADDRESS)
    {
        return (Status);
    }

    /*
     * There has been a protection violation within the request. Fall
     * back to byte granularity port I/O and ignore the failing bytes.
     * This provides Windows compatibility.
     */
    for (i = 0; i < Width; i += 8)
    {
        /* Validate and write one byte */

        if (AcpiHwValidateIoRequest (Address, 8) == AE_OK)
        {
            Status = AcpiOsWritePort (Address, (Value >> i) & 0xFF, 8);
            if (ACPI_FAILURE (Status))
            {
                return (Status);
            }
        }

        Address++;
    }

    return (AE_OK);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable

    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.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<!--
Author: Petr Ivanov
Version: $Revision: 1.2 $
-->

<Test
    ID="GetLongFieldTest"
    date-of-creation="15-11-2004"
    timeout="1"
    >
        <Author value="Gregory Shimansky, Petr Ivanov"/>
        <Description>
            <TestedMethod name="GetLongField()"/>
            Native code returns value of the object field specified
            in the argument. Test checks that this value is equal
            to the field value.

            Covered assertions assert_func216 assert_func218_6 assert_func222 assert_func220 assert_func211
        </Description>
        <Keyword name="functional"/>
        <Source name="GetLongFieldTest.java"/>

        <Runner ID="Runtime">
            <Param name="toRun" value="org.apache.harmony.vts.test.vm.jni.object_fields.GetLongFieldTest"/>
        </Runner>
</Test>


text:
(function() {
'use strict';

angular
    .module('gridjs-test.comparer', ['gridjs-test.algorithm-adapter'])
    .controller('ComparerController', [
        'datasetManager',
        '$rootScope',
        'gridPattern',
        'ElementsLayout',
        'AlgorithmAdapter',
        '$timeout',
        ComparerController
    ]);

function ComparerController(datasetManager, $rootScope, gridPattern, ElementsLayout, AlgorithmAdapter, $timeout) {
    this.$timeout = $timeout;

    this.dataset = datasetManager.currentSet;
    this.gridPattern = gridPattern;
    this.layout = new ElementsLayout();

    this.desiredWidth = this.dataset.width;

    this.init(AlgorithmAdapter);

    $rootScope.$on('newCurrentSet', function(event, newCurrentSet) {
        this.dataset = newCurrentSet;
        this.init(AlgorithmAdapter);
    }.bind(this));
}

ComparerController.prototype.init = function(AlgorithmAdapter) {
    this.desiredWidth = this.dataset.width;

    this.dataset.goToMostRecent();
    this.initElements();

    this.algorithmAdapter = new AlgorithmAdapter({
        elements: this.dataset.elements,
        rowHeight: this.dataset.rowHeight,
        columnWidth: this.dataset.columnWidth,
        units: this.dataset.units,
        keepIndexOrder: this.dataset.keepIndexOrder,
        containerWidth: this.desiredWidth,
    });

    this.algorithmAdapter.arrange();

    this.adjustZoom();
};

ComparerController.prototype.initElements = function() {
    this.elementsByHand = _.filter(this.dataset.elements, { isArranged: true });
};

ComparerController.prototype.adjustZoom = function() {
    if (!this.readWidthArrangedByHand) {
        this.$timeout(function() {
            this.adjustZoom();
            this.readWidthArrangedByHand = this.readWidthArrangedByHand
                || function() { return this.desiredWidth; };
        }.bind(this), 20);
        return;
    }

    var zoom = this.readWidthArrangedByHand() / this.desiredWidth;
    this.zoom = zoom < 1 ? zoom : 1;
};

ComparerController.prototype.getElementsContainerCss = function(elements) {
    var sizing = this.layout.getContainerCss({
        zoom: this.zoom,
        width: this.desiredWidth,
        shouldScaleDown: true,
        elements: elements,
        units: this.dataset.units,
    });

    var gridCss = this.gridPattern.getGridCss(
        this.dataset.columnWidth * this.zoom,
        this.dataset.rowHeight * this.zoom);

    return _.merge(gridCss, sizing);
};

ComparerController.prototype.getElementCss = function(element) {
    return this.layout.getElementCss(element, this.zoom, this.dataset.units);
};

ComparerController.prototype.goBackInHistory = function() {
    this.dataset.popHistoryEntry();
    this.algorithmAdapter.stepBack();
    this.initElements();
};

ComparerController.prototype.goForwardInHistory = function() {
    this.dataset.goForwardInHistory();
    this.algorithmAdapter.stepForward();
    this.initElements();
};

ComparerController.prototype.goToMostRecent = function() {
    this.dataset.goToMostRecent();
    this.algorithmAdapter.arrange();
    this.initElements();
};

ComparerController.prototype.goToOldestHistoryEntry = function() {
    this.dataset.goToOldestHistoryEntry();
    this.algorithmAdapter.reset();
    this.initElements();
};

}());


text:
package html_char_filter

import (
	"time"

	"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/blevesearch/bleve/analysis"
	"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/blevesearch/bleve/analysis/datetime_parsers/flexible_go"
	"github.com/khlieng/name_pending/Godeps/_workspace/src/github.com/blevesearch/bleve/registry"
)

const Name = "dateTimeOptional"

const rfc3339NoTimezone = "2006-01-02T15:04:05"
const rfc3339NoTimezoneNoT = "2006-01-02 15:04:05"
const rfc3339NoTime = "2006-01-02"

var layouts = []string{
	time.RFC3339Nano,
	time.RFC3339,
	rfc3339NoTimezone,
	rfc3339NoTimezoneNoT,
	rfc3339NoTime,
}

func DateTimeParserConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.DateTimeParser, error) {
	return flexible_go.NewFlexibleGoDateTimeParser(layouts), nil
}

func init() {
	registry.RegisterDateTimeParser(Name, DateTimeParserConstructor)
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Didymella fruticosae Höhn.

### Remarks
null