text:
package org.apache.phoenix.filter;

import java.io.DataInput;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Bytes;

import org.apache.phoenix.expression.Expression;
import org.apache.phoenix.expression.KeyValueColumnExpression;
import org.apache.phoenix.schema.tuple.Tuple;

/**
 *
 * Modeled after {@link org.apache.hadoop.hbase.filter.SingleColumnValueFilter},
 * but for general expression evaluation in the case where multiple KeyValue
 * columns are referenced in the expression.
 *
 *
 * @since 0.1
 */
public abstract class MultiKeyValueComparisonFilter extends BooleanExpressionFilter {
    private static final byte[] UNITIALIZED_KEY_BUFFER = new byte[0];

    private Boolean matchedColumn;
    protected final IncrementalResultTuple inputTuple = new IncrementalResultTuple();

    public MultiKeyValueComparisonFilter() {
    }

    public MultiKeyValueComparisonFilter(Expression expression) {
        super(expression);
        init();
    }

    private static final class KeyValueRef {
        public KeyValue keyValue;

        @Override
        public String toString() {
            if(keyValue != null) {
                return keyValue.toString() + " value = " + Bytes.toStringBinary(keyValue.getValue());
            } else {
                return super.toString();
            }
        }
    }

    protected abstract Object setColumnKey(byte[] cf, int cfOffset, int cfLength, byte[] cq, int cqOffset, int cqLength);
    protected abstract Object newColumnKey(byte[] cf, int cfOffset, int cfLength, byte[] cq, int cqOffset, int cqLength);

    private final class IncrementalResultTuple implements Tuple {
        private int refCount;
        private final ImmutableBytesWritable keyPtr = new ImmutableBytesWritable(UNITIALIZED_KEY_BUFFER);
        private final Map<Object,KeyValueRef> foundColumns = new HashMap<Object,KeyValueRef>(5);

        public void reset() {
            refCount = 0;
            keyPtr.set(UNITIALIZED_KEY_BUFFER);
            for (KeyValueRef ref : foundColumns.values()) {
                ref.keyValue = null;
            }
        }

        @Override
        public boolean isImmutable() {
            return refCount == foundColumns.size();
        }

        public void setImmutable() {
            refCount = foundColumns.size();
        }

        public ReturnCode resolveColumn(KeyValue value) {
            // Always set key, in case we never find a key value column of interest,
            // and our expression uses row key columns.
            setKey(value);
            byte[] buf = value.getBuffer();
            Object ptr = setColumnKey(buf, value.getFamilyOffset(), value.getFamilyLength(), buf, value.getQualifierOffset(), value.getQualifierLength());
            KeyValueRef ref = foundColumns.get(ptr);
            if (ref == null) {
                // Return INCLUDE here. Although this filter doesn't need this KV
                // it should still be projected into the Result
                return ReturnCode.INCLUDE;
            }
            // Since we only look at the latest key value for a given column,
            // we are not interested in older versions
            // TODO: test with older versions to confirm this doesn't get tripped
            // This shouldn't be necessary, because a scan only looks at the latest
            // version
            if (ref.keyValue != null) {
                // Can't do NEXT_ROW, because then we don't match the other columns
                // SKIP, INCLUDE, and NEXT_COL seem to all act the same
                return ReturnCode.NEXT_COL;
            }
            ref.keyValue = value;
            refCount++;
            return null;
        }

        public void addColumn(byte[] cf, byte[] cq) {
            Object ptr = MultiKeyValueComparisonFilter.this.newColumnKey(cf, 0, cf.length, cq, 0, cq.length);
            foundColumns.put(ptr, new KeyValueRef());
        }

        public void setKey(KeyValue value) {
            keyPtr.set(value.getBuffer(), value.getRowOffset(), value.getRowLength());
        }

        @Override
        public void getKey(ImmutableBytesWritable ptr) {
            ptr.set(keyPtr.get(),keyPtr.getOffset(),keyPtr.getLength());
        }

        @Override
        public KeyValue getValue(byte[] cf, byte[] cq) {
            Object ptr = setColumnKey(cf, 0, cf.length, cq, 0, cq.length);
            KeyValueRef ref = foundColumns.get(ptr);
            return ref == null ? null : ref.keyValue;
        }

        @Override
        public String toString() {
            return foundColumns.toString();
        }

        @Override
        public int size() {
            return refCount;
        }

        @Override
        public KeyValue getValue(int index) {
            // This won't perform very well, but it's not
            // currently used anyway
            for (KeyValueRef ref : foundColumns.values()) {
                if (ref.keyValue == null) {
                    continue;
                }
                if (index == 0) {
                    return ref.keyValue;
                }
                index--;
            }
            throw new IndexOutOfBoundsException(Integer.toString(index));
        }

        @Override
        public boolean getValue(byte[] family, byte[] qualifier,
                ImmutableBytesWritable ptr) {
            KeyValue kv = getValue(family, qualifier);
            if (kv == null)
                return false;
            ptr.set(kv.getBuffer(), kv.getValueOffset(), kv.getValueLength());
            return true;
        }
    }

    protected void init() {
        EvaluateOnCompletionVisitor visitor = new EvaluateOnCompletionVisitor() {
            @Override
            public Void visit(KeyValueColumnExpression expression) {
                inputTuple.addColumn(expression.getColumnFamily(), expression.getColumnName());
                return null;
            }
        };
        expression.accept(visitor);
        this.evaluateOnCompletion = visitor.evaluateOnCompletion();
        expression.reset();
    }

    @Override
    public ReturnCode filterKeyValue(KeyValue keyValue) {
        if (Boolean.TRUE.equals(this.matchedColumn)) {
          // We already found and matched the single column, all keys now pass
          return ReturnCode.INCLUDE;
        }
        if (Boolean.FALSE.equals(this.matchedColumn)) {
          // We found all the columns, but did not match the expression, so skip to next row
          return ReturnCode.NEXT_ROW;
        }
        // This is a key value we're not interested in (TODO: why INCLUDE here instead of NEXT_COL?)
        ReturnCode code = inputTuple.resolveColumn(keyValue);
        if (code != null) {
            return code;
        }

        // We found a new column, so we can re-evaluate
        // TODO: if we have row key columns in our expression, should
        // we always evaluate or just wait until the end?
        this.matchedColumn = this.evaluate(inputTuple);
        if (this.matchedColumn == null) {
            if (inputTuple.isImmutable()) {
                this.matchedColumn = Boolean.FALSE;
            } else {
                return ReturnCode.INCLUDE;
            }
        }
        return this.matchedColumn ? ReturnCode.INCLUDE : ReturnCode.NEXT_ROW;
    }

    @Override
    public boolean filterRow() {
        if (this.matchedColumn == null && !inputTuple.isImmutable() && evaluateOnCompletion()) {
            inputTuple.setImmutable();
            this.matchedColumn = this.evaluate(inputTuple);
        }

        return ! (Boolean.TRUE.equals(this.matchedColumn));
    }

      @Override
    public void reset() {
        matchedColumn = null;
        inputTuple.reset();
        super.reset();
    }

    @Override
    public void readFields(DataInput input) throws IOException {
        super.readFields(input);
        init();
    }
}


text:
namespace base {
namespace subtle {

typedef int32_t Atomic32;
#ifdef ARCH_CPU_64_BITS
// We need to be able to go between Atomic64 and AtomicWord implicitly.  This
// means Atomic64 and AtomicWord should be the same type on 64-bit.
#if defined(__ILP32__) || defined(OS_NACL)
// NaCl's intptr_t is not actually 64-bits on 64-bit!
// http://code.google.com/p/nativeclient/issues/detail?id=1162
typedef int64_t Atomic64;
#else
typedef intptr_t Atomic64;
#endif
#endif

// Use AtomicWord for a machine-sized pointer.  It will use the Atomic32 or
// Atomic64 routines below, depending on your architecture.
typedef intptr_t AtomicWord;

// Atomically execute:
//      result = *ptr;
//      if (*ptr == old_value)
//        *ptr = new_value;
//      return result;
//
// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
// Always return the old value of "*ptr"
//
// This routine implies no memory barriers.
Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
                                  Atomic32 old_value,
                                  Atomic32 new_value);

// Atomically store new_value into *ptr, returning the previous value held in
// *ptr.  This routine implies no memory barriers.
Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value);

// Atomically increment *ptr by "increment".  Returns the new value of
// *ptr with the increment applied.  This routine implies no memory barriers.
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment);

Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
                                 Atomic32 increment);

// These following lower-level operations are typically useful only to people
// implementing higher-level synchronization operations like spinlocks,
// mutexes, and condition-variables.  They combine CompareAndSwap(), a load, or
// a store with appropriate memory-ordering instructions.  "Acquire" operations
// ensure that no later memory access can be reordered ahead of the operation.
// "Release" operations ensure that no previous memory access can be reordered
// after the operation.  "Barrier" operations have both "Acquire" and "Release"
// semantics.
Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
                                Atomic32 old_value,
                                Atomic32 new_value);
Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
                                Atomic32 old_value,
                                Atomic32 new_value);

void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value);
void Release_Store(volatile Atomic32* ptr, Atomic32 value);

Atomic32 NoBarrier_Load(volatile const Atomic32* ptr);
Atomic32 Acquire_Load(volatile const Atomic32* ptr);

// 64-bit atomic operations (only available on 64-bit processors).
#ifdef ARCH_CPU_64_BITS
Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
                                  Atomic64 old_value,
                                  Atomic64 new_value);
Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value);
Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);
Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment);

Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
                                Atomic64 old_value,
                                Atomic64 new_value);
Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
                                Atomic64 old_value,
                                Atomic64 new_value);
void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value);
void Release_Store(volatile Atomic64* ptr, Atomic64 value);
Atomic64 NoBarrier_Load(volatile const Atomic64* ptr);
Atomic64 Acquire_Load(volatile const Atomic64* ptr);
#endif  // ARCH_CPU_64_BITS

}  // namespace subtle
}  // namespace base

#include "base/atomicops_internals_portable.h"

// On some platforms we need additional declarations to make
// AtomicWord compatible with our other Atomic* types.
#if defined(OS_APPLE) || defined(OS_OPENBSD)
#include "base/atomicops_internals_atomicword_compat.h"
#endif

#endif  // BASE_ATOMICOPS_H_

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using Newtonsoft.Json;

namespace Microsoft.Azure.WebJobs.Extensions.SignalRService
{
    /// <summary>
    /// The <see cref="SignalRMessage.Arguments"/> shouldn't be required, but it's a breaking change to remove the <see cref="JsonRequiredAttribute"/> of the member. As a workaround, we have to use a converter to override the behaviour.
    /// </summary>
    internal class SignalRMessageConverter : JsonConverter<SignalRMessage>
    {
        public override SignalRMessage ReadJson(JsonReader reader, Type objectType, SignalRMessage existingValue, bool hasExistingValue, JsonSerializer serializer)
        {
            var internalMessageObj = serializer.Deserialize<InternalSignalRMessage>(reader);
            return new()
            {
                ConnectionId = internalMessageObj.connectionId,
                UserId = internalMessageObj.userId,
                GroupName = internalMessageObj.groupName,
                Target = internalMessageObj.target,
                Arguments = internalMessageObj.arguments,
                Endpoints = internalMessageObj.endpoints,
            };
        }

        public override void WriteJson(JsonWriter writer, SignalRMessage value, JsonSerializer serializer)
        {
            serializer.Serialize(writer, value);
        }
    }
}


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

<title>Uses of Interface org.springframework.aop.RawTargetAccess (Spring Framework 5.1.18.RELEASE API)</title>
<meta name="date" content="2020-09-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Spring Framework

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.springframework.aop.RawTargetAccess

Packages that use RawTargetAccess

Package
Description

org.springframework.aop.scope

Support for AOP-based scoping of target objects, with configurable backend.

Uses of RawTargetAccess in org.springframework.aop.scope

Subinterfaces of RawTargetAccess in org.springframework.aop.scope

Modifier and Type
Interface and Description

interface
ScopedObject

An AOP introduction interface for scoped objects.

Classes in org.springframework.aop.scope that implement RawTargetAccess

Modifier and Type
Class and Description

class
DefaultScopedObject

Default implementation of the ScopedObject interface.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Spring Framework

Prev

Next

Frames

No Frames

All Classes


text:
<?php
/**
 * Class SilexInstagramServiceProvider
 *
 * @author Mauro Moreno <moreno.mauro.emanuel@gmail.com>
 */
namespace MauroMoreno\SilexInstagram;

use Silex\ServiceProviderInterface;
use Silex\Application;
use MetzWeb\Instagram\Instagram;

/**
 * Class SilexInstagramServiceProvider
 * @package MauroMoreno\SilexInstagram
 */
class SilexInstagramServiceProvider implements ServiceProviderInterface
{

    /**
     * {@inheritdoc}
     */
    public function register(Application $app)
    {
        $app['instagram'] = function () use ($app) {
            return new Instagram([
                'apiKey' => $app['instagram.key'],
                'apiSecret' => $app['instagram.secret'],
                'apiCallback' => $app['instagram.callback']
            ]);
        };
    }

    /**
     * {@inheritdoc}
     */
    public function boot(Application $app)
    {
    }

}


text:
module JsonColumn
  VERSION = "0.6.6"
end


text:
package org.onosproject.provider.of.message.impl;

import com.google.common.collect.Maps;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.metrics.MetricsService;
import org.onlab.util.SharedScheduledExecutorService;
import org.onlab.util.SharedScheduledExecutors;
import org.onosproject.cpman.message.ControlMessageProvider;
import org.onosproject.cpman.message.ControlMessageProviderRegistry;
import org.onosproject.cpman.message.ControlMessageProviderService;
import org.onosproject.net.DeviceId;
import org.onosproject.net.provider.AbstractProvider;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.openflow.controller.Dpid;
import org.onosproject.openflow.controller.OpenFlowController;
import org.onosproject.openflow.controller.OpenFlowMessageListener;
import org.onosproject.openflow.controller.OpenFlowSwitch;
import org.onosproject.openflow.controller.OpenFlowSwitchListener;
import org.onosproject.openflow.controller.RoleState;
import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPortStatus;
import org.projectfloodlight.openflow.protocol.OFType;
import org.slf4j.Logger;

import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

import static org.onosproject.net.DeviceId.deviceId;
import static org.onosproject.openflow.controller.Dpid.uri;
import static org.slf4j.LoggerFactory.getLogger;

/**
 * Provider which uses an OpenFlow controller to collect control message.
 */
@Component(immediate = true)
public class OpenFlowControlMessageProvider extends AbstractProvider
        implements ControlMessageProvider {

    private final Logger log = getLogger(getClass());

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected ControlMessageProviderRegistry providerRegistry;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected OpenFlowController controller;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected MetricsService metricsService;

    private ControlMessageProviderService providerService;

    private final InternalDeviceProvider listener = new InternalDeviceProvider();

    private final InternalControlMessageListener messageListener =
                    new InternalControlMessageListener();

    private HashMap<Dpid, OpenFlowControlMessageAggregator> aggregators = Maps.newHashMap();
    private SharedScheduledExecutorService executor;
    private static final int AGGR_INIT_DELAY = 1;
    private static final int AGGR_PERIOD = 1;
    private static final TimeUnit AGGR_TIME_UNIT = TimeUnit.MINUTES;
    private HashMap<Dpid, ScheduledFuture<?>> executorResults = Maps.newHashMap();

    /**
     * Creates a provider with the supplier identifier.
     */
    public OpenFlowControlMessageProvider() {
        super(new ProviderId("of", "org.onosproject.provider.openflow"));
    }

    @Activate
    protected void activate() {
        providerService = providerRegistry.register(this);

        // listens all OpenFlow device related events
        controller.addListener(listener);

        // listens all OpenFlow control message
        controller.addMessageListener(messageListener);

        executor = SharedScheduledExecutors.getSingleThreadExecutor();

        connectInitialDevices();
        log.info("Started");
    }

    @Deactivate
    protected void deactivate() {
        controller.removeListener(listener);
        providerRegistry.unregister(this);
        providerService = null;

        // stops listening all OpenFlow control message events
        controller.removeMessageListener(messageListener);

        log.info("Stopped");
    }

    private void connectInitialDevices() {
        for (OpenFlowSwitch sw: controller.getSwitches()) {
            try {
                listener.switchAdded(new Dpid(sw.getId()));
            } catch (Exception e) {
                log.warn("Failed initially adding {} : {}", sw.getStringId(), e.getMessage());
                log.debug("Error details:", e);
            }
        }
    }

    /**
     * A listener for OpenFlow switch event.
     */
    private class InternalDeviceProvider implements OpenFlowSwitchListener {

        @Override
        public void switchAdded(Dpid dpid) {
            if (providerService == null) {
                return;
            }

            DeviceId deviceId = deviceId(uri(dpid));
            OpenFlowControlMessageAggregator ofcma =
                    new OpenFlowControlMessageAggregator(metricsService,
                            providerService, deviceId);
            ScheduledFuture result = executor.scheduleAtFixedRate(ofcma,
                    AGGR_INIT_DELAY, AGGR_PERIOD, AGGR_TIME_UNIT, true);
            aggregators.put(dpid, ofcma);
            executorResults.put(dpid, result);
        }

        @Override
        public void switchRemoved(Dpid dpid) {
            if (providerService == null) {
                return;
            }

            // removes the aggregator when switch is removed
            // this also stops the aggregator from running
            OpenFlowControlMessageAggregator aggregator = aggregators.remove(dpid);
            if (aggregator != null) {
                executorResults.get(dpid).cancel(true);
                executorResults.remove(dpid);
            }
        }

        @Override
        public void switchChanged(Dpid dpid) {
        }

        @Override
        public void portChanged(Dpid dpid, OFPortStatus status) {
        }

        @Override
        public void receivedRoleReply(Dpid dpid, RoleState requested, RoleState response) {
        }
    }

    /**
     * A listener for all OpenFlow control messages.
     */
    private class InternalControlMessageListener implements OpenFlowMessageListener {

        @Override
        public void handleIncomingMessage(Dpid dpid, OFMessage msg) {
            if (msg.getType() == OFType.PACKET_IN ||
                    msg.getType() == OFType.FLOW_MOD ||
                    msg.getType() == OFType.STATS_REPLY) {
                aggregators.computeIfPresent(dpid, (k, v) -> {
                    v.increment(msg);
                    return v;
                });
            }
        }

        @Override
        public void handleOutgoingMessage(Dpid dpid, List<OFMessage> msgs) {
            for (OFMessage msg : msgs) {
                if (msg.getType() == OFType.PACKET_OUT ||
                        msg.getType() == OFType.FLOW_MOD ||
                        msg.getType() == OFType.STATS_REQUEST) {
                    aggregators.computeIfPresent(dpid, (k, v) -> {
                        v.increment(msg);
                        return v;
                    });
                }
            }
        }
    }
}


text:
using System;
using AASCJFPPE.DAL.Datas;
using AASCJFPPE.Misc;
using System.Windows.Forms;
using System.Linq;
using System.Collections.Generic;

namespace AASCJFPPE.UserControls.Cahier_Journal
{
    /// <summary>
    /// UserControl permettant la modification d'une séance du Cahier Journal
    /// </summary>
    public partial class UCSeanceCJModification : UCSeanceCJ
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UCSeanceCJModification"/> class.
        /// </summary>
        public UCSeanceCJModification()
            : base()
        {
            InitializeComponent();

            this.cmbDiscipline.DisplayMember = "Intitule";
            this.cmbDiscipline.ValueMember = "Id";

            this.cmbDiscipline.DataSource = DataRepository.Instance.Discipline.ToList().OrderBy(d => d.Intitule).ToList();

            this.InitializeSeanceDatas();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UCSeanceCJModification"/> class.
        /// </summary>
        /// <param name="seance">The seance.</param>
        public UCSeanceCJModification(CahierJournal seance)
            : base(seance)
        {
            InitializeComponent();

            this.AddDidactiquePanel(new DidactiqueCJ());

            this.cmbDiscipline.DisplayMember = "Intitule";
            this.cmbDiscipline.ValueMember = "Id";

            this.cmbDiscipline.DataSource = DataRepository.Instance.Discipline.ToList().OrderBy(d => d.Intitule).ToList();

            this.InitializeSeanceDatas();
        }

        /// <summary>
        /// Initializes the seance datas.
        /// </summary>
        protected override void InitializeSeanceDatas()
        {
            if (this.Seance.Id.HasValue)
            {
                this.txtTrancheHoraire.Text = this.Seance.TrancheHoraire;

                this.nudNumero.Value = this.Seance.NumeroSeance.Value;

                this.txtObjectifs.Text = this.Seance.Objectifs;

                this.cmbDiscipline.Text = DataRepository.Instance.Discipline.SelectById(this.Seance.Discipline)[0].Intitule;

                List<DomaineActivite> das = DataRepository.Instance.DomaineActivite.SelectById(this.Seance.DomaineActivite);
                if (das != null && das.Count > 0)
                {
                    this.cmbDomainActivite.Text = das[0].Intitule;
                }

                this.InitializeDidactiques(this.Seance.Didactiques);
            }
        }

        /// <summary>
        /// Gets the didactique panel.
        /// </summary>
        /// <returns></returns>
        protected override UCDidactiqueCJ GetDidactiquePanel(DidactiqueCJ didactique)
        {
            return new UCDidactiqueCJModification(didactique);
        }

        /// <summary>
        /// Handles the SelectedIndexChanged event of the cmbDiscipline control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void cmbDiscipline_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.cmbDomainActivite.DisplayMember = "Intitule";
            this.cmbDomainActivite.ValueMember = "Id";
            List<DomaineActivite> das = DataRepository.Instance.DomaineActivite.SelectByDiscipline((long)this.cmbDiscipline.SelectedValue);
            if (das != null && das.Count > 0)
            {
                this.cmbDomainActivite.DataSource = das.OrderBy(da => da.Intitule).ToList();
                this.cmbDomainActivite.Enabled = true;
            }
            else
            {
                this.cmbDomainActivite.DataSource = null;
                this.cmbDomainActivite.Items.Clear();
                this.cmbDomainActivite.Enabled = false;
            }
        }

        /// <summary>
        /// Handles the Click event of the btnAjouterDidactique control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnAjouterDidactique_Click(object sender, EventArgs e)
        {
            this.AddDidactiquePanel(new DidactiqueCJ());
            this.btnDeleteLastDidactique.Enabled = true;
        }

        /// <summary>
        /// Saves this instance.
        /// </summary>
        /// <param name="dateDebut">The date debut.</param>
        /// <param name="dateFin">The date fin.</param>
        /// <param name="dateJour">The date jour.</param>
        public override void Save(DateTime dateDebut, DateTime dateFin, DateTime dateJour)
        {
            // Save
            this.Seance.DateDebut = dateDebut;
            this.Seance.DateFin = dateFin;
            this.Seance.DateJour = dateJour;
            this.Seance.Discipline = (long?)this.cmbDiscipline.SelectedValue;
            this.Seance.DomaineActivite = (long?)this.cmbDomainActivite.SelectedValue;
            this.Seance.NumeroSeance = (int)this.nudNumero.Value;
            this.Seance.Objectifs = this.txtObjectifs.Text;
            this.Seance.TrancheHoraire = this.txtTrancheHoraire.Text;

            if (this.Seance.Id.HasValue)
            {
                // Update
                DataRepository.Instance.CahierJournal.Update(this.Seance);
            }
            else
            {
                // Insert
                this.Seance.Id = DataRepository.Instance.CahierJournal.CreateAndGetId(this.Seance.DateDebut,
                                                    this.Seance.DateFin,
                                                    this.Seance.DateJour,
                                                    this.Seance.TrancheHoraire,
                                                    this.Seance.Discipline,
                                                    this.Seance.NumeroSeance,
                                                    this.Seance.Objectifs,
                                                    this.Seance.DomaineActivite);
            }

            // Delete previous links
            DataRepository.Instance.Link_CJ_DidactiqueCJ.DeleteByCJ_Id(this.Seance.Id);

            for (int i = this.pnlDidactiques.Controls.Count - 1; i >= 0; i--)
            {
                UCDidactiqueCJ ucDidactiqueCJ = this.pnlDidactiques.Controls[i] as UCDidactiqueCJ;
                if (ucDidactiqueCJ != null)
                {
                    long didactiqueId = ucDidactiqueCJ.Save();

                    //  Save Link
                    DataRepository.Instance.Link_CJ_DidactiqueCJ.Create(this.Seance.Id, didactiqueId);
                }
            }
        }

        private void pnlDisciplineEtDomaineActivite_Resize(object sender, EventArgs e)
        {
            this.lblDisciplineEtDomaineActivite.Left = (this.pnlDisciplineEtDomaineActivite.Width - this.lblDisciplineEtDomaineActivite.Width) / 2;
            this.cmbDomainActivite.Left = this.pnlDisciplineEtDomaineActivite.Width / 2;
        }

        private void btnDeleteLastDidactique_Click(object sender, EventArgs e)
        {
            if (this.pnlDidactiques.Controls.Count > 1)
            {
                this.pnlDidactiques.Controls.RemoveAt(0);

                if (this.pnlDidactiques.Controls.Count == 1)
                {
                    this.btnDeleteLastDidactique.Enabled = false;
                }
            }
        }
    }
}


text:
#ifndef REGISTRY_H
#define REGISTRY_H

#include <librdkafka/rdkafka.h>
#include <curl/curl.h>
#include <avro.h>

/* 5 bytes prefix is added by schema_registry_encode_msg(). */
#define SCHEMA_REGISTRY_MESSAGE_PREFIX_LEN 5

#define SCHEMA_REGISTRY_ERROR_LEN 512

typedef struct {
    CURL *curl;                            /* HTTP client for making requests to schema registry */
    struct curl_slist *curl_headers;       /* HTTP headers for requests to schema registry */
    char curl_error[CURL_ERROR_SIZE];      /* Buffer for libcurl error messages */
    char error[SCHEMA_REGISTRY_ERROR_LEN]; /* Buffer for general error messages */
    char *registry_url;                    /* URL of server */
} schema_registry;

typedef schema_registry *schema_registry_t;

schema_registry_t schema_registry_new(char *url);
int schema_registry_request(schema_registry_t registry, const char* name,
        int is_key,
        const char *schema_json, size_t schema_len,
        int *schema_id_out);
int schema_registry_encode_msg(int key_schema_id, int row_schema_id,
        const void *key_bin, size_t key_len, void **key_out, size_t *key_len_out,
        const void *row_bin, size_t row_len, void **row_out, size_t *row_len_out);
void schema_registry_free(schema_registry_t reader);

#endif /* REGISTRY_H */


text:
namespace torali
{

  template<typename TConfig, typename TValidRegion, typename TSRStore, typename TStructuralVariantRecord>
  inline void
  assembleSplitReads(TConfig const& c, TValidRegion const& validRegions, TSRStore const& srStore, std::vector<TStructuralVariantRecord>& svs)
  {
    typedef typename TValidRegion::value_type TChrIntervals;
    typedef typename TSRStore::value_type TPosReadSV;

    // Open file handles
    typedef std::vector<samFile*> TSamFile;
    typedef std::vector<hts_idx_t*> TIndex;
    TSamFile samfile(c.files.size());
    TIndex idx(c.files.size());
    for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
      samfile[file_c] = sam_open(c.files[file_c].string().c_str(), "r");
      hts_set_fai_filename(samfile[file_c], c.genome.string().c_str());
      idx[file_c] = sam_index_load(samfile[file_c], c.files[file_c].string().c_str());
    }
    bam_hdr_t* hdr = sam_hdr_read(samfile[0]);

    // Reads per SV
    typedef std::set<std::string> TSequences;
    typedef std::vector<TSequences> TSVSequences;
    TSVSequences traStore(svs.size(), TSequences());
    uint32_t maxReadPerSV = 20;
    typedef std::vector<uint8_t> TQualities;
    typedef std::vector<TQualities> TQualVectors;
    TQualVectors traQualStore(svs.size(), TQualities());

    // Parse BAM
    boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
    std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "Split-read assembly" << std::endl;

    faidx_t* fai = fai_load(c.genome.string().c_str());
    for(int32_t refIndex = 0; refIndex < hdr->n_targets; ++refIndex) {
      if (validRegions[refIndex].empty()) continue;
      if (srStore[refIndex].empty()) continue;

      // Load sequence
      int32_t seqlen = -1;
      std::string tname(hdr->target_name[refIndex]);
      char* seq = faidx_fetch_seq(fai, tname.c_str(), 0, hdr->target_len[refIndex], &seqlen);

      // Collect all split-read pos
      typedef boost::dynamic_bitset<> TBitSet;
      TBitSet hits(hdr->target_len[refIndex]);
      for(typename TPosReadSV::const_iterator it = srStore[refIndex].begin(); it != srStore[refIndex].end(); ++it) hits[it->first.first] = 1;

      // Sequences
      TSVSequences seqStore(svs.size(), TSequences());
      TQualVectors qualStore(svs.size(), TQualities());

      // Collect reads from all samples
      for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
	// Read alignments
	for(typename TChrIntervals::const_iterator vRIt = validRegions[refIndex].begin(); vRIt != validRegions[refIndex].end(); ++vRIt) {
	  hts_itr_t* iter = sam_itr_queryi(idx[file_c], refIndex, vRIt->lower(), vRIt->upper());
	  bam1_t* rec = bam_init1();
	  while (sam_itr_next(samfile[file_c], iter, rec) >= 0) {
	    if (rec->core.flag & (BAM_FQCFAIL | BAM_FDUP | BAM_FUNMAP | BAM_FSECONDARY | BAM_FSUPPLEMENTARY)) continue;
	    if ((rec->core.qual < c.minMapQual) || (rec->core.tid<0)) continue;
	    if (!hits[rec->core.pos]) continue;

	    // Valid split-read
	    std::size_t seed = hash_string(bam_get_qname(rec));
	    typename TPosReadSV::const_iterator it = srStore[refIndex].find(std::make_pair(rec->core.pos, seed));
	    if (it != srStore[refIndex].end()) {
	      int32_t svid = it->second;

	      // Get the sequence
	      if (svid == (int32_t) svs[svid].id) {  // Should be always true
		std::string sequence;
		sequence.resize(rec->core.l_qseq);
		uint8_t* seqptr = bam_get_seq(rec);
		for (int i = 0; i < rec->core.l_qseq; ++i) sequence[i] = "=ACMGRSVTWYHKDBN"[bam_seqi(seqptr, i)];

		// Adjust orientation
		bool bpPoint = false;
		if (_translocation(svs[svid].svt)) {
		  if (rec->core.tid == svs[svid].chr2) bpPoint = true;
		} else {
		  // Only relevant for inversions
		  if (svs[svid].svt == 0) {
		    if (rec->core.pos + 25 > svs[svid].svStart) bpPoint = true;
		    else bpPoint = false;
		  } else if (svs[svid].svt == 1) {
		    if (rec->core.pos + 25 > svs[svid].svEnd) bpPoint = true;
		    else bpPoint = false;
		  }
		}
		_adjustOrientation(sequence, bpPoint, svs[svid].svt);

		// At most n split-reads
		if (seqStore[svid].size() < maxReadPerSV) {
		  bool insertSuccess = false;
		  if (_translocation(svs[svid].svt)) insertSuccess = traStore[svid].insert(sequence).second;
		  else insertSuccess = seqStore[svid].insert(sequence).second;
		  // Store qualities
		  if (insertSuccess) {
		    if (_translocation(svs[svid].svt)) traQualStore[svid].push_back(rec->core.qual);
		    else qualStore[svid].push_back(rec->core.qual);
		  }
		}
	      }
	    }
	  }
	  bam_destroy1(rec);
          hts_itr_destroy(iter);
	}
      }

      // Process all SVs on this chromosome
      for(uint32_t svid = 0; svid < seqStore.size(); ++svid) {
	if (_translocation(svs[svid].svt)) continue;
	if (svs[svid].chr != refIndex) continue;

	// MSA
	bool msaSuccess = false;
	if (seqStore[svid].size() > 1) {
	  msa(c, seqStore[svid], svs[svid].consensus);
	  if (alignConsensus(c, hdr, seq, NULL, svs[svid])) msaSuccess = true;
	}
	if (!msaSuccess) {
	  svs[svid].consensus = "";
	  svs[svid].srSupport = 0;
	  svs[svid].srAlignQuality = 0;
	} else {
	  // SR support and qualities
	  std::sort(qualStore[svid].begin(), qualStore[svid].end());
	  svs[svid].mapq = 0;
	  for(uint32_t i = 0; i < qualStore[svid].size(); ++i) svs[svid].mapq += qualStore[svid][i];
	  svs[svid].srSupport = seqStore[svid].size();
	  svs[svid].srMapQuality = qualStore[svid][qualStore[svid].size()/2];
	}
      }
      // Clean-up
      if (seq != NULL) free(seq);
    }

    // Process translocations
    for(int32_t refIndex2 = 0; refIndex2 < hdr->n_targets; ++refIndex2) {
      if (validRegions[refIndex2].empty()) continue;
      char* sndSeq = NULL;
      for(int32_t refIndex = refIndex2 + 1; refIndex < hdr->n_targets; ++refIndex) {
	if (validRegions[refIndex].empty()) continue;
	char* seq = NULL;

	// Iterate SVs
	for(uint32_t svid = 0; svid < traStore.size(); ++svid) {
	  if (!_translocation(svs[svid].svt)) continue;
	  if ((svs[svid].chr != refIndex) || (svs[svid].chr2 != refIndex2)) continue;

	  bool msaSuccess = false;
	  if (traStore[svid].size() > 1) {
	    // Lazy loading of references
	    if (seq == NULL) {
	      int32_t seqlen = -1;
	      std::string tname(hdr->target_name[refIndex]);
	      seq = faidx_fetch_seq(fai, tname.c_str(), 0, hdr->target_len[refIndex], &seqlen);
	    }
	    if (sndSeq == NULL) {
	      int32_t seqlen = -1;
	      std::string tname(hdr->target_name[refIndex2]);
	      sndSeq = faidx_fetch_seq(fai, tname.c_str(), 0, hdr->target_len[refIndex2], &seqlen);
	    }
	    msa(c, traStore[svid], svs[svid].consensus);
	    if (alignConsensus(c, hdr, seq, sndSeq, svs[svid])) msaSuccess = true;
	  }
	  if (!msaSuccess) {
	    svs[svid].consensus = "";
	    svs[svid].srSupport = 0;
	    svs[svid].srAlignQuality = 0;
	  } else {
	    // SR support and qualities
	    std::sort(traQualStore[svid].begin(), traQualStore[svid].end());
	    svs[svid].mapq = 0;
	    for(uint32_t i = 0; i < traQualStore[svid].size(); ++i) svs[svid].mapq += traQualStore[svid][i];
	    svs[svid].srSupport = traStore[svid].size();
	    svs[svid].srMapQuality = traQualStore[svid][traQualStore[svid].size()/2];
	  }
	}
	if (seq != NULL) free(seq);
      }
      if (sndSeq != NULL) free(sndSeq);
    }

    // Clean-up
    fai_destroy(fai);
    bam_hdr_destroy(hdr);
    for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
      hts_idx_destroy(idx[file_c]);
      sam_close(samfile[file_c]);
    }
  }

  template<typename TConfig, typename TValidRegion, typename TSRStore, typename TSampleLib>
  inline void
  scanPEandSR(TConfig const& c, TValidRegion const& validRegions, std::vector<StructuralVariantRecord>& svs, std::vector<StructuralVariantRecord>& srSVs, TSRStore& srStore, TSampleLib& sampleLib)
  {
    typedef typename TValidRegion::value_type TChrIntervals;

    // Open file handles
    typedef std::vector<samFile*> TSamFile;
    typedef std::vector<hts_idx_t*> TIndex;
    TSamFile samfile(c.files.size());
    TIndex idx(c.files.size());
    for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
      samfile[file_c] = sam_open(c.files[file_c].string().c_str(), "r");
      hts_set_fai_filename(samfile[file_c], c.genome.string().c_str());
      idx[file_c] = sam_index_load(samfile[file_c], c.files[file_c].string().c_str());
    }
    bam_hdr_t* hdr = sam_hdr_read(samfile[0]);

    // Split-read records
    typedef std::vector<SRBamRecord> TSRBamRecord;
    typedef std::vector<TSRBamRecord> TSvtSRBamRecord;
    TSvtSRBamRecord srBR(2 * DELLY_SVT_TRANS, TSRBamRecord());

    // Create bam alignment record vector
    typedef std::vector<BamAlignRecord> TBamRecord;
    typedef std::vector<TBamRecord> TSvtBamRecord;
    TSvtBamRecord bamRecord(2 * DELLY_SVT_TRANS, TBamRecord());

    // Parse genome, process chromosome by chromosome
    boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
    std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "Paired-end and split-read scanning" << std::endl;
    // Iterate all samples
#pragma omp parallel for default(shared)
    for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
      // Inter-chromosomal mate map and alignment length
      typedef std::pair<uint8_t, int32_t> TQualLen;
      typedef boost::unordered_map<std::size_t, TQualLen> TMateMap;
      std::vector<TMateMap> matetra(c.files.size());

      // Split-read junctions
      typedef std::vector<Junction> TJunctionVector;
      typedef std::map<unsigned, TJunctionVector> TReadBp;
      TReadBp readBp;

      // Iterate all chromosomes for that sample
      for(int32_t refIndex=0; refIndex < (int32_t) hdr->n_targets; ++refIndex) {

	// Any data?
	if (validRegions[refIndex].empty()) continue;
	bool nodata = true;
	std::string suffix("cram");
	std::string str(c.files[file_c].string());
	if ((str.size() >= suffix.size()) && (str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0)) nodata = false;
	uint64_t mapped = 0;
	uint64_t unmapped = 0;
	hts_idx_get_stat(idx[file_c], refIndex, &mapped, &unmapped);
	if (mapped) nodata = false;
	if (nodata) continue;

	// Intra-chromosomal mate map and alignment length
	TMateMap mateMap;

	// Read alignments
	for(typename TChrIntervals::const_iterator vRIt = validRegions[refIndex].begin(); vRIt != validRegions[refIndex].end(); ++vRIt) {
	  hts_itr_t* iter = sam_itr_queryi(idx[file_c], refIndex, vRIt->lower(), vRIt->upper());
	  bam1_t* rec = bam_init1();
	  int32_t lastAlignedPos = 0;
	  std::set<std::size_t> lastAlignedPosReads;
	  while (sam_itr_next(samfile[file_c], iter, rec) >= 0) {
	    if (rec->core.flag & (BAM_FQCFAIL | BAM_FDUP | BAM_FUNMAP)) continue;
	    if ((rec->core.qual < c.minMapQual) || (rec->core.tid<0)) continue;

	    unsigned seed = hash_string(bam_get_qname(rec));

	    // SV detection using single-end read
	    uint32_t rp = rec->core.pos; // reference pointer
	    uint32_t sp = 0; // sequence pointer

	    // Parse the CIGAR
	    uint32_t* cigar = bam_get_cigar(rec);
	    for (std::size_t i = 0; i < rec->core.n_cigar; ++i) {
	      if ((bam_cigar_op(cigar[i]) == BAM_CMATCH) || (bam_cigar_op(cigar[i]) == BAM_CEQUAL) || (bam_cigar_op(cigar[i]) == BAM_CDIFF)) {
		sp += bam_cigar_oplen(cigar[i]);
		rp += bam_cigar_oplen(cigar[i]);
	      } else if (bam_cigar_op(cigar[i]) == BAM_CDEL) {
		if (bam_cigar_oplen(cigar[i]) > c.minRefSep) _insertJunction(readBp, seed, rec, rp, sp, false);
		rp += bam_cigar_oplen(cigar[i]);
		if (bam_cigar_oplen(cigar[i]) > c.minRefSep) _insertJunction(readBp, seed, rec, rp, sp, true);
	      } else if (bam_cigar_op(cigar[i]) == BAM_CINS) {
		if (bam_cigar_oplen(cigar[i]) > c.minRefSep) _insertJunction(readBp, seed, rec, rp, sp, false);
		sp += bam_cigar_oplen(cigar[i]);
		if (bam_cigar_oplen(cigar[i]) > c.minRefSep) _insertJunction(readBp, seed, rec, rp, sp, true);
	      } else if ((bam_cigar_op(cigar[i]) == BAM_CSOFT_CLIP) || (bam_cigar_op(cigar[i]) == BAM_CHARD_CLIP)) {
		int32_t finalsp = sp;
		bool scleft = false;
		if (sp == 0) {
		  finalsp += bam_cigar_oplen(cigar[i]); // Leading soft-clip / hard-clip
		  scleft = true;
		}
		sp += bam_cigar_oplen(cigar[i]);
		if (bam_cigar_oplen(cigar[i]) > c.minClip) _insertJunction(readBp, seed, rec, rp, finalsp, scleft);
	      } else if (bam_cigar_op(cigar[i]) == BAM_CREF_SKIP) {
		rp += bam_cigar_oplen(cigar[i]);
	      } else {
		std::cerr << "Warning: Unknown Cigar operation!" << std::endl;
	      }
	    }

	    // Paired-end clustering
	    if (rec->core.flag & BAM_FPAIRED) {
	      // Single-end library
	      if (sampleLib[file_c].median == 0) continue; // Single-end library

	      // Secondary/supplementary alignments, mate unmapped or blacklisted chr
	      if (rec->core.flag & (BAM_FSECONDARY | BAM_FSUPPLEMENTARY)) continue;
	      if ((rec->core.mtid<0) || (rec->core.flag & BAM_FMUNMAP)) continue;
	      if (validRegions[rec->core.mtid].empty()) continue;
	      if ((_translocation(rec)) && (rec->core.qual < c.minTraQual)) continue;

	      // SV type
	      int32_t svt = _isizeMappingPos(rec, sampleLib[file_c].maxISizeCutoff);
	      if (svt == -1) continue;
	      if ((!c.svtset.empty()) && (c.svtset.find(svt) == c.svtset.end())) continue;

	      // Check library-specific insert size for deletions
	      if ((svt == 2) && (sampleLib[file_c].maxISizeCutoff > std::abs(rec->core.isize))) continue;

	      // Clean-up the read store for identical alignment positions
	      if (rec->core.pos > lastAlignedPos) {
		lastAlignedPosReads.clear();
		lastAlignedPos = rec->core.pos;
	      }

	      // Get or store the mapping quality for the partner
	      if (_firstPairObs(rec, lastAlignedPosReads)) {
		// First read
		lastAlignedPosReads.insert(seed);
		std::size_t hv = hash_pair(rec);
		if (_translocation(svt)) matetra[file_c][hv]= std::make_pair((uint8_t) rec->core.qual, alignmentLength(rec));
		else mateMap[hv]= std::make_pair((uint8_t) rec->core.qual, alignmentLength(rec));
	      } else {
		// Second read
		std::size_t hv = hash_pair_mate(rec);
		int32_t alenmate = 0;
		uint8_t pairQuality = 0;
	        if (_translocation(svt)) {
		  // Inter-chromosomal
		  if ((matetra[file_c].find(hv) == matetra[file_c].end()) || (!matetra[file_c][hv].first)) continue; // Mate discarded
		  TQualLen p = matetra[file_c][hv];
		  pairQuality = std::min((uint8_t) p.first, (uint8_t) rec->core.qual);
		  alenmate = p.second;
		  matetra[file_c][hv].first = 0;
		} else {
		  // Intra-chromosomal
		  if ((mateMap.find(hv) == mateMap.end()) || (!mateMap[hv].first)) continue; // Mate discarded
		  TQualLen p = mateMap[hv];
		  pairQuality = std::min((uint8_t) p.first, (uint8_t) rec->core.qual);
		  alenmate = p.second;
		  mateMap[hv].first = 0;
		}

#pragma omp critical
		{
		  bamRecord[svt].push_back(BamAlignRecord(rec, pairQuality, alignmentLength(rec), alenmate, sampleLib[file_c].median, sampleLib[file_c].mad, sampleLib[file_c].maxNormalISize));
		}
		++sampleLib[file_c].abnormal_pairs;
	      }
	    }
	  }
	  bam_destroy1(rec);
	  hts_itr_destroy(iter);
	}
      }

      // Process all junctions for this BAM file
      for(typename TReadBp::iterator it = readBp.begin(); it != readBp.end(); ++it) {
	std::sort(it->second.begin(), it->second.end(), SortJunction<Junction>());
      }

      // Collect split-read SVs
#pragma omp critical
      {
	if ((c.svtset.empty()) || (c.svtset.find(2) != c.svtset.end())) selectDeletions(c, readBp, srBR);
	if ((c.svtset.empty()) || (c.svtset.find(3) != c.svtset.end())) selectDuplications(c, readBp, srBR);
	if ((c.svtset.empty()) || (c.svtset.find(0) != c.svtset.end()) || (c.svtset.find(1) != c.svtset.end())) selectInversions(c, readBp, srBR);
	if ((c.svtset.empty()) || (c.svtset.find(4) != c.svtset.end())) selectInsertions(c, readBp, srBR);
	if ((c.svtset.empty()) || (c.svtset.find(DELLY_SVT_TRANS) != c.svtset.end()) || (c.svtset.find(DELLY_SVT_TRANS + 1) != c.svtset.end()) || (c.svtset.find(DELLY_SVT_TRANS + 2) != c.svtset.end()) || (c.svtset.find(DELLY_SVT_TRANS + 3) != c.svtset.end())) selectTranslocations(c, readBp, srBR);
      }
    }

    // Debug abnormal paired-ends and split-reads
    //outputSRBamRecords(c, srBR);

    // Cluster split-read records
    now = boost::posix_time::second_clock::local_time();
    std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "Split-read clustering" << std::endl;
    for(uint32_t svt = 0; svt < srBR.size(); ++svt) {
      if ((!c.svtset.empty()) && (c.svtset.find(svt) == c.svtset.end())) continue;
      if (srBR[svt].empty()) continue;

      // Sort
      std::sort(srBR[svt].begin(), srBR[svt].end(), SortSRBamRecord<SRBamRecord>());

      // Cluster
      cluster(c, srBR[svt], srSVs, c.maxReadSep, svt);

      // Debug SR SVs
      //outputStructuralVariants(c, srSVs, svt);
    }

    // Cluster paired-end records
    now = boost::posix_time::second_clock::local_time();
    std::cerr << '[' << boost::posix_time::to_simple_string(now) << "] " << "Paired-end clustering" << std::endl;

    // Maximum variability in insert size
    int32_t varisize = getVariability(c, sampleLib);
    for(int32_t svt = 0; svt < (int32_t) bamRecord.size(); ++svt) {
      if ((!c.svtset.empty()) && (c.svtset.find(svt) == c.svtset.end())) continue;
      if (bamRecord[svt].empty()) continue;

      // Sort BAM records according to position
      std::sort(bamRecord[svt].begin(), bamRecord[svt].end(), SortBamRecords<BamAlignRecord>());

      // Cluster
      cluster(c, bamRecord[svt], svs, varisize, svt);
    }

    // Track split-reads
    for(uint32_t svt = 0; svt < srBR.size(); ++svt) {
      for(uint32_t i = 0; i < srBR[svt].size(); ++i) {
	// Read assigned?
	if ((srBR[svt][i].svid != -1) && (srBR[svt][i].rstart != -1)) {
	  if (srBR[svt][i].rstart < (int32_t) hdr->target_len[srBR[svt][i].chr]) srStore[srBR[svt][i].chr].insert(std::make_pair(std::make_pair(srBR[svt][i].rstart, srBR[svt][i].id), srBR[svt][i].svid));
	  if (srBR[svt][i].chr != srBR[svt][i].chr2) {
	    // Unclear which chr was primary alignment so insert both if and only if rstart < reference length
	    if (srBR[svt][i].rstart < (int32_t) hdr->target_len[srBR[svt][i].chr2]) srStore[srBR[svt][i].chr2].insert(std::make_pair(std::make_pair(srBR[svt][i].rstart, srBR[svt][i].id), srBR[svt][i].svid));
	  }
	}
      }
    }

    // Clean-up
    bam_hdr_destroy(hdr);
    for(unsigned int file_c = 0; file_c < c.files.size(); ++file_c) {
      hts_idx_destroy(idx[file_c]);
      sam_close(samfile[file_c]);
    }
  }

  inline void
  mergeSort(std::vector<StructuralVariantRecord>& pe, std::vector<StructuralVariantRecord>& sr) {
    typedef typename std::vector<StructuralVariantRecord> TVariants;
    // Sort PE records for look-up
    sort(pe.begin(), pe.end(), SortSVs<StructuralVariantRecord>());

    // Sort SR records for look-up
    sort(sr.begin(), sr.end(), SortSVs<StructuralVariantRecord>());

    // Augment PE SVs and append missing SR SVs
    for(int32_t svt = 0; svt < 10; ++svt) {
      for(int32_t i = 0; i < (int32_t) sr.size(); ++i) {
	if (sr[i].svt != svt) continue;
	if ((sr[i].srSupport == 0) || (sr[i].srAlignQuality == 0)) continue; // SR assembly failed

	// Precise duplicates
	int32_t searchWindow = 500;
	bool svExists = false;
	typename TVariants::iterator itOther = std::lower_bound(pe.begin(), pe.end(), StructuralVariantRecord(sr[i].chr, std::max(0, sr[i].svStart - searchWindow), sr[i].svEnd), SortSVs<StructuralVariantRecord>());
	for(; ((itOther != pe.end()) && (std::abs(itOther->svStart - sr[i].svStart) < searchWindow)); ++itOther) {
	  if ((itOther->svt != svt) || (itOther->precise)) continue;
	  if ((sr[i].chr != itOther->chr) || (sr[i].chr2 != itOther->chr2)) continue;  // Mismatching chr

	  // Breakpoints within PE confidence interval?
	  if ((itOther->svStart + itOther->ciposlow < sr[i].svStart) && (sr[i].svStart < itOther->svStart + itOther->ciposhigh)) {
	    if ((itOther->svEnd + itOther->ciendlow < sr[i].svEnd) && (sr[i].svEnd < itOther->svEnd + itOther->ciendhigh)) {
	      svExists = true;
	      // Augment PE record
	      itOther->svStart = sr[i].svStart;
	      itOther->svEnd = sr[i].svEnd;
	      itOther->ciposlow = sr[i].ciposlow;
	      itOther->ciposhigh = sr[i].ciposhigh;
	      itOther->ciendlow = sr[i].ciendlow;
	      itOther->ciendhigh = sr[i].ciendhigh;
	      itOther->srMapQuality = sr[i].srMapQuality;
	      itOther->srSupport = sr[i].srSupport;
	      itOther->insLen = sr[i].insLen;
	      itOther->homLen = sr[i].homLen;
	      itOther->srAlignQuality = sr[i].srAlignQuality;
	      itOther->precise = true;
	      itOther->consensus = sr[i].consensus;
	      itOther->mapq += sr[i].mapq;
	    }
	  }
	}

	// SR only SV
	if (!svExists) {
	  // Make sure there is no PRECISE duplicate
	  int32_t precSearchWindow = 10;
	  bool preciseDuplicate = false;
	  for(int32_t j = i + 1; j < (int32_t) sr.size(); ++j) {
	    if (std::abs(sr[i].svStart - sr[j].svStart) > precSearchWindow) break;
	    if (sr[i].svt != sr[j].svt) continue;   // Mismatching SV types
	    if ((sr[i].chr != sr[j].chr) || (sr[i].chr2 != sr[j].chr2)) continue;  // Mismatching chr

	    // Breakpoints within PE confidence interval?
	    if ((sr[j].svStart + sr[j].ciposlow <= sr[i].svStart) && (sr[i].svStart <= sr[j].svStart + sr[j].ciposhigh)) {
	      if ((sr[j].svEnd + sr[j].ciendlow <= sr[i].svEnd) && (sr[i].svEnd <= sr[j].svEnd + sr[j].ciendhigh)) {
		// Duplicate, keep better call
		if ((sr[i].srSupport < sr[j].srSupport) || ((i < j) && (sr[i].srSupport == sr[j].srSupport))) preciseDuplicate = true;
	      }
	    }
	  }
	  for(int32_t j = i - 1; j>=0; --j) {
	    if (std::abs(sr[i].svStart - sr[j].svStart) > precSearchWindow) break;
	    if (sr[i].svt != sr[j].svt) continue;   // Mismatching SV types
	    if ((sr[i].chr != sr[j].chr) || (sr[i].chr2 != sr[j].chr2)) continue;  // Mismatching chr

	    // Breakpoints within PE confidence interval?
	    if ((sr[j].svStart + sr[j].ciposlow < sr[i].svStart) && (sr[i].svStart < sr[j].svStart + sr[j].ciposhigh)) {
	      if ((sr[j].svEnd + sr[j].ciendlow < sr[i].svEnd) && (sr[i].svEnd < sr[j].svEnd + sr[j].ciendhigh)) {
		// Duplicate, keep better call
		if ((sr[i].srSupport < sr[j].srSupport) || ((i < j) && (sr[i].srSupport == sr[j].srSupport))) preciseDuplicate = true;
	      }
	    }
	  }
	  if (!preciseDuplicate) {
	    pe.push_back(sr[i]);
	    sort(pe.begin(), pe.end(), SortSVs<StructuralVariantRecord>());
	  }
	}
      }
    }
  }

}

#endif


text:
package com.ryougi.adapter;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

import com.ryougi.iframe.AuthorityFrame;
import com.ryougi.iframe.BorrowFrame;
import com.ryougi.iframe.DonateModifyFrame;
import com.ryougi.iframe.LibraryPolicyFrame;
import com.ryougi.iframe.NewBookFrame;
import com.ryougi.iframe.RegisterFrame;
import com.ryougi.iframe.RemandFrame;
import com.ryougi.iframe.SysMessageFrame;

public class MenuActions implements ActionListener {

	private String key;

	public MenuActions(JFrame frame, String key) {
		this.key = key;
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		switch (key) {
		case "借书":
			new BorrowFrame().setVisible(true);
			break;
		case "归还":
			new RemandFrame().setVisible(true);
			break;
		case "购书":
			new NewBookFrame().setVisible(true);
			break;
		case "赠书":
			new DonateModifyFrame("赠书", "捐赠入库").setVisible(true);
			break;
		case "修改":
			new DonateModifyFrame("书籍信息修改", "提交修改").setVisible(true);
			break;
		case "操作员":
			new RegisterFrame("操作员").setVisible(true);
			break;
		case "读者":
			new RegisterFrame("读者").setVisible(true);
			break;
		case "借书权限":
			new AuthorityFrame().setVisible(true);
			break;
		case "借阅须知":
			new LibraryPolicyFrame().setVisible(true);
			break;
		case "系统信息":
			new SysMessageFrame().setVisible(true);
			break;
		case "系统升级":

			break;

		default:
			break;
		}
	}
}


text:
package com.codepath.apps.twitterEnhanced.fragments;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.codepath.apps.twitterEnhanced.R;
import com.codepath.apps.twitterEnhanced.activities.UserListActivity;
import com.codepath.apps.twitterEnhanced.applications.TwitterApplication;
import com.codepath.apps.twitterEnhanced.clients.TwitterClient;
import com.codepath.apps.twitterEnhanced.databinding.FragmentUserHeaderBinding;
import com.codepath.apps.twitterEnhanced.models.User;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.loopj.android.http.JsonHttpResponseHandler;

import org.json.JSONObject;

import butterknife.BindView;
import butterknife.ButterKnife;
import cz.msebera.android.httpclient.Header;

/**
 * Created by Saranu on 3/31/17.
 */

public class UserHeaderFragment extends android.support.v4.app.Fragment {
    TwitterClient client;
    User user;
    String screenName;
    FragmentUserHeaderBinding fragmentUserHeaderBinding;
    @BindView(R.id.ivTweetImage) public ImageView ivTweetImage;
    @BindView(R.id.tvFollowersLabel) public TextView tvFollowersLabel;
    @BindView(R.id.tvFollowingLabel) public TextView tvFollowingLabel;

    //  @BindView(R.id.ivProfileBackground) public ImageView ivProfileBackground;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        client = TwitterApplication.getRestClient();
        screenName=  getArguments().getString("screen_name");
        populateUserHeader();
    }

    public static UserHeaderFragment newInstance(String screenName) {
        UserHeaderFragment userHeaderFragment = new UserHeaderFragment();
        Bundle args = new Bundle();
        args.putString("screen_name", screenName);
        userHeaderFragment.setArguments(args);
        return userHeaderFragment;
    }

    //  @BindingAdapter({"imageUrl"})
    private static void setImageUrl(ImageView view, String imageUrl) {
        Glide.with(view.getContext()).load(imageUrl).placeholder(R.drawable.ic_launcher).
                error(R.drawable.ic_launcher).into(view);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {

        fragmentUserHeaderBinding = DataBindingUtil.inflate(
                inflater, R.layout.fragment_user_header, parent, false);
        View view = fragmentUserHeaderBinding.getRoot();
        ButterKnife.bind(this,view);
        return fragmentUserHeaderBinding.getRoot();
    }

    protected void populateUserHeader() {
        if (screenName != null) {
            client.getShowUser(new JsonHttpResponseHandler() {
                public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
                    Log.d("DEBUG", response.toString());
                    Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
                    user = gson.fromJson(response.toString(), User.class);
                    fragmentUserHeaderBinding.setUser(user);
                    setImageUrl(ivTweetImage, user.getProfileImageUrl());
                    tvFollowersLabel.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent = new Intent(getActivity(), UserListActivity.class);
                            intent.putExtra("screen_name", user.getScreenName());
                            intent.putExtra("followers", 'Y');
                            startActivity(intent);
                        }
                    });

                    tvFollowingLabel.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent = new Intent(getActivity(), UserListActivity.class);
                            intent.putExtra("screen_name", user.getScreenName());
                            startActivity(intent);
                        }
                    });

                    if (user == null) {
                        Toast.makeText(getContext(), "NO TWEET MENTIONS",
                                Toast.LENGTH_LONG).show();
                    } else {

                    }
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
                    Log.d("DEBUG", errorResponse.toString());
                    if (errorResponse.toString().contains("Too Many Requests") || errorResponse.toString().contains("Rate limit exceeded")) {
                        Toast.makeText(getContext(), "TOO MANY REQUESTS THIS SESSION",
                                Toast.LENGTH_LONG).show();
                    } else{}
                        Toast.makeText(getContext(), "TOO MANY REQUESTS ??",
                            Toast.LENGTH_LONG).show();
                }

            }, screenName);

        } else {
            client.getUserInfo(new JsonHttpResponseHandler() {
                public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
                    Log.d("DEBUG", response.toString());
                    Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
                    user = gson.fromJson(response.toString(), User.class);
                    fragmentUserHeaderBinding.setUser(user);
                    setImageUrl(ivTweetImage, user.getProfileImageUrl());
                    tvFollowersLabel.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent = new Intent(getActivity(), UserListActivity.class);
                            intent.putExtra("screen_name", user.getScreenName());
                            intent.putExtra("followers", "Y");

                            startActivity(intent);
                        }
                    });

                    tvFollowingLabel.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            Intent intent = new Intent(getActivity(), UserListActivity.class);
                            intent.putExtra("screen_name", user.getScreenName());
                            startActivity(intent);
                        }
                    });

                    //   setImageUrl(ivProfileBackground,user.getProfileBackgroundImageUrl());//backgrondImage
                    if (user == null) {
                        Toast.makeText(getContext(), "NO TWEET MENTIONS",
                                Toast.LENGTH_LONG).show();
                    } else {

                    }
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
                    Log.d("DEBUG", errorResponse.toString());
                    if (errorResponse.toString().contains("Too Many Requests") || errorResponse.toString().contains("Rate limit exceeded")) {
                        Toast.makeText(getContext(), "TOO MANY REQUESTS THIS SESSION",
                                Toast.LENGTH_LONG).show();
                    } else Toast.makeText(getContext(), "TOO MANY REQUESTS ??",
                            Toast.LENGTH_LONG).show();
                }

            });

        }

    }
}


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

namespace Neblina.Api.Models.TransferViewModels
{
    public class SendTransferReceiptViewModel
    {
        public int TransactionId { get; set; }
        public int DestinationBankId { get; set; }
        public int DestinationAccountId { get; set; }
        public decimal Amount { get; set; }
    }
}


text:
class Messaging;

class SendAbstract : public MPxCommand
{
public:
	SendAbstract();
	~SendAbstract();

	virtual MStatus	doIt(const MArgList&) = 0;

protected:

	// gets goes over all nodes for mesh and performs the specified func(including transform)
	void traverseAllValidNodesForMesh(MDagPath & dagPath, std::function<bool(MFnDependencyNode&)>& func);

	// goes over all nodes starting from one passed to it
	void traverseAllValidNodes(MFnDependencyNode & node, std::function<bool(MFnDependencyNode&)>& func);

	MStatus getGenericNode(MFnDependencyNode & _inNode, json& _outNode);
	MStatus getAttribFromPlug(MPlug& _plug, json& _attribs);
	MStatus getNumericDataFromAttrib(MPlug& _plug, json& _attribs);
	MStatus getTypeDataFromAttrib(MPlug& _plug, json& _attribs);
	MStatus getOtherDataFromAttrib(MPlug& _plug, json& _attribs);
	MStatus getUnitDataFromAttrib(MPlug& _plug, json& _attribs);
	std::vector<std::string> getCompList(MPlug& _plug, MStatus& status);

	MStatus getIncomingID(MFnDependencyNode & _inNode, MString& _id);
	MStatus getOutgoingID(MFnDependencyNode & _inNode, MString& _id);

	std::unique_ptr<Messaging> pMessaging;
};

#endif


text:
using System;
using System.Linq;
using Meowth.Esentery.Core;

namespace Meowth.Esentery.Extensions
{
    /// <summary> Returns typed column by name </summary>
    public static class TableExtensons
    {
        /// <summary> Returns typed column </summary>
        public static Column GetColumn<T>(this Table table, string name)
        {
            var c = GetColumn(table, name);
            if(c.ColumnType != typeof(T))
                throw new ArgumentException("Column has another type");

            return c;
        }

        /// <summary> Removes all rows from table </summary>
        public static void RemoveAllRows(this Table table)
        {
            // TODO:
        }

        /// <summary> Returns untyped column </summary>
        public static Column GetColumn(this Table table, string columnName)
        {
            var col = table.GetColumns().FirstOrDefault(c => c.ColumnName == columnName);
            if (col == null)
                throw new ArgumentException("Column with such name and type not found");

            return col;
        }

        /// <summary> Returns untyped index </summary>
        public static ISearchIndex GetSearchIndexOfColumn(this Table table, string columnName)
        {
            var column = table.GetColumn(columnName);
            var indices = table.GetIndexes()
                .OfType<ISearchIndex>()
                .Where(i => i.Column == column)
                .ToList();

            if (indices.Count() == 0)
                throw new ArgumentException("There is no search index on given column");
            if (indices.Count() > 1)
                throw new ArgumentException("There is too many search indices on given column");

            return indices.First();
        }

        /// <summary> Counts records on table </summary>
        public static long GetRecordCount(this Table table)
        {
            var count = 0;
            using (var cursor = table.OpenPrimaryCursor())
                while (cursor.MoveNext())
                    count++;

            return count;
        }

        /// <summary> Check is any records presents </summary>
        public static bool HasRecords(this Table table)
        {
            using (var cursor = table.OpenPrimaryCursor())
                return cursor.MoveNext();
        }
    }
}


text:
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="{{ if .IsNode }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ else }}{{ with .Description }}{{ . }}{{ end }}{{ end }}">
  {{.Hugo.Generator}}

  <title>{{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title>

  <!-- CSS -->
  {{ $purecss := "https://cdnjs.cloudflare.com/ajax/libs/pure/2.0.6/" }}
  <link rel="stylesheet" href="{{ $purecss }}pure-min.css">

  <link rel="stylesheet" href="{{ $purecss }}grids-responsive-min.css">

  <link rel="stylesheet" href="/css/side-menu.css">

  <link rel="stylesheet" href="/css/blackburn.css">

  <!-- Icons -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

  <!-- Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">

 <!-- RSS -->
  {{ if .RSSLink }}
  <link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="{{ .RSSLink }}" />
  {{ end }}

  {{ with .Site.Params.highlightjs }}
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{ . }}.min.css">
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  {{ range $.Site.Params.highlightjs_extra_languages }}
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{ . }}.min.js"></script>
  {{ end }}
  <script>hljs.initHighlightingOnLoad();</script>
  {{ end }}

  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  {{ partial "favicon.html" . }}

  {{ range .Site.Params.custom_css }}
    {{ if findRE "https?://" . }}
        <link rel="stylesheet" href="{{ . }}">
    {{ else }}
        <link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
    {{ end }}
  {{ end }}
  {{ range .Site.Params.custom_js }}
    {{ if findRE "https?://" . }}
        <script src="{{ . }}"></script>
    {{ else }}
        <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
    {{ end }}
  {{ end }}

</head>


text:
tensorpack package
==================

Subpackages
-----------

.. toctree::

    tensorpack.RL
    tensorpack.callbacks
    tensorpack.dataflow
    tensorpack.models
    tensorpack.predict
    tensorpack.tfutils
    tensorpack.train
    tensorpack.utils

Module contents
---------------

.. automodule:: tensorpack
    :members:
    :undoc-members:
    :show-inheritance:


text:
extern int main_real(int argc, char* argv[argc]);

int main(int argc, char* argv[argc])
{
	return main_real(argc, argv);
}


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Cosa Nostra</title>
        <link rel="stylesheet" href="dist/style.min.css">

Cosa Nostra

                Experience 20's gangster's lifestyle in the real world

                Support App
                Stayzest on Facebook

                        Coming

                        Soon

                        The game
                        Cosa Nostra

This location-based game allows you to take over real-world establishments to build your gangster empire and become the kingpin of your city.

Build your strategy, battle agains other players to become more experienced and wealthier, hire thugs or steal from them.

                        Every place you conquer is connected to the real place by Foursquaretm

                        The more popular a place is the more money it will generate to you.

See the map of your own town in a diferente perspective.

Every place you can get into is a deal you may fight for.

                Watch our video

                <video class="embed" autoplay loop>
                    <source src="dist/videos/video-preview.webm" type="video/webm">
                    <source src="dist/videos/video-preview.mp4" type="video/mp4">
                </video>

                Cosa Nostra
                Features

Conquer

Earn the money, conquer your business and fight for the respect!

Recruit

Not really in a popular area? Now's a great time to recruit some new henchmen that might be near you, they surely can help you out.

Skills

Build-up your character as you gain experience focusing in the skills you find more important for your strategy.

Training

Let your henchmen hit the gym or the shooting range, training them to enhance your chances of winning.

Interact

Take over the world by going outside, or do that within the confort of your home. It's your call.

Compete

Earn your friends', your town's or even the world's respect.

                        Download
                        For Free

We're launching Cosa Nostra in a few countries at first so we can monitor everything, scale properly and avoid downtimes. We are also working day and night to bring this world of adventure to everyone as soon as possible.

App Support

Say hello!

            <form onsubmit="return false">

                    <input type="text" name="fullName" id="full-name" required>
                    Full name

                    <input type="email" name="email" id="email" required>
                    E-mail

                    <textarea name="message" id="message" required></textarea>
                    Message

                <button type="submit" class="submit-btn">Send</button>
            </form>

                Give us your
                feedback
                about Cosa Nostra

                Stayzest Technologies


text:
<?php

namespace Social;

class Twitter {

	public static $_instance = false;

	protected static $_config = null;

	public static function _init() {
		static::$_config = \Config::get('twitter');
	}

	public static function forge( $token = null, $token_secret = null ) {
		if (static::$_instance)
			return static::$_instance;

		static::$_instance = $token ? new TwitterOAuth( static::$_config['key'], static::$_config['secret'], $token, $token_secret )
									: new TwitterOAuth( static::$_config['key'], static::$_config['secret'] );

		return static::$_instance;

	}

	public static function __callStatic( $method, $arguments ) {

		if( !method_exists( static::forge(), $method ) )
			throw new Exception( 'No such method (' . $method . ')' );

		return call_user_func_array( array( static::forge(), $method ), $arguments );

	}

}


text:
set -o errexit -o nounset -o pipefail

safe_checkout_master_or_release() {
  # We need to be on a branch for release:perform to be able to create commits,
  # and we want that branch to be master or release-X.Y, which has been checked before.
  # But we also want to make sure that we build and release exactly the tagged version, so we verify that the remote
  # branch is where our tag is.
  checkoutBranch=$(echo ${TRAVIS_TAG} | sed 's/.[[:digit:]]\+$//')
  if ! git ls-remote --exit-code --heads origin "$checkoutBranch" ; then
    checkoutBranch=master
  fi
  git checkout -B "${checkoutBranch}"
  git fetch origin "${checkoutBranch}":origin/"${checkoutBranch}"
  commit_local_master="$(git show --pretty='format:%H' ${checkoutBranch})"
  commit_remote_master="$(git show --pretty='format:%H' origin/${checkoutBranch})"
  if [ "$commit_local_master" != "$commit_remote_master" ]; then
    echo "${checkoutBranch} on remote 'origin' has commits since the version under release, aborting"
    exit 1
  fi
}

if [[ "$TRAVIS_TAG" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+?$ ]]; then
    echo "We are on release- tag"
    echo "bumping versions and creating vX.Y.Z tag"
    echo "final artifact will be published in build for the tag"
    safe_checkout_master_or_release
    version=$(echo "${TRAVIS_TAG}" | sed 's/^release-//')
    ./gradlew release release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${version}
else
    ./gradlew publish
fi


text:
extern crate tokio_core;
extern crate hyper;
extern crate url;
extern crate futures;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate quick_error;

use std::net::SocketAddr;

use futures::future::Either;
use futures::{Future, Stream, BoxFuture};
use hyper::client::{self, HttpConnector};
use tokio_core::net::UdpSocket;
use tokio_core::reactor::Handle;

pub mod measurement;
pub use measurement::Measurement;

// TODO: documentation

quick_error! {
    #[derive(Debug)]
    pub enum Error {
        Url(error: url::ParseError) {
            description(error.description())
            display("Unable to parse URL: {}", error)
            from()
            cause(error)
        }
        Hyper(error: hyper::Error) {
            description(error.description())
            display("Unable to perform HTTP request: {}", error)
            from()
            cause(error)
        }
        Serde(error: serde_json::Error) {
            description(error.description())
            display("Unable to deserialize JSON: {}", error)
            from()
            cause(error)
        }
        BadRequest(what: String) {
            description("The InfluxDB server responded with an error")
            display("The InfluxDB server responded with an error: {}", what)
        }
        AddrParse(error: std::net::AddrParseError) {
            description(error.description())
            display("Unable to parse the address: {}", error)
            from()
            cause(error)
        }
        Udp(error: std::io::Error) {
            description(error.description())
            display("Unable to perform UDP request: {}", error)
            from()
            cause(error)
        }
    }
}

type Result<T> = ::std::result::Result<T, Error>;

pub struct AsyncDb {
    name: String,
    query_endpoint: url::Url,
    write_endpoint: url::Url,
    client: hyper::Client<HttpConnector>,
}

impl AsyncDb {
    pub fn new(handle: Handle, base_url: &str, name: &str) -> Result<Self> {
        let base_url = url::Url::parse(base_url)?;
        let query_endpoint = base_url.join("/query")?;
        let mut write_endpoint = base_url.join("/write")?;
        write_endpoint.query_pairs_mut()
            .append_pair("db", &name);

        let client = hyper::Client::configure().keep_alive(false).build(&handle);

        Ok(AsyncDb {
            name: name.into(),
            query_endpoint: query_endpoint,
            write_endpoint: write_endpoint,
            client: client,
        })
    }

    pub fn add_data<T>(&self, measure: T) -> AddData
        where T: Measurement
    {
        let mut request = client::Request::new(
            hyper::Method::Post, self.write_endpoint.as_str().parse().expect("Invalid request URL"));
        let mut bytes_to_send = String::new();
        measure.to_data(&mut bytes_to_send);
        request.set_body(bytes_to_send.into_bytes());

        let response =
            self.client.request(request)
            .map_err(Error::Hyper)
            .and_then(check_response_code)
            .map(|_| ());

        AddData(Box::new(response))
    }

    pub fn query(&self, query: &str) -> Query {
        let mut query_endpoint = self.query_endpoint.clone();
        query_endpoint.query_pairs_mut()
            .append_pair("db", &self.name)
            .append_pair("q", query);

        let response =
            self.client.get(query_endpoint.as_str().parse().expect("Invalid query URL"))
            .map_err(Error::Hyper)
            .and_then(check_response_code)
            .and_then(response_to_json);

        Query(Box::new(response))
    }
}

fn check_response_code(resp: client::Response) -> Box<Future<Item = client::Response, Error = Error>> {
    let f = if resp.status().is_success() {
        Either::A(futures::future::ok(resp))
    } else {
        let e = response_to_json::<InfluxServerError>(resp)
            .and_then(|message| Err(Error::BadRequest(message.error)));
        Either::B(e)
    };

    Box::new(f)
}

fn response_to_json<T>(resp: client::Response) -> Box<Future<Item = T, Error = Error>>
    where T: serde::Deserialize + 'static,
{
    let f =
        resp.body()
        .map_err(Error::Hyper)
        .fold(Vec::new(), |mut acc, chunk| {
            // TODO: Is it the best idea to just build up a big `Vec`?
            // TODO: Is there some way of reusing the vector allocation?
            acc.extend_from_slice(&*chunk);
            futures::future::ok::<_, Error>(acc)
        })
        .and_then(|body| serde_json::from_slice(&body).map_err(Error::Serde));

    Box::new(f)
}

#[must_use = "futures do nothing unless polled"]
pub struct AddData(Box<Future<Item = (), Error = Error>>);

impl Future for AddData {
    type Item = ();
    type Error = Error;

    fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
        self.0.poll()
    }
}

#[must_use = "futures do nothing unless polled"]
pub struct Query(Box<Future<Item = QueryResponse, Error = Error>>);

impl Future for Query {
    type Item = QueryResponse;
    type Error = Error;

    fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
        self.0.poll()
    }
}

#[derive(Debug, Deserialize)]
pub struct QueryResponse {
    pub results: Vec<QueryResult>,
}

#[derive(Debug, Deserialize)]
pub struct QueryResult {
    #[serde(default)]
    pub series: Vec<Series>,
    pub error: Option<String>,
    pub statement_id: usize,
}

#[derive(Debug, Deserialize)]
pub struct Series {
    pub name: String,
    pub columns: Vec<String>, // TODO: `time` is always added?
    pub values: Vec<Vec<serde_json::Value>>, // TODO: matches with columns?
    // TODO: Don't expose serde types publically
}

#[derive(Debug, Deserialize)]
pub struct InfluxServerError {
    pub error: String,
}

pub struct AsyncUdpDb {
    handle: Handle,
    my_addr: SocketAddr,
    their_addr: SocketAddr,
}

impl AsyncUdpDb {
    pub fn new(handle: Handle, ip_port: &str) -> Result<Self> {
        Ok(AsyncUdpDb {
            handle: handle,
            my_addr: "0.0.0.0:0".parse()?,
            their_addr: ip_port.parse()?,
        })
    }

    pub fn add_data<T>(&self, measure: T) -> AddDataUdp
        where T: Measurement
    {
        let mut bytes_to_send = String::new();
        measure.to_data(&mut bytes_to_send);

        // TODO: We could consume self like `send_dgram` does, which
        // allows reusing the same socket over and over. The API would
        // be more annoying, but might be like other futures...
        let f = match UdpSocket::bind(&self.my_addr, &self.handle) {
            Ok(socket) => {
                let f = socket.send_dgram(bytes_to_send, self.their_addr)
                    .map(|_| ())
                    .map_err(Error::Udp);
                Either::A(f)
            }
            Err(e) => {
                Either::B(futures::future::err(Error::Udp(e)))
            }
        };

        AddDataUdp(f.boxed())
    }
}

#[must_use = "futures do nothing unless polled"]
pub struct AddDataUdp(BoxFuture<(), Error>);

impl Future for AddDataUdp {
    type Item = ();
    type Error = Error;

    fn poll(&mut self) -> futures::Poll<Self::Item, Self::Error> {
        self.0.poll()
    }
}


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

class Test
{
    static void Main()
    {
        List<Human> humans = new List<Human>();

        List<Worker> workers = new List<Worker>
        {
        new Worker("Kalin","Penev"),
         new Worker("Pesho","Stavrev",200,6),
         new Worker("Tanq","Veleva",300,8),
         new Worker("Plamen","Velev",500,7),
         new Worker("Jujka","Cvetelinova",220,5),
         new Worker("Peca","Kirkova",450,4),
         new Worker("Ranars","Zatvornikov",370,6),
         new Worker("Neno","Tumbev",200,7),
         new Worker("Ceci","Sokolov",200,8),
         new Worker("Matej","Kazijski",200,7)
        };

        List<Student> students = new List<Student>
        {
            new Student("Penka","Talibanova"),
            new Student("Liliq","Plamenova",4),
            new Student("Ivanka","Georgieva",5),
            new Student("Pepa","Kalinova",6),
            new Student("Siqna","Stavreva",3),
            new Student("Nenka","Liubenova",4),
            new Student("Ivan","Pecov",2),
            new Student("Dechko","Damqnov",5),
            new Student("Dimitar","Ivanov",6),
            new Student("Kolio","Kolev",6)
        };

        foreach (Student student in students.OrderBy(x => x.Grade))
        {
            Console.WriteLine(student.ToString());
            humans.Add(student);
        }

        Console.WriteLine(new string('=',50)+"\n\n");

        foreach (Worker worker in workers.OrderBy(x => -x.MoneyPerHour()))
        {
            Console.WriteLine(worker.ToString());
            humans.Add(worker);
        }

        Console.WriteLine(new string('=', 50) + "\n\n");

        foreach (Human human in humans.OrderBy(x => x.FirstName).ThenBy(x => x.LastName))
        {
            Console.WriteLine(human.ToString());
        }
    }
}


text: dart $(dirname ${0})/all_tests.dart


text:
#include <stddef.h>
#include <stdio.h>
#include "h2o.h"

static ssize_t add_header(h2o_mem_pool_t *pool, h2o_headers_t *headers, h2o_iovec_t *name, const char *orig_name, const char *value,
                          size_t value_len, h2o_header_flags_t flags)
{
    h2o_header_t *slot;

    h2o_vector_reserve(pool, headers, headers->size + 1);
    slot = headers->entries + headers->size++;

    slot->name = name;
    slot->value.base = (char *)value;
    slot->value.len = value_len;
    slot->orig_name = orig_name ? h2o_strdup(pool, orig_name, name->len).base : NULL;
    slot->flags = flags;
    return headers->size - 1;
}

ssize_t h2o_find_header(const h2o_headers_t *headers, const h2o_token_t *token, ssize_t cursor)
{
    for (++cursor; cursor < headers->size; ++cursor) {
        if (headers->entries[cursor].name == &token->buf) {
            return cursor;
        }
    }
    return -1;
}

ssize_t h2o_find_header_by_str(const h2o_headers_t *headers, const char *name, size_t name_len, ssize_t cursor)
{
    for (++cursor; cursor < headers->size; ++cursor) {
        h2o_header_t *t = headers->entries + cursor;
        if (h2o_memis(t->name->base, t->name->len, name, name_len)) {
            return cursor;
        }
    }
    return -1;
}

ssize_t h2o_add_header(h2o_mem_pool_t *pool, h2o_headers_t *headers, const h2o_token_t *token, const char *orig_name,
                       const char *value, size_t value_len)
{
    return add_header(pool, headers, (h2o_iovec_t *)&token->buf, orig_name, value, value_len, (h2o_header_flags_t){0});
}

ssize_t h2o_add_header_by_str(h2o_mem_pool_t *pool, h2o_headers_t *headers, const char *name, size_t name_len, int maybe_token,
                              const char *orig_name, const char *value, size_t value_len)
{
    h2o_iovec_t *name_buf;

    if (maybe_token) {
        const h2o_token_t *token = h2o_lookup_token(name, name_len);
        if (token != NULL) {
            return add_header(pool, headers, (h2o_iovec_t *)token, orig_name, value, value_len, (h2o_header_flags_t){0});
        }
    }
    name_buf = h2o_mem_alloc_pool(pool, *name_buf, 1);
    name_buf->base = (char *)name;
    name_buf->len = name_len;
    return add_header(pool, headers, name_buf, orig_name, value, value_len, (h2o_header_flags_t){0});
}

ssize_t h2o_set_header(h2o_mem_pool_t *pool, h2o_headers_t *headers, const h2o_token_t *token, const char *value, size_t value_len,
                       int overwrite_if_exists)
{
    ssize_t cursor = h2o_find_header(headers, token, -1);
    if (cursor != -1) {
        if (overwrite_if_exists) {
            h2o_iovec_t *slot = &headers->entries[cursor].value;
            slot->base = (char *)value;
            slot->len = value_len;
        }
        return cursor;
    } else {
        return h2o_add_header(pool, headers, token, NULL, value, value_len);
    }
}

ssize_t h2o_set_header_by_str(h2o_mem_pool_t *pool, h2o_headers_t *headers, const char *name, size_t name_len, int maybe_token,
                              const char *value, size_t value_len, int overwrite_if_exists)
{
    ssize_t cursor;

    if (maybe_token) {
        const h2o_token_t *token = h2o_lookup_token(name, name_len);
        if (token != NULL) {
            return h2o_set_header(pool, headers, token, value, value_len, overwrite_if_exists);
        }
    }

    cursor = h2o_find_header_by_str(headers, name, name_len, -1);
    if (cursor != -1) {
        if (overwrite_if_exists) {
            h2o_iovec_t *slot = &headers->entries[cursor].value;
            slot->base = (char *)value;
            slot->len = value_len;
        }
        return cursor;
    } else {
        h2o_iovec_t *name_buf = h2o_mem_alloc_pool(pool, *name_buf, 1);
        name_buf->base = (char *)name;
        name_buf->len = name_len;
        return add_header(pool, headers, name_buf, NULL, value, value_len, (h2o_header_flags_t){0});
    }
}

ssize_t h2o_set_header_token(h2o_mem_pool_t *pool, h2o_headers_t *headers, const h2o_token_t *token, const char *value,
                             size_t value_len)
{
    size_t found = -1;
    size_t i;
    for (i = 0; i != headers->size; ++i) {
        if (headers->entries[i].name == &token->buf) {
            if (h2o_contains_token(headers->entries[i].value.base, headers->entries[i].value.len, value, value_len, ','))
                return -1;
            found = i;
        }
    }
    if (found != -1) {
        h2o_header_t *dest = headers->entries + found;
        dest->value = h2o_concat(pool, dest->value, h2o_iovec_init(H2O_STRLIT(", ")), h2o_iovec_init(value, value_len));
        return found;
    } else {
        return h2o_add_header(pool, headers, token, NULL, value, value_len);
    }
}

ssize_t h2o_delete_header(h2o_headers_t *headers, ssize_t cursor)
{
    assert(cursor != -1);

    --headers->size;
    memmove(headers->entries + cursor, headers->entries + cursor + 1, sizeof(h2o_header_t) * (headers->size - cursor));

    return cursor;
}


text:
package example;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.Objects;
import javax.swing.*;
import javax.swing.event.MouseInputAdapter;
import javax.swing.event.MouseInputListener;

public final class MainPanel extends JPanel {
  private transient MouseInputListener handler;

  private MainPanel() {
    super();
    add(new JLabel("mouseDragged: Show JToolTip"));
    setPreferredSize(new Dimension(320, 240));
  }

  @Override public void updateUI() {
    removeMouseMotionListener(handler);
    removeMouseListener(handler);
    super.updateUI();
    handler = new ToolTipLocationHandler();
    addMouseMotionListener(handler);
    addMouseListener(handler);
  }

  public static void main(String[] args) {
    EventQueue.invokeLater(MainPanel::createAndShowGui);
  }

  private static void createAndShowGui() {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
      ex.printStackTrace();
      Toolkit.getDefaultToolkit().beep();
    }
    JFrame frame = new JFrame("@title@");
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.getContentPane().add(new MainPanel());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  }
}

class ToolTipLocationHandler extends MouseInputAdapter {
  private final JWindow window = new JWindow();
  private final JToolTip tip = new JToolTip();
  private final PopupFactory factory = PopupFactory.getSharedInstance();
  private Popup popup;
  private String prev = "";

  private Point getToolTipLocation(MouseEvent e) {
    Point p = e.getPoint();
    Component c = e.getComponent();
    SwingUtilities.convertPointToScreen(p, c);
    p.translate(0, -tip.getPreferredSize().height);
    return p;
  }

  private void updateTipText(MouseEvent e) {
    Point pt = e.getPoint();
    String txt = String.format("Window(x, y)=(%d, %d)", pt.x, pt.y);
    tip.setTipText(txt);
    Point p = getToolTipLocation(e);
    if (SwingUtilities.isLeftMouseButton(e)) {
      if (prev.length() != txt.length()) {
        window.pack();
      }
      window.setLocation(p);
      window.setAlwaysOnTop(true);
    } else {
      if (Objects.nonNull(popup)) {
        popup.hide();
      }
      popup = factory.getPopup(e.getComponent(), tip, p.x, p.y);
      Container c = tip.getTopLevelAncestor();
      if (c instanceof JWindow && ((JWindow) c).getType() != Window.Type.POPUP) {
        // Popup$LightWeightWindow
        popup.show();
      }
    }
    prev = txt;
  }

  @Override public void mousePressed(MouseEvent e) {
    if (SwingUtilities.isLeftMouseButton(e)) {
      // window.getContentPane().removeAll();
      window.add(tip);
      updateTipText(e);
      window.setVisible(true);
    } else {
      updateTipText(e);
    }
  }

  @Override public void mouseDragged(MouseEvent e) {
    updateTipText(e);
  }

  @Override public void mouseReleased(MouseEvent e) {
    if (Objects.nonNull(popup)) {
      popup.hide();
    }
    window.setVisible(false);
  }
}


text:
package quasar

import (
	"net"
	"net/http"
	"net/rpc"

	"github.com/pkg/errors"
)

var (
	DaemonNameIsNotFoundError = errors.New("daemon name is not found.")
)

type Server struct {
	instances map[string]instance
}

type RPCArgs struct {
	Name, Envname string
}

func (s *Server) GetEnv(args *RPCArgs, resp *string) error {
	ins, ok := s.instances[args.Name]
	if !ok {
		return DaemonNameIsNotFoundError
	}

	r, err := ins.GetEnv(args.Envname)
	if err != nil {
		return errors.Wrapf(err, "failed call %s.GetEnv", args.Name)
	}

	*resp = r

	return nil
}

func (s *Server) Close(args *RPCArgs, resp *string) error {
	ins, ok := s.instances[args.Name]
	if !ok {
		return DaemonNameIsNotFoundError
	}

	err := ins.Close(args.Envname)
	if err != nil {
		return errors.Wrapf(err, "failed call %s.Close", args.Name)
	}

	return nil
}

func Serve(c config, inss map[string]instance) error {
	server := &Server{
		instances: inss,
	}
	rpc.Register(server)
	rpc.HandleHTTP()

	l, err := net.Listen("tcp", c.Address())
	if err != nil {
		return errors.Wrap(err, "cannot open server port")
	}

	return http.Serve(l, nil)
}


text:
.. _ref-templatetags:

Template tags (``feincms3.templatetags.feincms3``)
==================================================

.. automodule:: feincms3.templatetags.feincms3
   :members:


text:
/**************************************************
 * Author : hollystyles@fastmail.co.uk
 * Date : 26/05/2013
 *
 * A CSV stream and file reader.
 *
 * ************************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Hollyathome.IO
{
    /// <summary>
    /// Used to read a comma delimited text file or stream.
    /// </summary>
    public class CsvReader : StreamReader
    {
        #region Constructors

        public CsvReader(Stream stream)
            : base(stream)
        {
        }

        public CsvReader(Stream stream, Encoding encoding)
            : base(stream, encoding)
        {
        }

        public CsvReader(string filePath)
            : base(filePath)
        {
        }

        public CsvReader(string path, Encoding encoding)
            : base(path, encoding)
        {
        }

        #endregion

        #region Public methods

        /// <summary>
        /// Reads the current line in the stream and returns an
        /// array of the delimited values
        /// </summary>
        /// <returns></returns>
        public string[] ReadRow()
        {
            List<string> row = new List<string>();
            bool inQuotedString = false;
            bool escapeNext = false;
            string val = string.Empty;
            string line = base.ReadLine();

            foreach (char c in line)
            {
                if (c == '\\' && !escapeNext)
                {
                    escapeNext = true;
                }
                else if (c == '"' && !escapeNext)
                {
                    inQuotedString = !inQuotedString;
                }
                else if (c == ',' && !inQuotedString)
                {
                    row.Add(val);
                    val = string.Empty;
                }
                else
                {
                    val += c;
                    escapeNext = false;
                }
            }

            row.Add(val);

            return row.ToArray();
        }

        #endregion

    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.neucrack.smarthome">

    <!-- To auto-complete the email text field in the login form with the user's emails -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".Home"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".subDevices"
            android:label="@string/title_activity_sub_devices"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity
            android:name=".signIn"
            android:label="@string/title_activity_sign_in" />
        <activity
            android:name=".Settings"
            android:label="@string/title_activity_settings" />
        <activity android:name=".Smart"></activity>
    </application>

</manifest>


text:
module Aeolus
  module Image
    module Factory
      class Builder < Base
        ACTIVE_STATES = ['FAILED', 'COMPLETED']

        def find_active_build(build_id, target)
          builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'build' && b.build_id == build_id && b.target == target}
        end

        def find_active_build_by_imageid(image_id, target)
          builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'build' && b.image_id == image_id && b.target == target}
        end

        def find_active_push(target_image_id, provider, account)
          builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'push' && b.target_image_id == target_image_id &&
                              b.provider == provider && b.provider_account_identifier == account}
        end

        def failed_build_count(build_id, target)
          builders.count {|b| b.status == 'FAILED' && b.operation == 'build' && b.build_id == build_id && b.target == target}
        end

        def failed_push_count(target_image_id, provider, account)
          builders.count {|b| b.status == 'FAILED' && b.operation == 'push' && b.target_image_id == target_image_id &&
                              b.provider == provider && b.provider_account_identifier == account}
        end
      end
    end
  end
end


text: Selamat datang di halaman admin