text:
package es.tid.pce.pcep.objects;

/**
 * Wavelength Assignement Object.
 *
 * http://tools.ietf.org/html/draft-lee-pce-wson-rwa-ext-03
 *
 * And additions..
 *
 *  The format of the Wavelength Assignment (WA) object body is as
   follows:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                           Flags                       |  O  |M|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                                                               |
      //                      Optional TLVs                          //
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Figure 3 WA Object

   o  Flags (32 bits)

   The following new flags SHOULD be set

     . M (Mode - 1 bit): M bit is used to indicate the mode of
        wavelength assignment. When M bit is set to 1, this indicates
        that the label assigned by the PCE must be explicit. That is,
        the selected way to convey the allocated wavelength is by means
        of Explicit Label Control (ELC) [RFC4003] for each hop of a
        computed LSP. Otherwise, the label assigned by the PCE needs
        not be explicit (i.e., it can be suggested in the form of label
        set objects in the corresponding response, to allow distributed
        WA. In such case, the PCE MUST return a Label_Set object in the
        response if the path is found.

   (Ed note: When the distributed WA is applied, some specific
   wavelength range and/or the maximum number of wavelengths to be
   returned in the Label Set might be additionally indicated. The
   optional TLV field will be used for conveying this additional
   request. The details of this encoding will be provided in a later
   revision.)

     . O (Order - 3 bits): O bit is used to indicate the wavelength
        assignment constraint in regard to the order of wavelength
        assignment to be returned by the PCE. This case is only applied
        when M bit is set to "explicit." The following indicators
        should be defined:

         000 - Reserved

         001 - Random Assignment

         010 - First Fit (FF) in descending Order

         011 - First Fit (FF) in ascending Order

         100 - Last Fit (LF) in ascending Order

         101 - Last Fit (LF) in descending Order

         110 - Vendor Specific/Private

         111 - Reserved

   When the Order bit is set for "Vendor Specific/Private", the
   optional TLV field will be used to indicate specifics of the order
   algorithm applied by the PCE.
 * @author ogondio
 *
 */
public class WavelengthAssignementObject extends PCEPObject{

	//private boolean mode;

	//private int order;

	private boolean retry;

	public WavelengthAssignementObject(){
		super();
		this.setObjectClass(ObjectParameters.PCEP_OBJECT_CLASS_WAVELENGTH_ASSIGNEMENT);
		this.setOT(ObjectParameters.PCEP_OBJECT_TYPE_WAVELENGTH_ASSIGNEMENT);
	}

	public WavelengthAssignementObject(byte []bytes, int offset) throws MalformedPCEPObjectException{
		super(bytes,offset);
		decode();
	}

	public void encode() {
		ObjectLength=8;/* 4 bytes de la cabecera + 4 del cuerpo */
		object_bytes=new byte[ObjectLength];
		encode_header();
		this.object_bytes[4]=0;
		this.object_bytes[5]=0;
		this.object_bytes[6]=0;
		this.object_bytes[7]=(byte)((retry==true)?0x10:0);
	}

	@Override
	public void decode() throws MalformedPCEPObjectException {
		retry=(this.object_bytes[7]&0x10)==0x10;
	}

	public boolean isRetry() {
		return retry;
	}

	public void setRetry(boolean retry) {
		this.retry = retry;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + (retry ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		WavelengthAssignementObject other = (WavelengthAssignementObject) obj;
		if (retry != other.retry)
			return false;
		return true;
	}

}


text:
using System.Collections.Generic;
using System.Linq;

namespace SupaCharge.Core.Web.Utility {
  public class MultipartFormDataBuilder {
    private class Entry {
      public string Key{get;set;}
      public object Value{get;set;}
    }

    public MultipartFormDataBuilder(string boundary) {
      mBoundary = boundary;
    }

    public void Add(string key, object value) {
      mEntries.Add(new Entry {Key = key, Value = value});
    }

    public string Build() {
      return mEntries.Any() ? BuildData() : "";
    }

    private string BuildData() {
      var bodyParts = mEntries.Select(e => string.Concat(_BodyParts[0], mBoundary, _BodyParts[1], e.Key, _BodyParts[2], e.Value)).ToArray();
      return _Header + string.Join(_Sep, bodyParts) + GetFooter();
    }

    private string GetFooter() {
      return string.Concat(_Sep, "--", mBoundary, "--");
    }

    private const string _Sep = "\r\n";
    private const string _Header = "\r\n\r\n";

    private static readonly string[] _BodyParts = new[] {
                                                          "--",
                                                          "\r\ncontent-disposition: form-data; name=\"",
                                                          "\"\r\n\r\n"
                                                        };

    private readonly string mBoundary;
    private readonly List<Entry> mEntries = new List<Entry>();
  }
}

redpajama_set_name: RedPajamaGithub


text:
package uk.nhs.kch.rassyeyanie.rules.common.pims.translations;

import uk.nhs.kch.rassyeyanie.framework.AbstractA01Processor;

public class PimsAllHicAll extends AbstractA01Processor {

}


text:
namespace blink {

void HeapObject::Trace(Visitor* visitor) {
    visitor->Trace(m_crossThreadPersistent);
    visitor->Trace(m_crossThreadWeakPersistent);
}

}


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>EnableI3DL2ReverbSoundEffect Method</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            IrrKlang.NET

ISoundEffectControl.EnableI3DL2ReverbSoundEffect Method

 Enables the I3DL2Reverb sound effect with default values. An implementation of the listener properties in the I3DL2 specification. Source properties are not supported. If this sound effect is already enabled, calling this only modifies the parameters of the active effect.

Overload List

 Enables the I3DL2Reverb sound effect with default values. An implementation of the listener properties in the I3DL2 specification. Source properties are not supported. If this sound effect is already enabled, calling this only modifies the parameters of the active effect.

        public bool EnableI3DL2ReverbSoundEffect();

 Enables the I3DL2Reverb sound effect with default values. An implementation of the listener properties in the I3DL2 specification. Source properties are not supported. If this sound effect is already enabled, calling this only modifies the parameters of the active effect.

        public bool EnableI3DL2ReverbSoundEffect(int,int,float,float,float,int,float,int,float,float,float,float);

See Also

        ISoundEffectControl Class | IrrKlang Namespace

          The irrKlang Sound Engine Documentation © 2003-2010 by Nikolaus Gebhardt.


text:
package com.example.web.listener;

import javax.servlet.http.HttpSessionActivationListener;
import javax.servlet.http.HttpSessionEvent;

/**
 * Created by kslisenko on 11/23/14.
 */
public class MyHttpSessionActivationListener implements HttpSessionActivationListener {

    @Override
    public void sessionWillPassivate(HttpSessionEvent httpSessionEvent) {
        System.out.println(">>Session " + httpSessionEvent.getSession().getId() + " will passivate");
    }

    @Override
    public void sessionDidActivate(HttpSessionEvent httpSessionEvent) {
        System.out.println(">>Session " + httpSessionEvent.getSession().getId() + " did actiate");
    }
}


text:
package log

import (
	"fmt"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEntry_WithFields(t *testing.T) {
	a := NewEntry(nil)
	assert.Nil(t, a.Fields)

	b := a.WithFields(Fields{"foo": "bar"})
	assert.Equal(t, Fields{}, a.mergedFields())
	assert.Equal(t, Fields{"foo": "bar"}, b.mergedFields())

	c := a.WithFields(Fields{"foo": "hello", "bar": "world"})

	e := c.finalize(InfoLevel, "upload")
	assert.Equal(t, e.Message, "upload")
	assert.Equal(t, e.Fields, Fields{"foo": "hello", "bar": "world"})
	assert.Equal(t, e.Level, InfoLevel)
	assert.NotEmpty(t, e.Timestamp)
}

func TestEntry_WithField(t *testing.T) {
	a := NewEntry(nil)
	b := a.WithField("foo", "bar")
	assert.Equal(t, Fields{}, a.mergedFields())
	assert.Equal(t, Fields{"foo": "bar"}, b.mergedFields())
}

func TestEntry_WithError(t *testing.T) {
	a := NewEntry(nil)
	b := a.WithError(fmt.Errorf("boom"))
	assert.Equal(t, Fields{}, a.mergedFields())
	assert.Equal(t, Fields{"error": "boom"}, b.mergedFields())
}

func TestEntry_WithErrorFields(t *testing.T) {
	a := NewEntry(nil)
	b := a.WithError(errFields("boom"))
	assert.Equal(t, Fields{}, a.mergedFields())
	assert.Equal(t, Fields{
		"error":  "boom",
		"reason": "timeout",
	}, b.mergedFields())
}

type errFields string

func (ef errFields) Error() string {
	return string(ef)
}

func (ef errFields) Fields() Fields {
	return Fields{"reason": "timeout"}
}


text:
/**
 */
package gluemodel.CIM.IEC61970.StateVariables;

import gluemodel.CIM.Element;

/**
 *
 * A representation of the model object 'State Variable'.
 *
 *
 *
 * @see gluemodel.CIM.IEC61970.StateVariables.StateVariablesPackage#getStateVariable()
 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='An abstract class for state variables.'"
 *        annotation="http://langdale.com.au/2005/UML Profile\040documentation='An abstract class for state variables.'"
 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='An abstract class for state variables.' Profile\040documentation='An abstract class for state variables.'"
 * @generated
 */
public interface StateVariable extends Element {
} // StateVariable


text:
<?php
/**
 * @category    Brownie/CartsGuru
 * @author      Brownie <oss.brownie@gmail.com>
 * @license     http://www.gnu.org/copyleft/lesser.html
 */

namespace Brownie\CartsGuru\Exception;

/**
 * Exception caused by parsing json.
 */
class JsonException extends \Exception
{
}


text:
.icon{ background-image: url(../slice/icon.png); width: 40px; height: 40px; background-repeat: no-repeat;}
.label{ background-image: url(../slice/label.png); width: 40px; height: 40px; background-repeat: no-repeat;}

.dib{ display: inline-block;}

.img1{ background-image: url(../slice/jpg/img1.jpg); width: 80px; height: 80px; background-repeat: no-repeat;}
.img2{ background-image: url(../slice/jpg/img2.jpg); width: 80px; height: 80px; background-repeat: no-repeat;}


text:
package com.youama.nexus.parser.collector;

import com.youama.nexus.core.item.BasicItem;
import com.youama.nexus.core.text.WordUtil;
import org.jsoup.Jsoup;
import org.jsoup.select.Elements;

import java.util.List;

/**
 * This class implements the BaseCollector and Collector. TextCollector collects words by different rules. This class
 * should not be referenced directly, it is handled by the FactoryCollector class.
 *
 * @author David Belicza - 87.bdavid@gmail.com
 * @since 0.1.0
 */
public class TextCollector extends BaseCollector implements Collector {

    /**
     * It sets the html source the property.
     *
     * @param textBasedHTMLSource A regular text based HTML code as a String.
     */
    public TextCollector(String textBasedHTMLSource) {
        super(textBasedHTMLSource);
    }

    /**
     * It collects the sentences and words by default value.
     */
    public void parse() {
        parseByRule(CollectorSelector.TEXT_ALL);
    }

    /**
     * It collects the sentences and words by the rule identifier.
     *
     * @param rule The ID of the rule.
     */
    public void parseByRule(CollectorSelector rule) {
        switch (rule) {
            case TEXT_ALL:
                collectText("html");
                break;
            case TEXT_BODY:
                collectText("body");
        }
    }

    /**
     * It selects the clear text from an HTML document by the name of the HTML tag then it splits the text to sentences
     * and words. When it finished it retrieves the separated, collected words.
     *
     * @param htmlTag The html tag as a String. "title" for example.
     */
    protected void collectText(String htmlTag) {
        resetParsedItems();
        Elements elements = DOM.getElementsByTag(htmlTag);

        if (elements != null) {
            String parentTag = elements.get(0).toString();
            List<BasicItem> sentences = WordUtil.getSentencesFromText(Jsoup.parse(parentTag).text());
            if (sentences != null) {
                parsedItems = sentences;
            }
        }
    }
}


text:
package com.example.agonyaunt;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

import com.example.agonyaunt.R;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Teng Li on 09/07/2014.
 */

public class EditPatientActivity extends Activity {

    EditText patientName, patientAge, patientOccupation, patientInterFrequency;
    Button btnUpdate, btnDelete;
    RadioButton rbMale, rbFemale;

    String pid;

    // Progress Dialog
    private ProgressDialog pDialog;

    // JSON parser class
    JSONParser jsonParser = new JSONParser();

    // single patient url
//    private static final String url_patient_details = "http://10.0.2.2:8888/AndroidApp/get_patient_details.php";
    private static final String url_patient_details = "http://tl29.host.cs.st-andrews.ac.uk/AndroidApp/get_patient_details.php";

    // url to update patient
//    private static final String url_update_patient = "http://10.0.2.2:8888/AndroidApp/update_patient.php";
    private static final String url_update_patient = "http://tl29.host.cs.st-andrews.ac.uk/AndroidApp/update_patient.php";

    // url to delete patient
//    private static final String url_delete_patient = "http://10.0.2.2:8888/AndroidApp/delete_patient.php";
    private static final String url_delete_patient = "http://tl29.host.cs.st-andrews.ac.uk/AndroidApp/delete_patient.php";

    // JSON Node names
    private static final String TAG_SUCCESS = "success";
    private static final String TAG_PATIENT = "patient";
    private static final String TAG_PID = "pid";
    private static final String TAG_NAME = "name";
    private static final String TAG_AGE = "age";
    private static final String TAG_GENDER = "gender";
    private static final String TAG_OCCUPATION = "occupation";
    private static final String TAG_INTERFREQUENCY = "interventionFrequency";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_edit_patient);

        // save button
        btnUpdate = (Button) findViewById(R.id.btnUpdatePatient);
        btnDelete = (Button) findViewById(R.id.btnDeletePatient);

        // getting patient details from intent
        Intent i = getIntent();

        // getting patient id (pid) from intent
        pid = i.getStringExtra(TAG_PID);
        Log.w("What is the value of pid", pid);

        // Getting complete patient details in background thread
        new GetPatientDetails().execute();

        // save button click event
        btnUpdate.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // starting background task to update patient
                new UpdatePatientDetails().execute();
            }
        });

        // Delete button click event
        btnDelete.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // deleting patient in background thread
                new DeletePatient().execute();
            }
        });
    }

    /**
     * Background Async Task to Get complete patient details
     * */
    class GetPatientDetails extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditPatientActivity.this);
            pDialog.setMessage("Loading patient details. Please wait...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Getting patient details in background thread
         * */
        protected String doInBackground(String... params) {

            // updating UI from Background Thread
            runOnUiThread(new Runnable() {
                public void run() {
                    // Check for success tag
                    int success;
                    try {
                        // Building Parameters
                        Log.e("What is the value of pid",pid);
                        List<NameValuePair> params = new ArrayList<NameValuePair>();
                        params.add(new BasicNameValuePair(TAG_PID, pid));

                        // getting patient details by making HTTP request
                        // Note that patient details url will use GET request
                        JSONObject json = jsonParser.makeHttpRequest(url_patient_details, "GET", params);

                        // check your log for json response
                        Log.d("Single Patient Details", json.toString());

                        // json success tag
                        success = json.getInt(TAG_SUCCESS);
                        Log.e("The success valuse is", success+"");
                        if (success == 1) {
                            // successfully received patient details
                            JSONArray patientObj = json.getJSONArray(TAG_PATIENT); // JSON Array

                            // get first patient object from JSON Array
                            JSONObject patient = patientObj.getJSONObject(0);

                            Log.e("Json object patient: ", patient.toString());

                            // patient with this pid found
                            // Edit Text
                            patientName = (EditText) findViewById(R.id.editTextName);
                            patientAge = (EditText) findViewById(R.id.editTextAge);
                            patientOccupation = (EditText) findViewById(R.id.editTextOccupation);
//                            interventionFrequency= (EditText) findViewById(R.id.editTextInterventionFrequency);
                            patientInterFrequency = (EditText) findViewById(R.id.editTextInterventionFrequency);
                            rbMale = (RadioButton) findViewById(R.id.radioBtnMale);
                            rbFemale = (RadioButton) findViewById(R.id.radioBtnFemale);

                            // display patient data in EditText
                            patientName.setText(patient.getString(TAG_NAME));
                            patientAge.setText(patient.getString(TAG_AGE));
                            patientOccupation.setText(patient.getString(TAG_OCCUPATION));
                            patientInterFrequency.setText(patient.getString(TAG_INTERFREQUENCY));

                            if (patient.getString(TAG_GENDER).equals("Male") ){
                                rbMale.setChecked(true);
                            }else if (patient.get(TAG_GENDER).equals("Female")){
                                rbFemale.setChecked(true);
                            }

                        }else{
                            // patient with pid not found
                        }
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            });

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * **/
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once got all details
            pDialog.dismiss();
        }
    }

    /**
     * Background Async Task to  Save patient Details
     * */
    class UpdatePatientDetails extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         * */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditPatientActivity.this);
            pDialog.setMessage("Saving patient ...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Saving patient
         * */
        protected String doInBackground(String... args) {

            // getting updated data from EditTexts
            String name = patientName.getText().toString();
            String age = patientAge.getText().toString();
            String occupation = patientOccupation.getText().toString();
            String interventionFrequency = patientInterFrequency.getText().toString();
            String gender = null;
            if (rbMale.isChecked()){
                gender = "Male";
            }else if (rbFemale.isChecked()){
                gender ="Female";
            }

            // Building Parameters
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new BasicNameValuePair(TAG_PID, pid));
            params.add(new BasicNameValuePair(TAG_NAME, name));
            params.add(new BasicNameValuePair(TAG_AGE, age));
            params.add(new BasicNameValuePair(TAG_GENDER, gender));
            params.add(new BasicNameValuePair(TAG_OCCUPATION, occupation));
            params.add(new BasicNameValuePair(TAG_INTERFREQUENCY, interventionFrequency));

            // sending modified data through http request
            // Notice that update patient url accepts POST method
            JSONObject json = jsonParser.makeHttpRequest(url_update_patient,
                    "POST", params);

            // check json success tag
            try {
                int success = json.getInt(TAG_SUCCESS);

                if (success == 1) {
                    // successfully updated
                    Intent i = getIntent();
                    // send result code 100 to notify about patient update
                    setResult(100, i);
                    finish();
                } else {
                    // failed to update patient
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * **/
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once patient uupdated
            pDialog.dismiss();
        }
    }

    /*****************************************************************
     * Background Async Task to Delete patient
     * */
    class DeletePatient extends AsyncTask<String, String, String> {

        /**
         * Before starting background thread Show Progress Dialog
         */
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(EditPatientActivity.this);
            pDialog.setMessage("Deleting patient...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(true);
            pDialog.show();
        }

        /**
         * Deleting patient
         */
        protected String doInBackground(String... args) {

            // Check for success tag
            int success;
            try {
                // Building Parameters
                List<NameValuePair> params = new ArrayList<NameValuePair>();
                params.add(new BasicNameValuePair("pid", pid));

                // getting patient details by making HTTP request
                JSONObject json = jsonParser.makeHttpRequest(
                        url_delete_patient, "POST", params);

                // check your log for json response
                Log.d("Delete patient", json.toString());

                // json success tag
                success = json.getInt(TAG_SUCCESS);
                if (success == 1) {
                    // patient successfully deleted
                    // notify previous activity by sending code 100
                    Intent i = getIntent();
                    // send result code 100 to notify about patient deletion
                    setResult(100, i);
                    finish();
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        /**
         * After completing background task Dismiss the progress dialog
         * *
         */
        protected void onPostExecute(String file_url) {
            // dismiss the dialog once patient deleted
            pDialog.dismiss();

        }

//        @Override
//        public boolean onCreateOptionsMenu(Menu menu) {
//            // Inflate the menu; this adds items to the action bar if it is present.
//            getMenuInflater().inflate(R.menu.edit_patient, menu);
//            return true;
//        }
//
//        @Override
//        public boolean onOptionsItemSelected(MenuItem item) {
//            // Handle action bar item clicks here. The action bar will
//            // automatically handle clicks on the Home/Up button, so long
//            // as you specify a parent activity in AndroidManifest.xml.
//            int id = item.getItemId();
//            if (id == R.id.action_settings) {
//                return true;
//            }
//            return super.onOptionsItemSelected(item);
//        }
    }
}


text:
<?php

declare(strict_types=1);

namespace Frontend\User;

use Dot\User\Factory\FormFactory;
use Dot\User\Factory\UserDbMapperFactory;
use Dot\User\Form\UserFieldset;
use Dot\User\Options\MessagesOptions;
use Frontend\User\Authentication\AuthenticationListener;
use Frontend\User\Entity\UserEntity;
use Frontend\User\Factory\UserFieldsetDelegator;
use Frontend\User\Fieldset\UserDetailsFieldset;
use Frontend\User\Form\AccountForm;
use Frontend\User\Form\RegisterForm;
use Frontend\User\Listener\UserEventsListener;
use Frontend\User\Mapper\UserDbMapper;
use Zend\ServiceManager\Factory\InvokableFactory;

/**
 * Class ConfigProvider
 * @package Frontend\User
 */
class ConfigProvider
{
    public function __invoke(): array
    {
        return [
            'dependencies' => $this->getDependencies(),

            'dot_form' => $this->getForms(),

            'dot_mapper' => $this->getMappers(),

            'templates' => $this->getTemplates(),

            'dot_authentication' => $this->getAuthentication(),

            'dot_user' => [
                'user_entity' => UserEntity::class,

                'route_default' => [
                    'route_name' => 'user',
                    'route_params' => ['action' => 'account']
                ],
                'default_roles' => ['user'],

                'event_listeners' => [
                    'user' => [
                        [
                            'type' => UserEventsListener::class,
                            'priority' => 100,
                        ]
                    ],
                    'token' => [
                        [
                            'type' => UserEventsListener::class,
                            'priority' => 100,
                        ]
                    ]
                ],

                'template_options' => [
                    'login_template' => 'user::login',
                    'register_template' => 'user::register',
                    'account_template' => 'user::account',
                    'change_password_template' => 'user::change-password',
                    'forgot_password_template' => 'user::forgot-password',
                    'reset_password_template' => 'user::reset-password',
                ],

                'messages_options' => [
                    'messages' => [
                        MessagesOptions::REGISTER_SUCCESS =>
                            'Account was successfully created. Check your e-mail for account activation'
                    ]
                ]
            ]
        ];
    }

    public function getDependencies(): array
    {
        return [

        ];
    }

    public function getTemplates(): array
    {
        return [
            'paths' => [
                'user' => [__DIR__ . '/../templates/user']
            ]
        ];
    }

    public function getForms(): array
    {
        return [
            'form_manager' => [
                'factories' => [
                    UserDetailsFieldset::class => InvokableFactory::class,
                    RegisterForm::class => FormFactory::class,
                    AccountForm::class => FormFactory::class,
                ],
                'aliases' => [
                    'UserDetailsFieldset' => UserDetailsFieldset::class,
                    //overwrites some forms from dot-user
                    'Register' => RegisterForm::class,
                    'Account' => AccountForm::class,
                ],
                'delegators' => [
                    UserFieldset::class => [
                        UserFieldsetDelegator::class,
                    ]
                ]
            ]
        ];
    }

    public function getMappers(): array
    {
        return [
            'mapper_manager' => [
                'factories' => [
                    UserDbMapper::class => UserDbMapperFactory::class,
                ],
                'aliases' => [
                    UserEntity::class => UserDbMapper::class,
                ],
            ]
        ];
    }

    public function getAuthentication(): array
    {
        return [
            'web' => [
                'login_route' => [
                    'route_name' => 'login',
                ],

                'logout_route' => [
                    'route_name' => 'logout',
                ],

                'after_logout_route' => [
                    'route_name' => 'login',
                ],

                'after_login_route' => [
                    'route_name' => 'user',
                    'route_params' => ['action' => 'account']
                ],

                'event_listeners' => [
                    [
                        'type' => AuthenticationListener::class,
                        'priority' => 100,
                    ]
                ]
            ]
        ];
    }
}


text:
var userController = (function () {
    var CONSTANTS = {
        USERNAME_LOCAL_STORAGE_KEY: 'username',
        AUTH_KEY_LOCAL_STORAGE_KEY: 'user-auth-key'
    };

    function setUserPanel() {
        var info = data.auth.userInfo();
        templates
            .get('user-panel')
            .then(function (template) {
                $('#user-panel').html(template(info));
            })
    }

    function logout(context) {
        localStorage.removeItem(CONSTANTS.USERNAME_LOCAL_STORAGE_KEY);
        localStorage.removeItem(CONSTANTS.AUTH_KEY_LOCAL_STORAGE_KEY);
        context.redirect('#/');
    }

    function register(context) {
        templates
            .get('register')
            .then(function (data) {
                $('#main-container').html(data);
                $('#register-btn').on('click', function () {
                    registerUser(context);
                });

                $(function () {
                    $("#birthdate").datepicker();
                });
            });
    }

    function registerUser(context) {
        var username = $('#username').val();
        var password = $('#password').val();
        var passConfirm = $('#pass-confirm').val();
        var firstName = $('#firstname').val();
        var lastName = $('#lastname').val();
        var dateofbirth = $('#birthdate').val();
        var isMale = $('#is-male-radio').is(':checked');

        var user = {
            email: username,
            password: password,
            confirmPassword: passConfirm,
            firstName: firstName,
            lastName: lastName,
            dateofbirth: dateofbirth,
            isMale: isMale
        }

        data.auth.register(user, context);
    }

    function login(context) {
        templates
            .get('login')
            .then(function (data) {
                $('#main-container').html(data);
                $('#login-btn').on('click', function () {
                    loginUser(context);
                })
            })
    }

    function loginUser(context) {
        var username = $('#username').val();
        var password = $('#password').val();

        data.auth.login(username, password, context);
    }

    var userController = {
        register: register,
        login: login,
        setUserPanel: setUserPanel,
        logout: logout
    };

    return userController;
})();;


text:
package uk.co.epsilontechnologies.watcher;

public interface RequestCaptor<T> {

    void populate(WatchableHttpServletRequestWrapper watchableHttpServletRequestWrapper);

    T getCapturedValue();

}


text:
import EmberObject from '@ember/object';
import ActionHandler from '@ember/object/-private/action-handler';
import Transition from '@ember/routing/-private/transition';
import Evented from '@ember/object/evented';
import { RenderOptions, RouteQueryParam } from '@ember/routing/types';
import Controller from '@ember/controller';

// tslint:disable-next-line:strict-export-declare-modifiers
type RouteModel = object | string | number;

/**
 * The `Ember.Route` class is used to define individual routes. Refer to
 * the [routing guide](http://emberjs.com/guides/routing/) for documentation.
 */
export default class Route<Model = unknown> extends EmberObject.extend(ActionHandler, Evented) {
    // methods
    /**
     * This hook is called after this route's model has resolved.
     * It follows identical async/promise semantics to `beforeModel`
     * but is provided the route's resolved model in addition to
     * the `transition`, and is therefore suited to performing
     * logic that can only take place after the model has already
     * resolved.
     */
    afterModel(resolvedModel: Model, transition: Transition): any;

    /**
     * This hook is the first of the route entry validation hooks
     * called when an attempt is made to transition into a route
     * or one of its children. It is called before `model` and
     * `afterModel`, and is appropriate for cases when:
     * 1) A decision can be made to redirect elsewhere without
     *     needing to resolve the model first.
     * 2) Any async operations need to occur first before the
     *     model is attempted to be resolved.
     * This hook is provided the current `transition` attempt
     * as a parameter, which can be used to `.abort()` the transition,
     * save it for a later `.retry()`, or retrieve values set
     * on it from a previous hook. You can also just call
     * `this.transitionTo` to another route to implicitly
     * abort the `transition`.
     * You can return a promise from this hook to pause the
     * transition until the promise resolves (or rejects). This could
     * be useful, for instance, for retrieving async code from
     * the server that is required to enter a route.
     */
    beforeModel(transition: Transition): any;

    /**
     * Returns the controller of the current route, or a parent (or any
     * ancestor) route in a route hierarchy.
     *
     * The controller instance must already have been created, either through
     * entering the associated route or using `generateController`.
     *
     * @param name the name of the route or controller
     */
    controllerFor(name: string): Controller;

    /**
     * Disconnects a view that has been rendered into an outlet.
     */
    disconnectOutlet(options: string | { outlet?: string | undefined; parentView?: string | undefined }): void;

    /**
     * A hook you can implement to convert the URL into the model for
     * this route.
     */
    model(params: {}, transition: Transition): Model | PromiseLike<Model>;

    /**
     * Returns the model of a parent (or any ancestor) route
     * in a route hierarchy.  During a transition, all routes
     * must resolve a model object, and if a route
     * needs access to a parent route's model in order to
     * resolve a model (or just reuse the model from a parent),
     * it can call `this.modelFor(theNameOfParentRoute)` to
     * retrieve it.
     */
    modelFor(name: string): any;

    /**
     * Retrieves parameters, for current route using the state.params
     * variable and getQueryParamsFor, using the supplied routeName.
     */
    paramsFor(name: string): {};

    /**
     * A hook you can implement to optionally redirect to another route.
     *
     * If you call `this.transitionTo` from inside of this hook, this route
     * will not be entered in favor of the other hook.
     *
     * `redirect` and `afterModel` behave very similarly and are
     * called almost at the same time, but they have an important
     * distinction in the case that, from one of these hooks, a
     * redirect into a child route of this route occurs: redirects
     * from `afterModel` essentially invalidate the current attempt
     * to enter this route, and will result in this route's `beforeModel`,
     * `model`, and `afterModel` hooks being fired again within
     * the new, redirecting transition. Redirects that occur within
     * the `redirect` hook, on the other hand, will _not_ cause
     * these hooks to be fired again the second time around; in
     * other words, by the time the `redirect` hook has been called,
     * both the resolved model and attempted entry into this route
     * are considered to be fully validated.
     */
    redirect(model: Model, transition: Transition): void;

    /**
     * Refresh the model on this route and any child routes, firing the
     * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion
     * to how routes are entered when transitioning in from other route.
     * The current route params (e.g. `article_id`) will be passed in
     * to the respective model hooks, and if a different model is returned,
     * `setupController` and associated route hooks will re-fire as well.
     * An example usage of this method is re-querying the server for the
     * latest information using the same parameters as when the route
     * was first entered.
     * Note that this will cause `model` hooks to fire even on routes
     * that were provided a model object when the route was initially
     * entered.
     */
    refresh(): Transition;

    /**
     * `render` is used to render a template into a region of another template
     * (indicated by an `{{outlet}}`). `render` is used both during the entry
     * phase of routing (via the `renderTemplate` hook) and later in response to
     * user interaction.
     * Not all options need to be passed to render. Default values will be used
     * based on the name of the route specified in the router or the Route's
     * controllerName and templateName properties.
     */
    render(name?: string, options?: RenderOptions): void;

    /**
     * A hook you can use to render the template for the current route.
     * This method is called with the controller for the current route and the
     * model supplied by the `model` hook. By default, it renders the route's
     * template, configured with the controller for the route.
     * This method can be overridden to set up and render additional or
     * alternative templates.
     */
    renderTemplate(controller: Controller, model: Model): void;

    /**
     * Transition into another route while replacing the current URL, if possible.
     * This will replace the current history entry instead of adding a new one.
     * Beside that, it is identical to `transitionTo` in all other respects. See
     * 'transitionTo' for additional information regarding multiple models.
     */
    replaceWith(name: string, ...args: any[]): Transition;

    /**
     * A hook you can use to reset controller values either when the model
     * changes or the route is exiting.
     */
    resetController(controller: Controller, isExiting: boolean, transition: Transition): void;

    /**
     * Sends an action to the router, which will delegate it to the currently active
     * route hierarchy per the bubbling rules explained under actions.
     */
    send(name: string, ...args: any[]): void;

    /**
     * A hook you can implement to convert the route's model into parameters
     * for the URL.
     *
     * The default `serialize` method will insert the model's `id` into the
     * route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.
     * If the route has multiple dynamic segments or does not contain '_id', `serialize`
     * will return `Ember.getProperties(model, params)`
     * This method is called when `transitionTo` is called with a context
     * in order to populate the URL.
     */
    serialize(model: Model, params: string[]): string | object;

    /**
     * A hook you can use to setup the controller for the current route.
     * This method is called with the controller for the current route and the
     * model supplied by the `model` hook.
     * By default, the `setupController` hook sets the `model` property of
     * the controller to the `model`.
     * If you implement the `setupController` hook in your Route, it will
     * prevent this default behavior. If you want to preserve that behavior
     * when implementing your `setupController` function, make sure to call
     * `_super`
     */
    setupController(controller: Controller, model: Model, transition: Transition): void;

    /**
     * Transition the application into another route. The route may
     * be either a single route or route path:
     *
     * ```javascript
     * this.transitionTo('blogPosts');
     * this.transitionTo('blogPosts.recentEntries');
     * ```
     *
     * Optionally supply a model for the route in question. The model
     * will be serialized into the URL using the `serialize` hook of
     * the route:
     *
     * ```javascript
     * this.transitionTo('blogPost', aPost);
     * ```
     *
     * If a literal is passed (such as a number or a string), it will
     * be treated as an identifier instead. In this case, the `model`
     * hook of the route will be triggered:
     *
     * ```javascript
     * this.transitionTo('blogPost', 1);
     * ```
     *
     * Multiple models will be applied last to first recursively up the
     * route tree.
     *
     * ```app/routes.js
     * // ...
     *
     * Router.map(function() {
     *   this.route('blogPost', { path:':blogPostId' }, function() {
     *     this.route('blogComment', { path: ':blogCommentId' });
     *   });
     * });
     *
     * export default Router;
     * ```
     *
     * ```javascript
     * this.transitionTo('blogComment', aPost, aComment);
     * this.transitionTo('blogComment', 1, 13);
     * ```
     *
     * It is also possible to pass a URL (a string that starts with a
     * `/`).
     *
     * ```javascript
     * this.transitionTo('/');
     * this.transitionTo('/blog/post/1/comment/13');
     * this.transitionTo('/blog/posts?sort=title');
     * ```
     *
     * An options hash with a `queryParams` property may be provided as
     * the final argument to add query parameters to the destination URL.
     *
     * ```javascript
     * this.transitionTo('blogPost', 1, {
     *   queryParams: { showComments: 'true' }
     * });
     *
     * // if you just want to transition the query parameters without changing the route
     * this.transitionTo({ queryParams: { sort: 'date' } });
     * ```
     *
     * See also [replaceWith](#method_replaceWith).
     *
     * Simple Transition Example
     *
     * ```app/routes.js
     * // ...
     *
     * Router.map(function() {
     *   this.route('index');
     *   this.route('secret');
     *   this.route('fourOhFour', { path: '*:' });
     * });
     *
     * export default Router;
     * ```
     *
     * ```app/routes/index.js
     * import Route from '@ember/routing/route';
     * import { action } from '@ember/object';
     *
     * export default class IndexRoute extends Route {
     *   @action
     *   moveToSecret(context) {
     *     if (authorized()) {
     *       this.transitionTo('secret', context);
     *     } else {
     *       this.transitionTo('fourOhFour');
     *     }
     *   }
     * }
     * ```
     *
     * Transition to a nested route
     *
     * ```app/router.js
     * // ...
     *
     * Router.map(function() {
     *   this.route('articles', { path: '/articles' }, function() {
     *     this.route('new');
     *   });
     * });
     *
     * export default Router;
     * ```
     *
     * ```app/routes/index.js
     * import Route from '@ember/routing/route';
     * import { action } from '@ember/object';
     *
     * export default class IndexRoute extends Route {
     *   @action
     *   transitionToNewArticle() {
     *     this.transitionTo('articles.new');
     *   }
     * }
     * ```
     *
     * Multiple Models Example
     *
     * ```app/router.js
     * // ...
     *
     * Router.map(function() {
     *   this.route('index');
     *
     *   this.route('breakfast', { path: ':breakfastId' }, function() {
     *     this.route('cereal', { path: ':cerealId' });
     *   });
     * });
     *
     * export default Router;
     * ```
     *
     * ```app/routes/index.js
     * import Route from '@ember/routing/route';
     * import { action } from '@ember/object';
     *
     * export default class IndexRoute extends Route {
     *   @action
     *   moveToChocolateCereal() {
     *     let cereal = { cerealId: 'ChocolateYumminess' };
     *     let breakfast = { breakfastId: 'CerealAndMilk' };
     *
     *     this.transitionTo('breakfast.cereal', breakfast, cereal);
     *   }
     * }
     * ```
     *
     * Nested Route with Query String Example
     *
     * ```app/routes.js
     * // ...
     *
     * Router.map(function() {
     *   this.route('fruits', function() {
     *     this.route('apples');
     *   });
     * });
     *
     * export default Router;
     * ```
     *
     * ```app/routes/index.js
     * import Route from '@ember/routing/route';
     *
     * export default class IndexRoute extends Route {
     *   @action
     *   transitionToApples() {
     *     this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });
     *   }
     * }
     * ```
     *
     * @param name    the name of the route or a URL.
     * @param models  the model(s) or identifier(s) to be used while
     *                transitioning to the route.
     * @param options optional hash with a queryParams property
     *                containing a mapping of query parameters. May be supplied
     *                as the only parameter to trigger a query-parameter-only
     *                transition.
     * @returns       the Transition object associated with this attempted
     *                transition
     */
    transitionTo(name: string, options?: { queryParams: object }): Transition;
    transitionTo(name: string, modelsA: RouteModel, options?: { queryParams: object }): Transition;
    transitionTo(name: string, modelsA: RouteModel, modelsB: RouteModel, options?: { queryParams: object }): Transition;
    transitionTo(
        name: string,
        modelsA: RouteModel,
        modelsB: RouteModel,
        modelsC: RouteModel,
        options?: { queryParams: object },
    ): Transition;
    transitionTo(
        name: string,
        modelsA: RouteModel,
        modelsB: RouteModel,
        modelsC: RouteModel,
        modelsD: RouteModel,
        options?: { queryParams: object },
    ): Transition;
    transitionTo(options: { queryParams: object }): Transition;

    // https://emberjs.com/api/ember/3.2/classes/Route/methods/intermediateTransitionTo?anchor=intermediateTransitionTo
    /**
     * Perform a synchronous transition into another route without attempting to resolve promises,
     * update the URL, or abort any currently active asynchronous transitions
     * (i.e. regular transitions caused by transitionTo or URL changes).
     *
     * @param name           the name of the route or a URL
     * @param object         the model(s) or identifier(s) to be used while
     *                       transitioning to the route.
     * @returns              the Transition object associated with this attempted transition
     */
    intermediateTransitionTo(name: string, ...object: any[]): Transition;

    // properties
    /**
     * The controller associated with this route.
     */
    controller: Controller;

    /**
     * The name of the controller to associate with this route.
     * By default, Ember will lookup a route's controller that matches the name
     * of the route (i.e. `App.PostController` for `App.PostRoute`). However,
     * if you would like to define a specific controller to use, you can do so
     * using this property.
     * This is useful in many ways, as the controller specified will be:
     * * p assed to the `setupController` method.
     * * used as the controller for the view being rendered by the route.
     * * returned from a call to `controllerFor` for the route.
     */
    controllerName: string;

    /**
     * The name of the route, dot-delimited, including the engine prefix if applicable.
     */
    fullRouteName: string;

    /**
     * Configuration hash for this route's queryParams.
     */
    queryParams: { [key: string]: RouteQueryParam };

    /**
     * The name of the route, dot-delimited
     */
    routeName: string;

    /**
     * The name of the template to use by default when rendering this routes
     * template.
     * This is similar with `viewName`, but is useful when you just want a custom
     * template without a view.
     */
    templateName: string;

    // events
    /**
     * This hook is executed when the router enters the route. It is not executed
     * when the model for the route changes.
     */
    activate(): void;

    /**
     * This hook is executed when the router completely exits this route. It is
     * not executed when the model for the route changes.
     */
    deactivate(): void;

    /**
     * The didTransition action is fired after a transition has successfully been
     * completed. This occurs after the normal model hooks (beforeModel, model,
     * afterModel, setupController) have resolved. The didTransition action has
     * no arguments, however, it can be useful for tracking page views or resetting
     * state on the controller.
     */
    didTransition(): void;

    /**
     * When attempting to transition into a route, any of the hooks may return a promise
     * that rejects, at which point an error action will be fired on the partially-entered
     * routes, allowing for per-route error handling logic, or shared error handling logic
     * defined on a parent route.
     */
    error(error: any, transition: Transition): void;

    /**
     * The loading action is fired on the route when a route's model hook returns a
     * promise that is not already resolved. The current Transition object is the first
     * parameter and the route that triggered the loading event is the second parameter.
     */
    loading(transition: Transition, route: Route): void;

    /**
     * The willTransition action is fired at the beginning of any attempted transition
     * with a Transition object as the sole argument. This action can be used for aborting,
     * redirecting, or decorating the transition from the currently active routes.
     */
    willTransition(transition: Transition): void;

    /**
     * Allows you to produce custom metadata for the route.
     * The return value of this method will be attached to
     * its corresponding RouteInfoWithAttributes object.
     * Example
     * ```app/routes/posts/index.js
     * import Route from '@ember/routing/route';
     * export default class PostsIndexRoute extends Route {
     *   buildRouteInfoMetadata() {
     *     return { title: 'Posts Page' }
     *   }
     * }
     * ```
     * ```app/routes/application.js
     * import Route from '@ember/routing/route';
     * import { inject as service } from '@ember/service';
     * export default class ApplicationRoute extends Route {
     *   @service router
     *   constructor() {
     *     super(...arguments);
     *     this.router.on('routeDidChange', transition => {
     *       document.title = transition.to.metadata.title;
     *       // would update document's title to "Posts Page"
     *     });
     *   }
     * }
     * ```
     */
    buildRouteInfoMetadata(): unknown;
}


text:
Contributor: Gunnar Atli Sigurdsson

**New:** extension of this framework to the deep CRF model on Charades for *Asynchronous Temporal Fields for Action Recognition*: https://github.com/gsig/temporal-fields

* **New:** This code implements a Two-Stream network in PyTorch
* This code implements a Two-Stream network in Torch
* This code implements a Two-Stream+LSTM network in Torch

See [pytorch/](pytorch/), [torch/](torch/), for the code repositories.

The code replicates the 'Two-Stream Extended' and 'Two-Stream+LSTM' baselines found in:
```
@inproceedings{sigurdsson2017asynchronous,
author = {Gunnar A. Sigurdsson and Santosh Divvala and Ali Farhadi and Abhinav Gupta},
title = {Asynchronous Temporal Fields for Action Recognition},
booktitle={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2017},
pdf = {http://arxiv.org/pdf/1612.06371.pdf},
code = {https://github.com/gsig/temporal-fields},
}
```
which is in turn based off "Two-stream convolutional networks for action recognition in videos" by Simonyan and Zisserman, and "Beyond Short Snippets: Deep Networks for Video Classification" by Joe Yue-Hei Ng el al.

Combining the predictions (submission files) of those models using combine_rgb_flow.py
yields a final classification accuracy of 18.9% mAP (Two-Stream) and 19.8% (LSTM) on Charades (evalated with charades_v1_classify.m)

## Technical Overview:

The code is organized such that to train a two-stream network. Two independed network are trained: One RGB network and one Flow network.
This code parses the training data into pairs of an image (or flow), and a label for a single activity class. This forms a softmax training setup like a standard CNN. The network is a VGG-16 network. For RGB it is pretrained on Image-Net, and for Flow it is pretrained on UCF101. The pretrained networks can be downloaded with the scripts in this directory.
For testing. The network uses a batch size of 25, scores all images, and pools the output to make a classfication prediction or uses all 25 outputs for localization.


text:
static void *YHModelCachedPropertyKeysKey = &YHModelCachedPropertyKeysKey;

@interface YAHActiveObject () <
YAHJSONSerializing>

@end

@implementation YAHActiveObject

#pragma mark - NSCoding

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super init];
    if (self) {
        NSArray *propertyNames = [[self class] p_propertyKeys].allObjects;
        for (NSString *propertyName in propertyNames) {
            [self setValue:[coder decodeObjectForKey:propertyName] forKey:propertyName];
        }
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {

    NSArray *propertyNames = [[self class] p_propertyKeys].allObjects;
    for (NSString *propertyName in propertyNames) {
        id propertyValue = [self valueForKey:propertyName];
        [aCoder encodeObject:propertyValue forKey:propertyName];
    }
}

#pragma mark - NSCoping

- (id)copyWithZone:(NSZone *)zone {

    YAHActiveObject *result = [[[self class] allocWithZone:zone] init];

    NSArray *propertyNames = [[self class] p_propertyKeys].allObjects;
    for (NSString *propertyName in propertyNames) {
        id propertyValue = [self valueForKey:propertyName];
        if ([propertyValue respondsToSelector:@selector(copyWithZone:)]) {
            propertyValue = [propertyValue copyWithZone:zone];
        }
        [result setValue:propertyValue forKey:propertyName];
    }
    return result;
}

#pragma mark - Public

+ (NSDictionary *)bridgePropertyAndJSON {

    return nil;
}

+ (NSDictionary *)bridgeClassAndArray {

    return nil;
}

#pragma mark - YHJSONSerializing

+ (NSDictionary *)JSONKeyPathsByPropertyKey {

    NSArray *propertyKeys = [[self class] p_propertyKeys].allObjects;
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithObjects:propertyKeys forKeys:propertyKeys];
    NSDictionary *changeJSONKey = [self bridgePropertyAndJSON];
    if (changeJSONKey) {
        [dic setValuesForKeysWithDictionary:changeJSONKey];
    }
    return dic;
}

+ (NSDictionary *)convertClassStringDictionary {

    return [self bridgeClassAndArray];
}

#pragma mark - Private

+ (NSSet *)p_propertyKeys {

    NSSet *cachedKeys = objc_getAssociatedObject(self, YHModelCachedPropertyKeysKey);
    if (cachedKeys != nil) return cachedKeys;

    NSMutableSet *keys = [NSMutableSet set];
    unsigned int propertyCount = 0;
    objc_property_t *propertyList = class_copyPropertyList([self class], &propertyCount);
    for (int i=0; i<propertyCount; i++) {
        objc_property_t *property = propertyList + i;
        NSString *propertyName = [NSString stringWithCString:property_getName(*property) encoding:NSUTF8StringEncoding];
        [keys addObject:propertyName];
    }
    free(propertyList);
    objc_setAssociatedObject(self, YHModelCachedPropertyKeysKey, keys, OBJC_ASSOCIATION_COPY);

    return keys;
}

- (NSString *)description {

    return [NSString stringWithFormat:@"<%@: %p> %@", self.class, self, [YAHJSONAdapter jsonStringFromObject:self]];
}

@end


text:
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

	<context:component-scan base-package="com.in28minutes" />

	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix">
			<value>/WEB-INF/views/</value>
		</property>
		<property name="suffix">
			<value>.jsp</value>
		</property>
	</bean>

	<mvc:resources mapping="/webjars/**" location="/webjars/"/>

    <bean id="messageSource"
        class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="classpath:messages" />
        <property name="defaultEncoding" value="UTF-8" />
    </bean>

    <bean id="localeResolver"
        class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
        <property name="defaultLocale" value="en" />
    </bean>

    <mvc:interceptors>
        <bean id="localeChangeInterceptor"
            class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
            <property name="paramName" value="language" />
        </bean>
    </mvc:interceptors>

	<mvc:annotation-driven />

</beans>


text:
if [[ $# -gt 0 ]] && [[ $1 == '--help' ]]; then
    echo "
    Terminating Batch Server
    ------------------------

    As a user, send term signal to a geopmsession process owned by the
    test user, and make sure that server (owned by root) shuts down
    cleanly.

"
    exit 0
fi

test_error() {
    echo "Error: $1" 1>&2
    exit -1
}

TEST_DIR=$(dirname $(readlink -f $0))
TEST_USER=test

set -x

TEST_SCRIPT="${TEST_DIR}/test_su_term_batch_helper.sh"
if [[ $(whoami) == 'root' ]]; then
    export SESSION_PID=$(sudo -E -u ${TEST_USER} ${TEST_SCRIPT})
else
    export SESSION_PID=$(${TEST_SCRIPT})
fi

sleep 5
BATCH_PID=$(sudo geopmaccess -s ${SESSION_PID} | \
            python3 -c 'import sys,json; print(json.loads(sys.stdin.read())["batch_server"])')
kill -7 $SESSION_PID # Ok to send as test user
sleep 5
if ps --pid $BATCH_PID >& /dev/null; then
    kill -9 $BATCH_PID
    test_error "Batch server persists after client is terminated"
fi

echo "SUCCESS"
exit 0


text:
import React, { Component, PropTypes } from 'react'
import classNames from 'classnames'
import Icon from '../Icon/Icon'

export default class TabbarItem extends Component {

  static propTypes = {
    iconName: PropTypes.string,
    icon: PropTypes.node,
    label: PropTypes.string,
    active: PropTypes.bool,
    className: PropTypes.string
  };

  render () {
    const { iconName, icon, label, active, className, ...props } = this.props
    const classes = classNames({
      'tab-link': true,
      'active': active
    }, className)
    return (

        {iconName &&
          <Icon name={iconName} />
        }
        {icon}
        {label &&
          {label}
        }

    )
  }
}


text:
import { TREE_ACTIONS, IActionMapping, IActionHandler } from './models/tree-options.model';
import { ITreeOptions, IAllowDropFn, IAllowDragFn, ITreeState } from './defs/api';
import { KEYS } from './constants/keys';
import { TreeModel } from './models/tree.model';
import { TreeNode } from './models/tree-node.model';
import { TreeDraggedElement } from './models/tree-dragged-element.model';
import { TreeVirtualScroll } from './models/tree-virtual-scroll.model';
import { LoadingComponent } from './components/loading.component';
import { TreeComponent } from './components/tree.component';
import { TreeNodeComponent } from './components/tree-node.component';
import { TreeNodeContent } from './components/tree-node-content.component';
import { TreeNodeDropSlot } from './components/tree-node-drop-slot.component';
import { TreeNodeExpanderComponent } from './components/tree-node-expander.component';
import { TreeNodeChildrenComponent } from './components/tree-node-children.component';
import { TreeNodeCollectionComponent } from './components/tree-node-collection.component';
import { TreeViewportComponent } from './components/tree-viewport.component';
import { TreeDropDirective } from './directives/tree-drop.directive';
import { TreeDragDirective } from './directives/tree-drag.directive';
import './polyfills';
export { TreeModel, TreeNode, TreeDraggedElement, TreeVirtualScroll, ITreeOptions, TREE_ACTIONS, KEYS, IActionMapping, IActionHandler, IAllowDropFn, IAllowDragFn, LoadingComponent, TreeComponent, TreeNodeComponent, TreeNodeContent, TreeDropDirective, TreeDragDirective, TreeNodeExpanderComponent, TreeNodeChildrenComponent, TreeNodeDropSlot, TreeNodeCollectionComponent, TreeViewportComponent, ITreeState };
export declare class TreeModule {
}
export default TreeModule;


text:
#pragma once

#include "Uniform.h"

namespace q
{
namespace video
{

	class Auto_Uniform_Def
	{
	public:
        Auto_Uniform_Def() = default;
		Auto_Uniform_Def(data:Path const& link, size_t file_start_offset = 0, size_t file_end_offset = 0);

		Path const&		get_link() const;
		size_t			get_file_start_offset() const;
		size_t			get_file_end_offset() const;

		typedef boost::function1<Uniform const&, void*> Getter;

		void			set_getter(Getter func);
		Uniform const&	get_value(void* data) const;

		void			set_enabled(bool yes);
		bool			is_enabled() const;

	private:
		Path			m_link;
        size_t			m_file_start_offset = 0;
        size_t			m_file_end_offset = 0;
		Getter			m_getter;
        bool			m_is_enabled = false;
	};

	inline Auto_Uniform_Def::Auto_Uniform_Def(data:Path const& link, size_t file_start_offset /* = 0 */, size_t file_end_offset /* = 0 */)
		: m_link(link)
		, m_file_start_offset(fileStartOffset)
		, m_file_end_offset(fileEndOffset)
		, m_is_enabled(false)
	{
		QASSERT(m_file_end_offset >= m_file_start_offset);
	}
	inline Path const& Auto_Uniform_Def::get_link() const
	{
		return m_link;
	}
	inline size_t Auto_Uniform_Def::get_file_start_offset() const
	{
		return m_file_start_offset;
	}
	inline size_t Auto_Uniform_Def::get_file_end_offset() const
	{
		return m_file_end_offset;
	}
	inline void Auto_Uniform_Def::set_getter(Getter func)
	{
		m_getter = func;
	}
	inline Uniform const& Auto_Uniform_Def::get_value(void* data) const
	{
		return m_getter ? m_getter(data) : m_default;
	}
	inline void Auto_Uniform_Def::set_enabled(bool yes)
	{
		m_is_enabled = yes;
	}
	inline bool Auto_Uniform_Def::is_enabled() const
	{
		return m_is_enabled;
	}

}
}


text:
layout: category_page
title: Knowledge Base - News and Announcements
categories:
  - news
  - news_industry
parents:
  - kb
  - news
---


text:
class Perftest
  include Rhom::PropertyBag

end


text:
package com.github.kmbulebu.nicknack.providers.dsc.events;

import java.util.UUID;

import com.github.kmbulebu.nicknack.core.events.impl.BasicTimestampedEventDefinition;
import com.github.kmbulebu.nicknack.providers.dsc.attributes.PartitionLabelAttributeDefinition;
import com.github.kmbulebu.nicknack.providers.dsc.attributes.PartitionNumberAttributeDefinition;

public class EntryDelayInProgressEventDefinition extends BasicTimestampedEventDefinition {

	public static final EntryDelayInProgressEventDefinition INSTANCE = new EntryDelayInProgressEventDefinition();

	private EntryDelayInProgressEventDefinition() {
		super(UUID.fromString("79341832-d336-49b0-a208-742a23236426"),
				"Entry Delay in Progress",
				PartitionLabelAttributeDefinition.INSTANCE,
				PartitionNumberAttributeDefinition.INSTANCE);
	}

}


text: convert -size 128x128 xc:none +antialias -fill white  -draw "circle 64,64 64,8" drawn_jaggies.png


text:
<?xml version="1.0" ?>
<tei xml:space="preserve">
	<teiHeader>
		<fileDesc xml:id="submission_161"/>
	</teiHeader>
	<text xml:lang="en">
		<front>
<lb/>
	<docTitle>
	<titlePart>MAGNETO-PHOTOLUMINESCENCE AS A PROBE OF PHASES IN<lb/> QUANTUM HALL MULTI-LAYERS<lb/></titlePart>
	</docTitle>

	<byline>
	<docAuthor>Yu.A.Pusep 1* , L.Fernandes dos Santos 1 , D.Smirnov 2 , A.K.Bakarov 3 , and A.I.Toropov 3<lb/> </docAuthor>
	</byline>

	<byline>
	<affiliation>1 Instituto de Fisica de São Carlos, Universidade de São Paulo,</affiliation>
	</byline>

	<address>13560-970 São Carlos, SP, Brazil<lb/></address>

	<byline>
	<affiliation>2 National High Magnetic Field Laboratory,</affiliation>
	</byline>

	<address>Tallahassee, FL 32312, USA<lb/></address>

	<byline>
	<affiliation>3 Institute of Semiconductor Physics,</affiliation>
	</byline>

	<address>Novosibirsk 630090, Russia</address>

		</front>
	</text>
</tei>


text:
typedef struct i3ipc_msg i3ipc_msg;
typedef struct i3Workspace i3Workspace;

int i3ipc_sock_connect(const char *sockpath);
void i3ipc_sock_disconnect(void);

i3Workspace *get_workspaces(void);
void destroy_workspaces(i3Workspace *root);
const char *workspace_name(const i3Workspace *workspace);


text:
package jade.content.abs;

import jade.util.leap.Serializable;

/**
 * The common ancestor of all abstract descriptors
 * @author Federico Bergenti - Universita` di Parma
 * @author Giovanni Caire - TILAB
 */
public interface AbsObject extends Serializable {
	public static final int UNKNOWN = -1;
	public static final int ABS_PREDICATE = 1;
	public static final int ABS_CONCEPT = 2;
	public static final int ABS_AGENT_ACTION = 3;
	public static final int ABS_PRIMITIVE = 4;
	public static final int ABS_AGGREGATE = 5;
	public static final int ABS_IRE = 6;
	public static final int ABS_VARIABLE = 7;
	public static final int ABS_CONTENT_ELEMENT_LIST = 8;
	public static final int ABS_CONCEPT_SLOT_FUNCTION = 9;

    /**
     * @return The name of the type of the object held by this
     * abstract descriptor.
     */
    public String getTypeName();

    /**
     * Gets the value of an attribute of the object held by this
     * abstract descriptor.
     * @param name The name of the attribute.
     * @return value The value of the attribute.
     */
    public AbsObject getAbsObject(String name);

    /**
     * @return the name of all attributes.
     */
    public String[] getNames();

    /**
     * Tests if the object is grounded, i.e., if no one of its attributes
     * is associated with a variable
     * @return true if the object is grounded.
     */
    public boolean isGrounded();

    /**
     * Gets the number of attributes.
     * @return the number of attributes.
     */
    public int getCount();

    public int getAbsType();
}


text:
package org.springframework.session.mongodb.examples;

import java.util.Set;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.By;
import org.openqa.selenium.Cookie;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.session.mongodb.examples.pages.HomePage;
import org.springframework.session.mongodb.examples.pages.LoginPage;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder;

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

/**
 * @author Pool Dolorier
 */
@ExtendWith(SpringExtension.class)
@AutoConfigureMockMvc
@SpringBootTest(webEnvironment = WebEnvironment.MOCK)
@ContextConfiguration(initializers = SpringSessionMongoTraditionalBoot.Initializer.class)
public class BootTests {

	@Autowired
	private MockMvc mockMvc;

	private WebDriver driver;

	@BeforeEach
	void setUp() {
		this.driver = MockMvcHtmlUnitDriverBuilder.mockMvcSetup(this.mockMvc).build();
	}

	@AfterEach
	void tearDown() {
		this.driver.quit();
	}

	@Test
	void unauthenticatedUserSentToLogInPage() {

		HomePage homePage = HomePage.go(this.driver);
		LoginPage loginPage = homePage.unauthenticated();
		loginPage.assertAt();
	}

	@Test
	void logInViewsHomePage() {

		LoginPage loginPage = LoginPage.go(this.driver);
		loginPage.assertAt();

		HomePage homePage = loginPage.login("user", "password");
		homePage.assertAt();

		WebElement username = homePage.getDriver().findElement(By.id("un"));
		assertThat(username.getText()).isEqualTo("user");
		Set<Cookie> cookies = homePage.getDriver().manage().getCookies();
		assertThat(cookies).extracting("name").contains("SESSION");
		assertThat(cookies).extracting("name").doesNotContain("JSESSIONID");
	}

	@Test
	void logoutSuccess() {

		LoginPage loginPage = LoginPage.go(this.driver);
		HomePage homePage = loginPage.login("user", "password");
		LoginPage successLogoutPage = homePage.logout();

		successLogoutPage.assertAt();
	}

	@Test
	void loggedOutUserSentToLoginPage() {

		LoginPage loginPage = LoginPage.go(this.driver);
		HomePage homePage = loginPage.login("user", "password");
		homePage.logout();

		HomePage backHomePage = HomePage.go(this.driver);
		LoginPage backLoginPage = backHomePage.unauthenticated();

		backLoginPage.assertAt();
	}

}


text:
<title>Berkeley DB: DbMpoolFile::close</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">

DbMpoolFile::close

<tt>

#include <db_cxx.h>

int
DbMpoolFile::close(u_int32_t flags);

Description: DbMpoolFile::close

The DbMpoolFile::close method closes the source file indicated by the
DbMpoolFile object.  Calling DbMpoolFile::close does not imply a call
to DbMpoolFile::sync; that is, no pages are written to the source file
as as a result of calling DbMpoolFile::close.

If the DbMpoolFile was temporary, any underlying files created
for this DbMpoolFile will be removed.

After DbMpoolFile::close has been called, regardless of its return, the
DbMpoolFile handle may not be accessed again.

The DbMpoolFile::close method
either returns a non-zero error value
or throws an exception that encapsulates a non-zero error value on
failure, and returns 0 on success.

Parameters

 flags

The flags parameter is currently unused, and must be set to 0.

Class
DbEnv, DbMpoolFile

See Also
Memory Pools and Related Methods
</tt>

Copyright (c) 1996,2008 Oracle.  All rights reserved.


text:
<?php

namespace GuilleGF\Lifx\Domain\Selector;

/**
 * Class SelectorCollection
 * @package GuilleGF\Lifx\Domain\Selector
 */
class SelectorCollection
{
    /** @var Selector[] */
    private $selectors = array();

    /**
     * SelectorCollection constructor.
     * @param Selector[] $selectors
     */
    public function __construct(array $selectors)
    {
        foreach ($selectors as $selector) {
            $this->add($selector);
        }
    }

    /**
     * @param Selector $selector
     */
    public function add(Selector $selector)
    {
        $this->selectors[] = $selector;
    }

    /**
     * @return Selector[]
     */
    public function selectors()
    {
        return $this->selectors;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->toString();
    }

    /**
     * @return string
     */
    public function toString()
    {
        $string = '';
        foreach ($this->selectors as $selector) {
            $string .= (string)$selector.' ';
        }

        return trim($string);
    }
}


text:
let Action = require('./Action'),
    calc = require('../inc/calc'),
    utils = require('../inc/utils'),
    simulations = require('./simulate/simulations');

const DEFAULT_PROP = 'velocity';

class Simulate extends Action {
    constructor(...args) {
        super(...args);
        this.calculatesVelocity = true;
        this.inactiveFrames = 0;
    }

    getDefaultProps() {
        return {
            maxInactiveFrames: 3
        };
    }

    getDefaultValue() {
        return {
            // [string]: Simulation to .run
            simulate: DEFAULT_PROP,

            // [number]: Deceleration to apply to value, in units per second
            deceleration: 0,

            // [number]: Acceleration to apply to value, in units per second
            acceleration: 0,

            // [number]: Factor to multiply velocity by on bounce
            bounce: 0,

            // [number]: Spring strength during 'string'
            spring: 80,

            // [number]: Timeconstant of glide
            timeConstant: 395,

            // [number]: Stop simulation under this speed
            stopSpeed: 5,

            // [boolean]: Capture with spring physics on limit breach
            capture: false,

            // [number]: Friction to apply per frame
            friction: 0,

            to: 0,
            round: false
        };
    }

    getDefaultValueProp() {
        return DEFAULT_PROP;
    }

    onStart() {
        this.started = utils.currentTime();
    }

    /*
        Simulate the Value's per-frame movement

        @param [Actor]
        @param [Value]: Current value
        @param [string]: Key of current value
        @param [number]: Duration of frame in ms
        @return [number]: Calculated value
    */
    process(actor, value, key, timeSinceLastFrame) {
        var simulate = value.simulate,
            simulation = utils.isString(simulate) ? simulations[simulate] : simulate,
            newVelocity = simulation ? simulation(value, timeSinceLastFrame, this.started) : 0;

        value.velocity = (Math.abs(newVelocity) >= value.stopSpeed) ? newVelocity : 0;
        return value.current + calc.speedPerFrame(value.velocity, timeSinceLastFrame);
    }

    /*
        Has this action ended?

        Use a framecounter to see if Action has changed in the last x frames
        and declare ended if not

        @param [Actor]
        @param [boolean]: Has Action changed?
        @return [boolean]: Has Action ended?
    */
    hasEnded(actor, hasChanged) {
        this.inactiveFrames = hasChanged ? 0 : this.inactiveFrames + 1;
        return (this.inactiveFrames > actor.maxInactiveFrames);
    }

    /*
        Limit output to value range, if any

        If velocity is at or more than range, and value has a bounce property,
        run the bounce simulation

        @param [number]: Calculated output
        @param [Value]: Current Value
        @return [number]: Limit-adjusted output
    */
    limit(output, value) {
        var isOutsideMax = (output >= value.max),
            isOutsideMin = (output <= value.min),
            isOutsideRange = isOutsideMax || isOutsideMin;

        if (isOutsideRange) {
            output = calc.restricted(output, value.min, value.max);

            if (value.bounce) {
                value.velocity = simulations.bounce(value);
            } else if (value.capture) {
                simulations.capture(value, isOutsideMax ? value.max : value.min);
            }
        }

        return output;
    }
}

module.exports = Simulate;