text:
 <col width=200>
 <col width=300>

  100	200	300


text:
MODE=${1:--s}

# Output file name
FILE="$HOME/Images/Captures/`date +%FT%T.gif`"

# Temporary files
TMPDIR="/tmp"
TMP_AVI=$(mktemp -u $TMPDIR/gifcast.XXXXXXXXXX.avi)
TMP_PALETTE=$(mktemp $TMPDIR/gifcast.XXXXXXXXXX.png)
TMP_PIPE=$(mktemp -u $TMPDIR/gifcast.XXXXXXXXXX.fifo)
mkfifo $TMP_PIPE

exec 3<> $TMP_PIPE

# Cleanup temporary files at exit
function at_exit() {
  rm -f $TMP_AVI
  rm -f $TMP_PALETTE
  rm -f $TMP_PIPE
}
trap at_exit EXIT

# Stop recording and tray icon
function tray_cb {
echo $TMP_PIPE
  local pipe=$1
  local cast_pid=$2
  local capture_pid=`pgrep -P $cast_pid`

  kill $capture_pid
  echo "quit" > $pipe
}
export -f tray_cb

# Start capture
ffcast $MODE rec $TMP_AVI &
cast_pid=$!

yad --notification \
  --image media-playback-stop \
  --command "bash -c 'tray_cb $TMP_PIPE $cast_pid'" \
  --listen <&3

# Start convert using a GIF palette
ffmpeg -i $TMP_AVI -vf "fps=15,palettegen" -y $TMP_PALETTE
ffmpeg -i $TMP_AVI -i $TMP_PALETTE -lavfi "fps=15 [x]; [x][1:v] paletteuse" -y $FILE

echo "$FILE"

redpajama_set_name: RedPajamaGithub


text:
title: Contact
layout: page
description: How to contact me
image:
  feature: abstract-11.jpg
  credit: dargadgetz
  creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/
share: true
modified: '2016-06-01 15:14:43 -0400'
---

You can send me an email at hey (at) thezenvan.com


text:
package org.sistemafinanciero.entity.type;

public enum RolType {
	CAJERO, JEFE_CAJA, ADMINISTRADOR, ADMIN
}


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

namespace Gallio.Ambience
{
    /// <summary>
    /// Represents a lazily evaluated query over Ambient data for use with
    /// the LINQ query syntax.
    /// </summary>
    public interface IAmbientDataQuery<T> : IEnumerable<T>
    {
    }
}


text:
@class NSDictionary, UNNotificationResponse;

@protocol IDERemoteNotificationHandling <NSObject>
- (BOOL)handleNotificationResponse:(UNNotificationResponse *)arg1 payload:(NSDictionary *)arg2 error:(id *)arg3;
- (BOOL)handleNotificationPayload:(NSDictionary *)arg1 error:(id *)arg2;
- (BOOL)canHandleNotificationPayload:(NSDictionary *)arg1;
@end


text:
package org.apereo.cas.util.scripting;

import org.apereo.cas.util.RegexUtils;
import org.apereo.cas.util.ResourceUtils;

import groovy.lang.Binding;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
import groovy.lang.GroovyShell;
import groovy.lang.Script;
import lombok.SneakyThrows;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.codehaus.groovy.runtime.InvokerInvocationException;
import org.springframework.core.io.Resource;

import javax.script.Invocable;
import javax.script.ScriptEngineManager;
import javax.script.SimpleBindings;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This is {@link ScriptingUtils}.
 *
 * @author Misagh Moayyed
 * @since 5.1.0
 */

@Slf4j
@UtilityClass
public class ScriptingUtils {
    /**
     * Pattern indicating groovy script is inlined.
     */
    private static final Pattern INLINE_GROOVY_PATTERN = RegexUtils.createPattern("groovy\\s*\\{\\s*(.+)\\s*\\}",
        Pattern.DOTALL | Pattern.MULTILINE);

    /**
     * Pattern indicating groovy script is a file/resource.
     */
    private static final Pattern FILE_GROOVY_PATTERN = RegexUtils.createPattern("(file|classpath):(.+\\.groovy)");

    /**
     * Is inline groovy script ?.
     *
     * @param script the script
     * @return the boolean
     */
    public static boolean isInlineGroovyScript(final String script) {
        return getMatcherForInlineGroovyScript(script).find();
    }

    /**
     * Is external groovy script ?.
     *
     * @param script the script
     * @return the boolean
     */
    public static boolean isExternalGroovyScript(final String script) {
        return getMatcherForExternalGroovyScript(script).find();
    }

    /**
     * Gets inline groovy script matcher.
     *
     * @param script the script
     * @return the inline groovy script matcher
     */
    public static Matcher getMatcherForInlineGroovyScript(final String script) {
        return INLINE_GROOVY_PATTERN.matcher(script);
    }

    /**
     * Gets groovy file script matcher.
     *
     * @param script the script
     * @return the groovy file script matcher
     */
    public static Matcher getMatcherForExternalGroovyScript(final String script) {
        return FILE_GROOVY_PATTERN.matcher(script);
    }

    /**
     * Execute groovy shell script t.
     *
     * @param <T>    the type parameter
     * @param script the script
     * @param clazz  the clazz
     * @return the t
     */
    public static <T> T executeGroovyShellScript(final Script script,
                                                 final Class<T> clazz) {
        return executeGroovyShellScript(script, new HashMap<>(0), clazz);
    }

    /**
     * Execute groovy shell script t.
     *
     * @param <T>       the type parameter
     * @param script    the script
     * @param variables the variables
     * @param clazz     the clazz
     * @return the t
     */
    public static <T> T executeGroovyShellScript(final Script script,
                                                 final Map<String, Object> variables,
                                                 final Class<T> clazz) {
        try {
            val binding = script.getBinding();
            if (!binding.hasVariable("logger")) {
                binding.setVariable("logger", LOGGER);
            }
            if (variables != null && !variables.isEmpty()) {
                variables.forEach(binding::setVariable);
            }
            script.setBinding(binding);
            LOGGER.debug("Executing groovy script [{}] with variables [{}]", script, binding.getVariables());

            val result = script.run();
            return getGroovyScriptExecutionResultOrThrow(clazz, result);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    /**
     * Execute groovy script via run object.
     *
     * @param <T>          the type parameter
     * @param groovyScript the groovy script
     * @param args         the args
     * @param clazz        the clazz
     * @param failOnError  the fail on error
     * @return the object
     */
    public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final Object[] args, final Class<T> clazz,
                                            final boolean failOnError) {
        return executeGroovyScript(groovyScript, "run", args, clazz, failOnError);
    }

    /**
     * Execute groovy script.
     *
     * @param <T>          the type parameter
     * @param groovyObject the groovy object
     * @param args         the args
     * @param clazz        the clazz
     * @param failOnError  the fail on error
     * @return the result
     */
    public static <T> T executeGroovyScript(final GroovyObject groovyObject,
                                            final Object[] args, final Class<T> clazz,
                                            final boolean failOnError) {
        return executeGroovyScript(groovyObject, "run", args, clazz, failOnError);
    }

    /**
     * Execute groovy script t.
     *
     * @param <T>          the type parameter
     * @param groovyScript the groovy script
     * @param methodName   the method name
     * @param clazz        the clazz
     * @param args         the args
     * @return the type to return
     */
    public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final String methodName,
                                            final Class<T> clazz,
                                            final Object... args) {
        return executeGroovyScript(groovyScript, methodName, args, clazz, false);
    }

    /**
     * Execute groovy script.
     *
     * @param <T>          the type parameter
     * @param groovyScript the groovy script
     * @param methodName   the method name
     * @param clazz        the clazz
     * @return the t
     */
    public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final String methodName,
                                            final Class<T> clazz) {
        return executeGroovyScript(groovyScript, methodName, ArrayUtils.EMPTY_OBJECT_ARRAY, clazz, false);
    }

    /**
     * Execute groovy script t.
     *
     * @param <T>          the type parameter
     * @param groovyScript the groovy script
     * @param methodName   the method name
     * @param args         the args
     * @param clazz        the clazz
     * @param failOnError  the fail on error
     * @return the t
     */
    @SneakyThrows
    public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final String methodName,
                                            final Object[] args,
                                            final Class<T> clazz,
                                            final boolean failOnError) {

        if (groovyScript == null || StringUtils.isBlank(methodName)) {
            return null;
        }

        try {
            return AccessController.doPrivileged((PrivilegedAction<T>) () -> getGroovyResult(groovyScript, methodName, args, clazz, failOnError));
        } catch (final Exception e) {
            var cause = e instanceof PrivilegedActionException ? PrivilegedActionException.class.cast(e).getException() : e;
            if (failOnError) {
                throw cause;
            }
            LOGGER.error(cause.getMessage(), cause);
        }
        return null;
    }

    /**
     * Execute groovy script t.
     *
     * @param <T>          the type parameter
     * @param groovyObject the groovy object
     * @param methodName   the method name
     * @param args         the args
     * @param clazz        the clazz
     * @param failOnError  the fail on error
     * @return the t
     */
    @SneakyThrows
    public static <T> T executeGroovyScript(final GroovyObject groovyObject,
                                            final String methodName,
                                            final Object[] args,
                                            final Class<T> clazz,
                                            final boolean failOnError) {
        try {
            LOGGER.trace("Executing groovy script's [{}] method, with parameters [{}]", methodName, args);
            val result = groovyObject.invokeMethod(methodName, args);
            LOGGER.trace("Results returned by the groovy script are [{}]", result);
            if (!clazz.equals(Void.class)) {
                return getGroovyScriptExecutionResultOrThrow(clazz, result);
            }
        } catch (final Exception e) {
            var cause = e instanceof InvokerInvocationException ? e.getCause() : e;
            if (failOnError) {
                throw cause;
            }
            LOGGER.error(cause.getMessage(), cause);
        }
        return null;
    }

    /**
     * Execute groovy script t.
     *
     * @param <T>          the type parameter
     * @param groovyObject the groovy object
     * @param args         the args
     * @param clazz        the clazz
     * @param failOnError  the fail on error
     * @return the t
     */
    @SneakyThrows
    public static <T> T executeGroovyScript(final Script groovyObject,
                                            final Map<String, Object> args,
                                            final Class<T> clazz,
                                            final boolean failOnError) {
        try {
            LOGGER.trace("Executing groovy script with bindings [{}]", args);

            val binding = new Binding();
            if (args != null && !args.isEmpty()) {
                args.forEach(binding::setVariable);
            }
            if (!binding.hasVariable("logger")) {
                binding.setVariable("logger", LOGGER);
            }
            groovyObject.setBinding(binding);
            val result = groovyObject.run();
            LOGGER.trace("Results returned by the groovy script are [{}]", result);

            if (!clazz.equals(Void.class)) {
                return getGroovyScriptExecutionResultOrThrow(clazz, result);
            }
        } catch (final Exception e) {
            var cause = e instanceof InvokerInvocationException ? e.getCause() : e;
            if (failOnError) {
                throw cause;
            }
            LOGGER.error(cause.getMessage(), cause);
        }
        return null;
    }

    /**
     * Parse groovy shell script script.
     *
     * @param script the script
     * @return the script
     */
    public static Script parseGroovyShellScript(final String script) {
        try {
            val shell = new GroovyShell();
            LOGGER.debug("Parsing groovy script [{}]", script);
            return shell.parse(script);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    /**
     * Parse groovy script groovy object.
     *
     * @param groovyScript the groovy script
     * @param failOnError  the fail on error
     * @return the groovy object
     */
    public static GroovyObject parseGroovyScript(final Resource groovyScript,
                                                 final boolean failOnError) {
        return AccessController.doPrivileged((PrivilegedAction<GroovyObject>) () -> {
            val parent = ScriptingUtils.class.getClassLoader();
            try (val loader = new GroovyClassLoader(parent)) {
                val groovyClass = loadGroovyClass(groovyScript, loader);
                if (groovyClass != null) {
                    LOGGER.trace("Creating groovy object instance from class [{}]", groovyScript.getURI().getPath());
                    return (GroovyObject) groovyClass.getDeclaredConstructor().newInstance();
                }
                LOGGER.warn("Groovy script at [{}] does not exist", groovyScript.getURI().getPath());
            } catch (final Exception e) {
                if (failOnError) {
                    throw new RuntimeException(e);
                }
                LOGGER.error(e.getMessage(), e);
            }
            return null;
        });
    }

    private Class loadGroovyClass(final Resource groovyScript,
                                  final GroovyClassLoader loader) throws IOException {
        if (ResourceUtils.isJarResource(groovyScript)) {
            try (val groovyReader = new BufferedReader(new InputStreamReader(groovyScript.getInputStream(), StandardCharsets.UTF_8))) {
                return loader.parseClass(groovyReader, groovyScript.getFilename());
            }
        }

        val groovyFile = groovyScript.getFile();
        if (groovyFile.exists()) {
            return loader.parseClass(groovyFile);
        }
        return null;
    }

    @SneakyThrows
    private static <T> T getGroovyResult(final Resource groovyScript,
                                         final String methodName,
                                         final Object[] args,
                                         final Class<T> clazz,
                                         final boolean failOnError) {
        try {
            val groovyObject = parseGroovyScript(groovyScript, failOnError);
            if (groovyObject == null) {
                LOGGER.error("Could not parse the Groovy script at [{}]", groovyScript);
                return null;
            }
            return executeGroovyScript(groovyObject, methodName, args, clazz, failOnError);
        } catch (final Exception e) {
            if (failOnError) {
                throw e;
            }
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    private static <T> T getGroovyScriptExecutionResultOrThrow(final Class<T> clazz, final Object result) {
        if (result != null && !clazz.isAssignableFrom(result.getClass())) {
            throw new ClassCastException("Result [" + result + " is of type " + result.getClass() + " when we were expecting " + clazz);
        }
        return (T) result;
    }

    /**
     * Execute groovy script engine t.
     *
     * @param <T>        the type parameter
     * @param scriptFile the script file
     * @param args       the args
     * @param clazz      the clazz
     * @return the t
     */
    public static <T> T executeScriptEngine(final String scriptFile, final Object[] args, final Class<T> clazz) {
        try {
            val engineName = getScriptEngineName(scriptFile);
            if (StringUtils.isBlank(engineName)) {
                LOGGER.warn("Script engine name can not be determined for [{}]", engineName);
                return null;
            }
            val engine = new ScriptEngineManager().getEngineByName(engineName);
            if (engine == null) {
                LOGGER.warn("Script engine is not available for [{}]", engineName);
                return null;
            }

            val resourceFrom = ResourceUtils.getResourceFrom(scriptFile);
            val theScriptFile = resourceFrom.getFile();
            if (theScriptFile.exists()) {
                LOGGER.debug("Created object instance from class [{}]", theScriptFile.getCanonicalPath());

                try (val reader = Files.newBufferedReader(theScriptFile.toPath(), StandardCharsets.UTF_8)) {
                    engine.eval(reader);
                }
                val invocable = (Invocable) engine;
                LOGGER.debug("Executing script's run method, with parameters [{}]", args);
                val result = invocable.invokeFunction("run", args);
                LOGGER.debug("Groovy script result is [{}]", result);
                return getGroovyScriptExecutionResultOrThrow(clazz, result);
            }
            LOGGER.warn("[{}] script [{}] does not exist, or cannot be loaded", StringUtils.capitalize(engineName), scriptFile);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    /**
     * Execute inline groovy script engine.
     *
     * @param <T>       the type parameter
     * @param script    the script
     * @param variables the variables
     * @param clazz     the clazz
     * @return the t
     */
    public static <T> T executeGroovyScriptEngine(final String script,
                                                  final Map<String, Object> variables,
                                                  final Class<T> clazz) {
        try {
            val engine = new ScriptEngineManager().getEngineByName("groovy");
            if (engine == null) {
                LOGGER.warn("Script engine is not available for Groovy");
                return null;
            }
            val binding = new SimpleBindings();
            if (variables != null && !variables.isEmpty()) {
                binding.putAll(variables);
            }
            if (!binding.containsKey("logger")) {
                binding.put("logger", LOGGER);
            }
            val result = engine.eval(script, binding);
            return getGroovyScriptExecutionResultOrThrow(clazz, result);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    /**
     * Gets object instance from groovy resource.
     *
     * @param <T>          the type parameter
     * @param resource     the resource
     * @param expectedType the expected type
     * @return the object instance from groovy resource
     */
    public static <T> T getObjectInstanceFromGroovyResource(final Resource resource,
                                                            final Class<T> expectedType) {
        return getObjectInstanceFromGroovyResource(resource, ArrayUtils.EMPTY_CLASS_ARRAY, ArrayUtils.EMPTY_OBJECT_ARRAY, expectedType);
    }

    /**
     * Gets object instance from groovy resource.
     *
     * @param <T>             the type parameter
     * @param resource        the resource
     * @param constructorArgs the constructor args
     * @param args            the args
     * @param expectedType    the expected type
     * @return the object instance from groovy resource
     */
    public static <T> T getObjectInstanceFromGroovyResource(final Resource resource,
                                                            final Class[] constructorArgs,
                                                            final Object[] args,
                                                            final Class<T> expectedType) {
        try {
            if (resource == null) {
                LOGGER.debug("No groovy script is defined");
                return null;
            }

            val script = IOUtils.toString(resource.getInputStream(), StandardCharsets.UTF_8);

            val clazz = AccessController.doPrivileged((PrivilegedAction<Class<T>>) () -> {
                val classLoader = new GroovyClassLoader(ScriptingUtils.class.getClassLoader(),
                    new CompilerConfiguration(), true);
                return classLoader.parseClass(script);
            });

            LOGGER.trace("Preparing constructor arguments [{}] for resource [{}]", args, resource);
            val ctor = clazz.getDeclaredConstructor(constructorArgs);
            val result = ctor.newInstance(args);

            if (!expectedType.isAssignableFrom(result.getClass())) {
                throw new ClassCastException("Result [" + result
                    + " is of type " + result.getClass()
                    + " when we were expecting " + expectedType);
            }
            return result;
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }

    /**
     * Gets script engine name.
     *
     * @param scriptFile the script file
     * @return the script engine name
     */
    public static String getScriptEngineName(final String scriptFile) {
        if (scriptFile.endsWith(".py")) {
            return "python";
        }
        if (scriptFile.endsWith(".js")) {
            return "js";
        }
        if (scriptFile.endsWith(".groovy")) {
            return "groovy";
        }
        return null;
    }
}


text:
// Shake.cs
// Copyright (c) Nikhil Kothari, 2008. All Rights Reserved.
// http://www.nikhilk.net
//
// Silverlight.FX is an application framework for building RIAs with Silverlight.
// This project is licensed under the BSD license. See the accompanying License.txt
// file for more information.
// For updated project information please visit http://projects.nikhilk.net/SilverlightFX.
//

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Glitz;

namespace SilverlightFX.UserInterface.Effects {

    /// <summary>
    /// Represents an effect that shakes the associated element left and right.
    /// </summary>
    public class Shake : AnimationEffect {

        private double _shakeDistance;
        private TranslateTransform _translateTransform;

        /// <summary>
        /// Initializes an instance of a ShakeEffect.
        /// </summary>
        public Shake() {
            _shakeDistance = 10;
        }

        /// <summary>
        /// Gets or sets the distance that the element should be shaken.
        /// </summary>
        public double ShakeDistance {
            get {
                return _shakeDistance;
            }
            set {
                if (value <= 0) {
                    throw new ArgumentOutOfRangeException("value");
                }
                _shakeDistance = value;
            }
        }

        /// <internalonly />
        protected internal override ProceduralAnimation CreateEffectAnimation(AnimationEffectDirection direction) {
            FrameworkElement target = GetTarget();

            if (_translateTransform == null) {
                Transform existingTransform = target.RenderTransform;
                if (existingTransform != null) {
                    _translateTransform = existingTransform as TranslateTransform;

                    if (_translateTransform == null) {
                        TransformGroup transformGroup = existingTransform as TransformGroup;

                        if (transformGroup != null) {
                            foreach (Transform transform in transformGroup.Children) {
                                _translateTransform = transform as TranslateTransform;
                                if (_translateTransform != null) {
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            if (_translateTransform == null) {
                throw new InvalidOperationException("The element does not have a translate transform associated with it.");
            }

            ShakeAnimation animation = new ShakeAnimation(_translateTransform, Duration, _shakeDistance);
            animation.Interpolation = GetEffectiveInterpolation();

            return animation;
        }

        private sealed class ShakeAnimation : TweenAnimation {

            private TranslateTransform _transform;
            private double _distance;

            public ShakeAnimation(TranslateTransform transform, TimeSpan duration, double distance)
                : base(duration) {
                _transform = transform;
                _distance = distance;
            }

            protected override void PerformTweening(double frame) {
                double initialX;
                double finalX;

                if (frame <= .1) {
                    frame = frame / .1;
                    initialX = 0;
                    finalX = _distance;
                }
                else if (frame <= .3) {
                    frame = (frame - .1) / .2;
                    initialX = _distance;
                    finalX = -_distance;
                }
                else if (frame <= .5) {
                    frame = (frame - .3) / .2;
                    initialX = -_distance;
                    finalX = _distance;
                }
                else if (frame <= .7) {
                    frame = (frame - .5) / .2;
                    initialX = _distance;
                    finalX = -_distance;
                }
                else if (frame <= .9) {
                    frame = (frame - .7) / .2;
                    initialX = -_distance;
                    finalX = _distance;
                }
                else {
                    frame = (frame - .9) / .1;
                    initialX = _distance;
                    finalX = 0;
                }

                frame = Math.Min(frame, 1.0);

                _transform.X = initialX + (finalX - initialX) * frame;
            }
        }
    }
}


text:
package com.panjin.design.actor.ob.subject;

import com.panjin.design.actor.ob.observer.Architect;
import com.panjin.design.actor.ob.observer.ITalent;
import com.panjin.design.actor.ob.observer.JuniorEngineer;
import com.panjin.design.actor.ob.observer.SeniorEngineer;

public class Client1 {

  public static void main(String[] args) {
    ITalent juniorEngineer = new JuniorEngineer();
    ITalent seniorEngineer = new SeniorEngineer();
    ITalent architect = new Architect();

    AbstractHR subject = new HeadHunter();
    subject.addTalent(juniorEngineer);
    subject.addTalent(seniorEngineer);
    subject.addTalent(architect);

    subject.publishJob("Top 500 big data position");
  }

}


text:
import { $ } from "./util.js";

export function init() {
  $("#birdfeeder-reset-feed-id").addEventListener("click", resetFeedId);
}

function resetFeedId() {
  var feedContainerNode = $("#birdfeeder-feed-container");
  feedContainerNode.classList.add("disabled");

  fetch("/bird-feeder/reset-feed-id", { method: "POST" })
    .then((response) => response.text())
    .then(() => window.location.reload())
    .catch((error) => {
      feedContainerNode.classList.remove("disabled");
      alert("Could not reset the feed URL: " + error);
    });
}


text:
title: "Hampton Catlin & Amy Lee"
---

Come hang out with us for The Mixin, our 9th San Francisco [Sass][]
& front-end meet up.

[sass]: http://sass-lang.com

We'll have a couple talks by 2 rad speakers, plus some food and drinks.
Tweeting about this event? Use hashtag: [#mixin112015][hashtag]

[hashtag]: https://twitter.com/search?q=#mixin112015

## Presentations
This time, we're excited to have the following talks:

* "**Sass to the Future**"
  by [Hampton Catlin](http://www.hamptoncatlin.com/), co-founder,
  [Wordset](http://wordset.org), inventor [Sass](http://sass-lang.com)
  CSS](https://github.com/stubbornella/oocss)
* "**UI Motion & the Lightning Design System**"
  by [Amy Lee](http://twitter.com/amster), UX engineer, Salesforce

## Event Team
* [Jina](http://twitter.com/jina) --- organizers & emcees
* [Kaelig](http://twitter.com/kaelig) --- Sass community update
* [Salesforce UX](http://twitter.com/salesforceux) --- Host & Sponsor


text:
class Gradle < Formula
  desc "Build system based on the Groovy language"
  homepage "https://www.gradle.org/"
  url "https://downloads.gradle.org/distributions/gradle-2.6-bin.zip"
  sha256 "18a98c560af231dfa0d3f8e0802c20103ae986f12428bb0a6f5396e8f14e9c83"

  def install
    libexec.install %w[bin lib]
    bin.install_symlink libexec+"bin/gradle"
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Ranunculus subrigidus W.B. Drew

### Remarks
null


text:
@interface _WJHXCTestInvocation : NSInvocation
@end


text:
/**
 * Created by Stefano on 06/04/14.
 */

test("RBTreeList - Insert test", function () {
	var tree = new RBTreeList();
	var keys = [];
	for (var i = 0; i < 20; i++) {
		keys.push(Math.random());
		tree.insert(keys[i], i);
	}
	for (var j = 0; j < 20; j++)
		deepEqual(tree.search(keys[j]), j, "Insert node");
});

test("RBTreeList - Minimum test", function () {
	var tree = new RBTreeList();
	var keys = [];
	var min = 10;
	for (var i = 0; i < 20; i++) {
		keys.push(Math.random());
		tree.insert(keys[i], i);
		if (keys[i] < min)
			min = keys[i];
	}
	deepEqual(tree.minimum().item, tree.search(min), "Minimum");
});

test("RBTreeList - Maximum test", function () {
	var tree = new RBTreeList();
	var keys = [];
	var max = -1;
	for (var i = 0; i < 20; i++) {
		keys.push(Math.random());
		tree.insert(keys[i], i);
		if (keys[i] > max)
			max = keys[i];
	}
	deepEqual(tree.maximum().item, tree.search(max), "Maximum");
});

test("RBTreeList - Successor test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 20; i++)
		tree.insert(i, i);
	var it = tree.getIterator();
	var j = 1;
	for (it.first(); !it.isDone(); it.next(), j++) {
		var successor = tree.successor(it.getNode());
		if (successor)
			deepEqual(successor.item, j, "Successor");
		else
			deepEqual(successor, null, "No successor");
	}
});

test("RBTreeList - Predecessor test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 20; i++)
		tree.insert(i, i);
	var it = tree.getIterator();
	var j = 18;
	for (it.last(); !it.isDone(); it.previous(), j--) {
		var predecessor = tree.predecessor(it.getNode());
		if (predecessor)
			deepEqual(predecessor.item, j, "Predecessor");
		else
			deepEqual(predecessor, null, "No predecessor");
	}
});

test("RBTreeList - Delete node test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 20; i++)
		tree.insert(i, i);
	var j = 0;
	while (tree.minimum()) {
		deepEqual(tree.minimum().item, j, "Deletion");
		tree.deleteNode(tree.minimum());
		j++;
	}
});

test("RBTreeList - To array test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 5; i++)
		tree.insert(i, i);
	deepEqual(tree.toArray(), [0, 1, 2, 3, 4], "To array");
});

test("RBTreeList - Filter test", function () {
	var tree = new RBTreeList();

	for (var i = 0; i < 100; i++)
		tree.insert(i, i);

	var result = tree.filter(function (item) {
		return 1 - item % 2;
	});

	deepEqual(result[0], 0, "Filter of the even values");
	deepEqual(result[result.length - 1], 98, "Filter on the even values");
});

test("RBTreeList - Clear test", function () {
	var tree = new RBTreeList();
	tree.insert(0, 0);
	tree.insert(2, 2);
	tree.clear();
	deepEqual(tree.isEmpty(), true, "Clear tree");
});

test("RBTreeList - Is empty test", function () {
	var tree = new RBTreeList();
	tree.insert(0, 0);
	tree.insert(2, 2);
	deepEqual(tree.isEmpty(), false, "Is not empty");
	tree.clear();
	deepEqual(tree.isEmpty(), true, "Is empty");
});

test("RBTreeList - Contains test", function () {
	var tree = new RBTreeList();
	tree.insert(0, 0);
	tree.insert(2, 2);
	deepEqual(tree.contains(0), true, "Contains 0");
	deepEqual(tree.contains(2), true, "Contains 2");
	deepEqual(tree.contains(1), false, "Not contains 1");
	var callback = function (item) {
		return item > 0;
	};
	deepEqual(tree.fullContains(callback), true, "Contains a value > 0");
	callback = function (item) {
		return item < 0;
	};
	deepEqual(tree.fullContains(callback), false, "Contains a value < 0");
});

test("RBTreeList - Execute test", function () {
	var tree = new RBTreeList();
	tree.insert(0, 0);
	tree.insert(2, 2);
	var callback = function (item) {
		return item * 2;
	};
	tree.execute(callback);
	deepEqual(tree.search(0), 0, "Execute for key 0");
	deepEqual(tree.search(2), 4, "Execute for key 1");
});

test("RBTreeList - Index of test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 10; i++)
		tree.insert(i, i);
	var callback = function (item) {
		return !(item % 2) && item > 5;
	};
	deepEqual(tree.indexOf(0), 0, "Index of 0");
	deepEqual(tree.indexOf(15), -1, "Index of 15");
	deepEqual(tree.indexOf(5), 5, "Index of 5");
	deepEqual(tree.indexOf(null, callback), 6, "Index of the first even number greater than 5");
});

test("RBTreeList - Last index of test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 10; i++)
		tree.insert(i, i);
	var callback = function (item) {
		return !(item % 2) && item > 5;
	};
	deepEqual(tree.lastIndexOf(0), 0, "Last index of 0");
	deepEqual(tree.lastIndexOf(15), -1, "Last index of 15");
	deepEqual(tree.lastIndexOf(5), 5, "Last index of 5");
	deepEqual(tree.lastIndexOf(null, callback), 8, "Index of the last even number greater than 5");
});

test("RBTreeList - Indexes of test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 30; i++)
		tree.insert(i, i % 10);
	var callback = function (item) {
		return !(item % 2) && item > 5;
	};
	deepEqual(tree.allIndexesOf(0), [0, 10, 20], "Indexes of 0");
	deepEqual(tree.allIndexesOf(15), [], "Indexes of 15");
	deepEqual(tree.allIndexesOf(5), [5, 15, 25], "Indexes of 5");
	deepEqual(tree.allIndexesOf(null, callback), [6, 8, 16, 18, 26, 28], "Indexes of the even numbers greater than 5");
});

test("RBTreeList - Clone test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 10; i++)
		tree.insert(i, i);
	var clone = tree.clone();
	var it = clone.getIterator();
	var j = 0;
	for (it.first(); !it.isDone(); it.next(), j++)
		deepEqual(it.getItem(), j, "Clone of the tree");
});

test("RBTreeList - Clone distinct test", function () {
	var tree = new RBTreeList();
	for (var i = 0; i < 20; i++)
		tree.insert(i % 10, i % 10);
	var clone = tree.cloneDistinct();
	deepEqual(clone.allIndexesOf(2), [2], "Clone of the tree");
});


text:
package me.chanjar.javadelegate;

import org.activiti.engine.delegate.BpmnError;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ThrowBPMNErrorTask implements JavaDelegate {

  protected Logger logger = LoggerFactory.getLogger(this.getClass());

  @Override
  public void execute(DelegateExecution execution) throws Exception {
    logger.error("throw BPMN error");
    throw new BpmnError("abc");
  }

}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Petri Net Plans: learnpnp::EGreedy Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

Petri Net Plans

Main Page

Related Pages

Namespaces

Classes

Files

Class List

Class Hierarchy

Class Members

learnpnp

EGreedy

Public Member Functions

learnpnp::EGreedy Class Reference

Implements an epsilon-greedy exploration strategy.
 More...

#include <EGreedy.h>

Inheritance diagram for learnpnp::EGreedy:

  <map id="learnpnp::EGreedy_map" name="learnpnp::EGreedy_map">
<area href="classlearnpnp_1_1_exp_policy.html" title="The interface for exploration policies based on a value function." alt="learnpnp::ExpPolicy" shape="rect" coords="0,0,124,24"/>
</map>

List of all members.

Public Member Functions

 	EGreedy (double epsilon, bool remember=true)

 	Creates an epsilon-greedy policy with the specified epsilon.

Detailed Description

Implements an epsilon-greedy exploration strategy.

This strategy returns the next marking with highest value with probability (1- epislon), and a random marking (among the ones available) with probability epsilon

Author:

Matteo Leonetti

Constructor & Destructor Documentation

          learnpnp::EGreedy::EGreedy
          (
          double
          epsilon,

          bool
          remember = true

          )
          	 [explicit]

Creates an epsilon-greedy policy with the specified epsilon.

Parameters:

epsilon	is the probability according to which a uniformly distributed random action will be selected

remember	whether or not this exploration policy should remember previous choices

See also:

ExpPolicy for more information about memory.

The documentation for this class was generated from the following file:

include/pnp/learning_plan/exp/EGreedy.h

<address class="footer">
Generated on Thu Oct 9 2014 02:16:35 for Petri Net Plans by

 1.7.6.1
</address>


text:
exec >/dev/null 2>&1
if /usr/sbin/ntpdate -u 0.north-america.pool.ntp.org; then
  exit 0
else
  if /usr/sbin/ntpdate -u 1.north-america.pool.ntp.org; then
    exit 0
  else
    logger -p cron.err "Cannot fetch network time."
    exit 1
  fi
fi


text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
//
// Copyright (c) 2009 INESC Porto
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation;
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// Author: Gustavo J. A. M. Carneiro  <gjc@inescporto.pt> <gjcarneiro@gmail.com>
//

#ifndef FLOW_MONITOR_H
#define FLOW_MONITOR_H

#include <vector>
#include <map>

#include "ns3/ptr.h"
#include "ns3/object.h"
#include "ns3/flow-probe.h"
#include "ns3/flow-classifier.h"
#include "ns3/histogram.h"
#include "ns3/nstime.h"
#include "ns3/event-id.h"

namespace ns3 {

/**
 * \defgroup flow-monitor Flow Monitor
 * \brief  Collect and store performance data from a simulation
 */

/**
 * \ingroup flow-monitor
 * \brief An object that monitors and reports back packet flows observed during a simulation
 *
 * The FlowMonitor class is responsible for coordinating efforts
 * regarding probes, and collects end-to-end flow statistics.
 *
 */
class FlowMonitor : public Object
{
public:

  /// \brief Structure that represents the measured metrics of an individual packet flow
  struct FlowStats
  {
    /// Contains the absolute time when the first packet in the flow
    /// was transmitted, i.e. the time when the flow transmission
    /// starts
    Time     timeFirstTxPacket;

    /// Contains the absolute time when the first packet in the flow
    /// was received by an end node, i.e. the time when the flow
    /// reception starts
    Time     timeFirstRxPacket;

    /// Contains the absolute time when the last packet in the flow
    /// was transmitted, i.e. the time when the flow transmission
    /// ends
    Time     timeLastTxPacket;

    /// Contains the absolute time when the last packet in the flow
    /// was received, i.e. the time when the flow reception ends
    Time     timeLastRxPacket;

    /// Contains the sum of all end-to-end delays for all received
    /// packets of the flow.
    Time     delaySum; // delayCount == rxPackets

    /// Contains the sum of all end-to-end delay jitter (delay
    /// variation) values for all received packets of the flow.  Here
    /// we define _jitter_ of a packet as the delay variation
    /// relatively to the last packet of the stream,
    /// i.e. \f$Jitter\left\{P_N\right\} = \left|Delay\left\{P_N\right\} - Delay\left\{P_{N-1}\right\}\right|\f$.
    /// This definition is in accordance with the Type-P-One-way-ipdv
    /// as defined in IETF \RFC{3393}.
    Time     jitterSum; // jitterCount == rxPackets - 1

    /// Contains the last measured delay of a packet
    /// It is stored to measure the packet's Jitter
    Time     lastDelay;

    /// Total number of transmitted bytes for the flow
    uint64_t txBytes;
    /// Total number of received bytes for the flow
    uint64_t rxBytes;
    /// Total number of transmitted packets for the flow
    uint32_t txPackets;
    /// Total number of received packets for the flow
    uint32_t rxPackets;

    /// Total number of packets that are assumed to be lost,
    /// i.e. those that were transmitted but have not been reportedly
    /// received or forwarded for a long time.  By default, packets
    /// missing for a period of over 10 seconds are assumed to be
    /// lost, although this value can be easily configured in runtime
    uint32_t lostPackets;

    /// Contains the number of times a packet has been reportedly
    /// forwarded, summed for all received packets in the flow
    uint32_t timesForwarded;

    /// Histogram of the packet delays
    Histogram delayHistogram;
    /// Histogram of the packet jitters
    Histogram jitterHistogram;
    /// Histogram of the packet sizes
    Histogram packetSizeHistogram;

    /// This attribute also tracks the number of lost packets and
    /// bytes, but discriminates the losses by a _reason code_.  This
    /// reason code is usually an enumeration defined by the concrete
    /// FlowProbe class, and for each reason code there may be a
    /// vector entry indexed by that code and whose value is the
    /// number of packets or bytes lost due to this reason.  For
    /// instance, in the Ipv4FlowProbe case the following reasons are
    /// currently defined: DROP_NO_ROUTE (no IPv4 route found for a
    /// packet), DROP_TTL_EXPIRE (a packet was dropped due to an IPv4
    /// TTL field decremented and reaching zero), and
    /// DROP_BAD_CHECKSUM (a packet had bad IPv4 header checksum and
    /// had to be dropped).
    std::vector<uint32_t> packetsDropped; // packetsDropped[reasonCode] => number of dropped packets

    /// This attribute also tracks the number of lost bytes.  See also
    /// comment in attribute packetsDropped.
    std::vector<uint64_t> bytesDropped; // bytesDropped[reasonCode] => number of dropped bytes
    Histogram flowInterruptionsHistogram; //!< histogram of durations of flow interruptions
  };

  // --- basic methods ---
  /**
   * \brief Get the type ID.
   * \return the object TypeId
   */
  static TypeId GetTypeId ();
  TypeId GetInstanceTypeId () const;
  FlowMonitor ();

  /// Add a FlowClassifier to be used by the flow monitor.
  /// \param classifier the FlowClassifier
  void AddFlowClassifier (Ptr<FlowClassifier> classifier);

  /// Set the time, counting from the current time, from which to start monitoring flows.
  /// \param time delta time to start
  void Start (const Time &time);
  /// Set the time, counting from the current time, from which to stop monitoring flows.
  /// \param time delta time to stop
  void Stop (const Time &time);
  /// Begin monitoring flows *right now*
  void StartRightNow ();
  /// End monitoring flows *right now*
  void StopRightNow ();

  // --- methods to be used by the FlowMonitorProbe's only ---
  /// Register a new FlowProbe that will begin monitoring and report
  /// events to this monitor.  This method is normally only used by
  /// FlowProbe implementations.
  /// \param probe the probe to add
  void AddProbe (Ptr<FlowProbe> probe);

  /// FlowProbe implementations are supposed to call this method to
  /// report that a new packet was transmitted (but keep in mind the
  /// distinction between a new packet entering the system and a
  /// packet that is already known and is only being forwarded).
  /// \param probe the reporting probe
  /// \param flowId flow identification
  /// \param packetId Packet ID
  /// \param packetSize packet size
  void ReportFirstTx (Ptr<FlowProbe> probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize);
  /// FlowProbe implementations are supposed to call this method to
  /// report that a known packet is being forwarded.
  /// \param probe the reporting probe
  /// \param flowId flow identification
  /// \param packetId Packet ID
  /// \param packetSize packet size
  void ReportForwarding (Ptr<FlowProbe> probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize);
  /// FlowProbe implementations are supposed to call this method to
  /// report that a known packet is being received.
  /// \param probe the reporting probe
  /// \param flowId flow identification
  /// \param packetId Packet ID
  /// \param packetSize packet size
  void ReportLastRx (Ptr<FlowProbe> probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize);
  /// FlowProbe implementations are supposed to call this method to
  /// report that a known packet is being dropped due to some reason.
  /// \param probe the reporting probe
  /// \param flowId flow identification
  /// \param packetId Packet ID
  /// \param packetSize packet size
  /// \param reasonCode drop reason code
  void ReportDrop (Ptr<FlowProbe> probe, FlowId flowId, FlowPacketId packetId,
                   uint32_t packetSize, uint32_t reasonCode);

  /// Check right now for packets that appear to be lost
  void CheckForLostPackets ();

  /// Check right now for packets that appear to be lost, considering
  /// packets as lost if not seen in the network for a time larger
  /// than maxDelay
  /// \param maxDelay the max delay for a packet
  void CheckForLostPackets (Time maxDelay);

  // --- methods to get the results ---
  /// Retrieve all collected the flow statistics.  Note, if the
  /// FlowMonitor has not stopped monitoring yet, you should call
  /// CheckForLostPackets() to make sure all possibly lost packets are
  /// accounted for.
  /// \returns the flows statistics
  std::map<FlowId, FlowStats> GetFlowStats () const;

  /// Get a list of all FlowProbe's associated with this FlowMonitor
  /// \returns a list of all the probes
  std::vector< Ptr<FlowProbe> > GetAllProbes () const;

  /// Serializes the results to an std::ostream in XML format
  /// \param os the output stream
  /// \param indent number of spaces to use as base indentation level
  /// \param enableHistograms if true, include also the histograms in the output
  /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output
  void SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes);
  /// Same as SerializeToXmlStream, but returns the output as a std::string
  /// \param indent number of spaces to use as base indentation level
  /// \param enableHistograms if true, include also the histograms in the output
  /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output
  /// \return the XML output as string
  std::string SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes);
  /// Same as SerializeToXmlStream, but writes to a file instead
  /// \param fileName name or path of the output file that will be created
  /// \param enableHistograms if true, include also the histograms in the output
  /// \param enableProbes if true, include also the per-probe/flow pair statistics in the output
  void SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes);

protected:

  virtual void NotifyConstructionCompleted ();
  virtual void DoDispose (void);

private:

  /// Structure to represent a single tracked packet data
  struct TrackedPacket
  {
    Time firstSeenTime; //!< absolute time when the packet was first seen by a probe
    Time lastSeenTime; //!< absolute time when the packet was last seen by a probe
    uint32_t timesForwarded; //!< number of times the packet was reportedly forwarded
  };

  /// FlowId --> FlowStats
  std::map<FlowId, FlowStats> m_flowStats;

  /// (FlowId,PacketId) --> TrackedPacket
  typedef std::map< std::pair<FlowId, FlowPacketId>, TrackedPacket> TrackedPacketMap;
  TrackedPacketMap m_trackedPackets; //!< Tracked packets
  Time m_maxPerHopDelay; //!< Minimum per-hop delay
  std::vector< Ptr<FlowProbe> > m_flowProbes; //!< all the FlowProbes

  // note: this is needed only for serialization
  std::list<Ptr<FlowClassifier> > m_classifiers; //!< the FlowClassifiers

  EventId m_startEvent;     //!< Start event
  EventId m_stopEvent;      //!< Stop event
  bool m_enabled;           //!< FlowMon is enabled
  double m_delayBinWidth;   //!< Delay bin width (for histograms)
  double m_jitterBinWidth;  //!< Jitter bin width (for histograms)
  double m_packetSizeBinWidth;  //!< packet size bin width (for histograms)
  double m_flowInterruptionsBinWidth; //!< Flow interruptions bin width (for histograms)
  Time m_flowInterruptionsMinTime; //!< Flow interruptions minimum time

  /// Get the stats for a given flow
  /// \param flowId the Flow identification
  /// \returns the stats of the flow
  FlowStats& GetStatsForFlow (FlowId flowId);

  /// Periodic function to check for lost packets and prune statistics
  void PeriodicCheckForLostPackets ();
};

} // namespace ns3

#endif /* FLOW_MONITOR_H */


text:
package org.springframework.web.client;

import org.springframework.http.client.SimpleClientHttpRequestFactory;

/**
 * @author Roy Clarkson
 */
public class RestTemplateIntegrationSimpleClientTests extends AbstractRestTemplateIntegrationTests {

	@Override
	protected RestTemplate getRestTemplate() {
		return new RestTemplate(new SimpleClientHttpRequestFactory());
	}

}


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

<title>clir.model</title>
<meta name="date" content="2015-02-15">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

clir.model

Classes

IndexedDocLSA

LanguageFolder

PaperHit

QueryTerms

ResultsList


text:
package block

type emptyBlock struct {
	meta Metadata
}

// NewEmptyBlock creates an empty block with the given metadata.
func NewEmptyBlock(meta Metadata) Block {
	return &emptyBlock{meta: meta}
}

func (b *emptyBlock) Close() error { return nil }

func (b *emptyBlock) Info() BlockInfo {
	return NewBlockInfo(BlockEmpty)
}

func (b *emptyBlock) Meta() Metadata {
	return b.meta
}

func (b *emptyBlock) StepIter() (StepIter, error) {
	return &emptyStepIter{steps: b.meta.Bounds.Steps()}, nil
}

type emptyStepIter struct {
	steps int
}

func (it *emptyStepIter) Close()                   {}
func (it *emptyStepIter) Err() error               { return nil }
func (it *emptyStepIter) StepCount() int           { return it.steps }
func (it *emptyStepIter) SeriesMeta() []SeriesMeta { return []SeriesMeta{} }
func (it *emptyStepIter) Next() bool               { return false }
func (it *emptyStepIter) Current() Step            { return nil }

func (b *emptyBlock) SeriesIter() (SeriesIter, error) {
	return &emptySeriesIter{}, nil
}

type emptySeriesIter struct{}

func (it *emptySeriesIter) Close()                        {}
func (it *emptySeriesIter) Err() error                    { return nil }
func (it *emptySeriesIter) SeriesCount() int              { return 0 }
func (it *emptySeriesIter) SeriesMeta() []SeriesMeta      { return []SeriesMeta{} }
func (it *emptySeriesIter) Next() bool                    { return false }
func (it *emptySeriesIter) Current() UnconsolidatedSeries { return UnconsolidatedSeries{} }

func (b *emptyBlock) MultiSeriesIter(
	concurrency int,
) ([]SeriesIterBatch, error) {
	batch := make([]SeriesIterBatch, concurrency)
	for i := range batch {
		batch[i] = SeriesIterBatch{
			Size: 1,
			Iter: &emptySeriesIter{},
		}
	}

	return batch, nil
}


text:
@interface FileCache : NSObject
@property (nonatomic) NSUInteger maxSize;
@property (copy, nonatomic) NSString *domain;

+ (NSURL *)cacheDirURL;
- (NSURL *)domainCacheDirURL;
- (BOOL)saveData:(NSData *)data forKey:(NSString *)key;
- (NSData *)dataForKey:(NSString *)key;
@end


text:
package org.apache.isis.core.metamodel.facets.value;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;

import org.jmock.Expectations;
import org.junit.Before;
import org.junit.Test;

import org.apache.isis.applib.profiles.Localization;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facetapi.FacetHolderImpl;
import org.apache.isis.core.metamodel.facets.object.parseable.TextEntryParseException;
import org.apache.isis.core.metamodel.facets.value.dateutil.JavaUtilDateValueSemanticsProvider;

public class JavaUtilDateValueSemanticsProviderTest extends ValueSemanticsProviderAbstractTestCase {

    private java.util.Date date;
    private FacetHolder holder;

    @Before
    public void setUpObjects() throws Exception {
        context.checking(new Expectations() {
            {
                allowing(mockConfiguration).getString("isis.value.format.datetime");
                will(returnValue(null));
            }
        });

        TestClock.initialize();
        date = new java.util.Date(0);

        holder = new FacetHolderImpl();
        setValue(new JavaUtilDateValueSemanticsProvider(holder, mockConfiguration, mockContext) {
            @Override
            protected String defaultFormat() {
                return "iso";
            }
        });
    }

    @Test
    public void testInvalidParse() throws Exception {
        try {
            getValue().parseTextEntry(null, "invalid entry", null);
            fail();
        } catch (final TextEntryParseException expected) {
        }
    }

    /**
     * Something rather bizarre here, that the epoch formats as 01:00 rather
     * than 00:00. It's obviously because of some sort of timezone issue, but I
     * don't know where that dependency is coming from.
     */
    @Test
    public void testTitleOf() {
        final String EXPECTED = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new java.util.Date(0));
        assertEquals(EXPECTED, getValue().displayTitleOf(date, (Localization) null));
    }

    @Test
    public void testParse() throws Exception {
        final Object newValue = getValue().parseTextEntry(null, "1980-01-01 10:40", null);

        final Calendar calendar = Calendar.getInstance();
        calendar.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
        calendar.set(1980, 0, 1, 10, 40, 0);
        calendar.set(Calendar.MILLISECOND, 0);

        assertEquals(calendar.getTime(), newValue);
    }

}


text:
namespace Core.Commands.AppUserCommands
{
    public class UpdateAppUser : AddAppUser
    {

    }
}


text:
from pywrap.defaultconfig import Config
from nose.tools import assert_equal, assert_raises

def test_cpp_operator():
    config = Config()
    assert_equal(config.cpp_to_py_operator("operator()"), "__call__")
    assert_raises(NotImplementedError, config.cpp_to_py_operator, "operator<<")


text:
#include <aws/ec2/model/RunScheduledInstancesRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::EC2::Model;
using namespace Aws::Utils;

RunScheduledInstancesRequest::RunScheduledInstancesRequest() :
    m_dryRun(false),
    m_dryRunHasBeenSet(false),
    m_clientTokenHasBeenSet(false),
    m_instanceCount(0),
    m_instanceCountHasBeenSet(false),
    m_scheduledInstanceIdHasBeenSet(false),
    m_launchSpecificationHasBeenSet(false)
{
}

Aws::String RunScheduledInstancesRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=RunScheduledInstances&";
  if(m_dryRunHasBeenSet)
  {
    ss << "DryRun=" << m_dryRun << "&";
  }

  if(m_clientTokenHasBeenSet)
  {
    ss << "ClientToken=" << StringUtils::URLEncode(m_clientToken.c_str()) << "&";
  }

  if(m_instanceCountHasBeenSet)
  {
    ss << "InstanceCount=" << m_instanceCount << "&";
  }

  if(m_scheduledInstanceIdHasBeenSet)
  {
    ss << "ScheduledInstanceId=" << StringUtils::URLEncode(m_scheduledInstanceId.c_str()) << "&";
  }

  if(m_launchSpecificationHasBeenSet)
  {
    m_launchSpecification.OutputToStream(ss, "LaunchSpecification");
  }

  ss << "Version=2015-10-01";
  return ss.str();
}


text:
#include "proc_open.h"

#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>

#ifdef WIN32
# include <io.h>
# include <fcntl.h>
#else
# include <sys/wait.h>
# include <unistd.h>
#endif

#ifdef WIN32
/* {{{ win32 stuff */
# define SHELLENV "ComSpec"
# define SECURITY_DC , SECURITY_ATTRIBUTES *security
# define SECURITY_CC , security
# define pipe(pair) (CreatePipe(&pair[0], &pair[1], security, 2048L) ? 0 : -1)
static inline HANDLE dup_handle(HANDLE src, BOOL inherit, BOOL closeorig)
{
	HANDLE copy, self = GetCurrentProcess();

	if (!DuplicateHandle(self, src, self, &copy, 0, inherit, DUPLICATE_SAME_ACCESS |
				(closeorig ? DUPLICATE_CLOSE_SOURCE : 0)))
		return NULL;
	return copy;
}
# define close_descriptor(fd) CloseHandle(fd)
static void pipe_close_parent(pipe_t *p) {
	/* don't let the child inherit the parent side of the pipe */
	p->parent = dup_handle(p->parent, FALSE, TRUE);
}
static void pipe_close_child(pipe_t *p) {
	close_descriptor(p->child);
	p->fd = _open_osfhandle((long)p->parent,
			(p->fd == 0 ? O_RDONLY : O_WRONLY)|O_BINARY);
}
/* }}} */
#else /* WIN32 */
/* {{{ unix way */
# define SHELLENV "SHELL"
# define SECURITY_DC
# define SECURITY_CC
# define close_descriptor(fd) close(fd)
static void pipe_close_parent(pipe_t *p) {
	/* don't close stdin */
	close_descriptor(p->parent);
	if (dup2(p->child, p->fd) != p->fd) {
		perror("pipe_child dup2");
	} else {
		close_descriptor(p->child);
		p->child = p->fd;
	}
}
static void pipe_close_child(pipe_t *p) {
	close_descriptor(p->child);
	p->fd = p->parent;
}
/* }}} */
#endif /* WIN32 */

/* {{{ pipe_close */
static void pipe_close(pipe_t *p) {
	close_descriptor(p->parent);
	close_descriptor(p->child);
#ifdef WIN32
	close(p->fd);
#endif
}
/* }}} */
/* {{{ pipe_open */
static int pipe_open(pipe_t *p, int fd SECURITY_DC) {
	descriptor_t newpipe[2];

	if (0 != pipe(newpipe)) {
		fprintf(stderr, "can't open pipe");
		return -1;
	}
	if (0 == fd) {
		p->parent = newpipe[1]; /* write */
		p->child  = newpipe[0]; /* read */
	} else {
		p->parent = newpipe[0]; /* read */
		p->child  = newpipe[1]; /* write */
	}
	p->fd = fd;

	return 0;
}
/* }}} */

/* {{{ proc_open_pipes */
static int proc_open_pipes(proc_handler_t *proc SECURITY_DC) {
	if (pipe_open(&(proc->in), 0 SECURITY_CC) != 0) {
		return -1;
	}
	if (pipe_open(&(proc->out), 1 SECURITY_CC) != 0) {
		return -1;
	}
	if (pipe_open(&(proc->err), 2 SECURITY_CC) != 0) {
		return -1;
	}
	return 0;
}
/* }}} */
/* {{{ proc_close_pipes */
static void proc_close_pipes(proc_handler_t *proc) {
	pipe_close(&proc->in);
	pipe_close(&proc->out);
	pipe_close(&proc->err);
}
/* }}} */
/* {{{ proc_close_parents */
static void proc_close_parents(proc_handler_t *proc) {
	pipe_close_parent(&proc->in);
	pipe_close_parent(&proc->out);
	pipe_close_parent(&proc->err);
}
/* }}} */
/* {{{ proc_close_childs */
static void proc_close_childs(proc_handler_t *proc) {
	pipe_close_child(&proc->in);
	pipe_close_child(&proc->out);
	pipe_close_child(&proc->err);
}
/* }}} */

#ifdef WIN32
/* {{{ proc_close */
int proc_close(proc_handler_t *proc) {
	proc_pid_t child = proc->child;
	DWORD wstatus;

	proc_close_pipes(proc);
	WaitForSingleObject(child, INFINITE);
	GetExitCodeProcess(child, &wstatus);
	CloseHandle(child);

	return wstatus;
}
/* }}} */
/* {{{ proc_open */
int proc_open(proc_handler_t *proc, const char *command) {
	PROCESS_INFORMATION pi;
	STARTUPINFO si;
	BOOL procok;
	SECURITY_ATTRIBUTES security;
	const char *shell = NULL;
	const char *windir = NULL;
	buffer *cmdline;

	if (NULL == (shell = getenv(SHELLENV)) &&
			NULL == (windir = getenv("SystemRoot")) &&
			NULL == (windir = getenv("windir"))) {
		fprintf(stderr, "One of %s,%%SystemRoot,%%windir is required", SHELLENV);
		return -1;
	}

	/* we use this to allow the child to inherit handles */
	memset(&security, 0, sizeof(security));
	security.nLength = sizeof(security);
	security.bInheritHandle = TRUE;
	security.lpSecurityDescriptor = NULL;

	if (proc_open_pipes(proc, &security) != 0) {
		return -1;
	}
	proc_close_parents(proc);

	memset(&si, 0, sizeof(si));
	si.cb = sizeof(si);
	si.dwFlags = STARTF_USESTDHANDLES;
	si.hStdInput = proc->in.child;
	si.hStdOutput = proc->out.child;
	si.hStdError = proc->err.child;

	memset(&pi, 0, sizeof(pi));

	cmdline = buffer_init();
	if (shell) {
		buffer_append_string(cmdline, shell);
	} else {
		buffer_append_string(cmdline, windir);
		buffer_append_string_len(cmdline, CONST_STR_LEN("\\system32\\cmd.exe"));
	}
	buffer_append_string_len(cmdline, CONST_STR_LEN(" /c "));
	buffer_append_string(cmdline, command);
	procok = CreateProcess(NULL, cmdline->ptr, &security, &security, TRUE,
			NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);

	if (FALSE == procok) {
		fprintf(stderr, "failed to CreateProcess: %s", cmdline->ptr);
		buffer_free(cmdline);
		return -1;
	}
	buffer_free(cmdline);

	proc->child = pi.hProcess;
	CloseHandle(pi.hThread);

	proc_close_childs(proc);

	return 0;
}
/* }}} */
#else /* WIN32 */
/* {{{ proc_close */
int proc_close(proc_handler_t *proc) {
	pid_t child = proc->child;
	int wstatus;
	pid_t wait_pid;

	proc_close_pipes(proc);

	do {
		wait_pid = waitpid(child, &wstatus, 0);
	} while (wait_pid == -1 && errno == EINTR);

	if (wait_pid == -1) {
		return -1;
	} else {
		if (WIFEXITED(wstatus))
			wstatus = WEXITSTATUS(wstatus);
	}

	return wstatus;
}
/* }}} */
/* {{{ proc_open */
int proc_open(proc_handler_t *proc, const char *command) {
	pid_t child;
	const char *shell;

	if (NULL == (shell = getenv(SHELLENV))) {
		shell = "/bin/sh";
	}

	if (proc_open_pipes(proc) != 0) {
		return -1;
	}

	/* the unix way */

	child = fork();

	if (child == 0) {
		/* this is the child process */

		/* close those descriptors that we just opened for the parent stuff,
		 * dup new descriptors into required descriptors and close the original
		 * cruft
		 */
		proc_close_parents(proc);

		execl(shell, shell, "-c", command, (char *)NULL);
		fprintf(stderr, "failed to execute shell: %s -c %s: %s\n", shell, command, strerror(errno));
		_exit(127);

	} else if (child < 0) {
		fprintf(stderr, "failed to forking");
		proc_close(proc);
		return -1;

	} else {
		proc->child = child;
		proc_close_childs(proc);
		return 0;
	}
}
/* }}} */
#endif /* WIN32 */

/* {{{ proc_read_fd_to_buffer */
static void proc_read_fd_to_buffer(int fd, buffer *b) {
	ssize_t s;

	for (;;) {
		buffer_string_prepare_append(b, 1024);
		if ((s = read(fd, (void *)(b->ptr + buffer_string_length(b)), buffer_string_space(b))) <= 0) {
			break;
		}
		buffer_commit(b, s);
	}
}
/* }}} */
/* {{{ proc_open_buffer */
int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err) {
	proc_handler_t proc;

	if (proc_open(&proc, command) != 0) {
		return -1;
	}

	if (in) {
		if (write(proc.in.fd, CONST_BUF_LEN(in)) < 0) {
			perror("error writing pipe");
			return -1;
		}
	}
	pipe_close(&proc.in);

	if (out) {
		proc_read_fd_to_buffer(proc.out.fd, out);
	}
	pipe_close(&proc.out);

	if (err) {
		proc_read_fd_to_buffer(proc.err.fd, err);
	} else {
		buffer *tmp = buffer_init();
		proc_read_fd_to_buffer(proc.err.fd, tmp);
		if (!buffer_string_is_empty(tmp) &&  write(2, CONST_BUF_LEN(tmp)) < 0) {
			perror("error writing pipe");
			buffer_free(tmp);
			return -1;
		}
		buffer_free(tmp);
	}
	pipe_close(&proc.err);

	proc_close(&proc);

	return 0;
}
/* }}} */

/* {{{ test */
#ifdef DEBUG_PROC_OPEN
int main(void) {
	proc_handler_t proc;
	buffer *in = buffer_init(), *out = buffer_init(), *err = buffer_init();
	int wstatus;

#define FREE() do { \
	buffer_free(in); \
	buffer_free(out); \
	buffer_free(err); \
} while (0)

#define RESET() do { \
	buffer_reset(in); \
	buffer_reset(out); \
	buffer_reset(err); \
	wstatus = proc_close(&proc); \
	if (0&&wstatus != 0) { \
		fprintf(stdout, "exitstatus %d\n", wstatus); \
		return __LINE__ - 200; \
	} \
} while (0)

#define ERROR_OUT() do { \
	fprintf(stdout, "failed opening proc\n"); \
	wstatus = proc_close(&proc); \
	fprintf(stdout, "exitstatus %d\n", wstatus); \
	FREE(); \
	return __LINE__ - 300; \
} while (0)

#ifdef WIN32
#define CMD_CAT "pause"
#else
#define CMD_CAT "cat"
#endif

	do {
		fprintf(stdout, "test: echo 123 without read\n");
		if (proc_open(&proc, "echo 321") != 0) {
			ERROR_OUT();
		}
		close_descriptor(proc.in.parent);
		close_descriptor(proc.out.parent);
		close_descriptor(proc.err.parent);
		RESET();

		fprintf(stdout, "test: echo 321 with read\n"); fflush(stdout);
		if (proc_open_buffer("echo 321", NULL, out, err) != 0) {
			ERROR_OUT();
		}
		fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
		RESET();

		fprintf(stdout, "test: echo 123 | " CMD_CAT "\n"); fflush(stdout);
		buffer_copy_string_len(in, CONST_STR_LEN("123\n"));
		if (proc_open_buffer(CMD_CAT, in, out, err) != 0) {
			ERROR_OUT();
		}
		fprintf(stdout, "result: ->%s<-\n\n", out->ptr); fflush(stdout);
		RESET();
	} while (0);

#undef RESET
#undef ERROR_OUT

	fprintf(stdout, "ok\n");

	FREE();
	return 0;
}
#endif /* DEBUG_PROC_OPEN */
/* }}} */


text:
package me.termax.practice.lab01;

class Person {
    protected String name;

    public Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


text:
YUI.add('parallel', function (Y, NAME) {

/**
* A concurrent parallel processor to help in running several async functions.
* @module parallel
* @main parallel
*/

/**
A concurrent parallel processor to help in running several async functions.

    var stack = new Y.Parallel();

    for (var i = 0; i < 15; i++) {
        Y.io('./api/json/' + i, {
            on: {
                success: stack.add(function() {
                    Y.log('Done!');
                })
            }
        });
    }

    stack.done(function() {
        Y.log('All IO requests complete!');
    });

@class Parallel
@param {Object} o A config object
@param {Object} [o.context=Y] The execution context of the callback to done

*/

Y.Parallel = function(o) {
    this.config = o || {};
    this.results = [];
    this.context = this.config.context || Y;
    this.total = 0;
    this.finished = 0;
};

Y.Parallel.prototype = {
    /**
    * An Array of results from all the callbacks in the stack
    * @property results
    * @type Array
    */

    results: null,
    /**
    * The total items in the stack
    * @property total
    * @type Number
    */
    total: null,
    /**
    * The number of stacked callbacks executed
    * @property finished
    * @type Number
    */
    finished: null,
    /**
    * Add a callback to the stack
    * @method add
    * @param {Function} fn The function callback we are waiting for
    */
    add: function (fn) {
        var self = this,
            index = self.total;

        self.total += 1;

        return function () {
            self.finished++;
            self.results[index] = (fn && fn.apply(self.context, arguments)) ||
                (arguments.length === 1 ? arguments[0] : Y.Array(arguments));

            self.test();
        };
    },
    /**
    * Test to see if all registered items in the stack have completed, if so call the callback to `done`
    * @method test
    */
    test: function () {
        var self = this;
        if (self.finished >= self.total && self.callback) {
            self.callback.call(self.context, self.results, self.data);
        }
    },
    /**
    * The method to call when all the items in the stack are complete.
    * @method done
    * @param {Function} callback The callback to execute on complete
    * @param {Mixed} callback.results The results of all the callbacks in the stack
    * @param {Mixed} [callback.data] The data given to the `done` method
    * @param {Mixed} data Mixed data to pass to the success callback
    */
    done: function (callback, data) {
        this.callback = callback;
        this.data = data;
        this.test();
    }
};

}, '3.12.0', {"requires": ["yui-base"]});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Arch.CFX.AppInternals.PayLoad;
using Arch.CFX.AppInternals.Components;

namespace Arch.CFX.AppInternals.Service.Components
{
    public interface IService
    {
        IComponent GetComponent(string id);
    }
}


text:
[![Build Status](http://jenkins.bodul.fr/buildStatus/icon?job=GDG-Lille/twall-front/master)](http://jenkins.bodul.fr/job/GDG-Lille/job/twall-front/job/master/)

[![Quality Gate](https://sonarcloud.io/api/badges/gate?key=twall)](https://sonarcloud.io/dashboard/index/twall)
[![Lines of Codes](https://sonarcloud.io/api/badges/measure?key=twall&metric=ncloc&blinking=true)](https://sonarcloud.io/dashboard/index/twall)
[![Blocker Violations](https://sonarcloud.io/api/badges/measure?key=twall&metric=blocker_violations&blinking=true)](https://sonarcloud.io/dashboard/index/twall)
[![Critical Violations](https://sonarcloud.io/api/badges/measure?key=twall&metric=critical_violations&blinking=true)](https://sonarcloud.io/dashboard/index/twall)
[![Bugs](https://sonarcloud.io/api/badges/measure?key=twall&metric=bugs&blinking=true)](https://sonarcloud.io/dashboard/index/twall)
[![Code Smells](https://sonarcloud.io/api/badges/measure?key=twall&metric=code_smells&blinking=true)](https://sonarcloud.io/dashboard/index/twall)

## Made with ...
* [NPM](https://www.npmjs.com/)
* [Angular](https://angular.io/) with [Angular CLI](https://cli.angular.io/)
* [MomentJS](https://momentjs.com/)

## How to build for production ?

Run `ng build -prod` to build the project. The build artifacts will be stored in the `dist/` directory.

## How to run in local ?

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## How to display tweets ?

Simple, there is only one page : http://your-uri.org/tweets

### Option

| Name     | Description                              | Default              | Example                                  |
| -------- | ---------------------------------------- | -------------------- | ---------------------------------------- |
| refresh  | The refresh frequency (in milliseconds)  | 5000, cannot be less | http://your-uri.org/tweets;refresh=10000 |

## Contact via [Issues](https://github.com/GDG-Lille/twall-front/issues)
Helpful for **question**, **bug** and **contribution request**.


text:
// Type definitions for Platform 1.3
// Project: https://github.com/bestiejs/platform.js
// Definitions by: Jake Hickman <https://github.com/JakeH>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export as namespace platform;

/**
 * The platform object.
 */
interface Platform {
    /**
     * The platform description.
     */
    description?: string | undefined;
    /**
     * The name of the browser's layout engine.
     *
     * The list of common layout engines include:
     * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
     */
    layout?: string | undefined;
    /**
     * The name of the product's manufacturer.
     *
     * The list of manufacturers include:
     * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
     * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
     * "Nokia", "Samsung" and "Sony"
     */
    manufacturer?: string | undefined;
    /**
     * The name of the browser/environment.
     *
     * The list of common browser names include:
     * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
     * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
     * "Opera Mini" and "Opera"
     *
     * Mobile versions of some browsers have "Mobile" appended to their name:
     * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
     */
    name?: string | undefined;
    /**
     * The alpha/beta release indicator.
     */
    prerelease?: string | undefined;
    /**
     * The name of the product hosting the browser.
     *
     * The list of common products include:
     *
     * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
     * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
     */
    product?: string | undefined;
    /**
     * The browser's user agent string.
     */
    ua?: string | undefined;
    /**
     * The version of the OS.
     */
    version?: string | undefined;
    /**
     * The name of the operating system.
     */
    os?: OperatingSystem | undefined;
    /**
     * Creates a new platform object.
     * @param [ua=navigator.userAgent] The user agent string or
     *  context object.
     */
    parse(ua?: object | string): Platform;
    /**
     * Returns `platform.description` when the platform object is coerced to a string.
     */
    toString(): string;
}

interface OperatingSystem {
    /**
     * The CPU architecture the OS is built for.
     */
    architecture?: number | undefined;
    /**
     * The family of the OS.
     *
     * Common values include:
     * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
     * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
     * "SuSE", "Android", "iOS" and "Windows Phone"
     */
    family?: string | undefined;
    /**
     * The version of the OS.
     */
    version?: string | undefined;
    /**
     * Returns the OS string.
     */
    toString(): string;
}

declare const platform: Platform;

export = platform;


text:
var http = require('http');
var url = require('url');
var api_template = {
  protocol: 'http:',
  hostname: 'ip.taobao.com',
  query: {'ip': '127.0.0.1'},
  pathname: '/service/getIpInfo.php'
};

function queryIpv4Str (str, cb) {
  api_template.query = {'ip': str};
  http.get(url.format(api_template), function(res) {
    var body = '';
    res.on('data', function(chunk) {
        body += chunk;
    }).on('end', function() {
      var result = JSON.parse(body || '{}');
      if (!!cb && typeof cb === 'function') {
        process.nextTick(cb.bind(undefined, result));
      }
    });
  }).on('error', function(e) {
    throw e;
  });
}

module.exports = {
  // as for now, taobao only supports ipv4
  'queryIpv4Str': queryIpv4Str,
  // shortcut
  'query': queryIpv4Str
};


text:
<?php

namespace Oro\Bundle\DataGridBundle\Extension\Formatter\Property;

use Oro\Bundle\DataGridBundle\Datasource\ResultRecordInterface;
use Symfony\Component\Routing\Exception\InvalidParameterException;
use Symfony\Component\Routing\RouterInterface;
use Twig\Environment;

/**
 * Datagrid property formatter that renders a URL as an <a> HTML tag.
 */
class LinkProperty extends UrlProperty
{
    const TEMPLATE = 'OroDataGridBundle:Extension:Formatter/Property/linkProperty.html.twig';

    /**
     * @var Environment
     */
    protected $twig;

    /**
     * @param RouterInterface $router
     * @param Environment     $twig
     */
    public function __construct(RouterInterface $router, Environment $twig)
    {
        $this->router = $router;
        $this->twig = $twig;
    }

    /**
     * {@inheritdoc}
     */
    public function getRawValue(ResultRecordInterface $record)
    {
        $label = null;
        $link = null;

        try {
            $label = $record->getValue($this->getOr(self::DATA_NAME_KEY, $this->get(self::NAME_KEY)));
        } catch (\LogicException $e) {
        }

        try {
            $link = parent::getRawValue($record);
        } catch (InvalidParameterException $e) {
        }

        return $this->twig
            ->loadTemplate(self::TEMPLATE)
            ->render(
                [
                    'url'   => $link,
                    'label' => $label
                ]
            );
    }
}


text:
package guitests;

import org.junit.Test;

import seedu.task.commons.core.Messages;
import seedu.task.logic.commands.FindCommand;
import seedu.task.testutil.TestTask;
import seedu.task.testutil.TypicalTestTasks;

import static org.junit.Assert.assertTrue;
import static seedu.task.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

public class FindCommandTest extends TaskBookGuiTest {

    //@@author A0138301U
    @Test
    public void find_nonEmptyList() {
        assertFindResult("find life"); //no results
        assertFindResult("find time", TypicalTestTasks.study, TypicalTestTasks.play); //multiple results

        //find after deleting one result
        commandBox.runCommand("delete 1");
        assertFindResult("find time", TypicalTestTasks.play);
    }
    //@@author

    @Test
    public void find_emptyList(){
        commandBox.runCommand("clear");
        assertFindResult("find work"); //no results
    }

    @Test
    public void find_invalidCommand_fail() {
        commandBox.runCommand("findfood");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    @Test
    public void find_Priority() {
        assertFindResult("find #medium");
        assertFindResult("find #low", TypicalTestTasks.play);
        assertFindResult("find #high", TypicalTestTasks.study, TypicalTestTasks.coding);
    }

    @Test
    public void find_Status() {
        assertFindResult("find #done");
        assertFindResult("find #expired");
        assertFindResult("find #ignore");
        assertFindResult("find #active", TypicalTestTasks.study, TypicalTestTasks.play, TypicalTestTasks.coding);
        commandBox.runCommand("find #");
        assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE));
    }

    @Test
    public void find_Venue() {
        commandBox.runCommand("find @");
        assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE));
        assertFindResult("find @Playground", TypicalTestTasks.play);
    }

    private void assertFindResult(String command, TestTask... expectedHits ) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertResultMessage(expectedHits.length + " tasks listed!");
        assertTrue(taskListPanel.isListMatching(expectedHits));
    }
}


text:
package com.npatta01.blackjack;

import com.npatta01.blackjack.card.Deck;
import com.npatta01.blackjack.io.IDisplay;
import com.npatta01.blackjack.player.Dealer;
import com.npatta01.blackjack.player.GameState;
import com.npatta01.blackjack.player.HumanPlayer;
import com.npatta01.blackjack.player.PlayerMoves;

/**
 * A Blackjack game
 */
public class BlackJack {

    private final String welcomeMessage="Welcome to Blackjack";
    private final String rules="Try to get as close to 21\n You can hit and stand\n Minimum bet is 1\n";

    //player and dealer
    private HumanPlayer player;
    private Dealer dealer;

    //current round
    private int round;
    //deck
    private Deck deck;

    //display for output
    private IDisplay display;

    //current game state
    private GameState gamestate;
    //starting coins for users
    private final int startingAmount = 100;

    /**
     * Construtor
     * @param outputer
     * @param player
     * @param dealer
     * @param d
     */
    public BlackJack(IDisplay outputer, HumanPlayer player, Dealer dealer, Deck d){

        this.display =outputer;
        this.player=player;
        this.dealer=dealer;
        this.deck=d;
        round=0;
    }

    /**
     * Start the game
     *  Show the rules and sets user's balance
     */
    public void startGame(){
        display.showGameMessage(welcomeMessage);
        display.showGameRules(rules);

        player.setMoney(startingAmount);
        dealer.setMoney(startingAmount);
        gamestate=GameState.ROUND_STARTED;

    }

    /**
     * Game is over when the dealer or player is out of money
     * @return
     */
    public boolean gameOver(){
        return gamestate==GameState.DEALER_WON_GAME || gamestate==GameState.PLAYER_WON_GAME;
    }

    /**
     * A round of blackjack
     */
    public void playRound(){
        round++;
        if(!gameOver()){
            deck.shuffle();//shuffle deck at start of each round
            //empty user's hand
            player.clearHand();
            dealer.clearHand();

            //dispaly info that ha round has started
            gamestate=GameState.ROUND_STARTED;
            display.roundStartingInfo(round, player.getMoney(), dealer.getMoney());

            //ask player to make bet
            int pBet=player.makeBet();
            //ask dealer to make bet
            int dBet=dealer.makeBet();

            //display bets made by both players
            display.displayBets(pBet, dBet);

            //deal two cards altrnatingly cards
            player.addCardToHand(deck.deal());
            dealer.addCardToHand(deck.deal());
            player.addCardToHand(deck.deal());
            dealer.addCardToHand(deck.deal());

            display.displayHand("player", player.getHand());

            //ask player to make move
            while(player.handValue()<=21 && player.makeMove()!= PlayerMoves.STAND  ){
                player.addCardToHand(deck.deal());
                display.displayHand("player", player.getHand());
            }

           //ask dealer to make Move
           while(dealer.handValue()<=21 && dealer.makeMove()!=PlayerMoves.STAND ){
               dealer.addCardToHand(deck.deal());
               display.informOfDealerMove(PlayerMoves.HIT);

           }
            display.informOfDealerMove(PlayerMoves.STAND);

            //dsiplay dealer's hand
            display.displayHand("dealer", dealer.getHand());

            //decide winner
            if (player.handValue()>21) {
                if (dealer.handValue() > 21) {//both lost
                    gamestate=GameState.BOTH_LOST_ROUND;
                } else {//dealer won
                    gamestate=GameState.DEALER_WON_ROUND;
                }
            }else {
                if (player.handValue()>dealer.handValue()) {//player won
                    gamestate=GameState.PLAYER_WON_ROUND;
                }else if (player.handValue()<dealer.handValue() && dealer.handValue()<=21){//dealer won
                    gamestate=GameState.DEALER_WON_ROUND;
                }else{
                    gamestate=GameState.TIE;
                }
            }

            //update winnings
             if (gamestate==GameState.PLAYER_WON_ROUND){

                    display.informRoundWinner("player");
                 player.setMoney(player.getMoney()+pBet+dBet);
             }else if (gamestate==GameState.DEALER_WON_ROUND){
                 dealer.setMoney(dealer.getMoney()+pBet+dBet);
                 display.informRoundWinner("dealer");
             }else {
                 dealer.setMoney(dealer.getMoney()+dBet);
                 player.setMoney(player.getMoney()+pBet);
                 display.informRoundWinner("No One");
             }

            //check if any player is out of money
            if(player.getMoney()<1){
                gamestate=GameState.DEALER_WON_GAME;
                display.informGameEnded("dealer");
            }else if (dealer.getMoney()<1){
                gamestate=GameState.PLAYER_WON_GAME;
                display.informGameEnded("player");
            }

        }

    }

}


text:
namespace Taller.HolaMundo
{
    partial class frmLoginV2
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label2 = new System.Windows.Forms.Label();
            this.txtEMail = new System.Windows.Forms.TextBox();
            this.txtPassword = new System.Windows.Forms.TextBox();
            this.cmdAceptar = new System.Windows.Forms.Button();
            this.cmdCancelar = new System.Windows.Forms.Button();
            this.radEmail = new System.Windows.Forms.RadioButton();
            this.radioButton1 = new System.Windows.Forms.RadioButton();
            this.txtUserName = new System.Windows.Forms.TextBox();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            this.SuspendLayout();
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(23, 65);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(61, 13);
            this.label2.TabIndex = 4;
            this.label2.Text = "Contraseña";
            //
            // txtEMail
            //
            this.txtEMail.Location = new System.Drawing.Point(90, 10);
            this.txtEMail.Name = "txtEMail";
            this.txtEMail.Size = new System.Drawing.Size(194, 20);
            this.txtEMail.TabIndex = 1;
            this.txtEMail.TextChanged += new System.EventHandler(this.txtEMail_TextChanged);
            //
            // txtPassword
            //
            this.txtPassword.Location = new System.Drawing.Point(90, 62);
            this.txtPassword.Name = "txtPassword";
            this.txtPassword.Size = new System.Drawing.Size(194, 20);
            this.txtPassword.TabIndex = 5;
            this.txtPassword.TextChanged += new System.EventHandler(this.txtPassword_TextChanged);
            //
            // cmdAceptar
            //
            this.cmdAceptar.Enabled = false;
            this.cmdAceptar.Location = new System.Drawing.Point(128, 107);
            this.cmdAceptar.Name = "cmdAceptar";
            this.cmdAceptar.Size = new System.Drawing.Size(75, 23);
            this.cmdAceptar.TabIndex = 6;
            this.cmdAceptar.Text = "Aceptar";
            this.cmdAceptar.UseVisualStyleBackColor = true;
            //
            // cmdCancelar
            //
            this.cmdCancelar.Location = new System.Drawing.Point(209, 107);
            this.cmdCancelar.Name = "cmdCancelar";
            this.cmdCancelar.Size = new System.Drawing.Size(75, 23);
            this.cmdCancelar.TabIndex = 7;
            this.cmdCancelar.Text = "Cancelar";
            this.cmdCancelar.UseVisualStyleBackColor = false;
            this.cmdCancelar.Click += new System.EventHandler(this.cmdCancelar_Click);
            //
            // radEmail
            //
            this.radEmail.AutoSize = true;
            this.radEmail.Checked = true;
            this.radEmail.Location = new System.Drawing.Point(12, 13);
            this.radEmail.Name = "radEmail";
            this.radEmail.Size = new System.Drawing.Size(51, 17);
            this.radEmail.TabIndex = 0;
            this.radEmail.TabStop = true;
            this.radEmail.Text = "EMail";
            this.radEmail.UseVisualStyleBackColor = true;
            this.radEmail.CheckedChanged += new System.EventHandler(this.radEmail_CheckedChanged);
            //
            // radioButton1
            //
            this.radioButton1.AutoSize = true;
            this.radioButton1.Location = new System.Drawing.Point(12, 39);
            this.radioButton1.Name = "radioButton1";
            this.radioButton1.Size = new System.Drawing.Size(61, 17);
            this.radioButton1.TabIndex = 2;
            this.radioButton1.Text = "Usuario";
            this.radioButton1.UseVisualStyleBackColor = true;
            //
            // txtUserName
            //
            this.txtUserName.Enabled = false;
            this.txtUserName.Location = new System.Drawing.Point(90, 36);
            this.txtUserName.Name = "txtUserName";
            this.txtUserName.Size = new System.Drawing.Size(194, 20);
            this.txtUserName.TabIndex = 3;
            this.txtUserName.TextChanged += new System.EventHandler(this.txtUserName_TextChanged);
            //
            // checkBox1
            //
            this.checkBox1.AutoSize = true;
            this.checkBox1.Checked = true;
            this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
            this.checkBox1.Location = new System.Drawing.Point(26, 107);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(80, 17);
            this.checkBox1.TabIndex = 8;
            this.checkBox1.Text = "checkBox1";
            this.checkBox1.UseVisualStyleBackColor = true;
            //
            // frmLoginV2
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(297, 140);
            this.ControlBox = false;
            this.Controls.Add(this.checkBox1);
            this.Controls.Add(this.txtUserName);
            this.Controls.Add(this.radioButton1);
            this.Controls.Add(this.radEmail);
            this.Controls.Add(this.cmdCancelar);
            this.Controls.Add(this.cmdAceptar);
            this.Controls.Add(this.txtPassword);
            this.Controls.Add(this.txtEMail);
            this.Controls.Add(this.label2);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Name = "frmLoginV2";
            this.Text = "Inicie Session";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtEMail;
        private System.Windows.Forms.TextBox txtPassword;
        private System.Windows.Forms.Button cmdAceptar;
        private System.Windows.Forms.Button cmdCancelar;
        private System.Windows.Forms.RadioButton radEmail;
        private System.Windows.Forms.RadioButton radioButton1;
        private System.Windows.Forms.TextBox txtUserName;
        private System.Windows.Forms.CheckBox checkBox1;
    }
}