text:
<?php

namespace SilverSnake\View;

class ViewTemplate
{
    /**
     * @var \SilverSnake\View\ViewHandler
     */
    private $handler;

    /**
     * @var array
     */
    private $style = array();

    /**
     * @var array
     */
    private $script = array();

    /**
     * @var bool
     */
    private static $start = false;

    /**
     * @var array
     */
    private static $css = array();

    /**
     * @var array
     */
    private static $js = array();

    private function bootstrap()
    {
        $dir = __DIR__ . '/../../config';

        $script = file_get_contents($dir . '/script.json', true);
        $script = (array)json_decode($script);
        foreach ($script as $key => $value) {
            self::$js[$key] = $value;
        }

        $style = file_get_contents($dir . '/style.json', true);
        $style = (array)json_decode($style);
        foreach ($style as $key => $value) {
            self::$css[$key] = $value;
        }

        self::$start = true;

    }

    /**
     * @param string $name
     */
    public function __construct($name)
    {
        if (!self::$start)
            self::bootstrap();
        $this->handler = new ViewHandler();
        $this->handler->setTemplate($name);
    }

    /**
     * @return ViewHandler
     */
    public function getHandler()
    {
        return $this->handler;
    }

    /**
     * @param string $lib
     */
    public function addComponent($lib)
    {
        if (array_key_exists($lib, self::$css) && !array_key_exists($lib, $this->style)) {
            $this->style[$lib] = self::$css[$lib]['url'];
            if (array_key_exists('require', self::$css[$lib]))
                foreach (self::$css['require'] as $requirement)
                    $this->addComponent($requirement);
        }

        if (array_key_exists($lib, self::$js) && !array_key_exists($lib, $this->script)) {
            $this->script[$lib] = self::$js[$lib]['url'];
            if (array_key_exists('require', self::$js[$lib]))
                foreach (self::$js['require'] as $requirement)
                    $this->addComponent($requirement);
        }
    }

    /**
     * @param string $lib
     */
    public function removeComponent($lib)
    {
        if (array_key_exists($lib, $this->script)) {
            unset($this->script[$lib]);
            if (array_key_exists('require', self::$js[$lib]))
                foreach (self::$js['require'] as $require)
                    $this->removeComponent($require);
        }

        if (array_key_exists($lib, $this->style)) {
            unset($this->style[$lib]);
            if (array_key_exists('require', self::$css[$lib]))
                foreach (self::$css['require'] as $require)
                    $this->removeComponent($require);
        }
    }

    /**
     * @param string $name
     * @param mixed $value
     */
    public function setParameter($name, $value)
    {
        $this->handler->setParameter($name, $value);
    }

    /**
     * @param string $name
     */
    public function removeParameter($name)
    {
        $this->handler->removeParameter($name);
    }

    /**.
     * @return string
     */
    public function getDisplay()
    {
        $scripts = array();
        foreach ($this->script as $script) {
            $scripts = array_merge($scripts, $script);
        }
        $this->setParameter('scripts', $scripts);

        $styles = array();
        foreach ($this->style as $style) {
            $style = array_merge($styles, $style);
        }
        $this->setParameter('styles', $styles);

        return $this->handler->generate();
    }

}


text:
function [precision_score, recall_score] = ...
    precision_recall_values(Adjmat, correct_mat)

% PRECISION_RECALL_VALUES computes the precision and recall values for a
% given adjacency ADJMAT where CORRECT_INDS states the correct index pairs.
%
% INPUT: ADJMAT -- Adjaceny matrix
%        CORRECT_MAT -- Binary matrix of correct matches. We define that
%                       CORRECT_MAT(i,j) = 1 if i-th data point is matched
%                       to the j-th data point.
%
% OUTPUT: PRECISION_SCORE -- Precision score for ADJMAT given CORRECT_MAT
%         RECALL_SCORE -- Recall score for ADJMAT given CORRECT_MAT

A = Adjmat;
a = size(A,1);
num_matches_A = sum(sum(A));

CM = correct_mat;
num_matches_C = sum(sum(CM));

Found_CM_in_A = sum(sum(((A + CM) == 2)));

% Precision is number of matches in A and CI divided by number of matches
% in just A (see \cite{KK2007})
precision_score = Found_CM_in_A/num_matches_A;

% Recall is number of matches in A and CI divided by number of matches
% in just CI (see \cite{KK2007})
recall_score = Found_CM_in_A/num_matches_C;

redpajama_set_name: RedPajamaGithub


text:
#ifndef HCT_HANDLE_UTILS_H
#define HCT_HANDLE_UTILS_H

class hkLocalFrame;
class hkLocalFrameGroup;

template <class Key, class Value, typename Allocator> class hkPointerMap;
template <typename Value, typename Allocator> class hkStringMap;

	/// Utilities for constructing local frames.
class hctLocalFrameUtils
{
	public:

			/// Create a hierarchy of local frames for a node.
		static hkLocalFrame* createLocalFrames(	const class hkxNode* node,
												const hkxScene* scene,
												bool isRoot,
												hkPointerMap<const hkxNode*,int>* ignoreNodes,
												hkStringMap<hkLocalFrameGroup*, hkContainerHeapAllocator>& createdGroups );
};

#endif

/*
 * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
 *
 * Confidential Information of Havok.  (C) Copyright 1999-2014
 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
 * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
 * rights, and intellectual property rights in the Havok software remain in
 * Havok and/or its suppliers.
 *
 * Use of this software for evaluation purposes is subject to and indicates
 * acceptance of the End User licence Agreement for this product. A copy of
 * the license is included with this software and is also available at www.havok.com/tryhavok.
 *
 */


text:
package org.springframework.boot.autoconfigure.jms.activemq;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Tests for {@link ActiveMQProperties} and ActiveMQConnectionFactoryFactory.
 *
 * @author Stephane Nicoll
 */
public class ActiveMQPropertiesTests {

	private static final String DEFAULT_EMBEDDED_BROKER_URL = "vm://localhost?broker.persistent=false";

	private static final String DEFAULT_NETWORK_BROKER_URL = "tcp://localhost:61616";

	private final ActiveMQProperties properties = new ActiveMQProperties();

	@Test
	public void getBrokerUrlIsInMemoryByDefault() {
		assertEquals(DEFAULT_EMBEDDED_BROKER_URL,
				new ActiveMQConnectionFactoryFactory(this.properties)
						.determineBrokerUrl());
	}

	@Test
	public void getBrokerUrlUseExplicitBrokerUrl() {
		this.properties.setBrokerUrl("vm://foo-bar");
		assertEquals("vm://foo-bar", new ActiveMQConnectionFactoryFactory(this.properties)
				.determineBrokerUrl());
	}

	@Test
	public void getBrokerUrlWithInMemorySetToFalse() {
		this.properties.setInMemory(false);
		assertEquals(DEFAULT_NETWORK_BROKER_URL,
				new ActiveMQConnectionFactoryFactory(this.properties)
						.determineBrokerUrl());
	}

	@Test
	public void getExplicitBrokerUrlAlwaysWins() {
		this.properties.setBrokerUrl("vm://foo-bar");
		this.properties.setInMemory(false);
		assertEquals("vm://foo-bar", new ActiveMQConnectionFactoryFactory(this.properties)
				.determineBrokerUrl());
	}

}


text:
import os
import warehouse
from jinja2 import Environment, FileSystemLoader

def test_templates_for_empty_titles():
    """
        Test if all HTML templates have defined the title block. See
        https://github.com/pypa/warehouse/issues/784
    """
    dir_name = os.path.join(os.path.dirname(warehouse.__file__), 'templates')

    env = Environment(
        loader=FileSystemLoader(dir_name),
        extensions=[],
        cache_size=0,
    )

    env.filters.update({
        "format_date": "warehouse.i18n.filters:format_date",
        "format_datetime": "warehouse.i18n.filters:format_datetime",
        "format_rfc822_datetime":
            "warehouse.i18n.filters:format_rfc822_datetime",
        "format_tags": "warehouse.filters:format_tags",
        "json": "warehouse.filters:tojson",
        "readme": "warehouse.filters:readme",
        "shorten_number": "warehouse.filters:shorten_number",
        "urlparse": "warehouse.filters:urlparse",
    })

    for dir_, _, files in os.walk(dir_name):
        if dir_.find("/includes") > -1 or \
           dir_.find("/legacy") > -1:
            continue

        for file_name in files:
            if file_name.endswith(".html"):
                rel_dir = os.path.relpath(dir_, dir_name)
                rel_file = os.path.join(rel_dir, file_name)
                template = env.get_template(rel_file)
                assert 'title' in template.blocks


text:
function uiUser(ctx, page) {
  main(ctx, page, "uiUser");
  uiUserEventHandlers(ctx, page, page.r);
  uiUserRefresh(ctx, page);
}

function uiUserRefresh(ctx, page, ident) {
  var obj = findObjByNameOrIdent(ctx, "user", ident || page.ident) || page.obj;
  renderObj(ctx, page.r, obj, {
    users: _.sortBy(instances(ctx, "user"), "name")
  });
}

function uiUserEventHandlers(ctx, page, r) {
  r.on({
    "newUser": newNamedObjEventHandler(ctx, page, "user", uiUserRefresh,
                                       [ ["roles", function(s) {
                                             return _.compact(s.split(','));
                                           }] ])
  });
}


text:
extern crate coherence_lib as lib;
use lib::*;
use std::rc::Rc;

struct Local;

impl<T> Remote1<T> for Local {}

fn main() {}


text:
#pragma once

#include <QHash>
#include <QCryptographicHash>
#include "model3d.hh"

namespace clockwork {
namespace system {

class ResourceManager : public QObject
{
friend class Services;
public:
   /**
    * Load, store and return a 3D model from a given file. The 3D model is stored
    * in the resource dictionary which makes sure only a single instance of the
    * same 3D model is created in memory.
    * @param filename the name of the file containing the 3D model to load.
    */
   const clockwork::graphics::Model3D* loadModel3D(const QString& filename);
private:
   /**
    * The file hash generator.
    */
   QCryptographicHash _hashGenerator;
   /**
    * The resource dictionary where each resource is identified by its
    * cryptographic hash (stored in the form of a string).
    */
   QHash<const QString, clockwork::system::Resource*> _resources;
   /**
    * The ResourceManager is a singleton object so only a single instance of this
    * class should be created. To prevent copying and accidental instantiation,
    * the constructor is hidden (accessible only by the Services class),
    * and its copy constructor and operator are deleted.
    */
   ResourceManager();
   ResourceManager(const ResourceManager&) = delete;
   ResourceManager& operator=(const ResourceManager&) = delete;
};

} // namespace system
} // namespace clockwork


text:
id: 305
title: 'The Co-Creative Cloud Platform – Colayla'
date: 2011-06-03T16:45:46+00:00
author: Omkar
layout: post
guid: http://www.omkarslab.co.cc/?p=305
permalink: /2011/06/03/the-co-creative-cloud-platform-colayla/
sfw_comment_form_password:
  - DPImrEQrhxb3
sfw_pwd:
  - yDjR3Cmm0tlo
categories:
  - Cloud
  - Developer
  - Internet
  - Web Reviews
tags:
  - Cloud
  - Cloud
  - colayer
  - Colayla
  - collaboration
  - Computing
  - PaaS
  - Real-time
  - Start-ups
---
It has been long since I have written anything up here, but this is something that could not stay in the drafts for long now. As I have mentioned earlier, 'Cloud' has been a buzz word in the IT sector for long time now. Taking your apps on the Cloud is the right thing to do! Apparently that does take most of the IT Pro burden off the shoulders of us 'Developers'.

I did a post last year about Colayer, a ‘real real-time’ platform that lets you work with your colleagues collaboratively. The creators of Colayer have come up with an exciting new Cloud Platform that compliments the real-time capabilities of Colayer. The new Cloud Platform code named ‘Davos’ lets you develop your own applications on it. Your applications need not be intended for collaboration, still it would work just fine.

Follower Rate, a Twitter analytic service is created on Davos. Here are a few videos released by Markus Hegi, Founder of Colayer introducing Davos, and Colayer’s very own development language ‘Colayla’. If you are reluctant learning a new language to begin your application with, I’m with you. Colayla is nothing new. Infact it is one of the mostly widely used languages by Web Developers, right after HTML. Yes, Javascript! Colayla is based on Google’s V8 Javascript Engine: So when you write an application for Davos, you just need to know Javascripting. Easy right?

The three videos show 3 major new developments for Colayer Davos:

**1. Hello Co-creative World!**

It is a ‘true PaaS’: There is no set-up, no care about virtual machines, databases or processors. You write your code & run it – thats it!

**2. Just Use It!**

The use-it concept is, how Colayer sees the future of software reusability and open source: no downloads of code, no installation – all that happens by the Davos Cloud. You find something exciting on the web, and simply ‘use-it’ for your solution!

**3. Twitter Sign-in**

The web gets social & identities get connected. Websites are no isolated islands anymore. if you browse on different sites, you want to take your (FB, Twitter etc) identity with you. The new standard will be, that you have one single or just a few logins & use them on all your sites.

I did work on a small collaborative application for Davos which we hope to see live shortly. Here’s why I’m excited about Davos –

  * Write your application using a language as simple as the Javascript.
  * Your application resides on a platform specifically designed for real-time use cases.
  * You write your code on Davos itself. No SDK, no deployment process. Write and Save. How fast could your deployment process get?
  * If you are wondering about database, storage, etc. Davos is the total package. You just write your code and forget. That’s what the Platform as a Service (PaaS) is supposed to be right?

Do post your views and comments. 🙂

Related Links:

Colayer

 Colayla (Constantly under development – Accessible with your Twitter account)

Follow on Twitter:

 @Colayer @Colayla

Facebook: http://facebook.com/Colayer


text:
<?php
namespace Cerad\Bundle\GameBundle\Controller\ProjectGames\GameSchedule;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use Symfony\Component\HttpFoundation\Request;

class GameScheduleListController extends Controller
{
    const SessionSearch = 'ProjectGamesGameScheduleSearch';

    public function listAction(Request $request, GameScheduleListModel $model)
    {
/*
        // The form stuff
        $searchFormType = $this->get('cerad_game.game_schedule_search.form_type');
        $searchForm = $this->createForm($searchFormType,$model);

        $searchForm->handleRequest($request);

        if ($searchForm->isValid()) // GET Request
        {
            $modelPosted = $searchForm->getData();

            $request->getSession()->set(self::SESSION_GAME_SCHEDULE_SEARCH,$modelPosted);

            return $this->redirect($this->generateUrl('cerad_game_schedule'));
        }
*/
        // Query for the games
        $gameRepo = $this->get('cerad_game.game_repository');
        $games = $gameRepo->queryGameSchedule($model->criteria);

        // And render
        $tplData = array();
      //$tplData['searchForm'] = $searchForm->createView();
        $tplData['games'] = $games;
        return $this->render($request->get('_template'),$tplData);
    }
    public function createModel(Request $request)
    {
        // Build the search parameter information
        $model = array();

        $model['project'] = $project = $request->attributes->get('project');

        $criteria = array();

        $criteria['projectKeys'] = array($project->getKey());

        $criteria['levels']  = array();
        $criteria['teams' ]  = array();
        $criteria['fields']  = array();

        $projectRole = $project->getRole();
        if ($projectRole == 'tournament')
        {
          //$criteria['dates'] = $project->getDates();
        }
        $model['criteria'] = $criteria;

        return $model;

        // Merge form session
        $session = $request->getSession();
        if ($session->has(self::SESSION_GAME_SCHEDULE_SEARCH))
        {
            $modelSession = $session->get(self::SESSION_GAME_SCHEDULE_SEARCH);
            $model = array_merge($model,$modelSession);
        }

        // Add in project and level ids
        $levelRepo   = $this->get('cerad_level.level_repository');
        $projectRepo = $this->get('cerad_project.project_repository');

        $model['levelKeys'  ] = $levelRepo->queryLevelKeys    ($model);
        $model['projectKeys'] = $projectRepo->queryProjectKeys($model);

        // Done
        return $model;
    }
}


text:
function rois = norm_rois(rois,roiTypes,xVal,yVal)
%norm_rois  Test or normalizes ROIs to a given image size in pixels.
%
%   ROIS = norm_rois(ROIS,TYPE,X,Y) normalizes all ROIs in the cell array ROIS,
%   where ROIs are specifeid either by an n-by-2 array giving the x-y coordinate
%   pairs, respectively, or an imrect/imellipse position vector:
%
%       [xmin ymin width height]
%
%
%   tf = norm_rois(ROIS) determines if any of the ROI coordinates are greater
%   than 1 (i.e. not normalzied).

if nargin == 4
    rois = cellfun(@normfcnx,rois,roiTypes,'UniformOutput',false);
    rois = cellfun(@normfcny,rois,roiTypes,'UniformOutput',false);
else
    rois = all(cellfun(@isnormfcn,rois));
end

    % Function used with cellfun
    function x = normfcnx(x,x_type)

        if iscell(x)
            x = cellfun(@normfcnx,x,x_type,'UniformOutput',false);
            return
        elseif isempty(x)
            return
        end

        switch x_type
            case {'imellipse','imrect'}
                x(1:2:end) = x(1:2:end)/xVal;
            case {'imspline','impoly'}
                x(:,1) = x(:,1)/xVal;
        end

    end

    % Function used with cellfun
    function x = normfcny(x,x_type)

        if iscell(x)
            x = cellfun(@normfcny,x,x_type,'UniformOutput',false);
            return
        elseif isempty(x)
            return
        end

        switch x_type
            case {'imellipse','imrect'}
                x(2:2:end) = x(2:2:end)/yVal;
            case {'imspline','impoly'}
                x(:,2) = x(:,2)/yVal;
        end

    end

    % Function used with cellfun
    function tf = isnormfcn(x)
        if iscell(x)
            tf = cellfun(@isnormfcn,x);
            tf_emp = cellfun(@isempty,x);
            tf = all(tf(~tf_emp));
            return
        end

        tf = all(x(:)<=1);
    end

end


text:
"""
Permission classes for authentication.
"""
from aiorest_ws.abstract import AbstractPermission

__all__ = ('IsAuthenticated', )

class IsAuthenticated(AbstractPermission):
    """
    Permissions used for checking authenticated users.
    """
    @staticmethod
    def check(request, handler):
        """
        Check permission method.

        :param request: instance of Request class.
        :param handler: view, invoked later for the request.
        """
        return request.user and request.user.is_authenticated()


text:
branch=$1
git checkout -b $branch --track
git push origin $branch


text:
'use strict';

import test from 'tape';
import * as get from '../get';

test('DOM className test', (t) => {
  t.plan(1);
  const testNodes = get.className('test');
  const rootNode = get.css('html');
  const rootNodeAll = get.cssAll('html');
  console.log('root node: ', rootNode);
  console.log('root node all: ', rootNodeAll);
  console.log(typeof testNodes, testNodes);
  t.is(typeof testNodes, 'object', 'gets .test class');

});


text:
package org.jbpm.workbench.pr.client.editors.instance.signal;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.Dependent;
import javax.enterprise.event.Event;
import javax.inject.Inject;

import com.google.gwt.core.client.GWT;
import org.jboss.errai.common.client.api.Caller;
import org.jboss.errai.common.client.api.RemoteCallback;
import org.jbpm.workbench.pr.client.resources.i18n.Constants;
import org.jbpm.workbench.pr.events.ProcessInstancesUpdateEvent;
import org.jbpm.workbench.pr.service.ProcessService;
import org.uberfire.client.annotations.WorkbenchPartTitle;
import org.uberfire.client.annotations.WorkbenchPartView;
import org.uberfire.client.annotations.WorkbenchPopup;
import org.uberfire.client.mvp.PlaceManager;
import org.uberfire.client.mvp.UberView;
import org.uberfire.lifecycle.OnOpen;
import org.uberfire.lifecycle.OnStartup;
import org.uberfire.mvp.PlaceRequest;

@Dependent
@WorkbenchPopup(identifier = ProcessInstanceSignalPresenter.SIGNAL_PROCESS_POPUP)
public class ProcessInstanceSignalPresenter {

    public static final String SIGNAL_PROCESS_POPUP = "Signal Process Popup";

    private Constants constants = GWT.create(Constants.class);

    @Inject
    private PopupView view;

    @Inject
    private PlaceManager placeManager;

    @Inject
    private Event<ProcessInstancesUpdateEvent> processInstancesUpdatedEvent;

    private PlaceRequest place;

    @Inject
    private Caller<ProcessService> processService;

    private String serverTemplateId;

    private String[] deploymentId;

    @PostConstruct
    public void init() {

    }

    @OnStartup
    public void onStartup(final PlaceRequest place) {
        this.place = place;
    }

    @WorkbenchPartTitle
    public String getTitle() {
        return constants.Signaling_Process_Instance();
    }

    @WorkbenchPartView
    public UberView<ProcessInstanceSignalPresenter> getView() {
        return view;
    }

    public void signalProcessInstances(List<Long> processInstanceIds) {
        processService.call(
                new RemoteCallback<Void>() {
                    @Override
                    public void callback(Void v) {
                        processInstancesUpdatedEvent.fire(new ProcessInstancesUpdateEvent(0L));
                        placeManager.closePlace(place);
                    }
                }
        ).signalProcessInstances(serverTemplateId,
                                 Arrays.asList(deploymentId),
                                 processInstanceIds,
                                 view.getSignalRefText(),
                                 view.getEventText());
    }

    @OnOpen
    public void onOpen() {
        serverTemplateId = place.getParameter("serverTemplateId",
                                              "").toString();
        deploymentId = place.getParameter("deploymentId",
                                          "").toString().split(",");
        String processInstanceIds = place.getParameter("processInstanceId",
                                                       "-1").toString();
        String[] ids = processInstanceIds.split(",");
        for (String id : ids) {
            long processInstanceId = Long.parseLong(id);
            view.addProcessInstanceId(processInstanceId);
        }

        // for single process instance load available signals
        if (ids.length == 1 && Long.parseLong(ids[0]) != -1) {
            getAvailableSignals(Long.parseLong(ids[0]));
        }
    }

    public void getAvailableSignals(long processInstanceId) {
        processService.call(
                new RemoteCallback<Collection<String>>() {
                    @Override
                    public void callback(Collection<String> signals) {
                        view.setAvailableSignals(signals);
                    }
                }
        ).getAvailableSignals(serverTemplateId,
                              deploymentId[0],
                              processInstanceId);
    }

    public interface PopupView extends UberView<ProcessInstanceSignalPresenter> {

        void displayNotification(String text);

        void addProcessInstanceId(long processInstanceId);

        String getSignalRefText();

        String getEventText();

        void setAvailableSignals(Collection<String> signals);
    }
}


text:
<?php

/**
 *
 * @author RUGENTO
 */
class Rugento_Multistock_Block_Adminhtml_Stock_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{

    /*
     * (non-PHPdoc)
     * @see Mage_Adminhtml_Block_Widget_Form::_prepareForm()
     */
    protected function _prepareForm()
    {
        $stockId = '';
        if ($this->getRequest()->getActionName() == 'edit') {
            $stockId = array(
                'stock_id' => $this->getRequest()->getParam('stock_id')
            );
        }
        $form = new Varien_Data_Form(array(
            'id'        => 'edit_form',
            'action'    => $this->getUrl('*/*/save', $stockId),
            'method'    => 'post',
            'enctype'   => 'multipart/form-data'
        ));
        $form->setUseContainer(true);
        $this->setForm($form);
        return parent::_prepareForm();
    }
}


text:
@interface IFNashvilleFilter : IFImageFilter

@end


text:
package xworker.lang.actions.types;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.CopyOnWriteArrayList;

import org.xmeta.ActionContext;
import org.xmeta.Thing;

import xworker.util.MultiKeyMap;

public class TypesActions {
	public static List<Object> createList(ActionContext actionContext){
		Thing self = actionContext.getObject("self");

		String type = self.doAction("getType", actionContext);
		List<Object> list = null;
		if("CopyOnWriteArrayList".equals(type)) {
			list = new CopyOnWriteArrayList<Object>();
		}else if("LinkedList".equals(type)) {
			list = new LinkedList<Object>();
		}else {
			list = new ArrayList<Object>();
		}

		for(Thing child : self.getChilds()) {
			list.add(child.getAction().run(actionContext));
		}

		return list;
	}

	public static Map<String, Object> createMap(ActionContext actionContext){
		Thing self = actionContext.getObject("self");

		String type = self.doAction("getType", actionContext);
		Map<String, Object> map = null;
		if("ConcurrentHashMap".equals(type)) {
			map = new ConcurrentHashMap<String, Object>();
		}else if("ConcurrentSkipListMap".equals(type)) {
			map = new ConcurrentSkipListMap<String, Object>();
		}else if("LinkedHashMap".equals(type)) {
			map = new LinkedHashMap<String, Object>();
		}else if("TreeMap".equals(type)) {
			map = new TreeMap<String, Object>();
		}else {
			map = new HashMap<String, Object>();
		}

		for(Thing child : self.getChilds()) {
			String key = child.getMetadata().getName();
			Object value = child.getAction().run(actionContext);
			map.put(key, value);
		}

		return map;
	}

	public static MultiKeyMap createMultiKeyMap(ActionContext actionContext) {
		return new MultiKeyMap();
	}
}


text:
package config

import (
	"encoding/json"
	"io/ioutil"
	"os"
)

func createTempFileByKeyAndEmail(key, email string) (string, error) {
	credJsonBody, err := credsFile{
		PrivateKey:  key,
		ClientEmail: email,
	}.serviceAccountJson()
	if err != nil {
		return "", err
	}
	return createTempFile(credJsonBody)
}

func createTempFile(jsonBody string) (string, error) {
	tempDir := os.TempDir()
	f, err := ioutil.TempFile(tempDir, "google-api-go-wrapper.json.")
	if err != nil {
		return "", err
	}

	_, err = f.Write([]byte(jsonBody))
	return f.Name(), err
}

type credsFile struct {
	Type        string `json:"type"`
	PrivateKey  string `json:"private_key"`
	ClientEmail string `json:"client_email"`
}

func (c credsFile) serviceAccountJson() (string, error) {
	c.Type = "service_account"
	byt, err := json.Marshal(c)
	return string(byt), err
}


text:
/* $Id: IFilenet.java 988245 2010-08-23 18:39:35Z kwright $ */

/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.manifoldcf.crawler.common.filenet;

import java.rmi.*;
import java.util.*;

/** This class abstracts away from the filenet methods necessary to "do things" that
* the crawler or authority needs to be done with the Filenet repository.  The purpose for breaking this
* out is to permit the Filenet invocation to be RMI based, because it relies
* on too many specific versions of jars.
*
* One of the tricks needed is to preserve session.  This is handled at this level by explicitly passing a
* session string around.  The session string is created on the remote JVM, and is subsequently used to describe
* the individual session we care about from the client side.
*/
public interface IFilenet extends Remote
{
  public static final String _rcsid = "@(#)$Id: IFilenet.java 988245 2010-08-23 18:39:35Z kwright $";

  /** Create a session.
  *@param userID is the userID to use to establish the session.
  *@param password is the password to use to establish the session.
  *@param domain is the filenet domain of the user and password.
  *@param objectStore is the object store to use to establish the session.
  *@param serverWSIURI is the URI to use to get to the server's web services.
  */
  public void createSession(String userID, String password, String domain, String objectStore, String serverWSIURI)
    throws FilenetException, RemoteException;

  /** Delete a session.
  */
  public void destroySession()
    throws FilenetException, RemoteException;

  /** Check if there is a working connection.
  */
  public void checkConnection()
    throws FilenetException, RemoteException;

  /** Get the set of folder names that are children of the specified folder path. */
  public String[] getChildFolders(String[] parentFolderPath)
    throws FilenetException, RemoteException;

  /** Get the set of available document classes
  */
  public DocumentClassDefinition[] getDocumentClassesDetails()
    throws FilenetException, RemoteException;

  /** Get the set of available metadata fields per document class
  */
  public MetadataFieldDefinition[] getDocumentClassMetadataFieldsDetails(String documentClassName)
    throws FilenetException, RemoteException;

  /** Execute a sql statement against FileNet and return the matching object id's */
  public String[] getMatchingObjectIds(String sql)
    throws RemoteException, FilenetException;

  /** Get the document content information given an object id.  Will return null if the version id is not a current document version id. */
  public Integer getDocumentContentCount(String docId)
    throws RemoteException, FilenetException;

  /** Get document information for a given filenet document.  Will return null if the version id is not a current document version id.
  * The metadataFields hashmap is keyed by document class, and contains as a value either null (meaning "all"), or a String[] that has the
  * list of fields desired. */
  public FileInfo getDocumentInformation(String docId, Map<String,Object> metadataFields)
    throws FilenetException, RemoteException;

  /** Get document contents */
  public void getDocumentContents(String docId, int elementNumber, String tempFileName)
    throws FilenetException, RemoteException;

}


text:
  extern "C" { int EIGEN_BLAS_FUNC(FUNC) ARGLIST; }   \
  int EIGEN_BLAS_FUNC(FUNC) ARGLIST

typedef Eigen::Map<Eigen::Transpositions<Eigen::Dynamic,Eigen::Dynamic,int> > PivotsType;

#if ISCOMPLEX
#define EIGEN_LAPACK_ARG_IF_COMPLEX(X) X,
#else
#define EIGEN_LAPACK_ARG_IF_COMPLEX(X)
#endif

#endif // EIGEN_LAPACK_COMMON_H


text:
import argparse
import logging
import os
import subprocess
import sys
import time

import gerritlib.gerrit
from oslo.config import cfg

BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
                                       "../"))

gerrit_opts = [
    cfg.StrOpt('host', help='Gerrit host.'),
    cfg.IntOpt('port', default=29418,
               help='Gerrit Port.'),
    cfg.StrOpt('username', default="",
               help='Username to connect to.'),
    cfg.StrOpt('key_file', default="",
               help='Private Key path.')
]
general_opts = [
    cfg.StrOpt('run_script', default="",
               help=('Script to spawn.')),
    cfg.ListOpt('watched_projects', default=[],
                help='Username to connect to.'),
    cfg.BoolOpt('voting_jobs', default=False,
                help='Wether to vote back the result.'),
    cfg.StrOpt('recheck_word', default="recheck",
               help='Recheck words to rekick the test.'),
    cfg.StrOpt('http_server', default="",
               help='HTTP server address to expose the link to.'),
    cfg.StrOpt('static_dir', default="",
               help='Directory where to store the logs.')
]

cli_opts = [
    cfg.BoolOpt('debug',
                short='d',
                default=False,
                help='Print more verbose output.'),
]

def list_opts():
    return [('general', general_opts),
            ('gerrit', gerrit_opts)]

CONF = cfg.CONF
cfg.CONF.register_opts(general_opts, group='general')
cfg.CONF.register_opts(gerrit_opts, group='gerrit')
cfg.CONF.register_cli_opts(cli_opts, group='cli')

class GrigriBot(object):
    def __init__(self):
        self.gerrit = None
        self.log = logging.getLogger('bottine')
        self.server = CONF.gerrit.host
        self.port = CONF.gerrit.port
        self.username = CONF.gerrit.username
        self.static_dir = CONF.general.static_dir
        self.http_server = CONF.general.http_server
        self.keyfile = os.path.expanduser(CONF.gerrit.key_file)
        self.run_script = os.path.expanduser(
            CONF.general.run_script)
        self.connected = False
        self.watched_projects = CONF.general.watched_projects
        self.recheck_word = CONF.general.recheck_word
        self.voting_jobs = CONF.general.voting_jobs

    def connect(self):
        # Import here because it needs to happen after daemonization
        try:
            self.gerrit = gerritlib.gerrit.Gerrit(
                self.server, self.username, self.port, self.keyfile)
            self.gerrit.startWatching()
            self.log.info('Start watching Gerrit event stream.')
            self.connected = True
        except Exception:
            self.log.exception('Exception while connecting to gerrit')
            self.connected = False
            # Delay before attempting again.
            time.sleep(1)

    def run_command(self, data):
        output_dir = "%s/%s/%s" % (self.static_dir,
                                   data['change']['number'],
                                   data['patchSet']['number'])

        if not os.path.exists(output_dir):
            os.makedirs(output_dir)

        env = {'CHANGE_ID': data['change']['number'],
               'LOG_DIR': output_dir,
               'REF_ID': data['patchSet']['ref'],
               'AUTHOR': data['patchSet']['author']['email']}
        ret = subprocess.call([self.run_script], env=env, shell=True)
        self.log.info("script: %s has exited with return value of %s",
                      self.run_script, ret)

        if ret != 0:
            rets = "FAILED"
            retvote = '-1'
        else:
            rets = "SUCCESS"
            retvote = '+1'

        url = "%s/%s/%s/console.log" % (
            self.http_server, data['change']['number'],
            data['patchSet']['number'])

        if self.voting_jobs:
            self.gerrit.review(data['change']['project'],
                               "%s,%s" % (data['change']['number'],
                                          data['patchSet']['number']),
                               "run_tests.sh: %s: %s" % (rets, url),
                               action={'verified': retvote},)

    def _read(self, data):
        if 'change' not in data:
            return

        check = False
        if (data['type'] == 'comment-added' and
                data['comment'].endswith('\n' + self.recheck_word)):
            check = True
        elif data['type'] == 'patchset-created':
            check = True

        if data['change']['project'] not in self.watched_projects:
            check = False

        if check:
            self.log.info('Receiving event notification: %r' % data)
            self.run_command(data)

    def run(self):
        while True:
            while not self.connected:
                self.connect()
            try:
                event = self.gerrit.getEvent()
                self.log.debug('Received event: %s' % event)
                self._read(event)
            except Exception:
                self.log.exception('Exception encountered in event loop')
                if not self.gerrit.watcher_thread.is_alive():
                    # Start new gerrit connection. Don't need to restart IRC
                    # bot, it will reconnect on its own.
                    self.connected = False

def main():
    if os.path.exists("%s/etc/grigribot.ini" % BASEDIR):
        default_config_file = "%s/etc/grigribot.ini" % BASEDIR
    else:
        default_config_file = "/etc/grigribot/grigribot.conf"

    CONF(default_config_files=[default_config_file])
    logging_level = CONF.cli.debug and logging.DEBUG or logging.INFO
    logging.basicConfig(level=logging_level)

    k = GrigriBot()
    k.run()

if __name__ == '__main__':
    main()


text:
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2022, OpenNebula Project, OpenNebula Systems                */
/*                                                                            */
/* 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.                                             */
/* -------------------------------------------------------------------------- */

define(function(require) {
  /*
    DEPENDENCIES
   */

//  require('foundation.tab');
  var BaseFormPanel = require('utils/form-panels/form-panel');
  var Sunstone = require('sunstone');
  var Locale = require('utils/locale');
  var VCenterNetworks = require('utils/vcenter/networks');
  var HostsTable = require('tabs/hosts-tab/datatable');
  var UniqueId = require('utils/unique-id');
  var Notifier = require('utils/notifier');

  /*
    TEMPLATES
   */

  var TemplateHTML = require('hbs!./import/html');

  /*
    CONSTANTS
   */

  var FORM_PANEL_ID = require('./import/formPanelId');
  var TAB_ID = require('../tabId');

  /*
    CONSTRUCTOR
   */

  function FormPanel() {
    this.formPanelId = FORM_PANEL_ID;
    this.tabId = TAB_ID;
    this.actions = {
      'import': {
        'title': Locale.tr("Import vCenter Networks"),
        'buttonText': Locale.tr("Import"),
        'resetButton': true
      }
    };

    this.vCenterNetworks = new VCenterNetworks();

    var options = {
      'select': true,
      'selectOptions': {
        'multiple_choice': false,
        "filter_fn": function(host) { return host.VM_MAD === "vcenter" && host.IM_MAD === "vcenter"; }
      }
    };
    this.hostsTable = new HostsTable('HostsTable' + UniqueId.id(), options);

    BaseFormPanel.call(this);
  }

  FormPanel.FORM_PANEL_ID = FORM_PANEL_ID;
  FormPanel.prototype = Object.create(BaseFormPanel.prototype);
  FormPanel.prototype.constructor = FormPanel;
  FormPanel.prototype.htmlWizard = _htmlWizard;
  FormPanel.prototype.submitWizard = _submitWizard;
  FormPanel.prototype.onShow = _onShow;
  FormPanel.prototype.setup = _setup;

  return FormPanel;

  /*
    FUNCTION DEFINITIONS
   */

  function _htmlWizard() {
    return TemplateHTML({
      'formPanelId': this.formPanelId,
      'vCenterHostsHTML': this.hostsTable.dataTableHTML,
      'vCenterNetworksHTML': this.vCenterNetworks.html()
    });
  }

  function _setup(context) {
    var that = this;
    this.hostsTable.initialize();
    this.hostsTable.refreshResourceTableSelect();

    $(context).off("click", "#get-vcenter-networks");
    $(context).on("click", "#get-vcenter-networks", function(){
      var selectedHost = that.hostsTable.retrieveResourceTableSelect();
      if (selectedHost !== ""){
        that.vCenterNetworks.insert({
          container: context,
          selectedHost: selectedHost
        });
        $("#import_vcenter_networks", this.parentElement).prop("disabled", false);
      }
      else {
        Notifier.notifyMessage("You need select a vCenter host first");
      }
    });

    $(context).off("click", "#import_vcenter_networks");
    $(context).on("click", "#import_vcenter_networks", function(){
      that.vCenterNetworks.import(context);
      return false;
    });

    return false;
  }

  function _submitWizard(context) {
    var that = this;

    Sunstone.hideFormPanelLoading(TAB_ID);

    this.vCenterNetworks.import(context.closest("#import_networks_form_wrapper"));

    return false;
  }

  function _onShow(context) {
    $("#vnets-tab .submit_button").hide();
  }
});


text:
import Screen from './containers/DashboardContainer';

Screen.render();


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-supportlib-release/frameworks/support/v7/mediarouter/res/values-tl/strings.xml -->
    <eat-comment/>
    <string msgid="4271159405637008602" name="mr_media_route_button_content_description">"Output ng media"</string>
    <string msgid="7553005460920830010" name="mr_media_route_chooser_searching">"Naghahanap ng mga device…"</string>
    <string msgid="7106830097177242655" name="mr_media_route_chooser_title">"Kumonekta sa device"</string>
    <string msgid="109793632378378069" name="mr_media_route_controller_disconnect">"Idiskonekta"</string>
    <string msgid="5441529851481176817" name="mr_system_route_name">"System"</string>
    <string msgid="7498112907524977311" name="mr_user_route_category_name">"Mga Device"</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<hopsanobjectappearance version="0.3">
  <modelobject sourcecode="ActivityDiagramMerge.hpp" displayname="Merge" typename="ActivityDiagramMerge">
    <icons>
      <icon type="user" path="ActivityDiagramMerge.svg" scale="1" iconrotation="ON"/>
      <icon type="iso" path="ActivityDiagramMerge.svg" scale="1" iconrotation="ON"/>
    </icons>
    <help>
        <text>Activity diagram merge. CDF-player for Mathematica documents can be found on http://www.wolfram.com/cdf-player/</text>
        <link>ActivityDiagramMerge.nb</link>
    </help>
    <ports>
      <port enabled="true" x="0.2" y="0.38" autoplaced="true" name="event1" a="90"/>
      <port enabled="true" x="0.6" y="0.8" autoplaced="true" name="event2" a="180"/>
      <port enabled="true" x="0" y="0.305" autoplaced="true" name="Ppn1" a="0"/>
      <port enabled="true" x="0.69" y="1" autoplaced="true" name="Ppn2" a="90"/>
      <port enabled="true" x="1" y="0.305" autoplaced="true" name="Ppn3" a="180"/>
    </ports>
  </modelobject>
</hopsanobjectappearance>


text:
'use strict'

Entry.TvCast = function(tvCast) {
	this.generateView(tvCast);
}

var p = Entry.TvCast.prototype;

p.init = function(tvCastHash) {
	this.tvCastHash = tvCastHash;
}

p.generateView = function(tvCastHash) {
	var movieContainer = Entry.createElement('div');
    movieContainer.addClass('entryContainerMovieWorkspace');
    movieContainer.addClass('entryRemove');

    this.movieContainer = movieContainer;
    var view = this.movieContainer;

    var movieContainer = this.movieContainer;
    var iframe = Entry.createElement('iframe');
    iframe.setAttribute("id", "tvCastIframe");
    iframe.setAttribute('allowfullscreen', '');
    iframe.setAttribute('frameborder', 0);
    iframe.setAttribute('src', tvCastHash);
    this.movieFrame = iframe;

    this.movieContainer.appendChild(this.movieFrame);
}

p.getView = function () {
	return this.movieContainer;
}

p.resize = function() {
    var container = document.getElementById('entryContainerWorkspaceId');
    var iframe = document.getElementById('tvCastIframe');
    w = this.movieContainer.offsetWidth;
    iframe.width = w+'px';
    iframe.height = w*9/16 + 'px';
};


text:
<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Table(
 *     name="user_event_registration",
 *     uniqueConstraints={
 *         @ORM\UniqueConstraint(columns={"user_id", "event_id"})
 *     })
 *
 * @ORM\Entity(repositoryClass="App\Repository\UserEventRegistrationRepository")
 *
 * @UniqueEntity({"user", "event"})
 */
class UserEventRegistration implements UsedInterface, UserWithDateActionInterface
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTimeImmutable
     *
     * @ORM\Column(type="datetimetz_immutable")
     */
    private $createdAt;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="eventRegistrations")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
     *
     * @Assert\Type("App\Entity\User")
     */
    private $user;

    /**
     * @var Event
     *
     * @ORM\ManyToOne(targetEntity="App\Entity\Event")
     * @ORM\JoinColumn(name="event_id", referencedColumnName="id", onDelete="CASCADE")
     *
     * @Assert\Type("App\Entity\Event")
     */
    private $event;

    /**
     * @var bool
     *
     * @ORM\Column(type="boolean", options={"default":false})
     */
    private $used = false;

    /**
     * @param User                    $user
     * @param Event                   $event
     * @param \DateTimeInterface|null $date
     *
     * @throws \Exception
     */
    public function __construct(User $user, Event $event, ?\DateTimeInterface $date = null)
    {
        $this->user = $user;
        $this->event = $event;
        if ($date instanceof \DateTime) {
            $this->createdAt = \DateTimeImmutable::createFromMutable($date);
        } elseif ($date instanceof \DateTimeImmutable) {
            $this->createdAt = $date;
        } else {
            $this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Kiev'));
        }
    }

    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return User
     */
    public function getUser(): User
    {
        return $this->user;
    }

    /**
     * @return Event
     */
    public function getEvent(): Event
    {
        return $this->event;
    }

    /**
     * @return \DateTimeImmutable
     */
    public function getCreatedAt(): \DateTimeImmutable
    {
        return $this->createdAt;
    }

    /**
     * @param \DateTimeImmutable $createdAt
     *
     * @return $this
     */
    public function setCreatedAt(\DateTimeImmutable $createdAt): self
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * @return bool
     */
    public function isUsed(): bool
    {
        return $this->used;
    }

    /**
     * @param bool $used
     *
     * @return $this
     */
    public function setUsed(bool $used): self
    {
        $this->used = $used;

        return $this;
    }

    /**
     * @return \DateTimeInterface
     */
    public function getActionDate(): \DateTimeInterface
    {
        return $this->getCreatedAt();
    }
}


text:
import { Prompt } from 'react-router'
export default Prompt


text:
import * as React from 'react';
import { Image } from '..';
import { classes } from './ImageExtended.st.css';

export const ImagePerf = () => {
  return (
    <Image
      src="c5f754_dd75514d14fa4057b4f4a6cc8ce7add3~mv2.jpg"
      width={200}
      height={200}
      alt="Garfield smiles and puts his hand over chest"
      className={classes.root}
    />
  );
};


text:
package business.algorithm.predictAlgorithm;

import java.util.ArrayList;
import java.util.Date;
import java.util.TreeMap;

import JSci.maths.statistics.TDistribution;
import Jama.Matrix;
import Jama.SingularValueDecomposition;
import dataAccess.databaseManagement.entity.AssetEntity;
import dataAccess.databaseManagement.entity.PriceEntity;

public class AutoRegressionFE extends AbstractPredictAlgorithm {

	private ArrayList<double[]> cubicTrialFunctions = new ArrayList<double[]>();
	private Matrix coMatrix1; // coefficient matrix of linear system: phi(0)=?;
								// phi'(0)=?;phi(1)=?; phi'(1)=?
	private ArrayList<Double> parameterList = new ArrayList<Double>();

	// where phi() is a cubic functions, this is the linear system used for
	// finding phi()

	private void createTrialFunctions() {
		double[][] array = { { 1., 0., 0., 0. }, { 0., 1., 0., 0. },
				{ 1., 1., 1., 1. }, { 0., 1., 2., 3. } };
		coMatrix1 = new Matrix(array);
		Matrix b = new Matrix(4, 1);
		Matrix coTrialFunction;

		// find 4 trial cubic functions

		// first cubic
		b.set(0, 0, 1);
		b.set(1, 0, 0);
		b.set(2, 0, 0);
		b.set(3, 0, 0);
		coTrialFunction = coMatrix1.solve(b);
		cubicTrialFunctions.add(new double[4]);
		cubicTrialFunctions.get(0)[0] = coTrialFunction.get(0, 0);
		cubicTrialFunctions.get(0)[1] = coTrialFunction.get(1, 0);
		cubicTrialFunctions.get(0)[2] = coTrialFunction.get(2, 0);
		cubicTrialFunctions.get(0)[3] = coTrialFunction.get(3, 0);

		// second cubic
		b.set(0, 0, 0);
		b.set(1, 0, 1);
		b.set(2, 0, 0);
		b.set(3, 0, 0);
		coTrialFunction = coMatrix1.solve(b);
		cubicTrialFunctions.add(new double[4]);
		cubicTrialFunctions.get(1)[0] = coTrialFunction.get(0, 0);
		cubicTrialFunctions.get(1)[1] = coTrialFunction.get(1, 0);
		cubicTrialFunctions.get(1)[2] = coTrialFunction.get(2, 0);
		cubicTrialFunctions.get(1)[3] = coTrialFunction.get(3, 0);

		// third cubic
		b.set(0, 0, 0);
		b.set(1, 0, 0);
		b.set(2, 0, 1);
		b.set(3, 0, 0);
		coTrialFunction = coMatrix1.solve(b);
		cubicTrialFunctions.add(new double[4]);
		cubicTrialFunctions.get(2)[0] = coTrialFunction.get(0, 0);
		cubicTrialFunctions.get(2)[1] = coTrialFunction.get(1, 0);
		cubicTrialFunctions.get(2)[2] = coTrialFunction.get(2, 0);
		cubicTrialFunctions.get(2)[3] = coTrialFunction.get(3, 0);

		// fourth cubic
		b.set(0, 0, 0);
		b.set(1, 0, 0);
		b.set(2, 0, 0);
		b.set(3, 0, 1);
		coTrialFunction = coMatrix1.solve(b);
		cubicTrialFunctions.add(new double[4]);
		cubicTrialFunctions.get(3)[0] = coTrialFunction.get(0, 0);
		cubicTrialFunctions.get(3)[1] = coTrialFunction.get(1, 0);
		cubicTrialFunctions.get(3)[2] = coTrialFunction.get(2, 0);
		cubicTrialFunctions.get(3)[3] = coTrialFunction.get(3, 0);
	}

	public ArrayList<Double> finiteElementsStep() {
		createTrialFunctions();

		ArrayList<PriceEntity> priceEntityList = priceList.get(priceList.firstKey());

		ArrayList<Double> priceArrayList = Utility.convertPriceEntityListToPriceList(priceEntityList); // r(x)

		// approximate r'(x) (center)
		ArrayList<Double> firstDerivativeOfR = new ArrayList<Double>();
		firstDerivativeOfR.add(priceArrayList.get(1) - priceArrayList.get(0));
		for (int i = 1; i < priceArrayList.size() - 1; ++i) {
			firstDerivativeOfR.add((priceArrayList.get(i + 1) - priceArrayList
					.get(i - 1)) / 2);
		}
		firstDerivativeOfR.add(priceArrayList.get(priceArrayList.size() - 1)
				- priceArrayList.get(priceArrayList.size() - 2));

		// approximate -r''(x) (center)
		ArrayList<Double> secondDerivativeOfR = new ArrayList<Double>();
		secondDerivativeOfR.add(-firstDerivativeOfR.get(1)
				+ firstDerivativeOfR.get(0));
		for (int i = 1; i < firstDerivativeOfR.size() - 1; ++i) {
			secondDerivativeOfR
					.add((-firstDerivativeOfR.get(i + 1) + firstDerivativeOfR
							.get(i - 1)) / 2);
		}
		secondDerivativeOfR.add(-firstDerivativeOfR.get(firstDerivativeOfR
				.size() - 1)
				+ firstDerivativeOfR.get(firstDerivativeOfR.size() - 2));

		Matrix K = new Matrix(2 * secondDerivativeOfR.size(),
				2 * secondDerivativeOfR.size(), 0);
		Matrix F = new Matrix(2 * secondDerivativeOfR.size(), 1, 0);
		Matrix elementMatrix = new Matrix(4, 4);

		// calculate the element matrix
		for (int i = 0; i < 4; ++i) {
			for (int j = 0; j < 4; ++j) {
				double[] a1 = cubicTrialFunctions.get(i);
				double[] a2 = cubicTrialFunctions.get(j);
				double value = a1[1]
						* a2[1]
						+ (a1[1] * a2[2] + a1[2] * a2[1])
						+ (a1[1] * a2[3] + (4. / 3.) * a1[2] * a2[2] + a1[3]
								* a2[1]) + (6. / 4.)
						* (a1[2] * a2[3] + a1[3] * a2[2]) + (9. / 5.) * a1[3]
						* a2[3];

				elementMatrix.set(i, j, value);
			}
		}

		// calculate K matrices
		for (int i = 0; i < secondDerivativeOfR.size() - 1; ++i) {
			for (int j = 0; j < 4; ++j) {
				for (int k = 0; k < 4; ++k) {
					K.set(i * 2 + j, i * 2 + k, K.get(i * 2 + j, i * 2 + k)
							+ elementMatrix.get(j, k));
				}
			}
		}

		//calculate F matrices
		for (int i = 1; i < secondDerivativeOfR.size() - 1; ++i) {
			double area1 = cubicTrialFunctions.get(2)[0]
					+ cubicTrialFunctions.get(2)[1] / 2
					+ cubicTrialFunctions.get(2)[2] / 3
					+ cubicTrialFunctions.get(2)[3] / 4;
			double area2 = cubicTrialFunctions.get(0)[0]
					+ cubicTrialFunctions.get(0)[1] / 2
					+ cubicTrialFunctions.get(0)[2] / 3
					+ cubicTrialFunctions.get(0)[3] / 4;
			double value = ((secondDerivativeOfR.get(i - 1) + secondDerivativeOfR.get(i))/2) * area1
					+ ((secondDerivativeOfR.get(i)+secondDerivativeOfR.get(i + 1))/2) * area2;
			F.set(2 * i, 0, value);

			area1 = cubicTrialFunctions.get(3)[0]
					+ cubicTrialFunctions.get(3)[1] / 2
					+ cubicTrialFunctions.get(3)[2] / 3
					+ cubicTrialFunctions.get(3)[3] / 4;
			area2 = cubicTrialFunctions.get(1)[0]
					+ cubicTrialFunctions.get(1)[1] / 2
					+ cubicTrialFunctions.get(1)[2] / 3
					+ cubicTrialFunctions.get(1)[3] / 4;
			value = ((secondDerivativeOfR.get(i - 1) + secondDerivativeOfR.get(i))/2) * area1
					+ ((secondDerivativeOfR.get(i)+secondDerivativeOfR.get(i + 1))/2) * area2;
			F.set(2 * i + 1, 0, value);
		}

		// boundary conditions
		for (int i = 0; i < secondDerivativeOfR.size() * 2; i++) {
			K.set(0, i, 0);
			K.set(secondDerivativeOfR.size() * 2 - 2, i, 0);
		}
		K.set(0, 0, 1);
		K.set(secondDerivativeOfR.size() * 2 - 2,
				secondDerivativeOfR.size() * 2 - 2, 1);

		//
		F.set(0, 0, priceArrayList.get(0));
		double value = ((secondDerivativeOfR.get(0) + secondDerivativeOfR.get(1))/2)
				* (cubicTrialFunctions.get(3)[0]
						+ cubicTrialFunctions.get(3)[1] / 2
						+ cubicTrialFunctions.get(3)[2] / 3
						+ cubicTrialFunctions.get(3)[3] / 4);
		F.set(1, 0, value);
		F.set(secondDerivativeOfR.size() * 2 - 2, 0, priceArrayList.get(priceArrayList.size() - 1));
		value = ((secondDerivativeOfR.get(secondDerivativeOfR.size() - 2) + secondDerivativeOfR.get(secondDerivativeOfR.size() - 1))/2)
				* (cubicTrialFunctions.get(1)[0]
						+ cubicTrialFunctions.get(1)[1] / 2
						+ cubicTrialFunctions.get(1)[2] / 3
						+ cubicTrialFunctions.get(1)[3] / 4);
		F.set(secondDerivativeOfR.size() * 2 - 1, 0, value);

		// solve KU=F
		Matrix U = K.solve(F);

		ArrayList<Double> smootingCurve = new ArrayList<Double>();

		// training price
		for (int i = 0; i < priceEntityList.size(); ++i) {
			smootingCurve.add(U.get(i * 2, 0));
		}

		return smootingCurve;
	}

	private Double confidenceLevel;
	private Integer AR_period;

	public Double getConfidenceLevel() {
		return confidenceLevel;
	}

	public void setConfidenceLevel(Double confidenceLevel) {
		this.confidenceLevel = confidenceLevel;
	}

	public int getAR_period() {
		return AR_period;
	}

	public void setAR_period(Integer aR_period) {
		AR_period = aR_period;
	}

	@SuppressWarnings("rawtypes")
	@Override
	public TreeMap<String, Class> getParametersList() {
		// TODO Auto-generated method stub
		TreeMap<String, Class> map = super.getParametersList();
		map.put("Confidence level", Double.class);
		map.put("AR period", Integer.class);
		return map;
	}

	@Override
	public void setParametersValue(TreeMap<String, Object> map) {
		// TODO Auto-generated method stub
		super.setParametersValue(map);
		this.confidenceLevel = (Double) map.get("Confidence level");
		this.AR_period = (Integer) map.get("AR period");
	}

	public AutoRegressionFE(
			TreeMap<AssetEntity, ArrayList<PriceEntity>> priceList,
			Integer futureInterval, Double confidenceLevel, Integer MA_period,
			Integer AR_period) {
		super(priceList, futureInterval);
		this.confidenceLevel = confidenceLevel;
		this.AR_period = AR_period;
	}

	public AutoRegressionFE() {
		super(null, null);
		this.confidenceLevel = null;
		this.AR_period = null;
	}

	@Override
	public OutputForPredictionAlgorithm runAlgorithm() throws Exception {
		// TODO Auto-generated method stub
		AssetEntity asset = priceList.firstKey();
		ArrayList<PriceEntity> priceEntityList = priceList.get(priceList
				.firstKey());

		/*
		 * Finite Elements Step
		 */
		ArrayList<Double> smootingCurve = finiteElementsStep();

		/*
		 * Auto Regression step
		 */
		int nSmootingCurve = smootingCurve.size();

		if (nSmootingCurve - AR_period < 0)
			throw new Exception("There are too few samples");

		double[][] x = new double[nSmootingCurve - AR_period][AR_period + 1];
		double[] y = new double[nSmootingCurve - AR_period];
		for (int i = 0; i < (nSmootingCurve - AR_period); ++i) {
			for (int j = 0; j <= AR_period; ++j) {
				if (j != AR_period) {
					x[i][j] = smootingCurve.get(i + j);
				} else {
					x[i][j] = 1;
				}
			}
			y[i] = smootingCurve.get(i + AR_period);
		}
		Matrix matrixX = new Matrix(x);
		Matrix matrixY = new Matrix(y, nSmootingCurve - AR_period);
		Matrix matrixB = matrixX.transpose();
		matrixB = matrixB.times(matrixX);

		//matrixB = pseudo inverse of matrixB
		{
			SingularValueDecomposition svdMatrixB = matrixB.svd();
			Matrix pseudoInverseSigma = svdMatrixB.getS();
			int sizePseudoInverseSigma = Math.min(pseudoInverseSigma.getColumnDimension(), pseudoInverseSigma.getRowDimension());
			for (int i = 0; i < sizePseudoInverseSigma; ++i) {
				pseudoInverseSigma.set(i, i, 1/pseudoInverseSigma.get(i, i));
			}
			matrixB = (svdMatrixB.getV().times(pseudoInverseSigma)).times(svdMatrixB.getU().transpose());
		}

		matrixB = matrixB.times(matrixX.transpose());
		matrixB = matrixB.times(matrixY);

		parameterList.clear();
		for (int i = 0; i < matrixB.getRowDimension(); ++i) {
			parameterList.add(matrixB.get(i, 0));
		}

		ArrayList<Double> predictionPriceList = new ArrayList<Double>();
		for (int i = AR_period; i > 0; --i) {
			predictionPriceList
					.add(smootingCurve.get(smootingCurve.size() - i));
			parameterList.add(smootingCurve.get(smootingCurve.size() - i));
		}

		for (int i = 0; i < futureInterval; ++i) {
			Double temp = 0.0;
			for (int j = AR_period; j >= 0; --j) {
				if (j != 0) {
					temp += predictionPriceList.get(predictionPriceList.size()
							- j)
							* matrixB.get(AR_period - j, 0);
				} else {
					temp += matrixB.get(AR_period, 0);
				}
			}
			predictionPriceList.add(temp);
		}

		for (int i = AR_period; i > 0; --i) {
			predictionPriceList.remove(0);
		}

		predictionPriceList.add(0,
				priceEntityList.get(priceEntityList.size() - 1).getClose());

		Matrix matrixC = matrixX.transpose().times(matrixX);

		//matrixC = pseudo inverse of matrixC
		{
			SingularValueDecomposition svdMatrixC = matrixC.svd();
			Matrix pseudoInverseSigma = svdMatrixC.getS();
			int sizePseudoInverseSigma = Math.min(pseudoInverseSigma.getColumnDimension(), pseudoInverseSigma.getRowDimension());
			for (int i = 0; i < sizePseudoInverseSigma; ++i) {
				pseudoInverseSigma.set(i, i, 1/pseudoInverseSigma.get(i, i));
			}
			matrixC = (svdMatrixC.getV().times(pseudoInverseSigma)).times(svdMatrixC.getU().transpose());
		}

		Double variance = utility.Utility.variance(smootingCurve);
		Double s_b0 = Math.sqrt(variance * matrixC.get(0, 0));
		Double t;
		TDistribution tDistribution = new TDistribution(AR_period - 1);
		t = tDistribution.cumulative(1 - confidenceLevel);

		Double lambda = t * s_b0;

		/*
		 * TreeMap<AssetEntity, ArrayList<Double>> predictionPriceMap = new
		 * TreeMap<AssetEntity, ArrayList<Double>>();
		 * predictionPriceMap.put(asset, predictionPriceList); return new
		 * OutputForAutoRegression(predictionPriceMap, startPredictionDate,
		 * lambda);
		 */

		Date startPredictionDate = priceEntityList.get(
				priceEntityList.size() - 1).getDate();
		// startPredictionDate = new
		// java.sql.Date(utility.Utility.increaseDate(startPredictionDate).getTime());
		ArrayList<PriceEntry> priceEntryList = Utility.constructPriceList(
				asset, predictionPriceList, startPredictionDate);
		TreeMap<AssetEntity, ArrayList<PriceEntry>> predictionPriceMap = new TreeMap<AssetEntity, ArrayList<PriceEntry>>();
		predictionPriceMap.put(asset, priceEntryList);
		return new OutputForAutoRegression(predictionPriceMap, lambda);
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "Auto Regression (Finite Elements)";
	}

	public ArrayList<Double> getParameterList() {
		return parameterList;
	}

	public void setParameterList(ArrayList<Double> parameterList) {
		this.parameterList = parameterList;
	}

}


text:
find_path (Libgcrypt_INCLUDE_DIR NAMES gcrypt.h)

find_library (Libgcrypt_LIBRARY NAMES gcrypt)

include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Libgcrypt
				   REQUIRED_VARS
				   Libgcrypt_LIBRARY
				   Libgcrypt_INCLUDE_DIR)

mark_as_advanced (Libgcrypt_INCLUDE_DIR Libgcrypt_LIBRARY Libgcrypt_VERSION)

set (Libgcrypt_LIBRARIES ${Libgcrypt_LIBRARY})
set (Libgcrypt_INCLUDE_DIRS ${Libgcrypt_INCLUDE_DIR})

if (Libgcrypt_FOUND)
	# Try to compile and link a minimal sample program against libgcrypt
	try_compile (HAS_GCRYPT_4SURE ${CMAKE_BINARY_DIR} ${PROJECT_SOURCE_DIR}/src/plugins/crypto/compile_gcrypt.c
		     CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${Libgcrypt_INCLUDE_DIRS} -DLINK_LIBRARIES:PATH=${Libgcrypt_LIBRARIES})

	if (NOT HAS_GCRYPT_4SURE)
		message (STATUS "libgcrypt compile/linker test failed. Please check if all library and include paths are set properly!")
	endif ()
endif (Libgcrypt_FOUND)


text:
package org.springframework.boot.context;

import org.junit.jupiter.api.Test;

import org.springframework.boot.DefaultBootstrapContext;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.test.context.support.TestPropertySourceUtils;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;

/**
 * Tests for {@link FileEncodingApplicationListener}.
 *
 * @author Dave Syer
 */
class FileEncodingApplicationListenerTests {

	private final FileEncodingApplicationListener initializer = new FileEncodingApplicationListener();

	private final ConfigurableEnvironment environment = new StandardEnvironment();

	private final ApplicationEnvironmentPreparedEvent event = new ApplicationEnvironmentPreparedEvent(
			new DefaultBootstrapContext(), new SpringApplication(), new String[0], this.environment);

	@Test
	void testIllegalState() {
		TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
				"spring.mandatory_file_encoding=FOO");
		ConfigurationPropertySources.attach(this.environment);
		assertThatIllegalStateException().isThrownBy(() -> this.initializer.onApplicationEvent(this.event));
	}

	@Test
	void testSunnyDayNothingMandated() {
		this.initializer.onApplicationEvent(this.event);
	}

	@Test
	void testSunnyDayMandated() {
		assertThat(System.getProperty("file.encoding")).isNotNull();
		TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
				"spring.mandatory_file_encoding:" + System.getProperty("file.encoding"));
		ConfigurationPropertySources.attach(this.environment);
		this.initializer.onApplicationEvent(this.event);
	}

}


text:
/**
* Checks if the given Circle and Rectangle objects intersect.
* @method Phaser.Circle.intersectsRectangle
* @param {Phaser.Circle} c - The Circle object to test.
* @param {Phaser.Rectangle} r - The Rectangle object to test.
* @return {boolean} True if the two objects intersect, otherwise false.
*/
export default function CircleToRectangle (circle, rect) {

    let halfWidth = rect.width / 2;
    let halfHeight = rect.height / 2;

    let cx = Math.abs(circle.x - rect.x - halfWidth);
    let xDist = halfWidth + circle.radius;

    if (cx > xDist)
    {
        return false;
    }

    let cy = Math.abs(circle.y - rect.y - halfHeight);
    let yDist = halfHeight + circle.radius;

    if (cy > yDist)
    {
        return false;
    }

    if (cx <= halfWidth || cy <= halfHeight)
    {
        return true;
    }

    let xDistSq = (cx - halfWidth) * (cx - halfWidth);
    let yDistSq = (cy - halfHeight) * (cy - halfHeight);

    return (xDistSq + yDistSq <= circle.diameter);

}


text:
package carbon.widget;

import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

import carbon.R;
import carbon.shadow.ShadowView;

/**
 * Created by Marcin on 2014-12-13.
 */
public class Toolbar extends LinearLayout implements ShadowView {
    private ViewGroup content;
    private ImageView icon;
    private TextView title;

    public Toolbar(Context context) {
        this(context, null);
    }

    public Toolbar(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(attrs, R.attr.carbon_toolbarStyle);
    }

    private void init(AttributeSet attrs, int defStyle) {
        inflate(getContext(), R.layout.carbon_toolbar, this);
        content = (ViewGroup) findViewById(R.id.carbon_toolbarContent);
        title = (TextView) findViewById(R.id.carbon_toolbarTitle);
        icon = (ImageView) findViewById(R.id.carbon_icon);

        icon.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                ((Activity) getContext()).onBackPressed();
            }
        });

        TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Toolbar, defStyle, 0);
        setElevation(a.getDimension(R.styleable.Toolbar_carbon_elevation, 0));  // this shouldn't be necessary
        setText(a.getString(R.styleable.Toolbar_android_text));
        int iconRes = a.getResourceId(R.styleable.Toolbar_carbon_icon, 0);
        if (iconRes != 0) {
            setIcon(iconRes);
        } else {
            setIconVisible(false);
        }
        int color = a.getColor(R.styleable.Toolbar_android_background, 0);
        setBackgroundColor(color);
        a.recycle();
    }

    @Override
    public void addView(@NonNull View child) {
        if (content != null) {
            content.addView(child);
        } else {
            super.addView(child);
        }
    }

    @Override
    public void addView(@NonNull View child, int index) {
        if (content != null) {
            content.addView(child, index);
        } else {
            super.addView(child, index);
        }
    }

    @Override
    public void addView(@NonNull View child, int index, ViewGroup.LayoutParams params) {
        if (content != null) {
            content.addView(child, index, params);
        } else {
            super.addView(child, index, params);
        }
    }

    @Override
    public void addView(@NonNull View child, ViewGroup.LayoutParams params) {
        if (content != null) {
            content.addView(child, params);
        } else {
            super.addView(child, params);
        }
    }

    @Override
    public void addView(@NonNull View child, int width, int height) {
        if (content != null) {
            content.addView(child, width, height);
        } else {
            super.addView(child, width, height);
        }
    }

    public void setText(String text) {
        if (text != null) {
            title.setText(text);
            title.setVisibility(View.VISIBLE);
        } else {
            title.setVisibility(View.GONE);
        }
    }

    public void setText(int resId) {
        setText(getResources().getString(resId));
    }

    public String getText() {
        return (String) title.getText();
    }

    public View getTitleView() {
        return title;
    }

    public void setIcon(int iconRes) {
        if (iconRes == 0) {
            icon.setVisibility(GONE);
        } else {
            icon.setImageResource(iconRes);
            icon.setVisibility(VISIBLE);
        }
    }

    public void setIcon(Drawable drawable) {
        if (drawable == null) {
            icon.setVisibility(GONE);
        } else {
            icon.setImageDrawable(drawable);
            icon.setVisibility(VISIBLE);
        }
    }

    public void setIcon(Bitmap bitmap) {
        if (bitmap == null) {
            icon.setVisibility(GONE);
        } else {
            icon.setImageBitmap(bitmap);
            icon.setVisibility(VISIBLE);
        }
    }

    public Drawable getIcon() {
        return icon.getDrawable();
    }

    public View getIconView() {
        return icon;
    }

    public void setIconVisible(boolean visible) {
        icon.setVisibility(visible ? VISIBLE : GONE);
    }
}


text:
var tests = Object.keys(window.__karma__.files).filter(function (file) {
  return /^\/base\/test\/(.*)\.js$/.test(file) && !/main\.js$/.test(file);
});

var should;

require.config({
  baseUrl: '/base/app/scripts',
  paths: {
    angular: '../components/angular-unstable/angular',
    async: '../components/async/lib/async',
    jquery: '../components/jquery/jquery',
    underscore: '../components/underscore/underscore',
    ngResource: '../components/angular-resource-unstable/angular-resource',
    'http-auth-interceptor': '../components/angular-http-auth/src/http-auth-interceptor',
    chai: '../components/chai/chai',
    sinon: '../components/sinon/lib/sinon',
    'angular-mocks':'../components/angular-mocks/angular-mocks'
  },
  shim: {
    app: {
        deps: [
            'angular',
            'angular-mocks',
            'ngResource',
            'http-auth-interceptor',
            'chai',
            'sinon'
        ]
    },

    'angular-mocks': {
      deps: ['angular']
    },

    angular: {
        exports: 'angular'
    },

    'http-auth-interceptor': {
        deps: ['angular']
    },

    ngResource: {
        deps: ['angular']
    },

    underscore: {
        exports: '_'
    },

    // Controllers
    controllers: {
        deps: [
            'controllers/home',
            'controllers/login',
            'controllers/users'
        ]
    },

    // Directives
    directives: {
        deps: [
            'directives/string-to-number'
        ]
    },

    // Filters
    filters: {
        deps: [
            // 'filters/starts-with'
        ]
    },

    // Services
    services: {
        deps: [
            'services/debug',
            'services/http-options',
            'services/auth',
            'services/user',
            // 'services/browser-detect',
            // 'services/generic'
        ]
    },
  },
  deps: tests,

  // start test run, once Require.js is done
  callback: window.__karma__.start
});


text: <title>Compositing - Huge <div></title>


text:
@interface ProfileViewController : UIViewController <UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UIScrollView *scrollview;
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
@property (weak, nonatomic) IBOutlet UITextField *ageTextField;
@property (weak, nonatomic) IBOutlet UITextField *homeTownTextField;
@property (weak, nonatomic) IBOutlet UITextField *currentTownTextField;
@property (weak, nonatomic) IBOutlet UITextField *educationTextField;
@property (weak, nonatomic) IBOutlet UITextField *workTextField;
@property (weak, nonatomic) IBOutlet UITextField *hobbiesTextField;
@property (weak, nonatomic) IBOutlet UITextField *emailTextField;
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@property (weak, nonatomic) IBOutlet UIImageView *profileImage;
//@property (weak, nonatomic) IBOutlet UINavigationItem *navigationItem;

-(IBAction)saveProfileInformation:(id)sender;

@end


text:
// Copyright 2021 The Bazel Authors. All rights reserved.
//
// 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.
//

package com.google.devtools.build.lib.bazel.bzlmod;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.devtools.build.lib.analysis.BlazeDirectories;
import com.google.devtools.build.lib.cmdline.LabelConstants;
import com.google.devtools.build.lib.events.ExtendedEventHandler;
import com.google.devtools.build.lib.packages.NoSuchPackageException;
import com.google.devtools.build.lib.packages.Package;
import com.google.devtools.build.lib.packages.Package.NameConflictException;
import com.google.devtools.build.lib.packages.PackageFactory;
import com.google.devtools.build.lib.packages.RuleFactory.InvalidRuleException;
import com.google.devtools.build.lib.packages.StarlarkNativeModule.ExistingRulesShouldBeNoOp;
import com.google.devtools.build.lib.vfs.Root;
import com.google.devtools.build.lib.vfs.RootedPath;
import java.util.HashMap;
import java.util.Map;
import net.starlark.java.eval.EvalException;
import net.starlark.java.eval.Starlark;
import net.starlark.java.eval.StarlarkSemantics;
import net.starlark.java.eval.StarlarkThread;
import net.starlark.java.syntax.Location;

/**
 * A context object that should be stored in a {@link StarlarkThread} for use during module
 * extension evaluation.
 */
public final class ModuleExtensionEvalStarlarkThreadContext {
  public void storeInThread(StarlarkThread thread) {
    thread.setThreadLocal(ModuleExtensionEvalStarlarkThreadContext.class, this);
    // The following is just a hack; see documentation there for an explanation.
    thread.setThreadLocal(ExistingRulesShouldBeNoOp.class, new ExistingRulesShouldBeNoOp());
  }

  public static ModuleExtensionEvalStarlarkThreadContext from(StarlarkThread thread) {
    return thread.getThreadLocal(ModuleExtensionEvalStarlarkThreadContext.class);
  }

  @AutoValue
  abstract static class PackageAndLocation {
    abstract Package getPackage();

    abstract Location getLocation();

    static PackageAndLocation create(Package pkg, Location location) {
      return new AutoValue_ModuleExtensionEvalStarlarkThreadContext_PackageAndLocation(
          pkg, location);
    }
  }

  private final String repoPrefix;
  private final PackageFactory packageFactory;
  private final BlazeDirectories directories;
  private final ExtendedEventHandler eventHandler;
  private final Map<String, PackageAndLocation> generatedRepos = new HashMap<>();

  public ModuleExtensionEvalStarlarkThreadContext(
      String repoPrefix,
      PackageFactory packageFactory,
      BlazeDirectories directories,
      ExtendedEventHandler eventHandler) {
    this.repoPrefix = repoPrefix;
    this.packageFactory = packageFactory;
    this.directories = directories;
    this.eventHandler = eventHandler;
  }

  /** The string that should be prefixed to the names of all repos generated by this extension. */
  public String getRepoPrefix() {
    return repoPrefix;
  }

  public void createRepo(
      String internalRepoName,
      BzlmodRepoRuleCreator repoRuleCreator,
      Map<String, Object> kwargs,
      StarlarkSemantics starlarkSemantics,
      Location location)
      throws InterruptedException, EvalException {
    PackageAndLocation conflict = generatedRepos.get(internalRepoName);
    if (conflict != null) {
      throw Starlark.errorf(
          "A repo named %s is already generated by this module extension at %s",
          internalRepoName, conflict.getLocation());
    }

    Package.Builder packageBuilder =
        packageFactory.newExternalPackageBuilder(
            RootedPath.toRootedPath(
                Root.fromPath(directories.getWorkspace()),
                LabelConstants.MODULE_DOT_BAZEL_FILE_NAME),
            "dummy_name",
            starlarkSemantics);
    try {
      repoRuleCreator.createAndAddRule(packageBuilder, starlarkSemantics, kwargs, eventHandler);
    } catch (InvalidRuleException | NameConflictException e) {
      throw Starlark.errorf("%s", e.getMessage());
    }
    try {
      generatedRepos.put(
          internalRepoName, PackageAndLocation.create(packageBuilder.build(), location));
    } catch (NoSuchPackageException e) {
      // This will never happen!
      throw new IllegalStateException(e);
    }
  }

  /**
   * Returns the repos generated by the extension so far. The key is the "internal name" (as
   * specified by the extension) of the repo, and the value is the package containing (only) the
   * repo rule.
   */
  public ImmutableMap<String, Package> getGeneratedRepos() {
    return ImmutableMap.copyOf(
        Maps.transformValues(generatedRepos, PackageAndLocation::getPackage));
  }
}


text:
//
//  RechargeViewController.m
//  AXRecharge
//
//  Created by anxindeli on 2017/10/16.
//  Copyright © 2017年 anxindeli. All rights reserved.
//

#import "RechargeViewController.h"

@interface RechargeViewController ()

@end

@implementation RechargeViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 150, 50)];
    [self.view addSubview:label];
    label.text = @"这是充值模块";
    label.textColor = [UIColor greenColor];
    label.font = [UIFont systemFontOfSize:20];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
using FubuMVC.Swank.Description;

namespace TestHarness.Administration
{
    public class Module : ModuleDescription
    {
        public Module()
        {
            Name = "Administration";

            // We could have set the comments here but instead
            // added them in a markdown document because they
            // were a bit to complex.
            // Comments = "These are some lovely comments.";
        }
    }
}


text:
_Marc Gillard COMS, GDMI - Orientation & Mobility Services Specialist – Guide Dogs for the Blind_

## CATEGORY: MOTIVATIONAL READINESS

1.	Is the client motivated primarily by the goal of achieving independent mobility with a guide dog?
2.	Is the client prepared for a major commitment in order to be successful?
3.	Is the client prepared to play their role in the person – guide dog relationship to become a successful team?
4.	Does the client understand that a guide dog requires a '24/7, 365 days a year' care?
5.	Is the client prepared for the responsibility of caring for a guide dog over the long term?
6.	Is the client positive about living with a guide dog when it is off-duty and forming a long-term relationship?

## CATEGORY: PSYCHOLOGICAL, COGNITIVE & EMOTIONAL READINESS

7.	Does the client have any cognitive challenges that will impose limitations on developing and maintaining the leadership role with a guide dog?
8.	Will the client be able to comprehend and remember the skills and knowledge needed to be successful with a guide dog and apply them independently over the long term?
9.	Will the client be able to process sensory input and make decisions quickly enough while multi-tasking?
10.	Is the client emotionally stable so they can form a satisfactory long term working relationship with a guide dog and respond/attend to its physical and emotional needs?
11.	Does the client have the necessary level of maturity to be successful with a guide dog over the long term?  (Younger clients).

## CATEGORY: PHYSICAL READINESS

12.	Does the client have the necessary strength to manage an appropriately matched guide dog?
13.	Does the client have the necessary motor skills, range of motion, reflexes, flexibility and coordination to work with a guide dog?
14.	Does the client have the capacity to walk for approximately 20 minutes or a total of a mile a day at a speed conducive to guide dog travel without experiencing cardiovascular stress, shortness of breath, fatigue or undue muscle soreness?  (A short rest break is acceptable).
15.	Does the client have the ability to maintain balance while negotiating curbs and steps, traveling over varied surfaces, managing the guide's behavior and executing the body movements required when completing turns and following a guide dog?
16.	Does the client have the ability to react quickly enough if the guide dog exhibits inappropriate behavior, makes directional changes, slows down/speeds up or ceases/commences movement?

## CATEGORY: ENVIRONMENTAL READINESS

17.	Does the client have an understanding of the principles and practice of orientation both indoors and outdoors extending to route planning and execution?
18.	Has the client developed the kinesthetic, auditory and time-distance skills in addition to spatial representation and non-tactile travel abilities to be dynamically oriented while working with a guide dog?
19.	Does the client have a minimum of three purposeful routes, (to destinations) to enable a guide dog to maintain a safe and satisfactory standard of guiding performance and satisfy its physical and emotional needs?
20.	Does the client have the skills, knowledge and experience to complete intersection analysis and understand traffic patterns to complete safe, independent street crossings?
21.	Is the client 'dynamically oriented' to the initial routes/destinations they intend to use immediately following their guide dog-client training program?

## CATEGORY: SENSORY READINESS

22.	Is the client legally blind in both eyes and requires a primary mobility aid for safe, independent travel?
23.	Can the client use hearing, residual vision or a combination of both to detect the locality and directional flow of traffic to enable safe street crossing decisions?
24.	Can the client receive and interpret sufficient kinesthetic, proprioceptive and haptic input to follow, manage and support a guide dog as well as interpret its movements and behavior?

## CATEGORY: ACCOMMODATION & DOG CARE READINESS

25.	Can the client provide a guide dog with safe and hygienic accommodation at home and at work?
26.	Are there other people or dogs/pets in the client's environment that could pose a safety risk to a guide dog either physically and/or emotionally?
27.	Does the client plan to remain living at their current address for a minimum of six months following their guide dog-client training program?
28.	Does the client have the financial means to support a guide dog?

## CATEGORY: ADULT LEARNING READINESS

29.	Does the client understand their learning style, strengths and challenges?
30.	Can the client self-advocate and communicate information to instructional staff to facilitate their learning?
31.	Does the client have experience with their preferred learning media and can use it with minimal assistance to access supporting educational materials?
32.	Can the client function independently away from home in a new environment with a minimum of assistance, e.g. ADL's & medical needs?
33.	Can the client follow a timetable, be on time to lessons/appointments and implement instructions?
34.	Will the client be successful in a group setting?

## CATEGORY: SOCIAL READINESS RELATED TO GUIDE DOG MOBILITY

35.	Has the client discussed their guide dog mobility goal with their support and social network?
36.	Is the client prepared and capable of communicating with and directing others in order to foster appropriate interactions with a guide dog and to maintain an environment that preserves its training, health and positive behavior?
37.	Has the client addressed and resolved any issues indicating concern, confusion or a lack of support for a guide dog within their social network which may impose challenges and limitations?
38.	Is the client aware and have they considered the increase in public attention, admiration and scrutiny that will result from being accompanied by a guide dog and are they overall positive about this prospect?

# CATEGORY: DOG KNOWLEDGE READINESS

39.	Does the client understand the roles of the guide dog user and the guide dog within a mobility context?
40.	Does the client understand that guide dogs are indeed dogs and their behaviors are influenced by their environment, instincts and senses as well as formal training?
41.	Does the client understand that a guide dog will require occasional management to deal with distracted behavior and to redirect its attention back on guide work?
42.	Does the client understand that dogs are social animals and respond favorably to human leadership?
43.	Does the client understand that a guide dog will require regular energy expenditure opportunities both in and out of guide work?
44.	Does the client understand that a guide dog will require regular feeding and watering?
45.	Does the client understand that a guide dog will require regular leash-relieving opportunities in all types of weather conditions?
46.	Does the client understand that a guide dog will require regular grooming and shed hair?
47.	Does the client understand that a guide dog will require routine veterinary care and sometimes unplanned vet care being unable to work until it recovers?
48.	Does the client understand that a guide dog has a finite working life and the process of retirement and subsequent retraining can be emotionally difficult?


text:
package metrics

import (
	"strconv"

	"github.com/argoproj/pkg/kubeclientmetrics"
	"k8s.io/client-go/rest"

	"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)

// AddMetricsTransportWrapper adds a transport wrapper which increments 'argocd_app_k8s_request_total' counter on each kubernetes request
func AddMetricsTransportWrapper(server *MetricsServer, app *v1alpha1.Application, config *rest.Config) *rest.Config {
	inc := func(resourceInfo kubeclientmetrics.ResourceInfo) error {
		namespace := resourceInfo.Namespace
		kind := resourceInfo.Kind
		statusCode := strconv.Itoa(resourceInfo.StatusCode)
		server.IncKubernetesRequest(app, resourceInfo.Server, statusCode, string(resourceInfo.Verb), kind, namespace)
		return nil
	}

	newConfig := kubeclientmetrics.AddMetricsTransportWrapper(config, inc)
	return newConfig
}