text:
using System;
using System.IO;
using System.Text;

using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto.Macs;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto.Utilities;
using Org.BouncyCastle.Utilities;
using Org.BouncyCastle.Utilities.IO;

namespace Org.BouncyCastle.Crypto.Tls
{
	/// <remarks>Some helper fuctions for MicroTLS.</remarks>
	public class TlsUtilities
	{
		internal static byte[] ToByteArray(string str)
		{
			return Strings.ToByteArray(str);
		}

		internal static void WriteUint8(short i, Stream os)
		{
			os.WriteByte((byte)i);
		}

		internal static void WriteUint8(short i, byte[] buf, int offset)
		{
			buf[offset] = (byte)i;
		}

		internal static void WriteUint16(int i, Stream os)
		{
			os.WriteByte((byte)(i >> 8));
			os.WriteByte((byte)i);
		}

		internal static void WriteUint16(int i, byte[] buf, int offset)
		{
			buf[offset] = (byte)(i >> 8);
			buf[offset + 1] = (byte)i;
		}

		internal static void WriteUint24(int i, Stream os)
		{
			os.WriteByte((byte)(i >> 16));
			os.WriteByte((byte)(i >> 8));
			os.WriteByte((byte)i);
		}

		internal static void WriteUint24(int i, byte[] buf, int offset)
		{
			buf[offset] = (byte)(i >> 16);
			buf[offset + 1] = (byte)(i >> 8);
			buf[offset + 2] = (byte)(i);
		}

		internal static void WriteUint64(long i, Stream os)
		{
			os.WriteByte((byte)(i >> 56));
			os.WriteByte((byte)(i >> 48));
			os.WriteByte((byte)(i >> 40));
			os.WriteByte((byte)(i >> 32));
			os.WriteByte((byte)(i >> 24));
			os.WriteByte((byte)(i >> 16));
			os.WriteByte((byte)(i >> 8));
			os.WriteByte((byte)i);
		}

		internal static void WriteUint64(long i, byte[] buf, int offset)
		{
			buf[offset] = (byte)(i >> 56);
			buf[offset + 1] = (byte)(i >> 48);
			buf[offset + 2] = (byte)(i >> 40);
			buf[offset + 3] = (byte)(i >> 32);
			buf[offset + 4] = (byte)(i >> 24);
			buf[offset + 5] = (byte)(i >> 16);
			buf[offset + 6] = (byte)(i >> 8);
			buf[offset + 7] = (byte)(i);
		}

		internal static short ReadUint8(Stream inStr)
		{
			int i = inStr.ReadByte();
			if (i < 0)
			{
				throw new EndOfStreamException();
			}
			return (short)i;
		}

		internal static int ReadUint16(Stream inStr)
		{
			int i1 = inStr.ReadByte();
			int i2 = inStr.ReadByte();
			if ((i1 | i2) < 0)
			{
				throw new EndOfStreamException();
			}
			return i1 << 8 | i2;
		}

		internal static int ReadUint24(Stream inStr)
		{
			int i1 = inStr.ReadByte();
			int i2 = inStr.ReadByte();
			int i3 = inStr.ReadByte();
			if ((i1 | i2 | i3) < 0)
			{
				throw new EndOfStreamException();
			}
			return (i1 << 16) | (i2 << 8) | i3;
		}

		internal static void ReadFully(byte[] buf, Stream inStr)
		{
			if (Streams.ReadFully(inStr, buf, 0, buf.Length) < buf.Length)
				throw new EndOfStreamException();
		}

		internal static void CheckVersion(byte[] readVersion, TlsProtocolHandler handler)
		{
			if ((readVersion[0] != 3) || (readVersion[1] != 1))
			{
				handler.FailWithError(TlsProtocolHandler.AL_fatal, TlsProtocolHandler.AP_protocol_version);
			}
		}

		internal static void CheckVersion(Stream inStr, TlsProtocolHandler handler)
		{
			int i1 = inStr.ReadByte();
			int i2 = inStr.ReadByte();
			if ((i1 != 3) || (i2 != 1))
			{
				handler.FailWithError(TlsProtocolHandler.AL_fatal, TlsProtocolHandler.AP_protocol_version);
			}
		}

		internal static void WriteVersion(Stream os)
		{
			os.WriteByte(3);
			os.WriteByte(1);
		}

		private static void hmac_hash(IDigest digest, byte[] secret, byte[] seed, byte[] output)
		{
			HMac mac = new HMac(digest);
			KeyParameter param = new KeyParameter(secret);
			byte[] a = seed;
			int size = digest.GetDigestSize();
			int iterations = (output.Length + size - 1) / size;
			byte[] buf = new byte[mac.GetMacSize()];
			byte[] buf2 = new byte[mac.GetMacSize()];
			for (int i = 0; i < iterations; i++)
			{
				mac.Init(param);
				mac.BlockUpdate(a, 0, a.Length);
				mac.DoFinal(buf, 0);
				a = buf;
				mac.Init(param);
				mac.BlockUpdate(a, 0, a.Length);
				mac.BlockUpdate(seed, 0, seed.Length);
				mac.DoFinal(buf2, 0);
				Array.Copy(buf2, 0, output, (size * i), System.Math.Min(size, output.Length - (size * i)));
			}
		}

		internal static void PRF(
			byte[]	secret,
			byte[]	label,
			byte[]	seed,
			byte[]	buf)
		{
			int s_half = (secret.Length + 1) / 2;
			byte[] s1 = new byte[s_half];
			byte[] s2 = new byte[s_half];
			Array.Copy(secret, 0, s1, 0, s_half);
			Array.Copy(secret, secret.Length - s_half, s2, 0, s_half);

			byte[] ls = new byte[label.Length + seed.Length];
			Array.Copy(label, 0, ls, 0, label.Length);
			Array.Copy(seed, 0, ls, label.Length, seed.Length);

			byte[] prf = new byte[buf.Length];
			hmac_hash(new MD5Digest(), s1, ls, prf);
			hmac_hash(new Sha1Digest(), s2, ls, buf);
			for (int i = 0; i < buf.Length; i++)
			{
				buf[i] ^= prf[i];
			}
		}
	}
}


text:
package org.apache.geode.management.internal.security;

import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER;
import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.util.Properties;
import java.util.Scanner;

import org.apache.commons.lang.ArrayUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.security.AuthenticationFailedException;
import org.apache.geode.security.SecurityManager;
import org.apache.geode.test.junit.rules.GfshShellConnectionRule;
import org.apache.geode.test.dunit.rules.LocatorServerStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.categories.IntegrationTest;

@Category(IntegrationTest.class)
public class LogNoPasswordTest {

  private static String PASSWORD = "abcdefghijklmn";
  @Rule
  public LocatorServerStartupRule lsRule = new LocatorServerStartupRule().withLogFile();

  @Rule
  public GfshShellConnectionRule gfsh = new GfshShellConnectionRule();

  @Test
  public void testPasswordInLogs() throws Exception {
    Properties properties = new Properties();
    properties.setProperty(LOG_LEVEL, "debug");
    properties.setProperty(SECURITY_MANAGER, MySecurityManager.class.getName());
    MemberVM locator = lsRule.startLocatorVM(0, properties);
    gfsh.secureConnectAndVerify(locator.getHttpPort(), GfshShellConnectionRule.PortType.http, "any",
        PASSWORD);
    gfsh.executeAndVerifyCommand("list members");

    // scan all locator log files to find any occurrences of password
    File[] serverLogFiles =
        locator.getWorkingDir().listFiles(file -> file.toString().endsWith(".log"));
    File[] gfshLogFiles = gfsh.getWorkingDir().listFiles(file -> file.toString().endsWith(".log"));

    File[] logFiles = (File[]) ArrayUtils.addAll(serverLogFiles, gfshLogFiles);

    for (File logFile : logFiles) {
      Scanner scanner = new Scanner(logFile);
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        assertThat(line).describedAs("File: %s, Line: %s", logFile.getAbsolutePath(), line)
            .doesNotContain(PASSWORD);
      }
    }
  }

  public static class MySecurityManager implements SecurityManager {
    @Override
    public Object authenticate(Properties credentials) throws AuthenticationFailedException {
      String user = credentials.getProperty("security-username");
      String password = credentials.getProperty("security-password");
      if (PASSWORD.equals(password)) {
        return user;
      }

      throw new AuthenticationFailedException("Not authenticated.");
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
$settings = array(
    'zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
    'user_entity_class' => 'ZfcUser\Entity\User',
    'enable_registration' => true,
    'enable_username' => true,
    'auth_adapters' => array( 100 => 'ZfcUser\Authentication\Adapter\Db' ),
    'enable_display_name' => true,
    'auth_identity_fields' => array('email', 'username'),
    'login_form_timeout' => 300,
    'user_form_timeout' => 600,
    'login_after_registration' => false,
    'use_registration_form_captcha' => false,
    'use_redirect_parameter_if_present' => true,

    //'user_login_widget_view_template' => 'zfc-user/user/login.phtml',
    //'login_redirect_route' => 'zfcuser/user',
    //'logout_redirect_route' => 'zfcuser/user/login',

    //'password_cost' => 14,
    //'enable_user_state' => true,

    //'default_user_state' => 1,
    //'allowed_login_states' => array( null, 1 ),

    'table_name' => 'user',
);

/**
 * You do not need to edit below this line
 */
return array(
    'zfcuser' => $settings,
    'service_manager' => array(
        'aliases' => array(
            'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter']: 'Zend\Db\Adapter\Adapter',
        ),
    ),
);


text:
package org.apache.sling.launchpad.testservices.servlets;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.servlets.post.AbstractPostResponse;
import org.apache.sling.servlets.post.PostResponse;
import org.apache.sling.servlets.post.PostResponseCreator;

/**
 * Sample implementation of the PostResponseCreator interface.
 */
@Component
@Service
public class CustomPostResponseCreatorImpl implements PostResponseCreator {

    public PostResponse createPostResponse(SlingHttpServletRequest req) {
        if ("custom".equals(req.getParameter(":responseType"))) {
            return new AbstractPostResponse() {

                public void onChange(String type, String... arguments) {
                    // NO-OP
                }

                @Override
                protected void doSend(HttpServletResponse response) throws IOException {
                    response.setContentType("text/html");
                    response.setCharacterEncoding("UTF-8");

                    response.getWriter().write("Thanks!");
                    response.getWriter().flush();
                }

            };
        } else {
            return null;
        }
    }
}


text:
// Copyright (c) 2005  Stanford University (USA).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s)     : Daniel Russel <drussel@alumni.princeton.edu>

#ifndef CGAL_KINETIC_ROOT_DEGEN_FK_H
#define CGAL_KINETIC_ROOT_DEGEN_FK_H
#include <CGAL/Kinetic/basic.h>
#include <CGAL/Kinetic/internal/debug_counters.h>

namespace CGAL { namespace Kinetic {

template <class Traits_t, bool SLOPPY>
class HDRS{
  private:
    typedef typename Traits_t::Root_stack Wrapped_solver;
    typedef typename Traits_t::Function Function;

  public:
    typedef typename Wrapped_solver::Root Root;
    typedef Traits_t Traits;
    //! Construct and check preconditions
    /*!

    */
    HDRS(const Function &uf, const Root& lb,
	 const Root& ub, const Traits_t& k): solver_(k.root_stack_object(uf, lb, ub)) {
      CGAL_LOG(Log::LOTS, "Function= " << uf << std::endl);
      CGAL_expensive_precondition(solver_.empty() || solver_.top() >= lb);
      if (uf.degree() == -1) {
	CGAL_LOG(Log::SOME, "Zero function found at time " << lb << std::endl);
	++ internal::zero_certificates__;
      }
#ifndef NDEBUG
      if (!SLOPPY && k.sign_at_object()(uf, lb) == CGAL::NEGATIVE) {
	CGAL_ERROR( "Invalid certificate constructed for function " << uf << " between " << lb
			    << " and " << ub << " will fail immediately." << std::endl);
	CGAL_exactness_precondition(k.sign_at_object()(uf, lb) != CGAL::NEGATIVE);
      }
#endif
      if (solver_.empty()) {
	CGAL_LOG(Log::LOTS, "No failure" << std::endl);
	 //sn = k.sign_between_roots_object()(uf, lb, ub);
      } else if (solver_.top() == lb) {
	CGAL_LOG(Log::LOTS, "Degeneracy at " << solver_.top() << std::endl);
	CGAL::Sign sn = k.sign_after_object()(uf, lb);
	if (sn == CGAL::NEGATIVE) {
	  ++internal::function_degeneracies__;
	  CGAL_LOG(Log::LOTS, "Extra root at lower bound of " << lb << std::endl);
	} else {
	  CGAL_LOG(Log::LOTS, "Popping extra root at lower bound of " << lb << std::endl);
	  solver_.pop();
	}
      }
    }

    HDRS(){}

    //! Drop even roots
    const Root& top() const
    {
      return solver_.top();
    }

    void pop() {
      solver_.pop();
    }

    bool empty() const
    {
      return solver_.empty();
    }
  /*double estimate() const {
      return solver_.estimate();
      }*/

    std::ostream &write(std::ostream& out) const {
      out << solver_;
      return out;
    }

  protected:
    Wrapped_solver solver_;
  };

template <class Traits_t, bool SLOPPY>
struct Handle_degeneracy_function_kernel: public Traits_t
{

  typedef HDRS<Traits_t, SLOPPY> Root_stack;

  Root_stack root_stack_object(const typename Traits_t::Function &f,
			       const typename Traits_t::Root &lb,
			       const typename Traits_t::Root &ub) const {
    return Root_stack(f, lb, ub, *this);
  }
};

template <class T, bool SLOPPY>
std::ostream &operator<<(std::ostream &out, const HDRS<T, SLOPPY> &k) {
  return k.write(out);
}

} } //namespace CGAL::Kinetic
#endif


text:
package org.kuali.rice.core.api.uif;

import org.kuali.rice.core.api.CoreConstants;
import org.w3c.dom.Element;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.Collection;

/**
 * A password input control type.
 */
@XmlRootElement(name = RemotablePasswordInput.Constants.ROOT_ELEMENT_NAME)
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = RemotablePasswordInput.Constants.TYPE_NAME, propOrder = {
        RemotablePasswordInput.Elements.SIZE,
		CoreConstants.CommonElements.FUTURE_ELEMENTS })
public final class RemotablePasswordInput extends RemotableAbstractControl implements Sized {

    @XmlElement(name = Elements.SIZE, required = false)
    private final Integer size;

    @Override
    public Integer getSize() {
        return size;
    }

    @SuppressWarnings("unused")
    @XmlAnyElement
    private final Collection<Element> _futureElements = null;

    /**
     * Should only be invoked by JAXB.
     */
    @SuppressWarnings("unused")
    private RemotablePasswordInput() {
        size = null;
    }

    private RemotablePasswordInput(Builder b) {
        size = b.size;
    }

    public static final class Builder extends RemotableAbstractControl.Builder implements Sized {
        private Integer size;

        private Builder() {
            super();
        }

        public static Builder create() {
            return new Builder();
        }

        @Override
        public Integer getSize() {
            return size;
        }

        public void setSize(Integer size) {
            if (size != null && size < 1) {
                throw new IllegalArgumentException("size was < 1");
            }

            this.size = size;
        }

        @Override
        public RemotablePasswordInput build() {
            return new RemotablePasswordInput(this);
        }
    }

    /**
     * Defines some internal constants used on this class.
     */
    static final class Constants {
        static final String TYPE_NAME = "PasswordInputType";
        final static String ROOT_ELEMENT_NAME = "passwordInput";
    }

    static final class Elements {
        static final String SIZE = "size";
    }
}


text:
var once = require('once')

module.exports = function getBuffer (stream, length, cb) {
  cb = once(cb)
  var buf = new Buffer(length)
  var offset = 0
  stream
    .on('data', function (chunk) {
      chunk.copy(buf, offset)
      offset += chunk.length
    })
    .on('end', function () { cb(null, buf) })
    .on('error', cb)
}


text:
Microtut frontend
=================

Install bower dependencies:
```
bower install mustache jquery materialize
```

Open `index.html` to run the frontend, make sure that the api gateway and other services are running.


text:
<title>OGRE: Member List - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Class List

Class Index

Class Hierarchy

Class Members

Ogre

RotationalSpline

Ogre::RotationalSpline Member List

This is the complete list of members for Ogre::RotationalSpline, including all inherited members.

addPoint(const Quaternion &p)	Ogre::RotationalSpline

clear(void)	Ogre::RotationalSpline

getNumPoints(void) const 	Ogre::RotationalSpline

getPoint(unsigned short index) const 	Ogre::RotationalSpline

interpolate(Real t, bool useShortestPath=true)	Ogre::RotationalSpline

interpolate(unsigned int fromIndex, Real t, bool useShortestPath=true)	Ogre::RotationalSpline

mAutoCalc	Ogre::RotationalSpline	 [protected]

mPoints	Ogre::RotationalSpline	 [protected]

mTangents	Ogre::RotationalSpline	 [protected]

recalcTangents(void)	Ogre::RotationalSpline

RotationalSpline()	Ogre::RotationalSpline

setAutoCalculate(bool autoCalc)	Ogre::RotationalSpline

updatePoint(unsigned short index, const Quaternion &value)	Ogre::RotationalSpline

~RotationalSpline()	Ogre::RotationalSpline

Copyright © 2008 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sat Jan 14 2012 18:40:52


text:
#ifndef _ELM_LAYERS_LAYERGRAPH_H_
#define _ELM_LAYERS_LAYERGRAPH_H_

#include <string>
#include <set>
#include <vector>

#include "elm/core/typedefs_fwd.h"

namespace elm {

class Signal;
class LayerGraph_Impl;
typedef std::set<std::string> SetS;     ///< convinience typedef for set of strings

/** @brief Layer Graph for managing non-linear layer pipelines
  */
class LayerGraph
{
public:
    ~LayerGraph();

    LayerGraph();

    /**
     * @brief Add layer and associated info to graph
     * @param name layer name
     * @param layer shared layer instance
     * @param cfg configuration
     * @param io I/O
     */
    void Add(const std::string &name,
             LayerShared &layer,
             const LayerConfig &cfg,
             const LayerIONames &io);

    /**
     * @brief Add registered layer and associated info to graph
     * @param name registered layer name, registered with layer factory
     * @param cfg configuration
     * @param io I/O
     */
    void Add(const std::string &name,
             const LayerConfig &cfg,
             const LayerIONames &io);

    /**
     * @brief Request output
     * @param output_name
     * @throws ExceptionKeyError if unavailable
     */
    void AddOutput(const std::string &output_name);

    /**
     * @brief Get list of outputs generated by graph
     * @return list of unique outputs
     */
    SetS Outputs() const;

    /**
     * @brief Get list of primary inputs required by active layers
     * Primary inputs are inputs not generated by any active layers in the graph
     * @return list of unique primary input names
     */
    SetS Inputs() const;

    /**
     * @brief Clear Active layers
     */
    void ClearActive();

    /**
     * @brief Configure active layers
     */
    void Configure();

    /**
     * @brief reconfigure any layers with configured with given parameter key value pair
     * @param key parameter key
     * @param value new parameter value
     * @return no. of layers updated with new value
     */
    template <class TVal>
    int Reconfigure(const std::string &key, const TVal& value);

    /**
     * @brief Get Sequence of layers for generating requested outputs
     * @param[out] ordered list of layers
     */
    void Sequence(std::vector<LayerShared> &layer_seq);

    /**
     * @brief get number of layers in graph
     * @return number of layers
     */
    size_t num_layers() const;

    /**
     * @brief Process active layers and gather their response
     * @param[in] layers ordered list of layers
     * @param s signal with external input, populated with layer responses
     */
    void ActivateForResponse(const std::vector<LayerShared> &layers, Signal &s);

    /**
     * @brief Save graph to file
     * @param[in] file_path
     */
    void Save(const std::string &file_path) const;

    /**
     * @brief Save graph to JSON file
     * @param[in] file_path
     */
    void SaveJSON(const std::string &file_path) const;

    /**
     * @brief Load graph from file
     * @param[in] file_path
     */
    void Load(const std::string &file_path);

    /**
     * @brief Load graph from file from JSON file
     * @param[in] file_path
     */
    void LoadJSON(const std::string &file_path);

protected:
    LayerGraph_Impl *impl_;
};

} // namespace elm

namespace elm {

// template specializations for LayerGraph::Reconfigure()
template <>
int LayerGraph::Reconfigure<bool>(const std::string &key, const bool& value);

template <>
int LayerGraph::Reconfigure<float>(const std::string &key, const float& value);

template <>
int LayerGraph::Reconfigure<int>(const std::string &key, const int& value);

template <>
int LayerGraph::Reconfigure<std::string>(const std::string &key, const std::string& value);

} // namespace elm

#endif // _ELM_LAYERS_LAYERGRAPH_H_


text:
while True:
	pass


text:
<?php
namespace OptimusCrime\Site\Configuration;

class Configuration
{
    const SERVER = 'server';
    const GENERATOR = 'generator';
}


text:
package com.netflix.ribbon.http;

import com.netflix.hystrix.HystrixInvokableInfo;
import com.netflix.hystrix.HystrixObservableCommand;
import com.netflix.ribbon.RequestWithMetaData;
import com.netflix.ribbon.RibbonResponse;
import com.netflix.ribbon.hystrix.HystrixObservableCommandChain;
import com.netflix.ribbon.hystrix.ResultCommandPair;
import io.netty.buffer.ByteBuf;
import rx.Notification;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.subjects.ReplaySubject;
import rx.subjects.Subject;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;

class HttpMetaRequest<T> implements RequestWithMetaData<T> {

    private static class ResponseWithSubject<T> extends RibbonResponse<Observable<T>> {
        Subject<T, T> subject;
        HystrixInvokableInfo<?> info;

        public ResponseWithSubject(Subject<T, T> subject,
                                   HystrixInvokableInfo<?> info) {
            this.subject = subject;
            this.info = info;
        }

        @Override
        public Observable<T> content() {
            return subject;
        }

        @Override
        public HystrixInvokableInfo<?> getHystrixInfo() {
            return info;
        }
    }

    private final HttpRequest<T> request;

    HttpMetaRequest(HttpRequest<T> request) {
        this.request = request;
    }

    @Override
    public Observable<RibbonResponse<Observable<T>>> toObservable() {
        HystrixObservableCommandChain<T> commandChain = request.createHystrixCommandChain();
        return convertToRibbonResponse(commandChain, commandChain.toResultCommandPairObservable());
    }

    @Override
    public Observable<RibbonResponse<Observable<T>>> observe() {
        HystrixObservableCommandChain<T> commandChain = request.createHystrixCommandChain();
        Observable<ResultCommandPair<T>> notificationObservable = commandChain.toResultCommandPairObservable();
        notificationObservable = retainBufferIfNeeded(notificationObservable);
        ReplaySubject<ResultCommandPair<T>> subject = ReplaySubject.create();
        notificationObservable.subscribe(subject);
        return convertToRibbonResponse(commandChain, subject);
    }

    @Override
    public Future<RibbonResponse<T>> queue() {
        Observable<ResultCommandPair<T>> resultObservable = request.createHystrixCommandChain().toResultCommandPairObservable();
        resultObservable = retainBufferIfNeeded(resultObservable);
        final Future<ResultCommandPair<T>> f = resultObservable.toBlocking().toFuture();
        return new Future<RibbonResponse<T>>() {
            @Override
            public boolean cancel(boolean mayInterruptIfRunning) {
                return f.cancel(mayInterruptIfRunning);
            }

            @Override
            public RibbonResponse<T> get() throws InterruptedException,
                    ExecutionException {
                final ResultCommandPair<T> pair = f.get();
                return new HttpMetaResponse<T>(pair.getResult(), pair.getCommand());
            }

            @Override
            public RibbonResponse<T> get(long timeout, TimeUnit timeUnit)
                    throws InterruptedException, ExecutionException,
                    TimeoutException {
                final ResultCommandPair<T> pair = f.get(timeout, timeUnit);
                return new HttpMetaResponse<T>(pair.getResult(), pair.getCommand());
            }

            @Override
            public boolean isCancelled() {
                return f.isCancelled();
            }

            @Override
            public boolean isDone() {
                return f.isDone();
            }
        };
    }

    @Override
    public RibbonResponse<T> execute() {
        RibbonResponse<Observable<T>> response = observe().toBlocking().last();
        return new HttpMetaResponse<T>(response.content().toBlocking().last(), response.getHystrixInfo());
    }

    private Observable<ResultCommandPair<T>> retainBufferIfNeeded(Observable<ResultCommandPair<T>> resultObservable) {
        if (request.isByteBufResponse()) {
            resultObservable = resultObservable.map(new Func1<ResultCommandPair<T>, ResultCommandPair<T>>() {
                @Override
                public ResultCommandPair<T> call(ResultCommandPair<T> pair) {
                    ((ByteBuf) pair.getResult()).retain();
                    return pair;
                }
            });
        }
        return resultObservable;
    }

    private Observable<RibbonResponse<Observable<T>>> convertToRibbonResponse(
            final HystrixObservableCommandChain<T> commandChain, final Observable<ResultCommandPair<T>> hystrixNotificationObservable) {
        return Observable.create(new OnSubscribe<RibbonResponse<Observable<T>>>() {
            @Override
            public void call(
                    final Subscriber<? super RibbonResponse<Observable<T>>> t1) {
                final Subject<T, T> subject = ReplaySubject.create();
                hystrixNotificationObservable.materialize().subscribe(new Action1<Notification<ResultCommandPair<T>>>() {
                    AtomicBoolean first = new AtomicBoolean(true);

                    @Override
                    public void call(Notification<ResultCommandPair<T>> notification) {
                        if (first.compareAndSet(true, false)) {
                            HystrixObservableCommand<T> command = notification.isOnError() ? commandChain.getLastCommand() : notification.getValue().getCommand();
                            t1.onNext(new ResponseWithSubject<T>(subject, command));
                            t1.onCompleted();
                        }
                        if (notification.isOnNext()) {
                            subject.onNext(notification.getValue().getResult());
                        } else if (notification.isOnCompleted()) {
                            subject.onCompleted();
                        } else { // onError
                            subject.onError(notification.getThrowable());
                        }
                    }
                });
            }
        });
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="@drawable/list_item_shape">
    <ImageView
        android:layout_width="64dp"
        android:layout_height="match_parent"
        android:id="@+id/item_image"
        android:paddingLeft="10dp" />
    <TextView
        android:id="@+id/item_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceListItemSmall"
        android:gravity="center_vertical|center_horizontal"
        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
        android:minHeight="?android:attr/listPreferredItemHeightSmall"
        android:textColor="#ffffffff"
        android:textSize="20dp"
        android:paddingLeft="0dp"
        android:paddingTop="15dp"
        android:paddingBottom="15dp" />
</LinearLayout>


text:
Este código es la respuesta a la Tarea 1 del curso "Diseño y Análisis de Algoritmos" primavera 2017 (CC4102) impartido en dcc.uchile.cl.
El código está escrito completamente en Java usando Github y Google CodeStyle como forma de mantener las "buenas practicas" en el desarrollo.
Para esto se ha usado el IDE IntelliJ IDEA 2017.2.4 o superior y Java 9.

Los integrantes del grupo están en la sección de colaboradores

__sobre la integración con Overleaf:__ Al modificar cosas en el informe se porfavor realizar ```git submodule update```en el terminal del IDE o en git según donde se esté trabajando.

Hemos elegido implementar las siguiente heurísticas:
- [ ] Linear Split
- [ ] Greene's Split


text:
require 'forwardable'
require 'hashie'
require_relative 'qboard/string'
require_relative 'qboard/hash'
require_relative 'qboard/errors'
require_relative 'qboard/version'
require_relative 'qboard/client'
require_relative 'qboard/tickets'
require_relative 'qboard/users'
require_relative 'qboard/lists'
require_relative 'qboard/comments'

module Qboard
  class << self
    extend Forwardable

    def api_key
      raise APIKeyNotSet if @api_key.nil?
      @api_key
    end

    def api_key=(api_key)
      @api_key = api_key
    end

    delegate [
      :users,
      :tickets,
      :lists,
      :comments
    ] => :client

    def client
      @client = Qboard::Client.new(@api_key)
    end

  end
end


text:
namespace device {

const int kMaxOculusRenderLoopInputId = (ovrControllerType_Remote + 1);

class OculusRenderLoop : public XRCompositorCommon {
 public:
  OculusRenderLoop();
  ~OculusRenderLoop() override;

 private:
  // XRDeviceAbstraction:
  mojom::XRFrameDataPtr GetNextFrameData() override;
  bool StartRuntime() override;
  void StopRuntime() override;
  void OnSessionStart() override;
  bool PreComposite() override;
  bool SubmitCompositedFrame() override;
  void OnLayerBoundsChanged() override;

  // Helpers to implement XRDeviceAbstraction:
  void CreateOvrSwapChain();
  void DestroyOvrSwapChain();

  std::vector<mojom::XRInputSourceStatePtr> GetInputState(
      const ovrTrackingState& tracking_state);

  device::mojom::XRInputSourceStatePtr GetTouchData(
      ovrControllerType type,
      const ovrPoseStatef& pose,
      const ovrInputState& input_state,
      ovrHandType hand);

  long long ovr_frame_index_ = 0;
  ovrSession session_ = nullptr;
  ovrGraphicsLuid luid_ = {};
  ovrPosef last_render_pose_;
  ovrTextureSwapChain texture_swap_chain_ = 0;
  gfx::Size swap_chain_size_;
  double sensor_time_;
  bool primary_input_pressed[kMaxOculusRenderLoopInputId];
  bool primary_squeeze_pressed[kMaxOculusRenderLoopInputId];

  DISALLOW_COPY_AND_ASSIGN(OculusRenderLoop);
};

}  // namespace device

#endif  // DEVICE_VR_OCULUS_RENDER_LOOP_H


text:
@interface NpcShip : CCSprite {
    CCSpriteBatchNode *_spriteSheet;
    CCSprite *_image;
    int _type;
    int _line;
    int _minusTime;
}

@property (nonatomic ,assign) int line;
@property (nonatomic ,readonly) int minusTime;

+ (id)createNpcWithType:(int)type;
- (void)actionStart;
- (void)move;

@end


text:
import csv
from datetime import date

from shipane_sdk.jobs.basic_job import BasicJob

class BatchJob(BasicJob):
    def __init__(self, client, client_aliases=None, name=None, **kwargs):
        super(BatchJob, self).__init__(name, kwargs.get('schedule', None), kwargs.get('enabled', False))

        self._client = client
        self._client_aliases = client_aliases
        self._folder = kwargs.get('folder')

    def __call__(self):
        file_name = '{}/{}.csv'.format(self._folder, date.today().isoformat())
        with open(file_name, encoding='utf-8-sig') as file:
            reader = csv.DictReader(file)
            for client_alias in self._client_aliases:
                client = self._client_aliases[client_alias]
                for row in reader:
                    order = {
                        'action': 'BUY' if row[u'买卖标志'] == u'买入' else 'SELL',
                        'symbol': row[u'证券代码'],
                        'type': 'LIMIT',
                        'price': float(row[u'价格']),
                        'amount': int(row[u'数量'])
                    }
                    try:
                        self._client.execute(client, **order)
                    except Exception as e:
                        self._logger.exception("下单异常")


text:
class LinkedList:
    def __init__(self):
        self.head = None
        self.tail = None

    def add(self, data):
        node = self.Node(data)
        if self.head is None:
            self.head = node
            self.tail = node
        else:
            self.tail.next = node
        return True

    def insertBefore(self, element, data):
        if self.head is None:
            self.add(data)
            return True

        node = self.Node(data)
        cur = self.head
        while cur:
            if cur.next and cur.next.data == element:
                node.next = cur.next
                cur.next = node
                return True
            cur = cur.next
        return False

    def remove(self, element):
        cur = self.head
        while cur:
            if cur.next and cur.next.data == element:
                removed = cur.next
                cur.next = cur.next.next
                del(removed)
                return True
        return False

    def search(self, element):
        cur = self.head
        while cur and cur.data != element:
            cur = cur.next
        if cur and cur.data == element:
            return cur
        return None

    def __repr__(self):
        if self.head:
            string = "[" + str(self.head.data)
        else:
            string = "["

        cur = self.head.next
        while cur:
            string +=  ", " + str(cur)
            cur = cur.next
        string += "]"
        return string

    class Node:
        def __init__(self, data=None, next=None):
            self.data = data
            self.next = next

        def __repr__(self):
            return str(self.data)


text:
require "stylespec/version"
require "rspec"
require "stylespec/query"
require "stylespec/matchers"
require "stylespec/helpers"

RSpec.configure do |c|
  c.add_setting :name
  c.add_setting :root
end

module Stylespec
  # Your code goes here...
end


text:
describe('FacebookService', function () {
  var _facebookService;
  var _$q;

  //excuted before each "it" is run.
  beforeEach(function () {
    // Initialize the service provider by injecting it to a fake module's config block
    angular.module('testApp', [])
      .config(function (facebookConfigProvider) {
        facebookConfigProvider.setAppId(12345);
      });

    //load the module.
    module('angularjs-facebook-sdk', 'testApp');

    //inject your service for testing.
    inject(function (facebookService, $q) {
      _facebookService = facebookService;
      _$q = $q;
    });
  });

  it('should export the correct api', function () {
    expect(_facebookService.ready).not.toBe(null);
    expect(_facebookService.api).toEqual(jasmine.any(Function));
    expect(_facebookService.ui).toEqual(jasmine.any(Function));
    expect(_facebookService.login).toEqual(jasmine.any(Function));
    expect(_facebookService.logout).toEqual(jasmine.any(Function));
    expect(_facebookService.getLoginStatus).toEqual(jasmine.any(Function));
  });

  it('should return a promise on the api method', function () {
    expect(_facebookService.api().then).toBeDefined();
  })
});


text:
function MockRoute(path, handler) {
  this.path = path;
  this.handler = handler;
}

module.exports = MockRoute;


text:
Cloud-init configuration are breaked into segements and put into it's own file. The final "user-data" file for cloud-init will be assembled at the target machine in vagrant provisioning process.

So each node of a cluster can pick the cloud-init segements only needs or fits to that specific node.

Usage examples are in ndoes-conf/


text:
title: jQuery CDN
category: JavaScript libraries
---

### Google jQuery

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>


text:
use crate::models::Range;
use reproto_core::Position;
use std::collections::{BTreeMap, Bound};

#[derive(Debug, Clone)]
pub struct Triggers<T> {
    triggers: BTreeMap<Position, (Range, T)>,
}

impl<T> Triggers<T> {
    /// Create a new trigger container.
    pub fn new() -> Self {
        Self {
            triggers: BTreeMap::new(),
        }
    }

    /// Insert the given trigger.
    pub fn insert<R: Into<Range>>(&mut self, range: R, value: T) {
        let range = range.into();
        self.triggers.insert(range.start, (range, value));
    }

    /// Test if the given position matches a trigger in the containers.
    pub fn find(&self, position: ty::Position) -> Option<&T> {
        use self::Bound::*;

        let end = Position {
            line: position.line as usize,
            col: position.character as usize,
        };

        let mut range = self.triggers.range((Unbounded, Included(&end)));

        let (range, value) = match range.next_back() {
            Some((_, &(ref range, ref value))) => (range, value),
            None => return None,
        };

        if !range.contains(&end) {
            return None;
        }

        Some(value)
    }
}

#[cfg(test)]
mod tests {
    use super::Triggers;
    use reproto_core::Position;

    #[test]
    fn test_trigger() {
        let mut t = Triggers::new();

        let a = Position { line: 0, col: 4 };

        let b = Position { line: 1, col: 0 };

        t.insert((a, b), 0);
    }
}


text:
import { jsonCall } from './helpers.js'

function streamerPath(route) {
  return `//streamer.${window.location.host}${route}`
}

function streamerJsonCall(route) {
  let path = streamerPath(route)

  return jsonCall(path)
}

const StreamerAPI = {
  stream:      (channel)          => streamerJsonCall(`/${channel}`),
  receiverUrl: (channel)          => `/chromecast#${channel}`,
  playlistUrl: (channel, quality) => {
    // Video data needs lowercased access
    let lcChannel = channel.toLowerCase()
    let lcQuality = quality.toLowerCase()

    return streamerPath(`/${lcChannel}/${lcQuality}/index.m3u8`)
  }
}

export default StreamerAPI


text:
//go:generate go generate ../genop
//go:generate go run ../genop/main.go -outfile wrappers.go

package op


text:
package gcbatch.base.exception;

import gcbatch.utils.StringUtil;

public class BaseException extends Exception {

    private static final long serialVersionUID = -5037332127176872390L;

    public BaseException(Throwable t) {
		super(t);
		if(t instanceof BaseException) {
			this.errorCode = ((BaseException) t).getErrorCode();
			this.errorMessage = ((BaseException) t).getErrorMessage();
		} else {
			this.errorCode = "99999999";
			this.errorMessage = t.getMessage();
		}
	}

    public BaseException(String errorCode, String errorMessage, Throwable t) {
	super(errorMessage, t);
	this.errorCode = errorCode;
	this.errorMessage = errorMessage;
    }

    public BaseException(String errorCode, String errorMessage) {
	super(errorMessage);
	this.errorCode = errorCode;
	this.errorMessage = errorMessage;
    }

    @Override
	public String toString() {
	StringBuilder buff = new StringBuilder();
	buff.append("[").append(errorCode).append("]").append(errorMessage);
	if (t != null) {
	    buff.append("\n[exception]\n").append(StringUtil.getExceptionStack(t));
	}
	return buff.toString();

    }

    protected String errorCode;
    protected String errorMessage;
    protected Throwable t;

    public String getErrorCode() {
	return errorCode;
    }

    public void setErrorCode(String errorCode) {
	this.errorCode = errorCode;
    }

    public String getErrorMessage() {
	return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
	this.errorMessage = errorMessage;
    }

}


text:
PKG_NAME="xsane"
PKG_VER="0.998"
PKG_REV="1"
PKG_DESC="A scanning application"
PKG_CAT="Graphics"
PKG_DEPS="libjpeg,libpng,libtiff,gtk,sane-backends"
PKG_LICENSE="gpl-2.0.txt"

# the package source files
PKG_SRC="http://www.xsane.org/download/$PKG_NAME-$PKG_VER.tar.gz"

build() {
	# extract the sources tarball
	extract_tarball $PKG_NAME-$PKG_VER.tar.gz
	[ 0 -ne $? ] && return 1

	cd $PKG_NAME-$PKG_VER

	# generate a new configure script
	autoconf
	[ 0 -ne $? ] && return 1

	# configure the package
	./configure $AUTOTOOLS_BASE_OPTS \
	            --enable-gtk2 \
	            --disable-gimp \
	            --disable-gimp2 \
	            --enable-jpeg \
	            --enable-png \
	            --enable-tiff \
	            --disable-lcms \
	            --with-catgets
	[ 0 -ne $? ] && return 1

	# build the package
	make -j $BUILD_THREADS
	[ 0 -ne $? ] && return 1

	return 0
}

package() {
	# install the package
	make DESTDIR=$INSTALL_DIR install
	[ 0 -ne $? ] && return 1

	# install the list of authors
	install -D -m 644 xsane.AUTHOR \
	                  $INSTALL_DIR/$LEGAL_DIR/$PKG_NAME/xsane.AUTHOR
	[ 0 -ne $? ] && return 1

	return 0
}


text:
@interface CountlyAPMNetworkLog : NSObject <NSURLConnectionDataDelegate, NSURLConnectionDelegate>
+ (instancetype)logWithRequest:(NSURLRequest *)request andOriginalDelegate:(id)originalDelegate startNow:(BOOL)startNow;
- (void)start;
- (void)updateWithResponse:(NSURLResponse *)response;
- (void)finish;
- (void)finishWithStatusCode:(NSInteger)statusCode andDataSize:(long long)dataSize;
@end


text:
Base
====

Base comprises of Normalize.css - a modern, HTML5-ready alternative to CSS
resets.

This component is a port of the original Normalize.css project, which can be
found at <http://necolas.github.com/normalize.css/>.

Differences
-----------

Changes are minimal. Base uses Normalize v1.1.1.

  - Create a contextual normalize.css (normalize-context.css) toggled off a
    parent classname: `.pure`.


text:
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
import java.util.stream.Stream;

public class Baz {
  public static void bar() {
<caret>    int s = Stream.of(1, 2, 3).flatMapToInt(x -> IntStream.empty()).sum();
  }
}


text:
#!/usr/bin/env node

var Liftoff = require('liftoff');
var argv = require('minimist')(process.argv.slice(2));
var gutil = require('gulp-util');
var cli = new Liftoff({
  name: 'au-run',
  processTitle: 'au-run',
  moduleName: 'au-run',
  configName: 'au-run-conf',

  // only js supported!
  extensions: {
    '.js': null
  }
});

cli.launch({
  cwd: argv.cwd,
  configPath: argv.aufile
}, function(env) {
  var au;
  if (!env.modulePath) {
    au = require('../');
  } else {
    au = require(env.modulePath);
  }

  process.title = this.name + ' ' + process.argv.slice(2).join(' ') + ' [ ' + env.cwd + ' ]';

  gutil.log(gutil.colors.green('Please Wait ......'));

  if (!env.configPath) {
    gutil.log('Not found au-run-conf.js');
    process.exit(1);
  }

  // This is what actually loads up the aufile
  var initConfig = require(env.configPath);

  if (typeof initConfig === 'function') {
    initConfig(au, argv);
  }
  //gulp cli命令
  gutil.log('Using aufile ', gutil.colors.magenta(env.configPath));

  require('../cli-gulp/bin/gulp');
});

/*
## au-run-conf.js 的例子

```js
var gutil = require('gulp-util');
var webpack = require('webpack');

module.exports = function(au, argv) {
  var gulp = au.gulp;

  gulp.task("webpack", function(callback) {
    // run webpack
    webpack({
      // configuration
    }, function(err, stats) {
      if (err) throw new gutil.PluginError("webpack", err);
      gutil.log("[webpack]", stats.toString({
        // output options
      }));
      callback();
    });
  });
  gulp.task('default', ['webpack']);
  au.gulpInst();
};
```
*/


text:
import Tape from '../tape';
import CommandSet from '../commandSet';
import commandLineTokenizer from '../tokenizer/commandLineTokenizer';
import DescentParser from './descentParser';
import {DescentParserNode} from '../ast/nodes/descentParserNodes';

import * as ast from '../ast/nodes/descentParserNodes';

export function parseCmdLine (line: string, commands: CommandSet): DescentParserNode {
	const tokens = commandLineTokenizer(line);
	const parser = new DescentParser(commands, new Tape(tokens));
	const node = parser.COMMAND_LINE();
	if (parser.firstCommand && node.err) {
		node.firstCommand = true;
	}
	return node;
}

export function parseJS (line: string): DescentParserNode {
	return ast.JS({type: null, text: line, pos: null});
}


text:
public class DecrementThread extends Thread {
	@Override
	public void run() {
		for (int i = 5; i > 0; i--) {
			System.out.println("Decrement : " + i);
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		System.out.println("Decrement Ends");
	}
}


text:
<?php
/**
 * @author  Stefano Torresi (http://stefanotorresi.it)
 * @license See the file LICENSE for copying permission.
 * ************************************************
 */

declare(strict_types=1);

namespace Thorr\Advent\Test\Puzzle;

use PHPUnit_Framework_TestCase as TestCase;
use Thorr\Advent\Puzzle;

class Day1Test extends TestCase
{
    /**
     * @var Puzzle\Day1
     */
    protected $puzzle;

    protected function setUp()
    {
        $this->puzzle = new Puzzle\Day1();
    }

    /**
     * @dataProvider floorValidDataProvider
     */
    public function testFloorValidInput(string $input, int $expectedOutput)
    {
        $this->assertSame($expectedOutput, $this->puzzle->floor($input));
    }

    public function floorValidDataProvider()
    {
        return [
            [ '(', 1 ],
            [ ')', -1 ],
            [ '()', 0 ],
            [ '(()))))', -3 ],
        ];
    }

    /**
     * @dataProvider floorInvalidDataProvider
     */
    public function testFloorInvalidInput(string $input)
    {
        $this->setExpectedException(\InvalidArgumentException::class, "Input must only consist of '(' or ')'");
        $this->puzzle->floor($input);
    }

    public function floorInvalidDataProvider()
    {
        return [
            [ 'foobar' ],
            [ '' ],
            [ '(z' ],
            [ 'a(' ],
            [ 'a(z' ],
        ];
    }

    /**
     * @dataProvider basementValidDataProvider
     */
    public function testBasementValidInput(string $input, int $expectedOutput)
    {
        $this->assertSame($expectedOutput, $this->puzzle->basement($input));
    }

    public function basementValidDataProvider()
    {
        return [
            [ '(()))))', 5 ],
            [ '()())', 5 ],
            [ ')', 1 ],
        ];
    }

    /**
     * @dataProvider basementInvalidDataProvider
     */
    public function testBasementInvalidInput(string $input, string $message)
    {
        $this->setExpectedException(\InvalidArgumentException::class, $message);
        $this->puzzle->basement($input);
    }

    public function basementInvalidDataProvider()
    {
        $noBasementMsg = "Santa never went to the basement";
        $malformedInputMsg = "Input must only consist of '(' or ')'";

        return [
            [ '(', $noBasementMsg ],
            [ '(((((', $noBasementMsg ],
            [ '()', $noBasementMsg ],
            [ 'foobar', $malformedInputMsg ],
        ];
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="./css/global.css">

		<title>News</title>

Loading…


text:
@class CMAttributeRun;

@interface CMCascadingAttributeStack : NSObject
@property (nonatomic, readonly) NSDictionary *cascadedAttributes;

- (void)push:(CMAttributeRun *)run;
- (CMAttributeRun *)pop;
- (CMAttributeRun *)peek;

@end


text:
#ifndef __CPU_DTUTEST_DTUTEST_HH__
#define __CPU_DTUTEST_DTUTEST_HH__

#include "params/DtuTest.hh"
#include "mem/dtu/regfile.hh"
#include "sim/system.hh"

class DtuTest : public MemObject
{
  public:
    DtuTest(const DtuTestParams *p);

    BaseMasterPort& getMasterPort(const std::string &if_name,
                                  PortID idx = InvalidPortID) override;

  protected:

    /// main simulation loop
    void tick();

    EventWrapper<DtuTest, &DtuTest::tick> tickEvent;

    class CpuPort : public MasterPort
    {
      private:
        DtuTest& dtutest;
      public:
        CpuPort(const std::string& _name, DtuTest* _dtutest)
            : MasterPort(_name, _dtutest), dtutest(*_dtutest)
        { }
      protected:
        bool recvTimingResp(PacketPtr pkt) override;

        void recvReqRetry() override;
    };

    CpuPort port;

    enum class State
    {
        IDLE,
        INIT,
        SETUP_TRANSMIT_EP,
        SETUP_RECEIVE_EP,
        START_TRANSMISSION,
        WAIT,
        VALIDATE,
    };

    State state;

    /// Request id for all generated traffic
    MasterID masterId;

    unsigned int id;

    const bool atomic;

    // XXX used to count ticks and do different tasks depending on current value
    int counter = 0;

    /// Stores the Packet for later retry
    PacketPtr retryPkt;

    PacketPtr createDtuRegisterPkt(Addr reg, RegFile::reg_t value, MemCmd cmd);

    bool sendPkt(PacketPtr pkt);

    void completeRequest(PacketPtr pkt);

    void recvRetry();

    static Addr getRegAddr(DtuReg reg);

    static Addr getRegAddr(CmdReg reg);

    // static Addr getRegAddr(EpReg reg, unsigned epid);
};

#endif // __CPU_DTUTEST_DTUTEST_HH__


text:
class SubscriptionsController < ApplicationController
  # GET /subscriptions
  # GET /subscriptions.xml

  access_control do
    allow :admin
    deny  :member
  end

  def index
    @subscriptions = Subscription.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @subscriptions }
    end
  end

  # GET /subscriptions/1
  # GET /subscriptions/1.xml
  def show
    @subscription = Subscription.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @subscription }
    end
  end

  # GET /subscriptions/new
  # GET /subscriptions/new.xml
  def new
    @subscription = Subscription.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @subscription }
    end
  end

  # GET /subscriptions/1/edit
  def edit
    @subscription = Subscription.find(params[:id])
  end

  # POST /subscriptions
  # POST /subscriptions.xml
  def create
    @subscription = Subscription.new(params[:subscription])

    respond_to do |format|
      if @subscription.save
        flash[:notice] = 'Subscription was successfully created.'
        format.html { redirect_to(@subscription) }
        format.xml  { render :xml => @subscription, :status => :created, :location => @subscription }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @subscription.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /subscriptions/1
  # PUT /subscriptions/1.xml
  def update
    @subscription = Subscription.find(params[:id])

    respond_to do |format|
      if @subscription.update_attributes(params[:subscription])
        flash[:notice] = 'Subscription was successfully updated.'
        format.html { redirect_to(@subscription) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @subscription.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /subscriptions/1
  # DELETE /subscriptions/1.xml
  def destroy
    @subscription = Subscription.find(params[:id])
    @subscription.destroy

    respond_to do |format|
      format.html { redirect_to(subscriptions_url) }
      format.xml  { head :ok }
    end
  end
end


text:
<?php

namespace Trive\Fiskal\Api;

use Magento\Framework\Api\SearchCriteriaInterface;
use Trive\Fiskal\Api\Data\SequenceInterface;

interface SequenceRepositoryInterface
{
    /**
     * @param int $identifier
     *
     * @return \Trive\Fiskal\Api\Data\SequenceInterface
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function getById($identifier);

    /**
     * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
     *
     * @return \Trive\Fiskal\Api\Data\SequenceSearchResultsInterface
     */
    public function getList(SearchCriteriaInterface $searchCriteria);

    /**
     * @param \Trive\Fiskal\Api\Data\SequenceInterface $sequence
     *
     * @return \Trive\Fiskal\Api\Data\SequenceInterface
     * @throws \Magento\Framework\Exception\CouldNotSaveException If there is a problem with the input
     * @throws \Magento\Framework\Exception\NoSuchEntityException If a ID is sent but the entity does not exist
     */
    public function save(SequenceInterface $sequence);

    /**
     * @param \Trive\Fiskal\Api\Data\SequenceInterface $sequence
     *
     * @return bool
     * @throws \Magento\Framework\Exception\CouldNotDeleteException If there is a problem with the input
     */
    public function delete(SequenceInterface $sequence);

    /**
     * @param int $sequenceId
     *
     * @return bool
     * @throws \Magento\Framework\Exception\NoSuchEntityException If a ID is sent but the entity does not exist
     * @throws \Magento\Framework\Exception\CouldNotDeleteException If there is a problem with the input
     */
    public function deleteById($sequenceId);
}


text:
import {IMyService} from "../services/myService";

// コントローラ定義
// コントローラの役割はスコープのsetup
export class MyController {
    public message: string;
    public hoge: number;
    public $interval: angular.IIntervalService;
    public $location: angular.ILocationService;
    public myService: IMyService;

    constructor($interval, $location, addService, myService) {
        this.init(addService);
        this.$interval = $interval;
        this.$location = $location;
        console.log(this.$location);
        this.myService = myService;

    }

    private init(addService) {
        this.message = "Hello world";
        this.hoge = addService(10, 20);
    }

    public action($event) {
        if (this.message.indexOf("o") > 0) {
            this.message = this.message.slice(0, -1);
        } else {
            this.message = "GooooooooooooooodBye!";
        }
        $event.stopPropagation();
        console.log($event);
    }

    public wait(num) {
        let _num = num;
        this.$interval(() => {
            console.log(_num--);
        }, num);
    }

    public callService() {
        this.message = this.myService.getResponse();
    }

    public resolveCallback(msg, func) {
        func(msg);
    }
}

export class ScopeController {
    public $rootScope: angular.IRootScopeService;
    public test: string;

    constructor($rootScope) {
        this.$rootScope = $rootScope;
        this.test = "test1";  // これは$scope
        this.$rootScope["rootTest"] = "rootTest1";
    }
}

export class ScopeController2 {
    public $rootScope: angular.IRootScopeService;
    public test: string;

    constructor($rootScope) {
        this.$rootScope = $rootScope;
        this.test = "test2";  // これは$scope
        this.$rootScope["rootTest"] = "rootTest2";
    }
}


text:
package com.tribbloids.spookystuff.tree

import org.apache.spark.sql.catalyst.trees.TreeNode

abstract class TreeView[BaseType <: TreeView[BaseType]] extends TreeNode[BaseType] {
  self: BaseType =>

  // due to the limitation of Spark TreeNode impl
  // every element must have only 1 row
  // this may change in the future once this class switch to an implementation with better support to multiple rows
  protected def argStrings: Seq[String] = Nil

  final override lazy val verboseString: String = {
    val argBlock =
      if (argStrings.isEmpty) ""
      else argStrings.mkString("[", ", ", "]")
    simpleString + argBlock
  }
}


text:
public class ReverseWordsInASentence {

    /*
    7.6
    */

    public static String reverseWordsInASentence(String input) {

        return "";
    }
}


text:
using System;
using NUnit.Framework;
using Nohros.Data.Json;

namespace Nohros.Common.data.json
{
  [TestFixture]
  public class JsonStringBuilderTest
  {
    [Test]
    public void ShouldEscapeLastWrittenToken() {
      string json = new JsonStringBuilder()
        .WriteBeginArray()
        .Escape()
        .ToString();
      Assert.AreEqual("[", json);

      json = new JsonStringBuilder()
        .WriteBeginObject()
        .WriteMember("key", "value")
        .Escape()
        .WriteEndObject()
        .ToString();
      Assert.AreEqual("{\"key\":\"value\"}", json);

      json = new JsonStringBuilder()
        .WriteBeginObject()
        .WriteMember("key", "value-with-CRLF\r\n")
        .Escape()
        .WriteEndObject()
        .ToString();
      Assert.AreEqual("{\"key\":\"value-with-CRLF\\r\\n\"}", json);
    }

    [Test]
    public void ShouldWriteJsonMember() {
      string json = new JsonStringBuilder()
        .WriteMember("name", "key")
        .ToString();
      Assert.AreEqual(json, "\"name\":\"key\"");

      json = new JsonStringBuilder()
        .WriteMember("name", (double) 20.1)
        .ToString();
      Assert.AreEqual("\"name\":20.1", json);

      json = new JsonStringBuilder()
        .WriteMember("name", (int) 20)
        .ToString();
      Assert.AreEqual("\"name\":20", json);

      json = new JsonStringBuilder()
        .WriteMember("name", (long) 64000)
        .ToString();
      Assert.AreEqual("\"name\":64000", json);
    }

    [Test]
    public void ShouldWriteJsonMemberName() {
      string json = new JsonStringBuilder()
        .WriteMemberName("name")
        .ToString();
      Assert.AreEqual("\"name\":", json);

      json = new JsonStringBuilder()
        .WriteMemberName("name")
        .WriteNumber(20)
        .ToString();
      Assert.AreEqual("\"name\":20", json);

      json = new JsonStringBuilder()
        .WriteMemberName("name")
        .WriteBeginObject()
        .WriteMember("name", "value")
        .WriteEndObject()
        .ToString();
      Assert.AreEqual("\"name\":{\"name\":\"value\"}", json);
    }

    [Test]
    public void ShouldEscapeJsonStructuralCharacters() {
      string escaped = JsonStringBuilder.Escape("\r\n\r\n");
      Assert.AreEqual("\\r\\n\\r\\n", escaped);

      escaped = JsonStringBuilder.Escape("escape:\r\n\r\n");
      Assert.AreEqual("escape:\\r\\n\\r\\n", escaped);

      escaped = JsonStringBuilder.Escape("escape:\b\f\r\n\t");
      Assert.AreEqual("escape:\\b\\f\\r\\n\\t", escaped);
    }

    [Test]
    public void ShouldEscapeunicodeCharacters() {
      string json = JsonStringBuilder.Escape("C:\\p");
      Assert.AreEqual("C:\\\\p", json);
      Assert.That(JsonStringBuilder.Escape("data \"67676\""), Is.EqualTo("data \\\"67676\\\""));
    }
  }
}


text:
var app = app || {};

app.LibraryView = Backbone.View.extend({
    el: '#books',

    initialize: function() {
    	//OLD this.collection = new app.Library( initialBooks );
        this.collection = new app.Library();
        this.collection.fetch({reset: true});
        this.render();
        this.listenTo( this.collection, 'add', this.renderBook );
        this.listenTo( this.collection, 'reset', this.render );
    },

    // render library by rendering each book in its collection
    render: function() {
        this.collection.each(function( item ) {
            this.renderBook( item );
        }, this );
    },

    // render a book by creating a BookView and appending the
    // element it renders to the library's element
    renderBook: function( item ) {
        var bookView = new app.BookView({
            model: item
        });
        this.$el.append( bookView.render().el );
    },

    events:{
        'click #add':'addBook'
    },

    addBook: function( e ) {
        e.preventDefault();

        var formData = {};

        $( '#addBook div' ).children( 'input' ).each( function( i, el ) {
            if( $( el ).val() != '' )
            {
                if( el.id === 'keywords' ) {
                    formData[ el.id ] = [];
                    _.each( $( el ).val().split( ' ' ), function( keyword ) {
                        formData[ el.id ].push({ 'keyword': keyword });
                    });
                } else if( el.id === 'releaseDate' ) {
                    formData[ el.id ] = $( '#releaseDate' ).datepicker( 'getDate' ).getTime();
                } else {
                    formData[ el.id ] = $( el ).val();
                }
            }
            // Clear input field value
            $( el ).val('');
        });

        this.collection.create( formData );
    }
});


text:
class Folder < ActiveRecord::Base
  attr_accessible :title, :user_id, :parent_id

  belongs_to :user
  belongs_to :parent, :class_name => 'Folder'
  has_many :children, :class_name => 'Folder', :foreign_key => 'parent_id'
  has_many :submissions, :order => ('updated_at DESC')

  def self.search(search)
  	where("title like ?", "%#{search}%")
  end

end


text:
TaskManager
===========

New project - Task Manager iOS


text:
package org.brackit.server.store.index.bracket.filter;

import org.brackit.server.metadata.pathSynopsis.PSNode;
import org.brackit.server.metadata.pathSynopsis.manager.PathSynopsisMgr;
import org.brackit.server.node.bracket.BracketNode;
import org.brackit.server.store.page.bracket.DeweyIDBuffer;
import org.brackit.server.store.page.bracket.RecordInterpreter;
import org.brackit.xquery.atomic.QNm;

/**
 * @author Sebastian Baechle
 *
 */
public class AttrFilter extends BracketFilter {

	private final PathSynopsisMgr ps;
	private final QNm name;
	private final PSNode psn;
	private final int pcr;

	public AttrFilter(PathSynopsisMgr ps, QNm name, PSNode psn) {
		this.ps = ps;
		this.name = name;
		this.psn = psn;
		this.pcr = psn.getPCR();
	}

	@Override
	public boolean accept(DeweyIDBuffer deweyID, boolean hasRecord,
			RecordInterpreter value) {
		if (value.getPCR() == pcr) {
			value.setPsNode(psn);
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean accept(BracketNode node) {
		// TODO Auto-generated method stub
		return false;
	}
}


text:
package com.aiyc.server.standalone.db.homes.vector;

import com.aiyc.server.standalone.core.measure.GSMReading;
import com.aiyc.server.standalone.db.HomeFactory;
import com.aiyc.server.standalone.db.homes.EntityHome;

public class GSMReadingVectorHome extends VectorHome<GSMReading> {

	private static final String className = GSMReading.class.getSimpleName();

	@Override
	public String getContainedObjectClassName() {
		return className;
	}

	/**
	 * @see VectorHome#getObjectHome()
	 */
	@Override
	public EntityHome<GSMReading> getObjectHome() {
		return HomeFactory.getGSMReadingHome();
	}

}


text:
var $CONFIG = {
  serverPort : 8999,
  staticContentPath : "static",
  meteogrammaPadova: 10,
  bollettinoid: "MV"
};

// External modules
var express = require('express');
var app = express();
var fs = require("fs");
var moment = require("moment");
moment.locale('it');

var forecasts = require("./forecasts");

console.log("Server starting");

var app = express();
app.use(express.static(__dirname + '/' + $CONFIG.staticContentPath));

function buildPrevisione(fcasts, pdata) {
  if(fcasts && fcasts.previsioni && fcasts.previsioni.meteogrammi && fcasts.previsioni.meteogrammi.meteogramma) {
    var index = -1, mgramma = fcasts.previsioni.meteogrammi.meteogramma;
    for(var i = 0; i < mgramma.length; i++)
      if(mgramma[i].zoneid == $CONFIG.meteogrammaPadova)
        index = i;

    if(index < 0)
      return null;

    var indexData = -1, prev = mgramma[index].scadenza;
    for(i = 0; i < prev.length; i++)
      if(prev[i].data.trim() == pdata)
        indexData = i;

    if(indexData < 0)
      return null;

    var ref = prev[indexData].previsione;
    var toRet = {};
    for(i = 0; i < ref.length; i++) {
      if(ref[i].title == "Simbolo")
        toRet.simbolo = ref[i].value;
      if(ref[i].title == "Cielo")
        toRet.cielo = ref[i].value;
      if(ref[i].title == "Temperatura")
        toRet.temperatura = ref[i].value;
      if(ref[i].title == "Precipitazioni")
        toRet.precipitazioni = ref[i].value;
      if(ref[i].title == "Probabilita' precipitazione")
        toRet.probabilita = ref[i].value;
      if(ref[i].title == "Attendibilita'")
        toRet.attendibilita = ref[i].value;
    } // for
    toRet.data = pdata;

    return toRet;

  } else
    return null;
} // buildPrevisione

function buildBollettino(fcasts, pdata) {
  if(fcasts && fcasts.previsioni && fcasts.previsioni.bollettini && fcasts.previsioni.bollettini.bollettino) {

    var index = -1, bollettino = fcasts.previsioni.bollettini.bollettino;
    for(var i = 0; i < bollettino.length; i++)
      if(bollettino[i].bollettinoid == $CONFIG.bollettinoid)
        index = i;

    if(index < 0)
      return null;

    return bollettino[index].evoluzionegenerale;
  } // if
}

function buildHTML(fcasts, done) {

  fs.readFile($CONFIG.staticContentPath + "/template.html", {"encoding": "utf8"}, function(err, data) {

    if(err) {
      done(err);
      return;
    } // if

    var dataRef = moment().format("D MMMM");

    var input = buildPrevisione(fcasts, dataRef + " " + (moment().hours() < 12 ? "mattina" : "pomeriggio"));

    var output = data;
    for(var i in input)
      output = output.replace("%" + i, input[i]);

    var bollettino = buildBollettino(fcasts, dataRef);
    output = output.replace("%previsione", bollettino);

    fs.writeFile($CONFIG.staticContentPath + "/index.html", output, function(err, data) {
      done(err, data);
    });
  });

} // buildHTML

app.get("/update", function(req, res) {

  forecasts.get(function(err, fcasts) {

    if(err) {
      console.log("Error: " + err);
      res.sendStatus(500);
      return;
    } // if

    buildHTML(fcasts, function(err2) {
      if(err2) {
        console.log("Error: " + err2);
        res.sendStatus(500);
        return;
      } // if

      res.sendStatus(200);
    });
  });
});

app.listen($CONFIG.serverPort);
console.info("Server listening on port " + $CONFIG.serverPort);


text:
package trust_test

import (
	"bytes"
	"context"
	"crypto"
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/rsa"
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"os"
	"path/filepath"
	"testing"
	"time"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/scionproto/scion/go/lib/scrypto/cppki"
	"github.com/scionproto/scion/go/lib/serrors"
	"github.com/scionproto/scion/go/lib/xtest"
	"github.com/scionproto/scion/go/pkg/trust"
	"github.com/scionproto/scion/go/pkg/trust/mock_trust"
)

func TestLoadX509KeyPair(t *testing.T) {
	if *updateNonDeterministic {
		t.Skip("test crypto is being updated")
	}

	getChain := func(t *testing.T) []*x509.Certificate {
		return xtest.LoadChain(t,
			filepath.Join(goldenDir, "ISD1/ASff00_0_110/crypto/as/ISD1-ASff00_0_110.pem"))
	}

	trc := xtest.LoadTRC(t, filepath.Join(goldenDir, "ISD1/trcs/ISD1-B1-S1.trc"))
	key := loadSigner(t, filepath.Join(goldenDir, "ISD1/ASff00_0_110/crypto/as/cp-as.key"))

	chain := getChain(t)
	longer := getChain(t)
	longer[0].NotAfter = longer[0].NotAfter.Add(time.Hour)
	longer[0].SubjectKeyId = []byte("longer")

	shorter := getChain(t)
	shorter[0].NotAfter = shorter[0].NotAfter.Add(-time.Hour)
	shorter[0].SubjectKeyId = []byte("shorter")

	longestKey := loadSigner(t, filepath.Join(goldenDir, "ISD1/ASff00_0_111/crypto/as/cp-as.key"))
	longestChain := xtest.LoadChain(t,
		filepath.Join(goldenDir, "ISD1/ASff00_0_111/crypto/as/ISD1-ASff00_0_111.pem"))
	longestChain[0].NotAfter = longestChain[0].NotAfter.Add(2 * time.Hour)
	longestChain[0].SubjectKeyId = []byte("longest")

	testCases := map[string]struct {
		keyLoader    func(mctrcl *gomock.Controller) trust.KeyRing
		db           func(mctrcl *gomock.Controller) trust.DB
		extKeyUsage  x509.ExtKeyUsage
		assertFunc   assert.ErrorAssertionFunc
		expectedCert func() *tls.Certificate
	}{
		"valid": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				cert := chain[0]
				db := mock_trust.NewMockDB(mctrl)
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					[][]*x509.Certificate{chain}, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.NoError,
			expectedCert: func() *tls.Certificate {
				certificate := make([][]byte, len(chain))
				for i := range chain {
					certificate[i] = chain[i].Raw
				}
				return &tls.Certificate{
					Certificate: certificate,
					PrivateKey:  key,
					Leaf:        chain[0],
				}
			},
		},
		"newest": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				cert := chain[0]
				db := mock_trust.NewMockDB(mctrl)
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}

				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					[][]*x509.Certificate{chain, longer, shorter}, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.NoError,
			expectedCert: func() *tls.Certificate {
				certificate := make([][]byte, len(longer))
				for i := range longer {
					certificate[i] = longer[i].Raw
				}
				return &tls.Certificate{
					Certificate: certificate,
					PrivateKey:  key,
					Leaf:        longer[0],
				}
			},
		},
		"newest multiple keys": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {

				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key, longestKey}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)

				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn(
					func(
						_ context.Context,
						chainQuery trust.ChainQuery,
					) ([][]*x509.Certificate, error) {
						skid, err := cppki.SubjectKeyID(longestKey.Public())
						if err != nil {
							return nil, err
						}
						if bytes.Equal(chainQuery.SubjectKeyID, skid) {
							return [][]*x509.Certificate{longestChain}, nil
						}
						return [][]*x509.Certificate{chain, longer, shorter}, nil
					},
				)
				return db
			},
			assertFunc:  assert.NoError,
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			expectedCert: func() *tls.Certificate {
				certificate := make([][]byte, len(longestChain))
				for i := range longer {
					certificate[i] = longestChain[i].Raw
				}
				return &tls.Certificate{
					Certificate: certificate,
					PrivateKey:  key,
					Leaf:        longestChain[0],
				}
			},
		},
		"select best from grace": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				cert := chain[0]
				db := mock_trust.NewMockDB(mctrl)
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}

				trc2 := xtest.LoadTRC(t, filepath.Join(goldenDir, "ISD1/trcs/ISD1-B1-S1.trc"))
				trc2.TRC.ID.Serial = 2
				trc2.TRC.Validity.NotBefore = time.Now()
				trc2.TRC.GracePeriod = 5 * time.Minute

				roots, err := trc2.TRC.RootCerts()
				require.NoError(t, err)
				key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
				require.NoError(t, err)
				for _, root := range roots {
					root.PublicKey = key.Public()
				}
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc2, nil,
				)
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1, Serial: 1, Base: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					[][]*x509.Certificate{chain, longer, shorter}, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.NoError,
			expectedCert: func() *tls.Certificate {
				certificate := make([][]byte, len(chain))
				for i := range chain {
					certificate[i] = longer[i].Raw
				}
				return &tls.Certificate{
					Certificate: certificate,
					PrivateKey:  key,
					Leaf:        longer[0],
				}
			},
		},
		"no keys": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				return mock_trust.NewMockDB(mctrl)
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"rsa key": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)

				priv, err := rsa.GenerateKey(rand.Reader, 512)
				require.NoError(t, err)

				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{priv}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"no chain found": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				cert := chain[0]
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}
				db.EXPECT().SignedTRC(ctxMatcher{},
					cppki.TRCID{ISD: 1}).Return(trc, nil)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(nil, nil)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"db.SignedTRC error": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				db.EXPECT().SignedTRC(ctxMatcher{},
					cppki.TRCID{ISD: 1}).Return(
					cppki.SignedTRC{}, serrors.New("fail"))
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"db.SignedTRC not found": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					cppki.SignedTRC{}, nil)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"db.Chain error": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				cert := chain[0]
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}
				db.EXPECT().SignedTRC(ctxMatcher{},
					cppki.TRCID{ISD: 1}).Return(trc, nil)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					nil, serrors.New("fail"),
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
		"correct EKU": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				invalidExtChain := getChain(t)
				invalidExtChain[0].ExtKeyUsage = []x509.ExtKeyUsage{
					x509.ExtKeyUsageClientAuth,
					x509.ExtKeyUsageTimeStamping,
				}
				validExtChain := getChain(t)
				validExtChain[0].ExtKeyUsage = []x509.ExtKeyUsage{
					x509.ExtKeyUsageServerAuth,
					x509.ExtKeyUsageTimeStamping,
				}
				cert := validExtChain[0]
				db := mock_trust.NewMockDB(mctrl)
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					[][]*x509.Certificate{invalidExtChain, validExtChain}, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.NoError,
			expectedCert: func() *tls.Certificate {
				validExtChain := getChain(t)
				validExtChain[0].ExtKeyUsage = []x509.ExtKeyUsage{
					x509.ExtKeyUsageServerAuth,
					x509.ExtKeyUsageTimeStamping,
				}
				certificate := make([][]byte, len(validExtChain))
				for i := range validExtChain {
					certificate[i] = validExtChain[i].Raw
				}
				return &tls.Certificate{
					Certificate: certificate,
					PrivateKey:  key,
					Leaf:        validExtChain[0],
				}
			},
		},
		"wrong EKU": {
			keyLoader: func(mctrl *gomock.Controller) trust.KeyRing {
				loader := mock_trust.NewMockKeyRing(mctrl)
				loader.EXPECT().PrivateKeys(gomock.Any()).Return(
					[]crypto.Signer{key}, nil,
				)
				return loader
			},
			db: func(mctrl *gomock.Controller) trust.DB {
				extChain := getChain(t)
				extChain[0].ExtKeyUsage = []x509.ExtKeyUsage{
					x509.ExtKeyUsageClientAuth,
					x509.ExtKeyUsageTimeStamping,
				}
				cert := extChain[0]
				db := mock_trust.NewMockDB(mctrl)
				matcher := chainQueryMatcher{
					ia:   xtest.MustParseIA("1-ff00:0:110"),
					skid: cert.SubjectKeyId,
				}
				db.EXPECT().SignedTRC(ctxMatcher{}, cppki.TRCID{ISD: 1}).Return(
					trc, nil,
				)
				db.EXPECT().Chains(gomock.Any(), matcher).Return(
					[][]*x509.Certificate{extChain}, nil,
				)
				return db
			},
			extKeyUsage: x509.ExtKeyUsageServerAuth,
			assertFunc:  assert.Error,
			expectedCert: func() *tls.Certificate {
				return nil
			},
		},
	}
	for name, tc := range testCases {
		name, tc := name, tc
		t.Run(name, func(t *testing.T) {
			//t.Parallel()
			mctrl := gomock.NewController(t)
			defer mctrl.Finish()

			provider := trust.X509KeyPairProvider{
				IA:     xtest.MustParseIA("1-ff00:0:110"),
				DB:     tc.db(mctrl),
				Loader: tc.keyLoader(mctrl),
			}
			tlsCert, err := provider.LoadX509KeyPair(context.Background(), tc.extKeyUsage)
			tc.assertFunc(t, err)
			if err == nil {
				assert.Equal(t, tc.expectedCert().Leaf.SubjectKeyId, tlsCert.Leaf.SubjectKeyId)
			}

		})
	}
}

func loadSigner(t *testing.T, file string) crypto.Signer {
	raw, err := os.ReadFile(file)
	require.NoError(t, err)
	block, _ := pem.Decode(raw)
	if block == nil || block.Type != "PRIVATE KEY" {
		panic("no valid private key block")
	}
	key, err := x509.ParsePKCS8PrivateKey(block.Bytes)
	require.NoError(t, err)
	return key.(crypto.Signer)
}


text:
namespace Frontend
{
	public partial class DPinConfigDialog
	{
		private global::Gtk.Table table3;

		private global::Gtk.ColorButton cbColor;

		private global::Gtk.ComboBox cbPin;

		private global::Gtk.Entry entryName;

		private global::Gtk.Label lblColor;

		private global::Gtk.Label lblName;

		private global::Gtk.Label lblPin;

		private global::Gtk.Button buttonCancel;

		private global::Gtk.Button buttonOk;

		protected virtual void Build()
		{
			global::Stetic.Gui.Initialize(this);
			// Widget Frontend.DPinConfigDialog
			this.Name = "Frontend.DPinConfigDialog";
			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
			this.AllowShrink = true;
			// Internal child Frontend.DPinConfigDialog.VBox
			global::Gtk.VBox w1 = this.VBox;
			w1.Name = "dialog1_VBox";
			// Container child dialog1_VBox.Gtk.Box+BoxChild
			this.table3 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
			this.table3.Name = "table3";
			this.table3.RowSpacing = ((uint)(6));
			this.table3.ColumnSpacing = ((uint)(6));
			// Container child table3.Gtk.Table+TableChild
			this.cbColor = new global::Gtk.ColorButton();
			this.cbColor.CanFocus = true;
			this.cbColor.Events = ((global::Gdk.EventMask)(784));
			this.cbColor.Name = "cbColor";
			this.table3.Add(this.cbColor);
			global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table3[this.cbColor]));
			w2.TopAttach = ((uint)(2));
			w2.BottomAttach = ((uint)(3));
			w2.LeftAttach = ((uint)(1));
			w2.RightAttach = ((uint)(2));
			w2.XOptions = ((global::Gtk.AttachOptions)(4));
			w2.YOptions = ((global::Gtk.AttachOptions)(4));
			// Container child table3.Gtk.Table+TableChild
			this.cbPin = global::Gtk.ComboBox.NewText();
			this.cbPin.Name = "cbPin";
			this.table3.Add(this.cbPin);
			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table3[this.cbPin]));
			w3.TopAttach = ((uint)(1));
			w3.BottomAttach = ((uint)(2));
			w3.LeftAttach = ((uint)(1));
			w3.RightAttach = ((uint)(2));
			w3.XOptions = ((global::Gtk.AttachOptions)(4));
			w3.YOptions = ((global::Gtk.AttachOptions)(4));
			// Container child table3.Gtk.Table+TableChild
			this.entryName = new global::Gtk.Entry();
			this.entryName.CanFocus = true;
			this.entryName.Name = "entryName";
			this.entryName.IsEditable = true;
			this.entryName.InvisibleChar = '●';
			this.table3.Add(this.entryName);
			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table3[this.entryName]));
			w4.LeftAttach = ((uint)(1));
			w4.RightAttach = ((uint)(2));
			w4.XOptions = ((global::Gtk.AttachOptions)(4));
			w4.YOptions = ((global::Gtk.AttachOptions)(4));
			// Container child table3.Gtk.Table+TableChild
			this.lblColor = new global::Gtk.Label();
			this.lblColor.Name = "lblColor";
			this.lblColor.Xalign = 0F;
			this.lblColor.LabelProp = global::Mono.Unix.Catalog.GetString("Color:");
			this.table3.Add(this.lblColor);
			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table3[this.lblColor]));
			w5.TopAttach = ((uint)(2));
			w5.BottomAttach = ((uint)(3));
			w5.XOptions = ((global::Gtk.AttachOptions)(4));
			w5.YOptions = ((global::Gtk.AttachOptions)(4));
			// Container child table3.Gtk.Table+TableChild
			this.lblName = new global::Gtk.Label();
			this.lblName.Name = "lblName";
			this.lblName.Xalign = 0F;
			this.lblName.LabelProp = global::Mono.Unix.Catalog.GetString("Name:");
			this.table3.Add(this.lblName);
			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table3[this.lblName]));
			w6.XOptions = ((global::Gtk.AttachOptions)(4));
			w6.YOptions = ((global::Gtk.AttachOptions)(4));
			// Container child table3.Gtk.Table+TableChild
			this.lblPin = new global::Gtk.Label();
			this.lblPin.Name = "lblPin";
			this.lblPin.Xalign = 0F;
			this.lblPin.LabelProp = global::Mono.Unix.Catalog.GetString("Pin:");
			this.table3.Add(this.lblPin);
			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table3[this.lblPin]));
			w7.TopAttach = ((uint)(1));
			w7.BottomAttach = ((uint)(2));
			w7.XOptions = ((global::Gtk.AttachOptions)(4));
			w7.YOptions = ((global::Gtk.AttachOptions)(4));
			w1.Add(this.table3);
			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1[this.table3]));
			w8.Position = 0;
			w8.Expand = false;
			w8.Fill = false;
			// Internal child Frontend.DPinConfigDialog.ActionArea
			global::Gtk.HButtonBox w9 = this.ActionArea;
			w9.Name = "dialog1_ActionArea";
			w9.Spacing = 10;
			w9.BorderWidth = ((uint)(5));
			w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
			this.buttonCancel = new global::Gtk.Button();
			this.buttonCancel.CanDefault = true;
			this.buttonCancel.CanFocus = true;
			this.buttonCancel.Name = "buttonCancel";
			this.buttonCancel.UseStock = true;
			this.buttonCancel.UseUnderline = true;
			this.buttonCancel.Label = "gtk-cancel";
			this.AddActionWidget(this.buttonCancel, -6);
			global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9[this.buttonCancel]));
			w10.Expand = false;
			w10.Fill = false;
			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
			this.buttonOk = new global::Gtk.Button();
			this.buttonOk.CanDefault = true;
			this.buttonOk.CanFocus = true;
			this.buttonOk.Name = "buttonOk";
			this.buttonOk.UseStock = true;
			this.buttonOk.UseUnderline = true;
			this.buttonOk.Label = "gtk-add";
			this.AddActionWidget(this.buttonOk, -10);
			global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9[this.buttonOk]));
			w11.Position = 1;
			w11.Expand = false;
			w11.Fill = false;
			if ((this.Child != null))
			{
				this.Child.ShowAll();
			}
			this.DefaultWidth = 223;
			this.DefaultHeight = 145;
			this.Show();
		}
	}
}


text:
<?php

class Level_model extends CI_Model {

    protected $tbl = 'level';
    protected $add_rules = [
        'required'  => [],
        'email'     => [],
        'equals'    => [],
        'lengthMin' => [],
        'lengthMax' => []
    ];

    function __construct() {
        $this->load->database();
    }

    /*
     * GET
     */
    public function get($where) {
        $where['client_id'] = CLIENT_ID;
        $result = $this->db->get_where($this->tbl, $where);
        return $result->row();
    }

    public function get_list($where) {
        $where['client_id'] = CLIENT_ID;
        $result = $this->db->get_where($this->tbl, $where);
        return $result->result();
    }

    /*
     * ADD
     */
    public function add(array $data) {

        /* Validate using the rules */
        $v = new Valitron\Validator($data);
        $v->rules($this->add_rules);
        if(!$v->validate()) {
            return array('success' => false, 'message' => "Please validate your inputs.", 'errors' => $v->errors());
        }

        /* Check if unique identifier already exists */
        $result = $this->db->get_where($this->tbl, array('name' => $data['name']));
        if($result->num_rows() > 0) {
            return array('success' => false, 'message' => 'Level Name already exists.', 'field' => 'name');
        }

        $data['client_id'] = CLIENT_ID;
        /* Insert data */
        $this->db->trans_start();
        if($this->db->insert($this->tbl, $data)) {
            if ($this->db->trans_status() === FALSE) {
                $this->db->trans_rollback();
            } else {
                $this->db->trans_commit();
                return array('success' => true);
            }
        }
        return array('success' => false, 'message' => 'Something went wrong.');
    }

    /*
     * UPDATE
     */
    public function update($level_id, array $update) {
        $this->db->trans_start();
        $this->db->where('level_id', $level_id);
        if($this->db->update($this->tbl, $update)) {
            if ($this->db->trans_status() === FALSE) {
                $this->db->trans_rollback();
            } else {
                $this->db->trans_commit();
                return array('success' => true);
            }
        }
        return array('success' => false, 'message' => 'Something went wrong.');
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
 ~ Copyright (c) WSO2 Inc. (http://wso2.com) All Rights Reserved.
 ~
 ~ Licensed under the Apache License, Version 2.0 (the "License");
 ~ you may not use this file except in compliance with the License.
 ~ You may obtain a copy of the License at
 ~
 ~      http://www.apache.org/licenses/LICENSE-2.0
 ~
 ~ Unless required by applicable law or agreed to in writing, software
 ~ distributed under the License is distributed on an "AS IS" BASIS,
 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ~ See the License for the specific language governing permissions and
 ~ limitations under the License.
-->

<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/maven-v4_0_0.xsd">

    <parent>
        <groupId>org.wso2.carbon.commons</groupId>
        <artifactId>transaction-mgt</artifactId>
        <version>4.5.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.transaction.manager</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Carbon - Transaction manager</name>
    <description>Transaction Manager for Carbon</description>
    <url>http://wso2.org</url>

    <dependencies>
        <dependency>
            <groupId>org.jboss.spec.javax.transaction</groupId>
            <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.atomikos.wso2</groupId>
            <artifactId>atomikos</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.utils</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <!--<version>1.4</version>-->
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <forkMode>pertest</forkMode>
                    <argLine>-enableassertions</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <skip>false</skip>
                    <includes>
                        <include>**/*TestSuite.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.wso2.carbon.transaction.manager.*
                        </Export-Package>
                        <Import-Package>
                            !org.wso2.carbon.transaction.manager.*
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
@interface PodsDummy_Pods_TKSequenceTextField_Tests : NSObject
@end
@implementation PodsDummy_Pods_TKSequenceTextField_Tests
@end