text:
var SocketPeer = require('../browser');
var test = require('tape');

test('connect_attempt event gets emitted', function (t) {
  var peer = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    reconnect: false,
    timeout: 0
  });

  peer.on('connect_attempt', function () {
    t.ok(true, 'got connect_attempt event');
    t.equal(peer.socketConnected, false, 'peer.socketConnected');
    t.equal(peer._connections.socket.attempt, 1, 'peer._connections.socket.attempt');
    t.equal(peer._connections.socket.success, 0, 'peer._connections.socket.success');
    t.equal(peer._connections.socket.error, 0, 'peer._connections.socket.error');
    peer.destroy();
    t.end();
  });

  peer.on('error', function (err) {
    console.warn('Ignoring error: %s', err.message);
  });
});

test('basic lifecycle', function (t) {
  var peer1 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    reconnect: false
  });

  var peer2 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    reconnect: false
  });

  peer1.on('connect', function () {
    t.equal(peer1.socketConnected, true, 'peer1.socketConnected');
    t.equal(peer1._connections.socket.attempt, 0, 'peer1._connections.socket.attempt');
    t.equal(peer1._connections.socket.success, 1, 'peer1._connections.socket.success');
    t.equal(peer1._connections.socket.error, 0, 'peer1._connections.socket.error');
    tryConnect();
  });
  peer2.on('connect', function () {
    t.equal(peer2.socketConnected, true, 'peer2.socketConnected');
    t.equal(peer2._connections.socket.attempt, 0, 'peer2._connections.socket.attempt');
    t.equal(peer2._connections.socket.success, 1, 'peer2._connections.socket.success');
    t.equal(peer2._connections.socket.error, 0, 'peer2._connections.socket.error');
    tryConnect();
  });

  function tryConnect () {
    if (peer1.socketConnected && peer2.socketConnected) {
      t.ok(true, 'connected');

      peer1.send('ping');

      peer2.on('data', function (data) {
        if (data === 'ping') {
          t.ok(true, 'peer2 ping');
          peer2.send('pong');
        }
      });

      peer1.on('data', function (data) {
        if (data === 'pong') {
          t.ok(true, 'peer1 pong');

          peer1.destroy();
          peer2.destroy();

          t.end();
        }
      });
    }
  }
});

test('connect_timeout event gets emitted', function (t) {
  var peer = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    timeout: 500
  });

  peer.on('connect_timeout', function () {
    t.ok(true, 'got connect_timeout event');
    t.equal(peer.socketConnected, false, 'peer.socketConnected');
  });

  peer.on('connect_error', function () {
    t.ok(true, 'got connect_error event');
  });

  peer.on('error', function () {
    t.ok(true, 'got error event');
    t.equal(peer._connections.socket.attempt, 1, 'peer._connections.socket.attempt');
    t.equal(peer._connections.socket.success, 0, 'peer._connections.socket.success');
    t.equal(peer._connections.socket.error, 1, 'peer._connections.socket.error');
    peer.destroy();
    t.end();
  });
});

test('message sent over WebSocket when RTC peer disconnects', function (t) {
  var peer1 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    reconnect: false
  });

  var peer2 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/',
    reconnect: false
  });

  peer1.on('upgrade', tryUpgrade);
  peer2.on('upgrade', tryUpgrade);

  function tryUpgrade () {
    if (peer1.rtcConnected && peer2.rtcConnected) {
      t.ok(true, 'connected');
      sendPing();
    }
  }

  function sendPing () {
    peer1.send('ping');

    peer2.on('data', function (data) {
      if (data === 'ping') {
        t.ok(true, 'peer2 ping');
        sendPong();
      }
    });
  }

  function sendPong () {
    peer2.on('downgrade', function () {
      t.equal(peer2.rtcConnected, false, 'peer2.rtcConnected');

      peer2.send('pong');
      peer1.on('data', function (data) {
        t.equal(peer1.rtcConnected, false, 'peer1.rtcConnected');

        if (data === 'pong') {
          t.ok(true, 'peer1 pong');

          peer1.destroy();
          peer2.destroy();

          t.end();
        }
      });
    });

    peer2.destroyPeer();
  }
});

test('socket reconnects', function (t) {
  var peer1 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/'
  });

  var peer2 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/'
  });

  peer1.once('connect', tryConnect);
  peer2.once('connect', tryConnect);

  function tryConnect () {
    if (peer1.socketConnected && peer2.socketConnected) {
      t.ok(true, 'connected');

      peer1.once('reconnect', function () {
        t.equal(peer1.socketConnected, true, 'peer1.socketConnected');
        t.equal(peer2.socketConnected, true, 'peer2.socketConnected');

        peer1.destroy();
        peer2.destroy();
        t.end();
      });

      setTimeout(function () {
        peer1.socket.close();
      }, 0);
    }
  }
});

test('WebRTC reconnects', function (t) {
  var peer1 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/'
  });

  var peer2 = new SocketPeer({
    pairCode: 'yolo',
    url: 'http://localhost:3000/socketpeer/'
  });

  peer1.once('upgrade', tryUpgrade);
  peer2.once('upgrade', tryUpgrade);

  function tryUpgrade () {
    if (peer1.rtcConnected && peer2.rtcConnected) {
      t.ok(true, 'upgrade');

      peer1.once('downgrade', function () {
        t.ok(true, 'downgrade');

        t.equal(peer1.rtcConnected, false, 'peer1.rtcConnected');
      });

      peer1.once('upgrade', function () {
        t.ok(true, 'upgrade');

        t.equal(peer1.rtcConnected, true, 'peer1.rtcConnected');

        peer1.destroy();
        peer2.destroy();
        t.end();
      });

      peer1.destroyPeer();
    }
  }
});


text:
package net.authorize.util;

import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

import net.authorize.ResponseField;

/**
 * Parses a response string from Authorize.net into a Map of values.
 */
public class ResponseParser {

	/**
	 * Take a string and parses it into a Map keyed on ResponseFields.
	 *
	 * @param responseString
	 * @return Map<ResponseField,String> of response values.
	 */
	public static Map<ResponseField, String> parseResponseString(String responseString) {
		return parseResponseString(responseString, net.authorize.sim.Transaction.TRANSACTION_FIELD_DELIMITER);
	}

	/**
	 * Take a string and parses it into a Map keyed on ResponseFields.
	 *
	 * @param responseString
	 * @param delimiter
	 * @return Map<ResponseField,String> of response values.
	 */
	public static Map<ResponseField, String> parseResponseString(String responseString, String delimiter) {

		Map<ResponseField, String> responseMap = new HashMap<ResponseField, String>();

		StringTokenizer st = new StringTokenizer(responseString, delimiter, true);

		int order = 0;
		while(st.hasMoreTokens()) {
			String token = st.nextToken();
			ResponseField responseField = ResponseField.get(++order);
			if(responseField != null) {
				if(delimiter.equals(token)) {
					responseMap.put(responseField, "");
				} else {
					responseMap.put(responseField, token.replaceAll(delimiter, ""));
					if (st.hasMoreTokens()) {
						st.nextToken(); // skip delimiter
					}
				}
			}
		}

		return responseMap;
	}

}

redpajama_set_name: RedPajamaGithub


text:
#pragma once

#include <primitives/filesystem.h>

#include <unordered_map>

#define STAMPS_DIR "stamps"
#define STORAGE_DIR "storage"
#define CPPAN_FILENAME "cppan.yml"

using Stamps = std::unordered_map<path, fs::file_time_type>;
using SourceGroups = std::map<String, std::set<String>>;

path get_root_directory();
path get_config_filename();

path temp_directory_path(const path &subdir = path());
path get_temp_filename(const path &subdir = path());

String get_stamp_filename(const String &prefix);
String make_archive_name(const String &fn = String());

path findRootDirectory(const path &p);


text:
/**************************************************************/
/* ********************************************************** */
/* *                                                        * */
/* *             PROOF CHECKING                             * */
/* *                                                        * */
/* *  Copyright (C) 1998, 1999, 2000, 2001                  * */
/* *  MPI fuer Informatik                                   * */
/* *                                                        * */
/* *  This program is free software; you can redistribute   * */
/* *  it and/or modify it under the terms of the GNU        * */
/* *  General Public License as published by the Free       * */
/* *  Software Foundation; either version 2 of the License, * */
/* *  or (at your option) any later version.                * */
/* *                                                        * */
/* *  This program is distributed in the hope that it will  * */
/* *  be useful, but WITHOUT ANY WARRANTY; without even     * */
/* *  the implied warranty of MERCHANTABILITY or FITNESS    * */
/* *  FOR A PARTICULAR PURPOSE.  See the GNU General Public * */
/* *  License for more details.                             * */
/* *                                                        * */
/* *  You should have received a copy of the GNU General    * */
/* *  Public License along with this program; if not, write * */
/* *  to the Free Software Foundation, Inc., 59 Temple      * */
/* *  Place, Suite 330, Boston, MA  02111-1307  USA         * */
/* *                                                        * */
/* $Revision: 21527 $                                        * */
/* $State$                                            * */
/* $Date: 2005-04-25 00:10:28 -0400 (Mon, 25 Apr 2005) $                             * */
/* $Author: duraid $                                       * */
/* *                                                        * */
/* *                                                        * */
/* *             Contact:                                   * */
/* *             Christoph Weidenbach                       * */
/* *             MPI fuer Informatik                        * */
/* *             Stuhlsatzenhausweg 85                      * */
/* *             66123 Saarbruecken                         * */
/* *             Email: weidenb@mpi-sb.mpg.de               * */
/* *             Germany                                    * */
/* *                                                        * */
/* ********************************************************** */

/* $RCSfile$ */

#ifndef _PROOFCHECK_H_
#define _PROOFCHECK_H_

#include "options.h"

#include <string.h>
#include <ctype.h>
#include <math.h>
#include "list.h"
#include "vector.h"

#include "misc.h"
#include "dfg.h"
#include "foldfg.h"
#include "flags.h"
#include "clause.h"
#include "tableau.h"
#include "search.h"
#include "dfg.h"

LIST  pcheck_ReduceSPASSProof(LIST);
char* pcheck_GenericFilename(const char*, const char*);
int   pcheck_SeqProofDepth(LIST);
void  pcheck_DeleteProof(LIST);
BOOL  pcheck_BuildTableauFromProof(LIST, TABLEAU*);
LIST  pcheck_ConvertTermListToClauseList(LIST, FLAGSTORE, PRECEDENCE);
void  pcheck_TableauToProofTask(TABLEAU, const char*, const char*);
BOOL  pcheck_TableauProof(TABLEAU*, LIST);
LIST  pcheck_ParentPointersToParentNumbers(LIST);
LIST  pcheck_ConvertParentsInSPASSProof(PROOFSEARCH, LIST);
void  pcheck_MarkRecursive(LIST);
LIST  pcheck_ClauseNumberMergeSort(LIST);
void  pcheck_ClauseListRemoveFlag(LIST, CLAUSE_FLAGS);

#endif


text:
<resources>

    <string name="app_name">iconkit-demo</string>
	<string name="github">tank000/iconkit</string>
</resources>


text:
<?php

namespace SCRUM\SwiftairBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class PassagiersType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('naam')
            ->add('voornaam')
            ->add('adres')
            ->add('rijksregister')
            ->add('geboortedatum', 'date', array('years' => range(date('Y'), date('Y') - 100)))
            ->add('bagage', 'checkbox', array('required' => false))
            ->add('verzekering', 'checkbox', array('required' => false))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'SCRUM\SwiftairBundle\Entity\Passagiers'
        ));
    }

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


text:
import unittest
from random import randint

from reobject.exceptions import DoesNotExist, MultipleObjectsReturned
from reobject.models import Model, Field
from reobject.query import QuerySet, EmptyQuerySet

class SomeModel(Model):
    p = Field()
    q = Field(default=lambda: randint(1, 10000))
    r = Field(default=None)

class TestQuerySet(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        SomeModel.objects.all().delete()

    def test_pipe(self):
        SomeModel(p='foo')
        SomeModel(p='bar')

        self.assertEqual(
            (
                SomeModel.objects.filter(p='foo') | SomeModel.objects.filter(p='bar')
            ).order_by('q'),
            SomeModel.objects.all().order_by('q')
        )

    def test_count(self):
        SomeModel(p='foo')
        SomeModel(p='bar')

        self.assertEqual(SomeModel.objects.filter().count(), 2)

    def test_manager_count(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        self.assertEqual(SomeModel.objects.count(), 2)

    def test_delete(self):
        SomeModel(p='foo')
        SomeModel(p='bar')

        _len, _type = SomeModel.objects.filter(p='bar').delete()
        self.assertFalse(SomeModel.objects.filter(p='bar').exists())
        self.assertEqual(_len, 1)
        self.assertEqual(_type, {'SomeModel': 1})

    def test_distinct(self):
        SomeModel(p='foo')
        SomeModel(p='foo')
        SomeModel(p='foo')

        self.assertEqual(SomeModel.objects.filter().distinct('p').count(), 1)
        self.assertEqual(SomeModel.objects.filter().distinct('q').count(), 3)
        self.assertEqual(SomeModel.objects.filter().distinct('p', 'q').count(), 3)
        self.assertEqual(SomeModel.objects.filter().distinct('q', 'p').count(), 3)

    def test_earliest(self):
        obj = SomeModel.objects.earliest()
        self.assertIsNone(obj)

        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=0)

        obj = SomeModel.objects.earliest()

        self.assertEqual(obj.p, 'foo')

    def test_exists(self):
        SomeModel(p='foo')

        self.assertTrue(SomeModel.objects.filter(p='foo').exists())
        self.assertFalse(SomeModel.objects.filter(p='bar').exists())

    def test_exclude(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=0)

        self.assertEqual(SomeModel.objects.filter(q__gte=1).exclude(p='foo').count(), 0)
        self.assertEqual(SomeModel.objects.filter().exclude(q__gte=0).count(), 0)

    def test_manager_exclude_some_multiple_kwargs(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        objs = SomeModel.objects.exclude(q=3, r=4)
        self.assertEqual(len(objs), 1)
        self.assertEqual(objs[0].p, 1)
        self.assertEqual(objs[0].q, 2)
        self.assertEqual(objs[0].r, 3)

        self.assertEqual(SomeModel.objects.exclude(q=3, r=3).count(), 2)

    def test_manager_filter_nokwargs(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        self.assertEqual(len(SomeModel.objects.filter()), 2)

    def test_manager_filter_none(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        self.assertEqual(SomeModel.objects.filter(p=2), EmptyQuerySet(model=SomeModel))

    def test_manager_filter_some_single_kwarg(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        objs = SomeModel.objects.filter(q=2)
        self.assertEqual(len(objs), 1)
        self.assertEqual(objs[0].p, 1)
        self.assertEqual(objs[0].q, 2)
        self.assertEqual(objs[0].r, 3)

    def test_manager_filter_some_multiple_kwargs(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        objs = SomeModel.objects.filter(q=3, r=4)
        self.assertEqual(len(objs), 1)
        self.assertEqual(objs[0].p, 1)
        self.assertEqual(objs[0].q, 3)
        self.assertEqual(objs[0].r, 4)

        self.assertEqual(SomeModel.objects.filter(q=3, r=3), EmptyQuerySet(model=SomeModel))

    def test_queryset_get(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=0)

        self.assertEqual(SomeModel.objects.filter(q__gte=0).get(p='foo').q, 1)

    def test_manager_get_success(self):
        _id = SomeModel(p=1, q=2, r=3).id

        obj = SomeModel.objects.get(id=_id)
        self.assertEqual(obj.p, 1)
        self.assertEqual(obj.q, 2)
        self.assertEqual(obj.r, 3)

    def test_manager_get_does_not_exist(self):
        SomeModel(p=1, q=2, r=3)

        with self.assertRaises(DoesNotExist):
            SomeModel.objects.get(p=2)

    def test_manager_get_multiple_objects_returned(self):
        SomeModel(p=1, q=2, r=3)
        SomeModel(p=1, q=3, r=4)

        with self.assertRaises(MultipleObjectsReturned):
            SomeModel.objects.get(p=1)

    def test_get_or_create(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=0)

        obj, created = SomeModel.objects.filter(q__gte=0).get_or_create(p='foo')

        self.assertEqual(obj.q, 1)
        self.assertFalse(created)

        obj, created = SomeModel.objects.exclude(q__gte=0).get_or_create(p='foo', defaults={'q': 2})
        self.assertEqual(obj.q, 2)
        self.assertTrue(created)

    def test_latest(self):
        obj = SomeModel.objects.latest()
        self.assertIsNone(obj)

        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=0)

        obj = SomeModel.objects.latest()

        self.assertEqual(obj.p, 'bar')

    def test_none(self):
        self.assertFalse(SomeModel.objects.all().none().exists())

    def test_order_by(self):
        SomeModel(p='foo', q=3)
        SomeModel(p='foo', q=1)
        SomeModel(p='foo', q=2)

        self.assertEqual(
            SomeModel.objects.filter().order_by('q').values_list('q'),
            QuerySet(
                [(1,), (2,), (3,)],
                model=SomeModel
            )
        )

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values_list('q'),
            QuerySet(
                [(3,), (2,), (1,)],
                model=SomeModel
            )
        )

        with self.assertRaises(AttributeError):
            SomeModel.objects.filter().order_by()

    def test_reverse(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='foo', q=2)

        self.assertEqual(
            SomeModel.objects.filter().order_by('q').reverse().values_list('q'),
            QuerySet(
                [(2,), (1,)],
                model=SomeModel
            )
        )

        self.assertEqual(
            SomeModel.objects.filter().order_by('q').reverse().reverse()
                .values_list('q'),
            QuerySet(
                [(1,), (2,)],
                model=SomeModel
            )
        )

    def test_values(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values('q'),
            QuerySet(
                [{'q': 2}, {'q': 1}, ],
                model=SomeModel
            )
        )

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values('p', 'q'),
            QuerySet(
                [
                    {'q': 2, 'p': 'bar'},
                    {'q': 1, 'p': 'foo'},
                ],
                model=SomeModel
            )
        )

        self.assertSetEqual(
            set(SomeModel.objects.filter().order_by('-q').values()[0].keys()),
            {'p', 'q', 'r', 'created', 'updated', 'id'}
        )

    def test_values_list(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values_list('p', 'q'),
            QuerySet(
                [
                    ('bar', 2,),
                    ('foo', 1,)
                ],
                model=SomeModel
            )
        )

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values_list('q', 'p'),
            QuerySet(
                [
                    (2, 'bar',),
                    (1, 'foo',)
                ],
                model=SomeModel
            )
        )

    def test_invalid_lookup_params(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        with self.assertRaises(TypeError):
            SomeModel.objects.all().values_list('p', 0)

    def test_values_list_flat(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        self.assertEqual(
            SomeModel.objects.filter().order_by('-q').values_list('p', flat=True),
            QuerySet(
                ['bar', 'foo'],
                model=SomeModel
            )
        )

        with self.assertRaises(TypeError):
            SomeModel.objects.filter().order_by('-q').values_list('p', 'q', flat=True)

    def test_first(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        obj = SomeModel.objects.all().order_by('-q').first()

        self.assertEqual(obj.q, 2)

    def test_manager_first(self):
        self.assertIsNone(SomeModel.objects.first())

        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        obj = SomeModel.objects.first()

        self.assertEqual(obj.q, 1)

    def test_first_none(self):
        self.assertIsNone(SomeModel.objects.all().first())

    def test_last(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        obj = SomeModel.objects.all().order_by('q').last()

        self.assertEqual(obj.q, 2)

    def test_manager_last(self):
        self.assertIsNone(SomeModel.objects.last())

        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        obj = SomeModel.objects.last()

        self.assertEqual(obj.q, 2)

    def test_last_none(self):
        self.assertIsNone(SomeModel.objects.all().last())

    def test_manager_random(self):
        self.assertIsNone(SomeModel.objects.random())

        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        obj = SomeModel.objects.random()

        self.assertIn(obj, SomeModel.objects.all())

    def test_manager_map(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        result = SomeModel.objects.map(
            func=lambda obj: obj.p.upper()
        )

        self.assertEqual(set(result), {'FOO', 'BAR'})

    def test_map(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        result = SomeModel.objects.filter().map(
            func=lambda obj: obj.p.upper()
        )

        self.assertEqual(set(result), {'FOO', 'BAR'})

    def test_manager_map_non_callable(self):
        SomeModel(p='foo', q=1)
        SomeModel(p='bar', q=2)

        with self.assertRaises(TypeError):
            result = SomeModel.objects.map(func=1)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Language" content="en">

    <meta name="author" content="Arunvel Sriram">
    <meta name="description" content="Arunvel Sriram is Software Engineer at Thoughtworks. He writes about his learnings, findings, experiences about various technologies in his blog">
    <meta name="keywords" content="blog,developer,engineer,software,opensource,personal">

    <meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="jacoco"/>
<meta name="twitter:description" content="Arunvel Sriram is Software Engineer at Thoughtworks. He writes about his learnings, findings, experiences about various technologies in his blog"/>

    <meta property="og:title" content="jacoco" />
<meta property="og:description" content="Arunvel Sriram is Software Engineer at Thoughtworks. He writes about his learnings, findings, experiences about various technologies in his blog" />
<meta property="og:type" content="website" />
<meta property="og:url" content="/tags/jacoco/" />
<meta property="og:updated_time" content="2019-06-23T14:04:10+05:30" />

      <base href="/tags/jacoco/">

    <title>Tag: jacoco · arunvelsriram</title>

      <link rel="canonical" href="/tags/jacoco/">

    <link href="https://fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather:300,700%7CSource+Code+Pro:400,700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css" integrity="sha384-Bfad6CLCknfcloXFOyFnlgtENryhrpZCe29RTifKEixXQZ38WheV+i/6YWSzkz3V" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" integrity="sha256-l85OmPOjvil/SOvVt3HnSSjzF1TUMyT9eV0c2BzEGzU=" crossorigin="anonymous" />

      <link rel="stylesheet" href="/css/coder.min.3219ef62ae52679b7a9c19043171c3cd9f523628c2a65f3ef247ee18836bc90b.css" integrity="sha256-MhnvYq5SZ5t6nBkEMXHDzZ9SNijCpl8+8kfuGINryQs=" crossorigin="anonymous" media="screen" />

    <link rel="icon" type="image/png" href="/images/favicon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="/images/favicon-16x16.png" sizes="16x16">

    <link rel="alternate" type="application/rss+xml" href="/tags/jacoco/index.xml" title="arunvelsriram" />
    <meta name="generator" content="Hugo 0.74.3" />

      arunvelsriram

    <input type="checkbox" id="menu-toggle" />

            About

            Posts

            Tags

Tag: jacoco

      June 23, 2019
      JaCoCo Configuration using Gradle's Kotlin DSL

        ©

        2020
         Arunvel Sriram

         ·
        Powered by Hugo & Coder.


text:
AWDMaterial::AWDMaterial(AWD_mat_type type, const char *name, awd_uint16 name_len) :
    AWDBlock(SIMPLE_MATERIAL),
    AWDNamedElement(name, name_len),
    AWDAttrElement()
{
    this->type = type;
    this->texture = NULL;
    this->color = 0;
    this->alpha_threshold = 0.0f;
    this->alpha_blending = false;
    this->repeat = false;
    this->first_method = NULL;
    this->last_method = NULL;
    this->num_methods = 0;
}

AWDMaterial::~AWDMaterial()
{
    // Texture will be deleted
    // by the block list it's in
    this->texture = NULL;
}

AWD_mat_type
AWDMaterial::get_type()
{
    return this->type;
}

void
AWDMaterial::set_type(AWD_mat_type type)
{
    this->type = type;
}

AWDBitmapTexture *
AWDMaterial::get_texture()
{
    return this->texture;
}

void
AWDMaterial::set_texture(AWDBitmapTexture *texture)
{
    this->texture = texture;
}

void
AWDMaterial::add_method(AWDShadingMethod *method)
{
    AWD_mat_method *item;

    item = (AWD_mat_method *)malloc(sizeof(AWD_mat_method));
    item->method = method;
    item->next = NULL;

    if (!this->first_method)
        this->first_method = item;
    else
        this->last_method->next = item;

    this->last_method = item;
    this->last_method->next = NULL;

    this->num_methods++;
}

awd_uint32
AWDMaterial::calc_body_length(bool wide_mtx)
{
    AWD_mat_method *cur;
    awd_uint32 len;

    len = 2; // type + method count 8-bit ints

    len += sizeof(awd_uint16) + this->get_name_length();
    len += this->calc_attr_length(true, true, wide_mtx);

    cur = this->first_method;
    while (cur) {
        len += cur->method->calc_method_length(wide_mtx);
        cur = cur->next;
    }

    return len;
}

void
AWDMaterial::prepare_write()
{
    if (this->type == AWD_MATTYPE_COLOR) {
        if (this->color > 0) {
            AWD_field_ptr col_val;
            col_val.col = (awd_color *)malloc(sizeof(awd_uint32));
            *col_val.col = this->color;
            this->properties->set(PROP_MAT_COLOR, col_val, sizeof(awd_color), AWD_FIELD_COLOR);
        }
    }
    else {
        if (this->texture) {
            AWD_field_ptr tex_val;
            tex_val.addr = (awd_baddr *)malloc(sizeof(awd_baddr));
            *tex_val.addr = this->texture->get_addr();
            this->properties->set(PROP_MAT_TEXTURE, tex_val, sizeof(awd_baddr), AWD_FIELD_BADDR);
        }

        if (this->repeat) {
            AWD_field_ptr rep_val;
            rep_val.b = (awd_bool *)malloc(sizeof(awd_bool));
            *rep_val.b = AWD_TRUE;
            this->properties->set(PROP_MAT_REPEAT, rep_val, sizeof(awd_bool), AWD_FIELD_BOOL);
        }

        if (this->alpha_blending) {
            AWD_field_ptr trans_val;
            trans_val.b = (awd_bool *)malloc(sizeof(awd_bool));
            *trans_val.b = AWD_TRUE;
            this->properties->set(PROP_MAT_ALPHA_BLENDING, trans_val, sizeof(awd_bool), AWD_FIELD_BOOL);
        }

        if (this->alpha_threshold != 0.0f) {
            AWD_field_ptr th_val;
            th_val.f32 = (awd_float32 *)malloc(sizeof(awd_float32));
            *th_val.f32 = this->alpha_threshold;
            this->properties->set(PROP_MAT_ALPHA_THRESHOLD, th_val, sizeof(awd_float32), AWD_FIELD_FLOAT32);
        }
    }
}

void
AWDMaterial::write_body(int fd, bool wide_mtx)
{
    AWD_mat_method *cur;

    awdutil_write_varstr(fd, this->get_name(), this->get_name_length());
    write(fd, &this->type, sizeof(awd_uint8));
    write(fd, &this->num_methods, sizeof(awd_uint8));

    this->properties->write_attributes(fd, wide_mtx);

    cur = this->first_method;
    while (cur) {
        cur->method->write_method(fd, wide_mtx);
        cur = cur->next;
    }

    this->user_attributes->write_attributes(fd, wide_mtx);
}


text:
package org.jenkinsci.plugins.pretestedintegration.unit;

import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.Result;
import java.io.IOException;
import net.sf.json.JSONObject;
import org.jenkinsci.plugins.pretestedintegration.AbstractSCMBridge;
import org.jenkinsci.plugins.pretestedintegration.exceptions.PushFailedException;
import org.jenkinsci.plugins.pretestedintegration.exceptions.EstablishingWorkspaceFailedException;
import org.jenkinsci.plugins.pretestedintegration.IntegrationStrategy;
import org.jenkinsci.plugins.pretestedintegration.SCMBridgeDescriptor;
import org.kohsuke.stapler.DataBoundConstructor;

import org.kohsuke.stapler.StaplerRequest;

public class DummySCM extends AbstractSCMBridge {

    private boolean commited = false;
    private boolean rolledBack = false;

    @DataBoundConstructor
    public DummySCM(IntegrationStrategy behaves) {
        super(behaves);
    }

    public boolean isCommited() {
        return commited;
    }

    public boolean isRolledBack() {
        return rolledBack;
    }

    @Override
    protected String getIntegrationBranch() {
        return "master";
    }

    @Extension
    public static final class DescriptorImpl extends SCMBridgeDescriptor<DummyBridge> {

        @Override
        public String getDisplayName() {
            return "DummySCM";
        }

        @Override
        public DummyBridge newInstance(StaplerRequest req, JSONObject formData) throws FormException {
            DummyBridge i = (DummyBridge) super.newInstance(req, formData);
            save();
            return i;
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Hilgardia 14: 206 (1941)

#### Original name
Stigmina polymorpha D.J. Sm. & C.O. Sm.

### Remarks
null


text:
describe('Configured Model Generator', function () {
    it('Auto model should exist', function() {
        expect(Test.model.Auto).toBeDefined();
    });
    it('Car model should exist', function() {
        expect(Test.TestBundle.Entity.Car).toBeDefined();
    });
});


text:
package atc

type CheckRequestBody struct {
	From Version `json:"from"`
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.selendroid</groupId>
		<artifactId>selendroid</artifactId>
		<version>0.6.0-SNAPSHOT</version>
	</parent>
	<artifactId>selendroid-server-common</artifactId>
	<name>selendroid-server-common</name>

	<dependencies>
		<dependency>
			<groupId>org.webbitserver</groupId>
			<artifactId>webbit</artifactId>
			<version>0.4.15</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20090211</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.2.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


text:
    Domain

      <select class="input-small gf-form-input" ng-model="ctrl.panel.config.domain" ng-options="t for t in domains" ng-change="ctrl.render()"></select>

    Sub domain

      <select class="input-small gf-form-input" ng-model="ctrl.panel.config.subDomain" ng-options="t for t in subDomains[ctrl.panel.config.domain]" ng-change="ctrl.render()"></select>

    <gf-form-switch class="gf-form" label="Vertical orientation" label-class="width-12" checked="ctrl.panel.config.verticalOrientation" on-change="ctrl.render()"></gf-form-switch>

    Col limit

    <input class="gf-form-input max-width-8" ng-model="ctrl.panel.config.colLimit" ng-change="ctrl.render()" ng-model-onblur>

    Row limit

    <input class="gf-form-input max-width-8" ng-model="ctrl.panel.config.rowLimit" ng-change="ctrl.render()" ng-model-onblur>

    Cell size
    <input class="gf-form-input max-width-8" ng-model="ctrl.panel.config.cellSize" ng-change="ctrl.render()" ng-model-onblur>

    Cell padding
    <input class="gf-form-input max-width-8" ng-model="ctrl.panel.config.cellPadding" ng-change="ctrl.render()" ng-model-onblur>

    Cell radius
    <input class="gf-form-input max-width-8" ng-model="ctrl.panel.config.cellRadius" ng-change="ctrl.render()" ng-model-onblur>

    Thresholds
      <i class="grafana-tip fa fa-question-circle ng-scope" bs-tooltip="'Thresholds to split data into colors.
10,20,30 will produce 4 colors for <10(color=min), 10:20, 20:30, and >=30(color=max).
If it is empty or auto, the thresholds are automatically determined based on statistics.'">

    <input class="gf-form-input max-width-26" ng-model="ctrl.panel.config.legendStr" ng-change="ctrl.render()" ng-model-onblur>

    Colors (min:max)
    <spectrum-picker class="gf-form-input width-4" ng-model="ctrl.panel.config.legendColors.min" ng-change="ctrl.render()" ></spectrum-picker>
    <spectrum-picker class="gf-form-input width-4" ng-model="ctrl.panel.config.legendColors.max" ng-change="ctrl.render()" ></spectrum-picker>

    Empty color
    <spectrum-picker class="gf-form-input width-8" ng-model="ctrl.panel.config.legendColors.empty" ng-change="ctrl.render()" ></spectrum-picker>

    <gf-form-switch class="gf-form" label="Show legend" label-class="width-10" checked="ctrl.panel.config.displayLegend" on-change="ctrl.render()"></gf-form-switch>

    Link template

    <input class="gf-form-input max-width-26" ng-model="ctrl.panel.config.linkTemplate" ng-change="ctrl.render()" ng-model-onblur>

Hover info

    Unit

    Decimals
    <input type="number" class="gf-form-input max-width-5" ng-model="ctrl.panel.config.hoverDecimals" ng-change="ctrl.render()" ng-model-onblur>


text:
jQuery(document).ready(function(){
	// filter compare: init and change
	wpv_usermeta_field_initialize_compare();

	// filter compare mode: init and change
	wpv_usermeta_field_initialize_compare_mode();

	// filter relationship
	wpv_usermeta_field_initialize_relationship();
})

function wpv_usermeta_field_initialize_compare() {
	var wpv_allowed_values = 0;
	jQuery('.js-filter-list .js-wpv-usermeta-field-compare-select').each(function(){
		var wpv_single_row = jQuery(this).parents('.js-filter-row-multiple-element');
		/*
		 / /T*his section commented before we found better way filter by usermeta and wp_users fields.
		 if ( jQuery(wpv_single_row).data('field') == 'user_email' ||
			 jQuery(wpv_single_row).data('field') == 'user_url' ||
			 jQuery(wpv_single_row).data('field') == 'user_login' || jQuery(wpv_single_row).data('field') == 'display_name' ){
		jQuery(wpv_single_row).find('.js-wpv-usermeta-comare-box').hide();
		jQuery(wpv_single_row).find('.js-wpv-usermeta-field-compare-mode option').each(function(){
			if ( jQuery(this).val() != 'constant' && jQuery(this).val() != 'url' && jQuery(this).val() != 'attribute' ){
				jQuery(this).remove();
			 }

			 });
			 }*/

		wpv_clear_validate_messages('.js-filter-list .js-filter-usermeta-field');
		jQuery(this).parents('.js-filter-usermeta-field').find('.filter-input-error').removeClass('filter-input-error');
		if (jQuery(this).val() == 'BETWEEN' || jQuery(this).val() == 'NOT BETWEEN') {
			wpv_allowed_values = 2;
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-add-value').addClass('hidden');
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-remove-value').addClass('hidden');
			divs = jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-value-div');
			if (divs.length < 2) {
				// add another one.
				var clone = jQuery(divs[0]).clone();
				clone.find('.js-wpv-usermeta-field-value-text').val('');
				clone.insertAfter(divs[0]);
				wpv_usermeta_field_initialize_compare_mode();
			}
		} else if (jQuery(this).val() == 'IN' || jQuery(this).val() == 'NOT IN') {
			wpv_allowed_values = 100000;
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-add-value').removeClass('hidden');
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-value-div').each(function(index) {
				if (index > 0) {
					jQuery(this).find('.js-wpv-usermeta-field-remove-value').removeClass('hidden');
				} else {
					jQuery(this).find('.js-wpv-usermeta-field-remove-value').addClass('hidden');
				}
			});
		} else {
			wpv_allowed_values = 1;
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-add-value').addClass('hidden');
			jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-remove-value').addClass('hidden');
		}
		jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-value-div').each(function() {
			if (wpv_allowed_values > 0) {
				jQuery(this).removeClass('hidden');
			} else {
				jQuery(this).remove();
			}
			wpv_allowed_values--;
		});
	});
}

jQuery(document).on('change', '.js-filter-list .js-wpv-usermeta-field-compare-select', function() {
	wpv_usermeta_field_initialize_compare();
});

// Inputs based on filter compare mode

function wpv_usermeta_field_initialize_compare_mode() {
	jQuery('.js-filter-list .js-wpv-usermeta-field-compare-mode').each(function() {
		wpv_usermeta_field_show_hide_text_date_controls(this);
	});
	jQuery(document).on('change', '.js-filter-list .js-wpv-usermeta-field-compare-mode', function() {
		wpv_usermeta_field_show_hide_text_date_controls(this)
	});
}

function wpv_usermeta_field_show_hide_text_date_controls(item) {
	// Show the text control depending on the compare function.
	var mode = jQuery(item).val();
	jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').removeClass('js-wpv-filter-validate');
	jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').data('type', 'none');
	switch(mode) {
		case 'constant':
			//	case 'url':
			//	case 'attribute':
		case 'future_day':
		case 'past_day':
		case 'future_month':
		case 'past_month':
		case 'future_year':
		case 'past_year':
		case 'seconds_from_now':
		case 'months_from_now':
		case 'years_from_now':
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').removeClass('hidden');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-date').addClass('hidden');
			break;
		case 'url':
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').addClass('js-wpv-filter-validate');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').data('type', 'url');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').removeClass('hidden');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-date').addClass('hidden');
			break;
		case 'attribute':
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').addClass('js-wpv-filter-validate');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').data('type', 'shortcode');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').removeClass('hidden');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-date').addClass('hidden');
			break;
		case 'date':
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').addClass('hidden');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-date').removeClass('hidden');
			break;
		default:
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-value-text').addClass('hidden');
			jQuery(item).parents('.js-wpv-usermeta-field-value-div').find('.js-wpv-usermeta-field-date').addClass('hidden');
			break;

	}
}

function wpv_usermeta_field_initialize_relationship() {
	if (jQuery('.js-filter-list .js-wpv-usermeta-field-compare-select').length > 1) {
		jQuery('.js-filter-list .js-wpv-filter-usermeta-field-relationship-container').removeClass('hidden');
		jQuery('.js-filter-list .js-filter-usermeta-field-row-remove').addClass('js-multiple-items');
	} else if (jQuery('.js-filter-list .js-wpv-usermeta-field-compare-select').length == 0) {
		jQuery('.js-filter-list .js-filter-usermeta-field').remove();
		if (jQuery('.js-wpv-section-unsaved').length < 1) {
			setConfirmUnload(false);
		}
	} else {
		jQuery('.js-filter-list .js-wpv-filter-usermeta-field-relationship-container').addClass('hidden');
		jQuery('.js-filter-list .js-filter-usermeta-field-row-remove').removeClass('js-multiple-items');
	}
}

// Add another value

jQuery(document).on('click', '.js-filter-list .js-wpv-usermeta-field-add-value', function() {
	var clone = jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-value-div:last').clone();

	clone.find('.js-wpv-usermeta-field-value-text').val('');
	clone.find('.js-wpv-usermeta-field-remove-value').removeClass('hidden');

	clone.insertAfter(jQuery(this).parents('.js-filter-row-multiple-element').find('.js-wpv-usermeta-field-value-div:last'));

	wpv_usermeta_field_initialize_compare();
	wpv_usermeta_field_initialize_compare_mode();
	wpv_filter_usermeta_field_watch_changes();
});

// Remove value

jQuery(document).on('click', '.js-filter-list .js-wpv-usermeta-field-remove-value', function() {
	jQuery(this).parents('.js-wpv-usermeta-field-value-div').remove();
	wpv_filter_usermeta_field_watch_changes();
});

// Get value

function _wpv_resolve_usermeta_field_value() {
	// Calculate the actual value to be saved using the
	// settings from the mode and text boxes.
	jQuery('.js-filter-list .js-wpv-usermeta-field-values').each(function(index) {
		var text_box = jQuery(this).find('.js-wpv-usermeta-field-values-real');
		var _wpv_resolve_usermeta_field_value_output = '';
		jQuery(this).find('.js-wpv-usermeta-field-value-div').each(function(index) {
			var text_control = jQuery(this).find('.js-wpv-usermeta-field-value-text')
			if (_wpv_resolve_usermeta_field_value_output != '') {
				_wpv_resolve_usermeta_field_value_output += ',';
			}
			var value = text_control.val();

			var mode = jQuery(this).children('.js-wpv-usermeta-field-compare-mode').val();
			switch(mode) {
				case 'url':
					value = 'URL_PARAM(' + value + ')';
					break;

				case 'attribute':
					value = 'VIEW_PARAM(' + value + ')';
					break;

				case 'now':
					value = 'NOW()';
					break;

				case 'today':
					value = 'TODAY()';
					break;

				case 'future_day':
					value = 'FUTURE_DAY(' + value + ')';
					break;

				case 'past_day':
					value = 'PAST_DAY(' + value + ')';
					break;

				case 'this_month':
					value = 'THIS_MONTH()';
					break;

				case 'future_month':
					value = 'FUTURE_MONTH(' + value + ')';
					break;

				case 'past_month':
					value = 'PAST_MONTH(' + value + ')';
					break;

				case 'this_year':
					value = 'THIS_YEAR()';
					break;

				case 'future_year':
					value = 'FUTURE_YEAR(' + value + ')';
					break;

				case 'past_year':
					value = 'PAST_YEAR(' + value + ')';
					break;

				case 'seconds_from_now':
					value = 'SECONDS_FROM_NOW(' + value + ')';
					break;

				case 'months_from_now':
					value = 'MONTHS_FROM_NOW(' + value + ')';
					break;

				case 'years_from_now':
					value = 'YEARS_FROM_NOW(' + value + ')';
					break;

				case 'date':
					var date_div = jQuery(this).find('.js-wpv-usermeta-field-date');
					var month = jQuery(date_div).find('select');

					var mm = month.val();
					var jj = month.next().val();
					var aa = month.next().next().val();

					value = 'DATE(' + jj + ',' + mm + ',' + aa + ')';
					break;

			}

			_wpv_resolve_usermeta_field_value_output += value;
		})

		text_box.val(_wpv_resolve_usermeta_field_value_output);
	});
}

var wpv_filter_usermeta_field_selected = jQuery('.js-filter-list .js-filter-usermeta-field input, .js-filter-list .js-filter-usermeta-field select').serialize();

// Watch changes

jQuery(document).on('change keyup input cut paste', '.js-filter-list .js-filter-usermeta-field input, .js-filter-list .js-filter-usermeta-field select', function() {
	jQuery(this).parents('.js-filter-usermeta-field').find('.filter-input-error').removeClass('filter-input-error');
	wpv_filter_usermeta_field_watch_changes();
});

function wpv_filter_usermeta_field_watch_changes() {
	jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').prop('disabled', false);
	wpv_clear_validate_messages('.js-filter-list .js-filter-usermeta-field');
	if ( wpv_filter_usermeta_field_selected != jQuery('.js-filter-list .js-filter-usermeta-field input, .js-filter-list .js-filter-usermeta-field select').serialize() ) {
		jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').removeClass('button-secondary').addClass('button-primary').addClass('js-wpv-section-unsaved').val(jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').data('save'));
		setConfirmUnload(true);
	} else {
		jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').removeClass('button-primary').addClass('button-secondary').removeClass('js-wpv-section-unsaved').val(jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').data('close'));
		jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').parent().find('.unsaved').remove();
		if (jQuery('.js-wpv-section-unsaved').length < 1) {
			setConfirmUnload(false);
		}
	}
}

// Close and save

jQuery(document).on('click', '.js-filter-list .js-wpv-filter-usermeta-field-edit-ok', function() {
	jQuery(this).parent().find('.unsaved').remove();
	if (wpv_filter_usermeta_field_selected == jQuery('.js-filter-list .js-filter-usermeta-field input, .js-filter-list .js-filter-usermeta-field select').serialize() ) {
		wpv_close_filter_row('.js-filter-list .js-filter-usermeta-field');
	} else {
		var valid = true;
		var tax_row = jQuery('.js-filter-list .js-wpv-usermeta-field-compare-mode').parents('.js-filter-row-multiple-element').data('field');
		valid = wpv_validate_filter_inputs('.js-filter-list .js-filter-row-usermeta-field-' + tax_row);
		if (valid) {
			_wpv_resolve_usermeta_field_value();
			var update_message = jQuery(this).data('success');
			var unsaved_message = jQuery(this).data('unsaved');
			var nonce = jQuery(this).data('nonce');
			wpv_filter_usermeta_field_selected = jQuery('.js-filter-list .js-filter-usermeta-field input, .js-filter-list .js-filter-usermeta-field select').serialize();
			var wpv_usermeta_fields_values = {};
			jQuery('.js-filter-list .js-filter-usermeta-field .js-filter-row-multiple-element').each(function() {
				var wpv_usermeta_field = "usermeta-field-" + jQuery(this).data('field');
				wpv_usermeta_fields_values[wpv_usermeta_field + "_compare"] = jQuery(this).find('.js-wpv-usermeta-field-compare-select').val();
				wpv_usermeta_fields_values[wpv_usermeta_field + "_type"] = jQuery(this).find('.js-wpv-usermeta-field-type-select').val();
				wpv_usermeta_fields_values[wpv_usermeta_field + "_value"] = jQuery(this).find('.js-wpv-usermeta-field-values-real').val();
			});
			var filter_usermeta_fields = JSON.stringify(wpv_usermeta_fields_values);
			var spinnerContainer = jQuery('
').insertAfter(jQuery(this)).removeClass('hidden');
			var data_view_id = jQuery('.js-post_ID').val();
			var data = {
				action: 'wpv_filter_usermeta_field_update',
				id: data_view_id,
				filter_usermeta_fields: filter_usermeta_fields,
				filter_usermeta_fields_relationship: jQuery('.js-filter-list .js-wpv-filter-usermeta-fields-relationship').val(),
				wpnonce: nonce
			};
			jQuery.post(ajaxurl, data, function(response) {
				if ( (typeof(response) !== 'undefined')) {
					if (response != 0) {
						jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').removeClass('button-primary').addClass('button-secondary').removeClass('js-wpv-section-unsaved').val(jQuery('.js-filter-list .js-wpv-filter-usermeta-field-edit-ok').data('close'));
						if (jQuery('.js-wpv-section-unsaved').length < 1) {
							setConfirmUnload(false);
						}
						jQuery('.js-filter-list .js-wpv-filter-usermeta-field-summary').html(response);
						jQuery('.js-filter-list .js-wpv-filter-usermeta-field-summary').append(' ' + update_message + '');
						setTimeout(function(){
							jQuery('.js-filter-list .js-wpv-filter-usermeta-field-summary .updated').fadeOut('fast');
						}, 2000);
						wpv_close_filter_row('.js-filter-list .js-filter-usermeta-field');
						wpv_update_parametric_search_section();
					} else {
						console.log( "Error: WordPress AJAX returned " + response );
					}
				} else {
					console.log( "Error: AJAX returned " + response );
				}

			})
			.fail(function(jqXHR, textStatus, errorThrown) {
				console.log( "Error: %s %s", textStatus, errorThrown );
			})
			.always(function() {
				spinnerContainer.remove();
			});
		}
	}
});


text:
import { h, render } from 'preact';
import TodoList from './todolist.component.js';

render(<TodoList />, document.body);


text:
title: Create a Custom Color Palette
category: 4-Build Stuff in XD
order: 4
---

Working with color palettes is important for consistency and uniformity in your designs. Below is a screenshot of the color palette I want to use for my app design.

 Let's look at a quick way to add a custom color palette in Adobe XD.

The first thing you need to do is take a screenshot of the color palette so you can import it into Adobe XD.

Once you import the color palette into Adobe XD you can drag it off the artboard.
Next, you will want to save each color swatch to the appearance section of the Property Inspector.
I'll show you how this is done.

Start by selecting the artboard and clicking on the dropper next to the fill.
A color picker will appear.

Move the color picker up to the color palette you imported earlier and select the first color.

Click on Fill and then click on the + sign in the lower left corner.
This will add a color swatch to the panel.
You can repeat this process for the rest of the color palette.

Continue adding each color from the palette until you have all the matching swatches.

Here you can see the entire color palette reflected in the color picker.


text:
pc.script.create('led', function (app) {
    // Creates a new Led instance
    var Led = function (entity) {
        this.entity = entity;
        this.mat = null;
        this.targetIntensity = 0;
        this.percent = 1;
        this.timeToEnable = 0;
    };

    var smoothstepC = function (c) {
        return c * c * (3 - 2 * c);
    }

    var curve = function (x) {
      if (x < 0.1) {
          return smoothstepC(x / 0.1) * 2;
      } else {
          return pc.math.lerp(2, 1.0, smoothstepC(x - 0.1) / 0.9);
      }
    }

    Led.prototype = {
        // Called once after all resources are loaded and before the first update
        initialize: function () {

            this.mat = this.entity.model.model.meshInstances[0].material.clone();
            this.entity.model.model.meshInstances[0].material = this.mat;
            this.mat.emissiveIntensity = 0;
            this.mat.update();

            if (!app._leds) app._leds = [];
            app._leds.push(this);
        },

        // Called every frame, dt is time in seconds since last update
        update: function (dt) {
            if (Date.now() < this.timeToEnable) return;

            if (this.percent < 1) {
                this.percent += dt * (this.targetIntensity===1? 0.5 : 10);
                if (this.percent > 1) this.percent = 1;

                this.mat.emissiveIntensity = this.targetIntensity===1? curve(this.percent) : (1-this.percent);
                this.mat.update();
            }
        },

        turnOn: function () {
            this.targetIntensity = 1;
            this.percent = 0;
            this.timeToEnable = Date.now() + 2000 + Math.random() * 500;
        },

        turnOff: function () {
            this.targetIntensity = 0;
            this.percent = 0;
            this.timeToEnable = 0;//Date.now() + 500;
        }
    };

    return Led;
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Helpers;

using Composite.AspNet.Razor;

namespace CompositeC1Contrib.FormBuilder.Web.UI
{
    public class WizardHtmlForm : IDisposable
    {
        private readonly StandardFormWizardPage _page;
        private bool _disposed;

        public WizardHtmlForm(StandardFormWizardPage page, Wizard wizard, object htmlAttributes)
        {
            _page = page;

            var htmlAttributesDictionary = new Dictionary<string, IList<string>>
            {
                {
                    "class", new List<string>
                    {
                        "form",
                        "formwizard-" + wizard.Name.ToLowerInvariant(),
                    }
                }
            };

            var action = String.Empty;

            var dictionary = Functions.ObjectToDictionary(htmlAttributes);
            if (dictionary != null)
            {
                if (dictionary.ContainsKey("class"))
                {
                    htmlAttributesDictionary["class"].Add((string)dictionary["class"]);
                }

                if (dictionary.ContainsKey("action"))
                {
                    action = (string)dictionary["action"];
                }
            }

            page.WriteLiteral($"<form method=\"post\" action=\"{action}\"");

            foreach (var kvp in htmlAttributesDictionary)
            {
                page.WriteLiteral(" " + kvp.Key + "=\"");
                foreach (var itm in kvp.Value)
                {
                    page.WriteLiteral(itm + " ");
                }

                page.WriteLiteral("\"");
            }

            if (wizard.HasFileUpload)
            {
                page.WriteLiteral(" enctype=\"multipart/form-data\"");
            }

            page.WriteLiteral(" data-renderer=\"" + page.FormRenderer.GetType().AssemblyQualifiedName + "\"");
            page.WriteLiteral(">");

            page.WriteLiteral("<input type=\"hidden\" name=\"__type\" value=\"" + HttpUtility.HtmlAttributeEncode(wizard.Name) + "\" />");

            for (int i = 0; i < wizard.Steps.Count; i++)
            {
                var step = wizard.Steps[i];

                RenderHiddenField("step_" + (i + 1), "step_" + (i + 1), step.FormName);
            }

            foreach (var field in wizard.Fields.Where(f => f.Label == null))
            {
                RenderHiddenField(field.Name, field.Id, field.Value == null ? String.Empty : field.GetValueAsString());
            }

            if (!wizard.DisableAntiForgery)
            {
                page.WriteLiteral(AntiForgery.GetHtml());
            }
        }

        private void RenderHiddenField(string name, string id, string value)
        {
            var s = String.Format("<input type=\"hidden\" name=\"{0}\" id=\"{1}\" value=\"{2}\" />",
                    HttpUtility.HtmlAttributeEncode(name),
                    HttpUtility.HtmlAttributeEncode(id),
                    HttpUtility.HtmlAttributeEncode(value));

            _page.WriteLiteral(s);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _page.WriteLiteral("</form>");

                _disposed = true;
            }
        }

        public void Dispose()
        {
            Dispose(true);

            GC.SuppressFinalize(this);
        }

        public void EndForm()
        {
            Dispose(true);
        }
    }
}


text:
setDebug(true);

function callee() {
  assertJit();
  evalInFrame(1, "var x = 'success'");
}
function caller() {
  assertJit();
  callee();
  return x;
}
assertEq(caller(), "success");
assertEq(typeof x, "undefined");


text:
package org.seqcode.gsebricks.verbs.location;

import java.util.*;

import org.seqcode.genome.Genome;
import org.seqcode.genome.location.NamedRegion;
import org.seqcode.genome.location.Region;
import org.seqcode.gsebricks.verbs.CastingMapper;
import org.seqcode.gsebricks.verbs.Expander;
import org.seqcode.gsebricks.verbs.ExpanderIterator;
import org.seqcode.gsebricks.verbs.Mapper;
import org.seqcode.gsebricks.verbs.MapperIterator;

/**
 * This encapsulates the little pattern that we always have to write when we want
 * to get all of some X in an *entire* genome.
 *
 * We usually take a Genome, throw it through ChromRegionIterator, (sometimes)
 * map those NamedRegions down to Regions, and then concatenate that Iterator
 * with the Expander of interest.  This just does all that, in its execute method --
 * it is an Expander which takes a Genome, and returns "all of the X's" in that
 * entire genome.
 *
 * @author tdanford
 */
public class GenomeExpander<X> implements Expander<Genome,X> {

	private Expander<Region,X> expander;
	private Mapper<NamedRegion,Region> caster;

	public GenomeExpander(Expander<Region,X> exp) {
		expander = exp;
		caster = new CastingMapper<NamedRegion,Region>();
	}

	public Iterator<X> execute(Genome a) {
        ChromRegionIterator chroms = new ChromRegionIterator(a);
        Iterator<Region> rchroms = new MapperIterator<NamedRegion,Region>(caster, chroms);
		return new ExpanderIterator<Region,X>(expander, rchroms);
	}

}


text:
<?php

namespace Application\Service\Factory;

use Application\Service\AuthenticationService;
use Interop\Container\ContainerInterface;
use Zend\Db\Adapter\AdapterInterface;
use Zend\ServiceManager\Factory\FactoryInterface;

class AuthenticationServiceFactory implements FactoryInterface
{

    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $dbAdapter = $container->get(AdapterInterface::class);
        $authenticationService = new AuthenticationService($container, $dbAdapter);

        return $authenticationService;
    }
}


text:
.class Lo/zk$if$if;
.super Ljava/lang/Object;

# interfaces
.implements Lo/zk;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lo/zk$if;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "if"
.end annotation

# instance fields
.field private ˊ:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    return-void
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 1

    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    return-object v0
.end method

.method public ˊ(Lcom/google/android/gms/common/api/Status;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/common/api/Status;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0xb

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/common/data/DataHolder;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/common/data/DataHolder;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x5

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/ab;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/ab;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0x9

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/ap;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/ap;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x3

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/at;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/at;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x7

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/aw;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/aw;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0xc

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/p;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/p;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x6

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/r;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/r;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x2

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/t;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/t;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0xd

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/v;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/v;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0xa

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/x;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/x;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x4

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method

.method public ˊ(Lcom/google/android/gms/wearable/internal/z;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.wearable.internal.IWearableCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    if-eqz p1, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p1, v3, v0}, Lcom/google/android/gms/wearable/internal/z;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    iget-object v0, p0, Lo/zk$if$if;->ˊ:Landroid/os/IBinder;

    const/16 v1, 0x8

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_1

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_1
    return-void
.end method


text:
var express = require('express');
var app = express();
var article = require("article");
var kanye = require("../../kanye");
var request = require("request");

var STATE = {
    getState: function(number) {
        if (!this[number]) {
            this[number] = {};
        }
        return this[number];
    }
};

var isImage = function(url) {
    return  url.indexOf("jpg") != -1 ||
            url.indexOf("jpeg") != -1 ||
            url.indexOf("gif") != -1 ||
            url.indexOf("png") != -1;
};

var isImgur = function(url) {
    return url.indexOf("imgur");
}

var makeRedditRequest = function(page, number, res) {
    console.log("reddit request from " + page);
    request("http://reddit.com/top.json?limit=100",
        function(error, response, body) {
            var json = JSON.parse(body);

            var state = STATE.getState(number);
            state.page = page;

            var response = "";
            var num = page + 1;
            json.data.children = json.data.children.splice(page, 5);
            for (var x in json.data.children) {
                var child = json.data.children[x].data;
                var title = child.title;
                response += (num++) + ") " + title + "\n";
            }

            res.send(JSON.stringify({
                message: response,
                number: number
            }));
            res.status(200).end();
    });
};

// The main app can hit this when an SMS is received
app.get('/sms', function(req, res) {
    var message = req.query.message;
    var number = req.query.number;

    // If it's a number
    if (!isNaN(message)) {
        var num = parseInt(message);
        request("http://reddit.com/top.json?limit=100",
            function(error, response, body) {
                console.log("Here");
                var json = JSON.parse(body);

                var child = json.data.children[num-1].data;
                var url = child.url;

                if (isImage(url)) {
                    res.json({
                        media: url,
                        message: child.title,
                        number: number
                    });
                    res.status(200).end();
                } else if (isImgur(url)) {
                    if (url.indexOf('http://') == 0) {
                        url = 'http://i.' + url.substring(7) + ".jpg";
                    } else if (url.indexOf('https://') == 0) {
                        url = 'https://i.' + url.substring(8) + ".jpg";
                    }
                    console.log(url);
                    res.json({
                        media: url,
                        message: child.title,
                        number: number
                    });
                    res.status(200).end();
                } else {
                    request(url).pipe(article(url, function(err, result) {
                        if (err || result.text.length <= child.title) {
                            res.send(JSON.stringify({
                                message: "Sorry, couldn't display that post.",
                                number: number
                            }));
                            return;
                        }
                        console.log(result.text);
                        res.send({
                            message: result.text.substring(0, 1500),
                            number: number
                        });
                        res.status(200).end();
                    }));
                }
        });

        return;
    }

    // The command reddit always starts at page 0
    if (message.trim().toLowerCase() == "reddit") {
        makeRedditRequest(0, number, res);

        return;
    }

    if (message.trim().toLowerCase() == "more" ||
            message.trim().toLowerCase() == "next") {
        console.log("pagination");
        var state = STATE.getState(number);
        console.log(state);
        if (typeof state.page == undefined) {
            res.status(400).end();
            return;
        }

        makeRedditRequest(state.page + 5, number, res);

        return;
    }

    // We should only get here if we couldnt handle the message
    res.status(400).end();
    return;
});

app.listen(3002);


text:
* [Homepage](https://rubygems.org/gems/vortex)
* [Documentation](http://rubydoc.info/gems/vortex/frames)
* [Email](mailto:jweissman1986 at gmail.com)

[![Code Climate GPA](https://codeclimate.com/github/deepcerulean/vortex/badges/gpa.svg)](https://codeclimate.com/github/deepcerulean/vortex)
[ ![Codeship Status for deepcerulean/vortex](https://codeship.com/projects/75145900-f534-0133-fe0e-1a6c3db727a0/status?branch=master)](https://codeship.com/projects/150314)

## Description

A simple example 2-d platformer for dedalus/joyce

## Features

  - cd with codeship + heroku to deploy the server app

## Examples

    require 'vortex'

## Requirements

## Install

    $ gem install vortex

## Synopsis

    $ vortex

## Copyright

Copyright (c) 2016 Joseph Weissman

See {file:LICENSE.txt} for details.


text:
This program computes the nth fibonacci number using an algorithm that has log(n) complexity.

Usage: run `make` in the command line and then call `./fibLog [n]`. The program will compute the [n]th fibonacci number using an algorithm that has log(n) complexity.

To clean your directory, run `make clean`. This will remove all object and executable files from your directory.


text:
require 'spec_helper'

describe 'ibm-im-test::install_im' do
  cached(:centos_67_install_im) do
    ChefSpec::ServerRunner.new(
      file_cache_path: '/tmp/cache',
      step_into: 'install_mgr'
    ) do
    end.converge('ibm-im-test::install_im')
  end

  # test recipe compilation
  context 'when compiling the recipe' do
    it 'installs install_mgr[ibm-im install]' do
      expect(centos_67_install_im).to install_install_mgr('ibm-im install')
    end
  end

  context 'when stepping into install_mgr' do
    it 'creates ibm-im user' do
      expect(centos_67_install_im).to create_user('ibm-im').with(home: '/home/ibm-im')
    end

    it 'creates home dir' do
      expect(centos_67_install_im).to create_directory('/home/ibm-im').with(
        user:   'ibm-im',
        group:  'ibm-im',
        mode:   '0750'
      )
    end

    it 'creates ibm-im group ' do
      expect(centos_67_install_im).to create_group('ibm-im')
    end

    dirs = %w[
      /opt/IBM
      /tmp/cache/ibm-installmgr
      /opt/IBM/InstallationManager/eclipse
      /var/IBM/InstallationManager
    ]
    it 'creates these directories' do
      dirs.each do |dir|
        expect(centos_67_install_im).to create_directory(dir).with(
          user:   'ibm-im',
          group:  'ibm-im',
          mode:   '0750'
        )
      end
    end

    # it 'installs unzip package' do
    #   expect(centos_67_install_im).to install_yum_package('unzip')
    # end

    it 'executes unzip command' do
      expect(centos_67_install_im).to run_execute('unzip ibm-im installer package')
    end

    it 'executes imcl install' do
      expect(centos_67_install_im).to run_execute('install im com.ibm.cic.agent')
    end
  end
end


text:
#include "tensorflow/core/example/feature_util.h"

#include <string>

#include "absl/strings/string_view.h"

namespace tensorflow {

namespace internal {
Feature& ExampleFeature(absl::string_view name, Example* example) {
  return *GetFeature(name, example);
}

}  // namespace internal

template <>
bool HasFeature<>(absl::string_view key, const Features& features) {
  return features.feature().contains(internal::ProtoMapKey(key));
}

template <>
bool HasFeature<protobuf_int64>(absl::string_view key,
                                const Features& features) {
  auto it = features.feature().find(internal::ProtoMapKey(key));
  return (it != features.feature().end()) &&
         (it->second.kind_case() == Feature::KindCase::kInt64List);
}

template <>
bool HasFeature<float>(absl::string_view key, const Features& features) {
  auto it = features.feature().find(internal::ProtoMapKey(key));
  return (it != features.feature().end()) &&
         (it->second.kind_case() == Feature::KindCase::kFloatList);
}

template <>
bool HasFeature<std::string>(absl::string_view key, const Features& features) {
  auto it = features.feature().find(internal::ProtoMapKey(key));
  return (it != features.feature().end()) &&
         (it->second.kind_case() == Feature::KindCase::kBytesList);
}

template <>
bool HasFeature<tstring>(absl::string_view key, const Features& features) {
  auto it = features.feature().find(internal::ProtoMapKey(key));
  return (it != features.feature().end()) &&
         (it->second.kind_case() == Feature::KindCase::kBytesList);
}

bool HasFeatureList(absl::string_view key,
                    const SequenceExample& sequence_example) {
  return sequence_example.feature_lists().feature_list().contains(
      internal::ProtoMapKey(key));
}

template <>
const protobuf::RepeatedField<protobuf_int64>& GetFeatureValues<protobuf_int64>(
    const Feature& feature) {
  return feature.int64_list().value();
}

template <>
protobuf::RepeatedField<protobuf_int64>* GetFeatureValues<protobuf_int64>(
    Feature* feature) {
  return feature->mutable_int64_list()->mutable_value();
}

template <>
const protobuf::RepeatedField<float>& GetFeatureValues<float>(
    const Feature& feature) {
  return feature.float_list().value();
}

template <>
protobuf::RepeatedField<float>* GetFeatureValues<float>(Feature* feature) {
  return feature->mutable_float_list()->mutable_value();
}

template <>
const protobuf::RepeatedPtrField<std::string>& GetFeatureValues<tstring>(
    const Feature& feature) {
  return feature.bytes_list().value();
}

template <>
const protobuf::RepeatedPtrField<std::string>& GetFeatureValues<std::string>(
    const Feature& feature) {
  return feature.bytes_list().value();
}

template <>
protobuf::RepeatedPtrField<std::string>* GetFeatureValues<tstring>(
    Feature* feature) {
  return feature->mutable_bytes_list()->mutable_value();
}

template <>
protobuf::RepeatedPtrField<std::string>* GetFeatureValues<std::string>(
    Feature* feature) {
  return feature->mutable_bytes_list()->mutable_value();
}

const protobuf::RepeatedPtrField<Feature>& GetFeatureList(
    absl::string_view key, const SequenceExample& sequence_example) {
  return sequence_example.feature_lists()
      .feature_list()
      .at(internal::ProtoMapKey(key))
      .feature();
}

protobuf::RepeatedPtrField<Feature>* GetFeatureList(
    absl::string_view feature_list_key, SequenceExample* sequence_example) {
  return (*sequence_example->mutable_feature_lists()
               ->mutable_feature_list())[internal::ProtoMapKey(
                                             feature_list_key)]
      .mutable_feature();
}

template <>
void ClearFeatureValues<protobuf_int64>(Feature* feature) {
  feature->mutable_int64_list()->Clear();
}

template <>
void ClearFeatureValues<float>(Feature* feature) {
  feature->mutable_float_list()->Clear();
}

template <>
void ClearFeatureValues<std::string>(Feature* feature) {
  feature->mutable_bytes_list()->Clear();
}

template <>
void ClearFeatureValues<tstring>(Feature* feature) {
  feature->mutable_bytes_list()->Clear();
}

template <>
Features* GetFeatures<Features>(Features* proto) {
  return proto;
}

template <>
Features* GetFeatures<Example>(Example* proto) {
  return proto->mutable_features();
}

template <>
Features* GetFeatures<SequenceExample>(SequenceExample* proto) {
  return proto->mutable_context();
}

template <>
const Features& GetFeatures<Features>(const Features& proto) {
  return proto;
}

template <>
const Features& GetFeatures<Example>(const Example& proto) {
  return proto.features();
}

template <>
const Features& GetFeatures<SequenceExample>(const SequenceExample& proto) {
  return proto.context();
}

template <>
const protobuf::RepeatedField<protobuf_int64>& GetFeatureValues<protobuf_int64>(
    const Feature& feature);

template <>
protobuf::RepeatedField<protobuf_int64>* GetFeatureValues<protobuf_int64>(
    Feature* feature);

template <>
const protobuf::RepeatedField<float>& GetFeatureValues<float>(
    const Feature& feature);

template <>
protobuf::RepeatedField<float>* GetFeatureValues<float>(Feature* feature);

template <>
const protobuf::RepeatedPtrField<std::string>& GetFeatureValues<std::string>(
    const Feature& feature);

template <>
const protobuf::RepeatedPtrField<std::string>& GetFeatureValues<tstring>(
    const Feature& feature);

template <>
protobuf::RepeatedPtrField<std::string>* GetFeatureValues<std::string>(
    Feature* feature);

template <>
protobuf::RepeatedPtrField<std::string>* GetFeatureValues<tstring>(
    Feature* feature);

}  // namespace tensorflow


text:
#include "bgp/bgp_show_handler.h"

#include <boost/bind.hpp>
#include <boost/foreach.hpp>

#include "base/time_util.h"
#include "bgp/bgp_config.h"
#include "bgp/bgp_peer_internal_types.h"
#include "bgp/bgp_peer_types.h"
#include "bgp/bgp_server.h"

using std::string;
using std::vector;

//
// Fill in information for an instance.
//
static void FillBgpInstanceConfigInfo(ShowBgpInstanceConfig *sbic,
    const BgpSandeshContext *bsc, const BgpInstanceConfig *instance) {
    sbic->set_name(instance->name());
    sbic->set_virtual_network(instance->virtual_network());
    sbic->set_virtual_network_index(instance->virtual_network_index());
    sbic->set_vxlan_id(instance->vxlan_id());

    vector<string> import_list;
    BOOST_FOREACH(std::string rt, instance->import_list()) {
        import_list.push_back(rt);
    }
    sbic->set_import_target(import_list);
    vector<string> export_list;
    BOOST_FOREACH(std::string rt, instance->export_list()) {
        export_list.push_back(rt);
    }
    sbic->set_export_target(export_list);
    sbic->set_last_change_at(UTCUsecToString(instance->last_change_at()));

    vector<ShowBgpServiceChainConfig> sbscc_list;
    BOOST_FOREACH(const ServiceChainConfig &sc_config,
        instance->service_chain_list()) {
        ShowBgpServiceChainConfig sbscc;
        sbscc.set_family(Address::FamilyToString(sc_config.family));
        sbscc.set_routing_instance(sc_config.routing_instance);
        sbscc.set_service_instance(sc_config.service_instance);
        sbscc.set_chain_address(sc_config.service_chain_address);
        sbscc.set_prefixes(sc_config.prefix);
        sbscc_list.push_back(sbscc);
    }
    sbic->set_service_chain_infos(sbscc_list);

    vector<ShowBgpStaticRouteConfig> static_route_list;
    BOOST_FOREACH(const StaticRouteConfig &rtconfig,
        instance->static_routes()) {
        ShowBgpStaticRouteConfig sbsrc;
        string prefix = rtconfig.address.to_string() + "/";
        prefix += integerToString(rtconfig.prefix_length);
        sbsrc.set_prefix(prefix);
        sbsrc.set_targets(rtconfig.route_target);
        sbsrc.set_nexthop(rtconfig.nexthop.to_string());
        static_route_list.push_back(sbsrc);
    }
    if (!static_route_list.empty())
        sbic->set_static_routes(static_route_list);
}

//
// Specialization of BgpShowHandler<>::CallbackCommon.
//
template <>
bool BgpShowHandler<ShowBgpInstanceConfigReq, ShowBgpInstanceConfigReqIterate,
    ShowBgpInstanceConfigResp, ShowBgpInstanceConfig>::CallbackCommon(
    const BgpSandeshContext *bsc, Data *data) {
    uint32_t page_limit = bsc->page_limit() ? bsc->page_limit() : kPageLimit;
    uint32_t iter_limit = bsc->iter_limit() ? bsc->iter_limit() : kIterLimit;
    const BgpConfigManager *bcm = bsc->bgp_server->config_manager();

    BgpConfigManager::InstanceMapRange range =
        bcm->InstanceMapItems(data->next_entry);
    BgpConfigManager::InstanceMap::const_iterator it = range.first;
    BgpConfigManager::InstanceMap::const_iterator it_end = range.second;
    for (uint32_t iter_count = 0; it != it_end; ++it, ++iter_count) {
        const BgpInstanceConfig *instance = it->second;
        if (!data->search_string.empty() &&
            (instance->name().find(data->search_string) == string::npos)) {
            continue;
        }

        ShowBgpInstanceConfig sbic;
        FillBgpInstanceConfigInfo(&sbic, bsc, instance);
        data->show_list.push_back(sbic);
        if (data->show_list.size() >= page_limit)
            break;
        if (iter_count >= iter_limit)
            break;
    }

    // All done if we've looked at all instances.
    if (it == it_end || ++it == it_end)
        return true;

    // Return true if we've reached the page limit, false if we've reached the
    // iteration limit.
    bool done = data->show_list.size() >= page_limit;
    SaveContextToData(it->second->name(), done, data);
    return done;
}

//
// Specialization of BgpShowHandler<>::FillShowList.
//
template <>
void BgpShowHandler<ShowBgpInstanceConfigReq, ShowBgpInstanceConfigReqIterate,
    ShowBgpInstanceConfigResp, ShowBgpInstanceConfig>::FillShowList(
        ShowBgpInstanceConfigResp *resp,
        const vector<ShowBgpInstanceConfig> &show_list) {
    resp->set_instances(show_list);
}

//
// Handler for ShowBgpInstanceConfigReq.
//
void ShowBgpInstanceConfigReq::HandleRequest() const {
    RequestPipeline::PipeSpec ps(this);
    RequestPipeline::StageSpec s1;
    TaskScheduler *scheduler = TaskScheduler::GetInstance();

    s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
    s1.cbFn_ = boost::bind(&BgpShowHandler<
        ShowBgpInstanceConfigReq,
        ShowBgpInstanceConfigReqIterate,
        ShowBgpInstanceConfigResp,
        ShowBgpInstanceConfig>::Callback, _1, _2, _3, _4, _5);
    s1.allocFn_ = BgpShowHandler<
        ShowBgpInstanceConfigReq,
        ShowBgpInstanceConfigReqIterate,
        ShowBgpInstanceConfigResp,
        ShowBgpInstanceConfig>::CreateData;
    s1.instances_.push_back(0);
    ps.stages_.push_back(s1);
    RequestPipeline rp(ps);
}

//
// Handler for ShowBgpInstanceConfigReqIterate.
//
void ShowBgpInstanceConfigReqIterate::HandleRequest() const {
    RequestPipeline::PipeSpec ps(this);
    RequestPipeline::StageSpec s1;
    TaskScheduler *scheduler = TaskScheduler::GetInstance();

    s1.taskId_ = scheduler->GetTaskId("bgp::ShowCommand");
    s1.cbFn_ = boost::bind(&BgpShowHandler<
        ShowBgpInstanceConfigReq,
        ShowBgpInstanceConfigReqIterate,
        ShowBgpInstanceConfigResp,
        ShowBgpInstanceConfig>::CallbackIterate, _1, _2, _3, _4, _5);
    s1.allocFn_ = BgpShowHandler<
        ShowBgpInstanceConfigReq,
        ShowBgpInstanceConfigReqIterate,
        ShowBgpInstanceConfigResp,
        ShowBgpInstanceConfig>::CreateData;
    s1.instances_.push_back(0);
    ps.stages_.push_back(s1);
    RequestPipeline rp(ps);
}