text:
<?php

namespace TW\neloBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Rooms
 *
 * @ORM\Table(name="rooms")
 * @ORM\Entity(repositoryClass="TW\neloBundle\Entity\RoomsRepository")
 */
class Rooms
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="number", type="integer", unique=true)
     */
    private $number;

    /**
     * @var float
     *
     * @ORM\Column(name="price", type="decimal")
     */
    private $price;

    /**
     * @var boolean
     *
     * @ORM\Column(name="state", type="boolean")
     */
    private $state;

        /**
     * @var boolean
     *
     * @ORM\Column(name="overbooked", type="boolean")
     */
    private $overbooked;

    /**
     * @var ldate
     *
     * @ORM\Column(name="leavingDate", type="date")
     */
    private $leavingDate;

    /**
     * @ORM\ManyToMany(targetEntity="Facilities", inversedBy="rooms")
     */
    private $facilities;

    /**
    *@ORM\ManyToOne(targetEntity="Type", inversedBy="rooms")
    *@ORM\JoinColumn(name="type_id", referencedColumnName="id")
    */
    protected $type;

      /**
     * @ORM\ManyToMany(targetEntity="User", mappedBy="rooms")
     */
    private $users;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set price
     *
     * @param float $price
     * @return Rooms
     */
    public function setPrice($price)
    {
        $this->price = $price;

        return $this;
    }

    /**
     * Get price
     *
     * @return float
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * Set state
     *
     * @param boolean $state
     * @return Rooms
     */
    public function setState($state)
    {
        $this->state = $state;

        return $this;
    }

    /**
     * Get state
     *
     * @return boolean
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->facilities = new ArrayCollection();
        $this->users = new ArrayCollection();

    }

    /**
     * Set type
     *
     * @param \TW\neloBundle\Entity\Type $type
     * @return Rooms
     */
    public function setType(\TW\neloBundle\Entity\Type $type = null)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return \TW\neloBundle\Entity\Type
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set number
     *
     * @param integer $number
     * @return Rooms
     */
    public function setNumber($number)
    {
        $this->number = $number;

        return $this;
    }

    /**
     * Get number
     *
     * @return integer
     */
    public function getNumber()
    {
        return $this->number;
    }

    /**
     * Add facilities
     *
     * @param \TW\neloBundle\Entity\Facilities $facilities
     * @return Rooms
     */
    public function addFacilities(\TW\neloBundle\Entity\Facilities $facilities)
    {
        $this->facilities[] = $facilities;

        return $this;
    }

    /**
     * Remove facilities
     *
     * @param \TW\neloBundle\Entity\Facilities $facilities
     */
    public function removeFacilities(\TW\neloBundle\Entity\Facilities $facilities)
    {
        $this->facilities->removeElement($facilities);
    }

    /**
     * Get facilities
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFacilities()
    {
        return $this->facilities;
    }

    /**
     * Add facilities
     *
     * @param \TW\neloBundle\Entity\Facilities $facilities
     * @return Rooms
     */
    public function addFacilitie(\TW\neloBundle\Entity\Facilities $facilities)
    {
        $this->facilities[] = $facilities;

        return $this;
    }

    /**
     * Remove facilities
     *
     * @param \TW\neloBundle\Entity\Facilities $facilities
     */
    public function removeFacilitie(\TW\neloBundle\Entity\Facilities $facilities)
    {
        $this->facilities->removeElement($facilities);
    }

    /**
     * Add users
     *
     * @param \TW\neloBundle\Entity\User $users
     * @return Rooms
     */
    public function addUser(\TW\neloBundle\Entity\User $users)
    {
        $this->users[] = $users;

        return $this;
    }

    /**
     * Remove users
     *
     * @param \TW\neloBundle\Entity\User $users
     */
    public function removeUser(\TW\neloBundle\Entity\User $users)
    {
        $this->users->removeElement($users);
    }

    /**
     * Get users
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getUsers()
    {
        return $this->users;
    }

    /**
     * Set overbooked
     *
     * @param boolean $overbooked
     * @return Rooms
     */
    public function setOverbooked($overbooked)
    {
        $this->overbooked = $overbooked;

        return $this;
    }

    /**
     * Get overbooked
     *
     * @return boolean
     */
    public function getOverbooked()
    {
        return $this->overbooked;
    }

    /**
     * Set leavingDate
     *
     * @param \DateTime $leavingDate
     * @return Rooms
     */
    public function setLeavingDate($leavingDate)
    {
        $this->leavingDate = $leavingDate;

        return $this;
    }

    /**
     * Get leavingDate
     *
     * @return \DateTime
     */
    public function getLeavingDate()
    {
        return $this->leavingDate;
    }
}


text:
<?php

namespace App\Models;

use App\User;
use Illuminate\Database\Eloquent\Model;

class Cost extends Model
{
    protected $fillable = [
        'name', 'cost', 'company_id'
    ];

    public function users()
    {
        return $this->hasMany(User::class);
    }

    public function company()
    {
        return $this->belongsTo(Company::class);
    }
}

redpajama_set_name: RedPajamaGithub


text:
function HandToPosition(position)
    global joint_a_gear_ratio;
    global joint_b_gear_ratio;
    global motorA;
    global motorB;

    position

    % Grab the positions we want to go to.
    [theta_1, theta_2] = GetAngles(position);

    [theta1_current, theta2_current] = GetCurrentAngles();

    % Read current position from motor, and determine rotations required.
    motorA.TachoLimit = mod(round(abs(theta1_current - (theta_1 * 180 / pi)) * joint_a_gear_ratio), 360);

    % If it needs to rotate, do the rotations.
    if (motorA.TachoLimit > 0)
        if (theta1_current > theta_1)
            motorA.Power = 25;
        else
            motorA.Power = -25;
        end

        motorA.SendToNXT();
        motorA.WaitFor();
    end

    % Read current position from motor, and determine rotations required.
    motorB.TachoLimit = mod(round(abs(theta2_current - (theta_2 * 180 / pi)) * joint_b_gear_ratio), 360);

    % If it needs to rotate, do the rotations.
    if (motorB.TachoLimit > 0)
        if (theta2_current > theta_2)
            motorB.Power = 25;
        else
            motorB.Power = -25;
        end
        motorB.SendToNXT();
        motorB.WaitFor();
    end
end


text:
package com.java110.utils.cache;

import com.java110.utils.util.SerializeUtil;
import com.java110.entity.order.ServiceBusiness;
import redis.clients.jedis.Jedis;

import java.util.List;

/**
 * 业务信息 缓存类
 * Created by wuxw on 2018/4/14.
 */
public class ServiceBusinessCache extends BaseCache {

    //后缀 用来刷缓存时删除 所有以这个为后缀的数据
    public final static String _KEY_SERVICE_BUSINESS = "_KEY_ALL_SERVICE_BUSINESS";

    /**
     * 获取 业务信息
     * @return
     */
    public static List<ServiceBusiness> getServiceBusiness(){
        List<ServiceBusiness> serviceBusinesses = null;
        Jedis redis = null;
        try {
            redis = getJedis();
            serviceBusinesses = SerializeUtil.unserializeList(redis.get((_KEY_SERVICE_BUSINESS).getBytes()),ServiceBusiness.class);
            if(serviceBusinesses == null || serviceBusinesses.size() ==0) {
                return null;
            }
        }finally {
            if(redis != null){
                redis.close();
            }
        }
        return serviceBusinesses;
    }

    /**
     * 保存路由信息
     * @param serviceBusinesses
     */
    public static void setServiceBusiness(List<ServiceBusiness> serviceBusinesses){
        Jedis redis = null;
        try {
            redis = getJedis();
            redis.set((_KEY_SERVICE_BUSINESS).getBytes(),SerializeUtil.serializeList(serviceBusinesses));
        }finally {
            if(redis != null){
                redis.close();
            }
        }
    }

}


text:
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Diagnostics;

namespace Grpc.Core.Utils
{
    public static class Preconditions
    {
        /// <summary>
        /// Throws ArgumentException if condition is false.
        /// </summary>
        public static void CheckArgument(bool condition)
        {
            if (!condition)
            {
                throw new ArgumentException();
            }
        }

        /// <summary>
        /// Throws ArgumentException with given message if condition is false.
        /// </summary>
        public static void CheckArgument(bool condition, string errorMessage)
        {
            if (!condition)
            {
                throw new ArgumentException(errorMessage);
            }
        }

        /// <summary>
        /// Throws NullReferenceException if reference is null.
        /// </summary>
        public static T CheckNotNull<T> (T reference)
        {
            if (reference == null)
            {
                throw new NullReferenceException();
            }
            return reference;
        }

        /// <summary>
        /// Throws NullReferenceException with given message if reference is null.
        /// </summary>
        public static T CheckNotNull<T> (T reference, string errorMessage)
        {
            if (reference == null)
            {
                throw new NullReferenceException(errorMessage);
            }
            return reference;
        }

        /// <summary>
        /// Throws InvalidOperationException if condition is false.
        /// </summary>
        public static void CheckState(bool condition)
        {
            if (!condition)
            {
                throw new InvalidOperationException();
            }
        }

        /// <summary>
        /// Throws InvalidOperationException with given message if condition is false.
        /// </summary>
        public static void CheckState(bool condition, string errorMessage)
        {
            if (!condition)
            {
                throw new InvalidOperationException(errorMessage);
            }
        }
    }
}


text:
var Socketiop2p = require('../../index');
var io = require('socket.io-client');

var expect = require('expect.js');
var extend = require('extend.js');

var peerOpts = {};

describe('Multi-way communication', function() {
  var connectionUrl = '/chat';
  var manager1 = io.Manager();
  var manager2 = io.Manager();
  var manager3 = io.Manager();

  var socket1 = manager1.socket(connectionUrl)
  var socket2 = manager2.socket(connectionUrl)
  var socket3 = manager3.socket(connectionUrl)

  var p2psocket1 = new Socketiop2p(peerOpts, socket1);
  var p2psocket2 = new Socketiop2p(peerOpts, socket2);
  var p2psocket3 = new Socketiop2p(peerOpts, socket3);

  p2psocket1.useSockets = false;
  p2psocket2.useSockets = false;
  p2psocket3.useSockets = false;

  describe('3-way JSON object transfer', function(done) {
    it('should parse data from peer connection and sockets', function(done) {
      var jsonObj = {ping: 'pong', ding: {dong: 'song'}};
      p2psocket3.on('ready', function() {
        console.log("ready");

        p2psocket2.on('peer-obj', function(data) {
          p2psocket2._peers;
          console.log("Peer 2 recieved");
          expect(data).to.eql(jsonObj)
        })

        p2psocket1.on('peer-obj', function(data) {
          p2psocket1._peers;
          console.log("Peer 3 recieved");
          expect(data).to.eql(jsonObj)
          done();
          p2psocket1.disconnect()
          p2psocket2.disconnect()
          p2psocket3.disconnect()
        })
        p2psocket3.emit('peer-obj', jsonObj)
      });
    });
  });

})


text:
const DrawCard = require('../../../drawcard.js');

class Dawn extends DrawCard {
    setupCardAbilities(ability) {
        this.whileAttached({
            effect: ability.effects.dynamicStrength(() => this.controller.getNumberOfUsedPlots()),
            recalculateWhen: ['onUsedPlotsModified']
        });
        this.whileAttached({
            match: card => card.hasTrait('House Dayne'),
            effect: ability.effects.addKeyword('Intimidate')
        });
    }

    canAttach(player, card) {
        if(card.getType() !== 'character') {
            return false;
        }

        return super.canAttach(player, card);
    }
}

Dawn.code = '01115';

module.exports = Dawn;


text:
<?php
class ApplicationHelper extends Rails\ActionView\Helper
{
    public function linkTo($link, $url_params, array $attrs = array())
    {
        if ($url_params == 'root') {
            return $this->base()->linkTo($link, $url_params, $attrs);
        } else {
            $base_path = Rails::application()->router()->basePath();
            $attrs['href'] = $base_path . '/' . Rails::application()->config()->rails_panel_path . '/' . substr($url_params, 1);
            return $this->contentTag('a', $link, $attrs);
        }
    }
}


text:
(function () {

    var JavaWrapper = require(EclairJS_Globals.NAMESPACE + '/JavaWrapper');
    var Logger = require(EclairJS_Globals.NAMESPACE + '/Logger');
    var Utils = require(EclairJS_Globals.NAMESPACE + '/Utils');

    var JavaDuration = Java.type("org.apache.spark.streaming.Duration");

    /**
     * @constructor
     * @memberof module:eclairjs/streaming
     * @classdesc Duration of time to wait.
     * @param {long} millis
     */
    var Duration = function (millis) {
        var jvmObj = new JavaDuration(millis);
        this.logger = Logger.getLogger("streaming.Duration_js");
        JavaWrapper.call(this, jvmObj);
    };

    Duration.prototype = Object.create(JavaWrapper.prototype);

    Duration.prototype.constructor = Duration;
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {double}
     */
    Duration.prototype.div = function (that) {
        return this.getJavaObject().div(Utils.unwrapObject(that));
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {boolean}
     */
    Duration.prototype.greater = function (that) {
        return this.getJavaObject().greater(Utils.unwrapObject(that));
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {boolean}
     */
    Duration.prototype.greaterEq = function (that) {
        return this.getJavaObject().greaterEq(Utils.unwrapObject(that));
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {boolean}
     */
    Duration.prototype.isMultipleOf = function (that) {
        return this.getJavaObject().isMultipleOf(Utils.unwrapObject(that));
    };
    /**
     * @returns {boolean}
     */
    Duration.prototype.isZero = function () {
        return this.getJavaObject().isZero();
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {boolean}
     */
    Duration.prototype.less = function (that) {
        return this.getJavaObject().less(Utils.unwrapObject(that));
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {boolean}
     */
    Duration.prototype.lessEq = function (that) {
        return this.getJavaObject().lessEq(Utils.unwrapObject(that));
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {module:eclairjs/streaming.Duration}
     */
    Duration.prototype.max = function (that) {
        var d = this.getJavaObject().max(Utils.unwrapObject(that));
        return new Duration(d);
    };
    /**
     *
     * @returns {long}
     */
    Duration.prototype.milliseconds = function () {
        return this.getJavaObject().milliseconds();
    };
    /**
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {module:eclairjs/streaming.Duration}
     */
    Duration.prototype.min = function (that) {
        var d = this.getJavaObject().min(Utils.unwrapObject(that));
        return new Duration(d);
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {module:eclairjs/streaming.Duration}
     */
    Duration.prototype.minus = function (that) {
        var d = this.getJavaObject().minus(Utils.unwrapObject(that));
        return new Duration(d);
    };
    /**
     *
     * @param {module:eclairjs/streaming.Duration} that
     * @returns {module:eclairjs/streaming.Duration}
     */
    Duration.prototype.plus = function (that) {
        var d = this.getJavaObject().plus(Utils.unwrapObject(that));
        return new Duration(d);
    };
    /**
     *
     * @param {integer} times
     * @returns {module:eclairjs/streaming.Duration}
     */
    Duration.prototype.times = function (times) {
        var d = this.getJavaObject().times();
        return new Duration(d);
    };

    module.exports = Duration;

})();


text:
import { Template } from 'meteor/templating';

Template.Login_Page.onCreated(function onCreated() {
});

Template.Login_Page.helpers({

});


text:
import { moduleForModel, test } from 'ember-qunit';

moduleForModel('taxonomy', 'Unit | Serializer | taxonomy', {
    // Specify the other units that are required for this test.
    needs: ['serializer:taxonomy'],
});

// Replace this with your real tests.
test('it serializes records', function(assert) {
    const record = this.subject();

    const serializedRecord = record.serialize();

    assert.ok(serializedRecord);
});


text:
 Python Party: résumé
* ![alt](https://raw.github.com/Dakarlug/site-datas/master/datas/image "") .*  [Telecharger l'affiche](https://raw.github.com/Dakarlug/site-datas/master/datas/python_fr.pdf "").

      Alors après la python party de samedi dernier je fais un petit résumé.Langage complètement different de ce qu'on aconnu avant(C/C++, Java,
PHP, Windev, etc). Les "batteries incluses" de python ont surpris tout
le monde :). iPython est devenu le meilleur ami de chacun et est
l'outil indispensable pour le développement rapide et efficace des applications.Voici les liens utiles pour les débutants, mais aussi pour les programmeurs affirmés:Tutoriel sur Python, par Daniel Nouri(traduction française)Livre libre "Dive into Python"(traduction française)Tutoriel sur iPython(anglais)P.S.: j'ai une remarque, essayez d'être à l'heure quand on spécifie
qu'il faut être présent à 13h pile, on fait encore des exceptions, mais
ça va pas durer longtemps…Over…


text:
define(function(require, exports, module){
/*
type
*/"use strict"

var toString = Object.prototype.toString,
    types = /number|object|array|string|function|date|regexp|boolean/

var type = function(object){
    if (object == null) return "null"
    var string = toString.call(object).slice(8, -1).toLowerCase()
    if (string === "number" && isNaN(object)) return "null"
    if (types.test(string)) return string
    return "object"
}

module.exports = type
});


text:
package com.wyparking.po;

public class Application {
	private int appliid;
	private int userid;
	private String parkname;
	private int parknumber;
	private String parkadress;
	private int apkind;
	public int getAppliid() {
		return appliid;
	}
	public void setAppliid(int appliid) {
		this.appliid = appliid;
	}
	public int getUserid() {
		return userid;
	}
	public void setUserid(int userid) {
		this.userid = userid;
	}
	public String getParkname() {
		return parkname;
	}
	public void setParkname(String parkname) {
		this.parkname = parkname;
	}
	public int getParknumber() {
		return parknumber;
	}
	public void setParknumber(int parknumber) {
		this.parknumber = parknumber;
	}
	public String getParkadress() {
		return parkadress;
	}
	public void setParkadress(String parkadress) {
		this.parkadress = parkadress;
	}
	public int getApkind() {
		return apkind;
	}
	public void setApkind(int apkind) {
		this.apkind = apkind;
	}

}


text:
class Admin::PressesController < Admin::BaseController

  crudify :press, :title_attribute => :headline

end


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

    /// <summary>
    /// A copy activity Oracle sink.
    /// </summary>
    public partial class OracleSink : CopySink
    {
        /// <summary>
        /// Initializes a new instance of the OracleSink class.
        /// </summary>
        public OracleSink()
        {
          CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the OracleSink class.
        /// </summary>
        /// <param name="writeBatchSize">Write batch size. Type: integer (or
        /// Expression with resultType integer), minimum: 0.</param>
        /// <param name="writeBatchTimeout">Write batch timeout. Type: string
        /// (or Expression with resultType string), pattern:
        /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).</param>
        /// <param name="sinkRetryCount">Sink retry count. Type: integer (or
        /// Expression with resultType integer).</param>
        /// <param name="sinkRetryWait">Sink retry wait. Type: string (or
        /// Expression with resultType string), pattern:
        /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).</param>
        /// <param name="preCopyScript">SQL pre-copy script. Type: string (or
        /// Expression with resultType string).</param>
        public OracleSink(object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object preCopyScript = default(object))
            : base(writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait)
        {
            PreCopyScript = preCopyScript;
            CustomInit();
        }

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

        /// <summary>
        /// Gets or sets SQL pre-copy script. Type: string (or Expression with
        /// resultType string).
        /// </summary>
        [JsonProperty(PropertyName = "preCopyScript")]
        public object PreCopyScript { get; set; }

    }
}


text:
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited

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.
"""
from __future__ import print_function

from sys import stdout

class DefaultAuto():
    """ Simple, basic host test's test runner waiting for serial port
        output from MUT, no supervision over test running in MUT is executed.
    """
    def test(self, selftest):
        result = selftest.RESULT_SUCCESS
        try:
            while True:
                c = selftest.mbed.serial_read(512)
                if c is None:
                    return selftest.RESULT_IO_SERIAL
                stdout.write(c)
                stdout.flush()
        except KeyboardInterrupt:
            selftest.notify("\r\n[CTRL+C] exit")
            result = selftest.RESULT_ERROR
        return result


text:
#ifndef _ALSPI_H_INCLUDED_
#define _ALSPI_H_INCLUDED_

#include <limits.h>
#include <stddef.h>
#include <stdarg.h>

#ifdef WIN32
#include <windows.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

extern char library_dir[PATH_MAX];
extern char executable_path[PATH_MAX];

/*
 * Set up some macros for dealing with prototypes and other ANSI C features.
 */

#if defined(macintosh)
#define ALSPI_API(X)		pascal X
#define ALSPI_APIP(X,Y)		pascal X (*Y)
#elif defined(WIN32)
#define ALSPI_API(X)		X __stdcall
#define ALSPI_APIP(X,Y)		X (__stdcall *Y)
#else
#define ALSPI_API(X)    	X
#define ALSPI_APIP(X,Y)		X (*Y)
#endif

#ifndef PWordTypeDefined
typedef long PWord;
#define PWordTypeDefined 1
#endif

#define PI_VAR 		0		/* unbound variables */
#define PI_LIST 	1
#define PI_STRUCT 	2
#define PI_SYM 		3
#define PI_INT 		4
#define PI_UIA 		5
#define PI_DOUBLE 	6

typedef struct {
		const char *name;
		int  arity;
		int (*func) (void);
		const char *funcname;
} PSTRUCT;

#define PI_BEGIN static PSTRUCT pi_init_array[] = {
#define PI_DEFINE(p,a,f) {p,a,f,((char *) -1)},
#define PI_MODULE(m) {m,-1,((int (*)(void)) 0),((char *) -1)},
#define PI_END {((char *) -1),-1,((int (*)(void)) 0),((char *) -1)} };

#define PI_PDEFINE(p,a,f,fn) {p,a,f,fn},

#define PI_INIT PrologInit(pi_init_array)

/*
 * Added 6/11/88 - chris
 */

#define PI_FAIL		return(0)
#define PI_SUCCEED	return(1)

/*
 * Informational, warning, and error messages
 *
 * PI_app_printf must be defined by the application.
 */

typedef enum {
    PI_app_printf_banner,		/* als startup banner */
    PI_app_printf_informational,	/* informational only */
    PI_app_printf_warning,		/* message is a warning */
    PI_app_printf_error,		/* message is an error */
    PI_app_printf_fatal_error		/* message is fatal error */
} PI_app_printf_flags;

/* PI_system_setup is a structure containing initilization information
   for the ALS Prolog engine.

   Fields set to 0 or NULL will cause the engine to use its default
   value.
 */

typedef struct {
    unsigned long heap_size;   /* Prolog heap size in K long words */
    unsigned long stack_size;  /* Prolog stack size in K long words */
    unsigned long icbuf_size;  /* Prolog compiler buffer size in K code words */
    const char *alsdir;        /* Path to the ALS directory */
    const char *saved_state;   /* Path to saved state file */
    int load_executable_state; /* Boolean for loading from executable */

    /* OS Specific setup information */

    /* ANSI C main() command line argument count and vector */
    int argc;
    char **argv;

#ifdef WIN32
    /* Win32 WinMain() arguments */
    HINSTANCE hInstance;
    HINSTANCE hPrevInstance;
    LPSTR lpCmdLine;
    int nCmdShow;
#endif
} PI_system_setup;

/*
 * Declarations for foreign interface functions - 6/15/88 - chris
 */

extern	ALSPI_API(char *)	PI_forceuia	( PWord *, int * );
extern	ALSPI_API(void)	PI_getan	( PWord *, int *, int );
extern	ALSPI_API(void)	PI_getargn	( PWord *, int *, PWord, int );
extern	ALSPI_API(void)	PI_gethead	( PWord *, int *, PWord );
extern	ALSPI_API(void)	PI_gettail	( PWord *, int *, PWord );
extern	ALSPI_API(void)	PI_getdouble	( double *, PWord );
extern	ALSPI_API(void)	PI_getstruct	( PWord *, int *, PWord );
extern	ALSPI_API(char *)	PI_getsymname	( char *, PWord, int );
extern	ALSPI_API(char *)	PI_getuianame	( char *, PWord, int );
extern	ALSPI_API(void)	PI_getuiasize	( PWord, int * );
extern	ALSPI_API(void)	PI_makedouble	( PWord *, int *, double );
extern	ALSPI_API(void)	PI_makelist	( PWord *, int * );
extern	ALSPI_API(void)	PI_makestruct	( PWord *, int *, PWord, int );
extern	ALSPI_API(void)	PI_makesym	( PWord *, int *, const char * );
extern	ALSPI_API(void)	PI_makeuia	( PWord *, int *, const char * );
extern	ALSPI_API(void)	PI_allocuia	( PWord *, int *, int );
extern	ALSPI_API(int)	PI_printf	( const char *, ... );
extern	ALSPI_API(int)	PI_aprintf	( const char *, const char *, ... );
extern  ALSPI_API(int)	PI_vprintf	( const char *, va_list );
extern  ALSPI_API(int)	PI_vaprintf	( const char *, const char *, va_list );
extern	ALSPI_API(int)	PI_rungoal	( PWord, PWord, int );
extern	ALSPI_API(int)	PI_rungoal_with_update	( PWord, PWord *, int * );
extern	ALSPI_API(int)	PI_rungoal_with_update_and_catch	( PWord, PWord *, int *, int * );
extern	ALSPI_API(int)	PI_unify	( PWord , int, PWord , int );
extern	ALSPI_API(void)	PrologInit	( PSTRUCT * );
extern	ALSPI_API(void)	PI_shutdown	( void );
extern	ALSPI_API(void)	PI_toplevel	( void );
extern	ALSPI_API(int)	PI_status_toplevel	( int * );
extern	ALSPI_API(int)	PI_prolog_init	( int, char **);
extern	ALSPI_API(int)	PI_startup	( const PI_system_setup *);
extern	ALSPI_API(void)	PI_throw	(PWord obj, int objt);
extern	ALSPI_API(void)	PI_getball	(PWord *obj, int *objt);
extern	ALSPI_API(int)	PI_main		(int argc, char *argv[], void (*init)(void));
extern	ALSPI_API(void)	PI_interrupt	(void);

#ifdef APP_PRINTF_CALLBACK
extern	ALSPI_API(void)	PI_set_app_printf_callback(void (*callback)(int, va_list));
#endif
extern	ALSPI_API(void)	PI_app_printf	( int, ... );
extern  ALSPI_API(void)    PI_vapp_printf  ( int, va_list );
extern	ALSPI_API(const char *)	PI_get_options	( void );

typedef long (*console_func)(char *, long);

extern ALSPI_API(void)	PI_set_console_functions(console_func readf,
								console_func writef, console_func error);

#ifdef macintosh
extern	long	yield_interval;
extern  long	yield_counter;
extern	void	PI_yield_time	( void );
extern	ALSPI_API(void)	PI_set_yield_proc(void (*p)(void));
#endif

#ifdef macintosh
Boolean SIOUXIsAppWindow(WindowPtr w);
short SIOUXHandleOneEvent(EventRecord *event);
void SIOUXSetEventVector(short (*handler)(EventRecord *));
QDGlobals *GetQD(void);

#endif
/* Error codes */

#define FE_SYMSPACE		0	/* Out of symbol space */
#define FE_STRSPACE		1	/* Out of string space */
#define FE_MAPSYM		2	/* Symbol mapping error */
#define FE_PATH			3	/* PATH variable inaccessible */
#define FE_INFND		4	/* Image not found */
#define FE_SMALLHEAP	5	/* Heap size too small */
#define FE_SMALLSTACK	6	/* Stack size too small */
#define FE_BIGHEAP		7	/* Heap size too big */
#define FE_BIGSTACK		8	/* Stack size too big */
#define FE_TAGERR		9	/* Invalid tagging on stack/heap */
#define FE_REMIDX		10	/* Error removing index block */
#define FE_DEVZERO		11	/* Error opening /dev/zero */
#define FE_STKOVERFLOW	12	/* Stack overflow */
#define FE_ICODEBUFINIT	13	/* Error allocating icode buffer */
#define FE_ICODEBUFOVER	14	/* Icode buffer overflow */
#define FE_XMEM_NTBL	15	/* Memory exhausted while allocating
	 			 * procedure entry
	 			 */
#define FE_FULL_NTBL	16	/* Procedure table full */
#define FE_XMEM_CLAUSE	17	/* Memory exhausted while allocating
	 			 * clause space
	 			 */
#define FE_GCMAGIC_CGC	18	/* Return address doesn't point at
	 			 * gc magic value (in wintcode.c)
	 			 */
#define FE_GCMAGIC		19	/* return address doesn't point at
					 * gc magic value (in gc.c)
		 			 */
#define FE_FULL_MODTBL	20	/* Module Table full */
#define FE_OVER_MODSTK	21	/* Module Stack overflow */
#define FE_OVER_CGSTK	22	/* Clause Group stack overflow */
#define FE_FULL_DEFUSES	23	/* Default use table full */
#define FE_FULL_DEFPROC	24	/* Default procs table full */
#define FE_FULL_MODUSE	25	/* Module use table full */
#define FE_SYM_PCKG		26  /* symbol/package initialization error */
#define FE_IN_COMP1		27	/* internal compiler error 1 */
#define	FE_OVER_HEAP	28	/* Heap/Choice point stack overflow */
#define FE_PANIC_FAIL	29	/* panic fail */
#define FE_PANIC_CONTINUE 30	/* panic continue */
#define FE_BAD_SWITCH	31	/* bad command line switch */
#define FE_BAD_NSWITCH	32	/* bad numeric switch */
#define FE_FDREFCNTS	33	/* error allocating fdrefcnts */
#define FE_DEMO_LIMIT	34	/* demonstration time limit exceeded */
#define FE_IN_BLTINIT	35	/* builtins init internal error */
#define FE_IN_INDEX1	36	/* indexing internal error */
#define FE_IN_PCKG1		37	/* internal packaging error */
#define FE_IN_PCKG2		38	/* internal packaging error */
#define FE_IN_PCKG3		39	/* internal packaging error */
#define FE_PCKG_RINFO	40	/* RInfo buffer full */
#define FE_PCKG_HTBL	41	/* Package hash table full */
#define FE_IN_PCKG4		42	/* internal packaging error */
#define FE_IN_PCKG5		43	/* internal packaging error */
#define FE_IN_PCKG6		44	/* internal packaging error */
#define FE_IN_PCKG7		45	/* internal packaging error */
#define FE_IN_PCKG8		46	/* internal packaging error */
#define FE_PCKG_NTBL	47	/* Procedure table full */
#define FE_IN_PCKG9		48	/* internal packaging error */
#define FE_IN_PCKG10	49	/* internal packaging error */
#define FE_IN_WGET1		50	/* internal w_get error */
#define FE_IN_WGET2		51	/* internal w_get error */
#define FE_IN_WINSTALL	52	/* internal w_install error */
#define FE_IN_HEAPCOPY	53	/* internal heap_copy error */
#define FE_IN_TERMCMP	54	/* internal error in termcmp */
#define FE_CAPTURE_INC  55      /* error in increasing capture size */
#define FE_ABOLISH_FAIL 56      /* abolish_predicate() failed */
#define FE_ASSERT_SSD   57      /* error asserting sys_searchdir */
#define FE_ASSERT_SD    58      /* error asserting searchdir */
#define FE_ASSERT_SYS   59      /* error asserting als_system */
#define FE_ASSERT_COM   60      /* error asserting app command line */
#define FE_GETCWD       61      /* error in getcwd */
#define FE_ALS_MEM_INIT	62	/* error in initial memory allocation */
#define FE_CODESPACE_INIT 63	/* error initializing code space */
#define FE_MODULE_INIT	64	/* error initializing module system */
#define FE_SYMTAB_INIT	65	/* error initializing symbol table */
#define FE_SS_MAXGLOBALS 66	/* AM_MAXGLOBALS constant not large enough */
#define FE_SS_INTEGRITY	67	/* Saved state file does not correspond to
	 			 * image
	 			 */
#define FE_SS_OPENERR	68	/* Cannot open saved state file */
#define FE_SS_FMALLOC	69	/* Problem with fmalloc */
#define FE_ALS_OPTIONS	70	/* Problem getting ALS_OPTIONS */
#define FE_AUTOLOAD	71	/* Problem autoloading file */
#define FE_FDREFOVERFLOW	72 /* Overflow/Underflow of file descriptors */

/* Defined EXIT_ERROR for reporting invalid options, etc. */
#define EXIT_ERROR 2

/*=====================================================================*
 |		 cinterf.h
 |		Copyright (c) 1992-95, Applied Logic Systems Inc.
 |
 |			-- defines for support routines for C interface
 |
 | Author : Prabhakaran Raman
 | Creation : 2/1/92
 *=====================================================================*/

/*---------------------------------------------------------------------
 * Information on the fields of a C-structure/C-union is kept in
 * an array (one per structure/union) that has the following layout.
 * (The array is initialized with the structure information by the
 * interface generator ).
 *--------------------------------------------------------------------*/

typedef struct {
  char *fname;
  unsigned int foffset;
  short  ftype;    /* integer identifying C type; 0 for struct/union */
  char *type_name;  /* when ftype is 0, typename is set to struct name */
  int  arraysz;    /* N=0 => not an array, N>0 => array of size N */
} FieldEntry;      /* For array, currently, this is set to 1000   */
                   /* Later, when ctrans is modified to recognize */
                   /* array size, this field with be set correctly*/
                   /* What about multi-dimensional arrays ?       */

#define CI_BEGARRAY(name) static FieldEntry name[]= {

#define CI_FIELD(fieldstr,field,structname,typeid,typename) \
  { (fieldstr), ((unsigned int) &(((structname *)0)->field)), \
	  (typeid), (typename), 0 }

#define CI_ARRAYFIELD(fieldstr,field,structname,typeid,typename,size) \
  { (fieldstr), ((unsigned int) &(((structname *)0)->field[0])), \
	  (typeid), (typename), (size) }

#define CI_ENDARRAY  };

/*-----------------------------------------------------------------------*
 * The C interface maintains its own symbol table for
 * storing C-constants, C-type and C-structure information.
 * The following tags are used to identify the nature of
 * entries in the symbol table
 *-----------------------------------------------------------------------*/

#define CI_LONGTYPE		0
#define CI_PTRTYPE		1
#define CI_INTTYPE		2
#define CI_STRINGTYPE	3
#define CI_SHORTTYPE	4
#define CI_CHARTYPE		5
#define CI_FLOATTYPE	6
#define CI_DOUBLETYPE	7
#define CI_RCONSTTYPE	8
#define CI_STRUCTTYPE	9
#define CI_CTYPE		10

/*-----------------------------------------------------------------------*
 * The following macros are used to load up the symbol table at
 * interface initialization time with info on C-constants,
 * C-types, and C-structures (the initialization routine as
 * well as each of the macro invocation code are output by
 * interface generator ).
 *-----------------------------------------------------------------------*/

extern	ALSPI_API(int)	sym_insert_2long ( char *, int, long, long );
extern	ALSPI_API(int)	sym_insert_dbl	( char *, int, double );
extern	ALSPI_API(int)	CI_get_integer	( PWord *, int );
extern	ALSPI_API(int)	CI_get_double	( double *, unsigned long, unsigned long );

extern	ALSPI_API(const char *) find_callback(void *func, void *object);

#define CI_INTCONST(name,val) 	\
	sym_insert_2long(name,CI_INTTYPE,(long)val,0);

#define CI_SHORTCONST(name,val) 	\
	sym_insert_2long(name,CI_SHORTTYPE,(long)val,0);

#define CI_CHARCONST(name,val) 	\
	sym_insert_2long(name,CI_CHARTYPE,(long)val,0);

#define CI_LONGCONST(name,val) 	\
	sym_insert_2long(name,CI_LONGTYPE,(long)val,0);

#define CI_PTRCONST(name,val) 	\
	sym_insert_2long(name,CI_PTRTYPE,(long)val,0);

#define CI_STRINGCONST(name,val) 	\
	sym_insert_2long(name,CI_STRINGTYPE,(long)val,0);

#define CI_FLOATCONST(name,val) 	\
	sym_insert_dbl(name,CI_FLOATTYPE,(double)val);

#define CI_DOUBLECONST(name,val) 	\
	sym_insert_dbl(name,CI_DOUBLETYPE,(double)(long)val);

#define CI_STRUCT(name,cname,defnptr)	\
  sym_insert_2long(name,CI_STRUCTTYPE,sizeof(cname),(long)defnptr);

#define CI_CTYPEDEF(name,ctype,typeid) \
  sym_insert_2long(name,CI_CTYPE,sizeof(ctype),typeid);

#define CI_RCONST(name,val)		\
	sym_insert_2long(name,CI_RCONSTTYPE,(long)val,0);

void pi_init(void);

#ifdef __cplusplus
}
#endif

#endif /* _ALSPI_H_INCLUDED_ */


text:
package org.eu.eark.denormalizedb.model;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.eu.eark.denormalizedb.model.util.Wrapping;

/**
 * The actual data contained in a column.
 */
public class ColumnData implements Iterable<Object> {

    private final TableData table;
    private final int colIndex;
    private final Map<Object, Integer> rowByValue = new HashMap<Object, Integer>();

    public ColumnData(TableData table, int colIndex) {
        this.table = table;
        this.colIndex = colIndex;
    }

    public Object row(int rowIndex) {
        return table.get(rowIndex).get(colIndex);
    }

    public Object[] rows(int[] rowIndexes) {
        Object[] values = new Object[rowIndexes.length];
        for (int i = 0; i < values.length; i++) {
            values[i] = row(rowIndexes[i]);
        }
        return values;
    }

    public Object[] rows() {
        Object[] values = new Object[size()];
        for (int i = 0; i < values.length; i++) {
            values[i] = row(i);
        }
        return values;
    }

    public int indexOf(Object value) {
        lazyFillLookup();
        Integer row = rowByValue.get(value);
        return Wrapping.toPrimitive(row, "object [" + value + "] not found in column");
    }

    private void lazyFillLookup() {
        if (rowByValue.isEmpty()) {
            int row = 0;
            for (Object value : this) {
                found(value, row);
                row++;
            }
        }
    }

    private void found(Object value, int inRow) {
        if (rowByValue.containsKey(value)) {
            return;
        }
        rowByValue.put(value, inRow);
    }

    public int[] indexesOf(Object[] values) {
        lazyFillLookup();
        Integer[] rowNums = new Integer[values.length];
        for (int i = 0; i < values.length; i++) {
            rowNums[i] = rowByValue.get(values[i]);
        }
        return Wrapping.toPrimitive(rowNums);
    }

    @Override
    public Iterator<Object> iterator() {
        return new Iterator<Object>() {
            private final Iterator<RowData> tableItr = table.iterator();

            @Override
            public boolean hasNext() {
                return tableItr.hasNext();
            }

            @Override
            public Object next() {
                return tableItr.next().get(colIndex);
            }

            @Override
            public void remove() {
                tableItr.remove();
            }
        };
    }

    public int size() {
        return table.size();
    }

}


text:
#pragma once

#include <linefinder.h>

namespace upm {
    /**
     * @brief Line Finder Sensor library
     * @defgroup linefinder libupm-linefinder
     * @ingroup seeed dfrobot gpio color robok
     */

    /**
     * @library linefinder
     * @sensor linefinder
     * @comname Infrared (IR) Based Line Finder
     * @altname Grove Line Finder, DFRobot Line Tracking sensor
     * @type color
     * @man seeed dfrobot
     * @con gpio
     * @kit robok
     *
     * @brief API for the  Line Finder Sensor
     *
     * UPM module for the Line Finder sensor. It outputs a
     * digital signal indicating whether it is detecting black on a
     * white background, or white on a black background.
     *
     * @image html linefinder.jpg
     * @snippet linefinder.cxx Interesting
     */
    class LineFinder {
    public:
        /**
         *  Line Finder digital sensor constructor
         *
         * @param pin Digital pin to use
         */
        LineFinder(int pin);

        /**
         * LineFinder destructor
         */
        ~LineFinder();

        /**
         * Determines whether white has been detected
         *
         * @return True if white is detected
         */
        bool whiteDetected();

        /**
         * Determines whether black has been detected
         *
         * @return True if black is detected
         */
        bool blackDetected();

    private:
        linefinder_context m_linefinder;
    };
}


text:
package com.google.mlkit.vision.automl.demo.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build.VERSION_CODES;
import android.preference.EditTextPreference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import androidx.camera.core.CameraSelector;
import com.google.android.gms.common.images.Size;
import com.google.common.base.Preconditions;
import com.google.mlkit.vision.automl.demo.CameraSource;
import com.google.mlkit.vision.automl.demo.CameraSource.SizePair;
import com.google.mlkit.vision.automl.demo.R;

/** Utility class to retrieve shared preferences. */
public final class PreferenceUtils {

  static void saveString(Context context, @StringRes int prefKeyId, @Nullable String value) {
    PreferenceManager.getDefaultSharedPreferences(context)
        .edit()
        .putString(context.getString(prefKeyId), value)
        .apply();
  }

  @Nullable
  public static SizePair getCameraPreviewSizePair(Context context, int cameraId) {
    Preconditions.checkArgument(
        cameraId == CameraSource.CAMERA_FACING_BACK
            || cameraId == CameraSource.CAMERA_FACING_FRONT);
    String previewSizePrefKey;
    String pictureSizePrefKey;
    if (cameraId == CameraSource.CAMERA_FACING_BACK) {
      previewSizePrefKey = context.getString(R.string.pref_key_rear_camera_preview_size);
      pictureSizePrefKey = context.getString(R.string.pref_key_rear_camera_picture_size);
    } else {
      previewSizePrefKey = context.getString(R.string.pref_key_front_camera_preview_size);
      pictureSizePrefKey = context.getString(R.string.pref_key_front_camera_picture_size);
    }

    try {
      SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
      return new SizePair(
          Size.parseSize(sharedPreferences.getString(previewSizePrefKey, null)),
          Size.parseSize(sharedPreferences.getString(pictureSizePrefKey, null)));
    } catch (RuntimeException e) {
      return null;
    }
  }

  @RequiresApi(VERSION_CODES.LOLLIPOP)
  @Nullable
  public static android.util.Size getCameraXTargetResolution(Context context, int lensfacing) {
    Preconditions.checkArgument(
        lensfacing == CameraSelector.LENS_FACING_BACK
            || lensfacing == CameraSelector.LENS_FACING_FRONT);
    String prefKey =
        lensfacing == CameraSelector.LENS_FACING_BACK
            ? context.getString(R.string.pref_key_camerax_rear_camera_target_resolution)
            : context.getString(R.string.pref_key_camerax_front_camera_target_resolution);
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    try {
      return android.util.Size.parseSize(sharedPreferences.getString(prefKey, null));
    } catch (RuntimeException e) {
      return null;
    }
  }

  public static boolean isCameraLiveViewportEnabled(Context context) {
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    String prefKey = context.getString(R.string.pref_key_camera_live_viewport);
    return sharedPreferences.getBoolean(prefKey, false);
  }

  public static String getAutoMLRemoteModelName(Context context) {
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
    String modelNamePrefKey = context.getString(R.string.pref_key_automl_remote_model_name);
    String defaultModelName = "mlkit_flowers";
    String remoteModelName = sharedPreferences.getString(modelNamePrefKey, defaultModelName);
    if (remoteModelName.isEmpty()) {
      remoteModelName = defaultModelName;
    }
    return remoteModelName;
  }

  public static void setUpRemoteModelNamePreferences(PreferenceFragment preferenceFragment) {
    EditTextPreference autoMLRemoteModelNamePref =
        (EditTextPreference)
            preferenceFragment.findPreference(
                preferenceFragment.getString(R.string.pref_key_automl_remote_model_name));
    autoMLRemoteModelNamePref.setSummary(autoMLRemoteModelNamePref.getText());
    autoMLRemoteModelNamePref.setOnPreferenceChangeListener(
        (preference, newValue) -> {
          String modelName = (String) newValue;
          if (!modelName.isEmpty()) {
            autoMLRemoteModelNamePref.setSummary((String) newValue);
            return true;
          }

          Toast.makeText(
                  preferenceFragment.getActivity(),
                  R.string.pref_key_automl_remote_model_name,
                  Toast.LENGTH_LONG)
              .show();
          return false;
        });
  }

  private PreferenceUtils() {}
}


text:
package cluster

import (
	"fmt"
	//"strconv"
	"testing"
	"time"
)

func TestSaveClusterSingletonLockIndex(t *testing.T) {
	jsonMap := make(map[string]interface{})
	jsonMap["id"] = "ip1"
	jsonMap["firstTimeStamp"] = time.Now().Format(time.RFC3339Nano)
	jsonMap["lastTimeStamp"] = time.Now().Format(time.RFC3339Nano)

	fmt.Println(saveClusterSingletonLock(
		indexClusterSingletonLock,
		typeCloudoneAnalysis,
		"test",
		jsonMap,
		false))
}

func TestLoadClusterSingletonLockIndex(t *testing.T) {
	jsonMap, err := loadClusterSingletonLock(indexClusterSingletonLock,
		typeCloudoneAnalysis,
		"test")
	fmt.Println(jsonMap, err)
	if err != nil && err.Error() == "record not found" {
		fmt.Println("record not found")
	}
	if jsonMap != nil {
		fmt.Println(time.Parse(time.RFC3339Nano, jsonMap["firstTimeStamp"].(string)))
	}

}


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NSubstituteAutoMocker;

namespace NGA.Tests.Infrastructure
{
    public class MockistTest<T>
        where T : class
    {
        protected T SystemUnderTest;
        protected NSubstituteAutoMocker<T> Mocker;

        [TestInitialize]
        public virtual void Init()
        {
            Mocker = new NSubstituteAutoMocker<T>();
            SystemUnderTest = Mocker.ClassUnderTest;

            Arrange();
            Act();
        }

        [TestCleanup]
        public virtual void TestCleanup()
        {
            CleanUp();
        }

        public virtual void Arrange() {}
        public virtual void Act() {}
        public virtual void CleanUp() {}
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

		<item value="true" key="WizardProjectsImportPage.STORE_NESTED_PROJECTS"/>
		<item value="true" key="WizardProjectsImportPage.STORE_COPY_PROJECT_ID"/>
		<item value="true" key="WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"/>
		<list key="WizardProjectsImportPage.STORE_DIRECTORIES">
			<item value=""/>
		</list>
		<list key="WizardProjectsImportPage.STORE_ARCHIVES">
			<item value="D:\GitHub\Programacion\UT7\Entrega\Instituto.zip"/>
			<item value="D:\GitHub\Programacion\UT7\Entrega\Coordenadas.zip"/>
			<item value="D:\GitHub\Programitas\Juego2D\proyectoEclipse.zip"/>
		</list>


text:
package br.uece.memcached.orchestrator.management;

import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import br.uece.memcached.orchestrator.endpoint.Server;
import br.uece.memcached.orchestrator.endpoint.ServersUtil;
import br.uece.memcached.orchestrator.management.ResourcePool.ResourceBuilder;

import com.google.common.collect.Iterables;

public class ServersHandler {

	private Random random;

	private SharedIndex sharedIndex;
	private Map<InetSocketAddress, ResourcePool<Server>> servers;

	public ServersHandler(SharedIndex sharedIndex, List<InetSocketAddress> serversAddresses, Integer connectionsCount) throws Exception {
		this.random = new Random();
		this.sharedIndex = sharedIndex;
		this.servers = new HashMap<InetSocketAddress, ResourcePool<Server>>(serversAddresses.size());

		for (final InetSocketAddress inetSocketAddress : serversAddresses) {

			this.servers.put(inetSocketAddress, new ResourcePool<Server>(connectionsCount, new ResourceBuilder<Server>() {
				@Override
				public Server build() {
					return new Server(inetSocketAddress);
				}
			}));
		}
	}

	public void associateKeyToServer(String key, Server server) {
		sharedIndex.put(key, Arrays.asList(server.getAddress()));
	}

	public Boolean disassociateKeyFromServers(String key) {
		@SuppressWarnings("unchecked")
		List<InetSocketAddress> addresses = (List<InetSocketAddress>) sharedIndex.remove(key);
		return addresses != null && !addresses.isEmpty();
	}

	public List<Server> getServersAssociatedWithKey(String key) {
		@SuppressWarnings("unchecked")
		List<InetSocketAddress> addresses = (List<InetSocketAddress>) sharedIndex.get(key);

		if (addresses != null && !addresses.isEmpty()) {
			List<Server> servers = new ArrayList<Server>(addresses.size());

			for (InetSocketAddress address : addresses) {
				servers.add(this.servers.get(address).getResource());
			}

			return servers;
		}
		else {
			return new ArrayList<Server>(0);
		}
	}

	public Server getBestServerAssociatedWithKey(String key) {
		//TODO get the load from some other place, avoiding resource lock

		List<Server> servers = getServersAssociatedWithKey(key);

		if (servers.size() > 1) {
			Server bestServer = ServersUtil.minLoad(servers);

			servers.remove(bestServer);
			releaseServerUsage(servers);

			return bestServer;
		}
		else {
			return Iterables.getOnlyElement(servers, null);
		}
	}

	public Server getBestServer() {
		//TODO select based on some threshold

		List<ResourcePool<Server>> servers = new ArrayList<ResourcePool<Server>>(this.servers.values());
		return servers.get(random.nextInt(servers.size())).getResource();
	}

	public void releaseServerUsage(List<Server> servers) {
		for (Server server : servers) {
			this.servers.get(server.getAddress()).returnResource(server);
		}
	}

	public void releaseServerUsage(Server... servers) {
		releaseServerUsage(Arrays.asList(servers));
	}

}


text:
import pandas as pd
import numpy as np
import operator
import os
import re
import glob
import trace
def INVALID_OBS():
    invalid_obs = []
    for DIR_NAME in all_observations:
        current_obslog = glob.glob(data_dir+DIR_NAME+'/'+'*.obslog')
        if current_obslog == []:
            continue

        #Extract substring that contains obslog relative path
        relative_path = re.findall(r'[/][\d]+[.]obslog', current_obslog[0])[0][1:]
        #Invalid file (not fitting given constraints i.e. < 900 MHz and IF BW != 6,16,32)
        if relative_path not in valid_observations:
 	    invalid_obs.append(data_dir+DIR_NAME)

	#Valid obslog file with no LTA file in the DIR
        if relative_path in valid_observations:
            if glob.glob(data_dir+DIR_NAME+'/'+'*.lta') == []:
                #print data_dir+DIR_NAME
		invalid_obs.append(data_dir+DIR_NAME)
    return invalid_obs

def VALID_OBS():
    valid_obs = []
    for DIR_NAME in all_observations:
            current_obslog = glob.glob(data_dir+DIR_NAME+'/'+'*.obslog')
	    if current_obslog == []:
            	continue
            #Extract substring that contains obslog relative path
            relative_path = re.findall(r'[/][\d]+[.]obslog', current_obslog[0])[0][1:]

            if relative_path in valid_observations:
                if glob.glob(data_dir+DIR_NAME+'/'+'*.lta') != []:
                    valid_obs.append(data_dir+DIR_NAME)
    return valid_obs

def NUM_LTA():
    valid_obs = []
    all_lta_files = []
    for DIR_NAME in all_observations:
        current_obslog = glob.glob(data_dir+DIR_NAME+'/'+'*.obslog')

        #Extract substring that contains obslog relative path
        relative_path = re.findall(r'[/][\d]+[.]obslog', current_obslog[0])[0][1:]

        if relative_path in valid_observations:
            current_dir_lta_files = glob.glob(data_dir+DIR_NAME+'/'+'*.lta*')
            #print current_dir_lta_files
            if(current_dir_lta_files != []):
                valid_obs.append(data_dir+DIR_NAME)
                all_lta_files.append(current_dir_lta_files)
    return len([i for j in all_lta_files for i in j])

def extract( file_name ):
    with open(file_name) as f:
        for i,line in enumerate(f,1):
            if "SCN" in line:
                return i

def main(lta_name):
    calibrator_list = ['3C48', '3C147', '3C286']
    os.system('ltahdr -i'+ lta_name + '> lta_file.txt')
    dictionary = {}
    try:
        skipped_rows = extract('lta_file.txt')-1

        header = pd.read_csv('lta_file.txt',skiprows=skipped_rows,delimiter=r"\s+")
        flux = list(set(header["OBJECT"]))
        #print flux

        header['Nrecs'] = header['Nrecs'].astype(float)

        for i in flux :
            temp = header.loc[header.OBJECT==i,'Nrecs'].values
            temp = np.mean(temp)
            dictionary[i]=temp

        #Sort the list of targets according to the number of recordings
        list_of_targets = sorted(dictionary.iteritems(),key=operator.itemgetter(1), reverse=True)
        for i in list_of_targets:
            if i[0] in calibrator_list:
                continue
            else:
                os.system('rm lta_file.txt')
                return i[0]
        #Return this value if entire list of targets is populated with calibrators
        return -1
    except:
        pass

def test_validity():
    #valid_observations = VALID_OBS()
    #lta_file_count = 0
    #for DIR in valid_observations:

    lta_uvfits_files = glob.glob('*.lta*')
    uvfits_files = glob.glob('*.lta*.UVFITS')
    all_lta_files = [i for i in lta_uvfits_files if i not in uvfits_files]
    output_list = []
    for LTA_FILE in all_lta_files:
        try:
            output = main(LTA_FILE)
            #Check if valid target name is found
            #if output != -1:
                #lta_success_file.write(LTA_FILE + '\n' + output + '\n')
                #lta_file_count += 1
             #   output_list.append([output, LTA_FILE])

            if output == -1:
                continue
                #ltahdr_error_dir.write(DIR+ '/' + LTA_FILE + '\n')
                #lta_file_count += 1
        except:
	    continue
            #Log the error directory to a file
            #ltahdr_error_dir.write(DIR+ '/' + LTA_FILE + '\n')
            #lta_file_count += 1
    return output


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.restapi;

import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
import com.yahoo.restapi.RestApi;
import com.yahoo.restapi.RestApiRequestHandler;
import com.yahoo.vespa.hosted.provision.NodeRepository;

import javax.inject.Inject;

/**
 * @author mpolden
 * @author jonmv
 */
public class LoadBalancersV1ApiHandler extends RestApiRequestHandler<LoadBalancersV1ApiHandler> {

    private final NodeRepository nodeRepository;

    @Inject
    public LoadBalancersV1ApiHandler(ThreadedHttpRequestHandler.Context parentCtx, NodeRepository nodeRepository) {
        super(parentCtx, LoadBalancersV1ApiHandler::createRestApiDefinition);
        this.nodeRepository = nodeRepository;
    }

    private static RestApi createRestApiDefinition(LoadBalancersV1ApiHandler self) {
        return RestApi.builder()
                      .addRoute(RestApi.route("/loadbalancers/v1")
                                       .get(self::getLoadBalancers))
                      .build();
    }

    private HttpResponse getLoadBalancers(RestApi.RequestContext context) {
        return new LoadBalancersResponse(context.request(), nodeRepository);
    }

}


text:
sap.ui.define([
   "sap/ui/core/mvc/Controller",
   "sap/m/MessageToast"
], function (Controller, MessageToast) {
   "use strict";
   return Controller.extend("com.scout138.inventoryManager.mvc.controller.App", {

      onShowHello : function () {
         // read msg from i18n model
         var oBundle = this.getView().getModel("i18n").getResourceBundle();
         var sRecipient = this.getView().getModel().getProperty("/recipient/name");
         var sMsg = oBundle.getText("helloMsg", [sRecipient]);
         // show message
         MessageToast.show(sMsg);
      }
   });
});


text:
@class MFSideMenuContainerViewController;

// category on UIViewController to provide reference to the
// menuContainerViewController in any of the contained View Controllers
@interface UIViewController (MFSideMenuAdditions)

@property(nonatomic, readonly, retain)
    MFSideMenuContainerViewController* menuContainerViewController;

@end


text:
import { SObject } from '../types';
export { SObjectDescribe, toMinimalSObject } from './sObjectDescribe';

export type SObjectShortDescription = Pick<SObject, 'name' | 'custom'>;

export interface SObjectSelector {
  select(sobject: SObjectShortDescription): boolean;
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Panel de Administrador</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        Toggle navigation

      </button>
      Administrador BLOX6 MOvIES

Localizaciones

Cines

Salas

Películas

Cartelera

Ventas

Cine Modificado

Id_UbiCine:
<?php echo $_POST["Id_UbiCine"]; ?>

Id_Manager:
<?php echo $_POST["Id_Manager"]; ?>

Ubicacion Nombre:
<?php echo $_POST["Ubicacion_Nombre"]; ?>

Telefono:
<?php echo $_POST["Ubicacion_Telefono"]; ?>

Identificacion Ciudad:
<?php echo $_POST["Id_Ciudad"]; ?>

Direccion:
<?php echo $_POST["Ubicacion_direccion"]; ?>

	<?php

$serverName = "172.29.185.108";
$connectionInfo = array( "Database"=>"Sistema_Cine", "UID"=>"sa", "PWD"=>"Password1.");
$conn = sqlsrv_connect( $serverName, $connectionInfo);

$phpId_UbiCine = $_POST["Id_UbiCine"];

$phpId_Manager = $_POST["Id_Manager"];
	$phpUbicacion_Nombre = $_POST["Ubicacion_Nombre"];
   	$phpUbicacion_Telefono = $_POST["Ubicacion_Telefono"];
      	$phpId_Ciudad = $_POST["Id_Ciudad"];
   	$phpUbicacion_direccion = $_POST["Ubicacion_direccion"];

echo $phpId_UbiCine;
	echo $phpId_Manager;
	echo $phpUbicacion_Nombre;
    echo $phpUbicacion_Telefono;
    echo $phpId_Ciudad;
    echo $phpUbicacion_direccion;

if ($conn){
    echo "connected";
    if(($result = sqlsrv_query($conn,"UPDATE Ubicacion_Cine set Id_Manager ='$phpId_Manager', Ubicacion_Nombre ='$phpUbicacion_Nombre', Ubicacion_Telefono = '$phpUbicacion_Telefono', Id_Ciudad = '$phpId_Ciudad', Ubicacion_direccion = '$phpUbicacion_direccion' where (Id_UbiCine)=('$phpId_UbiCine')")) !== false){
		 while( $obj = sqlsrv_fetch_object( $result )) {
			       echo"borrada correctamente";

	//$recurso=sqlsrv_prepare($result);
	//$recurso=sqlsrv_prepare($result);
	}
		//elseif (sqlsrv_execute($result)){
      //echo"Agregado correctamente";
		//}

		//else{
      //echo"No Agregado";
//}
        // while( $obj = sqlsrv_fetch_object( $result )) {
			// echo '
';
			// echo ''.$obj->Id_topic.'	';
			// echo ''.$obj->Name.'	';

        }

else{
    die(print_r(sqlsrv_errors(), true));

}
sqlsrv_close( $conn );

	}

	?>

UH @2016 Diseño de Aplicaciones 2do Cuatrimestre 2016 L N


text:
<?php

namespace Kunstmaan\AdminBundle\Tests\EventListener;

use Kunstmaan\AdminBundle\EventListener\ConsoleExceptionSubscriber;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\OutputInterface;

class ConsoleExceptionSubscriberTest extends TestCase
{
    public function testListener()
    {
        // Remove when sf3.4 support is removed
        if (!class_exists(ConsoleErrorEvent::class)) {
            // Nothing to test
            return;
        }

        $error = new \TypeError('An error occurred');
        $output = $this->createMock(OutputInterface::class);
        $logger = $this->createMock(LoggerInterface::class);
        $logger->expects($this->once())->method('critical');

        $subscriber = new ConsoleExceptionSubscriber($logger);
        $subscriber->onConsoleError(new ConsoleErrorEvent(new ArgvInput(['console.php', 'test:run', '--foo=baz', 'buzz']), $output, $error, new Command('test:run')));
    }
}


text:
package smile.gap;

/**
 * Artificial chromosomes in genetic algorithm/programming encoding candidate
 * solutions to an optimization problem. Note that chromosomes have to
 * implement Comparable interface to support comparison of their fitness.
 *
 * @author Haifeng Li
 */
public interface Chromosome extends Comparable<Chromosome> {

    /**
     * Returns the fitness of chromosome.
     */
    public double fitness();

    /**
     * Returns a new random instance.
     */
    public Chromosome newInstance();

    /**
     * Returns a pair of offsprings by crossovering this one with another one
     * according to the crossover rate, which determines how often will be
     * crossover performed. If there is no crossover, offspring is exact copy of
     * parents. Various crossover strategies can be employed.
     */
    public Chromosome[] crossover(Chromosome another);

    /**
     * For genetic algorithms, this method mutates the chromosome randomly.
     * The offspring may have no changes since the mutation rate is usually
     * very low. For Lamarckian algorithms, this method actually does the local
     * search such as such as hill-climbing.
     */
    public void mutate();
}


text:
package org.xson.core.testmodel;

import java.util.List;

import org.xson.core.vo.Phone;

public class XUser8 {

	List<Phone> phones;

	public List<Phone> getPhones() {
		return phones;
	}

	public void setPhones(List<Phone> phones) {
		this.phones = phones;
	}

}


text:
const getVuePressBars = require("vuepress-bar"); // eslint-disable-line import/no-extraneous-dependencies
const { join } = require("path");
const packageData = require("../../package.json");

const GOOGLE_ANALYTICS_ID = packageData.vuepress && packageData.vuepress["google-analytics-id"];

const { nav, sidebar } = getVuePressBars(join(__dirname, "../../docs"), { addReadMeToFirstGroup: false });
const plugins = ["@vuepress/active-header-links", "@vuepress/pwa"];

if (GOOGLE_ANALYTICS_ID) plugins.push(["@vuepress/google-analytics", { ga: GOOGLE_ANALYTICS_ID }]);

// If `addReadMeToFirstGroup` is `true`, and another link is not added API sidebar, it moves root README.md into first available section.
// Below conditional code reverses this for api section by moving README.md link from children of classes (or first section) to main section.
// if (sidebar["/nav.02.api/"][0].children) {
//   sidebar["/nav.02.api/"][0].children.shift();
//   sidebar["/nav.02.api/"].unshift("");
// }

// Find item with text "Api" and change it to "API".
nav
  .filter((item) => ["Api", "Cli"].includes(item.text))
  .map((item) => {
    item.text = item.text.toUpperCase(item.text); // eslint-disable-line no-param-reassign
    return item;
  });

module.exports = {
  title: packageData.label || packageData.name,
  description: packageData.description,
  plugins,
  themeConfig: {
    repo: typeof packageData.repository === "object" ? packageData.repository.url : packageData.repository,
    nav,
    sidebar,
    sidebarDepth: 2,
  },
};


text:
package jordb;

/**
 *
 * @author Robert Henry
 * @version 1.0 Last Updated: 06/15/1999
 * @see Condition
 *
 */
public class And extends LogicalCondition implements Condition
{

	public And()
	{
		super();
	}

	public And(Condition l,Condition r)
	{
		super(l,r);
	}

	public boolean compare() throws TableException
	{
		return mLeft.compare() && mRight.compare();
	}

}


text:
<?php
return [
'Articles' => 'Artykuły',
'Categories' => 'Kategorie',
'Comments' => 'Komentarze',
];


text:
NS_ROOT
NS_BEGIN(analysis)

////////////////////////////////////////////////////////////////////////////////
/// @brief an analyzer capable of breaking up delimited text into tokens as per
///        RFC4180 (without starting new records on newlines)
////////////////////////////////////////////////////////////////////////////////
class delimited_token_stream: public analyzer, util::noncopyable {
 public:
  DECLARE_ANALYZER_TYPE();

  // for use with irs::order::add<T>() and default args (static build)
  DECLARE_FACTORY(const string_ref& delimiter);

  delimited_token_stream(const irs::string_ref& delimiter);
  virtual const irs::attribute_view& attributes() const NOEXCEPT override {
    return attrs_;
  }
  static void init(); // for trigering registration in a static build
  virtual bool next() override;
  virtual bool reset(const string_ref& data) override;

 private:
  class term_attribute final: public irs::term_attribute {
   public:
    void value(const irs::bytes_ref& value) { value_ = value; }
  };

  irs::attribute_view attrs_;
  irs::bytes_ref data_;
  irs::bytes_ref delim_;
  irs::bstring delim_buf_;
  irs::increment inc_;
  irs::offset offset_;
  irs::payload payload_; // raw token value
  term_attribute term_; // token value with evaluated quotes
  irs::bstring term_buf_; // buffer for the last evaluated term
};

NS_END // analysis
NS_END // ROOT

#endif


text:
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using SimpleIdentityServer.AccountFilter;

namespace SimpleIdentityServer.Core.Services
{
    internal sealed class DefaultAccountFilter : IAccountFilter
    {
        public Task<AccountFilterResult> Check(IEnumerable<Claim> claims)
        {
            return Task.FromResult(new AccountFilterResult
            {
                IsValid = true
            });
        }
    }
}


text:
import {merge} from 'lodash'
import {SUBMIT_LOGIN} from '../Config/Constants'

export interface IUser {
    login: string
    img: string
}

export interface ILoginReducer {
    user: IUser
}

const initialState: ILoginReducer = {
    user: {
        login: '',
        img: ''
    }
};

export const LoginReducer = (state: ILoginReducer, action): ILoginReducer => {
    switch (action.type) {
        case SUBMIT_LOGIN:
            return merge({},
                state,
                action
            )
        default:
            return state || initialState;
    }
}


text:
title: "Weishi Razor Review"
date: 2011-04-08 00:00
---

I made the switch to double-edged "safety" razors a few months ago. I chose the [Weshi Classic](http://www.fendrihan.com/weishi-classic-doubleedge-razor-p-174.html) because it was apparently great for beginners. Bad decision. "Good for beginners" means "it's a toy." I earnestly think it's impossible to cut your face with this thing, as there is no room between the blade and the guard and the blade is quite recessed. I've moved onto a much friendlier razor and will let you know how that goes. It's only been two shaves but I finally feel the closer shave I was promised with the safety razor.

Aside: For anyone using safety razors, The Shamporium in King's Place as Merkur 10-packs of Super Platinum bales for 95 cents.

<!-- more -->


text:
layout: post-norway
title: préambule
categories: [news, italy]
plugin: intense
---

Solstice d'été 2014, 7 heures 32, un coin perdu quelque part en
Bretagne, je me réveille prêt à partir à l'aventure.  La journée
s'annonce chaude, favorable à une virée de 15h dans une voiture sans
climatisation en direction de Valsavarenche dans le nord de l'Italie.

Sac à dos dans le coffre, thermos de café sous le siège, GPS volé en
douce au petit frère qui dort (lorsqu'il s'en rendra compte, je serais
déjà loin! oui je suis lâche et méchant), playlist pour conduire, je
prends la direction de Nantes pour attraper 2 heures plus tard Faltad
et son sac à dos. Il commence déjà à faire chaud dans la voiture, et
c'est pas près de s'améliorer: vers 15h, bos thermomètres planqués
dans le coffre indiquent 38 degrés.

On essaye plein de techniques différentes pour gagner quelques degrés
et la plus efficace consiste à ouvrir toutes les vitres en roulant à
130 sur l'autoroute. Ça fait plein de bruit et il y a un moment où le
compromis bruit versus chaleur devient moins intéressant. Donc on
alterne, toutes les 20 minutes environs on ouvre les vitres pour 3/4
minutes.

Pas grand chose d'intéressant sur l'autoroute, mis à part les messages
sur les panneaux, un exercice difficile qui consiste à faire passer le
plus de choses dans très court, voici une compilation des meilleurs:

- La ceinture devant derrière j'adhère
- Détendez vous sur les aires d'autoroute
- SVP halte aux déchets sauvages
- Homme en jaune, il protège votre vie
- Téléphone au volant C pas sérieux

Après avoir transpiré environs 2 litres et traversé des tunnels dignes
de Trackmania, on arrive à Lyon où l'on s'arrête pour faire le plein
de courses (en évitant soigneusement le riz rond): le cadis est chargé
de paquets de barres énergétiques banane chocolat et cacahuète (qui
ont le meilleur rapport énergie/poids/prix).  Ensuite on s'arrête à un
Quick (probablement notre dernier repas riche en calories avant un
petit moment), et on en profite pour récupérer plein de sachets de
sauce en s'imagineant heureux de ne pas manger des pâtes fades.

En théorie on pensait se poser un peu après Lyon pour reprendre la
route le lendemain matin, mais je suis toujours motivé à conduire et
donc on continue. On passe le col Saint Bernard vers 23 heures et on
traverse les villages déserts à cette heure avec du Sigur Rós dans les
oreilles.

On décide de mettre du Salut c'est cool pour se réveiller un peu, et
par une drôle de coïncidence, on aperçoit des lumières lointaines au
prochain village qui proviennent d'un sapin géant submergé de fumée
artificielle: c'est la grosse teuf, on traverse au ralenti le nuage
dans lequel déambulent des silhouettes alcoolisées sur de la techno
qui fait mal ; on en profite pour mettre un peu plus fort Merci Nature
d'être là avant de continuer.

Je ne suis pas habitué à conduire et après 14 heures de route, tout
content de moi, je dis à Faltad que j'ai probablement pris un peu
d'XP. Faltad me fait alors remarquer que je viens de m'arrêter à un
feu vert.

On approche bientôt du but, il fait toujours chaud (environs 25
degrés), et comme par magie, on voit un jet d'arrosage qui déborque
sur la route, on ouvre les vitres et on passe au ralenti en profitant
de la petite douche gratuite. Vers minuit 30, on est à Valsavarenche
où tout est fermé, on a pas trop la motivation pour improviser quelque
chose d'intelligent et on s'endort dans la voiture sur le parking du
camping sans penser au prochain réveil difficile.


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="ndm.miniwms.dao.CompanyUserMapper">
	<resultMap id="BaseResultMap" type="ndm.miniwms.pojo.CompanyUser">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="company_id" property="companyId" jdbcType="INTEGER" />
	</resultMap>

	<select id="all" resultMap="BaseResultMap">
		select * from company_user
	</select>

	<select id="selectTab" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
	select * from company_user where 1 = 1
	</select>

	<delete id="delById" parameterType="java.lang.Integer">
		delete from company_user
		where id = #{id,jdbcType=INTEGER}
	</delete>

	<update id="update" parameterType="ndm.miniwms.pojo.CompanyUser">
		update company_user
		set created=#{created},modified=#{modified},username=#{username},
		password=#{password},address=#{address},tel=#{tel},cname=#{cname},
		company_id=#{companyId}
		where id = #{id,jdbcType=INTEGER}
	</update>

	<insert id="add" parameterType="ndm.miniwms.pojo.CompanyUser">
		insert into company_user
		(created, modified, username, password, address,
		tel, cname, company_id
		) values (#{created}, #{modified}, #{username},
		#{password},
		#{address}, #{tel}, #{cname}, #{companyId})
	</insert>
</mapper>


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.datacatalog.v1beta1.model;

/**
 * Message capturing a taxonomy and its policy tag hierarchy as a nested proto. Used for taxonomy
 * import/export and mutation.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Cloud Data Catalog API. For a detailed
 * explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudDatacatalogV1beta1SerializedTaxonomy extends com.google.api.client.json.GenericJson {

  /**
   * A list of policy types that are activated for a taxonomy.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> activatedPolicyTypes;

  /**
   * Description of the serialized taxonomy. The length of the description is limited to 2000 bytes
   * when encoded in UTF-8. If not set, defaults to an empty description.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String description;

  /**
   * Required. Display name of the taxonomy. Max 200 bytes when encoded in UTF-8.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayName;

  /**
   * Top level policy tags associated with the taxonomy if any.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GoogleCloudDatacatalogV1beta1SerializedPolicyTag> policyTags;

  static {
    // hack to force ProGuard to consider GoogleCloudDatacatalogV1beta1SerializedPolicyTag used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudDatacatalogV1beta1SerializedPolicyTag.class);
  }

  /**
   * A list of policy types that are activated for a taxonomy.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getActivatedPolicyTypes() {
    return activatedPolicyTypes;
  }

  /**
   * A list of policy types that are activated for a taxonomy.
   * @param activatedPolicyTypes activatedPolicyTypes or {@code null} for none
   */
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy setActivatedPolicyTypes(java.util.List<java.lang.String> activatedPolicyTypes) {
    this.activatedPolicyTypes = activatedPolicyTypes;
    return this;
  }

  /**
   * Description of the serialized taxonomy. The length of the description is limited to 2000 bytes
   * when encoded in UTF-8. If not set, defaults to an empty description.
   * @return value or {@code null} for none
   */
  public java.lang.String getDescription() {
    return description;
  }

  /**
   * Description of the serialized taxonomy. The length of the description is limited to 2000 bytes
   * when encoded in UTF-8. If not set, defaults to an empty description.
   * @param description description or {@code null} for none
   */
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy setDescription(java.lang.String description) {
    this.description = description;
    return this;
  }

  /**
   * Required. Display name of the taxonomy. Max 200 bytes when encoded in UTF-8.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayName() {
    return displayName;
  }

  /**
   * Required. Display name of the taxonomy. Max 200 bytes when encoded in UTF-8.
   * @param displayName displayName or {@code null} for none
   */
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy setDisplayName(java.lang.String displayName) {
    this.displayName = displayName;
    return this;
  }

  /**
   * Top level policy tags associated with the taxonomy if any.
   * @return value or {@code null} for none
   */
  public java.util.List<GoogleCloudDatacatalogV1beta1SerializedPolicyTag> getPolicyTags() {
    return policyTags;
  }

  /**
   * Top level policy tags associated with the taxonomy if any.
   * @param policyTags policyTags or {@code null} for none
   */
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy setPolicyTags(java.util.List<GoogleCloudDatacatalogV1beta1SerializedPolicyTag> policyTags) {
    this.policyTags = policyTags;
    return this;
  }

  @Override
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy set(String fieldName, Object value) {
    return (GoogleCloudDatacatalogV1beta1SerializedTaxonomy) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudDatacatalogV1beta1SerializedTaxonomy clone() {
    return (GoogleCloudDatacatalogV1beta1SerializedTaxonomy) super.clone();
  }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sk89q</groupId>
  <artifactId>rebar</artifactId>
  <version>4.1.0-SNAPSHOT</version>
  <name>Rebar</name>
  <description>A plugin framework.</description>
  <licenses>
    <license>
      <name>GNU Lesser General Public License 2.0</name>
      <url>LICENSE-LGPL3.txt</url>
      <distribution>repo</distribution>
      <comments>License on all contributions</comments>
    </license>
    <license>
      <name>3-clause BSD license</name>
      <distribution>repo</distribution>
      <url>LICENSE-BSD.txt</url>
      <comments>Additional license on all contributions by third parties</comments>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/sk89q/rebar.git</connection>
    <developerConnection>scm:git:git@github.com:sk89q/rebar.git</developerConnection>
    <url>https://github.com/sk89q/rebar</url>
    <tag>master</tag>
  </scm>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <repositories>
    <repository>
      <id>sk89q-repo</id>
      <url>http://maven.sk89q.com/repo/</url>
    </repository>
    <repository>
      <id>bukkit-repo</id>
      <url>http://repo.bukkit.org/content/groups/public</url>
    </repository>
    <repository>
      <id>sonatype-public</id>
      <url>http://oss.sonatype.org/content/groups/public/</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>com.sk89q</groupId>
      <artifactId>worldedit</artifactId>
      <version>5.3</version>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>1.10</version>
    </dependency>
    <dependency>
      <groupId>org.bukkit</groupId>
      <artifactId>bukkit</artifactId>
      <version>1.3.1-R2.0</version>
    </dependency>
    <dependency>
      <groupId>com.jolbox</groupId>
      <artifactId>bonecp</artifactId>
      <version>0.7.1.RELEASE</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <site>
      <id>sk89q-docs-upload</id>
      <url>ftp://sk89q-maven-deploy/rebar/</url>
    </site>
    <repository>
      <id>maven.sk89q.com</id>
      <url>http://maven.sk89q.com/artifactory/libs-release-local</url>
    </repository>
  </distributionManagement>
  <build>
    <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
         <artifactId>wagon-ftp</artifactId>
         <version>1.0-beta-6</version>
      </extension>
    </extensions>

    <resources>
      <resource>
        <targetPath>.</targetPath>
        <filtering>true</filtering>
        <directory>${basedir}/src/main/resources/</directory>
        <includes>
          <include>plugin.yml</include>
        </includes>
      </resource>
      <resource>
        <targetPath>defaults/</targetPath>
        <filtering>true</filtering>
        <directory>${basedir}/src/main/resources/</directory>
        <includes>
          <include>materials.yml</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <configuration>
          <archive>
            <addMavenDescriptor>true</addMavenDescriptor>
            <manifestEntries>
              <Class-Path></Class-Path>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.3.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <reportPlugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.5</version>
            <reportSets>
              <reportSet>
                <reports>
                  <report>license</report>
                  <report>index</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.8.1</version>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
require 'helper'

describe Charm::Page do
  subject { create :page }

  it_behaves_like Charm::HasPath
  it { should validate_uniqueness_of(:path) }

  %w[/session/new /pages /pages/new /pages/1 /pages/1/edit].each do |wrong_path|
    it { should_not allow_value(wrong_path).for(:path) }
  end

  it { should validate_presence_of(:heading) }
  it { should validate_presence_of(:body) }
end


text:
<?php

namespace Magento\Framework\Data;

use Magento\Framework\Data\Tree\Node;
use Magento\Framework\Data\Tree\Node\Collection as NodeCollection;

/**
 * Data tree
 *
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Tree
{
    /**
     * Nodes collection
     *
     * @var NodeCollection
     */
    protected $_nodes;

    /**
     * Enter description here...
     *
     */
    public function __construct()
    {
        $this->_nodes = new NodeCollection($this);
    }

    /**
     * Enter description here...
     *
     * @return \Magento\Framework\Data\Tree
     */
    public function getTree()
    {
        return $this;
    }

    /**
     * Enter description here...
     *
     * @param Node $parentNode
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function load($parentNode = null)
    {
    }

    /**
     * Enter description here...
     *
     * @param int|string $nodeId
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function loadNode($nodeId)
    {
    }

    /**
     * Append child
     *
     * @param array|Node $data
     * @param Node $parentNode
     * @param Node $prevNode
     * @return Node
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function appendChild($data, $parentNode, $prevNode = null)
    {
        if (is_array($data)) {
            $node = $this->addNode(new Node($data, $parentNode->getIdField(), $this), $parentNode);
        } elseif ($data instanceof Node) {
            $node = $this->addNode($data, $parentNode);
        }
        return $node;
    }

    /**
     * Add node
     *
     * @param Node $node
     * @param Node $parent
     * @return Node
     */
    public function addNode($node, $parent = null)
    {
        $this->_nodes->add($node);
        $node->setParent($parent);
        if ($parent !== null && $parent instanceof Node) {
            $parent->addChild($node);
        }
        return $node;
    }

    /**
     * Move node
     *
     * @param Node $node
     * @param Node $parentNode
     * @param Node $prevNode
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function moveNodeTo($node, $parentNode, $prevNode = null)
    {
    }

    /**
     * Copy node
     *
     * @param Node $node
     * @param Node $parentNode
     * @param Node $prevNode
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function copyNodeTo($node, $parentNode, $prevNode = null)
    {
    }

    /**
     * Remove node
     *
     * @param Node $node
     * @return $this
     */
    public function removeNode($node)
    {
        $this->_nodes->delete($node);
        if ($node->getParent()) {
            $node->getParent()->removeChild($node);
        }
        unset($node);
        return $this;
    }

    /**
     * Create node
     *
     * @param Node $parentNode
     * @param Node $prevNode
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function createNode($parentNode, $prevNode = null)
    {
    }

    /**
     * Get child
     *
     * @param Node $node
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function getChild($node)
    {
    }

    /**
     * Get children
     *
     * @param Node $node
     * @return void
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function getChildren($node)
    {
    }

    /**
     * Enter description here...
     *
     * @return NodeCollection
     */
    public function getNodes()
    {
        return $this->_nodes;
    }

    /**
     * Enter description here...
     *
     * @param Node $nodeId
     * @return Node
     */
    public function getNodeById($nodeId)
    {
        return $this->_nodes->searchById($nodeId);
    }

    /**
     * Get path
     *
     * @param Node $node
     * @return array
     */
    public function getPath($node)
    {
        if ($node instanceof Node) {
        } elseif (is_numeric($node)) {
            if ($_node = $this->getNodeById($node)) {
                return $_node->getPath();
            }
        }
        return [];
    }
}


text:
import * as React from 'react'
import * as Kb from '../../common-adapters'
import * as Styles from '../../styles'

type EnterKeyProps = {
  error: string
  onKeyChange: (key: string) => void
  secretKey: string
}

const EnterKey = (props: EnterKeyProps) => (
  <Kb.Box2
    direction="vertical"
    fullWidth={true}
    gap={Styles.isMobile ? 'small' : 'medium'}
    style={{flex: 1}}
    gapStart={!Styles.isMobile}
  >
    {!Styles.isMobile && (
      <Kb.Box2 direction="vertical" gap="medium" centerChildren={true}>
        <Kb.Icon type="icon-wallet-add-48" />
        <Kb.Text type="Header">Link an existing account</Kb.Text>
      </Kb.Box2>
    )}
    <Kb.Box2 direction="vertical" gap="xtiny" fullWidth={true} style={styles.inputContainer}>
      <Kb.LabeledInput
        placeholder="Paste your secret key (SDNBUW...SC7632)"
        multiline={true}
        rowsMin={2}
        rowsMax={2}
        value={props.secretKey}
        onChangeText={props.onKeyChange}
        autoFocus={true}
        maxLength={56}
        error={!!props.error}
      />
      {!!props.error && (
        <Kb.Text type="BodySmall" style={styles.error}>
          {props.error}
        </Kb.Text>
      )}
    </Kb.Box2>
    <Kb.InfoNote>
      <Kb.Box2 direction="vertical" fullWidth={true}>
        <Kb.Text center={true} type="BodySmall" style={styles.infoText}>
          This imports a Stellar secret key so you can also use it in Keybase. You can continue to use this
          Stellar account in other wallet apps.
        </Kb.Text>
      </Kb.Box2>
    </Kb.InfoNote>
  </Kb.Box2>
)

const styles = Styles.styleSheetCreate(
  () =>
    ({
      error: Styles.platformStyles({
        common: {
          color: Styles.globalColors.redDark,
          textAlign: 'left',
          width: '100%',
        },
        isElectron: {
          wordWrap: 'break-word',
        },
      }),
      infoText: Styles.platformStyles({
        isMobile: {
          paddingLeft: Styles.globalMargins.medium,
          paddingRight: Styles.globalMargins.medium,
        },
      }),
      inputContainer: Styles.platformStyles({
        common: {
          alignItems: 'flex-start',
        },
        isElectron: {width: '100%'},
        isMobile: {
          borderBottomWidth: 1,
          borderColor: Styles.globalColors.black_05,
          borderStyle: 'solid',
          paddingBottom: Styles.globalMargins.tiny,
          paddingLeft: Styles.globalMargins.small,
          paddingRight: Styles.globalMargins.small,
          paddingTop: Styles.globalMargins.tiny,
        },
      }),
    } as const)
)

export default EnterKey