text:
package org.xmlsoap.schemas.ws._2003._03.addressing;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the org.xmlsoap.schemas.ws._2003._03.addressing package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _EndpointReference_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "EndpointReference");
    private final static QName _Recipient_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "Recipient");
    private final static QName _To_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "To");
    private final static QName _MessageID_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "MessageID");
    private final static QName _FaultTo_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "FaultTo");
    private final static QName _RelatesTo_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "RelatesTo");
    private final static QName _Action_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "Action");
    private final static QName _ReplyTo_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "ReplyTo");
    private final static QName _From_QNAME = new QName("http://schemas.xmlsoap.org/ws/2003/03/addressing", "From");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.xmlsoap.schemas.ws._2003._03.addressing
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link Relationship }
     *
     */
    public Relationship createRelationship() {
        return new Relationship();
    }

    /**
     * Create an instance of {@link AttributedQName }
     *
     */
    public AttributedQName createAttributedQName() {
        return new AttributedQName();
    }

    /**
     * Create an instance of {@link EndpointReferenceType }
     *
     */
    public EndpointReferenceType createEndpointReferenceType() {
        return new EndpointReferenceType();
    }

    /**
     * Create an instance of {@link ReferencePropertiesType }
     *
     */
    public ReferencePropertiesType createReferencePropertiesType() {
        return new ReferencePropertiesType();
    }

    /**
     * Create an instance of {@link ServiceNameType }
     *
     */
    public ServiceNameType createServiceNameType() {
        return new ServiceNameType();
    }

    /**
     * Create an instance of {@link AttributedURI }
     *
     */
    public AttributedURI createAttributedURI() {
        return new AttributedURI();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EndpointReferenceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "EndpointReference")
    public JAXBElement<EndpointReferenceType> createEndpointReference(EndpointReferenceType value) {
        return new JAXBElement<EndpointReferenceType>(_EndpointReference_QNAME, EndpointReferenceType.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EndpointReferenceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "Recipient")
    public JAXBElement<EndpointReferenceType> createRecipient(EndpointReferenceType value) {
        return new JAXBElement<EndpointReferenceType>(_Recipient_QNAME, EndpointReferenceType.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AttributedURI }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "To")
    public JAXBElement<AttributedURI> createTo(AttributedURI value) {
        return new JAXBElement<AttributedURI>(_To_QNAME, AttributedURI.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AttributedURI }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "MessageID")
    public JAXBElement<AttributedURI> createMessageID(AttributedURI value) {
        return new JAXBElement<AttributedURI>(_MessageID_QNAME, AttributedURI.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EndpointReferenceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "FaultTo")
    public JAXBElement<EndpointReferenceType> createFaultTo(EndpointReferenceType value) {
        return new JAXBElement<EndpointReferenceType>(_FaultTo_QNAME, EndpointReferenceType.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link Relationship }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "RelatesTo")
    public JAXBElement<Relationship> createRelatesTo(Relationship value) {
        return new JAXBElement<Relationship>(_RelatesTo_QNAME, Relationship.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link AttributedURI }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "Action")
    public JAXBElement<AttributedURI> createAction(AttributedURI value) {
        return new JAXBElement<AttributedURI>(_Action_QNAME, AttributedURI.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EndpointReferenceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "ReplyTo")
    public JAXBElement<EndpointReferenceType> createReplyTo(EndpointReferenceType value) {
        return new JAXBElement<EndpointReferenceType>(_ReplyTo_QNAME, EndpointReferenceType.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link EndpointReferenceType }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing", name = "From")
    public JAXBElement<EndpointReferenceType> createFrom(EndpointReferenceType value) {
        return new JAXBElement<EndpointReferenceType>(_From_QNAME, EndpointReferenceType.class, null, value);
    }

}


text:
LEVEL := ..
include $(LEVEL)/Makefile.common

INC_DIRS=-I$(SRC_ROOT)/include/ -I$(OBJ_ROOT)/include -I.
STD_LIBS=-lsupc++ -lpthread -lstdc++ -lrt
TERN_LIBS=-L$(OBJ_ROOT)/lib/ -lruntime -lcommon
CFLAGS += $(INC_DIRS)
CXXFLAGS += $(INC_DIRS)
HOOK_DIR=$(SRC_ROOT)/dync_hook

all:: interpose.so libxtern-annot.so

interpose.so: template.cpp spec_hooks.cpp hook.cpp
	gcc -fPIC -rdynamic $(HOOK_DIR)/hook.cpp $(CFLAGS) -c -o interpose.o
	gcc $(CFLAGS) -shared -Wl,-soname,interpose.so interpose.o -o interpose.so -ldl $(TERN_LIBS) $(STD_LIBS)

libxtern-annot.so: xtern-annot.cpp
	gcc -fPIC -rdynamic $(HOOK_DIR)/xtern-annot.cpp $(CFLAGS) -c -o xtern-annot.o
	gcc $(CFLAGS) -shared -Wl,-soname,libxtern-annot.so xtern-annot.o -o libxtern-annot.so -ldl $(TERN_LIBS) $(STD_LIBS)

%.o: %.cpp
	$(CXX) $(INCLUDES) $(CXXFLAGS) -c $

code_gen: code_gen.cpp
	g++ $^ $(CXXFLAGS) -o code_gen -ldl

template.cpp: code_gen func_template.cpp void_func_template.cpp hook_func.def
	./code_gen $(HOOK_DIR)/func_template.cpp $(HOOK_DIR)/void_func_template.cpp < $(HOOK_DIR)/hook_func.def

clean::
	rm -rf *.o
	rm -rf *.so
	rm -rf code_gen template.cpp
	rm -rf $(HOOK_DIR)/*.o
	rm -rf $(HOOK_DIR)/*.so
	rm -rf $(HOOK_DIR)/code_gen $(HOOK_DIR)/template.cpp

install::
	cp *.so $(HOOK_DIR)

redpajama_set_name: RedPajamaGithub


text:
Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining.

Note:
Both m and n are less than 110. The height of each unit cell is greater than 0 and is less than 20,000.

Example:
```
Given the following 3x6 height map:
[
  [1,4,3,1,3,2],
  [3,2,1,3,2,4],
  [2,3,3,2,3,1]
]

Return 4.
```
The above image represents the elevation map [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]] before the rain.

After the rain, water is trapped between the blocks. The total volume of water trapped is 4.


text:
import React from 'react';

const style = {
  backgroundColor: 'aliceblue',
  fontSize: 16,
  lineHeight: 1.5,
  marginLeft: 15
};

const Highlighted = (props) => (
  <span style={style} { ...props } />
);

export default Highlighted;


text:
FAB-Loading [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FAB--Loading-green.svg?style=flat)](https://android-arsenal.com/details/1/2418)
==========================
A loading animation based on Floating Action Button.

 ![Marvel Sample Screenshots][1]

 ![FAB-Loading Sample Screenshots][2]

Usage
=====
 1. Include the `LoadingView` widget in your view:
  ```
  <io.saeid.fabloading.LoadingView
      android:id="@+id/loading_view"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:scaleX="1.5" //(optional)
      android:scaleY="1.5" // (optional)
      app:mfl_onclickLoading="true" //(optional)
      app:mfl_duration="200" //(optional)
      app:mfl_repeat="4" //(optional)
      />
```
  2.Add your loading items.

     *Note that there are four types of loading animation, `LoadingView.FROM_LEFT`, `LoadingView.FROM_TOP`,          `LoadingView.FROM_RIGHT`, `LoadingView.FROM_BOTTOM`.*
  ```
    mLoadingView = (LoadingView) findViewById(R.id.loading_view);
    mLoadingView.addAnimation(yourColor,yourDrawable,yourLoadingType);

    //also you can add listener for getting callback (optional)
    mLoadingView.addListener(new LoadingView.LoadingListener() {
           @Override public void onAnimationStart(int currentItemPosition) {
           }

           @Override public void onAnimationRepeat(int nextItemPosition) {
           }

           @Override public void onAnimationEnd(int nextItemPosition) {
           }
          });
  ```

  3.Call  `mLoadingView.startAnimation();` whenever you want to start animation.

XML Attributes
-------
| XML Attribute | Related Method | Description |
|:---|:---|:---|
| mfl_onclickLoading | ... | Start animation by clicking FAB. (default is false) |
| mfl_duration | setDuration(int duration) | Set duration for each loading item. (default is 500 millis) |
| mfl_repeat | setRepeat(int repeat) | For values greater than 1, it calls next animations automatically for 'repeat-1' times. (default is 1) |

Installation
-------
```
compile 'io.saeid:fab-loading:0.6.0'
```

Credits
=====
Inspired by : http://www.materialup.com/posts/marvel-avengers-loading-animation

License
=====
```
Copyright 2015 Saeed Masoumi.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
[1]: https://raw.githubusercontent.com/smasoumi/FAB-Loading/master/images/marvel_loader.gif
[2]: https://raw.githubusercontent.com/smasoumi/FAB-Loading/master/images/preview.gif


text:
package org.chocosolver.solver.constraints.nary.count;

import gnu.trove.map.hash.THashMap;
import org.chocosolver.solver.Solver;
import org.chocosolver.solver.constraints.Propagator;
import org.chocosolver.solver.constraints.PropagatorPriority;
import org.chocosolver.solver.exception.ContradictionException;
import org.chocosolver.solver.variables.IntVar;
import org.chocosolver.solver.variables.events.IntEventType;
import org.chocosolver.util.ESat;
import org.chocosolver.util.tools.ArrayUtils;

/**
 * Define a COUNT constraint setting size{forall v in lvars | v = occval} = occVar
 * assumes the occVar variable to be the last of the variables of the constraint:
 * vars = [lvars | occVar]
 * Arc Consistent algorithm
 * with  lvars = list of variables for which the occurrence of occval in their domain is constrained
 * <br/>
 *
 * @author Jean-Guillaume Fages
 */
public class PropCountVar extends Propagator<IntVar> {

    //***********************************************************************************
    // VARIABLES
    //***********************************************************************************

    private int n;
    private IntVar val, card;

    //***********************************************************************************
    // CONSTRUCTORS
    //***********************************************************************************

    /**
     * Propagator for Count Constraint for integer variables
     * Performs Arc Consistency
     *
     * @param decvars an array of integer variables
     * @param restrictedValue integer variable
     * @param valueCardinality integer variable
     */
    public PropCountVar(IntVar[] decvars, IntVar restrictedValue, IntVar valueCardinality) {
        super(ArrayUtils.append(decvars, new IntVar[]{valueCardinality, restrictedValue}), PropagatorPriority.QUADRATIC, false);
        this.n = decvars.length;
        this.card = this.vars[n];
        this.val = this.vars[n + 1];
    }

    @Override
    public String toString() {
        StringBuilder st = new StringBuilder();
        st.append("PropCountVar_(");
        int i = 0;
        for (; i < Math.min(4, vars.length); i++) {
            st.append(vars[i].getName()).append(", ");
        }
        if (i < vars.length - 2) {
            st.append("...,");
        }
        st.append(vars[vars.length - 1].getName()).append(")");
        return st.toString();
    }

    //***********************************************************************************
    // PROPAGATION
    //***********************************************************************************

    @Override
    public void propagate(int evtmask) throws ContradictionException {
        int minCard = Integer.MAX_VALUE / 10;
        int maxCard = -minCard;
        int cardLB = card.getLB();
        int cardUB = card.getUB();
        for (int value = val.getLB(); value <= val.getUB(); value = val.nextValue(value)) {
            int min = 0;
            int max = 0;
            for (int i = 0; i < n; i++) {
                IntVar v = vars[i];
                if (v.contains(value)) {
                    max++;
                    if (v.isInstantiated()) {
                        min++;
                    }
                }
            }
            if (cardLB > max || cardUB < min) {
                val.removeValue(value, aCause);
            } else {
                minCard = Math.min(minCard, min);
                maxCard = Math.max(maxCard, max);
            }
        }
        card.updateLowerBound(minCard, aCause);
        card.updateUpperBound(maxCard, aCause);
        if (val.isInstantiated() && card.isInstantiated()) {
            int nb = card.getValue();
            int value = val.getValue();
            if (maxCard == nb) {
                for (int i = 0; i < n; i++) {
                    if (vars[i].contains(value)) {
                        vars[i].instantiateTo(value, aCause);
                    }
                }
                setPassive();
            } else if (minCard == nb) {
                int nbInst = 0; // security
                for (int i = 0; i < n; i++) {
                    if (vars[i].contains(value)) {
                        if (vars[i].isInstantiated()) {
                            nbInst++;
                        } else {
                            vars[i].removeValue(value, aCause);
                        }
                    }
                }
                card.instantiateTo(nbInst, aCause);
            }
        }
    }

    //***********************************************************************************
    // INFO
    //***********************************************************************************

    @Override
    public int getPropagationConditions(int vIdx) {
        if (vIdx == n) {// cardinality variables
            return IntEventType.boundAndInst();
        }
        return IntEventType.all();
    }

    @Override
    public ESat isEntailed() {
        boolean support = false;
        boolean instSupport = false;
        for (int value = val.getLB(); value <= val.getUB(); value = val.nextValue(value)) {
            int min = 0;
            int max = 0;
            for (int i = 0; i < n; i++) {
                IntVar v = vars[i];
                if (v.contains(value)) {
                    max++;
                    if (v.isInstantiated()) {
                        min++;
                    }
                }
            }
            if (card.getLB() <= max && card.getUB() >= min) {
                support = true;
                if (min == max) {
                    instSupport = true;
                }
            }
        }
        if (!support) {
            return ESat.FALSE;
        }
        if (val.isInstantiated() && instSupport && card.isInstantiated()) {
            return ESat.TRUE;
        }
        return ESat.UNDEFINED;
    }

    @Override
    public void duplicate(Solver solver, THashMap<Object, Object> identitymap) {
        if (!identitymap.containsKey(this)) {
            int size = this.vars.length - 2;
            IntVar[] aVars = new IntVar[size];
            for (int i = 0; i < size; i++) {
                this.vars[i].duplicate(solver, identitymap);
                aVars[i] = (IntVar) identitymap.get(this.vars[i]);
            }
            this.vars[size - 1].duplicate(solver, identitymap);
            IntVar aVar1 = (IntVar) identitymap.get(this.vars[size - 1]);
            this.vars[size].duplicate(solver, identitymap);
            IntVar aVar2 = (IntVar) identitymap.get(this.vars[size]);
            identitymap.put(this, new PropCountVar(aVars, aVar2, aVar1));
        }
    }
}


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

package org.jumlabs.jcr.oak.rpc.api;

import javax.jcr.Credentials;
import javax.jcr.GuestCredentials;
import javax.jcr.NoSuchWorkspaceException;
import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.security.auth.login.LoginException;
import org.apache.jackrabbit.oak.api.CommitFailedException;
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.thrift.TException;
import org.jumlabs.jcr.oak.rpc.TestUtils;
import org.jumlabs.jcr.oak.rpc.util.RepositoryUtils;
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 *
 * @author otto
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/META-INF/spring/spring-config.xml")
public class JCRRepositoryTests {
    @Autowired
    private Repository repository;

    @Autowired
    private Credentials adminCredentials;

    @Test
    public void testRepositoryInitialized(){
        assertNotNull(repository);
    }

    @Test
    public void testRepositorySession() {
        Session session = null;
        try{
            session = repository.login(adminCredentials);
            String nodePath = "/jcr:system";
            Node node = session.getNode(nodePath);
            assertEquals(nodePath, node.getPath());
        } catch (RepositoryException ex){
            fail(ex.getMessage());
        }
        finally{
           if(session != null){
                session.logout();
           }
        }

    }
}


text:
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using Viticulture.Logic.Pieces;
using Viticulture.Logic.State;

namespace Viticulture.Screens.Game.Cellar
{
    [Export(typeof(ICellarViewModel))]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public class CellarViewModel : ViewModel, ICellarViewModel
    {
        private readonly IGameState _gameState;

        [ImportingConstructor]
        public CellarViewModel(IGameState gameState)
        {
            _gameState = gameState;
        }

        public IEnumerable<Wine> RedWines1 => _gameState.RedWines.Take(3);
        public IEnumerable<Wine> RedWines2 => _gameState.RedWines.Skip(3).Take(3);
        public IEnumerable<Wine> RedWines3 => _gameState.RedWines.Skip(6).Take(3);
        public IEnumerable<Wine> WhiteWines1 => _gameState.WhiteWines.Take(3);
        public IEnumerable<Wine> WhiteWines2 => _gameState.WhiteWines.Skip(3).Take(3);
        public IEnumerable<Wine> WhiteWines3 => _gameState.WhiteWines.Skip(6).Take(3);
        public IEnumerable<Wine> BlushWines1 => _gameState.BlushWines.Take(3);
        public IEnumerable<Wine> BlushWines2 => _gameState.BlushWines.Skip(3).Take(3);
        public IEnumerable<Wine> SparklingWines => _gameState.SparklingWines;
    }
}


text:
OpenLayers Application Setup Generator
============

Creates a basic OpenLayers application setup

Install
------------
`npm install -g ol-app-setup`

Usage
--------

See `ol-app-setup --help` for detailed usage.

    Usage: ol-app-setup [options]

    Options:

    -h, --help                      output usage information
    -t, --target <folder>           Path to create the app within (required)
    -v, --olversion <majorversion>  Defines the library profile to be used for the app setup. Valid options are "ol3" and "ol2". (Default is "ol3")
    -j, --jquery                    Includes jQuery in your app setup
    -b, --bootstrap                 Includes bootstrap in your app setup
    -s, --server                    Start an internal web server on localhost:8888

Example calls
-----------------
Create a simple OpenLayers 3 app

`ol-app-setup -t /tmp/foo`

Create a simple OpenLayers 2 app

`ol-app-setup -t /tmp/foo -v ol2`

Create an ol3 app with jQuery and bootstrap

`ol-app-setup -t /tmp/foo -v ol3 --jquery --bootstrap`

Create an ol3 app and start an internal web server to explore the map

`ol-app-setup -t /tmp/foo -v ol3 -s`


text:
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Extensions;

namespace osu.Game.Overlays.Music
{
    public class PlaylistOverlay : OverlayContainer
    {
        private const float transition_duration = 600;

        private const float playlist_height = 510;

        private FilterControl filter;
        private PlaylistList list;

        private TrackManager trackManager;
        private BeatmapDatabase beatmaps;

        private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();

        public IEnumerable<BeatmapSetInfo> BeatmapSets;

        [BackgroundDependencyLoader]
        private void load(OsuGameBase game, BeatmapDatabase beatmaps, OsuColour colours)
        {
            this.beatmaps = beatmaps;
            trackManager = game.Audio.Track;

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    CornerRadius = 5,
                    Masking = true,
                    EdgeEffect = new EdgeEffect
                    {
                        Type = EdgeEffectType.Shadow,
                        Colour = Color4.Black.Opacity(40),
                        Radius = 5,
                    },
                    Children = new Drawable[]
                    {
                        new Box
                        {
                            Colour = colours.Gray3,
                            RelativeSizeAxes = Axes.Both,
                        },
                        list = new PlaylistList
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding = new MarginPadding { Top = 95, Bottom = 10, Right = 10 },
                            OnSelect = itemSelected,
                        },
                        filter = new FilterControl
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes = Axes.Y,
                            ExitRequested = () => State = Visibility.Hidden,
                            FilterChanged = search => list.Filter(search),
                            Padding = new MarginPadding(10),
                        },
                    },
                },
            };

            list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList();

            beatmapBacking.BindTo(game.Beatmap);
        }

        protected override void LoadComplete()
        {
            base.LoadComplete();
            beatmapBacking.ValueChanged += b => list.SelectedItem = b?.BeatmapSetInfo;
            beatmapBacking.TriggerChange();
        }

        protected override void PopIn()
        {
            filter.Search.HoldFocus = true;
            Schedule(() => filter.Search.TriggerFocus());

            ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint);
            FadeIn(transition_duration, EasingTypes.OutQuint);
        }

        protected override void PopOut()
        {
            filter.Search.HoldFocus = false;

            ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint);
            FadeOut(transition_duration);
        }

        private void itemSelected(BeatmapSetInfo set)
        {
            if (set.ID == (beatmapBacking.Value?.BeatmapSetInfo?.ID ?? -1))
            {
                beatmapBacking.Value?.Track?.Seek(0);
                return;
            }

            playSpecified(set.Beatmaps[0]);
        }

        public void PlayPrevious()
        {
            var currentID = beatmapBacking.Value?.BeatmapSetInfo.ID ?? -1;
            var available = BeatmapSets.Reverse();

            var playable = available.SkipWhile(b => b.ID != currentID).Skip(1).FirstOrDefault() ?? available.FirstOrDefault();

            if (playable != null)
                playSpecified(playable.Beatmaps[0]);
        }

        public void PlayNext()
        {
            var currentID = beatmapBacking.Value?.BeatmapSetInfo.ID ?? -1;
            var available = BeatmapSets;

            var playable = available.SkipWhile(b => b.ID != currentID).Skip(1).FirstOrDefault() ?? available.FirstOrDefault();

            if (playable != null)
                playSpecified(playable.Beatmaps[0]);
        }

        private void playSpecified(BeatmapInfo info)
        {
            beatmapBacking.Value = beatmaps.GetWorkingBeatmap(info, beatmapBacking);

            Task.Run(() =>
            {
                var track = beatmapBacking.Value.Track;
                trackManager.SetExclusive(track);
                track.Start();
            }).ContinueWith(task => Schedule(task.ThrowIfFaulted), TaskContinuationOptions.OnlyOnFaulted);
        }
    }

    //todo: placeholder
    public enum PlaylistCollection
    {
        All
    }
}


text:
/**
 * Out-of-API Methods
 * @license MIT
 * @description This is the definition bridge for OOAPI methods.
 *        Please always include it
 **/
var __OOAPI = new function () {
  var channels = {};

  function dispatchMessage (msg) {
    if (channels.hasOwnProperty(msg.channel)) {
      for(var i = 0; i < channels[msg.channel].listeners.length; i++) {
        try {
          channels[msg.channel].listeners[i](msg.payload);
        } catch(e) {
          if (e.stack) {
            __trace(e.stack.toString(), 'err');
          } else {
            __trace(e.toString(), 'err');
          }
        }
      }
    } else {
      __trace('Got message on channel "' + msg.channel +
        '" but channel does not exist.', 'warn');
    }
  };

  self.addEventListener('message', function (event) {
    if (!event) {
      return;
    }
    try {
      var msg = JSON.parse(event.data);
    } catch (e) {
      __trace(e, 'err');
      return;
    }
    if (msg !== null && msg.hasOwnProperty('channel') &&
      typeof msg.channel === 'string') {
      dispatchMessage(msg);
    } else {
      __trace(msg, 'warn');
    }
  });

  this.listChannels = function () {
    var chl = {};
    for (var chan in channels) {
      chl[chan] = {
        'max': channels[chan].max,
        'listeners': channels[chan].listeners.length
      };
    }
    return chl;
  };

  this.deleteChannel = function (channelId, authToken){
    if (!(channelId in channels)) {
      return true;
    }
    if (authToken || channels[channelId].auth) {
      if (authToken === channels[channelId].auth) {
        delete channels[channelId];
        return true;
      }
      return false;
    } else {
      delete channels[channelId];
      return true;
    }
  };

  this.createChannel = function (channelId, maximum, authToken) {
    if (!(channelId in channels)) {
      channels[channelId] = {
        'max': maximum ? maximum : 0,
        'auth': authToken,
        'listeners': []
      };
      return true;
    }
    return false;
  };

  this.addListenerChannel = function (channel, listener) {
    if (!(channel in channels)) {
      channels[channel] = {
        'max': 0,
        'listeners': []
      };
    }
    if (channels[channel].max > 0) {
      if (channels[channel].listeners.length >=
        channels[channel].max) {
        return false;
      }
    }
    channels[channel].listeners.push(listener);
    return true;
  };
};

function __trace (obj, traceMode) {
  self.postMessage(JSON.stringify({
    'channel': '',
    'obj': obj,
    'mode': (traceMode ? traceMode : 'log')
  }));
};

function __channel (id, payload, callback) {
  self.postMessage(JSON.stringify({
    'channel': id,
    'payload': payload,
    'callback': true
  }));
  __OOAPI.addListenerChannel(id, callback);
};

function __schannel (id, callback) {
  __OOAPI.addListenerChannel(id, callback);
};

function __pchannel (id, payload) {
  self.postMessage(JSON.stringify({
    'channel': id,
    'payload': payload,
    'callback': false
  }));
};

function __achannel (id, auth, payload) {
  self.postMessage(JSON.stringify({
    'channel': id,
    'auth': auth,
    'payload': payload,
    'callback': false
  }));
};


text:
package service

import (
	"testing"

	"github.com/banerwai/global/bean"
	"gopkg.in/mgo.v2/bson"
)

func TestResumeBase(t *testing.T) {

	var _service ResumeService

	var _obj bean.Resume
	_obj.ID = bson.ObjectIdHex("5707cb10ae6faa1d1071a189")
	_obj.AuthEmail = "ministor@126.com"
	_obj.UserID = bson.ObjectIdHex("5707cb10ae6faa1d1071a189")

	_obj.Phone = "12345678901"

	var lsToolandArchs []bean.ToolandArch

	var _tool1 bean.ToolandArch
	_tool1.ToolLevel = 5
	_tool1.ToolTitle = "Java"
	lsToolandArchs = append(lsToolandArchs, _tool1)

	var _tool2 bean.ToolandArch
	_tool2.ToolLevel = 2
	_tool2.ToolTitle = "Go"
	lsToolandArchs = append(lsToolandArchs, _tool2)

	_obj.ToolandArchs = lsToolandArchs

	v := _service.AddResumeBean(_obj)
	if !bson.IsObjectIdHex(v) {
		t.Errorf(v)
	}

	var _tool3 bean.ToolandArch
	_tool3.ToolLevel = 1
	_tool3.ToolTitle = ".Net"
	lsToolandArchs = append(lsToolandArchs, _tool3)

	_obj.ToolandArchs = lsToolandArchs

	var lsSkillExperiences []bean.SkillExperience

	var _skill1 bean.SkillExperience
	_skill1.SkillLevel = 5
	_skill1.SkillTitle = "Java"
	lsSkillExperiences = append(lsSkillExperiences, _skill1)

	_obj.SkillExperiences = lsSkillExperiences

	userID := "5707cb10ae6faa1d1071a189"

	v = _service.UpdateResumeBean(userID, _obj)

	if v != "OK" {
		t.Errorf("UpdateResumeBean error")
	}

	_mapUpdate := make(map[string]string)
	_mapUpdate["auth_email"] = "ministor@126.com"
	_mapUpdate["phone"] = "13811111111"

	v = _service.UpdateResumeBase(userID, _mapUpdate)

	if v != "OK" {
		t.Errorf("UpdateResumeBase error")
	}

	var lsEducationes []bean.Education

	var _edu1 bean.Education
	_edu1.Degree = "degree"
	_edu1.Description = "description"
	lsEducationes = append(lsEducationes, _edu1)

	v = _service.UpdateResumeEducationsBean(userID, lsEducationes)

	_bean := _service.GetResumeBean(userID)

	if _bean.AuthEmail != "ministor@126.com" {
		t.Errorf("GetResumeBean error")
	}
	if len(_bean.ToolandArchs) != 3 {
		t.Errorf("GetResumeBean error")
	}
}


text:
require 'spec_helper'

RSpec.describe Github::Client::Gists, '#starred?' do
  let(:gist_id) { 1 }
  let(:request_path) { "/gists/#{gist_id}/star" }
  let(:body) { '' }
  let(:status) { 204 }

  before {
    stub_get(request_path).to_return(:body => body, :status => status,
      :headers => {:content_type => "application/json; charset=utf-8"})
  }

  after { reset_authentication_for(subject) }

  context 'when gist is starred' do
    let(:status) { 204 }

    it { expect { subject.starred? }.to raise_error(ArgumentError) }

    it 'raises error if gist id not present' do
      expect { subject.starred? nil }.to raise_error(ArgumentError)
    end

    it 'performs request' do
      subject.starred? gist_id
      expect(a_get(request_path)).to have_been_made
    end

    it 'returns true if gist is already starred' do
      expect(subject.starred?(gist_id)).to be_true
    end
  end

  context 'when gist is not starred' do
    let(:status) { 404 }

    it 'returns false if gist is not starred' do
      expect(subject.starred?(gist_id)).to be_false
    end
  end
end # starred?


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

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

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
-#}
{% extends 'forgewiki:templates/wiki/master.html' %}
{% do g.register_forge_css('css/forge/hilite.css', compress=False) %}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}

{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / {{page.title}}{% endblock %}

{% block header %}{{page.title}}{% if page['deleted'] %} (deleted){% endif %}{% endblock %}

{% block extra_css %}

{% endblock %}

{% block head %}
<link rel="alternate" type="application/rss+xml" title="Page RSS" href="feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Page Atom" href="feed.atom"/>
<link rel="alternate" type="application/rss+xml" title="Wiki RSS" href="../feed.rss"/>
<link rel="alternate" type="application/atom+xml" title="Wiki Atom" href="../feed.atom"/>
{% endblock %}
{% block body_css_class %} {{super()}} wiki-{{(page.title).replace(' ','_')}}{% endblock %}

{% block actions %}
  {% if not page['deleted'] %}
      {% if h.has_access(page, 'edit') %}
        {{ g.icons['edit'].render(href='edit', show_title=True) }}
      {% elif c.user.is_anonymous() and h.is_allowed_by_role(page, 'edit', '*authenticated', c.project) %}
          Log in to Edit
      {% endif %}
      {{ g.icons['history'].render(href='history') }}
  {% elif h.has_access(page, 'delete')() %}
    {{ g.icons['undelete'].render(extra_css='post-link') }}

        {{ g.icons['close'].render(tag='b', extra_css='close') }}

Confirm page restoration

            Do you really want to restore the page?
            You can undo it later.

            <button class="continue_confirm" href="./undelete">Yes</button>
            <input type="button" value="Cancel" class="cancel_confirmation close">

  {% endif %}
  {% if c.user and c.user != c.user.anonymous() %}
    {{c.subscribe_form.display(value=page_subscribed, action='subscribe', style='icon')}}
  {% endif %}
  {{ g.icons['feed'].render(href='feed', title='RSS') }}
  {{ g.icons['search'].render(href='../search') }}
{% endblock %}

{% block wiki_content %}
{{page.html_text}}
{% endblock %}

{% block wiki_meta %}

  {% if page.labels %}

    Labels:
    {% for label in page.labels %}
      {% if label != '' %}
        {{label}} ({{page.artifacts_labeled_with(label, page.app_config).count()}})
      {% endif %}
    {% endfor %}

  {% endif %}

    Authors:
    {% for author in page.authors() %}
      {{lib.user_link(author, avatar=True)}}
    {% endfor %}

   {% if page.attachments %}

        Attachments
        {% for att in page.attachments %}

                {{att.filename}}
                ({{att.length}} bytes)

        {% endfor %}

  {% endif %}

{% endblock %}

{% block after_content %}

  {{lib.related_artifacts(page)}}
  {% if page.discussion_thread and c.app.show_discussion %}
      {% if h.has_access(page, 'post')() or page.discussion_thread.num_replies > 0 %}

Discussion

          {% set thread = page.discussion_thread %}

{{ c.thread.display(value=thread,page=pagenum,limit=limit,count=count) }}

      {% endif %}
  {% endif %}
  {{c.confirmation.display(content='')}}
{% endblock %}


text:
module AutobotsLicense
  class Copyright
    def initialize(app)
      @app = app
    end

    def call(env)
      status, headers, response = @app.call(env)
      headers["X-Powered-By"] = "Autobots"

      [status, headers, response]
    end
  end
end


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrganizationsTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('organizations', function($table)
        {
            $table->increments('id');
            $table->timestamps();

            $table->string('name', 150);
            $table->string('logo', 45);
            $table->string('url', 150);
            $table->string('address', 150);
            $table->string('city', 45);
            $table->string('state', 45);
            $table->string('postal_code', 45);
            $table->string('country', 45);
            $table->string('short_code', 45);
            $table->string('email', 150);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('organizations');
    }

}


text:
cd ioping-0.8/
make
make install
./bench.py --deps


text:
<?xml version="1.0" encoding="utf-8"?>
<Monster xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Name>queen bee</Name>
  <Attack1>Sting 1d8 poisonous</Attack1>
  <Difficulty>12</Difficulty>
  <BaseLevel>9</BaseLevel>
  <BaseExperience>225</BaseExperience>
  <Speed>24</Speed>
  <BaseAC>-4</BaseAC>
  <BaseMR>0</BaseMR>
  <Alignment>0 (neutral)</Alignment>
  <Frequency>(by normal means) 0 (Not randomly generated)</Frequency>
  <GenoCidable>Yes</GenoCidable>
  <Weight>1</Weight>
  <NutritionalValue>5</NutritionalValue>
  <Size>Tiny</Size>
  <Resistances>conveyed Poison (60%)</Resistances>
  <ResistancesConveyed>Poison (60%)</ResistancesConveyed>
  <Characteristics>
    <string>can fly. </string>
    <string>has no hands. </string>
    <string>is an animal. </string>
    <string>can lay eggs. </string>
    <string>is poisonous to eat. </string>
    <string>does not eat. (*) </string>
    <string>is an overlord to its kind. </string>
    <string>is female. </string>
    <string>is normally generated hostile.</string>
  </Characteristics>
</Monster>


text:
"""Tests which check the various ways you can set DJANGO_SETTINGS_MODULE

If these tests fail you probably forgot to install django-configurations.
"""
import sys
import pytest

# importing configurations fails on 2.5, even though it might be installed
if sys.version_info < (2, 6):
    pytest.skip('django-configurations is not supported on Python < 2.6')

pytest.importorskip('configurations')

BARE_SETTINGS = '''
from configurations import Settings

class MySettings(Settings):
    # At least one database must be configured
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': ':memory:'
        },
    }

    SECRET_KEY = 'foobar'
'''

def test_dc_env(testdir, monkeypatch):
    monkeypatch.setenv('DJANGO_SETTINGS_MODULE', 'tpkg.settings_env')
    monkeypatch.setenv('DJANGO_CONFIGURATION', 'MySettings')

    pkg = testdir.mkpydir('tpkg')
    settings = pkg.join('settings_env.py')
    settings.write(BARE_SETTINGS)
    testdir.makepyfile("""
        import os

        def test_settings():
            assert os.environ['DJANGO_SETTINGS_MODULE'] == 'tpkg.settings_env'
            assert os.environ['DJANGO_CONFIGURATION'] == 'MySettings'
    """)
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(['*1 passed*'])

def test_dc_ini(testdir, monkeypatch):
    monkeypatch.setenv('DJANGO_SETTINGS_MODULE', 'DO_NOT_USE')
    monkeypatch.setenv('DJANGO_CONFIGURATION', 'DO_NOT_USE')

    testdir.makeini("""
       [pytest]
       DJANGO_SETTINGS_MODULE = tpkg.settings_ini
       DJANGO_CONFIGURATION = MySettings
    """)
    pkg = testdir.mkpydir('tpkg')
    settings = pkg.join('settings_ini.py')
    settings.write(BARE_SETTINGS)
    testdir.makepyfile("""
        import os

        def test_ds():
            assert os.environ['DJANGO_SETTINGS_MODULE'] == 'tpkg.settings_ini'
            assert os.environ['DJANGO_CONFIGURATION'] == 'MySettings'
    """)
    result = testdir.runpytest()
    result.stdout.fnmatch_lines(['*1 passed*'])

def test_dc_option(testdir, monkeypatch):
    monkeypatch.setenv('DJANGO_SETTINGS_MODULE', 'DO_NOT_USE_env')
    monkeypatch.setenv('DJANGO_CONFIGURATION', 'DO_NOT_USE_env')

    testdir.makeini("""\
       [pytest]
       DJANGO_SETTINGS_MODULE = DO_NOT_USE_ini
       DJANGO_CONFIGURATION = DO_NOT_USE_ini
    """)
    pkg = testdir.mkpydir('tpkg')
    settings = pkg.join('settings_opt.py')
    settings.write(BARE_SETTINGS)
    testdir.makepyfile("""
        import os

        def test_ds():
            assert os.environ['DJANGO_SETTINGS_MODULE'] == 'tpkg.settings_opt'
            assert os.environ['DJANGO_CONFIGURATION'] == 'MySettings'
    """)
    result = testdir.runpytest('--ds=tpkg.settings_opt', '--dc=MySettings')
    result.stdout.fnmatch_lines(['*1 passed*'])


text:
> Demo: http://distinct-potato.surge.sh/#/

Inspired by the [egghead](https://egghead.io/) tutorial on redux, I created the Angular 2 equivalent, this repo is meant to be a playground for Angular 2 good practices, the backend is provided by Stripe.

Stack:
- NG2
- NGRX
- Stripe API
- Node
- Webpack
- Typescript


text:
package set;

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

import org.junit.Test;

public class SetTest {

	@Test
	public void noSetTest() {
		SetGame game = new SetGame();
		Card c1 = new Card(Color.GREEN, Symbol.DIAMOND, Shading.OPEN, 1);
		Card c2 = new Card(Color.GREEN, Symbol.SQUIGGLE, Shading.OPEN, 1);
		Card c3 = new Card(Color.GREEN, Symbol.OVAL, Shading.SOLID, 1);
		List<List<Card>> sets = game.findSets(Arrays.asList(c1, c2, c3));
		assertEquals(0, sets.size());
	}

	@Test
	public void oneSetTest() {
		SetGame game = new SetGame();
		Card c1 = new Card(Color.GREEN, Symbol.DIAMOND, Shading.OPEN, 1);
		Card c2 = new Card(Color.GREEN, Symbol.SQUIGGLE, Shading.OPEN, 1);
		Card c3 = new Card(Color.GREEN, Symbol.OVAL, Shading.OPEN, 1);
		List<List<Card>> sets = game.findSets(Arrays.asList(c1, c2, c3));
		assertEquals(1, sets.size());
	}

	@Test
	public void oneSetAllDifferentTest() {
		SetGame game = new SetGame();
		Card c1 = new Card(Color.GREEN, Symbol.DIAMOND, Shading.OPEN, 1);
		Card c2 = new Card(Color.PURPLE, Symbol.OVAL, Shading.SOLID, 2);
		Card c3 = new Card(Color.RED, Symbol.SQUIGGLE, Shading.STRIPED, 3);
		List<List<Card>> sets = game.findSets(Arrays.asList(c1, c2, c3));
		assertEquals(1, sets.size());
	}

	@Test
	public void twoSetsTest() {
		SetGame game = new SetGame();
		Card c1 = new Card(Color.GREEN, Symbol.DIAMOND, Shading.OPEN, 1);
		Card c2 = new Card(Color.GREEN, Symbol.SQUIGGLE, Shading.OPEN, 1);
		Card c3 = new Card(Color.GREEN, Symbol.OVAL, Shading.OPEN, 1);
		Card c4 = new Card(Color.RED, Symbol.OVAL, Shading.OPEN, 1);
		Card c5 = new Card(Color.PURPLE, Symbol.OVAL, Shading.OPEN, 1);

		List<List<Card>> sets = game.findSets(Arrays.asList(c1, c2, c3, c4, c5));
		assertEquals(2, sets.size());
	}

	@Test
	public void randomSetTest() {
		Card c1 = new Card(true);
		System.out.println(c1);
	}

	@Test
	public void constructSetTest() {
		SetGame game = new SetGame();
		List<Card> set = game.constructSet();
		assertEquals(81, set.size());
	}
}


text:
<?php session_start();
	    //checka ef user er login, ef ekki, redirecta a login page
		if (!isset($_SESSION['email'])) {
			 header('Location: signin.php');
			 exit;
		}
	?>
	<!DOCTYPE html>

	        <?php include_once "includes/header.php" ?>
	        <?php include_once "includes/title.php" ?>

	        <?php include_once("includes/menu.php") ?>

				<?php
			//	require_once("includes/dbconnect.php");
			//	$email = $_SESSION['email'];
			//	$sql = "SELECT name FROM users WHERE email='$email LIMIT 1";
			//	$resault = $pdo-> query($sql);
			//	$username = $resault->fetch();

				 ?>

Notandi: <?php echo htmlspecialchars($_SESSION['email']);
				 ?>

	        <form class="" action="updatuser.php" method="post">

	                change password

	            <input type="password" name="oldPwd" value="" placeholder="old Password">
	            <input type="password" name="newPwd1" value="" placeholder="new password">
	            <input type="password" name="newPwd2" value="" placeholder="new password again">
	            <input type="submit" name="subChangePass" value="submit">
	        </form>

	            change email

	        <form class="" action="updatuser.php" method="post">
	            <input type="text" name="oldEmail" value="" placeholder="old email">
	            <input type="text" name="newEmail1" value="" placeholder="new email">
	            <input type="text" name="newEmail2" value="" placeholder="just to confirm">
	            <input type="submit" name="subChangeEmail" value="submit">
	        </form>

Mínar myndir

					<?php
						require_once("includes/dbconnect.php");
						$uploader = $_SESSION['email'];
						$sql = "SELECT picture_name, picture_category FROM pictures WHERE uploader = '$uploader'";

						foreach ($pdo -> query($sql) as $row) {
							$imageName = $row['picture_name'];
							$category = $row['picture_category'];
							echo "Nafn >> " . htmlspecialchars($imageName) . "
";
							echo "Category >> " . htmlspecialchars($category) . "
";?>
							<form class="" action="myAccount.php" method="post">
								<input type="hidden" name="CurrentImage" value="<?php echo htmlspecialchars($imageName); ?>">
									<a href="uploads/<?php echo $imageName ?>"><img class="userImages" src="uploads/<?php echo $imageName; ?>" alt="Random image" height="250">

								<input type="submit" name="subDeletePic" value="delete picture">
								<input type="submit" name="subDownload" value="download">
								<input type="text" name="addCategory" value="" placeholder="Breyta category">
								<input type="submit" name="subAddCategory" value="bæta category">
							</form>
							<?php
						}
						//delete image script
						if (isset($_POST['subDeletePic'])) {
							$imageToDelete = $_POST['CurrentImage'];

							try {
								require_once("includes/dbconnect.php");
								$del = "DELETE FROM pictures WHERE picture_name = '$imageToDelete'";
								$pdo -> exec($del);
								echo "mynd eitt frá database
";
								$file = "uploads/$imageToDelete";
								if (!unlink($file)){
									echo ("Error deleting $file");
								}
								else{
									echo ("Deleted $file
");
								}
								echo "refreshaðu síðu til að sjá núverandi myndir.
";
							} catch (PDOException $e) {
								echo "villa >>> " . $e;

							}

						}

						if (isset($_POST['subAddCategory'])) {
							$currentImage = $_POST['CurrentImage'];
							$category = $_POST['addCategory'];
							try {
								require_once('includes/dbconnect.php');
								$sql = "UPDATE pictures SET picture_category = '$category' WHERE picture_name = '$currentImage'";
								$stmt = $pdo->prepare($sql);
								$stmt->execute();
								echo "done.";
								echo "category, " . $category . ", hefur verið breytt";
							} catch (PDOException $e) {
								echo "error >>> ". $e;
							}

						}

					?>

<?php include_once("includes/footer.php");  ?>

	<?php

	 ?>


text:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true  */
/*global phantom, console, require, QUnit */

/*
A phantomjs QUnit test runner with support for JUnit, TAP, and pretty
console output.
*/

(function() {
    'use strict';

    var args = require('system').args;

    // Takes up to 4 args
    // 1. URL
    // 2. Output Format: (junit, tap, console (default))
    // 3. Verbosity (1: Show all assertions (default), 0: Show only test results)
    // 4. The errorcode to use for the phantomjs process if tests fail (Defaults to 1).

    var url = args[1];
    var output = "console";
    var verbose = true;
    var errorcode = 1;
    var usecolor = true;
    if (args.length > 2) {
        output = args[2];
        if (args.length > 3) {
            verbose = (args[3] === '1');
            if (args.length > 4) {
                errorcode = parseInt(args[4], 10);
                if (args.length > 5) {
                    usecolor = (args[5] === '1');
                }
            }
        }
    }

    var COLORS = {
        'pass': 90,
        'fail': 31,
        'bright pass': 92,
        'bright fail': 91,
        'bright yellow': 93,
        'pending': 36,
        'suite': 0,
        'error title': 0,
        'error message': 31,
        'error stack': 90,
        'checkmark': 32,
        'fast': 90,
        'medium': 33,
        'slow': 31,
        'green': 32,
        'light': 90,
        'diff gutter': 90,
        'diff added': 42,
        'diff removed': 41
    };

    function color(type, str) {
        if (!usecolor) {
            return str;
        }
        return '\u001b[' + COLORS[type] + 'm' + str + '\u001b[0m';
    }

    /*
    JUnit XML output for QUnit tests compatible with PhantomJS 1.3
    https://gist.github.com/1363104
    */
    var JUnitPlugin = (function () {
        var module, moduleStart, testStart, testCases = [],
            current_test_assertions = [], JUnitPlugin = {};

        JUnitPlugin.begin = function() {
            // That does not work when invoked in PhantomJS
            console.log('<?xml version="1.0" encoding="UTF-8"?>');
            console.log('<testsuites name="testsuites">');
        };

        JUnitPlugin.moduleStart = function(context) {
            moduleStart = new Date();
            module = context.name;
            testCases = [];
        };

        JUnitPlugin.moduleDone = function(context) {
            // context = { name, failed, passed, total }
            var i, l, xml = '\t<testsuite name="' + context.name + '" errors="0" failures="' + context.failed + '" tests="' + context.total + '" time="' + (new Date() - moduleStart) / 1000 + '"';
            if (testCases.length) {
                xml += '>\n';
                for (i = 0, l = testCases.length; i < l; i+=1) {
                    xml += testCases[i];
                }
                xml += '\t</testsuite>';
            } else {
                xml += '/>\n';
            }
            console.log(xml);
        };

        JUnitPlugin.testStart = function() {
            testStart = new Date();
        };

        JUnitPlugin.testDone = function(result) {
            // result = { name, failed, passed, total }
            var i, xml = '\t\t<testcase classname="' + module + '" name="' + result.name + '" time="' + (new Date() - testStart) / 1000 + '"';
            if (result.failed) {
                xml += '>\n';
                for (i = 0; i < current_test_assertions.length; i+=1) {
                    xml += "\t\t\t" + current_test_assertions[i];
                }
                xml += '\t\t</testcase>\n';
            } else {
                xml += '/>\n';
            }
            current_test_assertions = [];
            testCases.push(xml);
        };

        JUnitPlugin.log = function(details) {
            //details = { result , actual, expected, message }
            if (details.result) {
                return;
            }
            var message = details.message || "";
            if (details.expected) {
                if (message) {
                    message += ", ";
                }
                message = "expected: " + details.expected + ", but was: " + details.actual;
            }
            var xml = '<failure type="failed" message="' + message + '"/>\n';

            current_test_assertions.push(xml);
        };

        JUnitPlugin.done = function(result) {
            console.log('</testsuites>');
            return result.failed > 0 ? 1 : 0;
        };

        return JUnitPlugin;
    }());

    /*
     * QUnit-TAP - A TAP Output Producer Plugin for QUnit
     *
     * http://github.com/twada/qunit-tap
     * version: 1.0.0
     *
     * Copyright (c) 2010, 2011 Takuto Wada
     * Dual licensed under the MIT (MIT-LICENSE.txt)
     * and GPLv2 (GPL-LICENSE.txt) licenses.
     */
    var TapPlugin = (function(puts, options) {
        var qu = {};
        if (typeof qu.tap !== 'undefined') {
            return;
        }

        // borrowed from qunit.js
        var extend = function(a, b) {
            var prop;
            for (prop in b) {
                if (b[prop] === undefined) {
                    delete a[prop];
                } else {
                    a[prop] = b[prop];
                }
            }
            return a;
        };

        // using QUnit.tap as namespace.
        qu.tap = extend({
            count: 0,
            noPlan: false,
            showDetailsOnFailure: true
        }, options);
        qu.tap.puts = puts;
        var initialCount = qu.tap.count;

        // borrowed from prototype.js
        // not required since QUnit.log receives raw data (details). see
        // https://github.com/jquery/qunit/commit/c2cde34d3e53f5438a984dfdacdc992c8e417919
        var stripTags = function(str) {
            if (!str) { return str; }
            return str.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
        };

        var commentAfterLineEnd = function(str) {
            return str.replace(/(\r?\n)/g, '$&# ');
        };

        var formDescription = function(str) {
            if (!str) { return str; }
            return commentAfterLineEnd(' - ' + str);
        };

        var appendDetailsTo = function(desc, details) {
            if (qu.tap.showDetailsOnFailure &&
                !(details.result) &&
                typeof(details.expected) !== 'undefined')
            {
                if (desc) { desc += ', '; }
                desc += 'expected: ';
                desc += details.expected;
                desc += ' result: ';
                desc += details.actual;
            }
            return desc;
        };

        qu.tap.moduleStart = function(arg) {
            var name = (typeof arg === 'string') ? arg : arg.name;
            qu.tap.puts('# module: ' + name);
        };

        qu.tap.testStart = function(arg) {
            var name = (typeof arg === 'string') ? arg : arg.name;
            qu.tap.puts('# test: ' + name);
        };

        qu.tap.log = function(arg0, arg1, arg2) {
            var details;
            switch (arguments.length) {
                case 1:  // details
                    details = arg0;
                    break;
                case 2:  // result, message(with tags)
                    details = {result: arg0, message: stripTags(arg1)};
                    break;
                case 3:  // result, message, details
                    details = arg2;
                    break;
            }
            var testLine = (details.result ? 'ok' : 'not ok') +
                ' ' + (qu.tap.count += 1);
            if (details.result && !details.message) {
                qu.tap.puts(testLine);
                return;
            }
            var desc = appendDetailsTo((details.message || ''), details);
            qu.tap.puts(testLine + formDescription(desc));
        };
        // prop in arg: failed,passed,total,runtime
        qu.tap.done = function(arg) {
            if (!qu.tap.noPlan) {
                return;
            }
            qu.tap.puts((initialCount + 1) + '..' + qu.tap.count);
        };

        qu.moduleStart = qu.tap.moduleStart;
        qu.testStart = qu.tap.testStart;
        qu.log = qu.tap.log;
        qu.done = qu.tap.done;

        return qu;
    }(function(s) { console.log(s); }, {noPlan: true}));

    var ConsolePlugin = (function () {
        var begin, module, moduleStart, testStart, testCases = [],
            current_test_assertions = [], plugin = {};
        var testDetails = {
            passed: 0,
            failed: 0,
            total: 0
        };

        plugin.begin = function() {
            // That does not work when invoked in PhantomJS
            begin = new Date();
            console.log('Tests Started');
            console.log('');
        };

        plugin.moduleStart = function(context) {
            moduleStart = new Date();
            module = context.name;
            testCases = [];
            console.log(module);
            console.log('');
        };

        plugin.moduleDone = function(details) {
            var runtime = (new Date() - moduleStart) / 1000;
            console.log('');
        };

        plugin.testStart = function(details) {
            testStart = new Date();
            if (verbose) {
                console.log('     ' + details.name);
            }
        };

        plugin.testDone = function(details) {
            var runtime = (new Date() - testStart) / 1000;
            if (details.failed) {
                testDetails.failed += 1;
            } else {
                testDetails.passed += 1;
            }
            testDetails.total += 1;
            if (!verbose) {
                console.log('    ' + (details.failed ?  color('fail', '× ') : color('checkmark', '? ')) + color(details.failed ? 'fail' : 'pass', details.name + ' (' + runtime + 's)'));
            }
        };

        plugin.log = function(details) {
            var runtime = (new Date() - testStart) / 1000;
            if (verbose) {
                console.log('        ' + (details.result ?  color('checkmark', '? ') : color('fail', '? ')) + color(details.result ? 'pass' : 'fail', (details.message || details.name) + ' (' + runtime + 's)'));
            }

            if (details.result) {
                return;
            }
            var message = details.message || "";
            if (details.expected) {
                if (message) {
                    message += ", ";
                }
                message = "expected: " + details.expected + ", but was: " + details.actual;
            }

            current_test_assertions.push({
                module: module,
                name: details.name,
                message: message,
                source: details.source
            });
        };

        plugin.done = function(details) {
            // That does not work when invoked in PhantomJS
            testDetails.runtime = details.runtime;
            details = (verbose ? details : testDetails);

            // TODO: Traceback summary.
            if (details.failed) {
                var i;
                for (i = 0; i < current_test_assertions.length; i += 1) {
                    var err = current_test_assertions[i];
                    console.log('======================================================================');
                    console.log('FAIL: ' + color('error title', err.name) + '(' + err.module + ')');
                    console.log('----------------------------------------------------------------------');
                    console.log(color('error message', err.message));
                    if (err.source) {
                        console.log(color('error stack', err.source));
                    }
                }
            }

            console.log('----------------------------------------------------------------------');
            console.log('Ran ' + details.total + ' tests in ' + (details.runtime / 1000) + ' secs');
            console.log('');
            if (details.failed) {
                console.log(color('bright fail', 'FAILED') + ' (failures=' + details.failed + ')');
            } else {
                console.log(color('bright pass', 'OK'));
            }
        };

        return plugin;
    }());

    //-----------------------------------------

    var OUTPUT_FORMATS = {
        'junit': JUnitPlugin,
        'tap': TapPlugin,
        'console': ConsolePlugin
    };

    var OutputPlugin = OUTPUT_FORMATS[output];
    if (!OutputPlugin) {
        console.error('Bad output format: ' + output);
        phantom.exit(1);
    }

    var page = require('webpage').create();

    function setupCallbacks() {
        window.document.addEventListener('DOMContentLoaded', function() {
            // Setup Error Handling
            var qunit_error = window.onerror;
            window.onerror = function ( error, filePath, linerNr ) {
                qunit_error(error, filePath, linerNr);
                if (typeof window.callPhantom === 'function') {
                    window.callPhantom({
                        'name': 'Window.error',
                        'error': error,
                        'filePath': filePath,
                        'linerNr': linerNr
                    });
                }
            };

            var callback = function(name) {
                return function(details) {
                    if (typeof window.callPhantom === 'function') {
                        window.callPhantom({
                            'name': 'QUnit.' + name,
                            'details': details
                        });
                    }
                };
            };

            var i, callbacks = [
                'begin', 'done', 'log',
                'moduleStart', 'moduleDone',
                'testStart', 'testDone'
            ];
            for (i=0; i<callbacks.length;i+=1) {
                QUnit[callbacks[i]](callback(callbacks[i]));
            }

        }, false);
    }

    // Route `console.log()` calls from within the Page context to the main Phantom context (i.e. current `this`)
    page.onConsoleMessage = function(msg) {
        console.log(msg);
    };

    page.onInitialized = function() {
        page.evaluate(setupCallbacks);
    };

    page.onCallback = function(message) {
        var result,
            failed;

        if (message) {
            if (message.name === 'Window.error') {
                phantom.exit(1);
            } else {
                var msgs = message.name.split(".");
                if (msgs[0] === "QUnit") {

                    var cb = OutputPlugin[msgs[1]];
                    if (cb) {
                        cb(message.details);
                    }

                    if (msgs[1] === 'done') {
                        result = message.data;
                        failed = !result || result.failed;

                        phantom.exit(failed ? errorcode : 0);
                    }
                }
            }
        }
    };

    page.open(url, function(status) {
        if (status !== 'success') {
            console.error('Unable to access network: ' + status);
            phantom.exit(1);
        } else {
            // Cannot do this verification with the 'DOMContentLoaded' handler because it
            // will be too late to attach it if a page does not have any script tags.
            var qunitMissing = page.evaluate(function() { return (typeof QUnit === 'undefined' || !QUnit); });
            if (qunitMissing) {
                console.error('The `QUnit` object is not present on this page.');
                phantom.exit(1);
            }

            // Do nothing... the callback mechanism will handle everything!
        }
    });

    page.onError = function(msg, trace) {
        console.error(color('error message', msg));
        trace.forEach(function(item) {
            console.error(color('error stack', '  ' + item.file + ':' + item.line));
        });
        console.error('');
        phantom.exit(1);
    };
}());


text:
using UnityEngine;
using System.Collections;

public class PathfindingManager : MonoBehaviour {
	public  string fileName = "dummyScene1";
	public  string fileFolder = "NAPS/Paths";
	string filePath = "";
	public bool autoload = false;
	bool newFilePathDialog = true;

	void Awake(){
		filePath = Application.dataPath+"/"+fileFolder;
		if(!autoload)
			return;
		if(!Pathfinding.DataLoaded()){
		Pathfinding.LoadNavigationData(filePath,fileName);
		newFilePathDialog = false;
		}
	}

	void Update(){
		if(!autoload)
			return;
		if(!Pathfinding.DataLoaded()){
		Pathfinding.LoadNavigationData(filePath,fileName);
		newFilePathDialog = false;
		}
	}

	void Start(){
	Debug.Log ("Paths size = "+Pathfinding.Paths.Length);
	}

	void OnGUI(){
	GUILayout.BeginVertical ();
	if(newFilePathDialog){
	GUILayout.BeginHorizontal ();
	GUILayout.Label("file path:");
	filePath = GUILayout.TextField(filePath,GUILayout.MaxWidth(250));
	GUILayout.EndHorizontal ();
	GUILayout.BeginHorizontal ();
	GUILayout.Label("file name:",GUILayout.MaxWidth(65));
	fileName = GUILayout.TextField(fileName,GUILayout.MaxWidth(100));
	GUILayout.EndHorizontal ();
		if(GUILayout.Button ("Load",GUILayout.MaxWidth(40))){
		Pathfinding.LoadNavigationData(filePath,fileName);
		newFilePathDialog = false;
			}
		}else{
		if(GUILayout.Button ("Load other file"))
		newFilePathDialog = true;
		}
	GUILayout.EndVertical ();
	}
}


text:
import * as React from 'react';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { OverridableComponent } from '@mui/types';
import {
  unstable_capitalize as capitalize,
  unstable_isMuiElement as isMuiElement,
} from '@mui/utils';
import { useThemeProps } from '../styles';
import styled from '../styles/styled';
import { getCardUtilityClass } from './cardClasses';
import { CardProps, CardTypeMap } from './CardProps';
import { resolveSxValue } from '../styles/styleUtils';
import { CardRowContext } from './CardContext';

const useUtilityClasses = (ownerState: CardProps) => {
  const { size, variant, color, row } = ownerState;

  const slots = {
    root: [
      'root',
      variant && `variant${capitalize(variant)}`,
      color && `color${capitalize(color)}`,
      size && `size${capitalize(size)}`,
      row && 'row',
    ],
  };

  return composeClasses(slots, getCardUtilityClass, {});
};

const CardRoot = styled('div', {
  name: 'JoyCard',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root,
})<{ ownerState: CardProps }>(({ theme, ownerState }) => [
  {
    // a context variable for any child component
    '--Card-childRadius':
      'max((var(--Card-radius) - var(--variant-borderWidth)) - var(--Card-padding), min(var(--Card-padding) / 2, (var(--Card-radius) - var(--variant-borderWidth)) / 2))',
    // AspectRatio integration
    '--AspectRatio-radius': 'var(--Card-childRadius)',
    // Link integration
    '--internal-action-margin': 'calc(-1 * var(--variant-borderWidth))',
    // Link, Radio, Checkbox integration
    '--internal-action-radius': resolveSxValue(
      { theme, ownerState },
      'borderRadius',
      'var(--Card-radius)',
    ),
    // CardCover integration
    '--CardCover-radius': 'calc(var(--Card-radius) - var(--variant-borderWidth))',
    // CardOverflow integration
    '--CardOverflow-offset': `calc(-1 * var(--Card-padding))`,
    '--CardOverflow-radius': 'calc(var(--Card-radius) - var(--variant-borderWidth))',
    // Divider integration
    '--Divider-inset': 'calc(-1 * var(--Card-padding))',
    ...(ownerState.size === 'sm' && {
      '--Card-radius': theme.vars.radius.sm,
      '--Card-padding': '0.5rem',
    }),
    ...(ownerState.size === 'md' && {
      '--Card-radius': theme.vars.radius.md,
      '--Card-padding': '1rem',
      fontSize: theme.vars.fontSize.md,
    }),
    ...(ownerState.size === 'lg' && {
      '--Card-radius': theme.vars.radius.lg,
      '--Card-padding': '1.5rem',
    }),
    padding: 'var(--Card-padding)',
    borderRadius: 'var(--Card-radius)',
    boxShadow: theme.vars.shadow.sm,
    backgroundColor: theme.vars.palette.background.surface,
    fontFamily: theme.vars.fontFamily.body,
    // TODO: discuss the theme transition.
    // This value is copied from mui-material Sheet.
    transition: 'box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms',
    position: 'relative',
    display: 'flex',
    flexDirection: ownerState.row ? 'row' : 'column',
  },
  theme.variants[ownerState.variant!]?.[ownerState.color!],
]);

const Card = React.forwardRef(function Card(inProps, ref) {
  const props = useThemeProps<typeof inProps & CardProps>({
    props: inProps,
    name: 'JoyCard',
  });

  const {
    className,
    color = 'neutral',
    component = 'div',
    size = 'md',
    variant = 'plain',
    children,
    row = false,
    ...other
  } = props;

  const ownerState = {
    ...props,
    color,
    component,
    row,
    size,
    variant,
  };

  const classes = useUtilityClasses(ownerState);

  return (
    <CardRowContext.Provider value={row}>
      <CardRoot
        as={component}
        ownerState={ownerState}
        className={clsx(classes.root, className)}
        ref={ref}
        {...other}
      >
        {React.Children.map(children, (child, index) => {
          if (!React.isValidElement(child)) {
            return child;
          }
          const extraProps: Record<string, any> = {};
          if (isMuiElement(child, ['Divider'])) {
            extraProps.inset = 'inset' in child.props ? child.props.inset : 'context';

            const orientation = row ? 'vertical' : 'horizontal';
            extraProps.orientation =
              'orientation' in child.props ? child.props.orientation : orientation;
          }
          if (index === 0) {
            extraProps['data-first-child'] = '';
          }
          if (index === React.Children.count(children) - 1) {
            extraProps['data-last-child'] = '';
          }
          return React.cloneElement(child, extraProps);
        })}
      </CardRoot>
    </CardRowContext.Provider>
  );
}) as OverridableComponent<CardTypeMap>;

Card.propTypes /* remove-proptypes */ = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit TypeScript types and run "yarn proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * Used to render icon or text elements inside the Card if `src` is not set.
   * This can be an element, or just a string.
   */
  children: PropTypes.node,
  /**
   * @ignore
   */
  className: PropTypes.string,
  /**
   * The color of the component. It supports those theme colors that make sense for this component.
   * @default 'neutral'
   */
  color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
    PropTypes.oneOf(['danger', 'info', 'neutral', 'primary', 'success', 'warning']),
    PropTypes.string,
  ]),
  /**
   * The component used for the root node.
   * Either a string to use a HTML element or a component.
   */
  component: PropTypes.elementType,
  /**
   * If `true`, flex direction is set to 'row'.
   * @default false
   */
  row: PropTypes.bool,
  /**
   * The size of the component.
   * It accepts theme values between 'sm' and 'lg'.
   * @default 'md'
   */
  size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
    PropTypes.oneOf(['lg', 'md', 'sm']),
    PropTypes.string,
  ]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
    PropTypes.func,
    PropTypes.object,
  ]),
  /**
   * The variant to use.
   * @default 'plain'
   */
  variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
    PropTypes.oneOf(['outlined', 'plain', 'soft', 'solid']),
    PropTypes.string,
  ]),
} as any;

export default Card;


text:
-- Traveler Account Type change to use KualiCodeBase
-- KULRICE-11129 Samples for I22, population of fields with initial values
UPDATE TRV_ACCT_TYPE SET ACTV_IND="Y"
/


text:
require 'active_support'
require 'active_audit/audit_repository'

module ActiveAudit
  extend ActiveSupport::Autoload

  eager_autoload { autoload :Base }
  autoload :StorageAdapters

  class << self

    attr_accessor :storage_adapter, :current_user_method, :ignored_attributes, :job_queue, :delayed_auditing, :default_user, :extract_user_profile

    def configure
      @current_user_method = :current_user
      @ignored_attributes = %w(created_at updated_at)
      @job_queue = :audits
      @delayed_auditing = false
      @extract_user_profile = lambda { |user| { id: user.id } }
      self.eager_load!
      yield(self) if block_given?
      AuditPusher.queue_as job_queue
      AuditRepository.storage_adapter = storage_adapter if storage_adapter
    end

    def session
      Thread.current[:auditing_store] ||= {}
    end

    def add_hint comment
      self.session[:comment] = comment
    end
  end

end


text:
/* $Id$ */

#ifndef ISCAPI_NAMESPACE_H
#define ISCAPI_NAMESPACE_H 1

/*%
 * name space conversions
 */

#ifdef BIND9

#define isc_app_start isc__app_start
#define isc_app_ctxstart isc__app_ctxstart
#define isc_app_onrun isc__app_onrun
#define isc_app_run isc__app_run
#define isc_app_ctxrun isc__app_ctxrun
#define isc_app_shutdown isc__app_shutdown
#define isc_app_ctxshutdown isc__app_ctxshutdown
#define isc_app_ctxsuspend isc__app_ctxsuspend
#define isc_app_reload isc__app_reload
#define isc_app_finish isc__app_finish
#define isc_app_block isc__app_block
#define isc_app_unblock isc__app_unblock
#define isc_appctx_create isc__appctx_create
#define isc_appctx_destroy isc__appctx_destroy
#define isc_appctx_settaskmgr isc__appctx_settaskmgr
#define isc_appctx_setsocketmgr isc__appctx_setsocketmgr
#define isc_appctx_settimermgr isc__appctx_settimermgr

#define isc_mem_checkdestroyed isc__mem_checkdestroyed
#define isc_mem_createx isc__mem_createx
#define isc_mem_createx2 isc__mem_createx2
#define isc_mem_create isc__mem_create
#define isc_mem_create2 isc__mem_create2
#define isc_mem_attach isc__mem_attach
#define isc_mem_detach isc__mem_detach
#define isc__mem_putanddetach isc___mem_putanddetach
#define isc_mem_destroy isc__mem_destroy
#define isc_mem_ondestroy isc__mem_ondestroy
#define isc__mem_get isc___mem_get
#define isc__mem_put isc___mem_put
#define isc_mem_stats isc__mem_stats
#define isc__mem_allocate isc___mem_allocate
#define isc__mem_free isc___mem_free
#define isc__mem_strdup isc___mem_strdup
#define isc__mem_reallocate isc___mem_reallocate
#define isc_mem_references isc__mem_references
#define isc_mem_setdestroycheck isc__mem_setdestroycheck
#define isc_mem_setquota isc__mem_setquota
#define isc_mem_getname isc__mem_getname
#define isc_mem_getquota isc__mem_getquota
#define isc_mem_gettag isc__mem_gettag
#define isc_mem_inuse isc__mem_inuse
#define isc_mem_isovermem isc__mem_isovermem
#define isc_mem_setname isc__mem_setname
#define isc_mem_setwater isc__mem_setwater
#define isc_mem_printallactive isc__mem_printallactive
#define isc_mem_waterack isc__mem_waterack
#define isc_mempool_create isc__mempool_create
#define isc_mempool_setname isc__mempool_setname
#define isc_mempool_destroy isc__mempool_destroy
#define isc_mempool_associatelock isc__mempool_associatelock
#define isc__mempool_get isc___mempool_get
#define isc__mempool_put isc___mempool_put
#define isc_mempool_setfreemax isc__mempool_setfreemax
#define isc_mempool_getfreemax isc__mempool_getfreemax
#define isc_mempool_getfreecount isc__mempool_getfreecount
#define isc_mempool_setmaxalloc isc__mempool_setmaxalloc
#define isc_mempool_getmaxalloc isc__mempool_getmaxalloc
#define isc_mempool_getallocated isc__mempool_getallocated
#define isc_mempool_setfillcount isc__mempool_setfillcount
#define isc_mempool_getfillcount isc__mempool_getfillcount

#define isc_socket_create isc__socket_create
#define isc_socket_attach isc__socket_attach
#define isc_socket_detach isc__socket_detach
#define isc_socketmgr_create isc__socketmgr_create
#define isc_socketmgr_create2 isc__socketmgr_create2
#define isc_socketmgr_destroy isc__socketmgr_destroy
#define isc_socket_open isc__socket_open
#define isc_socket_close isc__socket_close
#define isc_socket_recvv isc__socket_recvv
#define isc_socket_recv isc__socket_recv
#define isc_socket_recv2 isc__socket_recv2
#define isc_socket_send isc__socket_send
#define isc_socket_sendto isc__socket_sendto
#define isc_socket_sendv isc__socket_sendv
#define isc_socket_sendtov isc__socket_sendtov
#define isc_socket_sendto2 isc__socket_sendto2
#define isc_socket_cleanunix isc__socket_cleanunix
#define isc_socket_permunix isc__socket_permunix
#define isc_socket_bind isc__socket_bind
#define isc_socket_filter isc__socket_filter
#define isc_socket_listen isc__socket_listen
#define isc_socket_accept isc__socket_accept
#define isc_socket_connect isc__socket_connect
#define isc_socket_getname isc__socket_getname
#define isc_socket_gettag isc__socket_gettag
#define isc_socket_getpeername isc__socket_getpeername
#define isc_socket_getsockname isc__socket_getsockname
#define isc_socket_cancel isc__socket_cancel
#define isc_socket_gettype isc__socket_gettype
#define isc_socket_isbound isc__socket_isbound
#define isc_socket_ipv6only isc__socket_ipv6only
#define isc_socket_setname isc__socket_setname
#define isc_socketmgr_getmaxsockets isc__socketmgr_getmaxsockets
#define isc_socketmgr_setstats isc__socketmgr_setstats
#define isc_socketmgr_setreserved isc__socketmgr_setreserved
#define isc__socketmgr_maxudp isc___socketmgr_maxudp
#define isc_socket_fdwatchcreate isc__socket_fdwatchcreate
#define isc_socket_fdwatchpoke isc__socket_fdwatchpoke

#define isc_task_create isc__task_create
#define isc_task_attach isc__task_attach
#define isc_task_detach isc__task_detach
/* #define isc_task_exiting isc__task_exiting XXXMPA */
#define isc_task_send isc__task_send
#define isc_task_sendanddetach isc__task_sendanddetach
#define isc_task_purgerange isc__task_purgerange
#define isc_task_purge isc__task_purge
#define isc_task_purgeevent isc__task_purgeevent
#define isc_task_unsendrange isc__task_unsendrange
#define isc_task_unsend isc__task_unsend
#define isc_task_onshutdown isc__task_onshutdown
#define isc_task_shutdown isc__task_shutdown
#define isc_task_destroy isc__task_destroy
#define isc_task_setname isc__task_setname
#define isc_task_getname isc__task_getname
#define isc_task_gettag isc__task_gettag
#define isc_task_getcurrenttime isc__task_getcurrenttime
#define isc_taskmgr_create isc__taskmgr_create
#define isc_taskmgr_destroy isc__taskmgr_destroy
#define isc_taskmgr_setexcltask isc__taskmgr_setexcltask
#define isc_taskmgr_excltask isc__taskmgr_excltask
#define isc_task_beginexclusive isc__task_beginexclusive
#define isc_task_endexclusive isc__task_endexclusive

#define isc_timer_create isc__timer_create
#define isc_timer_reset isc__timer_reset
#define isc_timer_gettype isc__timer_gettype
#define isc_timer_touch isc__timer_touch
#define isc_timer_attach isc__timer_attach
#define isc_timer_detach isc__timer_detach
#define isc_timermgr_create isc__timermgr_create
#define isc_timermgr_poke isc__timermgr_poke
#define isc_timermgr_destroy isc__timermgr_destroy

#endif /* BIND9 */

#endif /* ISCAPI_NAMESPACE_H */


text:
Notifications = {
	warn : function(title,message){
		console.log("Title: " + title + "\nmessage: " + message);
	},
	error : function(title,message){
		console.log("Title: " + title + "\nmessage: " + message);
	},
	info : function(title,message){
		console.log("Title: " + title + "\nmessage: " + message);
	},
	success : function(title,message){
		console.log("Title: " + title + "\nmessage: " + message);
	}
};

//When notifications package will be fixed, make sure to uncomment the section regarding the notifications in client/warnings.js


text:
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace MidiPlugin
{
	[TypeConverter(typeof(ValueTypeTypeConverter<MidiMessage>))]
	[StructLayout(LayoutKind.Explicit)]
	public struct MidiMessage
	{
		[FieldOffset(0)]
		public byte channel;
		[FieldOffset(1)]
		public byte message;
		[FieldOffset(2)]
		public byte data1;
		[FieldOffset(3)]
		public byte data2;
		[FieldOffset(0)]
		public int Data;
		public byte Channel
		{
			get
			{
				return this.channel;
			}
			set
			{
				this.channel = value;
			}
		}
		public byte Message
		{
			get
			{
				return this.message;
			}
			set
			{
				this.message = value;
			}
		}
		public byte Data1
		{
			get
			{
				return this.data1;
			}
			set
			{
				this.data1 = value;
			}
		}
		public byte Data2
		{
			get
			{
				return this.data2;
			}
			set
			{
				this.data2 = value;
			}
		}
		public bool EqualsSimple(MidiMessage other)
		{
			return this.channel == other.channel && this.message == other.message && this.data1 == other.data1;
		}
		public override string ToString()
		{
			return string.Format("{0}:{1} D1:{2} D2:{3}", new object[]
			{
				this.channel,
				this.message,
				this.data1,
				this.data2
			});
		}
		public static bool operator ==(MidiMessage a, MidiMessage b)
		{
			return a.Data == b.Data;
		}
		public static bool operator !=(MidiMessage a, MidiMessage b)
		{
			return a.Data != b.Data;
		}
		public override int GetHashCode()
		{
			return this.Data;
		}
		public override bool Equals(object obj)
		{
			return base.Equals(obj);
		}
	}
}


text:
package com.microsoft.azure.management.signalr.v2018_03_01_preview.implementation;

import com.microsoft.azure.management.signalr.v2018_03_01_preview.ResourceSku;
import com.microsoft.azure.management.signalr.v2018_03_01_preview.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.rest.SkipParentValidation;
import com.microsoft.azure.Resource;

/**
 * A class represent a SignalR service resource.
 */
@JsonFlatten
@SkipParentValidation
public class SignalRResourceInner extends Resource {
    /**
     * SKU of the service.
     */
    @JsonProperty(value = "sku")
    private ResourceSku sku;

    /**
     * Prefix for the hostName of the SignalR service. Retained for future use.
     * The hostname will be of format:
     * <hostNamePrefix>.service.signalr.net.
     */
    @JsonProperty(value = "properties.hostNamePrefix")
    private String hostNamePrefix;

    /**
     * Provisioning state of the resource. Possible values include: 'Unknown',
     * 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating',
     * 'Deleting', 'Moving'.
     */
    @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /**
     * The publicly accessible IP of the SignalR service.
     */
    @JsonProperty(value = "properties.externalIP", access = JsonProperty.Access.WRITE_ONLY)
    private String externalIP;

    /**
     * FQDN of the SignalR service instance. Format: xxx.service.signalr.net.
     */
    @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY)
    private String hostName;

    /**
     * The publicly accessibly port of the SignalR service which is designed
     * for browser/client side usage.
     */
    @JsonProperty(value = "properties.publicPort", access = JsonProperty.Access.WRITE_ONLY)
    private Integer publicPort;

    /**
     * The publicly accessibly port of the SignalR service which is designed
     * for customer server side usage.
     */
    @JsonProperty(value = "properties.serverPort", access = JsonProperty.Access.WRITE_ONLY)
    private Integer serverPort;

    /**
     * Get the sku value.
     *
     * @return the sku value
     */
    public ResourceSku sku() {
        return this.sku;
    }

    /**
     * Set the sku value.
     *
     * @param sku the sku value to set
     * @return the SignalRResourceInner object itself.
     */
    public SignalRResourceInner withSku(ResourceSku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the hostNamePrefix value.
     *
     * @return the hostNamePrefix value
     */
    public String hostNamePrefix() {
        return this.hostNamePrefix;
    }

    /**
     * Set the hostNamePrefix value.
     *
     * @param hostNamePrefix the hostNamePrefix value to set
     * @return the SignalRResourceInner object itself.
     */
    public SignalRResourceInner withHostNamePrefix(String hostNamePrefix) {
        this.hostNamePrefix = hostNamePrefix;
        return this;
    }

    /**
     * Get the provisioningState value.
     *
     * @return the provisioningState value
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the externalIP value.
     *
     * @return the externalIP value
     */
    public String externalIP() {
        return this.externalIP;
    }

    /**
     * Get the hostName value.
     *
     * @return the hostName value
     */
    public String hostName() {
        return this.hostName;
    }

    /**
     * Get the publicPort value.
     *
     * @return the publicPort value
     */
    public Integer publicPort() {
        return this.publicPort;
    }

    /**
     * Get the serverPort value.
     *
     * @return the serverPort value
     */
    public Integer serverPort() {
        return this.serverPort;
    }

}


text:
package org.xdevs23.management.config;

public class SharedPreferenceArray {

    public static String getPreferenceString(String[] array) {
        StringBuilder sb = new StringBuilder();
        for ( String s : array)
            sb.append(s.replace(":", "::").replace("|", "||"))
                    .append("|:|");
        sb.delete(sb.length() - 3, sb.length());
        return sb.toString();
    }

    public static String[] getStringArray(String preferenceString) {
        if(preferenceString.isEmpty()) return null;
        String[] array = preferenceString.split("([|][:][|])");
        for ( int i = 0; i < array.length; i++ )
            array[i] = array[i].replace("::", ":").replace("||", "|");
        return array;
    }

}


text:
var bower    = require('./bower.json'),
    sh       = require('shelljs'),
    gulp     = require('gulp'),
    notify   = require('gulp-notify'),
    jshint   = require('gulp-jshint'),
    stylish  = require('jshint-stylish'),
    mocha    = require('gulp-mocha'),
    annotate = require('gulp-ng-annotate'),
    concat   = require('gulp-concat'),
    uglify   = require('gulp-uglify'),
    sequence = require('run-sequence'),
    express  = require('express'),
    open     = require('open'),
    app      = express();

var dependencies = [];

var paths = JSON.parse(
  sh.exec('./node_modules/bower/bin/bower list --paths --json', { silent: true })
    .output);

for (var dependency in paths)
  if (bower.dependencies && dependency in bower.dependencies)
    dependencies.push(paths[dependency]);

var paths = {
  src: ['./src/file.js', './src/*.*.js', './src/*/**/*.js'],
  preamble: ['./build/preamble.js'],
  postamble: ['./build/postamble.js'],
  tests: ['./tests/**/*.js'],
  dependencies: dependencies,
};

// lint scripts
gulp.task('lint', function () {
  return gulp.src(paths.src)
    .pipe(jshint({ lookup: false }))
    .pipe(jshint.reporter(stylish))
    .pipe(notify({message: 'Jshint done'}));
});

// test changes
gulp.task('test', function() {
  return gulp.src(paths.tests)
    .pipe(mocha({ bail: true, reporter: 'nyan' }));
});

// build dist
gulp.task('build', function() {
  // clean dist
  sh.rm('-f', 'index.js', 'index.min.js');

  gulp.src(dependencies.concat(paths.preamble, paths.src, paths.postamble))
  // concatenate
    .pipe(concat('index.js'))
  // annotate dependency injections
    /* TODO: Enable ngAnnotate when it supports @ngNoInject tags
    .pipe(annotate({ add: true, single_quotes: true })) */
    .pipe(gulp.dest('.'))
  // minify
    .pipe(concat('index.min.js'))
    .pipe(uglify())
    .pipe(gulp.dest('.'));
});

// watch all for changes
gulp.task('watch', function () {
  gulp.watch(paths.src, ['lint', 'test', 'build']);
  gulp.watch(paths.tests, ['test']);
});

// serve a demonstration (used by mock)
gulp.task('serve', function() {
  app.use(express.static('./tests'));
  app.use(express.static('.'));
  app.listen(9000);

  open('http://0.0.0.0:9000');
});

// kick it all off
gulp.task('default', ['lint', 'test', 'watch']);

// serve a mock
gulp.task('mock', function(done) {
  sequence('build', ['serve', 'watch'], done);
});


text:
`chef provision` invokes an embedded chef-client run to provision machines
using Chef Provisioning. If not otherwise specified, `chef provision` will
expect to find a cookbook named 'provision' in the current working directory.
It runs a recipe in this cookbook which should use Chef Provisioning to create
one or more machines (or other infrastructure).

The `chef provision` command aims to achieve these goals:

* Provide provisioning mechanism that supports Policyfiles
* Improve Chef Provisioning ease of use by creating naming conventions
* Improve Chef Provisioning ease of use by integrating with ChefDK CLI
* Improve Chef Provisioning ease of use by separating the way you
  configure provisioned machines from the way you invoke Chef
  Provisioning
* Improve on the `knife bootstrap` experience by expressing more of your
  provisioning requirements as code (instead of CLI options).

## Basic CLI Use

`chef provision` provides three forms of operation:

### chef provision POLICY_GROUP --policy-name POLICY_NAME

In the first form of the command, `chef provision` creates machines that will
operate in policyfile mode. The chef configuration passed to the cookbook will
set the policy group and policy name as given.

### chef provision POLICY_GROUP --sync [POLICYFILE_PATH] [options]

In the second form of the command, `chef provision` create machines that will
operate in policyfile mode and syncronizes a local policyfile to the server
before converging the machine(s) defined in the provision cookbook.

### chef provision --no-policy [options]

In the third form of the command, `chef provision` expects to create machines
that will not operate in policyfile mode.

Note that this command is considered beta. Behavior, the APIs that pass CLI
data to chef-client, and argument names may change as more experience is gained
from real-world usage.

## Cookbook Integration

Most of the options and arguments to `chef provision` only affect what
default data is passed to your provisioning recipe. Your recipe must
pull data from the provisioning data context in order for the command
line values to have any effect on the provisioned machines.

### Basic Example

This is a machine recipe I created to demonstrate provisioning with
Policyfiles:

```ruby
# Assign the context to a local variable for convenience
context = ChefDK::ProvisioningData.context

with_driver 'vagrant:~/.vagrant.d/boxes' do

  # Set Machine Options
  options = {
    vagrant_options: { 'vm.box' => 'opscode-ubuntu-14.04' },
    # Set all machine options to the defaults provided by `chef provision`
    convergence_options: context.convergence_options
  }

  # Set node_name to user provided node name
  machine context.node_name do
    machine_options(options)

    # This forces a chef run every time, which is sensible for some
    # `chef provision` use cases, especially when using `--sync`
    converge(true)
    # Set action to what `chef provision` specifies
    action(context.action)
  end
end
```

To provision the machine, I run:

```sh
chef provision test123 --sync -n aar-dev
```

This synchronizes my Policyfile lock to my Chef Server and converges the
node.

### Provisioning Context

The provisioning context provides the following data:

* `action`: `:converge`, or `:destroy` if you pass `-d` to the
  CLI.
* `node_name`: the argument to the `-n` option.
* `policy_group`: is set to the relevant CLI argument when operating in
  one of the Policyfile modes.
* `policy_name`: set to either the value of `--policy-name` or the
  policy name specified in the Policyfile lock for `--sync`
* `extra_chef_config`: `chef provision` currently uses the `chef_config`
  convergence option to set Policyfile config and duplicate your current
  `ssl_verify_mode` setting. You can set further custom config by
  assigning a value to this setting, e.g.:

```ruby
ChefDK::ProvisioningData.context.extra_chef_config = 'log_level :debug'
```


text:
class Relationship < ActiveRecord::Base
  attr_accessible :followed_id

  belongs_to :follower, class_name: "User"
  belongs_to :followed, class_name: "User"

  validate :follower_id, presence: true
  validate :followed_id, presence: true
end


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

namespace RemoveNegativesAndRev01
{
    class RemoveNegativesAndRev01
    {
        static void Main(string[] args)
        {
            var numbers = Console.ReadLine()
               .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
               .Select(int.Parse)
               .ToList();

            for (int i = 0; i < numbers.Count; i++)
            {
                if (numbers[i] < 0)
                {
                    numbers.RemoveAt(i);

                    i--;
                }
            }

            numbers.Reverse();

            if (numbers.Count == 0)

                Console.WriteLine("Empty");
            else
            {

                foreach (var item in numbers)
                {
                    Console.WriteLine(item);
                }
            }
        }

    }
}


text:
<?php

namespace Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Compiler;

use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractCompilerPassTestCase;
use Sylius\Bundle\ResourceBundle\DependencyInjection\Compiler\DoctrineTargetEntitiesResolverPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

/**
 * @author Kamil Kokot <kamil@kokot.me>
 */
final class DoctrineTargetEntitiesResolverPassTest extends AbstractCompilerPassTestCase
{
    /**
     * @test
     */
    public function it_adds_method_call_to_resolve_doctrine_target_entities_with_interface_given_as_fqcn()
    {
        $this->setDefinition('doctrine.orm.listeners.resolve_target_entity', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['app.loremipsum' => ['classes' => ['interface' => \Countable::class]]]
        );

        $this->setParameter('app.model.loremipsum.class', \stdClass::class);

        $this->compile();

        $this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
            'doctrine.orm.listeners.resolve_target_entity',
            'addResolveTargetEntity',
            [\Countable::class, \stdClass::class, []]
        );
    }

    /**
     * @test
     */
    public function it_adds_method_call_to_resolve_doctrine_target_entities_with_interface_given_as_parameter()
    {
        $this->setDefinition('doctrine.orm.listeners.resolve_target_entity', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['app.loremipsum' => ['classes' => ['interface' => 'app.interface.loremipsum.class']]]
        );

        $this->setParameter('app.model.loremipsum.class', \stdClass::class);
        $this->setParameter('app.interface.loremipsum.class', \Countable::class);

        $this->compile();

        $this->assertContainerBuilderHasServiceDefinitionWithMethodCall(
            'doctrine.orm.listeners.resolve_target_entity',
            'addResolveTargetEntity',
            [\Countable::class, \stdClass::class, []]
        );
    }

    /**
     * @test
     */
    public function it_ignores_resources_without_interface()
    {
        $this->setDefinition('doctrine.orm.listeners.resolve_target_entity', new Definition());

        $this->setParameter(
            'sylius.resources',
            ['app.loremipsum' => ['classes' => ['model' => \stdClass::class]]]
        );

        $this->compile();
    }

    /**
     * @test
     */
    public function it_adds_doctrine_event_listener_tag_to_target_entities_resolver_if_not_exists()
    {
        $this->setDefinition('doctrine.orm.listeners.resolve_target_entity', new Definition());
        $this->setParameter('sylius.resources', []);

        $this->compile();

        $this->assertContainerBuilderHasServiceDefinitionWithTag(
            'doctrine.orm.listeners.resolve_target_entity',
            'doctrine.event_listener',
            ['event' => 'loadClassMetadata']
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function registerCompilerPass(ContainerBuilder $container)
    {
        $container->addCompilerPass(new DoctrineTargetEntitiesResolverPass());
    }
}