text:
// Originally submitted to OSEHRA 2/21/2017 by DSS, Inc.
// Authored by DSS, Inc. 2014-2017

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NLog;

namespace VA.Gov.Artemis.Core
{
    public static class VistaLogger
    {
        // *** NLog logger object ***
        private static Logger logger = LogManager.GetLogger("dashboard-vista");

        /// <summary>
        /// Logs calls to VistA
        /// </summary>
        /// <param name="op">Operation or RPC Name</param>
        /// <param name="elapsed">Time Elapsed in seconds</param>
        /// <param name="returnSize">Size of the Data Returned</param>
        /// <param name="commandArgs">The Command Args Passed In</param>
        public static void Log(string op, string elapsed, int returnSize, object[] commandArgs, string result)
        {
            // *** Format of the operation ***
            string opFormat = "{0}({1})";

            string args = "";

            // *** Check if there are ags to work with ***
            if (commandArgs != null)
            {
                // *** Keep track of outer loop first ***
                bool outFirst = true;

                // *** Go through each arg ***
                foreach (var arg in commandArgs)
                {
                    // *** Add vertical bar separator if not first item ***
                    if (outFirst)
                        outFirst = false;
                    else
                        args += "|";

                    // *** Special handling for string array ***
                    if (arg is string[])
                    {
                        // *** Delimit string array items by caret ***
                        string[] argArray = arg as string[];
                        bool inFirst = true;
                        foreach (var subArg in argArray)
                        {
                            if (inFirst)
                                inFirst = false;
                            else
                                args += "^";

                            args += string.Format("{0}", subArg);
                        }
                    }
                    else if (arg != null)
                        args += arg.ToString();
                }
            }

            // *** Get final string for args ***
            string opArgs = string.Format(opFormat, op, args);

            // *** Create message ***
            string msg = string.Format("{0},{1},{2},{3},{4},{5}", DateTime.Now.ToShortDateString(), DateTime.Now.ToString("HH:mm:ss"), opArgs, result, elapsed, returnSize);

            // *** Log it ***
            logger.Info(msg);
        }

    }
}


text:
describe MotionForm do
  it 'knows about all of the included cells' do
    expected_cells = [TextInputCell, TextFieldCell, ButtonCell]

    MotionForm.included_cells.should.equal expected_cells
  end

  describe '#register_cell' do
    it 'registers a cell' do
      MotionForm.register_cell(UITableViewCell)

      MotionForm.registered_cells.should.include? UITableViewCell
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.mitchellbosecke.pebble.template;

import com.mitchellbosecke.pebble.PebbleEngine;
import com.mitchellbosecke.pebble.extension.escaper.SafeString;
import com.mitchellbosecke.pebble.node.ArgumentsNode;
import com.mitchellbosecke.pebble.node.BlockNode;
import com.mitchellbosecke.pebble.node.RenderableNode;
import com.mitchellbosecke.pebble.template.Block;
import com.mitchellbosecke.pebble.template.EvaluationContextImpl;
import com.mitchellbosecke.pebble.template.Macro;
import com.mitchellbosecke.pebble.template.PebbleTemplate;
import com.mitchellbosecke.pebble.utils.Pair;
import java.io.Writer;
import java.util.List;
import java.util.Locale;
import java.util.Map;

public class PebbleTemplateImpl implements PebbleTemplate
{
    protected PebbleTemplateImpl() {}
    public PebbleTemplateImpl getNamedImportedTemplate(EvaluationContextImpl p0, String p1){ return null; }
    public PebbleTemplateImpl(PebbleEngine p0, RenderableNode p1, String p2){}
    public SafeString macro(EvaluationContextImpl p0, String p1, ArgumentsNode p2, boolean p3, int p4){ return null; }
    public String getName(){ return null; }
    public String resolveRelativePath(String p0){ return null; }
    public boolean hasBlock(String p0){ return false; }
    public boolean hasMacro(String p0){ return false; }
    public void block(Writer p0, EvaluationContextImpl p1, String p2, boolean p3){}
    public void embedTemplate(int p0, Writer p1, EvaluationContextImpl p2, String p3, Map<? extends Object, ? extends Object> p4, List<BlockNode> p5){}
    public void evaluate(Writer p0){}
    public void evaluate(Writer p0, Locale p1){}
    public void evaluate(Writer p0, Map<String, Object> p1){}
    public void evaluate(Writer p0, Map<String, Object> p1, Locale p2){}
    public void evaluateBlock(String p0, Writer p1){}
    public void evaluateBlock(String p0, Writer p1, Locale p2){}
    public void evaluateBlock(String p0, Writer p1, Map<String, Object> p2){}
    public void evaluateBlock(String p0, Writer p1, Map<String, Object> p2, Locale p3){}
    public void importNamedMacrosFromTemplate(String p0, List<Pair<String, String>> p1){}
    public void importNamedTemplate(EvaluationContextImpl p0, String p1, String p2){}
    public void importTemplate(EvaluationContextImpl p0, String p1){}
    public void includeTemplate(Writer p0, EvaluationContextImpl p1, String p2, Map<? extends Object, ? extends Object> p3){}
    public void registerBlock(Block p0){}
    public void registerMacro(Macro p0){}
    public void registerMacro(String p0, Macro p1){}
    public void setParent(EvaluationContextImpl p0, String p1){}
}


text:
<?php

namespace SofaChamps\Bundle\BowlPickemBundle\Tests\Entity;

use SofaChamps\Bundle\BowlPickemBundle\Entity\Game;
use SofaChamps\Bundle\NCAABundle\Entity\Team;

class GameTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider gameData
     */
    public function testGetFavorite(Game $game, Team $favorite, Team $underdog)
    {
        $this->assertEquals($favorite, $game->getFavorite());
        $this->assertEquals($underdog, $game->getUnderdog());
    }

    public function gameData()
    {
        $homeTeam = new Team();
        $homeTeam->setId('home');
        $homeTeam->setName('home');

        $awayTeam = new Team();
        $awayTeam->setId('away');
        $awayTeam->setName('away');

        $game1 = new Game();
        $game1->setName('Game 1');
        $game1->setHomeTeam($homeTeam);
        $game1->setAwayTeam($awayTeam);
        $game1->setSpread(1);

        $game2 = new Game();
        $game2->setName('Game 2');
        $game2->setHomeTeam($homeTeam);
        $game2->setAwayTeam($awayTeam);
        $game2->setSpread(-1);

        $game3 = new Game();
        $game3->setName('Game 3');
        $game3->setHomeTeam($homeTeam);
        $game3->setAwayTeam($awayTeam);
        $game3->setSpread(0);

        return array(
            array($game1, $awayTeam, $homeTeam),
            array($game2, $homeTeam, $awayTeam),
            array($game3, $homeTeam, $awayTeam),
        );
    }
}


text:
package example.repo;

import example.model.Customer62;

import java.util.List;

import org.springframework.data.repository.CrudRepository;

public interface Customer62Repository extends CrudRepository<Customer62, Long> {

	List<Customer62> findByLastName(String lastName);
}


text:
head: {
    defaults: {
        title: 'my title',
        useSocialMetaTags: false
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2014 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="app_name" msgid="8095131950334945205">"Калкулатор"</string>
    <string name="error_nan" msgid="4071578355972369426">"Не е број"</string>
    <string name="error_syntax" msgid="6940043994468390738">"Грешка"</string>
    <string name="fun_cos" msgid="7312559527731358211">"cos"</string>
    <string name="fun_ln" msgid="6282013842946532944">"ln"</string>
    <string name="fun_log" msgid="6856905045055937519">"log"</string>
    <string name="fun_sin" msgid="7136698561875496766">"sin"</string>
    <string name="fun_tan" msgid="9116158377794370341">"tan"</string>
    <string name="clr" msgid="3126239559646368205">"исч"</string>
    <string name="del" msgid="6700172918709138470">"изб"</string>
    <string name="desc_const_e" msgid="7752508267661034194">"Ојлеров број"</string>
    <string name="desc_const_pi" msgid="5843835548313660468">"Пи"</string>
    <string name="desc_dec_point" msgid="6211527612960070934">"точка"</string>
    <string name="desc_lparen" msgid="3319203240269597504">"лева заграда"</string>
    <string name="desc_rparen" msgid="7629704943022422763">"десна заграда"</string>
    <string name="desc_fun_cos" msgid="3197307754450718348">"косинус"</string>
    <string name="desc_fun_ln" msgid="4943842219071979148">"природен логаритам"</string>
    <string name="desc_fun_log" msgid="6163178034661345125">"логаритам"</string>
    <string name="desc_fun_sin" msgid="4010564022860883142">"синус"</string>
    <string name="desc_fun_tan" msgid="8547330421304946587">"тангента"</string>
    <string name="desc_op_add" msgid="1174812755738083078">"плус"</string>
    <string name="desc_op_div" msgid="8320455802423478031">"подели"</string>
    <string name="desc_op_fact" msgid="5004950609277631750">"факториел"</string>
    <string name="desc_op_mul" msgid="978652245185868311">"по"</string>
    <string name="desc_op_pow" msgid="2620877401884059447">"на степен"</string>
    <string name="desc_op_sqrt" msgid="4405610392216554239">"квадратен корен"</string>
    <string name="desc_op_sub" msgid="2563060630032563021">"минус"</string>
    <string name="desc_clr" msgid="8357371663749541924">"исчисти"</string>
    <string name="desc_del" msgid="1866733601083210032">"избриши"</string>
    <string name="desc_eq" msgid="8068773095462472408">"еднакво"</string>
</resources>


text:
using Overflow.Behaviors;
using Overflow.Test.Fakes;
using Overflow.Test.TestingInfrastructure;
using Xunit;

namespace Overflow.Test.Behaviors
{
    public class ConditionalExecutionBehaviorFactoryTests
    {
        [Theory, AutoMoqData]
        public void A_conditional_execution_behavior_is_created_for_conditional_operations(SkippableOperation operation)
        {
            var sut = new ConditionalExecutionBehaviorFactory();

            var result = sut.CreateBehaviors(operation, new FakeWorkflowConfiguration());

            Assert.Equal(1, result.Count);
            Assert.IsType<ConditionalExecutionBehavior>(result[0]);
            Assert.NotNull(result[0]);
        }

        [Theory, AutoMoqData]
        public void A_conditional_execution_behavior_is_not_created_for_unconditional_operations(FakeOperation operation)
        {
            var sut = new ConditionalExecutionBehaviorFactory();

            var result = sut.CreateBehaviors(operation, new FakeWorkflowConfiguration());

            Assert.Equal(0, result.Count);
        }

        public class SkippableOperation : Operation, IConditionalOperation
        {
            public bool SkipExecution { get; }
        }
    }
}


text: <?= $this->url->icon('user-circle-o', t('Use case'), 'UseCase', 'show', array('project_id' => $project['id'], 'search' => $filters['search'], 'plugin' => 'Usecase'), false) ?>


text:
<?php

namespace J2\Bundle\ExchangeBundle\Twig;

use Twig_Extension;
use Twig_Filter_Method;

class Text extends Twig_Extension
{

    public function getFilters()
    {
        return array(
            'nl2br'    => new Twig_Filter_Method($this, 'twig_nl2br_filter'),
            'truncate' => new Twig_Filter_Method($this, 'twig_truncate_filter'),
            'wordwrap' => new Twig_Filter_Method($this, 'twig_wordwrap_filter')
        );
    }

    /**
     * Name of this extension
     *
     * @return string
     */
    public function getName()
    {
        return 'text_extension';
    }

    function twig_nl2br_filter($value, $sep = '<br />')
    {
        return str_replace("\n", $sep."\n", $value);
    }

    function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '...')
    {
        if (strlen($value) > $length) {
            if ($preserve) {
                if (false !== ($breakpoint = strpos($value, ' ', $length))) {
                    $length = $breakpoint;
                }
            }

            return substr($value, 0, $length) . $separator;
        }

        return $value;
    }

    function twig_wordwrap_filter($value, $length = 80, $separator = "\n", $preserve = false)
    {
        return wordwrap($value, $length, $separator, !$preserve);
    }

}


text:
package pt.ul.fc.di.lasige.simhs.core.services;

import pt.ul.fc.di.lasige.simhs.core.domain.RTSystem;

/**
 * An abstract class specifying a reader which acts as a simulated scenario (system) pool.
 *
 *
 * @author jcraveiro
 *
 */
public abstract class AbsSystemsReader implements IReader {

	/* (non-Javadoc)
	 * @see pt.ul.fc.di.lasige.simhs.services.IReader#getSystem()
	 */
	@Override
	public RTSystem getSystem() {
		return iterator().next();
	}

}


text:
@implementation PathUtil

+ (NSString *)scriptDirectoryPath
{
#ifdef DEBUG
    NSString *file = @(__FILE__);
    return [[file stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Scripts"];
#else
    return [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Scripts"];
#endif
}

+ (NSURL *)URLForFileAtScriptDirectory:(NSString *)file
{
    return [NSURL fileURLWithPath:[[self scriptDirectoryPath] stringByAppendingPathComponent:file]];
}

@end


text:
package Paws::CloudTrail::RemoveTags;
  use Moose;
  has ResourceId => (is => 'ro', isa => 'Str', required => 1);
  has TagsList => (is => 'ro', isa => 'ArrayRef[Paws::CloudTrail::Tag]');

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'RemoveTags');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CloudTrail::RemoveTagsResponse');
  class_has _result_key => (isa => 'Str', is => 'ro');
1;

### main pod documentation begin ###

=head1 NAME

Paws::CloudTrail::RemoveTags - Arguments for method RemoveTags on Paws::CloudTrail

=head1 DESCRIPTION

This class represents the parameters used for calling the method RemoveTags on the
AWS CloudTrail service. Use the attributes of this class
as arguments to method RemoveTags.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RemoveTags.

As an example:

  $service_obj->RemoveTags(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> ResourceId => Str

Specifies the ARN of the trail from which tags should be removed. The
format of a trail ARN is:

C<arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail>

=head2 TagsList => ArrayRef[L<Paws::CloudTrail::Tag>]

Specifies a list of tags to be removed.

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method RemoveTags in L<Paws::CloudTrail>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Ito & Tokunaga, Trans. Sapporo nat. Hist. Soc. 14(1): 13 (1935)

#### Original name
Pythium iwayamae S. Ito

### Remarks
null


text:
DOCUMENTATION = '''
---
author: Jesse Keating and Dustin Lundquist
module: cinder_volume_group
short_description: Configure LVM volume groups
description:
  - This module creates a LVM VG for Cinder to use
options:
  dev:
    description:
      - The device to make a swift disk
    required: true
'''

EXAMPLES = '''
# create a volume group for cinder, named `cinder-volumes`,
# backed by a file mounted over loop device

- swift_disk: dev=sdb
'''

import os
import pwd
import grp

def main():
    module = AnsibleModule(
        argument_spec  = dict(
            dev       = dict(required=True),
        ),
    )

    dev = module.params.get('dev')
    dev_path = "/dev/%s" % dev
    part_path = "%s1" % dev_path

    if not os.path.exists(dev_path):
        module.fail_json(msg="no such device: %s" % dev)

    if os.path.exists(part_path):
        module.exit_json(changed=False)

    # setup the parted command
    cmd = ['parted', '--script', dev_path, 'mklabel', 'gpt', 'mkpart', 'primary', '1', '100%']
    rc, out, err = module.run_command(cmd, check_rc=True)

    # make an xfs
    cmd = ['mkfs.xfs', '-f', '-i', 'size=512', part_path]
    rc, out, err = module.run_command(cmd, check_rc=True)

    # discover uuid
    cmd = ['blkid', '-o', 'value', part_path]
    rc, out, err = module.run_command(cmd, check_rc=True)
    fsuuid = out.splitlines()[0]

    # write fstab
    try:
        with open('/etc/fstab', 'a') as f:
            f.write("UUID=%s /srv/node/%s1 xfs noatime,nodiratime,nobarrier,logbufs=8 0 0\n" % (fsuuid, dev))
    except Exception, e:
        module.fail_json(msg="failed to update fstab: %s" % e)

    # mount point
    os.makedirs('/srv/node/%s1' % dev)

    # mount it
    cmd = ['mount', '/srv/node/%s1' % dev]
    rc, out, err = module.run_command(cmd, check_rc=True)

    # chown it
    swuid = pwd.getpwnam('swift').pw_uid
    swgid = grp.getgrnam('swift').gr_gid
    os.chown('/srv/node/%s1' % dev, swuid, swgid)

    module.exit_json(changed=True)

# this is magic, see lib/ansible/module.params['common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()


text:
layout: post
microblog: true
audio:
photo:
date: 2016-12-26 21:46:59 -0700
guid: http://curt.micro.blog/2016/12/27/t813607082868035584.html
---
"Russia's policies are rooted in deceit, graft & violence—a combination that presents an existential challenge…" #fb [https://t.co/p47QuwVJVD](https://t.co/p47QuwVJVD)


text:
namespace autofill {

// A convenience class for implementing data-driven tests. Subclassers need only
// implement the conversion of serialized input data to serialized output data
// and provide a set of input files. For each input file, on the first run, a
// gold output file is generated; for subsequent runs, the test ouptut is
// compared to this gold output.
class DataDrivenTest {
 public:
  // For each file in |input_directory| whose filename matches
  // |file_name_pattern|, slurps in the file contents and calls into
  // |GenerateResults()|. If the corresponding output file already exists in
  // the |output_directory|, verifies that the results match the file contents;
  // otherwise, writes a gold result file to the |output_directory|.
  void RunDataDrivenTest(const base::FilePath& input_directory,
                         const base::FilePath& output_directory,
                         const base::FilePath::StringType& file_name_pattern);

  // As above, but runs a test for a single file, the full path of which is
  // given by |test_file_name|.
  void RunOneDataDrivenTest(const base::FilePath& test_file_name,
                            const base::FilePath& output_directory,
                            bool is_expected_to_pass);

  // Given the |input| data, generates the |output| results. The output results
  // must be stable across runs.
  // Note: The return type is |void| so that googletest |ASSERT_*| macros will
  // compile.
  virtual void GenerateResults(const std::string& input,
                               std::string* output) = 0;

  // Return |base::FilePath|s to the test input and output subdirectories
  // ../autofill/|test_name|/input and ../autofill/|test_name|/output.
  base::FilePath GetInputDirectory(const base::FilePath::StringType& test_name);
  base::FilePath GetOutputDirectory(
      const base::FilePath::StringType& test_name);

 protected:
  DataDrivenTest(const base::FilePath& test_data_directory);
  virtual ~DataDrivenTest();

 private:
  base::FilePath test_data_directory_;

  DISALLOW_COPY_AND_ASSIGN(DataDrivenTest);
};

}  // namespace autofill

#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_DRIVEN_TEST_H_


text:
using System.Collections.Concurrent;
using System.Threading.Tasks;
using System.Windows;

namespace C.Sharp.Parallel.Pi
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        #region Constants

        private const int NUM_STEPS = int.MaxValue;

        #endregion

        #region Constructors

        public MainWindow()
        {
            InitializeComponent();
        }

        #endregion

        #region Event Handling

        private void sync_button_Click(object sender, RoutedEventArgs e)
        {
            result_label.Content = "Executing Sync";

            double result = Pi();
            result_label.Content = result.ToString();
        }

        private async void async_button_Click(object sender, RoutedEventArgs e)
        {
            result_label.Content = "Executing Async";

            double result = await PiAsync();
            result_label.Content = result.ToString();
        }

        #endregion

        #region Methods

        /// <summary>
        /// Make Pi
        /// </summary>
        /// <returns>Pi</returns>
        /// <remarks>Disclaimer : Pi is not edible</remarks>
        private double Pi()
        {
            double sum = 0.0;
            double step = 1.0 / NUM_STEPS;

            //Compute Pi using parallel map/reduce scheme through a Partitioner
            object monitor = new object();
            System.Threading.Tasks.Parallel.ForEach(Partitioner.Create(0, NUM_STEPS), () => 0d, (range, state, local) =>
            {
                for (int i = range.Item1; i < range.Item2; i++)
                {
                    double x = (i + 0.5) * step;
                    local += 4.0 / (1.0 + x * x);
                }
                return local;
            }, local => { lock (monitor) sum += local; });

            return step * sum;
        }

        /// <summary>
        /// Make Pi while doing the other stuff too!!
        /// </summary>
        /// <returns>Pi but later...</returns>
        /// <remarks>Disclaimer : Async Pi is stil not edible</remarks>
        private async Task<double> PiAsync() => await Task.Run(() => Pi());

        #endregion
    }
}


text:
module FbGraph
  class AdGroup < Node
    include Connections::AdCreatives
    include Connections::ReachEstimates
    include Connections::AdInsights

    attr_accessor :ad_id, :campaign_id, :name, :adgroup_status, :bid_type, :max_bid, :targeting, :creative, :creative_ids, :adgroup_id,
      :end_time, :start_time, :updated_time, :bid_info, :disapprove_reason_descriptions, :view_tags, :objective

    def initialize(identifier, attributes = {})
      super
      set_attrs(attributes)
    end

    # We override update to handle the "redownload" parameter
    # If redownload is specified, the FbGraph::AdGroup object will be updated with the data returned from Facebook.
    def update(options)
      response = super(options)

      if options[:redownload]
        attributes = options.merge(response[:data][:adgroups][identifier]).with_indifferent_access
        set_attrs(attributes)
      end

      response
    end

    def creatives(fetch = true)
      creative_ids.map { |creative_id| fetch ? AdCreative.fetch(creative_id) : AdCreative.new(creative_id) }
    end

    protected

    def set_attrs(attributes)
      %w(ad_id campaign_id name adgroup_status bid_type max_bid targeting creative creative_ids adgroup_id bid_info disapprove_reason_descriptions view_tags objective).each do |field|
        send("#{field}=", attributes[field.to_sym])
      end

      # max_bid is string only when reloaded for some reason..
      self.max_bid = max_bid.try(:to_i)

      %w(start_time end_time updated_time).each do |field|
        if val = attributes[field.to_sym]
          # Handles integer timestamps and ISO8601 strings
          time = Time.parse(val) rescue Time.at(val.to_i)
          send("#{field}=", time)
        end
      end
    end
  end
end


text:
namespace llvm {
  template<typename T>
  class ArrayRef;
  class DominatorTree;
  class Instruction;
  class DataLayout;
  class FastMathFlags;
  class TargetLibraryInfo;
  class Type;
  class Value;

  /// SimplifyAddInst - Given operands for an Add, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyAddInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifySubInst - Given operands for a Sub, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifySubInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// Given operands for an FAdd, see if we can fold the result.  If not, this
  /// returns null.
  Value *SimplifyFAddInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// Given operands for an FSub, see if we can fold the result.  If not, this
  /// returns null.
  Value *SimplifyFSubInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// Given operands for an FMul, see if we can fold the result.  If not, this
  /// returns null.
  Value *SimplifyFMulInst(Value *LHS, Value *RHS,
                          FastMathFlags FMF,
                          const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyMulInst - Given operands for a Mul, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyMulInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifySDivInst - Given operands for an SDiv, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifySDivInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyUDivInst - Given operands for a UDiv, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyUDivInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyFDivInst - Given operands for an FDiv, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyFDivInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifySRemInst - Given operands for an SRem, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifySRemInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyURemInst - Given operands for a URem, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyURemInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyFRemInst - Given operands for an FRem, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyFRemInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyShlInst - Given operands for a Shl, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyShlInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifyLShrInst - Given operands for a LShr, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyLShrInst(Value *Op0, Value *Op1, bool isExact,
                          const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyAShrInst - Given operands for a AShr, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact,
                          const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyAndInst - Given operands for an And, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyAndInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifyOrInst - Given operands for an Or, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyOrInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                        const TargetLibraryInfo *TLI = 0,
                        const DominatorTree *DT = 0);

  /// SimplifyXorInst - Given operands for a Xor, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyXorInst(Value *LHS, Value *RHS, const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifyICmpInst - Given operands for an ICmpInst, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                          const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifyFCmpInst - Given operands for an FCmpInst, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                          const DataLayout *TD = 0,
                          const TargetLibraryInfo *TLI = 0,
                          const DominatorTree *DT = 0);

  /// SimplifySelectInst - Given operands for a SelectInst, see if we can fold
  /// the result.  If not, this returns null.
  Value *SimplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal,
                            const DataLayout *TD = 0,
                            const TargetLibraryInfo *TLI = 0,
                            const DominatorTree *DT = 0);

  /// SimplifyGEPInst - Given operands for an GetElementPtrInst, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyGEPInst(ArrayRef<Value *> Ops, const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifyInsertValueInst - Given operands for an InsertValueInst, see if we
  /// can fold the result.  If not, this returns null.
  Value *SimplifyInsertValueInst(Value *Agg, Value *Val,
                                 ArrayRef<unsigned> Idxs,
                                 const DataLayout *TD = 0,
                                 const TargetLibraryInfo *TLI = 0,
                                 const DominatorTree *DT = 0);

  /// SimplifyTruncInst - Given operands for an TruncInst, see if we can fold
  /// the result.  If not, this returns null.
  Value *SimplifyTruncInst(Value *Op, Type *Ty, const DataLayout *TD = 0,
                           const TargetLibraryInfo *TLI = 0,
                           const DominatorTree *DT = 0);

  //=== Helper functions for higher up the class hierarchy.

  /// SimplifyCmpInst - Given operands for a CmpInst, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                         const DataLayout *TD = 0,
                         const TargetLibraryInfo *TLI = 0,
                         const DominatorTree *DT = 0);

  /// SimplifyBinOp - Given operands for a BinaryOperator, see if we can
  /// fold the result.  If not, this returns null.
  Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
                       const DataLayout *TD = 0,
                       const TargetLibraryInfo *TLI = 0,
                       const DominatorTree *DT = 0);

  /// \brief Given a function and iterators over arguments, see if we can fold
  /// the result.
  ///
  /// If this call could not be simplified returns null.
  Value *SimplifyCall(Value *V, User::op_iterator ArgBegin,
                      User::op_iterator ArgEnd, const DataLayout *TD = 0,
                      const TargetLibraryInfo *TLI = 0,
                      const DominatorTree *DT = 0);

  /// \brief Given a function and set of arguments, see if we can fold the
  /// result.
  ///
  /// If this call could not be simplified returns null.
  Value *SimplifyCall(Value *V, ArrayRef<Value *> Args,
                      const DataLayout *TD = 0,
                      const TargetLibraryInfo *TLI = 0,
                      const DominatorTree *DT = 0);

  /// SimplifyInstruction - See if we can compute a simplified version of this
  /// instruction.  If not, this returns null.
  Value *SimplifyInstruction(Instruction *I, const DataLayout *TD = 0,
                             const TargetLibraryInfo *TLI = 0,
                             const DominatorTree *DT = 0);

  /// \brief Replace all uses of 'I' with 'SimpleV' and simplify the uses
  /// recursively.
  ///
  /// This first performs a normal RAUW of I with SimpleV. It then recursively
  /// attempts to simplify those users updated by the operation. The 'I'
  /// instruction must not be equal to the simplified value 'SimpleV'.
  ///
  /// The function returns true if any simplifications were performed.
  bool replaceAndRecursivelySimplify(Instruction *I, Value *SimpleV,
                                     const DataLayout *TD = 0,
                                     const TargetLibraryInfo *TLI = 0,
                                     const DominatorTree *DT = 0);

  /// \brief Recursively attempt to simplify an instruction.
  ///
  /// This routine uses SimplifyInstruction to simplify 'I', and if successful
  /// replaces uses of 'I' with the simplified value. It then recurses on each
  /// of the users impacted. It returns true if any simplifications were
  /// performed.
  bool recursivelySimplifyInstruction(Instruction *I,
                                      const DataLayout *TD = 0,
                                      const TargetLibraryInfo *TLI = 0,
                                      const DominatorTree *DT = 0);
} // end namespace llvm

#endif


text:
from flask import Flask, request, render_template, redirect, url_for
db = {}
app = Flask(__name__)

def get_client_ip(request):
    # PythonAnywhere.com calls our service through a loabalancer
    # the remote_addr is therefore the IP of the loaabalancer, PythonAnywhere stores Client IP in header
    if request.headers['X-Real-IP']: return request.headers['X-Real-IP']
    return request.remote_addr

if __name__ == "__main__":
    app.run(host="0.0.0.0")

@app.route('/')
def get():
    ip = get_client_ip(request)
    return render_template("index.html", text = db.get(ip, ''))

@app.route('/', methods=['POST'])
def post():
    ip, content = get_client_ip(request), request.form.get('text')
    if len(content) == 0:
        del db[ip]
    else:
        db[ip] = content
    return redirect(url_for('get'))

if __name__ == "__main__":
    app.run(host="0.0.0.0")


text:
from gluon import current

def config(settings):
    """
        Template settings for Belize
        - designed to be used in a Cascade with an application template
    """

    #T = current.T

    # Pre-Populate
    settings.base.prepopulate.append("locations/BZ")

    # Restrict to specific country/countries
    settings.gis.countries.append("BZ")
    # Dosable the Postcode selector in the LocationSelector
    #settings.gis.postcode_selector = False

    # L10n (Localization) settings
    settings.L10n.languages["es"] = "Spanish"
    settings.L10n.languages["bzj"] = "Kriol"
    settings.L10n.languages["kek"] = "Q'eqchi'"
    settings.L10n.languages["mop"] = "Mopan"
    settings.L10n.languages["yua"] = "Yucatec Maya"
    settings.L10n.languages["de"] = "German"
    settings.L10n.languages["cab"] = "Garifuna"
    settings.L10n.languages["zh"] = "Chinese"
    # Default Language (put this in custom template if-required)
    #settings.L10n.default_language = "es"
    # Default timezone for users
    settings.L10n.timezone = "America/Belize"
    # Default Country Code for telephone numbers
    settings.L10n.default_country_code = 501

    settings.fin.currencies["BZD"] = "Belize Dollars"
    settings.fin.currency_default = "BZD"

# END =========================================================================


text:
layout: page
title: Temple Mind Foundation Award Ceremony
date: 2016-05-24
author: Shirley Carrillo
tags: weekly links, java
status: published
summary: Vestibulum viverra risus ac quam.
banner: images/banner/office-01.jpg
booking:
  startDate: 01/26/2019
  endDate: 01/29/2019
  ctyhocn: PFNPPHX
  groupCode: TMFAC
published: true
---
Morbi quis diam non orci fermentum facilisis. Sed tincidunt risus turpis, vitae volutpat lacus finibus volutpat. Phasellus eu cursus lorem. Donec commodo arcu vitae lectus molestie, id mattis risus vulputate. Phasellus viverra lobortis velit, id fringilla quam eleifend in. Phasellus sollicitudin mi quis odio aliquet tristique. Nam a eleifend mauris. Proin vel porta velit, eu laoreet arcu. Vestibulum ex urna, suscipit sit amet iaculis non, feugiat vel tellus. Nullam ut ullamcorper erat. Etiam pharetra vestibulum enim ac viverra.
Nullam ut nulla euismod, iaculis ex id, ullamcorper elit. Mauris hendrerit arcu a volutpat ullamcorper. Curabitur elementum nisl dolor, a porttitor elit tincidunt sit amet. Nam pharetra eu purus non lobortis. Suspendisse dapibus porttitor eros. Duis feugiat id augue eget venenatis. Pellentesque et lorem felis. Mauris id nibh tristique augue sagittis molestie non ac dolor. Nulla orci sapien, porta non urna nec, scelerisque tempus arcu. Maecenas eu pulvinar est, non mollis nunc. Curabitur vitae suscipit lacus, sit amet lacinia mauris. Nunc a pellentesque libero, ut vehicula neque.

* Donec id dui venenatis, volutpat dolor sit amet, aliquam eros
* Sed lacinia nunc eu volutpat porta
* Curabitur sit amet nibh vitae neque porttitor tincidunt
* Morbi vestibulum lectus sed dignissim fermentum
* Nullam quis ante volutpat, tincidunt urna sed, condimentum lacus
* Proin interdum enim vel rutrum ullamcorper.

Vivamus pretium nisi eget congue consequat. Nulla dictum posuere odio. Ut eu enim ullamcorper, mollis leo eget, lobortis enim. Suspendisse sagittis tortor sit amet purus vestibulum scelerisque. Donec ut nisl non ex egestas posuere vitae sit amet diam. Sed fringilla ex a tellus tincidunt, vel suscipit nisi molestie. Nulla euismod metus lectus, ac pulvinar dui ornare in. Aliquam ornare semper risus, eget tincidunt diam porttitor in. Mauris placerat nunc neque, vel eleifend urna placerat quis. Nam tempor nulla in lorem condimentum eleifend. Duis lacinia est eu blandit ullamcorper. Nulla non elit pulvinar ante convallis auctor. Quisque semper magna ipsum, sed pretium sem pretium et. Vestibulum eu neque nulla.


text:
package com.flipkart.foxtrot.core.querystore.actions;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.doReturn;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.flipkart.foxtrot.common.Document;
import com.flipkart.foxtrot.common.group.GroupRequest;
import com.flipkart.foxtrot.common.group.GroupResponse;
import com.flipkart.foxtrot.common.query.Filter;
import com.flipkart.foxtrot.common.query.general.EqualsFilter;
import com.flipkart.foxtrot.common.query.numeric.GreaterThanFilter;
import com.flipkart.foxtrot.common.stats.Stat;
import com.flipkart.foxtrot.core.TestUtils;
import com.flipkart.foxtrot.core.exception.ErrorCode;
import com.flipkart.foxtrot.core.exception.FoxtrotException;
import com.flipkart.foxtrot.core.querystore.impl.ElasticsearchQueryStore;
import com.google.common.collect.Maps;
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest;
import org.elasticsearch.client.RequestOptions;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

/**
 * Created by rishabh.goyal on 28/04/14.
 */
public class GroupActionTest extends ActionTest {

    @BeforeClass
    public static void setUp() throws Exception {
        List<Document> documents = TestUtils.getGroupDocuments(getMapper());
        getQueryStore().save(TestUtils.TEST_TABLE_NAME, documents);
        getElasticsearchConnection().getClient()
                .indices()
                .refresh(new RefreshRequest("*"), RequestOptions.DEFAULT);
        getTableMetadataManager().getFieldMappings(TestUtils.TEST_TABLE_NAME, true, true);
        ((ElasticsearchQueryStore) getQueryStore()).getCardinalityConfig()
                .setMaxCardinality(15000);
        getTableMetadataManager().updateEstimationData(TestUtils.TEST_TABLE_NAME, 1397658117000L);
    }

    @Ignore
    @Test
    public void testGroupActionSingleQueryException() throws FoxtrotException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Collections.singletonList("os"));
        doReturn(null).when(getElasticsearchConnection())
                .getClient();
        try {
            getQueryExecutor().execute(groupRequest);
            fail();
        } catch (FoxtrotException ex) {
            ex.printStackTrace();
            assertEquals(ErrorCode.ACTION_EXECUTION_ERROR, ex.getCode());
        }
    }

    @Test
    public void testGroupActionSingleFieldNoFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Collections.singletonList("os"));

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", 7L);
        response.put("ios", 4L);

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionSingleFieldEmptyFieldNoFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Collections.singletonList(""));

        try {
            getQueryExecutor().execute(groupRequest);
            fail();
        } catch (FoxtrotException ex) {
            ex.printStackTrace();
            assertEquals(ErrorCode.MALFORMED_QUERY, ex.getCode());
        }
    }

    @Test
    public void testGroupActionSingleFieldSpecialCharactersNoFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Collections.singletonList(""));

        try {
            getQueryExecutor().execute(groupRequest);
            fail();
        } catch (FoxtrotException ex) {
            ex.printStackTrace();
            assertEquals(ErrorCode.MALFORMED_QUERY, ex.getCode());
        }
    }

    @Test
    public void testGroupActionSingleFieldHavingSpecialCharactersWithFilter()
            throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);

        EqualsFilter equalsFilter = new EqualsFilter();
        equalsFilter.setField("device");
        equalsFilter.setValue("nexus");
        groupRequest.setFilters(Collections.<Filter>singletonList(equalsFilter));
        groupRequest.setNesting(Collections.singletonList("!@#$%^&*()"));

        Map<String, Object> response = Maps.newHashMap();

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionSingleFieldWithFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);

        EqualsFilter equalsFilter = new EqualsFilter();
        equalsFilter.setField("device");
        equalsFilter.setValue("nexus");
        groupRequest.setFilters(Collections.<Filter>singletonList(equalsFilter));
        groupRequest.setNesting(Collections.singletonList("os"));

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", 5L);
        response.put("ios", 1L);

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionTwoFieldsNoFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "device"));

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("nexus", 5L);
            put("galaxy", 2L);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("nexus", 1L);
            put("ipad", 2L);
            put("iphone", 1L);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionTwoFieldsWithFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "device"));

        GreaterThanFilter greaterThanFilter = new GreaterThanFilter();
        greaterThanFilter.setField("battery");
        greaterThanFilter.setValue(48);
        groupRequest.setFilters(Collections.<Filter>singletonList(greaterThanFilter));

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("nexus", 3L);
            put("galaxy", 2L);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("ipad", 1L);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionMultipleFieldsNoFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "device", "version"));

        Map<String, Object> response = Maps.newHashMap();

        final Map<String, Object> nexusResponse = new HashMap<String, Object>() {{
            put("1", 2L);
            put("2", 2L);
            put("3", 1L);
        }};
        final Map<String, Object> galaxyResponse = new HashMap<String, Object>() {{
            put("2", 1L);
            put("3", 1L);
        }};
        response.put("android", new HashMap<String, Object>() {{
            put("nexus", nexusResponse);
            put("galaxy", galaxyResponse);
        }});

        final Map<String, Object> nexusResponse2 = new HashMap<String, Object>() {{
            put("2", 1L);
        }};
        final Map<String, Object> iPadResponse = new HashMap<String, Object>() {{
            put("2", 2L);
        }};
        final Map<String, Object> iPhoneResponse = new HashMap<String, Object>() {{
            put("1", 1L);
        }};
        response.put("ios", new HashMap<String, Object>() {{
            put("nexus", nexusResponse2);
            put("ipad", iPadResponse);
            put("iphone", iPhoneResponse);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    public void testGroupActionMultipleFieldsWithFilter() throws FoxtrotException, JsonProcessingException {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "device", "version"));

        GreaterThanFilter greaterThanFilter = new GreaterThanFilter();
        greaterThanFilter.setField("battery");
        greaterThanFilter.setValue(48);
        groupRequest.setFilters(Collections.<Filter>singletonList(greaterThanFilter));

        Map<String, Object> response = Maps.newHashMap();

        final Map<String, Object> nexusResponse = new HashMap<String, Object>() {{
            put("2", 2L);
            put("3", 1L);
        }};
        final Map<String, Object> galaxyResponse = new HashMap<String, Object>() {{
            put("2", 1L);
            put("3", 1L);
        }};
        response.put("android", new HashMap<String, Object>() {{
            put("nexus", nexusResponse);
            put("galaxy", galaxyResponse);
        }});

        final Map<String, Object> iPadResponse = new HashMap<String, Object>() {{
            put("2", 1L);
        }};
        response.put("ios", new HashMap<String, Object>() {{
            put("ipad", iPadResponse);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(response, actualResult.getResult());
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testGroupActionDistinctCountAggregation() {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "version"));
        groupRequest.setUniqueCountOn("device");

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("1", 1L);
            put("2", 2L);
            put("3", 2L);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("1", 1L);
            put("2", 2L);
        }});
        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(((Map<String, Object>) response.get("android")).get("1"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("1"));
        assertEquals(((Map<String, Object>) response.get("android")).get("2"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("2"));
        assertEquals(((Map<String, Object>) response.get("android")).get("3"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("3"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("1"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("ios")).get("1"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("2"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("ios")).get("2"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testGroupActionMaxAggregation() {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "version"));
        groupRequest.setAggregationField("battery");
        groupRequest.setAggregationType(Stat.MAX);

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("1", 48.0);
            put("2", 99.0);
            put("3", 87.0);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("1", 24.0);
            put("2", 56.0);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(((Map<String, Object>) response.get("android")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("1"));
        assertEquals(((Map<String, Object>) response.get("android")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("2"));
        assertEquals(((Map<String, Object>) response.get("android")).get("3"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("3"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("1"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("2"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testGroupActionAvgAggregation() {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "version"));
        groupRequest.setAggregationField("battery");
        groupRequest.setAggregationType(Stat.AVG);

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("1", 36.0);
            put("2", 84.33333333333333);
            put("3", 80.5);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("1", 24.0);
            put("2", 45.0);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(((Map<String, Object>) response.get("android")).get("1"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("1"));
        assertEquals(((Map<String, Object>) response.get("android")).get("2"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("2"));
        assertEquals(((Map<String, Object>) response.get("android")).get("3"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("android")).get("3"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("1"),
                ((Map<String, Object>) actualResult.getResult()
                        .get("ios")).get("1"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("2"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testGroupActionSumAggregation() {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "version"));
        groupRequest.setAggregationField("battery");
        groupRequest.setAggregationType(Stat.SUM);

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("1", 72.0);
            put("2", 253.0);
            put("3", 161.0);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("1", 24.0);
            put("2", 135.0);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(((Map<String, Object>) response.get("android")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("1"));
        assertEquals(((Map<String, Object>) response.get("android")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("2"));
        assertEquals(((Map<String, Object>) response.get("android")).get("3"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("3"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("1"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("2"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testGroupActionCountAggregation() {
        GroupRequest groupRequest = new GroupRequest();
        groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
        groupRequest.setNesting(Arrays.asList("os", "version"));
        groupRequest.setAggregationField("battery");
        groupRequest.setAggregationType(Stat.COUNT);

        Map<String, Object> response = Maps.newHashMap();
        response.put("android", new HashMap<String, Object>() {{
            put("1", 2L);
            put("2", 3L);
            put("3", 2L);
        }});
        response.put("ios", new HashMap<String, Object>() {{
            put("1", 1L);
            put("2", 3L);
        }});

        GroupResponse actualResult = (GroupResponse) getQueryExecutor().execute(groupRequest);
        assertEquals(((Map<String, Object>) response.get("android")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("1"));
        assertEquals(((Map<String, Object>) response.get("android")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("2"));
        assertEquals(((Map<String, Object>) response.get("android")).get("3"), ((Map<String, Object>) actualResult.getResult()
                .get("android")).get("3"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("1"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("1"));
        assertEquals(((Map<String, Object>) response.get("ios")).get("2"), ((Map<String, Object>) actualResult.getResult()
                .get("ios")).get("2"));
    }

}


text:
<!DOCTYPE html>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <link href="user_docs.css" rel="stylesheet" type="text/css">
    <link href="local_extensions.css" rel="stylesheet" type="text/css">
    <title>
      Viewing Timelines- Google Earth User Guide
    </title>

        Google Earth User Guide

        <form action="http://www.google.com/search" class="c3" method="get">
          Search Google Earth

          User Guide

          <form action="http://www.google.com/cse" id="cse-search-box" name="cse-search-box">

              <input name="cx" type="hidden" value="006447561658385433045:da9zsap5cmm">
              <input name="q" size="18" type="text"> <input name="sa" type="submit" value="Search">

          </form>

                Table of Contents

                Introduction

                Finding Places and Directions

                Marking Places

                Using Layers

                Using Map Features

                Using Places

                About KML

                Sharing Places Information

                Using Tours

                Editing Places and Folders

                Managing Search Results

                Measuring Distances and Areas

                Viewing Sky

                Drawing Paths and Polygons

                Using Image Overlays and 3D Models

                Using the Flight Simulator

                Importing Your Data Into Google Earth

                Using Style Templates

                Viewing Timelines

                      Setting Timeline Options

                  Viewing Historical Imagery

                  Viewing Timelines

                      Supported Devices

                      Required Connectors

                      About GPS Points

                      Importing GPS Data

                      Viewing Realtime GPS Information

                Making Movies with Google Earth

                Keyboard Controls

                3D Viewer Options

        </form>

            Viewing Timelines

            If you have downloaded data that contains time information (for example, GPS tracks),
            you can view this information sequentially in Google Earth. For example, you can view
            GPS tracks that occurred within a specific time period and visually follow these
            tracks. To do this:

If necessary, import the GPS data or other time-related data.

In the Places panel, select this data. The time slider appears at the top
            of the 3D viewer with a time range that corresponds to the data you selected.

Do any of the following:

To re-define the time range of data displayed in the 3D viewer, drag the range
            marker (see below) to the right or left.

To move the time range earlier or later, drag the time slider (see below) to the right or left. The range marker moves with
            the time slider so that the time range shown remains the same.

To play an animation of the sequence, click the Play button (see below). Note that this is only useful if only a portion of
            the data is defined in the time range.

            Features of the time slider include:

Click this to play an animation of a sequence. This works best if you
            move the range marker to define a time range smaller than the whole set. Click the
            adjacent buttons to step forward or back.

Drag the range marker to the right or left to re-define the time range of
            data displayed.

Click this to set options for the time
            slider.

Zoom in or out to shorten or lengthen the date range covered by your
            timeline. This allows you to more easily see the different imagery that's available
            within a shorter or longer period of time. Notice that, as you zoom in or out, the
            Start and End dates on the timeline change.

Drag this to move the time range earlier or later.

            Note: The time slider is not available when you record movies.

            Setting Timeline Options

            You can set options for the timeline display feature. To do
            this:

In the time slider, click the settings icon (see
            above). The Date and Time options dialog box appears. Options include:

              Start and End date/time - Set the date and time for the start and
              end of the timeline.

              Display time in - Choose the appropriate type of displayed time.

              Animation speed - Use this slider to set the speed of the animation
              that occurs when you click the play button on the time slider (see above).

                  Loop animation - Select this checkbox to play your animation
                  continuously.

When you are finished, click OK.

          Viewing Historical Imagery
          New!

          By default, Google Earth displays most up-to-date imagery available. You can view
          historical imagery so that you can see how places have changed over time.

          San Francisco in 1946

          To access historical imagery, do one of the following:

Click View > Historical Imagery

Click the Clock icon  in the toolbar above the 3D viewer.

          The small vertical lines on the timeline indicate the dates of
          different imagery available for your location. Notice that the slider is automatically
          positioned at the far right of the timeline, showing that you are viewing more recent
          satellite imagery. Move back or forward in time by doing the following:

Click the Forward or Back buttons above the slider.

Drag the slider along the timeline. Note that regardless of where you release your
          mouse on the timeline, the slider automatically moves to the closest date for which
          imagery is available.

          Viewing Timelines

          If you have a GPS (Global Position System) device, you can connect it to your computer
          and import your waypoint and track data into Google Earth. Note that this set of features
          is available to users of Google Earth Pro and Google Earth EC, but not the free version
          (see Google Earth
          Products). Topics in this section include:

            Supported Devices

            Required Connectors

            About GPS Points

            Importing GPS Data

            Viewing Realtime GPS Information

          Supported Devices

          Google Earth currently supports most GPS devices from the following manufacturers:

            Garmin

            Magellan

          The GPSBabel web site lists the
          devices officially supported by the Google Earth GPS import feature. You can try other
          devices, but they might not work correctly. If you're using a device that is not
          supported, you can try importing GPS data from the device to your computer as a .gpx or
          .loc file and then opening it in Google Earth (File > Open).

          Required Connectors

          You need either a serial or USB cable to connect the GPS device to your computer.
          Typically, your device is sold with one type of cable. If your GPS device did not come
          with a cable, you can visit the manufacturer's web site to purchase the correct one for
          your model.

          About GPS Points

          When your GPS data is imported into Google Earth, it is categorized into three possible
          folders, depending upon the type of point. These folders are:

            Tracks - Tracks (or trackpoints) are the points automatically recorded
            by the GPS device periodically along the recorded route. They can be imported into the
            Google Earth application as paths.

            Waypoints - Waypoints are points entered manually by the user and
            typically marked with a name, such as "home" or "turnaround point."

            Routes - Route points are those points that the GPS device uses to
            creating the routing, such as when you instruct the device to "go to" a
            recorded point from another recorded point. Route points can contain multiple connected
            "go to" instructions. They can be imported into the Google Earth application
            as paths.

          Importing GPS Data

          Tip - If you have a .GPX file on your computer, you can import it by dragging and dropping the
          file into Google Earth.

          Importing the data from your GPS to Google Earth is simple:

If you are using a Garmin USB device and a Windows computer, please install
          the Garmin USB driver from the CD that came with your GPS device or download this driver
          from the Garmin
          website.

Connect your device to the computer running Google Earth.

            You can use either a serial cable or USB cable, depending upon which one came with your
            device.

Turn on the GPS device. Once your device is on and activated, it is not
          necessary to wait until it connects to satellites.

From the Tools menu, select GPS. The GPS window
          appears.

Select the correct manufacturer type for your device.

Under Import, Select the types of data you want to import.

Under Options, choose your drawing preferences. Check Draw
          icons at track and route points if you want an icon to be displayed in the 3D viewer
          for every track/route point recorded by your GPS device. Check Draw lines for tracks
          and routes to draw each GPS track and route as a solid line.

Check the Adjust altitude to ground height check box to adjust all
          recorded point to ground level, such as when importing a track taken on foot, car, or
          bike. However, if your GPS track was recorded while hang gliding or flying, make sure
          this option is not selected so that your points appear as above-ground points.

Click OK. When your GPS data is finished loading into Google Earth, a
          confirmation dialog box appears.

          Your data appears in the Places panel with the label Garmin GPS Device
          or Magellan GPS Device, depending upon the device used (see Supported Devices). If you expand that folder, you can see the data
          sorted into the appropriate folders depending upon the type of data, as illustrated in
          the example below.

          You can expand those folders and explore the information within as you would any other
          type of places data. This includes organizing, editing, sharing, saving, and more.

          Note - If you receive a connection error, turn off the GPS device, turn
          it on again, and start again from Step 4 above.

          Viewing Realtime GPS Information

          If you have connected your portable computer to a GPS device, you can view GPS
          information in realtime. For example, you can view a live GPS track of your progress in a
          car on a laptop in Google Earth as you travel. To do this:

Connect your GPS device and portable computer as described in steps
          1-4 of Importing GPS Data.

In the GPS dialog box, click the Realtime tab.

Choose the appropriate options:

            Select protocol - If you don't know which one to use, choose NMEA.

            Track point import limit - This is the maximum number of points imported per
            poll of the device. A smaller number can result in faster data but a less accurate
            depiction of your journey, while a larger number can mean the opposite.

            Polling interval (seconds) - This is the frequency of which Google Earth
            collects data from the GPS device.

            Automatically follow the path - Check this to have the 3D viewer center on and
            follow the current realtime GPS track.

Click Start to begin realtime GPS tracking.

          ©2010 Google - Privacy Policy -
          Terms and Conditions - About Google

      Updated on


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using DND.Services.Skyscanner.Model;
using Solution.Base.Helpers;
using System.Threading.Tasks;
using DND.Services.SearchEngines;
using DND.Services.Factories;
using DND.Services.SearchEngines.Interfaces;
using System.Threading;

namespace DND.Services.SearchEngines
{

    public class LocaleMarketCurrencySearchEngine : ILocaleMarketCurrencySearchEngine
    {
        private IFlightSearchEngine _flightSearchEngine;
        public LocaleMarketCurrencySearchEngine(string id)
        {
            _flightSearchEngine = new FlightSearchEngineFactory().GetFlightSearchEngine(id);
        }

        public async Task<LocalesServiceResponse> GetLocalesAsync(CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetLocalesAsync(cancellationToken);
        }

        public async Task<Locale> GetLocaleByIDAsync(string id, CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetLocaleByIDAsync(id, cancellationToken);
        }

        public async Task<CountriesServiceResponse> GetMarketsByLocaleAsync(string locale, CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetCountriesByLocaleAsync(locale, cancellationToken);
        }

        public async Task<Country> GetMarketByIDAsync(string id, CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetCountryByIDAsync(id, cancellationToken);
        }

        public async Task<CurrenciesServiceResponse> GetCurrenciesAsync(CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetCurrenciesAsync(cancellationToken);
        }

        public async Task<Currency> GetCurrencyByIDAsync(string id, CancellationToken cancellationToken)
        {
            return await _flightSearchEngine.GetCurrencyByIDAsync(id, cancellationToken);
        }
    }
}


text:
#pragma once
#include "ofMain.h"
#include "ofxXmlSettings.h"
/**
 *  \brief Provides a persistent settings interface for stuff
 *
 *  It's basically a hashmap that saves itself every time you set a value.
 *  Also, if you ever try to get a value, you can optionally provide a default so
 *  it creates a default settings file if one didn't exist in the first place.
 *
 *  It's also accessible everywhere, just include Settings.h and then
 *  do something like
 *
 *  int width = settings.getInt("width", 1024);
 *
 *  Which will load the xml if not done already, then return the width value.
 *  If width hasn't been set, or there is no xml file, one will be created,
 *  using the default value set in the second parameter.
 *
 *  The file format is xml, so easy on the eye when editing.
 */
class ofxSettings {
public:

	ofxSettings();

	// set a value
	void set(string key, string value);
	void set(string key, int value);
	void set(string key, float value);
	void set(string key, bool value);

	/** get a string value (with optional default value) */
	string get(string key, string defaultValue = "");

	/** get an int */
	int getInt(string key, int defaultValue = 0);

	/** get a float */
	float getFloat(string key, float defaultValue = 0);

	/** get a bool */
	bool getBool(string key, bool defaultValue = false);

	/**
	 * Loads the file.
	 */
	void load(string path);

private:
	string xmlFilePath;
	// map of data
	map<string,string> data;

	// have we tried to load yet?
	bool loaded;

	/**
	 * Saves the file. If you don't pass a parameter, it'll try to
	 * save it to the last place it was loaded from.
	 */
	bool save(string path = "");

};

extern ofxSettings settings;


text:
require File.join(File.dirname(__FILE__), "..", "test_helper")

class TestUuidFu < Test::Unit::TestCase
  context UuidFu do
    should "pass" do
      assert true
    end
  end
end


text:
using Microsoft.SqlServer.Server;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.IO;
using System.Linq;

#endregion

namespace DeviceSQL.SQLTypes.ROC
{
    [Serializable()]
    [SqlUserDefinedType(Format.UserDefined, IsByteOrdered = false, IsFixedLength = false, MaxByteSize = -1)]
    public struct ROCPlusHistoryRecordArray : INullable, IBinarySerialize
    {

        #region Fields

        internal List<ROCPlusHistoryRecord> rocPlusHistoryRecords;

        #endregion

        #region Properties

        internal ROCPlusHistoryRecord this[int index]
        {
            get
            {
                return ROCPlusHistoryRecords[index];
            }
            set
            {
                ROCPlusHistoryRecords[index] = value;
            }
        }

        public bool IsNull
        {
            get;
            internal set;
        }

        public int Length
        {
            get
            {
                return ROCPlusHistoryRecords.Count;
            }
        }

        #endregion

        #region Helper Methods

        private List<ROCPlusHistoryRecord> ROCPlusHistoryRecords
        {
            get
            {
                if (rocPlusHistoryRecords == null)
                {
                    rocPlusHistoryRecords = new List<ROCPlusHistoryRecord>();
                }
                return rocPlusHistoryRecords;
            }
        }

        public static ROCPlusHistoryRecordArray Null
        {
            get
            {
                return (new ROCPlusHistoryRecordArray() { IsNull = true });
            }
        }

        public override string ToString()
        {
            return string.Join("|", ROCPlusHistoryRecords.Select(parameter => parameter.ToString()));
        }

        public ROCPlusHistoryRecordArray AddROCPlusHistoryRecord(ROCPlusHistoryRecord rocPlusHistoryRecord)
        {
            ROCPlusHistoryRecords.Add(rocPlusHistoryRecord);
            return this;
        }

        public static ROCPlusHistoryRecordArray Parse(SqlString stringToParse)
        {
            if (stringToParse.IsNull)
            {
                return Null;
            }

            var parsedROCPlusHistoryRecords = new ROCPlusHistoryRecordArray();
            parsedROCPlusHistoryRecords.rocPlusHistoryRecords = new List<ROCPlusHistoryRecord>();
            var parsedString = stringToParse.Value.Split("|".ToCharArray());

            for (var i = 0; parsedString.Length > i; i++)
            {
                parsedROCPlusHistoryRecords.rocPlusHistoryRecords.Add(ROCPlusHistoryRecord.Parse(parsedString[i]));
            }

            return parsedROCPlusHistoryRecords;
        }

        public ROCPlusHistoryRecord GetROCPlusHistoryRecord(SqlInt32 index)
        {
            return ROCPlusHistoryRecords[index.Value];
        }

        public static ROCPlusHistoryRecordArray Empty()
        {
            var rocPlusHistoryRecord = new ROCPlusHistoryRecordArray { rocPlusHistoryRecords = new List<ROCPlusHistoryRecord>() };
            return rocPlusHistoryRecord;
        }

        #endregion

        #region Serialization Methods

        public void Read(BinaryReader binaryReader)
        {
            ROCPlusHistoryRecords.Clear();
            IsNull = binaryReader.ReadBoolean();

            if (IsNull)
            {
                return;
            }
            else
            {
                var length = binaryReader.ReadInt32();

                for (var i = 0; length > i; i++)
                {
                    var rocPlusHistoryRecord = new ROCPlusHistoryRecord();
                    rocPlusHistoryRecord.Read(binaryReader);
                    ROCPlusHistoryRecords.Add(rocPlusHistoryRecord);
                }
            }

        }

        public void Write(BinaryWriter binaryWriter)
        {
            binaryWriter.Write(IsNull);
            binaryWriter.Write(Length);

            if (Length > 0)
            {
                for (var i = 0; ROCPlusHistoryRecords.Count > i; i++)
                {
                    ROCPlusHistoryRecords[i].Write(binaryWriter);
                }
            }
        }

        #endregion

    }
}


text:
"use strict";

 define(['jquery', 'ncc', 'NccLayout'], function($, ncc, NccLayout) {
    return $.extend(true, {}, NccLayout, {
        name: 'transactions',
        url: 'transactions.html',
        template: 'rv!layout/transactions',
        parent: 'wallet',
        local: {
        	scrollBottomTolerance: 100
        },
        initOnce: function() {
        	/**
        	 * @param {string} type load type: 'reload' | 'update' | 'append'
        	 */
			ncc.loadTransactions = function(type) {
				var api = ncc.get('transactions.filter');
				var currAccount = ncc.get('activeAccount.address');
				var requestData = { account: currAccount };
				var currTxes = ncc.get('transactions.filtered');
				if (type === 'append') {
					requestData.hash = (currTxes && currTxes.length) ? currTxes[currTxes.length - 1].hash : undefined;
				}

				ncc.postRequest(api, requestData, function(data) {
					var updatedTxes = ncc.processTransactions(data.transactions);
					var all;
					if (type === 'append' && currTxes && currTxes.concat) {
						all = currTxes.concat(updatedTxes);
					} else if (type === 'update') {
						all = ncc.updateNewer(updatedTxes, currTxes, 'hash');
					} else {
						all = updatedTxes;
					}

                    ncc.set('transactions.filtered', all);
                    if (type !== 'update') {
                    	var gotAll = updatedTxes.length < ncc.consts.txesPerPage;
                		ncc.set('transactions.gotAll', gotAll);
                		if (gotAll) {
                			ncc.global.$window.off('scroll.txesInfiniteScrolling');
                		}
                	}
                }, null, type === 'update');
			};
		},
    	setupEverytime: function() {
    		var local = this.local;

			local.listeners.push(ncc.observe('activeAccount.address transactions.filter', function() {
				ncc.loadTransactions('reload');
			}));

			local.intervalJobs.push(setInterval(function() {
				ncc.loadTransactions('update');
			}, local.autoRefreshInterval));

			var $win = ncc.global.$window;
			var $doc = ncc.global.$document;
			$win.on('scroll.txesInfiniteScrolling', function(event) {
				if (!ncc.get('status.loadingOlderTransactions') && $win.scrollTop() + $win.height() >= $doc.height() - local.scrollBottomTolerance) {
					ncc.loadTransactions('append');
				}
			});
    	},
    	leave: [function() {
    		ncc.global.$window.off('scroll.txesInfiniteScrolling');
    	}]
    });
});


text:
const html = require('choo/html');

const sidebar = require('../components/sidebar.js');
const done = require('../components/done.js');

module.exports = (state, prev, send) => {
  return html`
    <div id="root" class="layout">
      ${sidebar(state, prev, send)}
      ${done(state, prev, send)}
    </div>
  `;
}


text:
		<title>Hoteles Disponibles</title>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<link rel="stylesheet" type="text/css" href="Css/Estilo.css">

		<form form action="Index.html" method="post" class=usuario>

<marquee>Disponible!</marquee>

Para hacer su reservación, favor ir a Reservaciones y seleccionar la oferta de su preferencia

<input type="submit" value="Volver al Inicio">

		</form>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd" >
<struts>
	<package name="share" extends="closeSessionInterceptor" namespace="/share">

		<!-- 获取街道下面的社区 -->
		<action name="address"
			class="com.tq.requisition.presentation.actions.share.Address"
			method="listById"></action>

			<!-- 上传文件 -->
		<action name="updateFile"
			class="com.tq.requisition.presentation.actions.share.FileUploade"
			method="updateFile"></action>

		<!-- 获取政策法规类型 -->
		<action name="docFileType"
			class="com.tq.requisition.presentation.actions.share.DocFileType"
			method="list"></action>

		<!-- 保存base64文件 -->
		<action name="saveFile"
			class="com.tq.requisition.presentation.actions.share.FileUploade"
			method="saveFile"></action>

		<!-- 人员信息 -->
		<action name="personInfo" class="com.tq.requisition.presentation.actions.share.PersonInfo">
			<result name="success">../WEB-INF/view/share/personInfo.jsp</result>
		</action>

		<!-- 项目信息 -->
		<action name="projectInfo" class="com.tq.requisition.presentation.actions.share.ProjectInfo">
			<result name="success">../WEB-INF/view/share/projectInfo.jsp</result>
		</action>

		<!-- 项目列表 -->
		<action name="projectList" class="com.tq.requisition.presentation.actions.share.ProjectList">
			<result name="success">../WEB-INF/view/share/projectList.jsp</result>
		</action>

		<!-- 人员列表 -->
		<action name="personList" class="com.tq.requisition.presentation.actions.share.PersonList">
			<result name="success">../WEB-INF/view/share/personList.jsp</result>
		</action>

		<!-- 户列表 -->
		<action name="huList" class="com.tq.requisition.presentation.actions.share.HuList">
			<result name="success">../WEB-INF/view/share/huList.jsp</result>
		</action>
		<action name="huListList" method="list" class="com.tq.requisition.presentation.actions.share.HuList"></action>

			<!-- 拍照 -->
		<action name="photographs" class="com.tq.requisition.presentation.actions.share.Photographs">
			<result name="success">../WEB-INF/view/share/photographs.jsp</result>
		</action>

		<!-- 登陆 -->
		<action name="login" class="com.tq.requisition.presentation.actions.Index"  method="login"></action>

	</package>
</struts>


text:
module Llvm.Asm.Printer.Common
       (module Llvm.Asm.Printer.Common
       ,module Text.PrettyPrint
       )
       where

import Text.PrettyPrint
import Data.Monoid (mempty)
import qualified Data.Map as M(Map, foldWithKey)

angleBrackets :: Doc -> Doc
angleBrackets x = char '<' <> x <> char '>'

commaSepList :: [Doc] -> Doc
commaSepList l = hsep $ punctuate comma l

commaSepNonEmpty :: [Doc] -> Doc
commaSepNonEmpty l = commaSepList (filter (not . isEmpty) l)

sepMaybe :: (a -> Doc) -> (Doc -> Doc) -> Maybe a -> Doc
sepMaybe f _  (Nothing) = empty
sepMaybe f sep (Just x) = sep $ f x


text:
<html>
<body>
<script type="text/javascript" charset="utf-8">
if (!window.test)
  window.test = 'window'
require('ipc').send('preload', window.test);
</script>
</body>
</html>


text:
using System;
using Dapper;
using Microsoft.AspNetCore.Mvc;
using System.Data;
using System.Data.SqlClient;

namespace Novanet.Ndc2017.Api.Controllers
{
    [Route("api/[controller]")]
    public class EmotionsController : Controller
    {
        // GET api/values
        [HttpPost]
        public void Post([FromBody]Emotions emotions)
        {

            using (IDbConnection db = new SqlConnection(Environment.GetEnvironmentVariable("ndc2017sql")))
            {
                db.Execute(@"INSERT INTO
[dbo].[Emotions]([PhotoId],[Anger],[Contempt],[Disgust],[Fear],[Happiness],[Neutral],[Sadness],[Surprise], [Added])
VALUES (@photoId, @anger, @contempt, @disgust, @fear, @happiness, @neutral, @sadness, @surprise, GETDATE())",
                    new
                    {
                        emotions.photoId,
                        emotions.anger,
                        emotions.contempt,
                        emotions.disgust,
                        emotions.fear,
                        emotions.happiness,
                        emotions.neutral,
                        emotions.sadness,
                        emotions.surprise
                    });
            }
        }
    }

    public class Emotions
    {
        public string photoId { get; set; }
        public string blobUri { get; set; }
        public string anger { get; set; }
        public string contempt { get; set; }
        public string disgust { get; set; }
        public string fear { get; set; }
        public string happiness { get; set; }
        public string neutral { get; set; }
        public string sadness { get; set; }
        public string surprise { get; set; }
    }
}


text:
package org.apache.ignite.internal.processors.cache.binary;

import org.apache.ignite.internal.managers.discovery.DiscoCache;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.lang.IgniteUuid;
import org.jetbrains.annotations.Nullable;

/**
 * Acknowledge message for {@link MetadataUpdateProposedMessage}: see its javadoc for detailed description of protocol.
 *
 * As discovery messaging doesn't guarantee that message makes only one pass across the cluster
 * <b>MetadataUpdateAcceptedMessage</b> enables to mark it as duplicated so other nodes won't process it but skip.
 */
public class MetadataUpdateAcceptedMessage implements DiscoveryCustomMessage {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private final IgniteUuid id = IgniteUuid.randomUuid();

    /** */
    private final int typeId;

    /** */
    private final int acceptedVer;

    /** */
    private boolean duplicated;

    /**
     * @param typeId Type id.
     * @param acceptedVer Accepted version.
     */
    MetadataUpdateAcceptedMessage(int typeId, int acceptedVer) {
        this.typeId = typeId;
        this.acceptedVer = acceptedVer;
    }

    /** {@inheritDoc} */
    @Override public IgniteUuid id() {
        return id;
    }

    /** {@inheritDoc} */
    @Nullable @Override public DiscoveryCustomMessage ackMessage() {
        return null;
    }

    /** {@inheritDoc} */
    @Override public boolean isMutable() {
        return true;
    }

    /** {@inheritDoc} */
    @Nullable @Override public DiscoCache createDiscoCache(GridDiscoveryManager mgr,
        AffinityTopologyVersion topVer, DiscoCache discoCache) {
        throw new UnsupportedOperationException();
    }

    /** */
    int acceptedVersion() {
        return acceptedVer;
    }

    /** */
    public int typeId() {
        return typeId;
    }

    /** */
    public boolean duplicated() {
        return duplicated;
    }

    /**
     * @param duplicated duplicated flag.
     */
    public void duplicated(boolean duplicated) {
        this.duplicated = duplicated;
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(MetadataUpdateAcceptedMessage.class, this);
    }
}


text:
export default function (text = 'Hello world') {
  const element = document.createElement('div');

  element.innerHTML = text;

  return element;
}


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

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.

=cut

package Bio::EnsEMBL::Production::Pipeline::OntologiesLoad::AddSubsetMap;

use strict;
use warnings FATAL => 'all';

use Bio::EnsEMBL::Hive::DBSQL::DBConnection;
use base ('Bio::EnsEMBL::Production::Pipeline::Common::Base');

sub fetch_input {
}

sub run {
    my $self = shift @_;

}

sub write_output {
    my $self = shift @_;

    my $statement = q(
        SELECT DISTINCT
                ontology.name,
                subset.name
        FROM    ontology,
                term,
                subset
        WHERE   ontology.ontology_id = term.ontology_id
          AND   is_obsolete = 0
          AND   FIND_IN_SET(subset.name, term.subsets) > 0
    );

    my $table_template = q(
        CREATE TABLE %s (
          term_id           INT UNSIGNED NOT NULL,
          subset_term_id    INT UNSIGNED NOT NULL,
          distance          TINYINT UNSIGNED NOT NULL,
          UNIQUE INDEX map_idx (term_id, subset_term_id)
        ) ENGINE=MyISAM
        SELECT  child_term.term_id AS term_id,
                parent_term.term_id AS subset_term_id,
                MIN(distance) AS distance
        FROM    ontology
          JOIN  term parent_term
            ON  (parent_term.ontology_id = ontology.ontology_id)
          JOIN  closure
            ON  (closure.parent_term_id = parent_term.term_id)
          JOIN  term child_term
            ON  (child_term.term_id = closure.child_term_id)
        WHERE   ontology.name = %s
          AND   FIND_IN_SET(%s, parent_term.subsets) > 0
          AND   parent_term.ontology_id = closure.ontology_id
          AND   child_term.ontology_id = closure.ontology_id
          AND   parent_term.is_obsolete = 0
          AND   child_term.is_obsolete = 0
        GROUP BY child_term.term_id, parent_term.term_id
    );

    my $drop_statement = q(
        SHOW TABLES LIKE 'aux_%'
    );

    my $dbc = Bio::EnsEMBL::Hive::DBSQL::DBConnection->new(-url => $self->param_required('db_url'));
    $dbc->connect();
    my $dbh = $dbc->db_handle();

    my $droph = $dbc->prepare($drop_statement);

    # drop all previous auxiliary table
    $droph->execute();
    while (my $drop_table_name = $droph->fetchrow_array()) {
        $self->warning('Dropping: ' . $drop_table_name);
        $dbh->do('DROP TABLE `'. $drop_table_name.'`');
    }

    my $sth = $dbc->prepare($statement);

    $sth->execute();

    my ($ontology_name, $subset_name);

    $sth->bind_columns(\($ontology_name, $subset_name));

    while ($sth->fetch()) {

        my $aux_table_name = $dbh->quote_identifier(
            sprintf("aux_%s_%s_map", uc($ontology_name), $subset_name));

        printf("Creating and populating %s...\n", $aux_table_name);

        $dbc->do(sprintf($table_template,
            $aux_table_name, $dbh->quote($ontology_name),
            $dbh->quote($subset_name)));

        if ($dbh->err()) {
            printf("MySQL error, \"%s\", skipping...\n", $dbc->errstr());
            next;
        }

    }
}
1;


text:
package edu.uci.eecs.spectralLDA.textprocessing

import org.scalatest._
import org.apache.spark.SparkContext
import edu.uci.eecs.spectralLDA.testharness.Context
import breeze.linalg._

class TextProcessorTest extends FlatSpec with Matchers {

  private val sc: SparkContext = Context.getSparkContext

  "Inverse Document Frequency" should "be correct" in {
    val docs = Seq[(Long, SparseVector[Double])](
      (1000L, SparseVector[Double](0.0, 0.0, 7.0)),
      (1001L, SparseVector[Double](0.0, 3.0, 5.0)),
      (1002L, SparseVector[Double](1.0, 3.0, 0.5))
    )
    val docsRDD = sc.parallelize[(Long, SparseVector[Double])](docs)

    val idf = TextProcessor.inverseDocumentFrequency(docsRDD)

    norm(idf - DenseVector[Double](3.0, 1.5, 1.0)) should be <= 1e-8
  }

  "Filtering for a given IDF lower bound" should "be correct" in {
    val docs = Seq[(Long, SparseVector[Double])](
      (1000L, SparseVector[Double](0.0, 0.0, 7.0)),
      (1001L, SparseVector[Double](0.0, 3.0, 5.0)),
      (1002L, SparseVector[Double](1.0, 3.0, 0.5))
    )
    val docsRDD = sc.parallelize[(Long, SparseVector[Double])](docs)

    val filteredRDD = TextProcessor.filterIDF(docsRDD, 1.5)

    filteredRDD.collect should contain theSameElementsAs Array[(Long, SparseVector[Double])](
      (1000L, SparseVector[Double](0.0, 0.0, 0.0)),
      (1001L, SparseVector[Double](0.0, 3.0, 0.0)),
      (1002L, SparseVector[Double](1.0, 3.0, 0.0))
    )
  }
}


text:
package ru.job4j.carsale.filter;

import ru.job4j.carsale.dao.AdDao;
import ru.job4j.models.Ad;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class ManageAdFilter implements Filter {
    private final AdDao adDao = new AdDao();

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        HttpSession session = request.getSession();
        Integer userId = (Integer) session.getAttribute("userId");

        int id = Integer.valueOf(request.getParameter("id"));
        Ad ad = adDao.getById(id);

        if (userId == ad.getUser().getId()) {
            filterChain.doFilter(servletRequest, servletResponse);
        } else {
            ((HttpServletResponse) servletResponse).sendRedirect(String.format("%s/list", request.getContextPath()));
        }
    }

    @Override
    public void destroy() {
        adDao.close();
    }
}


text:
Example 1: HA + Nova-network FlatDHCP manager
=============================================

As a model example, the following configuration is used:

* **Deployment mode:** Multi-node HA

* **Networking model:** Nova-network FlatDHCP manager

**Hardware and environment:**

* 7 servers with two 1Gb/s Ethernet NIC and IPMI
* 1 Cisco Catalyst 2960G switch
* Independent out of band management network for IPMI
* Connection to the Internet or/and DC network via a router called
  **Gateway** and IP 172.16.1.1

**Node Server roles:**

* 1 server as Fuel Node
* 3 servers as Controller Node
* 1 server as Cinder Node
* 2 servers as Compute Node

**Network configuration plan:**

* Public network 172.16.1.0/24
* Floating network 172.16.0.0/24 in VLAN 100
* Management network 192.168.0.0/24 in VLAN 101
* Storage network 192.168.1.0/24 in VLAN 102
* Private (Fixed) network 10.0.0.0/24 in VLAN 103
* Administrative network (for Fuel) 10.20.0.0/24 in VLAN 104

**Network Parameters:**

* Fuel server IP: 10.20.0.2/24
* Default gateway: 10.20.0.1
* DNS 10.20.0.1

.. note:: The Internet and rest of DC access is available through the  Public
          network (for OpenStack Nodes) and Administrative network (Fuel server)

From the server node side, ports with the following VLAN IDs for
networks are used:

* eth0 -  Management VLAN 101 (tagged), Storage VLAN 102(tagged) and Administrative VLAN 104 (untagged)

* eth1 -  Public/Floating VLAN 100 (tagged), Private VLAN 103 (tagged)