text:
/**
 * This file was generated by the Objective Systems ASN1C Compiler
 * (http://www.obj-sys.com).  Version: 5.83, Date: 19-Mar-2007.
 */
#include "asn1intl.h"
#include "NBAP-PDU-Discriptions.h"

/**************************************************************/
/*                                                            */
/*  InitiatingMessage                                         */
/*                                                            */
/**************************************************************/

EXTERN int asn1PD_InitiatingMessage (ASN1CTXT* pctxt, InitiatingMessage* pvalue)
{
   int stat = 0;

   RTDIAGSTRM2 (pctxt,"asn1PD_InitiatingMessage: start\n");

   /* decode procedureID */

   PU_PUSHNAME (pctxt, "procedureID");

   stat = asn1PD_ProcedureID (pctxt, &pvalue->procedureID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode criticality */

   PU_PUSHNAME (pctxt, "criticality");

   stat = asn1PD_Criticality (pctxt, &pvalue->criticality);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode messageDiscriminator */

   PU_PUSHNAME (pctxt, "messageDiscriminator");

   stat = asn1PD_MessageDiscriminator (pctxt, &pvalue->messageDiscriminator);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode transactionID */

   PU_PUSHNAME (pctxt, "transactionID");

   stat = asn1PD_TransactionID (pctxt, &pvalue->transactionID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode value */

   PU_PUSHNAME (pctxt, "value");

   stat = pd_OpenType (pctxt, &pvalue->value.data, &pvalue->value.numocts);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   RTDIAGSTRM2 (pctxt,"asn1PD_InitiatingMessage: end\n");

   return (stat);
}

/**************************************************************/
/*                                                            */
/*  SuccessfulOutcome                                         */
/*                                                            */
/**************************************************************/

EXTERN int asn1PD_SuccessfulOutcome (ASN1CTXT* pctxt, SuccessfulOutcome* pvalue)
{
   int stat = 0;

   RTDIAGSTRM2 (pctxt,"asn1PD_SuccessfulOutcome: start\n");

   /* decode procedureID */

   PU_PUSHNAME (pctxt, "procedureID");

   stat = asn1PD_ProcedureID (pctxt, &pvalue->procedureID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode criticality */

   PU_PUSHNAME (pctxt, "criticality");

   stat = asn1PD_Criticality (pctxt, &pvalue->criticality);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode messageDiscriminator */

   PU_PUSHNAME (pctxt, "messageDiscriminator");

   stat = asn1PD_MessageDiscriminator (pctxt, &pvalue->messageDiscriminator);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode transactionID */

   PU_PUSHNAME (pctxt, "transactionID");

   stat = asn1PD_TransactionID (pctxt, &pvalue->transactionID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode value */

   PU_PUSHNAME (pctxt, "value");

   stat = pd_OpenType (pctxt, &pvalue->value.data, &pvalue->value.numocts);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   RTDIAGSTRM2 (pctxt,"asn1PD_SuccessfulOutcome: end\n");

   return (stat);
}

/**************************************************************/
/*                                                            */
/*  UnsuccessfulOutcome                                       */
/*                                                            */
/**************************************************************/

EXTERN int asn1PD_UnsuccessfulOutcome (ASN1CTXT* pctxt, UnsuccessfulOutcome* pvalue)
{
   int stat = 0;

   RTDIAGSTRM2 (pctxt,"asn1PD_UnsuccessfulOutcome: start\n");

   /* decode procedureID */

   PU_PUSHNAME (pctxt, "procedureID");

   stat = asn1PD_ProcedureID (pctxt, &pvalue->procedureID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode criticality */

   PU_PUSHNAME (pctxt, "criticality");

   stat = asn1PD_Criticality (pctxt, &pvalue->criticality);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode messageDiscriminator */

   PU_PUSHNAME (pctxt, "messageDiscriminator");

   stat = asn1PD_MessageDiscriminator (pctxt, &pvalue->messageDiscriminator);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode transactionID */

   PU_PUSHNAME (pctxt, "transactionID");

   stat = asn1PD_TransactionID (pctxt, &pvalue->transactionID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode value */

   PU_PUSHNAME (pctxt, "value");

   stat = pd_OpenType (pctxt, &pvalue->value.data, &pvalue->value.numocts);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   RTDIAGSTRM2 (pctxt,"asn1PD_UnsuccessfulOutcome: end\n");

   return (stat);
}

/**************************************************************/
/*                                                            */
/*  Outcome                                                   */
/*                                                            */
/**************************************************************/

EXTERN int asn1PD_Outcome (ASN1CTXT* pctxt, Outcome* pvalue)
{
   int stat = 0;

   RTDIAGSTRM2 (pctxt,"asn1PD_Outcome: start\n");

   /* decode procedureID */

   PU_PUSHNAME (pctxt, "procedureID");

   stat = asn1PD_ProcedureID (pctxt, &pvalue->procedureID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode criticality */

   PU_PUSHNAME (pctxt, "criticality");

   stat = asn1PD_Criticality (pctxt, &pvalue->criticality);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode messageDiscriminator */

   PU_PUSHNAME (pctxt, "messageDiscriminator");

   stat = asn1PD_MessageDiscriminator (pctxt, &pvalue->messageDiscriminator);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode transactionID */

   PU_PUSHNAME (pctxt, "transactionID");

   stat = asn1PD_TransactionID (pctxt, &pvalue->transactionID);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   /* decode value */

   PU_PUSHNAME (pctxt, "value");

   stat = pd_OpenType (pctxt, &pvalue->value.data, &pvalue->value.numocts);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_POPNAME (pctxt);

   RTDIAGSTRM2 (pctxt,"asn1PD_Outcome: end\n");

   return (stat);
}

/**************************************************************/
/*                                                            */
/*  NBAP_PDU                                                  */
/*                                                            */
/**************************************************************/

EXTERN int asn1PD_NBAP_PDU (ASN1CTXT* pctxt, NBAP_PDU* pvalue)
{
   int stat = 0;
   OSUINT32 ui;
   ASN1OpenType openType;
   OSBOOL extbit;

   RTDIAGSTRM2 (pctxt,"asn1PD_NBAP_PDU: start\n");

   /* extension bit */

   PU_NEWFIELD (pctxt, "extension marker");

   stat = PD_BIT (pctxt, &extbit);
   if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

   PU_SETBITCOUNT (pctxt);

   if (!extbit) {
      PU_PUSHNAME (pctxt, "t");

      stat = pd_ConsUnsigned (pctxt, &ui, 0, OSUINTCONST(3));
      if (stat != 0) return LOG_ASN1ERR (pctxt, stat);
      else pvalue->t = ui + 1;

      PU_POPNAME (pctxt);

      switch (ui) {
         /* initiatingMessage */
         case 0:
            PU_PUSHNAME (pctxt, "u.initiatingMessage");

            pvalue->u.initiatingMessage = rtMemAllocTypeZ (pctxt, InitiatingMessage);
            if (pvalue->u.initiatingMessage == NULL)
               return LOG_ASN1ERR (pctxt, ASN_E_NOMEM);

            stat = asn1PD_InitiatingMessage (pctxt, pvalue->u.initiatingMessage);
            if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

            PU_POPNAME (pctxt);

            break;

         /* succesfulOutcome */
         case 1:
            PU_PUSHNAME (pctxt, "u.succesfulOutcome");

            pvalue->u.succesfulOutcome = rtMemAllocTypeZ (pctxt, SuccessfulOutcome);
            if (pvalue->u.succesfulOutcome == NULL)
               return LOG_ASN1ERR (pctxt, ASN_E_NOMEM);

            stat = asn1PD_SuccessfulOutcome (pctxt, pvalue->u.succesfulOutcome);
            if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

            PU_POPNAME (pctxt);

            break;

         /* unsuccesfulOutcome */
         case 2:
            PU_PUSHNAME (pctxt, "u.unsuccesfulOutcome");

            pvalue->u.unsuccesfulOutcome = rtMemAllocTypeZ (pctxt, UnsuccessfulOutcome);
            if (pvalue->u.unsuccesfulOutcome == NULL)
               return LOG_ASN1ERR (pctxt, ASN_E_NOMEM);

            stat = asn1PD_UnsuccessfulOutcome (pctxt, pvalue->u.unsuccesfulOutcome);
            if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

            PU_POPNAME (pctxt);

            break;

         /* outcome */
         case 3:
            PU_PUSHNAME (pctxt, "u.outcome");

            pvalue->u.outcome = rtMemAllocTypeZ (pctxt, Outcome);
            if (pvalue->u.outcome == NULL)
               return LOG_ASN1ERR (pctxt, ASN_E_NOMEM);

            stat = asn1PD_Outcome (pctxt, pvalue->u.outcome);
            if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

            PU_POPNAME (pctxt);

            break;

         default:
            return LOG_ASN1ERR (pctxt, ASN_E_INVOPT);
      }
   }
   else {
      PU_NEWFIELD (pctxt, "choice index");

      stat = pd_SmallNonNegWholeNumber (pctxt, &ui);
      if (stat != 0) return LOG_ASN1ERR (pctxt, stat);
      else pvalue->t = ui + 5;

      PU_SETBITCOUNT (pctxt);

      stat = PD_BYTE_ALIGN (pctxt);
      if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

      PU_PUSHNAME (pctxt, "choice extension");

      stat = pd_OpenType (pctxt, &openType.data, &openType.numocts);
      if (stat != 0) return LOG_ASN1ERR (pctxt, stat);

      PU_POPNAME (pctxt);

      PU_PUSHNAME (pctxt, "extension");

      pvalue->u.extElem1 = rtMemAllocType (pctxt, ASN1OpenType);
      if (pvalue->u.extElem1 == NULL)
         return LOG_ASN1ERR (pctxt, ASN_E_NOMEM);

      pvalue->u.extElem1->data = openType.data;
      pvalue->u.extElem1->numocts = openType.numocts;

      PU_POPNAME (pctxt);

   }

   RTDIAGSTRM2 (pctxt,"asn1PD_NBAP_PDU: end\n");

   return (stat);
}


text:
package com.hanuor.sapphire.temporarydb;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class TrainingTracker extends SQLiteOpenHelper {
    private static final String DB_NAME_VALUE = "TrainindData.db";
    private static final String TRAINING_TABLE = "TrainingTable";
    private static final String MON_COL = "MondayColumn";
    private static final String TUE_COL = "TuesdayColumn";
    private static final String WED_COL = "WednesdayColumn";
    private static final String THU_COL = "ThursdayColumn";
    private static final String FRI_COL = "FridayColumn";
    private static final String SAT_COL = "SaturdayColumn";
    private static final String SUN_COL = "SundayColumn";
    private static  String COLUMN;
    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {
        String CREATE_ = "CREATE TABLE "+ TRAINING_TABLE + "("+
                MON_COL + " TEXT," + TUE_COL + " TEXT," +
                WED_COL + " TEXT," + THU_COL + " TEXT," +
                FRI_COL + " TEXT," + SAT_COL + " TEXT," +
                SUN_COL + " TEXT" + ");";
        sqLiteDatabase.execSQL(CREATE_);
    }
    private static int Db_VERSION_VALUE = 13;
    public TrainingTracker(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }
    public TrainingTracker(Context context){
        super(context, DB_NAME_VALUE, null, Db_VERSION_VALUE);

    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }

    public void updateValue(int day){
        String GETCOLUMNNAME = null;
        switch (day){
            case 0:
                GETCOLUMNNAME = SUN_COL;
                break;
            case 1:
                GETCOLUMNNAME = MON_COL;
                break;
            case 2:
                GETCOLUMNNAME = TUE_COL;
                break;
            case 3:
                GETCOLUMNNAME = WED_COL;
                break;
            case 4:
                GETCOLUMNNAME = THU_COL;
                break;
            case 5:
                GETCOLUMNNAME = FRI_COL;
                break;
            case 6:
                GETCOLUMNNAME = SAT_COL;
                break;
            default:
                GETCOLUMNNAME = SUN_COL;
                break;
        }

        //query here then store

        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues contentValues = new ContentValues();
        contentValues.put(GETCOLUMNNAME, "stored");

        long ff = db.insert(TRAINING_TABLE, null, contentValues);
        Log.d("TrainingTracker",GETCOLUMNNAME+"  "+ff);
        db.close();
    }

    public void clearTable(){
        SQLiteDatabase db0 = this.getWritableDatabase();
        db0.delete(TRAINING_TABLE,1+"="+1 , null);
        db0.close();
    }
    public String queryTracker(int day, boolean forAll){

        SQLiteDatabase db = this.getReadableDatabase();
        String query_params = null;
        COLUMN = null;
        switch (day){
            case 0:
                query_params = "SELECT " + SUN_COL + " FROM " + TRAINING_TABLE;
                COLUMN = SUN_COL;
                break;
            case 1:
                query_params = "SELECT " + MON_COL + " FROM " + TRAINING_TABLE;
                COLUMN = MON_COL;
                break;
            case 2:
                query_params = "SELECT " + TUE_COL + " FROM " + TRAINING_TABLE;
                COLUMN = TUE_COL;
                break;
            case 3:
                query_params = "SELECT " + WED_COL + " FROM " + TRAINING_TABLE;
                COLUMN = WED_COL;
                break;
            case 4:
                query_params = "SELECT " + THU_COL + " FROM " + TRAINING_TABLE;
                COLUMN = THU_COL;
                break;
            case 5:
                query_params = "SELECT " + FRI_COL + " FROM " + TRAINING_TABLE;
                COLUMN = FRI_COL;
                break;
            case 6:
                COLUMN = SAT_COL;
                query_params = "SELECT " + SAT_COL + " FROM " + TRAINING_TABLE;
                break;
            default:
                COLUMN = SUN_COL;
                query_params = "SELECT " + SUN_COL + " FROM " + TRAINING_TABLE;
                break;
        }
        if(!forAll){
            Cursor cSor = db.rawQuery(query_params, null);
            if(cSor.moveToFirst()){
                do{
                    return cSor.getString(cSor.getColumnIndexOrThrow(TrainingTracker.COLUMN));
                }while(cSor.moveToNext());
            }else{
                return null;
            }

        }else{

            String query_params0 = "SELECT " + SUN_COL + " FROM " + TRAINING_TABLE;
            String query_params1 = "SELECT " + MON_COL + " FROM " + TRAINING_TABLE;
            String query_params2 = "SELECT " + TUE_COL + " FROM " + TRAINING_TABLE;
            String query_params3 = "SELECT " + WED_COL + " FROM " + TRAINING_TABLE;
            String query_params4 = "SELECT " + THU_COL + " FROM " + TRAINING_TABLE;
            String query_params5 = "SELECT " + FRI_COL + " FROM " + TRAINING_TABLE;
            String query_params6 = "SELECT " + SAT_COL + " FROM " + TRAINING_TABLE;
            String queryArr[] = {query_params0, query_params1, query_params2,query_params3, query_params4, query_params5,query_params6};
            String corresP_D[] = {SUN_COL,MON_COL, TUE_COL, WED_COL, THU_COL, FRI_COL, SAT_COL};
            boolean validatorHelper[]  =new boolean[7];
            boolean validator = false;
            for(int i = 0; i<7; i++){
                Cursor cSor = db.rawQuery(queryArr[i], null);

                if(cSor.moveToFirst()){
                    do{

                        try {
                            String  Rvalue  =  cSor.getString(cSor.getColumnIndexOrThrow(corresP_D[i]));
                            Log.d("TrainingT",""+Rvalue + " for " + corresP_D[i]);
                            if(Rvalue.length()==0){
                                validator = false;
                            }else{
                                validator = true;
                            }
                            validatorHelper[i]  = validator;
                        } catch (IllegalArgumentException e) {
                            e.printStackTrace();
                        } finally {
                            continue;
                        }
                    }while(cSor.moveToNext());
                }else{
                    return null;
                }
            }

            if(areAllTrue(validatorHelper)){
                return "stored";
            }else{
                return null;
            }

        }
    }
    public static boolean areAllTrue(boolean[] array)
    {
        for(boolean b : array) if(!b) return false;
        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML>

This page tests :-webkit-any. This window needs to be focused for the :focus tests to pass.

h1

h1

div

foo

b
i

p

a
span

li

u
<s>s</s>

<input type='text'>

div span

<q>div~q</q>
<q>q+q</q>
<q>q>span</q>

first

last


text:
using biz.dfch.CS.Appclusive.UI.App_LocalResources;
using biz.dfch.CS.Appclusive.UI.Models.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace biz.dfch.CS.Appclusive.UI.Models
{
    public class AppcusiveEntityViewModelBase : IAppcusiveEntityBase
    {
        public AppcusiveEntityViewModelBase()
        {
            AppcusiveEntityBaseHelper.InitEntity(this);
        }

        #region IAppcusiveEntityBase

        [Display(Name = "Id", ResourceType = typeof(GeneralResources))]
        public long Id { get; set; }

        [Display(Name = "Created", ResourceType = typeof(GeneralResources))]
        public DateTimeOffset Created { get; set; }

        [Display(Name = "Modified", ResourceType = typeof(GeneralResources))]
        public DateTimeOffset Modified { get; set; }

        [Display(Name = "RowVersion", ResourceType = typeof(GeneralResources))]
        public byte[] RowVersion { get; set; }

        [Display(Name = "Tid", ResourceType = typeof(GeneralResources))]
        public Guid Tid { get; set; }

        [Display(Name = "Tenant", ResourceType = typeof(GeneralResources))]
        public Tenant Tenant { get; set; }

        [Display(Name = "CreatedById", ResourceType = typeof(GeneralResources))]
        public long CreatedById { get; set; }

        [Display(Name = "CreatedBy", ResourceType = typeof(GeneralResources))]
        public User CreatedBy { get; set; }

        [Display(Name = "ModifiedById", ResourceType = typeof(GeneralResources))]
        public long ModifiedById { get; set; }

        [Display(Name = "ModifiedBy", ResourceType = typeof(GeneralResources))]
        public User ModifiedBy { get; set; }

        [Display(Name = "Name", ResourceType = typeof(GeneralResources))]
        public string Name { get; set; }

        [Display(Name = "Description", ResourceType = typeof(GeneralResources))]
        public string Description { get; set; }

        #endregion

    }
}


text:
PKG_NAME = sshfs
PKG_VERS = 2.5
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-fuse-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = http://sourceforge.net/projects/fuse/files/$(PKG_NAME)-fuse/$(PKG_VERS)
PKG_DIR = $(PKG_NAME)-fuse-$(PKG_VERS)

DEPENDS = cross/fuse cross/glib

HOMEPAGE = http://fuse.sourceforge.net/sshfs.html
COMMENT  = sshfs is a filesystem client based on the SSH File Transfer Protocol.
LICENSE  = GNU GPLv2

GNU_CONFIGURE = 1

include ../../mk/spksrc.cross-cc.mk


text:
package org.jvnet.hudson.test;

import hudson.Launcher;
import hudson.Extension;
import hudson.EnvVars;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.Descriptor;
import hudson.tasks.Builder;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;

import java.io.IOException;

/**
 * {@link Builder} that captures the environment variables used during a build.
 *
 * @author Kohsuke Kawaguchi
 */
public class CaptureEnvironmentBuilder extends Builder {

    private EnvVars envVars;

    public EnvVars getEnvVars() {
        return envVars;
    }

    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        envVars = build.getEnvironment(listener);
        return true;
    }

    @Extension
    public static final class DescriptorImpl extends Descriptor<Builder> {

        public Builder newInstance(StaplerRequest req, JSONObject data) {
            throw new UnsupportedOperationException();
        }

        public String getDisplayName() {
            return "Capture Environment Variables";
        }
    }
}


text:
package org.eclipse.californium.examples;

import java.lang.Thread;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.TimeUnit;
import java.lang.InterruptedException;
import java.util.concurrent.TimeUnit;
import java.lang.InterruptedException;

import org.eclipse.californium.core.CoapClient;
import org.eclipse.californium.core.CoapResponse;
import org.eclipse.californium.core.Utils;

public class T4RPiClientThread extends Thread {
	public static void main(String args[]) {
            	T4RPiClientThread t = new T4RPiClientThread();
            	t.start();
        }

        public void run() {
		while(true) {
            		client();
            		// thread will have a sleep time of 10 second
            		try {
                		TimeUnit.SECONDS.sleep(10);
            		} catch(InterruptedException ex) {
                		System.out.println("\nClient Restarted\n");
            		}
		}
        }

    	public void client() {
        	URI uri = null; // URI parameter of the request

        	// input URI from command line arguments
        	try {
            		uri = new URI("coap://api.tantiv4.com:5683/endpoint/keepalive");
        	} catch (URISyntaxException e) {
            		System.err.println("Invalid URI: " + e.getMessage());
            		System.exit(-1);
        	}
        	CoapClient client = new CoapClient(uri);
        	//JSONObject body = new JSONObject();
        	//body.put("device_id", "rpi1");
        	CoapResponse response = client.post("{\"device_id\":\"t4rpi1\"}", 1);

        	if (response!=null) {
            		System.out.println(response.getCode());
            		System.out.println(response.getOptions());
            		System.out.println(response.getResponseText());

            		System.out.println("\nADVANCED\n");
            		// access advanced API with accesUs to more details through .advanced()
            		System.out.println(Utils.prettyPrint(response));
        	} else {
            		System.out.println("No response received.");
        	}
    	}
}


text:
#include "config.h"

#include "core/rendering/RenderMarquee.h"

#include "HTMLNames.h"
#include "core/html/HTMLMarqueeElement.h"
#include "core/page/FrameView.h"
#include "core/page/UseCounter.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderView.h"

using namespace std;

namespace WebCore {

using namespace HTMLNames;

RenderMarquee::RenderMarquee(Element* element)
    : RenderBlock(element)
    , m_currentLoop(0)
    , m_totalLoops(0)
    , m_timer(this, &RenderMarquee::timerFired)
    , m_start(0)
    , m_end(0)
    , m_speed(0)
    , m_reset(false)
    , m_suspended(false)
    , m_stopped(false)
    , m_direction(MAUTO)
{
    UseCounter::count(document(), UseCounter::HTMLMarqueeElement);
}

RenderMarquee::~RenderMarquee()
{
}

int RenderMarquee::marqueeSpeed() const
{
    int result = style()->marqueeSpeed();
    if (Node* node = this->node()) {
        ASSERT(node->hasTagName(marqueeTag));
        HTMLMarqueeElement* marqueeElt = static_cast<HTMLMarqueeElement*>(node);
        result = max(result, marqueeElt->minimumDelay());
    }
    return result;
}

EMarqueeDirection RenderMarquee::direction() const
{
    // FIXME: Support the CSS3 "auto" value for determining the direction of the marquee.
    // For now just map MAUTO to MBACKWARD
    EMarqueeDirection result = style()->marqueeDirection();
    TextDirection dir = style()->direction();
    if (result == MAUTO)
        result = MBACKWARD;
    if (result == MFORWARD)
        result = (dir == LTR) ? MRIGHT : MLEFT;
    if (result == MBACKWARD)
        result = (dir == LTR) ? MLEFT : MRIGHT;

    // Now we have the real direction.  Next we check to see if the increment is negative.
    // If so, then we reverse the direction.
    Length increment = style()->marqueeIncrement();
    if (increment.isNegative())
        result = static_cast<EMarqueeDirection>(-result);

    return result;
}

bool RenderMarquee::isHorizontal() const
{
    return direction() == MLEFT || direction() == MRIGHT;
}

int RenderMarquee::computePosition(EMarqueeDirection dir, bool stopAtContentEdge)
{
    if (isHorizontal()) {
        bool ltr = style()->isLeftToRightDirection();
        LayoutUnit clientWidth = this->clientWidth();
        LayoutUnit contentWidth = ltr ? maxPreferredLogicalWidth() : minPreferredLogicalWidth();
        if (ltr)
            contentWidth += (paddingRight() - borderLeft());
        else {
            contentWidth = width() - contentWidth;
            contentWidth += (paddingLeft() - borderRight());
        }
        if (dir == MRIGHT) {
            if (stopAtContentEdge)
                return max<LayoutUnit>(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
            else
                return ltr ? contentWidth : clientWidth;
        }
        else {
            if (stopAtContentEdge)
                return min<LayoutUnit>(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
            else
                return ltr ? -clientWidth : -contentWidth;
        }
    }
    else {
        int contentHeight = layoutOverflowRect().maxY() - borderTop() + paddingBottom();
        int clientHeight = this->clientHeight();
        if (dir == MUP) {
            if (stopAtContentEdge)
                 return min(contentHeight - clientHeight, 0);
            else
                return -clientHeight;
        }
        else {
            if (stopAtContentEdge)
                return max(contentHeight - clientHeight, 0);
            else
                return contentHeight;
        }
    }
}

void RenderMarquee::start()
{
    if (m_timer.isActive() || style()->marqueeIncrement().isZero())
        return;

    // We may end up propagating a scroll event. It is important that we suspend events until
    // the end of the function since they could delete the layer, including the marquee.
    FrameView* frameView = document()->view();
    if (frameView)
        frameView->pauseScheduledEvents();

    if (!m_suspended && !m_stopped) {
        if (isHorizontal())
            layer()->scrollToOffset(IntSize(m_start, 0));
        else
            layer()->scrollToOffset(IntSize(0, m_start));
    }
    else {
        m_suspended = false;
        m_stopped = false;
    }

    m_timer.startRepeating(speed() * 0.001);

    if (frameView)
        frameView->resumeScheduledEvents();
}

void RenderMarquee::suspend()
{
    m_timer.stop();
    m_suspended = true;
}

void RenderMarquee::stop()
{
    m_timer.stop();
    m_stopped = true;
}

void RenderMarquee::updateMarqueePosition()
{
    bool activate = (m_totalLoops <= 0 || m_currentLoop < m_totalLoops);
    if (activate) {
        EMarqueeBehavior behavior = style()->marqueeBehavior();
        m_start = computePosition(direction(), behavior == MALTERNATE);
        m_end = computePosition(reverseDirection(), behavior == MALTERNATE || behavior == MSLIDE);
        if (!m_stopped)
            start();
    }
}

const char* RenderMarquee::renderName() const
{
    if (isFloating())
        return "RenderMarquee (floating)";
    if (isOutOfFlowPositioned())
        return "RenderMarquee (positioned)";
    if (isAnonymous())
        return "RenderMarquee (generated)";
    if (isRelPositioned())
        return "RenderMarquee (relative positioned)";
    if (isRunIn())
        return "RenderMarquee (run-in)";
    return "RenderMarquee";

}

void RenderMarquee::styleDidChange(StyleDifference difference, const RenderStyle* oldStyle)
{
    RenderBlock::styleDidChange(difference, oldStyle);

    RenderStyle* s = style();

    if (m_direction != s->marqueeDirection() || (m_totalLoops != s->marqueeLoopCount() && m_currentLoop >= m_totalLoops))
        m_currentLoop = 0; // When direction changes or our loopCount is a smaller number than our current loop, reset our loop.

    m_totalLoops = s->marqueeLoopCount();
    m_direction = s->marqueeDirection();

    // Hack for WinIE. In WinIE, a value of 0 or lower for the loop count for SLIDE means to only do
    // one loop.
    if (m_totalLoops <= 0 && s->marqueeBehavior() == MSLIDE)
        m_totalLoops = 1;

    // Hack alert: Set the white-space value to nowrap for horizontal marquees with inline children, thus ensuring
    // all the text ends up on one line by default. Limit this hack to the <marquee> element to emulate
    // WinIE's behavior. Someone using CSS3 can use white-space: nowrap on their own to get this effect.
    // Second hack alert: Set the text-align back to auto. WinIE completely ignores text-align on the
    // marquee element.
    // FIXME: Bring these up with the CSS WG.
    if (isHorizontal() && childrenInline()) {
        s->setWhiteSpace(NOWRAP);
        s->setTextAlign(TASTART);
    }

    // Legacy hack - multiple browsers default vertical marquees to 200px tall.
    if (!isHorizontal() && s->height().isAuto())
        s->setHeight(Length(200, Fixed));

    if (speed() != marqueeSpeed()) {
        m_speed = marqueeSpeed();
        if (m_timer.isActive())
            m_timer.startRepeating(speed() * 0.001);
    }

    // Check the loop count to see if we should now stop.
    bool activate = (m_totalLoops <= 0 || m_currentLoop < m_totalLoops);
    if (activate && !m_timer.isActive())
        setNeedsLayout(true);
    else if (!activate && m_timer.isActive())
        m_timer.stop();
}

void RenderMarquee::timerFired(Timer<RenderMarquee>*)
{
    // FIXME: Why do we need to check the view and not just the RenderMarquee itself?
    if (view()->needsLayout())
        return;

    if (m_reset) {
        m_reset = false;
        if (isHorizontal())
            layer()->scrollToXOffset(m_start);
        else
            layer()->scrollToYOffset(m_start);
        return;
    }

    RenderStyle* s = style();

    int endPoint = m_end;
    int range = m_end - m_start;
    int newPos;
    if (range == 0)
        newPos = m_end;
    else {
        bool addIncrement = direction() == MUP || direction() == MLEFT;
        bool isReversed = s->marqueeBehavior() == MALTERNATE && m_currentLoop % 2;
        if (isReversed) {
            // We're going in the reverse direction.
            endPoint = m_start;
            range = -range;
            addIncrement = !addIncrement;
        }
        bool positive = range > 0;
        int clientSize = (isHorizontal() ? clientWidth() : clientHeight());
        int increment = abs(intValueForLength(style()->marqueeIncrement(), clientSize));
        int currentPos = (isHorizontal() ? layer()->scrollXOffset() : layer()->scrollYOffset());
        newPos =  currentPos + (addIncrement ? increment : -increment);
        if (positive)
            newPos = min(newPos, endPoint);
        else
            newPos = max(newPos, endPoint);
    }

    if (newPos == endPoint) {
        m_currentLoop++;
        if (m_totalLoops > 0 && m_currentLoop >= m_totalLoops)
            m_timer.stop();
        else if (s->marqueeBehavior() != MALTERNATE)
            m_reset = true;
    }

    if (isHorizontal())
        layer()->scrollToXOffset(newPos);
    else
        layer()->scrollToYOffset(newPos);
}

} // namespace WebCore


text:
package com.streamsets.pipeline.stage.processor.fieldtypeconverter;

import com.streamsets.pipeline.api.ErrorCode;
import com.streamsets.pipeline.api.GenerateResourceBundle;

@GenerateResourceBundle
public enum Errors implements ErrorCode {
  CONVERTER_00("Failed to convert field '{}' of type '{}' with value '{}' to type '{}'"),
  CONVERTER_01("Invalid Encoding '{}'"),
  ;

  private final String msg;
  Errors(String msg) {
    this.msg = msg;
  }

  @Override
  public String getCode() {
    return name();
  }

  @Override
  public String getMessage() {
    return msg;
  }

}


text:
package epic
package preprocess

import java.io.InputStream
import java.net.URL

import de.l3s.boilerpipe.extractors.ArticleExtractor
import epic.slab.Slab
import epic.trees.Span
import org.apache.tika.Tika
import org.apache.tika.io.TikaInputStream
import org.apache.tika.metadata.Metadata
import org.apache.tika.parser.html.BoilerpipeContentHandler
import org.apache.tika.parser.{ParseContext, Parser}
import org.apache.tika.sax.ToTextContentHandler
import org.xml.sax._

/**
 * Just a simple thing for me to learn Tika
 *
 * @author dlwh
 **/
object TextExtractor {
  if (!hasTika)
    throw new RuntimeException("Apache Tika is an optional dependency and is not on the classpath")

  def extractText(url: URL, extractMainContentOnly: Boolean = true) = loadSlab(url, extractMainContentOnly).content

  def loadSlab(url: URL, extractMainContentOnly: Boolean = true) = {
    val newLineTags = Set(
      "address",
      "blockquote",
      "div",
      "dl",
      "fieldset",
      "form",
      "h1",
      "h2",
      "h3",
      "h4",
      "h5",
      "h6",
      "hr",
      "noscript",
      "ol",
      "p",
      "pre",
      "table",
      "ul",
      "dd",
      "dt",
      "li",
      "tbody",
      "td",
      "tfoot",
      "th",
      "thead",
      "tr",
      // html5
      "article",
      "aside",
      "audio",
      "canvas",
      "figcaption",
      "figure",
      "header",
      "hgroup",
      "output",
      "section",
      "video"
    )

    val textHandler = new ToTextContentHandler() {
      override def ignorableWhitespace(ch: Array[Char], start: Int, length: Int): Unit = characters(ch, start, length)

      override def startElement(uri: String, localName: String, qName: String, attributes: Attributes): Unit = {
        super.startElement(uri, localName, qName, attributes)
        if (newLineTags(qName.toLowerCase)) {
          ignorableWhitespace(Array('\n'), 0, 1)
        }
      }

      override def endElement(uri: String, localName: String, qName: String): Unit = {
        super.endElement(uri, localName, qName)
        if (newLineTags(qName.toLowerCase)) {
          ignorableWhitespace(Array('\n'), 0, 1)
        }

      }
    }
    val handler = if (extractMainContentOnly) {
      new BoilerpipeContentHandler(textHandler, ArticleExtractor.getInstance()) {
        // stupid handler doesn't pass whitespace
        /*
        override def ignorableWhitespace(ch: Array[Char], start: Int, length: Int): Unit = {
          try {
            characters(ch, start, length)
          } catch {
            case ex: ArrayIndexOutOfBoundsException =>
          }
        }
        */
        setIncludeMarkup(true)
      }
    } else {
      textHandler
    }
    val tk = new Tika()
    val parser = tk.getParser

    val metadata: Metadata = new Metadata
    val stream: InputStream = TikaInputStream.get(url, metadata)

    try {
      val context: ParseContext = new ParseContext
      context.set(classOf[Parser], parser)
      parser.parse(stream, handler, metadata, context)
    } finally {
      stream.close()
    }

    val content = textHandler.toString.trim

    Slab(content).addLayer(Span(0, content.length) -> epic.slab.Source(url))
  }

  /* TODO: I'd like to be able to keep the XHTML formatting in the text, but right now that looks like it's going to
  cause problems with the way slabs work. (Namely, we'll get discontiguous blocks of text, even in the middle of words.
   * Uses boilerpipe to extract the content from an XHTML document
   * @return
  case class Content(labels: Set[String] = Set.empty)
  def loadSlab(url: URL):StringSlab[Content] = {
    val originalxhtml = extractXHTML(url)
    val doc = new BoilerpipeSAXInput(new InputSource(new StringReader(originalxhtml.toString))).getTextDocument

    ArticleExtractor.getInstance().process(doc)

    val textElements = doc.getTextBlocks.asScala.collect { case block if block.isContent =>
      block.getContainedTextElements
    }.foldLeft(new java.util.BitSet()) {(a,b) => a |= b; a}

    val sb = new StringBuilder()
    val contents = new ArrayBuffer[(Span, Content)]()

    val handler = new DefaultHandler {
      var index = 0

      override def startElement(uri: String, localName: String, qName: String, attributes: Attributes): Unit = {
        sb.append('<')
        sb.append(qName)
        for(i <- 0 until attributes.getLength) {
          val attr: String = attributes.getQName(i)
          val value: String = attributes.getValue(i)
          sb.append(' ')
          sb.append(attr)
          sb.append("=\"")
          sb.append(StringEscapeUtils.escapeXml11(value))
          sb.append("\"")
        }

        sb.append('>')
      }

      override def endElement(uri: String, localName: String, qName: String): Unit = {
        sb.append("</")
        sb.append(qName)
        sb.append('>')
      }

      override def ignorableWhitespace(ch: Array[Char], start: Int, length: Int): Unit = {
        sb.appendAll(ch, start, length)
      }

      override def characters(ch: Array[Char], start: Int, length: Int): Unit = {
        index += 1
        val s = sb.length
        val value = new String(ch, start, length)
        sb.append(StringEscapeUtils.escapeXml11(value))
        if (textElements(index)) {
          contents.append(Span(s, sb.length) -> Content(getLabelsForTextElement(doc, index)))
        }
      }
    }

    val parser = new AbstractSAXParser(new HTMLConfiguration) {setContentHandler(handler)}

    parser.parse(new InputSource(new StringReader(originalxhtml.toString())))

    val content = sb.toString

    Slab(content)++contents

  }

  private def getLabelsForTextElement(doc: TextDocument, index: Int): Set[String] = {
    doc.getTextBlocks.asScala.find(_.getContainedTextElements.get(index)).map(b => Option(b.getLabels).map(_.asScala).iterator.flatten.toSet).getOrElse(Set.empty)
  }

   */
  def extractXHTML(url: URL) = {
    val metadata = new Metadata()
    val stream: InputStream = TikaInputStream.get(url, metadata)
    val loader = new Loader()
    new Tika().getParser.parse(stream, loader, metadata, new ParseContext)
    loader.value
  }

  def foo(url: URL)=  {
    ArticleExtractor.INSTANCE.getText(url)
  }

  import org.xml.sax._
  import org.xml.sax.helpers.DefaultHandler

import scala.xml._
  import scala.xml.factory.XMLLoader

  class Loader extends DefaultHandler with XMLLoader[Elem] {
    val newAdapter = adapter
    def value = newAdapter.rootElem.asInstanceOf[Elem]

    override def characters( ch: Array[Char], start: Int, length: Int) {
      newAdapter.characters(ch, start, length)
    }
    override def endDocument() {
      newAdapter.endDocument()
      // the pdf parser sends two end documents...
      if (newAdapter.scopeStack.nonEmpty)
        newAdapter.scopeStack.pop()
    }
    override def endElement(uri: String, localName: String, qName: String) {
      newAdapter.endElement(uri, localName, qName)
    }
    override def processingInstruction(target: String, data: String) {
      newAdapter.processingInstruction(target, data)
    }
    override def startDocument() {
      newAdapter.scopeStack push TopScope
      newAdapter.startDocument()
    }
    override def startElement(uri: String, localName: String, qName: String, atts: Attributes) {
      newAdapter.startElement(uri, localName, qName, atts)
    }

    override def ignorableWhitespace(ch: Array[Char], start: Int, length: Int): Unit = {
      characters(ch, start, length)
    }
  }

  def hasTika = {
    try {
      Class.forName(classOf[Tika].getName)
      true
    }
    catch {
      case _: Any => false
    }
  }

}


text:
#ifndef DrawEM_H_
#define DrawEM_H_

#include "mirtk/EMBase.h"

#include "mirtk/PolynomialBiasField.h"
#include "mirtk/Image.h"
#include "mirtk/HashProbabilisticAtlas.h"
#include "mirtk/BiasField.h"
#include "mirtk/BiasCorrection.h"
#include "mirtk/Image.h"
#include "mirtk/GaussianBlurring.h"
#include "mirtk/EuclideanDistanceTransform.h"
#include "mirtk/ConnectedComponents.h"

#include <set>
#include <map>
#include <vector>
#include <utility>

namespace mirtk {

class DrawEM : public EMBase
{
    mirtkObjectMacro(DrawEM);

protected:
    //

    /// local weights for MRF field
    RealImage _MRF_weights;

    /// Uncorrected image
    RealImage _uncorrected;

    /// Bias field correction filter
    BiasCorrection _biascorrection;

    /// Bias field
    BiasField *_biasfield;

    /// MRF connectivity
    Matrix _connectivity;

    /// PV classes
    map<int,int> pv_classes;
    vector< pair<int, int> > pv_connections;
    vector<double> pv_fc;

    /// use 26-nn MRF
    bool bignn;
    /// do PV correction similar to Hui et al.
    bool huipvcorr;
    /// weight of the MRF
    double mrfweight;
    /// intra MRF
    double beta,betainter;

    /// inter MRF
    bool intermrf;
    RealImage **_MRF_inter;

    /// the tissue class of each label
    Array<int> tissuelabels;
    int csflabel,wmlabel,gmlabel,outlabel;

private:
    bool isPVclass(int pvclass);
    double getMRFenergy(int index, int tissue);
    double getMRFInterEnergy(int index, int tissue);

public:
    /// Constructor
    DrawEM();
    template <class ImageType>
    DrawEM(int noTissues, ImageType **atlas, ImageType *background);
    template <class ImageType>
    DrawEM(int noTissues, ImageType **atlas);
    template <class ImageType>
    DrawEM(int noTissues, ImageType **atlas, ImageType **initposteriors);

    /// Initialize parameters
    void InitialiseParameters();

    /// Get the bias field
    void GetBiasField(RealImage &image);

    /// add partial volume between classes classA and classB
    int AddPartialVolumeClass(int classA, int classB, int huiclass=0);

    /// estimate probabilities
    void EStepMRF(void);

    /// relax priors
    void RStep(void);
    void RStep(double rf);

    /// Estimates bias field
    virtual void BStep();

protected:

    using EMBase::SetInput;

public:

    /// Set image
    virtual void SetInput(const RealImage &, const Matrix &);

    /// Set bias field
    virtual void SetBiasField(BiasField *);

    /// Execute one iteration and return log likelihood
    virtual double Iterate(int iteration);

    /// Compute the bias corrected image
    virtual void GetBiasCorrectedImage(RealImage &);

    /// set the MRF strength
    virtual void setMRFstrength(double mrfw);
    /// set a 26-neighborhood in the MRF
    virtual void setbignn(bool bnn);
    /// computes the MRF with the 26-neighborhood
    double getMRFenergy_diag(int index, int tissue);

    /// removes the PV classes!
    //void removePVclasses(double threshold = 0.1);

    /// sets the tissue class of each label
    void setTissueLabels(int num,int *atisslabels);

    /// set hui-style PV correction
    void setHui(bool hui);
    /// hui-style PV correction - HACKY!!
    void huiPVCorrection(bool changePosterior=false);
    /// construct seg with the tissue class of each label instead of the label itself
    void ConstructSegmentationHui(IntegerImage &segmentation);
    /// finds the overall tissue probabilities at the voxel (x,y,z)
    /// by adding the probability of the different labels belonging to the tissue class
    void getHuiValues(double &outval,double &csfval,double &gmval,double &wmval,int x,int y,int z,bool atlas);
    /// modifies the probability of the labels according to overall tissue probabilities at the voxel (x,y,z)
    /// the overall tissue probability is divided to its labels according to their "contribution" to the tissue
    void setHuiValues(double &outval,double &csfval,double &gmval,double &wmval,int x,int y,int z,bool atlas);

    /// set beta_intra
    virtual void setBeta(double beta);
    /// set beta_inter
    virtual void setBetaInter(double betainter);
    /// set mrf_inter term
    virtual void setMRFInterAtlas(RealImage **&atlas);

};

inline void DrawEM::setHui(bool hui){huipvcorr=hui;}
inline void DrawEM::setbignn(bool bnn){bignn=bnn;}
inline void DrawEM::setMRFstrength(double mrfw){mrfweight=mrfw;}
inline void DrawEM::setMRFInterAtlas(RealImage **&atlas){	_MRF_inter=atlas; intermrf=true;}
inline void DrawEM::setBeta(double b){beta=b;}
inline void DrawEM::setBetaInter(double b){betainter=b;}

inline void DrawEM::setTissueLabels(int num,int *atisslabels)
{
  tissuelabels.resize(num);
  for (int i = 0; i < num; i++) {
    tissuelabels[i] = atisslabels[i];
  }
}

} // namespace mirtk

#endif /* DrawEM_H_ */


text:
package com.google.code.morphia.testmodel;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Embedded;
import com.google.code.morphia.annotations.Reference;
import com.google.code.morphia.annotations.Property;
import com.google.code.morphia.testutil.TestEntity;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Olafur Gauti Gudmundsson
 */
@Entity("articles")
@SuppressWarnings("unchecked")
public class Article extends TestEntity {
	private static final long serialVersionUID = 1L;

    @Embedded
    private Map<String,Translation> translations;
	@Property
    private Map attributes;
    @Reference
    private Map<String,Article> related;

    public Article() {
        super();
        translations = new HashMap<String,Translation>();
        attributes = new HashMap<String,Object>();
        related = new HashMap<String,Article>();
    }

    public Map<String, Translation> getTranslations() {
        return translations;
    }

    public void setTranslations(Map<String, Translation> translations) {
        this.translations = translations;
    }

    public void setTranslation( String langCode, Translation t ) {
        translations.put(langCode, t);
    }

    public Translation getTranslation( String langCode ) {
        return translations.get(langCode);
    }

    public Map<String, Object> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, Object> attributes) {
        this.attributes = attributes;
    }

    public void setAttribute( String name, Object value ) {
        attributes.put(name, value);
    }

    public Object getAttribute( String name ) {
        return attributes.get(name);
    }

    public Map<String, Article> getRelated() {
        return related;
    }

    public void setRelated(Map<String, Article> related) {
        this.related = related;
    }

    public void putRelated(String name, Article a) {
        related.put(name, a);
    }

    public Article getRelated( String name ) {
        return related.get(name);
    }
}


text:
Object::Object (std::string name)
{
  name_ = name;

  actors_ = vtkSmartPointer<vtkActorCollection>::New ();
}

// Accessors
// -----------------------------------------------------------------------------
std::string
Object::getName () const
{
  return name_;
}

void
Object::setName (std::string name)
{
  name_ = name;
}

vtkSmartPointer<vtkActorCollection>
Object::getActors ()
{
  return actors_;
}

void
Object::render (vtkRenderer* renderer)
{
  boost::mutex::scoped_lock lock (actors_mutex_);
  // Iterate over the objects actors
  actors_->InitTraversal ();
  for (vtkIdType i = 0; i < actors_->GetNumberOfItems (); i++)
  {
    vtkActor* actor = actors_->GetNextActor ();

    // If the actor hasn't been added to the renderer add it
    std::set<vtkRenderer*>::iterator renderer_it;
    renderer_it = associated_renderers_[actor].find (renderer);
    if (renderer_it == associated_renderers_[actor].end ())
    {
      associated_renderers_[actor].insert (renderer);
      renderer->AddActor (actor);
    }
  }
}

bool
Object::hasActor (vtkActor *actor)
{
  boost::mutex::scoped_lock lock (actors_mutex_);

  return actors_->IsItemPresent (actor);
}

void
Object::addActor (vtkActor *actor)
{
  Scene::instance ()->lock ();
  boost::mutex::scoped_lock lock (actors_mutex_);

  if (!actors_->IsItemPresent (actor))
    actors_->AddItem (actor);

  // If the actor doesn't exist in the associated_renderers_ map add it
  std::map<vtkActor*, std::set<vtkRenderer*> >::iterator actor_it;
  actor_it = associated_renderers_.find (actor);
  if (actor_it == associated_renderers_.end ())
  {
    associated_renderers_[actor] = std::set<vtkRenderer*> ();
  }
  Scene::instance ()->unlock ();

//  Scene *scene = Scene::instance();
//  std::vector<Viewport*> viewports = scene->getViewports();
//  for(int i=0; i < viewports.size(); i++)
//  {
//
//    vtkRenderer *renderer = viewports[i]->getRenderer();
//    // If the actor hasn't been added to the renderer add it
//    std::set<vtkRenderer*>::iterator renderer_it;
//    renderer_it = associated_renderers_[actor].find(renderer);
//    if (renderer_it == associated_renderers_[actor].end())
//    {
//      associated_renderers_[actor].insert(renderer);
//      renderer->AddActor(actor);
//    }
//  }
}

void
Object::removeActor (vtkActor *actor)
{
  Scene::instance ()->lock ();
  //std::cout << "Removing Actor" << std::endl;
  boost::mutex::scoped_lock lock (actors_mutex_);
  actors_->RemoveItem (actor);

  std::map<vtkActor*, std::set<vtkRenderer*> >::iterator actor_it;
  actor_it = associated_renderers_.find (actor);

  if (actor_it != associated_renderers_.end ())
  {
    std::set<vtkRenderer*>::iterator renderer_it;
    for (renderer_it = associated_renderers_[actor].begin (); renderer_it != associated_renderers_[actor].end ();
        renderer_it++)
    {
      (*renderer_it)->RemoveActor (actor);
    }
    associated_renderers_.erase (actor);
  }
  //std::cout << "Removing Actor - DONE" << std::endl;
  Scene::instance ()->unlock ();
}


text:
The purpose of this function is to reference a variable in the thread explicitly.  This avoids [minification from mangling references](#thread/minification) to things you have required via `thread.require()` or to thread globals like `resolve()` or `broadcast()`.

## Examples

```js
function foo(){
  return 'bar';
}

var t = weaver.thread();

t.require( foo, 'foo' ); // explicitly specify name to avoid minification issues

t.run(function(){
   // explicitly get by reference to avoid minification issues:
  var foo = _ref_('foo');
  var resolve = _ref_('resolve');

  resolve( foo() );
}).then(function( val ){
  console.log( val ); // bar
});
```


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>Redirect app</title>

plop://view1

router://view1

router://view2

router://view1?param=test

router://view1?param=test&param2=plop


text:
import util.continuations.{shift, reset}

object Experiment5 {

	def wrap(f: (Unit=>Unit) => Unit ) = shift(f)

	def main(args: Array[String]) {
		var callback: Unit=>Unit = null
		reset {
			def f(k: Unit=>Unit): Unit = {callback = k}
			wrap(f)
			println(2)
		}
		println(1)
		callback()

    }

}


text:
(function() {
    'use strict';

    angular
        .module('mdPickers')
        .factory('mdpDatePickerService', mdpDatePickerService);

    /** @ngInject */
    function mdpDatePickerService() {

        var service = {
            formatValidator: formatValidator,
            minDateValidator: minDateValidator,
            maxDateValidator: maxDateValidator,
            filterValidator: filterValidator,
            requiredValidator: requiredValidator
        };

        return service;

        function formatValidator(value, format) {
            return !value || angular.isDate(value) || moment(value, format, true).isValid();
        }

        function minDateValidator(value, format, minDate) {
            minDate = moment(minDate, "YYYY-MM-DD", true);
            var date = angular.isDate(value) ? moment(value) : moment(value, format, true);

            return !value ||
                angular.isDate(value) ||
                !minDate.isValid() ||
                date.isSameOrAfter(minDate);
        }

        function maxDateValidator(value, format, maxDate) {
            maxDate = moment(maxDate, "YYYY-MM-DD", true);
            var date = angular.isDate(value) ? moment(value) : moment(value, format, true);

            return !value ||
                angular.isDate(value) ||
                !maxDate.isValid() ||
                date.isSameOrBefore(maxDate);
        }

        function filterValidator(value, format, filter) {
            var date = angular.isDate(value) ? moment(value) : moment(value, format, true);

            return !value ||
                angular.isDate(value) ||
                !angular.isFunction(filter) ||
                !filter(date);
        }

        function requiredValidator(value, isRequired) {
            return !(isRequired && (value === undefined || value === null || value === ''));
        }

    }
})();


text:
package bear.task;

/**
 * @author Andrey Chaschev chaschev@gmail.com
 */
public class BearException extends RuntimeException {
    public BearException() {
    }

    public BearException(String message) {
        super(message);
    }

    public BearException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
//
// Created by Anton Dobkin on 14.03.15.
// Copyright © 2015 Anton Dobkin. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <UIKit/UIkit.h>
#import "ADAlertControllerAnimationProtocol.h"

@class ADAlertControllerAction;
@class ADAlertControllerTextField;
@class ADAlertControllerTextView;

typedef NS_ENUM(NSInteger, ADAlertControllerStyle) {
    ADAlertControllerStyleAlert = 0,
    ADAlertControllerStyleActionSheet
};

NS_ASSUME_NONNULL_BEGIN;

/*!
 * An instance of ADAlertController displays an alert message to the user.
 *
 * The ADAlertController - a replacement for UIAlertController with block-based API. The
 * ADAlertController displays an alert message to the user and supports two style to display:
 *
 *   - ADAlertControllerStyleAlert - By default an alert displayed modally in center of screen
 *   - ADAlertControllerStyleActionSheet - By default an action sheet displayed modally on bottom of screen
 *
 * After configuring the ADAlertController present it using the presentViewController:animated:completion: method.
 *
 * In addition to displaying a message to a user, you can associate user's actions with your alert controller to give the user
 * a way to respond. Each action is instance of ADAlertControllerAction. To add the action you should use the addAction:
 * or addActions: method.
 *
 * When you configuring the ADAlertController with the ADAlertControllerStyleAlert style, you can add text fields and text views.
 * To add the text field you should use the addTextField: method, to add the text view - addTextView: method. The ADAlertController
 * lets you provide a block for configuring your text fields prior to display it. The text field is instance of
 * ADAlertControllerTextField, the text view is instance of ADAlertControllerTextView.
 *
 * Additionally, you can add any custom view to the alert controller if used ADAlertControllerStyleAlert style.
 */
@interface ADAlertController : UIViewController

///-----------------------------------------------------------------------------
/// @name Configuring
///-----------------------------------------------------------------------------

/*!
 * The title of the alert controller.
 *
 * The title string is displayed top in the alert controller. You should use this string to get the user's
 * attention and communicate the reason for displaying the alert.
 */
@property(copy, nonatomic, readwrite, nullable) NSString *title;

/*!
 * The descriptive, which provides more details about the reason for the alert controller.
 *
 * The description string is displayed below the title string. Use this string to provide additional context
 * about the reason for the alert or about the actions that the user might take.
 */
@property(copy, nonatomic, readwrite, nullable) NSString *message;

/*!
 * The style of the alert controller.
 *
 * This value determines how the alert is displayed on screen.
 */
@property(assign, nonatomic, readonly) ADAlertControllerStyle style;

/*!
 * The inset or outset margins for the rectangle around the content view.
 */
@property(assign, nonatomic, readwrite) UIEdgeInsets contentInsets;

/*!
 * Flag used to disable blur effect for content view. Default value is NO.
 */
@property(assign, nonatomic, readwrite) BOOL disableBlurEffects;

/*!
 * Blur style. Default UIBlurEffectStyleExtraLight
 */
@property(assign, nonatomic, readwrite) UIBlurEffectStyle blurStyle;

/*!
 * Background color.
 */
@property(strong, nonatomic, readwrite, nullable) UIColor *backgroundColor;

/*!
 * The Block that will be called upon tapping the background.
 */
@property(copy, nonatomic, readwrite, nullable) void (^backgroundTapHandler)(void);

/*!
 * The animation wich uses to present and dismiss instance of ADAlertController.
 *
 * If is in nil value, will be used default animation. Default is nil.
 */
@property(strong, nonatomic, readwrite, null_resettable) id <ADAlertControllerAnimation> animation;

///-----------------------------------------------------------------------------
/// @name Initializing
///-----------------------------------------------------------------------------

/*!
 * Initializes and returns a new instance.
 *
 * @param title The title string is displayed top in the alert controller. Use this string
 * 		to get the user's attention and communicate the reason for the
 * 		alert. Can be nil.
 * @param message The description string is displayed below the title string. Can be nil
 * @param style Determines how the alert controller is displayed on screen.
 */
- (instancetype)initWithTitle:(nullable NSString *)title
                      message:(nullable NSString *)message
                        style:(ADAlertControllerStyle)style NS_DESIGNATED_INITIALIZER;

/*!
 * Initializes and returns a new instance.
 *
 * @param title The title string is displayed top in the alert controller. Use this
 *              string to get the user's attention and communicate the reason for the
 *              alert. Can be nil.
 * @param message The description string is displayed below the title string. Can be nil
 */
- (instancetype)initWithTitle:(nullable NSString *)title
                      message:(nullable NSString *)message;

///-----------------------------------------------------------------------------
/// @name Actions
///-----------------------------------------------------------------------------

/*!
 * Adds an action to the alert controller
 *
 * @param action The action
 */
- (void)addAction:(ADAlertControllerAction *)action;

/*!
 * Adds multiple actions to the alert controller
 *
 * @param actions The Array of actions
 */
- (void)addActions:(NSArray <ADAlertControllerAction *> *)actions;

///-----------------------------------------------------------------------------
/// @name Text Fields & Text Views
///-----------------------------------------------------------------------------

/*!
 * The array of text fields displayed by the alert controller.
 *
 * Use this property to access the text fields displayed by the alert. The text fields are in
 * the order in which you added them to the alert controller.
 */
@property(strong, nonatomic, readonly, nullable) NSArray <ADAlertControllerTextField *> *textFields;

/*!
 * The array of text views displayed by the alert controller.
 *
 * Use this property to access the text views displayed by the alert. The text views are in
 * the order in which you added them to the alert controller.
 */
@property(strong, nonatomic, readonly, nullable) NSArray <ADAlertControllerTextView *> *textViews;

/*!
 * Adds a text field to the alert controller.
 *
 * @param configurationHandler A block used to configure the text field. The block takes the text field instance as a parameter,
 * and can modify it properties prior to being displayed.
 */
- (void)addTextField:(nullable void (^)(ADAlertControllerTextField *field))configurationHandler;

/*!
 * Adds a text view to the alert controller.
 *
 * @param configurationHandler A block used to configure the text view. The block takes the text view instance as a parameter,
 * and can modify it properties prior to being displayed.
 */
- (void)addTextView:(nullable void (^)(ADAlertControllerTextView *textView))configurationHandler;

///-----------------------------------------------------------------------------
/// @name Custom Views
///-----------------------------------------------------------------------------

/*!
 * The custom header view that is displayed above the content.
 * Default is nil.
 */
@property(strong, nonatomic, readwrite) UIView *headerView;

/*!
 * The inset or outset margins for the rectangle around the header view.
 */
@property(assign, nonatomic, readwrite) UIEdgeInsets headerInsets;

- (void)addOtherView:(UIView *)view;
@end

NS_ASSUME_NONNULL_END;


text:
using System;
using System.Collections.Generic;
using MineLib.Network;
using MineLib.Network.Data;
using MineLib.Network.Data.Anvil;
using ProtocolModern.Enum;

namespace MineLib.ClientWrapper.Data.BigData
{
    // Just ignore it. I think something is wrong here :DD
    internal static class TimeSpanUtil
    {
        public static double ConvertSecondsToDays(double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalDays;
        }

        public static double ConvertSecondsToHours(double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalHours;
        }

        public static double ConvertSecondsToMinutes(double seconds)
        {
            return TimeSpan.FromSeconds(seconds).TotalMinutes;
        }

    }

    public class World
    {
        public List<Chunk> Chunks;

        // -- Debugging
        public static List<string> UnsupportedBlockList = new List<string>();
        public static List<IPacket> DamagedChunks = new List<IPacket>();
        // -- Debugging

        public GameMode GameMode;
        public Dimension Dimension;
        public Difficulty Difficulty;
        public GameStateChanged StateChanged;
        public Position SpawnPosition;

        public byte MaxPlayers;

        public string LevelType;

        public long AgeOfTheWorld;
        public long TimeOfDay;

        private const float RealTimeDivisor = 24 * 60 * 60;
        private const float GameHourInRealMinutes = (float)2 / 60;
        private const float GameHourInRealSeconds = GameHourInRealMinutes * 60;
        public float GetGameTimeOfDay()
        {
            return ((TimeOfDay / GameHourInRealSeconds) % 24); // quick demonstration of day & night cycles.
            //return 12; // this disables the day & night cycle.
        }

        public TimeSpan AgeOfTheWorldTimeSpan => new TimeSpan(
            (int) TimeSpanUtil.ConvertSecondsToDays(AgeOfTheWorld / 20),
            (int) TimeSpanUtil.ConvertSecondsToHours(AgeOfTheWorld / 20),
            (int) TimeSpanUtil.ConvertSecondsToMinutes(AgeOfTheWorld / 20));

        public World()
        {
            Chunks = new List<Chunk>();
        }

        #region Anvil

        public int GetChunkIndex(Coordinates2D coordinates)
        {
            foreach (var chunk in Chunks)
            {
                if (chunk.Coordinates == coordinates)
                    return Chunks.IndexOf(chunk);
            }

            return -1;
        }

        public Chunk GetChunkByBlockCoordinates(Position coordinates)
        {
            if (coordinates.Y < 0 || coordinates.Y >= Chunk.Height)
                throw new ArgumentOutOfRangeException("coordinates", "Coordinates.Y is out of range");

            var chunkX = coordinates.X >> 4;
            var chunkZ = coordinates.Z >> 4;

            return GetChunk(new Coordinates2D(chunkX, chunkZ));
        }

        public static Coordinates2D ChunkCoordinatesToWorld(Coordinates2D coordinates)
        {
            var chunkX = coordinates.X * Chunk.Width;
            var chunkZ = coordinates.Z * Chunk.Depth;

            return new Coordinates2D(chunkX, chunkZ);
        }

        public Chunk GetChunk(Coordinates2D coordinates)
        {
            foreach (var chunk in Chunks)
            {
                if (chunk.Coordinates == coordinates)
                    return chunk;
            }
            return null;
        }

        public void SetChunk(Chunk chunk)
        {
            Chunks.Add(chunk);
        }

        public void RemoveChunk(Coordinates2D coordinates)
        {
            for (int i = 0; i < Chunks.Count; i++)
            {
                var chunk = Chunks[i];
                if (chunk.Coordinates == coordinates)
                    Chunks[i] = null;
            }
        }

        public Block GetBlock(Position coordinates)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            return chunk.GetBlock(coordinates);
        }

        public void SetBlock(Position coordinates, Block block)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            chunk.SetBlock(coordinates, block);
        }

        public void SetBlock(Position coordinates, Coordinates2D chunkCoordinates, Block block)
        {
            var chunk = GetChunk(chunkCoordinates);

            chunk.SetBlockMultiBlock(coordinates, block);
        }

        public byte GetBlockLight(Position coordinates)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            return chunk.GetBlockLight(coordinates);
        }

        public void SetBlockLight(Position coordinates, byte light)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            chunk.SetBlockLight(coordinates, light);
        }

        public byte GetBlockSkylight(Position coordinates)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            return chunk.GetBlockSkylight(coordinates);
        }

        public void SetBlockSkylight(Position coordinates, byte light)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            chunk.SetBlockSkylight(coordinates, light);
        }

        public byte GetBlockBiome(Position coordinates)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            return chunk.GetBlockBiome(coordinates);
        }

        public void SetBlockBiome(Position coordinates, byte biome)
        {
            var chunk = GetChunkByBlockCoordinates(coordinates);

            chunk.SetBlockBiome(coordinates, biome);
        }

        #endregion
    }

    public struct GameStateChanged
    {
        public GameStateReason Reason;
        public float Value;
    }

}


text:
package accounts

import (
	"testing"

	"github.com/rackspace/gophercloud"
	th "github.com/rackspace/gophercloud/testhelper"
)

const endpoint = "http://localhost:57909/"

func endpointClient() *gophercloud.ServiceClient {
	return &gophercloud.ServiceClient{Endpoint: endpoint}
}

func TestGetURL(t *testing.T) {
	actual := getURL(endpointClient())
	expected := endpoint
	th.CheckEquals(t, expected, actual)
}

func TestUpdateURL(t *testing.T) {
	actual := updateURL(endpointClient())
	expected := endpoint
	th.CheckEquals(t, expected, actual)
}


text:
require 'test_helper'

module AIGames
  module FourInARow
    class BotTest < Minitest::Test
      def setup
        @bot = Bot.new
      end

      def test_place_disc
        assert_includes 0...7, @bot.place_disc
      end
    end
  end
end


text:
using System;
using System.Globalization;

namespace Sharpen
{
	public class JavaCalendar
	{
		public static int HOUR_OF_DAY = 0;
		public static int MINUTE = 1;
		public static int SECOND = 2;
		public static int MILLISECOND = 3;
		public static int DATE = 4;
		public static int YEAR = 5;
		public static int MONTH = 6;
		public static int WEEK_OF_YEAR = 7;

		DateTime Time;

		public JavaCalendar ()
		{
			Time = DateTime.UtcNow;
		}

		public void Add (int type, int value)
		{
			switch (type) {
			case 0:
				Time.AddHours (value);
				break;
			case 1:
				Time.AddMinutes (value);
				break;
			case 2:
				Time.AddSeconds (value);
				break;
			case 3:
				Time.AddMilliseconds (value);
				break;
			case 5:
				Time.AddYears (value);
				break;
			case 6:
				Time.AddMonths (value);
				break;
			case 7:
				Time.AddDays (7 * value);
				break;
			default:
				throw new NotSupportedException ();
			}
		}

		public JavaCalendar Clone ()
		{
			return (JavaCalendar) MemberwiseClone ();
		}

		public DateTime GetTime ()
		{
			return Time;
		}

		public void Set (int type, int value)
		{
			switch (type) {
			case 0:
				Time.AddHours (value - Time.Hour);
				break;
			case 1:
				Time.AddMinutes (value - Time.Minute);
				break;
			case 2:
				Time.AddSeconds (value - Time.Second);
				break;
			case 3:
				Time.AddMilliseconds (value - Time.Millisecond);
				break;
			case 5:
				Time.AddYears (value - Time.Year);
				break;
			case 6:
				Time.AddMonths (value - Time.Month);
				break;
			default:
				throw new NotSupportedException ();
			}
		}

		public void SetTimeInMillis (long milliseconds)
		{
			Time = new DateTime (milliseconds * TimeSpan.TicksPerMillisecond);
		}
	}

	public class JavaGregorianCalendar : JavaCalendar
	{
		public JavaGregorianCalendar (TimeZoneInfo timezone, CultureInfo culture)
		{
		}
	}
}


text:
package org.apache.camel.component.facebook.config;

import java.net.URL;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import facebook4j.AlbumCreate;
import facebook4j.CheckinCreate;
import facebook4j.EventUpdate;
import facebook4j.GeoLocation;
import facebook4j.Media;
import facebook4j.PictureSize;
import facebook4j.PostUpdate;
import facebook4j.Reading;
import facebook4j.TagUpdate;
import facebook4j.TestUser;

import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;

@UriParams
public class FacebookEndpointConfiguration extends FacebookConfiguration {

    @UriParam
    private URL achievementURL;
    @UriParam
    private AlbumCreate albumCreate;
    @UriParam
    private String albumId;
    @UriParam
    private Boolean allowNewOptions;
    @UriParam
    private String appId;
    @UriParam
    private GeoLocation center;
    @UriParam
    private CheckinCreate checkinCreate;
    @UriParam
    private String checkinId;
    @UriParam
    private String commentId;
    @UriParam
    private String description;
    @UriParam
    private Integer distance;
    @UriParam
    private String domainId;
    @UriParam
    private String domainName;
    @UriParam
    private List<String> domainNames;
    @UriParam
    private String eventId;
    @UriParam
    private EventUpdate eventUpdate;
    @UriParam
    private String friendId;
    @UriParam
    private String friendUserId;
    @UriParam
    private String friendlistId;
    @UriParam
    private String friendlistName;
    @UriParam
    private String groupId;
    @UriParam
    private List<String> ids;
    @UriParam
    private Boolean includeRead;
    @UriParam
    private URL link;
    @UriParam
    private String linkId;
    @UriParam
    private Locale locale;
    @UriParam
    private String message;
    @UriParam
    private String messageId;
    @UriParam
    private String metric;
    @UriParam
    private String name;
    @UriParam
    private Boolean noStory;
    @UriParam
    private String noteId;
    @UriParam
    private String notificationId;
    @UriParam
    private String objectId;
    @UriParam
    private String optionDescription;
    @UriParam
    private List<String> options;
    @UriParam
    private String permissionName;
    @UriParam
    private String permissions;
    @UriParam
    private String photoId;
    @UriParam
    private String place;
    @UriParam
    private String placeId;
    @UriParam
    private String postId;
    @UriParam
    private PostUpdate postUpdate;
    @UriParam
    private Map<String, String> queries;
    @UriParam
    private String query;
    @UriParam
    private String question;
    @UriParam
    private String questionId;
    @UriParam
    private Reading reading;
    @UriParam
    private Integer scoreValue;
    @UriParam
    private PictureSize size;
    @UriParam
    private Media source;
    @UriParam
    private String subject;
    @UriParam
    private TagUpdate tagUpdate;
    @UriParam
    private TestUser testUser1;
    @UriParam
    private TestUser testUser2;
    @UriParam
    private String testUserId;
    @UriParam
    private String title;
    @UriParam
    private String toUserId;
    @UriParam
    private List<String> toUserIds;
    @UriParam
    private String userId1;
    @UriParam
    private String userId2;
    @UriParam
    private String userId;
    @UriParam
    private List<String> userIds;
    @UriParam
    private String userLocale;
    @UriParam
    private String videoId;

    public URL getAchievementURL() {
        return achievementURL;
    }

    public void setAchievementURL(URL achievementURL) {
        this.achievementURL = achievementURL;
    }

    public AlbumCreate getAlbumCreate() {
        return albumCreate;
    }

    public void setAlbumCreate(AlbumCreate albumCreate) {
        this.albumCreate = albumCreate;
    }

    public String getAlbumId() {
        return albumId;
    }

    public void setAlbumId(String albumId) {
        this.albumId = albumId;
    }

    public Boolean isAllowNewOptions() {
        return allowNewOptions;
    }

    public void setAllowNewOptions(Boolean allowNewOptions) {
        this.allowNewOptions = allowNewOptions;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public GeoLocation getCenter() {
        return center;
    }

    public void setCenter(GeoLocation center) {
        this.center = center;
    }

    public CheckinCreate getCheckinCreate() {
        return checkinCreate;
    }

    public void setCheckinCreate(CheckinCreate checkinCreate) {
        this.checkinCreate = checkinCreate;
    }

    public String getCheckinId() {
        return checkinId;
    }

    public void setCheckinId(String checkinId) {
        this.checkinId = checkinId;
    }

    public String getCommentId() {
        return commentId;
    }

    public void setCommentId(String commentId) {
        this.commentId = commentId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }

    public String getDomainId() {
        return domainId;
    }

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    public String getDomainName() {
        return domainName;
    }

    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    public List<String> getDomainNames() {
        return domainNames;
    }

    public void setDomainNames(List<String> domainNames) {
        this.domainNames = domainNames;
    }

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public EventUpdate getEventUpdate() {
        return eventUpdate;
    }

    public void setEventUpdate(EventUpdate eventUpdate) {
        this.eventUpdate = eventUpdate;
    }

    public String getFriendId() {
        return friendId;
    }

    public void setFriendId(String friendId) {
        this.friendId = friendId;
    }

    public String getFriendUserId() {
        return friendUserId;
    }

    public void setFriendUserId(String friendUserId) {
        this.friendUserId = friendUserId;
    }

    public String getFriendlistId() {
        return friendlistId;
    }

    public void setFriendlistId(String friendlistId) {
        this.friendlistId = friendlistId;
    }

    public String getFriendlistName() {
        return friendlistName;
    }

    public void setFriendlistName(String friendlistName) {
        this.friendlistName = friendlistName;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public List<String> getIds() {
        return ids;
    }

    public void setIds(List<String> ids) {
        this.ids = ids;
    }

    public Boolean isIncludeRead() {
        return includeRead;
    }

    public void setIncludeRead(Boolean includeRead) {
        this.includeRead = includeRead;
    }

    public URL getLink() {
        return link;
    }

    public void setLink(URL link) {
        this.link = link;
    }

    public String getLinkId() {
        return linkId;
    }

    public void setLinkId(String linkId) {
        this.linkId = linkId;
    }

    public Locale getLocale() {
        return locale;
    }

    public void setLocale(Locale locale) {
        this.locale = locale;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getMetric() {
        return metric;
    }

    public void setMetric(String metric) {
        this.metric = metric;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean isNoStory() {
        return noStory;
    }

    public void setNoStory(Boolean noStory) {
        this.noStory = noStory;
    }

    public String getNoteId() {
        return noteId;
    }

    public void setNoteId(String noteId) {
        this.noteId = noteId;
    }

    public String getNotificationId() {
        return notificationId;
    }

    public void setNotificationId(String notificationId) {
        this.notificationId = notificationId;
    }

    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    public String getOptionDescription() {
        return optionDescription;
    }

    public void setOptionDescription(String optionDescription) {
        this.optionDescription = optionDescription;
    }

    public List<String> getOptions() {
        return options;
    }

    public void setOptions(List<String> options) {
        this.options = options;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public void setPermissionName(String permissionName) {
        this.permissionName = permissionName;
    }

    public String getPermissions() {
        return permissions;
    }

    public void setPermissions(String permissions) {
        this.permissions = permissions;
    }

    public String getPhotoId() {
        return photoId;
    }

    public void setPhotoId(String photoId) {
        this.photoId = photoId;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getPlaceId() {
        return placeId;
    }

    public void setPlaceId(String placeId) {
        this.placeId = placeId;
    }

    public String getPostId() {
        return postId;
    }

    public void setPostId(String postId) {
        this.postId = postId;
    }

    public PostUpdate getPostUpdate() {
        return postUpdate;
    }

    public void setPostUpdate(PostUpdate postUpdate) {
        this.postUpdate = postUpdate;
    }

    public Map<String, String> getQueries() {
        return queries;
    }

    public void setQueries(Map<String, String> queries) {
        this.queries = queries;
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public Reading getReading() {
        return reading;
    }

    public void setReading(Reading reading) {
        this.reading = reading;
    }

    public Integer getScoreValue() {
        return scoreValue;
    }

    public void setScoreValue(Integer scoreValue) {
        this.scoreValue = scoreValue;
    }

    public PictureSize getSize() {
        return size;
    }

    public void setSize(PictureSize size) {
        this.size = size;
    }

    public Media getSource() {
        return source;
    }

    public void setSource(Media source) {
        this.source = source;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public TagUpdate getTagUpdate() {
        return tagUpdate;
    }

    public void setTagUpdate(TagUpdate tagUpdate) {
        this.tagUpdate = tagUpdate;
    }

    public TestUser getTestUser1() {
        return testUser1;
    }

    public void setTestUser1(TestUser testUser1) {
        this.testUser1 = testUser1;
    }

    public TestUser getTestUser2() {
        return testUser2;
    }

    public void setTestUser2(TestUser testUser2) {
        this.testUser2 = testUser2;
    }

    public String getTestUserId() {
        return testUserId;
    }

    public void setTestUserId(String testUserId) {
        this.testUserId = testUserId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getToUserId() {
        return toUserId;
    }

    public void setToUserId(String toUserId) {
        this.toUserId = toUserId;
    }

    public List<String> getToUserIds() {
        return toUserIds;
    }

    public void setToUserIds(List<String> toUserIds) {
        this.toUserIds = toUserIds;
    }

    public String getUserId1() {
        return userId1;
    }

    public void setUserId1(String userId1) {
        this.userId1 = userId1;
    }

    public String getUserId2() {
        return userId2;
    }

    public void setUserId2(String userId2) {
        this.userId2 = userId2;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public List<String> getUserIds() {
        return userIds;
    }

    public void setUserIds(List<String> userIds) {
        this.userIds = userIds;
    }

    public String getUserLocale() {
        return userLocale;
    }

    public void setUserLocale(String userLocale) {
        this.userLocale = userLocale;
    }

    public String getVideoId() {
        return videoId;
    }

    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }

}


text:
namespace {

const unsigned int kMaxRecentlyClosedSessionResults = 25;
const char kRecentlyClosedListEmpty[] =
    "There are no recently closed sessions.";
const char kInvalidSessionId[] = "Invalid session id.";
const char kNoBrowserToRestoreSession[] =
    "There are no browser windows to restore the session.";

}  // namespace

namespace extensions {

namespace GetRecentlyClosed = api::session_restore::GetRecentlyClosed;
namespace Restore = api::session_restore::Restore;
namespace tabs = api::tabs;
namespace windows = api::windows;
namespace session_restore = api::session_restore;

scoped_ptr<tabs::Tab> SessionRestoreGetRecentlyClosedFunction::CreateTabModel(
    const TabRestoreService::Tab& tab, int selected_index) {
  scoped_ptr<tabs::Tab> tab_struct(new tabs::Tab);
  const sessions::SerializedNavigationEntry& current_navigation =
      tab.navigations[tab.current_navigation_index];
  GURL gurl = current_navigation.virtual_url();
  std::string title = UTF16ToUTF8(current_navigation.title());

  tab_struct->url.reset(new std::string(gurl.spec()));
  tab_struct->title.reset(new std::string(title.empty() ? gurl.spec() : title));
  tab_struct->index = tab.tabstrip_index;
  tab_struct->pinned = tab.pinned;
  tab_struct->id = tab.id;
  tab_struct->window_id = tab.browser_id;
  tab_struct->index = tab.tabstrip_index;
  tab_struct->pinned = tab.pinned;
  tab_struct->selected = tab.tabstrip_index == selected_index;
  tab_struct->active = false;
  tab_struct->highlighted = false;
  tab_struct->incognito = false;
  ExtensionTabUtil::ScrubTabForExtension(GetExtension(),
                                         tab_struct.get());
  return tab_struct.Pass();
}

scoped_ptr<windows::Window>
    SessionRestoreGetRecentlyClosedFunction::CreateWindowModel(
        const TabRestoreService::Window& window) {
  scoped_ptr<windows::Window> window_struct(new windows::Window);
  DCHECK(!window.tabs.empty());

  scoped_ptr<std::vector<linked_ptr<tabs::Tab> > > tabs(
      new std::vector<linked_ptr<tabs::Tab> >);
  for (size_t i = 0; i < window.tabs.size(); ++i) {
    tabs->push_back(make_linked_ptr(CreateTabModel(window.tabs[i],
        window.selected_tab_index).release()));
  }
  window_struct->tabs.reset(tabs.release());
  window_struct->incognito = false;
  window_struct->always_on_top = false;
  window_struct->focused = false;
  window_struct->type = windows::Window::TYPE_NORMAL;
  window_struct->state = windows::Window::STATE_NORMAL;
  return window_struct.Pass();
}

scoped_ptr<session_restore::ClosedEntry>
    SessionRestoreGetRecentlyClosedFunction::CreateEntryModel(
        const TabRestoreService::Entry* entry) {
  scoped_ptr<session_restore::ClosedEntry> entry_struct(
      new session_restore::ClosedEntry);
  switch (entry->type) {
    case TabRestoreService::TAB:
      entry_struct->tab.reset(CreateTabModel(
          *static_cast<const TabRestoreService::Tab*>(entry), -1).release());
      break;
    case TabRestoreService::WINDOW:
      entry_struct->window.reset(CreateWindowModel(
          *static_cast<const TabRestoreService::Window*>(entry)).release());
      break;
    default:
      NOTREACHED();
  }
  entry_struct->timestamp = entry->timestamp.ToTimeT();
  entry_struct->id = entry->id;
  return entry_struct.Pass();
}

bool SessionRestoreGetRecentlyClosedFunction::RunImpl() {
  scoped_ptr<GetRecentlyClosed::Params> params(
      GetRecentlyClosed::Params::Create(*args_));
  EXTENSION_FUNCTION_VALIDATE(params.get());
  unsigned int max_results = kMaxRecentlyClosedSessionResults;
  if (params->options && params->options->max_results)
    max_results = *params->options->max_results;
  EXTENSION_FUNCTION_VALIDATE(max_results >= 0 &&
                              max_results <= kMaxRecentlyClosedSessionResults);

  std::vector<linked_ptr<session_restore::ClosedEntry> > result;
  TabRestoreService* tab_restore_service =
      TabRestoreServiceFactory::GetForProfile(profile());
  DCHECK(tab_restore_service);

  // List of entries. They are ordered from most to least recent.
  // We prune the list to contain max 25 entries at any time and removes
  // uninteresting entries.
  TabRestoreService::Entries entries = tab_restore_service->entries();
  for (TabRestoreService::Entries::const_iterator it = entries.begin();
       it != entries.end() && result.size() < max_results; ++it) {
    TabRestoreService::Entry* entry = *it;
    if (!params->options || params->options->entry_type ==
        GetRecentlyClosed::Params::Options::ENTRY_TYPE_NONE) {
      // Include both tabs and windows if type is not defined.
      result.push_back(make_linked_ptr(CreateEntryModel(entry).release()));
    } else if (
        (params->options->entry_type ==
            GetRecentlyClosed::Params::Options::ENTRY_TYPE_TAB &&
                entry->type == TabRestoreService::TAB) ||
        (params->options->entry_type ==
            GetRecentlyClosed::Params::Options::ENTRY_TYPE_WINDOW &&
                entry->type == TabRestoreService::WINDOW)) {
      result.push_back(make_linked_ptr(CreateEntryModel(entry).release()));
    }
  }

  results_ = GetRecentlyClosed::Results::Create(result);
  return true;
}

bool SessionRestoreRestoreFunction::RunImpl() {
  scoped_ptr<Restore::Params> params(Restore::Params::Create(*args_));
  EXTENSION_FUNCTION_VALIDATE(params.get());

  Browser* browser =
      chrome::FindBrowserWithProfile(profile(),
                                     chrome::HOST_DESKTOP_TYPE_NATIVE);
  if (!browser) {
    error_ = kNoBrowserToRestoreSession;
    return false;
  }

  TabRestoreService* tab_restore_service =
      TabRestoreServiceFactory::GetForProfile(profile());
  TabRestoreServiceDelegate* delegate =
      TabRestoreServiceDelegate::FindDelegateForWebContents(
          browser->tab_strip_model()->GetActiveWebContents());
  DCHECK(delegate);
  chrome::HostDesktopType host_desktop_type = browser->host_desktop_type();
  TabRestoreService::Entries entries = tab_restore_service->entries();

  if (entries.empty()) {
    error_ = kRecentlyClosedListEmpty;
    return false;
  }

  if (!params->id) {
    tab_restore_service->RestoreMostRecentEntry(delegate, host_desktop_type);
    return true;
  }

  // Check if the recently closed list contains an entry with the provided id.
  bool is_valid_id = false;
  for (TabRestoreService::Entries::iterator it = entries.begin();
       it != entries.end(); ++it) {
    if ((*it)->id == *params->id) {
      is_valid_id = true;
      break;
    }

    // For Window entries, see if the ID matches a tab. If so, report true for
    // the window as the Entry.
    if ((*it)->type == TabRestoreService::WINDOW) {
      std::vector<TabRestoreService::Tab>& tabs =
          static_cast<TabRestoreService::Window*>(*it)->tabs;
      for (std::vector<TabRestoreService::Tab>::iterator tab_it = tabs.begin();
           tab_it != tabs.end(); ++tab_it) {
        if ((*tab_it).id == *params->id) {
          is_valid_id = true;
          break;
        }
      }
    }
  }

  if (!is_valid_id) {
    error_ = kInvalidSessionId;
    return false;
  }

  tab_restore_service->RestoreEntryById(delegate, *params->id,
      host_desktop_type, UNKNOWN);
  return true;
}

SessionRestoreAPI::SessionRestoreAPI(Profile* profile) {
}

SessionRestoreAPI::~SessionRestoreAPI() {
}

static base::LazyInstance<ProfileKeyedAPIFactory<SessionRestoreAPI> >
    g_factory = LAZY_INSTANCE_INITIALIZER;

// static
ProfileKeyedAPIFactory<SessionRestoreAPI>*
    SessionRestoreAPI::GetFactoryInstance() {
  return &g_factory.Get();
}

}  // namespace extensions


text:
git-contrib(1) -- Show user's contributions
===========================================

## SYNOPSIS

`git-contrib` [<username>|<email>]

## DESCRIPTION

  Output a user's contributions to a project, based on the author name or email.
  Returns multiple entries if there are more than one match.

## OPTIONS

  <username>

  The name or email of the user who owns the contributions.

## EXAMPLES

    Searching with a username

    $ git contrib visionmedia
    visionmedia (18):
      Export STATUS_CODES
      Moved help msg to node-repl
      Added multiple arg support for sys.puts(), print(), etc.
      Fix stack output on socket error
      ...

    Searching with a partial email

    $ git contrib tj@
    visionmedia (18):
      Export STATUS_CODES
      Moved help msg to node-repl
      Added multiple arg support for sys.puts(), print(), etc.
      Fix stack output on socket error
      ...

## AUTHOR

Written by Tj Holowaychuk <<tj@vision-media.ca>>

## REPORTING BUGS

<<https://github.com/tj/git-extras/issues>>

## SEE ALSO

<<https://github.com/tj/git-extras>>


text:
namespace Pomdog {

class SpriteRenderer;

namespace Detail {
namespace Rendering {

class ParticleBatchCommand final: public RenderCommand {
public:
    float DrawOrder() const override
    {
        return drawOrder;
    }

    std::type_index TypeIndex() const override;

public:
    TextureRegion textureRegion;
    Matrix3x2 transform;
    std::shared_ptr<Texture2D> texture;
    std::vector<Particle> const* particles = nullptr;
    float drawOrder;
};

}// namespace Rendering
}// namespace Detail
}// namespace Pomdog

#endif // POMDOG_PARTICLEBATCHCOMMAND_BBF33260_HPP


text:
1.	A vote is a public influencer, voter can be anonymous.
2.	Votes give a candidate a value. The value fades over time.
3.	A voter is unable to vote again until original vote fades to zero plus a time of dormancy.
4.	Once a candidate crosses a value threshold, it wins.
  1.	It is possible that the value #2 determines influence sustaining duration, but that is not the same as the valuation of #4. (E.g. The value of #4 is simply the number of voters, not the voters*#2 valuation).
5.	If #4 is just # of voters, look to book honeybee democracy to determine % of voting body required to be a winner.

## Frameworks and Tools:
- Mongo db
- Mongoose
- Node
- Express
- Jasmine
- Mocha
- Frisby
- ESLint
- Grunt
- Passport

## What works/half-works at the moment
- Mongo: currently this expects mongo to be on the default port ('mongodb://localhost:27017/honeybeevote')
- Mongoose: I have a fair understanding of this, at this point.
- Express: on startup it should print out the port for express "The Magic happens on port: [0-9]*" (default: 8000)
- Testing: run "grunt default" in one cmd window, then elsewhere run "grunt test". will run unit and api tests.
   - Unit tests:
      - "grunt mochaTest"
   - Api tests:
      - "grunt shell"
      - "grunt jasmine_node"
- ESLint: to run lint, use this: grunt lint
- Grunt: I don't know half of what's in here, really, just following recipes.
	- I know: eslint, nodemon, concurrent
	- I don't know: pkg, babel
- Passport: just barely "heartbeats" as in does basic validation. The validation isn't actually applied anywhere or required.
- The whole thing could have better logging and .config
- Functionality: you should be able to do basic CRUD on Election, Voter, Candidate, and Candidate-[Votes]

- node-inspector debugging seems to be broken, a fix they're screaming about on node-inspector forums.
- I think .app.js works fine, but the original Express bootstrapping program has things running through ./biz/www, which also works fine. Obviously need to get rid of ./bin/www if it's not adding anything.

- Docker: You can containerize this app using 'docker build .' Once built, you can run the container with something like 'docker run -e MONGO_URL=mongodb://192.168.0.128:27017/honeybeevote -d -p 8000:8000 honeybeevotesvc' where MONGO_URL points to your mongo server.

## Features for voters
### V1
1.	Know what we are voting for.
2.	See all candidates and popularity.
3.	Ability to vote on candidates.
4.	Know when there's a winner.

### V2
1.	See time remaining until next vote allowed.
2.	See time remaining until vote goes to zero influence.
3.	See history of vote.
4.	Know information about voters.
5.	Add information to candidate.
6.	Add candidate.
7.	Be given > 1 vote to use at the same time.
8.	See graphics.
9.	Set win criteria, vote sustain duration, vote valuation calculation.


text:
import nltk
import glob
import pickle
import numpy as np

# obvious
alpha = 0.5
nExamples = 0

# load pickle
wordsInOrder = pickle.load( open( "wordsInOrder.p", "rb" ) )
wordProb = pickle.load( open( "wordProbability.p", "rb" ) )

nFeatures = np.shape(wordProb)[0]-1

f_handle = file('TrainingData.txt','w',)
files = glob.glob('reuters/training/*')
files = files[0:10]
for filename in files:
    openfile = open(filename,'r')
    readfile = openfile.read()
    tokens = nltk.word_tokenize(readfile)

    # set up initial state of the whatever
    recentWordProb = np.copy(wordProb)
    nextWord = np.zeros(np.shape(recentWordProb))

    # loop through tokens
    for token in tokens:
        token = token.lower()
        if (token in wordsInOrder):
            tokenIndex = wordsInOrder[token]
        else:
            tokenIndex = nFeatures

        nextWord[tokenIndex] = 1

        np.savetxt(f_handle,np.transpose(recentWordProb),fmt='%.6f',delimiter=' ')
        np.savetxt(f_handle,np.transpose(nextWord),fmt='%.1f',delimiter=' ')

        recentWordProb = (1-alpha)*recentWordProb + alpha*nextWord

        nextWord[tokenIndex] = 0

    nExamples += len(tokens)
    openfile.close()

f_handle.close()

firstLine = "%d %d %d \n" % (nExamples,nFeatures+1,nFeatures+1)

with file('TrainingData.txt', 'r') as original: data = original.read()
with file('TrainingData.txt', 'w') as modified: modified.write(firstLine + data)