text:
function [dat] = read_plexon_ddt(filename, begsample, endsample)

% READ_PLEXON_DDT reads header or data from a Plexon *.ddt file,
% which is a Plexon continuous data file optimized for continuous
% (streaming) recording where every channel is continuously recorded
% without gaps and the recording includes any dead time between spikes.
%
% Use as
%   [hdr] = read_plexon_ddt(filename)
%   [dat] = read_plexon_ddt(filename, begsample, endsample)
%
% samples start counting at 1
% returned values are in mV

% Copyright (C) 2005-2007, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id: read_plexon_ddt.m 945 2010-04-21 17:41:20Z roboos $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Version 100: Samples are assumed to be 12 bits.  All channels have the same NIDAQ gain, and preamp
% gain is not saved.
%     int     Version;         // =100
%     int     DataOffset;      // Offset into the file where the data starts
%     double  Freq;            // Digitization frequency
%     int     NChannels;       // Number of channels
%     int     Year;            // Time/date when the data was acquired
%     int     Month;
%     int     Day;
%     int     Hour;
%     int     Minute;
%     int     Second;
%     int     Gain;            // NIDAQ gain (the same gain for all channels
%     char    Comment[128];    // User-supplied comment
%     unsigned char Padding[256];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

dat = [];
fid = fopen(filename, 'rb', 'ieee-le');

Version    = fread(fid, 1, 'int'    );
dat.Version    = Version;

% this is common for all subformats
dat.DataOffset = fread(fid, 1, 'int'    );
dat.Freq       = fread(fid, 1, 'double' );
dat.NChannels  = fread(fid, 1, 'int'    );
dat.Year       = fread(fid, 1, 'int'    );
dat.Month      = fread(fid, 1, 'int'    );
dat.Day        = fread(fid, 1, 'int'    );
dat.Hour       = fread(fid, 1, 'int'    );
dat.Minute     = fread(fid, 1, 'int'    );
dat.Second     = fread(fid, 1, 'int'    );
dat.Gain       = fread(fid, 1, 'int'    );
dat.Comment        = char(fread(fid, 128, 'char')');

if Version==100
  % the remainder of the header contains bytes for padding
  dat.Padding    = fread(fid, 256, 'char' );
elseif Version==101
  % Version 101: A field was added to indicate bits-per-sample (12 or 16).  All channels have the same NIDAQ
  % gain, and preamp gain is not saved.
  dat.BitsPerSample = fread(fid,   1, 'char');
  dat.Padding       = fread(fid, 255, 'char');
elseif Version==102
  % Version 102: A byte array of per-channel NIDAQ gains was added.  The Gain field now indicates the
  % preamp gain,   a value of 1 usually indicating that no preamp gain was specified in the application that
  % recorded the DDT.
  dat.BitsPerSample = fread(fid,   1, 'char');
  dat.ChannelGain   = fread(fid,  64, 'char');
  dat.Padding       = fread(fid, 191, 'char');
elseif Version==103
  % Version 103: A field was added to specify ADC maximal input voltage. The value is integer number in
  % millivolts.
  dat.BitsPerSample  = fread(fid,   1, 'char');
  dat.ChannelGain    = fread(fid,  64, 'char');
  dat.MaxMagnitudeMV = fread(fid,   1, 'short');
  dat.Padding        = fread(fid, 189, 'char');
else
  error('unsupported version of ddt file');
end

% determine the number of samples by looking at the length of the datafile
offset = ftell(fid);
fseek(fid, 0, 'eof');
dat.NSamples = (ftell(fid) - offset) / (2 * dat.NChannels);

if nargin==1
  % do not read any data, only return the header
  fclose(fid);
  return
end

% A DDT file contains a file header followed by an array of A/D samples stored as 16-bit integers regardless
% of whether values are 12 or 16-bits. The samples are multiplexed.

% read the desired samples of the data
offset = dat.DataOffset + (begsample-1)*dat.NChannels;
nsampl = endsample - begsample + 1;
fseek(fid, offset, 'bof');
dat.data = fread(fid, [dat.NChannels nsampl], 'int16');

fclose(fid);

% apply the calibration to obtain the signal in physical units
if Version==100
  PreAmpGain = 1000;
  dat.data = dat.data * 5000 / (2048 * dat.Gain * PreAmpGain);
elseif Version==101
  PreAmpGain = 1000;
  dat.data = dat.data * 5000 / (0.5 * (2^dat.BitsPerSample) * dat.Gain * PreAmpGain);
elseif Version==102
  for i=1:dat.NChannels
    dat.data(i,:) = dat.data(i,:) * 5000 ./ (0.5 * (2^dat.BitsPerSample) * dat.ChannelGain(i));
  end
elseif Version==103
  % I am not sure whether the calibration like this is correct, since the
  % Plexon documentation does not explicitely specify how to do it for the
  % 104 file format. I presume that it is identical to the 103 format.
  for i=1:dat.NChannels
    dat.data(i,:) = dat.data(i,:) * 5000 ./ (0.5 * (2^dat.BitsPerSample) * dat.ChannelGain(i));
  end
end


text:
using Abp.Data.Migrations.FluentMigrator;
using FluentMigrator;

namespace Abp.Modules.Core.Data.Migrations.V20140323
{
    [Migration(2014032307)]
    public class _20140323_07_CreateAbpSettingsTable : AutoReversingMigration
    {
        public override void Up()
        {
            Create.Table("AbpSettings")
                .WithColumn("Id").AsInt64().NotNullable().PrimaryKey().Identity()
                .WithNullableTenantId()
                .WithNullableUserId()
                .WithColumn("Name").AsAnsiString(128).NotNullable()
                .WithColumn("Value").AsString().NotNullable()
                .WithAuditColumns();
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

/**
 * Module dependencies.
 */
var path = require('path'),
  mongoose = require('mongoose'),
  Quiz = mongoose.model('Quiz'),
  errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller'));

/**
 * Create a quiz
 */
exports.create = function (req, res) {
  var quiz = new Quiz(req.body);
  quiz.user = req.user;

  quiz.save(function (err) {
    if (err) {
      return res.status(400).send({
        message: errorHandler.getErrorMessage(err)
      });
    } else {
      res.json(quiz);
    }
  });
};

/**
 * Show the current quiz
 */
exports.read = function (req, res) {
  res.json(req.quiz);
};

/**
 * Update a quiz
 */
exports.update = function (req, res) {
  var quiz = req.quiz;

  quiz.title = req.body.title;
  quiz.question = req.body.question;
  quiz.choices = req.body.choices;
  quiz.correctAnswer = req.body.correctAnswer;
  quiz.quizOpen = req.body.quizOpen;
  quiz.quizEnded = req.body.quizEnded;
  quiz.scores = req.body.scores;

  quiz.save(function (err) {
    if (err) {
      return res.status(400).send({
        message: errorHandler.getErrorMessage(err)
      });
    } else {
      res.json(quiz);
    }
  });
};

//update quiz score + participant
exports.submit = function(req, res){

  //The (old) one in the db
  var quiz = req.quiz;
  var user = req.user;

  //get the newly submitted one
  var scores = req.body.scores;
  //The last one in array is the latest pushed one
  var submitted = scores.pop();

  //Used to check if student's answer already exists in db
  var answerExists = false;

  for(var i = 0; i < quiz.scores.length; i++){
    if(quiz.scores[i].studentID.toString() === user._id.toString()){
      answerExists = true;
    }
  }

  //TODO: return error to user

  //Be sure to pass in an answer from client controller when student submit answer
  if(!answerExists){

    quiz.totalParticipant++;

    if(submitted.selectedAnswer === quiz.correctAnswer){
      quiz.scores.push({ studentID : submitted.studentID, student : user, selectedAnswer : submitted.selectedAnswer, quizScore : 1});
    }else{
      quiz.scores.push({ studentID : submitted.studentID, student : user, selectedAnswer : submitted.selectedAnswer, quizScore : 0});
    }

    //TODO: check if student score already exists in the database in the front as well

    quiz.save(function (err) {
      if (err) {
        return res.status(400).send({
          message: errorHandler.getErrorMessage(err)
        });
      } else {
        res.json(quiz);
      }
    });

  }else{
    res.json(quiz);
  }
};

/**
 * Delete an quiz
 */
exports.delete = function (req, res) {
  var quiz = req.quiz;

  quiz.remove(function (err) {
    if (err) {
      return res.status(400).send({
        message: errorHandler.getErrorMessage(err)
      });
    } else {
      res.json(quiz);
    }
  });
};

/**
 * List of Quizzes
 */
exports.list = function (req, res) {

  //console.log('is ther filter ' + req.query.filter);
  //console.log(Quiz.find({courseID: req.query.courseID}).length);

  /*
  if(req.query.filter === true){
    Quiz.find({'_id': req.query.courseID}).sort('-created').populate('user', 'displayName').exec(function (err, quizzes) {
      if (err) {
        return res.status(400).send({
          message: errorHandler.getErrorMessage(err)
        });
      } else {
        res.json(quizzes);
      }
    });

  }else{*/
    Quiz.find().sort('-created').populate('user', 'displayName').populate('scores.student', 'displayName').exec(function (err, quizzes) {
      if (err) {
        return res.status(400).send({
          message: errorHandler.getErrorMessage(err)
        });
      } else {
        res.json(quizzes);
      }
    });
  //}

};

/**
 * Quiz middleware
 */
exports.quizByID = function (req, res, next, id) {

  if (!mongoose.Types.ObjectId.isValid(id)) {
    return res.status(400).send({
      message: 'Quiz is invalid'
    });
  }

  Quiz.findById(id).populate('user', 'displayName').populate('scores.student', 'displayName firstName lastName').exec(function (err, quiz) {
    if (err) {
      return next(err);
    } else if (!quiz) {
      return res.status(404).send({
        message: 'No quiz with that identifier has been found'
      });
    }
    req.quiz = quiz;
    next();
  });
};


text:
/*
 * ui/ui.h -- User interface code (header).
 *
 * Declares the UI window structure, and redefines the ui_* functions to use
 * those found on the host platform.
 *
 */

#ifndef QPRA_UI_H
#define QPRA_UI_H

#include <stdint.h>
#include <pthread.h>
#include <SDL2/SDL.h>
#include <GL/glx.h>
#ifdef _WIN32
#else
#include <gtk/gtk.h>
#endif

struct ui_window
{
    int width, height;
    const char *name;
    unsigned long id;

#ifdef _WIN32
#else
    GtkWidget *window;
    GtkWidget *area;
    GLXContext context;
#endif
};

#ifdef _WIN32

#define ui_init ui_init_windows
#define ui_window_new ui_window_new_windows
#define ui_run ui_run_windows

#else

#define ui_init ui_init_gtk
#define ui_window_new ui_window_new_gtk
#define ui_run ui_run_gtk

#endif

extern pthread_mutex_t fb_lock;
extern uint8_t framebuffer[256 * 224 * 4];

void ui_init(int, char **);
struct ui_window * ui_window_new(void);
void ui_run(struct ui_window*);

void ui_lock_fb(void);
void ui_unlock_fb(void);
void *ui_get_fb(void);

extern struct ui_window *window;

#endif


text:
package com.google.errorprone;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.collect.ImmutableSet.toImmutableSet;

import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Streams;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.errorprone.annotations.CheckReturnValue;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * Represents an immutable map of Error Prone flags to their set values.
 *
 *
All get* methods return an {@code Optional<*>} containing the value for the given key, or
 * empty if the flag is unset.
 *
 *
To access ErrorProneFlags from a BugChecker class, add a constructor to the class that takes
 * one parameter of type ErrorProneFlags.
 *
 *
See documentation for full syntax description.
 */
public final class ErrorProneFlags implements Serializable {
  public static final String PREFIX = "-XepOpt:";

  private final ImmutableMap<String, String> flagsMap;

  public static ErrorProneFlags empty() {
    return new ErrorProneFlags(ImmutableMap.of());
  }

  public static ErrorProneFlags fromMap(Map<String, String> flagsMap) {
    return new ErrorProneFlags(ImmutableMap.copyOf(flagsMap));
  }

  private ErrorProneFlags(ImmutableMap<String, String> flagsMap) {
    this.flagsMap = flagsMap;
  }

  public ImmutableMap<String, String> getFlagsMap() {
    return ImmutableMap.copyOf(flagsMap);
  }

  /**
   * Gets flag value for the given key as a String, wrapped in an {@link Optional}, which is empty
   * if the flag is unset.
   */
  public Optional<String> get(String key) {
    return Optional.ofNullable(flagsMap.get(key));
  }

  /**
   * Gets the flag value for the given key as a Boolean, wrapped in an {@link Optional}, which is
   * empty if the flag is unset.
   *
   *
The value within the {@link Optional} will be {@code true} if the flag's value is "true",
   * {@code false} for "false", both case insensitive. If the value is neither "true" nor "false",
   * throws an {@link IllegalArgumentException}.
   *
   *
Note that any flag set without a value, e.g. {@code -XepOpt:FlagValue}, will be "true".
   */
  public Optional<Boolean> getBoolean(String key) {
    return this.get(key).map(ErrorProneFlags::parseBoolean);
  }

  /**
   * Gets the flag value for an enum of the given type, wrapped in an {@link Optional}, which is
   * empty if the flag is unset.
   */
  public <T extends Enum<T>> Optional<T> getEnum(String key, Class<T> clazz) {
    return this.get(key).map(value -> asEnumValue(key, value, clazz));
  }

  /**
   * Gets the flag value for a comma-separated set of enums of the given type, wrapped in an {@link
   * Optional}, which is empty if the flag is unset. If the flag is explicitly set to empty, an
   * empty set will be returned.
   */
  public <T extends Enum<T>> Optional<ImmutableSet<T>> getEnumSet(String key, Class<T> clazz) {
    return this.get(key)
        .map(
            value ->
                Streams.stream(Splitter.on(',').omitEmptyStrings().split(value))
                    .map(v -> asEnumValue(key, v, clazz))
                    .collect(toImmutableSet()));
  }

  private static <T extends Enum<T>> T asEnumValue(String key, String value, Class<T> clazz) {
    try {
      return Enum.valueOf(clazz, value);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException(
          String.format(
              "Error Prone flag %s=%s could not be parsed as an enum constant of %s",
              key, value, clazz),
          e);
    }
  }

  private static boolean parseBoolean(String value) {
    if ("true".equalsIgnoreCase(value)) {
      return true;
    }
    if ("false".equalsIgnoreCase(value)) {
      return false;
    }
    throw new IllegalArgumentException(
        String.format("Error Prone flag value %s could not be parsed as a boolean.", value));
  }

  /**
   * Gets the flag value for the given key as an Integer, wrapped in an {@link Optional}, which is
   * empty if the flag is unset.
   *
   *
If the flag's value cannot be interpreted as an Integer, throws a {@link
   * NumberFormatException} (note: float values will *not* be interpreted as integers and will throw
   * an exception!)
   */
  public Optional<Integer> getInteger(String key) {
    return this.get(key).map(Integer::valueOf);
  }

  /**
   * Gets the flag value for the given key as a comma-separated {@link List} of Strings, wrapped in
   * an {@link Optional}, which is empty if the flag is unset.
   *
   *
(note: empty strings included, e.g. {@code "-XepOpt:List=,1,,2," => ["","1","","2",""]})
   */
  public Optional<List<String>> getList(String key) {
    return this.get(key).map(v -> ImmutableList.copyOf(Splitter.on(',').split(v)));
  }

  /**
   * Gets the flag value for the given key as a comma-separated {@link Set} of Strings, wrapped in
   * an {@link Optional}, which is empty if the flag is unset.
   *
   *
(note: empty strings included, e.g. {@code "-XepOpt:Set=,1,,1,2," => ["","1","2"]})
   */
  public Optional<Set<String>> getSet(String key) {
    return this.get(key).map(v -> ImmutableSet.copyOf(Splitter.on(',').split(v)));
  }

  /** Whether this Flags object is empty, i.e. no flags have been set. */
  public boolean isEmpty() {
    return this.flagsMap.isEmpty();
  }

  /**
   * Returns a new ErrorProneFlags object with the values of two ErrorProneFlags objects added
   * together. For flags that appear in both instances, the values in {@code other} override {@code
   * this}.
   */
  @CheckReturnValue
  public ErrorProneFlags plus(ErrorProneFlags other) {
    Map<String, String> combinedMaps = new HashMap<>(this.getFlagsMap());
    combinedMaps.putAll(other.getFlagsMap());
    return ErrorProneFlags.fromMap(combinedMaps);
  }

  /** Builder for Error Prone command-line flags object. Parses flags from strings. */
  public static class Builder {

    private final HashMap<String, String> flagsMap = new HashMap<>();

    private Builder() {}

    /**
     * Given a String custom flag in the format {@code "-XepOpt:FlagName=Value"}, places the flag in
     * this builder's dictionary, e.g. {@code flagsMap["FlagName"] = "Value"}
     */
    @CanIgnoreReturnValue
    public Builder parseFlag(String flag) {
      checkArgument(flag.startsWith(PREFIX));

      // Strip prefix
      String remaining = flag.substring(PREFIX.length());

      // Get key and value by splitting on first equals sign.
      String[] parts = remaining.split("=", 2);
      String key = parts[0];
      String value = parts.length < 2 ? "true" : parts[1];

      this.putFlag(key, value);
      return this;
    }

    /** Puts a key-value pair directly in this builder's dictionary. Mostly exists for testing. */
    @CanIgnoreReturnValue
    public Builder putFlag(String key, String value) {
      flagsMap.put(key, value);
      return this;
    }

    public ErrorProneFlags build() {
      return fromMap(flagsMap);
    }
  }

  public static Builder builder() {
    return new Builder();
  }
}


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

<TITLE>
XSLTStylesheet
</TITLE>

<META NAME="date" CONTENT="2012-04-16">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

gov.nih.nci.cbiit.cmts.transform.artifact

Class XSLTStylesheet

java.lang.Object
  org.jdom.Document
      gov.nih.nci.cbiit.cmts.transform.artifact.XSLTStylesheet

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.jdom.Parent

public class XSLTStylesheet
extends org.jdom.Document

See Also:
Serialized Form

Field Summary

protected static org.jdom.Namespace
xsltNamespace

Fields inherited from class org.jdom.Document

baseURI

Constructor Summary

XSLTStylesheet()

XSLTStylesheet(java.lang.String namespace)

Method Summary

 void
addTempate(org.jdom.Element template)

          <xsl:template> is top level element, add it to the root element

 void
writeOut(java.io.Writer out)

Methods inherited from class org.jdom.Document

addContent, addContent, addContent, addContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, getDocument, getParent, getProperty, getRootElement, hashCode, hasRootElement, indexOf, removeContent, removeContent, removeContent, removeContent, setBaseURI, setContent, setContent, setContent, setContent, setDocType, setProperty, setRootElement, toString

Methods inherited from class java.lang.Object

finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail

xsltNamespace

protected static org.jdom.Namespace xsltNamespace

Constructor Detail

XSLTStylesheet

public XSLTStylesheet(java.lang.String namespace)

XSLTStylesheet

public XSLTStylesheet()

Method Detail

addTempate

public void addTempate(org.jdom.Element template)

<xsl:template> is top level element, add it to the root element

Parameters:
template -

writeOut

public void writeOut(java.io.Writer out)
              throws java.io.IOException

Throws:

java.io.IOException

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?php namespace TeamWorkPm\Response;

use \TeamWorkPm\Helper\Str;
use \ArrayObject;

class JSON extends Model
{

    public function parse($data, array $headers)
    {
        $source = json_decode($data);
        $errors = $this->getJsonErrors();
        $this->string = $data;
        if (!$errors) {
            if (!(
                $headers['Status'] === 201 ||
                $headers['Status'] === 200 ||
                $headers['Status'] === 409 ||
                $headers['Status'] === 422
            )) {
                print_r($headers);
                exit;
            }
            if ($headers['Status'] === 201 || $headers['Status'] === 200) {
                switch ($headers['Method']) {
                    case 'UPLOAD':
                        return empty($source->pendingFile->ref) ? null :
                                            (string) $source->pendingFile->ref;
                    case 'POST':
                        // print_r($headers);
                        if (!empty($headers['id'])) {
                            return (int) $headers['id'];
                        } elseif (!empty($source->fileId)) {
                            return (int) $source->fileId;
                        }
                        // no break
                    case 'PUT':
                    case 'DELETE':
                         return true;

                    default:
                        if (!empty($source->STATUS)) {
                            unset($source->STATUS);
                        }
                        if (!empty($source->project->files)) {
                            $source = $source->project->files;
                        } elseif (!empty($source->project->notebooks)) {
                            $source = $source->project->notebooks;
                        } elseif (!empty($source->project->links)) {
                            $source = $source->project->links;
                        } elseif (
                            !empty($source->messageReplies) &&
                            preg_match(
                                '!messageReplies/(\d+)!',
                                $headers['X-Action']
                            )
                        ) {
                                $source = current($source->messageReplies);
                        } elseif (
                            !empty($source->people) &&
                            preg_match(
                                '!projects/(\d+)/people/(\d+)!',
                                $headers['X-Action']
                            )
                        ) {
                            $source = current($source->people);
                        } elseif (
                            !empty($source->project) &&
                            preg_match(
                                '!projects/(\d+)/notebooks!',
                                $headers['X-Action']
                            )
                        ) {
                            $source = [];
                        } else {
                            $source = current($source);
                        }
                        if ($headers['X-Action'] === 'links' ||
                                        $headers['X-Action'] === 'notebooks') {
                            $_source = [];
                            $wrapper = $headers['X-Action'];
                            foreach ($source as $project) {
                                foreach ($project->$wrapper as $object) {
                                    $_source[] = $object;
                                }
                            }
                            $source = $_source;
                        } elseif (
                            strpos($headers['X-Action'], 'time_entries') > 0 &&
                            !$source
                        ) {
                            $source = [];
                        }
                        $this->headers = $headers;
                        $this->string = json_encode($source);

                        $this->data   = self::camelizeObject($source);

                        if (!empty($this->data->id)) {
                            $this->data->id = (int) $this->data->id;
                        }

                        return $this;
                }
            } elseif (!empty($source->MESSAGE)) {
                $errors = $source->MESSAGE;
            } else {
                $errors = null;
            }
        }

        throw new \TeamWorkPm\Exception([
            'Message'  => $errors,
            'Response' => $data,
            'Headers'  => $headers
        ]);
    }

    protected function getContent()
    {
        $object = json_decode($this->string);

        return json_encode($object, JSON_PRETTY_PRINT);
    }

    protected static function camelizeObject($source)
    {
        $destination = new ArrayObject([], ArrayObject::ARRAY_AS_PROPS);
        foreach ($source as $key => $value) {
            if (ctype_upper($key)) {
                $key = strtolower($key);
            }
            $key = Str::camel($key);
            $destination->$key = is_scalar($value) ?
                                        $value : self::camelizeObject($value);
        }
        return $destination;
    }

    /**
     * @codeCoverageIgnore
     */
    private function getJsonErrors()
    {
        $errorCode = json_last_error();
        if (!$errorCode) {
            return;
        }

        if (function_exists('json_last_error_msg')) {
            return json_last_error_msg();
        }

        switch ($errorCode) {
            case JSON_ERROR_DEPTH:
                return 'Maximum stack depth exceeded';
            break;
            case JSON_ERROR_STATE_MISMATCH:
                return 'Underflow or the modes mismatch';
            break;
            case JSON_ERROR_CTRL_CHAR:
                return 'Unexpected control character found';
            break;
            case JSON_ERROR_SYNTAX:
                return 'Syntax error, malformed JSON';
            break;
            case JSON_ERROR_UTF8:
                return 'Malformed UTF-8 characters, possibly incorrectly encoded';
            break;
        }
    }
}


text:
<?php

namespace app\controllers;

use yii\base\Model;
use Yii;
use yii\web\Response;
use yii\widgets\ActiveForm;

trait AjaxValidationTrait
{
    /**
     * Performs ajax validation.
     *
     * @param Model $model
     *
     * @throws \yii\base\ExitException
     */
    protected function performAjaxValidation(Model $model)
    {
        if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
            Yii::$app->response->format = Response::FORMAT_JSON;
            echo json_encode(ActiveForm::validate($model));
            Yii::$app->end();
        }
    }
}


text:
package org.wso2.carbon.mdm.services.android.bean.wrapper;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@ApiModel(
        value = "DeviceInfo",
        description = "This class carries all information related to the device information provided by a device."
)
public class AndroidDeviceInfo extends DeviceInfo implements Serializable {
    private static final long serialVersionUID = 1998101733L;
    @ApiModelProperty(
            name = "IMEI",
            value = "IMEI number of the device.",
            required = true
    )
    private String IMEI;
    @ApiModelProperty(
            name = "IMSI",
            value = "IMSI number of the device.",
            required = true
    )
    private String IMSI;
    @ApiModelProperty(
            name = "deviceModel",
            value = "Model of the device.",
            required = true
    )
    private String deviceModel;
    @ApiModelProperty(
            name = "vendor",
            value = "Vendor of the device.",
            required = true
    )
    private String vendor;
    @ApiModelProperty(
            name = "osVersion",
            value = "Operating system version.",
            required = true
    )
    private String osVersion;
    @ApiModelProperty(
            name = "batteryLevel",
            value = "Battery level of the device.",
            required = true
    )
    private Double batteryLevel;
    @ApiModelProperty(
            name = "internalTotalMemory",
            value = "Total internal memory of the device.",
            required = true
    )
    private Double internalTotalMemory;
    @ApiModelProperty(
            name = "internalAvailableMemory",
            value = "Total available memory of the device.",
            required = true
    )
    private Double internalAvailableMemory;
    @ApiModelProperty(
            name = "externalTotalMemory",
            value = "Total external memory of the device.",
            required = true
    )
    private Double externalTotalMemory;
    @ApiModelProperty(
            name = "externalAvailableMemory",
            value = "Total external memory avilable of the device.",
            required = true
    )
    private Double externalAvailableMemory;
    @ApiModelProperty(
            name = "operator",
            value = "Mobile operator of the device.",
            required = true
    )
    private String operator;
    @ApiModelProperty(
            name = "connectionType",
            value = "How the device is connected to the network.",
            required = true
    )
    private String connectionType;
    @ApiModelProperty(
            name = "mobileSignalStrength",
            value = "Current mobile signal strength.",
            required = true
    )
    private Double mobileSignalStrength;
    @ApiModelProperty(
            name = "ssid",
            value = "ssid of the connected WiFi.",
            required = true
    )
    private String ssid;
    @ApiModelProperty(
            name = "cpuUsage",
            value = "Current total cpu usage.",
            required = true
    )
    private Double cpuUsage;
    @ApiModelProperty(
            name = "totalRAMMemory",
            value = "Total Ram memory size.",
            required = true
    )
    private Double totalRAMMemory;
    @ApiModelProperty(
            name = "availableRAMMemory",
            value = "Available total memory of RAM.",
            required = true
    )
    private Double availableRAMMemory;
    @ApiModelProperty(
            name = "pluggedIn",
            value = "Whether the device is plugged into power or not.",
            required = true
    )
    private boolean pluggedIn;
    @ApiModelProperty(
            name = "updatedTime",
            value = "Device updated time.",
            required = true
    )
    private Date updatedTime;
    @ApiModelProperty(
            name = "location",
            value = "Last updated location of the device",
            required = false
    )
    private DeviceLocation location;
    @ApiModelProperty(
            name = "deviceDetailsMap",
            value = ".",
            required = true
    )
    private Map<String, String> deviceDetailsMap = new HashMap();

    public AndroidDeviceInfo() {
    }

    public DeviceLocation getLocation() {
        return this.location;
    }

    public void setLocation(DeviceLocation location) {
        this.location = location;
    }

    public String getIMEI() {
        return this.IMEI != null?this.IMEI:"";
    }

    public void setIMEI(String IMEI) {
        this.IMEI = IMEI;
    }

    public String getIMSI() {
        return this.IMSI != null?this.IMSI:"";
    }

    public void setIMSI(String IMSI) {
        this.IMSI = IMSI;
    }

    public String getDeviceModel() {
        return this.deviceModel != null?this.deviceModel:"";
    }

    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }

    public String getVendor() {
        return this.vendor != null?this.vendor:"";
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public String getOsVersion() {
        return this.osVersion != null?this.osVersion:"";
    }

    public void setOsVersion(String osVersion) {
        this.osVersion = osVersion;
    }

    public Double getBatteryLevel() {
        return this.batteryLevel != null?this.batteryLevel:Double.valueOf(0.0D);
    }

    public void setBatteryLevel(Double batteryLevel) {
        this.batteryLevel = batteryLevel;
    }

    public Double getInternalTotalMemory() {
        return this.internalTotalMemory != null?this.internalTotalMemory:Double.valueOf(0.0D);
    }

    public void setInternalTotalMemory(Double internalTotalMemory) {
        this.internalTotalMemory = internalTotalMemory;
    }

    public Double getInternalAvailableMemory() {
        return this.internalAvailableMemory != null?this.internalAvailableMemory:Double.valueOf(0.0D);
    }

    public void setInternalAvailableMemory(Double internalAvailableMemory) {
        this.internalAvailableMemory = internalAvailableMemory;
    }

    public Double getExternalTotalMemory() {
        return this.externalTotalMemory != null?this.externalTotalMemory:Double.valueOf(0.0D);
    }

    public void setExternalTotalMemory(Double externalTotalMemory) {
        this.externalTotalMemory = externalTotalMemory;
    }

    public Double getExternalAvailableMemory() {
        return this.externalAvailableMemory != null?this.externalAvailableMemory:Double.valueOf(0.0D);
    }

    public void setExternalAvailableMemory(Double externalAvailableMemory) {
        this.externalAvailableMemory = externalAvailableMemory;
    }

    public String getOperator() {
        return this.operator != null?this.operator:"";
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getConnectionType() {
        return this.connectionType != null?this.connectionType:"";
    }

    public void setConnectionType(String connectionType) {
        this.connectionType = connectionType;
    }

    public Double getMobileSignalStrength() {
        return this.mobileSignalStrength != null?this.mobileSignalStrength:Double.valueOf(0.0D);
    }

    public void setMobileSignalStrength(Double mobileSignalStrength) {
        this.mobileSignalStrength = mobileSignalStrength;
    }

    public String getSsid() {
        return this.ssid != null?this.ssid:"";
    }

    public void setSsid(String ssid) {
        this.ssid = ssid;
    }

    public Double getCpuUsage() {
        return this.cpuUsage != null?this.cpuUsage:Double.valueOf(0.0D);
    }

    public void setCpuUsage(Double cpuUsage) {
        this.cpuUsage = cpuUsage;
    }

    public Double getTotalRAMMemory() {
        return this.totalRAMMemory != null?this.totalRAMMemory:Double.valueOf(0.0D);
    }

    public void setTotalRAMMemory(Double totalRAMMemory) {
        this.totalRAMMemory = totalRAMMemory;
    }

    public Double getAvailableRAMMemory() {
        return this.availableRAMMemory != null?this.availableRAMMemory:Double.valueOf(0.0D);
    }

    public void setAvailableRAMMemory(Double availableRAMMemory) {
        this.availableRAMMemory = availableRAMMemory;
    }

    public boolean isPluggedIn() {
        return this.pluggedIn;
    }

    public void setPluggedIn(boolean pluggedIn) {
        this.pluggedIn = pluggedIn;
    }

    public Date getUpdatedTime() {
        if(this.updatedTime == null) {
            this.updatedTime = new Date();
        }

        return this.updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public void setDeviceDetailsMap(Map<String, String> deviceDetailsMap) {
        this.deviceDetailsMap = deviceDetailsMap;
    }

    public Map<String, String> getDeviceDetailsMap() {
        return this.deviceDetailsMap;
    }
}


text:
<?php

namespace HMS\Doctrine;

class CarbonTimeType extends CarbonType
{
    /**
     * {@inheritdoc}
     */
    protected $getFormatString = 'getTimeFormatString';
}


text:
<?php
//+---------------------------------------------------------------------------------------------------------------------------------+
//																    /
// Copyright (c) 2012 Yahoo! Inc. All rights reserved. 										    /
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this 				            /
// file except in compliance with the License. You may obtain a copy of the License at 						    /
//																    /
//		http://www.apache.org/licenses/LICENSE-2.0 									    /
//																    /
// Unless required by applicable law or agreed to in writing, software distributed under 					    /
// the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF    					    /
// ANY KIND, either express or implied. See the License for the specific language governing 					    /
// permissions and limitations under the License. See accompanying LICENSE file.						    /
// 																    /
// $Author:shawcs@yahoo-inc.com  $Date: 30-Jan-2012										    /
//																    /
//+---------------------------------------------------------------------------------------------------------------------------------+
define('OPS_APP_HOME_DIR', dirname(__FILE__));

require_once 'assist/prepend.php';
require_once 'assist/lib/model/calendarConfig.php';

session_start();
$auth = $_SESSION['auth'];
$settings=parse_ini_file('conf/setting.ini', true);
$dbh = Connection::cal_ro();
$obj = new calendarConfig();
$TMG= $obj->isMember($auth->username, $dbh, $settings['manager_group']);
if( !$TMG)
{
		header( "Location: calendar.php");
}
else
{
$action=$_GET['action'];
include 'header.php';
?>

  Team Management

<?php
if($action=="addteam"){
	$team_name=$_POST['team_name'];
	$desc=$_POST['description'];
	$user_ilist=$_POST['user_ilist'];
	$admin_ilist=$_POST['admin_ilist'];
	$dbh=Connection::cal_rw();
	$obj_assignee = new calendarConfig();
	$obj_assignee->addTeamDetails($dbh,$team_name,$desc,$user_ilist,$admin_ilist);
}

if($action=="editteam"){
	if($_POST['team_id'])
		$team_id=$_POST['team_id'];
	$dbh=Connection::cal_ro();
	$obj_assignee = new calendarConfig();
	$details = $obj_assignee->getTidDetails($dbh, $team_id);
	$team_name = $details['team_name'];
	$desc = $details['description'];
	$user_ilist=$details['user_ilist'];
	$admin_ilist=$details['admin_ilist'];

	if($_POST['team_name'])
		$team_name=$_POST['team_name'];
	if($_POST['description'])
		$desc=$_POST['description'];
	if($_POST['user_ilist'])
		$user_ilist=$_POST['user_ilist'];
	if($_POST['admin_ilist'])
		$admin_ilist=$_POST['admin_ilist'];
	$dbh=Connection::cal_rw();
	$obj_assignee = new calendarConfig();
	$obj_assignee->editTeamDetails($dbh,$team_id,$team_name,$desc,$user_ilist,$admin_ilist);
}

if($action=="deleteteam"){
	$team_id=$_POST['team_id'];
	$dbh=Connection::cal_rw();
	$obj_assignee = new calendarConfig();
	$obj_assignee->deleteTeam($dbh, $team_id);
}
?>

Add new Team/
Edit Existing Team Details
/Delete a Team
    <form action="team_mgmt.php?action=addteam" method="post" id="hiddenForm" style="display: none;">

Add New Team:

Team Name:	<input type="text" name="team_name"/>

Description:	<input type="text" name="description"/>

User Ilist:	<input type="text" name="user_ilist"/>

Admin Ilist:	<input type="text" name="admin_ilist"/>

	 <input type="submit" value="Save" />
     </form>

    <form action="team_mgmt.php?action=editteam" method="post" id="hiddenForm2" style="display: none;">

Edit Existing Team Details:

Team Id:	<input type="text" name="team_id"/>

Team Name:	<input type="text" name="team_name"/>

Description:	<input type="text" name="description"/>

User Ilist:	<input type="text" name="user_ilist"/>

Admin Ilist:	<input type="text" name="admin_ilist"/>

         <input type="submit" value="Save" />
    </form>

    <form action="team_mgmt.php?action=deleteteam" method="post" id="hiddenForm3" style="display: none;">

Delete a Team:

Team Id:	<input type="text" name="team_id"/>

	<input type="submit" value="Delete"/>
    </form>

<form name='teamdetails' method ='post' action="team_mgmt.php?action=details">
<select name="team_name" onChange="document.forms['teamdetails'].submit()">
<?php
	$dbh = Connection::cal_ro();
	$obj_assignee = new calendarConfig();
	$teams = $obj_assignee->getTeamlist($dbh);
	$team="Select a team";
	if($_POST['team_name'] && $_GET['action']=="details")
		$team=$_POST['team_name'];
?>
<option selected> <?php echo $team ?> </option>
<?php
for($i=0;$i<count($teams); $i+=1)
{
	if($teams[$i]['team_name']!=$team)
	{
		?>
		<option> <?php echo  $teams[$i]['team_name']?></option>
		<?php
	}
}
?>
</select>

Team Id
Team name
Description
User Ilist
Admin Ilist

<?php
	if($team!="Select a team"){
		$dbh = Connection::cal_ro();
		$obj_assignee = new calendarConfig();
		$teamdetails=$obj_assignee->getTeamDetails($dbh,$team);
?>

 		<?php echo $teamdetails['team_id']?>
 		<?php echo $teamdetails['team_name']?>
 		<?php echo $teamdetails['description']?>
 		<?php echo $teamdetails['user_ilist']?>
 		<?php echo $teamdetails['admin_ilist']?>

<?php
	}
?>

          Copyright © 2012 Yahoo! Inc. All rights reserved.

<?php
}
?>


text:
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash's](https://lodash.com/) `_.escapeRegExp` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.

## Installation

Using npm:

```bash
$ {sudo -H} npm i -g npm
$ npm i --save lodash.escaperegexp
```

In Node.js/io.js:

```js
var escapeRegExp = require('lodash.escaperegexp');
```

See the [documentation](https://lodash.com/docs#escapeRegExp) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.escaperegexp) for more details.


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

<title>org.codehaus.jackson.util (Jackson JSON Processor)</title>
<meta name="date" content="2013-07-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.codehaus.jackson.util

Utility classes used by Jackson Core functionality.

See: Description

Class Summary

Class
Description

BufferRecycler

This is a small utility class, whose main functionality is to allow
 simple reuse of raw byte/char buffers.

ByteArrayBuilder

Helper class that is similar to ByteArrayOutputStream
 in usage, but more geared to Jackson use cases internally.

CharTypes

DefaultPrettyPrinter

Default PrettyPrinter implementation that uses 2-space
 indentation with platform-default linefeeds.

DefaultPrettyPrinter.FixedSpaceIndenter

This is a very simple indenter that only every adds a
 single space for indentation.

DefaultPrettyPrinter.Lf2SpacesIndenter

Default linefeed-based indenter uses system-specific linefeeds and
 2 spaces for indentation per level.

DefaultPrettyPrinter.NopIndenter

Dummy implementation that adds no indentation whatsoever

InternCache

Singleton class that adds a simple first-level cache in front of
 regular String.intern() functionality.

JsonGeneratorDelegate

JsonParserDelegate

Helper class that implements
 delegation pattern for JsonParser,
 to allow for simple overridability of basic parsing functionality.

JsonParserSequence

Helper class that can be used to sequence multiple physical
 JsonParsers to create a single logical sequence of
 tokens, as a single JsonParser.

MinimalPrettyPrinter

PrettyPrinter implementation that adds no indentation,
 just implements everything necessary for value output to work
 as expected, and provide simpler extension points to allow
 for creating simple custom implementations that add specific
 decoration or overrides.

TextBuffer

TextBuffer is a class similar to StringBuffer, with
 following differences:

  TextBuffer uses segments character arrays, to avoid having
     to do additional array copies when array is not big enough.

TokenBuffer

Utility class used for efficient storage of JsonToken
 sequences, needed for temporary buffering.

TokenBuffer.Parser

TokenBuffer.Segment

Individual segment of TokenBuffer that can store up to 16 tokens
 (limited by 4 bits per token type marker requirement).

VersionUtil

Functionality for supporting exposing of component Versions.

Enum Summary

Enum
Description

BufferRecycler.ByteBufferType

BufferRecycler.CharBufferType

Package org.codehaus.jackson.util Description

Utility classes used by Jackson Core functionality.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System;
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Microsoft.Owin.Security.Cookies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("0c13812a-31fd-4d51-861d-3edc11b5e279")]
[assembly: CLSCompliant(true)]


text:
<?php

use yii\db\Migration;

/**
 * Handles the creation for table `job_position`.
 */
class m160801_093622_create_job_position_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('job_position', [
            'id' => $this->primaryKey(),
            'name' => $this->string()->notNull(),
            'description' => $this->text(),
            'icon_path' => $this->string()
        ]);

        $this->createIndex('idx-user_data_position_id', '{{%user_data}}', '[[position_id]]');
        $this->addForeignKey('fk-user_data-position_id', '{{%user_data}}', '[[position_id]]', '{{%job_position}}', '[[id]]', 'SET NULL', 'CASCADE');
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropForeignKey('fk-user_data-position_id', '{{%user_data}}');
        $this->dropIndex('idx-user_data_position_id', '{{%user_data}}');
        $this->dropTable('job_position');
    }
}


text:
import alt from "alt-instance";
import iDB from "idb-instance";
import {key} from "bitsharesjs";
import {ChainConfig} from "bitsharesjs-ws";
import Immutable from "immutable";
import BaseStore from "stores/BaseStore";

let AddressIndexWorker;
if (__ELECTRON__) {
    AddressIndexWorker = require("worker-loader?inline!workers/AddressIndexWorker");
}
class AddressIndex extends BaseStore {
    constructor() {
        super();
        this.state = {
            addresses: Immutable.Map(),
            saving: false
        };
        this.pubkeys = new Set();
        // loadAddyMap is for debugging, this.add will load this on startup
        this._export("add", "addAll", "loadAddyMap");
    }

    saving() {
        if (this.state.saving) return;
        this.state.saving = true;
        this.setState({saving: true});
    }

    /** Add public key string (if not already added).  Reasonably efficient
        for less than 10K keys.
    */
    add(pubkey) {
        this.loadAddyMap()
            .then(() => {
                var dirty = false;
                if (this.pubkeys.has(pubkey)) return;
                this.pubkeys.add(pubkey);
                this.saving();
                // Gather all 5 legacy address formats (see key.addresses)
                var address_strings = key.addresses(pubkey);
                for (let address of address_strings) {
                    this.state.addresses = this.state.addresses.set(
                        address,
                        pubkey
                    );
                    dirty = true;
                }
                if (dirty) {
                    this.setState({addresses: this.state.addresses});
                    this.saveAddyMap();
                } else {
                    this.setState({saving: false});
                }
            })
            .catch(e => {
                throw e;
            });
    }

    /** Worker thread implementation (for more than 10K keys) */
    addAll(pubkeys) {
        return new Promise((resolve, reject) => {
            this.saving();
            this.loadAddyMap()
                .then(() => {
                    if (!__ELECTRON__) {
                        AddressIndexWorker = require("worker-loader!workers/AddressIndexWorker");
                    }
                    let worker = new AddressIndexWorker();
                    worker.postMessage({
                        pubkeys,
                        address_prefix: ChainConfig.address_prefix
                    });
                    // let _this = this
                    worker.onmessage = event => {
                        try {
                            let key_addresses = event.data;
                            let dirty = false;
                            let addresses = this.state.addresses.withMutations(
                                addresses => {
                                    for (let i = 0; i < pubkeys.length; i++) {
                                        let pubkey = pubkeys[i];
                                        if (this.pubkeys.has(pubkey)) continue;
                                        this.pubkeys.add(pubkey);
                                        // Gather all 5 legacy address formats (see key.addresses)
                                        let address_strings = key_addresses[i];
                                        for (let address of address_strings) {
                                            addresses.set(address, pubkey);
                                            dirty = true;
                                        }
                                    }
                                }
                            );
                            if (dirty) {
                                this.setState({addresses});
                                this.saveAddyMap();
                            } else {
                                this.setState({saving: false});
                            }
                            resolve();
                        } catch (e) {
                            console.error("AddressIndex.addAll", e);
                            reject(e);
                        }
                    };
                })
                .catch(e => {
                    throw e;
                });
        });
    }

    loadAddyMap() {
        if (this.loadAddyMapPromise) return this.loadAddyMapPromise;
        this.loadAddyMapPromise = iDB.root
            .getProperty("AddressIndex")
            .then(map => {
                this.state.addresses = map
                    ? Immutable.Map(map)
                    : Immutable.Map();
                // console.log("AddressIndex load", this.state.addresses.size);
                this.state.addresses
                    .valueSeq()
                    .forEach(pubkey => this.pubkeys.add(pubkey));
                this.setState({addresses: this.state.addresses});
            });
        return this.loadAddyMapPromise;
    }

    saveAddyMap() {
        clearTimeout(this.saveAddyMapTimeout);
        this.saveAddyMapTimeout = setTimeout(() => {
            // console.log("AddressIndex save", this.state.addresses.size);
            this.setState({saving: false});
            // If indexedDB fails to save, it will re-try via PrivateKeyStore calling this.add
            return iDB.root.setProperty(
                "AddressIndex",
                this.state.addresses.toObject()
            );
        }, 100);
    }
}
// console.log("post msg a");
// worker.postMessage("a")
export default alt.createStore(AddressIndex, "AddressIndex");


text:
<?xml version="1.0" encoding="UTF-8"?>

<behavior name="Sweep Test Behavior">

	<executable package_path="vigir_behavior_sweep_test_behavior.sweep_test_behavior_sm" class="SweepTestBehaviorSM" />
	<tagstring>test sweep</tagstring>
	<author>Philipp Schillinger</author>
	<date>Fri Aug 28 2015</date>
	<description>
		Performs a short sweep and logs some stuff.
	</description>

	<!-- Contained Behaviors -->

	<!-- Available Parameters -->

</behavior>


text:
package org.hibernate.service.jdbc.connections.internal;

import java.sql.SQLException;

import org.jboss.logging.Cause;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;

import org.hibernate.internal.CoreMessageLogger;

import static org.jboss.logging.Logger.Level.INFO;
import static org.jboss.logging.Logger.Level.WARN;

/**
 * The jboss-logging {@link MessageLogger} for the hibernate-c3p0 module.  It reserves message ids ranging from
 * 10001 to 15000 inclusively.
 * <p/>
 * New messages must be added after the last message defined to ensure message codes are unique.
 */
@MessageLogger( projectCode = "HHH" )
public interface C3P0MessageLogger extends CoreMessageLogger {

    @LogMessage( level = WARN )
    @Message( value = "Both hibernate-style property '%s' and c3p0-style property '%s' have been set in hibernate.properties. "
                      + "Hibernate-style property '%s' will be used and c3p0-style property '%s' will be ignored!", id = 10001 )
    void bothHibernateAndC3p0StylesSet( String hibernateStyle,
                                        String c3p0Style,
                                        String hibernateStyle2,
                                        String c3p0Style2 );

    @LogMessage( level = INFO )
    @Message( value = "C3P0 using driver: %s at URL: %s", id = 10002 )
    void c3p0UsingDriver( String jdbcDriverClass,
                          String jdbcUrl );

    @Message( value = "JDBC Driver class not found: %s", id = 10003 )
    String jdbcDriverNotFound( String jdbcDriverClass );

    @LogMessage( level = WARN )
    @Message( value = "Could not destroy C3P0 connection pool", id = 10004 )
    void unableToDestroyC3p0ConnectionPool( @Cause SQLException e );

    @Message( value = "Could not instantiate C3P0 connection pool", id = 10005 )
    String unableToInstantiateC3p0ConnectionPool();
}


text:
import * as AWS from "aws-sdk";
import * as crypto from "crypto";
import fetch from "node-fetch";
import * as jwt from "jwt-simple";
import * as uuid from "uuid";
import { createJWT, AuthCompleteMessage } from "./common";

import { ForbiddenError } from "../errors";

import { ShopifyAuthCompleteResponse, ShopifyAuthCompleteRequest } from "./common";

// The shape of the token exchange response from Shopify
interface ShopifyTokenResponse {
    error?: string;
    errors?: string;
    error_description?: string;
    access_token?: string;
    scope?: string;
}

// We need this to iterate through the keys of the AuthCompleteRequest later
type AuthCompleteRequestKey = keyof ShopifyAuthCompleteRequest;

export async function authComplete(token: string, params: ShopifyAuthCompleteRequest): Promise<ShopifyAuthCompleteResponse> {
        if (!validateNonce(token, params) || !validateShopDomain(params.shop) || !validateHMAC(params)) {
            console.error("Invalid Token");
            throw new ForbiddenError("Invalid Token");
        }

        const resp = await exchangeToken(params.shop, params.code);
        const access_token = resp["access_token"];
        if (access_token === undefined) {
            console.error("resp[\"access_token\"] is undefined");
            throw new Error("resp[\"access_token\"] is undefined");
        }

        await writeShop(params.shop, resp["access_token"] as string);
        const result = await sendAuthCompleteNotification(params.shop, access_token);
        console.log("Message ID", result.MessageId);

        return {
            token: createJWT(params.shop, uuid(), 43200)
        };

}

// Validate the nonce against the token
function validateNonce(token: string, params: ShopifyAuthCompleteRequest): boolean {
    let payload = jwt.decode(token, process.env.JWT_SECRET);

    if (payload.exp > (new Date()).getTime()) {
        console.error("Token has expired");
        return false;
    }

    if (payload.iss !== process.env.JWT_ISS) {
        console.error("Incorrect issuer");
        return false;
    }

    if (payload.sub !== params["shop"]) {
        console.log("Token for a different shop", payload.sub);
        return false;
    }

    if (payload.jti !== params["state"]) {
        console.error("Incorrect nonce");
        return false;
    }

    return true;
}

// Check that the shop_domain is a valid myshop.com domain. This is required by Shopify
function validateShopDomain(shop_domain: string): boolean {
    if (shop_domain.match(/^[a-z][a-z0-9\-]*\.myshopify\.com$/i) === null) {
        console.error("Shop validation failed", shop_domain);
        return false;
    }

    return true;
}

// Validate the HMAC parameter
function validateHMAC(params: ShopifyAuthCompleteRequest): boolean {
    let p = [];
    let k: AuthCompleteRequestKey;
    for (k in params) {
        if (k !== "hmac") {
            k.replace("%", "%25");
            p.push(encodeURIComponent(k) + "=" + encodeURIComponent(params[k].toString()));
        }
    }
    const message = p.sort().join("&");

    const digest = crypto.createHmac("SHA256", process.env.SHOPIFY_API_SECRET).update(message).digest("hex");

    return (digest === params.hmac);
}

// Exchange the temporary code the permanent API token
async function exchangeToken(shop: string, code: string): Promise<ShopifyTokenResponse> {
    const data = {
        client_id: process.env.SHOPIFY_API_KEY,
        client_secret: process.env.SHOPIFY_API_SECRET,
        code: code
    };

    const body = JSON.stringify(data);

    const url = `https://${shop}/admin/oauth/access_token`;

    const options = {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
            "Accept": "application/json",
        },
        body: body
    };

    const res = await fetch(url, options);
    const json = await res.json() as ShopifyTokenResponse;
    console.log("Shopify Token Exchange Response", json);
    if ("error_description" in json || "error" in json || "errors" in json) {
        throw new Error(json["error_description"] || json["error"] || json["errors"]);
    }
    return json;
}

// Write the shop record to the dynamodb table
async function writeShop(shop_domain: string, access_token: string): Promise<AWS.DynamoDB.UpdateItemOutput> {
    const dynamodb = new AWS.DynamoDB({ apiVersion: "2012-08-10" });
    const now = new Date();
    const updateParams = {
        TableName: process.env.SHOPS_TABLE,
        Key: {
            shop_domain: { S: shop_domain }
        },
        UpdateExpression: "SET platform = :platform, access_token = :access_token, installed_at = :installed_at",
        ExpressionAttributeValues: {
            ":platform": { S: "shopify" },
            ":access_token": { S: access_token },
            ":installed_at": { N: now.getTime().toString() }
        }
    };
    console.log("Update Item", updateParams);

    // TODO Retrieve the shop first and only set installed_at ONCE
    return dynamodb.updateItem(updateParams).promise();
}

// Send the SNS notification that the application has been installed
async function sendAuthCompleteNotification(shop_domain: string, access_token: string): Promise<AWS.SNS.PublishResponse> {
    const sns = new AWS.SNS();

    const message: AuthCompleteMessage = {
        shop_domain: shop_domain,
        event: "app/auth_complete",
        access_token: access_token,
        data: null
    };

    const params = {
        TopicArn: process.env.AUTH_COMPLETE_TOPIC_ARN,
        Message: JSON.stringify(message),
    };

    return sns.publish(params).promise();
}


text:
package org.apache.sling.jobs.impl.storage;

import org.apache.sling.jobs.Job;
import org.apache.sling.jobs.impl.spi.JobStorage;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * An unbounded local JVM job store.
 */
public class InMemoryJobStorage implements JobStorage {

    private Map<String, Job> store = new ConcurrentHashMap<String, Job>();

    @Nullable
    @Override
    public Job get(@Nonnull String jobId) {
        check();
        return store.get(jobId);
    }

    @Nonnull
    @Override
    public Job put(@Nonnull Job job) {
        check();
        store.put(job.getId(), job);
        return job;
    }

    @Nullable
    @Override
    public Job remove(@Nonnull String jobId) {
        check();
        Job j = store.get(jobId);
        store.remove(jobId);
        return j;
    }

    @Nullable
    @Override
    public Job remove(@Nonnull Job job) {
        check();
        return remove(job.getId());
    }

    private void check() {
        if ( store == null) {
            throw new IllegalStateException("Job store already closed.");
        }
    }

    @Override
    public void dispose() {
        store.clear();
        store = null;
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.micmiu.mvc</groupId>
        <artifactId>ferriswheel-parent</artifactId>
        <version>1.3.1-SNAPSHOT</version>
        <relativePath>../ferriswheel-parent/</relativePath>
    </parent>

    <artifactId>ferriswheel-spring</artifactId>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <url>http://micmiu.com</url>
    <modules>
        <module>ferriswheel-spring-exts</module>
        <module>ferriswheel-spring-mvc</module>
    </modules>
    <dependencies>
        <!-- spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>

        <!-- slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- slf4j-log4j绑定 -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>

        <!-- common-logging slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>

        <!-- log4j -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <!-- source attach plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
'use strict';

angular.module('mean.persona').config(['$stateProvider',
    function ($stateProvider) {

        // Check if user has role
        var checkUserRole = function (role, $q, $timeout, $http, $location, Auth) {

            // Initialize a new promise
            var deferred = $q.defer();

            // ver-personas
            if (Auth.authz.hasResourceRole(role, 'persona')) {
                $timeout(deferred.resolve);
            }

            // Not ver-personas
            else {
                $timeout(deferred.reject);
                //$location.url('/auth/login');
                alert('No tiene los permisos para poder acceder a esta pagina');
            }

            return deferred.promise;
        };

        $stateProvider
            .state('persona', {
                abstract: true,
                url: '/persona',
                templateUrl: 'persona/views/_body.html',
                controller: 'PersonaController'
            })
            .state('persona.home', {
                url: '/home',
                templateUrl: 'persona/views/index.html'
            })
            .state('persona.app', {
                url: '/app',
                templateUrl: 'persona/views/app.html'
            })

            .state('persona.app.personas', {
                url: '/personas',
                template: '

'
            })
            .state('persona.app.administracion', {
                url: '/administracion',
                template: '

'
            })

            //tipoDocumento
            .state('persona.app.administracion.buscarTipoDocumento', {
                url: '/buscarTipoDocumentos',
                templateUrl: 'persona/views/tipoDocumento/form-buscar-tipoDocumento.html',
                controller: 'Persona.BuscarTipoDocumentoController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-documentos', $q, $timeout, $http, $location, Auth)
                    }
                }
            })
            .state('persona.app.administracion.crearTipoDocumento', {
                url: '/tipoDocumento',
                templateUrl: 'persona/views/tipoDocumento/form-crear-tipoDocumento.html',
                controller: 'Persona.CrearTipoDocumentoController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-documentos', $q, $timeout, $http, $location, Auth)
                    }
                }
            })
            .state('persona.app.administracion.editarTipoDocumento', {
                url: '/tipoDocumento/:id',
                templateUrl: 'persona/views/tipoDocumento/form-editar-tipoDocumento.html',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-documentos', $q, $timeout, $http, $location, Auth)
                    },
                    tipoDocumento: function ($state, $stateParams, SGTipoDocumento) {
                        return SGTipoDocumento.$find($stateParams.id);
                    }
                },
                controller: 'Persona.EditarTipoDocumentoController'
            })

            //Personas
            .state('persona.app.personas.buscarPersonaNatural', {
                url: '/buscarPersonaNatural',
                templateUrl: 'persona/views/natural/form-buscar-personaNatural.html',
                controller: 'Persona.BuscarPersonaNaturalController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.crearPersonaNatural', {
                url: '/natural?tipoDocumento&numeroDocumento',
                templateUrl: 'persona/views/natural/form-crear-personaNatural.html',
                controller: 'Persona.CrearPersonaNaturalController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaNatural', {
                url: '/natural/{id:[0-9]{1,8}}',
                templateUrl: 'persona/views/natural/form-editar-personaNatural.html',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    },
                    personaNatural: function ($state, $stateParams, SGPersonaNatural) {
                        return SGPersonaNatural.$find($stateParams.id);
                    }
                },
                controller: 'Persona.EditarPersonaNaturalController'
            }).state('persona.app.personas.editarPersonaNatural.resumen', {
                url: '/resumen',
                templateUrl: 'persona/views/natural/form-editar-resumen.html',
                controller: 'Persona.EditarPersonaNatural.ResumenController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaNatural.datosPrincipales', {
                url: '/principal',
                templateUrl: 'persona/views/natural/form-editar-datosPrincipales.html',
                controller: 'Persona.EditarPersonaNatural.DatosPrincipalesController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaNatural.datosAdicionales', {
                url: '/adicionales',
                templateUrl: 'persona/views/natural/form-editar-datosAdicionales.html',
                controller: 'Persona.EditarPersonaNatural.DatosAdicionalesController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            })

            .state('persona.app.personas.buscarPersonaJuridica', {
                url: '/juridica/buscar',
                templateUrl: 'persona/views/juridica/form-buscar-personaJuridica.html',
                controller: 'Persona.BuscarPersonaJuridicaController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.crearPersonaJuridica', {
                url: '/juridica?tipoDocumento&numeroDocumento',
                templateUrl: 'persona/views/juridica/form-crear-personaJuridica.html',
                controller: 'Persona.CrearPersonaJuridicaController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.crearPersonaJuridica.datosPrincipales', {
                url: '/principal',
                templateUrl: 'persona/views/juridica/form-crear-datosPrincipales.html',
                controller: 'Persona.CrearPersonaJuridica.DatosPrincipalesController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.crearPersonaJuridica.representante', {
                url: '/representante',
                templateUrl: 'persona/views/juridica/form-crear-representante.html',
                controller: 'Persona.CrearPersonaJuridica.RepresentanteController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            })

            .state('persona.app.personas.editarPersonaJuridica', {
                url: '/juridica/{id:[0-9]{1,8}}',
                templateUrl: 'persona/views/juridica/form-editar-personaJuridica.html',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    },
                    personaJuridica: function ($state, $stateParams, SGPersonaJuridica) {
                        return SGPersonaJuridica.$find($stateParams.id);
                    }
                },
                controller: 'Persona.EditarPersonaJuridicaController'
            }).state('persona.app.personas.editarPersonaJuridica.resumen', {
                url: '/resumen',
                templateUrl: 'persona/views/juridica/form-editar-resumen.html',
                controller: 'Persona.EditarPersonaJuridica.ResumenController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaJuridica.datosPrincipales', {
                url: '/principal',
                templateUrl: 'persona/views/juridica/form-editar-datosPrincipales.html',
                controller: 'Persona.EditarPersonaJuridica.DatosPrincipalesController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaJuridica.datosAdicionales', {
                url: '/adicionales',
                templateUrl: 'persona/views/juridica/form-editar-datosAdicionales.html',
                controller: 'Persona.EditarPersonaJuridica.DatosAdicionalesController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaJuridica.representante', {
                url: '/representante',
                templateUrl: 'persona/views/juridica/form-editar-representante.html',
                controller: 'Persona.EditarPersonaJuridica.RepresentanteController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            }).state('persona.app.personas.editarPersonaJuridica.crearAccionista', {
                url: '/accionista',
                templateUrl: 'persona/views/juridica/form-editar-accionistas.html',
                controller: 'Persona.EditarPersonaJuridica.AccionistasController',
                resolve: {
                    loggedin: function ($q, $timeout, $http, $location, Auth) {
                        return checkUserRole('ver-personas', $q, $timeout, $http, $location, Auth)
                    }
                }
            });
    }
]);


text:
package com.ligadata.filedataprocessor

import java.io.{IOException, File, PrintWriter}
import java.nio.file.{Path, FileSystems}

import com.ligadata.Exceptions.{InternalErrorException, MissingArgumentException}
import org.apache.logging.log4j.{ Logger, LogManager }

/**
 * Created by danielkozin on 9/24/15.
 */
class DirectoryListener {

}

object LocationWatcher {
  lazy val loggerName = this.getClass.getName
  lazy val logger = LogManager.getLogger(loggerName)
  def main (args: Array[String]) : Unit = {

      if (args.size == 0 || args.size > 1) {
        logger.error("Smart File Consumer requires a configuration file as its argument")
        return
      }

      // Read the config and figure out how many consumers to start
      var config = args(0)
      var properties = scala.collection.mutable.Map[String,String]()

      val lines = scala.io.Source.fromFile(config).getLines.toList
      lines.foreach(line => {
        var lProp = line.split("=")
        try {
          properties(lProp(0)) = lProp(1)
        } catch {
          case iobe: IndexOutOfBoundsException => {
            logger.error("SMART FILE CONSUMER: Invalid format in the configuration file " + config)
            logger.error("SMART FILE CONSUMER: unable to determine the value for property " + lProp(0))
            return
          }
        }

      })

      var numberOfProcessors = properties(SmartFileAdapterConstants.NUMBER_OF_FILE_CONSUMERS).toInt
      var processors: Array[FileProcessor] = new Array[FileProcessor](numberOfProcessors)
      var threads: Array[Thread] = new Array[Thread](numberOfProcessors)
      var path: Path= null
      try {
         path = FileSystems.getDefault().getPath(properties(SmartFileAdapterConstants.DIRECTORY_TO_WATCH))
      } catch {
        case e: IOException => {
          println ("Unable to find the directory to watch")
          return
        }
      }

      logger.info("Starting "+ numberOfProcessors+" file consumers, reading from "+ path)
    try {
      for (i <- 1 to numberOfProcessors) {
        var processor = new FileProcessor(path,i)
        processor.init(properties)
        val watch_thread = new Thread(processor)
        watch_thread.start
      }

    } catch {
      case e: Exception => {
        logger.error("ERROR in starting SMART FILE CONSUMER "+ e)
        return
      }
    }
  }
}


text:
struct ContentData
{
    QString DataString;
    QByteArray DataRaw;
    QString ContentType;
    QString FileName;
};

struct PostOptions
{
    QString PrepareStrategy;
    PostOptions();
};

class IPostPrepareStrategyFactory;
class IHttpClient : public QObject
{
    Q_OBJECT
    public:

        explicit IHttpClient(QObject *parent = 0);
        virtual void Get(const QString &url) = 0;
        virtual void Download(const QString &url, const QString &file) = 0;
        virtual void Post(const QString &url, const QHash<QString,QString> & params, const PostOptions & Options = PostOptions()) = 0;
        virtual void Post(const QString &url, const QHash<QString,ContentData> & params, const PostOptions & Options = PostOptions()) = 0;
        virtual bool WasError() = 0;
        virtual QString GetErrorString() = 0;
        virtual QString GetContent() = 0;
        virtual QByteArray GetPageData() = 0;
        virtual QString GetBase64() = 0;
        virtual int GetStatus() = 0;
        virtual QString GetLastUrl() = 0;
        virtual void Connect(QObject *object, const char * slot) = 0;
        virtual void Disconnect() = 0;
        virtual void Stop() = 0;

        virtual QString GetHeader(const QString& header) = 0;
        virtual void AddHeader(const QString& name,const QString& value) = 0;
        virtual void CleanHeader() = 0;
        virtual void SetProxy(const QString& server, int Port, bool IsHttp, const QString& name, const QString& password) = 0;
        virtual QString GetCookiesForUrl(const QString& url) = 0;
        virtual void SetPostPrepareStrategyFactory(IPostPrepareStrategyFactory* PostPrepareStrategyFactory) = 0;
        virtual QString SaveCookies() = 0;
        virtual void RestoreCookies(const QString& cookies) = 0;

    signals:
        void Finished();
        void DownloadProgress(qint64 BytesReceived, qint64 BytesTotal);
    public slots:

};

#endif // IHTTPCLIENT_H


text:
module Fog
  module Network
    class OpenStack
      class Real
        def delete_ipsec_policy(ipsec_policy_id)
          request(
            :expects => 204,
            :method  => 'DELETE',
            :path    => "vpn/ipsecpolicies/#{ipsec_policy_id}"
          )
        end
      end

      class Mock
        def delete_ipsec_policy(ipsec_policy_id)
          response = Excon::Response.new
          if list_ipsec_policies.body['ipsecpolicies'].collect { |r| r['id'] }.include? ipsec_policy_id
            data[:ipsec_policies].delete(ipsec_policy_id)
            response.status = 204
            response
          else
            raise Fog::Network::OpenStack::NotFound
          end
        end
      end
    end
  end
end


text:
package operators

import (
	"vitess.io/vitess/go/vt/sqlparser"
	"vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops"
	"vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext"
)

// Horizon is an operator we use until we decide how to handle the source to the horizon.
// It contains information about the planning we have to do after deciding how we will send the query to the tablets.
type Horizon struct {
	Source ops.Operator
	Select sqlparser.SelectStatement

	noColumns
}

var _ ops.Operator = (*Horizon)(nil)
var _ ops.PhysicalOperator = (*Horizon)(nil)

func (h *Horizon) IPhysical() {}

func (h *Horizon) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.Expr) (ops.Operator, error) {
	newSrc, err := h.Source.AddPredicate(ctx, expr)
	if err != nil {
		return nil, err
	}
	h.Source = newSrc
	return h, nil
}

func (h *Horizon) Clone(inputs []ops.Operator) ops.Operator {
	return &Horizon{
		Source: inputs[0],
		Select: h.Select,
	}
}

func (h *Horizon) Inputs() []ops.Operator {
	return []ops.Operator{h.Source}
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Rhodora 22:29. 1920

#### Original name
null

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/apache-jena-fuseki-2.0.0.iml" filepath="$PROJECT_DIR$/apache-jena-fuseki-2.0.0.iml" />
    </modules>
  </component>
</project>


text:
// Generated by Haxe 3.3.0
#ifndef INCLUDED_haxe_xml_XmlParserException
#define INCLUDED_haxe_xml_XmlParserException

#ifndef HXCPP_H
#include <hxcpp.h>
#endif

HX_DECLARE_CLASS2(haxe,xml,XmlParserException)

namespace haxe{
namespace xml{

class HXCPP_CLASS_ATTRIBUTES XmlParserException_obj : public hx::Object
{
	public:
		typedef hx::Object super;
		typedef XmlParserException_obj OBJ_;
		XmlParserException_obj();

	public:
		void __construct(::String message,::String xml,Int position);
		inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="haxe.xml.XmlParserException")
			{ return hx::Object::operator new(inSize,inContainer,inName); }
		inline void *operator new(size_t inSize, int extra)
			{ return hx::Object::operator new(inSize+extra,true,"haxe.xml.XmlParserException"); }
		static hx::ObjectPtr< XmlParserException_obj > __new(::String message,::String xml,Int position);
		static Dynamic __CreateEmpty();
		static Dynamic __Create(hx::DynamicArray inArgs);
		//~XmlParserException_obj();

		HX_DO_RTTI_ALL;
		hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
		hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp);
		void __GetFields(Array< ::String> &outFields);
		static void __register();
		void __Mark(HX_MARK_PARAMS);
		void __Visit(HX_VISIT_PARAMS);
		::String __ToString() const { return HX_HCSTRING("XmlParserException","\x79","\x27","\xd7","\x6b"); }

		::String message;
		Int lineNumber;
		Int positionAtLine;
		Int position;
		::String xml;
		virtual ::String toString();
		::Dynamic toString_dyn();

};

} // end namespace haxe
} // end namespace xml

#endif /* INCLUDED_haxe_xml_XmlParserException */


text:
package org.estatio.module.capex.dom.bankaccount.verification.transitions;

import java.util.List;

import org.apache.isis.applib.annotation.Mixin;

import org.estatio.module.financial.dom.bankaccount.verification.BankAccountVerificationState;
import org.estatio.module.financial.dom.bankaccount.verification.BankAccountVerificationStateTransition;
import org.estatio.module.financial.dom.bankaccount.verification.BankAccountVerificationStateTransitionType;
import org.estatio.module.task.dom.dobj.DomainObject_viewTransitionsAbstract;
import org.estatio.module.financial.dom.BankAccount;

/**
 * This cannot be inlined (needs to be a mixin) because BankAccount does not know abouts its verification state machine
 */
@Mixin(method = "act")
public class BankAccount_viewVerificationTransitions
        extends DomainObject_viewTransitionsAbstract<
                                BankAccount,
                                BankAccountVerificationStateTransition,
                                BankAccountVerificationStateTransitionType,
                                BankAccountVerificationState> {

    public BankAccount_viewVerificationTransitions(final BankAccount bankAccount) {
        super(bankAccount, BankAccountVerificationStateTransition.class);
    }

    // necessary because Isis' metamodel unable to infer return type from generic method
    @Override
    public List<BankAccountVerificationStateTransition> act() {
        return super.act();
    }
}


text:
require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
require "rails/all"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

module Recruiter
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    config.time_zone = 'Eastern Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    config.i18n.enforce_available_locales = true
    config.i18n.default_locale = :en

    # responders gem
    config.responders.flash_keys = [ :success, :error ]
    config.action_view.field_error_proc = Proc.new { |html_tag, instance|
      "
#{html_tag}
".html_safe
    }
  end
end


text:
package scalax.collection.io.json

/**
 * Error/warning constants and message producing.
 *
 * @author Peter Empen
 */
package object error {
}