text:
package com.microsoft.azure.management.network.v2018_06_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.Resource;
import com.microsoft.azure.arm.resources.models.GroupableResourceCore;
import com.microsoft.azure.arm.resources.models.HasResourceGroup;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.model.Creatable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.network.v2018_06_01.implementation.NetworkManager;
import java.util.List;
import com.microsoft.azure.SubResource;
import com.microsoft.azure.management.network.v2018_06_01.implementation.SubnetInner;
import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkPeeringInner;
import com.microsoft.azure.management.network.v2018_06_01.implementation.VirtualNetworkInner;

/**
 * Type representing VirtualNetwork.
 */
public interface VirtualNetwork extends HasInner<VirtualNetworkInner>, Resource, GroupableResourceCore<NetworkManager, VirtualNetworkInner>, HasResourceGroup, Refreshable<VirtualNetwork>, Updatable<VirtualNetwork.Update>, HasManager<NetworkManager> {
    /**
     * @return the addressSpace value.
     */
    AddressSpace addressSpace();

    /**
     * @return the ddosProtectionPlan value.
     */
    SubResource ddosProtectionPlan();

    /**
     * @return the dhcpOptions value.
     */
    DhcpOptions dhcpOptions();

    /**
     * @return the enableDdosProtection value.
     */
    Boolean enableDdosProtection();

    /**
     * @return the enableVmProtection value.
     */
    Boolean enableVmProtection();

    /**
     * @return the etag value.
     */
    String etag();

    /**
     * @return the provisioningState value.
     */
    String provisioningState();

    /**
     * @return the resourceGuid value.
     */
    String resourceGuid();

    /**
     * @return the subnets value.
     */
    List<Subnet> subnets();

    /**
     * @return the virtualNetworkPeerings value.
     */
    List<VirtualNetworkPeering> virtualNetworkPeerings();

    /**
     * The entirety of the VirtualNetwork definition.
     */
    interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate {
    }

    /**
     * Grouping of VirtualNetwork definition stages.
     */
    interface DefinitionStages {
        /**
         * The first stage of a VirtualNetwork definition.
         */
        interface Blank extends GroupableResourceCore.DefinitionWithRegion<WithGroup> {
        }

        /**
         * The stage of the VirtualNetwork definition allowing to specify the resource group.
         */
        interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup<WithCreate> {
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify AddressSpace.
         */
        interface WithAddressSpace {
            /**
             * Specifies addressSpace.
             * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets
             * @return the next definition stage
             */
            WithCreate withAddressSpace(AddressSpace addressSpace);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify DdosProtectionPlan.
         */
        interface WithDdosProtectionPlan {
            /**
             * Specifies ddosProtectionPlan.
             * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network
             * @return the next definition stage
             */
            WithCreate withDdosProtectionPlan(SubResource ddosProtectionPlan);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify DhcpOptions.
         */
        interface WithDhcpOptions {
            /**
             * Specifies dhcpOptions.
             * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network
             * @return the next definition stage
             */
            WithCreate withDhcpOptions(DhcpOptions dhcpOptions);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify EnableDdosProtection.
         */
        interface WithEnableDdosProtection {
            /**
             * Specifies enableDdosProtection.
             * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource
             * @return the next definition stage
             */
            WithCreate withEnableDdosProtection(Boolean enableDdosProtection);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify EnableVmProtection.
         */
        interface WithEnableVmProtection {
            /**
             * Specifies enableVmProtection.
             * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network
             * @return the next definition stage
             */
            WithCreate withEnableVmProtection(Boolean enableVmProtection);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify Etag.
         */
        interface WithEtag {
            /**
             * Specifies etag.
             * @param etag Gets a unique read-only string that changes whenever the resource is updated
             * @return the next definition stage
             */
            WithCreate withEtag(String etag);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify ProvisioningState.
         */
        interface WithProvisioningState {
            /**
             * Specifies provisioningState.
             * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'
             * @return the next definition stage
             */
            WithCreate withProvisioningState(String provisioningState);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify ResourceGuid.
         */
        interface WithResourceGuid {
            /**
             * Specifies resourceGuid.
             * @param resourceGuid The resourceGuid property of the Virtual Network resource
             * @return the next definition stage
             */
            WithCreate withResourceGuid(String resourceGuid);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify Subnets.
         */
        interface WithSubnets {
            /**
             * Specifies subnets.
             * @param subnets A list of subnets in a Virtual Network
             * @return the next definition stage
             */
            WithCreate withSubnets(List<SubnetInner> subnets);
        }

        /**
         * The stage of the virtualnetwork definition allowing to specify VirtualNetworkPeerings.
         */
        interface WithVirtualNetworkPeerings {
            /**
             * Specifies virtualNetworkPeerings.
             * @param virtualNetworkPeerings A list of peerings in a Virtual Network
             * @return the next definition stage
             */
            WithCreate withVirtualNetworkPeerings(List<VirtualNetworkPeeringInner> virtualNetworkPeerings);
        }

        /**
         * The stage of the definition which contains all the minimum required inputs for
         * the resource to be created (via {@link WithCreate#create()}), but also allows
         * for any other optional settings to be specified.
         */
        interface WithCreate extends Creatable<VirtualNetwork>, Resource.DefinitionWithTags<WithCreate>, DefinitionStages.WithAddressSpace, DefinitionStages.WithDdosProtectionPlan, DefinitionStages.WithDhcpOptions, DefinitionStages.WithEnableDdosProtection, DefinitionStages.WithEnableVmProtection, DefinitionStages.WithEtag, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceGuid, DefinitionStages.WithSubnets, DefinitionStages.WithVirtualNetworkPeerings {
        }
    }
    /**
     * The template for a VirtualNetwork update operation, containing all the settings that can be modified.
     */
    interface Update extends Appliable<VirtualNetwork>, Resource.UpdateWithTags<Update>, UpdateStages.WithAddressSpace, UpdateStages.WithDdosProtectionPlan, UpdateStages.WithDhcpOptions, UpdateStages.WithEnableDdosProtection, UpdateStages.WithEnableVmProtection, UpdateStages.WithEtag, UpdateStages.WithProvisioningState, UpdateStages.WithResourceGuid, UpdateStages.WithSubnets, UpdateStages.WithVirtualNetworkPeerings {
    }

    /**
     * Grouping of VirtualNetwork update stages.
     */
    interface UpdateStages {
        /**
         * The stage of the virtualnetwork update allowing to specify AddressSpace.
         */
        interface WithAddressSpace {
            /**
             * Specifies addressSpace.
             * @param addressSpace The AddressSpace that contains an array of IP address ranges that can be used by subnets
             * @return the next update stage
             */
            Update withAddressSpace(AddressSpace addressSpace);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify DdosProtectionPlan.
         */
        interface WithDdosProtectionPlan {
            /**
             * Specifies ddosProtectionPlan.
             * @param ddosProtectionPlan The DDoS protection plan associated with the virtual network
             * @return the next update stage
             */
            Update withDdosProtectionPlan(SubResource ddosProtectionPlan);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify DhcpOptions.
         */
        interface WithDhcpOptions {
            /**
             * Specifies dhcpOptions.
             * @param dhcpOptions The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network
             * @return the next update stage
             */
            Update withDhcpOptions(DhcpOptions dhcpOptions);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify EnableDdosProtection.
         */
        interface WithEnableDdosProtection {
            /**
             * Specifies enableDdosProtection.
             * @param enableDdosProtection Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource
             * @return the next update stage
             */
            Update withEnableDdosProtection(Boolean enableDdosProtection);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify EnableVmProtection.
         */
        interface WithEnableVmProtection {
            /**
             * Specifies enableVmProtection.
             * @param enableVmProtection Indicates if VM protection is enabled for all the subnets in the virtual network
             * @return the next update stage
             */
            Update withEnableVmProtection(Boolean enableVmProtection);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify Etag.
         */
        interface WithEtag {
            /**
             * Specifies etag.
             * @param etag Gets a unique read-only string that changes whenever the resource is updated
             * @return the next update stage
             */
            Update withEtag(String etag);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify ProvisioningState.
         */
        interface WithProvisioningState {
            /**
             * Specifies provisioningState.
             * @param provisioningState The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'
             * @return the next update stage
             */
            Update withProvisioningState(String provisioningState);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify ResourceGuid.
         */
        interface WithResourceGuid {
            /**
             * Specifies resourceGuid.
             * @param resourceGuid The resourceGuid property of the Virtual Network resource
             * @return the next update stage
             */
            Update withResourceGuid(String resourceGuid);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify Subnets.
         */
        interface WithSubnets {
            /**
             * Specifies subnets.
             * @param subnets A list of subnets in a Virtual Network
             * @return the next update stage
             */
            Update withSubnets(List<SubnetInner> subnets);
        }

        /**
         * The stage of the virtualnetwork update allowing to specify VirtualNetworkPeerings.
         */
        interface WithVirtualNetworkPeerings {
            /**
             * Specifies virtualNetworkPeerings.
             * @param virtualNetworkPeerings A list of peerings in a Virtual Network
             * @return the next update stage
             */
            Update withVirtualNetworkPeerings(List<VirtualNetworkPeeringInner> virtualNetworkPeerings);
        }

    }
}


text:
__author__ = 'lposti'

import pstats
import cProfile
from fJmodel.fJmodel import FJmodel

f = FJmodel('fJmodel/examples/Hernq_ngc6125_dp0.5-1.0_dz0.5-1.0_c0.1_4.out')

cProfile.runctx("f.project(0.)", globals(), locals(), "profile.prof")

s = pstats.Stats("profile.prof")
s.strip_dirs().sort_stats("time").print_stats()

redpajama_set_name: RedPajamaGithub


text:
package org.apache.asterix.transaction.management.service.transaction;

import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.logging.Logger;

import org.apache.asterix.common.config.AsterixReplicationProperties;
import org.apache.asterix.common.config.AsterixTransactionProperties;
import org.apache.asterix.common.config.IAsterixPropertiesProvider;
import org.apache.asterix.common.exceptions.ACIDException;
import org.apache.asterix.common.transactions.IAsterixAppRuntimeContextProvider;
import org.apache.asterix.common.transactions.ILockManager;
import org.apache.asterix.common.transactions.ILogManager;
import org.apache.asterix.common.transactions.IRecoveryManager;
import org.apache.asterix.common.transactions.ITransactionManager;
import org.apache.asterix.common.transactions.ITransactionSubsystem;
import org.apache.asterix.transaction.management.service.locking.ConcurrentLockManager;
import org.apache.asterix.transaction.management.service.logging.LogManager;
import org.apache.asterix.transaction.management.service.logging.LogManagerWithReplication;
import org.apache.asterix.transaction.management.service.recovery.CheckpointThread;
import org.apache.asterix.transaction.management.service.recovery.RecoveryManager;

/**
 * Provider for all the sub-systems (transaction/lock/log/recovery) managers.
 * Users of transaction sub-systems must obtain them from the provider.
 */
public class TransactionSubsystem implements ITransactionSubsystem {
    private final String id;
    private final ILogManager logManager;
    private final ILockManager lockManager;
    private final ITransactionManager transactionManager;
    private final IRecoveryManager recoveryManager;
    private final IAsterixAppRuntimeContextProvider asterixAppRuntimeContextProvider;
    private final CheckpointThread checkpointThread;
    private final AsterixTransactionProperties txnProperties;

    //for profiling purpose
    public static final boolean IS_PROFILE_MODE = false;//true
    public long profilerEntityCommitLogCount = 0;
    private EntityCommitProfiler ecp;
    private Future<Object> fecp;

    public TransactionSubsystem(String id, IAsterixAppRuntimeContextProvider asterixAppRuntimeContextProvider,
            AsterixTransactionProperties txnProperties) throws ACIDException {
        this.asterixAppRuntimeContextProvider = asterixAppRuntimeContextProvider;
        this.id = id;
        this.txnProperties = txnProperties;
        this.transactionManager = new TransactionManager(this);
        this.lockManager = new ConcurrentLockManager(txnProperties.getLockManagerShrinkTimer());

        AsterixReplicationProperties asterixReplicationProperties = null;
        if (asterixAppRuntimeContextProvider != null) {
            asterixReplicationProperties = ((IAsterixPropertiesProvider) asterixAppRuntimeContextProvider
                    .getAppContext()).getReplicationProperties();
        }

        if (asterixReplicationProperties != null && asterixReplicationProperties.isReplicationEnabled()) {
            this.logManager = new LogManagerWithReplication(this);
        } else {
            this.logManager = new LogManager(this);
        }

        this.recoveryManager = new RecoveryManager(this);

        if (asterixAppRuntimeContextProvider != null) {
            this.checkpointThread = new CheckpointThread(recoveryManager,
                    asterixAppRuntimeContextProvider.getDatasetLifecycleManager(), logManager,
                    this.txnProperties.getCheckpointLSNThreshold(), this.txnProperties.getCheckpointPollFrequency());
            this.checkpointThread.start();
        } else {
            this.checkpointThread = null;
        }

        if (IS_PROFILE_MODE) {
            ecp = new EntityCommitProfiler(this, this.txnProperties.getCommitProfilerReportInterval());
            fecp = (Future<Object>) getAsterixAppRuntimeContextProvider().getThreadExecutor().submit(ecp);
        }
    }

    public ILogManager getLogManager() {
        return logManager;
    }

    public ILockManager getLockManager() {
        return lockManager;
    }

    public ITransactionManager getTransactionManager() {
        return transactionManager;
    }

    public IRecoveryManager getRecoveryManager() {
        return recoveryManager;
    }

    public IAsterixAppRuntimeContextProvider getAsterixAppRuntimeContextProvider() {
        return asterixAppRuntimeContextProvider;
    }

    public AsterixTransactionProperties getTransactionProperties() {
        return txnProperties;
    }

    public String getId() {
        return id;
    }

    public void incrementEntityCommitCount() {
        ++profilerEntityCommitLogCount;
    }

    /**
     * Thread for profiling entity level commit count
     * This thread takes a report interval (in seconds) parameter and
     * reports entity level commit count every report interval (in seconds)
     * only if IS_PROFILE_MODE is set to true.
     * However, the thread doesn't start reporting the count until the entityCommitCount > 0.
     */
    static class EntityCommitProfiler implements Callable<Boolean> {
        private static final Logger LOGGER = Logger.getLogger(EntityCommitProfiler.class.getName());
        private final long reportIntervalInMillisec;
        private long lastEntityCommitCount;
        private int reportIntervalInSeconds;
        private TransactionSubsystem txnSubsystem;
        private boolean firstReport = true;
        private long startTimeStamp = 0;
        private long reportRound = 1;

        public EntityCommitProfiler(TransactionSubsystem txnSubsystem, int reportIntervalInSeconds) {
            Thread.currentThread().setName("EntityCommitProfiler-Thread");
            this.txnSubsystem = txnSubsystem;
            this.reportIntervalInSeconds = reportIntervalInSeconds;
            this.reportIntervalInMillisec = reportIntervalInSeconds * 1000;
            lastEntityCommitCount = txnSubsystem.profilerEntityCommitLogCount;
        }

        @Override
        public Boolean call() throws Exception {
            while (true) {
                Thread.sleep(reportIntervalInMillisec);
                if (txnSubsystem.profilerEntityCommitLogCount > 0) {
                    if (firstReport) {
                        startTimeStamp = System.currentTimeMillis();
                        firstReport = false;
                    }
                    //output the count
                    outputCount();
                }
            }
        }

        private void outputCount() {
            long currentTimeStamp = System.currentTimeMillis();
            long currentEntityCommitCount = txnSubsystem.profilerEntityCommitLogCount;

            LOGGER.severe("EntityCommitProfiler ReportRound[" + reportRound + "], AbsoluteTimeStamp[" + currentTimeStamp
                    + "], ActualRelativeTimeStamp[" + (currentTimeStamp - startTimeStamp)
                    + "], ExpectedRelativeTimeStamp[" + (reportIntervalInSeconds * reportRound) + "], IIPS["
                    + ((currentEntityCommitCount - lastEntityCommitCount) / reportIntervalInSeconds) + "], IPS["
                    + (currentEntityCommitCount / (reportRound * reportIntervalInSeconds)) + "]");

            lastEntityCommitCount = currentEntityCommitCount;
            ++reportRound;
        }
    }

}


text:
package com.after_sunrise.commons.base.reference;

import java.lang.ref.PhantomReference;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;

/**
 * @author takanori.takase
 */
public interface ReferenceCollector extends Runnable {

	<T> SoftReference<T> collectSoft(T target, Runnable runnable);

	<T> WeakReference<T> collectWeak(T target, Runnable runnable);

	<T> PhantomReference<T> collectPhantom(T target, Runnable runnable);

}


text:
import { assert } from "chai";
import { } from 'mocha';
import Vue from 'vue';
import { dispatchEvent } from './helper';
import { DropDownSelect } from '../../src/ui/app/components/drop-down/drop-down'; // uses webpack alias to resolve when compiling
import { KeyValue } from '../../src/ui/app/model';

const borg: KeyValue = { key: 'borg', value: 'BORG' };
const klingon: KeyValue = { key: 'klingon', value: 'KLINGON' };
const romulan: KeyValue = { key: 'romulan', value: 'ROMULAN' };

Vue.config.productionTip = false;

describe("Component@DropDown", () => {

    function setup(items?: string[], availableItems?: KeyValue[] | {}) {

        let propsData = {
            items: availableItems || [{ key: '', value: null }, borg, klingon, romulan],
            multiple: true,
            value: items || []
        };

        const ctor = Vue.extend(DropDownSelect);
        return new ctor({ propsData: propsData });

    };

    it("creates options from array", () => {
        const vm = setup(null, [borg, klingon]).$mount();

        const target = <HTMLSelectElement>vm.$el;

        assert.equal(target.options.length, 2, vm.$el.outerHTML);
    });

    it("creates options from object", () => {

        let availableItems = {
            borg: 'borg',
            klingon: 'klingon',
            ferengi: 'ferengi',
            romulan: 'romulan'
        };

        const vm = setup(null, availableItems).$mount();

        const target = <HTMLSelectElement>vm.$el;

        assert.equal(target.options.length, 4, target.outerHTML);
    });

    it("sets selected item on mount", () => {

        const vm = setup([klingon.key], null).$mount();

        const target = <HTMLSelectElement>vm.$el;

        assert.equal(target.selectedOptions.length, 1, target.outerHTML);
    });

    it("sets multiple selected items on mount", () => {

        const vm = setup([klingon.key, romulan.key], null).$mount();

        const target = <HTMLSelectElement>vm.$el;

        assert.equal(target.selectedOptions.length, 2, target.outerHTML);
    });

    it("emits 'input' event after selected item changes", (done) => {

        let onInput = (newValue, oldValue) => {
            assert.equal(newValue, romulan.key, newValue);
            done();
        };

        const vm = setup(null, null).$mount();
        vm.$on('input', onInput);

        const target = <HTMLSelectElement>vm.$el;
        target.options[3].selected = true;

        dispatchEvent(target, 'change');
    });
});


text:
<?php

namespace Wn\Model3DBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class WnModel3DBundle extends Bundle
{
}


text:
<?php
/*
Template Name: People Template
*/

get_header();

  while ( have_posts() ) {
    the_post();
    get_template_part( 'content', 'people' );

   } // end of the loop

get_footer();


text:
import React, {PropTypes, Component} from 'react';
import Color from '~/src/tools/Color';

export default class Line extends Component {
    static propTypes = {
        points: PropTypes.array.isRequired,
        color: PropTypes.instanceOf(Color).isRequired,
        width: PropTypes.number.isRequired
    }

    render() {
        const {points, color, width} = this.props;

        return (<line
            x1={points[0][0]}
            y1={points[0][1]}
            x2={points[1][0]}
            y2={points[1][1]}
            style={{
            'stroke': color.toHTML(),
            'strokeWidth': width
        }}/>);
    }
}


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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.p_natarajan.wifipoc.LandingPage">
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/root"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <!--android:background="@color/guillotine_background_dark"-->

        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/guillotine_actionbar_background_view_height"
            android:layout_gravity="top" />
        <!--android:background="@color/guillotine_background"-->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                style="@style/Toolbar"
                app:contentInsetStart="0dp">

                <ImageView
                    android:id="@+id/content_hamburger"
                    style="@style/ImageView.Hamburger"
                    android:src="@drawable/ic_menu_90" />

                <com.example.p_natarajan.widget.CanaroTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:text="INTERROBANG"
                    android:textSize="@dimen/guillotine_item_text_size" />
            </android.support.v7.widget.Toolbar>

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

    <ImageView
        android:id="@+id/background"
        android:layout_width="1080px"
        android:layout_height="1920px"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:src="@mipmap/grid2"
        android:layout_margin="0px"
        android:padding="0px"
        />
    <ImageView
        android:id="@+id/senderLocation"
        android:layout_width="60px"
        android:layout_height="60px"
        android:src="@mipmap/location"
        android:layout_margin="0px"
        android:padding="0px"
        />
    </RelativeLayout>
    </LinearLayout>
    </FrameLayout>
</RelativeLayout>


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

	<title>Alcohol and Substance Abuse</title>

	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<meta name="keywords" content="Alcohol and Substance Abuse" />

	<link rel="stylesheet" href="http://cdn.firespring.com/cache/core.1381239597.css" type="text/css" charset="UTF-8" />
	<link rel="stylesheet" href="http://cdn.firespring.com/designs/pacific/css/stylesheet.css" type="text/css" charset="UTF-8" />
	<link rel="stylesheet" href="http://cdn.firespring.com/designs/pacific/subdesigns/3320/css/stylesheet.css" type="text/css" charset="UTF-8" />

Contact Us

Search Our Site

formerly Youth and Family Enrichment Services

Home

Who We Are

What We Do

What You Can Do

What's New

Work With Us

Client Successes

Contact Us

In This Section

Alcohol & Substance Abuse

Archway

Children's Place Program

First Chance

Insights

Women's Enrichment Center

StarVista works with you to help create your own success story. We offer the resources, the guidance, and the inspiration that you need to create a healthier, stronger, and more hopeful life. For information on how we create positive and long-lasting changes for adults facing drug and substance abuse issues – and their families -- please select from the links on the left.

				Copyright © 2013

				Privacy Policy

			StarVista

			610 Elm Street, Suite 212			• San Carlos, CA 94070

			Phone (650) 591-9623
info@star-vista.org


text:
@implementation MLFlowLayout

#pragma mark Init

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        [self finishInitialize];
    }

    return self;
}

- (instancetype)init {
    if (self = [super init]) {
        [self finishInitialize];
    }

    return self;
}

- (void)finishInitialize {
    self.scrollDirection = UICollectionViewScrollDirectionVertical;
    self.minimumInteritemSpacing = 20.0f;
    self.minimumLineSpacing = 20.0f;
    self.itemSize = CGSizeMake(200.0f, 200.0f);
    self.sectionInset = UIEdgeInsetsMake(20.0f, 20.0f, 20.0f, 20.0f);
}

@end


text:
GameOverScript::GameOverScript(GameObject *owner) : Script(owner) {}
void GameOverScript::Start() {

  CreateAnimations();
  position = GetOwner()->GetPosition();
  animator = (Animator *)GetOwner()->GetComponent("Animator");
  input = InputSystem::GetInstance();
 GetOwner()->SetZoomProportion(Vector(0,0));

}
void GameOverScript::CreateAnimations(){

    auto snowImage = new Image("assets/Ending_PARTE_FINAL.png",0,0,4096, 2048);

    auto gameOverAnimation= new Animation(GetOwner(),snowImage );
    for (int i = 0; i <22; i++){

        for(int j=0 ; j <12 ; j++){

              gameOverAnimation->AddFrame(new Frame(j * 341,i* 256, 341, 256));
                gameOverAnimation->AddFrame(new Frame(j * 341,i* 256, 341, 256));

        }
    }

     // animator
      auto gameOverAnimator = new Animator(GetOwner());
      gameOverAnimator->AddAnimation("snowAnimation", gameOverAnimation);

}

void GameOverScript::ComponentUpdate() {
    animator->PlayAnimation("snowAnimation");
 if(play==1)
     animator->PlayAnimation("snowAnimation");

    if(input->GetKeyDown(INPUT_T) && play==0){
   // animator->StopAllAnimations();
      AudioController::GetInstance()->PlayAudio("snowSound", -1);
    play=1;
    }
    else if(input->GetKeyDown(INPUT_T) && play==1){
    play=0;
    AudioController::GetInstance()->StopAudio("snowSound");
    animator->StopAllAnimations();
    }

}
void GameOverScript::FixedComponentUpdate() {

  position->m_x=0;
  position->m_y=0;

}


text:
<?php

namespace JsonWorks\Tests\Document;

class CopyValueTest extends \JsonWorks\Tests\Base
{
    public function testSuccess()
    {
        $schema = null;
        $data = '{
                "prop1":
                {
                    "collection":
                    [
                        {"firstName": "Fred", "lastName": "Bloggs"},
                        {"firstName": "Harry", "lastName": "Smith"}
                    ]
                }
        }';

        $expected = '{
                "prop1":
                {
                    "collection":
                    [
                        {"firstName": "Fred", "lastName": "Bloggs"},
                        {"firstName": "Harry", "lastName": "Smith"}
                    ]
                },
                "prop2":
                {
                    "collection":
                    [
                        {"firstName": "Harry", "lastName": "Smith"}
                    ]
                 }
        }';

        $document = $this->getDocument($schema, $data);

        $fromPath = '/prop1/collection/1';
        $toPath = '/prop2/collection/-';
        $this->assertTrue($document->copyValue($fromPath, $toPath), 'Testing success');
        $this->assertEquals(json_decode($expected), $document->data);

        $fromPath = '/prop1/collection/2';
        $this->assertFalse($document->copyValue($fromPath, $toPath), 'Testing fail');
    }

    public function testFailSchema()
    {
        $schema = '{
            "properties": {
                "prop1": {}
            },
            "additionalProperties": false
        }';

        $data = '{
                "prop1":
                {
                    "collection":
                    [
                        {"firstName": "Fred", "lastName": "Bloggs"},
                        {"firstName": "Harry", "lastName": "Smith"}
                    ]
                }
        }';

        $document = $this->getDocument($schema, $data);

        $fromPath = '/prop1/collection/1';
        $toPath = '/prop2/collection/-';
        $this->assertFalse($document->copyValue($fromPath, $toPath), 'Testing fail');
    }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeFighter.Data
{
    public class ShipHullData
    {
        [Key]
        public int Id { get; set; }
        public string ClassName { get; set; }
        public string HullSize { get; set; }
        public int MaxHitPoints { get; set; }

        //public ICollection<ShipData> ShipData { get; set; }
        public ICollection<ShipHullPartCountData> PartCounts { get; set; }
    }
}


text:
"""
This script is aimed at getting the list of running PyCOMPSs jobs
with Jupyter notebook.
"""

import os
from commons import VERBOSE
from commons import SUCCESS_KEYWORD
from commons import ERROR_KEYWORD
from commons import command_runner
from commons import setup_supercomputer_configuration
from commons import get_job_name
from commons import get_job_status
from commons import verify_job_name

def find():
    """
    Main find function.
    Gets the jobs list command from the environment variable (defined in supercomputer cfgs)
    and runs it. It also gets each job identifier name and status to provide more information
    to the users.
    :return: None
    """
    if VERBOSE:
        print("Looking for PyCOMPSs interactive jobs...")

    # Load the Supercomputer configuration to get the appropriate status command
    setup_supercomputer_configuration()

    # Get the list of running job ids
    job_list_command = os.environ['QUEUE_JOB_LIST_CMD']
    return_code, raw_job_ids, _ = command_runner(job_list_command.split())
    job_ids = raw_job_ids.splitlines()

    # Filter the jobs (keep only the notebook related ones)
    notebook_jobs = []
    for job_id in job_ids:
        name = get_job_name(job_id).strip()
        if verify_job_name(name):
            status, _ = get_job_status(job_id)
            notebook_jobs.append((job_id, status, name))

    if VERBOSE:
        print("Finished looking for jobs.")

    # Print to notify the find result
    if return_code != 0:
        print(ERROR_KEYWORD)
        exit(1)
    else:
        # Print to provide the list of jobs to the client
        print(SUCCESS_KEYWORD)
        for job_id, status, name in notebook_jobs:
            print(str(job_id) + '\t- ' + str(status) + '\t- ' + str(name))

if __name__ == '__main__':
    find()


text:
import lastUrl from "./last-url";
import listen from "./listen";

export default function before([url]) {
	listen();
	lastUrl(url);
	return [url];
}


text:
name: cljs.core/INamed
see also:
---

## Summary

## Details

## Examples


text:
angular.module('ui.header', [])

.directive('header', function () {
    return {
        restrict: 'E',
        replace: true,
        templateUrl: 'src/ui/header/header.html',
        scope: {
        },
        link: function ($scope, $element, $attrs) {
        }
    };
});


text:
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { _ } from 'meteor/underscore';

const generateMetadataSchema = ({ fields, categories }) => {
  const fieldSchemaConfig = {};
  if (!_.isEmpty(fields)) {
    fields.forEach((field) => {
      const type = (field.numeric ? Number : String);
      fieldSchemaConfig[field.schemaId] = {
        type: (field.multiValue ? [type] : type),
        label: field.name,
        optional: true,
      };
    });
  }
  const fieldSchema = new SimpleSchema(fieldSchemaConfig);

  const categorySchemaConfig = {};
  if (!_.isEmpty(categories)) {
    categories.forEach((category) => {
      if (category.values) {
        categorySchemaConfig[category.schemaId] = {
          type: (category.multiselect ? [String] : String),
          label: category.name,
          optional: true,
          allowedValues: category.values,
        };
      }
    });
  }
  const categorySchema = new SimpleSchema(categorySchemaConfig);

  return { fieldSchema, categorySchema };
};

export default generateMetadataSchema;


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Arrays used by the UI -->
    <string-array name="aspect_ratio_names">
        <item>Original</item>
        <item>16:9</item>
        <item>16:10</item>
        <item>4:3</item>
        <item>2.35:1</item>
    </string-array>
    <string-array name="aspect_ratios" translatable="false">
        <!-- as accepted by video-aspect-override -->
        <item>-1</item>
        <item>16:9</item>
        <item>16:10</item>
        <item>4:3</item>
        <item>2.35</item>
    </string-array>

    <!-- Arrays used in settings -->
    <string-array name="background_play_entries">
        <item>Never</item>
        <item>Audio files only</item>
        <item>Always (Video files too)</item>
    </string-array>
    <string-array name="background_play_values" translatable="false">
        <item>never</item>
        <item>audio-only</item>
        <item>always</item>
    </string-array>
    <string-array name="auto_rotation_entries">
        <item>Automatic</item>
        <item>Default Landscape</item>
        <item>Default Portrait</item>
        <item>Device</item>
    </string-array>
    <string-array name="auto_rotation_values" translatable="false">
        <item>auto</item>
        <item>landscape</item>
        <item>portrait</item>
        <item>device</item>
    </string-array>

    <string-array name="scaler_list" translatable="false">
        <item>bilinear</item>
        <item>bicubic_fast</item>
        <item>oversample</item>
        <item>spline16</item>
        <item>spline36</item>
        <item>spline64</item>
        <item>sinc</item>
        <item>lanczos</item>
        <item>ginseng</item>
        <item>jinc</item>
        <item>ewa_lanczos</item>
        <item>ewa_hanning</item>
        <item>ewa_ginseng</item>
        <item>ewa_lanczossharp</item>
        <item>ewa_lanczossoft</item>
        <item>haasnsoft</item>
        <item>bicubic</item>
        <item>bcspline</item>
        <item>catmull_rom</item>
        <item>mitchell</item>
        <item>robidoux</item>
        <item>robidouxsharp</item>
        <item>ewa_robidoux</item>
        <item>ewa_robidouxsharp</item>
        <item>box</item>
        <item>nearest</item>
        <item>triangle</item>
        <item>gaussian</item>
    </string-array>
    <string-array name="temporal_scaler_list" translatable="false">
        <item>mitchell</item>
        <item>oversample</item>
        <item>linear</item>
    </string-array>

    <string-array name="deband_entries">
        <item>Disabled</item>
        <item>CPU</item>
        <item>GPU</item>
    </string-array>
    <string-array name="deband_values" translatable="false">
        <item></item>
        <item>gradfun</item>
        <item>gpu</item>
    </string-array>

    <string-array name="video_sync" translatable="false">
        <item>audio</item>
        <item>display-resample</item>
        <item>display-resample-vdrop</item>
        <item>display-vdrop</item>
        <item>display-adrop</item>
        <!-- omitted modes:
            "The modes with desync in their names [...] are meant for testing, not serious use."
        -->
    </string-array>

    <string-array name="stats_entries">
        <item>None</item>
        <item>FPS counter</item>
        <item>stats.lua: General</item>
        <item>stats.lua: Timings</item>
        <item>stats.lua: Cache</item>
    </string-array>
    <string-array name="stats_values" translatable="false">
        <item></item>
        <item>native_fps</item>
        <item>lua1</item>
        <item>lua2</item>
        <item>lua3</item>
    </string-array>

    <string-array name="gestures_entries">
        <item>None</item>
        <item>Seek</item>
        <item>Volume</item>
        <item>Brightness</item>
    </string-array>
    <string-array name="gestures_values" translatable="false">
        <item>none</item>
        <item>seek</item>
        <item>volume</item>
        <item>bright</item>
    </string-array>

    <string-array name="tap_gestures_entries">
        <item>None</item>
        <item>Seek</item>
        <item>Play/Pause</item>
        <item>Zoom</item>
        <item>Custom</item>
    </string-array>
    <string-array name="tap_gestures_values" translatable="false">
        <item>none</item>
        <item>seek</item>
        <item>playpause</item>
        <item>panscan</item>
        <item>custom</item>
    </string-array>
</resources>


text:
use aws_sdk_sfn::{Client, Error};
use structopt::StructOpt;

#[derive(Debug, StructOpt)]
struct Opt {
    /// The Amazon Resource Name (ARN) of the state machine to execute.
    #[structopt(short, long)]
    arn: String,

    /// The string that contains the JSON input data for the execution, for example "{\"first_name\" : \"test\"}".
    #[structopt(short, long)]
    input: String,

    /// Whether to display additional information.
    #[structopt(short, long)]
    verbose: bool,
}

/// Starts a state machine execution.
#[tokio::main]
async fn main() -> Result<(), Error> {
    tracing_subscriber::fmt::init();

    let Opt {
        arn,
        input,
        verbose,
    } = Opt::from_args();

    let shared_config = aws_config::load_from_env().await;
    let client = Client::new(&shared_config);

    println!();

    if verbose {
        println!("SF arn: {}", &arn);
        println!("Input: {}", &input);
        println!();
    }

    let rsp = client
        .start_execution()
        .state_machine_arn(&arn)
        .input("{\"input\": \"{}\"}")
        .send()
        .await?;

    println!("Step function response: `{:?}`", rsp);

    Ok(())
}


text:
namespace ash {
namespace device_activity {

// Device actives are measured according to trigger enums.
// TODO(https://crbug.com/1262178): Add another trigger for when sign-in occurs.
enum class Trigger {
  kNetwork  // Network state becomes connected.
};

}  // namespace device_activity
}  // namespace ash

#endif  // CHROMEOS_ASH_COMPONENTS_DEVICE_ACTIVITY_TRIGGER_H_


text:
#ifndef _PROTON_SRC_REACTOR_H
#define _PROTON_SRC_REACTOR_H 1

#include <proton/reactor.h>
#include <proton/url.h>

void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor);
void pni_reactor_set_connection_peer_address(pn_connection_t *connection,
                                             const char *host,
                                             const char *port);
pn_io_t *pni_reactor_io(pn_reactor_t *reactor);

#endif /* src/reactor.h */


text:
package org.skfiy.typhon.domain;

/**
 *
 * @author Kevin Zou <kevinz@skfiy.org>
 */
public interface Changeable {

    /**
     *
     * @return
     */
    public Player player();

    /**
     *
     * @return
     */
    public Changeable parent();

    /**
     *
     * @return
     */
    public String parentPropertyName();

    /**
     *
     * @param parent
     * @param parentPropertyName
     */
    public void set(Changeable parent, String parentPropertyName);
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>H-Index</title>
<meta name="date" content="2015-04-07">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV LETTER

NEXT LETTER

FRAMES

NO FRAMES

All Classes

A B C D E F G H I K L M N O P R S T U V W Y Z

H

hashCode() - Method in class com.cmput301.cs.project.models.Claim

hashCode() - Method in class com.cmput301.cs.project.models.Comment

hashCode() - Method in class com.cmput301.cs.project.models.Destination

hashCode() - Method in class com.cmput301.cs.project.models.Expense

hashCode() - Method in class com.cmput301.cs.project.models.Tag

hashCode() - Method in class com.cmput301.cs.project.models.User

hasReceipt() - Method in class com.cmput301.cs.project.models.Expense.Builder

hasReceipt() - Method in class com.cmput301.cs.project.models.Expense

hello_world - Static variable in class com.cmput301.cs.project.R.string

Hits<T> - Class in com.cmput301.cs.project.serialization.elasticsearch

This class acts as a wrapper from data obtained when using RemoteSaver to pull data from Elastic Search
 It is unimportant and boilerplate

Hits() - Constructor for class com.cmput301.cs.project.serialization.elasticsearch.Hits

holo_dark - Static variable in class com.cmput301.cs.project.R.id

holo_dark - Static variable in class com.google.android.gms.R.id

holo_light - Static variable in class com.cmput301.cs.project.R.id

holo_light - Static variable in class com.google.android.gms.R.id

home - Static variable in class com.cmput301.cs.project.R.string

home_btn - Static variable in class com.cmput301.cs.project.R.id

hybrid - Static variable in class com.cmput301.cs.project.R.id

hybrid - Static variable in class com.google.android.gms.R.id

A B C D E F G H I K L M N O P R S T U V W Y Z

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV LETTER

NEXT LETTER

FRAMES

NO FRAMES

All Classes


text:
package com.arqui.tomasulo.listeners;

public interface IClockListener {
	public void onClock();
}


text:
/*=================================\
* CWA.Connection\ReturnBackOption.cs
*
* The Coestaris licenses this file to you under the MIT license.
* See the LICENSE file in the project root for more information.
*
* Created: 22.08.2017 20:38
* Last Edited: 19.08.2017 7:38:22
*=================================*/

namespace CWA.Printing
{
    /// <summary>
    /// Определяет действие в конце печати (после конца).
    /// </summary>
    public enum ReturnBackOption
    {
        /// <summary>
        /// Вернуть перо в нулевую точку (та, с которой началась печать).
        /// </summary>
        ReturnToZero,

        /// <summary>
        /// Оставить перо там, где она стояло.
        /// </summary>
        StayAtEnd
    }
}


text:
<?php
namespace Dlin\GiftshopBundle\Util;
/**
 *
 * User: davidlin
 * Date: 7/02/13
 * Time: 12:15 AM
 *
 */
class DateUtil
{
    /**
     * Check if the given month sting is in the format of 'YYYY-MM'
     * @param $monthString
     * @return bool
     */
    public static function isValidMonthString($monthString){
        return  preg_match("/^\\d{4}-\\d{2}$/", $monthString) == true;
    }

    public static function genMonthString($timestamp){
        return date("%Y-%m", $timestamp);

    }

}


text:
module.exports = UrlProvider;

var IptvProvider = require('./iptv_provider');

util.inherits(UrlProvider, IptvProvider.Http);

function UrlProvider(url, opts) {
        /* hardcode channel = url, relaxing the need to manually
         * set a name using .chan */
        if (!opts)
                opts = {};
        if (!opts.channel)
                opts.channel = url;

        UrlProvider.super_.call(this, opts);

        this._fixed_url = url;
}


text:
layout: post
title:  About API coherence
author: Luca Ferrari
tags:
- api
- java
- c++
- perl
- development
permalink: /:year/:month/:day/:title.html
---
Is the *getter/setter* API coherent across your library?

## About API Coherence
-----
I've already spent some words on the [setters and getters](https://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiM2Jmzhv_UAhXFXhQKHTtBAfgQFggoMAE&url=http%253A%252F%252Ffluca1978.blogspot.com%252F2009%252F06%252Fsetter-getter-o-entrambi.html&usg=AFQjCNGHcLXyCXw_9PJ65aoJnOs9E88oaQ) subject, and I have to admit I hate with a  passion the way Java Beans implements them.
There are several ways I don't like the Java Beans specification about setters and getters, most notably the already discussed fact that it does not allow for a *fluent* interface, that is an handy way to concatenate setter calls. The reason for this is that Java requires a *setter* to return nothing (i.e., `void`), so that you have to use *setters* as follows:

    foo.setWidth( 30 );
    foo.setHeight( 50 );

while if the `setWidth` and `setHeight` does allow for a return type, in particular the same object they are mutating, the above code becomes a lot more compact and less error prone:

    foo.setWidth( 30 );
       .setHeight( 50 );

Why is the above less error prone? Because I'm mutating the *very same object*, no way I can mess with variables with similar names or something wrongly suggested by my IDE.
Well, to be honest, the fluent interface requires an extra slot on the stack to place the object to return, so chances are it is not a popular approach to save some memory access, but I think developers would have a strong benefit for change.

The other fact that makes me hate the Java Beans *s|g-etter* notation is the forced adoption of placing a prefix in front of each method.
Do you a property named `width`? You will end up with a couple of methods called `getWidth()` and `setWidth(..)`. There is no practical reason for having such suffixes, since I can only say a method from a variable due to the presence of brackets. In other words `width` is different from `width()` (and no, spaces are not a problem!).
This approach also lead to a few inconsistencies around the Java library itself, and this is due probably to different ages and evolutions of the API itself. But before going into deep here, let's review the naming convetion another time.
In Java, if you have a property `baz` you could have the following accessors:

-   `getBaz()` to read;
-   `setBaz(..)` to write.

What about a method that perform some action on `baz`, as a `normalizeBaz()`? Well, it is quite clear that *non-accessor methods never have a `set` or `get` suffix*. This rule of thumb could make the specification a little more easy to tolerate, as it allows to quickly say a computational method from an accessor one. The problem, in my opinion, is that Java engineers fears developers to write stupid dummy code and force them to avoid it (yeah, just think about the lack of operator overloading).
Again, my personal answer is: "who cares?".
Allow me to explain: I often end up with code that looks like the following

    public final void setWidth( int w ){
     if ( w < 0 )
        w = 0;
      width = w;
    }

    public final int getWidth(){
      if ( width < 0 )
         width = 0;
      return width;

The above code is wrong (in a pure Java Beans sense): accessor perform some kind of sanity on possible tainted data. Therefore my accessors also do computation, and therefore I cannot say a computational method from an accessor one without inspecting the code (or reading the documentation, that we all write, right?).

Assuming therefore that is a day-by-day needing for some accessors to perform some computation, let's go back to the naming coherency.
Is a Java `String` a bean? Apparently no, because its length is obtained via a read only accessor named `length()`.
Is a collection a bean? Apparently no, because its size is obtained via a read only accessor named `size()`.
Now, I hear you screaming "of course, they are not supposed to be writable properties!", and I agree with you, but then why they should not adhere to `get` prefix specification? And please note they should not be computational method, since the sizes are pretty well known at the time you ask for them.

Ok, let's see someone else that does things in a more coherent way. Let's examine the [Qt library](http://doc.qt.io/qt-5/reference-overview.html), which in my opinion is a very robust and great piece of code, a library we all should learn from.
The approach used there is quite simple: if you have the property `baz` you end up with

-   `baz()` to read;
-   `setBaz()` to write.

Note that the read accessor is perfectly coherent with any other version of the API, and could be coherent even with other Java classes.
Do you need a computational method? Just named it after the property, such as `computeBaz()`.
Clear, simple, coherent. No need to uppercase first the property in every accessor.

As for Java, even Qt does not implement the fluent interface, and I suspect the reasons are the same: avoiding an extra return slot on the stack.

Now, a syntactic sugar of the Java Beans specification is that *all* the getters and setters are grouped alphabetically, and this could allow a developer for a faster lookup once the IDE sort members and methods alphabetically. On the other hand, this is not a need for a C++ library, since usually variables and methods are kept in separate source files. This is a really small advantages compared to all the extra typing of `get` in front of reader accessors, and the inconsistencies you can find across the library.


text:
    <select id="select-category" [ngModel]="globals.currentCategory" (change)="categoryChanged($event)">
        <option value="all">General</option>
        <ng-container *ngFor="let category of globals.categories">
            <option *ngIf="category.assignable && globals.categoriesBlocked.indexOf(category.id) === -1"
                [value]="category.id">{{category.title}}</option>
        </ng-container>
    </select>


text:
package com.facebook.litho.widget;

import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static androidx.recyclerview.widget.OrientationHelper.VERTICAL;

import android.content.Context;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.OrientationHelper;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.LayoutParams;
import com.facebook.litho.ComponentContext;
import com.facebook.litho.SizeSpec;
import java.util.List;

/**
 * An implementation for {@link LayoutInfo} to implement linear lists with a {@link
 * LinearLayoutManager}.
 */
public class LinearLayoutInfo implements LayoutInfo {

  private static final int MAX_SANE_RANGE = 10;
  private static final int MIN_SANE_RANGE = 2;

  private final LinearLayoutManager mLinearLayoutManager;

  public LinearLayoutInfo(LinearLayoutManager linearLayoutManager) {
    mLinearLayoutManager = linearLayoutManager;
  }

  public LinearLayoutInfo(ComponentContext context, int orientation, boolean reverseLayout) {
    this(context.getAndroidContext(), orientation, reverseLayout);
  }

  public LinearLayoutInfo(
      ComponentContext context, int orientation, boolean reverseLayout, boolean stackFromEnd) {
    this(context.getAndroidContext(), orientation, reverseLayout, stackFromEnd);
  }

  public LinearLayoutInfo(Context context, int orientation, boolean reverseLayout) {
    this(context, orientation, reverseLayout, false);
  }

  public LinearLayoutInfo(
      Context context, int orientation, boolean reverseLayout, boolean stackFromEnd) {
    mLinearLayoutManager =
        new InternalLinearLayoutManager(context, orientation, reverseLayout, stackFromEnd);
    mLinearLayoutManager.setMeasurementCacheEnabled(false);
  }

  @Override
  public int getScrollDirection() {
    return mLinearLayoutManager.getOrientation();
  }

  @Override
  public int findFirstVisibleItemPosition() {
    return mLinearLayoutManager.findFirstVisibleItemPosition();
  }

  @Override
  public int findLastVisibleItemPosition() {
    return mLinearLayoutManager.findLastVisibleItemPosition();
  }

  @Override
  public int findFirstFullyVisibleItemPosition() {
    return mLinearLayoutManager.findFirstCompletelyVisibleItemPosition();
  }

  @Override
  public int findLastFullyVisibleItemPosition() {
    return mLinearLayoutManager.findLastCompletelyVisibleItemPosition();
  }

  @Override
  public int getItemCount() {
    return mLinearLayoutManager.getItemCount();
  }

  @Override
  public RecyclerView.LayoutManager getLayoutManager() {
    return mLinearLayoutManager;
  }

  @Override
  public void setRenderInfoCollection(@Nullable RenderInfoCollection renderInfoCollection) {
    // Do nothing
  }

  @Override
  public void scrollToPositionWithOffset(int position, int offset) {
    mLinearLayoutManager.scrollToPositionWithOffset(position, offset);
  }

  @Override
  public int approximateRangeSize(
      int firstMeasuredItemWidth,
      int firstMeasuredItemHeight,
      int recyclerMeasuredWidth,
      int recyclerMeasuredHeight) {

    int approximateRange;

    switch (mLinearLayoutManager.getOrientation()) {
      case LinearLayoutManager.HORIZONTAL:
        approximateRange =
            (int) Math.ceil((float) recyclerMeasuredWidth / (float) firstMeasuredItemWidth);
        break;
      default:
        approximateRange =
            (int) Math.ceil((float) recyclerMeasuredHeight / (float) firstMeasuredItemHeight);
        break;
    }

    if (approximateRange < MIN_SANE_RANGE) {
      approximateRange = MIN_SANE_RANGE;
    } else if (approximateRange > MAX_SANE_RANGE) {
      approximateRange = MAX_SANE_RANGE;
    }

    return approximateRange;
  }

  @Override
  public int getChildHeightSpec(int heightSpec, RenderInfo renderInfo) {
    switch (mLinearLayoutManager.getOrientation()) {
      case LinearLayoutManager.HORIZONTAL:
        return heightSpec;
      default:
        return SizeSpec.makeSizeSpec(0, SizeSpec.UNSPECIFIED);
    }
  }

  @Override
  public int getChildWidthSpec(int widthSpec, RenderInfo renderInfo) {
    switch (mLinearLayoutManager.getOrientation()) {
      case LinearLayoutManager.HORIZONTAL:
        return SizeSpec.makeSizeSpec(0, SizeSpec.UNSPECIFIED);
      default:
        return widthSpec;
    }
  }

  @Override
  public ViewportFiller createViewportFiller(int measuredWidth, int measuredHeight) {
    return new ViewportFiller(measuredWidth, measuredHeight, getScrollDirection());
  }

  @Override
  public int computeWrappedHeight(int maxHeight, List<ComponentTreeHolder> componentTreeHolders) {
    return LayoutInfoUtils.computeLinearLayoutWrappedHeight(
        mLinearLayoutManager, maxHeight, componentTreeHolders);
  }

  private static class InternalLinearLayoutManager extends LinearLayoutManager {

    InternalLinearLayoutManager(
        Context context, int orientation, boolean reverseLayout, boolean stackFromEnd) {
      super(context, orientation, reverseLayout);
      setStackFromEnd(stackFromEnd);
    }

    @Override
    public LayoutParams generateDefaultLayoutParams() {
      return getOrientation() == OrientationHelper.VERTICAL
          ? new RecyclerView.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
          : new RecyclerView.LayoutParams(WRAP_CONTENT, MATCH_PARENT);
    }

    @Override
    public boolean supportsPredictiveItemAnimations() {
      // Predictive animation in RecyclerView has some bugs that surface occasionally when one
      // RecyclerView is used as a child of another RecyclerView and it is very hard to repro
      // (https://issuetracker.google.com/issues/37007605). This one disables that optional
      // feature for Horizontal one which is used as inner RecyclerView most of the cases.
      // Disabling predictive animations lets RecyclerView use the simple animations instead.
      return getOrientation() == OrientationHelper.HORIZONTAL
          ? false
          : super.supportsPredictiveItemAnimations();
    }
  }

  /**
   * Simple implementation of {@link LayoutInfo.ViewportFiller} which fills the viewport by laying
   * out items sequentially.
   */
  public static class ViewportFiller implements LayoutInfo.ViewportFiller {

    private final int mWidth;
    private final int mHeight;
    private final int mOrientation;
    private int mFill;

    public ViewportFiller(int width, int height, int orientation) {
      mWidth = width;
      mHeight = height;
      mOrientation = orientation;
    }

    @Override
    public boolean wantsMore() {
      final int target = mOrientation == VERTICAL ? mHeight : mWidth;
      return mFill < target;
    }

    @Override
    public void add(RenderInfo renderInfo, int width, int height) {
      mFill += mOrientation == VERTICAL ? height : width;
    }

    @Override
    public int getFill() {
      return mFill;
    }
  }
}


text:
using System;
using System.Windows;
using System.Windows.Threading;
using EnvDTE;

namespace IBR.StringResourceBuilder2011.Modules
{
  public static class ExtensionMethods
  {
    #region UIElement.Refresh

    private static Action EmptyDelegate = delegate() { };

    public static void Refresh(this UIElement uiElement)
    {
      uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
    }

    #endregion

    #region CodeElement

    public static bool HasStartPoint(this CodeElement element)
    {
      try
      {
        //test whether access to the StartPoint throws an exception
        int line = element.StartPoint.Line;

        return (true);
      }
      catch (Exception /*ex*/)
      {
        return (false);
      }
    }

      #endregion
      //public static class TextBoxWatermarkExtensionMethod
      //{
      //  private const uint ECM_FIRST = 0x1500;
      //  private const uint EM_SETCUEBANNER = ECM_FIRST + 1;

      //  [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
      //  private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, uint wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);

      //  public static void SetWatermark(this TextBox textBox, string watermarkText)
      //  {
      //    SendMessage(textBox.Handle, EM_SETCUEBANNER, 0, watermarkText);
      //  }
      //}
    } //class
} //namespace


text:
#pragma once

#include <NvInfer.h>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/inference/engine.h"
#include "paddle/fluid/inference/tensorrt/helper.h"
#include "paddle/fluid/inference/tensorrt/plugin/trt_plugin.h"
#include "paddle/fluid/inference/tensorrt/plugin/trt_plugin_factory.h"
#include "paddle/fluid/inference/tensorrt/trt_int8_calibrator.h"
#include "paddle/fluid/inference/utils/singleton.h"

namespace paddle {
namespace inference {
namespace tensorrt {

class TRTInt8Calibrator;
/*
 * TensorRT Engine.
 *
 * There are two alternative ways to use it, one is  to build from a paddle
 * protobuf model, another way is to manully construct the network.
 */
class TensorRTEngine {
  using DescType = ::paddle::framework::proto::BlockDesc;

 public:
  // Weight is model parameter.
  class Weight {
   public:
    Weight() = default;
    Weight(nvinfer1::DataType dtype, void* value, size_t num_elem) {
      w_.type = dtype;
      w_.values = value;
      w_.count = num_elem;
    }
    const nvinfer1::Weights& get() { return w_; }

    std::vector<int64_t> dims;

   private:
    nvinfer1::Weights w_;
  };

  TensorRTEngine(int max_batch, int max_workspace, bool enable_int8 = false,
                 TRTInt8Calibrator* calibrator = nullptr, int device_id = 0,
                 nvinfer1::ILogger& logger = NaiveLogger::Global())
      : max_batch_(max_batch),
        max_workspace_(max_workspace),
        enable_int8_(enable_int8),
        calibrator_(calibrator),
        device_id_(device_id),
        logger_(logger) {}

  ~TensorRTEngine() {}

  // TODO(Superjomn) implement it later when graph segmentation is supported.
  void Build(const DescType& paddle_model);

  void Execute(int batch_size, std::vector<void*>* buffers,
               cudaStream_t stream);

  // Initialize the inference network, so that TensorRT layers can add to this
  // network.
  void InitNetwork() {
    freshDeviceId();
    infer_builder_.reset(createInferBuilder(&logger_));
    infer_network_.reset(infer_builder_->createNetwork());
  }
  // After finishing adding ops, freeze this network and creates the executation
  // environment.
  void FreezeNetwork();

  // Add an input and set its name, data type and dimention.
  nvinfer1::ITensor* DeclareInput(const std::string& name,
                                  nvinfer1::DataType dtype,
                                  const nvinfer1::Dims& dim);
  // Set the offset-th output from a layer as the network's output, and set its
  // name.
  void DeclareOutput(const nvinfer1::ILayer* layer, int offset,
                     const std::string& name);
  // Set the itensor_map_[name] as the network's output, and set its name.
  void DeclareOutput(const std::string& name);
  // Check if the ITensor has been declared
  bool HasDeclared(const std::string& name);

  void SetITensor(const std::string& name, nvinfer1::ITensor* tensor);
  // Get an ITensor called name.
  nvinfer1::ITensor* GetITensor(const std::string& name);

  nvinfer1::ICudaEngine* engine() { return infer_engine_.get(); }
  nvinfer1::INetworkDefinition* network() { return infer_network_.get(); }

  nvinfer1::IHostMemory* Serialize() {
    PADDLE_ENFORCE(infer_engine_ != nullptr,
                   "You should build engine first and then serialize");
    ihost_memory_.reset(infer_engine_->serialize());
    return ihost_memory_.get();
  }

  void Deserialize(const std::string& engine_serialized_data) {
    freshDeviceId();
    infer_ptr<nvinfer1::IRuntime> runtime(createInferRuntime(&logger_));
    infer_engine_.reset(runtime->deserializeCudaEngine(
        engine_serialized_data.c_str(), engine_serialized_data.size(),
        &inference::Singleton<plugin::PluginFactoryTensorRT>::Global()));
    PADDLE_ENFORCE(infer_engine_ != nullptr,
                   "build cuda engine failed when deserialize engine info.!");
    infer_context_.reset(infer_engine_->createExecutionContext());
  }

  void SetRuntimeBatch(size_t batch_size);
  int GetRuntimeBatch();
  int GetDeviceId() { return device_id_; }
  nvinfer1::IPluginLayer* AddPlugin(nvinfer1::ITensor* const* inputs,
                                    int num_inputs, plugin::PluginTensorRT*);

  // A pointer to CPU memory is needed of the TRT weight.
  // Before TRT runs, fluid loads weight into GPU storage.
  // so we need to copy the weights from GPU to CPU in our op converter.
  // We use a map to store these weights for the weight memory is not released
  // in advance, which affecting the construction of TRT Op.
  std::unordered_map<std::string /*name*/, std::unique_ptr<framework::Tensor>>
      weight_map;

 private:
  // Each ICudaEngine object is bound to a specific GPU when it is instantiated,
  // ensure that the thread is associated with the correct device by calling
  // freshDeviceId().
  void freshDeviceId();

  // the max batch size
  int max_batch_;
  // the runtime batch size
  static int runtime_batch_;
  // the max memory size the engine uses
  int max_workspace_;

  bool enable_int8_;
  TRTInt8Calibrator* calibrator_;
  // batch size of the current data, will be updated each Executation.
  int batch_size_{-1};

  int device_id_;
  nvinfer1::ILogger& logger_;

  // max data size for the buffers.
  std::unordered_map<std::string /*name*/, size_t /*max size*/> buffer_sizes_;
  std::unordered_map<std::string /*name*/, nvinfer1::ITensor* /*ITensor*/>
      itensor_map_;

  std::vector<std::unique_ptr<plugin::PluginTensorRT>> owned_plugin_;

  // TensorRT related internal members
  template <typename T>
  struct Destroyer {
    void operator()(T* x) {
      if (x) {
        x->destroy();
      }
    }
  };
  template <typename T>
  using infer_ptr = std::unique_ptr<T, Destroyer<T>>;
  infer_ptr<nvinfer1::IBuilder> infer_builder_;
  infer_ptr<nvinfer1::INetworkDefinition> infer_network_;
  infer_ptr<nvinfer1::ICudaEngine> infer_engine_;
  infer_ptr<nvinfer1::IExecutionContext> infer_context_;
  infer_ptr<nvinfer1::IHostMemory> ihost_memory_;
};  // class TensorRTEngine

// Add an layer__ into engine__ with args ARGS.
// For example:
//
// Reference
// https://docs.nvidia.com/deeplearning/sdk/tensorrt-developer-guide/index.html#charRNN_define_network
//
// will add a fully connected layer into the engine.
// TensorRT has too many layers, so that is not wise to add member functions for
// them, and an macro like this is more extensible when underlying TensorRT
// library add new layer supports.
#define TRT_ENGINE_ADD_LAYER(engine__, layer__, ARGS...) \
  engine__->network()->add##layer__(ARGS);

}  // namespace tensorrt
}  // namespace inference
}  // namespace paddle


text:
puppet-blkid-info
=================

This is a puppet module with a facter plugin to find the path to the actual
"which" command on the node where resources are being applied.

The fact is stored in "$which\_cmd"

Docs and a proper module structure Coming Soon(tm)

--
Stephen R. Scaffidi | stephen@scaffidi.net | Just Another (Perl|Python|Puppet) Hacker


text:
/*globals svgEditor */
svgEditor.readLang({
	lang: "sl",
	dir : "ltr",
	common: {
		"ok": "Shraniti",
		"cancel": "Prekliči",
		"key_backspace": "backspace",
		"key_del": "delete",
		"key_down": "down",
		"key_up": "up",
		"more_opts": "More Options",
		"url": "URL",
		"width": "Width",
		"height": "Height"
	},
	misc: {
		"powered_by": "Powered by"
	},
	ui: {
		"toggle_stroke_tools": "Show/hide more stroke tools",
		"palette_info": "Kliknite, če želite spremeniti barvo polnila, premik miške kliknite spremeniti barvo kap",
		"zoom_level": "Spreminjanje povečave",
		"panel_drag": "Drag left/right to resize side panel"
	},
	properties: {
		"id": "Identify the element",
		"fill_color": "Spremeni barvo polnila",
		"stroke_color": "Spremeni barvo kap",
		"stroke_style": "Spremeni kap dash slog",
		"stroke_width": "Spreminjanje širine kap",
		"pos_x": "Change X coordinate",
		"pos_y": "Change Y coordinate",
		"linecap_butt": "Linecap: Butt",
		"linecap_round": "Linecap: Round",
		"linecap_square": "Linecap: Square",
		"linejoin_bevel": "Linejoin: Bevel",
		"linejoin_miter": "Linejoin: Miter",
		"linejoin_round": "Linejoin: Round",
		"angle": "Sprememba kota rotacije",
		"blur": "Change gaussian blur value",
		"opacity": "Spremeni izbran predmet motnosti",
		"circle_cx": "Spremeni krog's CX usklajujejo",
		"circle_cy": "Spremeni krog's cy usklajujejo",
		"circle_r": "Spremeni krogu polmera",
		"ellipse_cx": "Spremeni elipse's CX usklajujejo",
		"ellipse_cy": "Spremeni elipse's cy usklajujejo",
		"ellipse_rx": "Spremeni elipse's x polmer",
		"ellipse_ry": "Spremeni elipse's y polmer",
		"line_x1": "Spremeni skladu z začetkom x usklajujejo",
		"line_x2": "Change line je končalo x usklajujejo",
		"line_y1": "Change line's začetkom y usklajujejo",
		"line_y2": "Change line je končalo y usklajujejo",
		"rect_height": "Spremeni pravokotniku višine",
		"rect_width": "Spremeni pravokotnik širine",
		"corner_radius": "Spremeni Pravokotnik Corner Radius",
		"image_width": "Spremeni Širina slike",
		"image_height": "Spremeni Višina slike",
		"image_url": "Spremeni URL",
		"node_x": "Change node's x coordinate",
		"node_y": "Change node's y coordinate",
		"seg_type": "Change Segment type",
		"straight_segments": "Straight",
		"curve_segments": "Curve",
		"text_contents": "Spremeni besedilo vsebino",
		"font_family": "Change Font Family",
		"font_size": "Spremeni velikost pisave",
		"bold": "Bold Text",
		"italic": "Italic Text"
	},
	tools: {
		"main_menu": "Main Menu",
		"bkgnd_color_opac": "Spreminjanje barve ozadja / motnosti",
		"connector_no_arrow": "No arrow",
		"fitToContent": "Fit to Content",
		"fit_to_all": "Fit na vse vsebine",
		"fit_to_canvas": "Fit na platno",
		"fit_to_layer_content": "Fit na plast vsebine",
		"fit_to_sel": "Fit za izbor",
		"align_relative_to": "Poravnaj glede na ...",
		"relativeTo": "glede na:",
		"page": "page",
		"largest_object": "Največji objekt",
		"selected_objects": "izvoljeni predmeti",
		"smallest_object": "najmanjša objekt",
		"new_doc": "New Image",
		"open_doc": "Open SVG",
		"export_img": "Export",
		"save_doc": "Shrani slike",
		"import_doc": "Import Image",
		"align_to_page": "Align Element to Page",
		"align_bottom": "Align Bottom",
		"align_center": "Sredino",
		"align_left": "Poravnaj levo",
		"align_middle": "Poravnava Middle",
		"align_right": "Poravnaj desno",
		"align_top": "Poravnava Top",
		"mode_select": "Select Tool",
		"mode_fhpath": "Pencil Tool",
		"mode_line": "Line Tool",
		"mode_connect": "Connect two objects",
		"mode_rect": "Rectangle Tool",
		"mode_square": "Square Tool",
		"mode_fhrect": "Free-Hand pravokotnik",
		"mode_ellipse": "Elipsa",
		"mode_circle": "Circle",
		"mode_fhellipse": "Free-Hand Elipsa",
		"mode_path": "Path Tool",
		"mode_shapelib": "Shape library",
		"mode_text": "Text Tool",
		"mode_image": "Image Tool",
		"mode_zoom": "Zoom Tool",
		"mode_eyedropper": "Eye Dropper Tool",
		"no_embed": "NOTE: This image cannot be embedded. It will depend on this path to be displayed",
		"undo": "Undo",
		"redo": "Redo",
		"tool_source": "Edit Vir",
		"wireframe_mode": "Wireframe Mode",
		"toggle_grid": "Show/Hide Grid",
		"clone": "Clone Element(s)",
		"del": "Delete Element(s)",
		"group_elements": "Skupina Elements",
		"make_link": "Make (hyper)link",
		"set_link_url": "Set link URL (leave empty to remove)",
		"to_path": "Convert to Path",
		"reorient_path": "Reorient path",
		"ungroup": "Razdruži Elements",
		"docprops": "Document Properties",
		"imagelib": "Image Library",
		"move_bottom": "Premakni v Bottom",
		"move_top": "Premakni na vrh",
		"node_clone": "Clone Node",
		"node_delete": "Delete Node",
		"node_link": "Link Control Points",
		"add_subpath": "Add sub-path",
		"openclose_path": "Open/close sub-path",
		"source_save": "Shraniti",
		"cut": "Cut",
		"copy": "Copy",
		"paste": "Paste",
		"paste_in_place": "Paste in Place",
		"delete": "Delete",
		"group": "Group",
		"move_front": "Bring to Front",
		"move_up": "Bring Forward",
		"move_down": "Send Backward",
		"move_back": "Send to Back"
	},
	layers: {
		"layer":"Layer",
		"layers": "Layers",
		"del": "Delete Layer",
		"move_down": "Move Down Layer",
		"new": "New Layer",
		"rename": "Rename Layer",
		"move_up": "Move Up Layer",
		"dupe": "Duplicate Layer",
		"merge_down": "Merge Down",
		"merge_all": "Merge All",
		"move_elems_to": "Move elements to:",
		"move_selected": "Move selected elements to a different layer"
	},
	config: {
		"image_props": "Image Properties",
		"doc_title": "Title",
		"doc_dims": "Canvas Dimensions",
		"included_images": "Included Images",
		"image_opt_embed": "Embed data (local files)",
		"image_opt_ref": "Use file reference",
		"editor_prefs": "Editor Preferences",
		"icon_size": "Icon size",
		"language": "Language",
		"background": "Editor Background",
		"editor_img_url": "Image URL",
		"editor_bg_note": "Note: Background will not be saved with image.",
		"icon_large": "Large",
		"icon_medium": "Medium",
		"icon_small": "Small",
		"icon_xlarge": "Extra Large",
		"select_predefined": "Select vnaprej:",
		"units_and_rulers": "Units & Rulers",
		"show_rulers": "Show rulers",
		"base_unit": "Base Unit:",
		"grid": "Grid",
		"snapping_onoff": "Snapping on/off",
		"snapping_stepsize": "Snapping Step-Size:",
		"grid_color": "Grid color"
	},
	shape_cats: {
		"basic": "Basic",
		"object": "Objects",
		"symbol": "Symbols",
		"arrow": "Arrows",
		"flowchart": "Flowchart",
		"animal": "Animals",
		"game": "Cards & Chess",
		"dialog_balloon": "Dialog balloons",
		"electronics": "Electronics",
		"math": "Mathematical",
		"music": "Music",
		"misc": "Miscellaneous",
		"raphael_1": "raphaeljs.com set 1",
		"raphael_2": "raphaeljs.com set 2"
	},
	imagelib: {
		"select_lib": "Select an image library",
		"show_list": "Show library list",
		"import_single": "Import single",
		"import_multi": "Import multiple",
		"open": "Open as new document"
	},
	notification: {
		"invalidAttrValGiven":"Invalid value given",
		"noContentToFitTo":"No content to fit to",
		"dupeLayerName":"There is already a layer named that!",
		"enterUniqueLayerName":"Please enter a unique layer name",
		"enterNewLayerName":"Please enter the new layer name",
		"layerHasThatName":"Layer already has that name",
		"QmoveElemsToLayer":"Move selected elements to layer '%s'?",
		"QwantToClear":"Do you want to clear the drawing?\nThis will also erase your undo history!",
		"QwantToOpen":"Do you want to open a new file?\nThis will also erase your undo history!",
		"QerrorsRevertToSource":"There were parsing errors in your SVG source.\nRevert back to original SVG source?",
		"QignoreSourceChanges":"Ignore changes made to SVG source?",
		"featNotSupported":"Feature not supported",
		"enterNewImgURL":"Enter the new image URL",
		"defsFailOnSave": "NOTE: Due to a bug in your browser, this image may appear wrong (missing gradients or elements). It will however appear correct once actually saved.",
		"loadingImage":"Loading image, please wait...",
		"saveFromBrowser": "Select \"Save As...\" in your browser to save this image as a %s file.",
		"noteTheseIssues": "Also note the following issues: ",
		"unsavedChanges": "There are unsaved changes.",
		"enterNewLinkURL": "Enter the new hyperlink URL",
		"errorLoadingSVG": "Error: Unable to load SVG data",
		"URLloadFail": "Unable to load from URL",
		"retrieving": "Retrieving \"%s\"..."
	},
	confirmSetStorage: {
		message: "By default and where supported, SVG-Edit can store your editor "+
		"preferences and SVG content locally on your machine so you do not "+
		"need to add these back each time you load SVG-Edit. If, for privacy "+
		"reasons, you do not wish to store this information on your machine, "+
		"you can change away from the default option below.",
		storagePrefsAndContent: "Store preferences and SVG content locally",
		storagePrefsOnly: "Only store preferences locally",
		storagePrefs: "Store preferences locally",
		storageNoPrefsOrContent: "Do not store my preferences or SVG content locally",
		storageNoPrefs: "Do not store my preferences locally",
		rememberLabel: "Remember this choice?",
		rememberTooltip: "If you choose to opt out of storage while remembering this choice, the URL will change so as to avoid asking again."
	}
});


text:
class Song
  def initialize(song, artist)
    @song = song
    @artist = artist
  end
  def play
    puts "Now playing: #{@song} by #{@artist}"
  end

end

class Playlist
  def initialize(*song)
    @tracks = song
  end
  def add(*new)
    @new = new
    @new.each do |x|
      @tracks << x
    end
  end
  def num_of_tracks
    @tracks.length
  end
  def play
    first_track = @track[0]
    p "Playing: "
  end
  def remove(delete)
    @delete = delete
  end

  def includes?(songs)
    if @tracks.include? songs
      return true
    else
      return false
    end
  end

  def play_all
  end
  def display
  end
end

# Refactored Solution

# DRIVER CODE AND TESTS GO BELOW THIS LINE
one_by_one = Song.new("One by One", "Sirenia")
world_so_cold = Song.new("World So Cold", "Three Days Grace")
going_under = Song.new("Going Under", "Evanescence")

my_playlist = Playlist.new(one_by_one, world_so_cold, going_under)

lying_from_you = Song.new("Lying From You", "Linkin Park")
angels = Song.new("Angels", "Within Temptation")

my_playlist.add(lying_from_you, angels)
p my_playlist.num_of_tracks == 5
going_under.play #How would you model a song getting "played" in Ruby? I used `puts` and `sleep`. You can model this however you want.
my_playlist.remove(angels)
p my_playlist.includes?(lying_from_you) == true
my_playlist.play_all
my_playlist.display

# Reflection
# What concepts did you review in this challenge?
#-I reviewed creating Ruby classes that interact with each other.
# What is still confusing to you about Ruby?
#- I think I wasn't too sure whether I should use attr_reader/writer methods, but no need.
# What are you going to study to get more prepared for Phase 1?
#- I'm reading over Chris Pine's Learn to Program chapter on classes.


text:
import os
from .conf import init_conf

class Local(object):

    def __init__(self, conf='toraconf'):
        self._conf = conf

    @property
    def conf(self):
        try:
            from flask import current_app
            return current_app.config
        except:
            if isinstance(self._conf, str):
                from flask import Config
                conf = Config(os.getcwd())
                init_conf(conf, self._conf)
                self._conf = conf
            return self._conf

    @property
    def secret_key(self):
        try:
            from flask import current_app
            return current_app.secret_key
        except:
            return self.conf['SECRET_KEY']

local = Local()


text:
export class URLRequestMethod
{
	/**
	 *
	 * @type {string}
	 */
	public static POST:string = 'POST';
	/**
	 *
	 * @type {string}
	 */
	public static GET:string = 'GET';
}


text:
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once 'vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Download the PHP helper library from twilio.com/docs/php/install
// These vars are your accountSid and authToken from twilio.com/user/account
// To set up environmental variables, see http://twil.io/secure
$account_sid = getenv('TWILIO_ACCOUNT_SID');
$auth_token = getenv('TWILIO_AUTH_TOKEN');
$client = new Client($account_sid, $auth_token);

$client->messages->create(
    "+441632960675",
    array(
        'messagingServiceSid' => "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        'body' => "Phantom Menace was clearly the best of the prequel trilogy."
    )
);


text:
+++
Title = "Przemyslaw Koltermann"
#Twitter = ""
image = "przemyslaw-koltermann.png"
type = "speaker"
linktitle = "przemyslaw-koltermann"
+++

#### Speaker

Docker Certified Associate and Docker Community Leader in Warsaw. Senior Software Engineer at GOG.com. Team DevOps, active everywhere where developers and IT meet, like development environment, deploy pipelines or Kubernetes. Master of Science in Computer Networking. Active Docker and Kubernetes advocate, performing lectures and trainings.


text:
describe('Directive', function () {

    var Directive  = require('vue/src/directive'),
        directives = require('vue/src/directives')

    var compiler = {
        options: {},
        getOption: function (type, id) {
            return Vue.options[type][id]
        },
        vm: {
            constructor: {}
        }
    }

    function makeSpy () {
        var spy = function () {
            spy.called++
            spy.args = [].slice.call(arguments)
        }
        spy.called = 0
        return spy
    }

    function build (name, exp, compiler) {
        var ast = Directive.parse(exp)[0]
        return new Directive(name, ast, directives[name], compiler, {})
    }

    describe('.parse()', function () {

        it('key', function () {
            var res = Directive.parse('key')
            assert.equal(res.length , 1)
            assert.equal(res[0].key, 'key')
            assert.equal(res[0].expression, 'key')
        })

        it('arg:key', function () {
            var res = Directive.parse('arg:key')
            assert.equal(res.length , 1)
            assert.equal(res[0].key, 'key')
            assert.equal(res[0].arg, 'arg')
            assert.equal(res[0].expression, 'arg:key')
        })

        it('arg : key | abc', function () {
            var res = Directive.parse(' arg : key | abc de')
            assert.equal(res.length , 1)
            assert.equal(res[0].key, 'key')
            assert.equal(res[0].arg, 'arg')
            assert.equal(res[0].expression, 'arg : key | abc de')
            assert.equal(res[0].filters.length, 1)
            assert.equal(res[0].filters[0].name, 'abc')
            assert.equal(res[0].filters[0].args.length, 1)
            assert.equal(res[0].filters[0].args[0], 'de')
        })

        it('a || b | c', function () {
            var res = Directive.parse('a || b | c')
            assert.equal(res.length, 1)
            assert.equal(res[0].key, 'a || b')
            assert.equal(res[0].expression, 'a || b | c')
            assert.equal(res[0].filters.length, 1)
            assert.equal(res[0].filters[0].name, 'c')
            assert.notOk(res[0].filters[0].args)
        })

        it('a ? b : c', function () {
            var res = Directive.parse('a ? b : c')
            assert.equal(res.length, 1)
            assert.equal(res[0].key, 'a ? b : c')
            assert.notOk(res[0].filters)
        })

        it('"a:b:c||d|e|f" || d ? a : b', function () {
            var res = Directive.parse('"a:b:c||d|e|f" || d ? a : b')
            assert.equal(res.length, 1)
            assert.equal(res[0].key, '"a:b:c||d|e|f" || d ? a : b')
            assert.notOk(res[0].filters)
            assert.notOk(res[0].arg)
        })

        it('a, b, c', function () {
            var res = Directive.parse('a, b, c')
            assert.equal(res.length, 3)
            assert.equal(res[0].key, 'a')
            assert.equal(res[1].key, 'b')
            assert.equal(res[2].key, 'c')
        })

        it('a:b | c, d:e | f, g:h | i', function () {
            var res = Directive.parse('a:b | c, d:e | f, g:h | i')
            assert.equal(res.length, 3)

            assert.equal(res[0].arg, 'a')
            assert.equal(res[0].key, 'b')
            assert.equal(res[0].filters.length, 1)
            assert.equal(res[0].filters[0].name, 'c')
            assert.notOk(res[0].filters[0].args)

            assert.equal(res[1].arg, 'd')
            assert.equal(res[1].key, 'e')
            assert.equal(res[1].filters.length, 1)
            assert.equal(res[1].filters[0].name, 'f')
            assert.notOk(res[1].filters[0].args)

            assert.equal(res[2].arg, 'g')
            assert.equal(res[2].key, 'h')
            assert.equal(res[2].filters.length, 1)
            assert.equal(res[2].filters[0].name, 'i')
            assert.notOk(res[2].filters[0].args)
        })

        it('click:test(c.indexOf(d,f),"e,f"), input: d || [e,f], ok:{a:1,b:2}', function () {
            var res = Directive.parse('click:test(c.indexOf(d,f),"e,f"), input: d || [e,f], ok:{a:1,b:2}')
            assert.equal(res.length, 3)
            assert.equal(res[0].arg, 'click')
            assert.equal(res[0].key, 'test(c.indexOf(d,f),"e,f")')
            assert.equal(res[1].arg, 'input')
            assert.equal(res[1].key, 'd || [e,f]')
            assert.notOk(res[1].filters)
            assert.equal(res[2].arg, 'ok')
            assert.equal(res[2].key, '{a:1,b:2}')
        })

    })

    describe('.inlineFilters()', function () {

        it('should inline computed filters', function () {
            var filters = Directive.parse('a | a | b | c d')[0].filters
            var exp = Directive.inlineFilters('this.a + this.b', filters)
            var mock = new Vue({
                filters: {
                    a: function (v) {
                        return v + 'a'
                    },
                    b: function (v) {
                        return v + 'b'
                    },
                    c: function (v, d) {
                        return v + 'c' + d
                    }
                },
                data: {
                    a: 'a',
                    b: 'b'
                }
            })
            var getter = new Function('return ' + exp)
            var res = getter.call(mock)
            assert.strictEqual(res, 'ababcd')
        })

    })

    describe('instantiation', function () {

        it('should copy the definition as update if the def is a function', function () {

            var testDir = function () {}
            directives.test = testDir

            var d = build('test', 'abc', compiler)
            assert.strictEqual(d.update, testDir)
        })

        it('should copy methods if the def is an object', function () {

            var obj = {
                bind: function () {},
                update: function () {},
                unbind: function () {},
                custom: function () {}
            }
            directives.obj = obj

            var d = build('obj', 'abc', compiler)
            assert.strictEqual(d.update, obj.update)
            assert.strictEqual(d.unbind, obj.unbind)
            assert.strictEqual(d.bind, obj.bind)
            assert.strictEqual(d.custom, obj.custom, 'should copy any custom methods')
        })

        it('should trim the expression', function () {
            var exp = ' fsfsef   | fsef a  ',
                d = build('text', exp, compiler)
            assert.strictEqual(d.expression, exp.trim())
        })

        it('should extract correct key', function () {
            var d = build('text', '"fsefse | fsefsef" && bc', compiler),
                e = build('text', '"fsefsf & fsefs" | test', compiler),
                f = build('text', '"fsef:fsefsf" || ff', compiler)
            assert.strictEqual(d.key, '"fsefse | fsefsef" && bc', 'pipe inside quotes and &&')
            assert.strictEqual(e.key, '"fsefsf & fsefs"', '& inside quotes with filter')
            assert.strictEqual(f.key, '"fsef:fsefsf" || ff', ': inside quotes and ||')
        })

        it('should extract correct argument', function () {
            var d = build('text', 'todo:todos', compiler),
                e = build('text', '$todo:todos + abc', compiler),
                f = build('text', '-todo-fsef:todos | fsf fsef', compiler)
            assert.strictEqual(d.arg, 'todo', 'simple')
            assert.strictEqual(e.arg, '$todo', 'expression')
            assert.strictEqual(f.arg, '-todo-fsef', 'with hyphens and filters')
        })

        it('should be able to determine whether the key is an expression', function () {
            var d = build('text', 'abc', compiler),
                e = build('text', '!abc', compiler),
                f = build('text', 'abc + bcd * 5 / 2', compiler),
                g = build('text', 'abc && (bcd || eee)', compiler),
                h = build('text', 'test(abc)', compiler),
                i = build('text', 'a.b', compiler),
                j = build('text', 'a.$b', compiler)
            assert.ok(!d.isExp, 'non-expression')
            assert.ok(e.isExp, 'negation')
            assert.ok(f.isExp, 'math')
            assert.ok(g.isExp, 'logic')
            assert.ok(h.isExp, 'function invocation')
            assert.ok(!i.isExp, 'dot syntax')
            assert.ok(!j.isExp, 'dot syntax with $')
        })

        it('should have a filter prop of null if no filters are present', function () {
            var d = build('text', 'abc', compiler),
                e = build('text', 'abc |', compiler),
                f = build('text', 'abc ||', compiler),
                g = build('text', 'abc | | ', compiler),
                h = build('text', 'abc | unknown | nothing at all | whaaat', compiler)
            assert.strictEqual(d.filters, null)
            assert.strictEqual(e.filters, null, 'single')
            assert.strictEqual(f.filters, null, 'double')
            assert.strictEqual(g.filters, null, 'with spaces')
            assert.strictEqual(h.filters, null, 'with unknown filters')
        })

        it('should extract correct filters (single filter)', function () {
            var d = build('text', 'abc || a + "b|c" | uppercase', compiler),
                f = d.filters[0]
            assert.strictEqual(f.name, 'uppercase')
            assert.strictEqual(f.args, null)
            assert.strictEqual(f.apply('test'), 'TEST')
        })

        it('should extract correct filters (single filter with args)', function () {
            var d = build('text', 'abc + \'b | c | d\' | pluralize item \'arg with spaces\'', compiler),
                f = d.filters[0]
            assert.strictEqual(f.name, 'pluralize', 'name')
            assert.strictEqual(f.args.length, 2, 'args length')
            assert.strictEqual(f.args[0], 'item', 'args value 1')
            assert.strictEqual(f.args[1], '\'arg with spaces\'', 'args value 2')
        })

        it('should extract correct filters (multiple filters)', function () {
            // intentional double pipe
            var d = build('text', 'abc | uppercase "a,b,c" | pluralize item | lowercase', compiler),
                f1 = d.filters[0],
                f2 = d.filters[1],
                f3 = d.filters[2]
            assert.strictEqual(d.filters.length, 3)
            assert.strictEqual(f1.name, 'uppercase')
            assert.strictEqual(f1.args[0], '"a,b,c"')
            assert.strictEqual(f2.name, 'pluralize')
            assert.strictEqual(f2.args[0], 'item')
            assert.strictEqual(f3.name, 'lowercase')
        })

        it('should compile the key if the key contains interpolation tags', function () {
            compiler.eval = makeSpy()
            build('model', '{{abc}} | uppercase', compiler)
            assert.ok(compiler.eval.called)
            assert.equal(compiler.eval.args[0], '{{abc}}')
        })

    })

    describe('.$applyFilters()', function () {

        it('should work', function () {
            var d = build('text', 'abc | pluralize item | capitalize', compiler),
                v = d.$applyFilters(2)
            assert.strictEqual(v, 'Items')
        })

    })

    describe('.$update()', function () {

        var d = build('text', 'abc', compiler),
            updated = false
        d.update = function () {
            updated = true
        }

        it('should call user update() for first time update, even with undefined', function () {
            d.$update(undefined, true)
            assert.strictEqual(updated, true)
        })

        it('should user update() when a different value is given', function () {
            updated = false
            d.$update(123)
            assert.strictEqual(d.value, 123)
            assert.strictEqual(updated, true)
        })

        it('should not call user update() if the value is the same', function () {
            updated = false
            d.$update(123)
            assert.ok(!updated)
        })

        it('should call $applyFilter() is there are filters', function () {
            var filterApplied = false
            d.filters = []
            d.$applyFilters = function () {
                filterApplied = true
            }
            d.$update(234)
            assert.ok(filterApplied)
        })

    })

    describe('.$unbind()', function () {

        var d = build('text', 'abc', compiler),
            unbound = false,
            val
        d.unbind = function (v) {
            val = v
            unbound = true
        }

        it('should not work if it has no element yet', function () {
            d.el = null
            d.$unbind()
            assert.strictEqual(unbound, false)
        })

        it('should call user unbind() and null everything if it has an element', function () {
            d.el = true
            d.$unbind()
            assert.strictEqual(unbound, true)
            assert.ok(d.el === null && d.vm === null && d.binding === null && d.compiler === null)
        })

        it('should not execute if called more than once', function () {
            unbound = false
            d.$unbind()
            assert.notOk(unbound)
        })

    })

    describe('empty directive', function () {

        it('should copy as bind() if the def is a function', function () {
            var called = 0
            function call () {
                called++
            }
            Vue.directive('empty-dir-test1', call)
            var d = build('empty-dir-test1', '', compiler)
            d.bind()
            assert.strictEqual(called, 1)
        })

        it('should copy/delegate bind and unbind if the def is an object', function () {
            var called = 0
            function call () {
                called++
            }
            Vue.directive('empty-dir-test2', {
                bind: call,
                unbind: call
            })
            var d = build('empty-dir-test2', '', compiler, true)
            d.bind()
            d.unbind()
            assert.strictEqual(called, 2)
        })

    })

})


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace QBitNinja
{
    internal class ReaderWriterLock
    {
        ReaderWriterLockSlim @lock = new ReaderWriterLockSlim();

        public IDisposable LockRead()
        {
            return new ActionDisposable(() => @lock.EnterReadLock(), () => @lock.ExitReadLock());
        }
        public IDisposable LockWrite()
        {
            return new ActionDisposable(() => @lock.EnterWriteLock(), () => @lock.ExitWriteLock());
        }

        internal bool TryLockWrite(out IDisposable locked)
        {
            locked = null;
            if(this.@lock.TryEnterWriteLock(0))
            {
                locked = new ActionDisposable(() =>
                {
                }, () => this.@lock.ExitWriteLock());
                return true;
            }
            return false;
        }
    }
}