text:
import os, datetime
import numpy as np
import tensorflow as tf
from tensorflow.contrib.layers.python.layers import batch_norm
from DataLoader import *

# Dataset Parameters
batch_size = 100
load_size = 128
fine_size = 100
c = 3

# Note: may want to actually recompute this, or just do away with it...
data_mean = np.asarray([0.45834960097,0.44674252445,0.41352266842])

# Training Parameters
init_lr = 0.01
lr_decay_factor = 10
max_decays = 3
momentum = 0.9
beta = 0.0005

dropout = 0.5 # Dropout, probability to keep units
num_epochs = 75
training_iters = (100000 / batch_size) * num_epochs     # Based on VGG paper
step_display = 50
step_save = training_iters / num_epochs     # Once per epoch
path_save = './saved_models/vgg_receptor_bn'
start_from = '18000'

eval_only = False

def batch_norm_layer(x, train_phase, scope_bn):
    return batch_norm(x, decay=0.9, center=True, scale=True,
    updates_collections=None,
    is_training=train_phase,
    reuse=None,
    trainable=True,
    scope=scope_bn)

weights = {
    'wc1': tf.Variable(tf.random_normal([3, 3, 3, 64], stddev=np.sqrt(2./(3*3*3)))),
    'wc2': tf.Variable(tf.random_normal([3, 3, 64, 128], stddev=np.sqrt(2./(3*3*64)))),
    'wc3': tf.Variable(tf.random_normal([3, 5, 128, 256], stddev=np.sqrt(2./(3*5*128)))),
    'wc4': tf.Variable(tf.random_normal([5, 3, 256, 256], stddev=np.sqrt(2./(5*3*256)))),
    'wc5': tf.Variable(tf.random_normal([3, 5, 256, 512], stddev=np.sqrt(2./(3*5*256)))),
    'wc6': tf.Variable(tf.random_normal([5, 3, 512, 512], stddev=np.sqrt(2./(5*3*512)))),

    'wf7': tf.Variable(tf.random_normal([25088, 4096], stddev=np.sqrt(2./25088))),
    'wf8': tf.Variable(tf.random_normal([4096, 4096], stddev=np.sqrt(2./4096))),
    'wo': tf.Variable(tf.random_normal([4096, 100], stddev=np.sqrt(2./4096)))
}

biases = {
    'bc1': tf.Variable(tf.zeros(64)),
    'bc2': tf.Variable(tf.zeros(128)),
    'bc3': tf.Variable(tf.zeros(256)),
    'bc4': tf.Variable(tf.zeros(256)),
    'bc5': tf.Variable(tf.zeros(512)),
    'bc6': tf.Variable(tf.zeros(512)),

    'bf7': tf.Variable(tf.zeros(4096)),
    'bf8': tf.Variable(tf.zeros(4096)),
    'bo': tf.Variable(tf.zeros(100))
}

def vgg_receptor(x, keep_dropout, train_phase):
    # Conv3-64 + ReLU + 2x2 Pool
    conv1 = tf.nn.conv2d(x, weights['wc1'], strides=[1, 1, 1, 1], padding='SAME')
    conv1 = batch_norm_layer(conv1, train_phase, 'bn1')
    conv1 = tf.nn.relu(tf.nn.bias_add(conv1, biases['bc1']))
    pool1 = tf.nn.max_pool(conv1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')

    # Conv3-128 + ReLU + 2x2 Pool
    conv2 = tf.nn.conv2d(pool1, weights['wc2'], strides=[1, 1, 1, 1], padding='SAME')
    conv2 = batch_norm_layer(conv2, train_phase, 'bn2')
    conv2 = tf.nn.relu(tf.nn.bias_add(conv2, biases['bc2']))
    pool2 = tf.nn.max_pool(conv2, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')

    # Conv5-256 + ReLU + Conv3-256 + ReLU + 2x2 Pool
    conv3 = tf.nn.conv2d(pool2, weights['wc3'], strides=[1, 1, 1, 1], padding='SAME')
    conv3 = batch_norm_layer(conv3, train_phase, 'bn3')
    conv3 = tf.nn.relu(tf.nn.bias_add(conv3, biases['bc3']))
    conv4 = tf.nn.conv2d(conv3, weights['wc4'], strides=[1, 1, 1, 1], padding='SAME')
    conv4 = batch_norm_layer(conv4, train_phase, 'bn4')
    conv4 = tf.nn.relu(tf.nn.bias_add(conv4, biases['bc4']))
    pool3 = tf.nn.max_pool(conv4, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')

    # Conv5-512 + ReLU + Conv3-512 + ReLU + 2x2 Pool
    conv5 = tf.nn.conv2d(pool3, weights['wc5'], strides=[1, 1, 1, 1], padding='SAME')
    conv5 = batch_norm_layer(conv5, train_phase, 'bn5')
    conv5 = tf.nn.relu(tf.nn.bias_add(conv5, biases['bc5']))
    conv6 = tf.nn.conv2d(conv5, weights['wc6'], strides=[1, 1, 1, 1], padding='SAME')
    conv6 = batch_norm_layer(conv6, train_phase, 'bn6')
    conv6 = tf.nn.relu(tf.nn.bias_add(conv6, biases['bc6']))
    pool4 = tf.nn.max_pool(conv6, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')

    # FC + ReLU + Dropout
    fc7 = tf.reshape(pool4, [-1, weights['wf7'].get_shape().as_list()[0]])
    fc7 = tf.add(tf.matmul(fc7, weights['wf7']), biases['bf7'])
    fc7 = batch_norm_layer(fc7, train_phase, 'bn7')
    fc7 = tf.nn.relu(fc7)
    fc7 = tf.nn.dropout(fc7, keep_dropout)

    # FC + ReLU + Dropout
    fc8 = tf.add(tf.matmul(fc7, weights['wf8']), biases['bf8'])
    fc8 = batch_norm_layer(fc8, train_phase, 'bn8')
    fc8 = tf.nn.relu(fc8)
    fc8 = tf.nn.dropout(fc8, keep_dropout)

    # Output FC
    out = tf.add(tf.matmul(fc8, weights['wo']), biases['bo'])

    return out

# Construct dataloader
opt_data_train = {
    'data_h5': 'miniplaces_128_train.h5',
    'data_root': 'images/',   # MODIFY PATH ACCORDINGLY
    'data_list': 'development_kit/data/train.txt', # MODIFY PATH ACCORDINGLY
    'load_size': load_size,
    'fine_size': fine_size,
    'data_mean': data_mean,
    'randomize': True
    }
opt_data_val = {
    'data_h5': 'miniplaces_128_val.h5',
    'data_root': 'images/',   # MODIFY PATH ACCORDINGLY
    'data_list': 'development_kit/data/val.txt',   # MODIFY PATH ACCORDINGLY
    'load_size': load_size,
    'fine_size': fine_size,
    'data_mean': data_mean,
    'randomize': False
    }
opt_data_test = {
    'data_h5': 'miniplaces_128_test.h5',
    'data_root': 'images/',   # MODIFY PATH ACCORDINGLY
    'data_list': 'development_kit/data/test.txt',   # MODIFY PATH ACCORDINGLY
    'load_size': load_size,
    'fine_size': fine_size,
    'data_mean': data_mean,
    'randomize': False
    }

# loader_train = DataLoaderDisk(**opt_data_train)
# loader_val = DataLoaderDisk(**opt_data_val)
if not eval_only:
    print("Loading train data...", flush=True)
    loader_train = DataLoaderH5(**opt_data_train)

print("Loading validation data...", flush=True)
loader_val = DataLoaderH5(**opt_data_val)

print("Loading test data...", flush=True)
loader_test = DataLoaderH5(**opt_data_test)

# tf Graph input
x = tf.placeholder(tf.float32, [None, fine_size, fine_size, c])
y = tf.placeholder(tf.int64, None)
keep_dropout = tf.placeholder(tf.float32)
train_phase = tf.placeholder(tf.bool)

# Construct model
logits = vgg_receptor(x, keep_dropout, train_phase)

# Define loss and optimizer
loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=y, logits=logits))
l2_regularizer= sum(tf.nn.l2_loss(weights[key]) for key in weights.keys())
loss = tf.reduce_mean(loss + beta * l2_regularizer)
lr_placeholder = tf.placeholder(tf.float32, [])
train_optimizer = tf.train.MomentumOptimizer(learning_rate=lr_placeholder, momentum=momentum).minimize(loss)

# Evaluate model
accuracy1 = tf.reduce_mean(tf.cast(tf.nn.in_top_k(logits, y, 1), tf.float32))
accuracy5 = tf.reduce_mean(tf.cast(tf.nn.in_top_k(logits, y, 5), tf.float32))

predict = tf.nn.top_k(logits, 5)

# define initialization
init = tf.global_variables_initializer()

# define saver (only saves best so far)
saver = tf.train.Saver(max_to_keep=1)

# define summary writer
#writer = tf.train.SummaryWriter('.', graph=tf.get_default_graph())

# Launch the graph
with tf.Session() as sess:
    # Initialization
    current_lr = init_lr
    if len(start_from)>1:
        saver.restore(sess, path_save+"-"+start_from)
        step = int(start_from)
    else:
        sess.run(init)
        step = 0

    if not eval_only:
        best_val_loss = float('inf')
        val_loss_sum = 0.0
        total_decays = 0

        while step < training_iters:

            # Load a batch of training data
            images_batch, labels_batch = loader_train.next_batch(batch_size)

            if step % step_display == 0:
                print('[%s]:' %(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")), flush=True)

                # Calculate batch loss and accuracy on training set
                l, acc1, acc5 = sess.run([loss, accuracy1, accuracy5], feed_dict={x: images_batch, y: labels_batch, keep_dropout: 1., lr_placeholder: current_lr, train_phase: False})
                print("-Iter " + str(step) + ", Training Loss= " + \
                      "{:.6f}".format(l) + ", Accuracy Top1 = " + \
                      "{:.4f}".format(acc1) + ", Top5 = " + \
                      "{:.4f}".format(acc5), flush=True)

                # Calculate batch loss and accuracy on validation set
                images_batch_val, labels_batch_val = loader_val.next_batch(batch_size)
                l, acc1, acc5 = sess.run([loss, accuracy1, accuracy5], feed_dict={x: images_batch_val, y: labels_batch_val, keep_dropout: 1., lr_placeholder: current_lr, train_phase: False})
                val_loss_sum += l
                print("-Iter " + str(step) + ", Validation Loss= " + \
                      "{:.6f}".format(l) + ", Accuracy Top1 = " + \
                      "{:.4f}".format(acc1) + ", Top5 = " + \
                      "{:.4f}".format(acc5), flush=True)

            # Run optimization op (backprop)
            sess.run(train_optimizer, feed_dict={x: images_batch, y: labels_batch, keep_dropout: dropout, lr_placeholder: current_lr, train_phase: True})

            step += 1

            # End of epoch for model
            if step % step_save == 0:
                # Save model
                saver.save(sess, path_save, global_step=step)
                print("Model saved at Iter %d !" %(step), flush=True)

                # Check if learning rate should be decayed
                if val_loss_sum >= best_val_loss:
                    print("Validation loss sum did not improve (from %.6f to %.6f)" % (best_val_loss, val_loss_sum), flush=True)
                    current_lr /= lr_decay_factor
                    total_decays += 1
                    if total_decays > max_decays:
                        print("Exceeded maximum number of learning rate decays (%d); stopping early" % max_decays, flush=True)
                        break
                    else:
                        print("Decayed learning rate by factor %.2f to %.6f" % (lr_decay_factor, current_lr), flush=True)
                else:
                    print("Validation loss sum improved from %.6f to %.6f" % (best_val_loss, val_loss_sum), flush=True)
                # Reset values for new epoch
                best_val_loss = val_loss_sum
                val_loss_sum = 0.0

        print("Optimization Finished!", flush=True)

    # Evaluate on the whole validation set
    print('Evaluation on the whole validation set...', flush=True)
    num_batch = loader_val.size()//batch_size
    acc1_total = 0.
    acc5_total = 0.
    loader_val.reset()
    for i in range(num_batch):
        images_batch, labels_batch = loader_val.next_batch(batch_size)
        acc1, acc5 = sess.run([accuracy1, accuracy5], feed_dict={x: images_batch, y: labels_batch, keep_dropout: 1., lr_placeholder: current_lr, train_phase: False})
        acc1_total += acc1
        acc5_total += acc5
        print("Validation Accuracy Top1 = " + \
              "{:.4f}".format(acc1) + ", Top5 = " + \
              "{:.4f}".format(acc5), flush=True)

    acc1_total /= num_batch
    acc5_total /= num_batch
    print('Evaluation Finished! Accuracy Top1 = ' + "{:.4f}".format(acc1_total) + ", Top5 = " + "{:.4f}".format(acc5_total), flush=True)

    # Evaluate on the whole test set
    print('results on the test set', flush=True)
    num_batch = loader_test.size()//batch_size
    loader_test.reset()
    with open("pred.txt", "w") as f:
        for i in range(num_batch):
            images_batch, labels_batch = loader_test.next_batch(batch_size)
            labels = sess.run(predict, feed_dict={x: images_batch, keep_dropout: 1., lr_placeholder: current_lr, train_phase: False})[1]
            for j in range(len(labels)):
                item = labels[j]
                f.write("test/"+str((i * batch_size) + j + 1).zfill(8)+".jpg "+ " ".join([str(it) for it in item])+"\n")


text:
package net.sf.cglib.core;

import org.objectweb.asm.Attribute;
import org.objectweb.asm.Type;

abstract public class ClassInfo {

    protected ClassInfo() {
    }

    abstract public Type getType();
    abstract public Type getSuperType();
    abstract public Type[] getInterfaces();
    abstract public int getModifiers();

    public boolean equals(Object o) {
        if (o == null)
            return false;
        if (!(o instanceof ClassInfo))
            return false;
        return getType().equals(((ClassInfo)o).getType());
    }

    public int hashCode() {
        return getType().hashCode();
    }

    public String toString() {
        // TODO: include modifiers, superType, interfaces
        return getType().getClassName();
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="reference" name="DC.Type" />
<meta name="DC.Title" content="GROUP BY clause" />
<meta name="abstract" content="A GROUP BY clause, part of a selectExpression, groups a result into subsets that have matching values for one or more columns." />
<meta name="description" content="A GROUP BY clause, part of a selectExpression, groups a result into subsets that have matching values for one or more columns." />
<meta content="GROUP BY clause" name="DC.subject" />
<meta content="GROUP BY clause" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="rrefclauses.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="rrefsqlj32654" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>GROUP BY clause</title>

GROUP BY clause

A GROUP BY clause, part of a selectExpression, groups a result
into subsets that have matching values for one or more columns.

In each group, no two rows have the same value for the grouping column or
columns. NULLs are considered equivalent for grouping purposes. See
selectExpression for more information.

You typically use a GROUP BY clause in conjunction with an aggregate
expression.

Using the ROLLUP syntax, you can specify that multiple levels of grouping
should be computed at once.

Syntax

GROUP BY
{
    columnName [ , columnName ]* |
    ROLLUP ( columnName [ , columnName ]* )
}

The columnName
must be a column from
the current scope of the query; there can be no columns from a query block
outside the current scope. For example, if a GROUP BY clause is in a subquery,
it cannot refer to columns in the outer query.

The selectItems in
the selectExpression with
a GROUP BY clause must contain only aggregates or grouping columns.

Examples

-- find the average flying_times of flights grouped by
-- airport
SELECT AVG (flying_time), orig_airport
FROM Flights
GROUP BY orig_airport

SELECT MAX(city_name), region
FROM Cities, Countries
WHERE Cities.country_ISO_code = Countries.country_ISO_code
GROUP BY region

-- group by an a smallint
SELECT ID, AVG(SALARY)
FROM SAMP.STAFF
GROUP BY ID

-- Get the AVGSALARY and EMPCOUNT columns, and the DEPTNO column using the AS clause
-- And group by the WORKDEPT column using the correlation name OTHERS
SELECT OTHERS.WORKDEPT AS DEPTNO,
AVG(OTHERS.SALARY) AS AVGSALARY,
COUNT(*) AS EMPCOUNT
FROM SAMP.EMPLOYEE OTHERS
GROUP BY OTHERS.WORKDEPT

-- Compute sub-totals of Sales_History data, grouping it by Region, by
-- (Region, State), and by (Region, State, Product), as well as computing
-- an overall total of the sales for all Regions, States, and Products:
SELECT Region, State, Product, SUM(Sales) Total_Sales
FROM Sales_History
GROUP BY ROLLUP(Region, State, Product)

Parent topic: SQL clauses


text:
/**
 * ExisteConsecutivoInterno.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.ekomercio.edixcfdisecure;

public class ExisteConsecutivoInterno  implements java.io.Serializable {
    private java.lang.String cConsecutivoInterno;

    private java.lang.String cErrorMensaje;

    public ExisteConsecutivoInterno() {
    }

    public ExisteConsecutivoInterno(
           java.lang.String cConsecutivoInterno,
           java.lang.String cErrorMensaje) {
           this.cConsecutivoInterno = cConsecutivoInterno;
           this.cErrorMensaje = cErrorMensaje;
    }

    /**
     * Gets the cConsecutivoInterno value for this ExisteConsecutivoInterno.
     *
     * @return cConsecutivoInterno
     */
    public java.lang.String getCConsecutivoInterno() {
        return cConsecutivoInterno;
    }

    /**
     * Sets the cConsecutivoInterno value for this ExisteConsecutivoInterno.
     *
     * @param cConsecutivoInterno
     */
    public void setCConsecutivoInterno(java.lang.String cConsecutivoInterno) {
        this.cConsecutivoInterno = cConsecutivoInterno;
    }

    /**
     * Gets the cErrorMensaje value for this ExisteConsecutivoInterno.
     *
     * @return cErrorMensaje
     */
    public java.lang.String getCErrorMensaje() {
        return cErrorMensaje;
    }

    /**
     * Sets the cErrorMensaje value for this ExisteConsecutivoInterno.
     *
     * @param cErrorMensaje
     */
    public void setCErrorMensaje(java.lang.String cErrorMensaje) {
        this.cErrorMensaje = cErrorMensaje;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ExisteConsecutivoInterno)) return false;
        ExisteConsecutivoInterno other = (ExisteConsecutivoInterno) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.cConsecutivoInterno==null && other.getCConsecutivoInterno()==null) ||
             (this.cConsecutivoInterno!=null &&
              this.cConsecutivoInterno.equals(other.getCConsecutivoInterno()))) &&
            ((this.cErrorMensaje==null && other.getCErrorMensaje()==null) ||
             (this.cErrorMensaje!=null &&
              this.cErrorMensaje.equals(other.getCErrorMensaje())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getCConsecutivoInterno() != null) {
            _hashCode += getCConsecutivoInterno().hashCode();
        }
        if (getCErrorMensaje() != null) {
            _hashCode += getCErrorMensaje().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ExisteConsecutivoInterno.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("http://edixcfdisecure.ekomercio.com/", ">existeConsecutivoInterno"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("CConsecutivoInterno");
        elemField.setXmlName(new javax.xml.namespace.QName("http://edixcfdisecure.ekomercio.com/", "cConsecutivoInterno"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("CErrorMensaje");
        elemField.setXmlName(new javax.xml.namespace.QName("http://edixcfdisecure.ekomercio.com/", "cErrorMensaje"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
package mil.nga.geopackage;

import org.junit.Before;

/**
 * Abstract Test Case on a single GeoPackage
 *
 * @author osbornb
 */
public abstract class GeoPackageTestCase extends BaseTestCase {

	/**
	 * GeoPackage
	 */
	protected GeoPackage geoPackage = null;

	/**
	 * Constructor
	 */
	public GeoPackageTestCase() {

	}

	/**
	 * Get the geo package to test
	 *
	 * @return GeoPackage
	 */
	protected abstract GeoPackage getGeoPackage() throws Exception;

	@Before
	public void geoPackageSetUp() throws Exception {
		// Get the geo package
		geoPackage = getGeoPackage();
	}

}


text:
(function() {

  printLog = function() {
    var now = new Date().toISOString();
    var logLevel = arguments[0];
    var args = arguments[1];
    var origFunc = arguments[2];
    var logger = document.getElementById('debugLog');
    var prefix = '[' + now + '] ' + (logLevel ? logLevel + ': ' : '');
    for (var i = 0; i < args.length; i++) {
      logger.innerHTML += prefix + args[i] + '<br />';
    }
    origFunc.apply(undefined, args);
  };

  console.log_orig = console.log;
  console.log = function() { printLog('', arguments, console.log_orig); };

  console.info_orig = console.error;
  console.info = function() { printLog('INFO', arguments, console.info_orig); };

  console.warn_orig = console.error;
  console.warn = function() { printLog('WARN', arguments, console.warn_orig); };

  console.error_orig = console.error;
  console.error = function() { printLog('ERROR', arguments, console.error_orig); };

  // catch all errors
  window.onerror = function(msg, url, lineNo, columnNo, error) {
    console.error(msg);
    return false;
  }

  console.log("Debug Console enabled.")
})();


text:
<%#
 Copyright 2013-2018 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see http://www.jhipster.tech/
 for more information.

 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.
-%>

Configuration

    Filter (by prefix) <input type="text" [(ngModel)]="filter" class="form-control">
    Spring configuration

            Prefix
            Properties

            {{entry.prefix}}

{{key}}

                        {{entry.properties[key] | json}}

        {{key}}

                Property
                Value

                {{item.key}}

                    {{item.val}}


text:
/* ------------------------------------------------------------------------------
*
*  # Basic markers
*
*  Specific JS code additions for maps_google_markers.html page
*
*  Version: 1.0
*  Latest update: Aug 1, 2015
*
* ---------------------------------------------------------------------------- */

$(function() {

	// Setup map
	function initialize() {

		// Set coordinates
		var myLatlng = new google.maps.LatLng(52.374,4.898);

		// Options
		var mapOptions = {
			zoom: 10,
			center: myLatlng
		};

		// Apply options
		var map = new google.maps.Map($('.map-marker-simple')[0], mapOptions);
		var contentString = 'Amsterdam';

		// Add info window
		var infowindow = new google.maps.InfoWindow({
			content: contentString
		});

		// Add marker
		var marker = new google.maps.Marker({
			position: myLatlng,
			map: map,
			title: 'Hello World!'
		});

		// Attach click event
		google.maps.event.addListener(marker, 'click', function() {
			infowindow.open(map,marker);
		});

	};

	// Initialize map on window load
	google.maps.event.addDomListener(window, 'load', initialize);

});


text:
import uuid
import datetime

from oslo.config import cfg

from st2common.util import isotime
from st2common.exceptions.auth import TokenNotFoundError
from st2common.exceptions.auth import TTLTooLargeException
from st2common.models.db.auth import TokenDB, UserDB
from st2common.persistence.auth import Token, User
from st2common import log as logging

__all__ = [
    'create_token',
    'delete_token'
]

LOG = logging.getLogger(__name__)

def create_token(username, ttl=None, metadata=None):
    """
    :param username: Username of the user to create the token for. If the account for this user
                     doesn't exist yet it will be created.
    :type username: ``str``

    :param ttl: Token TTL (in seconds).
    :type ttl: ``int``

    :param metadata: Optional metadata to associate with the token.
    :type metadata: ``dict``
    """

    if ttl:
        if ttl > cfg.CONF.auth.token_ttl:
            msg = 'TTL specified %s is greater than max allowed %s.' % (
                ttl, cfg.CONF.auth.token_ttl
            )
            raise TTLTooLargeException(msg)
    else:
        ttl = cfg.CONF.auth.token_ttl

    if username:
        try:
            User.get_by_name(username)
        except:
            user = UserDB(name=username)
            User.add_or_update(user)

            extra = {'username': username, 'user': user}
            LOG.audit('Registered new user "%s".' % (username), extra=extra)

    token = uuid.uuid4().hex
    expiry = datetime.datetime.utcnow() + datetime.timedelta(seconds=ttl)
    expiry = isotime.add_utc_tz(expiry)
    token = TokenDB(user=username, token=token, expiry=expiry, metadata=metadata)
    Token.add_or_update(token)

    username_string = username if username else 'an anonymous user'
    token_expire_string = isotime.format(expiry, offset=False)
    extra = {'username': username, 'token_expiration': token_expire_string}

    LOG.audit('Access granted to "%s" with the token set to expire at "%s".' %
              (username_string, token_expire_string), extra=extra)

    return token

def delete_token(token):
    try:
        token_db = Token.get(token)
        return Token.delete(token_db)
    except TokenNotFoundError:
        pass
    except Exception:
        raise


text:
package org.wildfly.swarm.keycloak;

import java.net.URL;

import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Form;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.swarm.Swarm;
import org.wildfly.swarm.arquillian.CreateSwarm;
import org.wildfly.swarm.jaxrs.JAXRSArchive;

/**
 * @author Bob McWhirter
 */
@RunWith(Arquillian.class)
public class KeycloakArquillianTest {

    @Deployment
    public static Archive<?> createDeployment() throws Exception {
        JAXRSArchive deployment = ShrinkWrap.create(JAXRSArchive.class, "test.war");
        deployment.addResource(SecuredApplication.class);
        deployment.addResource(SecuredResource.class);
        deployment.addAsResource("wildfly-swarm-keycloak-example-realm.json");
        deployment.addAsResource("keycloak.json");
        deployment.addAsResource("project-default-kc-json.yml", "project-defaults.yml");
        return deployment;
    }

    @CreateSwarm
    public static Swarm newContainer() throws Exception {
        URL migrationRealmUrl = KeycloakArquillianTest.class.getResource("/wildfly-swarm-keycloak-example-realm.json");
        System.setProperty("keycloak.migration.file", migrationRealmUrl.toURI().getPath());
        System.setProperty("keycloak.migration.provider", "singleFile");
        System.setProperty("keycloak.migration.action", "import");

        return new Swarm();
    }

    @Test
    @RunAsClient
    public void testResourceIsSecured() throws Exception {
        // Check 401 is returned without the token
        Assert.assertEquals(Response.Status.UNAUTHORIZED.getStatusCode(),
           ClientBuilder.newClient().target("http://localhost:8080/secured").request().get().getStatus());

        final String tokenUri =
            "http://localhost:8080/auth/realms/wildfly-swarm-keycloak-example/protocol/openid-connect/token";
        String response =
            ClientBuilder.newClient().target(tokenUri).request()
                .post(Entity.form(
                        new Form().param("grant_type", "password").param("client_id", "curl")
                                  .param("username", "user1").param("password", "password1")),
                        String.class);
        String accessToken = getAccessTokenFromResponse(response);

        String serviceResponse =
            ClientBuilder.newClient().target("http://localhost:8080/secured")
                .request()
                .header(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken)
                .get(String.class);
        Assert.assertEquals("Hi user1, this resource is secured", serviceResponse);

    }

    private String getAccessTokenFromResponse(String response) {
        String tokenStart = response.substring("{\"access_token\":\"".length());
        return tokenStart.substring(0, tokenStart.indexOf("\""));
    }
}


text:
require "spec_helper"

describe Onebox::Engine::RedditMediaOnebox do
  let(:link) { "https://www.reddit.com/r/colors/comments/b4d5xm/literally_nothing_black_edition" }
  let(:html) { described_class.new(link).to_html }

  before do
    fake(link, response("reddit_image"))
  end

  it "includes title" do
    expect(html).to include('reddit')
  end

  it "includes image" do
    expect(html).to include("https://preview.redd.it/vsg59iw0srn21.jpg")
  end

  it "includes description" do
    expect(html).to include("Literally nothing black edition")
  end
end


text:
package com.example.yetti.toneplayer.json;

import com.example.yetti.toneplayer.callback.ICallbackResult;
import com.example.yetti.toneplayer.model.Artist;
import com.example.yetti.toneplayer.model.Song;

import java.util.List;

public interface IJsonParser {

    void asyncConvertSongsToJson(final List<Song> pSongs, final ICallbackResult<String> pStringICallbackResult);

    void asyncConvertJsonToSongs(final String pJson, final ICallbackResult<List<Song>> pListICallbackResult);

    void asyncConvertArtistToJson(final Artist pArtist, final ICallbackResult<String> pArtistICallbackResult);

    void asyncConvertJsonToArtist(final String pJson, final ICallbackResult<Artist> pArtistICallbackResult);

    String convertSongsToJson(final List<Song> pSongList);

    List<Song> convertJsonToSongs(final String pJSONSongList);

    String convertArtistToJson(final Artist pArtistList);

    Artist convertJsonToArtist(final String pJSONArtist);
}


text:
import { last } from 'lodash';
import { Models } from 'omnisharp-client';
import { Observable, Subscription } from 'rxjs';
import { CompositeDisposable } from 'ts-disposables';
import { Omni } from '../server/omni';
// tslint:disable-next-line:no-require-imports no-var-requires
const $: JQueryStatic = require('jquery');
// tslint:disable-next-line:no-require-imports no-var-requires
const Range: typeof TextBuffer.Range = require('atom').Range;
const identifierRegex = /^identifier|identifier$|\.identifier\./;

class GoToDefinition implements IFeature {
    public required = true;
    public title = 'Go To Definition';
    public description = 'Adds support to goto definition, as well as display metadata returned by a goto definition metadata response';

    private disposable: CompositeDisposable;
    private enhancedHighlighting: boolean;
    private marker: Atom.Marker;
    private wantMetadata: boolean;

    public activate() {
        this.disposable = new CompositeDisposable();
        let altGotoDefinition = false;
        this.disposable.add(atom.config.observe('omnisharp-atom:altGotoDefinition', value => altGotoDefinition = value));

        this.disposable.add(Omni.switchActiveEditor((editor, cd) => {
            const view = $(atom.views.getView(editor));
            const scroll = this._getFromShadowDom(view, '.scroll-view');
            if (!scroll[0]) {
                return;
            }

            const click = Observable.fromEvent<MouseEvent>(scroll[0], 'click');

            const mousemove = Observable.fromEvent<MouseEvent>(scroll[0], 'mousemove');

            const keyup = Observable.merge(
                Observable.fromEvent<any>(view[0], 'focus'),
                Observable.fromEvent<any>(view[0], 'blur'),
                Observable.fromEventPattern<any>(
                    x => { (<any>atom.getCurrentWindow()).on('focus', x); },
                    x => { (<any>atom.getCurrentWindow()).removeListener('focus', x); }),
                Observable.fromEventPattern<any>(
                    x => { (<any>atom.getCurrentWindow()).on('blur', x); },
                    x => { (<any>atom.getCurrentWindow()).removeListener('blur', x); }),
                Observable.fromEvent<KeyboardEvent>(view[0], 'keyup')
                    .filter(x => {
                        if (altGotoDefinition) {
                            return x.which === 18; // alt
                        }
                        return x.which === 17 /*ctrl*/ || /*meta --> */ x.which === 224 || x.which === 93 || x.which === 92 || x.which === 91;
                    })
            )
                .throttleTime(100);

            const keydown = Observable.fromEvent<KeyboardEvent>(view[0], 'keydown')
                .filter(z => !z.repeat)
                .filter(e => altGotoDefinition ? e.altKey : (e.ctrlKey || e.metaKey))
                .throttleTime(100);

            const specialKeyDown = keydown
                .switchMap(x => mousemove
                    .takeUntil(keyup)
                    .map(event => {
                        const pixelPt = this._pixelPositionFromMouseEvent(editor, view, event);
                        if (!pixelPt) { return; }
                        const screenPt = editor.screenPositionForPixelPosition(pixelPt);
                        return editor.bufferPositionForScreenPosition(screenPt);
                    })
                    .filter(a => !!a)
                    .startWith(editor.getCursorBufferPosition())
                    .map(bufferPt => ({ bufferPt, range: this._getWordRange(editor, bufferPt) }))
                    .filter(z => !!z.range)
                    .distinctUntilChanged((current, next) => current.range.isEqual(<any>next.range)));

            editor.onDidDestroy(() => cd.dispose());

            let eventDisposable: Subscription;
            cd.add(atom.config.observe('omnisharp-atom.enhancedHighlighting', (enabled: boolean) => {
                this.enhancedHighlighting = enabled;
                if (eventDisposable) {
                    eventDisposable.unsubscribe();
                    cd.remove(eventDisposable);
                }

                let observable = specialKeyDown;
                if (!enabled) {
                    observable = observable.debounceTime(200);
                }

                eventDisposable = observable
                    .subscribe(({ bufferPt, range }) => this._underlineIfNavigable(editor, bufferPt, range));

                cd.add(eventDisposable);
            }));

            cd.add(keyup.subscribe(() => this._removeMarker()));

            cd.add(click.subscribe(e => {
                if (!e.ctrlKey && !e.metaKey) {
                    return;
                }
                if (altGotoDefinition && !e.altKey) {
                    return;
                }

                this._removeMarker();
                this.goToDefinition();
            }));
            this.disposable.add(cd);
        }));

        this.disposable.add(atom.emitter.on('symbols-view:go-to-declaration', () => this.goToDefinition()));
        this.disposable.add(Omni.addTextEditorCommand('omnisharp-atom:go-to-definition', () => this.goToDefinition()));
        this.disposable.add(atom.config.observe('omnisharp-atom.wantMetadata', enabled => {
            this.wantMetadata = enabled;
        }));
    }

    public dispose() {
        this.disposable.dispose();
    }

    public goToDefinition() {
        const editor = atom.workspace.getActiveTextEditor();
        if (editor) {
            const word = <any>editor.getWordUnderCursor();
            Omni.request(editor, solution => solution.gotodefinition({
                WantMetadata: this.wantMetadata
            }))
                .subscribe((data: Models.GotoDefinitionResponse) => {
                    // tslint:disable-next-line:triple-equals
                    if (data.FileName != null) {
                        Omni.navigateTo(data);
                    } else if (data.MetadataSource) {
                        /* tslint:disable:variable-name */
                        const { AssemblyName, TypeName } = data.MetadataSource;
                        /* tslint:enable:variable-name */
                        atom.workspace.open(`omnisharp://metadata/${AssemblyName}/${TypeName}`, <any>{
                            initialLine: data.Line,
                            initialColumn: data.Column,
                            searchAllPanes: true
                        });
                    } else {
                        atom.notifications.addWarning(`Can't navigate to ${word}`);
                    }
                });
        }
    }

    private _getWordRange(editor: Atom.TextEditor, bufferPt: TextBuffer.Point): TextBuffer.Range {
        const buffer = editor.getBuffer();
        let startColumn = bufferPt.column;
        let endColumn = bufferPt.column;
        const line = buffer.getLines()[bufferPt.row];

        if (!/[A-Z_0-9]/i.test(line[bufferPt.column])) {
            if (this.marker) { this._removeMarker(); }
            return;
        }

        while (startColumn > 0 && /[A-Z_0-9]/i.test(line[--startColumn])) { /* */ }

        while (endColumn < line.length && /[A-Z_0-9]/i.test(line[++endColumn])) { /* */ }

        return new Range([bufferPt.row, startColumn + 1], [bufferPt.row, endColumn]);
    }

    private _underlineIfNavigable(editor: Atom.TextEditor, bufferPt: TextBuffer.Point, wordRange: TextBuffer.Range) {
        if (this.marker &&
            (<any>this.marker.bufferMarker).range &&
            (<any>this.marker.bufferMarker).range.compare(wordRange) === 0) {
            return;
        }

        let decoration: Atom.Marker;
        const addMark = () => {
            this._removeMarker();
            this.marker = editor.markBufferRange(wordRange);
            decoration = editor.decorateMarker(this.marker, { type: 'highlight', class: 'gotodefinition-underline' });
        };

        if (this.enhancedHighlighting) {
            const scopes: string[] = (<any>editor.scopeDescriptorForBufferPosition(bufferPt)).scopes;
            if (identifierRegex.test(last(scopes))) {
                addMark();
            }
        } else {
            // If enhanced highlighting is off, fallback to the old method.
            Omni.request(editor, solution => solution.gotodefinition({
                Line: bufferPt.row,
                Column: bufferPt.column
            })).filter(data => !!data.FileName || !!data.MetadataSource)
                .subscribe(data => addMark());
        }
    }

    private _pixelPositionFromMouseEvent(editor: Atom.TextEditor, editorView: any, event: MouseEvent) {
        const clientX = event.clientX;
        const clientY = event.clientY;
        const shadow = this._getFromShadowDom(editorView, '.lines')[0];
        if (!shadow) {
            return;
        }

        const linesClientRect = shadow.getBoundingClientRect();

        let top = clientY - linesClientRect.top;
        let left = clientX - linesClientRect.left;
        top += (<any>editor).getScrollTop();
        left += (<any>editor).getScrollLeft();
        return { top, left };
    }

    private _getFromShadowDom(element: JQuery, selector: string): JQuery {
        try {
            const el = element[0];
            const found = (<any>el).rootElement.querySelectorAll(selector);
            return $(found[0]);
        } catch (e) {
            return $(document.createElement('div'));
        }
    }

    private _removeMarker() {
        // tslint:disable-next-line:triple-equals
        if (this.marker != null) {
            this.marker.destroy();
            this.marker = null;
        }
    }
}

// tslint:disable-next-line:export-name
export const goToDefintion = new GoToDefinition();


text:
using System;

namespace Backend.Fx.Extensions
{
    public class MultipleDisposable : IDisposable
    {
        private readonly IDisposable[] _disposables;

        public MultipleDisposable(params IDisposable[] disposables)
        {
            _disposables = disposables;
        }

        public void Dispose()
        {
            foreach (IDisposable disposable in _disposables)
            {
                disposable?.Dispose();
            }
        }
    }
}


text:
package edu.wustl.catissuecore.bizlogic.uidomain.order;

import edu.wustl.catissuecore.actionForm.OrderSpecimenForm;
import edu.wustl.catissuecore.bean.OrderSpecimenBean;
import edu.wustl.catissuecore.domain.DerivedSpecimenOrderItem;
import edu.wustl.catissuecore.domain.ExistingSpecimenOrderItem;
import edu.wustl.catissuecore.domain.Specimen;
import edu.wustl.catissuecore.domain.SpecimenOrderItem;
import edu.wustl.catissuecore.factory.DomainInstanceFactory;
import edu.wustl.catissuecore.factory.InstanceFactory;
import edu.wustl.common.bizlogic.InputUIRepOfDomain;

@InputUIRepOfDomain(OrderSpecimenForm.class)
public class OrderSpecimenTransformer extends AbstractAddArrayableOrderDetailsTransformer<OrderSpecimenForm> {

    @Override
    protected SpecimenOrderItem getExistingOrderItem(OrderSpecimenBean orderSpecimenBean) {
    	InstanceFactory<ExistingSpecimenOrderItem> existSpecOrderItemInstFact = DomainInstanceFactory.getInstanceFactory(ExistingSpecimenOrderItem.class);
        ExistingSpecimenOrderItem existingOrderItem = existSpecOrderItemInstFact.createObject();//new ExistingSpecimenOrderItem();
        existingOrderItem.setSpecimen(getSpecimen(orderSpecimenBean.getSpecimenId()));
        return existingOrderItem;
    }

    @Override
    protected SpecimenOrderItem getDerivedOrderItem(OrderSpecimenBean orderSpecimenBean) {
    	InstanceFactory<DerivedSpecimenOrderItem> derSpecOrderInstFact = DomainInstanceFactory.getInstanceFactory(DerivedSpecimenOrderItem.class);
        DerivedSpecimenOrderItem derivedSpecimenOrderItem = derSpecOrderInstFact.createObject();//new DerivedSpecimenOrderItem();
        derivedSpecimenOrderItem.setParentSpecimen(getSpecimen(orderSpecimenBean.getSpecimenId()));
        derivedSpecimenOrderItem.setSpecimenClass(orderSpecimenBean.getSpecimenClass());
        derivedSpecimenOrderItem.setSpecimenType(orderSpecimenBean.getSpecimenType());

        return derivedSpecimenOrderItem;
    }

    private Specimen getSpecimen(String id) {
    	InstanceFactory<Specimen> instFact= DomainInstanceFactory.getInstanceFactory(Specimen.class);
        Specimen specimen = instFact.createObject();//new Specimen();
        specimen.setId(Long.valueOf(id));
        return specimen;
    }
}


text:
package uk.co.real_logic.aeron.driver;

/**
 * Handler for sending a retransmit
 */
@FunctionalInterface
public interface RetransmitSender
{
    /**
     * Called when a retransmit should be sent
     *
     * @param termId     for the NAK
     * @param termOffset for the NAK
     * @param length     for the NAK
     */
    void resend(int termId, int termOffset, int length);
}


text:
package org.q3df.test.demo;

import org.junit.Assert;
import org.junit.Test;
import org.q3df.common.msg.BitStream;
import org.q3df.common.msg.BitStreamWriter;

import java.util.BitSet;

public class BitStreamTest {

    @Test
    public void perf002 () {
        long sum = 0;
        for (int i = 0; i < 10; i++)
            sum += doStreamWritePerfTest();

        System.out.println("avg write = " + (sum/10));

        sum = 0;
        for (int i = 0; i < 10; i++)
            sum += doStreamReadPerfTest();

        System.out.println("avg read = " + (sum/10));
    }

    private long doStreamReadPerfTest() {
        BitStream bitStream = new BitStream(4096*8);

        long st = System.currentTimeMillis();
        int summ = 0;
        for (int i = 0; i < 15*1024*1024*8; i++) {
            summ += bitStream.readBit();

            if (bitStream.isEORD())
                bitStream.rewindRead();
        }

        long r = System.currentTimeMillis() - st;

        System.out.println("run, " + summ);

        return r;
    }

    private long doStreamWritePerfTest() {
        BitStream bitStream = new BitStream(4096*8);

        long st = System.currentTimeMillis();
        for (int i = 0; i < 15*1024*1024*8; i++) {
            bitStream.writeBit(true);

            if (bitStream.isEOWR())
                bitStream.rewindWrite();
        }

        long r = System.currentTimeMillis() - st;

        System.out.println("run, " + bitStream.getByte(0));

        return r;
    }

    @Test
    public void perf001 () {

        long sum = 0;
        for (int i = 0; i < 10; i++)
            sum += doPerfTestBitSet();

        System.out.println("avg = " + (sum/10));
    }

    private long doPerfTestBitSet() {
        BitSet bitSet = new BitSet(4096*8);

        long st = System.currentTimeMillis();
        for (int i = 0; i < 15*1024*1024*8; i++) {
            bitSet.set(i & 0x7FFF);
        }

        long r = System.currentTimeMillis() - st;
        System.out.println("run, " + bitSet.get(4));

        return r;
//        System.out.println(System.currentTimeMillis() - st);
//        System.out.println(bitSet.cardinality());
    }

    @Test
    public void testBitOrder () {
        BitStream stream = new BitStream(new byte[]{0}, 8);

        int testBits[] = {1,0,1,0,1,1,1,1};

        for (int b : testBits) {
            Assert.assertTrue(stream.writeBit(b));
        }
        System.out.println(stream.getByte(0));

        Assert.assertEquals(0b11110101, stream.getByte(0));
        Assert.assertTrue(stream.isEOWR());

        for (int b : testBits)
            Assert.assertEquals(b, stream.readBit());

        Assert.assertTrue(stream.isEORD());
    }

    @Test
    public void testValues () {
        BitStreamWriter stream = new BitStream(new byte[8]);
        stream.writeBits(0, 4);    // 0000
        stream.writeBits(0b1100, 4);  // 1100
        stream.writeBits(0xAB, 8);

        Assert.assertEquals(0b11000000, stream.getByte(0));
        Assert.assertEquals(0xAB, stream.getByte(1));

        Assert.assertTrue(!stream.isEOWR());
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Statistics of PUNCT in UD_Swedish</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Swedish: POS Tags: PUNCT

There are 14 PUNCT lemmas (0%), 14 PUNCT types (0%) and 10368 PUNCT tokens (11%).
Out of 16 observed tags, the rank of PUNCT is: 13 in number of lemmas, 13 in number of types and 3 in number of tokens.

The 10 most frequent PUNCT lemmas: ., ,, ', -, ?, (, ), :, *, ;

The 10 most frequent PUNCT types:  ., ,, ', -, ?, (, ), :, *, ;

The 10 most frequent ambiguous lemmas: - (<tt>PUNCT</tt> 470, <tt>SYM</tt> 39), : (<tt>PUNCT</tt> 265, <tt>SYM</tt> 1), / (<tt>SYM</tt> 39, <tt>PUNCT</tt> 1)

The 10 most frequent ambiguous types:  - (<tt>PUNCT</tt> 470, <tt>SYM</tt> 39), : (<tt>PUNCT</tt> 265, <tt>SYM</tt> 1), / (<tt>SYM</tt> 39, <tt>PUNCT</tt> 1)

-

<tt>PUNCT</tt> 470: Bördan att fostra barn - uttrycket låter negativt .

<tt>SYM</tt> 39: De är avsedda för barn i åldern 6 månader - 7 år .

:

<tt>PUNCT</tt> 265: Han sammanfattar resultaten så här :

<tt>SYM</tt> 1: Prisstegringen beräknas då som 228 : 218 = 1,05 vilket innebär en uppgång med 5/100 det vill säga med 5 procent .

/

<tt>SYM</tt> 39: Det handlar inte om hemmafruar / yrkeskvinnor .

<tt>PUNCT</tt> 1: Citaten är hämtade ur Svenska Dagbladets debatt ' Hemmafru i skatteskruv ' ( vänstra spalten , rak stil ) och Kajsa Ohrlander : Kvinnor som slavar , Aldus / Bonniers , 13:75 ( högra spalten , kursiv stil ) .

Morphology

The form / lemma ratio of PUNCT is 1.000000 (the average of all parts of speech is 1.421389).

The 1st highest number of forms (1) was observed with the lemma "!": !.

The 2nd highest number of forms (1) was observed with the lemma "'": '.

The 3rd highest number of forms (1) was observed with the lemma "(": (.

PUNCT does not occur with any features.

Relations

PUNCT nodes are attached to their parents using 1 different relations: <tt>punct</tt> (10368; 100% instances)

Parents of PUNCT nodes belong to 12 different parts of speech: <tt>VERB</tt> (5996; 58% instances), <tt>NOUN</tt> (2894; 28% instances), <tt>ADJ</tt> (929; 9% instances), <tt>PROPN</tt> (266; 3% instances), <tt>PRON</tt> (101; 1% instances), <tt>NUM</tt> (82; 1% instances), <tt>ADV</tt> (63; 1% instances), <tt>ADP</tt> (15; 0% instances), <tt>INTJ</tt> (10; 0% instances), <tt>DET</tt> (9; 0% instances), <tt>PUNCT</tt> (2; 0% instances), <tt>AUX</tt> (1; 0% instances)

10365 (100%) PUNCT nodes are leaves.

0 (0%) PUNCT nodes have one child.

3 (0%) PUNCT nodes have two children.

The highest child degree of a PUNCT node is 2.

Children of PUNCT nodes are attached using 4 different relations: <tt>cc</tt> (2; 33% instances), <tt>punct</tt> (2; 33% instances), <tt>ccomp</tt> (1; 17% instances), <tt>nsubj</tt> (1; 17% instances)

Children of PUNCT nodes belong to 4 different parts of speech: <tt>CCONJ</tt> (2; 33% instances), <tt>PUNCT</tt> (2; 33% instances), <tt>ADJ</tt> (1; 17% instances), <tt>PROPN</tt> (1; 17% instances)

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
class RefCountedBytes;

namespace gfx {
class Image;
}

// FileIconSource is the gateway between network-level chrome:
// requests for favicons and the history backend that serves these.
class FileIconSource : public ChromeURLDataManager::DataSource {
 public:
  explicit FileIconSource();

  // Called when the network layer has requested a resource underneath
  // the path we registered.
  virtual void StartDataRequest(const std::string& path,
                                bool is_incognito,
                                int request_id) OVERRIDE;

  virtual std::string GetMimeType(const std::string&) const OVERRIDE;

  // Called when favicon data is available from the history backend.
  void OnFileIconDataAvailable(
      IconManager::Handle request_handle,
      gfx::Image* icon);

 private:
  virtual ~FileIconSource();

  CancelableRequestConsumerT<int, 0> cancelable_consumer_;

  // Raw PNG representation of the favicon to show when the favicon
  // database doesn't have a favicon for a webpage.
  scoped_refptr<RefCountedBytes> default_favicon_;

  DISALLOW_COPY_AND_ASSIGN(FileIconSource);
};
#endif  // CHROME_BROWSER_UI_WEBUI_FILEICON_SOURCE_H_


text:
package org.camunda.bpm.engine.repository;

/**
 * Contains the constants for the possible values the property {@link ProcessApplicationDeploymentBuilder#resumePreviousVersionsBy(String)}.
 */
public enum ResumePreviousBy {
  ;

  /**
   * Resume previous deployments that contain processes with the same key as in the new deployment
   */
  public static final String RESUME_BY_PROCESS_DEFINITION_KEY = "process-definition-key";

  /**
   * Resume previous deployments that have the same name as the new deployment
   */
  public static final String RESUME_BY_DEPLOYMENT_NAME = "deployment-name";
}


text:
<TITLE>Review for Permanent Midnight (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Permanent Midnight (1998)

reviewed by
Michael Dequina

_Permanent_Midnight_ (R) ** (out of ****)

Arriving fairly fresh off the blink-and-you-thankfully-missed-it run of
Terry Gilliam's _Fear_and_Loathing_in_Las_Vegas_ is another adaptation of a
drug-dazed book, this time a non-fiction one: _Permanent_Midnight_, the
celebrated autobiography of TV writer Jerry Stahl.  While the resulting
film is nowhere near the disaster Gilliam's was, screenwriter-director
David Veloz's glimpse at one man's real-life walk on the wild side rings
just about as false as that surreal work.

The true story of Stahl would appear to make an intriguing film.  While he
was a successful writer for such television shows as _thirtysomething_,
_Moonlighting_, and _ALF_ (the latter recreated in the film as
_Mr._Chompers_), Stahl also led the life of a heroin junkie.  This double
life scenario does hold some promise, and with the vibrant Ben Stiller
playing Stahl, first-time helmer Veloz appeared to be onto something
interesting.

Veloz, however, shoots himself in the foot just about right from the
get-go.  Not content to follow Stahl's story straight ahead, he comes up
with a woefully unconvincing framing story.  We meet Jerry as he works in a
fast food joint as part of a drug rehab program, and he gets picked up by a
mysterious woman named Kitty (Maria Bello).  Jerry and Kitty hole up at a
motel, and in between (and sometimes during) attempts at sex, Jerry tells
Kitty of his turbulent life: the out-of-control heroin abuse and the
devastating effects it had on his marriage of convenience to a beautiful
Brit (Elizabeth Hurley, trying her best in a thankless role) and his
once-thriving writing career.

The Jerry-Kitty subplot fails the test as a simple framework, yet Veloz
somehow got the wrongheaded idea that this already-weak part of the story
could serve as the film's emotional core.  Past catches up to present by
the end of act two, when Jerry finishes his story and he parts company with
Kitty; just when one thinks that's the last of Kitty, act three's focus is
on Jerry's inexplicable romantic feelings for her.  According to the
script, Jerry and Kitty form an unbelievably strong bond during their
nights together, presumably due to the "similar pasts" they purportedly
share.  But one is never given a clear idea of Kitty's past; she alludes to
having similar troubles, but she never gets a chance to deliver her whole
story (or, at the very least, _enough_ of it).  Bello is terrific (she
could very well have a successful film career after suddenly bolting from
TV's smash _ER_), investing great warmth and humanity to her role, but,
still, Kitty never becomes a fully developed character.

The same, unfortunately, can be said about Jerry.  Stiller's immersion
into the role is admirable (he lost 30 pounds), and as a whole, he turns in
an impressive dramatic turn.  However, as written by Veloz, Jerry is less a
person than a set of tics: shaking, manic talking.  It does not help that
one is never treated to a glimpse to what Jerry was like before the drugs,
thus never lending the audience to a standard of comparison.  Even worse,
there's no clear turning point in Jerry's story; the film feels like it's
missing a scene where he realizes his mistake and decides to turn his life
around.  While one pivotal event is _said_ to be his turning point, its
depiction leaves little of that sense.

I have not read _Permanent_Midnight_, but based on what I've read about
it, the film is a pale shadow of what is said to be a work that is quite
harrowing and even funny.  Of course, what apparently makes the book work
even more is that it is all based on fact.  If I had not known that detail
in advance, I would not have been able to glean it from
_Permanent_Midnight_ the movie, which comes off as manufactured and
synthetic as most Hollywood product.

Michael Dequina
mrbrown@iname.com   |  michael_jordan@geocities.com
Mr. Brown's Movie Site: http://welcome.to/mrbrown
CompuServe Hollywood Hotline: http://www.HollywoodHotline.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
module SmallIntConstraints (SmallIntConstraint(..),
                            toBRCConstraints,
                            lteRel) where

import BRC.BinRel
import BRC.Constraint
import qualified BRC.FiniteSet as FS
import BRC.SetOf

import SmallInt

-- | The possible binary relations on 'SmallInt'.
data SmallIntConstraint =
  LTE (Either String SmallInt) (Either String SmallInt)
  -- ^ Less than or equal to.
  deriving (Eq, Ord, Show)

-- | Converts a 'SmallIntConstraint' into one or more equivalent BRC
-- constraints.
toBRCConstraints :: SmallIntConstraint -> [Constraint String SmallInt]
toBRCConstraints (LTE l r) = [Related (toBRCRelatee l) (toBRCRelatee r)]

toBRCRelatee :: Either String SmallInt -> Relatee String SmallInt
toBRCRelatee = either Variable Constant

-- | 'BRC.BinRel' representation of the less-than-or-equal relation on
-- 'SmallInt'.
lteRel :: BinRel SmallInt (FS.Set SmallInt)
lteRel = BinRel { contains = (<=),
                  leftOf   = lteLeftOf,
                  rightOf  = lteRightOf }

-- | @lteLeftOf x@ is the set of @y@ such that @y <= x@.
lteLeftOf x =
  if x == minBound then empty else FS.fromList [minBound .. x]

-- | @lteRightOf x@ is the set of @y@ such that @x <= y@.
lteRightOf x =
  if x == maxBound then empty else FS.fromList [x .. maxBound]


text:
FtInTitle Plugin
================

The ``ftintitle`` plugin automatically moves "featured" artists from the
``artist`` field to the ``title`` field.

According to `MusicBrainz style`_, featured artists are part of the artist
field. That means that, if you tag your music using MusicBrainz, you'll have
tracks in your library like "Tellin' Me Things" by the artist "Blakroc feat.
RZA". If you prefer to tag this as "Tellin' Me Things feat. RZA" by "Blakroc",
then this plugin is for you.

To use the ``ftintitle`` plugin, enable it in your configuration
(see :ref:`using-plugins`).

Configuration
-------------

To configure the plugin, make a ``ftintitle:`` section in your configuration
file. The available options are:

- **auto**: Enable metadata rewriting during import.
  Default: ``yes``.
- **drop**: Remove featured artists entirely instead of adding them to the
  title field.
  Default: ``no``.

Running Manually
----------------

From the command line, type::

    $ beet ftintitle [QUERY]

The query is optional; if it's left off, the transformation will be applied to
your entire collection.

Use the ``-d`` flag to remove featured artists (equivalent of the ``drop``
config option).

.. _MusicBrainz style: http://musicbrainz.org/doc/Style


text:
/*!
 @header EMVoiceMessageBody.h
 @abstract 聊天的语音消息体对象类型
 @author EaseMob Inc.
 @version 1.00 2014/01/01 Creation (1.00)
 */

#import <Foundation/Foundation.h>
#import "IEMFileMessageBody.h"
#import "EMChatServiceDefs.h"

@class EMMessage;
@class EMChatVoice;
@protocol IEMChatObject;

/*!
 @class
 @brief 聊天的语音消息体对象
 */
@interface EMVoiceMessageBody : NSObject<IEMFileMessageBody>

/*!
 @property
 @brief 消息体的类型
 */
@property (nonatomic, readonly) MessageBodyType messageBodyType;

/*!
 @property
 @brief 消息体的底层聊天对象
 */
@property (nonatomic, strong, readonly) id<IEMChatObject> chatObject;

/*!
 @property
 @brief 消息体所在的消息对象
 */
@property (nonatomic, weak) EMMessage *message;

/*!
 @property
 @brief 文件消息体的显示名
 */
@property (nonatomic, strong) NSString *displayName;

/*!
 @property
 @brief 文件消息体的本地文件路径
 */
@property (nonatomic, strong) NSString *localPath;

/*!
 @property
 @brief 文件消息体的服务器远程文件路径
 */
@property (nonatomic, strong) NSString *remotePath;

/*!
 @property
 @brief 远端语音文件的密钥, 下载时需要语音文件密钥和用户安全信息配合以下载远程语音文件
 */
@property (nonatomic, strong) NSString *secretKey;

/*!
 @property
 @brief 文件消息体的文件长度, 以字节为单位
 */
@property (nonatomic) long long fileLength;

/*!
 @property
 @brief 语音时长, 秒为单位
 */
@property (nonatomic) NSInteger duration;

/*!
 @property
 @brief 语音附件是否下载完成
 */
@property (nonatomic)EMAttachmentDownloadStatus attachmentDownloadStatus;

/*!
 @method
 @brief 以语音对象创建语音消息体实例
 @discussion
 @param aChatVoice 语音对象
 @result 语音消息体
 */
- (id)initWithChatObject:(EMChatVoice *)aChatVoice;

@end


text:
package strace

import "github.com/u-root/u-root/pkg/strace/internal/abi"

// ReadMessageHeader64 reads a MessageHeader64
func ReadMessageHeader64(t *Tracer, addr Addr, msg *abi.MessageHeader64) error {
	if _, err := t.Read(addr, msg); err != nil {
		return err
	}

	return nil
}


text:
namespace Microsoft.Azure.Management.StorSimple1200Series.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// The iscsi server.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class ISCSIServer : BaseModel
    {
        /// <summary>
        /// Initializes a new instance of the ISCSIServer class.
        /// </summary>
        public ISCSIServer()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ISCSIServer class.
        /// </summary>
        /// <param name="storageDomainId">The storage domain id.</param>
        /// <param name="backupScheduleGroupId">The backup policy id.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="type">The type.</param>
        /// <param name="description">The description.</param>
        /// <param name="chapId">The chap id.</param>
        /// <param name="reverseChapId">The reverse chap id.</param>
        public ISCSIServer(string storageDomainId, string backupScheduleGroupId, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string chapId = default(string), string reverseChapId = default(string))
            : base(id, name, type)
        {
            StorageDomainId = storageDomainId;
            BackupScheduleGroupId = backupScheduleGroupId;
            Description = description;
            ChapId = chapId;
            ReverseChapId = reverseChapId;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the storage domain id.
        /// </summary>
        [JsonProperty(PropertyName = "properties.storageDomainId")]
        public string StorageDomainId { get; set; }

        /// <summary>
        /// Gets or sets the backup policy id.
        /// </summary>
        [JsonProperty(PropertyName = "properties.backupScheduleGroupId")]
        public string BackupScheduleGroupId { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        [JsonProperty(PropertyName = "properties.description")]
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets the chap id.
        /// </summary>
        [JsonProperty(PropertyName = "properties.chapId")]
        public string ChapId { get; set; }

        /// <summary>
        /// Gets or sets the reverse chap id.
        /// </summary>
        [JsonProperty(PropertyName = "properties.reverseChapId")]
        public string ReverseChapId { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (StorageDomainId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "StorageDomainId");
            }
            if (BackupScheduleGroupId == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "BackupScheduleGroupId");
            }
        }
    }
}


text:
comments: true
date: 2015-10-14 03:47:50+00:00
layout: article
slug: apa-itu-ajax
title: Apa itu AJAX ?
wordpress_id: 1332
categories: javascript
tags: [artikel, ajax, javascript]
ads: true
---

AJAX adalah singkatan dari _Asynchronous JavaScript and XML_. AJAX adalah suatu teknik untuk membuat akses data ke server menjadi lebih cepat dari pada metode yang biasanya. AJAX memungkinkan halaman web diperbarui _asynchronously_ dengan bertukar data dalam jumlah kecil dengan server. Dengan kata lain AJAX dapat memperbarui bagian dari halaman web, tanpa melakukan reload seluruh halaman.

Contoh web yang menggunakan AJAX: Google Maps, Gmail, YouTube, dan Facebook.

### Cara Kerja AJAX

![(http://www.w3schools.com/ajax/ajax.gif)](http://www.w3schools.com/ajax/ajax.gif)

Cara kerja AJAX. Sumber gambar [disini](http://www.w3schools.com/ajax)

### Basis AJAX

AJAX bekerja berbasis kepada kombinasi dari

  * XMLHttpRequest object = untuk mengambil data dari server

  * Javascript/DOM = untuk menampilkan data ke halaman web

### Kesimpulan

AJAX memberikan suatu metode untuk mempercepat proses load data tanpa melakukan refersh page pada browser.. Seorang developer web disarankan untuk menguasai AJAX agar web yang ditampilkan lebih atraktif dan cepat dalam me-load data baik dari database atau sources lainnya.

### Contoh

[Contoh menggunakan kode ajax](/contoh-aplikasi-ajax-penggunaan-xmlhttprequest/)

### Referensi

[http://www.w3schools.com/ajax/](http://www.w3schools.com/ajax/)


text:
package net.hardisonbrewing.signingserver.service.push;

import java.io.IOException;
import java.io.InputStream;

import javax.microedition.io.HttpConnection;

import net.hardisonbrewing.signingserver.closed.Settings.BISPushInfo;
import net.hardisonbrewing.signingserver.model.PushNotification;
import net.hardisonbrewing.signingserver.service.SigStatusService;
import net.hardisonbrewing.signingserver.service.icon.IconService;
import net.hardisonbrewing.signingserver.service.store.push.PushSIGStatusStore;
import net.rim.blackberry.api.push.PushApplicationStatus;
import net.rim.device.api.io.transport.ConnectionDescriptor;
import net.rim.device.api.io.transport.ConnectionFactory;
import net.rim.device.api.system.DeviceInfo;

import org.json.javame.JSONException;
import org.json.javame.JSONObject;
import org.metova.mobile.util.io.IOUtility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PushSIGService {

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

    public static void register( boolean active ) {

        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append( BISPushInfo.REGISTER_URL );
        stringBuffer.append( "?pin=" );
        stringBuffer.append( Integer.toHexString( DeviceInfo.getDeviceId() ) );
        stringBuffer.append( "&active=" );
        stringBuffer.append( active );

        log.info( stringBuffer.toString() );

        ConnectionFactory connectionFactory = new ConnectionFactory();
        ConnectionDescriptor connectionDescriptor = connectionFactory.getConnection( stringBuffer.toString() );

        if ( connectionDescriptor == null ) {
            log.error( "Unable to create connection. Push registration not completed." );
            return;
        }

        HttpConnection connection = null;

        try {
            connection = (HttpConnection) connectionDescriptor.getConnection();
            int responseCode = connection.getResponseCode();
            if ( responseCode >= 200 && responseCode < 300 ) {
                log.error( "Push registration completed." );
                PushSIGStatusStore.put( active );
                IconService.updateIcon();
            }
            else {
                log.error( "Made connection with server but error[" + responseCode + "] was returned. Push registration not completed." );
            }
        }
        catch (IOException e) {
            log.error( "Exception caught while registering with server. Push registration not completed." );
        }
        finally {
            IOUtility.safeClose( connection );
        }
    }

    public static void confirm( String pid ) {

        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append( BISPushInfo.CONFIRM_URL );
        stringBuffer.append( "?pin=" );
        stringBuffer.append( Integer.toHexString( DeviceInfo.getDeviceId() ) );
        stringBuffer.append( "&pid=" );
        stringBuffer.append( pid );

        log.info( stringBuffer.toString() );

        ConnectionFactory connectionFactory = new ConnectionFactory();
        ConnectionDescriptor connectionDescriptor = connectionFactory.getConnection( stringBuffer.toString() );

        if ( connectionDescriptor == null ) {
            log.error( "Unable to create connection. Push confirmation not completed." );
            return;
        }

        HttpConnection connection = null;

        try {
            connection = (HttpConnection) connectionDescriptor.getConnection();
            int responseCode = connection.getResponseCode();
            if ( responseCode >= 200 && responseCode < 300 ) {
                log.error( "Push confirmation completed." );
            }
            else {
                log.error( "Made connection with server but error[" + responseCode + "] was returned. Push confirmation not completed." );
            }
        }
        catch (IOException e) {
            log.error( "Exception caught while confirming with server. Push confirmation not completed." );
        }
        finally {
            IOUtility.safeClose( connection );
        }
    }

    public static PushNotification parse( InputStream inputStream ) throws IOException, JSONException {

        String response = IOUtility.getInputStreamAsString( inputStream );

        log.info( response );

        JSONObject notification = new JSONObject( response );
        int version = notification.getInt( "version" );
        if ( version != BISPushInfo.VERSION ) {
            log.error( "Version does not match" );
            return null;
        }

        JSONObject message = notification.getJSONObject( "message" );

        PushNotification pushNotification = new PushNotification();
        pushNotification.pid = notification.getString( "pid" );
        pushNotification.date = notification.getLong( "date" );
        pushNotification.message = SigStatusService.parse( message );
        return pushNotification;
    }

    public static String getStatusText( byte status ) {

        switch (status) {
            case PushApplicationStatus.STATUS_ACTIVE: {
                return "STATUS_ACTIVE";
            }
            case PushApplicationStatus.STATUS_FAILED: {
                return "STATUS_FAILED";
            }
            case PushApplicationStatus.STATUS_NOT_REGISTERED: {
                return "STATUS_NOT_REGISTERED";
            }
            case PushApplicationStatus.STATUS_PENDING: {
                return "STATUS_PENDING";
            }
            default: {
                return null;
            }
        }
    }

    public static String getStatusHumanText( byte status ) {

        switch (status) {
            case PushApplicationStatus.STATUS_ACTIVE: {
                return "Active";
            }
            case PushApplicationStatus.STATUS_FAILED: {
                return "Failed";
            }
            case PushApplicationStatus.STATUS_PENDING: {
                return "Pending";
            }
            case PushApplicationStatus.STATUS_NOT_REGISTERED:
            default: {
                return "Not Registered";
            }
        }
    }

    public static String getReasonText( byte reason ) {

        switch (reason) {
            case PushApplicationStatus.REASON_API_CALL: {
                return "REASON_API_CALL";
            }
            case PushApplicationStatus.REASON_INVALID_PARAMETERS: {
                return "REASON_INVALID_PARAMETERS";
            }
            case PushApplicationStatus.REASON_NETWORK_ERROR: {
                return "REASON_NETWORK_ERROR";
            }
            case PushApplicationStatus.REASON_REJECTED_BY_SERVER: {
                return "REASON_REJECTED_BY_SERVER";
            }
            case PushApplicationStatus.REASON_SIM_CHANGE: {
                return "REASON_SIM_CHANGE";
            }
            default: {
                return null;
            }
        }
    }
}


text:
My redux of CSUD (Chadderz's Simple USB Driver) by Alex Chadwick was converted to 32/64 bit compatible code. I also merged nested interrupt code which blinks the LED while the USB runs.

Just in the process of updating ... I will update details here shortly

If you just want to see it just put the files in the DiskImg directory on a formatted SD card and place in your Pi.

To compile edit the makefile so the compiler path matches your compiler:
>
For Pi1:
>     Make Pi1
For Pi2:
>     Make Pi2
For Pi3 in 32 Bit:
>     Make Pi3
For Pi3 in 64 Bit:
>     Make Pi3-64

To clean for full compile:
>     Make Clean
![](https://github.com/LdB-ECM/Docs_and_Images/blob/master/Images/USB64_alpha.jpg?raw=true)


text:
<!DOCTYPE html>

Unable to update funding rules.

All potential changes must be agreed with the organisation before they are implemented. You can do this in the finance query form.

            All saved changes will be visible to the organisation.

Funding rules selected:

funding rules

       Edit

            <form th:action="@{${#ifsUtil.formPostUri(#httpServletRequest)}}" method="post" th:object="${form}" enctype="multipart/form-data">

Override funding rules

                            <input id="override-funding-rules"
                                    class="govuk-checkboxes__input"
                                    type="checkbox"
                                    th:field="*{overrideFundingRules}"
                                    data-switches-button-status="#save-and-return" />

                                Change funding rules to something.

The funding rules have changed, this may affect the eligible funding levels. You must review the project to make sure it is still eligible for funding.

                <button id="save-and-return" name="save-and-return" class="govuk-button">Save and return</button>
            </form>

The funding rules have changed, this may affect the eligible funding levels. You must review the project to make sure it is still eligible for funding.

        <form th:if="${!model.editMode AND !model.readOnly}" th:action="@{${#ifsUtil.formPostUri(#httpServletRequest)}}" method="post" th:object="${form}">

Approve funding rules check

                        <input  id="project-funding-rules"
                                class="govuk-checkboxes__input"
                                type="checkbox"
                                th:field="*{confirmFundingRules}"
                                data-switches-button-status="#confirm-button" />

                            I confirm that the funding rules are correct and that I have agreed all changes with the organisation.

            <button type="submit"
                    class="govuk-button"
                    name="confirm-funding-rules"
                    id="confirm-button">Approve funding rules</button>
        </form>

                Cancel changes

        Return to finance checks

            Queries
            Notes


text: Detect Cycle in a Directed Graph


text:
package org.specs.form

class lineFormSpec extends org.spex.Specification {
  val lineForm = new LineForm {
        prop("First Name", "Hello")
        prop("Last Name", "World")
      }
  "a line form" should {
    "display all values when rendering its Xhtml method" in {
      lineForm.toHtml.toString must include("Hello") and include("World")
    }
    "have no labels displayed when rendering its Xhtml method" in {
      lineForm.toHtml.toString must not include("First Name")
    }
    "return a header with the properties labels" in {
      lineForm.header.toString must include("First Name") and include("Last Name")
    }
    "return a modified header with specific attributes" in {
      (lineForm % <t width="50%"/>.attributes).header.toString must include("width=\"50%\"")
    }
    "return a row containing the properties values instead when queried for rows" in {
      lineForm.rows must have size 1
      lineForm.rows aka "multiple rows query" must have size 1
    }
  }
  "An entity line form" should {
    "reset its actual values when the entity changes" in {
      val stringSize = new EntityLineForm[String] {
        prop((_:String).size)(5)
      }
      val update = (a: Option[String]) => stringSize.entityIs(a)
      update(None).execute.isOk must be(true)
      update(Some("Hello")).execute.isOk must be(true)
      update(Some("My dear")).execute.isOk must be(false)
    }
    "have a testWith method returning a copy of the form with a specific entity" in {
      val stringSize = new EntityLineForm[String] {
        val p = prop((_:String).size)(5)
      }
      stringSize.entityIs("Helloooooo")
      val stringSize2 = stringSize.testWith("World")
      stringSize must !=(stringSize2)

      stringSize2.entity.isDefined must beTrue
      stringSize2.entity.get must_== "World"
      stringSize2.execute.isOk must beTrue
      stringSize2.rows aka "table rows" must not be empty
      stringSize2.rows(0) aka "table first row" must not be empty
    }
    "have a toEmbeddedXhtml method returning the properties on the same row without labels" in {
      val form = new EntityLineForm[String]{
        val p = prop((_:String).size)(5)
        val p2 = prop((_:String).size)(5)
        tr(p, p2)
      }
      form.toEmbeddedXhtml must ==/(scala.xml.Group(5	5	))
    }
    "decorate all fields and properties when decorated" in {
      val form = new EntityLineForm[String]{
        val p = prop((_:String).size)(5)
      }.italic
      form.p.toXhtml must \\("i")
    }

  }
}


text:
package org.neo4art.importer.wikipedia.parser.util;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class InfoboxVisitorsParser
{

  private static Log logger = LogFactory.getLog(InfoboxVisitorsParser.class);

  public InfoboxVisitorsParser()
  {

  }

  public static String infoboxVisitors(String visitors)
  {
    try
    {
      if (visitors.contains("
"))
      {
        visitors = visitors.replace("
", "");

        String[] da = StringUtils.split(visitors, "<");

        return da[0];
      }

      if (visitors.contains("<"))
      {
        String[] da = StringUtils.split(visitors, "<");

        return da[0];
      }
    }
    catch (Exception e)
    {
      logger.error("Error parsing Visitors infobox: " + e.getMessage());
    }

    return null;
  }

}