text:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Admin
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.btnGenerateCoordinates = New System.Windows.Forms.Button()
        Me.SuspendLayout()
        '
        'btnGenerateCoordinates
        '
        Me.btnGenerateCoordinates.Location = New System.Drawing.Point(12, 12)
        Me.btnGenerateCoordinates.Name = "btnGenerateCoordinates"
        Me.btnGenerateCoordinates.Size = New System.Drawing.Size(126, 23)
        Me.btnGenerateCoordinates.TabIndex = 0
        Me.btnGenerateCoordinates.Text = "Generate Coordinates"
        Me.btnGenerateCoordinates.UseVisualStyleBackColor = True
        '
        'Admin
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 261)
        Me.Controls.Add(Me.btnGenerateCoordinates)
        Me.Name = "Admin"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Admin"
        Me.ResumeLayout(False)

    End Sub

    Friend WithEvents btnGenerateCoordinates As Button
End Class


text:
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "spec_helper"))

describe Chef::Provider::Package::EasyInstall do
  before(:each) do
    @node = Chef::Node.new
    @run_context = Chef::RunContext.new(@node, {})
    @new_resource = Chef::Resource::EasyInstallPackage.new('boto')
    @new_resource.version('1.8d')

    @current_resource = Chef::Resource::EasyInstallPackage.new('boto')
    @current_resource.version('1.8d')

    @provider = Chef::Provider::Package::EasyInstall.new(@new_resource, @run_context)
    Chef::Resource::Package.stub!(:new).and_return(@current_resource)

    @stdin = StringIO.new
    @stdout = StringIO.new
    @status = mock("Status", :exitstatus => 0)
    @stderr = StringIO.new
    @pid = 2342
    @provider.stub!(:popen4).and_return(@status)
  end

  describe "easy_install_binary_path" do
    it "should return a Chef::Provider::EasyInstall object" do
      provider = Chef::Provider::Package::EasyInstall.new(@node, @new_resource)
      provider.should be_a_kind_of(Chef::Provider::Package::EasyInstall)
    end

    it "should set the current resources package name to the new resources package name" do
      $stdout.stub!(:write)
      @current_resource.should_receive(:package_name).with(@new_resource.package_name)
      @provider.load_current_resource
    end

    it "should return a relative path to easy_install if no easy_install_binary is given" do
      @provider.easy_install_binary_path.should eql("easy_install")
    end

    it "should return a specific path to easy_install if a easy_install_binary is given" do
      @new_resource.should_receive(:easy_install_binary).and_return("/opt/local/bin/custom/easy_install")
      @provider.easy_install_binary_path.should eql("/opt/local/bin/custom/easy_install")
    end

  end

  describe "actions_on_package" do
    it "should run easy_install with the package name and version" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install \"boto==1.8d\""
      })
      @provider.install_package("boto", "1.8d")
    end

    it "should run easy_install with the package name and version and specified options" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install --always-unzip \"boto==1.8d\""
      })
      @new_resource.stub!(:options).and_return("--always-unzip")
      @provider.install_package("boto", "1.8d")
    end

    it "should run easy_install with the package name and version" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install \"boto==1.8d\""
      })
      @provider.upgrade_package("boto", "1.8d")
    end

    it "should run easy_install -m with the package name and version" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install -m boto"
      })
      @provider.remove_package("boto", "1.8d")
    end

    it "should run easy_install -m with the package name and version and specified options" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install -x -m boto"
      })
      @new_resource.stub!(:options).and_return("-x")
      @provider.remove_package("boto", "1.8d")
    end

    it "should run easy_install -m with the package name and version" do
      @provider.should_receive(:run_command).with({
        :command => "easy_install -m boto"
      })
      @provider.purge_package("boto", "1.8d")
    end

  end
end

redpajama_set_name: RedPajamaGithub


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.monkeys.gui.matcher;

import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;
import javax.swing.SwingUtilities;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;

@ActionID(
        category = "File",
        id = "org.monkeys.gui.matcher.OpenUrlAction"
)
@ActionRegistration(
        iconBase = "org/monkeys/gui/icons/remote-16.png",
        displayName = "#CTL_OpenUrlAction"
)
@ActionReferences(
        {
            @ActionReference(path = "Menu/File", position = 1301),
            @ActionReference(path = "Toolbars/Editor", position = 1100)
        })
@Messages("CTL_OpenUrlAction=Open URL")
public final class OpenUrlAction implements ActionListener
{
    @Override
    public void actionPerformed(final ActionEvent e)
    {
        this.open();
    }

    public boolean open()
    {
        final Frame parent = WindowManager.getDefault().getMainWindow();
        final OpenUrlDialog dialog = new OpenUrlDialog(parent, true);
        dialog.setLocationRelativeTo(parent);
        dialog.setVisible(true);
        final URL url = dialog.getURL();
        if (null == url)
        {
            return false;
        }

        TopComponent tc = findTopComponent(url);
        if (tc == null)
        {
            tc = new UrlTopComponent(url);
            tc.open();
        }
        final TopComponent window = tc;
        SwingUtilities.invokeLater(new Runnable()
        {

            @Override
            public void run()
            {
                window.requestActive();
            }
        });
        return true;
    }

    private TopComponent findTopComponent(final URL url)
    {
        for (final TopComponent tc : WindowManager.getDefault().getRegistry().getOpened())
        {
            final URL existing = tc.getLookup().lookup(URL.class);
            if (existing != null && url.equals(existing))
            {
                return tc;
            }
        }
        return null;
    }
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.co.geniustree.google.cloudprint.api.model;

/**
 *
 * @author jittagorn pitakmetagoon
 */
public class ColorOptopn {

    private boolean is_default;
    private String type;
    private String vendor_id;

    public boolean isIs_default() {
        return is_default;
    }

    public void setIs_default(boolean is_default) {
        this.is_default = is_default;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getVendor_id() {
        return vendor_id;
    }

    public void setVendor_id(String vendor_id) {
        this.vendor_id = vendor_id;
    }
}


text:
#ifdef QT_QML_DEBUG
#include <QtQuick>
#endif

#include <sailfishapp.h>
#include <QtQml>
#include <QScopedPointer>
#include <QQuickView>
#include <QQmlEngine>
#include <QGuiApplication>
#include <QQmlContext>
#include <QCoreApplication>
#include "logger.h"

int main(int argc, char *argv[])
{
    qmlRegisterType<Logger>("harbour.valuelogger.Logger", 1, 0, "Logger");

    QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));

    QTranslator translator;
    translator.load("translations_" + QLocale::system().name(), "/usr/share/harbour-valuelogger/i18n");
    app->installTranslator(&translator);

    QScopedPointer<QQuickView> view(SailfishApp::createView());
    view->setSource(SailfishApp::pathTo("qml/valuelogger.qml"));
    view->show();

    return app->exec();
}


text:
/**
 *
 */
package io.github.pbremer.icecreammanager.validator;

import java.util.List;
import java.util.Vector;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

import io.github.pbremer.icecreammanager.flatfilecontents.DriverFlatFileContainer;

/**
 * @author Patrick Bremer
 */
public class DriverValidator implements Validator, InitializingBean {

    private List<String> driverCahce;

    /*
     * (non-Javadoc)
     * @see org.springframework.validation.Validator#supports(java.lang.Class)
     */
    @Override
    public boolean supports(Class<?> clazz) {
	return clazz.isInstance(new DriverFlatFileContainer());
    }

    /*
     * (non-Javadoc)
     * @see org.springframework.validation.Validator#validate(java.lang.Object,
     * org.springframework.validation.Errors)
     */
    @Override
    public void validate(Object target, Errors errors) {
	DriverFlatFileContainer arg = (DriverFlatFileContainer) target;
	if (driverCahce.contains(arg.getDriverNumber())) {
	    errors.reject("truck.trucknumber.occupied",
	            new StringBuffer("Driver ").append(arg.getDriverNumber())
	                    .append(" already exists").toString());
	    return;
	}
	driverCahce.add(arg.getDriverNumber());

    }

    /*
     * (non-Javadoc)
     * @see
     * org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
     */
    @Override
    public void afterPropertiesSet() throws Exception {
	if (driverCahce == null) {
	    driverCahce = new Vector<String>();
	}
    }

}


text:
/* fix vertical when not overflow
call fullscreenFix() if .fullscreen content changes */
function fullscreenFix(){
    var h = $('body').height();
    // set .fullscreen height
    $(".content-b").each(function(i){
        if($(this).innerHeight() <= h){
            $(this).closest(".fullscreen").addClass("not-overflow");
        }
    });
}
$(window).resize(fullscreenFix);
fullscreenFix();

/* resize background images */
function backgroundResize(){
    var windowH = $(window).height();
    $(".background").each(function(i){
        var path = $(this);
        // variables
        var contW = path.width();
        var contH = path.height();
        var imgW = path.attr("data-img-width");
        var imgH = path.attr("data-img-height");
        var ratio = imgW / imgH;
        // overflowing difference
        var diff = parseFloat(path.attr("data-diff"));
        diff = diff ? diff : 0;
        // remaining height to have fullscreen image only on parallax
        var remainingH = 0;
        if(path.hasClass("parallax")){
            var maxH = contH > windowH ? contH : windowH;
            remainingH = windowH - contH;
        }
        // set img values depending on cont
        imgH = contH + remainingH + diff;
        imgW = imgH * ratio;
        // fix when too large
        if(contW > imgW){
            imgW = contW;
            imgH = imgW / ratio;
        }
        //
        path.data("resized-imgW", imgW);
        path.data("resized-imgH", imgH);
        path.css("background-size", imgW + "px " + imgH + "px");
    });
}
$(window).resize(backgroundResize);
$(window).focus(backgroundResize);
backgroundResize();

$(document).ready(function() {
var newYear = new Date();
newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1);
$('#countdown-clock').countdown({until: newYear});

});// End jQuery


text:
<project>
    <build>
        <plugins>
            <plugin>
                <groupId>com.github.kongchen</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>3.0-M2-SNAPSHOT</version>
                <configuration>
                    <apiSources>
                        <apiSource>
                            <springmvc>false</springmvc>
                            <operationIdFormat>{{className}}_{{methodName}}_{{httpMethod}}</operationIdFormat>
                            <locations>
                                <location>com.wordnik.jaxrs</location>
                            </locations>
                            <schemes>
                                <scheme>http</scheme>
                                <scheme>https</scheme>
                            </schemes>
                            <securityDefinitions>
                                <securityDefinition>
                                    <name>basicAuth</name>
                                    <type>basic</type>
                                </securityDefinition>
                                <securityDefinition>
                                    <name>api_key_2</name>
                                    <type>apiKey</type>
                                    <in>header</in>
                                </securityDefinition>
                                <securityDefinition>
                                    <json>/securityDefinition.json</json>
                                </securityDefinition>
                            </securityDefinitions>
                            <outputFormats>json</outputFormats>
                            <swaggerDirectory>${basedir}/generated/swagger-ui-enhanced-operation-id</swaggerDirectory>
                            <swaggerApiReader>com.wordnik.jaxrs.VendorExtensionsJaxrsReader</swaggerApiReader>
                            <attachSwaggerArtifact>true</attachSwaggerArtifact>
                            <swaggerUIDocBasePath>http://www.example.com/restapi/doc</swaggerUIDocBasePath>
                            <modelSubstitute>/override.map</modelSubstitute>
                            <apiModelPropertyAccessExclusions>
                                <apiModelPropertyAccessExclusion>secret-property</apiModelPropertyAccessExclusion>
                                <apiModelPropertyAccessExclusion>another-secret-property</apiModelPropertyAccessExclusion>
                                <apiModelPropertyAccessExclusion>exclude-when-jev-option-not-set</apiModelPropertyAccessExclusion>
                            </apiModelPropertyAccessExclusions>
                            <swaggerExtensions>
                                <swaggerExtension>com.wordnik.sample.VendorExtensionWithoutReader</swaggerExtension>
                            </swaggerExtensions>
                        </apiSource>
                    </apiSources>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


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

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

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

<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>
    <parent>
        <artifactId>storm</artifactId>
        <groupId>org.apache.storm</groupId>
        <version>2.0.0-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>apache-storm-bin</artifactId>
    <packaging>pom</packaging>
    <name>Storm Binary Distribution</name>
    <description>Storm binary distribution</description>

    <!--
        Used for cache busting in the Storm UI HTML and script.js files
        See src/main/assembly/pom.xml for the fileSet rules with
            <filtered>true</filtered>
    -->
    <properties>
        <packageTimestamp>${maven.build.timestamp}</packageTimestamp>
        <maven.build.timestamp.format>YYYYMMddHHmm</maven.build.timestamp.format>
    </properties>

    <modules>
        <module>storm-drpc-server-bin</module>
        <module>final-package</module>
    </modules>
</project>


text:
module FreecivCalc{
	export enum UnitSide{
		attacker,
		defender
	}
	export interface Unit{
		id :string;
		label :string;
		label_detail :string;
		phonetics :Array<string>;
		class :string;
		flags :Array<string>;
		hp :number;
		attack :number;
		defence :number;
		firepower :number;
	}
	export interface UnitClass{
		id:string;
		label:string;
	}
	export class UnitManager{
		private _units: {[key:string]: Unit};
		private _classlist: {[key:string]: UnitClass};
		constructor(){
			this._units = {};
			this._classlist = {};
		}
		init(classlist:Array<UnitClass>, units:Array<Unit>){
			for(var i=0; i<classlist.length; i++){
				var c = classlist[i];
				this._classlist[c.id] = c;
			}
			for(var i=0; i<units.length; i++){
				var u = units[i];
				this._units[u.id] = u;
			}
		}
		get(name:string): Unit{
			if(this._units[name]) {
				// return copy of unit
				return this.copyUnit(this._units[name]);
			}
			else return null;
		}
		getclass(name:string): UnitClass{
			if(this._classlist[name]) return this._classlist[name];
			else return null;
		}
		copyUnit(unit:Unit): Unit{
			var u: Unit = {
				id : unit.id,
				label : unit.label,
				label_detail : unit.label_detail,
				phonetics : unit.phonetics,
				class : unit.class,
				flags : unit.flags,
				hp : unit.hp,
				attack : unit.attack,
				defence : unit.defence,
				firepower : unit.firepower,
			}
			return u;
		}
	}
}


text:
<!--
  ~ Copyright 2015 Ayuget
  ~
  ~ 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.
  -->

<resources>
    <!-- Text -->
    <dimen name="text_size_default">15sp</dimen>
    <dimen name="text_size_details">13sp</dimen>

    <dimen name="padding_normal">16dp</dimen>

    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="settings_activity_horizontal_margin">24dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>

    <dimen name="navdrawer_icon_margin">16dp</dimen>
    <dimen name="navdrawer_chosen_account_height">96dp</dimen>

    <dimen name="subcategories_spinner_width">200dp</dimen>
    <dimen name="subcategories_spinner_item_height">48dp</dimen>
    <dimen name="spinner_left_padding">16dp</dimen>

    <!-- Topics list -->
    <dimen name="topic_item_height">72dp</dimen>
    <dimen name="topic_subject_height">40dp</dimen>
    <dimen name="topic_additional_details_height">24dp</dimen>
    <dimen name="topic_item_vertical_padding">8dp</dimen>
    <dimen name="topic_item_vertical_padding_compact">2dp</dimen>
    <dimen name="topic_subject_height_compact">22dp</dimen>

    <dimen name="topic_item_height_compact">42dp</dimen>
    <dimen name="topic_icon_size_compact">24dp</dimen>
    <dimen name="topic_unread_count_top_compact">4dp</dimen>
    <dimen name="topic_icon_container_vertical_padding_compact">10dp</dimen>

    <dimen name="topic_icon_container_width">72dp</dimen>
    <dimen name="topic_icon_container_horizontal_padding">16dp</dimen>
    <dimen name="topic_icon_container_vertical_padding">16dp</dimen>
    <dimen name="topic_unread_count_margin">8dp</dimen>
    <dimen name="topic_icon_size">40dp</dimen>
    <dimen name="topic_unread_count_size">24dp</dimen>
    <dimen name="topic_unread_count_top_margin">24dp</dimen>
    <dimen name="topic_unread_count_text_size">10sp</dimen>

    <dimen name="topic_item_font_size">14sp</dimen>
    <dimen name="topic_last_post_author_font_size">12sp</dimen>

    <dimen name="swipe_refresh_progress_bar_start_margin">40dp</dimen>
    <dimen name="swipe_refresh_progress_bar_end_margin">72dp</dimen>

    <dimen name="fab_padding">16dp</dimen>
    <dimen name="fab_elevation">6dp</dimen>
    <dimen name="fab_pressed_translation_z">12dp</dimen>

    <dimen name="move_to_top_top_padding">102dp</dimen>
    <dimen name="move_to_bottom_bottom_padding">86dp</dimen>

    <!-- Reply dialog -->
    <dimen name="reply_edit_text_padding">12dp</dimen>
    <dimen name="reply_dialog_avatar_padding">8dp</dimen>
    <dimen name="smiley_touch_size">16dp</dimen>
    <dimen name="smiley_padding">2dp</dimen>

    <!-- Image detail -->
    <dimen name="image_detail_item_height">72dp</dimen>
    <dimen name="image_detail_item_main_text_size">16sp</dimen>
    <dimen name="image_detail_item_secondary_text_size">13sp</dimen>

    <!-- Profile detail -->
    <dimen name="profile_detail_item_height">72dp</dimen>
    <dimen name="profile_detail_item_username_text_size">24sp</dimen>
    <dimen name="profile_detail_item_status_text_size">16sp</dimen>
    <dimen name="profile_detail_item_main_text_size">16sp</dimen>
    <dimen name="profile_detail_item_secondary_text_size">13sp</dimen>
    <dimen name="profile_detail_heading_text_size">13sp</dimen>

    <!-- Insert image bottom sheet -->
    <dimen name="image_bottom_sheet_margin">16dp</dimen>

    <!-- Z-axis elevations -->
    <dimen name="z_app_bar">4dp</dimen>
</resources>


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="osp.edu.pl.shopingassistant.ScrollingActivity">
    <item
        android:id="@+id/action_del"
        android:orderInCategory="100"
        android:title="@string/action_del"
        app:showAsAction="never" />
    <item
        android:id="@+id/action_add"
        android:orderInCategory="100"
        android:title="@string/action_add"
        app:showAsAction="never" />
</menu>


text:
{% extends "base.html" %}
{% block title %} logout {% endblock %}

{% block content %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" media="screen" title="no title" charset="utf-8">
<link href="/acme/static/css/form.css" rel="stylesheet">
<button class="btn btn-lg btn-primary btn-block" type="submit" name="logout" value="logout">Log Out</button>
{% endblock %}

{% block footer %}

    Privacy & Legal Notice
    Site Issues

{% endblock %}


text:
package de.neofonie.cinderella.core;

import org.springframework.mock.web.MockHttpServletRequest;
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertNull;

public class RequestUtilTest {

    @Test
    public void testIpAddress123() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        assertEquals(RequestUtil.getClientIpAddr(request), "RemoteAddr");
    }

    @Test
    public void testIpAddress() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("178.255.215.98");
        assertEquals(RequestUtil.getClientIpAddr(request), "178.255.215.98");
    }

    @Test
    public void testIpAddress2() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("178.255.215.98");
        request.addHeader("X-Forwarded-For", "");
        assertEquals(RequestUtil.getClientIpAddr(request), "178.255.215.98");
    }

    @Test
    public void testIpAddress3() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", "66.249.66.1");
        assertEquals(RequestUtil.getClientIpAddr(request), "66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");
    }

    @Test
    public void testIpAddress4() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", "192.168.0.1,66.249.66.1");
        assertEquals(RequestUtil.getClientIpAddr(request), "66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");
    }

    @Test
    public void testGetHostName() throws Exception {
        final MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("127.0.0.1");

        assertEquals(RequestUtil.getHostName(request, false), "localhost");

        request.setRemoteAddr("66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");

        request.setRemoteAddr("66.247.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "66.247.66.1");

        request.setRemoteAddr(null);
        assertEquals(RequestUtil.getHostName(request, false), null);

        request.setRemoteAddr("crap");
        assertEquals(RequestUtil.getHostName(request, false), null);
    }

    @Test
    public void testGetHostNameHelper() throws Exception {
        assertEquals(RequestUtil.getHostNameHelper("66.247.66.1", false), "66.247.66.1");
        assertEquals(RequestUtil.getHostNameHelper("66.249.66.1", false), "crawl-66-249-66-1.googlebot.com");
        //should be heise.de?
        assertEquals(RequestUtil.getHostNameHelper("193.99.144.80", false), "redirector.heise.de");

        assertEquals(RequestUtil.getHostNameHelper("127.0.0.1", false), "localhost");
        assertEquals(RequestUtil.getHostNameHelper(null, false), null);
        assertEquals(RequestUtil.getHostNameHelper("crap", false), null);
    }

    @Test
    public void testXforwardedForIpListWithGoogleAndBlanks() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", " 193.99.144.80 , 66.249.66.1 ");
        assertEquals(RequestUtil.getClientIpAddr(request), "66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");
    }

    @Test
    public void testXforwardedForIpListWithGoogle() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", "193.99.144.80, 66.249.66.1");
        assertEquals(RequestUtil.getClientIpAddr(request), "66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");
    }

    @Test
    public void testXforwardedForIpListWithGoogleAndPrivateIps() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", " 193.99.144.80 , 66.249.66.1 , 172.16.0.0, 10.255.0.0, 192.168.0.0");
        assertEquals(RequestUtil.getClientIpAddr(request), "66.249.66.1");
        assertEquals(RequestUtil.getHostName(request, false), "crawl-66-249-66-1.googlebot.com");
    }

    @Test
    public void testXforwardedOnlyPrivateIps() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("10.4.5.6");
        request.addHeader("X-Forwarded-For", "172.16.0.0, 10.255.0.0, 192.168.0.0");
        assertEquals(RequestUtil.getClientIpAddr(request), "10.4.5.6");
    }

    @Test
    public void testXforwardedForIpListWithSistrixNoDNSForwardLookup() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", "85.10.196.88");
        assertEquals(RequestUtil.getClientIpAddr(request), "85.10.196.88");
        assertEquals(RequestUtil.getHostName(request, true), "85-10-196-88.crawler.sistrix.net");
    }

    @Test
    public void testXforwardedForIpListWithSistrixẂithDNSForwardLookup() throws Exception {
        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setRemoteAddr("RemoteAddr");
        request.addHeader("X-Forwarded-For", "85.10.196.88");
        assertEquals(RequestUtil.getClientIpAddr(request), "85.10.196.88");
        assertNotEquals(RequestUtil.getHostName(request, false), "85-10-196-88.crawler.sistrix.net");
    }
}


text:
angular.module('app').constant('StringHelper', new function() {
	function _dashToCamel(g) {
		return g[1].toUpperCase()
	}

	this.dashToCamel = function(string) {
		return string.replace(/-([a-z])/g, _dashToCamel);
	};

});


text:
using System.IO;
using System.Linq;
using Glyssen.Shared;
using GlyssenCharacters;
using GlyssenCharactersTests.Properties;
using GlyssenCharactersTests.Utilities;
using NUnit.Framework;
using SIL.IO;
using SIL.Scripture;

namespace GlyssenCharactersTests
{
	/// <summary>
	/// Note that these tests purport to test the GetCharacters method, but in fact that is just a simple LINQ statement;
	/// they're really testing the Load method.
	/// </summary>
	[TestFixture]
	class ControlCharacterVerseDataTests
	{
		private static readonly int kGENbookNum = BCVRef.BookToNumber("GEN");
		private static readonly int k1SAbookNum = BCVRef.BookToNumber("1SA");
		private static readonly int kMRKbookNum = BCVRef.BookToNumber("MRK");
		private static readonly int kLUKbookNum = BCVRef.BookToNumber("LUK");
		private static readonly int kACTbookNum = BCVRef.BookToNumber("ACT");

		private ScrVers m_testVersification;

		[OneTimeSetUp]
		public void OneTimeSetUp()
		{
			// Use a test version of the file so the tests won't break every time we fix a problem in the production control file.
			ControlCharacterVerseData.TabDelimitedCharacterVerseData = Resources.TestCharacterVerse;

			using (TempFile tempFile = new TempFile())
			{
				File.WriteAllText(tempFile.Path, Resources.TestVersification);
				m_testVersification = Versification.Table.Implementation.Load(tempFile.Path);
			}
		}

		[Test]
		public void GetCharacters_NoMatch_EmptyResults()
		{
			Assert.IsFalse(ControlCharacterVerseData.Singleton.GetCharacters(kMRKbookNum, 1, new SingleVerse(1)).Any());
		}

		[Test]
		public void GetCharacters_OneInControlFile_Retrieved()
		{
			Assert.AreEqual("God", ControlCharacterVerseData.Singleton.GetCharacters(kGENbookNum, 15, new SingleVerse(20)).Single().Character);
		}

		[Test]
		public void GetCharacters_VerseBridgeInControlFile_StartVerse()
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(kLUKbookNum, 1, new SingleVerse(43)).Single();
			Assert.AreEqual("Elizabeth", character.Character);
		}

		[Test]
		public void GetCharacters_VerseBridgeInControlFile_MiddleVerse()
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(kGENbookNum, 15, new SingleVerse(20)).Single();
			Assert.AreEqual("God", character.Character);
		}

		[Test]
		public void GetCharacters_VerseBridgeInControlFile_EndVerse()
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(kLUKbookNum, 1, new SingleVerse(55)).Single();
			Assert.AreEqual("Mary (Jesus' mother)", character.Character);
		}

		[Test]
		public void GetCharacters_ControlHasNoDataForInitialStartVerseButDoesForSecondVerse_ReturnsNoCharacters()
		{
			Assert.IsFalse(ControlCharacterVerseData.Singleton.GetCharacters(kACTbookNum, 11, new []{new SingleVerse(2), new SingleVerse(3) }).Any());
		}

		[Test]
		public void GetCharacters_ControlHasSameCharacterEntryForInitialStartAndInitialEndVerse_GetsOnlyOneEntryForCharacter()
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(kGENbookNum, 1, new VerseBridge(14, 15)).Single();
			Assert.AreEqual("God", character.Character);
		}

		[Test]
		public void GetCharacters_OriginalVersification_StartVerseMovesToPreviousChapter_GettingNarratorOverridesDoesNotCrash()
		{
			// Note: There are no narrator overrides for GEN, so this test would also work for includeNarratorOverrides: false,
			// but it is testing the case where we attempt to retrieve narrator overrides for a range which (after converting to
			// English versification), the verses are no longer in the same chapter.
			var bookNumGen = BCVRef.BookToNumber("GEN");
			// In English, GEN 31:55 => GEN 32:1 & GEN 32:1-32 => GEN 32:2-33
			var expected = ControlCharacterVerseData.Singleton.GetCharacters(bookNumGen, 31, new SingleVerse(55),
				ScrVers.English, includeNarratorOverrides: true);
			expected.UnionWith(ControlCharacterVerseData.Singleton.GetCharacters(bookNumGen, 32, new VerseBridge(1, 2),
				ScrVers.English, includeNarratorOverrides: true));
			var characters = ControlCharacterVerseData.Singleton.GetCharacters(bookNumGen, 32, new VerseBridge(1, 3),
				ScrVers.Original, includeNarratorOverrides: true);
			Assert.IsTrue(expected.SetEquals(characters));
		}

		[TestCase(false)]
		[TestCase(true)]
		public void GetCharacters_RussianOrthodoxVersificationWithInitialVerseBridge_FindsCharacterAfterChangingVersification(bool includeNarratorOverrides)
		{
			// Psalm 37:16-17 in Russian Orthodox => Psalm 38:15-16 in English
			var expected = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("PSA"), 38, new VerseBridge(15, 16),
				ScrVers.English, includeNarratorOverrides: includeNarratorOverrides);
			var characters = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("PSA"), 37, new VerseBridge(16, 17),
				ScrVers.RussianOrthodox, includeNarratorOverrides: includeNarratorOverrides).ToList();
			Assert.IsTrue(expected.SequenceEqual(characters));
		}

		[TestCase(2)]
		[TestCase(0)]
		[TestCase(3)]
		public void GetCharacters_RussianOrthodoxIncludeNarratorOverrides_FindsCharacterAfterChangingVersification(int endVerse)
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("PSA"), 41, endVerse <= 2 ? (IVerse)new SingleVerse(2) : new VerseBridge(2, endVerse),
				ScrVers.RussianOrthodox, includeNarratorOverrides: true).Single();

			// Psalm 41:2 in Russian Orthodox => Psalm 42:1 in English
			if (endVerse > 0)
				endVerse--;
			var expected = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("PSA"), 42, endVerse <= 1 ? (IVerse)new SingleVerse(1) : new VerseBridge(1, endVerse),
				ScrVers.English, includeNarratorOverrides: true).Single();
			Assert.AreEqual(expected, character);
		}

		[Test]
		public void GetCharacters_OriginalVersificationWithVerseBridge_FindsCharacterAfterChangingVersification()
		{
			// 1 Samuel 24:1-2 in Original => 1 Samuel 23:29-24:1 in English
			var expected = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("1SA"), 24, new SingleVerse(1),
				ScrVers.English).Single();
			var character = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("1SA"), 24, new VerseBridge(1, 2),
				ScrVers.Original).Single();
			Assert.AreEqual(expected.Character, character.Character);
		}

		[Test]
		public void GetCharacters_ControlHasNoDataForInitialStartVerseButDoesForThirdVerse_ReturnsNoCharacters()
		{
			Assert.IsFalse(ControlCharacterVerseData.Singleton.GetCharacters(kACTbookNum, 11, new []{ new SingleVerse(1), new SingleVerse(3) }).Any());
		}

		[Test]
		public void GetCharacters_MoreThanOneWithNoDuplicates_ReturnsAll()
		{
			var characters = ControlCharacterVerseData.Singleton.GetCharacters(kMRKbookNum, 6, new SingleVerse(24));
			Assert.AreEqual(2, characters.Count);
			Assert.AreEqual(1, characters.Count(c => c.Character == "Herodias"));
			Assert.AreEqual(1, characters.Count(c => c.Character == "Herodias' daughter"));
		}

		[Test]
		public void GetCharacters_MultipleCharactersInOneButNotAllVerses_ReturnsSingleCharacter()
		{
			var character = ControlCharacterVerseData.Singleton.GetCharacters(k1SAbookNum, 6, new[] { new SingleVerse(4), new SingleVerse(6) }).Single();
			Assert.AreEqual("Philistine priests and diviners", character.Character);
		}

		[Test]
		public void GetCharacters_MultipleCharactersInMultipleVerses_ReturnsAmbiguous()
		{
			var characters = ControlCharacterVerseData.Singleton.GetCharacters(k1SAbookNum, 8, new[] { new SingleVerse(21), new SingleVerse(22) });
			Assert.AreEqual(2, characters.Count);
			Assert.AreEqual(1, characters.Count(c => c.Character == "God"));
			Assert.AreEqual(1, characters.Count(c => c.Character == "Samuel"));
		}

		[Test]
		public void GetCharacters_MultipleCharactersInMultipleVerses_NoCharacterInInitialStartVerse_ReturnsNoCharacters()
		{
			Assert.IsFalse(ControlCharacterVerseData.Singleton.GetCharacters(k1SAbookNum, 8, new[] { new SingleVerse(20), new SingleVerse(22) }).Any());
		}

		[Test]
		public void GetCharacters_SingleCharactersInMultipleVerses_NoCharacterInInitialStartVerse_ReturnsNoCharacters()
		{
			Assert.IsFalse(ControlCharacterVerseData.Singleton.GetCharacters(k1SAbookNum, 9, new[] { new SingleVerse(4), new SingleVerse(6) }).Any());
		}

		[Test]
		public void GetCharacters_NonEnglishVersification()
		{
			// Prove the test is valid
			var character = ControlCharacterVerseData.Singleton.GetCharacters(1, 32, new SingleVerse(6)).Single();
			Assert.AreEqual("messengers of Jacob", character.Character);
			var verseRef = new VerseRef(1, 32, 6, ScrVers.English);
			verseRef.ChangeVersification(m_testVersification);
			Assert.AreEqual(1, verseRef.BookNum);
			Assert.AreEqual(32, verseRef.ChapterNum);
			Assert.AreEqual(7, verseRef.VerseNum);

			// Run the test
			character = ControlCharacterVerseData.Singleton.GetCharacters(verseRef.BookNum, verseRef.ChapterNum, (SingleVerse)verseRef, m_testVersification).Single();
			Assert.AreEqual("messengers of Jacob", character.Character);
		}

		[Test]
		public void GetCharacters_NormalDeliveryPlusAlternate_GetsBothDeliveries()
		{
			var characters = ControlCharacterVerseData.Singleton.GetCharacters(BCVRef.BookToNumber("JER"), 31, new SingleVerse(18),
				includeAlternatesAndRareQuotes: true);
			Assert.AreEqual(3, characters.Count);
			Assert.IsTrue(characters.Any(c => c.Character == "God" && c.Delivery == ""));
			Assert.IsTrue(characters.Any(c => c.Character == "God" && c.Delivery != "" && c.QuoteType == QuoteType.Alternate));
			Assert.IsTrue(characters.Any(c => c.Character == "Ephraim" && c.QuoteType == QuoteType.Quotation));
		}
	}

	[TestFixture]
	class ControlCharacterVerseDataTests_Oct2015
	{
		[OneTimeSetUp]
		public void OneTimeSetUp()
		{
			// Use a test version of the file so the tests won't break every time we fix a problem in the production control file.
			ControlCharacterVerseData.TabDelimitedCharacterVerseData = Resources.TestCharacterVerseOct2015;
		}

		[Test]
		public void ExpectedQuotes_ScriptureQuotation_IsExpected()
		{
			// ACT	8	32	scripture			Quotation	Isaiah
			Assert.True(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("ACT")][8].Contains(32));
		}

		[Test]
		public void ExpectedQuotes_ScriptureQuotationAccompaniedByRareNeedsReview_IsNotExpected()
		{
			// MAT	9	36	narrator-MAT			Quotation
			// MAT	9	36	scripture			Quotation	Micaiah, prophet of the LORD
			// MAT	9	36	Jesus			Rare
			// MAT	9	36	Needs Review			Rare
			Assert.False(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("MAT")][9].Contains(36));
		}

		[Test]
		public void ExpectedQuotes_QuotationDefaultedToNarrator_IsNotExpected()
		{
			// 1KI	12	12	Rehoboam, king			Quotation	narrator-1KI
			Assert.False(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("1KI")][12].Contains(12));
		}

		[Test]
		public void ExpectedQuotes_Normal_IsExpected()
		{
			//GEN 1   11  God God(the LORD)  Normal
			Assert.True(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("GEN")][1].Contains(11));
		}

		[Test]
		public void ExpectedQuotes_Dialogue_IsExpected()
		{
			// 2SA 9   2   David David, king Dialogue
			// 2SA 9   2   Ziba, servant of Saul's household			Dialogue
			Assert.True(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("2SA")][9].Contains(2));
		}

		[Test]
		public void ExpectedQuotes_Hypothetical_IsNotExpected()
		{
			// Every line in the control file for PSA 10 is Hypothetical
			Assert.False(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("PSA")].ContainsKey(10));
		}

		[Test]
		public void ExpectedQuotes_PotentialAndIndirect_IsNotExpected()
		{
			// ACT 8   37  Ethiopian officer of Queen Candace Indirect
			// ACT 8   37  Philip the evangelist Philip  Potential
			Assert.False(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("ACT")][8].Contains(37));
		}

		// Note: We didn't used to consider Implicit as expected, but now that we're marking more things as implicit (so we can
		// take advantage of the improved logic in the quote parser for implicit quotes), it seems better to regard them as
		// expected. They really are expected, and most languages that regularly use quotation marks will have them for most
		// implicit passages.
		[Test]
		public void ExpectedQuotes_Implicit_IsExpected()
		{
			// Every line in the control file for LEV 1 is Implicit.
			Assert.True(ControlCharacterVerseData.Singleton.ExpectedQuotes[BCVRef.BookToNumber("LEV")].ContainsKey(1));
		}
	}
}


text:
title: "Twitter: April 28, 2022 at 04:55PM"
text: "RT @youyuxi: Just use the syntax that fits the shape of your brain. Arguing your preferred syntax is superior is like arguing you have the better brain shape than others."
createdAt: "April 28, 2022 at 04:55PM"
type: "twitter"
url: "https://twitter.com/DHolloran/status/1519797573615329280"
username: "DHolloran"
collectionName: "twitter"
slug: "twitter-april-28-2022-at-0455pm"
---

RT @youyuxi: Just use the syntax that fits the shape of your brain. Arguing your preferred syntax is superior is like arguing you have the better brain shape than others.

  — Dan Holloran (@DHolloran)
  Apr 28, 2022


text:
export type ByteArray = Uint8Array | Buffer;

export interface OmggifModule {
    GifWriter: GifWriter;
    GifReader: GifReader;
}

export interface GlobalOptions {
    loop?: number; // 0 = unending loop; n > 0 = (n+1) iterations; null = once
    palette?: number[]; // global palette RGB by color index
    background?: number; // background index; most browsers may ignore this
}

export interface FrameOptions {
    palette?: number[]; // RGB by color index
    delay?: number; // duation in 100s of a second
    disposal?: number; // what to do with background color (0-3)
    transparent?: number; // transparency index
}

export interface GifWriter {
    new (buffer: ByteArray, width: number, height: number, gopts?: GlobalOptions): GifWriter;
    addFrame(x: number, y: number, width: number, height: number, indexedPixels: number[], opts?: FrameOptions): number; // returns size of buffer at end of frame
    getOutputBuffer(): ByteArray;
    setOutputBuffer(buffer: ByteArray): void;
    getOutputBufferPosition(): number;
    setOutputBufferPosition(position: number): void;
    end(): number; // ends GIF and returns size of buffer
}

export interface GifReader {
    width: number;
    height: number;
    new (buffer: ByteArray): GifReader;
    numFrames(): number;
    loopCount(): number;
    frameInfo(frameNumber: number): FrameInfo;
    decodeAndBlitFrameBGRA(frameNumber: number, pixels: number[]): void;
    decodeAndBlitFrameRGBA(frameNumber: number, pixels: number[]): void;
}

export interface FrameInfo {
    x: number;
    y: number;
    width: number;
    height: number;
    has_local_palette: boolean;
    palette_offset: number;
    data_offset: number;
    data_length: number;
    transparent_index: number;
    interlaced: boolean;
    delay: number; // 100ths of a second
    disposal: number;
}


text:
using v8::Local;
using v8::Object;
using v8::Persistent;
using v8::String;

namespace Util
{
    bool SafeGetObject(const Local<Object>& obj, uint32_t index, Local<Object>& dest);
    bool SafeGetString(const Local<Object>& obj, const char *key, std::string& dest);
    bool FromJSObject(const Local<Object>& obj, Filter& dest);
    bool ToJSObject(const Filter& src, Local<Object>& dest);
}


text:
if [ "x${1}" = "x" ]; then
	echo -e "\nUsage: ${0} <block device> [<console> <hostname> <interfaces>]\n"
	exit 0
fi

if [ -z "$OETMP" ]; then
	#OETMP="../../../build/tmp"
	OETMP="~/yocto-dylan-2/build/tmp"
	OETMP="/home/andrew/yocto-dylan-2/build/tmp"
	SCRTMP="/home/andrew/yocto-dylan-2/poky/meta-stanford-ARL/scripts"
	echo -e "\nWorking from default directory: $OETMP"
else
	echo -e "\nOETMP: $OETMP"

	if [ ! -d ${OETMP}/deploy/images ]; then
		echo "Directory not found: ${OETMP}/deploy/images"
		exit 1
	fi
fi

if [[ -z "${MACHINE}" ]]; then
	echo "Environment variable MACHINE not found!"
	echo "By default using overo"
	MACHINE=overo
#	echo "Choices are overo|duovero|beaglebone"
#	exit 1
else
	echo -e "MACHINE: $MACHINE\n"
fi

if [ "x${3}" = "x" ]; then
        TARGET_HOSTNAME=$MACHINE
else
	MACHINE=${3}
        TARGET_HOSTNAME=${3}
fi

if [ ! -z "$OETMP" ]; then
	cd ${OETMP}/deploy/images
fi

if [ ! -f MLO-${MACHINE} ]; then
	echo -e "File not found: MLO-${MACHINE}\n"

	if [ ! -z "$OETMP" ]; then
		cd $OLDPWD
	fi

	exit 1
fi

if [ ! -f u-boot-${MACHINE}.img ]; then
	echo -e "File not found: u-boot-${MACHINE}.img\n"

	if [ ! -z "$OETMP" ]; then
		cd $OLDPWD
	fi

	exit 1
fi

if [ ! -f uImage-${MACHINE}.bin ]; then
	echo -e "File not found: uImage-${MACHINE}.bin\n"

	if [ ! -z "$OETMP" ]; then
		cd $OLDPWD
	fi

	exit 1
fi

DEV=/dev/${1}1

if [ -b $DEV ]; then
	echo "Unmounting $DEV"
	sudo umount ${DEV}

	echo "Formatting FAT partition on $DEV"
	sudo mkfs.vfat -F 32 ${DEV} -n BOOT

	echo "Mounting $DEV"
	sudo mount ${DEV} /media/card

	echo "Copying MLO"
	sudo cp MLO-${MACHINE} /media/card/MLO
	echo "Copying u-boot"
	sudo cp u-boot-${MACHINE}.img /media/card/u-boot.img

	if [ -f boot.scr ]; then
		echo "Copying boot.scr"
		sudo cp boot.scr /media/card/boot.scr

		if [ -f boot.cmd ]; then
			echo "Copying boot.cmd"
			sudo cp boot.cmd /media/card/boot.cmd
		fi
	fi

	echo "Copying uImage"
	sudo cp uImage-${MACHINE}.bin /media/card/uImage

	sync
	echo "Unmounting ${DEV}"
	sudo umount ${DEV}
else
	echo -e "\nBlock device not found: $DEV\n"
fi

if [ ! -z "$OETMP" ]; then
	cd $OLDPWD
fi

# now copy over the rootfs

if [ "x${2}" = "x" ]; then
	#default image is the console image
        IMAGE=console
else
        IMAGE=${2}
fi

echo "IMAGE: $IMAGE"

echo -e "HOSTNAME: $TARGET_HOSTNAME\n"

if [ ! -z "$OETMP" ]; then
        cd ${OETMP}/deploy/images
fi

if [ ! -f "ARL-${IMAGE}-image-${MACHINE}.tar.bz2" ]; then
        echo -e "File not found: $PWD/ARL-${IMAGE}-image-${MACHINE}.tar.bz2\n"

                if [ ! -z "$OETMP" ]; then
                        cd $OLDPWD
                fi

        exit 1
fi

DEV=/dev/${1}2

# what interfaces file are we using
if [ "x${4}" = "x" ]; then
	# default one with dhcp wifi
	INTERFACES=files/interfaces
else
	INTERFACES=${4}
fi

if [ -b $DEV ]; then
	echo "Unmounting $DEV"
	sudo umount ${DEV}

        echo "Formatting $DEV as ext3"
        sudo mkfs.ext3 -L ROOT $DEV

        echo "Mounting $DEV"
        sudo mount $DEV /media/card

        echo "Extracting ARL-${IMAGE}-image-${MACHINE}.tar.bz2 to /media/card"
        sudo tar -xaf ARL-${IMAGE}-image-${MACHINE}.tar.bz2 -C /media/card

        echo "Writing hostname to /etc/hostname"
        export TARGET_HOSTNAME
        sudo -E bash -c 'echo ${TARGET_HOSTNAME} > /media/card/etc/hostname'

	if [ ! -z "$OETMP" ]; then
		cd $OLDPWD
	fi

        if [ -f ${SCRTMP}/files/$INTERFACES ]; then
                echo "Writing $INTERFACES to /media/card/etc/network/interfaces"
                sudo cp ${SCRTMP}/files/$INTERFACES /media/card/etc/network/interfaces
        fi

        if [ -f ${SCRTMP}/files/wpa_supplicant.conf ]; then
                echo "Writing wpa_supplicant.conf to /media/card/etc/"
                sudo cp ${SCRTMP}/files/wpa_supplicant.conf /media/card/etc/wpa_supplicant.conf
        fi

	if [ -d ${SCRTMP}/files/quarc_overo ]; then
		echo "Writing quarc files to /media/card/home/root/"
		sudo cp -R ${SCRTMP}/files/quarc_overo /media/card/home/root/
	fi

	if [ "${IMAGE}" = "gst" ]; then
		echo "Copying gst capture files for streaming to /media/card/home/root/"
		sudo cp ${SCRTMP}/files/build /media/card/home/root/
		sudo cp ${SCRTMP}/files/capture.c /media/card/home/root/
	fi

	sync
        echo "Unmounting $DEV"
        sudo umount $DEV
else
        echo "Block device $DEV does not exist"
	if [ ! -z "$OETMP" ]; then
        	cd $OLDPWD
	fi
fi

echo "Done making ARL SD card for $MACHINE."


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2012. Axon Framework
  ~
  ~ 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.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:axon="http://www.axonframework.org/schema/core" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:security="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core.xsd
                           http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
                           http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">

    <axon:annotation-config event-bus="eventBus" command-bus="commandBus"/>
    <security:global-method-security proxy-target-class="false" secured-annotations="enabled"/>

    <axon:event-bus id="eventBus"/>
    <axon:command-bus id="commandBus"/>

    <bean class="org.axonframework.spring.config.annotation.TransactionalListener"/>
    <bean class="org.axonframework.spring.config.annotation.TransactionalCommandHandler"/>

    <bean id="transactionManager" class="org.axonframework.spring.testutils.MockitoMockFactoryBean">
        <property name="mockType" value="org.springframework.transaction.PlatformTransactionManager"/>
        <property name="singleton" value="true"/>
    </bean>

    <tx:annotation-driven proxy-target-class="false"/>
</beans>


text:
namespace ipc
{
	class Message
	{
	public:
		Message();
		Message(Process *p, void *a, uintptr_t l);
		Process *proc;
		void *addr;
		uintptr_t len;
	};

	int translate_message(Process *dst, Process *src, char *msg, int len);
}


text:
package admission

import (
	"errors"
	"fmt"

	"k8s.io/kubernetes/pkg/admission"
	kapi "k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/unversioned"
	"k8s.io/kubernetes/pkg/runtime"

	buildapi "github.com/openshift/origin/pkg/build/api"
)

// IsBuildPod returns true if a pod is a pod generated for a Build
func IsBuildPod(a admission.Attributes) bool {
	if a.GetResource() != kapi.Resource("pods") {
		return false
	}
	if len(a.GetSubresource()) != 0 {
		return false
	}
	pod, err := GetPod(a)
	if err != nil {
		return false
	}
	return hasBuildAnnotation(pod) && hasBuildEnvVar(pod)
}

// GetBuild returns a build object encoded in a pod's BUILD environment variable along with
// its encoding version
func GetBuild(a admission.Attributes) (*buildapi.Build, unversioned.GroupVersion, error) {
	pod, err := GetPod(a)
	if err != nil {
		return nil, unversioned.GroupVersion{}, err
	}
	build, version, err := getBuildFromPod(pod)
	if err != nil {
		return nil, unversioned.GroupVersion{}, admission.NewForbidden(a, fmt.Errorf("unable to get build from pod: %v", err))
	}
	return build, version, nil
}

// GetPod returns a pod from an admission attributes object
func GetPod(a admission.Attributes) (*kapi.Pod, error) {
	pod, isPod := a.GetObject().(*kapi.Pod)
	if !isPod {
		return nil, admission.NewForbidden(a, fmt.Errorf("unrecognized request object: %#v", a.GetObject()))
	}
	return pod, nil
}

// SetBuild encodes a build object and sets it in a pod's BUILD environment variable
func SetBuild(a admission.Attributes, build *buildapi.Build, groupVersion unversioned.GroupVersion) error {
	pod, err := GetPod(a)
	if err != nil {
		return err
	}
	err = setBuildInPod(build, pod, groupVersion)
	if err != nil {
		return admission.NewForbidden(a, fmt.Errorf("unable to set build in pod: %v", err))
	}
	return nil
}

// getBuildFromPod detects the encoding of a Build in a pod and returns the Build
// object along with its detected version.
func getBuildFromPod(pod *kapi.Pod) (*buildapi.Build, unversioned.GroupVersion, error) {
	envVar, err := buildEnvVar(pod)
	if err != nil {
		return nil, unversioned.GroupVersion{}, err
	}
	obj, groupVersionKind, err := kapi.Codecs.UniversalDecoder().Decode([]byte(envVar.Value), nil, nil)
	if err != nil {
		return nil, unversioned.GroupVersion{}, err
	}
	build, ok := obj.(*buildapi.Build)
	if !ok {
		return nil, unversioned.GroupVersion{}, errors.New("decoded object is not of type Build")
	}
	return build, groupVersionKind.GroupVersion(), nil
}

// setBuildInPod encodes a build with the given version and sets it in the BUILD environment variable
// of the pod.
func setBuildInPod(build *buildapi.Build, pod *kapi.Pod, groupVersion unversioned.GroupVersion) error {
	envVar, err := buildEnvVar(pod)
	if err != nil {
		return err
	}
	encodedBuild, err := runtime.Encode(kapi.Codecs.LegacyCodec(groupVersion), build)
	if err != nil {
		return err
	}
	envVar.Value = string(encodedBuild)
	return nil
}

func buildEnvVar(pod *kapi.Pod) (*kapi.EnvVar, error) {
	if len(pod.Spec.Containers) == 0 {
		return nil, errors.New("pod has no containers")
	}
	env := pod.Spec.Containers[0].Env
	for i := range env {
		if env[i].Name == "BUILD" {
			if len(env[i].Value) == 0 {
				return nil, errors.New("BUILD environment variable is empty")
			}
			return &env[i], nil
		}
	}
	return nil, errors.New("pod does not have a BUILD environment variable")
}

func hasBuildEnvVar(pod *kapi.Pod) bool {
	_, err := buildEnvVar(pod)
	return err == nil
}

func hasBuildAnnotation(pod *kapi.Pod) bool {
	if pod.Annotations == nil {
		return false
	}
	_, hasAnnotation := pod.Annotations[buildapi.BuildAnnotation]
	return hasAnnotation
}


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

package com.google.devtools.build.lib.skyframe.serialization;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableClassToInstanceMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.devtools.build.lib.skyframe.serialization.Memoizer.Serializer;
import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec.MemoizationStrategy;
import com.google.devtools.build.lib.skyframe.serialization.SerializationException.NoCodecException;
import com.google.errorprone.annotations.CheckReturnValue;
import com.google.protobuf.CodedOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nullable;

/**
 * Stateful class for providing additional context to a single serialization "session". This class
 * is thread-safe so long as {@link #serializer} is null (which also implies that {@link
 * #allowFuturesToBlockWritingOn}) is false). If it is not null, this class is not thread-safe and
 * should only be accessed on a single thread for serializing one object (that may involve
 * serializing other objects contained in it).
 */
public class SerializationContext implements SerializationDependencyProvider {
  private final ObjectCodecRegistry registry;
  private final ImmutableClassToInstanceMap<Object> dependencies;
  @Nullable private final Memoizer.Serializer serializer;
  private final Set<Class<?>> explicitlyAllowedClasses;
  /** Initialized lazily. */
  @Nullable private List<ListenableFuture<Void>> futuresToBlockWritingOn;

  private final boolean allowFuturesToBlockWritingOn;

  private SerializationContext(
      ObjectCodecRegistry registry,
      ImmutableClassToInstanceMap<Object> dependencies,
      @Nullable Serializer serializer,
      boolean allowFuturesToBlockWritingOn) {
    this.registry = registry;
    this.dependencies = dependencies;
    this.serializer = serializer;
    this.allowFuturesToBlockWritingOn = allowFuturesToBlockWritingOn;
    explicitlyAllowedClasses = serializer != null ? new HashSet<>() : ImmutableSet.of();
  }

  @VisibleForTesting
  public SerializationContext(
      ObjectCodecRegistry registry, ImmutableClassToInstanceMap<Object> dependencies) {
    this(registry, dependencies, /*serializer=*/ null, /*allowFuturesToBlockWritingOn=*/ false);
  }

  @VisibleForTesting
  public SerializationContext(ImmutableClassToInstanceMap<Object> dependencies) {
    this(AutoRegistry.get(), dependencies);
  }

  // TODO(shahan): consider making codedOut a member of this class.
  public void serialize(Object object, CodedOutputStream codedOut)
      throws IOException, SerializationException {
    serializeInternal(object, /*customMemoizationStrategy=*/ null, codedOut);
  }

  void serializeWithAdHocMemoizationStrategy(
      Object object, MemoizationStrategy memoizationStrategy, CodedOutputStream codedOut)
      throws IOException, SerializationException {
    serializeInternal(object, memoizationStrategy, codedOut);
  }

  private void serializeInternal(
      Object object,
      @Nullable MemoizationStrategy customMemoizationStrategy,
      CodedOutputStream codedOut)
      throws IOException, SerializationException {
    ObjectCodecRegistry.CodecDescriptor descriptor =
        recordAndGetDescriptorIfNotConstantMemoizedOrNull(object, codedOut);
    if (descriptor != null) {
      if (serializer == null) {
        descriptor.serialize(this, object, codedOut);
      } else {
        @SuppressWarnings("unchecked")
        ObjectCodec<Object> castCodec = (ObjectCodec<Object>) descriptor.getCodec();
        MemoizationStrategy memoizationStrategy =
            customMemoizationStrategy != null ? customMemoizationStrategy : castCodec.getStrategy();
        serializer.serialize(this, object, castCodec, codedOut, memoizationStrategy);
      }
    }
  }

  @Override
  public <T> T getDependency(Class<T> type) {
    return checkNotNull(dependencies.getInstance(type), "Missing dependency of type %s", type);
  }

  /**
   * Returns a {@link SerializationContext} that will memoize values it encounters (using reference
   * equality) in a new memoization table. The returned context should be used instead of the
   * original: memoization may only occur when using the returned context. Calls must be in pairs
   * with {@link DeserializationContext#getMemoizingContext} in the corresponding deserialization
   * code.
   *
   *
This method is idempotent: calling it on an already memoizing context will return the same
   * context.
   */
  @CheckReturnValue
  public SerializationContext getMemoizingContext() {
    if (serializer != null) {
      return this;
    }
    return getNewMemoizingContext(/*allowFuturesToBlockWritingOn=*/ false);
  }

  /**
   * Returns a {@link SerializationContext} that will memoize values as described in {@link
   * #getMemoizingContext} and additionally permits attaching futures through {@link
   * #addFutureToBlockWritingOn}.
   */
  @CheckReturnValue
  public SerializationContext getMemoizingAndBlockingOnWriteContext() {
    checkState(serializer == null, "Should only be called on base serializationContext");
    checkState(!allowFuturesToBlockWritingOn, "Should only be called on base serializationContext");
    return getNewMemoizingContext(/*allowFuturesToBlockWritingOn=*/ true);
  }

  /**
   * Returns a memoizing {@link SerializationContext}, as getMemoizingContext above. Unlike
   * getMemoizingContext, this method is not idempotent - the returned context will always be fresh.
   */
  public SerializationContext getNewMemoizingContext() {
    return getNewMemoizingContext(allowFuturesToBlockWritingOn);
  }

  private SerializationContext getNewMemoizingContext(boolean allowFuturesToBlockWritingOn) {
    return new SerializationContext(
        registry, dependencies, new Memoizer.Serializer(), allowFuturesToBlockWritingOn);
  }

  /**
   * Returns a new {@link SerializationContext} mostly identical to this one, but with a dependency
   * map composed by applying overrides to this context's dependencies.
   *
   *
The given {@code dependencyOverrides} may contain keys already present (in which case the
   * dependency will be replaced) or new keys (in which case the dependency will be added).
   *
   *
Must only be called on a base context (no memoization state), since changing dependencies
   * may change deserialization semantics.
   */
  @CheckReturnValue
  public SerializationContext withDependencyOverrides(ClassToInstanceMap<?> dependencyOverrides) {
    checkState(serializer == null, "Must only be called on base SerializationContext");
    return new SerializationContext(
        registry,
        ImmutableClassToInstanceMap.builder()
            .putAll(Maps.filterKeys(dependencies, k -> !dependencyOverrides.containsKey(k)))
            .putAll(dependencyOverrides)
            .build(),
        /*serializer=*/ null,
        allowFuturesToBlockWritingOn);
  }

  /**
   * Registers a {@link ListenableFuture} that must complete successfully before the serialized
   * bytes generated using this context can be written remotely.
   */
  public void addFutureToBlockWritingOn(ListenableFuture<Void> future) {
    checkState(allowFuturesToBlockWritingOn, "This context cannot block on a future");
    if (futuresToBlockWritingOn == null) {
      futuresToBlockWritingOn = new ArrayList<>();
    }
    futuresToBlockWritingOn.add(future);
  }

  /**
   * Creates a future that succeeds when all futures stored in this context via {@link
   * #addFutureToBlockWritingOn} have succeeded, or null if no such futures were stored.
   */
  @Nullable
  public ListenableFuture<Void> createFutureToBlockWritingOn() {
    return futuresToBlockWritingOn != null
        ? Futures.whenAllSucceed(futuresToBlockWritingOn).call(() -> null, directExecutor())
        : null;
  }

  /**
   * Asserts during serialization that the encoded class of this codec has been explicitly
   * whitelisted for serialization (using {@link #addExplicitlyAllowedClass}). Codecs for objects
   * that are expensive to serialize and that should only be encountered in a limited number of
   * types of {@link com.google.devtools.build.skyframe.SkyValue}s should call this method to check
   * that the object is being serialized as part of an expected {@link
   * com.google.devtools.build.skyframe.SkyValue}, like {@link
   * com.google.devtools.build.lib.packages.Package} inside {@link
   * com.google.devtools.build.lib.skyframe.PackageValue}.
   */
  public <T> void checkClassExplicitlyAllowed(Class<T> allowedClass, T objectForDebugging)
      throws SerializationException {
    if (serializer == null) {
      throw new SerializationException(
          "Cannot check explicitly allowed class "
              + allowedClass
              + " without memoization ("
              + objectForDebugging
              + ")");
    }
    if (!explicitlyAllowedClasses.contains(allowedClass)) {
      throw new SerializationException(
          allowedClass
              + " not explicitly allowed (allowed classes were: "
              + explicitlyAllowedClasses
              + ") and object is "
              + objectForDebugging);
    }
  }

  /**
   * Adds an explicitly allowed class for this serialization context, which must be a memoizing
   * context. Must be called by any codec that transitively serializes an object whose codec calls
   * {@link #checkClassExplicitlyAllowed}.
   *
   *
Normally called by codecs for {@link com.google.devtools.build.skyframe.SkyValue} subclasses
   * that know they may encounter an object that is expensive to serialize, like {@link
   * com.google.devtools.build.lib.skyframe.PackageValue} and {@link
   * com.google.devtools.build.lib.packages.Package} or {@link
   * com.google.devtools.build.lib.analysis.ConfiguredTargetValue} and {@link
   * com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget}.
   *
   *
In case of an unexpected failure from {@link #checkClassExplicitlyAllowed}, it should first
   * be determined if the inclusion of the expensive object is legitimate, before it is whitelisted
   * using this method.
   */
  public void addExplicitlyAllowedClass(Class<?> allowedClass) throws SerializationException {
    if (serializer == null) {
      throw new SerializationException(
          "Cannot add explicitly allowed class %s without memoization: " + allowedClass);
    }
    explicitlyAllowedClasses.add(allowedClass);
  }

  private boolean writeNullOrConstant(@Nullable Object object, CodedOutputStream codedOut)
      throws IOException {
    if (object == null) {
      codedOut.writeSInt32NoTag(0);
      return true;
    }
    Integer tag = registry.maybeGetTagForConstant(object);
    if (tag != null) {
      codedOut.writeSInt32NoTag(tag);
      return true;
    }
    return false;
  }

  @Nullable
  private ObjectCodecRegistry.CodecDescriptor recordAndGetDescriptorIfNotConstantMemoizedOrNull(
      @Nullable Object object, CodedOutputStream codedOut) throws IOException, NoCodecException {
    if (writeNullOrConstant(object, codedOut)) {
      return null;
    }
    if (serializer != null) {
      Integer memoizedIndex = serializer.getMemoizedIndex(object);
      if (memoizedIndex != null) {
        // Subtract 1 so it will be negative and not collide with null.
        codedOut.writeSInt32NoTag(-memoizedIndex - 1);
        return null;
      }
    }
    ObjectCodecRegistry.CodecDescriptor descriptor = registry.getCodecDescriptorForObject(object);
    codedOut.writeSInt32NoTag(descriptor.getTag());
    return descriptor;
  }
}


text:
<?php

namespace Concrete\Core\Page\Type\Command;

use Concrete\Core\Foundation\Command\Command;

class UpdatePageTypeDefaultsCommand extends Command
{
    /**
     * @var int
     */
    protected $pageTypeDefaultPageID;

    /**
     * @var int
     */
    protected $pageID;

    /**
     * @var int
     */
    protected $collectionVersionID;

    /**
     * @var string
     */
    protected $blocksToUpdate;

    /**
     * @var string
     */
    protected $blocksToAdd;

    public function __construct(int $pageTypeDefaultPageID, int $pageID, int $collectionVersionID, string $blocksToUpdate, string $blocksToAdd)
    {
        $this
            ->setPageTypeDefaultPageID($pageTypeDefaultPageID)
            ->setPageID($pageID)
            ->setCollectionVersionID($collectionVersionID)
            ->setBlocksToUpdate($blocksToUpdate)
            ->setBlocksToAdd($blocksToAdd)
        ;
    }

    public function getPageTypeDefaultPageID(): int
    {
        return $this->pageTypeDefaultPageID;
    }

    /**
     * @return $this
     */
    public function setPageTypeDefaultPageID(int $pageTypeDefaultPageID): object
    {
        $this->pageTypeDefaultPageID = $pageTypeDefaultPageID;

        return $this;
    }

    public function getPageID(): int
    {
        return $this->pageID;
    }

    /**
     * @return $this
     */
    public function setPageID(int $pageID): object
    {
        $this->pageID = $pageID;

        return $this;
    }

    public function getCollectionVersionID(): int
    {
        return $this->collectionVersionID;
    }

    /**
     * @return $this
     */
    public function setCollectionVersionID(int $collectionVersionID): object
    {
        $this->collectionVersionID = $collectionVersionID;

        return $this;
    }

    public function getBlocksToUpdate(): string
    {
        return $this->blocksToUpdate;
    }

    /**
     * @return $this
     */
    public function setBlocksToUpdate(string $blocksToUpdate): object
    {
        $this->blocksToUpdate = $blocksToUpdate;

        return $this;
    }

    public function getBlocksToAdd(): string
    {
        return $this->blocksToAdd;
    }

    /**
     * @return $this
     */
    public function setBlocksToAdd(string $blocksToAdd): object
    {
        $this->blocksToAdd = $blocksToAdd;

        return $this;
    }
}


text:
package me.liaowei.mangdie.model;

import java.util.Date;

public class UserRole {
    private Long userRoleId;

    private Long userId;

    private Long roleId;

    private Long createUserId;

    private Long modifiedUserId;

    private Date gmtModified;

    private Date gmtCreate;

    public Long getUserRoleId() {
        return userRoleId;
    }

    public void setUserRoleId(Long userRoleId) {
        this.userRoleId = userRoleId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Long getModifiedUserId() {
        return modifiedUserId;
    }

    public void setModifiedUserId(Long modifiedUserId) {
        this.modifiedUserId = modifiedUserId;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }
}


text:
package com.lixiaodaoaaa.view.pieview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;

public class CanvasTestView extends View {

    private Paint paint;
    private int mWidth;
    private int mHeight;

    public CanvasTestView(Context context) {
        this(context, null);
        initPaint();
    }

    private void initPaint() {
        paint = new Paint();
        paint.setColor(Color.BLUE);
        paint.setAntiAlias(true);
        paint.setStrokeWidth(12);
        paint.setStyle(Paint.Style.STROKE);
    }

    public CanvasTestView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        mWidth = w;
        mHeight = h;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
//        translateTest(canvas);
//        scaleTest(canvas);
//        scaleTest03(canvas);
//        rotateTest01(canvas);
//        goodTest01(canvas);
//        screwTest(canvas);
//        testPathClose(canvas);
//        testPathDirection(canvas);
//        testPathForCan(canvas);
//        testArctoTest(canvas);
        rLineToTest(canvas);
    }

    private void translateTest(Canvas canvas) {
        for (int i = 0; i < 10; i++) {
            paint.setColor(Color.BLUE);
            canvas.translate(200, 200);
            canvas.drawCircle(0, 0, 100, paint);
        }
    }

    private void scaleTest(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);
        paint.setColor(Color.RED);
        Rect rect = new Rect(0, -400, 400, 0);
        canvas.drawRect(rect, paint);
        canvas.save();
        canvas.scale(0.5f, 0.5f);
        paint.setColor(Color.BLUE);
        canvas.drawRect(rect, paint);
        canvas.restore();
    }

    private void scaleTest01(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);
        paint.setColor(Color.RED);
        Rect rect = new Rect(0, -400, 400, 0);
        canvas.drawRect(rect, paint);
        canvas.save();
        canvas.scale(0.5f, 0.5f, 200, -200);
        paint.setColor(Color.BLUE);
        canvas.drawRect(rect, paint);
        canvas.restore();
    }

    private void scaleTest02(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);
        paint.setColor(Color.RED);
        Rect rect = new Rect(0, -400, 400, 0);
        canvas.drawRect(rect, paint);
        canvas.save();
        canvas.scale(0.5f, 0.5f, 200, 0);
        paint.setColor(Color.BLUE);
        canvas.drawRect(rect, paint);
        canvas.restore();
    }

    private void scaleTest03(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);
        paint.setColor(Color.BLUE);
        Rect rect = new Rect(-400, -400, 400, 400);

        for (int i = 0; i < 10; i++) {
            canvas.drawRect(rect, paint);
            canvas.scale(0.82f, 0.82f);
            canvas.drawRect(rect, paint);
        }
    }

    private void rotateTest01(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);
        paint.setColor(Color.RED);
        Rect rect = new Rect(0, -400, 400, 0);
        canvas.drawRect(rect, paint);
        paint.setColor(Color.BLUE);
        canvas.rotate(270, 0, 0);
        canvas.drawRect(rect, paint);
    }

    private void goodTest01(Canvas canvas) {
        // 将坐标系原点移动到画布正中心
        canvas.translate(mWidth / 2, mHeight / 2);
        canvas.drawCircle(0, 0, 400, paint);          // 绘制两个圆形
        paint.setColor(Color.GREEN);
        canvas.drawCircle(0, 0, 320, paint);
        for (int i = 0; i <= 360; i += 10) {               // 绘制圆形之间的连接线
            canvas.drawLine(0, 320, 0, 400, paint);
            canvas.rotate(10);
        }
    }

    private void screwTest(Canvas canvas) {
        // 将坐标系原点移动到画布正中心
        canvas.translate(mWidth / 2, mHeight / 2);

        RectF rect = new RectF(-200, 0, 0, 200);   // 矩形区域

        paint.setColor(Color.BLACK);           // 绘制黑色矩形
        canvas.drawRect(rect, paint);

        canvas.skew(1, 0);                       // 水平错切 <- 45度

        paint.setColor(Color.BLUE);            // 绘制蓝色矩形
        canvas.drawRect(rect, paint);
    }

    private void pathTest(Canvas canvas) {
        Path path = new Path();
        canvas.translate(mWidth / 2, mHeight / 2);

        path.lineTo(200, 200);
        path.lineTo(0, 200);
        path.lineTo(0, 0);
        canvas.drawPath(path, paint);
    }

    private void testPathClose(Canvas canvas) {
        Path path = new Path();
        canvas.translate(mWidth / 2, mHeight / 2);

        path.lineTo(200, 200);
        path.lineTo(0, 200);
        path.close();
        canvas.drawPath(path, paint);
    }

    private void testPathDirection(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);  // 移动坐标系到屏幕中心

        Path path = new Path();

        path.addRect(-100, -100, 100, 100, Path.Direction.CCW);

        path.setLastPoint(-500, 500);// <-- 重置最后一个点的位置
        path.close();
        canvas.drawPath(path, paint);
        path.close();
    }

    private void testPathForCan(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);  // 移动坐标系到屏幕中心
//        canvas.scale(1, -1);                         // <-- 注意 翻转y坐标轴

        Path path = new Path();
        Path src = new Path();

        path.addRect(-200, -200, 200, 200, Path.Direction.CW);
        src.addCircle(0, 0, 100, Path.Direction.CW);

        path.addPath(src, 0, 200);
        paint.setColor(Color.BLACK);           // 绘制合并后的路径
        canvas.drawPath(path, paint);
    }

    private void testArctoTest(Canvas canvas) {
        canvas.translate(mWidth / 2, mHeight / 2);  // 移动坐标系到屏幕中心
//        canvas.scale(1, -1);                         // <-- 注意 翻转y坐标轴

        Path path = new Path();
        path.lineTo(100, 100);

        RectF oval = new RectF(0, 0, 300, 300);

        path.addArc(oval, 0, 270);
// path.arcTo(oval,0,270,false);             // <-- 和上面一句作用等价

        canvas.drawPath(path, paint);
    }

    private void isArtTest(Canvas canvas) {
        Path path = new Path();
        path.lineTo(0, 400);
        path.lineTo(400, 400);
        path.lineTo(400, 0);
        path.lineTo(0, 0);

        RectF rect = new RectF();
        boolean b = path.isRect(rect);
        System.out.println("   result is " + b);
    }

    private void rLineToTest(Canvas canvas) {
        Path path = new Path();
        path.moveTo(100, 100);
        path.rLineTo(0, 200);
        canvas.drawPath(path, paint);
    }

}


text:
<?php

namespace Lsv\UberApi\Endpoints\Estimates;

use Geocoder\Model\Coordinates;
use Lsv\UberApi\AbstractRequest;
use Lsv\UberApi\Entity\Estimate\Time as TimeEntity;
use Psr\Http\Message\ResponseInterface;

/**
 * The Time Estimates endpoint returns ETAs for all products offered at a given location,
 * with the responses expressed as integers in seconds.
 *
 * We recommend that this endpoint be called every minute to provide the most accurate,up-to-date ETAs.
 */
class Time extends AbstractRequest
{
    /**
     * Get time estimaties.
     *
     * @param Coordinates $start
     * @param null|string $customerUuid
     * @param null|string $productId
     *
     * @return TimeEntity[]
     */
    public function query(Coordinates $start, $customerUuid = null, $productId = null)
    {
        $params = [
            'start_latitude'  => $start->getLatitude(),
            'start_longitude' => $start->getLongitude(),
        ];

        if ($customerUuid) {
            $params['customer_uuid'] = $customerUuid;
        }

        if ($productId) {
            $params['product_id'] = $productId;
        }

        return $this->doQuery($params);
    }

    /**
     * API Endpoint.
     *
     * @return string
     */
    protected function getEndPoint()
    {
        return 'estimates/time';
    }

    /**
     * Parse the query response.
     *
     * @param ResponseInterface $response
     * @param array             $queryParameters
     * @param array             $pathParameters
     *
     * @return mixed
     */
    protected function parseResponse(ResponseInterface $response, $queryParameters, $pathParameters)
    {
        $results = json_decode($response->getBody(), true);

        return TimeEntity::createFromArray($results['times'], $queryParameters, $pathParameters);
    }
}


text:
Companies Selected Students

          {{ company.name }}

          Applicants

        <button class="list-group-item" ng-click="selectStudent($index)" ng-repeat="applicants in vm.currentApplicants track by $index"> {{ applicants.name }}
        </button>

          Selected Students

        <button class="list-group-item" ng-click="unselectStudent($index)" ng-repeat="applicants in vm.currentSelectedStudents track by $index"> {{ applicants.name }}
        </button>

      <button ng-repeat="company in vm.companies track by $index" ng-click="viewCompany($index)" class="list-group-item" style="padding: 5px 20px;">
        {{ company.name }}
      </button>


text:
<?php

namespace Cerad\Bundle\GameBundle\Action\Project\GameOfficial\AssignByUser;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class AssignByUserSlotFormType extends AbstractType
{
    public function getName() { return 'cerad_game__game_official__assign_by_user_slot'; }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Cerad\Bundle\GameBundle\Doctrine\Entity\GameOfficial',
        ));
    }
    protected $workflow;
    protected $projectOfficial;

    public function __construct($workflow,$projectOfficial)
    {
        $this->workflow        = $workflow;
        $this->projectOfficial = $projectOfficial;
    }
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('role', 'text', array(
            'attr'      => array('size' => 10),
            'read_only' => true,
        ));
        $subscriber = new AssignByUserSlotSubscriber($builder->getFormFactory(),$this->workflow,$this->projectOfficial);
        $builder->addEventSubscriber($subscriber);

        if ($options);
    }
}


text:
from __future__ import annotations

from pants.backend.python.dependency_inference.module_mapper import (
    ModuleProviderType,
    ThirdPartyPythonModuleMapping,
)
from pants.engine.addresses import Address
from pants.util.docutil import doc_url
from pants.util.strutil import softwrap

class MissingPythonCodegenRuntimeLibrary(Exception):
    pass

class AmbiguousPythonCodegenRuntimeLibrary(Exception):
    pass

def find_python_runtime_library_or_raise_error(
    module_mapping: ThirdPartyPythonModuleMapping,
    codegen_address: Address,
    runtime_library_module: str,
    *,
    resolve: str,
    resolves_enabled: bool,
    recommended_requirement_name: str,
    recommended_requirement_url: str,
    disable_inference_option: str,
) -> Address:
    addresses = [
        possible_module_provider.provider.addr
        for possible_module_provider in module_mapping.providers_for_module(
            runtime_library_module, resolve=resolve
        )
        if possible_module_provider.provider.typ == ModuleProviderType.IMPL
    ]
    if len(addresses) == 1:
        return addresses[0]

    for_resolve_str = f" for the resolve '{resolve}'" if resolves_enabled else ""
    if not addresses:
        resolve_note = softwrap(
            (
                f"""
                Note that because `[python].enable_resolves` is set, you must specifically have a
                `python_requirement` target that uses the same resolve '{resolve}' as the target
                {codegen_address}. Alternatively, update {codegen_address} to use a different
                resolve.
                """
            )
            if resolves_enabled
            else ""
        )
        raise MissingPythonCodegenRuntimeLibrary(
            softwrap(
                f"""
                No `python_requirement` target was found with the module `{runtime_library_module}`
                in your project{for_resolve_str}, so the Python code generated from the target
                {codegen_address} will not work properly. See
                {doc_url('python-third-party-dependencies')} for how to add a requirement, such as
                adding to requirements.txt. Usually you will want to use the
                `{recommended_requirement_name}` project at {recommended_requirement_url}.

                {resolve_note}

                To ignore this error, set `{disable_inference_option} = false` in `pants.toml`.
                """
            )
        )

    alternative_solution = softwrap(
        (
            f"""
            Alternatively, change the resolve field for {codegen_address} to use a different resolve
            from `[python].resolves`.
            """
        )
        if resolves_enabled
        else (
            f"""
            Alternatively, if you do want to have multiple conflicting versions of the
            `{runtime_library_module}` requirement, set `{disable_inference_option} = false` in
            `pants.toml`. Then manually add a dependency on the relevant `python_requirement` target
            to each target that directly depends on this generated code (e.g. `python_source` targets).
            """
        )
    )
    raise AmbiguousPythonCodegenRuntimeLibrary(
        softwrap(
            f"""
            Multiple `python_requirement` targets were found with the module `{runtime_library_module}`
            in your project{for_resolve_str}, so it is ambiguous which to use for the runtime library
            for the Python code generated from the the target {codegen_address}:
            {sorted(addr.spec for addr in addresses)}

            To fix, remove one of these `python_requirement` targets{for_resolve_str} so that
            there is no ambiguity and Pants can infer a dependency. {alternative_solution}
            """
        )
    )


text:
package org.nlpub.watset.util;

import org.apache.commons.math3.linear.ArrayRealVector;
import org.apache.commons.math3.linear.RealVector;

import java.util.Collection;
import java.util.Map;

/**
 * Utilities for mapping bags-of-words to real-valued vectors.
 *
 * @see Dot products
 */
public interface Vectors {
    /**
     * Transform the bag-of-words into a real-valued vector.
     *

     * The number of elements in the vector is equal to the size of the key set of the given bag.
     *
     * @param bag the bag-of-words
     * @param <V> the type of bag elements
     * @return a real-valued vector
     */
    static <V> RealVector transform(Map<V, Number> bag) {
        return transform(bag, bag.keySet());
    }

    /**
     * Transform the bag-of-words into a real-valued vector.
     *

     * The number of elements in the vector is equal to the size of the domain set.
     *

     * Please make sure that all elements in {@code domain} are unique.
     *
     * @param bag    the bag-of-words
     * @param domain the collection of allowed elements of {@code bag}
     * @param <V>    the type of bag elements
     * @return a real-valued vector
     */
    static <V> RealVector transform(Map<V, Number> bag, Collection<V> domain) {
        final var data = new double[domain.size()];

        var i = 0;

        for (final var key : domain) {
            data[i++] = bag.getOrDefault(key, 0).doubleValue();
        }

        return new ArrayRealVector(data, false);
    }
}


text:
	<form name="form" novalidate class ="css-form form-horizontal form-input" >

		<tabset>
			<tab heading='Thông tin chính'>

							Tên công ty/cửa hàng (*)

								<input type="text" name ='name'  class="form-control"  ng-model='data.name' ng-required>

							Địa chỉ (*)

								<input type="text" name ='address'   class="form-control"  ng-model='data.address' ng-required='true'>

							Quận huyện

								<input type="text" name ='city'   class="form-control"  ng-model='data.city'>

							Tỉnh thành  (*)

								<select ng-model='data.province' class='form-control' ng-required='true'>
									<option ng-repeat='tt in province'  ng-value='tt'>{{tt}}</option>
								</select>

							Điện thoại (*)

								<input type="text"   class="form-control"  ng-model='data.phone' ng-required='true'>

							Email (*)

								<input type="email"   class="form-control"  ng-model='data.email' ng-required='true'>

							Giám đốc

								<input type="text"  class="form-control"  ng-model='data.giam_doc'>

							Kế toán trưởng

								<input type="text"  class="form-control"  ng-model='data.ke_toan_truong'>

							Ngày đầu năm tài chính  (*)

								<ng-datepicker ng-model='data.ngay_dn' ng-required='true'></ng-datepicker>

							Ngày sử dụng chương trình  (*)

								<ng-datepicker ng-model='data.ngay_ky1' ng-required='true'></ng-datepicker>

							Ngày khóa sổ  (*)

								<ng-datepicker ng-model='data.ngay_ks' ng-required='true'></ng-datepicker>

							Người nộp thuế

								<input type="text"  class="form-control"  ng-model='data.nguoi_nop_thue'>

							Mã số thuế

								<input type="text"  class="form-control"  ng-model='data.ma_so_thue'>

							Logo

								<input type="file" image-upload  model ='data.logo' folder='logos'/>

			</tab>
			<tab heading='Giới thiệu về công ty'>

					Giới thiệu về công ty/cửa hàng

					Ngành kinh doanh

			</tab>
			<tab heading='Bán hàng online'>

						<input type='checkbox' ng-model='data.sale_online'/> Bán hàng online

					Trang bán hàng

						<input type="text" class="form-control"  ng-model='data.site_name'>

					Facebook

						<input type="text" class="form-control"  ng-model='data.facebook'>

					Từ khóa để SEO

						<textarea class="form-control"  ng-model='data.keywords'></textarea>

					Chính sách vận chuyển

						<textarea  class="form-control"  ng-model='data.van_chuyen'></textarea>

					Chính sách bảo hàng

						<textarea class="form-control"  ng-model='data.bao_hanh'></textarea>

						Phương thức thanh toán

			</tab>
			<tab heading='Quản lý người dùng'>

						Tên	Quản trị

						Xóa

							<ng-typeahead ng-model='participant'
								module="colleague" fields="email,email_owner" field-model="email_coll" field-label = "name_coll" label ="name_coll"
								 on-select ='addParticipant($item)'>
							</ng-typeahead>

							 {{r.name}}

							<input type='checkbox' ng-model='r.admin'/>

							Xóa

			</tab>

		</tabset>

	</form>


text:
namespace cpp_client
{

namespace necrowar
{

void Game_object_::log(const std::string& message)
{
    std::string order = R"({"event": "run", "data": {"functionName": "log", "caller": {"id": ")";
    order += this->id + R"("}, "args": {)";

    order += std::string("\"message\":") + std::string("\"") + message + "\"";

    order += "}}}";
    Necrowar::instance()->send(order);
    //Go until not a delta
    std::unique_ptr<Any> info;
    //until a not bool is seen (i.e., the delta has been processed)
    do
    {
        info = Necrowar::instance()->handle_response();
    } while(info->type() == typeid(bool));
    return;
}

Game_object_::Game_object_(std::initializer_list<std::pair<std::string, Any&&>> init) :
    Base_object{
        {"gameObjectName", Any{std::decay<decltype(game_object_name)>::type{}}},
        {"id", Any{std::decay<decltype(id)>::type{}}},
        {"logs", Any{std::decay<decltype(logs)>::type{}}},
    },
    game_object_name(variables_["gameObjectName"].as<std::decay<decltype(game_object_name)>::type>()),
    id(variables_["id"].as<std::decay<decltype(id)>::type>()),
    logs(variables_["logs"].as<std::decay<decltype(logs)>::type>())
{
    for(auto&& obj : init)
    {
      variables_.emplace(std::make_pair(std::move(obj.first), std::move(obj.second)));
    }
}

Game_object_::~Game_object_() = default;

void Game_object_::resize(const std::string& name, std::size_t size)
{
    if(name == "logs")
    {
        auto& vec = variables_["logs"].as<std::decay<decltype(logs)>::type>();
        vec.resize(size);
        return;
    }
    throw Bad_manipulation(name + " in Game_object treated as a vector, but it is not a vector.");
}

void Game_object_::change_vec_values(const std::string& name, std::vector<std::pair<std::size_t, Any>>& values)
{
    if(name == "logs")
    {
        using type = std::decay<decltype(logs)>::type;
        auto& vec = variables_["logs"].as<type>();
        for(auto&& val : values)
        {
            vec[val.first] = std::move(val.second.as<type::value_type>());
        }
        return;
    }
    throw Bad_manipulation(name + " in Game_object treated as a vector, but it is not a vector.");
}

void Game_object_::remove_key(const std::string& name, Any& key)
{
    throw Bad_manipulation(name + " in Game_object treated as a map, but it is not a map.");
}

std::unique_ptr<Any> Game_object_::add_key_value(const std::string& name, Any& key, Any& value)
{
    throw Bad_manipulation(name + " in Game_object treated as a map, but it is not a map.");
}

bool Game_object_::is_map(const std::string& name)
{
    return false;
}

void Game_object_::rebind_by_name(Any* to_change, const std::string& member, std::shared_ptr<Base_object> ref)
{
   throw Bad_manipulation(member + " in Game_object treated as a reference, but it is not a reference.");
}

    Base_game* Game_object_::get_game() { return Necrowar::instance(); }

} // necrowar

} // cpp_client