text:
(function () {
  "use strict";
  var componentConfig = {
    bindings: {
      barcode: "<",
      onCancelClicked: "&",
      onAddCompleted: "&",
      serviceProviders: "<",
      onEditOpCompleted: "&",
      isForEdit: "<",
      editedSchedule: "<"
    },
    controller: [
      "$scope",
      "$rootScope",
      "$timeout",
      "fpm-utilities-factory",
      "work-orders-factory",
      "authenticationFactory",
      function (
        $scope,
        $rootScope,
        $timeout,
        fpmUtilitiesFactory,
        workOrdersFactory,
        authenticationFactory
      ) {
        var vm = this;
        vm.errors = [];
        vm.dateTimeFormat = $rootScope.dateFormat;
        //vm.user = authenticationFactory.getLoggedInUserInfo();
        var scheduleSchema = {
          serviceProvider: "",
          startDate: new Date(),
          endTime: new Date(),
          fromMobile: true,
          barCode: vm.barcode,
          intuitQboItemId: ""
        };
        //updateSchedule2
        vm.newSchedule = angular.copy(scheduleSchema);
        vm.events = {
          closeProductEditModal: function () {
            if (angular.isFunction(vm.onCancelClicked)) {
              vm.onCancelClicked();
            }
          },
          addScheduleClicked: function () {
            vm.errors = [];
            vm.showError = false;
            var schedule = angular.copy(vm.newSchedule);
            schedule.startDate = fpmUtilitiesFactory.toStringDate(
              vm.newSchedule.startDate
            );
            schedule.endTime = fpmUtilitiesFactory.toStringDate(
              vm.newSchedule.endTime
            );
            if (vm.isForEdit) {
              schedule = angular.copy(vm.editedSchedule);
              schedule.technicianNum = vm.newSchedule.serviceProvider;
              schedule.scheduledStartDateTime = fpmUtilitiesFactory.toStringDate(
                vm.newSchedule.startDate
              );;
              schedule.scheduledFinishDateTime = fpmUtilitiesFactory.toStringDate(
                vm.newSchedule.endTime
              );
            }
            fpmUtilitiesFactory.showLoading().then(function () {
              var _promise = vm.isForEdit ? workOrdersFactory.updateSchedule2 : workOrdersFactory.addWorkOrderSchedule;
              _promise(schedule)
                .then(function (response) {
                  if (
                    angular.isDefined(response.model) &&
                    angular.isArray(response.model.errors) &&
                    response.model.errors.length > 0
                  ) {
                    vm.errors = response.model.errors;
                    vm.showError = true;
                  } else {
                    if (angular.isFunction(vm.onAddCompleted) && !vm.isForEdit) {
                      vm.onAddCompleted({
                        o: {
                          invoice: response.invoice,
                          schedules: response.schedule
                        }
                      });
                    }
                    if (angular.isFunction(vm.onEditOpCompleted) && vm.isForEdit) {
                      vm.onEditOpCompleted({
                        isDone: true
                      });
                    }
                  }
                })
                .finally(fpmUtilitiesFactory.hideLoading);
            });
          },
          onServiceProviderSelectionChanged: function () {}
        };

        vm.$onInit = function () {

          vm.user = authenticationFactory.getLoggedInUserInfo();
          //$timeout(function() {
          vm.dateTimeFormat = vm.user.dateFormat;
          //}, 100);

          if (vm.isForEdit && vm.editedSchedule) {
            $timeout(function () {
              vm.newSchedule.serviceProvider = vm.editedSchedule.technicianNum;
              vm.newSchedule.startDate = kendo.parseDate(vm.editedSchedule.scheduledStartDateTime);
              vm.newSchedule.endTime = kendo.parseDate(vm.editedSchedule.scheduledFinishDateTime);
              vm.newSchedule.num = vm.editedSchedule.num;
              vm.newSchedule.barCode = vm.editedSchedule.barcode;
            }, 50)
          }
        };
      }
    ],
    controllerAs: "vm",
    templateUrl: "js/work-orders/add-schedule-modal-component.template.html"
  };
  angular.module("fpm").component("addScheduleModalComponent", componentConfig);
})();


text:
<?php

// Biz parameters
// ----------------------------

// relative path from newsd.php to temp text file containing URLs of channels to be fetched
$tmpSrcTxtFile = "tmp/cchannels";

// relative path from newsd.php to the file that, if found, stops the deamon without fetching subsequent URLs
$stop_newsd_now_cmdfile = "cmd/stop_newsd_now";

// relative path from newsd.php to the file that, if found, stops the daemon when all channels have been fetched. Otherwise, the deamon restarts from the first channel in the list.
$stop_newsd_cmdfile = "cmd/stop_newsd";

// relative path from newsd.php to temp xml files containing currently fetched channel content
$tmpCurrUnzippedXmlFile = "tmp/uncompressed.xml";
$tmpCurrXmlFile = "tmp/channel.xml";
$tmpCurrOriginalXmlFile = "tmp/original_channel.xml";
$tmpPartFolder = "tmp";

// src db conn data

$dbhost = "";
$dbuser = "";
$dbpass = "";
$dbname = "";

//db tables
$dbtable__twitter_twitted = "";
$dbtable__admin_news = "";
$dbtable__twitter_shorturl = "";
$dbtable__admin_channels = "";
$dbtable__stats_visualizzazioni = "";

// db fields
$dbfield__newsid = "";
$dbfield__id = "";
$dbfield__admin_news_channel = "";
$dbfield__admin_channels_channel = "";
$dbfield__content = "";
$dbfield__news = "";
$dbfield__skip = "";
$dbfield__stats_visualizzazioni_newsid = "";
$dbfield__twitter_shorturl_id = "";
$dbfield__stats_visualizzazioni_newstitle = "";
$dbfield__admin_channels_referer = "";

// website url
$websiteUrl = "";

// log
$newsLogFolder = "log";

// Facebook

$fbposting_enabled = false;
$appid = "";
$appsecret = "";
$pageAccessToken = "";
$fb_api_post_path = "";

// Twitter

$tweets_enabled = false;
$consumer_key = "";
$consumer_secret = "";
$user_token = "";
$user_secret = "";

global $tmpSrcTxtFile, $stop_newsd_now_cmdfile, $stop_newsd_cmdfile, $tmpCurrUnzippedXmlFile, $tmpCurrXmlFile, $tmpCurrOriginalXmlFile, $tmpPartFolder, $dbhost, $dbuser, $dbpass, $dbname, $dbtable__twitter_twitted, $dbtable__admin_news, $dbtable__twitter_shorturl, $dbtable__admin_channels, $dbtable__stats_visualizzazioni, $dbfield__newsid, $dbfield__id, $dbfield__admin_news_channel, $dbfield__admin_channels_channel, $dbfield__content, $dbfield__news, $dbfield__skip, $dbfield__stats_visualizzazioni_newsid, $dbfield__twitter_shorturl_id, $dbfield__stats_visualizzazioni_newstitle,$dbfield__admin_channels_referer, $newsLogFolder, $fbposting_enabled, $appid, $appsecret, $pageAccessToken, $fb_api_post_path, $tweets_enabled, $consumer_key, $consumer_secret, $user_token, $user_secret;

?>

redpajama_set_name: RedPajamaGithub


text:
package utilities

import anorm._
import play.api.db.DB
import play.api.Logger
import play.api.Play.current

/**
 * A utility object for general purpose database operations
 */
object DatabaseOperations {
  /**
   * Creates a new item in the database
   *
   * @param insertSql Sql for inserting the item
   * @param obtainSql Sql for obtaining the created item back from the database
   * @param rowParser Row parser to parse the query result
   * @param itemName  Name of the item to use in logging
   *
   * @tparam T  Type of the item
   *
   * @return  An optional item
   */
  def create[T](insertSql: Sql, obtainSql: Sql, rowParser: RowParser[T], itemName: String): Option[T] = {
    try {
      DB.withConnection { implicit c =>
        if(insertSql.executeUpdate() > 0)
          obtainSql.as(rowParser *).headOption
        else {
          Logger.error(s"$itemName.create() - Couldn't create $itemName, insert failed!")
          None
        }
      }
    }
    catch {
      case e: Exception =>
        Logger.error(s"$itemName.create() - ${e.getMessage}")
        None
    }
  }

  /**
   * Reads an item from the database
   *
   * @param readSql   Sql for reading the item from the database
   * @param rowParser Row parser to parse the query result
   * @param itemName  Name of the item to use in logging
   *
   * @tparam T  Type of the item
   *
   * @return  An optional item
   */
  def read[T](readSql: Sql, rowParser: RowParser[T], itemName: String): Option[T] = {
    try {
      DB.withConnection { implicit c =>
        readSql.as(rowParser *).headOption
      }
    }
    catch {
      case e: Exception =>
        Logger.error(s"$itemName.read() - ${e.getMessage}")
        None
    }
  }

  /**
   * Deletes an item from the database
   *
   * @param deleteSql Sql for deleting the item
   * @param itemName  Name of the item to use in logging
   *
   * @tparam T  Type of the item
   *
   * @return  true if successful, false otherwise
   */
  def delete[T](deleteSql: Sql, itemName: String): Boolean = {
    try {
      DB.withConnection { implicit c =>
        deleteSql.executeUpdate() > 0
      }
    }
    catch {
      case e: Exception =>
        Logger.error(s"$itemName.delete() - ${e.getMessage}")
        false
    }
  }
}


text:
.. currentmodule:: machine

class WDT -- watchdog timer
===========================

.. only:: not port_pycom_esp32

    The WDT is used to restart the system when the application crashes and ends
    up into a non recoverable state. Once started it cannot be stopped or
    reconfigured in any way. After enabling, the application must "feed" the
    watchdog periodically to prevent it from expiring and resetting the system.

.. only:: port_pycom_esp32

    The WDT is used to restart the system when the application crashes and ends
    up into a non recoverable state. After enabling, the application must "feed"
    the watchdog periodically to prevent it from expiring and resetting the system.

Example usage::

    from machine import WDT
    wdt = WDT(timeout=2000)  # enable it with a timeout of 2 seconds
    wdt.feed()

Constructors
------------

.. class:: WDT(id=0, timeout)

   Create a WDT object and start it. The ``id`` can only be 0.
   See the ``init`` method for the parameters of initialisation.

Methods
-------

.. class:: init(timeout)

   Initializes the watchdog timer. The timeout must be given in milliseconds.
   Once it is running the WDT cannot be stopped but the timeout can be re-configured
   at any point in time.

.. method:: wdt.feed()

   Feed the WDT to prevent it from resetting the system. The application
   should place this call in a sensible place ensuring that the WDT is
   only fed after verifying that everything is functioning correctly.


text:
/* jshint asi: true */
/* global define: false */
define(function(require, exports, module) {
    require("jquery")
    var $ = jQuery

    var app
    var API_BASE = "https://api.github.com/repos/jamesfancy/jamesfancy.github.io/"

    function api() {
        return API_BASE + [].slice.call(arguments, 0).join("/")
    }

    function call(callback) {
        if (typeof callback === "function") {
            callback.apply(null, [].slice.call(arguments, 1))
        }
    }

    function jsonApi(method, url, data, callback) {
        if (typeof data === "function") {
            callback = data
            data = null
        }

        $.ajax(url, {
            type: method || "get",
            dataType: "json",
            data: data
        }).done(function(json) {
            call(callback, null, json)
        }).fail(function(xhr) {
            call(callback, xhr || {})
        })
    }

    var github = {
        getIssues: function(page, callback) {
            jsonApi("get", api("issues"), callback)
        },
        getIssue: function(id, callback) {
            jsonApi("get", api("issues", id), callback)
        },
        getComment: function() {

        }
    }

    return function(_app) {
        app = app
        return github
    }
})


text:
    import "github.com/jtacoma/go-zpl"

[![Build Status](https://drone.io/github.com/jtacoma/go-zpl/status.png)](https://drone.io/github.com/jtacoma/go-zpl/latest) [![Build Status](https://travis-ci.org/jtacoma/go-zpl.png)](https://travis-ci.org/jtacoma/go-zpl) [![Coverage Status](https://coveralls.io/repos/jtacoma/go-zpl/badge.png?branch=master)](https://coveralls.io/r/jtacoma/go-zpl?branch=master)

The go-zpl package provides methods for consuming and producing data
in the ZeroMQ Property Language (ZPL).

ZPL is defined here: http://rfc.zeromq.org/spec:4.

    package main

    import "github.com/jtacoma/go-zpl"

    var data = `
    endpoints
        worker1
            addr = 192.168.0.10
            port = 8080
        worker2
            addr = 192.168.0.11
            port = 9999
    `

    type Endpoint struct {
        Address string `zpl:"addr"`
        Port    int    `zpl:"port"`
    }

    type Config struct {
        Endpoints map[string]*Endpoint `zpl:"endpoints"`
    }

    var config Config

    func main() {
        if err := zpl.Unmarshal([]byte(data), &config); err != nil {
            panic(err.Error())
        }
        // ...
        println(config.Endpoints["worker1"].Port)
        // ...
    }

This package mimics Go's standard "encodings" packages so should be
easy to get started with.  Since this package is new, there may be
some loose ends: please submit bug reports to:

https://github.com/jtacoma/go-zpl/issues

The errors include line numbers but not yet much else.  For example,
it doesn't mention that you've got an underscore in name, a number
sign in a value, or a tab character where a multiple of 4 spaces was
expected.

While ZPL shares some structural qualities with JSON there are some
major differences worth noting.  First, the root must be either an
object or a map.  Of course, in a configuration file format, this
makes perfect sense.  Second, two or more ZPL files can be
effectively merged by simply concatenating them together.  Given that
configuration files are often split into different scopes (e.g.
system, application, user), this feature is also good news.

## License

Use of this source code is governed by a BSD-style license that can be found in
the LICENSE file.


text:
'use strict'

var express = require('..');
var request = require('supertest');
var utils = require('./support/utils');

describe('res', function(){
  describe('.redirect(url)', function(){
    it('should default to a 302 redirect', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com');
      });

      request(app)
      .get('/')
      .expect('location', 'http://google.com')
      .expect(302, done)
    })

    it('should encode "url"', function (done) {
      var app = express()

      app.use(function (req, res) {
        res.redirect('https://google.com?q=\u2603 §10')
      })

      request(app)
      .get('/')
      .expect('Location', 'https://google.com?q=%E2%98%83%20%C2%A710')
      .expect(302, done)
    })

    it('should not touch already-encoded sequences in "url"', function (done) {
      var app = express()

      app.use(function (req, res) {
        res.redirect('https://google.com?q=%A710')
      })

      request(app)
      .get('/')
      .expect('Location', 'https://google.com?q=%A710')
      .expect(302, done)
    })
  })

  describe('.redirect(status, url)', function(){
    it('should set the response status', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect(303, 'http://google.com');
      });

      request(app)
      .get('/')
      .expect('Location', 'http://google.com')
      .expect(303, done)
    })
  })

  describe('.redirect(url, status)', function(){
    it('should set the response status', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com', 303);
      });

      request(app)
      .get('/')
      .expect('Location', 'http://google.com')
      .expect(303, done)
    })
  })

  describe('when the request method is HEAD', function(){
    it('should ignore the body', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com');
      });

      request(app)
        .head('/')
        .expect(302)
        .expect('Location', 'http://google.com')
        .expect(utils.shouldNotHaveBody())
        .end(done)
    })
  })

  describe('when accepting html', function(){
    it('should respond with html', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com');
      });

      request(app)
      .get('/')
      .set('Accept', 'text/html')
      .expect('Content-Type', /html/)
      .expect('Location', 'http://google.com')
      .expect(302, '
Found. Redirecting to http://google.com
', done)
    })

    it('should escape the url', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('<la\'me>');
      });

      request(app)
      .get('/')
      .set('Host', 'http://example.com')
      .set('Accept', 'text/html')
      .expect('Content-Type', /html/)
      .expect('Location', '%3Cla\'me%3E')
      .expect(302, '
Found. Redirecting to %3Cla'me%3E
', done)
    })

    it('should include the redirect type', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect(301, 'http://google.com');
      });

      request(app)
      .get('/')
      .set('Accept', 'text/html')
      .expect('Content-Type', /html/)
      .expect('Location', 'http://google.com')
      .expect(301, '
Moved Permanently. Redirecting to http://google.com
', done);
    })
  })

  describe('when accepting text', function(){
    it('should respond with text', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com');
      });

      request(app)
      .get('/')
      .set('Accept', 'text/plain, */*')
      .expect('Content-Type', /plain/)
      .expect('Location', 'http://google.com')
      .expect(302, 'Found. Redirecting to http://google.com', done)
    })

    it('should encode the url', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://example.com/?param=');
      });

      request(app)
      .get('/')
      .set('Host', 'http://example.com')
      .set('Accept', 'text/plain, */*')
      .expect('Content-Type', /plain/)
      .expect('Location', 'http://example.com/?param=%3Cscript%3Ealert(%22hax%22);%3C/script%3E')
      .expect(302, 'Found. Redirecting to http://example.com/?param=%3Cscript%3Ealert(%22hax%22);%3C/script%3E', done)
    })

    it('should include the redirect type', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect(301, 'http://google.com');
      });

      request(app)
      .get('/')
      .set('Accept', 'text/plain, */*')
      .expect('Content-Type', /plain/)
      .expect('Location', 'http://google.com')
      .expect(301, 'Moved Permanently. Redirecting to http://google.com', done);
    })
  })

  describe('when accepting neither text or html', function(){
    it('should respond with an empty body', function(done){
      var app = express();

      app.use(function(req, res){
        res.redirect('http://google.com');
      });

      request(app)
        .get('/')
        .set('Accept', 'application/octet-stream')
        .expect(302)
        .expect('location', 'http://google.com')
        .expect('content-length', '0')
        .expect(utils.shouldNotHaveHeader('Content-Type'))
        .expect(utils.shouldNotHaveBody())
        .end(done)
    })
  })
})


text:
@implementation UISplitViewController (BGHelpers)

#pragma mark Accessors

- (UIViewController *) bg_masterViewController
{
    if(self.viewControllers.count)
    {
        return self.viewControllers[0];
    }

    return nil;
}

- (UIViewController *) bg_detailViewController
{
    if(self.viewControllers.count >= 2)
    {
        return self.viewControllers[1];
    }

    return nil;
}

- (void) setBg_masterViewController:(UIViewController *)bg_masterViewController
{
    NSMutableArray * viewControllers = [self.viewControllers mutableCopy];
    viewControllers[0] = bg_masterViewController;
    self.viewControllers = viewControllers;
}

- (void) setBg_detailViewController:(UIViewController *)bg_detailViewController
{
    NSMutableArray * viewControllers = [self.viewControllers mutableCopy];
    viewControllers[1] = bg_detailViewController;
    self.viewControllers = viewControllers;
}

@end


text:
package com.chintux.graph;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;

public class Main {

	public static void main(String[] args) {

		ArrayList<LinkedList<Integer>> adjacency = new ArrayList<LinkedList<Integer>>();

		LinkedList<Integer> n0 = new LinkedList<Integer>();
		n0.add(1);
		n0.add(2);

		LinkedList<Integer> n1 = new LinkedList<Integer>();
		n1.add(0);
		n1.add(3);

		LinkedList<Integer> n2 = new LinkedList<Integer>();
		n2.add(0);
		n2.add(3);
		n2.add(4);

		LinkedList<Integer> n3 = new LinkedList<Integer>();
		n3.add(2);
		n3.add(4);
		n3.add(5);

		LinkedList<Integer> n4 = new LinkedList<Integer>();
		n4.add(2);
		n4.add(3);
		n4.add(5);

		LinkedList<Integer> n5 = new LinkedList<Integer>();
		n5.add(3);
		n5.add(4);

		adjacency.add(0, n0);
		adjacency.add(1, n1);
		adjacency.add(2, n2);
		adjacency.add(3, n3);
		adjacency.add(4, n4);
		adjacency.add(5, n5);
		System.out.println(adjacency);

		Queue<Integer> q = new LinkedList<Integer>();
		HashSet<Integer> explored = new HashSet<Integer>();
		q.add(0);
		explored.add(0);
		while(!q.isEmpty()) {
			Integer now = q.remove();

			LinkedList<Integer> adjacents = adjacency.get(now);
			for(Integer i : adjacents) {
				if (!explored.contains(i)) { // && !q.contains(i)) {
					q.add(i);
					explored.add(i);
				}
			}
			System.out.println(now);

		}
	}

}


text:
====
tftp
====

This library will have tftp functions in bash

Documentation
=============

    git@github.com:maralas/topology_lib_tftp.git/tree/master/doc

License
=======

::

   Copyright (C) 2016 maria alas

   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.


text:
#include "include/private/SkFloatingPoint.h"
#include "include/sksl/SkSLErrorReporter.h"
#include "src/sksl/SkSLAnalysis.h"
#include "src/sksl/SkSLConstantFolder.h"
#include "src/sksl/ir/SkSLBinaryExpression.h"
#include "src/sksl/ir/SkSLForStatement.h"
#include "src/sksl/ir/SkSLPostfixExpression.h"
#include "src/sksl/ir/SkSLPrefixExpression.h"
#include "src/sksl/ir/SkSLVarDeclarations.h"
#include "src/sksl/ir/SkSLVariableReference.h"

#include <cmath>
#include <memory>

namespace SkSL {

// Loops that run for 100000+ iterations will exceed our program size limit.
static constexpr int kLoopTerminationLimit = 100000;

static int calculate_count(double start, double end, double delta, bool forwards, bool inclusive) {
    if (forwards != (start < end)) {
        // The loop starts in a completed state (the start has already advanced past the end).
        return 0;
    }
    if ((delta == 0.0) || forwards != (delta > 0.0)) {
        // The loop does not progress toward a completed state, and will never terminate.
        return kLoopTerminationLimit;
    }
    double iterations = sk_ieee_double_divide(end - start, delta);
    double count = std::ceil(iterations);
    if (inclusive && (count == iterations)) {
        count += 1.0;
    }
    if (count > kLoopTerminationLimit || !std::isfinite(count)) {
        // The loop runs for more iterations than we can safely unroll.
        return kLoopTerminationLimit;
    }
    return (int)count;
}

static const char* get_es2_loop_unroll_info(const Statement* loopInitializer,
                                            const Expression* loopTest,
                                            const Expression* loopNext,
                                            const Statement* loopStatement,
                                            LoopUnrollInfo& loopInfo) {
    //
    // init_declaration has the form: type_specifier identifier = constant_expression
    //
    if (!loopInitializer) {
        return "missing init declaration";
    }
    if (!loopInitializer->is<VarDeclaration>()) {
        return "invalid init declaration";
    }
    const VarDeclaration& initDecl = loopInitializer->as<VarDeclaration>();
    if (!initDecl.baseType().isNumber()) {
        return "invalid type for loop index";
    }
    if (initDecl.arraySize() != 0) {
        return "invalid type for loop index";
    }
    if (!initDecl.value()) {
        return "missing loop index initializer";
    }
    if (!ConstantFolder::GetConstantValue(*initDecl.value(), &loopInfo.fStart)) {
        return "loop index initializer must be a constant expression";
    }

    loopInfo.fIndex = &initDecl.var();

    auto is_loop_index = [&](const std::unique_ptr<Expression>& expr) {
        return expr->is<VariableReference>() &&
               expr->as<VariableReference>().variable() == loopInfo.fIndex;
    };

    //
    // condition has the form: loop_index relational_operator constant_expression
    //
    if (!loopTest) {
        return "missing condition";
    }
    if (!loopTest->is<BinaryExpression>()) {
        return "invalid condition";
    }
    const BinaryExpression& cond = loopTest->as<BinaryExpression>();
    if (!is_loop_index(cond.left())) {
        return "expected loop index on left hand side of condition";
    }
    // relational_operator is one of: > >= < <= == or !=
    switch (cond.getOperator().kind()) {
        case Token::Kind::TK_GT:
        case Token::Kind::TK_GTEQ:
        case Token::Kind::TK_LT:
        case Token::Kind::TK_LTEQ:
        case Token::Kind::TK_EQEQ:
        case Token::Kind::TK_NEQ:
            break;
        default:
            return "invalid relational operator";
    }
    double loopEnd = 0;
    if (!ConstantFolder::GetConstantValue(*cond.right(), &loopEnd)) {
        return "loop index must be compared with a constant expression";
    }

    //
    // expression has one of the following forms:
    //   loop_index++
    //   loop_index--
    //   loop_index += constant_expression
    //   loop_index -= constant_expression
    // The spec doesn't mention prefix increment and decrement, but there is some consensus that
    // it's an oversight, so we allow those as well.
    //
    if (!loopNext) {
        return "missing loop expression";
    }
    switch (loopNext->kind()) {
        case Expression::Kind::kBinary: {
            const BinaryExpression& next = loopNext->as<BinaryExpression>();
            if (!is_loop_index(next.left())) {
                return "expected loop index in loop expression";
            }
            if (!ConstantFolder::GetConstantValue(*next.right(), &loopInfo.fDelta)) {
                return "loop index must be modified by a constant expression";
            }
            switch (next.getOperator().kind()) {
                case Token::Kind::TK_PLUSEQ:                                      break;
                case Token::Kind::TK_MINUSEQ: loopInfo.fDelta = -loopInfo.fDelta; break;
                default:
                    return "invalid operator in loop expression";
            }
        } break;
        case Expression::Kind::kPrefix: {
            const PrefixExpression& next = loopNext->as<PrefixExpression>();
            if (!is_loop_index(next.operand())) {
                return "expected loop index in loop expression";
            }
            switch (next.getOperator().kind()) {
                case Token::Kind::TK_PLUSPLUS:   loopInfo.fDelta =  1; break;
                case Token::Kind::TK_MINUSMINUS: loopInfo.fDelta = -1; break;
                default:
                    return "invalid operator in loop expression";
            }
        } break;
        case Expression::Kind::kPostfix: {
            const PostfixExpression& next = loopNext->as<PostfixExpression>();
            if (!is_loop_index(next.operand())) {
                return "expected loop index in loop expression";
            }
            switch (next.getOperator().kind()) {
                case Token::Kind::TK_PLUSPLUS:   loopInfo.fDelta =  1; break;
                case Token::Kind::TK_MINUSMINUS: loopInfo.fDelta = -1; break;
                default:
                    return "invalid operator in loop expression";
            }
        } break;
        default:
            return "invalid loop expression";
    }

    //
    // Within the body of the loop, the loop index is not statically assigned to, nor is it used as
    // argument to a function 'out' or 'inout' parameter.
    //
    if (Analysis::StatementWritesToVariable(*loopStatement, initDecl.var())) {
        return "loop index must not be modified within body of the loop";
    }

    // Finally, compute the iteration count, based on the bounds, and the termination operator.
    loopInfo.fCount = 0;

    switch (cond.getOperator().kind()) {
        case Token::Kind::TK_LT:
            loopInfo.fCount = calculate_count(loopInfo.fStart, loopEnd, loopInfo.fDelta,
                                              /*forwards=*/true, /*inclusive=*/false);
            break;

        case Token::Kind::TK_GT:
            loopInfo.fCount = calculate_count(loopInfo.fStart, loopEnd, loopInfo.fDelta,
                                              /*forwards=*/false, /*inclusive=*/false);
            break;

        case Token::Kind::TK_LTEQ:
            loopInfo.fCount = calculate_count(loopInfo.fStart, loopEnd, loopInfo.fDelta,
                                              /*forwards=*/true, /*inclusive=*/true);
            break;

        case Token::Kind::TK_GTEQ:
            loopInfo.fCount = calculate_count(loopInfo.fStart, loopEnd, loopInfo.fDelta,
                                              /*forwards=*/false, /*inclusive=*/true);
            break;

        case Token::Kind::TK_NEQ: {
            float iterations = sk_ieee_double_divide(loopEnd - loopInfo.fStart, loopInfo.fDelta);
            loopInfo.fCount = std::ceil(iterations);
            if (loopInfo.fCount < 0 || loopInfo.fCount != iterations ||
                !std::isfinite(iterations)) {
                // The loop doesn't reach the exact endpoint and so will never terminate.
                loopInfo.fCount = kLoopTerminationLimit;
            }
            break;
        }
        case Token::Kind::TK_EQEQ: {
            if (loopInfo.fStart == loopEnd) {
                // Start and end begin in the same place, so we can run one iteration...
                if (loopInfo.fDelta) {
                    // ... and then they diverge, so the loop terminates.
                    loopInfo.fCount = 1;
                } else {
                    // ... but they never diverge, so the loop runs forever.
                    loopInfo.fCount = kLoopTerminationLimit;
                }
            } else {
                // Start never equals end, so the loop will not run a single iteration.
                loopInfo.fCount = 0;
            }
            break;
        }
        default: SkUNREACHABLE;
    }

    SkASSERT(loopInfo.fCount >= 0);
    if (loopInfo.fCount >= kLoopTerminationLimit) {
        return "loop must guarantee termination in fewer iterations";
    }

    return nullptr;  // All checks pass
}

std::unique_ptr<LoopUnrollInfo> Analysis::GetLoopUnrollInfo(int line,
                                                            const Statement* loopInitializer,
                                                            const Expression* loopTest,
                                                            const Expression* loopNext,
                                                            const Statement* loopStatement,
                                                            ErrorReporter* errors) {
    auto result = std::make_unique<LoopUnrollInfo>();
    if (const char* msg = get_es2_loop_unroll_info(loopInitializer, loopTest, loopNext,
                                                   loopStatement, *result)) {
        result = nullptr;
        if (errors) {
            errors->error(line, msg);
        }
    }
    return result;
}

}  // namespace SkSL


text:
package io.getquill.mysql

import java.sql.{ Connection, ResultSet }
import io.getquill.PrepareZioJdbcSpecBase
import io.getquill.context.qzio.ImplicitSyntax.Implicit
import org.scalatest.BeforeAndAfter

class PrepareJdbcSpec extends PrepareZioJdbcSpecBase with BeforeAndAfter {

  val context = testContext.underlying
  import context._
  implicit val implicitPool = Implicit(pool)

  before {
    testContext.run(query[Product].delete).runSyncUnsafe()
  }

  def productExtractor = (rs: ResultSet, conn: Connection) => materializeQueryMeta[Product].extract(rs, conn)
  val prepareQuery = prepare(query[Product])

  "single" in {
    val prepareInsert = prepare(query[Product].insertValue(lift(productEntries.head)))
    singleInsert(prepareInsert) mustEqual false
    extractProducts(prepareQuery) === List(productEntries.head)
  }

  "batch" in {
    val prepareBatchInsert = prepare(
      liftQuery(withOrderedIds(productEntries)).foreach(p => query[Product].insertValue(p))
    )

    batchInsert(prepareBatchInsert).distinct mustEqual List(false)
    extractProducts(prepareQuery) === withOrderedIds(productEntries)
  }
}


text:
<?php

namespace Underscore\Mutator;

use Underscore\Collection;
use Underscore\Mutator;

class InitialMutator extends Mutator
{
    /**
     * Gets all but the last element or last n elements of collection.
     *
     * Returns mixed[]
     *
     * @param Collection $collection
     * @param int        $count
     * @return Collection
     */
    public function __invoke($collection, $count = 1)
    {
        $values = array_slice($collection->toArray(), 0, -$count);

        return $this->copyCollectionWith($collection, $values);
    }
}


text:
using CsQuery.HtmlParser;

namespace CsQuery.Implementation
{
    /// <summary>
    /// An HTML button element.
    /// </summary>

    public class HTMLButtonElement : FormSubmittableElement, IHTMLButtonElement
    {
        /// <summary>
        /// Default constructor.
        /// </summary>

        public HTMLButtonElement()
            : base(HtmlData.tagBUTTON)
        {
        }

        /// <summary>
        /// The value of the "type" attribute. For button elements, this property always returns a
        /// lowercase value and defaults to "submit" if there is no type attribute.
        /// </summary>
        ///
        /// <value>
        /// The type.
        /// </value>

        public override string Type
        {
            get
            {
                return GetAttribute(HtmlData.attrTYPE, "submit").ToLower();
            }
            set
            {
                base.Type = value;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qualifiedTypeNameHistroy>
<fullyQualifiedTypeName name="java.awt.Color"/>
<fullyQualifiedTypeName name="java.lang.System"/>
<fullyQualifiedTypeName name="com.jhilden13.utilities.DrawingPanel"/>
<fullyQualifiedTypeName name="java.awt.Graphics"/>
</qualifiedTypeNameHistroy>


text:
<?php

use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $model app\models\Presentacion */

$this->title = 'Modificar Presentacion: ' . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Presentacions', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modificar';
?>

<?= Html::encode($this->title) ?>
        <a href="<?= Url::to(['presentacion/index']) ?>" class="btn-link btn-sm">

        <?= $this->render('_form', [
            'model' => $model,
        ]) ?>


text:
import { connect } from 'react-redux';
import Matches from '../components/Matches.jsx';
import { unmountMatch, removeMatch, incrementOffset, addMatches } from '../actions/index.js';
import request from 'then-request';

const mapStateToProps = (state) => (
  {
    matches: state.matches.values,
    offset: state.matches.offset,
    self: {
      id: state.profile.id,
      languages: state.profile.languages,
      fbId: state.profile.fbId,
    },
  }
);

const mapDispatchToProps = (dispatch) => (
  {
    onConnectClick: (selfId, id, selfFB, otherFB) => {
      request('POST', '/api/relationships', {
        json: {
          newType: 'request',
          selfId,
          matchId: id,
        },
      })
      .done(data => {
        if (data.statusCode === 201) {
          dispatch(unmountMatch(id));
          request('POST', '/service/notifications', {
            json: {
              selfFB,
              otherFB,
            },
          });
          setTimeout(
            () => {
              dispatch(removeMatch(id));
            },
            120
          );
        } else {
          // TODO: handle error
        }
      });
    },
    onHideClick: (selfId, id) => {
      request('POST', '/api/relationships', {
        json: {
          newType: 'reject',
          selfId,
          matchId: id,
        },
      })
      .done(data => {
        if (data.statusCode === 201) {
          dispatch(unmountMatch(id));
          setTimeout(
            () => {
              dispatch(removeMatch(id));
            },
            120
          );
        } else {
          // TODO: handle error
        }
      });
    },
    onLoadMoreClick: (self, offset) => {
      // use the offset to get additional matches from db, then
      request('GET', '/api/matches', {
        qs: {
          self,
          offset,
        },
      })
      .done((matches) => {
        if (matches.statusCode === 200) {
          dispatch(addMatches(JSON.parse(matches.body)));
          dispatch(incrementOffset(20));
        } else {
          // TODO: handle error
        }
      });
    },
  }
);

export default connect(mapStateToProps, mapDispatchToProps)(Matches);


text:
(function() {
  var C, E, Leaf, MerkleClient, a_json_parse, athrow, createHash, db, env, iced, kbpgp, keys, log, make_esc, master_ring, pathcheck, req, __iced_k, __iced_k_noop, _merkle_client, _ref,
    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

  iced = require('iced-runtime').iced;
  __iced_k = __iced_k_noop = function() {};

  db = require('./db');

  req = require('./req');

  log = require('./log');

  E = require('./err').E;

  make_esc = require('iced-error').make_esc;

  _ref = require('iced-utils').util, a_json_parse = _ref.a_json_parse, athrow = _ref.athrow;

  createHash = require('crypto').createHash;

  master_ring = require('./keyring').master_ring;

  keys = require('./keys');

  env = require('./env').env;

  C = require('./constants').constants;

  pathcheck = require('libkeybase').merkle.pathcheck;

  Leaf = require('libkeybase').merkle.leaf.Leaf;

  kbpgp = require('kbpgp');

  MerkleClient = (function() {
    MerkleClient.LATEST = "latest";

    function MerkleClient() {
      this._nodes = {};
      this._keys = {};
      this._verified = {};
    }

    MerkleClient.prototype.lookup_path = function(_arg, cb) {
      var uid, username;
      uid = _arg.uid, username = _arg.username;
      if ((uid == null) && (username == null)) {
        cb(new Error("lookup_path: one of uid or username must be specified"));
        return;
      }
      if ((uid != null) && (username != null)) {
        cb(new Error("lookup_path: only one of uid (" + uid + ") and username (" + username + ") can be specified"));
        return;
      }
      return req.get({
        endpoint: "merkle/path",
        args: {
          uid: uid,
          username: username
        }
      }, cb);
    };

    MerkleClient.prototype.check_key_fingerprint = function(_arg, cb) {
      var err, fingerprint;
      fingerprint = _arg.fingerprint;
      if (__indexOf.call(env().get_merkle_key_fingerprints(), fingerprint) >= 0) {
        err = null;
      } else {
        err = new E.KeyNotTrustedError("the fingerprint " + fingerprint + " isn't trusted");
      }
      return cb(err);
    };

    MerkleClient.prototype.find_key_data = function(_arg, cb) {
      var err, fingerprint, json, key_data, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      fingerprint = _arg.fingerprint;
      err = key_data = null;
      (function(_this) {
        return (function(__iced_k) {
          if ((key_data = keys.lookup[fingerprint]) == null) {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/jacko/node-client/src/merkle_client.iced",
                funcname: "MerkleClient.find_key_data"
              });
              req.get({
                endpoint: "key/special",
                args: {
                  fingerprint: fingerprint
                }
              }, __iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    err = arguments[0];
                    return json = arguments[1];
                  };
                })(),
                lineno: 53
              }));
              __iced_deferrals._fulfill();
            })(function() {
              return __iced_k(err != null ? void 0 : (key_data = json.bundle) == null ? err = new E.KeyNotFoundError("have no key for " + fingerprint) : void 0);
            });
          } else {
            return __iced_k();
          }
        });
      })(this)((function(_this) {
        return function() {
          return cb(err, key_data);
        };
      })(this));
    };

    MerkleClient.prototype.get_merkle_pgp_key = function(_arg, cb) {
      var err, esc, fingerprint, index, key_data, obj, ret, ring, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      fingerprint = _arg.fingerprint;
      ring = master_ring();
      esc = make_esc(cb, "MerkleClient::get_merkle_pgp_key");
      err = ret = null;
      log.debug("+ merkle get_merkle_pgp_key");
      (function(_this) {
        return (function(__iced_k) {
          if ((ret = _this._keys[fingerprint]) == null) {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/jacko/node-client/src/merkle_client.iced",
                funcname: "MerkleClient.get_merkle_pgp_key"
              });
              ring.index2({}, esc(__iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    return index = arguments[0];
                  };
                })(),
                lineno: 67
              })));
              __iced_deferrals._fulfill();
            })(function() {
              var _ref1;
              _ref1 = index.lookup().fingerprint.get_0_or_1(fingerprint), err = _ref1[0], obj = _ref1[1];
              (function(__iced_k) {
                if (err != null) {
                  return __iced_k();
                } else {
                  (function(__iced_k) {
                    if (obj != null) {
                      log.debug("| merkle key already found in keyring");
                      return __iced_k(ret = ring.make_key({
                        fingerprint: fingerprint
                      }));
                    } else {
                      (function(__iced_k) {
                        __iced_deferrals = new iced.Deferrals(__iced_k, {
                          parent: ___iced_passed_deferral,
                          filename: "/home/jacko/node-client/src/merkle_client.iced",
                          funcname: "MerkleClient.get_merkle_pgp_key"
                        });
                        _this.find_key_data({
                          fingerprint: fingerprint
                        }, esc(__iced_deferrals.defer({
                          assign_fn: (function() {
                            return function() {
                              return key_data = arguments[0];
                            };
                          })(),
                          lineno: 74
                        })));
                        __iced_deferrals._fulfill();
                      })(function() {
                        log.debug("| doing a merkle key import for " + fingerprint);
                        ret = ring.make_key({
                          fingerprint: fingerprint,
                          key_data: key_data
                        });
                        (function(__iced_k) {
                          __iced_deferrals = new iced.Deferrals(__iced_k, {
                            parent: ___iced_passed_deferral,
                            filename: "/home/jacko/node-client/src/merkle_client.iced",
                            funcname: "MerkleClient.get_merkle_pgp_key"
                          });
                          ret.save(esc(__iced_deferrals.defer({
                            lineno: 77
                          })));
                          __iced_deferrals._fulfill();
                        })(function() {
                          return __iced_k(ret = ring.make_key({
                            fingerprint: fingerprint
                          }));
                        });
                      });
                    }
                  })(__iced_k);
                }
              })(function() {
                return __iced_k(ret != null ? _this._keys[fingerprint] = ret : void 0);
              });
            });
          } else {
            return __iced_k();
          }
        });
      })(this)((function(_this) {
        return function() {
          log.debug("- merkle get_merkle_pgp_key");
          return cb(err, ret);
        };
      })(this));
    };

    MerkleClient.prototype.rollback_check = function(_arg, cb) {
      var err, esc, last_root, p, q, root, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      root = _arg.root;
      log.debug("+ Rollback check");
      esc = make_esc(cb, "MerkleClient::rollback_check");
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/jacko/node-client/src/merkle_client.iced",
            funcname: "MerkleClient.rollback_check"
          });
          _this.load_last_root(esc(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return last_root = arguments[0];
              };
            })(),
            lineno: 90
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          err = null;
          (function(__iced_k) {
            var _ref1, _ref2;
            if ((typeof last_root !== "undefined" && last_root !== null) && (((q = (_ref1 = last_root.payload.body) != null ? _ref1.seqno : void 0) == null) || q > (p = (_ref2 = root.payload.body) != null ? _ref2.seqno : void 0))) {
              return __iced_k(err = new E.VersionRollbackError("Merkle root version rollback detected: " + q + " > " + p));
            } else {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/home/jacko/node-client/src/merkle_client.iced",
                  funcname: "MerkleClient.rollback_check"
                });
                _this.store_this_root({
                  root: root
                }, esc(__iced_deferrals.defer({
                  lineno: 95
                })));
                __iced_deferrals._fulfill();
              })(__iced_k);
            }
          })(function() {
            log.debug("- Rollback check");
            return cb(err);
          });
        };
      })(this));
    };

    MerkleClient.prototype.store_this_root = function(_arg, cb) {
      var err, root, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      root = _arg.root;
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/jacko/node-client/src/merkle_client.iced",
            funcname: "MerkleClient.store_this_root"
          });
          db.put({
            type: C.ids.merkle_root,
            key: root.hash,
            value: root,
            name: {
              type: C.lookups.merkle_root,
              name: MerkleClient.LATEST
            },
            debug: true
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return err = arguments[0];
              };
            })(),
            lineno: 111
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err);
        };
      })(this));
    };

    MerkleClient.prototype.load_last_root = function(cb) {
      var err, obj, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/jacko/node-client/src/merkle_client.iced",
            funcname: "MerkleClient.load_last_root"
          });
          db.lookup({
            type: C.lookups.merkle_root,
            name: MerkleClient.LATEST
          }, __iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                err = arguments[0];
                return obj = arguments[1];
              };
            })(),
            lineno: 117
          }));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          return cb(err, obj);
        };
      })(this));
    };

    MerkleClient.prototype.get_merkle_key_manager = function(_arg, cb) {
      var armored, blob, esc, fingerprint, key_manager, kid, path_response, pgp_key, ___iced_passed_deferral, __iced_deferrals, __iced_k, _ref1;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      path_response = _arg.path_response;
      esc = make_esc(cb, "MerkleClient::get_merkle_key_manager");
      fingerprint = null;
      _ref1 = path_response.root.sigs;
      for (kid in _ref1) {
        blob = _ref1[kid];
        if (blob.fingerprint != null) {
          fingerprint = blob.fingerprint;
          break;
        }
      }
      (function(_this) {
        return (function(__iced_k) {
          if (fingerprint == null) {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/jacko/node-client/src/merkle_client.iced",
                funcname: "MerkleClient.get_merkle_key_manager"
              });
              athrow(new Error("Didn't find a PGP fingerprint among the merkle sigs."), esc(__iced_deferrals.defer({
                lineno: 130
              })));
              __iced_deferrals._fulfill();
            })(__iced_k);
          } else {
            return __iced_k();
          }
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/home/jacko/node-client/src/merkle_client.iced",
              funcname: "MerkleClient.get_merkle_key_manager"
            });
            _this.check_key_fingerprint({
              fingerprint: fingerprint
            }, esc(__iced_deferrals.defer({
              lineno: 131
            })));
            __iced_deferrals._fulfill();
          })(function() {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/jacko/node-client/src/merkle_client.iced",
                funcname: "MerkleClient.get_merkle_key_manager"
              });
              _this.get_merkle_pgp_key({
                fingerprint: fingerprint
              }, esc(__iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    return pgp_key = arguments[0];
                  };
                })(),
                lineno: 132
              })));
              __iced_deferrals._fulfill();
            })(function() {
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/home/jacko/node-client/src/merkle_client.iced",
                  funcname: "MerkleClient.get_merkle_key_manager"
                });
                pgp_key.load(esc(__iced_deferrals.defer({
                  lineno: 133
                })));
                __iced_deferrals._fulfill();
              })(function() {
                armored = pgp_key.key_data();
                (function(__iced_k) {
                  __iced_deferrals = new iced.Deferrals(__iced_k, {
                    parent: ___iced_passed_deferral,
                    filename: "/home/jacko/node-client/src/merkle_client.iced",
                    funcname: "MerkleClient.get_merkle_key_manager"
                  });
                  kbpgp.KeyManager.import_from_armored_pgp({
                    armored: armored
                  }, esc(__iced_deferrals.defer({
                    assign_fn: (function() {
                      return function() {
                        return key_manager = arguments[0];
                      };
                    })(),
                    lineno: 135
                  })));
                  __iced_deferrals._fulfill();
                })(function() {
                  return cb(null, key_manager);
                });
              });
            });
          });
        };
      })(this));
    };

    MerkleClient.prototype.get_root_with_parsed_payload = function(_arg, cb) {
      var esc, k, payload, root_clone, root_from_server, v, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      root_from_server = _arg.root_from_server;
      esc = make_esc(cb, "MerkleClient::get_root_with_parsed_payload");
      root_clone = {};
      for (k in root_from_server) {
        v = root_from_server[k];
        root_clone[k] = v;
      }
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/jacko/node-client/src/merkle_client.iced",
            funcname: "MerkleClient.get_root_with_parsed_payload"
          });
          a_json_parse(root_clone.payload_json, esc(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return payload = arguments[0];
              };
            })(),
            lineno: 146
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          root_clone.payload_json = null;
          root_clone.payload = payload;
          return cb(null, root_clone);
        };
      })(this));
    };

    MerkleClient.prototype.find_and_verify = function(_arg, cb) {
      var esc, km, path_response, pathcheck_result, root, uid, username, ___iced_passed_deferral, __iced_deferrals, __iced_k;
      __iced_k = __iced_k_noop;
      ___iced_passed_deferral = iced.findDeferral(arguments);
      uid = _arg.uid, username = _arg.username;
      esc = make_esc(cb, "MerkleClient::find_and_verify");
      log.debug("+ merkle find_and_verify: uid " + uid + ", username " + username);
      (function(_this) {
        return (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/jacko/node-client/src/merkle_client.iced",
            funcname: "MerkleClient.find_and_verify"
          });
          _this.lookup_path({
            uid: uid,
            username: username
          }, esc(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return path_response = arguments[0];
              };
            })(),
            lineno: 156
          })));
          __iced_deferrals._fulfill();
        });
      })(this)((function(_this) {
        return function() {
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/home/jacko/node-client/src/merkle_client.iced",
              funcname: "MerkleClient.find_and_verify"
            });
            _this.get_merkle_key_manager({
              path_response: path_response
            }, esc(__iced_deferrals.defer({
              assign_fn: (function() {
                return function() {
                  return km = arguments[0];
                };
              })(),
              lineno: 157
            })));
            __iced_deferrals._fulfill();
          })(function() {
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/jacko/node-client/src/merkle_client.iced",
                funcname: "MerkleClient.find_and_verify"
              });
              pathcheck({
                server_reply: path_response,
                km: km
              }, esc(__iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    return pathcheck_result = arguments[0];
                  };
                })(),
                lineno: 158
              })));
              __iced_deferrals._fulfill();
            })(function() {
              (function(__iced_k) {
                if ((uid != null) && pathcheck_result.uid !== uid) {
                  (function(__iced_k) {
                    __iced_deferrals = new iced.Deferrals(__iced_k, {
                      parent: ___iced_passed_deferral,
                      filename: "/home/jacko/node-client/src/merkle_client.iced",
                      funcname: "MerkleClient.find_and_verify"
                    });
                    athrow(new Error("Expected uid " + uid + " does not match merkle response uid " + pathcheck_result.uid), esc(__iced_deferrals.defer({
                      lineno: 160
                    })));
                    __iced_deferrals._fulfill();
                  })(__iced_k);
                } else {
                  return __iced_k();
                }
              })(function() {
                (function(__iced_k) {
                  if ((username != null) && pathcheck_result.username !== username) {
                    (function(__iced_k) {
                      __iced_deferrals = new iced.Deferrals(__iced_k, {
                        parent: ___iced_passed_deferral,
                        filename: "/home/jacko/node-client/src/merkle_client.iced",
                        funcname: "MerkleClient.find_and_verify"
                      });
                      athrow(new Error("Expected username " + username + " does not match merkle response username " + pathcheck_result.username), esc(__iced_deferrals.defer({
                        lineno: 162
                      })));
                      __iced_deferrals._fulfill();
                    })(__iced_k);
                  } else {
                    return __iced_k();
                  }
                })(function() {
                  (function(__iced_k) {
                    __iced_deferrals = new iced.Deferrals(__iced_k, {
                      parent: ___iced_passed_deferral,
                      filename: "/home/jacko/node-client/src/merkle_client.iced",
                      funcname: "MerkleClient.find_and_verify"
                    });
                    _this.get_root_with_parsed_payload({
                      root_from_server: path_response.root
                    }, esc(__iced_deferrals.defer({
                      assign_fn: (function() {
                        return function() {
                          return root = arguments[0];
                        };
                      })(),
                      lineno: 163
                    })));
                    __iced_deferrals._fulfill();
                  })(function() {
                    (function(__iced_k) {
                      __iced_deferrals = new iced.Deferrals(__iced_k, {
                        parent: ___iced_passed_deferral,
                        filename: "/home/jacko/node-client/src/merkle_client.iced",
                        funcname: "MerkleClient.find_and_verify"
                      });
                      _this.rollback_check({
                        root: root
                      }, esc(__iced_deferrals.defer({
                        lineno: 164
                      })));
                      __iced_deferrals._fulfill();
                    })(function() {
                      return cb(null, pathcheck_result.leaf, root, path_response.id_version);
                    });
                  });
                });
              });
            });
          });
        };
      })(this));
    };

    return MerkleClient;

  })();

  _merkle_client = null;

  exports.merkle_client = function() {
    if (_merkle_client == null) {
      _merkle_client = new MerkleClient();
    }
    return _merkle_client;
  };

}).call(this);


text:
class SilentFailLog < ActiveRecord::Base
  validates :message, presence: true
end

class User < ActiveRecord::Base
  validates :name, presence: true
  validates :connection_time, numericality: true

  silent_fail_check :validation, :connection_time
end


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="br.com.bulgasoftwares.feedreader">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".view.HomeActivity"
            android:label="@string/title_activity_home"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".view.DetailActivity"
            android:label="@string/title_activity_detail"
            android:theme="@style/AppTheme.NoActionBar" />
    </application>

</manifest>


text:
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.omnibox.suggestions;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.annotation.Px;

import org.chromium.chrome.browser.WindowDelegate;

/** Represents the basic functionality of the Omnibox suggestions dropdown. */
public interface OmniboxSuggestionsDropdown {
    /** Provides the capabilities required to embed the omnibox suggestion list into the UI. */
    public interface Embedder {
        /** Return the anchor view the suggestion list should be drawn below. */
        View getAnchorView();

        /**
         * Return the view that the omnibox suggestions should be aligned horizontally to.  The
         * view must be a descendant of {@link #getAnchorView()}.  If null, the suggestions will
         * be aligned to the start of {@link #getAnchorView()}.
         */
        @Nullable
        View getAlignmentView();

        /** Return the delegate used to interact with the Window. */
        WindowDelegate getWindowDelegate();

        /** Return whether the suggestions are being rendered in the tablet UI. */
        boolean isTablet();
    }

    /** Interface that will receive notifications and callbacks from OmniboxSuggestionList. */
    public interface Observer {
        /**
         * Invoked whenever the height of suggestion list changes.
         * The height may change as a result of eg. soft keyboard popping up.
         *
         * @param newHeightPx New height of the suggestion list in pixels.
         */
        void onSuggestionDropdownHeightChanged(@Px int newHeightPx);

        /**
         * Invoked whenever the User scrolls the list.
         */
        void onSuggestionDropdownScroll();
    }

    /** Get the Android View implementing suggestion list. */
    ViewGroup getViewGroup();

    /** Show (and properly size) the suggestions list. */
    void show();

    /**
     * Sets the embedder for the list view.
     * @param embedder the embedder of this list.
     */
    void setEmbedder(Embedder embedder);

    /**
     * Sets the observer of suggestion list.
     * @param observer an observer of this list.
     */
    void setObserver(Observer observer);

    /** Resets selection typically in response to changes to the list. */
    void resetSelection();

    /** Update the suggestion popup background to reflect the current state. */
    void refreshPopupBackground(boolean isIncognito);

    /** Gets the number of items in the list. */
    int getItemCount();
}


text:
<title>BOCES ONC Graphics/Products</title>
<link rel='stylesheet' id='style.css' href='http://oncgraphics.com/style.css' type='text/css' media='all' />

Home

Contact

Our Products

Brochures

5 brochure

5 Brochures

5 Brochures

<div class="desc"5 Brochures

Business card

100 professional business cards

100 professional business cards

100 professional business cards

Posters & flyers

10 11" X 17" advertising poster

11" x 17" Artwork's poster

Simple web design

Add a description of the image here

Add a description of the image here

Add a description of the image here

photo studio

Add a description of the image here

Add a description of the image here

Add a description of the image here

Add a description of the image here

Student Artwork

Add a description of the image here

Add a description of the image here

Add a description of the image here

Copyright (c) 2014

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


text:
package v1

import (
	"context"
	"testing"

	"github.com/google/knative-gcp/pkg/apis/duck"
	metadatatesting "github.com/google/knative-gcp/pkg/gclient/metadata/testing"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	corev1 "k8s.io/api/core/v1"
	duckv1 "knative.dev/pkg/apis/duck/v1"

	gcpauthtesthelper "github.com/google/knative-gcp/pkg/apis/configs/gcpauth/testhelper"
	gcpduckv1 "github.com/google/knative-gcp/pkg/apis/duck/v1"
)

var (
	auditLogsSourceSpec = CloudAuditLogsSourceSpec{
		ServiceName:  "foo",
		MethodName:   "bar",
		ResourceName: "baz",
		PubSubSpec: gcpduckv1.PubSubSpec{
			Secret: &corev1.SecretKeySelector{
				LocalObjectReference: corev1.LocalObjectReference{
					Name: "secret-name",
				},
				Key: "secret-key",
			},
			SourceSpec: duckv1.SourceSpec{
				Sink: duckv1.Destination{
					Ref: &duckv1.KReference{
						APIVersion: "foo",
						Kind:       "bar",
						Namespace:  "baz",
						Name:       "qux",
					},
				},
			},
			Project: "my-eventing-project",
		},
	}

	auditLogsSourceSpecWithKSA = CloudAuditLogsSourceSpec{
		ServiceName:  "foo",
		MethodName:   "bar",
		ResourceName: "baz",
		PubSubSpec: gcpduckv1.PubSubSpec{

			SourceSpec: duckv1.SourceSpec{
				Sink: duckv1.Destination{
					Ref: &duckv1.KReference{
						APIVersion: "foo",
						Kind:       "bar",
						Namespace:  "baz",
						Name:       "qux",
					},
				},
			},
			IdentitySpec: gcpduckv1.IdentitySpec{
				ServiceAccountName: "old-service-account",
			},
			Project: "my-eventing-project",
		},
	}
)

func TestCloudAuditLogsSourceValidationFields(t *testing.T) {
	testCases := map[string]struct {
		spec  CloudAuditLogsSourceSpec
		error bool
	}{
		"ok": {
			spec:  auditLogsSourceSpec,
			error: false,
		},
		"bad ServiceName": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.ServiceName = ""
				return *obj
			}(),
			error: true,
		},
		"bad MethodName": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.MethodName = ""
				return *obj
			}(),
			error: true,
		},
		"bad sink, name": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.Sink.Ref.Name = ""
				return *obj
			}(),
			error: true,
		},
		"bad sink, empty": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.Sink = duckv1.Destination{}
				return *obj
			}(),
			error: true,
		},
		"nil secret": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				return *obj
			}(),
			error: false,
		},
		"invalid scheduler secret, missing key": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.Secret = &corev1.SecretKeySelector{
					LocalObjectReference: corev1.LocalObjectReference{Name: "test-secret"},
				}
				return *obj
			}(),
			error: true,
		},
		"invalid k8s service account": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.ServiceAccountName = invalidServiceAccountName
				return *obj
			}(),
			error: true,
		},
		"have k8s service account and secret at the same time": {
			spec: func() CloudAuditLogsSourceSpec {
				obj := auditLogsSourceSpec.DeepCopy()
				obj.ServiceAccountName = validServiceAccountName
				obj.Secret = &gcpauthtesthelper.Secret
				return *obj
			}(),
			error: true,
		},
	}
	for n, tc := range testCases {
		t.Run(n, func(t *testing.T) {
			err := tc.spec.Validate(context.TODO())
			if tc.error != (err != nil) {
				t.Fatalf("Unexpected validation failure. Got %v", err)
			}
		})
	}
}

func TestCloudAuditLogsSourceCheckImmutableFields(t *testing.T) {
	testCases := map[string]struct {
		orig              interface{}
		updated           CloudAuditLogsSourceSpec
		origAnnotation    map[string]string
		updatedAnnotation map[string]string
		allowed           bool
	}{
		"nil orig": {
			updated: auditLogsSourceSpec,
			allowed: true,
		},
		"ClusterName annotation changed": {
			origAnnotation: map[string]string{
				duck.ClusterNameAnnotation: metadatatesting.FakeClusterName + "old",
			},
			updatedAnnotation: map[string]string{
				duck.ClusterNameAnnotation: metadatatesting.FakeClusterName + "new",
			},
			allowed: false,
		},
		"AnnotationClass annotation changed": {
			origAnnotation: map[string]string{
				duck.AutoscalingClassAnnotation: duck.KEDA,
			},
			updatedAnnotation: map[string]string{
				duck.AutoscalingClassAnnotation: duck.KEDA + "new",
			},
			allowed: false,
		},
		"AnnotationClass annotation added": {
			origAnnotation: map[string]string{},
			updatedAnnotation: map[string]string{
				duck.AutoscalingClassAnnotation: duck.KEDA,
			},
			allowed: false,
		},
		"AnnotationClass annotation deleted": {
			origAnnotation: map[string]string{
				duck.AutoscalingClassAnnotation: duck.KEDA,
			},
			updatedAnnotation: map[string]string{},
			allowed:           false,
		},
		"ServiceName changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				MethodName:   auditLogsSourceSpec.MethodName,
				PubSubSpec:   auditLogsSourceSpec.PubSubSpec,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  "some-other-name",
			},
			allowed: false,
		},
		"MethodName changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				MethodName:   "some-other-name",
				PubSubSpec:   auditLogsSourceSpec.PubSubSpec,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"ResourceName changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				MethodName:   auditLogsSourceSpec.MethodName,
				PubSubSpec:   auditLogsSourceSpec.PubSubSpec,
				ResourceName: "some-other-name",
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"Project changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.PubSubSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.PubSubSpec.Secret.Key,
					},
					Project: "some-other-project",
					SourceSpec: duckv1.SourceSpec{
						Sink: auditLogsSourceSpec.PubSubSpec.Sink,
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"ServiceAccountName changed": {
			orig: &auditLogsSourceSpecWithKSA,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					IdentitySpec: gcpduckv1.IdentitySpec{
						ServiceAccountName: "new-service-account",
					},
					SourceSpec: duckv1.SourceSpec{
						Sink: auditLogsSourceSpecWithKSA.PubSubSpec.Sink,
					},
					Project: auditLogsSourceSpecWithKSA.Project,
				},
				MethodName:   auditLogsSourceSpecWithKSA.MethodName,
				ResourceName: auditLogsSourceSpecWithKSA.ResourceName,
				ServiceName:  auditLogsSourceSpecWithKSA.ServiceName,
			},
			allowed: false,
		},
		"Secret.Name changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: "some-other-name",
						},
						Key: auditLogsSourceSpec.PubSubSpec.Secret.Key,
					},
					Project: auditLogsSourceSpec.PubSubSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: auditLogsSourceSpec.PubSubSpec.Sink,
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"Secret.Key changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.PubSubSpec.Secret.Name,
						},
						Key: "some-other-key",
					},
					Project: auditLogsSourceSpec.PubSubSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: auditLogsSourceSpec.PubSubSpec.Sink,
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"ServiceAccountName added": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.Secret.Key,
					},
					Project:    auditLogsSourceSpec.Project,
					SourceSpec: auditLogsSourceSpec.SourceSpec,
					IdentitySpec: gcpduckv1.IdentitySpec{
						ServiceAccountName: "old-service-account",
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: false,
		},
		"ClusterName annotation added": {
			origAnnotation: nil,
			updatedAnnotation: map[string]string{
				duck.ClusterNameAnnotation: metadatatesting.FakeClusterName + "new",
			},
			allowed: true,
		},
		"Sink.APIVersion changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.Secret.Key,
					},
					Project: auditLogsSourceSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: "some-other-api-version",
								Kind:       auditLogsSourceSpec.Sink.Ref.Kind,
								Namespace:  auditLogsSourceSpec.Sink.Ref.Namespace,
								Name:       auditLogsSourceSpec.Sink.Ref.Name,
							},
						},
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: true,
		},
		"Sink.Kind changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.Secret.Key,
					},
					Project: auditLogsSourceSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: auditLogsSourceSpec.Sink.Ref.APIVersion,
								Kind:       "some-other-kind",
								Namespace:  auditLogsSourceSpec.Sink.Ref.Namespace,
								Name:       auditLogsSourceSpec.Sink.Ref.Name,
							},
						},
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: true,
		},
		"Sink.Namespace changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.Secret.Key,
					},
					Project: auditLogsSourceSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: auditLogsSourceSpec.Sink.Ref.APIVersion,
								Kind:       auditLogsSourceSpec.Sink.Ref.Kind,
								Namespace:  "some-other-namespace",
								Name:       auditLogsSourceSpec.Sink.Ref.Name,
							},
						},
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: true,
		},
		"Sink.Name changed": {
			orig: &auditLogsSourceSpec,
			updated: CloudAuditLogsSourceSpec{
				PubSubSpec: gcpduckv1.PubSubSpec{
					Secret: &corev1.SecretKeySelector{
						LocalObjectReference: corev1.LocalObjectReference{
							Name: auditLogsSourceSpec.Secret.Name,
						},
						Key: auditLogsSourceSpec.Secret.Key,
					},
					Project: auditLogsSourceSpec.Project,
					SourceSpec: duckv1.SourceSpec{
						Sink: duckv1.Destination{
							Ref: &duckv1.KReference{
								APIVersion: auditLogsSourceSpec.Sink.Ref.APIVersion,
								Kind:       auditLogsSourceSpec.Sink.Ref.Kind,
								Namespace:  auditLogsSourceSpec.Sink.Ref.Namespace,
								Name:       "some-other-name",
							},
						},
					},
				},
				MethodName:   auditLogsSourceSpec.MethodName,
				ResourceName: auditLogsSourceSpec.ResourceName,
				ServiceName:  auditLogsSourceSpec.ServiceName,
			},
			allowed: true,
		},
		"no change": {
			orig:    &auditLogsSourceSpec,
			updated: auditLogsSourceSpec,
			allowed: true,
		},
		"no spec": {
			orig:    []string{"wrong"},
			updated: auditLogsSourceSpec,
			allowed: true,
		},
	}
	for n, tc := range testCases {
		t.Run(n, func(t *testing.T) {
			var orig *CloudAuditLogsSource

			if tc.origAnnotation != nil {
				orig = &CloudAuditLogsSource{
					ObjectMeta: v1.ObjectMeta{
						Annotations: tc.origAnnotation,
					},
				}
			} else if tc.orig != nil {
				if spec, ok := tc.orig.(*CloudAuditLogsSourceSpec); ok {
					orig = &CloudAuditLogsSource{
						Spec: *spec,
					}
				}
			}
			updated := &CloudAuditLogsSource{
				ObjectMeta: v1.ObjectMeta{
					Annotations: tc.updatedAnnotation,
				},
				Spec: tc.updated,
			}
			err := updated.CheckImmutableFields(context.TODO(), orig)
			if tc.allowed != (err == nil) {
				t.Fatalf("Unexpected immutable field check. Expected %v. Actual %v", tc.allowed, err)
			}
		})
	}
}


text:
/**
 *
 */
package org.training.inheritance.exercise04;

import java.io.IOException;

/**
 * @author daniel
 *
 */
public class Test1 {
	public float aMethod(float a, float b) throws IOException {
		return a+b;
	}
}


text:
package org.apache.jmeter.functions;

import static org.junit.Assert.assertEquals;

import java.util.Collection;
import java.util.LinkedList;

import org.apache.jmeter.engine.util.CompoundVariable;
import org.apache.jmeter.junit.JMeterTestCase;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.threads.JMeterContext;
import org.apache.jmeter.threads.JMeterContextService;
import org.apache.jmeter.threads.JMeterVariables;
import org.junit.Before;
import org.junit.Test;

public class TestJexl2Function extends JMeterTestCase {
    protected AbstractFunction function;

    private SampleResult result;

    private Collection<CompoundVariable> params;

    private JMeterVariables vars;

    private JMeterContext jmctx;

    @Before
    public void setUp() {
        function = new Jexl2Function();
        result = new SampleResult();
        jmctx = JMeterContextService.getContext();
        String data = "The quick brown fox";
        result.setResponseData(data, null);
        vars = new JMeterVariables();
        jmctx.setVariables(vars);
        jmctx.setPreviousResult(result);
        params = new LinkedList<>();
    }

    @Test
    public void testParameterCount() throws Exception {
        checkInvalidParameterCounts(function, 1, 2);
    }

    @Test
    public void testSum() throws Exception {
        params.add(new CompoundVariable("1+2+3"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("6", ret);
    }

    @Test
    public void testSumVar() throws Exception {
        params.add(new CompoundVariable("1+2+3"));
        params.add(new CompoundVariable("TOTAL"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("6", ret);
        assertEquals("6", vars.get("TOTAL"));
    }

    @Test
    public void testReplace1() throws Exception {
        params.add(new CompoundVariable(
                "sampleResult.getResponseDataAsString().replaceAll('T','t')"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("the quick brown fox", ret);
    }

    @Test
    public void testReplace2() throws Exception {
        vars.put("URL", "/query.cgi?s1=1&s2=2&s3=3");
        params.add(new CompoundVariable("vars.get('URL').replaceAll('&','&')"));
        params.add(new CompoundVariable("URL"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("/query.cgi?s1=1&s2=2&s3=3", ret);
        assertEquals(ret,vars.getObject("URL"));
    }

    @Test
    public void testSumWithVar() throws Exception {
        params.add(new CompoundVariable("var a = 1+2+3"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("6", ret);
    }
}


text:
import React from 'react'

import 'isomorphic-fetch' /* global fetch */

import {Segment} from 'semantic-ui-react'

import Layout from '../components/layout'

export default class extends React.Component {
  static async getInitialProps ({ query }) {
    const res = await fetch(`${process.env.API_HOST}/handle/${query.name}/inspect-service`)
    const json = await res.json()
    return {
      service: json
    }
  }

  render () {
    return (
      <Layout title='Service info'>
        <Segment>

{ JSON.stringify(this.props.service, null, '  ') }

        </Segment>
      </Layout>
    )
  }
}


text:
using System.IO;

namespace TankLib.Helpers {
    public interface ISerializable {
        void Deserialize(BinaryReader reader);
        void Serialize(BinaryWriter writer);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Reflection;
using Bellona.Analysis.Clustering;

namespace ColorsWpf
{
    public class AppModel
    {
        public ColorCluster[] ColorClusters { get; private set; }

        public AppModel()
        {
            var colors = typeof(Color).GetProperties(BindingFlags.Public | BindingFlags.Static)
                .Where(p => p.PropertyType == typeof(Color))
                .Select(p => (Color)p.GetValue(null))
                .Where(c => c.A == 255) // Exclude Transparent.
                .ToArray();

            var model = ClusteringModel.CreateAuto<Color>(c => new double[] { c.R, c.G, c.B })
                .Train(colors);

            ColorClusters = model
                .ToSimpleArray(c => c.GetHue())
                .Select(cs => cs.Select(c => new ColorInfo(c)).ToArray())
                .Select((cs, i) => new ColorCluster { Id = i, Colors = cs })
                .ToArray();
        }
    }

    public struct ColorCluster
    {
        public int Id { get; set; }
        public ColorInfo[] Colors { get; set; }
    }

    [DebuggerDisplay(@"\{{Color}\}")]
    public class ColorInfo
    {
        public Color Color { get; private set; }

        public string Name { get { return Color.Name; } }
        public string RGB { get { return string.Format("#{0:X2}{1:X2}{2:X2}", Color.R, Color.G, Color.B); } }

        public ColorInfo(Color color)
        {
            Color = color;
        }
    }
}


text:
package io.datalayer.algorithm.geometry;

import io.datalayer.algorithm.geometry.ClosestPairFinder;
import io.datalayer.algorithm.geometry.PlaneSweepClosestPairFinder;

/**
 * Test case for {@link PlaneSweepClosestPairFinder}.
 *
 */
public class PlaneSweepClosestPairFinderTest extends AbstractClosestPairFinderTestCase {
    protected ClosestPairFinder createClosestPairFinder() {
        return PlaneSweepClosestPairFinder.INSTANCE;
    }
}


text:
package ros

func interfaceBridgeHosts() Command {
	return Command{
		Path:    "/interface bridge host",
		Command: "print",
		Detail:  true,
	}
}

func (r *Ros) InterfaceBridgeHosts() ([]map[string]string, error) {
	return r.UnnumberedList(interfaceBridgeHosts(), 1)
}


text:
{% extends "manage/manage_base.html" %}
{% set page = "picturegallery" %}

{% block manage_title %}
    Picture Gallery
{% endblock %}

{% block site_js %}
  {{ super() }}

  {% javascript 'picture_gallery' %}
{% endblock %}

{% block site_css %}
  {{ super() }}
  {% stylesheet 'picture_gallery' %}
{% endblock %}

{% block manage_content %}

    Loading pictures...

  {% if event %}

      You are here to associate a picture with
      {{ event.title }}

      {% if event.picture %}

      {% endif %}

    {% if event.placeholder_img %}

          Remove all pictures made for this event.

        Are you sure?
        <button class="btn btn-danger btn-sm"
        ng-click="deleteAllPictures()">
        Yes
        </button>
        <button class="btn btn-default btn-sm"
        ng-click="toggleDeleteAllConfirmation()">Cancel</button>

      <button type="button" class="close" data-dismiss="alert">
        ×Close
      </button>

        Successfully deleted all pictures associated with the event {{ event.title }}.

    {% else %}

      <button type="button" class="close" data-dismiss="alert">
        ×Close
      </button>

        Unable to delete all pictures associated with this event because the event
        relies on one of them and has no fallback placeholder image.

    {% endif %}

  {% endif %}

      Upload more pictures

  {% csrf_token %}
  {% raw %}

    <input type="text" ng-model="search_notes" placeholder="Find by notes">
    <select name="created" ng-model="search_created">
      <option value="">Uploaded</option>
      <option value="today">Today</option>
      <option value="yesterday">Yesterday</option>
      <option value="this_week">This week</option>
      <option value="older_than_this_week">Older than this week</option>
    </select>

    <button type="button" class="btn btn-default btn-xs btn-primary"
      ng-if="hasFilter()" ng-click="clearFilter()">Clear filter</button>

          {{ picture.width }}x{{ picture.height }}
          {{ picture.size | filesize }}

          Default placeholder

          Inactive!

        <input name="notes" value="{{ picture.notes }}"
         ng-model="picture.notes"
         placeholder="no notes">
        <button
          ng-click="saveNotes(picture)"
          class="btn btn-xs"
          ng-class="{'btn-primary': !picture._saving}">
          Saving
          Save
        </button>
        <button
          class="btn btn-danger btn-xs"
          ng-show="!picture._delete_confirmation && !picture.cant_delete"
          ng-click="toggleDeleteConfirmation(picture)">Delete</button>

           <ng-pluralize count="picture.events.length"
            when="{'one': '1 event', 'other': '{} events'}">
          </ng-pluralize>

        <button ng-click="associatePicture(picture)" ng-show="current_event && current_event_picture != picture.id"
                class="btn btn-primary">
          Pick this for the event
        </button>

          Current event picture

            {{ event.title }}

          Are you sure?
          <button class="btn btn-danger btn-xs"
            ng-click="deletePicture(picture)">
            Yes
          </button>
          <button class="btn btn-default btn-xs"
            ng-click="toggleDeleteConfirmation(picture)">Cancel</button>

            Careful. This picture is used by {{ picture.events.length }}
            events.

Filtered too much?

        Drop notes search on {{ search_notes }}

        Drop the filter on uploaded

      Total # pictures:
      {{ stats.total_pictures }}
      ({{ stats.event_pictures }} of those belong to specific events)

  {% endraw %}

    {% set paginate_label='Pictures per page' %}
    {% include "manage/_angular_pagesize.html" %}
    {% include "manage/_angular_paginate.html" %}

{% endblock %}