text:
nj=4
cmd=run.pl
sub_split=1
beam=13.0
lattice_beam=7.0
acwt=0.1
max_active=5000
transform_dir=
max_mem=20000000 # This will stop the processes getting too large.
# End configuration section.

echo "$0 $@"  # Print the command line for logging

[ -f ./path.sh ] && . ./path.sh; # source the path.
. parse_options.sh || exit 1;

if [ $# != 4 ]; then
   echo "Usage: steps/make_denlats_sgmm.sh [options] <data-dir> <lang-dir> <src-dir|alidir> <exp-dir>"
   echo "  e.g.: steps/make_denlats_sgmm.sh data/train data/lang exp/sgmm4a_ali exp/sgmm4a_denlats"
   echo "Works for (delta|lda) features, and (with --transform-dir option) such features"
   echo " plus transforms."
   echo ""
   echo "Main options (for others, see top of script file)"
   echo "  --config <config-file>                           # config containing options"
   echo "  --nj <nj>                                        # number of parallel jobs"
   echo "  --cmd (utils/run.pl|utils/queue.pl <queue opts>) # how to run jobs."
   echo "  --sub-split <n-split>                            # e.g. 40; use this for "
   echo "                           # large databases so your jobs will be smaller and"
   echo "                           # will (individually) finish reasonably soon."
   echo "  --transform-dir <transform-dir>   # directory to find fMLLR transforms."
   exit 1;
fi

data=$1
lang=$2
alidir=$3 # could also be $srcdir, but only if no vectors supplied.
dir=$4

sdata=$data/split$nj
splice_opts=`cat $alidir/splice_opts 2>/dev/null`
cmvn_opts=`cat $srcdir/cmvn_opts 2>/dev/null`
mkdir -p $dir/log
[[ -d $sdata && $data/feats.scp -ot $sdata ]] || split_data.sh $data $nj || exit 1;
echo $nj > $dir/num_jobs

utils/lang/check_phones_compatible.sh $lang/phones.txt $alidir/phones.txt || exit 1;
cp $alidir/phones.txt $dir || exit 1;

oov=`cat $lang/oov.int` || exit 1;

mkdir -p $dir

cp -RH $lang $dir/

# Compute grammar FST which corresponds to unigram decoding graph.
new_lang="$dir/"$(basename "$lang")
echo "$0: Making unigram grammar FST in $new_lang"
cat $data/text | utils/sym2int.pl --map-oov $oov -f 2- $lang/words.txt | \
  awk '{for(n=2;n<=NF;n++){ printf("%s ", $n); } printf("\n"); }' | \
  utils/make_unigram_grammar.pl | fstcompile | fstarcsort --sort_type=ilabel > $new_lang/G.fst \
   || exit 1;

# mkgraph.sh expects a whole directory "lang", so put everything in one directory...
# it gets L_disambig.fst and G.fst (among other things) from $dir/lang, and
# final.mdl from $alidir; the output HCLG.fst goes in $dir/graph.

echo "$0: Compiling decoding graph in $dir/dengraph"
if [ -s $dir/dengraph/HCLG.fst ] && [ $dir/dengraph/HCLG.fst -nt $srcdir/final.mdl ]; then
   echo "$0: Graph $dir/dengraph/HCLG.fst already exists: skipping graph creation."
else
  utils/mkgraph.sh $new_lang $alidir $dir/dengraph || exit 1;
fi

if [ -f $alidir/final.mat ]; then feat_type=lda; else feat_type=delta; fi
echo "$0: feature type is $feat_type"

case $feat_type in
  delta) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | add-deltas ark:- ark:- |";;
  lda) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $alidir/final.mat ark:- ark:- |"
    cp $alidir/final.mat $dir
   ;;
  *) echo "$0: Invalid feature type $feat_type" && exit 1;
esac

if [ ! -z "$transform_dir" ]; then # add transforms to features...
  echo "$0: using fMLLR transforms from $transform_dir"
  [ ! -f $transform_dir/trans.1 ] && echo "Expected $transform_dir/trans.1 to exist."
  [ "`cat $transform_dir/num_jobs`" -ne "$nj" ] \
    && echo "$0: mismatch in number of jobs with $transform_dir" && exit 1;
  [ -f $alidir/final.mat ] && ! cmp $transform_dir/final.mat $alidir/final.mat && \
     echo "$0: LDA transforms differ between $alidir and $transform_dir"
  feats="$feats transform-feats --utt2spk=ark:$sdata/JOB/utt2spk ark:$transform_dir/trans.JOB ark:- ark:- |"
else
  echo "$0: Assuming you don't have a SAT system, since no --transform-dir option supplied "
fi

if [ -f $alidir/gselect.1.gz ]; then
  gselect_opt="--gselect=ark,s,cs:gunzip -c $alidir/gselect.JOB.gz|"
else
  echo "$0: no such file $alidir/gselect.1.gz" && exit 1;
fi

if [ -f $alidir/vecs.1 ]; then
  spkvecs_opt="--spk-vecs=ark:$alidir/vecs.JOB --utt2spk=ark:$sdata/JOB/utt2spk"
else
  if [ -f $alidir/final.alimdl ]; then
    echo "$0: You seem to have an SGMM system with speaker vectors,"
    echo "yet we can't find speaker vectors.  Perhaps you supplied"
    echo "the model director instead of the alignment directory?"
    exit 1;
  fi
fi

# if this job is interrupted by the user, we want any background jobs to be
# killed too.
cleanup() {
  local pids=$(jobs -pr)
  [ -n "$pids" ] && kill $pids
}
trap "cleanup" INT QUIT TERM EXIT

if [ $sub_split -eq 1 ]; then
  $cmd JOB=1:$nj $dir/log/decode_den.JOB.log \
    sgmm-latgen-faster $spkvecs_opt "$gselect_opt" --beam=$beam \
    --lattice-beam=$lattice_beam --acoustic-scale=$acwt \
    --max-mem=$max_mem --max-active=$max_active \
    --word-symbol-table=$lang/words.txt $alidir/final.mdl  \
    $dir/dengraph/HCLG.fst "$feats" "ark:|gzip -c >$dir/lat.JOB.gz" || exit 1;
else
  # each job from 1 to $nj is split into multiple pieces (sub-split), and we aim
  # to have at most two jobs running at each time.  The idea is that if we have
  # stragglers from one job, we can be processing another one at the same time.
  rm $dir/.error 2>/dev/null

  prev_pid=
  for n in `seq $[nj+1]`; do
    if [ $n -gt $nj ]; then
      this_pid=
    elif [ -f $dir/.done.$n ] && [ $dir/.done.$n -nt $alidir/final.mdl ]; then
      echo "$0: Not processing subset $n as already done (delete $dir/.done.$n if not)";
      this_pid=
    else
      sdata2=$data/split$nj/$n/split${sub_split}utt;
      split_data.sh --per-utt $sdata/$n $sub_split || exit 1;
      mkdir -p $dir/log/$n
      mkdir -p $dir/part
      feats_subset=`echo $feats | sed "s/trans.JOB/trans.$n/g" | sed s:JOB/:$n/split${sub_split}utt/JOB/:g`
      spkvecs_opt_subset=`echo $spkvecs_opt | sed "s/JOB/$n/g"`
      gselect_opt_subset=`echo $gselect_opt | sed "s/JOB/$n/g"`
      $cmd JOB=1:$sub_split $dir/log/$n/decode_den.JOB.log \
        sgmm-latgen-faster $spkvecs_opt_subset "$gselect_opt_subset" \
        --beam=$beam --lattice-beam=$lattice_beam \
        --acoustic-scale=$acwt --max-mem=$max_mem --max-active=$max_active \
        --word-symbol-table=$lang/words.txt $alidir/final.mdl  \
        $dir/dengraph/HCLG.fst "$feats_subset" \
        "ark:|gzip -c >$dir/lat.$n.JOB.gz" || touch $dir/.error &
      this_pid=$!
    fi
    if [ ! -z "$prev_pid" ]; then # Wait for the previous job to merge lattices.
      wait $prev_pid
      [ -f $dir/.error ] && \
        echo "$0: error generating denominator lattices" && exit 1;
      rm $dir/.merge_error 2>/dev/null
      echo "$0: Merging archives for data subset $prev_n"
      for k in `seq $sub_split`; do
        gunzip -c $dir/lat.$prev_n.$k.gz || touch $dir/.merge_error;
      done | gzip -c > $dir/lat.$prev_n.gz || touch $dir/.merge_error;
      [ -f $dir/.merge_error ] && \
        echo "$0: Merging lattices for subset $prev_n failed" && exit 1;
      rm $dir/lat.$prev_n.*.gz
      touch $dir/.done.$prev_n
    fi
    prev_n=$n
    prev_pid=$this_pid
  done
fi

echo "$0: done generating denominator lattices with SGMMs."


text:
{CSSTemplate {
    $classpath : "test.aria.templates.css.imgprefix.TemplateWithRealImageCss"
}}

{macro main ()}
    * {
      margin: 0;
      padding: 0;
    }

    .container-real-image {
        background-image: url('errortooltip.png');
    }

{/macro}

{/CSSTemplate}

redpajama_set_name: RedPajamaGithub


text:
initializer 'a_paperclip.rb', <<-CODE
module Paperclip
  module ClassMethods
    def has_attached_file name, options = {}
      include InstanceMethods

      write_inheritable_attribute(:attachment_definitions, {}) if attachment_definitions.nil?
      attachment_definitions[name] = {:validations => []}.merge(options)

      after_save :save_attached_files
      before_destroy :destroy_attached_files

      define_callbacks :before_post_process, :after_post_process
      define_callbacks :"before_\#{name}_post_process", :"after_\#{name}_post_process"

      define_method name do |*args|
        a = attachment_for(name)
        (args.length > 0) ? a.to_s(args.first) : a
      end

      define_method "\#{name}=" do |file|
        attachment_for(name).assign(file)
      end

      define_method "\#{name}?" do
        attachment_for(name).file?
      end

      validates_each name, :logic => lambda {
        attachment = attachment_for(name)
        attachment.send(:flush_errors) #unless attachment.valid?
      }
    end
  end

  module Interpolations
    # Handle string ids (mongo)
    def id_partition attachment, style
      if (id = attachment.instance.id).is_a?(Integer)
        ("%09d" % id).scan(/\d{3}/).join("/")
      else
        id.scan(/.{3}/).first(3).join("/")
      end
    end
  end

  class Attachment
      # Somehow the :updated_at field gets returned as Date even if its key is a DateTime or Time...
      def updated_at
        time = instance_read(:updated_at).to_time
        time && time.to_f.to_i
      end
    end
end

ActiveRecord::Base.logger = Rails.logger
CODE

initializer 'authmonkey.rb', <<-CODE
# Monkeypatch to use a validates_numericality_of that MongoMapper's validation
# library understands (no :greater_than_or_equal_to option).
module Authlogic::ActsAsAuthentic::MagicColumns::Methods
  def self.included(klass)
    klass.class_eval do
      validates_numericality_of :login_count, :allow_nil => true if column_names.include?('login_count')
      validates_numericality_of :failed_login_count, :allow_nil => true if column_names.include?('failed_login_count')
    end
  end
end

# Monkeypatch to use save(:validate => false) instead of save(false)
module Authlogic::Session::Callbacks
  def save_record(alternate_record = nil)
    r = alternate_record || record
    r.save_without_session_maintenance(:validate => false) if r && r.changed? && !r.readonly?
  end
end

module AuthlogicPlugin
  def self.configure(model)
    model.class_eval do
      attr_protected :crypted_password, :password_salt, :persistence_token

      key :username, String
      key :email, String
      key :crypted_password, String
      key :password_salt, String
      key :persistence_token, String
      key :login_count, Integer, :default => 0
      key :last_request_at, Time
      key :last_login_at, Time
      key :current_login_at, Time
      key :last_login_ip, String
      key :current_login_ip, String

      include Authlogic::ActsAsAuthentic::Base
      include Authlogic::ActsAsAuthentic::Email
      include Authlogic::ActsAsAuthentic::LoggedInStatus
      include Authlogic::ActsAsAuthentic::Login
      include Authlogic::ActsAsAuthentic::MagicColumns
      include Authlogic::ActsAsAuthentic::Password
      include Authlogic::ActsAsAuthentic::PerishableToken
      include Authlogic::ActsAsAuthentic::PersistenceToken
      include Authlogic::ActsAsAuthentic::RestfulAuthentication
      include Authlogic::ActsAsAuthentic::SessionMaintenance
      include Authlogic::ActsAsAuthentic::SingleAccessToken
      include Authlogic::ActsAsAuthentic::ValidationsScope
    end
  end

  module ClassMethods
    def <(klass)
      return true if klass == ::ActiveRecord::Base
      super(klass)
    end

    def quoted_table_name
      'users'
    end

    def primary_key
      # This check might not be needed, but doesn't hurt to be sure (does
      # MM define a primary_key classmethod?)
      if caller.first.to_s[/(persist|session)/]
        :"_id"
      else
        super
      end
    end

    def default_timezone
      :utc
    end

    def find_by__id(*args)
      find_by_id *args
    end

    def find_with_case(field, value, sensitivity = true)
      where(field=>value).first
    end

    def with_exclusive_scope(query)
      query = where(query) if query.is_a?(Hash)
      yield query
    end

    def with_scope(query)
      with_exclusive_scope(query) {|*block_args| yield(*block_args)}
    end

    def named_scope(*args, &block)
      scope *args, &block
    end
  end

  module InstanceMethods
    def readonly?
      false
    end

    def username=(new_username)
      new_username.downcase! unless new_username.nil?
      write_attribute(:username, new_username)
    end
  end
end
CODE


text:
"use strict";

describe("FM.search.SearchCtrl", function() {

    var $scope, $rootScope, $location, $httpBackend, $q, FM_API_SERVER_ADDRESS, Spotify, PlayerQueueResource, searchResults;

    beforeEach(function (){
        module("FM.search.SearchCtrl");
    });

    beforeEach(inject(function (_$httpBackend_, $injector) {
        $httpBackend = _$httpBackend_;
        FM_API_SERVER_ADDRESS = $injector.get("env").FM_API_SERVER_ADDRESS;

        searchResults = {
            artists: { items: [{},{}] },
            albums: { items: [{uri: "spotify:album:foo"},{uri: "spotify:album:bar"}] },
            tracks: { items: [{},{}] }
        }

        $httpBackend.whenGET(/partials\/.*/).respond(200, "");
        $httpBackend.whenGET(/api.spotify.com\/v1\/search.*/).respond(200, searchResults);
        $httpBackend.whenGET(/api.spotify.com\/v1\/albums.*/).respond(200, searchResults.albums.items[0]);
        $httpBackend.whenPOST(FM_API_SERVER_ADDRESS + "player/queue").respond(200);
    }));

    beforeEach(inject(function ( _$rootScope_, $injector, $controller ) {
        $rootScope = _$rootScope_;
        $scope = $rootScope.$new();

        $rootScope.toogleSidebar = function(){}

        $q = $injector.get("$q");
        $location = $injector.get("$location");

        Spotify = $injector.get("Spotify");
        spyOn(Spotify, "search").and.callFake(function() {
            return {
                then: function(callback) { return callback(searchResults); }
            };
        });

        PlayerQueueResource = $injector.get("PlayerQueueResource");
        spyOn(PlayerQueueResource, "save").and.callThrough();

        $controller("SearchCtrl", {
            $scope: $scope,
            $rootScope: $rootScope,
            $q: $q,
            $location: $location,
            Spotify: Spotify,
            PlayerQueueResource: PlayerQueueResource
        });
    }));

    afterEach(function() {
        $httpBackend.verifyNoOutstandingExpectation();
        $httpBackend.verifyNoOutstandingRequest();
    });

    it("should search for spotify track", function() {
        $scope.search("foo");
        $httpBackend.flush();
        $rootScope.$digest();
        expect(Spotify.search).toHaveBeenCalled();

        searchResults = {
            artists: undefined,
            albums: undefined,
            tracks: undefined
        }
        $scope.search("foo");
        $rootScope.$digest();
        expect(Spotify.search.calls.count()).toBe(2);
    });

    it("should add selected song to playlist", function() {
        var track = { uri: "spotify:track:foo" };
        $scope.onTrackSelected(track);
        $httpBackend.flush();
        $rootScope.$digest();
        expect(PlayerQueueResource.save).toHaveBeenCalledWith(track);
    });

    it("should NOT add selected item to playlist", function() {
        spyOn($location, "path");
        var track = { uri: "spotify:album:foo" };;
        $scope.onTrackSelected(track);
        expect(PlayerQueueResource.save).not.toHaveBeenCalled();
        expect($location.path).toHaveBeenCalledWith("/albums/spotify:album:foo");

        track = undefined;
        $scope.onTrackSelected(track);
        expect(PlayerQueueResource.save).not.toHaveBeenCalled();

        track = {};
        $scope.onTrackSelected(track);
        expect(PlayerQueueResource.save).not.toHaveBeenCalled();

        track = { uri: "spotify:artist:foo" };;
        $scope.onTrackSelected(track);
        expect(PlayerQueueResource.save).not.toHaveBeenCalled();
        expect($location.path.calls.argsFor(1)).toEqual(["/artists/spotify:artist:foo"]);

    });

});


text:
/* vim: set expandtab ts=4 sw=4: */
/*
 * You may redistribute this program and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "util/events/libuv/UvWrapper.h"
#include "memory/Allocator.h"
#include "util/events/libuv/EventBase_pvt.h"
#include "util/Assert.h"
#include "util/Identity.h"

#ifdef win32
    #include <sys/timeb.h>
    #include <time.h>
#else
    #include <sys/time.h>
#endif

static int onFree(struct Allocator_OnFreeJob* job)
{
    struct EventBase_pvt* ctx = Identity_check((struct EventBase_pvt*) job->userData);
    if (ctx->running) {
        // The job will be completed in EventLoop_beginLoop()
        ctx->onFree = job;
        EventBase_endLoop((struct EventBase*) ctx);
        return Allocator_ONFREE_ASYNC;
    } else {
        uv_loop_delete(ctx->loop);
        return 0;
    }
}

static void calibrateTime(struct EventBase_pvt* base)
{
    uint64_t seconds;
    uint64_t milliseconds;

    #ifdef win32
        struct _timeb tb;
        _ftime(&tb);
        seconds = tb.time;
        milliseconds = tb.millitm;
    #else // sane operating systems.
        struct timeval tv;
        gettimeofday(&tv, NULL);
        seconds = tv.tv_sec;
        milliseconds = tv.tv_usec / 1000;
    #endif

    base->baseTime = (seconds * 1000) + milliseconds - uv_now(base->loop);
}

struct EventBase* EventBase_new(struct Allocator* allocator)
{
    struct Allocator* alloc = Allocator_child(allocator);
    struct EventBase_pvt* base = Allocator_calloc(alloc, sizeof(struct EventBase_pvt), 1);
    base->loop = uv_loop_new();
    base->alloc = alloc;
    Identity_set(base);

    Allocator_onFree(alloc, onFree, base);
    calibrateTime(base);
    return &base->pub;
}

void EventBase_beginLoop(struct EventBase* eventBase)
{
    struct EventBase_pvt* ctx = Identity_check((struct EventBase_pvt*) eventBase);

    Assert_true(!ctx->running); // double begin
    ctx->running = 1;

    // start the loop.
    uv_run(ctx->loop, UV_RUN_DEFAULT);

    ctx->running = 0;

    if (ctx->onFree) {
        uv_loop_delete(ctx->loop);
        Allocator_onFreeComplete(ctx->onFree);
        return;
    }
}

void EventBase_endLoop(struct EventBase* eventBase)
{
    struct EventBase_pvt* ctx = Identity_check((struct EventBase_pvt*) eventBase);
    uv_stop(ctx->loop);
}

static void countCallback(uv_handle_t* event, void* vEventCount)
{
    int* eventCount = (int*) vEventCount;
    if (!uv_is_closing(event)) {
        *eventCount = *eventCount + 1;
    }
}

int EventBase_eventCount(struct EventBase* eventBase)
{
    int eventCount = 0;
    struct EventBase_pvt* ctx = Identity_check((struct EventBase_pvt*) eventBase);
    uv_walk(ctx->loop, countCallback, &eventCount);
    return eventCount;
}

struct EventBase_pvt* EventBase_privatize(struct EventBase* base)
{
    return Identity_check((struct EventBase_pvt*) base);
}


text:
- Issue #3 - More than one SoapClient in Project

## 1.0.6
- Pull request #4: Rename $optioName to $optionName

## 1.0.5
- Update readme

## 1.0.4
- Issue #2 - Var name change request from $methoName to $methodName

## 1.0.3
- Add utility methods **getStreamContext()** and **getStreamContextOptions()** to AbstractSoapClientbase class

## 1.0.2
- Remove AbstractStructArrayBase::getAttributeName() method due to fatal error on PHP <= 5.3

## 1.0.1
- Interfaces' methods has been well declared as public
- Minor readme typo updates

## 1.0.0
- First major release, code coverage improved to reach 100% from the 1.0.0RC02 release.

## 1.0.0RC02
- Major: update source code structure, put all classes under ```src``` folder, rename Tests to tests, update composer and phpunit accordingly

## 1.0.0RC01
- Update Readme
- Define interfaces that must be used as interfaces in order to be able to define a usable top class for any generated ServiceType/StructType/ArrayType class by the [PackageGenerator](https://github.com/WsdlToPhp/PackageGenerator)

## 0.0.3
- Update dependency badge

## 0.0.2
- use top level namespace for SoapHeader class

## 0.0.1
- Initial version


text:
using System;
using System.Collections;
using nhibernator.BLL;
using nhibernator.DLL;

namespace Alachisoft.NCache.Samples
{
    /// <summary>
    /// This class is used to test the NHibernate.Mapper that is based on NHibernate
    /// To load the data from Customers and Orders table of Northwind database.
    /// </summary>
    ///
    public class NHibernate
    {
        public static CustomerFactory _customerFactory;

        public static void Run()
        {
            // Initialize customer factory
            _customerFactory = new CustomerFactory();
            Console.WriteLine("NHibernate test started");

            Console.WriteLine("Loading customers into the cache...");

            // Load customers into the cache
            _customerFactory.GetCustomers();
            _customerFactory.SessionDisconnect();
            Console.WriteLine("Customers information loaded in the cache");

            // Prints the customers in the cache
            PrintCustomerList(_customerFactory.GetCustomers());

            Random randGen = new Random();
            int randNum = randGen.Next(0, 9);
            string id = GetCustomerId(randNum);

            // Adds a new customer with randomId
            _customerFactory.SaveCustomer(GenerateCustomer(true, id));

            // Prints the customer details
            PrintCustomerDetail(_customerFactory.GetCustomer(id));

            // Fetches the customer Orders
            Customer customer = _customerFactory.GetCustomerOrders(id);
            PrintCustomerOrders(customer);

            // Updates the customer
            Customer tempCust = GenerateCustomer(false, id);
            if (tempCust != null)
            {
                _customerFactory.UpdateCustomer(tempCust);
            }

            // Deletes the customer
            _customerFactory.RemoveCustomer(id);

            // Disconnect session
            _customerFactory.SessionDisconnect();

            // Dispose customer factory once done
            _customerFactory.Dispose();
        }

        /// <summary>
        /// Get the next user option
        /// </summary>
        /// <returns></returns>
        private static int GetUserChoice()
        {
            Console.WriteLine("");
            Console.WriteLine(" 1- View customers list");
            Console.WriteLine(" 2- View customer details");
            Console.WriteLine(" 3- View customer orders");
            Console.WriteLine(" 4- Delete customer");
            Console.WriteLine(" 5- Add customer");
            Console.WriteLine(" 6- Update customer");
            Console.WriteLine(" 7- Exit");
            Console.WriteLine("");

            Console.Write("Enter your choice (1 - 7): ");
            try
            {
                int choice = Convert.ToInt32(Console.ReadLine());
                if (choice >= 1 && choice <= 7)
                    return choice;
            }
            catch (Exception e)
            {
            }
            Console.WriteLine("Please enter a valid choice (1 - 5)");
            return GetUserChoice();
        }

        /// <summary>
        /// Get user customer id from user
        /// </summary>
        /// <returns></returns>
        private static string GetCustomerId(int random)
        {
            return "CST-"+ random;
        }

        /// <summary>
        /// Display customer list
        /// </summary>
        /// <param name="list"></param>
        private static void PrintCustomerList(IList list)
        {
            Console.WriteLine("Customer ID    Customer Name");
            Console.WriteLine("-----------    -------------");

            if (list != null)
            {
                foreach (Customer customer in list)
                {
                    Console.WriteLine("{0,-13}  {1,-30}", customer.CustomerID, customer.ContactName);
                }
            }
            Console.WriteLine("");
        }

        /// <summary>
        /// Display customer details
        /// </summary>
        /// <param name="customer"></param>
        private static void PrintCustomerDetail(Customer customer)
        {
            if (customer != null)
            {
                Console.WriteLine("Customer's Detail");
                Console.WriteLine("-----------------");

                Console.WriteLine("Customer ID : " + customer.CustomerID);
                Console.WriteLine("Name        : " + customer.ContactName);
                Console.WriteLine("Company     : " + customer.CompanyName);
                Console.WriteLine("Address     : " + customer.Address);
            }
            else
            {
                Console.WriteLine("No such customer exist.");
            }
        }

        /// <summary>
        /// Display customer orders
        /// </summary>
        /// <param name="customer"></param>
        private static void PrintCustomerOrders(Customer customer)
        {
            if (customer != null)
            {
                Console.WriteLine(customer.ContactName + "'s Orders");
                Console.WriteLine("------------------------");

                if (customer.Orders != null)
                {
                    Console.WriteLine(" {0,-10} {1,-25} {2,-20}", "Order ID", "Order Date", "Ship Name");
                    Console.WriteLine(" {0,-10} {1,-25} {2,-20}", "--------", "----------e", "---------");
                    foreach (Order order in customer.Orders)
                    {
                        PrintOrderDetail(order);
                    }
                }
            }
            else
            {
                Console.WriteLine("No such customer exist.");
            }
        }

        /// <summary>
        /// Display order details
        /// </summary>
        /// <param name="order"></param>
        private static void PrintOrderDetail(Order order)
        {
            if (order != null)
                Console.WriteLine(" {0,-10} {1,-25} {2,-20}", order.OrderID, order.OrderDate.ToString(), order.ShipName);
        }

        /// <summary>
        /// Generates  new customer with specified customerId
        /// </summary>
        /// <param name="bAddUser">True for adding new record. False in case of update.</param>
        /// <returns></returns>
        private static Customer GenerateCustomer(bool bAddUser, string customerID)
        {
            Customer customer = new Customer();
            customer.CustomerID = customerID;

            if (!bAddUser)
            {
                if (_customerFactory.GetCustomer(customer.CustomerID) == null)
                {
                    Console.WriteLine("No such customer exist.");
                    return null;
                }
            }
            customer.ContactName = "ContactName" + customerID;
            customer.CompanyName = "CompanyName" + customerID;
            customer.Country = "Country" + customerID;
            customer.City = "City" + customerID;
            customer.Address = "Address" + customerID;

            return customer;
        }
    }
}


text:
from blaze.expr import *
from blaze.expr.broadcast import *
from blaze.expr.broadcast import leaves_of_type, broadcast_collect
from blaze.compatibility import builtins
from toolz import isdistinct

x = symbol('x', '5 * 3 * int32')
xx = symbol('xx', 'int32')

y = symbol('y', '5 * 3 * int32')
yy = symbol('yy', 'int32')

a = symbol('a', 'int32')

def test_broadcast_basic():
    b = Broadcast((x, y), (xx, yy), xx + yy)

    assert b.shape == x.shape
    assert b.schema == (xx + yy).dshape

    assert eval(str(b)).isidentical(b)

def test_scalar_symbols():
    exprs = [x, y]
    scalars = scalar_symbols(exprs)

    assert len(scalars) == len(exprs)
    assert isdistinct([s._name for s in scalars])
    assert builtins.all(s.dshape == e.schema for s, e in zip(scalars, exprs))

def test_broadcast_function():
    expr =  Pow(Add(x, Mult(2, y)), 2)  # (x + (2 * y)) ** 2
    b = broadcast(expr, [x, y])
    xx, yy = b._scalars
    assert b._scalar_expr.isidentical((xx + (2 * yy)) ** 2)

    # A different set of leaves
    b = broadcast(expr, [x, Mult(2, y)])
    xx, yy = b._scalars
    assert b._scalar_expr.isidentical((xx + yy) ** 2)

t = symbol('t', 'var * {x: int, y: int, z: int}')

def test_tabular_case():
    expr = t.x + t.y * 2

    b = broadcast(expr, [t])
    tt, = b._scalars

    assert b._scalar_expr.isidentical(tt.x + tt.y * 2)

def test_optimize_broadcast():
    expr = (t.distinct().x + 1).distinct()

    expected = broadcast(t.distinct().x + 1, [t.distinct()]).distinct()
    result = broadcast_collect(expr, Broadcastable=(Field, Arithmetic),
                                     WantToBroadcast=(Field, Arithmetic))

    assert result.isidentical(expected)

def test_leaves_of_type():
    expr = Distinct(Distinct(Distinct(t.x)))

    result = leaves_of_type((Distinct,), expr)
    assert len(result) == 1
    assert list(result)[0].isidentical(t.x)

def test_broadcast_collect_doesnt_collect_scalars():
    expr = xx + yy * a

    assert broadcast_collect(expr, Broadcastable=Arithmetic,
                                   WantToBroadcast=Arithmetic).isidentical(expr)

def test_table_broadcast():
    t = symbol('t', 'var * {x: int, y: int, z: int}')

    expr = t.distinct()
    expr = (2 * expr.x + expr.y + 1).distinct()

    expected = t.distinct()
    expected = broadcast(2 * expected.x + expected.y + 1, [expected]).distinct()
    assert broadcast_collect(expr).isidentical(expected)

    expr = (t.x + t.y).sum()
    result = broadcast_collect(expr)
    expected = broadcast(t.x + t.y, [t]).sum()
    assert result.isidentical(expected)

def test_broadcast_doesnt_affect_scalars():
    t = symbol('t', '{x: int, y: int, z: int}')
    expr = (2 * t.x + t.y + 1)

    assert broadcast_collect(expr).isidentical(expr)

def test_full_expr():
    b = Broadcast((x, y), (xx, yy), xx + yy)
    assert b._full_expr.isidentical(x + y)

def test_broadcast_naming():
    t = symbol('t', 'var * {x: int, y: int, z: int}')

    for expr in [t.x, t.x + 1]:
        assert broadcast(expr, [t])._name == 'x'


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
     Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="hint_time_zone_search" msgid="804776560897143016">"I-type ang pangalan ng bansa"</string>
    <string name="searchview_description_clear" msgid="1603860069305867810">"I-clear ang query"</string>
    <string name="no_results_found" msgid="5475293015394772651">"Walang nahanap na mga resulta"</string>
    <string name="palestine_display_name" msgid="3485026339977302148">"Palestine"</string>
</resources>


text:
package org.onosproject.net.flow.criteria;

import org.onlab.packet.TpPort;

import java.util.Objects;

/**
 * Implementation of TCP port criterion (16 bits unsigned integer).
 */
public final class TcpPortCriterion implements Criterion {
    private final TpPort tcpPort;
    private final TpPort mask;
    private final Type type;

    /**
     * Constructor.
     *
     * @param tcpPort the TCP port to match
     * @param mask the mask for the TCP port
     * @param type the match type. Should be either Type.TCP_SRC_MASKED or
     * Type.TCP_DST_MASKED
     */
    TcpPortCriterion(TpPort tcpPort, TpPort mask, Type type) {
        this.tcpPort = tcpPort;
        this.mask = mask;
        this.type = type;
    }

    /**
     * Constructor.
     *
     * @param tcpPort the TCP port to match
     * @param type the match type. Should be either Type.TCP_SRC or
     * Type.TCP_DST
     */
    TcpPortCriterion(TpPort tcpPort, Type type) {
        this(tcpPort, null, type);
    }

    @Override
    public Type type() {
        return this.type;
    }

    /**
     * Gets the TCP port to match.
     *
     * @return the TCP port to match
     */
    public TpPort tcpPort() {
        return this.tcpPort;
    }

    /**
     * Gets the mask for the TCP port to match.
     *
     * @return the TCP port mask, null if not specified
     */
    public TpPort mask() {
        return this.mask;
    }

    @Override
    public String toString() {
        return (mask != null) ?
                type().toString() + SEPARATOR + tcpPort + "/" + mask :
                type().toString() + SEPARATOR + tcpPort;
    }

    @Override
    public int hashCode() {
        return Objects.hash(type.ordinal(), tcpPort, mask);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof TcpPortCriterion) {
            TcpPortCriterion that = (TcpPortCriterion) obj;
            return Objects.equals(tcpPort, that.tcpPort) &&
                    Objects.equals(mask, that.mask) &&
                    Objects.equals(type, that.type);
        }
        return false;
    }
}


text:
/* This file was generated by SableCC (http://www.sablecc.org/). */

package node;

import analysis.*;

@SuppressWarnings("nls")
public final class TId extends Token
{
    public TId(String text)
    {
        setText(text);
    }

    public TId(String text, int line, int pos)
    {
        setText(text);
        setLine(line);
        setPos(pos);
    }

    @Override
    public Object clone()
    {
      return new TId(getText(), getLine(), getPos());
    }

    @Override
    public void apply(Switch sw)
    {
        ((Analysis) sw).caseTId(this);
    }
}


text:
//
//  CocosViewController.m
//  Ninja
//
//  Created by okihara.masataka on 10/10/14.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "CocosViewController.h"
#import "cocos2d.h"
#import "NJBattlePrepareScene.h"
#import "NJMissionScene.h"
#import "NJBattleScene.h"

@implementation CocosViewController

@synthesize delegate;

- (void)runSceneBattle
{
	[[CCDirector sharedDirector] replaceScene:[NJBattlePrepareScene scene]];
	//[[CCDirector sharedDirector] replaceScene:[BattleScene scene]];
}

- (void)runSceneMission
{
	[[CCDirector sharedDirector] replaceScene:[NJMissionScene scene]];
}

// Implement loadView to create a view hierarchy programmatically, without using a nib.
//- (void)loadView {
//
//}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
 	NSLog(@"%s", __FUNCTION__);

	CGRect frame = [[UIScreen mainScreen] bounds];
	if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] )
		[CCDirector setDirectorType:kCCDirectorTypeNSTimer];
	CCDirector *__director = [CCDirector sharedDirector];
	[__director setDeviceOrientation:kCCDeviceOrientationPortrait];
	[__director setDisplayFPS:NO];
	[__director setAnimationInterval:1.0/60];
	EAGLView *__glView = [EAGLView viewWithFrame:frame
									 pixelFormat:kEAGLColorFormatRGB565
									 depthFormat:0 /* GL_DEPTH_COMPONENT24_OES */
							  preserveBackbuffer:NO];
	[__director setOpenGLView:__glView];

	// Obtain the shared director in order to...
	CCDirector *director = [CCDirector sharedDirector];

	// Sets landscape mode
	[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

	// Turn on display FPS
	[director setDisplayFPS:YES];

	// Turn on multiple touches
	EAGLView *view = [director openGLView];
	[view setMultipleTouchEnabled:YES];

	// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
	// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
	// You can change anytime.
	[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];

	[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"untitled.plist"];

	self.view = __glView;

	[director runWithScene:[CCScene node]];
}

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)dealloc {
    [super dealloc];
}

@end


text:
PushMessagingPermissionContext*
PushMessagingPermissionContextFactory::GetForProfile(
    Profile* profile) {
  return static_cast<PushMessagingPermissionContext*>(
      GetInstance()->GetServiceForBrowserContext(profile, true));
}

// static
PushMessagingPermissionContextFactory*
PushMessagingPermissionContextFactory::GetInstance() {
  return base::Singleton<PushMessagingPermissionContextFactory>::get();
}

PushMessagingPermissionContextFactory::PushMessagingPermissionContextFactory()
    : BrowserContextKeyedServiceFactory(
          "GCMPermissionContext",
          BrowserContextDependencyManager::GetInstance()) {
}

PushMessagingPermissionContextFactory
::~PushMessagingPermissionContextFactory() {
}

KeyedService* PushMessagingPermissionContextFactory::BuildServiceInstanceFor(
    content::BrowserContext* profile) const {
  return new PushMessagingPermissionContext(static_cast<Profile*>(profile));
}

content::BrowserContext*
PushMessagingPermissionContextFactory::GetBrowserContextToUse(
    content::BrowserContext* context) const {
  return chrome::GetBrowserContextOwnInstanceInIncognito(context);
}