text:
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: Apache License, Version 2.0
 * See the LICENSE file in the root directory or visit http://www.apache.org/licenses/LICENSE-2.0
 */
package org.hibernate.sqm.query.expression;

import org.hibernate.sqm.SemanticQueryWalker;
import org.hibernate.sqm.domain.BasicType;
import org.hibernate.sqm.domain.Type;
import org.hibernate.sqm.query.Helper;

/**
 * @author Steve Ebersole
 */
public class ConcatExpression implements Expression {
	private final Expression lhsOperand;
	private final Expression rhsOperand;
	private final BasicType resultType;

	public ConcatExpression(Expression lhsOperand, Expression rhsOperand) {
		this( lhsOperand, rhsOperand, (BasicType) lhsOperand.getExpressionType() );
	}

	public ConcatExpression(Expression lhsOperand, Expression rhsOperand, BasicType resultType) {
		this.lhsOperand = lhsOperand;
		this.rhsOperand = rhsOperand;
		this.resultType = resultType;
	}

	public Expression getLeftHandOperand() {
		return lhsOperand;
	}

	public Expression getRightHandOperand() {
		return rhsOperand;
	}

	@Override
	public BasicType getExpressionType() {
		return resultType;
	}

	@Override
	public Type getInferableType() {
		return Helper.firstNonNull( lhsOperand.getInferableType(), rhsOperand.getInferableType() ) ;
	}

	@Override
	public <T> T accept(SemanticQueryWalker<T> walker) {
		return walker.visitConcatExpression( this );
	}
}


text:
import unittest

import lockserver_daemon as lockserver

class TheTestCase(unittest.TestCase):

  def setUp(self):
    # Reset the lockserver's global variables between each test.
    lockserver.init_globals()

  def testUserAndNodeLockContention_one(self):
    # Start three sessions.
    sess = []
    sess.append(lockserver.do_start_session())
    sess.append(lockserver.do_start_session())
    sess.append(lockserver.do_start_session())

    # First session requests lock on the user 'bob'.
    locks = {'user':['bob']}
    lockserver.do_acquire_locks(sess[0], locks)

    # First session requests locks on the nodes '123' and '456'.
    locks = {'node':['123','456']}
    lockserver.do_acquire_locks(sess[0], locks)

    # Second session requests lock on the node '123'.
    locks = {'node':['123']}
    lockserver.do_acquire_locks(sess[1], locks)

    # Third session requests lock on the user 'bob'.
    locks = {'user':['bob']}
    lockserver.do_acquire_locks(sess[2], locks)

    expected_heldlockdict = {
      'user': {'bob': {'locked_by_session': sess[0],
                       'queue': [sess[2]]}},
      'node': {'123': {'locked_by_session': sess[0],
                       'queue': [sess[1]]},
               '456': {'locked_by_session': sess[0],
                       'queue': []}}}
    expected_sessiondict = {
      sess[0]: {'heldlocks': {'user': ['bob'], 'node': ['123','456']},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True},
      sess[1]: {'heldlocks': {'user': [], 'node': []},
                'neededlocks': {'user': [], 'node': ['123']},
                'acquirelocksproceedeventset': False},
      sess[2]: {'heldlocks': {'user': [], 'node': []},
                'neededlocks': {'user': ['bob'], 'node': []},
                'acquirelocksproceedeventset': False}}

    status = lockserver.do_get_status()
    self.assertEqual(expected_heldlockdict, status["heldlockdict"])
    self.assertEqual(expected_sessiondict, status["sessiondict"])

    # First session releases user lock on 'bob'.
    # Note: they still hold the node locks on '123' and '456'
    locks = {'user':['bob']}
    lockserver.do_release_locks(sess[0], locks)

    expected_heldlockdict = {
      'user': {'bob': {'locked_by_session': sess[2],
                       'queue': []}},
      'node': {'123': {'locked_by_session': sess[0],
                       'queue': [sess[1]]},
               '456': {'locked_by_session': sess[0],
                       'queue': []}}}
    expected_sessiondict = {
      sess[0]: {'heldlocks': {'user': [], 'node': ['123','456']},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True},
      sess[1]: {'heldlocks': {'user': [], 'node': []},
                'neededlocks': {'user': [], 'node': ['123']},
                'acquirelocksproceedeventset': False},
      sess[2]: {'heldlocks': {'user': ['bob'], 'node': []},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True}}

    status = lockserver.do_get_status()
    self.assertEqual(expected_heldlockdict, status["heldlockdict"])
    self.assertEqual(expected_sessiondict, status["sessiondict"])

    # First session releases node lock on '123'.
    # Note: they still hold the node lock on '456'
    locks = {'node':['123']}
    lockserver.do_release_locks(sess[0], locks)

    expected_heldlockdict = {
      'user': {'bob': {'locked_by_session': sess[2],
                       'queue': []}},
      'node': {'123': {'locked_by_session': sess[1],
                       'queue': []},
               '456': {'locked_by_session': sess[0],
                       'queue': []}}}
    expected_sessiondict = {
      sess[0]: {'heldlocks': {'user': [], 'node': ['456']},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True},
      sess[1]: {'heldlocks': {'user': [], 'node': ['123']},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True},
      sess[2]: {'heldlocks': {'user': ['bob'], 'node': []},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True}}

    status = lockserver.do_get_status()
    self.assertEqual(expected_heldlockdict, status["heldlockdict"])
    self.assertEqual(expected_sessiondict, status["sessiondict"])

    # First session releases node lock on '456' and then requests locks on
    # user 'bob' and nodes '123' and '456' again. It can't request the node
    # locks, however, until it gets the node lock (in xmlrpc usage, the
    # user lock request would have blocked). So, we have the session that is
    # holding the lock on user 'bob' release that lock before the first session
    # makes the node lock requests.
    locks = {'node':['456']}
    lockserver.do_release_locks(sess[0], locks)
    locks = {'user':['bob']}
    lockserver.do_acquire_locks(sess[0], locks)
    locks = {'user':['bob']}
    lockserver.do_release_locks(sess[2], locks)
    locks = {'node':['123', '456']}
    lockserver.do_acquire_locks(sess[0], locks)

    expected_heldlockdict = {
      'user': {'bob': {'locked_by_session': sess[0],
                       'queue': []}},
      'node': {'123': {'locked_by_session': sess[1],
                       'queue': [sess[0]]},
               '456': {'locked_by_session': sess[0],
                       'queue': []}}}
    expected_sessiondict = {
      sess[0]: {'heldlocks': {'user': ['bob'], 'node': ['456']},
                'neededlocks': {'user': [], 'node': ['123']},
                'acquirelocksproceedeventset': False},
      sess[1]: {'heldlocks': {'user': [], 'node': ['123']},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True},
      sess[2]: {'heldlocks': {'user': [], 'node': []},
                'neededlocks': {'user': [], 'node': []},
                'acquirelocksproceedeventset': True}}

    status = lockserver.do_get_status()
    self.assertEqual(expected_heldlockdict, status["heldlockdict"])
    self.assertEqual(expected_sessiondict, status["sessiondict"])

redpajama_set_name: RedPajamaGithub


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

<title>Targets (Bouncy Castle Library 1.54 API Specification)</title>
<meta name="date" content="2015-12-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.bouncycastle.asn1.x509

Class Targets

java.lang.Object

org.bouncycastle.asn1.ASN1Object

org.bouncycastle.asn1.x509.Targets

All Implemented Interfaces:

ASN1Encodable, Encodable

public class Targets
extends ASN1Object

Targets structure used in target information extension for attribute
 certificates from RFC 3281.

            Targets ::= SEQUENCE OF Target

            Target  ::= CHOICE {
              targetName          [0] GeneralName,
              targetGroup         [1] GeneralName,
              targetCert          [2] TargetCert
            }

            TargetCert  ::= SEQUENCE {
              targetCertificate    IssuerSerial,
              targetName           GeneralName OPTIONAL,
              certDigestInfo       ObjectDigestInfo OPTIONAL
            }

See Also:

Target,
TargetInformation

Constructor Summary

Constructors

Constructor and Description

Targets(Target[] targets)

Constructor from given targets.

Method Summary

Methods

Modifier and Type
Method and Description

static Targets
getInstance(java.lang.Object obj)

Creates an instance of a Targets from the given object.

Target[]
getTargets()

Returns the targets in a Vector.

ASN1Primitive
toASN1Primitive()

Produce an object suitable for an ASN1OutputStream.

Methods inherited from class org.bouncycastle.asn1.ASN1Object

equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Targets

public Targets(Target[] targets)

Constructor from given targets.

 The vector is copied.

Parameters:

targets - A Vector of Targets.

Throws:

java.lang.IllegalArgumentException - if the vector contains not only Targets.

See Also:

Target

Method Detail

getInstance

public static Targets getInstance(java.lang.Object obj)

Creates an instance of a Targets from the given object.

 obj can be a Targets or a ASN1Sequence

Parameters:

obj - The object.

Returns:

A Targets instance.

Throws:

java.lang.IllegalArgumentException - if the given object cannot be
             interpreted as Target.

getTargets

public Target[] getTargets()

Returns the targets in a Vector.

 The vector is cloned before it is returned.

Returns:

Returns the targets.

toASN1Primitive

public ASN1Primitive toASN1Primitive()

Produce an object suitable for an ASN1OutputStream.

 Returns:

            Targets ::= SEQUENCE OF Target

Specified by:

toASN1Primitive in interface ASN1Encodable

Specified by:

toASN1Primitive in class ASN1Object

Returns:

a ASN1Primitive

Overview

Package

Class

Tree

Deprecated

Index

Help

Bouncy Castle Cryptography Library 1.54

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
.class final Landroid/net/wifi/WifiConnectionStatistics$1;
.super Ljava/lang/Object;
.source "WifiConnectionStatistics.java"

# interfaces
.implements Landroid/os/Parcelable$Creator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/net/wifi/WifiConnectionStatistics;
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/os/Parcelable$Creator",
        "<",
        "Landroid/net/wifi/WifiConnectionStatistics;",
        ">;"
    }
.end annotation

# direct methods
.method constructor <init>()V
    .registers 1

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

    return-void
.end method

# virtual methods
.method public createFromParcel(Landroid/os/Parcel;)Landroid/net/wifi/WifiConnectionStatistics;
    .registers 10
    .param p1, "in"    # Landroid/os/Parcel;

    .prologue
    .line 135
    new-instance v6, Landroid/net/wifi/WifiConnectionStatistics;

    invoke-direct {v6}, Landroid/net/wifi/WifiConnectionStatistics;-><init>()V

    .line 136
    .local v6, "stats":Landroid/net/wifi/WifiConnectionStatistics;
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v7

    iput v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->num24GhzConnected:I

    .line 137
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v7

    iput v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->num5GhzConnected:I

    .line 138
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v7

    iput v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->numAutoJoinAttempt:I

    .line 139
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v7

    iput v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->numAutoRoamAttempt:I

    .line 140
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v7

    iput v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->numWifiManagerJoinAttempt:I

    .line 141
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .local v1, "n":I
    move v2, v1

    .line 142
    .end local v1    # "n":I
    .local v2, "n":I
    :goto_28
    add-int/lit8 v1, v2, -0x1

    .end local v2    # "n":I
    .restart local v1    # "n":I
    if-lez v2, :cond_44

    .line 143
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 144
    .local v0, "Key":Ljava/lang/String;
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 145
    .local v3, "numConnection":I
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v4

    .line 147
    .local v4, "numUsage":I
    new-instance v5, Landroid/net/wifi/WifiNetworkConnectionStatistics;

    invoke-direct {v5, v3, v4}, Landroid/net/wifi/WifiNetworkConnectionStatistics;-><init>(II)V

    .line 148
    .local v5, "st":Landroid/net/wifi/WifiNetworkConnectionStatistics;
    iget-object v7, v6, Landroid/net/wifi/WifiConnectionStatistics;->untrustedNetworkHistory:Ljava/util/HashMap;

    invoke-virtual {v7, v0, v5}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    move v2, v1

    .end local v1    # "n":I
    .restart local v2    # "n":I
    goto :goto_28

    .line 150
    .end local v0    # "Key":Ljava/lang/String;
    .end local v2    # "n":I
    .end local v3    # "numConnection":I
    .end local v4    # "numUsage":I
    .end local v5    # "st":Landroid/net/wifi/WifiNetworkConnectionStatistics;
    .restart local v1    # "n":I
    :cond_44
    return-object v6
.end method

.method public bridge synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
    .registers 3
    .param p1, "in"    # Landroid/os/Parcel;

    .prologue
    .line 134
    invoke-virtual {p0, p1}, Landroid/net/wifi/WifiConnectionStatistics$1;->createFromParcel(Landroid/os/Parcel;)Landroid/net/wifi/WifiConnectionStatistics;

    move-result-object v0

    return-object v0
.end method

.method public newArray(I)[Landroid/net/wifi/WifiConnectionStatistics;
    .registers 3
    .param p1, "size"    # I

    .prologue
    .line 154
    new-array v0, p1, [Landroid/net/wifi/WifiConnectionStatistics;

    return-object v0
.end method

.method public bridge synthetic newArray(I)[Ljava/lang/Object;
    .registers 3
    .param p1, "size"    # I

    .prologue
    .line 153
    invoke-virtual {p0, p1}, Landroid/net/wifi/WifiConnectionStatistics$1;->newArray(I)[Landroid/net/wifi/WifiConnectionStatistics;

    move-result-object v0

    return-object v0
.end method


text:
/**
 * @fileoverview Prevent missing parentheses around multilines JSX
 * @author Yannick Croissant
 */
'use strict';

// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------

var rule = require('../../../lib/rules/jsx-wrap-multilines');
var RuleTester = require('eslint').RuleTester;

var parserOptions = {
  ecmaVersion: 6,
  ecmaFeatures: {
    jsx: true
  }
};

// ------------------------------------------------------------------------------
// Code Snippets
// ------------------------------------------------------------------------------

var RETURN_SINGLE_LINE = '\
  var Hello = React.createClass({\
    render: function() {\
      return
Hello {this.props.name}
;\
    }\
  });';

var RETURN_PAREN = '\
  var Hello = React.createClass({\
    render: function() {\
      return (
\n\

Hello {this.props.name}
\n\

);\
    }\
  });';

var RETURN_NO_PAREN = '\
  var Hello = React.createClass({\
    render: function() {\
      return
\n\

Hello {this.props.name}
\n\

;\
    }\
  });';

var DECLARATION_SINGLE_LINE = 'var hello =
Hello
;';

var DECLARATION_PAREN = '\
  var hello = (
\n\

Hello
\n\

);';

var DECLARATION_NO_PAREN = '\
  var hello =
\n\

Hello
\n\

;';

var ASSIGNMENT_SINGLE_LINE = 'var hello; hello =
Hello
;';

var ASSIGNMENT_PAREN = '\
  var hello;\
  hello = (
\n\

Hello
\n\

);';

var ASSIGNMENT_NO_PAREN = '\
  var hello;\
  hello =
\n\

Hello
\n\

;';

// ------------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------------

var ruleTester = new RuleTester();
ruleTester.run('jsx-wrap-multilines', rule, {

  valid: [
    {
      code: RETURN_SINGLE_LINE,
      parserOptions: parserOptions
    }, {
      code: RETURN_PAREN,
      parserOptions: parserOptions
    }, {
      code: RETURN_NO_PAREN,
      options: [{return: false}],
      parserOptions: parserOptions
    }, {
      code: DECLARATION_SINGLE_LINE,
      parserOptions: parserOptions
    }, {
      code: DECLARATION_PAREN,
      parserOptions: parserOptions
    }, {
      code: DECLARATION_NO_PAREN,
      options: [{declaration: false}],
      parserOptions: parserOptions
    }, {
      code: ASSIGNMENT_SINGLE_LINE,
      options: [{declaration: false}],
      parserOptions: parserOptions
    }, {
      code: ASSIGNMENT_PAREN,
      parserOptions: parserOptions
    }, {
      code: ASSIGNMENT_NO_PAREN,
      options: [{assignment: false}],
      parserOptions: parserOptions
    }
  ],

  invalid: [
    {
      code: RETURN_NO_PAREN,
      output: RETURN_PAREN,
      parserOptions: parserOptions,
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }, {
      code: RETURN_NO_PAREN,
      output: RETURN_PAREN,
      parserOptions: parserOptions,
      options: [{return: true}],
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }, {
      code: DECLARATION_NO_PAREN,
      output: DECLARATION_PAREN,
      parserOptions: parserOptions,
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }, {
      code: DECLARATION_NO_PAREN,
      output: DECLARATION_PAREN,
      parserOptions: parserOptions,
      options: [{declaration: true}],
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }, {
      code: ASSIGNMENT_NO_PAREN,
      output: ASSIGNMENT_PAREN,
      parserOptions: parserOptions,
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }, {
      code: ASSIGNMENT_NO_PAREN,
      output: ASSIGNMENT_PAREN,
      parserOptions: parserOptions,
      options: [{assignment: true}],
      errors: [{message: 'Missing parentheses around multilines JSX'}]
    }
  ]
});


text:
import unittest

from katas.kyu_7.self_descriptive_numbers import self_descriptive

class SelfDescriptiveNumbersTestCase(unittest.TestCase):
    def test_true(self):
        self.assertTrue(self_descriptive(21200))

    def test_true_2(self):
        self.assertTrue(self_descriptive(3211000))

    def test_true_3(self):
        self.assertTrue(self_descriptive(42101000))

    def test_true_4(self):
        self.assertTrue(self_descriptive(1210))

    def test_true_5(self):
        self.assertTrue(self_descriptive(2020))

    def test_true_6(self):
        self.assertTrue(self_descriptive(6210001000))

    def test_false(self):
        self.assertFalse(self_descriptive(21230))

    def test_false_2(self):
        self.assertFalse(self_descriptive(11200))

    def test_false_3(self):
        self.assertFalse(self_descriptive(51120111))

    def test_false_4(self):
        self.assertFalse(self_descriptive(11201))


text:
package org.apache.felix.ipojo.manipulator.reporter;

import java.io.PrintStream;

/**
 * A {@code SystemReporter} reports feedback from within the manipulation process.
 *
 * @author Felix Project Team
 */
public class SystemReporter extends EmptyReporter {

    /**
     * Micro enum used to prefix messages.
     */
    private enum Level {
        TRACE("#"),
        INFO("I"),
        WARN("W"),
        ERROR("E");

        private String value;

        Level(String value) {
            this.value = value;
        }

        public String append(String message) {
            return value + " " + message;
        }
    }

    /**
     * Enable/disable trace logging.
     */
    private boolean enableTrace = false;

    public void setEnableTrace(boolean enableTrace) {
        this.enableTrace = enableTrace;
    }

    private void log(PrintStream stream, Level level, String formatted, Throwable throwable) {
        // Print the message
        stream.println(level.append(formatted));

        // And the exception if any
        if (throwable != null) {
            throwable.printStackTrace(stream);
        }
    }

    @Override
    public void trace(String message, Object... args) {
        if (enableTrace) {
            String formatted = String.format(message, getMessageArguments(args));
            log(System.out, Level.TRACE, formatted, getThrowable());
        }
    }

    @Override
    public void info(String message, Object... args) {
        String formatted = String.format(message, getMessageArguments(args));
        log(System.out, Level.INFO, formatted, getThrowable());
    }

    @Override
    public void warn(String message, Object... args) {
        String formatted = String.format(message, getMessageArguments(args));
        Throwable throwable = getThrowable();
        log(System.out, Level.WARN, formatted, throwable);

        // Append Exception message if any
        if (throwable != null) {
            formatted += " ";
            formatted += throwable.getMessage();
        }
        getWarnings().add(formatted);
    }

    @Override
    public void error(String message, Object... args) {
        String formatted = String.format(message, getMessageArguments(args));
        Throwable throwable = getThrowable();
        log(System.out, Level.ERROR, formatted, throwable);

        // Append Exception message if any
        if (throwable != null) {
            formatted += " ";
            formatted += throwable.getMessage();
        }
        getErrors().add(formatted);
    }

}


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

package mongo.channel.test.join

import java.util.concurrent.{ TimeUnit, CountDownLatch }
import java.util.concurrent.atomic.AtomicLong
import com.mongodb.{ BasicDBObject, DBObject }
import mongo.channel.test.mongo.{ MongoDbEnviroment, MongoIntegrationEnv }
import org.scalatest.concurrent.ScalaFutures
import org.specs2.mutable.Specification
import rx.lang.scala.Subscriber
import rx.lang.scala.schedulers.ExecutionContextScheduler

import scala.collection.mutable
import scala.concurrent.ExecutionContext
import scalaz.concurrent.Task
import scalaz.stream.Process._
import scalaz.stream.io

class JoinMongoSpec extends Specification with ScalaFutures {
  import MongoIntegrationEnv._
  import join.Join
  import mongo._
  import dsl.mongo._
  import join.mongo.{ MongoProcess, MongoObservable, MongoObsCursorError, MongoObsFetchError }

  val pageSize = 7

  val qLang = for {
    _ ← "index" $gte 0 $lte 5
    _ ← sort("index" → Order.Ascending)
    q ← limit(6)
  } yield q

  def count = new CountDownLatch(1)
  def responses = new AtomicLong(0)

  "Join with MongoProcess" in new MongoDbEnviroment {
    initMongo

    type Module = MongoProcess

    def qProg(outer: Module#Record) = for { q ← "lang" $eq outer.get("index").asInstanceOf[Int] } yield q

    val cmd: (Module#Record, Module#Record) ⇒ String =
      (outer, inner) ⇒
        s"PK:${outer.get("index")} - [FK:${inner.get("lang")} - ${inner.get("name")}]"

    val buffer = mutable.Buffer.empty[String]
    val SinkBuffer = io.fillBuffer(buffer)
    implicit val c = client

    val join = (Join[Module] inner (qLang, LANGS, qProg(_), PROGRAMMERS, TEST_DB))(cmd)

    (for {
      joinLine ← eval(Task.now(client.getDB(TEST_DB))) through join.source
      _ ← joinLine to SinkBuffer
    } yield ())
      .onFailure { ex ⇒ logger.debug(s"MongoProcess has been completed with error: ${ex.getMessage}"); halt }
      .onComplete(eval_(Task.delay { c.close }))
      .runLog.run

    buffer.size === MongoIntegrationEnv.programmersSize
  }

  "Join with MongoObservable" in new MongoDbEnviroment {
    initMongo

    type Module = MongoObservable

    def qProg(outer: Module#Record) = for { q ← "lang" $eq outer.get("index").asInstanceOf[Int] } yield q

    val cmb: (Module#Record, Module#Record) ⇒ String =
      (outer, inner) ⇒
        s"PK:${outer.get("index")} - [FK:${inner.get("lang")} - ${inner.get("name")}]"

    val c0 = count
    val res = responses
    implicit val c = client

    val join = (Join[Module] inner (qLang, LANGS, qProg(_), PROGRAMMERS, TEST_DB))(cmb)

    val S = new Subscriber[String] {
      override def onStart() = request(pageSize)
      override def onNext(n: String) = {
        logger.info(s"onNext: $n")
        if (res.getAndIncrement % pageSize == 0) {
          logger.info(s"★ ★ ★ Fetched page:[$pageSize] ★ ★ ★ ")
          request(pageSize)
        }
      }
      override def onError(e: Throwable) = {
        logger.info(s"★ ★ ★ MongoObservable has been completed with error: ${e.getMessage}")
        c0.countDown()
      }
      override def onCompleted() = {
        logger.info("★ ★ ★  MongoObservable has been completed")
        c0.countDown()
        c.close()
      }
    }

    join
      .observeOn(ExecutionContextScheduler(ExecutionContext.fromExecutor(executor)))
      .subscribe(S)

    c0.await()
    res.get === MongoIntegrationEnv.programmersSize
  }

  "Run Mongo Observable with MongoObsCursorError error" in new MongoDbEnviroment {
    initMongo
    type Module = MongoObsCursorError

    val qLang = for { q ← "index" $gte 0 $lte 5 } yield q

    def qProg(outer: Module#Record) = for { q ← "lang" $eq outer.get("index").asInstanceOf[Int] } yield q

    val cmd: (Module#Record, Module#Record) ⇒ String =
      (outer, inner) ⇒
        s"PK:${outer.get("index")} - [FK:${inner.get("lang")} - ${inner.get("name")}]"

    val c0 = count
    val res = responses
    implicit val c = client

    val join = (Join[Module] inner (qLang, LANGS, qProg(_), PROGRAMMERS, TEST_DB))(cmd)

    val S = new Subscriber[String] {
      override def onStart() = request(pageSize)

      override def onNext(n: String) = {
        logger.info(s"onNext: $n")
        if (responses.getAndIncrement() % pageSize == 0) {
          request(pageSize)
        }
      }

      override def onError(e: Throwable) = {
        logger.info(s"★ ★ ★  MongoObsCursorError has been completed with error: ${e.getMessage}")
        c0.countDown()
        c.close()
      }

      override def onCompleted() = {
        c.close()
        logger.info("★ ★ ★  MongoObsCursorError has been completed")
      }
    }

    join
      .observeOn(ExecutionContextScheduler(ExecutionContext.fromExecutor(executor)))
      .subscribe(S)

    c0.await(5, TimeUnit.SECONDS) mustEqual true
  }

  "Run Mongo Observable with MongoObsFetchError" in new MongoDbEnviroment {
    initMongo
    type Module = MongoObsFetchError

    val qLang = for { q ← "index" $gte 0 $lte 5 } yield q

    def qProg(outer: Module#Record) = for { q ← "lang" $eq outer.get("index").asInstanceOf[Int] } yield q

    val cmd: (Module#Record, Module#Record) ⇒ String =
      (outer, inner) ⇒
        s"PK:${outer.get("index")} - [FK:${inner.get("lang")} - ${inner.get("name")}]"

    val c0 = count
    val res = responses
    implicit val c = client

    val query = (Join[Module] inner (qLang, LANGS, qProg(_), PROGRAMMERS, TEST_DB))(cmd)

    val S = new Subscriber[String] {
      override def onStart() = request(pageSize)
      override def onNext(n: String) = {
        logger.info(s"onNext: $n")
        if (responses.getAndIncrement() % pageSize == 0) {
          request(pageSize)
        }
      }

      override def onError(e: Throwable) = {
        logger.info(s"★ ★ ★  MongoObsFetchError has been completed with error: ${e.getMessage}")
        c0.countDown()
        c.close()
      }

      override def onCompleted() = {
        c.close()
        logger.info("★ ★ ★  MongoObsFetchError has been completed")
      }
    }

    query
      .observeOn(ExecutionContextScheduler(ExecutionContext.fromExecutor(executor)))
      .subscribe(S)

    c0.await(5, TimeUnit.SECONDS) mustEqual true
  }

  "Convert to case class" in {
    import dbtypes._

    case class DbRecord(persistence_id: String, partition_nr: Long, sequence_nr: Long)

    val x: DBObject = new BasicDBObject()
      .append("persistence_id", "key-a")
      .append("partition_nr", 1l)
      .append("sequence_nr", 100l)

    val out = x.as[DbRecord]

    println(out)

    true mustEqual true
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>StaticResource</name>
    </types>
    <version>31.0</version>
</Package>


text:
<?php

namespace AnyContent\Repository\Modules\Core\Repositories;

use AnyContent\Repository\Modules\Core\Application\Application;

use AnyContent\Repository\FilesManager;

class Repository
{

    protected $app;
    protected $name;

    protected $contentManager = array();
    protected $configManager = null;
    protected $filesManager = null;

    public function __construct(Application $app, $repositoryName)
    {
        $this->app  = $app;
        $this->name = $repositoryName;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getName()
    {
        return $this->name;
    }

    public function getContentTypesList()
    {
        return $this->app['repos']->getContentTypesList($this->name);
    }

    // todo rename
    public function getCMDL($contentTypeName)
    {
        return $this->app['repos']->getContentTypeCMDL($this->name, $contentTypeName);
    }

    // todo rename
    public function getConfigCMDL($configTypeName)
    {
        return $this->app['repos']->getConfigTypeCMDL($this->name, $configTypeName);
    }

    public function getContentTypeDefinition($contentTypeName)
    {
        return $this->app['repos']->getContentTypeDefinition($this->name, $contentTypeName);
    }

    public function getConfigTypesList()
    {
        return $this->app['repos']->getConfigTypesList($this->name);
    }

    public function getConfigTypeDefinition($configTypeName)
    {
        return $this->app['repos']->getConfigTypeDefinition($this->name, $configTypeName);
    }

    public function hasConfigType($configTypeName)
    {
        if (array_key_exists($configTypeName, $this->getConfigTypesList()))
        {
            return true;
        }

        return false;
    }

    public function getContentManager($contentTypeName)
    {
        if (array_key_exists($contentTypeName, $this->contentManager))
        {
            return $this->contentManager[$contentTypeName];
        }

        $contentTypeDefinition = $this->getContentTypeDefinition($contentTypeName);

        if ($contentTypeDefinition)
        {

            $manager = new ContentManager($this->app, $this, $contentTypeDefinition);

            $this->contentManager[$contentTypeName] = $manager;

            return $manager;
        }

        return false;
    }

    public function getConfigManager()
    {
        if ($this->configManager != null)
        {
            return $this->configManager;
        }

        $manager = new ConfigManager($this);

        $this->configManager = $manager;

        return $manager;

    }

    public
    function getFilesManager()
    {
        if ($this->filesManager != null)
        {
            return $this->filesManager;
        }
        $manager            = new FilesManager($this->app, $this, $this->app['repos']->getFilesAdapterConfig($this->getName()));
        $this->filesManager = $manager;

        return $manager;
    }

    public
    function getDatabaseConnection()
    {
        return $this->app['repos']->getDatabaseConnection();
    }

    /* public function getFileSystem()
     {
         return $this->app['repos']->getFileSystem($this->getName());
     }*/

    public
    function getMaxTimestamp()
    {
        return $this->app['repos']->getMaxTimestamp();
    }

    public
    function getTimeshiftTimestamp($timeshift = 0)
    {
        return $this->app['repos']->getTimeshiftTimestamp($timeshift);

    }

    public
    function getAPIUser()
    {
        return $this->app['repos']->getAPIUser();
    }

    public
    function getCurrentUserName()
    {
        return $this->app['repos']->getCurrentUserName();
    }

    public
    function getCurrentUserFirstname()
    {
        return $this->app['repos']->getCurrentUserFirstname();
    }

    public
    function getCurrentUserLastname()
    {
        return $this->app['repos']->getCurrentUserLastname();
    }

    public
    function getClientIp()
    {
        return $this->app['repos']->getClientIp();
    }

}


text:
{% extends 'oscar/dashboard/layout.html' %}
{% load currency_filters %}
{% load sorting_tags %}
{% load i18n %}

{% block title %}
    {{ voucher_set.name }} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}

{% trans "Dashboard" %}

{% trans "Voucher sets" %}

{{ voucher_set.name }}

{% endblock %}

{% block header %}

             {% trans "Download CSV" %}

{% trans "Voucher set" %} '{{ voucher_set.name }}'

{% endblock header %}

{% block dashboard_content %}
{% include "oscar/dashboard/vouchers/partials/voucher_set_details_table.html" %}

 {% trans "Search vouchers" %}

    <form method="get" class="form-inline">
		{% include 'oscar/partials/form_fields_inline.html' with form=form %}
		<button type="submit" class="btn btn-primary">{% trans "Search" %}</button>
		{% trans "Reset" %}
    </form>
    {% if search_filters %}

        Filters:
        {% for filter in search_filters %}
        {{ filter }}
        {% endfor %}

    {% endif %}

        {% if search_filters %}
        {% trans "Voucher Search Results" %}
        {% else %}
        {% trans "All Vouchers" %}
        {% endif %}

    {% if vouchers %}

        {% trans "Code" %}
        {% anchor 'num_basket_additions' _("Num baskets") %}
        {% anchor 'num_orders' _("Num orders") %}
        {% anchor 'date_created' _("Date created") %}

        {% for voucher in vouchers %}

                {{ voucher.code }}

            {{ voucher.num_basket_additions }}
            {{ voucher.num_orders }}
            {{ voucher.date_created }}

                        <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            {% trans "Actions" %}
                        </button>

                                {% trans "Stats" %}

                                {% trans "Delete" %}

        {% endfor %}
    {% else %}

{% trans "No vouchers found." %}

    {% endif %}

{% include "oscar/partials/pagination.html" %}

{% trans "Attached offers" %}

    {% if voucher_set.vouchers.first.offers.exists %}

            {% trans "Offer name" %}
            {% trans "Start date" %}
            {% trans "End date" %}
            {% trans "Is available?" %}
            {% trans "Priority" %}
            {% trans "Incentive" %}
            {% trans "Condition" %}
            {% trans "Restrictions" %}

        {% for offer in voucher_set.vouchers.first.offers.all %}

                {{ offer.name }}

            {{ offer.start_datetime|default:"-" }}
            {{ offer.end_datetime|default:"-" }}
            {% if offer.is_available %}
                {% trans "Yes" %}
                {% else %}
                {% trans "No" %}
                {% endif %}

            {{ offer.priority }}
            {{ offer.benefit.description|safe }}
            {{ offer.condition.description|safe }}

                {% for restriction in offer.availability_restrictions %}
                {% if not restriction.is_satisfied %}

                    {{ restriction.description }}

                {% else %}
                {{ restriction.description }}

                {% endif %}
                {% endfor %}

        {% endfor %}

    {% else %}

        {% trans "No offers are attached to this voucher set." %}

    {% endif %}

    {% trans "Edit" %} {% trans "or" %}
    {% trans "Delete" %} {% trans "or" %}
    {% trans "cancel" %}

{% endblock dashboard_content %}


text:
require 'spec_helper'

describe "cms_node_photo_album", type: :feature, dbscope: :example do
  let(:site) { cms_site }
  let(:node) { create :cms_node_photo_album, cur_site: site }
  let(:index_path) { node_photo_albums_path site, node }

  context "basic crud" do
    before { login_cms_user }

    it do
      visit index_path
      expect(status_code).to eq 200
      expect(current_path).to eq node_nodes_path site, node
    end
  end
end


text:
#include "Ip6Impl.h"

EFI_IP6_ICMP_TYPE mIp6SupportedIcmp[23] = {

  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_NO_ROUTE_TO_DEST
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_COMM_PROHIBITED
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_BEYOND_SCOPE
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_ADDR_UNREACHABLE
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_PORT_UNREACHABLE
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_SOURCE_ADDR_FAILED
  },
  {
    ICMP_V6_DEST_UNREACHABLE,
    ICMP_V6_ROUTE_REJECTED
  },

  {
    ICMP_V6_PACKET_TOO_BIG,
    ICMP_V6_DEFAULT_CODE
  },

  {
    ICMP_V6_TIME_EXCEEDED,
    ICMP_V6_TIMEOUT_HOP_LIMIT
  },
  {
    ICMP_V6_TIME_EXCEEDED,
    ICMP_V6_TIMEOUT_REASSEMBLE
  },

  {
    ICMP_V6_PARAMETER_PROBLEM,
    ICMP_V6_ERRONEOUS_HEADER
  },
  {
    ICMP_V6_PARAMETER_PROBLEM,
    ICMP_V6_UNRECOGNIZE_NEXT_HDR
  },
  {
    ICMP_V6_PARAMETER_PROBLEM,
    ICMP_V6_UNRECOGNIZE_OPTION
  },

  {
    ICMP_V6_ECHO_REQUEST,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_ECHO_REPLY,
    ICMP_V6_DEFAULT_CODE
  },

  {
    ICMP_V6_LISTENER_QUERY,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_LISTENER_REPORT,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_LISTENER_REPORT_2,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_LISTENER_DONE,
    ICMP_V6_DEFAULT_CODE
  },

  {
    ICMP_V6_ROUTER_SOLICIT,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_ROUTER_ADVERTISE,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_NEIGHBOR_SOLICIT,
    ICMP_V6_DEFAULT_CODE
  },
  {
    ICMP_V6_NEIGHBOR_ADVERTISE,
    ICMP_V6_DEFAULT_CODE
  },
};

/**
  Reply an ICMPv6 echo request.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  Head               The IP head of the ICMPv6 informational message.
  @param[in]  Packet             The content of the ICMPv6 message with the IP head
                                 removed.

  @retval EFI_OUT_OF_RESOURCES   Failed to allocate resources.
  @retval EFI_SUCCESS            Successfully answered the ICMPv6 Echo request.
  @retval Others                 Failed to answer the ICMPv6 Echo request.

**/
EFI_STATUS
Ip6IcmpReplyEcho (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IP6_HEADER         *Head,
  IN NET_BUF                *Packet
  )
{
  IP6_ICMP_INFORMATION_HEAD *Icmp;
  NET_BUF                   *Data;
  EFI_STATUS                Status;
  EFI_IP6_HEADER            ReplyHead;

  Status = EFI_OUT_OF_RESOURCES;
  //
  // make a copy the packet, it is really a bad idea to
  // send the MNP's buffer back to MNP.
  //
  Data = NetbufDuplicate (Packet, NULL, IP6_MAX_HEADLEN);
  if (Data == NULL) {
    goto Exit;
  }

  //
  // Change the ICMP type to echo reply, exchange the source
  // and destination, then send it. The source is updated to
  // use specific destination. See RFC1122. SRR/RR option
  // update is omitted.
  //
  Icmp = (IP6_ICMP_INFORMATION_HEAD *) NetbufGetByte (Data, 0, NULL);
  if (Icmp == NULL) {
    NetbufFree (Data);
    goto Exit;
  }

  Icmp->Head.Type     = ICMP_V6_ECHO_REPLY;
  Icmp->Head.Checksum = 0;

  //
  // Generate the IPv6 basic header
  // If the Echo Reply is a response to a Echo Request sent to one of the node's unicast address,
  // the Source address of the Echo Reply must be the same address.
  //
  ZeroMem (&ReplyHead, sizeof (EFI_IP6_HEADER));

  ReplyHead.PayloadLength  = HTONS ((UINT16) (Packet->TotalSize));
  ReplyHead.NextHeader     = IP6_ICMP;
  ReplyHead.HopLimit       = IpSb->CurHopLimit;
  IP6_COPY_ADDRESS (&ReplyHead.DestinationAddress, &Head->SourceAddress);

  if (Ip6IsOneOfSetAddress (IpSb, &Head->DestinationAddress, NULL, NULL)) {
    IP6_COPY_ADDRESS (&ReplyHead.SourceAddress, &Head->DestinationAddress);
  }

  //
  // If source is unspecified, Ip6Output will select a source for us
  //
  Status = Ip6Output (
             IpSb,
             NULL,
             NULL,
             Data,
             &ReplyHead,
             NULL,
             0,
             Ip6SysPacketSent,
             NULL
             );

Exit:
  NetbufFree (Packet);
  return Status;
}

/**
  Process Packet Too Big message sent by a router in response to a packet that
  it cannot forward because the packet is larger than the MTU of outgoing link.
  Since this driver already uses IPv6 minimum link MTU as the maximum packet size,
  if Packet Too Big message is still received, do not reduce the packet size, but
  rather include a Fragment header in the subsequent packets.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  Head               The IP head of the ICMPv6 error packet.
  @param[in]  Packet             The content of the ICMPv6 error with the IP head
                                 removed.

  @retval EFI_SUCCESS            The ICMPv6 error processed successfully.
  @retval EFI_OUT_OF_RESOURCES   Failed to finish the operation due to lack of
                                 resource.
  @retval EFI_NOT_FOUND          The packet too big message is not sent to us.

**/
EFI_STATUS
Ip6ProcessPacketTooBig (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IP6_HEADER         *Head,
  IN NET_BUF                *Packet
  )
{
  IP6_ICMP_ERROR_HEAD       Icmp;
  UINT32                    Mtu;
  IP6_ROUTE_ENTRY           *RouteEntry;
  EFI_IPv6_ADDRESS          *DestAddress;

  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *) &Icmp);
  Mtu         = NTOHL (Icmp.Fourth);
  DestAddress = &Icmp.IpHead.DestinationAddress;

  if (Mtu < IP6_MIN_LINK_MTU) {
    //
    // Normally the multicast address is considered to be on-link and not recorded
    // in route table. Here it is added into the table since the MTU information
    // need be recorded.
    //
    if (IP6_IS_MULTICAST (DestAddress)) {
      RouteEntry = Ip6CreateRouteEntry (DestAddress, 128, NULL);
      if (RouteEntry == NULL) {
        NetbufFree (Packet);
        return EFI_OUT_OF_RESOURCES;
      }

      RouteEntry->Flag = IP6_DIRECT_ROUTE | IP6_PACKET_TOO_BIG;
      InsertHeadList (&IpSb->RouteTable->RouteArea[128], &RouteEntry->Link);
      IpSb->RouteTable->TotalNum++;
    } else {
      RouteEntry = Ip6FindRouteEntry (IpSb->RouteTable, DestAddress, NULL);
      if (RouteEntry == NULL) {
        NetbufFree (Packet);
        return EFI_NOT_FOUND;
      }

      RouteEntry->Flag = RouteEntry->Flag | IP6_PACKET_TOO_BIG;

      Ip6FreeRouteEntry (RouteEntry);
    }
  }

  NetbufFree (Packet);
  return EFI_SUCCESS;
}

/**
  Process the ICMPv6 error packet, and deliver the packet to upper layer.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  Head               The IP head of the ICMPv6 error packet.
  @param[in]  Packet             The content of the ICMPv6 error with the IP head
                                 removed.

  @retval EFI_SUCCESS            The ICMPv6 error processed successfully.
  @retval EFI_INVALID_PARAMETER  The packet is invalid.
  @retval Others                 Failed to process the packet.

**/
EFI_STATUS
Ip6ProcessIcmpError (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IP6_HEADER         *Head,
  IN NET_BUF                *Packet
  )
{
  IP6_ICMP_ERROR_HEAD       Icmp;

  //
  // Check the validity of the packet
  //
  if (Packet->TotalSize < sizeof (Icmp)) {
    goto DROP;
  }

  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *) &Icmp);
  if (Icmp.Head.Type == ICMP_V6_PACKET_TOO_BIG) {
    return Ip6ProcessPacketTooBig (IpSb, Head, Packet);
  }

  //
  // Notify the upper-layer process that an ICMPv6 eror message is received.
  //
  IP6_GET_CLIP_INFO (Packet)->Status = EFI_ICMP_ERROR;
  return Ip6Demultiplex (IpSb, Head, Packet);

DROP:
  NetbufFree (Packet);
  Packet = NULL;
  return EFI_INVALID_PARAMETER;
}

/**
  Process the ICMPv6 informational messages. If it is an ICMPv6 echo
  request, answer it. If it is a MLD message, trigger MLD routines to
  process it. If it is a ND message, trigger ND routines to process it.
  Otherwise, deliver it to upper layer.

  @param[in]  IpSb               The IP service that receivd the packet.
  @param[in]  Head               The IP head of the ICMPv6 informational packet.
  @param[in]  Packet             The content of the ICMPv6 informational packet
                                 with IP head removed.

  @retval EFI_INVALID_PARAMETER  The packet is invalid.
  @retval EFI_SUCCESS            The ICMPv6 informational message processed.
  @retval Others                 Failed to process ICMPv6 informational message.

**/
EFI_STATUS
Ip6ProcessIcmpInformation (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IP6_HEADER         *Head,
  IN NET_BUF                *Packet
  )
{
  IP6_ICMP_INFORMATION_HEAD Icmp;
  EFI_STATUS                Status;

  NET_CHECK_SIGNATURE (IpSb, IP6_SERVICE_SIGNATURE);
  NET_CHECK_SIGNATURE (Packet, NET_BUF_SIGNATURE);
  ASSERT (Head != NULL);

  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *) &Icmp);
  Status = EFI_INVALID_PARAMETER;

  switch (Icmp.Head.Type) {
  case ICMP_V6_ECHO_REQUEST:
    //
    // If ICMPv6 echo, reply it
    //
    if (Icmp.Head.Code == 0) {
      Status = Ip6IcmpReplyEcho (IpSb, Head, Packet);
    }
    break;
  case ICMP_V6_LISTENER_QUERY:
    Status = Ip6ProcessMldQuery (IpSb, Head, Packet);
    break;
  case ICMP_V6_LISTENER_REPORT:
  case ICMP_V6_LISTENER_REPORT_2:
    Status = Ip6ProcessMldReport (IpSb, Head, Packet);
    break;
  case ICMP_V6_NEIGHBOR_SOLICIT:
    Status = Ip6ProcessNeighborSolicit (IpSb, Head, Packet);
    break;
  case ICMP_V6_NEIGHBOR_ADVERTISE:
    Status = Ip6ProcessNeighborAdvertise (IpSb, Head, Packet);
    break;
  case ICMP_V6_ROUTER_ADVERTISE:
    Status = Ip6ProcessRouterAdvertise (IpSb, Head, Packet);
    break;
  case ICMP_V6_REDIRECT:
    Status = Ip6ProcessRedirect (IpSb, Head, Packet);
    break;
  case ICMP_V6_ECHO_REPLY:
    Status = Ip6Demultiplex (IpSb, Head, Packet);
    break;
  default:
    Status = EFI_INVALID_PARAMETER;
    break;
  }

  return Status;
}

/**
  Handle the ICMPv6 packet. First validate the message format,
  then, according to the message types, process it as an informational packet or
  an error packet.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  Head               The IP head of the ICMPv6 packet.
  @param[in]  Packet             The content of the ICMPv6 packet with IP head
                                 removed.

  @retval EFI_INVALID_PARAMETER  The packet is malformated.
  @retval EFI_SUCCESS            The ICMPv6 message successfully processed.
  @retval Others                 Failed to handle the ICMPv6 packet.

**/
EFI_STATUS
Ip6IcmpHandle (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IP6_HEADER         *Head,
  IN NET_BUF                *Packet
  )
{
  IP6_ICMP_HEAD             Icmp;
  UINT16                    PseudoCheckSum;
  UINT16                    CheckSum;

  //
  // Check the validity of the incoming packet.
  //
  if (Packet->TotalSize < sizeof (Icmp)) {
    goto DROP;
  }

  NetbufCopy (Packet, 0, sizeof (Icmp), (UINT8 *) &Icmp);

  //
  // Make sure checksum is valid.
  //
  PseudoCheckSum = NetIp6PseudoHeadChecksum (
                     &Head->SourceAddress,
                     &Head->DestinationAddress,
                     IP6_ICMP,
                     Packet->TotalSize
                     );
  CheckSum = (UINT16) ~NetAddChecksum (PseudoCheckSum, NetbufChecksum (Packet));
  if (CheckSum != 0) {
    goto DROP;
  }

  //
  // According to the packet type, call corresponding process
  //
  if (Icmp.Type <= ICMP_V6_ERROR_MAX) {
    return Ip6ProcessIcmpError (IpSb, Head, Packet);
  } else {
    return Ip6ProcessIcmpInformation (IpSb, Head, Packet);
  }

DROP:
  NetbufFree (Packet);
  return EFI_INVALID_PARAMETER;
}

/**
  Retrieve the Prefix address according to the PrefixLength by clear the useless
  bits.

  @param[in]       PrefixLength  The prefix length of the prefix.
  @param[in, out]  Prefix        On input, points to the original prefix address
                                 with dirty bits; on output, points to the updated
                                 address with useless bit clear.

**/
VOID
Ip6GetPrefix (
  IN     UINT8              PrefixLength,
  IN OUT EFI_IPv6_ADDRESS   *Prefix
  )
{
  UINT8                     Byte;
  UINT8                     Bit;
  UINT8                     Mask;
  UINT8                     Value;

  ASSERT ((Prefix != NULL) && (PrefixLength < IP6_PREFIX_MAX));

  if (PrefixLength == 0) {
    ZeroMem (Prefix, sizeof (EFI_IPv6_ADDRESS));
    return ;
  }

  if (PrefixLength >= IP6_PREFIX_MAX) {
    return ;
  }

  Byte  = (UINT8) (PrefixLength / 8);
  Bit   = (UINT8) (PrefixLength % 8);
  Value = Prefix->Addr[Byte];

  if (Byte > 0) {
    ZeroMem (Prefix->Addr + Byte, 16 - Byte);
  }

  if (Bit > 0) {
    Mask = (UINT8) (0xFF << (8 - Bit));
    Prefix->Addr[Byte] = (UINT8) (Value & Mask);
  }

}

/**
  Check whether the DestinationAddress is an anycast address.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  DestinationAddress Points to the Destination Address of the packet.

  @retval TRUE                   The DestinationAddress is anycast address.
  @retval FALSE                  The DestinationAddress is not anycast address.

**/
BOOLEAN
Ip6IsAnycast (
  IN IP6_SERVICE            *IpSb,
  IN EFI_IPv6_ADDRESS       *DestinationAddress
  )
{
  IP6_PREFIX_LIST_ENTRY     *PrefixEntry;
  EFI_IPv6_ADDRESS          Prefix;
  BOOLEAN                   Flag;

  ZeroMem (&Prefix, sizeof (EFI_IPv6_ADDRESS));

  Flag = FALSE;

  //
  // If the address is known as on-link or autonomous prefix, record it as
  // anycast address.
  //
  do {
    PrefixEntry = Ip6FindPrefixListEntry (IpSb, Flag, 255, DestinationAddress);
    if (PrefixEntry != NULL) {
      IP6_COPY_ADDRESS (&Prefix, &PrefixEntry->Prefix);
      Ip6GetPrefix (PrefixEntry->PrefixLength, &Prefix);
      if (EFI_IP6_EQUAL (&Prefix, DestinationAddress)) {
        return TRUE;
      }
    }

    Flag = (BOOLEAN) !Flag;
  } while (Flag);

  return FALSE;
}

/**
  Generate ICMPv6 error message and send it out to DestinationAddress. Currently
  Destination Unreachable message, Time Exceeded message and Parameter Problem
  message are supported.

  @param[in]  IpSb               The IP service that received the packet.
  @param[in]  Packet             The packet which invoking ICMPv6 error.
  @param[in]  SourceAddress      If not NULL, points to the SourceAddress.
                                 Otherwise, the IP layer will select a source address
                                 according to the DestinationAddress.
  @param[in]  DestinationAddress Points to the Destination Address of the ICMPv6
                                 error message.
  @param[in]  Type               The type of the ICMPv6 message.
  @param[in]  Code               The additional level of the ICMPv6 message.
  @param[in]  Pointer            If not NULL, identifies the octet offset within
                                 the invoking packet where the error was detected.

  @retval EFI_INVALID_PARAMETER  The packet is malformated.
  @retval EFI_OUT_OF_RESOURCES   There is no sufficient resource to complete the
                                 operation.
  @retval EFI_SUCCESS            The ICMPv6 message was successfully sent out.
  @retval Others                 Failed to generate the ICMPv6 packet.

**/
EFI_STATUS
Ip6SendIcmpError (
  IN IP6_SERVICE            *IpSb,
  IN NET_BUF                *Packet,
  IN EFI_IPv6_ADDRESS       *SourceAddress       OPTIONAL,
  IN EFI_IPv6_ADDRESS       *DestinationAddress,
  IN UINT8                  Type,
  IN UINT8                  Code,
  IN UINT32                 *Pointer             OPTIONAL
  )
{
  UINT32                    PacketLen;
  NET_BUF                   *ErrorMsg;
  UINT16                    PayloadLen;
  EFI_IP6_HEADER            Head;
  IP6_ICMP_INFORMATION_HEAD *IcmpHead;
  UINT8                     *ErrorBody;

  if (DestinationAddress == NULL) {
    return EFI_INVALID_PARAMETER;
  }

  //
  // An ICMPv6 error message must not be originated as a result of receiving
  // a packet whose source address does not uniquely identify a single node --
  // e.g., the IPv6 Unspecified Address, an IPv6 multicast address, or an address
  // known by the ICMP message originator to be an IPv6 anycast address.
  //
  if (NetIp6IsUnspecifiedAddr (DestinationAddress) ||
      IP6_IS_MULTICAST (DestinationAddress)        ||
      Ip6IsAnycast (IpSb, DestinationAddress)
      ) {
    return EFI_INVALID_PARAMETER;
  }

  switch (Type) {
  case ICMP_V6_DEST_UNREACHABLE:
  case ICMP_V6_TIME_EXCEEDED:
    break;

  case ICMP_V6_PARAMETER_PROBLEM:
    if (Pointer == NULL) {
      return EFI_INVALID_PARAMETER;
    }

    break;

  default:
    return EFI_INVALID_PARAMETER;
  }

  PacketLen = sizeof (IP6_ICMP_ERROR_HEAD) + Packet->TotalSize;

  if (PacketLen > IpSb->MaxPacketSize) {
    PacketLen = IpSb->MaxPacketSize;
  }

  ErrorMsg = NetbufAlloc (PacketLen);
  if (ErrorMsg == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }

  PayloadLen = (UINT16) (PacketLen - sizeof (EFI_IP6_HEADER));

  //
  // Create the basic IPv6 header.
  //
  ZeroMem (&Head, sizeof (EFI_IP6_HEADER));

  Head.PayloadLength  = HTONS (PayloadLen);
  Head.NextHeader     = IP6_ICMP;
  Head.HopLimit       = IpSb->CurHopLimit;

  if (SourceAddress != NULL) {
    IP6_COPY_ADDRESS (&Head.SourceAddress, SourceAddress);
  } else {
    ZeroMem (&Head.SourceAddress, sizeof (EFI_IPv6_ADDRESS));
  }

  IP6_COPY_ADDRESS (&Head.DestinationAddress, DestinationAddress);

  NetbufReserve (ErrorMsg, sizeof (EFI_IP6_HEADER));

  //
  // Fill in the ICMP error message head
  //
  IcmpHead = (IP6_ICMP_INFORMATION_HEAD *) NetbufAllocSpace (ErrorMsg, sizeof (IP6_ICMP_INFORMATION_HEAD), FALSE);
  if (IcmpHead == NULL) {
    NetbufFree (ErrorMsg);
    return EFI_OUT_OF_RESOURCES;
  }

  ZeroMem (IcmpHead, sizeof (IP6_ICMP_INFORMATION_HEAD));
  IcmpHead->Head.Type = Type;
  IcmpHead->Head.Code = Code;

  if (Pointer != NULL) {
    IcmpHead->Fourth = HTONL (*Pointer);
  }

  //
  // Fill in the ICMP error message body
  //
  PayloadLen -= sizeof (IP6_ICMP_INFORMATION_HEAD);
  ErrorBody =  NetbufAllocSpace (ErrorMsg, PayloadLen, FALSE);
  if (ErrorBody != NULL) {
    ZeroMem (ErrorBody, PayloadLen);
    NetbufCopy (Packet, 0, PayloadLen, ErrorBody);
  }

  //
  // Transmit the packet
  //
  return Ip6Output (IpSb, NULL, NULL, ErrorMsg, &Head, NULL, 0, Ip6SysPacketSent, NULL);
}


text:
using namespace std;

extern "C" int stogo_verbose;

typedef void dom(RTBox) ;
typedef dom* Pdom ;

typedef double obj(RCRVector) ;
typedef obj* Pobj ;

typedef void grad(RCRVector,RVector&) ;
typedef grad* Pgrad ;

typedef enum { OBJECTIVE_ONLY, GRADIENT_ONLY, OBJECTIVE_AND_GRADIENT } whichO;

typedef double objgrad(RCRVector,RCRVector,whichO) ;
typedef objgrad* Pobjgrad ;

class GlobalParams {
public:
#ifdef NLOPT_UTIL_H
  nlopt_stopping *stop;
#else
  double maxtime;
  long int maxeval;
#endif
  double eps_cl, mu, rshift;
  int det_pnts, rnd_pnts;
};

class Global: public GlobalParams {
public:
  // Problem specification
  int dim ;
  Pobj  Objective ;
  Pgrad Gradient ;
  long int numeval;

  virtual double ObjectiveGradient(RCRVector xy, RVector&grad, whichO which){
       ++numeval;
       switch (which) {
	   case OBJECTIVE_AND_GRADIENT:
		Gradient(xy, grad);
	   case OBJECTIVE_ONLY:
		return Objective(xy);
	   case GRADIENT_ONLY:
		Gradient(xy, grad);
       }
       return 0.0;
  }

  Global(RTBox, Pobj, Pgrad, GlobalParams);
//  Global& operator=(const Global &);

  void Search(int, RCRVector);
  void DispMinimizers();
  double OneMinimizer(RCRVector);
  bool NoMinimizers();
  void SetDomain(RTBox);
  void GetDomain(RTBox);
  double GetMinValue();
  void SetMinValue(double);
  void ClearSolSet();
  void AddPoint(RCRVector, double);

  double GetTime();
  bool InTime();

private:
  list<Trial> SolSet;
  list<Trial>::const_iterator titr;
  priority_queue<TBox> CandSet;
  priority_queue<TBox> Garbage;

  double fbound;
  TBox Domain;

  void FillRegular(RTBox, RTBox);
  void FillRandom(RTBox, RTBox);
  double NewtonTest(RTBox, int, RCRVector, int*);
  void ReduceOrSubdivide(RTBox, int, RCRVector);
};
#endif


text:
package org.kuali.coeus.common.notification.impl;

import org.kuali.kra.infrastructure.PermissionConstants;
import org.kuali.rice.kns.lookup.HtmlData;
import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
import org.kuali.rice.krad.bo.BusinessObject;
import org.kuali.rice.krad.util.KRADConstants;

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

public class NotificationLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl {

    private KcNotificationAuthorizationService kcNotificationAuthorizationService;

    /**
     * Only display edit, copy and view links for the Questions if proper permission is given.
     * @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getCustomActionUrls(org.kuali.rice.kns.bo.BusinessObject, java.util.List)
     */
    @Override
    public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
        List<HtmlData> htmlDataList = new ArrayList<HtmlData>();
        boolean hasModifyPermission = getKcNotificationAuthorizationService().hasPermission(PermissionConstants.MODIFY_NOTIFICATION);
        if (hasModifyPermission) {
            AnchorHtmlData editHtmlData = getUrlData(businessObject, KRADConstants.MAINTENANCE_EDIT_METHOD_TO_CALL, pkNames);
            htmlDataList.add(editHtmlData);
        }
        return htmlDataList;
    }

    public KcNotificationAuthorizationService getKcNotificationAuthorizationService() {
        return kcNotificationAuthorizationService;
    }

    public void setKcNotificationAuthorizationService(KcNotificationAuthorizationService kcNotificationAuthorizationService) {
        this.kcNotificationAuthorizationService = kcNotificationAuthorizationService;
    }

}


text:
<?php
	require_once ('/modal/core/setup.php');

	if($_SESSION['role'] != Config::get('guest')){
		header('Location: dashboard.php?page=main');
	}

	if(Input::exist() && isset($_POST['currency'])) {
		$_SESSION['currency'] = Input::get('currency');
		$rate = MySQLConn::getInstance()->select("currency", array("rate"), array("code", '=', $_SESSION['currency']), "LIMIT 1")->fetch()['rate'];
	}

	// validate current page exists and user has permission to view it
	$routes = Booking::getInstance()->getTopFlight(8);
	$view = $page->pageCheck();
?>

<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="description" content="<?= Config::get('site_name') ?>" />
		<meta name="keywords" content="Ukraine International Airlines, UIA, flight, travel, booking" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="shortcut icon" type="image/png" href="assets/favicon.png">

		<title><?= Config::get('site_name')." | ".$page->data()[Page::COL_TITLE] ?></title>

		<link rel="stylesheet" type="text/css" href="css/app.css" />

	                      <button class="menu-icon dark " type="button" data-toggle="offCanvas" ></button>
	                      Menu

	                    <form method="post" action="" accept-charset="UTF-8">

									<?php echo $region . "/" . $_SESSION['currency'] ?>

<button name="currency" type="submit" value="USD">USD</button>

<button name="currency" type="submit" value="RUB">RUB</button>

<button name="currency" type="submit" value="MYR">MYR</button>

	                    </form>

				<img style="max-width: 100%; max-height: 100%;" class="hide-for-small-only" src="img/uia_home_<?php echo rand(1, 4); ?>.jpg" />

Your Journey Begins Here

Here at Ukraine International Airlines, we strive to
							provide the best experience when you're taking your
							flight with us. Enjoy world-class facilities and service
							when traveling with us.

							Sign Up
							Sign In

Hot Deals

						<?php

						for ($x = 0; $x < 4; $x++) {
						    $deal = "
";
						    $deal .= $routes[$x][Booking::COL_SOURCE] . " to " . $routes[$x][Booking::COL_DESTINATION];
						    $deal .= "From ";
						    $deal .= $_SESSION['currency'].($routes[$x][Booking::COL_ECONOMY] * $rate);
						    $deal .= "
";
						    echo $deal;
						}

						?>

Featured Routes

						<?php

						for ($x = 4; $x < 8; $x++) {
						    $deal = "
";
						    $deal .= $routes[$x][Booking::COL_SOURCE] . " to " . $routes[$x][Booking::COL_DESTINATION];
						    $deal .= "From ";
						    $deal .= $_SESSION['currency'].($routes[$x][Booking::COL_ECONOMY] * $rate);
						    $deal .= "
";
						    echo $deal;
						}

						?>

			<?php require_once('/view/components/footer.php'); ?>


text:
package org.wso2.carbon.apimgt.rest.api.store.v1;

import org.wso2.carbon.apimgt.rest.api.store.v1.dto.ErrorDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.TagListDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.TagsApiService;
import org.wso2.carbon.apimgt.rest.api.store.v1.impl.TagsApiServiceImpl;
import org.wso2.carbon.apimgt.api.APIManagementException;

import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.inject.Inject;

import io.swagger.annotations.*;
import java.io.InputStream;

import org.apache.cxf.jaxrs.ext.MessageContext;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;

import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
@Path("/tags")

@Api(description = "the tags API")

public class TagsApi  {

  @Context MessageContext securityContext;

TagsApiService delegate = new TagsApiServiceImpl();

    @GET

    @Produces({ "application/json" })
    @ApiOperation(value = "Get All Tags ", notes = "This operation can be used to retrieve a list of tags that are already added to APIs.  `X-WSO2-Tenant` header can be used to retrive tags that belongs to a different tenant domain. If not specified super tenant will be used. If Authorization header is present in the request, the user's tenant associated with the access token will be used.  **NOTE:** * This operation does not require an Authorization header by default. But in order to see a restricted API's tags, you need to provide Authorization header. ", response = TagListDTO.class, authorizations = {
        @Authorization(value = "OAuth2Security", scopes = {

        })
    }, tags={ "Tags" })
    @ApiResponses(value = {
        @ApiResponse(code = 200, message = "OK. Tag list is returned. ", response = TagListDTO.class),
        @ApiResponse(code = 304, message = "Not Modified. Empty body because the client has already the latest version of the requested resource. ", response = Void.class),
        @ApiResponse(code = 404, message = "Not Found. The specified resource does not exist.", response = ErrorDTO.class),
        @ApiResponse(code = 406, message = "Not Acceptable. The requested media type is not supported.", response = ErrorDTO.class) })
    public Response tagsGet( @ApiParam(value = "Maximum size of resource array to return. ", defaultValue="25") @DefaultValue("25") @QueryParam("limit") Integer limit,  @ApiParam(value = "Starting point within the complete list of items qualified. ", defaultValue="0") @DefaultValue("0") @QueryParam("offset") Integer offset,  @ApiParam(value = "For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be   retrieved from. " )@HeaderParam("X-WSO2-Tenant") String xWSO2Tenant,  @ApiParam(value = "Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resourec. " )@HeaderParam("If-None-Match") String ifNoneMatch) throws APIManagementException{
        return delegate.tagsGet(limit, offset, xWSO2Tenant, ifNoneMatch, securityContext);
    }
}


text:
static char *expected_udid = NULL;
static char *app_bundle_id = NULL;
static char *app_key = NULL;

static void print_app(const void *key, const void *value, void *context)
{
  if ((key == NULL) || (value == NULL))
  {
    return;
  }

  NSString *got_bundle_id = (__bridge NSString*)key;
  NSString *expected_bundle_id = [NSString stringWithUTF8String:app_bundle_id];

  if ([got_bundle_id caseInsensitiveCompare:expected_bundle_id] != NSOrderedSame)
  {
    return;
  }

  NSString *expected_app_key = [NSString stringWithUTF8String:app_key];

  NSDictionary *dict = (__bridge NSDictionary*)value;
  for (NSString *key in dict)
  {
    if ([key caseInsensitiveCompare:expected_app_key] == NSOrderedSame)
    {
      printfNS(@"%@\n", [dict objectForKey:key]);
      device_unregister(0);
      return;
    }
  }

  device_unregister(1);
}

static void on_device_connected(struct am_device *device)
{
  if (!device_matches(device, expected_udid))
  {
    return;
  }

  device_delayed_unregister_aborted = true;
  device_connect(device);

  CFDictionaryRef apps;
  ASSERT_OR_EXIT(!AMDeviceLookupApplications(device, 0, &apps), "!AMDeviceLookupApplications\n");

  CFDictionaryApplyFunction(apps, print_app, NULL);
  CFRelease(apps);

  device_unregister(1);
}

int get_app_prop(int argc, char *argv[])
{
  int flag;
  char *endptr;
  int64_t timeout = -1;

  while ((flag = getopt(argc, argv, "u:t:")) != -1)
  {
    switch (flag)
    {
      case 'u':
        expected_udid = optarg;
        break;

      case 't':
        timeout = strtoll(optarg, &endptr, 10);
        break;

      default:
        help(argc, argv);
        return 1;
    }
  }

  argc -= optind;
  argv += optind;

  if (argc != 2)
  {
    return invalid_usage(argc, argv);
  }

  app_bundle_id = argv[0];
  app_key = argv[1];

  device_delayed_unregister_status = 1;
  device_register(on_device_connected, timeout);
  return 1;
}


text:
// Copyright (c) 1997
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel).  All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s)     : Wieger Wesselink <wieger@cs.ruu.nl>

#include <CGAL/Polygon_2/Polygon_2_simplicity.h>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <set>
#include <vector>

/// \cond SKIP_IN_MANUAL

namespace CGAL {

//-----------------------------------------------------------------------//
//                          is_simple_2
//-----------------------------------------------------------------------//
// uses PolygonTraits::Less_xy_2
//      PolygonTraits::less_xy_2
//      PolygonTraits::Orientation_2
//      PolygonTraits::orientation_2
//      PolygonTraits::Point_2

template <class ForwardIterator, class PolygonTraits>
bool is_simple_2(ForwardIterator first,
                      ForwardIterator last,
                      const PolygonTraits& traits)
{
    return is_simple_polygon(first, last, traits);
}

//-----------------------------------------------------------------------//
//                          left_vertex_2
//-----------------------------------------------------------------------//
// uses PolygonTraits::Less_xy_2 and less_xy_2_object()

template <class ForwardIterator, class PolygonTraits>
ForwardIterator left_vertex_2(ForwardIterator first,
                                   ForwardIterator last,
                                   const PolygonTraits&traits)
{
    CGAL_polygon_precondition(first != last);
    return std::min_element(first, last, traits.less_xy_2_object());
}

//-----------------------------------------------------------------------//
//                          right_vertex_2
//-----------------------------------------------------------------------//
// uses PolygonTraits::Less_xy_2 and less_xy_2_object()

template <class ForwardIterator, class PolygonTraits>
ForwardIterator right_vertex_2(ForwardIterator first,
                                    ForwardIterator last,
                                    const PolygonTraits &traits)
{
    CGAL_polygon_precondition(first != last);
    return std::max_element(first, last, traits.less_xy_2_object());
}

//-----------------------------------------------------------------------//
//                          top_vertex_2
//-----------------------------------------------------------------------//
// uses PolygonTraits::Less_yx_2 and less_yx_2_object()

template <class ForwardIterator, class PolygonTraits>
ForwardIterator top_vertex_2(ForwardIterator first,
                                  ForwardIterator last,
                                  const PolygonTraits&traits)
{
    CGAL_polygon_precondition(first != last);
    return std::max_element(first, last, traits.less_yx_2_object());
}

//-----------------------------------------------------------------------//
//                          bottom_vertex_2
//-----------------------------------------------------------------------//
// uses PolygonTraits::Less_yx_2 and less_yx_2_object()

template <class ForwardIterator, class PolygonTraits>
ForwardIterator bottom_vertex_2(ForwardIterator first,
                                     ForwardIterator last,
                                     const PolygonTraits&traits)
{
    CGAL_polygon_precondition(first != last);
    return std::min_element(first, last, traits.less_yx_2_object());
}

//-----------------------------------------------------------------------//
//                          area_2
//-----------------------------------------------------------------------//
// uses Traits::
//  implemented in header file

//-----------------------------------------------------------------------//
//                          is_convex_2
//-----------------------------------------------------------------------//
// uses Traits::Less_xy_2 and less_xy_2_object()
//      Traits::Orientation_2 and orientation_2_object()
//      Traits::Equal_2 for filtering repeated points

template <class ForwardIterator, class Traits>
bool is_convex_2(ForwardIterator first,
                      ForwardIterator last,
                      const Traits& traits)
{
  ForwardIterator previous = first;
  if (previous == last) return true;

  ForwardIterator current = previous; ++current;
  if (current == last) return true;

  ForwardIterator next = current; ++next;
  if (next == last) return true;

  typename Traits::Equal_2 equal = traits.equal_2_object();

  while(equal(*previous, *current)) {
    current = next;
    ++next;
    if (next == last) return true;
  }

  typename Traits::Less_xy_2 less_xy_2 = traits.less_xy_2_object();
  typename Traits::Orientation_2 orientation = traits.orientation_2_object();
  // initialization
  bool HasClockwiseTriples = false;
  bool HasCounterClockwiseTriples = false;
  bool Order = less_xy_2(*previous, *current);
  int NumOrderChanges = 0;

  do {
  switch_orient:
    switch (orientation(*previous, *current, *next)) {
      case CLOCKWISE:
        HasClockwiseTriples = true;
        break;
      case COUNTERCLOCKWISE:
        HasCounterClockwiseTriples = true;
        break;
      case ZERO:
	if(equal(*current, *next)) {
	  if(next == first) {
	    first = current;
	  }
	  ++next;
	  if (next == last)
	    next = first;
	  goto switch_orient;
	}
	break;
    }

    bool NewOrder = less_xy_2(*current, *next);
    if (Order != NewOrder) NumOrderChanges++;

    if (NumOrderChanges > 2) {
#ifdef CGAL_POLYGON_DEBUG
std::cout << "too many order changes: not convex!" << std::endl;
#endif
      return false;
    }

    if (HasClockwiseTriples && HasCounterClockwiseTriples) {
#ifdef CGAL_POLYGON_DEBUG
std::cout << "polygon not locally convex!" << std::endl;
#endif
      return false;
    }

    previous = current;
    current = next;
    ++next;
    if (next == last) next = first;
    Order = NewOrder;
  }
  while (previous != first);

  return true;
}

//-----------------------------------------------------------------------//
//                          oriented_side_2
//-----------------------------------------------------------------------//
// uses Traits::Less_xy_2
//      Traits::Compare_x_2 compare_x_2_object()
//      Traits::Compare_y_2 compare_y_2_object()
//      Traits::Orientation_2 and orientation_2_object()

template <class ForwardIterator, class Point, class Traits>
Oriented_side oriented_side_2(ForwardIterator first,
                                        ForwardIterator last,
                                        const Point& point,
                                        const Traits& traits)
{
  Orientation o = orientation_2(first, last, traits);
  CGAL_polygon_assertion(o != COLLINEAR);

  Bounded_side b = bounded_side_2(first, last, point, traits);
  switch (b) {
    case ON_BOUNDARY:
      return ON_ORIENTED_BOUNDARY;

    case ON_BOUNDED_SIDE:
      return (o == CLOCKWISE) ?  ON_NEGATIVE_SIDE : ON_POSITIVE_SIDE;

    default:
    //case ON_UNBOUNDED_SIDE:
      return (o == CLOCKWISE) ?  ON_POSITIVE_SIDE : ON_NEGATIVE_SIDE;
  }
}

//-----------------------------------------------------------------------//
//                          bounded_side_2
//-----------------------------------------------------------------------//
// uses Traits::Compare_x_2 compare_x_2_object()
//      Traits::Compare_y_2 compare_y_2_object()
//      Traits::Orientation_2 and orientation_2_object()
//
// returns ON_BOUNDED_SIDE, ON_BOUNDARY or ON_UNBOUNDED_SIDE

/*
   Implementation: we shoot a horizontal ray from the point to the right
   and count the number of intersections with polygon segments.
   If the number of intersections is odd, the point is inside.
   We don't count intersections with horizontal segments.
   With non-horizontal segments, the top vertex is considered to be part of
   the segment, but the bottom vertex is not. (Segments are half-closed).
*/

namespace i_polygon {

template <class Point, class Orientation_2, class CompareX_2>
int which_side_in_slab(Point const &point, Point const &low, Point const &high,
    Orientation_2 &orientation_2, CompareX_2 &compare_x_2)
// returns -1 if point is left of segment <low, high>, 0 if its on the segment
// and 1 if it is to the right
// precondition: low.y < point.y < high.y
{
    // first we try to decide on x coordinate values alone
    // This is an optimisation (whether this is really faster for
    // a homogeneous kernel is not clear, as comparisons can be expensive.
    Comparison_result low_x_comp_res = compare_x_2(point, low);
    Comparison_result high_x_comp_res = compare_x_2(point, high);
    if (low_x_comp_res == SMALLER) {
        if (high_x_comp_res == SMALLER)
	    return -1;
    } else {
        switch (high_x_comp_res) {
	  case LARGER: return 1;
	  case SMALLER: break;
	  case EQUAL: return (low_x_comp_res == EQUAL) ? 0 : 1;
	}
    }
    switch (orientation_2(low, point, high)) {
      case LEFT_TURN: return 1;
      case RIGHT_TURN: return -1;
      default: return 0;
    }
}

}  // end namespace i_polygon

template <class ForwardIterator, class Point, class PolygonTraits>
Bounded_side bounded_side_2(ForwardIterator first,
                                      ForwardIterator last,
                                      const Point& point,
                                      const PolygonTraits& traits)
{

  ForwardIterator current = first;
  if (current == last) return ON_UNBOUNDED_SIDE;

  ForwardIterator next = current; ++next;
  if (next == last) return ON_UNBOUNDED_SIDE;

  typename PolygonTraits::Compare_x_2 compare_x_2 = traits.compare_x_2_object();
  typename PolygonTraits::Compare_y_2 compare_y_2 = traits.compare_y_2_object();
  typename PolygonTraits::Orientation_2 orientation_2 = traits.orientation_2_object();
  bool IsInside = false;
  Comparison_result cur_y_comp_res = compare_y_2(*current, point);

  do // check if the segment (current,next) intersects
     // the ray { (t,point.y()) | t >= point.x() }
  {
    Comparison_result next_y_comp_res = compare_y_2(*next, point);

    switch (cur_y_comp_res) {
      case SMALLER:
        switch (next_y_comp_res) {
          case SMALLER:
            break;
          case EQUAL:
            switch (compare_x_2(point, *next)) {
              case SMALLER: IsInside = !IsInside; break;
              case EQUAL:   return ON_BOUNDARY;
              case LARGER:  break;
            }
            break;
          case LARGER:
	    switch (i_polygon::which_side_in_slab(point, *current, *next,
	                orientation_2, compare_x_2)) {
	      case -1: IsInside = !IsInside; break;
	      case  0: return ON_BOUNDARY;
	    }
            break;
        }
        break;
      case EQUAL:
        switch (next_y_comp_res) {
          case SMALLER:
            switch (compare_x_2(point, *current)) {
              case SMALLER: IsInside = !IsInside; break;
              case EQUAL:   return ON_BOUNDARY;
              case LARGER:  break;
            }
            break;
          case EQUAL:
	    switch (compare_x_2(point, *current)) {
	      case SMALLER:
		if (compare_x_2(point, *next) != SMALLER)
		    return ON_BOUNDARY;
	        break;
	      case EQUAL: return ON_BOUNDARY;
	      case LARGER:
		if (compare_x_2(point, *next) != LARGER)
		    return ON_BOUNDARY;
	        break;
	    }
            break;
          case LARGER:
            if (compare_x_2(point, *current) == EQUAL) {
              return ON_BOUNDARY;
            }
            break;
        }
        break;
      case LARGER:
        switch (next_y_comp_res) {
          case SMALLER:
	    switch (i_polygon::which_side_in_slab(point, *next, *current,
	                orientation_2, compare_x_2)) {
	      case -1: IsInside = !IsInside; break;
	      case  0: return ON_BOUNDARY;
	    }
            break;
          case EQUAL:
            if (compare_x_2(point, *next) == EQUAL) {
              return ON_BOUNDARY;
            }
            break;
          case LARGER:
            break;
        }
        break;
    }

    current = next;
    cur_y_comp_res = next_y_comp_res;
    ++next;
    if (next == last) next = first;
  }
  while (current != first);

  return IsInside ? ON_BOUNDED_SIDE : ON_UNBOUNDED_SIDE;
}

//-----------------------------------------------------------------------//
//                          orientation_2
//-----------------------------------------------------------------------//
// uses Traits::Less_xy_2 (used by left_vertex_2)
//      Traits::orientation_2_object()

template <class ForwardIterator, class Traits>
Orientation orientation_2(ForwardIterator first,
                                    ForwardIterator last,
                                    const Traits& traits)
{
  CGAL_polygon_precondition(is_simple_2(first, last, traits));

  ForwardIterator i = left_vertex_2(first, last, traits);

  ForwardIterator prev = (i == first) ? last : i;
  --prev;

  ForwardIterator next = i;
  ++next;
  if (next == last)
    next = first;

  // if the range [first,last) contains less than three points, then some
  // of the points (prev,i,next) will coincide

  // return the orientation of the triple (prev,i,next)
  return traits.orientation_2_object()(*prev, *i, *next);
}

} //namespace CGAL

/// \endcond


text:
'use strict';

require.config({
	paths: {
    async: "../libs/requirejs-plugins/src/async",
    angular: '../libs/angular/angular',
    angularRoute: '../libs/angular-route/angular-route',
    angularMocks: '../libs/angular-mocks/angular-mocks',
    jquery: '../libs/jquery/dist/jquery',
    bootstrap: '../libs/bootstrap/dist/js/bootstrap',
    text: '../libs/requirejs-text/text',
    json: '../libs/requirejs-plugins/src/json',
    firebase : '../libs/firebase/firebase',
    angularfire : '../libs/angularfire/dist/angularfire.min'
  },
	shim: {
    "bootstrap": {
      deps: ["jquery"]
    },
		'angular' : {'exports' : 'angular'},
		'angularRoute': ['angular'],
		'angularMocks': {
			deps:['angular'],
			'exports':'angular.mock'
		},
    'json' : {
      deps:['text'],
      'exports':'json'
    },
    'firebase': {
      exports : 'firebase',
      deps: ['angular']
    },
    'angularfire': {
      deps: ['angular']
    }
	},
	priority: [
		"angular"
	]
});

window.name = "NG_DEFER_BOOTSTRAP!";

require([
  'angular',
  'angularRoute',
  'jquery',
  'bootstrap',
  'configs',
  'app',
  'controllers',
  'services',
  'directives',
  'filters',
  'routes',
  'json',
  'firebase',
  'angularfire'
], function () {
  angular.bootstrap(document, ['app']);
});


text:
package activitytest.com.example.bottomnavigationbartest.util;

import android.text.TextUtils;
import android.util.Log;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

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

import activitytest.com.example.bottomnavigationbartest.db.Job;
import activitytest.com.example.bottomnavigationbartest.db.MsgL;
import activitytest.com.example.bottomnavigationbartest.db.User;

/**
 * Created by pc on 2017/9/12.
 */

public class Utility {
    public static boolean handleStatusResponse(String response){
        Log.d("LoginFragment","MMMMMMMMM:status"+response);
        if(!TextUtils.isEmpty(response)) {
            Log.d("LoginFragment","response11"+response);
            try {
                JSONObject object = new JSONObject(response);
                String status = object.getString("status");

                return status.equals("1");

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return false;
    }
    public static User handleUserResponse(String response){
        Log.d("FirstFragment","用户UserList:"+response);
        if(!TextUtils.isEmpty(response)) {
            try{
                JSONObject jsonObject = new JSONObject(response);
                User user = new User();
                user.setUserName(jsonObject.getString("username"));
                if(jsonObject.getString("phoneNumber")!="") {
                    user.setPhone(jsonObject.getString("phoneNumber"));
                }
                return user;
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return null;

    }
    public static String handleStringResponse(String response,String keyword){
        Log.d("FirstFragment","用户UserList:"+response);
        if(!TextUtils.isEmpty(response)) {
            try{
                JSONObject jsonObject = new JSONObject(response);
                String key = jsonObject.getString(keyword);

                return key;
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return null;

    }
    public static int handleIntResponse(String response,String keyword){
        Log.d("FirstFragment","用户UserList:"+response);
        if(!TextUtils.isEmpty(response)) {
            try{
                JSONObject jsonObject = new JSONObject(response);
                int key = jsonObject.getInt(keyword);

                return key;
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        return 0;

    }

    //处理Job数据
    public static List<Job> handleJobResponse(String response){
        Log.d("FirstFragment","工作JobList:"+response);

        Log.d("FirstFragment","工作isEmpty"+TextUtils.isEmpty(response));
        if(!TextUtils.isEmpty(response)){

            try{
                JSONObject jsonObject = new JSONObject(response);
                List<Job> jobList = new ArrayList<>();
                JSONArray allJobs = jsonObject.getJSONArray("joblist");
                Log.d("FirstFragment","jobLength"+allJobs.length());
                for(int i = 0;i<allJobs.length();i++) {
                    JSONObject jobObject = allJobs.getJSONObject(i);

                    Job job = new Job();
                    Log.d("PublishFragment","日期GETDATE"+jobObject.getString("publishTime"));
                    job.setJobId(jobObject.getInt("jobId"));
                    job.setWorkPlace(jobObject.getString("address"));
                    job.setWorkName(jobObject.getString("jobName"));
                    job.setWorkPay(jobObject.getInt("salary"));
                    job.setWorkContent(jobObject.getString("detail"));
                    job.setWorkTime(jobObject.getString("workTime"));
                    job.setPublishTime(jobObject.getString("publishTime").substring(0,10));
                    job.setEmployerId(jobObject.getInt("employer_Id"));
                    job.setPhoneNum(jobObject.getString("phoneNumber"));
                    job.setWorkHour(jobObject.getInt("workHour"));
                    job.setStartTime(jobObject.getString("startTime"));
                    job.setEndTime(jobObject.getString("endTime"));
                    job.setStatus(jobObject.getInt("status"));

                    jobList.add(job);
                }

                Log.d("publishWanted","工作列表2");
                return jobList;

            }catch (JSONException e){
                e.printStackTrace();
            }

        }
        return null;
    }
    //处理Job数据
    public static List<Job> handlejobResponse(String response){
        Log.d("FirstFragment","工作JobList:"+response);

        Log.d("FirstFragment","工作isEmpty"+TextUtils.isEmpty(response));
        if(!TextUtils.isEmpty(response)){

            try{
                JSONObject jsonObject = new JSONObject(response);
                List<Job> jobList = new ArrayList<>();
                JSONArray allJobs = jsonObject.getJSONArray("jobList");
                Log.d("FirstFragment","jobLength"+allJobs.length());
                for(int i = 0;i<allJobs.length();i++) {
                    JSONObject jobObject = allJobs.getJSONObject(i);

                    Job job = new Job();
                    job.setJobId(jobObject.getInt("jobId"));
                    job.setWorkPlace(jobObject.getString("address"));
                    job.setWorkName(jobObject.getString("jobName"));
                    job.setWorkPay(jobObject.getInt("salary"));
                    job.setWorkContent(jobObject.getString("detail"));
                    job.setWorkTime(jobObject.getString("workTime"));

                    job.setPublishTime(jobObject.getString("publishTime").substring(0,10));
                    job.setEmployerId(jobObject.getInt("employer_Id"));
                    job.setPhoneNum(jobObject.getString("phoneNumber"));
                    job.setWorkHour(jobObject.getInt("workHour"));
                    job.setStartTime(jobObject.getString("startTime"));
                    job.setEndTime(jobObject.getString("endTime"));
                    job.setStatus(jobObject.getInt("status"));
                    jobList.add(job);
                }

                return jobList;

            }catch (JSONException e){
                e.printStackTrace();
            }

        }
        return null;
    }
    public static List<MsgL> handleMsgResponse(String response){
        if(!TextUtils.isEmpty(response)) {
            try {
                JSONObject jsonObject = new JSONObject(response);
                List<MsgL> msgList = new ArrayList<>();
                JSONArray allMsgs = jsonObject.getJSONArray("msglist");
                Log.d("FirstFragment", "jobLength" + allMsgs.length());
                for (int i = 0; i < allMsgs.length(); i++) {
                    JSONObject jobObject = allMsgs.getJSONObject(i);
                    MsgL msgL = new MsgL();
                    msgL.setFromId(jobObject.getInt("fromId"));
                    msgL.setToId(jobObject.getInt("toId"));
                    msgL.setInfo(jobObject.getString("info"));
                    msgL.setMsgId(jobObject.getInt("msgId"));
                    msgList.add(msgL);

                }
                return msgList;
            }catch(Exception e){
                e.printStackTrace();
                }

        }
        return null;
    }
    public static List<Job> handlejobStatusResponse(String response){
        Log.d("FirstFragment","工作JobList:"+response);

        Log.d("FirstFragment","工作isEmpty"+TextUtils.isEmpty(response));
        if(!TextUtils.isEmpty(response)){

            try{
                JSONObject jsonObject = new JSONObject(response);
                List<Job> jobList = new ArrayList<>();
                JSONArray allJobs = jsonObject.getJSONArray("jobList");
                Log.d("FirstFragment","jobLength"+allJobs.length());
                for(int i = 0;i<allJobs.length();i++) {
                    JSONObject jobObject = allJobs.getJSONObject(i);

                    if(jobObject.getInt("status")==1) {
                        Job job = new Job();
                        job.setJobId(jobObject.getInt("jobId"));
                        job.setWorkPlace(jobObject.getString("address"));
                        job.setWorkName(jobObject.getString("jobName"));
                        job.setWorkPay(jobObject.getInt("salary"));
                        job.setWorkContent(jobObject.getString("detail"));
                        job.setWorkTime(jobObject.getString("workTime"));

                        job.setPublishTime(jobObject.getString("publishTime").substring(0, 10));
                        job.setEmployerId(jobObject.getInt("employer_Id"));
                        job.setPhoneNum(jobObject.getString("phoneNumber"));
                        job.setWorkHour(jobObject.getInt("workHour"));
                        job.setStartTime(jobObject.getString("startTime"));
                        job.setEndTime(jobObject.getString("endTime"));
                        job.setStatus(jobObject.getInt("status"));
                        jobList.add(job);
                    }
                }

                return jobList;

            }catch (JSONException e){
                e.printStackTrace();
            }

        }
        return null;
    }

}


text:
==============
 mgsimdev-lcd
==============

-------------------------------------------------
 Character matrix display pseudo-device in MGSim
-------------------------------------------------

:Author: MGSim was created by Mike Lankamp. MGSim is now under
   stewardship of the Microgrid project. This manual page was written
   by Raphael 'kena' Poss.
:Date: August 2012
:Copyright: Copyright (C) 2008-2012 the Microgrid project.
:Version: PACKAGE_VERSION
:Manual section: 7

DESCRIPTION
===========

The MG matrix display is text-oriented output device. It provides both
grid addressing of individual characters and a serial interface with
automatic management of line feeds, tabs and scrolling.

The matrix display is rendered in text mode on the terminal where
``mgsim`` runs, using ANSI escape codes.

An I/O device of this type can be specified in MGSim using the device
type ``LCD``.

CONFIGURATION
=============

Each ``lcd`` device support the following configuration variables:

``<dev>:LCDDisplayWidth``, ``<dev>:LCDDisplayHeight``
   Size in characters of the display device.

``<dev>:LCDOutputRow``, ``<dev>:LCDOutputColumn``
   Position in the terminal where the matrix display is rendered.

``<dev>:LCDBackgroundColor``, ``<dev>:LCDForegroundColor``
   Terminal colors to use when rendering the matrix display. This
   uses standard ANSI color codes.

``<dev>:LCDTraceFile``
   File name to output every byte sent to the matrix display.

PROTOCOL
========

Writing characters at specific positions
----------------------------------------

Sending *I/O write* requests to the first WxH bytes, where W and H are
the display size in characters, causes the corresponding characters to
be displayed. Only printable characters are recognized.

The characters are organized in row-major order, that is bytes
0...(W-1) correspond to the first row of characters, W...(2W-1) to the
second row, and so on.

Accessing the display size
--------------------------

When queried using an *I/O read* request to offset 0 and size 32 bits,
the pseudo-device will report the matrix display size.  The low-order
16 bits indicate the height, and the high-order 16 bits indicate the
width. This must be accessed as a single 32-bit operation.

Serial output
-------------

The special offset W*H supports a serial output terminal with internal
display cursor.  Each character sent at that offset is printed at the
current cursor position, and the cursor position is modified
automatically. The pseudo-terminal recognizes newline (\\n),
tabulations (\\t), form feeds (\\f), carriage returns (\\r) and
backspaces (\\b). Lines wrap automatically, and outputs beyond the last
display line cause the existing characters to "scroll up".

INTERFACE
=========

The device presents itself to the I/O bus as a single device.

========== ============ ====== =============================
Address    Access width Mode   Description
========== ============ ====== =============================
0          4 bytes      Read   Display size (see below)
0 to W*H-1 (any)        Write  Grid-addressed output buffer
W*H        1 byte       Write  Serial output
========== ============ ====== =============================

SEE ALSO
========

mgsim(1), mgsimdoc(7)

BUGS
====

Report bugs & suggest improvements to PACKAGE_BUGREPORT.


text:
'use strict';

var path = require('path');

var configuration = {
  bucket: 'c-launcher-staticsource-mfs-20140708',
  region: 'ap-southeast-1',
  mongodb: 'mongodb://10.60.145.18:27017/anthcraft',
  property: path.join(__dirname, 'settings.properties'),
  relpath: {
    root: '/home/webadmin/anthCraft-dist/public/resources',
    theme: 'themes',
    preview: 'preview',
    thumbnails: 'thumbnail'
  },
  interval: '*/6 * * * * *',
  count: 1
};

exports = module.exports = configuration;


text:
'use strict';

angular.module('ilmomasiina.controllers')
  .controller('LandingCtrl', ['$scope', function($scope) {
    $scope.hello = 'Hello World!';
  }]);