text:
package com.thinkaurelius.titan.graphdb.database.serialize;

import com.google.common.base.Preconditions;
import com.thinkaurelius.titan.core.TitanException;
import com.thinkaurelius.titan.core.attribute.AttributeSerializer;
import com.thinkaurelius.titan.diskstorage.ReadBuffer;
import com.thinkaurelius.titan.diskstorage.StaticBuffer;
import com.thinkaurelius.titan.diskstorage.WriteBuffer;
import com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.thinkaurelius.titan.graphdb.database.serialize.kryo.KryoInstanceCacheImpl;
import com.thinkaurelius.titan.graphdb.database.serialize.kryo.KryoSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Closeable;
import java.io.IOException;

/**
 * @author Matthias Broecheler (me@matthiasb.com)
 */
public class StandardSerializer extends StandardAttributeHandling implements Serializer, Closeable {

    private static final Logger log = LoggerFactory.getLogger(StandardSerializer.class);

    private final KryoSerializer backupSerializer;

    public StandardSerializer(boolean allowCustomSerialization, int maxOutputSize, KryoInstanceCacheImpl kcache) {
        backupSerializer = new KryoSerializer(getDefaultRegistrations(), !allowCustomSerialization, maxOutputSize, kcache);
    }

    public StandardSerializer(boolean allowCustomSerialization, int maxOutputSize) {
        this(allowCustomSerialization, maxOutputSize, GraphDatabaseConfiguration.KRYO_INSTANCE_CACHE.getDefaultValue());
    }

    public StandardSerializer(boolean allowCustomSerialization) {
        this(allowCustomSerialization, KryoSerializer.DEFAULT_MAX_OUTPUT_SIZE);
    }

    public StandardSerializer(boolean allowCustomSerialization, KryoInstanceCacheImpl kcache) {
        this(allowCustomSerialization, KryoSerializer.DEFAULT_MAX_OUTPUT_SIZE, kcache);
    }

    public StandardSerializer() {
        this(true);
    }

    private KryoSerializer getBackupSerializer() {
        assert backupSerializer!=null;
        return backupSerializer;
    }

    private boolean supportsNullSerialization(Class type) {
        return getSerializer(type) instanceof SupportsNullSerializer;
    }

    @Override
    public <T> T readObjectByteOrder(ReadBuffer buffer, Class<T> type) {
        return readObjectInternal(buffer,type,true);
    }

    @Override
    public <T> T readObject(ReadBuffer buffer, Class<T> type) {
        return readObjectInternal(buffer,type,false);
    }

    @Override
    public <T> T readObjectNotNull(ReadBuffer buffer, Class<T> type) {
        return readObjectNotNullInternal(buffer,type,false);
    }

    private <T> T readObjectInternal(ReadBuffer buffer, Class<T> type, boolean byteOrder) {
        if (supportsNullSerialization(type)) {
            AttributeSerializer<T> s = getSerializer(type);
            if (byteOrder) return ((OrderPreservingSerializer<T>)s).readByteOrder(buffer);
            else return s.read(buffer);
        } else {
            //Read flag for null or not
            byte flag = buffer.getByte();
            if (flag==-1) {
                return null;
            } else {
                Preconditions.checkArgument(flag==0,"Invalid flag encountered in serialization: %s. Corrupted data.",flag);
                return readObjectNotNullInternal(buffer,type,byteOrder);
            }
        }
    }

    private <T> T readObjectNotNullInternal(ReadBuffer buffer, Class<T> type, boolean byteOrder) {
        AttributeSerializer<T> s = getSerializer(type);
        if (byteOrder) {
            Preconditions.checkArgument(s!=null && s instanceof OrderPreservingSerializer,"Invalid serializer for class: %s",type);
            return ((OrderPreservingSerializer<T>)s).readByteOrder(buffer);
        } else {
            if (s!=null) return s.read(buffer);
            else return getBackupSerializer().readObjectNotNull(buffer,type);
        }
    }

    @Override
    public Object readClassAndObject(ReadBuffer buffer) {
        return getBackupSerializer().readClassAndObject(buffer);
    }

    @Override
    public DataOutput getDataOutput(int initialCapacity) {
        return new StandardDataOutput(initialCapacity);
    }

    @Override
    public void close() throws IOException {
        backupSerializer.close();
    }

    private class StandardDataOutput extends WriteByteBuffer implements DataOutput {

        private StandardDataOutput(int initialCapacity) {
            super(initialCapacity);
        }

        @Override
        public DataOutput writeObjectByteOrder(Object object, Class type) {
            Preconditions.checkArgument(StandardSerializer.this.isOrderPreservingDatatype(type),"Invalid serializer for class: %s",type);
            return writeObjectInternal(object,type,true);
        }

        @Override
        public DataOutput writeObject(Object object, Class type) {
            return writeObjectInternal(object,type,false);
        }

        @Override
        public DataOutput writeObjectNotNull(Object object) {
            return writeObjectNotNullInternal(object,false);
        }

        private DataOutput writeObjectInternal(Object object, Class type, boolean byteOrder) {
            if (supportsNullSerialization(type)) {
                AttributeSerializer s = getSerializer(type);
                if (byteOrder) ((OrderPreservingSerializer)s).writeByteOrder(this,object);
                else s.write(this, object);
            } else {
                //write flag for null or not
                if (object==null) {
                    putByte((byte)-1);
                } else {
                    putByte((byte)0);
                    writeObjectNotNullInternal(object,byteOrder);
                }
            }
            return this;
        }

        private DataOutput writeObjectNotNullInternal(Object object, boolean byteOrder) {
            Preconditions.checkNotNull(object);
            AttributeSerializer s = getSerializer(object.getClass());
            if (byteOrder) {
                Preconditions.checkArgument(s!=null && s instanceof OrderPreservingSerializer,"Invalid serializer for class: %s",object.getClass());
                ((OrderPreservingSerializer)s).writeByteOrder(this,object);
            } else {
                if (s!=null) s.write(this, object);
                else {
                    try {
                        getBackupSerializer().writeObjectNotNull(this,object);
                    } catch (Exception e) {
                        throw new TitanException("Serializer Restriction: Cannot serialize object of type: " + object.getClass(),e);
                    }
                }
            }
            return this;
        }

        @Override
        public DataOutput writeClassAndObject(Object object) {
            try {
                getBackupSerializer().writeClassAndObject(this,object);
            } catch (Exception e) {
                throw new TitanException("Serializer Restriction: Cannot serialize object of type: " + (object==null?"null":object.getClass()),e);
            }

            return this;
        }

        @Override
        public DataOutput putLong(long val) {
            super.putLong(val);
            return this;
        }

        @Override
        public DataOutput putInt(int val) {
            super.putInt(val);
            return this;
        }

        @Override
        public DataOutput putShort(short val) {
            super.putShort(val);
            return this;
        }

        @Override
        public WriteBuffer putBoolean(boolean val) {
            super.putBoolean(val);
            return this;
        }

        @Override
        public DataOutput putByte(byte val) {
            super.putByte(val);
            return this;
        }

        @Override
        public DataOutput putBytes(byte[] val) {
            super.putBytes(val);
            return this;
        }

        @Override
        public DataOutput putBytes(final StaticBuffer val) {
            super.putBytes(val);
            return this;
        }

        @Override
        public DataOutput putChar(char val) {
            super.putChar(val);
            return this;
        }

        @Override
        public DataOutput putFloat(float val) {
            super.putFloat(val);
            return this;
        }

        @Override
        public DataOutput putDouble(double val) {
            super.putDouble(val);
            return this;
        }

    }

}


text:
<?php

namespace MicroCore\Tests\Mocks;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

class TestInvalidAction
{
    public function __invoke(ServerRequestInterface $request, ResponseInterface $response)
    {
        return $response;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Amalfra\SupportBee\API;

use Amalfra\SupportBee\HTTP;

/**
 * Class Replies
 *
 * @package Amalfra\SupportBee\API
 */
class Replies extends HTTP {
  public static function replies($id = 0) {
    return self::process_request('tickets/'.$id.'/replies');
  }

  public static function get_reply($ticket_id = 0, $reply_id = 0) {
    return self::process_request('tickets/'.$ticket_id.'/replies/'.$reply_id);
  }
}


text:
package main

import "net/http"
import "fmt"
import "time"

func handlerPing(response http.ResponseWriter, request *http.Request) {
	fmt.Fprintf(response, "Received ping on domain %s. Send pong to %s. Time was %v. OceanCMS %s. Bootstrap version %s, jQuery version %s, CKEditor version %s, ACE version %s.\n", request.Host, request.RemoteAddr, time.Now().UTC(), version, versionBootstrap, versionJQuery, versionCKEditor, versionACE)
}


text:
[![Build Status](https://travis-ci.org/zenbulabs/xbeeapi.svg?branch=master)](https://travis-ci.org/zenbulabs/xbeeapi)

Currently still a WIP. This provides a library for the XBee API, targeting 802.15.4 and Zigbee. Digimesh will be last priority.


text:
title: Bahr Idriss Abu Garda
published: true
description: Chairman and General Coordinator of Military Operations of the United Resistance Front (URF)
image_path: /uploads/1427829189231__45791892_icc226afp.jpg
image_credit: Photo courtesy of BBC News
country: sudan
slug: bahr-idriss-abu-garda
---


text:
package com.hazelcast.jet.sql.impl.opt.logical;

import com.google.common.collect.ImmutableList;
import com.hazelcast.jet.sql.impl.ExpressionUtil;
import com.hazelcast.jet.sql.impl.opt.OptUtils;
import com.hazelcast.sql.impl.expression.Expression;
import com.hazelcast.sql.impl.plan.node.PlanNodeSchema;
import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelOptRule;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelOptRuleOperand;
import org.apache.calcite.rel.core.Filter;
import org.apache.calcite.rel.core.Project;
import org.apache.calcite.rel.core.RelFactories;
import org.apache.calcite.rel.core.Values;
import org.apache.calcite.rel.logical.LogicalFilter;
import org.apache.calcite.rel.logical.LogicalProject;
import org.apache.calcite.rel.logical.LogicalValues;
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.rel.type.RelDataTypeField;
import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexLiteral;
import org.apache.calcite.rex.RexVisitor;
import org.apache.calcite.tools.RelBuilderFactory;

import java.util.List;

import static com.hazelcast.jet.impl.util.Util.toList;

abstract class ValuesReduceRule extends RelOptRule {

    static final ValuesReduceRule FILTER_INSTANCE =
            new ValuesReduceRule(
                    operand(LogicalFilter.class, operand(LogicalValues.class, none())),
                    RelFactories.LOGICAL_BUILDER,
                    ValuesReduceRule.class.getSimpleName() + "(Filter)"
            ) {
                @Override
                public void onMatch(RelOptRuleCall call) {
                    Filter filter = call.rel(0);
                    Values values = call.rel(1);
                    apply(call, null, filter, values);
                }
            };

    static final ValuesReduceRule PROJECT_INSTANCE =
            new ValuesReduceRule(
                    operand(LogicalProject.class, operand(LogicalValues.class, none())),
                    RelFactories.LOGICAL_BUILDER,
                    ValuesReduceRule.class.getSimpleName() + "(Project)"
            ) {
                @Override
                public void onMatch(RelOptRuleCall call) {
                    Project project = call.rel(0);
                    Values values = call.rel(1);
                    apply(call, project, null, values);
                }
            };

    static final ValuesReduceRule PROJECT_FILTER_INSTANCE =
            new ValuesReduceRule(
                    operand(LogicalProject.class, operand(LogicalFilter.class, operand(LogicalValues.class, none()))),
                    RelFactories.LOGICAL_BUILDER,
                    ValuesReduceRule.class.getSimpleName() + "(Project-Filter)"
            ) {
                public void onMatch(RelOptRuleCall call) {
                    Project project = call.rel(0);
                    Filter filter = call.rel(1);
                    Values values = call.rel(2);
                    apply(call, project, filter, values);
                }
            };

    private ValuesReduceRule(
            RelOptRuleOperand operand,
            RelBuilderFactory relBuilderFactory,
            String description
    ) {
        super(operand, relBuilderFactory, description);
    }

    @SuppressWarnings("unchecked")
    protected void apply(
            RelOptRuleCall call,
            Project project,
            Filter filter,
            Values values
    ) {
        PlanNodeSchema schema = OptUtils.schema(values.getRowType());
        RexVisitor<Expression<?>> converter = OptUtils.converter(schema);

        RelDataType rowType = null;

        Expression<Boolean> predicate = null;
        if (filter != null) {
            rowType = filter.getRowType();
            predicate = (Expression<Boolean>) filter.getCondition().accept(converter);
        }
        List<Expression<?>> projection = null;
        if (project != null) {
            rowType = project.getRowType();
            projection = toList(project.getProjects(), node -> node.accept(converter));
        }

        assert rowType != null;

        List<Object[]> rows = ExpressionUtil.evaluate(predicate, projection, OptUtils.convert(values));
        ImmutableList<ImmutableList<RexLiteral>> tuples = toTuples(rows, rowType.getFieldList(), values.getCluster());

        LogicalValues rel = LogicalValues.create(
                values.getCluster(),
                rowType,
                tuples
        );
        call.transformTo(rel);
    }

    private static ImmutableList<ImmutableList<RexLiteral>> toTuples(
            List<Object[]> rows,
            List<RelDataTypeField> fields,
            RelOptCluster cluster
    ) {
        RelDataTypeFactory typeFactory = cluster.getTypeFactory();
        RexBuilder rexBuilder = cluster.getRexBuilder();

        ImmutableList.Builder<ImmutableList<RexLiteral>> tuplesBuilder = new ImmutableList.Builder<>();
        for (Object[] row : rows) {
            ImmutableList.Builder<RexLiteral> tupleBuilder = new ImmutableList.Builder<>();
            for (int i = 0; i < row.length; i++) {
                assert row.length == fields.size();

                RelDataType relDataType = typeFactory.createTypeWithNullability(fields.get(i).getType(), false);
                RexLiteral literal = (RexLiteral) rexBuilder.makeLiteral(row[i], relDataType, false);
                tupleBuilder.add(literal);
            }
            ImmutableList<RexLiteral> tuple = tupleBuilder.build();

            tuplesBuilder.add(tuple);
        }
        return tuplesBuilder.build();
    }
}


text:
/* $Id$ */

package org.apache.fop.fo.flow;

// XML
import org.xml.sax.Locator;

import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.properties.CommonAccessibility;
import org.apache.fop.fo.properties.CommonAccessibilityHolder;
import org.apache.fop.fo.properties.SpaceProperty;

/**
 * Class modelling the
 * fo:initial-property-set object.
 */
public class InitialPropertySet extends FObj implements CommonAccessibilityHolder {

    private CommonAccessibility commonAccessibility;

    // private ToBeImplementedProperty letterSpacing;
    private SpaceProperty lineHeight;
    // private ToBeImplementedProperty textShadow;
    // Unused but valid items, commented out for performance:
    //     private CommonAural commonAural;
    //     private CommonBorderPaddingBackground commonBorderPaddingBackground;
    //     private CommonFont commonFont;
    //     private CommonRelativePosition commonRelativePosition;
    //     private Color color;
    //     private int scoreSpaces;
    //     private int textDecoration;
    //     private int textTransform;
    //     private SpaceProperty wordSpacing;
    // End of property values

    /**
     * Base constructor
     *
     * @param parent {@link FONode} that is the parent of this object
     */
    public InitialPropertySet(FONode parent) {
        super(parent);
    }

    /** {@inheritDoc} */
    public void bind(PropertyList pList) throws FOPException {
        super.bind(pList);
        commonAccessibility = CommonAccessibility.getInstance(pList);
        // letterSpacing = pList.get(PR_LETTER_SPACING);
        lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
        // textShadow = pList.get(PR_TEXT_SHADOW);
    }

    /**
     * {@inheritDoc}
     *
XSL Content Model: empty
     */
    protected void validateChildNode(Locator loc, String nsURI, String localName)
                throws ValidationException {
        if (FO_URI.equals(nsURI)) {
            invalidChildError(loc, nsURI, localName);
        }
    }

    /** @return the "line-height" property */
    public SpaceProperty getLineHeight() {
        return lineHeight;
    }

    /** {@inheritDoc} */
    public String getLocalName() {
        return "initial-property-set";
    }

    /**
     * {@inheritDoc}
     * @return {@link org.apache.fop.fo.Constants#FO_INITIAL_PROPERTY_SET}
     */
    public int getNameId() {
        return FO_INITIAL_PROPERTY_SET;
    }

    /** {@inheritDoc} */
    public CommonAccessibility getCommonAccessibility() {
        return commonAccessibility;
    }

}


text:
extern "C"
{
#endif

void fc3d_AlartCurnierFunctionGenerated(
  double *reaction,
  double *velocity,
  double mu,
  double *rho,
  double *f,
  double *A,
  double *B);

void fc3d_AlartCurnierJeanMoreauFunctionGenerated(
  double *reaction,
  double *velocity,
  double mu,
  double *rho,
  double *f,
  double *A,
  double *B);

#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
}
#endif
#endif


text:
package com.scottlogic.dmiley.battleship.logic.event;

import java.util.EventObject;

// Ship Sunk Event
public class ShipSankEvent extends EventObject {

    public ShipSankEvent(Object source) {
        super(source);
    }
}


text:
<?php

namespace Symfony\Bundle\DebugBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * DebugExtension configuration structure.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('debug');

        $rootNode
            ->children()
                ->integerNode('max_items')
                    ->info('Max number of displayed items past the first level, -1 means no limit')
                    ->min(-1)
                    ->defaultValue(250)
                ->end()
                ->integerNode('max_string_length')
                    ->info('Max length of displayed strings, -1 means no limit')
                    ->min(-1)
                    ->defaultValue(-1)
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Fragm. 9:132. 1875

#### Original name
null

### Remarks
null


text:
class FootballMemoryRepository::TeamRepo

 attr_accessor :records, :teams

 def initialize
   @records = {}
   @teams = []
   @id = 1
 end

 def model_class
    FootballEntities::Team
 end

 def new(attributes = {})
   model_class.new(attributes)
 end

 def save(object)
   object.id = @id
   @records[@id] = object
   @id += 1
   return object
 end

 def update(object)
   records[object.id] = object
   return object
 end

 def find_by_id(n)
   @records[n.to_i]
 end

 def retreive_all
   records_to_ary
   return @teams
 end

 def records_to_ary
   @records.each do |key, value|
     @teams << value
   end
 end

 def delete(object)
   @records[object.id]
 end

end


text:
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase

from chamber.multidomains.domain import Domain, get_current_domain, get_domain, get_domain_choices, get_user_class
from chamber.multidomains.urlresolvers import reverse

from germanium.tools import assert_equal, assert_raises  # pylint: disable=E0401

from test_chamber.models import BackendUser, FrontendUser  # pylint: disable=E0401

class MultidomainsTestCase(TestCase):

    def test_get_domain_choices(self):
        choices = get_domain_choices()
        assert_equal(len(choices), 2)
        assert_equal(choices[0][1], 'backend')
        assert_equal(choices[1][1], 'frontend')
        assert_equal(choices[0][0], 1)
        assert_equal(choices[1][0], 2)

    def test_get_current_user_class(self):
        assert_equal(get_user_class(), BackendUser)

    def test_get_user_class(self):
        assert_equal(get_domain(settings.BACKEND_SITE_ID).user_class, BackendUser)
        assert_equal(get_domain(settings.FRONTEND_SITE_ID).user_class, FrontendUser)

    def test_get_current_domain(self):
        assert_equal(get_current_domain().name, 'backend')

    def test_get_domain(self):
        assert_equal(get_domain(settings.BACKEND_SITE_ID).name, 'backend')
        assert_equal(get_domain(settings.FRONTEND_SITE_ID).name, 'frontend')
        assert_raises(ImproperlyConfigured, get_domain, 3)

    def test_get_domain_url(self):
        assert_equal(get_domain(settings.BACKEND_SITE_ID).url, 'http://localhost:8000')
        assert_equal(get_domain(settings.FRONTEND_SITE_ID).url, 'https://localhost')

    def test_new_domain_port(self):
        assert_equal(Domain('testA', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='http', hostname='localhost').port, 80)
        assert_equal(Domain('testB', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='https', hostname='localhost').port, 443)
        assert_equal(Domain('testC', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='http', hostname='localhost', port=443).port, 443)
        assert_equal(Domain('testD', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='https', hostname='localhost', port=80).port, 80)
        assert_raises(ImproperlyConfigured, Domain, 'testF', 'dj.backend_urls', 'test_chamber.BackendUser',
                      protocol='hbbs', hostname='localhost')
        assert_equal(Domain('testD', 'dj.backend_urls', 'test_chamber.BackendUser',
                            url='https://localhost:80').port, 80)
        assert_equal(Domain('testD', 'dj.backend_urls', 'test_chamber.BackendUser',
                            url='https://localhost').port, 443)

        assert_equal(Domain('testA', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='http', hostname='localhost').url, 'http://localhost')
        assert_equal(Domain('testB', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='https', hostname='localhost').url, 'https://localhost')
        assert_equal(Domain('testC', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='http', hostname='localhost', port=443).url, 'http://localhost:443')
        assert_equal(Domain('testD', 'dj.backend_urls', 'test_chamber.BackendUser',
                            protocol='https', hostname='localhost', port=80).url, 'https://localhost:80')

    def test_reverse(self):
        assert_equal(reverse('current-datetime'), '/current_time_backend/')
        assert_equal(reverse('current-datetime', site_id=settings.BACKEND_SITE_ID), '/current_time_backend/')
        assert_equal(reverse('current-datetime', site_id=settings.FRONTEND_SITE_ID), '/current_time_frontend/')

        assert_equal(reverse('current-datetime', site_id=settings.BACKEND_SITE_ID, add_domain=True),
                     'http://localhost:8000/current_time_backend/')
        assert_equal(reverse('current-datetime', site_id=settings.FRONTEND_SITE_ID, add_domain=True),
                     'https://localhost/current_time_frontend/')

        assert_equal(reverse('current-datetime', site_id=settings.BACKEND_SITE_ID, add_domain=True,
                             urlconf='dj.frontend_urls'),
                     'http://localhost:8000/current_time_frontend/')
        assert_equal(reverse('current-datetime', site_id=settings.FRONTEND_SITE_ID, add_domain=True,
                             urlconf='dj.backend_urls'),
                     'https://localhost/current_time_backend/')

        assert_equal(reverse('current-datetime', qs_kwargs={'a': 1}), '/current_time_backend/?a=1')

        assert_raises(ImproperlyConfigured, reverse, 'current-datetime', site_id=3)


text:
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <linux/fb.h>

#include <cutils/log.h>
#include <cutils/atomic.h>
#include <cutils/properties.h>
#include <hardware/hardware.h>
#include <hardware/gralloc.h>
/* SPRD: add for apct functions @{ */
#include <sys/time.h>
#include <time.h>
/* @} */
#include <GLES/gl.h>

#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
#include "gralloc_vsync_report.h"
#endif

#include "alloc_device.h"
#include "gralloc_priv.h"
#include "gralloc_helper.h"

#ifdef SPRD_DITHER_ENABLE
#include "image_dither.h"
#endif

// numbers of buffers for page flipping
#define NUM_BUFFERS NUM_FB_BUFFERS
//#define DEBUG_FB_POST

#ifdef DUMP_FB
extern void dump_fb(void* addr, struct fb_var_screeninfo * info , int format);
#endif

static int swapInterval = 1;

enum
{
	PAGE_FLIP = 0x00000001,
};

#ifdef SPRD_DITHER_ENABLE

struct dither_info {
    FILE*    fp;
    uint32_t alg_handle;
};

uint32_t dither_open(uint32_t w, uint32_t h)
{
    struct dither_info *dither = NULL;

    ALOGE("dither: open: %dx%d", w, h);

    dither = (struct dither_info *)malloc(sizeof(struct dither_info));
    if (NULL != dither) {
        int ret = 0;
        struct img_dither_init_in_param init_in;
        struct img_dither_init_out_param init_out;
        FILE* fp = NULL;

        memset(dither, 0, sizeof(struct dither_info));

        fp = fopen("/sys/module/mali/parameters/gpu_cur_freq", "r");
        if(fp == NULL)
        {
            AERR( "can not open /sys/module/mali/parameters/gpu_cur_freq %x", fp);
            free (dither);
            dither = NULL;
            return 0;
        }

        dither->fp = fp;
        init_in.alg_id = 0;
        init_in.height = h; //m->info.yres;
        init_in.width = w; //m->info.xres;

        ret = img_dither_init(&init_in, &init_out);
        if (0 != ret || 0 == init_out.param) {
            if(dither->fp) {
                fclose(dither->fp);
            }
            free (dither);
            dither = NULL;
            ALOGE("dither: init failed ,ret = 0x%x", ret);
            return 0;
        }

        dither->alg_handle = (uint32_t)init_out.param;

        AINF("dither open ID %i, handle = 0x%x\n", 1, dither->alg_handle);

    }
    else {
        ALOGE("dither: dither_open failed!");
    }

    return (uint32_t)dither;
}

void dither_close(uint32_t handle)
{
    if (NULL != handle)
    {
        struct dither_info *dither = (struct dither_info *)handle;

        img_dither_deinit(dither->alg_handle);
        dither->alg_handle = NULL;
        if(dither->fp) {
            fclose(dither->fp);
        }
        free((void *)handle);
    }
}
#endif

static int fb_set_swap_interval(struct framebuffer_device_t *dev, int interval)
{
	if (interval < dev->minSwapInterval)
	{
		interval = dev->minSwapInterval;
	}
	else if (interval > dev->maxSwapInterval)
	{
		interval = dev->maxSwapInterval;
	}

	swapInterval = interval;

	return 0;
}

static int fb_setUpdateRect(struct framebuffer_device_t* dev,
        int l, int t, int w, int h)
{
	if (((w|h) <= 0) || ((l|t)<0))
		return -EINVAL;

	private_module_t* m = reinterpret_cast<private_module_t*>(
		dev->common.module);
	m->info.reserved[0] = 0x6f766572; // "UPDT";
	m->info.reserved[1] = (uint16_t)l | ((uint32_t)t << 16);
	m->info.reserved[2] = (uint16_t)w | ((uint32_t)h << 16);

	return 0;
}

/* SPRD: add for apct functions @{ */
static void writeFpsToProc(float fps)
{
    char fps_buf[256] = {0};
    char *fps_proc = "/proc/benchMark/fps";
    int fpsInt = (int)(fps+0.5);

    sprintf(fps_buf, "fps:%d", fpsInt);

    FILE *f = fopen(fps_proc,"r+w");
	if (NULL != f)
	{
        fseek(f,0,0);
        fwrite(fps_buf,strlen(fps_buf),1,f);
        fclose(f);
    }
}

static int64_t systemTime()
{
    struct timespec t;
    t.tv_sec = t.tv_nsec = 0;
    clock_gettime(CLOCK_MONOTONIC, &t);
    return t.tv_sec*1000000000LL + t.tv_nsec;
}

bool gIsApctFpsShow = false;
bool gIsApctRead  = false;
bool getApctFpsSupport()
{
    if (gIsApctRead)
    {
        return gIsApctFpsShow;
    }
    gIsApctRead = true;

    char str[10] = {'\0'};
    char *FILE_NAME = "/data/data/com.sprd.APCT/apct/apct_support";

    FILE *f = fopen(FILE_NAME, "r");

    if (NULL != f)
    {
        fseek(f, 0, 0);
        fread(str, 5, 1, f);
        fclose(f);

        long apct_config = atol(str);

        gIsApctFpsShow =  (apct_config & 0x8002) == 0x8002 ? true : false;
    }
    return gIsApctFpsShow;
}
/* @} */

#ifdef SPRD_DITHER_ENABLE
static bool fb_is_dither_enable(struct dither_info *dither, private_handle_t const* hnd)
{
    char buf[16] = "312000";
    FILE *fp = dither->fp;

    if(fp == NULL)
    {
        AERR( "can not open /sys/module/mali/parameters/gpu_cur_freq %x", fp);
    }
    else
    {
        fseek(fp, 0, SEEK_SET);
        fread(buf, 1, 8, dither->fp);
    }

    int gpu_cur_freq = atoi(buf);
    if(gpu_cur_freq <= 256000) {
        if(hnd->flags & private_handle_t::PRIV_FLAGS_SPRD_DITHER) {
            return true;
        }
    }
    return false;
}
#endif

static int frame_count_fbpost = 0;
static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
{
	if (private_handle_t::validate(buffer) < 0)
	{
		return -EINVAL;
	}

    /* SPRD: add for apct functions @{ */
    static int64_t now = 0, last = 0;
    static int flip_count = 0;

    if (getApctFpsSupport())
    {
        flip_count++;
        now = systemTime();
        if ((now - last) >= 1000000000LL)
        {
            float fps = flip_count*1000000000.0f/(now-last);
            writeFpsToProc(fps);
            flip_count = 0;
            last = now;
        }
    }
    /* @} */

	/*
	  in surfaceflinger init process, first setTransactionState(...) will evoke a screen update which is not necessary
	  here we just skip this black frame
	*/
	if(frame_count_fbpost < 1) {
		frame_count_fbpost++;
		return 0;
	}

	private_handle_t const* hnd = reinterpret_cast<private_handle_t const*>(buffer);
	private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);

#ifdef DEBUG_FB_POST
	AINF( "%s in line=%d\n", __FUNCTION__, __LINE__);
#endif
	if (m->currentBuffer)
	{
		m->base.unlock(&m->base, m->currentBuffer);
		m->currentBuffer = 0;
	}

	if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)
	{
		m->base.lock(&m->base, buffer, private_module_t::PRIV_USAGE_LOCKED_FOR_POST,
		             0, 0, m->info.xres, m->info.yres, NULL);

		const size_t offset = hnd->base - m->framebuffer->base;
		int interrupt;
		m->info.activate = FB_ACTIVATE_VBL;
		m->info.yoffset = offset / m->finfo.line_length;

#ifdef DUMP_FB
        {
            dump_fb((void*)(hnd->base),&m->info,m->fbFormat);
        }
#endif

#ifdef SPRD_DITHER_ENABLE
        struct dither_info *dither = (struct dither_info *)dev->reserved[6];

        if (NULL != dither) {
            if(fb_is_dither_enable(dither, hnd)) {
                struct img_dither_in_param in_param;
                struct img_dither_out_param out_param;
                uint32_t dither_handle = 0;

                dither_handle = dither->alg_handle;
                in_param.alg_id = 0;
                in_param.data_addr = (void*)(hnd->base);
                in_param.format = 0;
                in_param.height =  m->info.yres;
                in_param.width =  m->info.xres;
                img_dither_process(dither_handle, &in_param, &out_param);
                m->info.reserved[3] = 1;
            }
        }
        else
#endif
        {
            m->info.reserved[3] = 0;
        }

#ifdef STANDARD_LINUX_SCREEN
#define FBIO_WAITFORVSYNC       _IOW('F', 0x20, __u32)
#define S3CFB_SET_VSYNC_INT _IOW('F', 206, unsigned int)

		if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1)
		{
			AERR("FBIOPAN_DISPLAY failed for fd: %d", m->framebuffer->fd);
			m->base.unlock(&m->base, buffer);
			return 0;
		}

		if (swapInterval == 1)
		{
			// enable VSYNC
			interrupt = 1;

			if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
			{
				AERR("S3CFB_SET_VSYNC_INT enable failed for fd: %d", m->framebuffer->fd);
				return 0;
			}

			// wait for VSYNC
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
			gralloc_mali_vsync_report(MALI_VSYNC_EVENT_BEGIN_WAIT);
#endif
			int crtc = 0;

			if (ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0)
			{
				AERR("FBIO_WAITFORVSYNC failed for fd: %d", m->framebuffer->fd);
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
				gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
				return 0;
			}

#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
			gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
			// disable VSYNC
			interrupt = 0;

			if (ioctl(m->framebuffer->fd, S3CFB_SET_VSYNC_INT, &interrupt) < 0)
			{
				AERR("S3CFB_SET_VSYNC_INT disable failed for fd: %d", m->framebuffer->fd);
				return 0;
			}
		}

#else
		/*Standard Android way*/
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
		gralloc_mali_vsync_report(MALI_VSYNC_EVENT_BEGIN_WAIT);
#endif

#ifdef FB_FORMAT_SWITCH
		if(dev->format==HAL_PIXEL_FORMAT_RGB_565){
			m->info.bits_per_pixel = 16;
			m->info.red.offset     = 11;
			m->info.red.length     = 5;
			m->info.green.offset   = 5;
			m->info.green.length   = 6;
			m->info.blue.offset    = 0;
			m->info.blue.length    = 5;
			m->info.transp.offset  = 0;
			m->info.transp.length  = 0;
		}
		else{
			m->info.bits_per_pixel = 32;
			m->info.red.offset     = 0;
			m->info.red.length     = 8;
			m->info.green.offset   = 8;
			m->info.green.length   = 8;
			m->info.blue.offset    = 16;
			m->info.blue.length    = 8;
			m->info.transp.offset  = 24;
			m->info.transp.length  = 0;
		}
#endif
		if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1)
		{
			AERR("FBIOPUT_VSCREENINFO failed for fd: %d", m->framebuffer->fd);
#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
			gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
			m->base.unlock(&m->base, buffer);
			return -errno;
		}

#ifdef MALI_VSYNC_EVENT_REPORT_ENABLE
		gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
#endif
#endif

		m->currentBuffer = buffer;
	}
	else
	{
		void *fb_vaddr;
		void *buffer_vaddr;

		m->base.lock(&m->base, m->framebuffer, GRALLOC_USAGE_SW_WRITE_RARELY,
		             0, 0, m->info.xres, m->info.yres, &fb_vaddr);

		m->base.lock(&m->base, buffer, GRALLOC_USAGE_SW_READ_RARELY,
		             0, 0, m->info.xres, m->info.yres, &buffer_vaddr);

		memcpy(fb_vaddr, buffer_vaddr, m->finfo.line_length * m->info.yres);

		m->base.unlock(&m->base, buffer);
		m->base.unlock(&m->base, m->framebuffer);
	}

#ifdef DEBUG_FB_POST
	AINF( "%s out line=%d\n", __FUNCTION__, __LINE__);
#endif
	return 0;
}

int init_frame_buffer_locked(struct private_module_t *module)
{
	if (module->framebuffer)
	{
		return 0; // Nothing to do, already initialized
	}

	char const *const device_template[] =
	{
		"/dev/graphics/fb%u",
		"/dev/fb%u",
		NULL
	};

	int fd = -1;
	int i = 0;
	char name[64];

	while ((fd == -1) && device_template[i])
	{
		snprintf(name, 64, device_template[i], 0);
		fd = open(name, O_RDWR, 0);
		i++;
	}

	if (fd < 0)
	{
		return -errno;
	}

	struct fb_fix_screeninfo finfo;

	if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1)
	{
		close(fd);
		return -errno;
	}

	struct fb_var_screeninfo info;

	if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
	{
		close(fd);
		return -errno;
	}

	info.reserved[0] = 0;
	info.reserved[1] = 0;
	info.reserved[2] = 0;
	info.reserved[3] = 0;
	info.xoffset = 0;
	info.yoffset = 0;
	info.activate = FB_ACTIVATE_NODISP;

	char value[PROPERTY_VALUE_MAX];
	property_get("ro.sf.lcd_width", value, "1");
	info.width = atoi(value);
	property_get("ro.sf.lcd_height", value, "1");
	info.height = atoi(value);

    if(info.bits_per_pixel == 16)
    {
        /*
         * Explicitly request 5/6/5
         */
        info.bits_per_pixel = 16;
        info.red.offset     = 11;
        info.red.length     = 5;
        info.green.offset   = 5;
        info.green.length   = 6;
        info.blue.offset    = 0;
        info.blue.length    = 5;
        info.transp.offset  = 0;
        info.transp.length  = 0;

        module->fbFormat = HAL_PIXEL_FORMAT_RGB_565;
    }
    else
    {
        /*
         * Explicitly request 8/8/8
         */
        info.bits_per_pixel = 32;
        info.red.offset     = 0;
        info.red.length     = 8;
        info.green.offset   = 8;
        info.green.length   = 8;
        info.blue.offset    = 16;
        info.blue.length    = 8;
        info.transp.offset  = 24;
        info.transp.length  = 0;

        module->fbFormat = HAL_PIXEL_FORMAT_RGBA_8888;
    }

	/*
	 * Request NUM_BUFFERS screens (at lest 2 for page flipping)
	 */
	info.yres_virtual = info.yres * NUM_BUFFERS;

	uint32_t flags = PAGE_FLIP;

	if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1)
	{
		info.yres_virtual = info.yres;
		flags &= ~PAGE_FLIP;
		AWAR("FBIOPUT_VSCREENINFO failed, page flipping not supported fd: %d", fd);
	}

	if (info.yres_virtual < info.yres * 2)
	{
		// we need at least 2 for page-flipping
		info.yres_virtual = info.yres;
		flags &= ~PAGE_FLIP;
		AWAR("page flipping not supported (yres_virtual=%d, requested=%d)", info.yres_virtual, info.yres * 2);
	}

	if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1)
	{
		close(fd);
		return -errno;
	}

	int refreshRate = 0;

	if (info.pixclock > 0)
	{
		refreshRate = 1000000000000000LLU /
		              (
		                  uint64_t(info.upper_margin + info.lower_margin + info.yres + info.hsync_len)
		                  * (info.left_margin  + info.right_margin + info.xres + info.vsync_len)
		                  * info.pixclock
		              );
	}
	else
	{
		AWAR("fbdev pixclock is zero for fd: %d", fd);
	}

	if (refreshRate == 0)
	{
		refreshRate = 60 * 1000; // 60 Hz
	}

	if (int(info.width) <= 0 || int(info.height) <= 0)
	{
		// the driver doesn't return that information
		// default to 160 dpi
		info.width  = ((info.xres * 25.4f) / 160.0f + 0.5f);
		info.height = ((info.yres * 25.4f) / 160.0f + 0.5f);
	}

	float xdpi = (info.xres * 25.4f) / info.width;
	float ydpi = (info.yres * 25.4f) / info.height;
	float fps  = refreshRate / 1000.0f;

	AINF("using (fd=%d)\n"
	     "id           = %s\n"
	     "xres         = %d px\n"
	     "yres         = %d px\n"
	     "xres_virtual = %d px\n"
	     "yres_virtual = %d px\n"
	     "bpp          = %d\n"
	     "r            = %2u:%u\n"
	     "g            = %2u:%u\n"
	     "b            = %2u:%u\n",
	     fd,
	     finfo.id,
	     info.xres,
	     info.yres,
	     info.xres_virtual,
	     info.yres_virtual,
	     info.bits_per_pixel,
	     info.red.offset, info.red.length,
	     info.green.offset, info.green.length,
	     info.blue.offset, info.blue.length);

	AINF("width        = %d mm (%f dpi)\n"
	     "height       = %d mm (%f dpi)\n"
	     "refresh rate = %.2f Hz\n",
	     info.width,  xdpi,
	     info.height, ydpi,
	     fps);

	if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1)
	{
		close(fd);
		return -errno;
	}

	if (finfo.smem_len <= 0)
	{
		close(fd);
		return -errno;
	}

	module->flags = flags;
	module->info = info;
	module->finfo = finfo;
	module->xdpi = xdpi;
	module->ydpi = ydpi;
	module->fps = fps;

	/*
	 * map the framebuffer
	 */
	size_t fbSize = round_up_to_page_size(finfo.line_length * info.yres_virtual);
	void *vaddr = mmap(0, fbSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

	if (vaddr == MAP_FAILED)
	{
		close(fd);
		AERR( "Error mapping the framebuffer (%s)", strerror(errno) );
		return -errno;
	}

	memset(vaddr, 0, fbSize);

	// Create a "fake" buffer object for the entire frame buffer memory, and store it in the module
	module->framebuffer = new private_handle_t(private_handle_t::PRIV_FLAGS_FRAMEBUFFER, 0, fbSize, intptr_t(vaddr),
	        0, dup(fd), 0);

	close(fd);
	module->numBuffers = info.yres_virtual / info.yres;
	module->bufferMask = 0;

#if GRALLOC_ARM_UMP_MODULE
#ifdef IOCTL_GET_FB_UMP_SECURE_ID
	ioctl(fd, IOCTL_GET_FB_UMP_SECURE_ID, &module->framebuffer->ump_id);
#endif

	if ((int)UMP_INVALID_SECURE_ID != module->framebuffer->ump_id)
	{
		AINF("framebuffer accessed with UMP secure ID %i\n", module->framebuffer->ump_id);
	}

#endif

	return 0;
}

static int init_frame_buffer(struct private_module_t *module)
{
	pthread_mutex_lock(&module->lock);
	int err = init_frame_buffer_locked(module);
	pthread_mutex_unlock(&module->lock);
	return err;
}

static int fb_close(struct hw_device_t *device)
{
	framebuffer_device_t *dev = reinterpret_cast<framebuffer_device_t *>(device);

#ifdef SPRD_DITHER_ENABLE
    if (dev->reserved[6]) {
        int ret = 0;
        dither_close(dev->reserved[6]);
        dev->reserved[6] = 0;
        AINF("dither close ID %i\n", 1);
    }
#endif

	if (dev)
	{
#if GRALLOC_ARM_UMP_MODULE
		ump_close();
#endif
		delete dev;
	}

	return 0;
}

int compositionComplete(struct framebuffer_device_t *dev)
{
	/* By doing a finish here we force the GL driver to start rendering
	   all the drawcalls up to this point, and to wait for the rendering to be complete.*/
	glFinish();
	/* The rendering of the backbuffer is now completed.
	   When SurfaceFlinger later does a call to eglSwapBuffer(), the swap will be done
	   synchronously in the same thread, and not asynchronoulsy in a background thread later.
	   The SurfaceFlinger requires this behaviour since it releases the lock on all the
	   SourceBuffers (Layers) after the compositionComplete() function returns.
	   However this "bad" behaviour by SurfaceFlinger should not affect performance,
	   since the Applications that render the SourceBuffers (Layers) still get the
	   full renderpipeline using asynchronous rendering. So they perform at maximum speed,
	   and because of their complexity compared to the Surface flinger jobs, the Surface flinger
	   is normally faster even if it does everyhing synchronous and serial.
	   */
	return 0;
}

int framebuffer_device_open(hw_module_t const *module, const char *name, hw_device_t **device)
{
	int status = -EINVAL;

	alloc_device_t *gralloc_device;
	status = gralloc_open(module, &gralloc_device);

	if (status < 0)
	{
		return status;
	}

	private_module_t *m = (private_module_t *)module;
	status = init_frame_buffer(m);

	if (status < 0)
	{
		gralloc_close(gralloc_device);
		return status;
	}

	/* initialize our state here */
	framebuffer_device_t *dev = new framebuffer_device_t();
	memset(dev, 0, sizeof(*dev));

	/* initialize the procs */
	dev->common.tag = HARDWARE_DEVICE_TAG;
	dev->common.version = 0;
	dev->common.module = const_cast<hw_module_t *>(module);
	dev->common.close = fb_close;
	dev->setSwapInterval = fb_set_swap_interval;
	dev->post = fb_post;
	dev->setUpdateRect = 0;
	dev->compositionComplete = &compositionComplete;

	int stride = m->finfo.line_length / (m->info.bits_per_pixel >> 3);
	const_cast<uint32_t &>(dev->flags) = 0;
	const_cast<uint32_t &>(dev->width) = m->info.xres;
	const_cast<uint32_t &>(dev->height) = m->info.yres;
	const_cast<int &>(dev->stride) = stride;
	const_cast<int&>(dev->format) = m->fbFormat;
	const_cast<float &>(dev->xdpi) = m->xdpi;
	const_cast<float &>(dev->ydpi) = m->ydpi;
	const_cast<float &>(dev->fps) = m->fps;
	const_cast<int &>(dev->minSwapInterval) = 0;
	const_cast<int &>(dev->maxSwapInterval) = 1;
	*device = &dev->common;

#ifdef SPRD_DITHER_ENABLE
    uint32_t dither_handle = (uint32_t)dither_open(m->info.xres, m->info.yres);
    if (dither_handle > 0) {
        dev->reserved[6] = dither_handle;
    }
    else {
        dev->reserved[6] = 0;
        ALOGE("dither: dither open failed!");
    }
#endif

	//if (m->finfo.reserved[0] == 0x6f76 &&
	//		m->finfo.reserved[1] == 0x6572) {
	//	dev->setUpdateRect = fb_setUpdateRect;
	//	LOGD("UPDATE_ON_DEMAND supported");
	//}

	status = 0;
	return status;
}


text:
package org.imirp.imirp.mutation.region;

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

import org.imirp.imirp.mutation.MutationSite;
import org.imirp.imirp.mutation.rule.MutationRule;
import org.imirp.imirp.mutation.rule.support.MutationRuleObserver;

/**
 * Contains meta information about a mutli-site mutation
 *
 * @author Torben
 *
 */
public class MultiSiteMutation implements MutationRuleObserver {
	private MutationRegion startRegion = null;
	private String sequence;
	private List<MutationRule> mutationRules;

	public MultiSiteMutation(String sequence, int[][] mutationSites, List<MutationRule> mutationRules) {
		this.sequence = sequence;
		this.mutationRules = mutationRules;
		ArrayList<MutationSite> mutSites = new ArrayList<MutationSite>();
		for (int[] site : mutationSites) {
			mutSites.add(new MutationSite(site));
		}
		initSites(mutSites);
	}

	public MultiSiteMutation(String sequence, Collection<MutationSite> mutationSites, List<MutationRule> mutationRules) {
		this.sequence = sequence;
		this.mutationRules = mutationRules;
		initSites(mutationSites);
	}

	public MultiSiteMutation(String sequence, MutationRegion startRegion, List<MutationRule> mutationRules) {
		this.sequence = sequence;
		this.mutationRules = mutationRules;
		this.startRegion = startRegion;
	}

	public Collection<MutationSite> getSites(){
	    Collection<MutationSite> sites = new ArrayList<>();
	    MutationRegion region = startRegion;
	    do{
	        sites.addAll(region.getMutationSites());
	    }while((region = region.getNextRegion()) != null);
	    return sites;
	}

	protected void initSites(Collection<MutationSite> mutationSites) {
		// Analyze list of mutation site indexes
		assert mutationSites.size() > 0;
		startRegion = new MutationRegionBuilder().addSites(mutationSites).build();
	}

	public MutationRegion getStartRegion() {
		return startRegion;
	}

	public Iterable<MutationRegion> getRegions(){
	    return new Iterable<MutationRegion>(){
            @Override
            public Iterator<MutationRegion> iterator() {
                return getRegionIterator();
            }
	    };
	}

	public Iterator<MutationRegion> getRegionIterator(){
	    return new Iterator<MutationRegion>(){
	        MutationRegion currentRegion = getStartRegion();
            @Override
            public boolean hasNext() {
                return currentRegion != null;
            }

            @Override
            public MutationRegion next() {
                final MutationRegion region = currentRegion;
                currentRegion = currentRegion.getNextRegion();
                return region;
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
	    };
	}

	public String getSequence() {
		return sequence;
	}

	/**
	 * @param mutatedSequence
	 *            the new, mutated sequence
	 * @return true if the new, mutated sequence satisfies the multi-site mutation's rules, false otherwise
	 */
	public boolean doesMutationSatisfyRules(String mutatedSequence) {
		// Check each rule and if any rule fails then the mutation is not satisfactory
		for(MutationRule rule : mutationRules){
			if(!rule.checkRule(this, sequence, mutatedSequence)){
				return false;
			}
		}

		// All the rules have been satisfied, we are go!
		return true;
	}

	/**
	 * @return the list of mutation rules for this multi-site mutation
	 */
	public List<MutationRule> getMutationRules() {
		return mutationRules;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("SEQ: ").append(sequence).append("\n");
		MutationRegion region = startRegion;
		while(region != null){
			sb.append("R").append(region.getRegionId()).append("[");
			sb.append(sequence.substring(region.getRegionStartIndex(), region.getRegionEndIndex()));
			sb.append("]\n");
			sb.append("Mutation Sites: [\n");
			for(MutationSite ms: region.getMutationSites()){
				sb.append("(").append(ms.getStartIndex()).append(",").append(ms.getEndIndex()).append(")=>(").append(sequence.substring(ms.getStartIndex(), ms.getEndIndex()+1)).append(")\n");
			}
			sb.append("]\n");
			region = region.getNextRegion();
		}
		sb.append("\n");
		sb.append(startRegion);

		return sb.toString();
	}

	public static void main(String[] args) {
		String testSeq = "GTCAGCTAGCATGCTGACGAGCATGCATGCGCGACAGGTACTTCTCGAGCATGCATGCATGCTGACTGATCGATCGTAGCTAGCGTAGTCTAGCTAGCTAGCTACGTAGCTA";
		List<MutationSite> testSites = new ArrayList<MutationSite>();
		testSites.add(new MutationSite(0, 7));
		testSites.add(new MutationSite(6, 13));
		testSites.add(new MutationSite(16, 23));
		testSites.add(new MutationSite(32, 39));
		testSites.add(new MutationSite(50, 57));
		testSites.add(new MutationSite(52, 59));
		testSites.add(new MutationSite(80, 87));
		testSites.add(new MutationSite(92, 99));

		System.out.println(new MultiSiteMutation(testSeq, testSites, new ArrayList<MutationRule>()));
	}
}


text:
require_relative 'base'

module Mv
  module Core
    module Validation
      module Builder
        class Exclusion < Base
          delegate :in, to: :validation

          def conditions
            [{
              statement: apply_allow_nil_and_blank(apply_in(column_reference)),
              message: message
            }]
          end

          protected

          def db_value value
            return value if value.is_a?(Integer) or value.is_a?(Float)
            return "'#{value.to_s}'" if value.is_a?(String)
            raise Mv::Core::Error.new(table_name: table_name,
                                      column_name: column_name,
                                      validation_type: :inclusion,
                                      options: { in: value },
                                      error: "#{value.class} is not supported as :in value")
          end

          def apply_in stmt
            if self.in.is_a?(Range)
              "#{stmt} < #{db_value(self.in.min)} OR #{stmt} > #{db_value(self.in.max)}"
            else
              prepared_in = self.in.to_a.collect{ |v| db_value(v) }

              "#{stmt} NOT IN (#{prepared_in.join(', ')})"
            end
          end
        end
      end
    end
  end
end


text:
module Azure::BotService::Mgmt::V2017_12_01_preview
  module Models
    #
    # Defines values for Kind
    #
    module Kind
      Sdk = "sdk"
      Designer = "designer"
      Bot = "bot"
      Function = "function"
    end
  end
end


text:
package blockstore

// This file implements block primitives.

import (
	"math/rand"
	"time"
)

// Size of a Block can be arbitrary. It is Intended to be 4096 to fit in a 4KB page.
const blockSize = 4096

type Block [blockSize]byte

// Helper function that generates a random block of data.
func GetRandomBlock() *Block {
	var newBlock *Block = new(Block)
	myRand := randomGen()
	for index, _ := range newBlock {
		newBlock[index] = byte(myRand.Intn(256))
	}
	return newBlock
}

func randomGen() *rand.Rand {
	seed := rand.NewSource(time.Now().UnixNano())
	random := rand.New(seed)
	return random
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/item_remove"
        android:title="@string/menu_app_remove"/>
</menu>


text:
JiraCli
============

[![Join the chat at https://gitter.im/CatenaLogic/JiraCli](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/CatenaLogic/JiraCli?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

![License](https://img.shields.io/github/license/catenalogic/jiracli.svg)
![NuGet downloads](https://img.shields.io/nuget/dt/jiracli.svg)
![Version](https://img.shields.io/nuget/v/jiracli.svg)
![Pre-release version](https://img.shields.io/nuget/vpre/jiracli.svg)
![Chocolatey count](https://img.shields.io/chocolatey/dt/jiracli.svg)
![Chocolatey version](https://img.shields.io/chocolatey/v/jiracli.svg)

![JiraCli](design/logo/logo_64.png)

JiraCli allows control of JIRA via the command line interface (CLI). One feature that is very useful is the availability to create releases via the CLI. This is very useful for build servers and continuous integration (CI) situations.

## Usage

The usage is simple and always requires this base call:

    JiraCli.exe -user [user] -pw [password] -url [url] -action [action]

The actions are implemented and determined dynamically. Use the **-help** parameter to see all available actions.

## Getting help

When you need help about JiraCli, use the following command line:

    JiraCli.exe -help

## Logging to a file ##

When you need to log the information to a file, use the following command line:

    JiraCli.exe -l JiraCliLog.log [other parameters]

## Create new version in JIRA

	[basecall] createversion -project MyProject -version 1.2.0

## Release new version in JIRA

	[basecall] releaseversion -project MyProject -version 1.2.0

# How to get JiraCli #

There are three general ways to get JiraCli:

## Get it from GitHub ##

The releases will be available as separate executable download on the [releases tab](https://github.com/CatenaLogic/JiraCli/releases) of the project.

## Get it via Chocolatey ##

If you want to install the tool on your (build) computer, the package is available via Chocolatey. To install, use the following command:

    choco install jiracli

## Get it via NuGet ##

If you want to reference the assembly to use it in code, the recommended way to get it is via NuGet.

**Note that getting JiraCli via NuGet will add it as a reference to the project**

# Icon

Flag by Castor & Pollux from The Noun Project


text:
<!DOCTYPE html>

<meta charset="utf-8"/>
<title>Metronic | Image Cropping</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta content="" name="description"/>
<meta content="" name="author"/>

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/bootstrap/css/bootstrap-rtl.min.css" rel="stylesheet" type="text/css">
<link href="../../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css">

<link href="../../assets/global/plugins/jcrop/css/jquery.Jcrop.min.css" rel="stylesheet"/>
<link href="../../assets/admin/pages/css/image-crop-rtl.css" rel="stylesheet"/>

<link href="../../assets/global/css/components-rounded.css" id="style_components" rel="stylesheet" type="text/css">
<link href="../../assets/global/css/plugins-rtl.css" rel="stylesheet" type="text/css">
<link href="../../assets/admin/layout3/css/layout-rtl.css" rel="stylesheet" type="text/css">
<link href="../../assets/admin/layout3/css/themes/default-rtl.css" rel="stylesheet" type="text/css" id="style_color">
<link href="../../assets/admin/layout3/css/custom-rtl.css" rel="stylesheet" type="text/css">

<link rel="shortcut icon" href="favicon.ico"/>

						7

You have 12 pending tasks

								view all

										just now

										New user registered.

										3 mins

										Server #12 overloaded.

										10 mins

										Server #2 not responding.

										14 hrs

										Application error.

										2 days

										Database overloaded 68%.

										3 days

										A user IP blocked.

										4 days

										Storage Server #4 not responding dfdfdfd.

										5 days

										System Error.

										9 days

										Storage server failed.

						3

You have 12 pending tasks

								view all

										New release v1.2
										30%

										40% Complete

										Application deployment
										65%

										65% Complete

										Mobile app release
										98%

										98% Complete

										Database migration
										10%

										10% Complete

										Web server upgrade
										58%

										58% Complete

										Mobile development
										85%

										85% Complete

										New UI release
										38%

										38% Complete

						3

You have 7 New Messages

								view all

										Lisa Wong
										Just Now

										Vivamus sed auctor nibh congue nibh. auctor nibh auctor nibh...

										Richard Doe
										16 mins

										Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh...

										Bob Nilson
										2 hrs

										Vivamus sed nibh auctor nibh congue nibh. auctor nibh auctor nibh...

										Lisa Wong
										40 mins

										Vivamus sed auctor 40% nibh congue nibh...

										Richard Doe
										46 mins

										Vivamus sed congue nibh auctor nibh congue nibh. auctor nibh auctor nibh...

						Nick

								 My Profile

								 My Calendar

								 My Inbox
								3

								 My Tasks
								7

								 Lock Screen

								 Log Out

			<form class="search-form" action="extra_search.html" method="GET">

					<input type="text" class="form-control" placeholder="Search" name="query">

			</form>

						Dashboard

						Features

eCommerce

													eCommerce

													Manage Orders

													Order View

													Manage Products

													Product Edit

Layouts

													Fluid Layout

													Fixed Mega Menu

													Fixed Top Bar

													Light Header Dropdowns

													Blank Page Layout

More Layouts

													Click vs. Hover Dropdowns

													Layout with Fontawesome

													Layout with Glyphicon

													Language Switch Bar

													Disabled Menu Links

						UI Components

UI Components

													General

													Buttons

													Popover Confirmations

													Font Icons

													Flat UI Colors

													Typography

													Tabs, Accordions & Navs

													Tree View

													Page Progress Bar new

													Block UI

													Notific8 Notifications

More UI Components

													Toastr Notifications

													Alerts & Dialogs API new

													Session Timeout

													User Idle Timeout

													Modals

													Extended Modals

													Tiles

													Date Paginator

													Nestable List

Form Stuff

													Form Controls

													iCheck Controls

													Form Layouts

													Form X-editable new

													Form Wizard

													Form Validation

													Image Cropping

													Multiple File Upload

													Dropzone File Upload

Form Components

													Pickers

													Custom Dropdowns

													Form Tools

													Markdown & WYSIWYG Editors

													Ion Range Sliders

													NoUI Range Sliders

													jQuery UI Sliders

													Knob Circle Dials

						Extra

								Data Tables

										Basic Datatables

										Responsive Datatables

										Managed Datatables

										Editable Datatables

										Advanced Datatables

										Ajax Datatables

								Portlets

										General Portlets

										New Portlets #1 new

										New Portlets #2 new

										Ajax Portlets

										Draggable Portlets

								Charts

										Amchart

										Flotchart

								Maps

										Google Maps

										Vector Maps

								Multi Level

										Item 1

										Item 2

										Item 3

										Sub Items

												Item 1

												Item 2

												Item 3

												Item 4

										Item 4

										Item 5

						Pages

User Pages

														New Timeline 2

													Todo & Tasks 4

													User Profile new

													User Inbox 4

													User Calendar 14

													Login Form 1

													Login Form 2

													Login Form 3

													Login Form 4

													Lock Screen 1

													Lock Screen 2

General Pages

													FAQ Page

													Portfolio

													Old Timeline 4

													Coming Soon

													Invoice

													Blog

													Blog Post

Custom Pages

													News 9

													News View

													About Us

													Contact Us

													Search Results

													Pricing Tables

Miscellaneous

													404 Page Option 1

													404 Page Option 2

													404 Page Option 3

													500 Page Option 1

													500 Page Option 2

													Newsletter Email Template

													System Email Template

						AngularJS Version

Image Cropping image cropping samples

THEME COLORS

                                                Default

                                                Blue Hoki

                                                Blue Steel

                                                Orange

                                                Yellow Crusta

                                                Green Haze

                                                Red Sunglo

                                                Red Intense

                                                Purple Plum

                                                Purple Studio

LAYOUT

                                        Theme Style
                                        <select class="theme-setting theme-setting-style form-control input-sm input-small input-inline tooltips" data-original-title="Change theme style" data-container="body" data-placement="left">
                                            <option value="boxed" selected="selected">Square corners</option>
                                            <option value="rounded">Rounded corners</option>
                                        </select>

                                         Layout
                                        <select class="theme-setting theme-setting-layout form-control input-sm input-small input-inline tooltips" data-original-title="Change layout type" data-container="body" data-placement="left">
                                            <option value="boxed" selected="selected">Boxed</option>
                                            <option value="fluid">Fluid</option>
                                        </select>

                                         Top Menu Style
                                        <select class="theme-setting theme-setting-top-menu-style form-control input-sm input-small input-inline tooltips" data-original-title="Change top menu dropdowns style" data-container="body" data-placement="left">
                                            <option value="dark" selected="selected">Dark</option>
                                            <option value="light">Light</option>
                                        </select>

                                         Top Menu Mode
                                        <select class="theme-setting theme-setting-top-menu-mode form-control input-sm input-small input-inline tooltips" data-original-title="Enable fixed(sticky) top menu" data-container="body" data-placement="left">
                                            <option value="fixed">Fixed</option>
                                            <option value="not-fixed" selected="selected">Not Fixed</option>
                                        </select>

                                         Mega Menu Style
                                        <select class="theme-setting theme-setting-mega-menu-style form-control input-sm input-small input-inline tooltips" data-original-title="Change mega menu dropdowns style" data-container="body" data-placement="left">
                                            <option value="dark" selected="selected">Dark</option>
                                            <option value="light">Light</option>
                                        </select>

                                         Mega Menu Mode
                                        <select class="theme-setting theme-setting-mega-menu-mode form-control input-sm input-small input-inline tooltips" data-original-title="Enable fixed(sticky) mega menu" data-container="body" data-placement="left">
                                            <option value="fixed" selected="selected">Fixed</option>
                                            <option value="not-fixed">Not Fixed</option>
                                        </select>

							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>

Modal title

							 Widget settings form goes here

							<button type="button" class="btn blue">Save changes</button>
							<button type="button" class="btn default" data-dismiss="modal">Close</button>

					Home

					UI Components

					 Image Cropping

								Basic

								Form Integration

								Visual Effects

								Animation Demo

								Realtime API

								Cusrom Style

								Non-Image

								PHP Cropping

This example demonstrates the default behavior of Jcrop.

									 Since no event handlers have been attached it only performs the cropping behavior.

An example with a basic event handler.

											 Here we've tied several form values together with a simple event handler invocation. The result is that the form values are updated in real-time as the selection is changed using Jcrop's onChange handler.

Cropped Image Details:

										<form id="coords" class="coords form-inline" onsubmit="return false;" action="javascript:;">

													X1

													<input type="text" id="x1" name="x1" class="form-control btn-sm"/>

													Y1

													<input type="text" id="y1" name="y1" class="form-control btn-sm"/>

													X2

													<input type="text" id="x2" name="x2" class="form-control btn-sm"/>

													Y2

													<input type="text" id="y2" name="y2" class="form-control btn-sm"/>

													Width

													<input type="text" id="w" name="w" class="form-control btn-sm"/>

													Height

													<input type="text" id="h" name="h" class="form-control btn-sm"/>

										</form>

An example implementing a preview pane.

									 Obviously the most visual demo, the preview pane is accomplished entirely outside of Jcrop with a simple jQuery-flavored callback. This type of interface could be useful for creating a thumbnail or avatar. The onChange event handler is used to update the view in the preview pane.

Experimental shader active.

											 Jcrop now includes a shading mode that facilitates building better transparent Jcrop instances. The experimental shader is less robust than Jcrop's default shading method and should only be used if you require this functionality.

Animation/Transitions.

											 Demonstration of animateTo API method and transitions for bgColor and bgOpacity options. Color fading requires inclusion of John Resig's jQuery
											Color Animations
											plugin. If it is not included, colors will not fade.

													<input type="checkbox" id="fadetog"/> Enable fading (bgFade: true)

													<input type="checkbox" id="shadetog"/> Use experimental shader (shade: true)

Realtime API

										<button id="setSelect" class="btn default">setSelect</button>
										<button id="animateTo" class="btn default">animateTo</button>
										<button id="release" class="btn default">Release</button>
										<button id="disable" class="btn default">Disable</button>

										<button id="enable" class="btn default" style="display:none;">Re-Enable</button>
										<button id="unhook" class="btn default">Destroy!</button>
										<button id="rehook" class="btn default" style="display:none;">Attach Jcrop</button>
										<fieldset class="optdual requiresjcrop">

Option Toggles

												<input type="checkbox" id="ar_lock"/>Aspect ratio
												<input type="checkbox" id="size_lock"/>minSize/maxSize setting
												<input type="checkbox" id="can_click"/>Allow new selections
												<input type="checkbox" id="can_move"/>Selection can be moved
												<input type="checkbox" id="can_size"/>Resizable selection

										</fieldset>
										<fieldset class="requiresjcrop">

Change Image

												<button class="btn default" id="img2">Pool</button>
												<button class="btn default active" id="img1">Sago</button>
												<button class="btn default" id="img3">Sago w/ outerImage</button>

										</fieldset>

Manipulate classes

											<button id="radio1" data-setclass="jcrop-light" class="btn active">jcrop-light</button>
											<button id="radio2" data-setclass="jcrop-dark" class="btn">jcrop-dark</button>
											<button id="radio3" data-setclass="jcrop-normal" class="btn">normal</button>

											Example styling tricks. Click the buttons above to change the appearance of Jcrop in real-time.

									This is an example of attaching Jcrop to a target that is not an image. You are now cropping a paragraph tag.

Attaching Jcrop to a non-image element.

									 This is mostly useful to implement other interfaces, such as canvas or over an arbitrary div.

An example server-side crop script.

											 Hidden form values are set when a selection is made. If you press the Crop Image
											button, the form will be submitted and a 150x150 thumbnail will be dumped to the browser. Try it!

										<form action="../../assets/global/plugins/jcrop/crop-demo.php" target="_blank" method="post" id="demo8_form">
											<input type="hidden" id="crop_x" name="x"/>
											<input type="hidden" id="crop_y" name="y"/>
											<input type="hidden" id="crop_w" name="w"/>
											<input type="hidden" id="crop_h" name="h"/>
											<input type="submit" value="Crop Image" class="btn btn-large green"/>
										</form>

About

					 Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam dolore.

Subscribe Email

					<form action="javascript:;">

							<input type="text" placeholder="mail@email.com" class="form-control">

							<button class="btn" type="submit">Submit</button>

					</form>

Follow Us On

Contacts

				<address class="margin-bottom-40">
				Phone: 800 123 3456

				 Email: info@metronic.com
				</address>

		 2014 © Metronic. All Rights Reserved.


text:
import os
import platform
import sys

if platform.system() == "Windows":
    intel_library_path = os.path.join(sys.prefix, "Library", "bin")
    if sys.version_info.major == 3 and sys.version_info.minor < 8:
        os.environ["PATH"] = intel_library_path + os.path.sep + os.environ["PATH"]
    else:
        os.add_dll_directory(intel_library_path)


text:
\subsection*{Navneordsanalyse (Martin)}
\addcontentsline{toc}{subsection}{Navneordsanalyse}
Udfra use casene har vi beskrevet vores problemstillinger:\\
En rekvirent logger ind og sender en rekvisition og evt. et kontrolskema. Disse
indeholder data om en patient, og om hvilken slags undersøgelse, der ønskes,
samt prioritet og ønsket dato af undersøgelsen. Brugeren kan annullere en
rekvisition.\\
En visitator logger ind og henter en liste over rekvisitioner. Visitatoren
vælger en rekvisition og gennemgår de relevante info. Alt efter om rekvisitionen
er i orden godkender eller afviser han den.\\
En sekretær logger ind og henter en liste over rekvisitioner, der skal bookes.
Sekretæren booker tider ved det nødvendige udstyr til hver undersøgelse og
sender notifikationer til alle interessenter.\\
En administrator logger ind og kan enten ændre rettigheder for en bruger,
oprette en bruger eller slette en bruger."\\
Herfra finder vi de relevante navneord, dem der umiddelbart ikke bare skal være
en attribut, og opstiller en liste, med de relevante udsagnsord efter. Navneord
bliver ofte til klasser i et program, og udsagnsord bliver ofte til metoder
øvrige navneord/tillægsord bliver ofte til attributter. Vi har markeret
udsagnsord der forventes at blive til metoder med kursiv.
\textbf{Rekvirent} - \emph{send rekvisition} og evt. et kontrolskema,
\emph{annuller rekvisition}\\
\textbf{Patient} - tilknyttet rekvisition og patient data\\
\textbf{Rekvisition/Kontrolskema} - indeholder data om patient, hvilken slags
undersøgelse ønskes, prioritet og ønsket dato af undersøgelse\\
\textbf{Visitator} - \emph{log ind}, \emph{se liste over rekvisitioner},
\emph{vælg rekvisition}, \emph{godkend rekvisition}, afvis
\textbf{Rekvisition} - sendes af rekvirent, modtages af visitator og sekretær,
visiteres, stemples godkendt eller afvist\\
\textbf{Sekretær} - \emph{log ind}, \emph{se liste} over rekvisitioner, marker
rekvisition som læst, \emph{book} tider/udstyr, \emph{send notifikationer} til
interessenter\\
\textbf{Undersøgelse} - tidspunkt, type\\
\textbf{Notifikation} - sendes til interessenter af sekretær\\
\textbf{Interessenter} - modtager notifikation\\
\textbf{Administrator} - \emph{log ind}, \emph{ændre rettigheder for bruger},
\emph{opret bruger}, \emph{slet bruger}\\
\textbf{Bruger} - liste af rettigheder
\FloatBarrier
\begin{figure}[h]
\subsection*{CRC-kort (Rúni, Morten)}
\addcontentsline{toc}{subsection}{CRC-kort}
\centering
\makebox[\textwidth]{\includegraphics[width=\textwidth]{CRC}}
\caption{\emph{CRC diagram}: Viser de overordnede relationer projektet
indeholder. \label{crc_kort}}
\end{figure}
\FloatBarrier
\subsection*{Domænemodel (Rúni, Magnus)}
\addcontentsline{toc}{subsection}{Domænemodel}
Vi har løbende opdateret vores domænemodel (se original model i
\hyperref[Bilag17]{bilag 17}) til at afspejle den del af rekvisitionssystemet vi
vil arbejde med (\hyperref[domainmodel]{figur \ref*{domainmodel}}).
Rekvirenten, visitatoren og sekretæren er brugere på vores system, hvor de har
mulighed for at udføre deres opgaver.
\FloatBarrier
\begin{figure}[h]
\centering
\makebox[\textwidth]{\includegraphics[width=\textwidth]{Domainmodel}}
\caption{\emph{Domænemodel}: \label{domainmodel}}
\end{figure}
\FloatBarrier
\begin{figure}[h]
\subsection*{System sekvens diagram (Morten)}
\addcontentsline{toc}{subsection}{System sekvens diagram}
\centering
\makebox[\textwidth]{\includegraphics[width=\textwidth]{SSD1}}
\caption{\emph{SSD} over use casen "bestil undersøgelse". Når brugeren har
udfyldt rekvisitionen, kan der til nogle undersøgelsestyper være et tilknyttet
et kontrolskema som også skal udfyldes. \label{ssd_1}}
\end{figure}
Yderligere et SSD over use casen visiter rekvisition ses i
\hyperref[Bilag18]{bilag 18}.
\FloatBarrier
\subsection*{Database Analyse (Christian, Magnus)}
\addcontentsline{toc}{subsection}{Database Analyse}
Vi startede med at analysere hele arbejdsgangen, og de data, der bruges til at
holde styr på rekvisition/undersøgelser som en skitse af et E/R diagram (se
\hyperref[Bilag19]{bilag 19}). Det gav os et meget stort E/R diagram, der ikke
ville kunne implementeres på en rimelig tid.\\
Efter vores møde og interview med interessenterne skar vi vores arbejdsområde
ned til selve rekvisitionen af en billeddannende undersøgelse.
\FloatBarrier
\begin{figure}[h]
\centering
\makebox[\textwidth]{\includegraphics[width=\textwidth]{E-R_Diagram}}
\caption{\emph{E/R diagram}. Beskriver sammenhæng mellem entiteterne. Vi har en
central relation - selve rekvisitionen, tegnet som en rhombe. Rekvirent, Patient
og Undersøgelse er alle obligatoriske i relationen, hvorimod en visitator
tilknyttes senere. Rekvirenten modelleres senere som en tabel
(sygeplejerske/læge distinktionen udgår). Stamafdelingen reduceres til en
attribut. \label{er_diagram}}
\end{figure}
\FloatBarrier


text:
.class Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;
.super Lcom/tencent/qrom/support/v4/view/PagerAdapter;
.source "QromResolverActivity.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/tencent/qrom/app/QromResolverActivity;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "QromPagerAdapter"
.end annotation

# instance fields
.field private mIntent:Landroid/content/Intent;

.field private mListInfo:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;",
            ">;"
        }
    .end annotation
.end field

.field private pagerCount:I

.field private pagers:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/tencent/qrom/widget/QromGridView;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/tencent/qrom/app/QromResolverActivity;

# direct methods
.method public constructor <init>(Lcom/tencent/qrom/app/QromResolverActivity;Landroid/content/Context;ILjava/util/List;Landroid/content/Intent;)V
    .locals 5
    .param p2, "context"    # Landroid/content/Context;
    .param p3, "pagerCount"    # I
    .param p5, "intent"    # Landroid/content/Intent;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "I",
            "Ljava/util/List",
            "<",
            "Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;",
            ">;",
            "Landroid/content/Intent;",
            ")V"
        }
    .end annotation

    .prologue
    .local p4, "listInfo":Ljava/util/List;, "Ljava/util/List<Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;>;"
    const/4 v4, 0x0

    .line 437
    iput-object p1, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    invoke-direct {p0}, Lcom/tencent/qrom/support/v4/view/PagerAdapter;-><init>()V

    .line 438
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iput-object v2, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagers:Ljava/util/List;

    .line 439
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    if-ge v1, p3, :cond_1

    .line 440
    const v2, 0x7a03001a

    const/4 v3, 0x0

    invoke-static {p2, v2, v3}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/tencent/qrom/widget/QromGridView;

    .line 441
    .local v0, "gridView":Lcom/tencent/qrom/widget/QromGridView;
    invoke-interface {p4}, Ljava/util/List;->size()I

    move-result v2

    const/4 v3, 0x2

    if-le v2, v3, :cond_0

    const/4 v2, 0x3

    :goto_1
    invoke-virtual {v0, v2}, Lcom/tencent/qrom/widget/QromGridView;->setNumColumns(I)V

    .line 442
    invoke-virtual {v0, v4}, Lcom/tencent/qrom/widget/QromGridView;->setIsNeedBounce(Z)V

    .line 443
    new-instance v2, Lcom/tencent/qrom/app/QromResolverActivity$QromGridAdapter;

    invoke-direct {v2, p1, v1, p4, p5}, Lcom/tencent/qrom/app/QromResolverActivity$QromGridAdapter;-><init>(Lcom/tencent/qrom/app/QromResolverActivity;ILjava/util/List;Landroid/content/Intent;)V

    invoke-virtual {v0, v2}, Lcom/tencent/qrom/widget/QromGridView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 444
    invoke-virtual {v0, v4}, Lcom/tencent/qrom/widget/QromGridView;->setVerticalScrollBarEnabled(Z)V

    .line 445
    iget-object v2, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagers:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 439
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 441
    :cond_0
    invoke-interface {p4}, Ljava/util/List;->size()I

    move-result v2

    goto :goto_1

    .line 447
    .end local v0    # "gridView":Lcom/tencent/qrom/widget/QromGridView;
    :cond_1
    iput p3, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagerCount:I

    .line 448
    iput-object p5, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->mIntent:Landroid/content/Intent;

    .line 449
    iput-object p4, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->mListInfo:Ljava/util/List;

    .line 450
    return-void
.end method

.method static synthetic access$200(Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;)I
    .locals 1
    .param p0, "x0"    # Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;

    .prologue
    .line 430
    iget v0, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagerCount:I

    return v0
.end method

.method static synthetic access$400(Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;)Ljava/util/List;
    .locals 1
    .param p0, "x0"    # Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;

    .prologue
    .line 430
    iget-object v0, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->mListInfo:Ljava/util/List;

    return-object v0
.end method

# virtual methods
.method public destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
    .locals 0
    .param p1, "container"    # Landroid/view/ViewGroup;
    .param p2, "position"    # I
    .param p3, "object"    # Ljava/lang/Object;

    .prologue
    .line 464
    check-cast p1, Lcom/tencent/qrom/support/v4/view/ViewPager;

    .end local p1    # "container":Landroid/view/ViewGroup;
    check-cast p3, Landroid/view/View;

    .end local p3    # "object":Ljava/lang/Object;
    invoke-virtual {p1, p3}, Lcom/tencent/qrom/support/v4/view/ViewPager;->removeView(Landroid/view/View;)V

    .line 465
    return-void
.end method

.method public getCount()I
    .locals 1

    .prologue
    .line 454
    iget v0, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagerCount:I

    return v0
.end method

.method public instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
    .locals 2
    .param p1, "container"    # Landroid/view/ViewGroup;
    .param p2, "position"    # I

    .prologue
    .line 469
    iget-object v1, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->pagers:Ljava/util/List;

    invoke-interface {v1, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/tencent/qrom/widget/QromGridView;

    .line 470
    .local v0, "view":Lcom/tencent/qrom/widget/QromGridView;
    new-instance v1, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter$1;

    invoke-direct {v1, p0}, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter$1;-><init>(Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;)V

    invoke-virtual {v0, v1}, Lcom/tencent/qrom/widget/QromGridView;->setOnItemClickListener(Lcom/tencent/qrom/widget/AdapterView$OnItemClickListener;)V

    .line 499
    invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    .line 500
    return-object v0
.end method

.method public intentForPosition(I)Landroid/content/Intent;
    .locals 6
    .param p1, "position"    # I

    .prologue
    .line 511
    iget-object v3, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->mList:Ljava/util/List;
    invoke-static {v3}, Lcom/tencent/qrom/app/QromResolverActivity;->access$800(Lcom/tencent/qrom/app/QromResolverActivity;)Ljava/util/List;

    move-result-object v3

    if-nez v3, :cond_0

    .line 512
    const/4 v2, 0x0

    .line 524
    :goto_0
    return-object v2

    .line 515
    :cond_0
    iget-object v3, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->mList:Ljava/util/List;
    invoke-static {v3}, Lcom/tencent/qrom/app/QromResolverActivity;->access$800(Lcom/tencent/qrom/app/QromResolverActivity;)Ljava/util/List;

    move-result-object v3

    iget-object v4, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->whichPage:I
    invoke-static {v4}, Lcom/tencent/qrom/app/QromResolverActivity;->access$300(Lcom/tencent/qrom/app/QromResolverActivity;)I

    move-result v4

    mul-int/lit8 v4, v4, 0x6

    add-int/2addr v4, p1

    invoke-interface {v3, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;

    .line 517
    .local v1, "dri":Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;
    new-instance v2, Landroid/content/Intent;

    iget-object v3, v1, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;->origIntent:Landroid/content/Intent;

    if-eqz v3, :cond_1

    iget-object v3, v1, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;->origIntent:Landroid/content/Intent;

    :goto_1
    invoke-direct {v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Intent;)V

    .line 519
    .local v2, "intent":Landroid/content/Intent;
    const/high16 v3, 0x3000000

    invoke-virtual {v2, v3}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 521
    iget-object v3, v1, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;->ri:Landroid/content/pm/ResolveInfo;

    iget-object v0, v3, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 522
    .local v0, "ai":Landroid/content/pm/ActivityInfo;
    new-instance v3, Landroid/content/ComponentName;

    iget-object v4, v0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget-object v4, v4, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    iget-object v5, v0, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String;

    invoke-direct {v3, v4, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v2, v3}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    goto :goto_0

    .line 517
    .end local v0    # "ai":Landroid/content/pm/ActivityInfo;
    .end local v2    # "intent":Landroid/content/Intent;
    :cond_1
    iget-object v3, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->mIntent:Landroid/content/Intent;

    goto :goto_1
.end method

.method public isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
    .locals 1
    .param p1, "view"    # Landroid/view/View;
    .param p2, "object"    # Ljava/lang/Object;

    .prologue
    .line 459
    if-ne p1, p2, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public resolveInfoForPosition(I)Landroid/content/pm/ResolveInfo;
    .locals 2
    .param p1, "position"    # I

    .prologue
    .line 504
    iget-object v0, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->mList:Ljava/util/List;
    invoke-static {v0}, Lcom/tencent/qrom/app/QromResolverActivity;->access$800(Lcom/tencent/qrom/app/QromResolverActivity;)Ljava/util/List;

    move-result-object v0

    if-nez v0, :cond_0

    .line 505
    const/4 v0, 0x0

    .line 507
    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->mList:Ljava/util/List;
    invoke-static {v0}, Lcom/tencent/qrom/app/QromResolverActivity;->access$800(Lcom/tencent/qrom/app/QromResolverActivity;)Ljava/util/List;

    move-result-object v0

    iget-object v1, p0, Lcom/tencent/qrom/app/QromResolverActivity$QromPagerAdapter;->this$0:Lcom/tencent/qrom/app/QromResolverActivity;

    # getter for: Lcom/tencent/qrom/app/QromResolverActivity;->whichPage:I
    invoke-static {v1}, Lcom/tencent/qrom/app/QromResolverActivity;->access$300(Lcom/tencent/qrom/app/QromResolverActivity;)I

    move-result v1

    mul-int/lit8 v1, v1, 0x6

    add-int/2addr v1, p1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;

    iget-object v0, v0, Lcom/tencent/qrom/app/QromResolverActivity$DisplayResolveInfo;->ri:Landroid/content/pm/ResolveInfo;

    goto :goto_0
.end method


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@android:color/holo_blue_bright"
    android:orientation="vertical">

    <TextView
        android:id="@+id/text"
        android:layout_width="80dp"
        android:layout_height="wrap_content" />

</LinearLayout>


text:
(function() {
  var AbstractParser;

  module.exports = AbstractParser = (function() {
    function AbstractParser() {}

    AbstractParser.prototype.weigth = 0;

    AbstractParser.prototype.ignores = function(token) {
      return false;
    };

    AbstractParser.prototype.registers = function(mime, extension) {
      return false;
    };

    return AbstractParser;

  })();

}).call(this);


text:
[D-Bus](http://dbus.freedesktop.org) is an interprocess communication
mechanism for Linux.
Ruby D-Bus is a pure Ruby library for writing clients and services for D-Bus.

[![Gem Version][GV img]][Gem Version]
[![Build Status][BS img]][Build Status]
[![Dependency Status][DS img]][Dependency Status]
[![Code Climate][CC img]][Code Climate]
[![Coverage Status][CS img]][Coverage Status]

[Gem Version]: https://rubygems.org/gems/ruby-dbus
[Build Status]: https://travis-ci.org/mvidner/ruby-dbus
[travis pull requests]: https://travis-ci.org/mvidner/ruby-dbus/pull_requests
[Dependency Status]: https://gemnasium.com/mvidner/ruby-dbus
[Code Climate]: https://codeclimate.com/github/mvidner/ruby-dbus
[Coverage Status]: https://coveralls.io/r/mvidner/ruby-dbus

[GV img]: https://badge.fury.io/rb/ruby-dbus.png
[BS img]: https://travis-ci.org/mvidner/ruby-dbus.png
[DS img]: https://gemnasium.com/mvidner/ruby-dbus.png
[CC img]: https://codeclimate.com/github/mvidner/ruby-dbus.png
[CS img]: https://coveralls.io/repos/mvidner/ruby-dbus/badge.png?branch=master

## Example

Check whether the system is on battery power
via [UPower](http://upower.freedesktop.org/docs/UPower.html#UPower:OnBattery)

    require "dbus"
    sysbus = DBus.system_bus
    upower_service   = sysbus["org.freedesktop.UPower"]
    upower_object    = upower_service.object "/org/freedesktop/UPower"
    upower_object.introspect
    upower_interface = upower_object["org.freedesktop.UPower"]
    on_battery       = upower_interface["OnBattery"]
    if on_battery
      puts "The computer IS on battery power."
    else
      puts "The computer IS NOT on battery power."
    end

## Requirements

- Ruby 1.9.3 or 2.0

## Installation

- `gem install ruby-dbus`

## Features

Ruby D-Bus currently supports the following features:

 * Connecting to local buses.
 * Accessing remote services, objects and interfaces.
 * Invoking methods on remote objects synchronously and asynchronously.
 * Catch signals on remote objects and handle them via callbacks.
 * Remote object introspection.
 * Walking object trees.
 * Creating services and registering them on the bus.
 * Exporting objects with interfaces on a bus for remote use.
 * Rubyish D-Bus object and interface syntax support that automatically
   allows for introspection.
 * Emitting signals on exported objects.

## Usage

 See some of the examples in the examples/ subdirectory of the tarball.
 Also, check out the included tutorial (in Markdown format) in doc/Tutorial.md
 or view it online on
 <https://github.com/mvidner/ruby-dbus/blob/master/doc/Tutorial.md> .

## License

 Ruby D-Bus is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published by the
 Free Software Foundation; either version 2.1 of the License, or (at
 your option) any later version.


text:
package com.jgoodies.looks.windows;

import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSplitPaneDivider;

/**
 * The JGoodies Windows L&F implementation of {@code SplitPaneUI}.
 * Uses a special divider that paints modified one-touch buttons.
 *
 * @author Karsten Lentzsch
 * @version $Revision: 1.9 $
 *
 * @see com.jgoodies.looks.windows.WindowsSplitPaneDivider
 */
public final class WindowsSplitPaneUI extends com.sun.java.swing.plaf.windows.WindowsSplitPaneUI {

	/**
	 * Creates and returns a {@code WindowsSplitPaneUI} instance.
	 */
	public static ComponentUI createUI(JComponent x) {
		return new WindowsSplitPaneUI();
	}

	/**
	 * Creates and returns the modified default divider.
	 */
	@Override
    public BasicSplitPaneDivider createDefaultDivider() {
		return new WindowsSplitPaneDivider(this);
	}

}