text:
require 'defaultDriver.rb'

endpoint_url = ARGV.shift
obj = Soap.new(endpoint_url)

# run ruby with -d to see SOAP wiredumps.
obj.wiredump_dev = STDERR if $DEBUG

# SYNOPSIS
#   login(parameters)
#
# ARGS
#   parameters      Login - {http://api.zuora.com/}login
#
# RETURNS
#   parameters      LoginResponse - {http://api.zuora.com/}loginResponse
#
# RAISES
#   #   fault           LoginFault - {http://fault.api.zuora.com/}LoginFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.login(parameters)

# SYNOPSIS
#   subscribe(parameters)
#
# ARGS
#   parameters      Subscribe - {http://api.zuora.com/}subscribe
#
# RETURNS
#   parameters      SubscribeResponse - {http://api.zuora.com/}subscribeResponse
#
# RAISES
#   #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.subscribe(parameters)

# SYNOPSIS
#   create(parameters)
#
# ARGS
#   parameters      Create - {http://api.zuora.com/}create
#
# RETURNS
#   parameters      CreateResponse - {http://api.zuora.com/}createResponse
#
# RAISES
#   #   fault           InvalidTypeFault - {http://fault.api.zuora.com/}InvalidTypeFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.create(parameters)

# SYNOPSIS
#   generate(parameters)
#
# ARGS
#   parameters      Generate - {http://api.zuora.com/}generate
#
# RETURNS
#   parameters      GenerateResponse - {http://api.zuora.com/}generateResponse
#
# RAISES
#   #   fault           InvalidTypeFault - {http://fault.api.zuora.com/}InvalidTypeFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.generate(parameters)

# SYNOPSIS
#   update(parameters)
#
# ARGS
#   parameters      Update - {http://api.zuora.com/}update
#
# RETURNS
#   parameters      UpdateResponse - {http://api.zuora.com/}updateResponse
#
# RAISES
#   #   fault           InvalidTypeFault - {http://fault.api.zuora.com/}InvalidTypeFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.update(parameters)

# SYNOPSIS
#   delete(parameters)
#
# ARGS
#   parameters      Delete - {http://api.zuora.com/}delete
#
# RETURNS
#   parameters      DeleteResponse - {http://api.zuora.com/}deleteResponse
#
# RAISES
#   #   fault           InvalidTypeFault - {http://fault.api.zuora.com/}InvalidTypeFault, #   fault           InvalidValueFault - {http://fault.api.zuora.com/}InvalidValueFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.delete(parameters)

# SYNOPSIS
#   execute(parameters)
#
# ARGS
#   parameters      Execute - {http://api.zuora.com/}execute
#
# RETURNS
#   parameters      ExecuteResponse - {http://api.zuora.com/}executeResponse
#
# RAISES
#   #   fault           InvalidTypeFault - {http://fault.api.zuora.com/}InvalidTypeFault, #   fault           InvalidValueFault - {http://fault.api.zuora.com/}InvalidValueFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.execute(parameters)

# SYNOPSIS
#   query(parameters)
#
# ARGS
#   parameters      Query - {http://api.zuora.com/}query
#
# RETURNS
#   parameters      QueryResponse - {http://api.zuora.com/}queryResponse
#
# RAISES
#   #   fault           MalformedQueryFault - {http://fault.api.zuora.com/}MalformedQueryFault, #   fault           InvalidQueryLocatorFault - {http://fault.api.zuora.com/}InvalidQueryLocatorFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.query(parameters)

# SYNOPSIS
#   queryMore(parameters)
#
# ARGS
#   parameters      QueryMore - {http://api.zuora.com/}queryMore
#
# RETURNS
#   parameters      QueryMoreResponse - {http://api.zuora.com/}queryMoreResponse
#
# RAISES
#   #   fault           InvalidQueryLocatorFault - {http://fault.api.zuora.com/}InvalidQueryLocatorFault, #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.queryMore(parameters)

# SYNOPSIS
#   getUserInfo(getUserInfo)
#
# ARGS
#   getUserInfo     GetUserInfo - {http://api.zuora.com/}getUserInfo
#
# RETURNS
#   parameters      GetUserInfoResponse - {http://api.zuora.com/}getUserInfoResponse
#
# RAISES
#   #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
getUserInfo = nil
puts obj.getUserInfo(getUserInfo)

# SYNOPSIS
#   amend(parameters)
#
# ARGS
#   parameters      Amend - {http://api.zuora.com/}amend
#
# RETURNS
#   parameters      AmendResponse - {http://api.zuora.com/}amendResponse
#
# RAISES
#   #   fault           UnexpectedErrorFault - {http://fault.api.zuora.com/}UnexpectedErrorFault
#
parameters = nil
puts obj.amend(parameters)


text:
var assert = require('chai').assert;
var expect = require("chai").expect;

var StorageServiceProto = require('../src/server/services/storage.service.js').StorageService;
var EvalServiceProto = require('../src/server/services/eval.service.js').EvaluationService;
var EvaluationProto = require('../src/server/services/eval.service.js').Evaluation;
var QuestionProto = require('../src/server/services/eval.service.js').Question;
var ItemProto = require('../src/server/services/eval.service.js').Item;

StorageService = new StorageServiceProto("mongodb://localhost:32768/MCS");
evalService = new EvalServiceProto(StorageService);

var questions = [];
for(var i=0; i<10; i++){
  var q = new QuestionProto();
  q.name = "question "+i;
  q.description = "question description "+i;
  q.type="score";
  q.postes.push("M1");
  q.postes.push("S1");
  for(var j=0; j<4; j++){
    var item = new ItemProto();
    item.name=" choix "+j;
    item.score=i;
    q.items.push(item);
  }
  questions.push(q);
}

var q = new QuestionProto();
q.name = "question "+i;
q.description = "question description "+i;
q.type="score";
q.postes.push("M2");
questions.push(q);

describe('EvalService', function() {

  describe('#saveEvaluation', function(){

    it('save wrong evaluation object', function(done){
      evalService.saveEvaluation({"fake":"object"}, function(res, err){
        expect(err).to.equal("wrong type");
        done();
      });
    });

    it('save empty evaluation', function(done){
      var eval = new EvaluationProto();
      evalService.saveEvaluation(eval, function(res, err){
        expect(err).to.equal("evaluation not completed");
        done();
      });
    });

  });

  describe('#getQuestions', function(){

    it('get questions for jobs', function(done){
      evalService.loadQuestions(questions, function(res, err){
        expect(res.length).to.equal(questions.length);
        evalService.getQuestionsByPoste("M1", function(results, err){
          expect(results.length).to.equal(10);
          evalService.getQuestionsByPoste("M2", function(a, err){
            expect(a.length).to.equal(1);
            done();
          });
        });
      });
    });

  });

  describe('#loadQuestions()', function (){

    it('load empty array', function (done) {
        var q = [];
        evalService.loadQuestions(q, function(res, err){
          expect(res).to.equal(0);
          done();
        });
    });

    it('load reliable datas', function(done){
      evalService.loadQuestions(questions, function(results, err){
        expect(results.length).to.equal(questions.length);
        done();
      });
    });

    it('load reliable datas twice', function(done){
      evalService.loadQuestions(questions, function(results, err){
        expect(results.length).to.equal(questions.length);
        evalService.loadQuestions(questions, function(results, err){
          expect(results.length).to.equal(questions.length);
          done();
        });
      });
    });

  });
});

redpajama_set_name: RedPajamaGithub


text:
#include <cprocessing/cprocessing.hpp>
using namespace cprocessing;

/**
 * Translate.
 *
 * The translate() function allows objects to be moved
 * to any location within the window. The first parameter
 * sets the x-axis offset and the second parameter sets the
 * y-axis offset.
 */

float x, y;
float dim = 80.0;

void setup() {
  size(640, 360);
  noStroke();
}

void draw() {
  background(102);

  x = x + 0.8;

  if (x > width + dim) {
    x = -dim;
  }

  translate(x, height/2-dim/2);
  fill(255);
  rect(-dim/2, -dim/2, dim, dim);

  // Transforms accumulate. Notice how this rect moves
  // twice as fast as the other, but it has the same
  // parameter for the x-axis value
  translate(x, dim);
  fill(0);
  rect(-dim/2, -dim/2, dim, dim);
}


text:
import fi.evident.dalesbred.Database;

import java.lang.String;

public class EnumConstruction {

    Database db;

    public void enumInstantiation() {
        db.findAll(Foo.class, "select type from foo");
        db.findUnique(Foo.class, "select type from foo");
    }
}

enum Foo {
    Foo, BAR
}


text:
module User::Friend
  def self.included(base)
    base.has_many :friend_requests, -> { includes(:sender) },
                  class_name: "Friend::Request",
                  dependent: :destroy
    base.has_many :friend_acceptances, -> { includes(:target) },
                  class_name: "Friend::Acceptance",
                  dependent: :destroy
    base.has_many :friend_rejections, -> { includes(:target) },
                  class_name: "Friend::Rejection",
                  dependent: :destroy
  end

  # 相手と双方向のフレンドか調べる
  # * target - Userオブジェクトかidのどちらでもよい
  def friend?(target)
    target_id = target.kind_of?(User) ? target.id : target
    friend_acceptances.find_by(target_id: target_id) && friend_requests.find_by(sender_id: target_id)
  end

  # ユーザー側に、フレンド登録されたという情報を送る。
  # 別インスタンスに送る場合を考えて専用メソッドにしている。別インスタンスの場合はスタブのUserクラスの同名メソッドが通信を行う。
  def send_friend_request_from!(sender)
    raise "no sender" unless sender
    friend_requests.create!(:sender_id => sender.id)
  end
  # ユーザー側に、フレンド登録が解消されたという情報を送る。
  # 別インスタンスに送る場合を考えて専用メソッドにしている。別インスタンスの場合はスタブのUserクラスの同名メソッドが通信を行う。
  def cancel_friend_request_from!(sender)
    raise "no sender" unless sender
    r = friend_requests.find_by(sender_id: sender.id)
    r.destroy if r
  end
  # 現時点で双方向に登録されているフレンドユーザーを返す
  def friends
    friend_acceptances.requested.map{|a|a.target}
  end

end


text:
from niprov.dependencies import Dependencies
from niprov.pipeline import Pipeline

class PipelineFactory(object):

    def __init__(self, dependencies=Dependencies()):
        self.files = dependencies.getRepository()

    def forFile(self, image):
        """Create a Pipeline object based on known files 'parents' field.
        """
        filesByLocation = {image.location.toString():image}

        def lookupRelativesRecursive(images, relationToLookFor):
            if relationToLookFor is 'parents':
                parentLocations = set()
                for image in images:
                    parentLocations.update(image.provenance.get('parents',[]))
                relatives = self.files.byLocations(list(parentLocations))
            elif relationToLookFor is 'children':
                thisGenerationLocations = [i.location.toString() for i in images]
                relatives = self.files.byParents(thisGenerationLocations)
            for relative in relatives:
                filesByLocation[relative.location.toString()] = relative
            if relatives:
                lookupRelativesRecursive(relatives, relationToLookFor)

        lookupRelativesRecursive([image], 'parents')
        lookupRelativesRecursive([image], 'children')
        return Pipeline(filesByLocation.values())


text:
import numpy as np

from netCDF4 import Dataset
from scipy.interpolate import griddata

from collections import defaultdict

from shapely.geometry import Point, Polygon

from datetime import datetime

lon_high = 101.866
lon_low = 64.115

lat_high= 33.
lat_low=-6.79

region='western_ghats'

polygon = Polygon(((73.75, 8.75), (70., 22.), (73.75, 22.), (77.75, 8.75)))

numpy_cube=np.load('/nfs/a90/eepdw/Data/Observations/Satellite/GSMAP_Aug_Sep_2011/GSMAP_EMBRACE.npz')

# Load land sea mask.  TRMM land sea mask is in % of water coverage so 100% is all water

nc = Dataset('/nfs/a90/eepdw/Data/Observations/Satellite/TRMM/TMPA_mask.nc')

#  Regrid lsm to data grid (offset b 0.125 degrees

lsm_lons, lsm_lats = np.meshgrid(nc.variables['lon'][:],nc.variables['lat'][:])
lons_data, lats_data = np.meshgrid(numpy_cube['lons'], numpy_cube['lats'])
#lsm_regrid = griddata((lsm_lats.flatten(), lsm_lons.flatten()), nc.variables['landseamask'][:].flatten(), (lats_data,lons_data), method='linear')
lsm_regrid = griddata((lsm_lats.flatten(), lsm_lons.flatten()), nc.variables['landseamask'][:].flatten(), (lats_data,lons_data), method='linear')

#points = np.array([[lat,lon] for lat, lon in zip(lats_data.flatten(), lons_data.flatten())])
points = np.array([[lon,lat] for lon, lat in zip(lons_data.flatten(), lats_data.flatten())])
intersects = np.array(map(polygon.intersects, map(Point, points))).reshape(lons_data.shape)
pcp_dom_2 = numpy_cube['rain_rates'][intersects,:] #  Need to vary between TRMM, CMORPH etc depending on shape of array
lsm = lsm_regrid[intersects]

bad_values=np.ma.masked_array(pcp_dom_2,pcp_dom_2<0.)

print numpy_cube['rain_rates'].shape
print pcp_dom_2.shape
print lsm.shape

####################################################

# Calculate mean for every time in the date range for entire area

#mean_of_each_time = pcp_dom_2.mean(axis=1)
#mean_and_hour=zip(mean_of_each_time,time_hour)

# OCEAN - Calculate mean for every time in the date range

#lsm_weights=lsm/100

#mean_oc = np.ma.average(pcp_dom_2, axis=1, weights=lsm_weights)
#oc_mean_and_hour=zip(mean_oc,time_hour)

# LAND - Calculate mean for every time in the date range

lsm_weights=1-(lsm/100)
mean_la = np.ma.average(bad_values, weights=lsm_weights, axis=0)
#pdb.set_trace()
time_hour =  numpy_cube['time_list'][3]
#pdb.set_trace()
la_mean_and_hour=zip(mean_la.data.flatten(),time_hour)

#####################################################

# Sort into time of day #################

# Total

#i = defaultdict(list)

#for v,k in mean_and_hour:
#    i[k.strip()].append(v)

#mean=[]
#hour=[]

# Average for each time of day

#for q,a in enumerate(i.items()):
    #print a[1]
 #   if a[1]:
#        mean.append(np.mean(a[1]))
#        hour.append(a[0])

#print mean
#print hour

# Land

i = defaultdict(list)

for v,k in la_mean_and_hour:
    i[k].append(v)

mean_l=[]
hour_l=[]

# Average for each time of day

for q,a in enumerate(i.items()):
    #print a[1]
    if a[1]:
        mean_l.append(np.mean(a[1]))
        hour_l.append(a[0])

print mean_l
print hour_l

# Ocean

#i = defaultdict(list)

#for v,k in oc_mean_and_hour:
 #   i[k.strip()].append(v)

#mean_o=[]
#hour_o=[]

      # Average for each time of day

#for q,a in enumerate(i.items()):
    #print a[1]
#    if a[1]:
#        mean_o.append(np.mean(a[1]))
#        hour_o.append(a[0])

#print mean_o
#print hour_o

# Save

#np.savez("/nfs/a90/eepdw/Data/Observations/Satellite/TRMM/Diurnal/total_trmm_diurnal_average_lat_%s_%s_lon_%s_%s_southern_western_indian_ocean" % (lat_low,lat_high, lon_low, lon_high), mean=mean, hour=hour )
#np.savez("/nfs/a90/eepdw/Data/Observations/Satellite/TRMM/Diurnal/sea_trmm_diurnal_average_lat_%s_%s_lon_%s_%s_southern_western_indian_ocean" % (lat_low,lat_high, lon_low, lon_high), mean=mean_o, hour=hour_o )
np.savez("/nfs/a90/eepdw/Data/Observations/Satellite/GSMAP_Aug_Sep_2011/Diurnal/land_gsmap_diurnal_average_%s_polygon" % region , mean=mean_l, hour=hour_l )


text:
var AbstractNode = require('../AbstractNode');

var teoria = require('teoria');

/**
 * A simple detuned saw pair with a sub sine for those lows.
 *
 * @param {AudioContext} ctx
 */

function Bass(ctx) {
  AbstractNode.call(this, ctx);
  this.detuneRatio = 2.053 / 2;

  this.sawOne = this.ctx.createOscillator();
  this.sawTwo = this.ctx.createOscillator();
  this.sub = this.ctx.createOscillator();

  this.sawOne.type = 'sawtooth';
  this.sawTwo.type = 'sawtooth';

  this.sawGain = this.ctx.createGain();
  this.subGain = this.ctx.createGain();

  this.sawGain.gain.value = 0.36;
  this.subGain.gain.value = 0.18;

  this.sawOne.connect(this.sawGain);
  this.sawTwo.connect(this.sawGain);
  this.sub.connect(this.subGain);

  this.sawGain.connect(this.output);
  this.subGain.connect(this.output);
}

Bass.prototype = Object.create(AbstractNode.prototype, {

  start: {
    value: function(when) {
      this.sawOne.start(when);
      this.sawTwo.start(when);
      this.sub.start(when);
    }
  },

  stop: {
    value: function(when) {
      this.sawOne.stop(when);
      this.sawTwo.stop(when);
      this.sub.stop(when);
    }
  },

  play: {
    value: function(bpm, bars, notes, callback) {
      var beats = 4 * bars;
      var duration = (60 / bpm) * beats;
      var interval = duration / notes.length;
      var timeout = window.setTimeout(callback, 1450);

      this.sawOne.onended = function(e) {
        window.clearTimeout(timeout);
        return callback(e);
      };

      // I'm assuming that the first note here is not a rest.
      var fq = teoria.note(notes[0]).fq();
      this.sub.frequency.setValueAtTime(fq, this.ctx.currentTime);
      this.sawOne.frequency.setValueAtTime(fq, this.ctx.currentTime);
      this.sawTwo.frequency.setValueAtTime(
        fq * this.detuneRatio,
        this.ctx.currentTime
      );

      notes.forEach(function(note, i) {
        if (note === '__') {
          return;
        }
        var fq = teoria.note(note).fq();
        var delta = (i + 1) * interval;
        var t = this.ctx.currentTime + delta;

        this.sub.frequency.exponentialRampToValueAtTime(fq, t);
        this.sawOne.frequency.exponentialRampToValueAtTime(fq, t);
        this.sawTwo.frequency.exponentialRampToValueAtTime(
          fq * this.detuneRatio,
          t
        );
      }, this);

      this.start(0);
      this.stop(this.ctx.currentTime + duration);
    }
  }

});

module.exports = Bass;


text:
namespace remoting {

// Extends Chromoting sessions with the ability to record raw frames and
// download them to the client. This can be used to obtain representative
// sequences of frames to run tests against.
class VideoFrameRecorderHostExtension : public HostExtension {
 public:
  VideoFrameRecorderHostExtension();
  ~VideoFrameRecorderHostExtension() override;

  // Sets the maximum number of bytes that each session may record.
  void SetMaxContentBytes(int64_t max_content_bytes);

  // remoting::HostExtension interface.
  std::string capability() const override;
  scoped_ptr<HostExtensionSession> CreateExtensionSession(
      ClientSessionControl* client_session,
      protocol::ClientStub* client_stub) override;

 private:
  int64_t max_content_bytes_;

  DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderHostExtension);
};

}  // namespace remoting

#endif  // REMOTING_HOST_VIDEO_FRAME_RECORDER_HOST_EXTENSION_H_


text:
<?php
// Heading
$_['heading_title']		 = 'LIQPAY';

// Text
$_['text_payment']		 = 'Pagamentos';
$_['text_success']		 = 'LIQPAY modificado com sucesso!';
$_['text_edit']          = 'Configurações do LIQPAY';
$_['text_pay']			 = 'LIQPAY';
$_['text_card']			 = 'Cartão de crédito';
$_['text_liqpay']		 = '<img src="view/image/payment/liqpay.png" alt="LIQPAY" title="LIQPAY" style="border: 1px solid #EEEEEE;" />';

// Entry
$_['entry_merchant']	 = 'Merchant ID';
$_['entry_signature']	 = 'Assinatura';
$_['entry_type']		 = 'Tipo';
$_['entry_total']		 = 'Total mínimo';
$_['entry_order_status'] = 'Situação do pedido';
$_['entry_geo_zone']	 = 'Região geográfica';
$_['entry_status']       = 'Situação';
$_['entry_sort_order']   = 'Posição';

// Help
$_['help_total']		 = 'O valor mínimo que o pedido deve alcançar para que o LIQPAY seja oferecido como opção de pagamento ao cliente.';

// Error
$_['error_permission']   = 'Atenção: Você não tem permissão para modificar a extensão de pagamento LIQPAY!';
$_['error_merchant']	 = 'O Merchant ID é obrigatório!';
$_['error_signature']	 = 'A assinatura é obrigatória!';


text:
module WebexApi
  class MeetingRequest < WebexApi::Request

    def initialize(client)
      super(client)

    end
    def create_meeting(conf_name,options={})
      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.meeting.CreateMeeting'){
          xml.metaData{
            xml.confName conf_name
          }
          if options[:meeting_password] != nil && options[:meeting_password].strip != ''
            xml.accessControl{
              xml.meetingPassword options[:meeting_password]
            }
          end
          xml.schedule{
            if options[:scheduled_date]
              xml.startDate options[:scheduled_date].utc.strftime("%m/%d/%Y %T") rescue nil
              # xml.timeZoneID 4
            else
              xml.startDate
            end
            xml.duration(options[:duration].to_i)
          }
          if options[:emails]
            xml.participants{
              xml.attendees{
                options[:emails].each do |email|
                  xml.attendee {
                    xml.emailInvitations true
                    xml.person {
                      xml.email email
                    }
                  }
                end
              }
            }
          end
        }
      end
      perform_request(body)

    end

    def get_meeting(meeting_key)
      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GetMeeting'){
          xml.meetingKey meeting_key
        }
      end
      begin
        perform_request(body)
      rescue WebexApi::WebexError
        nil
      end
    end

    def get_host_meeting_url(meeting_key)
      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GethosturlMeeting'){
          xml.sessionKey meeting_key
        }
      end
      perform_request(body)
    end

    def get_join_meeting_url(meeting_key)
      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GetjoinurlMeeting'){
          xml.sessionKey meeting_key
        }
      end
      perform_request(body)
    end

    def delete_meeting(meeting_key)
      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.DelMeeting'){
          xml.meetingKey meeting_key
        }
      end
      perform_request(body)

    end

    def add_attendee(meeting_key,email,options={})
       body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.CreateMeetingAttendee'){
          xml.person{
            if options[:name]
              xml.name options[:name]
            end

              xml.address {
                xml.addressType options[:address_type] || "PERSONAL"
              }

            xml.email email
            xml.type options[:type] || "VISITOR"
          }
          xml.role options[:role] || "ATTENDEE"
          xml.sessionKey meeting_key
          xml.emailInvitations options[:email_invitation] || "FALSE"
        }
      end
      perform_request(body)
    end

    def delete_attendee(meeting_key,email)
       body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.DelMeetingAttendee'){
          xml.attendeeEmail {
            xml.email email
            xml.sessionKey meeting_key
          }
        }
      end
      perform_request(body)
    end

    def list_attendees(meeting_key)

      body = webex_xml_request(@client.webex_email) do |xml|
        xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.LstMeetingAttendee'){
          xml.meetingKey meeting_key

        }
      end
      perform_request(body)
    end

  end
end


text:
<?php

namespace League\Route\Strategy;

use League\Route\Http\Exception as HttpException;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;

class MethodArgumentStrategy extends AbstractStrategy implements StrategyInterface
{
    /**
     * {@inheritdoc}
     */
    public function dispatch($controller, array $vars)
    {
        if (is_array($controller)) {
            $controller = [
                $this->container->get($controller[0]),
                $controller[1]
            ];
        }

        $response = $this->container->call($controller);

        return $this->determineResponse($response);
    }
}


text:
#include "registry.h"

#include <map>
#include <string>

Registry &Registry::getInstance() {
    static Registry instance;
    return instance;
}

void Registry::hit(std::string s) {
    auto search = _hits.find(s);
    if (search != _hits.end()) {
        search->second = search->second + 1;
    } else {
        _hits.insert(std::make_pair(s, 1));
    }
    ++_totalHits;
}

int Registry::getHits(std::string s) const {
    auto search = _hits.find(s);
    if (search != _hits.end()) {
        return search->second;
    } else {
        return 0;
    }
}

int Registry::getTotalHits() const {
    return _totalHits;
}

void Registry::reset() {
    _hits.clear();
    _totalHits = 0;
}

Registry::Registry() {
    reset();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_gallery"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.android.rahul.myselfieapp.Activity.GalleryActivity">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_gravity="bottom|right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat="@android:drawable/ic_menu_camera"/>
</FrameLayout>


text:
module.exports = {

  /**
   * Variable rules
   * @see http://eslint.org/docs/rules/#variables
   */
  rules: {

    /**
     * Require or disallow initialization in variable declarations
     * @see http://eslint.org/docs/rules/init-declarations
     */
    'init-declarations': [ 'off', 'always' ],

    /**
     * Disallow catch clause parameters from shadowing variables in the outer scope
     * @see http://eslint.org/docs/rules/no-catch-shadow
     */
    'no-catch-shadow': 'error',

    /**
     * Disallow deleting variables
     * @see http://eslint.org/docs/rules/no-delete-var
     */
    'no-delete-var': 'error',

    /**
     * Disallow labels that share a name with a variable
     * @see http://eslint.org/docs/rules/no-label-var
     */
    'no-label-var': 'error',

    /**
     * Disallow specified global variables
     * @see http://eslint.org/docs/rules/no-restricted-globals
     */
    'no-restricted-globals': 'off',

    /**
     * Disallow identifiers from shadowing restricted names
     * @see http://eslint.org/docs/rules/no-shadow-restricted-names
     */
    'no-shadow-restricted-names': 'error',

    /**
     * Disallow variable declarations from shadowing variables declared in the outer scope
     * @see http://eslint.org/docs/rules/no-shadow
     */
    'no-shadow': [ 'error', {
      builtinGlobals: false,
      hoist: 'functions',
      allow: []
    }],

    /**
     * Disallow initializing variables to undefined
     * @see http://eslint.org/docs/rules/no-undef-init
     * @fixable
     */
    'no-undef-init': 'error',

    /**
     * Disallow the use of undeclared variables unless mentioned in /* global * / comments
     * @see http://eslint.org/docs/rules/no-undef
     */
    'no-undef': 'error',

    /**
     * Disallow the use of undefined as an identifier
     * @see http://eslint.org/docs/rules/no-undefined
     */
    'no-undefined': 'error',

    /**
     * Disallow unused variables
     * @see http://eslint.org/docs/rules/no-unused-vars
     */
    'no-unused-vars': [ 'error', {
      caughtErrors: 'all',
      args: 'after-used',
      vars: 'all'
    }],

    /**
     * Disallow the use of variables before they are defined
     * @see http://eslint.org/docs/rules/no-use-before-define
     */
    'no-use-before-define': [ 'error', {
      functions: false,
      variables: true,
      classes: true
    }]
  }
}


text:
export default function middlewares() {
    return [function* (next) {
        if (this.querystring.length > 0) {
            this.state.reduxStore.dispatch({
                type: 'CLICKED'
            });
        }
        yield next;
    }, function* (next) {
        if (this.querystring.length > 0) {
            this.state.reduxStore.dispatch({
                type: 'CLICKED'
            });
        }
        yield next;
    }];
}


text:
package com.github.katjahahn.tools.anomalies;

import static org.testng.Assert.*;

import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.github.katjahahn.TestreportsReader;
import com.github.katjahahn.parser.HeaderKey;
import com.github.katjahahn.parser.optheader.WindowsEntryKey;
import com.github.katjahahn.parser.sections.SectionHeaderKey;

public class PEAnomalyScannerTest {

    //TODO use the new subtypes for tests instead of description strings

    @SuppressWarnings("unused")
    private static final Logger logger = LogManager
            .getLogger(PEAnomalyScannerTest.class.getName());
    private static final String RESOURCE_FOLDER = TestreportsReader.RESOURCE_DIR;
    private static final String TEST_FILE_PATH = RESOURCE_FOLDER + TestreportsReader.TEST_FILE_DIR;
    public static final String UNUSUAL_FOLDER = RESOURCE_FOLDER;
    private List<Anomaly> tinyAnomalies;
    private List<Anomaly> maxSecXPAnomalies;
    private List<Anomaly> sectionlessAnomalies;
    private List<Anomaly> dupe;
    private List<Anomaly> zeroImageBase;

    @BeforeClass
    public void prepare() {
        File file = Paths.get(TEST_FILE_PATH, "smallest-pe.exe").toFile();
        PEAnomalyScanner scanner = PEAnomalyScanner.newInstance(file);
        tinyAnomalies = scanner.getAnomalies();
        file = Paths.get(RESOURCE_FOLDER, "corkami", "maxsecXP.exe").toFile();
        scanner = PEAnomalyScanner.newInstance(file);
        maxSecXPAnomalies = scanner.getAnomalies();
        file = Paths.get(RESOURCE_FOLDER, "corkami", "nosectionXP.exe").toFile();
        scanner = PEAnomalyScanner.newInstance(file);
        sectionlessAnomalies = scanner.getAnomalies();
        file = Paths.get(RESOURCE_FOLDER, "corkami", "dupsec.exe")
                .toFile();
        scanner = PEAnomalyScanner.newInstance(file);
        dupe = scanner.getAnomalies();
        file = Paths.get(RESOURCE_FOLDER, "corkami", "ibnullXP.exe")
                .toFile();
        scanner = PEAnomalyScanner.newInstance(file);
        zeroImageBase = scanner.getAnomalies();
    }

    @Test
    public void collapsedOptionalHeader() throws IOException {
        performTest(tinyAnomalies, AnomalyType.STRUCTURE,
                "Collapsed Optional Header");
    }

    private void performTest(List<Anomaly> anomalies, HeaderKey key,
            String... descriptions) {
        for (String description : descriptions) {
            boolean containsDescription = false;
            for (Anomaly anomaly : filterByKey(key, anomalies)) {
                if (anomaly.description().contains(description)) {
                    containsDescription = true;
                    break;
                }
            }
            assertTrue(containsDescription);
        }
    }

    private List<Anomaly> filterByKey(HeaderKey key, List<Anomaly> anomalies) {
        List<Anomaly> list = new ArrayList<>();
        for (Anomaly anomaly : anomalies) {
            FieldOrStructureKey aKey = anomaly.key();
            if (key != null) {
                if (key.equals(aKey)) {
                    list.add(anomaly);
                }
            }
        }
        return list;
    }

    private void performTest(List<Anomaly> anomalies, AnomalyType type,
            String description) {
        boolean containsType = false;
        for (Anomaly anomaly : anomalies) {
            if (anomaly.getType() == type
                    && anomaly.description().contains(description)) {
                containsType = true;
                break;
            }
        }
        assertTrue(containsType);
    }

    @Test
    public void collapsedMSDOSHeader() {
        performTest(tinyAnomalies, AnomalyType.STRUCTURE,
                "Collapsed MSDOS Header");
    }

    @Test
    public void noDataDirs() {
        performTest(tinyAnomalies, AnomalyType.STRUCTURE, "No data directory");
        performTest(tinyAnomalies, AnomalyType.NON_DEFAULT,
                "NumberOfRVAAndSizes");
    }

    @Test
    public void sectionNrAnomaly() {
        File file = Paths.get(RESOURCE_FOLDER, "corkami", "maxsecXP.exe")
                .toFile();
        PEAnomalyScanner scanner = PEAnomalyScanner.newInstance(file);
        List<Anomaly> anomalies = scanner.getAnomalies();
        performTest(anomalies, AnomalyType.STRUCTURE, "Section Number");
    }

    @Test
    public void deprecated() {
        performTest(maxSecXPAnomalies, AnomalyType.DEPRECATED,
                "POINTER_TO_LINE_NUMBERS");
        performTest(maxSecXPAnomalies, AnomalyType.DEPRECATED,
                "IMAGE_SCN_TYPE_NO_PAD");
    }

    @Test
    public void fileAlignment() {
        performTest(tinyAnomalies, WindowsEntryKey.FILE_ALIGNMENT,
                "File Alignment must be between 0x200 and 0xFA00 (64 K)");
        performTest(sectionlessAnomalies, WindowsEntryKey.FILE_ALIGNMENT,
                "File Alignment must be between 0x200 and 0xFA00 (64 K)");
    }

    @Test
    public void unusualSectionNames() {
        File file = Paths.get(TEST_FILE_PATH,
                "6fdfdffeb4b1be2d0036bac49cb0d590").toFile();
        PEAnomalyScanner scanner = PEAnomalyScanner.newInstance(file);
        List<Anomaly> anomalies = scanner.getAnomalies();
        performTest(anomalies, SectionHeaderKey.NAME,
                "control symbols in name", "name is unusual");
    }

    @Test
    public void sectionAlignment() {
        // TODO add something like: performTest(maxSecXPAnomalies, AnomalyType.WRONG, "Size of Image");
        // but need to find such sample first, samples below have low alignment mode which seems a valid reason for no alignment?
        performTest(maxSecXPAnomalies, AnomalyType.NON_DEFAULT, "Size of Headers");
        performTest(sectionlessAnomalies, AnomalyType.NON_DEFAULT, "Size of Headers");
    }

    @Test
    public void overlappingSections() {
        performTest(dupe, AnomalyType.STRUCTURE, "same physical location as");
        // TODO overlap
        // TODO use customized section table structure --> section table
        // factory?
    }

    @Test
    public void imageBaseConstraints() {
        String description = "image base is 0";
        performTest(zeroImageBase, AnomalyType.NON_DEFAULT, description);
    }

}


text:
<?php

    namespace NRtworks\GlobalUtilsFunctionsBundle\Services;

    use Doctrine\ORM\EntityManager;

class APIGetData extends \Symfony\Component\DependencyInjection\ContainerAware{

   protected $em;
   protected $error;
   protected $BusinessDimension;
   protected $Subscription;

    public function __construct(EntityManager $em)
    {
        $this->em = $em;
        $this->error = "Unidentified error";
        $this->BusinessDimension = array("ChartOfAccounts","Account","BusinessUnit","FiscalYear","Period","Version","Cycle","Currency","CurrencyValuation","Campaign");
        $this->Subscription = array("Usertype","icousers","Customer");
    }

    protected function getRepository($bundle = "BusinessDimension",$dimension)
    {
        $string = "NRtworks".$bundle."Bundle:".$dimension;
        Try
        {
            return $this->em->getRepository($string);
        }
        Catch(Exception $e)
        {
            return "Requested entity is unknown";
        }
    }

    // the following returns the bundle name of a dimension/entity
    public function whichBundle($entity)
    {
        if(in_array($entity,$this->BusinessDimension))
        {
            return "BusinessDimension";
        }
        elseif(in_array($entity,$this->Subscription))
        {
            return "Subscription";
        }
        else
        {
            return "none";
        }
    }

    public function buildWhereClause($whereArray)
    {
        $where = "";
        $i = 0;
        //\Doctrine\Common\Util\Debug::dump($whereArray);
        foreach($whereArray as $key=>$value)
        {

            if($i != 0){$where = $where.' AND ';}
            if(is_array($value))
            {
                $where = $where . 'e.'.$key.' '.$value["operator"].' \''.$value["value"].'\'';
            }
            else
            {
                $where = $where . 'e.'.$key.' = \''.$value.'\'';
            }
            $i++;
            //echo $where;
        }

        return $where;
    }

    public function requestSimpleByArray($bundle,$dimension,$array)
    {
        $repo = $this->getRepository($bundle,$dimension);
        $result = $repo->findBy($array);
        return $result;
    }

    public function requestAll($bundle,$dimension)
    {
        $repo = $this->getRepository($bundle,$dimension);
        $result = $repo->findAll();
        return $result;
    }

    public function requestById($bundle,$dimension,$id)
    {
        $repo = $this->getRepository($bundle,$dimension);
        $result = $repo->find($id);
        //\Doctrine\Common\Util\Debug::dump($result);
        return $result;
    }

    public function requestQuery($bundle,$dimension,$whereArray,$orderBy = "id",$order = "ASC")
    {
       $repo = $this->getRepository($bundle,$dimension);

       $whereClause = $this->buildWhereClause($whereArray);

        $query = $this->em->createQuery(
            'SELECT e
            FROM NRtworks'.$bundle.'Bundle:'.$dimension.' e
            WHERE '.$whereClause.'
            ORDER BY e.'.$orderBy.' '.$order.''
        );
        //\Doctrine\Common\Util\Debug::dump($query);
       return $result = $query->getResult();
    }

    public function requestBySQLQuery($bundle,$dimension,$field,$value,$operator,$orderBy = "id",$order = "ASC")
    {

    }

    //end of class
}

?>


text:
package codeine.mail;

import java.util.Date;
import java.util.List;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import org.apache.log4j.Logger;

import codeine.configuration.EmailConfiguration;

public class SendMailTLS {

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

    public static void mail(String subject, String content, List<String> recipients, final EmailConfiguration conf)
    {
	Properties props = new Properties();
	props.put("mail.smtp.auth", conf.mail_smtp_auth);
	props.put("mail.smtp.starttls.enable", conf.mail_smtp_starttls_enable);
	props.put("mail.smtp.host", conf.mail_smtp_host);
	props.put("mail.smtp.port", conf.mail_smtp_port);

	Session session = Session.getInstance(props,
		new javax.mail.Authenticator() {
	    @Override
		protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(conf.username, conf.password);
	    }
	});

	try {

	    Message message = new MimeMessage(session);
	    message.setFrom(new InternetAddress(conf.username));
	    InternetAddress[] address = buildAdresses(recipients);
	    message.setRecipients(Message.RecipientType.TO, address);
	    message.setSubject(subject);
	    message.setSentDate(new Date());
	    message.setText(content);
	    log.info("Mail subject '" + subject + "' is sent to recipients: " + recipients);
	    if (System.getProperty("nomail") == null)
	    {
		Transport.send(message);
	    }
	} catch (MessagingException e) {
	    throw new RuntimeException(e);
	}
    }

    private static InternetAddress[] buildAdresses(List<String> recipients) throws AddressException
    {
	InternetAddress[] address = new InternetAddress[recipients.size()];
	for (int i = 0; i < address.length; i++)
	{
	    address[i] = InternetAddress.parse(recipients.get(i))[0];
	}
	return address;
    }

	public static void mail(Mail mail, EmailConfiguration email_configuration) {
		mail(mail.subject(), mail.content(), mail.recipients(), email_configuration);
	}
}


text:
docker
======

[![Build Status](https://img.shields.io/travis/marvinpinto/ansible-role-docker/master.svg?style=flat-square)](https://travis-ci.org/marvinpinto/ansible-role-docker)
[![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-docker-blue.svg?style=flat-square)](https://galaxy.ansible.com/marvinpinto/docker)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.txt)

This Ansible role enables people to install the latest Docker on an Ubuntu-like
system. It also provides a handy library function to validate that the Docker
daemon is running and functional.

Requirements
------------

This role will only work on an Ubuntu-like system.

Role Variables
--------------

```yaml
# Any additional docker service options
# Example: '--dns 8.8.8.8 --dns 8.8.4.4 --userns-remap=default'
# docker_additional_service_opts: |
#   {
#     "userns-remap": "default",
#     "dns": [
#       "8.8.8.8",
#       "8.8.4.4"
#     ]
#   }
docker_additional_service_opts: |
  {}
```

Examples
--------

Install this module from Ansible Galaxy into the './roles' directory:
```bash
ansible-galaxy install marvinpinto.docker -p ./roles
```

Use it in a playbook as follows:
```yaml
- hosts: 'servers'
  roles:
    - role: 'marvinpinto.docker'
      become: true
  tasks:
    - name: 'Ensure that the docker daemon is functional'
      become: true
      docker_ping:
      retries: 5
      delay: 10
      until: result|success
    - name: 'hello world'
      docker:
        name: 'helloworld'
        image: 'hello-world'
        state: 'started'
```


text:
package com.christiangp.monzoapi.model.response;

import com.squareup.moshi.Json;

public final class ExchangeAuthorizationResponse {

    @Json(name = "access_token")
    private String accessToken;

    @Json(name = "client_id")
    private String clientId;

    @Json(name = "expires_in")
    private long   expiresIn;

    @Json(name = "refresh_token")
    private String refreshToken;

    @Json(name = "token_type")
    private String tokenType;

    @Json(name = "user_id")
    private String userId;

    public String getAccessToken() {
        return accessToken;
    }

    public String getClientId() {
        return clientId;
    }

    public long getExpiresIn() {
        return expiresIn;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public String getTokenType() {
        return tokenType;
    }

    public String getUserId() {
        return userId;
    }
}


text:
package tech.aroma.data.sql;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.RowMapper;
import tech.sirwellington.alchemy.annotations.arguments.NonEmpty;
import tech.sirwellington.alchemy.annotations.arguments.Required;

/**
 * Responsible for saving and retrieving Aroma objects to/from the Database.
 *
 * @author SirWellington
 */
public interface DatabaseSerializer<T> extends RowMapper<T>
{
    /**
     * Saves the object to the Database.
     *
     * @param object    The Object to save.
     * @param statement The SQL Statement to use when calling the database.
     * @param database  The database to write to.
     */
    void save(@Required T object,
              @Required @NonEmpty String statement,
              @Required JdbcOperations database) throws SQLException;

    /**
     * Deserializes Aroma objects from a {@link ResultSet}.
     *
     * @param row The result set to extract data from
     * @return An Aroma object representation from the
     * @throws SQLException
     */
    T deserialize(@Required ResultSet row) throws SQLException;

    @Override
    default T mapRow(ResultSet rs, int rowNum) throws SQLException
    {
        return deserialize(rs);
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b52-fcs
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2007.03.21 at 10:56:51 AM CDT
//

package org.apache.axis2.jaxws.description.xml.handler;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 * The persistence-context-typeType specifies the transactional nature of a persistence context
 * reference.
 *

 * The value of the persistence-context-type element must be one of the following: Transaction
 * Extended
 *

 *

 *

 *
Java class for persistence-context-typeType complex type.
 *

 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <complexType name="persistence-context-typeType">
 *   <simpleContent>
 *     <restriction base="<http://java.sun.com/xml/ns/javaee>string">
 *     </restriction>
 *   </simpleContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "persistence-context-typeType")
public class PersistenceContextTypeType
        extends String {

}


text:
.class public final enum Lcom/baidu/mobads/GifAnimView$GifImageType;
.super Ljava/lang/Enum;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/baidu/mobads/GifAnimView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4019
    name = "GifImageType"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Enum",
        "<",
        "Lcom/baidu/mobads/GifAnimView$GifImageType;",
        ">;"
    }
.end annotation

# static fields
.field public static final enum COVER:Lcom/baidu/mobads/GifAnimView$GifImageType;

.field public static final enum SYNC_DECODER:Lcom/baidu/mobads/GifAnimView$GifImageType;

.field public static final enum WAIT_FINISH:Lcom/baidu/mobads/GifAnimView$GifImageType;

.field private static final synthetic b:[Lcom/baidu/mobads/GifAnimView$GifImageType;

# instance fields
.field final a:I

# direct methods
.method static constructor <clinit>()V
    .locals 5

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    new-instance v0, Lcom/baidu/mobads/GifAnimView$GifImageType;

    const-string v1, "WAIT_FINISH"

    invoke-direct {v0, v1, v2, v2}, Lcom/baidu/mobads/GifAnimView$GifImageType;-><init>(Ljava/lang/String;II)V

    sput-object v0, Lcom/baidu/mobads/GifAnimView$GifImageType;->WAIT_FINISH:Lcom/baidu/mobads/GifAnimView$GifImageType;

    new-instance v0, Lcom/baidu/mobads/GifAnimView$GifImageType;

    const-string v1, "SYNC_DECODER"

    invoke-direct {v0, v1, v3, v3}, Lcom/baidu/mobads/GifAnimView$GifImageType;-><init>(Ljava/lang/String;II)V

    sput-object v0, Lcom/baidu/mobads/GifAnimView$GifImageType;->SYNC_DECODER:Lcom/baidu/mobads/GifAnimView$GifImageType;

    new-instance v0, Lcom/baidu/mobads/GifAnimView$GifImageType;

    const-string v1, "COVER"

    invoke-direct {v0, v1, v4, v4}, Lcom/baidu/mobads/GifAnimView$GifImageType;-><init>(Ljava/lang/String;II)V

    sput-object v0, Lcom/baidu/mobads/GifAnimView$GifImageType;->COVER:Lcom/baidu/mobads/GifAnimView$GifImageType;

    const/4 v0, 0x3

    new-array v0, v0, [Lcom/baidu/mobads/GifAnimView$GifImageType;

    sget-object v1, Lcom/baidu/mobads/GifAnimView$GifImageType;->WAIT_FINISH:Lcom/baidu/mobads/GifAnimView$GifImageType;

    aput-object v1, v0, v2

    sget-object v1, Lcom/baidu/mobads/GifAnimView$GifImageType;->SYNC_DECODER:Lcom/baidu/mobads/GifAnimView$GifImageType;

    aput-object v1, v0, v3

    sget-object v1, Lcom/baidu/mobads/GifAnimView$GifImageType;->COVER:Lcom/baidu/mobads/GifAnimView$GifImageType;

    aput-object v1, v0, v4

    sput-object v0, Lcom/baidu/mobads/GifAnimView$GifImageType;->b:[Lcom/baidu/mobads/GifAnimView$GifImageType;

    return-void
.end method

.method private constructor <init>(Ljava/lang/String;II)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)V"
        }
    .end annotation

    invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V

    iput p3, p0, Lcom/baidu/mobads/GifAnimView$GifImageType;->a:I

    return-void
.end method

.method public static valueOf(Ljava/lang/String;)Lcom/baidu/mobads/GifAnimView$GifImageType;
    .locals 1

    const-class v0, Lcom/baidu/mobads/GifAnimView$GifImageType;

    invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;

    move-result-object v0

    check-cast v0, Lcom/baidu/mobads/GifAnimView$GifImageType;

    return-object v0
.end method

.method public static values()[Lcom/baidu/mobads/GifAnimView$GifImageType;
    .locals 1

    sget-object v0, Lcom/baidu/mobads/GifAnimView$GifImageType;->b:[Lcom/baidu/mobads/GifAnimView$GifImageType;

    invoke-virtual {v0}, [Lcom/baidu/mobads/GifAnimView$GifImageType;->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/baidu/mobads/GifAnimView$GifImageType;

    return-object v0
.end method


text:
/*
 * Created on 14 fevr. 2004
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package com.foc.gui;

import javax.swing.*;
import java.awt.event.*;

import javax.swing.text.*;

import com.foc.*;
import com.foc.desc.field.*;
import com.foc.property.*;

/**
 * @author Standard
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class FDateField_my extends JTextField implements FocusListener, ActionListener, FPropertyListener {

  private FProperty objectProperty = null;
  private DateDocument dateDocument = null;
  private int maxYear = 2100;

  public FDateField_my() {
    objectProperty = null;
  }

  public FDateField_my(FProperty objProp) throws Exception {
    super();
    setColumns(10);
    if (objProp != null) {
      FField focField = objProp.getFocField();
      setText(objProp.getString());

      objectProperty = objProp;
      this.addFocusListener(this);
      this.addActionListener(this);
      objectProperty.addListener(this);
    }
  }

  public int getMaxYear() {
    return maxYear;
  }

  private void updateObjectPropertyValue() {
    try {
      if (objectProperty != null) {
        objectProperty.setString(getText());
        Globals.logString(getText());
      }
    } catch (Exception exception) {
      Globals.logException(exception);
    }
  }

  // FocusListener
  // -------------
  public void focusGained(FocusEvent e) {

  }

  public void focusLost(FocusEvent e) {
    updateObjectPropertyValue();
  }

  // -------------

  // ActionListener
  // --------------
  public void actionPerformed(ActionEvent e) {
    updateObjectPropertyValue();
  }

  // --------------

  // PropertyListener
  // ----------------
  public void propertyModified(FProperty property) {
    if (objectProperty != null) {
      setText(objectProperty.getString());
    }
  }

  // ----------------

  protected Document createDefaultModel() {
    dateDocument = new DateDocument(this);
    return dateDocument;
  }

  static class DateDocument extends PlainDocument {
    FDateField_my fTextFld = null;

    public DateDocument(FDateField_my fTextFld) {
      this.fTextFld = fTextFld;
    }

    public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
      if (str != null && fTextFld != null) {
        char[] chars = str.toCharArray();
        int decal = 0;
        String prevString = fTextFld.getText();
        char[] prevChars = prevString.toCharArray();

        String newString = str;
        char[] newChars = new char[10];
        int newIdx = 0;

        for (int idx = 0; idx < chars.length; idx++) {
          if (offs + idx == 0 && Integer.parseInt(new String(chars, idx, 1)) > 3) break;

          if (offs + idx == 1) {
            int a0 = 0;
            int a1 = 0;
            if (offs == 0) {
              a0 = Integer.parseInt(new String(chars, 0, 1));
              a1 = Integer.parseInt(new String(chars, 1, 1));
            } else {
              a0 = Integer.parseInt(new String(prevChars, 0, 1));
              a1 = Integer.parseInt(new String(chars, 0, 1));
            }

            int day = a0 * 10 + a1;

            if (day > 31) break;
          }

          if (offs + idx == 2) {
            if (chars[idx] != '/') {
              decal++;
              newChars[newIdx++] = '/';
            }
          }

          if (offs + idx + decal == 3 && Integer.parseInt(new String(chars, idx, 1)) > 1) break;

          if (offs + idx + decal == 4) {
            int a0 = 0;
            int a1 = 0;
            if (offs <= 3) {
              a0 = Integer.parseInt(new String(chars, 3 - (offs + decal), 1));
            } else {
              a0 = Integer.parseInt(new String(prevChars, 3, 1));
            }

            a1 = Integer.parseInt(new String(chars, 4 - (offs + decal), 1));

            int month = a0 * 10 + a1;
            if (month > 12) break;
          }

          if (offs + idx + decal == 5) {
            if (chars[idx] != '/') {
              decal++;
              newChars[newIdx++] = '/';
            }
          }

          if (offs + idx + decal > 5) {
            int a0 = 0;
            int a1 = 0;
            int a2 = 0;
            int a3 = 0;

            if (offs <= 6) {
              a0 = Integer.parseInt(new String(chars, 6 - (offs + decal), 1));
            } else {
              a0 = Integer.parseInt(new String(prevChars, 6, 1));
            }

            if (offs + idx + decal > 6) {
              if (offs <= 7) {
                a1 = Integer.parseInt(new String(chars, 7 - (offs + decal), 1));
              } else {
                a1 = Integer.parseInt(new String(prevChars, 7, 1));
              }
            }

            if (offs + idx + decal > 7) {
              if (offs <= 8) {
                a2 = Integer.parseInt(new String(chars, 8 - (offs + decal), 1));
              } else {
                a2 = Integer.parseInt(new String(prevChars, 8, 1));
              }
            }

            if (offs + idx + decal > 8) {
              if (offs <= 9) {
                a2 = Integer.parseInt(new String(chars, 9 - (offs + decal), 1));
              } else {
                a2 = Integer.parseInt(new String(prevChars, 9, 1));
              }
            }

            int year = a0 * 1000 + a1 * 100 + a2 * 10 + a3;
            if (year > fTextFld.getMaxYear()) break;
          }

          newChars[newIdx++] = chars[idx];
        }

        super.insertString(offs, new String(newChars, 0, newIdx), a);
      }
    }
  }

  /* (non-Javadoc)
   * @see b01.foc.property.FPropertyListener#dispose()
   */
  public void dispose() {
  }
}


text:
module TestLauncher
  VERSION = "2.27.0"
end


text:
package writer

import (
	"context"
	"fmt"
	"os"
	"path/filepath"
	"time"

	"github.com/Jeffail/benthos/v3/internal/batch/policy"
	"github.com/Jeffail/benthos/v3/internal/bloblang/field"
	"github.com/Jeffail/benthos/v3/internal/component"
	"github.com/Jeffail/benthos/v3/internal/component/metrics"
	"github.com/Jeffail/benthos/v3/internal/interop"
	"github.com/Jeffail/benthos/v3/internal/log"
	"github.com/Jeffail/benthos/v3/internal/message"
	"github.com/colinmarc/hdfs"
)

//------------------------------------------------------------------------------

// HDFSConfig contains configuration fields for the HDFS output type.
type HDFSConfig struct {
	Hosts       []string      `json:"hosts" yaml:"hosts"`
	User        string        `json:"user" yaml:"user"`
	Directory   string        `json:"directory" yaml:"directory"`
	Path        string        `json:"path" yaml:"path"`
	MaxInFlight int           `json:"max_in_flight" yaml:"max_in_flight"`
	Batching    policy.Config `json:"batching" yaml:"batching"`
}

// NewHDFSConfig creates a new Config with default values.
func NewHDFSConfig() HDFSConfig {
	return HDFSConfig{
		Hosts:       []string{},
		User:        "",
		Directory:   "",
		Path:        `${!count("files")}-${!timestamp_unix_nano()}.txt`,
		MaxInFlight: 1,
		Batching:    policy.NewConfig(),
	}
}

//------------------------------------------------------------------------------

// HDFS is a benthos writer.Type implementation that writes messages to a
// HDFS directory.
type HDFS struct {
	conf HDFSConfig

	path *field.Expression

	client *hdfs.Client

	log   log.Modular
	stats metrics.Type
}

// NewHDFSV2 creates a new HDFS writer.Type.
func NewHDFSV2(
	conf HDFSConfig,
	mgr interop.Manager,
	log log.Modular,
	stats metrics.Type,
) (*HDFS, error) {
	path, err := mgr.BloblEnvironment().NewField(conf.Path)
	if err != nil {
		return nil, fmt.Errorf("failed to parse path expression: %v", err)
	}
	return &HDFS{
		conf:  conf,
		path:  path,
		log:   log,
		stats: stats,
	}, nil
}

// ConnectWithContext attempts to establish a connection to the target HDFS
// host.
func (h *HDFS) ConnectWithContext(ctx context.Context) error {
	return h.Connect()
}

// Connect attempts to establish a connection to the target HDFS host.
func (h *HDFS) Connect() error {
	if h.client != nil {
		return nil
	}

	client, err := hdfs.NewClient(hdfs.ClientOptions{
		Addresses: h.conf.Hosts,
		User:      h.conf.User,
	})
	if err != nil {
		return err
	}

	h.client = client

	h.log.Infof("Writing message parts as files to HDFS directory: %v\n", h.conf.Directory)
	return nil
}

// WriteWithContext attempts to write message contents to a target HDFS
// directory as files.
func (h *HDFS) WriteWithContext(ctx context.Context, msg *message.Batch) error {
	return h.Write(msg)
}

// Write attempts to write message contents to a target HDFS directory as files.
func (h *HDFS) Write(msg *message.Batch) error {
	if h.client == nil {
		return component.ErrNotConnected
	}

	return IterateBatchedSend(msg, func(i int, p *message.Part) error {
		path := h.path.String(i, msg)
		filePath := filepath.Join(h.conf.Directory, path)

		err := h.client.MkdirAll(h.conf.Directory, os.ModeDir|0o644)
		if err != nil {
			return err
		}

		fw, err := h.client.Create(filePath)
		if err != nil {
			return err
		}

		if _, err := fw.Write(p.Get()); err != nil {
			return err
		}
		fw.Close()
		return nil
	})
}

// CloseAsync begins cleaning up resources used by this reader asynchronously.
func (h *HDFS) CloseAsync() {
}

// WaitForClose will block until either the reader is closed or a specified
// timeout occurs.
func (h *HDFS) WaitForClose(time.Duration) error {
	return nil
}

//------------------------------------------------------------------------------


text:
package net.wendal.nutzbook.core.bean;

import java.io.Serializable;
import java.util.List;

import org.nutz.dao.entity.annotation.*;

@Table("t_user")
@Comment("用户表")
public class User extends BasePojo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id(auto=false)
	@Prev(els=@EL("ig(view.tableName)"))
	@Comment("用户编号")
	protected long id;
	@Name
	@Column
	@Comment("用户名")
	protected String name;
	@Column("passwd")
	@ColDefine(width=128)
	@Comment("用户密码")
	protected String password;
	@Column
	@Comment("盐")
	protected String salt;
	@Column
	@Comment("是否锁定")
	protected boolean locked;
	@ManyMany(from="u_id", relation="t_user_role", target=Role.class, to="role_id")
	protected List<Role> roles;
	@ManyMany(from="u_id", relation="t_user_permission", target=Permission.class, to="permission_id")
	protected List<Permission> permissions;
	@One(target=UserProfile.class, field="id", key="userId")
	protected UserProfile profile;

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getSalt() {
		return salt;
	}
	public void setSalt(String salt) {
		this.salt = salt;
	}

	public boolean isLocked() {
		return locked;
	}
	public void setLocked(boolean locked) {
		this.locked = locked;
	}
	public List<Role> getRoles() {
		return roles;
	}
	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}
	public List<Permission> getPermissions() {
		return permissions;
	}
	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}
	public UserProfile getProfile() {
		return profile;
	}
	public void setProfile(UserProfile profile) {
		this.profile = profile;
	}
}


text:
class H5Writer {
  public:
    H5Writer() : primed_(false) {}
    ~H5Writer();

    void init(const std::string& fname, int num_bootstrap, int num_processed, uint compression,
        size_t index_version, const std::string& shell_call,
        const std::string& start_time);

    void write_main(const EMAlgorithm& em,
        const std::vector<std::string>& targ_ids,
        const std::vector<int>& lengths);

    void write_bootstrap(const EMAlgorithm& em, int bs_id);

  private:
    bool primed_;

    int num_bootstrap_;
    uint compression_;

    hid_t file_id_;
    hid_t root_;
    hid_t aux_;
    hid_t bs_;
};

class H5Converter {
  public:
    // assumes 'out_dir' is already
    H5Converter(const std::string& h5_fname, const std::string& out_dir);
    ~H5Converter();

    void write_aux();
    void convert();

  private:
    void rw_from_counts(hid_t group_id, const std::string& count_name,
        const std::string& out_fname);

    std::string out_dir_;

    // run info
    std::string kal_version_;
    size_t idx_version_;
    std::string start_time_;
    std::string call_;

    // auxilary
    std::vector<std::string> targ_ids_;
    std::vector<int> lengths_;
    std::vector<double> eff_lengths_;

    // buffers used for every single read/write
    std::vector<int> kal_id_;
    std::vector<double> alpha_buf_;
    std::vector<double> tpm_buf_;

    hid_t file_id_;
    hid_t root_;
    hid_t aux_;
    hid_t bs_;

    int n_bs_;
    int n_proc_;
    size_t n_targs_;
};

#endif // KALLISTO_H5WRITER_H


text:
<?xml version="1.0" encoding="utf-8" ?>
<Moc-Config>
	<MOC MOC_NAME="MRSSipRecScheduleTask" Module="MRS" ACCESS_CONTROL="add,delete,modify,read" DEST_SVC="custom:ubp_mrs_moc:CreateModule:before" FILTER="">
		<Parameter name="RangeID" desc="区间ID" type="int" range="[1,2147483647]" constrain="PRI" FK="FK:DRUR:MRSRecRangeList:ID" mode="display" />
		<Parameter name="Name" desc="计划描述" type="string" range="[0,512]" mode="update" />
		<Parameter name="ScheduleType" desc="计划类型" type="enum" range="0,1,2" vlist="0:一段时间,1:每天固定时段,2:全录" constrain="NOT NULL" control="0:BeginTime|EndTime,1:BeginTime|EndTime,2:" mode="update" />
		<Parameter name="BeginTime" desc="开始时间" type="string" range="[1,64]" mode="update" />
		<Parameter name="EndTime" desc="结束时间" type="string" range="[1,64]" mode="update" />
		<Parameter name="RecType" desc="录制类型" type="bitset" range="" vlist="1:录音,2:视频点呼录音,4:录像" constrain="NOT NULL" mode="update" default="3" />
	</MOC>
</Moc-Config>


text:
<?php

namespace Propel\Generator\Model;

use Propel\Generator\Config\GeneratorConfigInterface;
use Propel\Generator\Exception\EngineException;
use Propel\Generator\Exception\InvalidArgumentException;
use Propel\Generator\Platform\PlatformInterface;

/**
 * A class for holding application data structures.
 *
 * @author Hans Lellelid <hans@xmpl.org> (Propel)
 * @author Leon Messerschmidt <leon@opticode.co.za> (Torque)
 * @author John McNally<jmcnally@collab.net> (Torque)
 * @author Martin Poeschl<mpoeschl@marmot.at> (Torque)
 * @author Daniel Rall<dlr@collab.net> (Torque)
 * @author Byron Foster <byron_foster@yahoo.com> (Torque)
 * @author Hugo Hamon <webmaster@apprendre-php.com> (Propel)
 */
class Database extends ScopedMappingModel
{

    use BehaviorableTrait;

    /**
     * The database's platform.
     *
     * @var PlatformInterface
     */
    private $platform;

    /**
     * @var Table[]
     */
    private $tables;

    /**
     * @var string
     */
    private $name;

    private $baseClass;
    private $defaultIdMethod;
    private $defaultPhpNamingMethod;

    /**
     * The default accessor visibility.
     *
     * It may be one of public, private and protected.
     *
     * @var string
     */
    private $defaultAccessorVisibility;

    /**
     * The default mutator visibility.
     *
     * It may be one of public, private and protected.
     *
     * @var string
     */
    private $defaultMutatorVisibility;
    private $domainMap;
    private $heavyIndexing;

    /** @var Schema */
    private $parentSchema;

    /**
     * @var Table[]
     */
    private $tablesByName;

    /**
     * @var Table[]
     */
    private $tablesByLowercaseName;

    /**
     * @var Table[]
     */
    private $tablesByPhpName;

    /**
     * @var string[]
     */
    private $sequences;

    protected $defaultStringFormat;
    protected $tablePrefix;

    /**
     * Constructs a new Database object.
     *
     * @param string            $name     The database's name
     * @param PlatformInterface $platform The database's platform
     */
    public function __construct($name = null, PlatformInterface $platform = null)
    {
        parent::__construct();

        if (null !== $name) {
            $this->setName($name);
        }

        if (null !== $platform) {
            $this->setPlatform($platform);
        }

        $this->heavyIndexing             = false;
        $this->defaultPhpNamingMethod    = NameGeneratorInterface::CONV_METHOD_UNDERSCORE;
        $this->defaultIdMethod           = IdMethod::NATIVE;
        $this->defaultStringFormat       = static::DEFAULT_STRING_FORMAT;
        $this->defaultAccessorVisibility = static::VISIBILITY_PUBLIC;
        $this->defaultMutatorVisibility  = static::VISIBILITY_PUBLIC;
        $this->behaviors                 = [];
        $this->domainMap                 = [];
        $this->tables                    = [];
        $this->tablesByName              = [];
        $this->tablesByPhpName           = [];
        $this->tablesByLowercaseName     = [];
    }

    protected function setupObject()
    {
        parent::setupObject();

        $this->name = $this->getAttribute('name');
        $this->baseClass = $this->getAttribute('baseClass');
        $this->defaultIdMethod = $this->getAttribute('defaultIdMethod', IdMethod::NATIVE);
        $this->defaultPhpNamingMethod = $this->getAttribute('defaultPhpNamingMethod', NameGeneratorInterface::CONV_METHOD_UNDERSCORE);
        $this->heavyIndexing = $this->booleanValue($this->getAttribute('heavyIndexing'));
        $this->tablePrefix = $this->getAttribute('tablePrefix', $this->getBuildProperty('tablePrefix'));
        $this->defaultStringFormat = $this->getAttribute('defaultStringFormat', static::DEFAULT_STRING_FORMAT);
    }

    /**
     * Returns the PlatformInterface implementation for this database.
     *
     * @return PlatformInterface
     */
    public function getPlatform()
    {
        return $this->platform;
    }

    /**
     * Sets the PlatformInterface implementation for this database.
     *
     * @param PlatformInterface $platform A Platform implementation
     */
    public function setPlatform(PlatformInterface $platform = null)
    {
        $this->platform = $platform;
    }

    /**
     * Returns the max column name's length.
     *
     * @return integer
     */
    public function getMaxColumnNameLength()
    {
        return $this->platform->getMaxColumnNameLength();
    }

    /**
     * Returns the database name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Sets the database name.
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Returns the name of the base super class inherited by active record
     * objects. This parameter is overridden at the table level.
     *
     * @return string
     */
    public function getBaseClass()
    {
        return $this->baseClass;
    }

    /**
     * Sets the name of the base super class inherited by active record objects.
     * This parameter is overridden at the table level.
     *
     * @param string $class.
     */
    public function setBaseClass($class)
    {
        $this->baseClass = $class;
    }

    /**
     * Returns the name of the default ID method strategy.
     * This parameter can be overridden at the table level.
     *
     * @return string
     */
    public function getDefaultIdMethod()
    {
        return $this->defaultIdMethod;
    }

    /**
     * Sets the name of the default ID method strategy.
     * This parameter can be overridden at the table level.
     *
     * @param string $strategy
     */
    public function setDefaultIdMethod($strategy)
    {
        $this->defaultIdMethod = $strategy;
    }

    /**
     * Returns the name of the default PHP naming method strategy, which
     * specifies the method for converting schema names for table and column to
     * PHP names. This parameter can be overridden at the table layer.
     *
     * @return string
     */
    public function getDefaultPhpNamingMethod()
    {
        return $this->defaultPhpNamingMethod;
    }

    /**
     * Sets name of the default PHP naming method strategy.
     *
     * @param string $strategy
     */
    public function setDefaultPhpNamingMethod($strategy)
    {
        $this->defaultPhpNamingMethod = $strategy;
    }

    /**
     * Returns the list of supported string formats
     *
     * @return array
     */
    public static function getSupportedStringFormats()
    {
        return [ 'XML', 'YAML', 'JSON', 'CSV' ];
    }

    /**
     * Sets the default string format for ActiveRecord objects in this table.
     * This parameter can be overridden at the table level.
     *
     * Any of 'XML', 'YAML', 'JSON', or 'CSV'.
     *
     * @param  string                   $format
     * @throws InvalidArgumentException
     */
    public function setDefaultStringFormat($format)
    {
        $formats = static::getSupportedStringFormats();

        $format = strtoupper($format);
        if (!in_array($format, $formats)) {
            throw new InvalidArgumentException(sprintf('Given "%s" default string format is not supported. Only "%s" are valid string formats.', $format, implode(', ', $formats)));
        }

        $this->defaultStringFormat = $format;
    }

    /**
     * Returns the default string format for ActiveRecord objects in this table.
     * This parameter can be overridden at the table level.
     *
     * @return string
     */
    public function getDefaultStringFormat()
    {
        return $this->defaultStringFormat;
    }

    /**
     * Returns whether or not heavy indexing is enabled.
     *
     * This is an alias for getHeavyIndexing().
     *
     * @return boolean
     */
    public function isHeavyIndexing()
    {
        return $this->getHeavyIndexing();
    }

    /**
     * Returns whether or not heavy indexing is enabled.
     *
     * This is an alias for isHeavyIndexing().
     *
     * @return boolean
     */
    public function getHeavyIndexing()
    {
        return $this->heavyIndexing;
    }

    /**
     * Sets whether or not heavy indexing is enabled.
     *
     * @param boolean $flag
     */
    public function setHeavyIndexing($flag = true)
    {
        $this->heavyIndexing = (Boolean) $flag;
    }

    /**
     * Return the list of all tables.
     *
     * @return Table[]
     */
    public function getTables()
    {
        return $this->tables;
    }

    /**
     * Return the number of tables in the database.
     *
     * Read-only tables are excluded from the count.
     *
     * @return integer
     */
    public function countTables()
    {
        $count = 0;
        foreach ($this->tables as $table) {
            if (!$table->isReadOnly()) {
                $count++;
            }
        }

        return $count;
    }

    /**
     * Returns the list of all tables that have a SQL representation.
     *
     * @return Table[]
     */
    public function getTablesForSql()
    {
        $tables = [];
        foreach ($this->tables as $table) {
            if (!$table->isSkipSql()) {
                $tables[] = $table;
            }
        }

        return $tables;
    }

    /**
     * Returns whether or not the database has a table.
     *
     * @param  string  $name
     * @param  boolean $caseInsensitive
     * @return boolean
     */
    public function hasTable($name, $caseInsensitive = false)
    {
        if ($caseInsensitive) {
            return isset($this->tablesByLowercaseName[ strtolower($name) ]);
        }

        return isset($this->tablesByName[$name]);
    }

    /**
     * Returns the table with the specified name.
     *
     * @param  string  $name
     * @param  boolean $caseInsensitive
     * @return Table
     */
    public function getTable($name, $caseInsensitive = false)
    {
        if ($this->getSchema() && $this->getPlatform()->supportsSchemas()
            && false === strpos($name, $this->getPlatform()->getSchemaDelimiter())) {
            $name = $this->getSchema() . $this->getPlatform()->getSchemaDelimiter() . $name;
        }

        if (!$this->hasTable($name, $caseInsensitive)) {
            return null;
        }

        if ($caseInsensitive) {
            return $this->tablesByLowercaseName[strtolower($name)];
        }

        return $this->tablesByName[$name];
    }

    /**
     * Returns whether or not the database has a table identified by its
     * PHP name.
     *
     * @param  string  $phpName
     * @return boolean
     */
    public function hasTableByPhpName($phpName)
    {
        return isset($this->tablesByPhpName[$phpName]);
    }

    /**
     * Returns the table object with the specified PHP name.
     *
     * @param  string $phpName
     * @return Table
     */
    public function getTableByPhpName($phpName)
    {
        if (isset($this->tablesByPhpName[$phpName])) {
            return $this->tablesByPhpName[$phpName];
        }

        return null; // just to be explicit
    }

    /**
     * Adds a new table to this database.
     *
     * @param  Table|array $table
     * @return Table
     */
    public function addTable($table)
    {
        if (!$table instanceof Table) {
            $tbl = new Table();
            $tbl->setDatabase($this);
            $tbl->setSchema($this->getSchema());
            $tbl->loadMapping($table);

            return $this->addTable($tbl);
        }

        $table->setDatabase($this);

        if (isset($this->tablesByName[$table->getName()])) {
            throw new EngineException(sprintf('Table "%s" declared twice', $table->getName()));
        }

        if (null === $table->getSchema()) {
            $table->setSchema($this->getSchema());
        }

        $this->tables[] = $table;
        $this->tablesByName[$table->getName()] = $table;
        $this->tablesByLowercaseName[strtolower($table->getName())] = $table;
        $this->tablesByPhpName[$table->getPhpName()] = $table;

        $this->computeTableNamespace($table);

        if (null === $table->getPackage()) {
            $table->setPackage($this->getPackage());
        }

        return $table;
    }

    /**
     * Adds several tables at once.
     *
     * @param Table[] $tables An array of Table instances
     */
    public function addTables(array $tables)
    {
        foreach ($tables as $table) {
            $this->addTable($table);
        }
    }

    /**
     * @param string[] $sequences
     */
    public function setSequences($sequences)
    {
        $this->sequences = $sequences;
    }

    /**
     * @return string[]
     */
    public function getSequences()
    {
        return $this->sequences;
    }

    /**
     * @param string $sequence
     */
    public function addSequence($sequence)
    {
        $this->sequences[] = $sequence;
    }

    /**
     * @param string $sequence
     */
    public function removeSequence($sequence)
    {
        if ($this->sequences) {
            if (false !== ($idx = array_search($sequence, $this->sequences))) {
                unset($this->sequence[$idx]);
            }
        }
    }

    /**
     * @param  string $sequence
     * @return bool
     */
    public function hasSequence($sequence)
    {
        return $this->sequences && in_array($sequence, $this->sequences);
    }

    /**
     * Returns the schema delimiter character.
     *
     * For example, the dot character with mysql when
     * naming tables. For instance: schema.the_table.
     *
     * @return string
     */
    public function getSchemaDelimiter()
    {
        return $this->platform->getSchemaDelimiter();
    }

    /**
     * Sets the database's schema.
     *
     * @param string $schema
     */
    public function setSchema($schema)
    {
        $oldSchema = $this->schema;
        if ($this->schema !== $schema && $this->getPlatform()) {
            $schemaDelimiter = $this->getPlatform()->getSchemaDelimiter();
            $fixHash = function(&$array) use ($schema, $oldSchema, $schemaDelimiter) {
                foreach ($array as $k => $v) {
                    if ($schema && $this->getPlatform()->supportsSchemas()) {
                        if (false === strpos($k, $schemaDelimiter)) {
                            $array[$schema . $schemaDelimiter . $k] = $v;
                            unset($array[$k]);
                        }
                    } elseif ($oldSchema) {
                        if (false !== strpos($k, $schemaDelimiter)) {
                            $array[explode($schemaDelimiter, $k)[1]] = $v;
                            unset($array[$k]);
                        }
                    }
                }
            };

            $fixHash($this->tablesByName);
            $fixHash($this->tablesByLowercaseName);
        }
        parent::setSchema($schema);
    }

    /**
     * Computes the table namespace based on the current relative or
     * absolute table namespace and the database namespace.
     *
     * @param  Table  $table
     * @return string
     */
    private function computeTableNamespace(Table $table)
    {
        $namespace = $table->getNamespace();
        if ($this->isAbsoluteNamespace($namespace)) {
            $namespace = ltrim($namespace, '\\');
            $table->setNamespace($namespace);

            return $namespace;
        }

        if ($namespace = $this->getNamespace()) {
            if ($table->getNamespace()) {
                $namespace .= '\\'.$table->getNamespace();
            }

            $table->setNamespace($namespace);
        }

        return $namespace;
    }

    /**
     * Sets the parent schema
     *
     * @param Schema $parent The parent schema
     */
    public function setParentSchema(Schema $parent)
    {
        $this->parentSchema = $parent;
    }

    /**
     * Returns the parent schema
     *
     * @return Schema
     */
    public function getParentSchema()
    {
        return $this->parentSchema;
    }

    /**
     * Adds a domain object to this database.
     *
     * @param  Domain|array $data
     * @return Domain
     */
    public function addDomain($data)
    {
        if ($data instanceof Domain) {
            $domain = $data; // alias
            $domain->setDatabase($this);
            $this->domainMap[$domain->getName()] = $domain;

            return $domain;
        }

        $domain = new Domain();
        $domain->setDatabase($this);
        $domain->loadMapping($data);

        return $this->addDomain($domain); // call self w/ different param
    }

    /**
     * Returns the already configured domain object by its name.
     *
     * @param  string $name
     * @return Domain
     */
    public function getDomain($name)
    {
        if (isset($this->domainMap[$name])) {
            return $this->domainMap[$name];
        }

        return null;
    }

    /**
     * Returns the GeneratorConfigInterface object.
     *
     * @return GeneratorConfigInterface
     */
    public function getGeneratorConfig()
    {
        if ($this->parentSchema) {
            return $this->parentSchema->getGeneratorConfig();
        }
    }

    /**
     * Returns the build property identified by its name.
     *
     * @param  string $name
     * @return string
     */
    public function getBuildProperty($name)
    {
        if ($config = $this->getGeneratorConfig()) {
            return $config->getBuildProperty($name);
        }
    }

    /**
     * Returns the table prefix for this database.
     *
     * @return string
     */
    public function getTablePrefix()
    {
        return $this->tablePrefix;
    }

    /**
     * Sets the tables' prefix.
     *
     * @param string $tablePrefix
     */
    public function setTablePrefix($tablePrefix)
    {
        $this->tablePrefix = $tablePrefix;
    }

    /**
     * Returns the next behavior on all tables, ordered by behavior priority,
     * and skipping the ones that were already executed.
     *
     * @return Behavior
     */
    public function getNextTableBehavior()
    {
        // order the behaviors according to Behavior::$tableModificationOrder
        $behaviors = [];
        $nextBehavior = null;
        foreach ($this->tables as $table) {
            foreach ($table->getBehaviors() as $behavior) {
                if (!$behavior->isTableModified()) {
                    $behaviors[$behavior->getTableModificationOrder()][] = $behavior;
                }
            }
        }
        ksort($behaviors);
        if (count($behaviors)) {
            $nextBehavior = $behaviors[key($behaviors)][0];
        }

        return $nextBehavior;
    }

    /**
     * Finalizes the setup process.
     *
     */
    public function doFinalInitialization()
    {
        // add the referrers for the foreign keys
        $this->setupTableReferrers();

        // add default behaviors to database
        if ($defaultBehaviors = $this->getBuildProperty('behaviorDefault')) {
            // add generic behaviors from build.properties
            $defaultBehaviors = explode(',', $defaultBehaviors);
            foreach ($defaultBehaviors as $behavior) {
                $this->addBehavior([ 'name' => trim($behavior) ]);
            }
        }

        // execute database behaviors
        foreach ($this->getBehaviors() as $behavior) {
            $behavior->modifyDatabase();
        }

        // execute table behaviors (may add new tables and new behaviors)
        while ($behavior = $this->getNextTableBehavior()) {
            $behavior->getTableModifier()->modifyTable();
            $behavior->setTableModified(true);
        }

        // do naming and heavy indexing
        foreach ($this->tables as $table) {
            $table->doFinalInitialization();
            // setup referrers again, since final initialization may have added columns
            $table->setupReferrers(true);
        }
    }

    protected function registerBehavior(Behavior $behavior)
    {
        $behavior->setDatabase($this);
    }

    /**
     * Setups all table referrers.
     *
     */
    protected function setupTableReferrers()
    {
        foreach ($this->tables as $table) {
            $table->doNaming();
            $table->setupReferrers();
        }
    }

    public function __toString()
    {
        $tables = [];
        foreach ($this->getTables() as $table) {
            $columns = [];
            foreach ($table->getColumns() as $column) {
                $columns[] = sprintf("      %s %s %s %s %s %s (%s)",
                    $column->getName(),
                    $column->getType(),
                    $column->getSize(),
                    $column->isPrimaryKey() ? 'PK' : '',
                    $column->isNotNull() ? 'NOT NULL' : '',
                    $column->getDefaultValueString() ? "'".$column->getDefaultValueString()."'" : '',
                    $column->isAutoIncrement() ? 'AUTO_INCREMENT' : '',
                    $column->getDomain()->getOriginSqlType()
                );
            }

            $fks = [];
            foreach ($table->getForeignKeys() as $fk) {
                $fks[] = sprintf("      %s (%s => %s)",
                    $fk->getName(),
                    join(', ', $fk->getLocalColumns()),
                    join(', ', $fk->getForeignColumns())
                );
            }

            $indices = [];
            foreach ($table->getIndices() as $index) {
                $indices[] = sprintf("      %s (%s)",
                    $index->getName(),
                    join(', ', $index->getColumns())
                );
            }

            $unices = [];
            foreach ($table->getUnices() as $index) {
                $unices[] = sprintf("      %s (%s)",
                    $index->getName(),
                    join(', ', $index->getColumns())
                );
            }

            $tableDef = sprintf("  %s (%s):\n%s",
                $table->getName(),
                $table->getCommonName(),
                implode("\n", $columns)
            );

            if ($fks) {
                $tableDef .= "\n    FKs:\n" . implode("\n", $fks);
            }

            if ($indices) {
                $tableDef .= "\n    indices:\n" . implode("\n", $indices);
            }

            if ($unices) {
                $tableDef .= "\n    unices:\n". implode("\n", $unices);
            }

            $tables[] = $tableDef;
        }

        return sprintf("%s:\n%s",
            $this->getName() . ($this->getSchema() ? '.'. $this->getSchema() : ''),
            implode("\n", $tables)
        );
    }

    /**
     * Sets the default accessor visibility.
     *
     * @param string $defaultAccessorVisibility
     */
    public function setDefaultAccessorVisibility($defaultAccessorVisibility)
    {
        $this->defaultAccessorVisibility = $defaultAccessorVisibility;
    }

    /**
     * Returns the default accessor visibility.
     *
     * @return string
     */
    public function getDefaultAccessorVisibility()
    {
        return $this->defaultAccessorVisibility;
    }

    /**
     * Sets the default mutator visibility.
     *
     * @param string $defaultMutatorVisibility
     */
    public function setDefaultMutatorVisibility($defaultMutatorVisibility)
    {
        $this->defaultMutatorVisibility = $defaultMutatorVisibility;
    }

    /**
     * Returns the default mutator visibility.
     *
     * @return string
     */
    public function getDefaultMutatorVisibility()
    {
        return $this->defaultMutatorVisibility;
    }
}


text:
var expect = require("chai").expect;
var math = require("../public/javascript/decorator.js");

describe("computer", function(){
    describe("screen", function(){
        it("Should add 200 to the price when the upgrade option is selected", function()
        {
            var price = 200 + 1000;
            expect(price).to.equal(1200);
        });

    });
    describe("drive", function(){
        it("Should add 200 to the price when the upgrade option is selected", function()
        {
            var price = 200 + 1000;
            expect(price).to.equal(1200);
        });

    });
    describe("memory", function(){
        it("Should add 200 to the price when the upgrade option is selected", function()
        {
            var price = 200 + 1000;
            expect(price).to.equal(1200);
        });

    });

});


text:
package org.apache.maven;

import java.io.File;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Signals a collision of two or more projects with the same g:a:v during a reactor build.
 *
 * @author Benjamin Bentmann
 */
public class DuplicateProjectException
    extends MavenExecutionException
{

    private Map<String, List<File>> collisions;

    /**
     * Creates a new exception with specified details.
     *
     * @param message The message text, may be {@code null}.
     * @param collisions The POM files of the projects that collided, indexed by their g:a:v, may be {@code null}.
     */
    public DuplicateProjectException( String message, Map<String, List<File>> collisions )
    {
        super( message, (File) null );

        this.collisions = ( collisions != null ) ? collisions : new LinkedHashMap<String, List<File>>();
    }

    /**
     * Gets the POM files of the projects that collided.
     *
     * @return The POM files of the projects that collided, indexed by their g:a:v, never {@code null}.
     */
    public Map<String, List<File>> getCollisions()
    {
        return collisions;
    }

}


text:
export default function getDisplayName(Comp) {
  return Comp.displayName || Comp.name || 'Component';
}


text:
<?php

abstract class AbstractGamePage
{
	/**
	 * reference of the template object
	 * @var template
	 */
	protected $tplObj;

	/**
	 * reference of the template object
	 * @var ResourceUpdate
	 */
	protected $ecoObj;
	protected $window;
	protected $disableEcoSystem = false;

	protected function __construct() {

		if(!AJAX_REQUEST)
		{
			$this->setWindow('full');
			if(!$this->disableEcoSystem)
			{
				$this->ecoObj	= new ResourceUpdate();
				$this->ecoObj->CalcResource();
			}
			$this->initTemplate();
		} else {
			$this->setWindow('ajax');
		}
	}

	protected function initTemplate() {
		if(isset($this->tplObj))
			return true;

		$this->tplObj	= new template;
		list($tplDir)	= $this->tplObj->getTemplateDir();
		$this->tplObj->setTemplateDir($tplDir.'game/');
		return true;
	}

	protected function setWindow($window) {
		$this->window	= $window;
	}

	protected function getWindow() {
		return $this->window;
	}

	protected function getQueryString() {
		$queryString	= array();
		$page			= HTTP::_GP('page', '');

		if(!empty($page)) {
			$queryString['page']	= $page;
		}

		$mode			= HTTP::_GP('mode', '');
		if(!empty($mode)) {
			$queryString['mode']	= $mode;
		}

		return http_build_query($queryString);
	}

	protected function getCronjobsTodo()
	{
		require_once 'includes/classes/Cronjob.class.php';

		$this->assign(array(
			'cronjobs'		=> Cronjob::getNeedTodoExecutedJobs()
		));
	}

	protected function getNavigationData()
	{
		global $PLANET, $LNG, $USER, $THEME, $resource, $reslist;

		$config			= Config::get();

		$PlanetSelect	= array();

		if(isset($USER['PLANETS'])) {
			$USER['PLANETS']	= getPlanets($USER);
		}

		foreach($USER['PLANETS'] as $PlanetQuery)
		{
			if($THEME->skininfo['name'] !== 'nui'){
			$PlanetSelect[$PlanetQuery['id']]	= $PlanetQuery['name'].(($PlanetQuery['planet_type'] == 3) ? " (" . $LNG['fcm_moon'] . ")":"")." [".$PlanetQuery['galaxy'].":".$PlanetQuery['system'].":".$PlanetQuery['planet']."]";
			}else{
			$PlanetSelect[$PlanetQuery['id']] = array();
			$PlanetSelect[$PlanetQuery['id']]['name']	= $PlanetQuery['name'].(($PlanetQuery['planet_type'] == 3) ? " (" . $LNG['fcm_moon'] . ")":"")."<br> [".$PlanetQuery['galaxy'].":".$PlanetQuery['system'].":".$PlanetQuery['planet']."]";
			$PlanetSelect[$PlanetQuery['id']]['pic'] = $PlanetQuery['image'];
			$PlanetSelect[$PlanetQuery['id']]['build'] = $PlanetQuery['b_building'];
			$PlanetSelect[$PlanetQuery['id']]['buildi'] = unserialize($PlanetQuery['b_building_id']);
			}
		}

		$resourceTable	= array();
		$resourceSpeed	= $config->resource_multiplier;
		foreach($reslist['resstype'][1] as $resourceID)
		{
			$resourceTable[$resourceID]['name']			= $resource[$resourceID];
			$resourceTable[$resourceID]['current']		= $PLANET[$resource[$resourceID]];
			$resourceTable[$resourceID]['max']			= $PLANET[$resource[$resourceID].'_max'];
			if($USER['urlaubs_modus'] == 1 || $PLANET['planet_type'] != 1)
			{
				$resourceTable[$resourceID]['production']	= $PLANET[$resource[$resourceID].'_perhour'];
			}
			else
			{
				$resourceTable[$resourceID]['production']	= $PLANET[$resource[$resourceID].'_perhour'] + $config->{$resource[$resourceID].'_basic_income'} * $resourceSpeed;
			}
		}

		foreach($reslist['resstype'][2] as $resourceID)
		{
			$resourceTable[$resourceID]['name']			= $resource[$resourceID];
			$resourceTable[$resourceID]['used']			= $PLANET[$resource[$resourceID].'_used'];
			$resourceTable[$resourceID]['max']			= $PLANET[$resource[$resourceID]];
		}

		foreach($reslist['resstype'][3] as $resourceID)
		{
			$resourceTable[$resourceID]['name']			= $resource[$resourceID];
			$resourceTable[$resourceID]['current']		= $USER[$resource[$resourceID]];
		}

		$themeSettings	= $THEME->getStyleSettings();

		$this->assign(array(
			'PlanetSelect'		=> $PlanetSelect,
			'new_message' 		=> $USER['messages'],
			'vacation'			=> $USER['urlaubs_modus'] ? _date($LNG['php_tdformat'], $USER['urlaubs_until'], $USER['timezone']) : false,
			'delete'			=> $USER['db_deaktjava'] ? sprintf($LNG['tn_delete_mode'], _date($LNG['php_tdformat'], $USER['db_deaktjava'] + ($config->del_user_manually * 86400)), $USER['timezone']) : false,
			'darkmatter'		=> $USER['darkmatter'],
			'current_pid'		=> $PLANET['id'],
			'image'				=> $PLANET['image'],
			'resourceTable'		=> $resourceTable,
			'shortlyNumber'		=> $themeSettings['TOPNAV_SHORTLY_NUMBER'],
			'closed'			=> !$config->game_disable,
			'hasBoard'			=> filter_var($config->forum_url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED),
			'hasAdminAccess'	=> !empty(Session::load()->adminAccess),
			'hasGate'			=> $PLANET[$resource[43]] > 0
		));
	}

	protected function getPageData()
	{
		global $USER, $THEME;

		if($this->getWindow() === 'full') {
			$this->getNavigationData();
			$this->getCronjobsTodo();
		}

		$dateTimeServer		= new DateTime("now");
		if(isset($USER['timezone'])) {
			try {
				$dateTimeUser	= new DateTime("now", new DateTimeZone($USER['timezone']));
			} catch (Exception $e) {
				$dateTimeUser	= $dateTimeServer;
			}
		} else {
			$dateTimeUser	= $dateTimeServer;
		}

		$config	= Config::get();

		$this->assign(array(
			'vmode'				=> $USER['urlaubs_modus'],
			'authlevel'			=> $USER['authlevel'],
			'userID'			=> $USER['id'],
			'bodyclass'			=> $this->getWindow(),
			'game_name'			=> $config->game_name,
			'uni_name'			=> $config->uni_name,
			'ga_active'			=> $config->ga_active,
			'ga_key'			=> $config->ga_key,
			'debug'				=> $config->debug,
			'VERSION'			=> $config->VERSION,
			'date'				=> explode("|", date('Y\|n\|j\|G\|i\|s\|Z', TIMESTAMP)),
			'isPlayerCardActive' => isModuleAvailable(MODULE_PLAYERCARD),
			'REV'				=> substr($config->VERSION, -4),
			'Offset'			=> $dateTimeUser->getOffset() - $dateTimeServer->getOffset(),
			'queryString'		=> $this->getQueryString(),
			'themeSettings'		=> $THEME->getStyleSettings(),
		));
	}
	protected function printMessage($message, $redirectButtons = NULL, $redirect = NULL, $fullSide = true)
	{
		$this->assign(array(
			'message'			=> $message,
			'redirectButtons'	=> $redirectButtons,
		));

		if(isset($redirect)) {
			$this->tplObj->gotoside($redirect[0], $redirect[1]);
		}

		if(!$fullSide) {
			$this->setWindow('popup');
		}

		$this->display('error.default.tpl');
	}

	protected function save() {
		if(isset($this->ecoObj)) {
			$this->ecoObj->SavePlanetToDB();
		}
	}

	protected function assign($array, $nocache = true) {
		$this->tplObj->assign_vars($array, $nocache);
	}

	protected function display($file) {
		global $THEME, $LNG;

		$this->save();

		if($this->getWindow() !== 'ajax') {
			$this->getPageData();
		}

		$this->assign(array(
			'lang'    		=> $LNG->getLanguage(),
			'dpath'			=> $THEME->getTheme(),
			'scripts'		=> $this->tplObj->jsscript,
			'execscript'	=> implode("\n", $this->tplObj->script),
			'basepath'		=> PROTOCOL.HTTP_HOST.HTTP_BASE,
		));

		$this->assign(array(
			'LNG'			=> $LNG,
		), false);

		$this->tplObj->display('extends:layout.'.$this->getWindow().'.tpl|'.$file);
		exit;
	}

	protected function sendJSON($data) {
		$this->save();
		echo json_encode($data);
		exit;
	}

	protected function redirectTo($url) {
		$this->save();
		HTTP::redirectTo($url);
		exit;
	}
}


text:
from __future__ import print_function
import os, sys
from .pytem import Pytem

def print_err(*args):
    print(*args, file=sys.stderr)

subject = Pytem("template",'globalfile')

def tag_test():
    result = subject.render_string("title : Title---%title%")
    print_err(result)
    assert result == "
Title
"

def md_test():
    result = subject.render_string("---#Hello World")
    print_err(result)
    assert result == "
Hello World
"

def dual_delim_test():
    result = subject.render_string("title : Title---%title%---More Content")
    print_err(result)
    assert result == "
Title---More Content
"

def site_test():
    os.environ["PROMPT"] = "no"
    return subject.render_site("in","out")