text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

/*
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Email for .NET API reference
when the project is build. Please check https://Docs.nuget.org/consume/nuget-faq for more information.
If you do not wish to use NuGet, you can manually download Aspose.Email for .NET API from http://www.aspose.com/downloads,
install it and then add its reference to this project. For any issues, questions or suggestions
please feel free to contact us using http://www.aspose.com/community/forums/default.aspx
*/

namespace Aspose.Email.Examples.CSharp.Email.Knowledge.Base
{
    public partial class AsposeEmailPop3SampleApp : Form
    {
        public AsposeEmailPop3SampleApp()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // ExStart:AsposeEmailPop3
            // Create a POP3 client
            Aspose.Email.Pop3.Pop3Client client;
            client = new Aspose.Email.Pop3.Pop3Client();

            // Basic settings (required)
            client.Host = "pop3.youdomain.com";
            client.Username = "username";
            client.Password = "psw";

            try
            {
                // Retrieve first message in MailMessage format directly
                Aspose.Email.Mail.MailMessage msg;
                msg = client.FetchMessage(1);
                txtFrom.Text = msg.From.ToString();
                txtSubject.Text = msg.Subject.ToString();
                txtBody.Text = msg.HtmlBody.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            // ExEnd:AsposeEmailPop3
        }

        private void button2_Click(object sender, EventArgs e)
        {
            // Create a POP3 client
            Aspose.Email.Pop3.Pop3Client client;
            client = new Aspose.Email.Pop3.Pop3Client();

            // Basic settings (required)
            client.Host = "pop3.youdomain.com";
            client.Username = "username";
            client.Password = "psw";

            // ExStart:SSLEnabledServer
            // Set implicit security mode
            client.SecurityOptions = Aspose.Email.SecurityOptions.SSLImplicit;
            // ExEnd:SSLEnabledServer

            try
            {
                // Retrieve first message in MailMessage format directly
                Aspose.Email.Mail.MailMessage msg;
                msg = client.FetchMessage(1);
                txtFrom.Text = msg.From.ToString();
                txtSubject.Text = msg.Subject.ToString();
                txtBody.Text = msg.HtmlBody.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}


text:
using System.Threading.Tasks;
using SharpCaster.Models;

namespace SharpCaster.Channels
{
    public class ConnectionChannel : ChromecastChannel
    {
        public ConnectionChannel(ChromeCastClient client) :
            base(client, "urn:x-cast:com.google.cast.tp.connection")
        {
        }

        public async Task OpenConnection()
        {
            await Write(MessageFactory.Connect());
        }

        public async Task ConnectWithDestination()
        {
            await Write(MessageFactory.ConnectWithDestination(Client.CurrentApplicationTransportId));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.servicemix.store.ehcache;

import junit.framework.TestCase;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import org.apache.servicemix.id.IdGenerator;
import org.apache.servicemix.store.StoreListener;
import org.easymock.EasyMock;

import static org.easymock.EasyMock.*;

/**
 * @author: iocanel
 */
public class EhCacheStoreTest extends TestCase {

    private static final String TEST_CACHE_NAME = "TEST_CACHE_NAME";
    IdGenerator idGenerator = new IdGenerator();
    CacheManagerFactory cacheManagerFactory;
    CacheManager cacheManager;

    Cache cache = null;

    private StoreListener listener = createMock(StoreListener.class);

    public EhCacheStoreTest() {
        cacheManagerFactory = new CacheManagerFactory();
        cacheManagerFactory.setDiskStorePath("target");
        cacheManager = cacheManagerFactory.build();
        cacheManager.addCache(TEST_CACHE_NAME);
        cache = cacheManager.getCache(TEST_CACHE_NAME);
    }

    public void testStore() throws Exception {
        EhCacheStore store = new EhCacheStore(cache,idGenerator,"testStore");
        String id = "1";
        String data = "Test data ....";
        store.store(id,data);
        assertEquals(data,store.peek(id));
        assertEquals(data,store.load(id));
        assertEquals(null,store.load(id));
    }

    public void testEviction() throws Exception {
        cacheManagerFactory.setTimeToIdleSeconds(2);
        cacheManagerFactory.setTimeToLiveSeconds(2);
        cacheManager = cacheManagerFactory.build();
        cacheManager.addCache(TEST_CACHE_NAME);
        cache = cacheManager.getCache(TEST_CACHE_NAME);

        EhCacheStore store = new EhCacheStore(cache,idGenerator,"testStore");
        String id = "1";
        String data = "Test data ....";
        store.store(id,data);
        assertEquals(data,store.peek(id));
        Thread.sleep(3000);
        assertEquals(null,store.peek(id));
    }

    public void testStoreListeners() throws Exception {
        cacheManagerFactory.setTimeToIdleSeconds(2);
        cacheManagerFactory.setTimeToLiveSeconds(2);
        cacheManager = cacheManagerFactory.build();
        cacheManager.addCache(TEST_CACHE_NAME);
        cache = cacheManager.getCache(TEST_CACHE_NAME);

        EhCacheStore store = new EhCacheStore(cache,idGenerator,"testStore");
        store.addListener(listener);
        String id = "1";
        String data = "Test data ....";

         //Record behavior
        listener.onAdd(id,data);
        expectLastCall().times(1);
        listener.onEvict(id, data);
        expectLastCall().once();
        replay(listener);

        store.store(id,data);
        assertEquals(data,store.peek(id));
        Thread.sleep(3000);
        assertEquals(null,store.peek(id));
        verify(listener);
    }
}


text:
<?php

namespace Symfony\Component\Console\Descriptor;

use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;

/**
 * Text descriptor.
 *
 * @author Jean-François Simon <contact@jfsimon.fr>
 */
class TextDescriptor extends Descriptor
{
    /**
     * {@inheritdoc}
     */
    protected function describeInputArgument(InputArgument $argument, array $options = array())
    {
        if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) {
            $default = sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($argument->getDefault()));
        } else {
            $default = '';
        }

        $nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($argument->getName());
        $output = str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $argument->getDescription());
        $output = sprintf(" <info>%-${nameWidth}s</info> %s%s", $argument->getName(), $output, $default);

        return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
    }

    /**
     * {@inheritdoc}
     */
    protected function describeInputOption(InputOption $option, array $options = array())
    {
        if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) {
            $default = sprintf('<comment> (default: %s)</comment>', $this->formatDefaultValue($option->getDefault()));
        } else {
            $default = '';
        }

        $nameWidth = isset($options['name_width']) ? $options['name_width'] : strlen($option->getName());
        $nameWithShortcutWidth = $nameWidth - strlen($option->getName()) - 2;

        $output = sprintf(" <info>%s</info> %-${nameWithShortcutWidth}s%s%s%s",
            '--'.$option->getName(),
            $option->getShortcut() ? sprintf('(-%s) ', $option->getShortcut()) : '',
            str_replace("\n", "\n".str_repeat(' ', $nameWidth + 2), $option->getDescription()),
            $default,
            $option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''
        );

        return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
    }

    /**
     * {@inheritdoc}
     */
    protected function describeInputDefinition(InputDefinition $definition, array $options = array())
    {
        $nameWidth = 0;
        foreach ($definition->getOptions() as $option) {
            $nameLength = strlen($option->getName()) + 2;
            if ($option->getShortcut()) {
                $nameLength += strlen($option->getShortcut()) + 3;
            }
            $nameWidth = max($nameWidth, $nameLength);
        }
        foreach ($definition->getArguments() as $argument) {
            $nameWidth = max($nameWidth, strlen($argument->getName()));
        }
        ++$nameWidth;

        $messages = array();

        if ($definition->getArguments()) {
            $messages[] = '<comment>Arguments:</comment>';
            foreach ($definition->getArguments() as $argument) {
                $messages[] = $this->describeInputArgument($argument, array('name_width' => $nameWidth));
            }
            $messages[] = '';
        }

        if ($definition->getOptions()) {
            $messages[] = '<comment>Options:</comment>';
            foreach ($definition->getOptions() as $option) {
                $messages[] = $this->describeInputOption($option, array('name_width' => $nameWidth));
            }
            $messages[] = '';
        }

        $output = implode("\n", $messages);

        return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
    }

    /**
     * {@inheritdoc}
     */
    protected function describeCommand(Command $command, array $options = array())
    {
        $command->getSynopsis();
        $command->mergeApplicationDefinition(false);
        $messages = array('<comment>Usage:</comment>', ' '.$command->getSynopsis(), '');

        if ($command->getAliases()) {
            $messages[] = '<comment>Aliases:</comment> <info>'.implode(', ', $command->getAliases()).'</info>';
        }

        $messages[] = $this->describeInputDefinition($command->getNativeDefinition());

        if ($help = $command->getProcessedHelp()) {
            $messages[] = '<comment>Help:</comment>';
            $messages[] = ' '.str_replace("\n", "\n ", $help)."\n";
        }

        $output = implode("\n", $messages);

        return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
    }

    /**
     * {@inheritdoc}
     */
    protected function describeApplication(Application $application, array $options = array())
    {
        $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
        $description = new ApplicationDescription($application, $describedNamespace);
        $messages = array();

        if (isset($options['raw_text']) && $options['raw_text']) {
            $width = $this->getColumnWidth($description->getCommands());

            foreach ($description->getCommands() as $command) {
                $messages[] = sprintf("%-${width}s %s", $command->getName(), $command->getDescription());
            }
        } else {
            $width = $this->getColumnWidth($description->getCommands());

            $messages[] = $application->getHelp();
            $messages[] = '';

            if ($describedNamespace) {
                $messages[] = sprintf("<comment>Available commands for the \"%s\" namespace:</comment>", $describedNamespace);
            } else {
                $messages[] = '<comment>Available commands:</comment>';
            }

            // add commands by namespace
            foreach ($description->getNamespaces() as $namespace) {
                if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
                    $messages[] = '<comment>'.$namespace['id'].'</comment>';
                }

                foreach ($namespace['commands'] as $name) {
                    $messages[] = sprintf("  <info>%-${width}s</info> %s", $name, $description->getCommand($name)->getDescription());
                }
            }
        }

        $output = implode("\n", $messages);

        return isset($options['raw_text']) && $options['raw_text'] ? strip_tags($output) : $output;
    }

    /**
     * Formats input option/argument default value.
     *
     * @param mixed $default
     *
     * @return string
     */
    private function formatDefaultValue($default)
    {
        if (version_compare(PHP_VERSION, '5.4', '<')) {
            return str_replace('\/', '/', json_encode($default));
        }

        return json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
    }

    /**
     * @param Command[] $commands
     *
     * @return int
     */
    private function getColumnWidth(array $commands)
    {
        $width = 0;
        foreach ($commands as $command) {
            $width = strlen($command->getName()) > $width ? strlen($command->getName()) : $width;
        }

        return $width + 2;
    }
}


text:
package utils

const (
	SortAsc SortDirection = 1 << iota
	SortDesc
)
const (
	_SortDirection_name_0 = "ASC"
	_SortDirection_name_1 = "DESC"
)

type SortDirection uint8

func (i SortDirection) String() string {
	switch {
	case i == 1:
		return _SortDirection_name_0
	case i == 2:
		return _SortDirection_name_1
	default:
		return _SortDirection_name_0
	}
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.containeranalysis.v1.model;

/**
 * A non-fatal problem encountered during the execution of the build.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Container Analysis API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning extends com.google.api.client.json.GenericJson {

  /**
   * The priority for this warning.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String priority;

  /**
   * Explanation of the warning generated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String text;

  /**
   * The priority for this warning.
   * @return value or {@code null} for none
   */
  public java.lang.String getPriority() {
    return priority;
  }

  /**
   * The priority for this warning.
   * @param priority priority or {@code null} for none
   */
  public ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning setPriority(java.lang.String priority) {
    this.priority = priority;
    return this;
  }

  /**
   * Explanation of the warning generated.
   * @return value or {@code null} for none
   */
  public java.lang.String getText() {
    return text;
  }

  /**
   * Explanation of the warning generated.
   * @param text text or {@code null} for none
   */
  public ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning setText(java.lang.String text) {
    this.text = text;
    return this;
  }

  @Override
  public ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning set(String fieldName, Object value) {
    return (ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning) super.set(fieldName, value);
  }

  @Override
  public ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning clone() {
    return (ContaineranalysisGoogleDevtoolsCloudbuildV1BuildWarning) super.clone();
  }

}


text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
  <title>Watercolor Basemap</title>
  <link rel="shortcut icon" href="//esri.github.io/quickstart-map-js/images/favicon.ico">

  <link rel="stylesheet" href="//js.arcgis.com/3.10/js/esri/css/esri.css">

  <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="//esri.github.io/bootstrap-map-js/src/css/bootstrapmap.css">

Watercolor Basemap

Stamen Watercolor tile set as a custom basemap.


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Oxylobium capitatum Benth.

### Remarks
null


text:
package net.dean.jraw.models;

import java.util.List;

/**
 * Immutable class representing a set of rules.
 */
public final class Ruleset {
    private final List<SubredditRule> rules;
    private final List<String> siteRules;

    /**
     * Instantiates a new Ruleset
     *
     * @param newRules A set of subreddit rules
     * @param newSiteRules A set of site rules
     */
    public Ruleset(List<SubredditRule> newRules, List<String> newSiteRules) {
        this.rules = newRules;
        this.siteRules = newSiteRules;
    }

    /**
     * Gets subreddit rules
     */
    public List<SubredditRule> getSubredditRules() {
        return rules;
    }

    /**
     * Gets site rules
     */
    public List<String> getSiteRules() {
        return siteRules;
    }
}


text:
namespace search::queryeval {

RankedSearchIteratorBase::
RankedSearchIteratorBase(fef::TermFieldMatchDataArray matchData)
    : SearchIterator(),
      _matchData(std::move(matchData)),
      _needUnpack(1)
{ }

RankedSearchIteratorBase::~RankedSearchIteratorBase() = default;

}


text:
package org.projectx.webservice.push;

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

import com.gexin.rp.sdk.base.IPushResult;
import com.gexin.rp.sdk.base.impl.SingleMessage;
import com.gexin.rp.sdk.base.impl.Target;
import com.gexin.rp.sdk.http.IGtPush;
import com.gexin.rp.sdk.template.LinkTemplate;
import com.gexin.rp.sdk.template.NotificationTemplate;
import com.gexin.rp.sdk.template.NotyPopLoadTemplate;
import com.gexin.rp.sdk.template.PopupTransmissionTemplate;
import com.gexin.rp.sdk.template.TransmissionTemplate;

public class pushtoSingle {
	static String appId = "请输入appId";
	static String appkey = "请输入appkey";
	static String master = "请输入master";
	static String CID = "请输入ClientID";
	static String Alias = "请输入别名"; // 根据别名推送,需要先绑定别名,请参考alias_bind_unbind.java

	static String host = "http://sdk.open.api.igexin.com/apiex.htm";

	public static void main(String[] args) throws Exception {
		IGtPush push = new IGtPush(host, appkey, master);
		push.connect();

		TransmissionTemplate template = TransmissionTemplateDemo();
		// LinkTemplate template = linkTemplateDemo();
		// NotificationTemplate template = NotificationTemplateDemo();
		// NotyPopLoadTemplate template =NotyPopLoadTemplateDemo();

		SingleMessage message = new SingleMessage();
		message.setOffline(true);
		message.setOfflineExpireTime(1 * 1000 * 3600);
		message.setData(template);
//		message.setPushNetWorkType(1); //根据WIFI推送设置

		List<Target> targets = new ArrayList<Target>();
		Target target1 = new Target();
		Target target2 = new Target();
		target1.setAppId(appId);
		target1.setClientId(CID);
		// target1.setAlias(Alias);	//根据别名推送设置,CID与Alias可二选一进行推送

		IPushResult ret = push.pushMessageToSingle(message, target1);
		System.out.println(ret.getResponse().toString());
	}

	public static PopupTransmissionTemplate PopupTransmissionTemplateDemo() {
		PopupTransmissionTemplate template = new PopupTransmissionTemplate();
		template.setAppId(appId);
		template.setAppkey(appkey);
		template.setText("");
		template.setTitle("");
		template.setImg("");
		template.setConfirmButtonText("");
		template.setCancelButtonText("");
		template.setTransmissionContent("111");
		template.setTransmissionType(1);

		return template;
	}

	public static TransmissionTemplate TransmissionTemplateDemo()
			throws Exception {
		TransmissionTemplate template = new TransmissionTemplate();
		template.setAppId(appId);
		template.setAppkey(appkey);
		template.setTransmissionType(1);
		template.setTransmissionContent("OS-TOSingle");
		// template.setPushInfo("dd", 1, "ddd", "com.gexin.ios.silence", "", "",
		// "", "");
		return template;
	}

	public static LinkTemplate linkTemplateDemo() throws Exception {
		LinkTemplate template = new LinkTemplate();
		template.setAppId(appId);
		template.setAppkey(appkey);
		template.setTitle("");
		template.setText("");
		template.setLogo("text.png");
		// template.setLogoUrl("");
		// template.setIsRing(true);
		// template.setIsVibrate(true);
		// template.setIsClearable(true);
		template.setUrl("http://www.baidu.com");
		// template.setPushInfo("actionLocKey", 1, "message", "sound",
		// "payload", "locKey", "locArgs", "launchImage");
		return template;
	}

	public static NotificationTemplate NotificationTemplateDemo()
			throws Exception {
		NotificationTemplate template = new NotificationTemplate();
		template.setAppId(appId);
		template.setAppkey(appkey);
		template.setTitle("内容");
		template.setText("标题");
		template.setLogo("icon.png");
		// template.setLogoUrl("");
		// template.setIsRing(true);
		// template.setIsVibrate(true);
		// template.setIsClearable(true);
		template.setTransmissionType(1);
		template.setTransmissionContent("dddd");
		// template.setPushInfo("actionLocKey", 2, "message", "sound",
		// "payload", "locKey", "locArgs", "launchImage");
		return template;
	}

	public static NotyPopLoadTemplate NotyPopLoadTemplateDemo() {
		NotyPopLoadTemplate template = new NotyPopLoadTemplate();
		// 填写appid与appkey
		template.setAppId(appId);
		template.setAppkey(appkey);
		// 填写通知标题和内容
		template.setNotyTitle("标题");
		template.setNotyContent("内容");
		// template.setLogoUrl("");
		// 填写图标文件名称
		template.setNotyIcon("text.png");
		// 设置响铃,震动,与可清除
		// template.setBelled(false);
		// template.setVibrationed(false);
		// template.setCleared(true);

		// 设置弹框标题与内容
		template.setPopTitle("弹框标题");
		template.setPopContent("弹框内容");
		// 设置弹框图片
		template.setPopImage("http://www-igexin.qiniudn.com/wp-content/uploads/2013/08/logo_getui1.png");
		template.setPopButton1("打开");
		template.setPopButton2("取消");

		// 设置下载标题,图片与下载地址
		template.setLoadTitle("下载标题");
		template.setLoadIcon("file://icon.png");
		template.setLoadUrl("http://gdown.baidu.com/data/wisegame/c95836e06c224f51/weixinxinqing_5.apk");
		template.setActived(true);
		template.setAutoInstall(true);
		template.setAndroidMark("");
		return template;
	}
}


text:
ReferenceToElements.Super = "delta.com.objectBase.ObjectBase";

function ReferenceToElements(params){
    Super(this, params);
    this.extract(this.root);
}

ReferenceToElements.properties = {
    root : null,

    querySelectorString : {
        value : 'view-reference'
    },

    extract : function extract(){
        var
            elements = this.root.querySelectorAll("[" + this.querySelectorString + "]"),
            length = elements.length, element, index = 0, reference
        ;

        for(;index<length;index++){
            element = elements[index];
            reference = element.getAttribute( this.querySelectorString );
            this[reference] = element;
        }
    }
}


text:
layout: page
subheadline: "Tech"
title: "Projet WiTo – « webcam » Wi-Fi haute qualité – 3"
date: 2009-11-16 06:51:11+00:00
teaser: "_Comme présenté précédemment, l'objectif de ce petit projet est de  connecter un vieil appareil photo à Internet pour faire office de Webcam  haute qualité (et autonome)._"
header:
    image_fullwidth: "header_typewriter.jpg"
    caption: Image by Florian Klauer
    caption_url: "http://florianklauer.de/"
image:
    thumb:  typewriter_thumb.jpg
    homepage: homepage_typewriter.jpg
categories:
    - tech
comments: false
show_meta: true
---
Une voie, que dis-je, une autoroute s'ouvre à nous : PTP nous voilà  !!

Mais avant de se jeter plus en avant il est nécessaire de s'assurer  que l'utilisation du PTP est possible sur des plateformes linux  embarquées.

Sous linux le logiciel permettant de manipuler des appareils photos  via PTP s'appelle [gphoto](http://gphoto.sourceforge.net/), il  est donc nécessaire de s'assurer de la disponibilité du logiciel pour  des plateformes embarquées.

![Le Logiciel Gphoto2 sous Linux](http://infracom-france.com/blog2/wp-content/uploads/2009/11/gphoto-logo.png)
    Le Logiciel Gphoto2 sous Linux

Un rapide connexion sur une de nos plateformes de développement  répond rapidement à nos interrogations.

<code>
wifipak> ipkg list | grep gphoto
gphoto2 - 2.4.1-1 - Command line digital camera software applications
libgphoto2 - 2.4.1-1 - digital camera software libraries
</code>

Bingo ! Le logiciel est disponible sur les dépots ipkg (apt-get pour  plateformes embarquées).

Nous pouvons donc avancer un peu plus dans le développement du WiTo.

Gphoto offre deux modes répondant à nos besoins:

  * Tethering
  * Capture and Download

Le mode tethering permet de transférer directement une photo entre  l'appareil sans passer par la carte mémoire et de transmettre ce cliché à  un logiciel présent sur le PC via un script (un "hook" script). Bien  que cette option semble intéressante, les différents tests réalisés ne  furent pas concluants (probablement un soucis de compatibilité avec  l'appareil photo de test). N'oubliez pas que nous visons l'utilisation  d'une plateforme embarquée avec de faibles ressources.

Le mode "Capture and Download", enregistre la photo sur la carte  mémoire de l'appareil photo, la transfère sur le PC puis efface la photo  de la carte mémoire.

Nous allons donc nous orienter vers cette seconde option.

La liste  des appareils testés et compatibles (ou non) avec Gphoto est disponible  ici: [http://gphoto.sourceforge.net/doc/remote/](http://gphoto.sourceforge.net/doc/remote/)

Par chance nous disposons d'un vieux Canon PowerShot A520 4 Mpix dont  le zoom ne se referme plus correctement. La prise de vue est toujours  correcte, cet appareil répond donc parfaitement à nos besoins. De plus,  il dispose d'une alimentation externe ce qui devrais permettre de le  laisser allumé 24h/24.

![Canon PowerShot A520](http://infracom-france.com/blog2/wp-content/uploads/2009/11/canon_powershot_a520.jpg)
    Canon PowerShot A520

Il ne nous reste plus qu'à développer un petit script pour prendre la  photo et la mettre à disposition en ligne.

<A SUIVRE>

_Cet article a été automatique importé de notre ancien blog, merci de nous excuser pour tout problème d'affichage ou image manquante._


text:
Phar: bug #69453: Memory Corruption in phar_parse_tarfile when entry filename starts with null
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
$fname = dirname(__FILE__) . '/bug69453.tar.phar';
try {
$r = new Phar($fname, 0);
} catch(UnexpectedValueException $e) {
	echo $e;
}
?>

==DONE==
--EXPECTF--
exception 'UnexpectedValueException' with message 'phar error: "%s%ebug69453.tar.phar" is a corrupted tar file (checksum mismatch of file "")' in %s:%d
Stack trace:
#0 %s%ebug69453.php(%d): Phar->__construct('%s', 0)
#1 {main}
==DONE==


text:
using System;

namespace Shuttle.Esb.RabbitMQ
{
    internal class ConnectionException : Exception
    {
        public ConnectionException(string message) : base(message)
        {
        }
    }
}


text:
package com.seodroid.seodroid.jobs;

import com.seodroid.seodroid.system.BaseHttp;
import com.seodroid.seodroid.system.IResult;

import java.net.URI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Dmoz extends BaseHttp
        implements IResult {

    //https://www.google.com/search?q=site:ru.ru
    private static final String REGEX =  "
\\s+]+)\"";

    public String getIconName(){
        return  "dmoz.png";
    }

    public String getGrabUrl(){
        return "http://www.dmoz.org/search/?q="+ getUri().getHost();
    }

    public String getName(){
         return  "DMOZ";
     }

     public String getResult() throws Exception{

         String htmlDocument = contentFromGetRequest(getGrabUrl());
         Pattern pattern = Pattern.compile(REGEX);
         Matcher matcher = pattern.matcher(htmlDocument);
         String host = getUri().getHost();
         String dmozHost;
         while(matcher.find()){
             try {
                dmozHost = URI.create(matcher.group(1)).getHost();

             }catch (Exception e){
                 continue;
             }

             if (host.equals(dmozHost)){
                 return "Yes";
             }
         }
         return  "No";

     }

}


text:
/**
 * NOTE: This helper-methods are added to the classes pimcore.object.edit, pimcore.object.fieldcollection,
 * pimcore.object.tags.localizedfields
 */

pimcore.registerNS("pimcore.object.helpers.grid");
pimcore.object.helpers.grid = Class.create({

    limit: 20,
    baseParams: {},
    showSubtype: true,
    showKey: true,
    enableEditor: false,

    initialize: function(selectedClass, fields, url, baseParams, isSearch) {
        this.selectedClass = selectedClass;
        this.fields = fields;
        this.isSearch = isSearch;

        this.url = url;
        if(baseParams) {
            this.baseParams = baseParams;
        } else {
            this.baseParams = {};
        }

        if(!this.baseParams.limit) {
            this.baseParams.limit = this.limit;
        }
        if(!this.baseParams["class"]) {
            this.baseParams["class"] = this.selectedClass;
        }

        var fieldParam = [];
        for(var i = 0; i < fields.length; i++) {
            fieldParam.push(fields[i].key);
        }

        this.baseParams['fields[]'] = fieldParam;
    },

    getStore: function() {

        // the store
        var readerFields = [];
        readerFields.push({name: "id", allowBlank: true});
        readerFields.push({name: "idPath", allowBlank: true});
        readerFields.push({name: "fullpath", allowBlank: true});
        readerFields.push({name: "published", allowBlank: true});
        readerFields.push({name: "type", allowBlank: true});
        readerFields.push({name: "subtype", allowBlank: true});
        readerFields.push({name: "filename", allowBlank: true});
        readerFields.push({name: "classname", allowBlank: true});
        readerFields.push({name: "creationDate", allowBlank: true});
        readerFields.push({name: "modificationDate", allowBlank: true});
        readerFields.push({name: "inheritedFields", allowBlank: false});
        readerFields.push({name: "metadata", allowBlank: true});
        readerFields.push({name: "#kv-tr", allowBlank: true});

        for (var i = 0; i < this.fields.length; i++) {
            readerFields.push({name: this.fields[i].key, allowBlank: true});
        }

        var proxy = new Ext.data.HttpProxy({
            url: this.url,
            method: 'post'
        });
        var reader = new Ext.data.JsonReader({
            totalProperty: 'total',
            successProperty: 'success',
            root: 'data'
        }, readerFields);

        var writer = null;
        var listeners = {};
        if(this.enableEditor) {
            writer = new Ext.data.JsonWriter();
            listeners.write = function(store, action, result, response, rs) {};
            listeners.exception = function (conn, mode, action, request, response, store) {
                if(action == "update") {
                    Ext.MessageBox.alert(t('error'),
                                         t('cannot_save_object_please_try_to_edit_the_object_in_detail_view'));
                    this.store.rejectChanges();
                }
            }.bind(this);
        }

        this.store = new Ext.data.Store({
            restful: false,
            idProperty: 'id',
            remoteSort: true,
            proxy: proxy,
            reader: reader,
            writer: writer,
            listeners: listeners,
            baseParams: this.baseParams
        });

        return this.store;

    },

    selectionColumn: null,
    getSelectionColumn: function() {
        if(this.selectionColumn == null) {
            this.selectionColumn = new Ext.grid.CheckboxSelectionModel();
        }
        return this.selectionColumn;
    },

    getGridColumns: function() {
        // get current class
        var classStore = pimcore.globalmanager.get("object_types_store");
        var klassIndex = classStore.findExact("text", this.selectedClass);
        var klass = classStore.getAt(klassIndex);
        var propertyVisibility = klass.get("propertyVisibility");

        if(this.isSearch) {
            propertyVisibility = propertyVisibility.search;
        } else {
            propertyVisibility = propertyVisibility.grid;
        }
        var showKey = propertyVisibility.path;
        if(this.showKey) {
            showKey = true;
        }

        // init grid-columns
        var gridColumns = [];

        if(this.enableEditor) {
            var selectionColumn = this.getSelectionColumn();
            gridColumns.push(selectionColumn);
        }

        var fields = this.fields;
        for (var i = 0; i < fields.length; i++) {

            var field = fields[i];
//            console.log(field);
            if(field.key == "subtype") {
                gridColumns.push({header: t("type"), width: this.getColumnWidth(field, 40), sortable: true, dataIndex: 'subtype',
                                        hidden: !this.showSubtype,
                                        renderer: function (value, metaData, record, rowIndex, colIndex, store) {
                        return '

';
                    }});
            } else if(field.key == "id") {
                gridColumns.push({header: 'ID', width: this.getColumnWidth(field, this.getColumnWidth(field, 40)), sortable: true,
                                                dataIndex: 'id'/*, hidden: !propertyVisibility.id*/});
            } else if(field.key == "published") {
                gridColumns.push(new Ext.grid.CheckColumn({
                    header: t("published"),
                    width: 40,
                    sortable: true,
                    dataIndex: "published",
                    renderer: function (key, value, metaData, record, rowIndex, colIndex, store) {
                        metaData.css += ' x-grid3-check-col-td';
                        return String.format('

', value ? '-on' : '');
                    }.bind(this, field.key)
                }));
            } else if(field.key == "fullpath") {
                gridColumns.push({header: t("path"), width: this.getColumnWidth(field, 200), sortable: true,
                                  dataIndex: 'fullpath'/*, hidden: !propertyVisibility.path*/});
            } else if(field.key == "filename") {
                gridColumns.push({header: t("filename"), width: this.getColumnWidth(field, 200), sortable: true,
                                  dataIndex: 'filename', hidden: !showKey});
            } else if(field.key == "classname") {
                gridColumns.push({header: t("class"), width: this.getColumnWidth(field, 200), sortable: true,
                                  dataIndex: 'classname',renderer: function(v){return ts(v);}/*, hidden: true*/});
            } else if(field.key == "creationDate") {
                gridColumns.push({header: t("creationdate") + " (System)", width: this.getColumnWidth(field, 200), sortable: true,
                                    dataIndex: "creationDate", editable: false, renderer: function(d) {
                                    var date = new Date(d * 1000);
                                    return date.format("Y-m-d H:i:s");
                                }/*, hidden: !propertyVisibility.creationDate*/});
            } else if(field.key == "modificationDate") {
                gridColumns.push({header: t("modificationdate") + " (System)", width: this.getColumnWidth(field, 200), sortable: true,
                                    dataIndex: "modificationDate", editable: false, renderer: function(d) {
                                    var date = new Date(d * 1000);
                                    return date.format("Y-m-d H:i:s");
                                }/*, hidden: !propertyVisibility.modificationDate*/});
            } else {
                var fc = pimcore.object.tags[fields[i].type].prototype.getGridColumnConfig(field);
                fc.width = this.getColumnWidth(field, 100);
                gridColumns.push(fc);
                gridColumns[gridColumns.length-1].hidden = false;
                gridColumns[gridColumns.length-1].layout = fields[i];
            }
        }

        return gridColumns;
    },

    getColumnWidth: function(field, defaultValue) {
        if (field.width) {
            return field.width;
        } else {
            return defaultValue;
        }
    },

    getGridFilters: function() {
        var configuredFilters = [{
            type: "date",
            dataIndex: "creationDate"
        },{
            type: "date",
            dataIndex: "modificationDate"
        }];

        var fields = this.fields;
        for (var i = 0; i < fields.length; i++) {

            if(fields[i].key != "id" && fields[i].key != "published" && fields[i].key != "fullpath"
                                && fields[i].key != "filename" && fields[i].key != "classname"
                                && fields[i].key != "creationDate" && fields[i].key != "modificationDate") {

                var filter = pimcore.object.tags[fields[i].type].prototype.getGridColumnFilter(fields[i]);
                if(filter) {
                    configuredFilters.push(filter);
                }
            }

        }

        // filters
        var gridfilters = new Ext.ux.grid.GridFilters({
            encode: true,
            local: false,
            filters: configuredFilters
        });

        return gridfilters;

    },

    applyGridEvents: function(grid) {
        var fields = this.fields;
        for (var i = 0; i < fields.length; i++) {

            if(fields[i].key != "id" && fields[i].key != "published" && fields[i].key != "fullpath"
                && fields[i].key != "filename" && fields[i].key != "classname"
                && fields[i].key != "creationDate" && fields[i].key != "modificationDate") {

                pimcore.object.tags[fields[i].type].prototype.applyGridEvents(grid, fields[i]);
            }

        }
    }

});


text:
package azkaban.security;

public class HadoopSecurityManagerException extends Exception {
  private static final long serialVersionUID = 1L;

  public HadoopSecurityManagerException(String message) {
    super(message);
  }

  public HadoopSecurityManagerException(String message, Throwable cause) {
    super(message, cause);
  }
}


text:
package ua.ikonovalov.list;

import java.util.ArrayList;

/**
 * class Node - found loop
 * @author ikonovalov
 * @since 26.02.19.
 */
public class Node<T> {

    private T value;
    private Node<T> next;

    public Node(T value) {
        this.value = value;
    }

    public void setNext(Node<T> next) {
        this.next = next;
    }

    /**
     * class Cycle
     * @param <T>
     */
    public static class Cycle<T> {

        public boolean hasCycle(Node first) {
            ArrayList<Node> list = new ArrayList<>();
            Node<T> value = first;
            boolean found = false;
            while (true) {
                if (value.next == null) {
                    break;
                }
                value = value.next;
                if (list.contains(value)) {
                    found = true;
                    break;
                } else {
                    list.add(value);
                }
            }
            return found;
        }

        /**
         * Algorithm tort and rabbit(Floyd)
         * @param first
         * @return true or false
         */
        public boolean hasCycleFloyd(Node<T> first) {
            Node<T> tort = first;
            Node<T> rabbit = first.next;
            boolean found = false;
            while (true) {
                if (rabbit == null || tort == null) {
                    break;
                }
                if (tort.equals(rabbit)) {
                    found = true;
                    break;
                } else {
                    tort = tort.next;
                    rabbit = rabbit.next.next;
                }
            }
            return found;
        }
    }
}


text:
from __future__ import division, print_function

from emcee import moves
from .test_proposal import _test_normal, _test_uniform

__all__ = ["test_normal_kde", "test_uniform_kde", "test_nsplits_kde"]

def test_normal_kde(**kwargs):
    _test_normal(moves.KDEMove(), **kwargs)

def test_uniform_kde(**kwargs):
    _test_uniform(moves.KDEMove(), **kwargs)

def test_nsplits_kde(**kwargs):
    _test_normal(moves.KDEMove(nsplits=5), **kwargs)


text:
using NUnit.Framework;
using Umbraco.Cms.Core.IO;

namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Templates;

[TestFixture]
public class DefaultViewContentProviderTests
{
    private IDefaultViewContentProvider DefaultViewContentProvider => new DefaultViewContentProvider();

    [Test]
    public void NoOptions()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent();
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
    Layout = null;
}"),
            FixView(view));
    }

    [Test]
    public void Layout()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent("Dharznoik");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
    Layout = ""Dharznoik.cshtml"";
}"),
            FixView(view));
    }

    [Test]
    public void ClassName()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent(modelClassName: "ClassName");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ClassName>
@{
    Layout = null;
}"),
            FixView(view));
    }

    [Test]
    public void Namespace()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent(modelNamespace: "Models");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
    Layout = null;
}"),
            FixView(view));
    }

    [Test]
    public void ClassNameAndNamespace()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent(modelClassName: "ClassName", modelNamespace: "My.Models");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.ClassName>
@using ContentModels = My.Models;
@{
    Layout = null;
}"),
            FixView(view));
    }

    [Test]
    public void ClassNameAndNamespaceAndAlias()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent(
            modelClassName: "ClassName",
            modelNamespace: "My.Models",
            modelNamespaceAlias: "MyModels");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<MyModels.ClassName>
@using MyModels = My.Models;
@{
    Layout = null;
}"),
            FixView(view));
    }

    [Test]
    public void Combined()
    {
        var view = DefaultViewContentProvider.GetDefaultFileContent("Dharznoik", "ClassName", "My.Models", "MyModels");
        Assert.AreEqual(
            FixView(@"@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<MyModels.ClassName>
@using MyModels = My.Models;
@{
    Layout = ""Dharznoik.cshtml"";
}"),
            FixView(view));
    }

    private static string FixView(string view)
    {
        view = view.Replace("\r\n", "\n");
        view = view.Replace("\r", "\n");
        view = view.Replace("\n", "\r\n");
        view = view.Replace("\t", "    ");
        return view;
    }
}


text:
'use strict';

var Promise = require('../../../ext/promise');
var getEnvVar = require('../../../ext/get-env-var');
var GitHubApi = require('github');
var github = new GitHubApi({ version: '3.0.0' });

var githubToken = getEnvVar('GITHUB_TOKEN', null);

if (githubToken) {
  github.authenticate({
    type: 'oauth',
    token: githubToken
  });
}

var compareCommits = Promise.denodeify(github.repos.compareCommits);
var massageGithubCommits = require('./massage-commits');

/**!
 *
 * @param options passed to the Github API compareCommits function
 * @returns {Promise} returns a promise which resolves to an array of parsed commits
 */
function githubCompareCommits(options, parseOptions) {
  return compareCommits(options)
    .then(function(commits) { return massageGithubCommits(commits, parseOptions); });
}

module.exports = githubCompareCommits;


text:
PXLActionSheet
==============

A new customizable replacement for UIActionSheet.

## Screenshots

![Screenshot](https://github.com/jasonsilberman/PXLActionSheet/blob/master/screenshot.png)

## Why?
1. The system `UIActionSheet` are very uncustomizable.
2. Blocks! Blocks! Blocks!

## Documentation
You can check out the documentation over at [Cocoadocs](http://cocoadocs.org/docsets/PXLActionSheet/).

## Adding to Your Project
Getting started using PXLActionSheet is really easy! You can use Cocoapods or you can do it manually.

### Using CocoaPods
Add the following to your `Podfile`.

```ruby
pod 'PXLActionSheet'
```

### Manually
To manually add to your project:

1. Add the files in `PXLActionSheet/` to your project.

PXLNetworking requires ARC.

## Usage
PXLActionSheet is super simple.

1. Create a `PXLActionSheetTheme` (or use the defaultTheme).
2. Create and show a `PXLActionSheet`.

Here is an example:

```objc
[PXLActionSheet showInView:self.view
		withTheme:[PXLActionSheetTheme defaultTheme]
		title:@"A new customizable replacement for UIActionSheet."
		cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
		otherButtonTitles:@[@"Custom Fonts", @"Custom Colors", @"And More!"]
		tapBlock:^(PXLActionSheet *actionSheet, NSInteger tappedButtonIndex) {
	NSLog(@"tapped at %ld", (long)tappedButtonIndex);
}];
```

*Super simple, I know!*

## License
PXLActionSheet is available under the MIT license. See the LICENSE file for more info.


text:
import os
from textwrap import dedent

from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.repository import Repository
from pants.backend.jvm.scala_artifact import ScalaArtifact
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.targets.java_library import JavaLibrary
from pants.backend.jvm.targets.scala_jar_dependency import ScalaJarDependency
from pants.backend.jvm.tasks.check_published_deps import CheckPublishedDeps
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.build_graph.target import Target
from pants.java.jar.jar_dependency import JarDependency
from pants.testutil.task_test_base import ConsoleTaskTestBase
from pants.util.dirutil import safe_mkdir, safe_mkdtemp, safe_open
from pants.util.memo import memoized_classproperty

class CheckPublishedDepsTest(ConsoleTaskTestBase):
    @classmethod
    def alias_groups(cls):
        return BuildFileAliases(
            targets={"target": Target, "jar_library": JarLibrary, "java_library": JavaLibrary},
            objects={
                "artifact": Artifact,
                "jar": JarDependency,
                "scala_artifact": ScalaArtifact,
                "scala_jar": ScalaJarDependency,
            },
            context_aware_object_factories={
                "repo": lambda _: Repository(
                    name="repo", url="http://www.www.com", push_db_basedir=cls.push_db_basedir
                ),
            },
        )

    @classmethod
    def task_type(cls):
        return CheckPublishedDeps

    @memoized_classproperty
    def push_db_basedir(cls):
        return safe_mkdtemp()

    def assert_console_output(self, *args, **kwargs):
        # Ensure that JarPublish's repos option is set, as CheckPublishedDeps consults it.
        self.set_options_for_scope("publish.jar", repos={})
        return super().assert_console_output(*args, **kwargs)

    def setUp(self):
        super().setUp()

        safe_mkdir(self.push_db_basedir, clean=True)

        def write_db_file(relpath, contents):
            with safe_open(os.path.join(self.push_db_basedir, relpath), "w") as fp:
                fp.write(contents)

        write_db_file(
            "org.name/lib1/publish.properties",
            dedent(
                """
                revision.major.org.name%lib1=2
                revision.minor.org.name%lib1=0
                revision.patch.org.name%lib1=0
                revision.sha.org.name%lib1=12345
                """
            ),
        )
        write_db_file(
            "org.name/lib2/publish.properties",
            dedent(
                """
                revision.major.org.name%lib2=2
                revision.minor.org.name%lib2=0
                revision.patch.org.name%lib2=0
                revision.sha.org.name%lib2=12345
                """
            ),
        )

        self.add_to_build_file(
            "provider/BUILD",
            dedent(
                """
                java_library(name='lib1',
                  provides=artifact(
                    org='org.name',
                    name='lib1',
                    repo=repo),
                  sources=[])
                java_library(name='lib2',
                  provides=artifact(
                    org='org.name',
                    name='lib2',
                    repo=repo),
                  sources=[])
                """
            ),
        )
        self.add_to_build_file(
            "outdated/BUILD",
            dedent(
                """
                jar_library(name='outdated',
                  jars=[jar(org='org.name', name='lib1', rev='1.0.0')]
                )
                """
            ),
        )
        self.add_to_build_file(
            "uptodate/BUILD",
            dedent(
                """
                jar_library(name='uptodate',
                  jars=[jar(org='org.name', name='lib2', rev='2.0.0')]
                )
                """
            ),
        )
        self.add_to_build_file(
            "both/BUILD",
            dedent(
                """
                target(name='both',
                  dependencies=[
                    'outdated',
                    'uptodate',
                  ]
                )
                """
            ),
        )

    def test_all_up_to_date(self):
        self.assert_console_output(targets=[self.target("uptodate")])

    def test_print_up_to_date_and_outdated(self):
        self.assert_console_output(
            "outdated org.name#lib1 1.0.0 latest 2.0.0",
            "up-to-date org.name#lib2 2.0.0",
            targets=[self.target("both")],
            options={"print_uptodate": True},
        )

    def test_outdated(self):
        self.assert_console_output(
            "outdated org.name#lib1 1.0.0 latest 2.0.0", targets=[self.target("outdated")]
        )


text:
using Microsoft.Diagnostics.Tracing.Parsers;
using Microsoft.Diagnostics.Tracing.Session;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Diagnostics.Tracing.Parsers.Kernel;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;
using Microsoft.Diagnostics.Tracing;

namespace LiveStacks
{
    class LiveSession
    {
        private static readonly string[] SupportedProviders = new[] { "kernel", "clr" };

        private TraceEventSession _session;
        private List<int> _processIDs = new List<int>();
        private readonly bool _includeKernelFrames;
        private string _provider;
        private KernelTraceEventParser.Keywords _kernelKeyword;
        private ClrTraceEventParser.Keywords _clrKeyword;
        private string _clrEventName;
        private Dictionary<int, string> _lastEventNameByThread = new Dictionary<int, string>();

        public AggregatedStacks Stacks { get; private set; } = new AggregatedStacks();

        public ulong TotalEventsSeen { get; private set; }

        public LiveSession(string stackEvent, IEnumerable<int> processIDs, bool includeKernelFrames)
        {
            ParseProvider(stackEvent);
            if (_processIDs != null)
            {
                _processIDs.AddRange(processIDs);
            }
            _includeKernelFrames = includeKernelFrames;
        }

        public event Action<TraceEvent> EventOccurred = delegate { };

        /// <summary>
        /// Starts the ETW session, and processes the stack samples that come in. This method
        /// does not return until another thread calls <see cref="Stop"/> to stop the session.
        /// While this method is executing, live stack aggregates can be obtained from the
        /// <see cref="Stacks"/> property, which is thread-safe.
        /// </summary>
        public void Start()
        {
            _session = new TraceEventSession($"LiveStacks-{Process.GetCurrentProcess().Id}");

            if (_provider == "kernel")
            {
                _session.EnableKernelProvider(_kernelKeyword, stackCapture: _kernelKeyword);
                _session.Source.Kernel.StackWalkStack += OnKernelStackEvent;
            }

            if (_provider == "clr")
            {
                _session.EnableProvider(
                    ClrTraceEventParser.ProviderGuid,
                    matchAnyKeywords: (ulong)(_clrKeyword | ClrTraceEventParser.Keywords.Stack));
                _session.Source.Clr.All += OnAnyClrEvent;
                _session.Source.Clr.ClrStackWalk += OnClrStackEvent;
            }

            _session.Source.Process();
        }

        private void ParseProvider(string eventSpec)
        {
            string[] parts = eventSpec.Split(':');
            if (parts.Length != 2 && parts.Length != 3)
            {
                throw new ArgumentException(
                    "Event specification must have two or three components separated by a colon, " +
                    "e.g. 'kernel:profile' or 'clr:gc:gc/allocationtick'.");
            }
            if (!SupportedProviders.Contains(parts[0], StringComparer.InvariantCultureIgnoreCase))
            {
                throw new ArgumentException(
                    "Event specification provider was not recognized. Supported providers: " +
                    String.Join(", ", SupportedProviders));
            }
            _provider = parts[0].ToLower();
            ParseEvent(parts.Skip(1).ToArray());
        }

        private void ParseEvent(string[] parts)
        {
            if (_provider == "kernel")
            {
                string keyword = parts[0];
                KernelTraceEventParser.Keywords parsedKeyword;
                if (!Enum.TryParse(keyword, true, out parsedKeyword))
                {
                    throw new ArgumentException("Unrecognized kernel keyword: '" + keyword + "'.");
                }
                _kernelKeyword = parsedKeyword;
            }
            else if (_provider == "clr")
            {
                if (parts.Length != 2)
                {
                    throw new ArgumentException("CLR event specification must contain a keyword and an event name.");
                }

                string keyword = parts[0];
                string eventName = parts[1];
                ClrTraceEventParser.Keywords parsedKeyword;
                if (!Enum.TryParse(keyword, true, out parsedKeyword))
                {
                    throw new ArgumentException("Unrecognized CLR keyword: '" + keyword + "'.");
                }
                _clrKeyword = parsedKeyword;
                _clrEventName = eventName.ToLower();
            }
        }

        private void OnAnyClrEvent(TraceEvent anyEvent)
        {
            if (anyEvent.EventName != "ClrStack/Walk")
                _lastEventNameByThread[anyEvent.ThreadID] = anyEvent.EventName;

            EventOccurred(anyEvent);
        }

        private void OnClrStackEvent(ClrStackWalkTraceData stack)
        {
            ++TotalEventsSeen;

            if (!ProcessFilter(stack.ProcessID))
                return;

            string lastEventName;
            if (!_lastEventNameByThread.TryGetValue(stack.ThreadID, out lastEventName))
                return;

            if (!lastEventName.Equals(_clrEventName, StringComparison.InvariantCultureIgnoreCase))
                return;

            ulong[] addresses = new ulong[stack.FrameCount];
            for (int i = 0; i < addresses.Length; ++i)
            {
                addresses[i] = stack.InstructionPointer(i);
            }
            Stacks.AddStack(stack.ProcessID, addresses);
        }

        private void OnKernelStackEvent(StackWalkStackTraceData stack)
        {
            ++TotalEventsSeen;

            if (!ProcessFilter(stack.ProcessID))
                return;

            ulong[] addresses = new ulong[stack.FrameCount];
            int recordedIdx = 0;
            for (int originalFrameIdx = 0; originalFrameIdx < stack.FrameCount; ++originalFrameIdx)
            {
                ulong ip = stack.InstructionPointer(originalFrameIdx);
                if (_includeKernelFrames || (ip < 0x8000000000000000))
                    addresses[recordedIdx++] = ip;
            }
            if (recordedIdx > 0) // This could have been a purely kernel stack
            {
                Stacks.AddStack(stack.ProcessID, addresses);
            }
        }

        private bool ProcessFilter(int processID)
        {
            return _processIDs.Count == 0 || _processIDs.Contains(processID);
        }

        public void Stop()
        {
            _session.Stop();
        }
    }
}


text:
package org.unbrokendome.eventbus.proxy;

import java.util.stream.Stream;

interface SubscriberScanner {

    Stream<EventSubscriberInfo> scanForSubscriberMethods(String beanName, Class<?> beanType);
}


text:
package org.elasticsearch.client.ilm;

import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.test.AbstractXContentTestCase;

import static org.hamcrest.Matchers.is;

public class WaitForSnapshotActionTests extends AbstractXContentTestCase<WaitForSnapshotAction> {

    @Override
    protected WaitForSnapshotAction doParseInstance(XContentParser parser) {
        return WaitForSnapshotAction.parse(parser);
    }

    @Override
    protected boolean supportsUnknownFields() {
        return true;
    }

    static WaitForSnapshotAction randomInstance() {
        return new WaitForSnapshotAction(randomAlphaOfLength(5));
    }

    @Override
    protected WaitForSnapshotAction createTestInstance() {
        return randomInstance();
    }

    public void testActionWithEmptyOrNullPolicy() {
        {
            IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> new WaitForSnapshotAction(""));
            assertThat(exception.getMessage(), is("policy name must be specified"));
        }

        {
            IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, () -> new WaitForSnapshotAction(null));
            assertThat(exception.getMessage(), is("policy name must be specified"));
        }
    }
}


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInitade614a4b53eb01623444dff7cb6792a::getLoader();


text:
describe "Get dashboard" do

  let(:path) { "/dashboard" }
  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  before do
    TestDataBuilder.new
      .create_consumer("Foo")
      .create_provider("Bar")
      .create_consumer_version("1.2.3")
      .create_consumer_version_tag("prod")
      .create_pact
      .create_verification(provider_version: "4.5.6", tag_names: "dev")
      .create_webhook
      .create_triggered_webhook
      .create_webhook_execution
  end

  subject { get path; last_response }

  it "returns a 200 HAL JSON response" do
    expect(subject).to be_a_hal_json_success_response
  end

  it "returns a list of items" do
    items = JSON.parse(subject.body)["items"]
    expect(items).to be_instance_of(Array)
  end
end


text:
<?php

namespace ThreadAndMirror\ProductsBundle\Service\Formatter;

use ThreadAndMirror\ProductsBundle\Entity\Product;

class YooxFormatter extends AbstractFormatter
{
	/**
	 * {@inheritdoc}
	 */
	protected function cleanupFeedName(Product $product)
	{
		$result = $this
			->format($product->getName())
			->sheerSpecial('caps')
			->sheer(' WOMEN on ', false)
			->sheer(' UNISEX on ', false)
			->sheer('s', false)
			->sheer('es', false)
			->result();

		$product->setName($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupFeedBrand(Product $product)
	{
		$result = $this
			->format($product->getBrandName())
			->name()
			->result();

		$product->setBrandName($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupFeedDescription(Product $product)
	{
		$result = $this
			->format($product->getDescription())
			->sheer(' * ', false)->append('.')
			->result();

		// Yoox descriptions are pretty naff, so ignore
		$product->setDescription('');
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupFeedPortraits(Product $product)
	{
		$result = $this
			->format($product->getImages())
			->replace('_12_', '_20_')
			->result();

		$product->setPortraits($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupFeedThumbnails(Product $product)
	{
		$result = $this
			->format($product->getImages())
			->replace('_12_', '_20_')
			->result();

		$product->setThumbnails($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledName(Product $product)
	{
		$result = $this
			->format($product->getName())
			->trim()
			->result();

		$product->setName($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledBrand(Product $product)
	{
		$result = $this
			->format($product->getBrandName())
			->name()
			->result();

		$product->setBrandName($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledPid(Product $product)
	{
		$result = $this
			->format($product->getPid())
			->result();

		$product->setPid($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledDescription(Product $product)
	{
		$result = $this
			->format($product->getDescription())
			->trim()
			->result();

		$product->setDescription($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledImages(Product $product)
	{
		$result = $this
			->format($product->getImages())
			->replace('9_f', '12_f')
			->result();

		$product->setImages($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledPortraits(Product $product)
	{

		$result = $this
			->format($product->getPortraits())
			->replace('9_f', '20_f')
			->result();

		$product->setPortraits($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledThumbnails(Product $product)
	{
		$result = $this
			->format($product->getThumbnails())
			->result();

		$product->setThumbnails($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledAvailableSizes(Product $product)
	{
		$result = $this
			->format($product->getAvailableSizes())
			->trim()
			->result();

		$product->setAvailableSizes($result);
	}

	/**
	 * {@inheritdoc}
	 */
	protected function cleanupCrawledStockedSizes(Product $product)
	{
		$result = $this
			->format($product->getStockedSizes())
			->trim()
			->result();

		$product->setStockedSizes($result);
	}
}


text:
layout: postag
title: 'NOUN'
shortdef: 'noun'
---

### Definition

Nouns (i.e. common nouns) are a part of speech typically denoting a person, place, thing,
animal or idea.

### Examples

- _pige_ "girl"
- _kat_ "cat"
- _træ_ "tree"
- _luft_ "air"
- _skønhed_ "beauty"


text:
<?php
/**
 * Created by PhpStorm.
 * User: harikrishnan
 * Date: 6/20/2017
 * Time: 11:31 AM
 */?>

                Education/Not-for-profit  -  Ecole Hoteliere De Lausanne

 <a href="<?php echo site_url(''); ?>">Home

 <a href="<?php echo site_url('resources/casestudies'); ?>">Case Studies

Ecole Hoteliere De Lausanner

Swiss Hospitality major deploys Fiorano Cloud ESB Integration Platform

Customer Profile

As the world's first hotel school, the Ecole hôtelière de Lausanne (EHL) is a leading institution that prides itself in preparing the leaders of tomorrow. EHL is an international, bilingual school, offering its programs in both English and French. It provides the solid management education of a top business school while basing its programs on its own unique educational philosophy: hospitality management as both a science and an art.

Business Problem

Over the past several years, EHL acquired substantial hardware and software infrastructure, with a data center hosting over 100 servers (both physical and virtual VMware instances), together with over 70 applications ranging from simple portlets to complex applications. The school's pillar applications include a Salesforce.com for CRM, Microsoft Dynamics AX 2010 as an ERP platform, academic and end-user portals, Microsoft Exchange for email and calendaring and Microsoft ActiveDirectory for Identity and Access Management.

To serve an increasingly larger body of students, EHL needed to automate various business processes. For instance, the automated creation of leads and prospects from EHL's website, the creation of student profiles from Admission and Enrollment information, feeding data for the automatic creation of invoices for students based on varying criteria, automatic updates of Alumni profiles from the end-user portal to the CRM system, etc.

Initial efforts focused on manual efforts with redundant logic spread across several point-to-point integrations. Batch loads made business processes difficult to document and track and reduced the visibility of information flow. Any change to a process required forced changes at multiple end-points, often performed manually, further reducing reuse potential and making business reporting even more difficult.

EHL soon realized that it needed to invest in a quality integration platform to automate business processes, increase transactional visibility and gain agility by developing capabilities to incorporate new business processes seamlessly without disrupting existing systems.

A search was initiated for a comprehensive integration platform and choices were narrowed down to Microsoft Biztalk, Mule (Open Source) and Fiorano.

                Key decision criteria included:

Zero-coding composition

Rapid debugging and deployment of integration flows

Web based monitoring tools

Scalability and Affordability

Solution

After performing Proofs-of-concept with all three products based on the above criteria, Fiorano emerged as the clear winner. "We found that developing and deploying new processes, as well as modifying and redeploying existing processes, was much faster with Fiorano in comparison with BizTalk and Mule. Fiorano also had a lower learning curve, decreasing our time to deployment significantly", said Ganasekharan Thoppe, Application Engineer, EHL.

The Fiorano ESB forms the integration layer moving data between the pillar applications. Fiorano "event processes" implement specific business processes, allowing EHL to automate operations incrementally. Testing was simplified with the help of the Fiorano Studio's sophisticated debugging capabilities. With Fiorano's peer-to-peer architecture EHL has managed to evolve it's ESB infrastructure as requirements have grown and the experience with the ESB solution has matured. In summary, Fiorano was chosen for the following reasons:

Code-free/Model-driven approach using a flow designer GUI

Faster development and debugging of event processes

Superior data integration capabilities (Web-services integration, Databases)

Web based dashboard for server monitoring

Linear Scalability

"We are very pleased with this successful deployment of the Fiorano Cloud ESB Integration Platform. With widespread adoption of SaaS, many organizations are finding it difficult to integrate their on-premise applications with their cloud solutions. Open source cloud integration falls short in scalability and security.
                        Fiorano's enterprise-class integration platform enables rapid deployment of business solutions while laying the foundation for an extensible SOA infrastructure."

                    Atul Saini,

                    CEO & CTO,

                    Fiorano Software.

About Fiorano Software

                    Founded in 1995, Fiorano is a trusted provider of enterprise integration middleware, high performance messaging and distributed systems. Fiorano's innovative event-driven SOA platform integrates applications and complex technologies into an enterprise nervous system. Fiorano's hybrid Cloud-ESB integrates applications across SaaS, PaaS and on-premise worlds.

                    Global leaders including Federal Bank, Commercial Bank of Africa, NASA, US Coast Guard, POSCO, British Telecom, AT&T Labs, Vodafone and L'Oréal have deployed Fiorano's solutions to drive innovation through open, standards-based, event-driven SOA applications yielding unprecedented productivity.

<img src="<?php echo __IMAGES__?>/ehl_logo.jpg" />

                "We found that developing and deploying new processes, as well as modifying and redeploying existing processes, was much faster with Fiorano in comparison with BizTalk and Mule. Fiorano also had a lower learning curve, decreasing our time to deployment significantly."

                    Ganasekharan Thoppe,

                    Application Engineer,

                    Ecole hôtelière de Lausanne.

                    <img src="<?php echo base_url('assets/images/casestudies/casestudy-download-pdf.jpg')?>" class="img-responsive">

            <img class="img-responsive" src="<?php echo base_url('assets/images/casestudies/casestudy-bottom-image.jpg')?>" class="text-center">


text:
<?php
namespace Cobase\AppBundle\Twig\Extensions;

use Cobase\AppBundle\Entity\Post;

use Cobase\AppBundle\Service\PostService;
use Cobase\AppBundle\Service\UserService;
use Twig_Extension;
use Twig_Environment;

class Like extends Twig_Extension
{
    /**
     * @var Twig_Environment
     */
    private $twig;

    /**
     * @var UserService
     */
    private $userService;

    /**
     * @var PostService
     */
    private $postService;

    /**
     * @param Twig_Environment  $twig
     * @param UserService       $userService
     * @param PostService       $postService
     */
    public function __construct(Twig_Environment $twig, UserService $userService, PostService $postService)
    {
        $this->twig         = $twig;
        $this->userService  = $userService;
        $this->postService  = $postService;
    }

    /**
     * @return array
     */
    public function getFunctions()
    {
        return array(
            'cobase_likes' => new \Twig_Function_Method(
                $this, 'likes', array('is_safe' => array('html') )
            ),
        );
    }

    /**
     * @param Post $post
     *
     * @return string
     */
    public function likes(Post $post)
    {
        return $this->twig->render('CobaseAppBundle:Twig:likes.html.twig', array(
            'user'      => $this->userService->getCurrentUser(),
            'post'      => $post,
            'likeCount' => $this->postService->getLikeCount($post),
        ) );
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'Cobase_app_like';
    }
}


text:
@interface JotHighlighterBrushTexture : JotBrushTexture

+ (JotBrushTexture*)sharedInstance;

@end


text:
module Experian
  class Error < StandardError

    def self.message(code)
      "Experian: " + (codes[code] || "Error Code #{code}")
    end

    # Experian has hundreds of codes documented, only populated small set
    def self.codes
      {
        1 => "System temporarily unavailable. Please resubmit",
        53 => "Invalid social security number"
      }
    end
  end

  class ClientError < Error; end
  class ArgumentError < ClientError; end
  class Forbidden < ClientError; end
  class ServerError < Error; end
  class AuthenticationError < Error; end

end


text:
Quadro allows you to run one-off tasks from the command line.

```sh
node app.js task demo
```

The command above will execute the file `tasks/demo.js` within the application context
and immediately terminate.

It is very similar to *rake tasks*.

That is cool because you can just a task as easy as:

```js
// tasks/demo.js
module.exports = async function(log, server) {
  let serverStatus = await server.getStatus()
  log.info({ serverStatus }, 'Current server status')
}
```

**NOTE** all the dependencies are injected into the task, so you can do
whatever business logic you want within it.


text:
// ReSharper disable once CheckNamespace
namespace MahApps.Metro
{
    using System.Collections.Generic;

    /// <summary>
    /// A class that allows for the detection and alteration of a theme.
    /// </summary>
    public static partial class ThemeManager
    {
        // Note: add more checks if these keys aren't sufficient
        private static readonly List<string> styleKeys = new List<string>(new[]
                                                                          {
                                                                              "HighlightColor",
                                                                              "AccentBaseColor",
                                                                              "HighlightBrush",
                                                                              "AccentBaseColorBrush"
                                                                          });
    }
}


text:
import unittest

from tuskar.templates import namespace

class NamespaceTests(unittest.TestCase):

    def test_apply_template_namespace(self):
        namespaced = namespace.apply_template_namespace('test-ns', 'test-name')
        self.assertEqual(namespaced, 'test-ns::test-name')
        self.assertTrue(namespace.matches_template_namespace('test-ns',
                                                             namespaced))

    def test_remove_template_namespace(self):
        stripped = namespace.remove_template_namespace('test-ns::test-name')
        self.assertEqual(stripped, 'test-name')

    def test_matches_template_namespace(self):
        value = 'test-ns::test-name'
        self.assertTrue(namespace.matches_template_namespace('test-ns', value))
        self.assertFalse(namespace.matches_template_namespace('fake', value))

    def test_apply_resource_alias_namespace(self):
        namespaced = namespace.apply_resource_alias_namespace('compute')
        self.assertEqual(namespaced, 'Tuskar::compute')

    def test_remove_resource_alias_namespace(self):
        stripped = namespace.remove_resource_alias_namespace(
            'Tuskar::controller')
        self.assertEqual(stripped, 'controller')


text:
class UsersController < ApplicationController
  before_action :authenticate_user!

    def users_only
      render json: {
        data: {
          message: "Welcome #{current_user.name}",
          user: current_user
        }
      }, status: 200
    end
end


text:
define(function (require, exports) {
    "use strict";

    var PlayObject = require("../playObject");

    /**
     * _ref object for photoshop custom settings
     *
     * @private
     * @type {Object}
     */
    var _customPrefRef = {
        _ref: [
            { _ref: "property", _property: "customPreference" },
            { _ref: "application", _enum: "ordinal", _value: "targetEnum" }
        ]
    };

    /**
     * Build a play object that will fetch a Photoshop custom preference at the given key
     *
     * @param {string} key
     * @return {PlayObject}
     */
    var getCustomPreference = function (key) {
        var desc = {
            null: _customPrefRef,
            keyword: key
        };
        return new PlayObject("get", desc);
    };

    /**
     * Build a play object that will set a Photoshop custom preference key value pair
     *
     * The value is expected to be a simple object
     *
     * @param {string} key
     * @param {object} value
     * @param {boolean=} persistent Optional, defaults to true
     * @return {PlayObject}
     */
    var setCustomPreference = function (key, value, persistent) {
        var desc = {
                null: _customPrefRef,
                keyword: key,
                persistent: persistent === undefined ? true : !!persistent
            },
            obj = {
                _obj: "object",
                _value: value
            };

        desc[key] = obj;
        return new PlayObject("set", desc);
    };

    exports.getCustomPreference = getCustomPreference;
    exports.setCustomPreference = setCustomPreference;
});


text:
package structural.decorator;

import structural.businessobjects.IceCream;

public abstract class IceCreamDecorator implements IceCream {

	protected IceCream specialIceCream;

	// Constructor Injection.
	public IceCreamDecorator(IceCream iceCream) {
		this.specialIceCream = iceCream;
	}

	public abstract String makeIceCream();
}


text:
@protocol JavaIoObjectInputValidation < NSObject, JavaObject >

- (void)validateObject;

@end

J2OBJC_EMPTY_STATIC_INIT(JavaIoObjectInputValidation)

J2OBJC_TYPE_LITERAL_HEADER(JavaIoObjectInputValidation)

#endif // _JavaIoObjectInputValidation_H_


text:
    <mat-card fxLayout="column" fxFlex="100" fxFlex.sm="80" fxFlex.gt-sm="40">
        <mat-card-content>

                <mat-form-field fxFlex="100" tdFileDrop (fileDrop)="files = $event" (click)="fileInput.inputElement.click()" (keyup.enter)="fileInput.inputElement.click()" (keyup.delete)="fileInput.clear()" (keyup.backspace)="fileInput.clear()" flex>
                    <input #fileInput matInput [placeholder]="'upload.label' | translate" value="{{fileInputValue}}" readonly/>
                </mat-form-field>
                <button mat-icon-button *ngIf="files" (click)="fileInput.clear()" (keyup.enter)="fileInput.clear()">
                    <mat-icon>cancel</mat-icon>
                </button>

                        <mat-icon>folder</mat-icon>
                        {{ 'upload.browse' | translate }}

        </mat-card-content>

            <button mat-raised-button color="accent" (click)="pushFiles()" [disabled]="!files">{{ 'upload.button' | translate }}</button>

        <mat-card-footer class="mat-card-no-margin" *ngIf="files">

            <mat-progress-bar color="primary" mode="determinate" value="{{0 || upload?.progress }}">
            </mat-progress-bar>

        </mat-card-footer>
    </mat-card>


text:
package usingflume.ch07;

import com.google.common.collect.Lists;
import org.apache.flume.Channel;
import org.apache.flume.ChannelSelector;
import org.apache.flume.Context;
import org.apache.flume.Source;
import org.apache.flume.Transaction;
import org.apache.flume.channel.ChannelProcessor;
import org.apache.flume.channel.MemoryChannel;
import org.apache.flume.channel.ReplicatingChannelSelector;
import org.apache.flume.conf.Configurables;
import org.apache.flume.source.AvroSource;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

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

@RunWith(Parameterized.class)
public class TestUsingFlumeLBRPCApp {

  private final boolean compress, ssl;

  @Parameterized.Parameters
  public static Collection<Object[]> inputs() {
    List<Object[]> params = Lists.newArrayList();
    params.add(new Object[]{false, false});
    params.add(new Object[]{true, false});
    params.add(new Object[]{false, true});
    params.add(new Object[]{true, true});
    return params;
  }

  public TestUsingFlumeLBRPCApp(boolean compress, boolean ssl) {
    this.compress = compress;
    this.ssl = ssl;
  }

  @Test
  public void testRPCClient() throws Exception {
    final List<Source> sources = Lists.newArrayList();
    final List<Channel> channels = Lists.newArrayList();

    List<String> args = Lists.newArrayList();

    StringBuilder hosts = new StringBuilder();
    for(int i = 0; i < 3; i++) {
      final int port = 41434 + i;
      final Source source = new AvroSource();
      sources.add(source);
      final MemoryChannel channel = new MemoryChannel();
      channels.add(channel);
      Context ctx = new Context();
      ctx.put("capacity", "100000");
      ctx.put("transactionCapacity", "100000");
      Configurables.configure(channel, ctx);
      List<Channel> srcChannels = new ArrayList<Channel>();
      srcChannels.add(channel);
      ChannelSelector rcs = new ReplicatingChannelSelector();
      rcs.setChannels(srcChannels);
      source.setChannelProcessor(new ChannelProcessor(rcs));
      ctx.put("bind", "0.0.0.0");
      ctx.put("port", String.valueOf(port));

      hosts.append("0.0.0.0:" + String.valueOf(port) + ",");
      if (compress) {
        ctx.put("compression-type", "deflate");
      }
      if (ssl) {
        ctx.put("ssl", "true");
        ctx.put("keystore", getClass().getResource("/server.p12").getFile());
        ctx.put("keystore-password", "password");
        ctx.put("keystore-type", "PKCS12");
      }
      Configurables.configure(source, ctx);
      channel.start();
      source.start();

    }
    args.add("-r");
    args.add(hosts.toString());
    if (compress) {
      args.add("-c");
    }
    if (ssl) {
      args.add("-s");
      args.add("-k");
      args.add(getClass().getResource("/server.p12").getFile());
      args.add("-d");
      args.add("password");
      args.add("-t");
      args.add("PKCS12");
    }
    Thread.sleep(2000);
    String[] argsArray = args.toArray(new String[0]);
    UsingFlumeLBRPCApp.main(argsArray);
    for(Source source : sources){
      source.stop();
    }
    int i = 0;
    for(Channel channel : channels) {
      Transaction tx = channel.getTransaction();
      tx.begin();

      while (channel.take() != null) {
        i++;
      }
      tx.commit();
      tx.close();
    }
    // 5 threads, each thread 100 transactions of 100 events each
    Assert.assertEquals(50000, i);
  }
}


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

namespace SimplyFast.Collections
{
    public class FastCollection<T> : ICollection<T>, IReadOnlyList<T>
    {
        private T[] _array;
        private int _count;

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public FastCollection(int capacity)
        {
            _array = capacity > 0? new T[capacity] : TypeHelper<T>.EmptyArray;
        }

        public FastCollection(IEnumerable<T> items)
        {
            var col = items as IReadOnlyCollection<T>;
            if (col != null)
            {
                _array = new T[col.Count];
                AddRange(col, col.Count);
            }
            else
            {
                _array = TypeHelper<T>.EmptyArray;
                foreach (var item in items)
                {
                    Add(item);
                }
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public FastCollection()
        {
            _array = TypeHelper<T>.EmptyArray;
        }

        public T this[int index]
        {
            get { return _array[index]; }
            set { _array[index] = value; }
        }

        public T[] Buffer => _array;

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public IEnumerator<T> GetEnumerator()
        {
            for (var i = 0; i < _count; i++)
            {
                yield return _array[i];
            }
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Add(T item)
        {
            if (_array.Length == _count)
                Array.Resize(ref _array, _count == 0 ? 4 : _count * 2);
            _array[_count++] = item;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void Clear()
        {
            if (TypeHelper<T>.IsReferenceType)
                Array.Clear(_array, 0, _count);
            _count = 0;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Contains(T item)
        {
            return IndexOf(item) >= 0;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void CopyTo(T[] array, int arrayIndex)
        {
            Array.Copy(_array, 0, array, arrayIndex, _count);
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool Remove(T item)
        {
            var index = IndexOf(item);
            if (index < 0)
                return false;
            RemoveAt(index);
            return true;
        }

        public int Count => _count;

        public int Capacity
        {
            get { return _array.Length; }
            set
            {
                if (value < _count)
                    throw new InvalidOperationException("Collection has more elements that requested capacity");
                var arr = new T[value];
                Array.Copy(_array, 0, arr, 0, _count);
                _array = arr;
            }
        }

        public bool IsReadOnly => false;

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public int IndexOf(T item)
        {
            return Array.IndexOf(_array, item, 0, _count);
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void RemoveAt(int i)
        {
            _count--;
            _array[i] = _array[_count];
            if (TypeHelper<T>.IsReferenceType)
                _array[_count] = default(T);
        }

        public void AddRange(T[] items, int index, int count)
        {
            if (_count + count > _array.Length)
                Capacity = Math.Max(_array.Length * 2, _count + count);

            Array.Copy(items, index, _array, _count, count);
            _count += count;
        }

        public void AddRange(T[] items, int count)
        {
            AddRange(items, 0, count);
        }

        public void AddRange(IEnumerable<T> items, int count)
        {
            if (_count + count > _array.Length)
                Capacity = Math.Max(_array.Length * 2, _count + count);

            var c = _count;
            var i = 0;
            foreach (var item in items)
            {
                if (i == count)
                    break;
                _array[c] = item;
                c++;
                i++;
            }
            _count += i;
        }

        public void RemoveAll(Func<T, bool> remove)
        {
            var c = _count;
            var i = 0;
            while (i < c)
            {
                if (remove(_array[i]))
                {
                    c--;
                    _array[i] = _array[c];
                    if (TypeHelper<T>.IsReferenceType)
                        _array[c] = default(T);
                }
                else
                {
                    ++i;
                }
            }
            _count = c;
        }

        //public void Insert(int index, T item)
        //{
        //    var count = _count;
        //    if (index < 0 || index > count)
        //        throw new IndexOutOfRangeException();
        //    if (index == count)
        //    {
        //        Add(item);
        //    }
        //    else if (_array.Length == count)
        //    {
        //        var arr = new T[count * 2];
        //        if (index != 0)
        //            Array.Copy(_array, 0, arr, 0, index);
        //        Array.Copy(_array, index, arr, index + 1, count - index);
        //        arr[index] = item;
        //        _count = count + 1;
        //        _array = arr;
        //    }
        //    else
        //    {
        //        Array.Copy(_array, index, _array, index + 1, count - index);
        //        _array[index] = item;
        //        _count = count + 1;
        //    }
        //}
    }
}


text:
package org.qfox.jestful.weixin.media;

import org.qfox.jestful.weixin.BaseResult;

/**
 * 微信公众号永久素材数量结果
 *
 * @author 杨昌沛 646742615@qq.com
 * @date 2018-03-08 14:27
 **/
public class MaterialCountResult extends BaseResult {
    private int voice_count;
    private int video_count;
    private int image_count;
    private int news_count;

    public int getVoice_count() {
        return voice_count;
    }

    public void setVoice_count(int voice_count) {
        this.voice_count = voice_count;
    }

    public int getVideo_count() {
        return video_count;
    }

    public void setVideo_count(int video_count) {
        this.video_count = video_count;
    }

    public int getImage_count() {
        return image_count;
    }

    public void setImage_count(int image_count) {
        this.image_count = image_count;
    }

    public int getNews_count() {
        return news_count;
    }

    public void setNews_count(int news_count) {
        this.news_count = news_count;
    }

    @Override
    public String toString() {
        return "MaterialCountResult{" +
                "voice_count=" + voice_count +
                ", video_count=" + video_count +
                ", image_count=" + image_count +
                ", news_count=" + news_count +
                "} " + super.toString();
    }
}


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

<title>org.datavec.hadoop.conf</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.datavec.hadoop.conf

Class Summary

Class
Description

ConfigurationUtil

Notes

 https://linuxjunkies.wordpress.com/2011/11/21/a-hdfsclient-for-hadoop-using-the-native-java-api-a-tutorial/

 Design Ideas

        -       Need a DataVec Conf entry:
                -       hadoop.configuration.path
                        -       example: hadoop.configuration.path=/home/hadoop/hadoop/conf/

TestConfigurationUtil

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
			<?php echo __('Database'); ?>

<a class="irfrsh" href="javascript:objectsRefresh()" title="<?php echo __('Refresh database object list'); ?>"><?php echo __('Refresh'); ?>

<a href="javascript:dbCreate()" title="<?php echo __('Create a new database'); ?>"><?php echo __('Create new'); ?>...

<a class="ibatch" href="javascript:dbBatch()" title="<?php echo __('Perform one or more batch operations on database'); ?>"><?php echo __('Batch operations'); ?>...

<a class="iexpdb" href="javascript:dataExport()" title="<?php echo __('Export database to external file'); ?>"><?php echo __('Export'); ?>...

			<?php echo __('Objects'); ?>

<a class="itable" href="javascript:tableCreate()" title="<?php echo __('Create a new table in the database'); ?>"><?php echo __('Create Table'); ?>...

<a class="itable" href="javascript:javascript:objCreate(0)" title="<?php echo __('Create a new table in the database'); ?>"><?php echo __('Create Table'); ?>...

<a class="iview" href="javascript:objCreate(1)" title="<?php echo __('Create a new view in the database'); ?>"><?php echo __('Create View'); ?>...

<a class="iproc" href="javascript:objCreate(2)" title="<?php echo __('Create a new stored procedure in the database'); ?>"><?php echo __('Create Stored Procedure'); ?>...

<a class="ifunc" href="javascript:objCreate(3)" title="<?php echo __('Create a new user defined function in the database'); ?>"><?php echo __('Create Function'); ?>...

<a class="itrig" href="javascript:objCreate(4)" title="<?php echo __('Create a new trigger in the database'); ?>"><?php echo __('Create Trigger'); ?>...

<a class="ievt" href="javascript:objCreate(5)" title="<?php echo __('Create a new event in the database'); ?>"><?php echo __('Create Event'); ?>...

<a class="ischm" href="javascript:objCreate(6)" title="<?php echo __('Create a new schema in the database'); ?>"><?php echo __('Create Schema'); ?>...

			<?php echo __('Data'); ?>

<a class="iimprt" href="javascript:dataImport()" title="<?php echo __('Import multiple queries from batch file'); ?>"><?php echo __('Import batch file'); ?>...

<a class="iimprt" href="javascript:tableImport()" title="<?php echo __('Import table data from external file'); ?>"><?php echo __('Import table data'); ?>...

<a class="iexpdb" href="javascript:dataExport()" title="<?php echo __('Export database to batch file as sql dump'); ?>"><?php echo __('Export database'); ?>...

<a class="iexprt" href="javascript:resultsExport()" title="<?php echo __('Export query results to clipboard or files'); ?>"><?php echo __('Export current results'); ?>...

<a class="iexpdb" href="javascript:dataBackup()" title="<?php echo __('Backup database on the server as sql dump'); ?>"><?php echo __('Backup Database'); ?>...

			<?php echo __('Tools'); ?>

<a class="itdb" href="javascript:toolsDbManager()" title="<?php echo __('Manage databases'); ?>"><?php echo __('Database Manager'); ?>

<a class="itprc" href="javascript:toolsProcManager()" title="<?php echo __('View and manage database processes'); ?>"><?php echo __('Process Manager'); ?>

<a class="itusr" href="javascript:toolsUsers()" title="<?php echo __('Manage database users'); ?>"><?php echo __('User Manager'); ?>

<a class="itchk" href="javascript:toolsDbCheck()" title="<?php echo __('Analyze and repair database tables'); ?>"><?php echo __('Repair Tables'); ?>

<a class="itsrch" href="javascript:toolsDbSearch()" title="<?php echo __('Search for text in the database'); ?>"><?php echo __('Search in Database'); ?>

<a class="itopts" href="javascript:toolsOptions()" title="<?php echo __('Configure application options'); ?>"><?php echo __('Options'); ?>

			<?php echo __('Information'); ?>

<a href="javascript:infoServer()" title="<?php echo __('View mysql server and connection details'); ?>"><?php echo __('Server/Connection Details'); ?>

<a href="javascript:infoVariables()" title="<?php echo __('View mysql server variables'); ?>"><?php echo __('Server Variables'); ?>

<a href="javascript:infoDatabase()" title="<?php echo __('View current database summary stats'); ?>"><?php echo __('Database Summary'); ?>

			<?php echo __('Interface'); ?>

<?php echo __('UI Theme'); ?>

						{{THEMES_MENU}}

<?php echo __('Language'); ?>

						{{LANGUAGE_MENU}}

<?php echo __('SQL Editor'); ?>

						{{EDITOR_MENU}}

<?php echo __('Show/Hide Panel'); ?>

<a href="javascript:main_layout.toggle('west')" title="<?php echo __('Toggle Object Viewer'); ?>"><?php echo __('Database Objects'); ?>

<a href="javascript:data_layout.toggle('south')" title="<?php echo __('Toggle SQL Editor'); ?>"><?php echo __('SQL Editor'); ?>

			<?php echo __('Help'); ?>

<a class="ihlp" href="javascript:helpShowAll()" title="<?php echo __('Learn the basics of using MyWebSQL'); ?>"><?php echo __('Help contents'); ?>

<a class="itutor" href="javascript:helpQuickTutorial()" title="<?php echo __('See quick hands-on tutorial of MyWebSQL interface'); ?>"><?php echo __('QuickStart Tutorials'); ?>

<a class="idocs" href="javascript:helpOnlineDocs()" title="<?php echo __('View online documentation on project website'); ?>"><?php echo __('Online documentation'); ?>

<a class="iftr" href="javascript:helpRequestFeature()" title="<?php echo __('If you would like your most favourite feature to be part of MyWebSQL, please click here to inform about it'); ?>"><?php echo __('Request a Feature'); ?>...

<a class="ibug" href="javascript:helpReportBug()" title="<?php echo __('If you have found a problem, or having trouble using the application, please click here to report the problem'); ?>"><?php echo __('Report a Problem'); ?>

<a href="javascript:helpCheckUpdates()" title="<?php echo __('Check for updated versions of the application online'); ?>"><?php echo __('Check for updates'); ?>

<a class="ilgout" href="javascript:logout()" title="<?php echo __('Logout from this session'); ?>"><?php echo __('Logout'); ?>


text:
using System;
using System.Diagnostics;
using CompareSimpleMaths.Contracts;

namespace CompareSimpleMaths.Models
{
    public static class SimpleMathOperationTestTime
    {
        public static void TestMathOperation(ILogger logger, Action methodToTest)
        {
            Stopwatch sw = Stopwatch.StartNew();

            for (long i = 0; i < 10000000; i++)
            {
                methodToTest();
            }

            sw.Stop();

            logger.Log(sw.Elapsed.ToString());
        }
    }
}


text:
Rails.application.routes.draw do
  devise_for :admins
  devise_for :users

  authenticated :admin do
    root to: 'admins/feeds#index', as: :authenticated_root
  end

  devise_scope :admin do
    get 'admin', to: 'devise/sessions#new'
  end

  namespace :admins do
    resources :categories
    resources :feeds
  end

  resources :home, only: :index
  root to: 'home#index'
end