text:
package de.fraunhofer.fokus.movepla.portlets;

import java.util.Date;

import javax.portlet.ActionRequest;

import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil;

import de.fraunhofer.fokus.movepla.Constants;
import de.fraunhofer.fokus.movepla.model.Application;
import de.fraunhofer.fokus.movepla.model.Application_Entitlement;
import de.fraunhofer.fokus.movepla.model.Category;
import de.fraunhofer.fokus.movepla.model.Entitlement;
import de.fraunhofer.fokus.movepla.model.Language;
import de.fraunhofer.fokus.movepla.model.LegalDetails;
import de.fraunhofer.fokus.movepla.model.Link;
import de.fraunhofer.fokus.movepla.model.MultiMedia;
import de.fraunhofer.fokus.movepla.model.Region;
import de.fraunhofer.fokus.movepla.model.impl.ApplicationImpl;
import de.fraunhofer.fokus.movepla.model.impl.Application_EntitlementImpl;
import de.fraunhofer.fokus.movepla.model.impl.CategoryImpl;
import de.fraunhofer.fokus.movepla.model.impl.EntitlementImpl;
import de.fraunhofer.fokus.movepla.model.impl.LanguageImpl;
import de.fraunhofer.fokus.movepla.model.impl.LegalDetailsImpl;
import de.fraunhofer.fokus.movepla.model.impl.LinkImpl;
import de.fraunhofer.fokus.movepla.model.impl.MultiMediaImpl;
import de.fraunhofer.fokus.movepla.model.impl.RegionImpl;

public class ActionUtil {

	private static Log _log = LogFactoryUtil.getLog(ActionUtil.class);

    /**
     * Creates a Application_Entitlement object out of fields from the request.
     *
     * @param request
     * @return application_Entitlement
     */
    public static Application_Entitlement application_EntitlementFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Application_Entitlement model = new Application_EntitlementImpl();

        _log.debug("themeDisplay.getCompanyId(): " + themeDisplay.getCompanyId());

        model.setApplicationEntitlementID(ParamUtil.getLong(request, "ApplicationEntitlementId"));
        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setApplicationId(ParamUtil.getLong(request, "applicationId"));
        model.setEntitlementId(ParamUtil.getLong(request, "entitlementId"));
        model.setName(ParamUtil.getString(request, "name").trim());
        model.setMotivation(ParamUtil.getString(request, "motivation").trim());

        return model;
    }

    /**
     * Creates a Application object out of fields from the request.
     *
     * @param request
     * @return application
     */
    public static Application applicationFromRequest(UploadPortletRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Application model = new ApplicationImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());
        _log.debug("themeDisplay.getUserId(): " + themeDisplay.getUserId());

        model.setApplicationId(ParamUtil.getLong(request, "applicationId"));
        if (ParamUtil.getString(request, "descriptionEditor").trim().length() > 2998 ) {
            model.setDescription(ParamUtil.getString(request, "descriptionEditor").trim().substring(0, 2998));

        } else {
            model.setDescription(ParamUtil.getString(request, "descriptionEditor").trim());
        }
        model.setFee(ParamUtil.getInteger(request, "fee"));

        _log.debug("targetCategory: " + ParamUtil.getString(request, "targetCategory").trim());
        String[] targetCategoryArray = ParamUtil.getParameterValues(request, "targetCategory");
        String targetCategoryValue ="";
        _log.debug("targetCategoryArray.lengths: " + targetCategoryArray.length);
        for (int i=0; i<targetCategoryArray.length; i++ ) {
        	targetCategoryValue += " " +  targetCategoryArray[i];
        }

        _log.debug("platform: " + ParamUtil.getString(request, "platform"));
        String[] platformArray = ParamUtil.getParameterValues(request, "platform");
        String platformValue ="";
        _log.debug("platformArray.lengths: " + platformArray.length);
        for (int i=0; i<platformArray.length; i++ ) {
        	platformValue=platformValue + " " +  platformArray[i];
        }
/*
        if (targetCategoryValue.contains("IOS")) {
        	platformValue += " IOS";
        }

        if (targetCategoryValue.contains("iPad") || targetCategoryValue.contains("iPhone")) {
        	platformValue += " Apple";
        }

        if (targetCategoryValue.contains("Android")) {
        	platformValue += " Android";
        }

        if (targetCategoryValue.contains("Windows")) {
        	platformValue += " Windows";
        }

        if (targetCategoryValue.contains("Webapp")) {
        	platformValue += " Webapp";
        }
*/
        _log.debug("targetCategoryValue: " + targetCategoryValue);
        _log.debug("platformValue: " + platformValue);

        model.setTargetCategory(targetCategoryValue.trim());
        model.setTargetOS(platformValue.trim());

//        model.setMinTargetOSVersion(ParamUtil.getInteger(request, "minTargetOSVersion"));
        model.setName(ParamUtil.getString(request, "name").trim());
        model.setSize(ParamUtil.getInteger(request, "size"));
//        model.setVersion(ParamUtil.getString(request, "version"));
//        model.setVersionInformation(ParamUtil.getString(request, "versionInformation"));
        model.setDeveloper(ParamUtil.getString(request, "developer").trim());
        model.setLegalDetails(ParamUtil.getString(request, "legalDetails").trim());

        int firstPublishingDateMonth = ParamUtil.getInteger(request, "firstPublishingDateMonth");
        int firstPublishingDateDay = ParamUtil.getInteger(request, "firstPublishingDateDay");
        int firstPublishingDateYear = ParamUtil.getInteger(request, "firstPublishingDateYear");

        try {
        	model.setFirstPublishingDate(PortalUtil.getDate(firstPublishingDateMonth, firstPublishingDateDay, firstPublishingDateYear, new PortalException()));
        } catch (PortalException ex) {
        	model.setFirstPublishingDate(new Date());
        }

        int lastModifiedDateMonth = ParamUtil.getInteger(request, "lastModifiedDateMonth");
        int lastModifiedDateDay = ParamUtil.getInteger(request, "lastModifiedDateDay");
        int lastModifiedDateYear = ParamUtil.getInteger(request, "lastModifiedDateYear");

        try {
        	model.setLastModifiedDate(PortalUtil.getDate(lastModifiedDateMonth, lastModifiedDateDay, lastModifiedDateYear, new PortalException()));
        } catch (PortalException ex) {
        	model.setLastModifiedDate(new Date());
        }
//        model.setFirstPublishingDate(ParamUtil.getDate(request, "firstPublishingDate", DateFormat.getDateInstance()));
//        model.setLastModifiedDate(ParamUtil.getDate(request, "lastModifiedDate", DateFormat.getDateInstance()));

        model.setLifeCycleStatus(ParamUtil.getInteger(request, "status"));
        model.setRelatedApplicationId(ParamUtil.getString(request, "relatedApplicationId").trim());

        boolean use_od = ParamUtil.getBoolean(request, "cb_od");
        if (use_od) {
        	model.setUseOpenData(Constants.USE_OPEN_DATA);
        	model.setLicense(AppConstants.getLicense(ParamUtil.getString(request, "lizenz")).getID());
        	model.setSector(ParamUtil.getString(request, "sektor"));
        } else {
        	model.setUseOpenData(0);
        	model.setLicense("");
        	model.setSector("");
        }

        return model;
    }

    /**
     * Creates a Category object out of fields from the request.
     *
     * @param request
     * @return category
     */
    public static Category categoryFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Category model = new CategoryImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());
/*
        _log.debug("ActionUtil:categoryFromRequest:parentCategoryId: " + ParamUtil.getLong(request, "parentCategoryId"));
        _log.debug("ActionUtil:categoryFromRequest:categoryName: " + ParamUtil.getString(request, "categoryName"));
        _log.debug("ActionUtil:categoryFromRequest:request.getParameter: " +  request.getParameter("categoryName"));
        Enumeration<String>  parameterNames = request.getParameterNames();
        while (parameterNames.hasMoreElements()) {
        	String parameterName = parameterNames.nextElement();
            _log.debug("ActionUtil:categoryFromRequest:parameterName: " +  parameterName);
            String[]  parameterValues = request.getParameterValues(parameterName);
                    for (int i=0; i<parameterValues.length; i++) {
                    	String parameterValue = parameterValues[i];
                        _log.debug("ActionUtil:categoryFromRequest:parameterValue: " +  parameterValue);
                    }
        }
*/
        model.setCategoryId(ParamUtil.getLong(request, "categoryId"));
        model.setParentCategory(ParamUtil.getLong(request, "parentCategoryId"));
        model.setCategoryName(ParamUtil.getString(request, "categoryName").trim());

        return model;
    }

    /**
     * Creates a Entitlement object out of fields from the request.
     *
     * @param request
     * @return entitlement
     */
    public static Entitlement entitlementFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Entitlement model = new EntitlementImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setEntitlementId(ParamUtil.getLong(request, "entitlementId"));
        model.setEntitlementName(ParamUtil.getString(request, "entitlementName").trim());
        model.setExplanation(ParamUtil.getString(request, "explanation").trim());
        model.setEstimation(ParamUtil.getString(request, "estimation").trim());
        return model;
    }

    /**
     * Creates a Language object out of fields from the request.
     *
     * @param request
     * @return language
     */
    public static Language languageFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Language model = new LanguageImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setLanguageId(ParamUtil.getLong(request, "languageId"));
        model.setLanguageAbbreviation(ParamUtil.getString(request, "languageAbbreviation").trim());
        model.setLanguageName(ParamUtil.getString(request, "languageName").trim());
        return model;
    }

    /**
     * Creates a LegalDetails object out of fields from the request.
     *
     * @param request
     * @return legalDetails
     */
    public static LegalDetails legalDetailsFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        LegalDetails model = new LegalDetailsImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setLegalDetailsId(ParamUtil.getLong(request, "legalDetailsId"));
        model.setAddress(ParamUtil.getString(request, "address").trim());
        model.setEmail(ParamUtil.getString(request, "email").trim());
        model.setFax(ParamUtil.getString(request, "fax").trim());
        model.setLegalForm(ParamUtil.getString(request, "legalForm").trim());
        model.setName(ParamUtil.getString(request, "name").trim());
        model.setRegistrationCourt(ParamUtil.getString(request, "registrationCourt").trim());
        model.setTelephone(ParamUtil.getString(request, "telephone").trim());
        model.setURL(ParamUtil.getString(request, "URL").trim());
        model.setValueAddedTaxNo(ParamUtil.getString(request, "valueAddedTaxNo").trim());
        return model;
    }

    /**
     * Creates a Link object out of fields from the request.
     *
     * @param request
     * @return link
     */
    public static Link linkFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Link model = new LinkImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setLinkId(ParamUtil.getLong(request, "linkId"));
        model.setDisplayName(ParamUtil.getString(request, "displayName").trim());
        model.setType(ParamUtil.getInteger(request, "type"));
        model.setUrl(ParamUtil.getString(request, "url").trim());
        model.setApplicationId(ParamUtil.getLong(request, "applicationId"));
        return model;
    }

    /**
     * Creates a MultiMedia object out of fields from the request.
     *
     * @param request
     * @return multiMedia
     */
    public static MultiMedia multiMediaFromRequest(UploadPortletRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        MultiMedia model = new MultiMediaImpl();

        model.setMultiMediaId(ParamUtil.getLong(request, "multiMediaId"));
        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setName(ParamUtil.getString(request, "name").trim());
        model.setType(ParamUtil.getInteger(request, "type"));
        model.setApplicationId(ParamUtil.getLong(request, "applicationId"));
        return model;
    }

    /**
     * Creates a Region object out of fields from the request.
     *
     * @param request
     * @return region
     */
    public static Region regionFromRequest(ActionRequest request) {
        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
        Region model = new RegionImpl();

        model.setCompanyId(themeDisplay.getCompanyId());
        model.setUserId(themeDisplay.getUserId());

        model.setRegionId(ParamUtil.getLong(request, "regionId"));
        model.setAgs(ParamUtil.getInteger(request, "ags"));
        model.setCoordniates_x(ParamUtil.getDouble(request, "coordniates_x"));
        model.setCoordniates_y(ParamUtil.getDouble(request, "coordniates_y"));
        model.setName(ParamUtil.getString(request, "regionName").trim());
        model.setParentRegion(ParamUtil.getLong(request, "parentRegionId"));
        return model;
    }
}


text:
package io.opentelemetry.sdk.metrics.internal.data;

import com.google.auto.value.AutoValue;
import io.opentelemetry.sdk.metrics.data.ValueAtQuantile;
import javax.annotation.concurrent.Immutable;

/**
 * A summary metric value.
 *
 * <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
 * at any time
 */
@Immutable
@AutoValue
public abstract class ImmutableValueAtQuantile implements ValueAtQuantile {
  public static ValueAtQuantile create(double quantile, double value) {
    return new AutoValue_ImmutableValueAtQuantile(quantile, value);
  }

  ImmutableValueAtQuantile() {}
}

redpajama_set_name: RedPajamaGithub


text:
Ostfalia Thesis (Suderburg BWB)
============================

Diese LaTeX-Vorlage ist an die Vorgaben der Fakultät Bau-Wasser-Boden der Ostfalia (Suderburg) angelehnt.
Ich garantiere nicht für Fehlerfreiheit in den Formalien, jedoch würde ich mich über eine Rückmeldung freuen, wenn Fehler vorhanden sind.

Diese Vorlage steht unter einer MIT-Lizens. Ihr könnt damit also alles machen was ihr wollt. Das Ergebnis dieser Vorlage ist in dem [Beispieldokument](../../raw/master/Beispieldokument.pdf) zu sehen.


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/mainBackGround"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/tv_day"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="10dp"
            android:gravity="center"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_date"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:gravity="center"
            android:textSize="30sp" />

        <Spinner
            android:id="@+id/sp_city"
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:background="@color/text_color"
            android:padding="0dp" />

        <TextView
            android:id="@+id/tv_city"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_marginLeft="8dp"
            android:layout_marginRight="8dp"
            android:gravity="center"
            android:textSize="20sp"
            android:visibility="gone" />

        <TextView
            android:id="@+id/tv_weather_desc"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:gravity="center"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_temp"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_marginRight="15dp"
            android:gravity="center"
            android:textSize="16sp" />

        <Button
            android:id="@+id/btn_refresh_weather"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_gravity="center"
            android:background="@android:drawable/ic_menu_mylocation"
            android:visibility="visible" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp" >

        <ImageView
            android:id="@+id/iv_eat"
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:src="@android:drawable/ic_menu_my_calendar" />

        <TextView
            android:id="@+id/tv_breakfast"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:background="#EEE9E9"
            android:gravity="center"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/tv_lunch"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:background="#EEE9BF"
            android:gravity="center"
            android:textSize="28sp" />

        <TextView
            android:id="@+id/tv_dinner"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:background="#EEE8CD"
            android:gravity="center"
            android:textSize="28sp" />
    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal" >

        <Button
            android:id="@+id/btn_add_record"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:background="@android:drawable/ic_input_add" />

        <ListView
            android:id="@+id/lv_today_record"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/tv_diary"
            android:layout_alignEnd="@+id/btn_add_record"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:textAlignment="gravity" />

        <TextView
            android:id="@+id/tv_diary"
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:layout_above="@+id/btn_add_record"
            android:layout_centerHorizontal="true"
            android:hint="    . . ." />
    </RelativeLayout>

</LinearLayout>


text:
/**************************************************************************//**
 * @file     system_<Device>.c
 * @brief    CMSIS Cortex-M# Device Peripheral Access Layer Source File for
 *           Device <Device>
 * @version  V3.10
 * @date     23. November 2012
 *
 * @note
 *
 ******************************************************************************/
/* Copyright (c) 2012 ARM LIMITED

   All rights reserved.
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:
   - Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
   - Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
   - Neither the name of ARM nor the names of its contributors may be used
     to endorse or promote products derived from this software without
     specific prior written permission.
   *
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   POSSIBILITY OF SUCH DAMAGE.
   ---------------------------------------------------------------------------*/

#include <stdint.h>
#include "<Device>.h"

/*----------------------------------------------------------------------------
  DEFINES
 *----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
  Define clocks
 *----------------------------------------------------------------------------*/
/* ToDo: add here your necessary defines for device initialization
         following is an example for different system frequencies             */
#define __HSI             ( 6000000UL)
#define __XTAL            (12000000UL)    /* Oscillator frequency             */
#define __SYS_OSC_CLK     (    ___HSI)    /* Main oscillator frequency        */

#define __SYSTEM_CLOCK    (4*__XTAL)

/*----------------------------------------------------------------------------
  Clock Variable definitions
 *----------------------------------------------------------------------------*/
/* ToDo: initialize SystemCoreClock with the system core clock frequency value
         achieved after system intitialization.
         This means system core clock frequency after call to SystemInit()    */
uint32_t SystemCoreClock = __SYSTEM_CLOCK;  /*!< System Clock Frequency (Core Clock)*/

/*----------------------------------------------------------------------------
  Clock functions
 *----------------------------------------------------------------------------*/
void SystemCoreClockUpdate (void)            /* Get Core Clock Frequency      */
{
/* ToDo: add code to calculate the system frequency based upon the current
         register settings.
         This function can be used to retrieve the system core clock frequeny
         after user changed register sittings.                                */
  SystemCoreClock = __SYSTEM_CLOCK;
}

/**
 * Initialize the system
 *
 * @param  none
 * @return none
 *
 * @brief  Setup the microcontroller system.
 *         Initialize the System.
 */
void SystemInit (void)
{
/* ToDo: add code to initialize the system
         do not use global variables because this function is called before
         reaching pre-main. RW section maybe overwritten afterwards.          */
  SystemCoreClock = __SYSTEM_CLOCK;
}


text:
To run the code in this directory call
````
python pairs_parallel_simulation.py
````

By default, this will run on 4 cores in parallel, but this can be changed in the Pool commands.

The python script will recreate Figure 8 in 'Malware Family Discovery Using Reversible Jump MCMC Sampling of Regimes'.


text:
package com.zang.api.unit;

import com.zang.api.connectors.SipIpAccessControlListsConnector;
import com.zang.api.domain.AccessControlList;
import com.zang.api.domain.IpAddress;
import com.zang.api.exceptions.ZangException;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;

public class SipAclTest extends BaseUnitTest {

    private SipIpAccessControlListsConnector connector;

    @Before
    public void initConnector() {
        connector = connectorFactory.getSipIpAccessControlListsConnector();
    }

    @Test
    public void viewIpAcl() throws ZangException, IOException {
        createExpectation("SipAclTest", "viewIpAcl");
        checkAcl(connector.viewIpAccessControlList("TestIpAccessControlListSid"));
    }

    @Test
    public void listIpAcls() throws ZangException, IOException {
        createExpectation("SipAclTest", "listIpAcls");
        connector.listIpAccessControlLists(0, 50);
    }

    @Test
    public void createIpAcl() throws ZangException, IOException {
        createExpectation("SipAclTest", "createIpAcl");
        checkAcl(connector.createIpAccessControlList("MyIpAclList"));
    }

    @Test
    public void updateIpAcl() throws ZangException, IOException {
        createExpectation("SipAclTest", "updateIpAcl");
        checkAcl(connector.updateIpAccessControlList("TestIpAccessControlListSid", "NewIpAclList"));
    }

    @Test
    public void deleteIpAcl() throws ZangException, IOException {
        createExpectation("SipAclTest", "deleteIpAcl");
        checkAcl(connector.deleteIpAccessControlList("TestIpAccessControlListSid"));
    }

    @Test
    public void viewAclIp() throws ZangException, IOException {
        createExpectation("SipAclTest", "viewAclIp");
        checkIp(connector.viewAccessControlListIp("TestIpAccessControlListSid", "TestIpAddressSid"));
    }

    @Test
    public void listAclIps() throws ZangException, IOException {
        createExpectation("SipAclTest", "listAclIps");
        connector.listAccessControlListIps("TestIpAccessControlListSid", 0, 10);
    }

    @Test
    public void addAclIp() throws ZangException, IOException {
        createExpectation("SipAclTest", "addAclIp");
        checkIp(connector.addAccessControlListIp("TestIpAccessControlListSid", "MyIpAddress", "10.0.0.1"));
    }

    @Test
    public void updateAclIp() throws ZangException, IOException {
        createExpectation("SipAclTest", "updateAclIp");
        checkIp(connector.updateAccessControlListIp("TestIpAccessControlListSid", "TestIpAddressSid", "NewIpAddress", "10.0.0.2"));
    }

    @Test
    public void deleteAclIp() throws ZangException, IOException {
        createExpectation("SipAclTest", "deleteAclIp");
        checkIp(connector.deleteAccessControlListIp("TestIpAccessControlListSid", "TestIpAddressSid"));
    }

    private void checkAcl(AccessControlList acl) {

    }

    private void checkIp(IpAddress ip) {

    }

}


text:
'use strict'

import {encrypt} from '../util'

export default function (sequelize, DataTypes) {

  let User = sequelize.define('User', {
    name: {type: DataTypes.STRING, allowNull: false, unique: true},
    email: {type: DataTypes.STRING, allowNull: false, unique: true},
    password: {
                type: DataTypes.STRING,
                allowNull: false,
                set: function (plainPass) {
                  this.setDataValue('password', encrypt(plainPass))
                }},
    lastConnection: {type: DataTypes.DATE, default: Date.now}
  }, {
    classMethods: {
      associate: function (db) {
        User.hasMany(db['Character'])
      }
    },
    instanceMethods: {
      authenticate: function (plainPass) {
        return encrypt(plainPass) === this.password
      }
    }
  })

  return User
}


text:
package org.apache.kafka.copycat.file;

import org.apache.kafka.copycat.errors.CopycatException;
import org.apache.kafka.copycat.source.SourceRecord;
import org.apache.kafka.copycat.source.SourceTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 * FileStreamSourceTask reads from stdin or a file.
 */
public class FileStreamSourceTask extends SourceTask {
    private static final Logger log = LoggerFactory.getLogger(FileStreamSourceTask.class);

    private InputStream stream;
    private BufferedReader reader = null;
    private char[] buffer = new char[1024];
    private int offset = 0;
    private String topic = null;

    private Long streamOffset;

    @Override
    public void start(Properties props) {
        String filename = props.getProperty(FileStreamSourceConnector.FILE_CONFIG);
        if (filename == null) {
            stream = System.in;
            // Tracking offset for stdin doesn't make sense
            streamOffset = null;
        } else {
            try {
                stream = new FileInputStream(filename);
                Long lastRecordedOffset = (Long) context.getOffsetStorageReader().getOffset(null);
                if (lastRecordedOffset != null) {
                    log.debug("Found previous offset, trying to skip to file offset {}", lastRecordedOffset);
                    long skipLeft = lastRecordedOffset;
                    while (skipLeft > 0) {
                        try {
                            long skipped = stream.skip(skipLeft);
                            skipLeft -= skipped;
                        } catch (IOException e) {
                            log.error("Error while trying to seek to previous offset in file: ", e);
                            throw new CopycatException(e);
                        }
                    }
                    log.debug("Skipped to offset {}", lastRecordedOffset);
                }
                streamOffset = (lastRecordedOffset != null) ? lastRecordedOffset : 0L;
            } catch (FileNotFoundException e) {
                throw new CopycatException("Couldn't find file for FileStreamSourceTask: {}", e);
            }
        }
        topic = props.getProperty(FileStreamSourceConnector.TOPIC_CONFIG);
        if (topic == null)
            throw new CopycatException("ConsoleSourceTask config missing topic setting");
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    @Override
    public List<SourceRecord> poll() throws InterruptedException {
        // Unfortunately we can't just use readLine() because it blocks in an uninterruptible way.
        // Instead we have to manage splitting lines ourselves, using simple backoff when no new data
        // is available.
        try {
            final BufferedReader readerCopy;
            synchronized (this) {
                readerCopy = reader;
            }
            if (readerCopy == null)
                return null;

            ArrayList<SourceRecord> records = null;

            int nread = 0;
            while (readerCopy.ready()) {
                nread = readerCopy.read(buffer, offset, buffer.length - offset);

                if (nread > 0) {
                    offset += nread;
                    if (offset == buffer.length) {
                        char[] newbuf = new char[buffer.length * 2];
                        System.arraycopy(buffer, 0, newbuf, 0, buffer.length);
                        buffer = newbuf;
                    }

                    String line;
                    do {
                        line = extractLine();
                        if (line != null) {
                            if (records == null)
                                records = new ArrayList<>();
                            records.add(new SourceRecord(null, streamOffset, topic, line));
                        }
                        new ArrayList<SourceRecord>();
                    } while (line != null);
                }
            }

            if (nread <= 0)
                Thread.sleep(1);

            return records;
        } catch (IOException e) {
            // Underlying stream was killed, probably as a result of calling stop. Allow to return
            // null, and driving thread will handle any shutdown if necessary.
        }
        return null;
    }

    private String extractLine() {
        int until = -1, newStart = -1;
        for (int i = 0; i < offset; i++) {
            if (buffer[i] == '\n') {
                until = i;
                newStart = i + 1;
                break;
            } else if (buffer[i] == '\r') {
                // We need to check for \r\n, so we must skip this if we can't check the next char
                if (i + 1 >= offset)
                    return null;

                until = i;
                newStart = (buffer[i + 1] == '\n') ? i + 2 : i + 1;
                break;
            }
        }

        if (until != -1) {
            String result = new String(buffer, 0, until);
            System.arraycopy(buffer, newStart, buffer, 0, buffer.length - newStart);
            offset = offset - newStart;
            if (streamOffset != null)
                streamOffset += newStart;
            return result;
        } else {
            return null;
        }
    }

    @Override
    public void stop() {
        log.trace("Stopping");
        synchronized (this) {
            try {
                stream.close();
                log.trace("Closed input stream");
            } catch (IOException e) {
                log.error("Failed to close ConsoleSourceTask stream: ", e);
            }
            reader = null;
            stream = null;
        }
    }
}


text:
/*
 * USB PHY defines
 *
 * These APIs may be used between USB controllers.  USB device drivers
 * (for either host or peripheral roles) don't use these calls; they
 * continue to use just usb_device and usb_gadget.
 */

#ifndef __LINUX_USB_PHY_H
#define __LINUX_USB_PHY_H

#include <linux/notifier.h>
#include <linux/usb.h>

enum usb_phy_interface {
	USBPHY_INTERFACE_MODE_UNKNOWN,
	USBPHY_INTERFACE_MODE_UTMI,
	USBPHY_INTERFACE_MODE_UTMIW,
	USBPHY_INTERFACE_MODE_ULPI,
	USBPHY_INTERFACE_MODE_SERIAL,
	USBPHY_INTERFACE_MODE_HSIC,
};

enum usb_phy_events {
	USB_EVENT_NONE,         /* no events or cable disconnected */
	USB_EVENT_VBUS,         /* vbus valid event */
	USB_EVENT_ID,           /* id was grounded */
	USB_EVENT_CHARGER,      /* usb dedicated charger */
	USB_EVENT_ENUMERATED,   /* gadget driver enumerated */
};

/* associate a type with PHY */
enum usb_phy_type {
	USB_PHY_TYPE_UNDEFINED,
	USB_PHY_TYPE_USB2,
	USB_PHY_TYPE_USB3,
};

/* OTG defines lots of enumeration states before device reset */
enum usb_otg_state {
	OTG_STATE_UNDEFINED = 0,

	/* single-role peripheral, and dual-role default-b */
	OTG_STATE_B_IDLE,
	OTG_STATE_B_SRP_INIT,
	OTG_STATE_B_PERIPHERAL,

	/* extra dual-role default-b states */
	OTG_STATE_B_WAIT_ACON,
	OTG_STATE_B_HOST,

	/* dual-role default-a */
	OTG_STATE_A_IDLE,
	OTG_STATE_A_WAIT_VRISE,
	OTG_STATE_A_WAIT_BCON,
	OTG_STATE_A_HOST,
	OTG_STATE_A_SUSPEND,
	OTG_STATE_A_PERIPHERAL,
	OTG_STATE_A_WAIT_VFALL,
	OTG_STATE_A_VBUS_ERR,
};

struct usb_phy;
struct usb_otg;

/* for transceivers connected thru an ULPI interface, the user must
 * provide access ops
 */
struct usb_phy_io_ops {
	int (*read)(struct usb_phy *x, u32 reg);
	int (*write)(struct usb_phy *x, u32 val, u32 reg);
};

struct usb_phy {
	struct device		*dev;
	const char		*label;
	unsigned int		 flags;

	enum usb_phy_type	type;
	enum usb_phy_events	last_event;

	struct usb_otg		*otg;

	struct device		*io_dev;
	struct usb_phy_io_ops	*io_ops;
	void __iomem		*io_priv;

	/* for notification of usb_phy_events */
	struct atomic_notifier_head	notifier;

	/* to pass extra port status to the root hub */
	u16			port_status;
	u16			port_change;

	/* to support controllers that have multiple transceivers */
	struct list_head	head;

	/* initialize/shutdown the OTG controller */
	int	(*init)(struct usb_phy *x);
	void	(*shutdown)(struct usb_phy *x);

	/* enable/disable VBUS */
	int	(*set_vbus)(struct usb_phy *x, int on);

	/* effective for B devices, ignored for A-peripheral */
	int	(*set_power)(struct usb_phy *x,
				unsigned mA);

	/* Set transceiver into suspend mode */
	int	(*set_suspend)(struct usb_phy *x,
				int suspend);

	/*
	 * Set wakeup enable for PHY, in that case, the PHY can be
	 * woken up from suspend status due to external events,
	 * like vbus change, dp/dm change and id.
	 */
	int	(*set_wakeup)(struct usb_phy *x, bool enabled);

	/* notify phy connect status change */
	int	(*notify_connect)(struct usb_phy *x,
			enum usb_device_speed speed);
	int	(*notify_disconnect)(struct usb_phy *x,
			enum usb_device_speed speed);
};

/**
 * struct usb_phy_bind - represent the binding for the phy
 * @dev_name: the device name of the device that will bind to the phy
 * @phy_dev_name: the device name of the phy
 * @index: used if a single controller uses multiple phys
 * @phy: reference to the phy
 * @list: to maintain a linked list of the binding information
 */
struct usb_phy_bind {
	const char	*dev_name;
	const char	*phy_dev_name;
	u8		index;
	struct usb_phy	*phy;
	struct list_head list;
};

/* for board-specific init logic */
extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
extern int usb_add_phy_dev(struct usb_phy *);
extern void usb_remove_phy(struct usb_phy *);

/* helpers for direct access thru low-level io interface */
static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
{
	if (x && x->io_ops && x->io_ops->read)
		return x->io_ops->read(x, reg);

	return -EINVAL;
}

static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
{
	if (x && x->io_ops && x->io_ops->write)
		return x->io_ops->write(x, val, reg);

	return -EINVAL;
}

static inline int
usb_phy_init(struct usb_phy *x)
{
	if (x && x->init)
		return x->init(x);

	return 0;
}

static inline void
usb_phy_shutdown(struct usb_phy *x)
{
	if (x && x->shutdown)
		x->shutdown(x);
}

static inline int
usb_phy_vbus_on(struct usb_phy *x)
{
	if (!x || !x->set_vbus)
		return 0;

	return x->set_vbus(x, true);
}

static inline int
usb_phy_vbus_off(struct usb_phy *x)
{
	if (!x || !x->set_vbus)
		return 0;

	return x->set_vbus(x, false);
}

/* for usb host and peripheral controller drivers */
#if IS_ENABLED(CONFIG_USB_PHY)
extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
extern struct usb_phy *devm_usb_get_phy(struct device *dev,
	enum usb_phy_type type);
extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index);
extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index);
extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
	const char *phandle, u8 index);
extern struct usb_phy *devm_usb_get_phy_by_node(struct device *dev,
	struct device_node *node, struct notifier_block *nb);
extern void usb_put_phy(struct usb_phy *);
extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
extern int usb_bind_phy(const char *dev_name, u8 index,
				const char *phy_dev_name);
extern void usb_phy_set_event(struct usb_phy *x, unsigned long event);
#else
static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
{
	return ERR_PTR(-ENXIO);
}

static inline struct usb_phy *devm_usb_get_phy(struct device *dev,
	enum usb_phy_type type)
{
	return ERR_PTR(-ENXIO);
}

static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
{
	return ERR_PTR(-ENXIO);
}

static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
{
	return ERR_PTR(-ENXIO);
}

static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
	const char *phandle, u8 index)
{
	return ERR_PTR(-ENXIO);
}

static inline struct usb_phy *devm_usb_get_phy_by_node(struct device *dev,
	struct device_node *node, struct notifier_block *nb)
{
	return ERR_PTR(-ENXIO);
}

static inline void usb_put_phy(struct usb_phy *x)
{
}

static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x)
{
}

static inline int usb_bind_phy(const char *dev_name, u8 index,
				const char *phy_dev_name)
{
	return -EOPNOTSUPP;
}

static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event)
{
}
#endif

static inline int
usb_phy_set_power(struct usb_phy *x, unsigned mA)
{
	if (x && x->set_power)
		return x->set_power(x, mA);
	return 0;
}

/* Context: can sleep */
static inline int
usb_phy_set_suspend(struct usb_phy *x, int suspend)
{
	if (x && x->set_suspend != NULL)
		return x->set_suspend(x, suspend);
	else
		return 0;
}

static inline int
usb_phy_set_wakeup(struct usb_phy *x, bool enabled)
{
	if (x && x->set_wakeup)
		return x->set_wakeup(x, enabled);
	else
		return 0;
}

static inline int
usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
{
	if (x && x->notify_connect)
		return x->notify_connect(x, speed);
	else
		return 0;
}

static inline int
usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
{
	if (x && x->notify_disconnect)
		return x->notify_disconnect(x, speed);
	else
		return 0;
}

/* notifiers */
static inline int
usb_register_notifier(struct usb_phy *x, struct notifier_block *nb)
{
	return atomic_notifier_chain_register(&x->notifier, nb);
}

static inline void
usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb)
{
	atomic_notifier_chain_unregister(&x->notifier, nb);
}

static inline const char *usb_phy_type_string(enum usb_phy_type type)
{
	switch (type) {
	case USB_PHY_TYPE_USB2:
		return "USB2 PHY";
	case USB_PHY_TYPE_USB3:
		return "USB3 PHY";
	default:
		return "UNKNOWN PHY TYPE";
	}
}
#endif /* __LINUX_USB_PHY_H */


text:
'''A simple, dumb scan test which only uses the basic signals'''

import time
import numpy as np

import config
from ophyd.controls import (PVPositioner, EpicsSignal, EpicsMotor)

def simple_scan(motors=[],
                trajectories=[],
                triggers=[],
                detectors=[],
                pos_settle_time=0.01,
                trigger_settle_time=0.01,
                dwell_time=1.0):
    '''Run a simple scan outside of the Ophyd framework

    Parameters
    ----------
    motors : a list of positioners
    trajectories : a list of iterables
        Trajectories should match in position to the motors
    triggers : a list of tuples in the format (pv, value)
        Run after motion has finished
    detectors : list of pvs
        Recorded after the dwell time
    dwell_time : float
        time to dwell per point of scan
    '''

    logger = config.logger

    def move_motors():
        end_of_trajectory = []
        status = []
        for motor in motors:
            try:
                _, stat = motor.move_next(wait=False)
            except StopIteration:
                logger.debug('End of trajectory for motor %s' % motor)
                # End of the trajectory
                end_of_trajectory.append(True)
                break
            else:
                logger.debug('Moving motor %s to %s' % (motor, pos))
                end_of_trajectory.append(False)
                status.append(stat)

        if all(end_of_trajectory):
            logger.debug('End of trajectory for all motors')
            return False

        while not all(stat.done for stat in status):
            time.sleep(0.01)

        return True

    def do_triggers():
        for trigger, value in triggers:
            logger.debug('Trigger %s = %s' % (trigger, value))
            trigger.value = value

    def collect_data():
        logger.debug('Collecting data')
        # return [det.read() for det in detectors]
        return [det.value for det in detectors]

    for motor, pos in zip(motors, trajectories):
        logger.debug('Setting trajectory for motor %s' % motor)
        motor.set_trajectory(pos)

    all_data = []
    try:
        while True:
            if not move_motors():
                break

            time.sleep(pos_settle_time)
            do_triggers()
            time.sleep(trigger_settle_time)
            time.sleep(dwell_time)
            all_data.append(collect_data())

    except KeyboardInterrupt:
        logger.error('Scan interrupted by KeyboardInterrupt')
        for m in motors:
            logger.debug('Stopping motor %s' % m._alias)
            m.stop()

    trajectories = [m._followed for m in motors]
    return trajectories, all_data

def test():
    loggers = ('ophyd.controls.signal',
               'ophyd.controls.positioner',
               'ophyd.session',
               )

    config.setup_loggers(loggers)

    fm = config.fake_motors[0]

    if 0:
        pos0 = PVPositioner(fm['setpoint'],
                            readback=fm['readback'],
                            act=fm['actuate'], act_val=1,
                            stop=fm['stop'], stop_val=1,
                            done=fm['moving'], done_val=1,
                            put_complete=False,
                            )
    else:
        motor_record = config.motor_recs[0]
        pos0 = EpicsMotor(motor_record)

    det = [EpicsSignal(pv, rw=False)
           for pv in config.fake_sensors]

    # pos0_traj = [0, 0.1, 0.2]
    pos0_traj = np.linspace(0, 1, 5)
    traj, data = simple_scan(motors=[pos0],
                             trajectories=[pos0_traj],
                             triggers=[],
                             detectors=det,
                             dwell_time=1.0)

    print(traj, data)

if __name__ == '__main__':
    test()


text:
/*
 * RssfBarometer.java
 *
 * Created on September 24, 2003, 1:55 PM
 */

package componentmodel.repositorytool;

/**
 *
 * @author  alla
 */
public class RssfBarometer {

    /** Creates a new instance of RssfBarometer */
    public RssfBarometer() {
    }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<meta name="GENERATOR" content=
"Quadralay WebWorks Publisher Professional Edition 7.0.2.1128" />
<meta name="TEMPLATEBASE" content="book-no-index" />
<meta name="LASTUPDATED" content="Wed Nov 13 16:47:46 2002" />
<title>Java™ Product Versioning</title>
<link rel="stylesheet" type="text/css" href="../../../../technotes/css/guide.css" />

Documentation Contents

Contents | Previous | Next

Java™ Product Versioning

Chapter   1

1.1 Introduction

In any system support must be provided for the
system to evolve over time. Most existing systems have conventions
and mechanisms that specify how change is accommodated. These
systems have been based on the model where software programs are
installed on a computer. Typically, developers have been able to
specify what versions of other packages are required and the
installation process has helped verify and configure the
system.

In open distributed systems the static assumptions
of existing systems does not work and evolution is more difficult
because it is not possible to control how or when the packages
change and correct operation depends on a greater number of
dependencies between packages. What is needed is an updated set of
conventions and mechanisms that specify how the packages of a
system should evolve so that the goal of an open reliable scalable
distributed system can be achieved.

This document specifies:

how classes, resources, and files that make up a Java package
are versioned. Packages define the consistent unit that can be
developed, packaged, verified, updated, and distributed. Per
package manifest information identifies the contents of the
package;

products are distributed by putting packages into archive
files. Archives include a manifest to identify the product version
and packages it contains;

the standards and conventions used by developers and
administrators to build and deploy products that operate reliably
as their packages and the packages they depend on are
upgraded.

1.2 Requirements

The impact of changes within a distributed system
has a significant impact on end users, support organizations, web
administrators, and developers.

End Users

Product Support Organizations

Webmasters and Administrators

Product Developers

Each of these groups has different requirements on
products deployed on the net that evolve over time.

Users

For users there is a need to build confidence that
Java based products will be reliable and compatible over time. The
reluctance to upgrade needs be addressed by building confidence in
the Write Once Run Anywhere philosophy. With Java it should no
longer be the norm that users will complain “if I upgrade it
will break something” or “I won't be able to
read/write data others can use”.

They need to know that upgrading will not break either other
programs or will obsolete existing data or produce data unusable by
others.

At the simplest level users want to know if the features they
need are in the product version they have and what version to ask
for to get particular features.

More knowledgeable users keep track of what bugs are in what
product version so they can work around them or avoid them.

Product support

Product organizations rely on being able to easily
and correctly identify the product that is being used, the
environment in which it is being used, and the integrity of the
product packaging.

Databases of known problems and solutions are indexed by
product identification information.

The interoperation of products and packages can introduce new
kinds of problems and require all of the packages in a system to be
identified. Problems can originate from public interfaces that are
under-specified, implementations that do not conform to the
specification, or clients that use implementation specific details
that are not part of the specification.

Webmasters and Administrators

Webmasters, administrators, and service providers
need to deploy applications for their clients via the web or
network filesystems in a way that is reliable and supportable.

The staff of these organizations must be able to support their
sites, identifying problems with individual packages and
interactions between packages.

Site configuration must be able to support the scaling up of
sites with automated site management tools.

Installing updating packages must not present a risk to the
correction operation of existing packages or active users.

Product Developers

Product developers need to know how to write and
deploy applications and libraries that satisfy the requirements of
the users, administrators and support personnel. The must be able
to make products and packages that:

can operate correctly in the open dynamic environment of the
web,

can be upgraded without breaking compatibility with
clients,

can take advantage of upgrades in the packages they rely
upon,

can take advantage of dynamic extensions of their
packages,

can identify the packages they rely on for reporting of
problems,

are packaged to support the needs of users, webmasters and
support organizations,

can have known packages and combinations that satisfy the
auditing and security requirements appropriate for the application
and organization.

1.3 Problems of Evolution in Distributed
Systems

In open distributed systems many problems can
occur when the packages evolve and are updated independently. If
the specified behavior inherent in the use of public interfaces are
not maintained the system may fail in unexpected ways. Open systems
are made up of many packages from different companies and
organizations. These organizations operate asynchronously,
introducing and upgrading their products on their own schedules.
The distribution of those upgraded products takes time and adoption
is not universal.

In Java, the components of local and distributed
systems rely on the public interfaces and contracts for the
behavior of other packages. Those packages will themselves evolve
over time. In order for a package to operate correctly the packages
it depends on must continue to provide the expected behavior even
though they have been updated.

In distributed systems only partial consistency is
possible, since it is impossible to have knowledge of the entire
state of the system. Each process and package of the system has its
own partial view of the current state of the system, accumulated
incrementally by requesting information from other parts of the
distributed system. Each piece of information whether from an
applet that was started, a class that was loaded, a remote method
invoked, or a web page retrieved must be treated carefully so that
it can be used consistently with the rest of that partial view.

Many kinds of errors could result from
inconsistencies in the classes that are loaded, including class
verification errors, classes could compute incorrectly but without
recognizable errors, or user requested functions could exhibit
arbitrary failures.

Typical problems include:

If an applet is running and has loaded only some of its classes
when the web server is updated with a new version. When the applet
incrementally loads more classes they may be inconsistent with the
classes already loaded.

If an application is using libraries from multiple websites and
has loaded only some of the classes it needs, the libraries might
be updated raising the potential of incompatibilities that the
applet or user is left to detect.

If an application or applet is running and makes a RMI call
that returns an object for which the class needs to be loaded. The
class that is loaded could be inconsistent with respect to the
other classes already loaded.

If an application or applet is running and makes a RMI call
that returns an object that is for a newer or older version of the
class.

Bugs may exist in a library, if the clients have worked around
the bug a cascade of problems may be introduced when the bug is
fixed.

These problems cannot be prevented or solved
directly because they arise out of inconsistencies between
dynamically loaded packages that are not under the control of a
single system administrator and so cannot be addressed by current
configuration management techniques.

1.4 Design for Evolution

The key to dealing with these problems and meeting
the requirements stated above is the careful design of the packages
and packaging of the system so that they may be updated,
distributed, and loaded in consistent units. Typical to mass
produced products is the notion of the field replacable unit. It is
the smallest unit of a product that can be identified with a
specification, a supplier, can be distributed and redistributed,
and can be replaced if faulty. This same model is used for software
distribution, products have a name, a version number, adhere to one
or more specifications, are distributed on the network or cdrom and
its problems can be reported to support organizations. These
packages are the smallest unit that can be distributed, used,
validated and replaced or upgraded when necessary. Packages can be
assembled with other packages and each package can still be
identified, verified, and distributed.

The Java language based package mechanism fits
well with the idea of a replacable unit. Java packages expose only
public interfaces and use only the public interfaces of other
packages. The Java Language Specification define the approaches for
compatible evolution of packages.

1.4.1 Java Language Specification on
Backwards Compatibility

The Java Language Specification lays the
groundwork for developing packages that can be expected to evolve
gracefully over time. It defines how classes can change and still
be backward compatible with other classes previously compiled and
distributed. Essential to robust evolution is the stability of the
public, protected, and package interfaces and behavior as the
implementations evolve. It defines “compatible” changes
as those changes that do not change existing interfaces or
behavior. Thus, if a class defines a method, and the method had a
particular behavior, that same contract must be supported by the
all later evolutions of the class. Detailed rules are given in
Chapter 13 of the Java Language Specification. One additional
incompatible change has been added; it is incompatible to add
methods to a public interface.

Incompatible changes are not permitted, but new or
similar functionality can always be added in new or existing
interfaces or classes.

By choosing the Java package as the unit of update
the package and private methods of the classes may change allowing
flexibility in the implementation of the package while the public
and protected classes and methods maintain the external interfaces
and semantics.

1.4.2 Object Serialization Specification on
Backwards Compatibility

Robust persistent storage and robust communication
between the components is important to distributed systems.
Components must be able to maintain persistent storage as they
evolve, being able to evolve classes and yet have them read data
previously written to storage. Components in a distributed system
evolve at different rates and must still be able to reliably
communicate.

Adhering to the compatibility requirements of
object serialization allows newer and older versions to communicate
in a predictable and consistent way. The details are in Chapter 5
of the Java™ Object Serialization
Specification.

1.5 Package Version Specification

There are several categories of artifacts that
need to be identified including specifications, implementation, the
Java Virtual Machine and Java Runtime Environment.

1.5.1 Specification Versioning

Open systems are based on the idea that a
specification may have multiple implementations. Specifications
evolve under the auspices of an organization or company. It is
highly undesirable if a specification has multiple incompatible
versions. Each version of a specification or implementation must
evolve only into a single subsequent version. The philosophy of
requiring specifications to be backward compatible allows
specifications to be identified as supersets of the previous
specification. Since there is a single sequence of version
specifications they can meaningfully be identified by version
numbers with specific semantics that imply the ordering.
Specification version numbers use a Dewey decimal notation
consisting of numbers seperated by periods.

A specification is identified by the:

Owner of the specification

Name of the Specification

Version number - major.minor.micro; major version numbers
identify significant functional changes, minor version numbers
identify smaller extensions to the functionality, micro versions
are even finer grained versions. These version numbers are ordered
with larger numbers specifying additions to the specification.

1.5.2 Virtual Machine Versioning

An implementation of the Java Virtual Machine
should be identify both the specification and the implementation.
These properties should be added to those already available using
java.lang.System.getProperties.

java.vm.specification.version: Example, 1.8

java.vm.specification.vendor: Example, Oracle Corporation

java.vm.specification.name: Example, Java Virtual Machine
Specification

java.vm.version: Example, 25.0-b05

java.vm.vendor: Example, Oracle Corporation

java.vm.name: Example, Java HotSpot(TM) Client VM

These properties are accessed using the method
java.lang.System.getProperty and each returns a string.

1.5.3 Version Identification of the Java
Runtime

The requirement to identify the Java Runtime is
already partially met via the properties specified by the Java
Language Specification, section 20.18.7 using
java.lang.System.getProperties.

java.version: Example, 1.8.0

java.vendor: Example, Oracle Corporation

Currently these identify the implementation of the
Java runtime and the core classes that are available. These
properties do not identify the Java
Language Specification version that this JDK implements.

Additional properties are needed to identify the
version of the Java Runtime Environment specification that this
implementation adheres to. The properties are:

java.specification.version: Example, 1.8

java.specification.name: Example: Java Language
Specification

java.specification.vendor: Example, Oracle Corporation

These properties are accessed using the method
java.lang.System.getProperty and return their values as
strings.

1.5.4 Package Versioning

Each Java package is made up of class files plus
optional resource files. The information needed to identify the
contents of the package is stored with the package contents.

This specification applies to all packages
regardless of whether they are developed as a core package
distributed with a Java Runtime, a standard extension, an applet or
application package.

Unlike version numbers for specifications version
information for implementations cannot
be used to identify the package as being backward compatible with
earlier versions. Package version numbers are present to identify
differences between the specification and the implementation, i.e.
bugs. New versions of implementations are specifically produced to
remove (bad or incorrect) behavior and thus are intended not to be backward compatible. Thus package
version strings can have any unique value and can only be compared
for equality. For a complete explanation of the rationale, see
Section 1.5.10
"Rationale for limiting Implementation version numbers to
identity”.

The following attribute names are defined for a
package. The value of each attribute is a string:

Package-Title: Title of the package

Package-Version: Version number

Package-Vendor: Vendor's company or organization

Specification-Title: Title of the specification

Specification-Version: Version number

Specification-Vendor: Vendor's company or organization

These attributes are stored in the manifest and
retrieved by programs using the java.lang.Package API described
below.

1.5.5 API to Package Version Information

The java.lang.Package class provides a object to
locate and access information about the package.

Package objects are created explicitly by class
loaders and should be created before the first class in the package
is defined. The attributes of each package are stored in the
manifest and are retrieved by the classloader.

package java.lang;
public class Package {

        // Return the name of this package.
        public String getName();

        // Return the title of the specification of this package.
        public String getSpecificationTitle();

        // Return the version of the specification of this package.
        public String getSpecificationVersion();

        // Return the vendor of the specification of this package.
        public String getSpecificationVendor();

        // Return the title of the implementation of this package.
        public String getImplementationTitle();

        // Return the version of the implementation of this package.
        public String getImplementationVersion();

        // Return the vendor of the implementation of this package.
        public String getImplementationVendor();

        // Is this package is compatible with the requested version
        public boolean isCompatibleWith(String desired);

        // Get the Package for the named class
        public static Package getPackage(String classname);

        // Return the packages for currently loaded classes.
        public static Package[] getAllPackages();

        // Return true if this package is equal to another object.
        public boolean equals(Object obj);

        // Return the hashcode for this object
        public int hashCode();

        // Return the string describing this package.
        public String toString();
}

The getName method
returns this package’s name, for example, java.lang.

The getSpecificationTitle method return this packages
specification title if it is known and null otherwise.

The getSpecificationVersion method return this the
version number of the specification this package implements. Null
is returned if the version is not known.

The getSpecificationVendor returns the organization,
group or vendor that owns the specification.

The getImplementationTitle method return this packages
implementation title if it is known and null otherwise.

The getImplementationVersion method return this the
version number of the implementation this package implements. Null
is returned if the version is not known.

The getImplementationVendor returns the organization,
group or vendor that owns this implementation.

The isCompatibleWith
method returns true if this package’s specification version
number is compatible with the desired version number. True is
returned if this packages specification version number is greater
than the supplied version string. A version string is a series of
positive numbers separated by periods. The numbers are compared
component by component from left to right. If any number is greater
than the corresponding number of the supplied string the method
returns true. If the number is less than it returns false. If the
corresponding numbers are equal the next number is examined.

The getPackage method
locates the package for the class by name. The current class loader
is consulted to map the package name to the package object in that
class loader. It returns the package object containing the
attributes for the package. Null is returned if the package
information has not yet been loaded or if no package information
was defined by the classloader.

The getAllPackages
method will return an array of the packages known to the current
classloader. It includes the packages of both the system and
classloaded classes. It does not identify all packages available to
be loaded by the classloader. It only identifies those packages for
which the classloader has provided information.

The equals method
returns true if this package has the same name and classloader as
the object passed in.

The hashCode method returns a hashcode consistent
with definition of equals as required by the Java Language
Specification.

The toString method
returns a string consisting of “package” and the
package name. If available the specification title and
specification version number are appended to the string.

1.5.6 java.lang.Class Additions

A method has been added to java.lang.Class to get the package for this
class.

package java.lang;
public class Class {
        ...
        public Package getPackage();
        ...
}

1.5.7 java.lang.ClassLoader Additions

In order to support Packages the classloader is
extended to keep track of the mapping from classes to packages and
to allow classloaders to define the Package instances for the
classes they load. The additional methods are defined to allow
subclasses to define packages in this classloader to allow the
Package implementation to get information about packages defined by
this classloader.

The java.lang.Package implementation needs to
identify the current classloader in order to call it from system
code.

package java.lang;
public class ClassLoader {
        ...
        // Return the non-null classloader of callers
        public static ClassLoader currentClassLoader();
        // Define a Package
        protected Package(String pkgname,
                        String spectitle, String specversion,
                        String specvendor,      String impltitle,
                        String implversion, String implvendor);
        ...
}

The currentClassLoader
method is used to find the current ClassLoader even if called from
a system class. When called from a classloader loaded class it will
return the equivalent of this.getClass().getClassLoader().
It’s behavior is identical to the current
SecurityManager.currentClassLoader method but is public.

The protected access definePackage method is used by subclasses to define
the packages of the classes it is loading. Packages with a given
name may only be defined once and must be defined before the first
class of that package is loaded. The classloader should supply the
versioning attributes from the manifest if they are available.

1.5.8 JAR Manifest Format

The current manifest format is extended to allow
the specification of the attributes for package versioning
information. A manifest entry should be created for each Java
package. The name of the entry will be the directory within the
archive that contains the package’s class and resource files.
For example:

Manifest-Version: 1.0
Created-By: 1.8.0 (Oracle Corporation)
Name: java/util/
Specification-Title: Java Utility Classes
Specification-Version: 1.2
Specification-Vendor: Example Tech, Inc.
Implementation-Title: java.util
Implementation-Version: build57
Implementation-Vendor: Example Tech, Inc.

These attributes can be inserted in the manifest
by creating a prototype manifest file and using the
“-m” switch of the jar tool to merge them into the
manifest when it is built. JarTool will be extended to browse and
set the versioning attributes in the manifest.

1.5.9 How Users Know What is Running

Users need to be able to report the identities of
the packages in use when bugs occur. It’s up to the
application, applet or browser to expose the available information
to the user on demand or when an error occurs. API’s are
available to allow the following to be reported:

What are the packages loaded?

The package.getAllPackages method will
return the active packages.

What are the package versions?

The java.lang.Package methods allow the attributes for names and
versions to be examined as listed in Section 1.5.4 "Package
Versioning”.

What version of the Java Runtime is active?

The System.getProperties method can be used to get the properties
of this virtual machine listed in Section 1.5.3 "Version
Identification of the Java Runtime”.

What version of the Java VM is active?

The System.getProperties method can be used to get the properties
of this virtual machine listed in Section 1.5.2 "Virtual Machine
Versioning”.

1.5.10 Rationale for limiting Implementation
version numbers to identity

Implementations evolve independently over time to
fix bugs, improve performance or add new functions called for by
later revisions of the specifications. Packages implement
specifications and must identify which version of each
specification they implement. Interactions occur between packages
only through their public and protected interfaces and classes. It
is the public api and behavior that must remain stable over time so
that changes can be allowed in the implementation of one package
without affecting the behavior of another package.

If the classes of a package always faithfully implemented the specification it
would be sufficient just to identify the specification. Since in
the real world this rarely happens packages need to identify
themselves so that bugs can be reported against the packages that
may have contributed to the problem.

There is a significant tendency to try to attach
some significance to version identifiers of implementations. If the
purpose is to allow the tracking of bugs then a unique number is
sufficient. It is also sufficient for a client package to
workaround a bug in a particular version of a vendors package since
that version can be tested for and the bug avoided.

However, many additional problems can occur when
one package attempts to work around bugs in other packages. They
need to identify behavior that is not part of the specification and
may try to use behavior that is only part of one implementation.
Such implementation specific behavior cannot be relied upon to be
in any particular version other than the one(s) seen and tested by
the developer.

A bug first appears in some version of a vendors
package and may or may not continue to be a problem in subsequent
versions. If the client of the buggy package uses a work around
based on version numbers it could correctly work around the bug in
the specific version. Now, if the buggy package was fixed, how
would the client package know whether the bug was fixed or not. If
it assumed that higher versions still contained the bug it would
still try to work around the bug. The work around itself might not
work correctly with the non-buggy package. This could cause a
cascade of bugs caused by fixing a bug. Only the developer, through
testing with a new version, can determine whether or not the
workaround for a bug is still necessary or whether it will cause
problems with the correctly behaving package. The developer only
knows that the bug exists in a particular individual versions.

1.6 Documenting How to Develop

This section should discuss each aspect of product
development and distributions giving direction on how to achieve a
robust evolvable product.

Read the Java Language Specification, be backward
compatible

Read Serialization Specification, be backward compatible

Develop on a platform that includes all of the functionality
required.

Test for new functionality not included in each previous
version of the platform specification and fall back or put up
sensible messages

Author the package and product versioning information and
create the necessary files

Depending on the archive model the entire contents will need to
be signed and the manifests be created

Test on oldest platform

Distribute only in archives with manifests to insure
consistency and integrity

Update only whole java packages or whole archive files

Contents | Previous | Next

Copyright
© 1993, 2015, Oracle and/or its affiliates. All rights
reserved.

Contact
Us


text:
execute_process(COMMAND brew --prefix libffi OUTPUT_VARIABLE LIBFFI_BREW_PREFIX)

find_library(LIBFFI_LIBRARY NAMES ffi libffi
        PATHS /usr /usr/local /opt/local
        PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu
        )

find_path(LIBFFI_INCLUDE_DIR ffi.h
        PATHS /usr /usr/local /opt/local /usr/include/ffi
        PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu x86_64-linux-gnu
        HINT LIBFFI_BREW_PREFIX
        )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBFFI DEFAULT_MSG LIBFFI_LIBRARY LIBFFI_INCLUDE_DIR)

# Copy the results to the output variables.
IF(LIBFFI_FOUND)
    SET(LIBFFI_LIBRARIES ${LIBFFI_LIBRARY})
    SET(LIBFFI_INCLUDE_DIRS ${LIBFFI_INCLUDE_DIR})
ELSE(LIBFFI_FOUND)
    SET(LIBFFI_LIBRARIES)
    SET(LIBFFI_INCLUDE_DIRS)
ENDIF(LIBFFI_FOUND)

MARK_AS_ADVANCED(LIBFFI_INCLUDE_DIRS LIBFFI_LIBRARIES)

message(STATUS "Found Libffi (include: ${LIBFFI_INCLUDE_DIRS}, library: ${LIBFFI_LIBRARIES})")


text:
package org.csc.phynixx.sqlquery.jpa;

// Generated 02.04.2015 10:08:48 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TestAdresse generated by hbm2java
 */
@Entity
@Table(name = "TEST_ADRESSE")
public class TestAdresse implements java.io.Serializable {

	private long sidTestAdresse;
	private TestPerson testPerson;
	private long idTestAdresse;
	private Date dtVon;
	private Date dtBis;
	private Date dtBearb;
	private Date dtLoesch;
	private String strasse;
	private String plz;
	private String ort;
	private String hausnummer;
	private Set<TestPerson> testPersons = new HashSet<TestPerson>(0);

	public TestAdresse() {
	}

	public TestAdresse(long sidTestAdresse, long idTestAdresse, Date dtVon,
			Date dtBis, Date dtBearb, Date dtLoesch) {
		this.sidTestAdresse = sidTestAdresse;
		this.idTestAdresse = idTestAdresse;
		this.dtVon = dtVon;
		this.dtBis = dtBis;
		this.dtBearb = dtBearb;
		this.dtLoesch = dtLoesch;
	}

	public TestAdresse(long sidTestAdresse, TestPerson testPerson,
			long idTestAdresse, Date dtVon, Date dtBis, Date dtBearb,
			Date dtLoesch, String strasse, String plz, String ort,
			String hausnummer, Set<TestPerson> testPersons) {
		this.sidTestAdresse = sidTestAdresse;
		this.testPerson = testPerson;
		this.idTestAdresse = idTestAdresse;
		this.dtVon = dtVon;
		this.dtBis = dtBis;
		this.dtBearb = dtBearb;
		this.dtLoesch = dtLoesch;
		this.strasse = strasse;
		this.plz = plz;
		this.ort = ort;
		this.hausnummer = hausnummer;
		this.testPersons = testPersons;
	}

	@Id
	@Column(name = "SID_TEST_ADRESSE", unique = true, nullable = false, precision = 10, scale = 0)
	public long getSidTestAdresse() {
		return this.sidTestAdresse;
	}

	public void setSidTestAdresse(long sidTestAdresse) {
		this.sidTestAdresse = sidTestAdresse;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SID_TEST_PERSON")
	public TestPerson getTestPerson() {
		return this.testPerson;
	}

	public void setTestPerson(TestPerson testPerson) {
		this.testPerson = testPerson;
	}

	@Column(name = "ID_TEST_ADRESSE", nullable = false, precision = 10, scale = 0)
	public long getIdTestAdresse() {
		return this.idTestAdresse;
	}

	public void setIdTestAdresse(long idTestAdresse) {
		this.idTestAdresse = idTestAdresse;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DT_VON", nullable = false, length = 7)
	public Date getDtVon() {
		return this.dtVon;
	}

	public void setDtVon(Date dtVon) {
		this.dtVon = dtVon;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DT_BIS", nullable = false, length = 7)
	public Date getDtBis() {
		return this.dtBis;
	}

	public void setDtBis(Date dtBis) {
		this.dtBis = dtBis;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_BEARB", nullable = false)
	public Date getDtBearb() {
		return this.dtBearb;
	}

	public void setDtBearb(Date dtBearb) {
		this.dtBearb = dtBearb;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "DT_LOESCH", nullable = false)
	public Date getDtLoesch() {
		return this.dtLoesch;
	}

	public void setDtLoesch(Date dtLoesch) {
		this.dtLoesch = dtLoesch;
	}

	@Column(name = "STRASSE", length = 50)
	public String getStrasse() {
		return this.strasse;
	}

	public void setStrasse(String strasse) {
		this.strasse = strasse;
	}

	@Column(name = "PLZ", length = 50)
	public String getPlz() {
		return this.plz;
	}

	public void setPlz(String plz) {
		this.plz = plz;
	}

	@Column(name = "ORT", length = 50)
	public String getOrt() {
		return this.ort;
	}

	public void setOrt(String ort) {
		this.ort = ort;
	}

	@Column(name = "HAUSNUMMER", length = 50)
	public String getHausnummer() {
		return this.hausnummer;
	}

	public void setHausnummer(String hausnummer) {
		this.hausnummer = hausnummer;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "testAdresse")
	public Set<TestPerson> getTestPersons() {
		return this.testPersons;
	}

	public void setTestPersons(Set<TestPerson> testPersons) {
		this.testPersons = testPersons;
	}

}


text:
package turtle.draw;

import turtle.Turtle;
import javafx.animation.Interpolator;
import javafx.animation.Transition;

/**
 * abstract superclass for all animations
 * @author Jonathan Tseng
 *
 */
public abstract class SLogoTransition extends Transition {

	protected Turtle myTurtle;

	protected SLogoTransition() {
		setCycleCount(1);
		setInterpolator(Interpolator.LINEAR);
	}

	public void setTurtle(Turtle turtle) {
		myTurtle = turtle;
	}

}


text:
using System;
using System.Collections.Generic;
using Microsoft.OData.Edm.Csdl.Parsing.Ast;
using Microsoft.OData.Edm.Expressions;

namespace Microsoft.OData.Edm.Csdl.CsdlSemantics
{
    /// <summary>
    /// Provides semantics for a Csdl Path expression.
    /// </summary>
    internal class CsdlSemanticsPathExpression : CsdlSemanticsExpression, IEdmPathExpression
    {
        protected readonly CsdlPathExpression Expression;

        protected readonly IEdmEntityType BindingContext;

        protected readonly Cache<CsdlSemanticsPathExpression, IEnumerable<string>> PathCache = new Cache<CsdlSemanticsPathExpression, IEnumerable<string>>();

        protected static readonly Func<CsdlSemanticsPathExpression, IEnumerable<string>> ComputePathFunc = (me) => me.ComputePath();

        public CsdlSemanticsPathExpression(CsdlPathExpression expression, IEdmEntityType bindingContext, CsdlSemanticsSchema schema)
            : base(schema, expression)
        {
            this.Expression = expression;
            this.BindingContext = bindingContext;
        }

        public override CsdlElement Element
        {
            get { return this.Expression; }
        }

        public override EdmExpressionKind ExpressionKind
        {
            get { return EdmExpressionKind.Path; }
        }

        public IEnumerable<string> Path
        {
            get { return this.PathCache.GetValue(this, ComputePathFunc, null); }
        }

        private IEnumerable<string> ComputePath()
        {
            return this.Expression.Path.Split(new char[] { '/' }, StringSplitOptions.None);
        }
    }
}


text:
package jetbrains.exodus.core.dataStructures.hash;

import org.junit.Assert;
import org.junit.Test;

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

public class LongLinkedHashMapTest {

    @Test
    public void testPutGet() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 1000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(1000, tested.size());
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i), tested.get(i));
        }
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i), tested.put(i, Long.toString(i + 1)));
        }
        Assert.assertEquals(1000, tested.size());
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i + 1), tested.get(i));
        }
    }

    @Test
    public void testPutGet2() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 1000; ++i) {
            tested.put(i - 500, Long.toString(i));
        }
        Assert.assertEquals(1000, tested.size());
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i), tested.get(i - 500));
        }
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i), tested.put(i - 500, Long.toString(i + 1)));
        }
        Assert.assertEquals(1000, tested.size());
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i + 1), tested.get(i - 500));
        }
    }

    @Test
    public void testPutGetRemove() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 1000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(1000, tested.size());
        for (long i = 0; i < 1000; i += 2) {
            Assert.assertEquals(Long.toString(i), tested.remove(i));
        }
        Assert.assertEquals(500, tested.size());
        for (long i = 0; i < 1000; ++i) {
            Assert.assertEquals((i % 2 == 0) ? null : Long.toString(i), tested.get(i));
        }
    }

    @Test
    public void keySet() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 10000; ++i) {
            tested.put(i, Long.toString(i));
        }
        long i = 10000;
        for (Long key : tested.keySet()) {
            Assert.assertEquals(--i, key.longValue());
        }
    }

    @Test
    public void keySet2() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 10000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Iterator<Long> it = tested.keySet().iterator();
        while (it.hasNext()) {
            final long i = it.next();
            if (i % 2 == 0) {
                it.remove();
            }
        }

        Assert.assertEquals(5000, tested.size());

        it = tested.keySet().iterator();
        for (long i = 9999; i > 0; i -= 2) {
            Assert.assertTrue(it.hasNext());
            Assert.assertEquals(i, it.next().longValue());
        }
    }

    @Test
    public void lru() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<String>() {
            @Override
            protected boolean removeEldestEntry(Map.Entry<Long, String> eldest) {
                return size() > 500;
            }
        };
        for (long i = 0; i < 1000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(500, tested.size());
        for (long i = 0; i < 500; ++i) {
            Assert.assertNull(tested.remove(i));
        }
        Assert.assertEquals(500, tested.size());
        for (long i = 500; i < 1000; ++i) {
            Assert.assertEquals(Long.toString(i), tested.remove(i));
        }
        Assert.assertEquals(0, tested.size());
    }

    @Test
    public void lru2() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<String>() {
            @Override
            protected boolean removeEldestEntry(Map.Entry<Long, String> eldest) {
                return size() > 1000;
            }
        };
        for (long i = 0; i < 1000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(Long.toString(0), tested.get(0));
        for (long i = 1000; i < 1999; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(Long.toString(0), tested.get(0));
        tested.put(2000, Long.toString(2000));
        Assert.assertNull(tested.get(1000));
    }

    @Test
    public void lru3() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<String>() {
            @Override
            protected boolean removeEldestEntry(Map.Entry<Long, String> eldest) {
                return size() > 1000;
            }
        };
        for (long i = 0; i < 1000; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(Long.toString(999), tested.remove(999));
        Assert.assertEquals(999, tested.size());
        Assert.assertEquals(Long.toString(0), tested.get(0));
        for (long i = 1000; i < 1999; ++i) {
            tested.put(i, Long.toString(i));
        }
        Assert.assertEquals(Long.toString(0), tested.get(0));
        tested.put(2000, Long.toString(2000));
        Assert.assertNull(tested.get(1000));
    }

    @Test
    public void forEachProcedure() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 100000; ++i) {
            tested.put(i, Long.toString(i));
        }
        final int[] ii = {0};
        tested.forEachKey(new ObjectProcedure<Long>() {
            @Override
            public boolean execute(Long object) {
                ii[0]++;
                return true;
            }
        });
        tested.forEachValue(new ObjectProcedure<String>() {
            @Override
            public boolean execute(String object) {
                ii[0]++;
                return true;
            }
        });
        Assert.assertEquals(tested.size() * 2, ii[0]);
        ii[0] = 0;
        tested.forEachKey(new ObjectProcedure<Long>() {
            @Override
            public boolean execute(Long object) {
                ii[0]++;
                return object > 99500;
            }
        });
        tested.forEachValue(new ObjectProcedure<String>() {
            @Override
            public boolean execute(String object) {
                ii[0]++;
                return true;
            }
        });
        Assert.assertEquals(tested.size() + 500, ii[0]);
    }
}


text:
require 'spec_helper_acceptance'

describe 'firewall isfragment property' do
  before :all do
    iptables_flush_all_tables
  end

  shared_examples "is idempotent" do |value, line_match|
    it "changes the value to #{value}" do
      pp = <<-EOS
          class { '::firewall': }
          firewall { '597 - test':
            ensure => present,
            proto  => 'tcp',
            #{value}
          }
      EOS

      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes => true)

      shell('iptables -S') do |r|
        expect(r.stdout).to match(/#{line_match}/)
      end
    end
  end
  shared_examples "doesn't change" do |value, line_match|
    it "doesn't change the value to #{value}" do
      pp = <<-EOS
          class { '::firewall': }
          firewall { '597 - test':
            ensure => present,
            proto  => 'tcp',
            #{value}
          }
      EOS

      apply_manifest(pp, :catch_changes => true)

      shell('iptables -S') do |r|
        expect(r.stdout).to match(/#{line_match}/)
      end
    end
  end

  describe 'adding a rule' do
    context 'when unset' do
      before :all do
        iptables_flush_all_tables
      end
      it_behaves_like 'is idempotent', '', /-A INPUT -p tcp -m comment --comment "597 - test"/
    end
    context 'when set to true' do
      before :all do
        iptables_flush_all_tables
      end
      it_behaves_like 'is idempotent', 'isfragment => true,', /-A INPUT -p tcp -f -m comment --comment "597 - test"/
    end
    context 'when set to false' do
      before :all do
        iptables_flush_all_tables
      end
      it_behaves_like "is idempotent", 'isfragment => false,', /-A INPUT -p tcp -m comment --comment "597 - test"/
    end
  end
  describe 'editing a rule' do
    context 'when unset or false' do
      before :each do
        iptables_flush_all_tables
        shell('/sbin/iptables -A INPUT -p tcp -m comment --comment "597 - test"')
      end
      context 'and current value is false' do
        it_behaves_like "doesn't change", 'isfragment => false,', /-A INPUT -p tcp -m comment --comment "597 - test"/
      end
      context 'and current value is true' do
        it_behaves_like "is idempotent", 'isfragment => true,', /-A INPUT -p tcp -f -m comment --comment "597 - test"/
      end
    end
    context 'when set to true' do
      before :each do
        iptables_flush_all_tables
        shell('/sbin/iptables -A INPUT -p tcp -f -m comment --comment "597 - test"')
      end
      context 'and current value is false' do
        it_behaves_like "is idempotent", 'isfragment => false,', /-A INPUT -p tcp -m comment --comment "597 - test"/
      end
      context 'and current value is true' do
        it_behaves_like "doesn't change", 'isfragment => true,', /-A INPUT -p tcp -f -m comment --comment "597 - test"/
      end
    end
  end
end


text:
#region License
//    Copyright 2012 Julien Lebosquain
//
//    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.
#endregion
using GammaJul.ReSharper.ForTea.Psi;
using JetBrains.Application.Settings;
using JetBrains.ReSharper.Daemon.CSharp.Stages;
using JetBrains.ReSharper.Daemon.Stages;
using JetBrains.ReSharper.Daemon.UsageChecking;
using JetBrains.ReSharper.Feature.Services.CSharp.Daemon;
using JetBrains.ReSharper.Psi;
using JetBrains.ReSharper.Psi.CSharp.Tree;
using JetBrains.ReSharper.Feature.Services.Daemon;

namespace GammaJul.ReSharper.ForTea.Daemon {

	// GlobalFileStructureCollectorStage is required before this stage (otherwise there will be an exception in CSharpIncrementalDaemonStageProcessBase).
	// CollectUsagesStage must come after this stage if we want the highlightings to appear as fast as possible.
	[DaemonStage(
		StagesBefore = new[] { typeof(GlobalFileStructureCollectorStage) },
		StagesAfter = new[] { typeof(CollectUsagesStage), typeof(IdentifierHighlightingStage) })]
	public class T4CSharpHighlightingStage : CSharpDaemonStageBase {

		protected override bool IsSupported(IPsiSourceFile sourceFile) {
			return base.IsSupported(sourceFile) && sourceFile.IsLanguageSupported<T4Language>();
		}

		protected override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind, ICSharpFile file) {
			return new T4CSharpHighlightingProcess(process, settings, file);
		}

	}

}