text:
//
//  MSTDViewController.m
//  家长界
//
//  Created by taylor on 2016/12/5.
//  Copyright © 2016年 西部家联. All rights reserved.
//

#import "MSTDViewController.h"

@interface MSTDViewController ()<UITableViewDelegate,UITableViewDataSource,WYAutoCaruselDelegate>

/*tableView*/
@property (strong,nonatomic) UITableView *tableView;

/*tableView的headerView*/
@property (strong,nonatomic) UIView *headerView;

/*轮播数组*/
@property (strong,nonatomic) NSMutableArray *lunBoArr;

/*筛选视图*/
@property (strong,nonatomic) UIView *siftView;

@property (strong,nonatomic) UIButton *btn1;
@property (strong,nonatomic) UIButton *btn2;
@property (strong,nonatomic) UIButton *btn3;
@property (strong,nonatomic) UIButton *btn4;
@property (strong,nonatomic) UIButton *btn5;

/*筛选按钮数组*/
@property (strong,nonatomic) NSMutableArray *buttonArray;

@end

@implementation MSTDViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [self.view addSubview:self.tableView];

    [self createAdsPageWithArr:self.lunBoArr];

}

#pragma mark -----懒加载-----

-(UIView *)headerView{
    if (!_headerView) {
        _headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, lunBoheight+5)];
        _headerView.backgroundColor = [UIColor whiteColor];
    }
    return _headerView;
}

-(NSMutableArray *)lunBoArr{
    if (!_lunBoArr) {
        _lunBoArr = [DataBase addSelecteArray];
    }
    return _lunBoArr;
}

-(UIView *)siftView{
    if (!_siftView) {
        _siftView = [[UIView alloc]initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, 40)];
        _siftView.backgroundColor = [UIColor whiteColor];

        NSArray *titleArray = @[@"城市",@"价格",@"美食",@"选择",@"排序"];
        _buttonArray = [NSMutableArray array];
        for (int i = 0; i<titleArray.count; i++) {

            UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
            bt.frame = CGRectMake(SCREEN_WIDTH/titleArray.count*i,0,SCREEN_WIDTH/titleArray.count-1, 40-1);
            [bt setTitle:titleArray[i] forState:UIControlStateNormal];
            [bt setTitleEdgeInsets: UIEdgeInsetsMake(0,-12 , 0, 12)];
            [bt setImageEdgeInsets:UIEdgeInsetsMake(0, 38, 0, -38)];
            [bt setImage:[UIImage imageNamed:@"icon_down"] forState:UIControlStateNormal];
            [bt setImage:[UIImage imageNamed:@"icon_up"] forState:UIControlStateSelected];
            [bt setTitleColor:HWColor(153, 153, 153) forState:UIControlStateNormal];
            [bt setTitleColor:[UIColor orangeColor] forState:UIControlStateSelected];
            bt.selected = NO;
            bt.tag = i;
            [bt addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
            [_buttonArray addObject:bt];

            if (bt.tag == 0) {
                self.btn1 = bt;
            }
            else if (bt.tag == 1){
                self.btn2 = bt;
            }
            else if (bt.tag == 2){
                self.btn3 = bt;
            }
            else if (bt.tag == 3){
                self.btn4 = bt;
            }
            else{
                self.btn5 = bt;
            }

            for (int j = 1; j < 5; j++) {
                UIView *view = [UIView new];
                view.frame = CGRectMake(j*(SCREEN_WIDTH/titleArray.count-1), 8, 1, 24);
                view.backgroundColor = HWColor(241, 241, 241);

                [_siftView addSubview:view];
            }

            [_siftView addSubview:bt];
        }

    }
    return _siftView;
}

#pragma mark /*********轮播图的实现*******/
-(void)createAdsPageWithArr:(NSMutableArray *)source
{
    NSMutableArray *arr = [[NSMutableArray alloc]init];
    for (NSDictionary *dic in source) {
        [arr addObject:[dic objectForKey:@"slecteImg"]];
    }
    //封装的轮播view实现
    WYAutoCarusel *aut = [[WYAutoCarusel alloc]init];
    [aut createCaruselWithFrame:CGRectMake(0, 5, SCREEN_WIDTH, lunBoheight) WithSuperView:self.headerView WithImageUrlArr:arr WithPlaceholderImageName:@"1" WithInterval:2];

    [aut createPageControlWithFrame:CGRectMake(SCREEN_WIDTH-60, lunBoheight-30, 30, 20) WithSuperView:self.headerView WithPageNum:arr.count WithCurrentColor:HWColor(248, 114, 1) WithTintColor:[UIColor whiteColor]];

    aut.delegate = self;
}

-(void)pushViewController:(NSInteger)tag{

}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGFloat offset = self.tableView.contentOffset.y;
    if (offset >lunBoheight) {
        HWLog(@"开始显示");
        [UIView animateWithDuration:0.1 animations:^{
            [self.view addSubview:self.siftView];

        }];
    }
    else{
        [UIView animateWithDuration:0.1 animations:^{
            [self.siftView removeFromSuperview];
        }];
    }
}

-(void)buttonAction:(UIButton *)sender{
    sender.selected = !sender.selected;
    switch (sender.tag) {
        case 0:
            self.btn2.selected = NO;
            self.btn3.selected = NO;
            self.btn4.selected = NO;
            self.btn5.selected = NO;
            break;
        case 1:
            self.btn1.selected = NO;
            self.btn3.selected = NO;
            self.btn4.selected = NO;
            self.btn5.selected = NO;
            break;
        case 2:
            self.btn1.selected = NO;
            self.btn2.selected = NO;
            self.btn4.selected = NO;
            self.btn5.selected = NO;
            break;
        case 3:
            self.btn1.selected = NO;
            self.btn2.selected = NO;
            self.btn3.selected = NO;
            self.btn5.selected = NO;
            break;
        default:
            self.btn1.selected = NO;
            self.btn2.selected = NO;
            self.btn3.selected = NO;
            self.btn4.selected = NO;
            break;
    }
}

#pragma mark =====tableview及方法======

-(UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.tableHeaderView = self.headerView;
        _tableView.tableHeaderView.height = self.headerView.height;
    }
    return _tableView;
}

-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 10;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return SCREEN_WIDTH*0.46;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *identifier = @"identifier";
        YSYKTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
        if (cell == nil) {
            cell = [[YSYKTableViewCell alloc]initWithFrame:cell.bounds];
            cell.backgroundColor = HWColor(241, 241, 241);
            cell.imgView.image = [UIImage imageNamed:@"cellView"];
            cell.titleLabel.text = @"鲜生活*喵小春的鱼";
            cell.addressLabel.text = @"大雁塔";
            cell.typeLabel.text = @"中餐";
            cell.parkIcon.image = [UIImage imageNamed:@"p"];
            cell.wifiIcon.image = [UIImage imageNamed:@"WiFi"];
            cell.priceLabel.text = @"¥39";
            cell.priceLabel.textColor = HWColor(253, 151, 46);
            cell.averageLabel.text = @"人均 :";
            cell.averageLabel.textColor = HWColor(51, 51, 51);
            cell.distanceLabel.text = @"2.3km";
            cell.firstIcon.image = [UIImage imageNamed:@"金币"];
            cell.firstLabel.text = @"10通币冲抵1元";
            cell.secondIcon.image = [UIImage imageNamed:@"优惠"];
            cell.secondLabel.text = @"每满10减1(买单立享)";

        }

    return cell;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

redpajama_set_name: RedPajamaGithub


text:
SocialStream.setup do |config|
  # List the models that are social entities. These will have ties between them.
  # Remember you must add an "actor_id" foreign key column to your migration!
  #
  # config.subjects = [:user, :group ]

  # Include devise modules in User. See devise documentation for details.
  # Others available are:
  # :confirmable, :lockable, :timeoutable, :validatable
  # config.devise_modules = :database_authenticatable, :registerable,
  #                         :recoverable, :rememberable, :trackable,
  #                         :omniauthable, :token_authenticatable

  # Type of activities managed by actors
  # Remember you must add an "activity_object_id" foreign key column to your migration!
  # Be sure to add the other modules of Social Stream you might be using (e.g. :document, :event, :link ).
  #
  # config.objects = [ :post, :comment ]

  # Form for activity objects to be loaded
  # You can write your own activity objects
  #
  # config.activity_forms = [ :post, :document, :foo, :bar ]

  # Config the relation model of your network
  #
  # :custom - users define their own relation types, and post with privacy, like Google+
  # :follow - user just follow other users, like Twitter
  #
  # config.relation_model = :custom

  # Expose resque interface to manage background tasks at /resque
  #
  # config.resque_access = true

  # Quick search (header) and Extended search models and its order. Remember to create
  # the indexes with thinking-sphinx if you are using customized models.
  #
  # config.quick_search_models = [:user, :group]
  # config.extended_search_models = [:user, :group]

  # Cleditor controls. It is used in new message editor, for example
  # config.cleditor_controls = "bold italic underline strikethrough subscript superscript | size style | bullets | image link unlink"
end

# You can customize toolbar, sidebar and location bar from here
# See https://github.com/ging/social_stream/wiki/How-to-customize-the-toolbar,-sidebar-and-location


text:
require 'helper'

describe Githu3::Client do

  before do
    @client = Githu3::Client.new("myvalidtoken")
  end

  describe "Getting my stuff..." do
    it "should be true if method exists" do
      defined?(Githu3::VERSION).should be_true
    end

    it 'should be oauthed as me...' do
      stub_get "/user", "me"
      @client.me.login.should == 'sbellity'
    end

    it 'should retreive rails org' do
      stub_get "/orgs/rails", "orgs/rails"
      @client.org('rails').login.should == 'rails'
    end

    it 'should retreive my orgs' do
      stub_get "/user/orgs", "orgs"
      @client.orgs.length.should == 2
      @client.orgs.first.login.should == "nuvoli"
    end

    it 'should retrieve all my repos' do
      stub_get "/user/repos", "all_repos"
      @client.repos.length.should == 2
      @client.repos.first.name.should == "brm-ruby-logger"
      @client.repos.first.private.should == true
    end

    it 'should retrieve all my public repos' do
      stub_get "/user/repos?type=public", "public_repos"
      @client.repos(:type => "public").length.should == 5
      @client.repos(:type => "public").first.name.should == "futon4mongo"
    end

    it 'should tell me if i am following someone else...' do
      stub_request(:get, "#{Githu3::Client::BaseUrl}/user/following/billevans").to_return(:status => 204)
      @client.following?('billevans').should be_true
    end

    it 'should tell me if i am NOT following someone else...' do
      stub_request(:get, "#{Githu3::Client::BaseUrl}/user/following/mildesdavis").to_return(:status => 404)
      @client.following?('mildesdavis').should be_false
    end

    it "should list my followers" do
      stub_get "/user/followers", "users/followers"
      @client.followers.length.should == 13
    end

    it "should list my following" do
      stub_get "/user/following", "users/following"
      @client.following.length.should == 30
    end

  end

end


text:
<?php

class Withdriver extends CI_Controller{
    public function index(){

       	$this->load->model('Withdrivermodel');
       	$vehicles['vehicles'] = $this->Withdrivermodel->get_drivercar();

        $this->load->view('template/header');
        $this->load->view('pages/withdriverview', $vehicles);
        $this->load->view('template/footer');
   }
}
?>


text:
from insights.core.plugins import make_response, rule
from insights.parsers.redhat_release import RedhatRelease

@rule(RedhatRelease)
def report(rel):
    """Fires if the machine is running Fedora."""

    if "Fedora" in rel.product:
        return make_response("IS_FEDORA")

if __name__ == "__main__":
    from insights import run
    run(report, print_summary=True)


text:
title: Blog 9
layout: post
author: rohit.srisakthivel
permalink: /blog-9/
source-id: 1-H3M55IUrxMbsSXo5JKePU7Da54SQXSeNknuWPZMW7c
published: true
---

    Title
    Blog 9
    Date
    26/03/18

    Starting point:
    Flashing lights

    Target for this lesson?
    Finish flashing lights

    Did I reach my target?
(add details to "Lesson Review")
     Yes

    Lesson Review

    How did I learn? What strategies were effective?

    Today was our final lesson doing fuze.I Believe that next term we are going to be doing python coding and that will be new for me.As it was our final week i wanted to do really well and succeed in completing most of the fuze projects.However today i found out that we had moved on from flashing lights and we were onto something called analogue coding which was something i didn't understand.But as always i was ready to learn something new.

    What limited my learning? Which habits do I need to work on?

    Unfortunately our teacher was absent for the lesson and so we had a cover teacher.This meant that if something went wrong we didn't have anybody to ask for help.So we had to be very independent and pay close attention to everything that we wrote.Luckily we didn't have the electronic component kit to worry about and it was just strictly code.The code was easy and me and my partner rowan got on with it pretty well.The lesson went by and we were fine as it was just copying and pasting some code.We finished the analog coding pretty swiftly.

    What will I change for next time? How will I improve my learning?

    Our teacher came back in the end to remind us that we needed to have our blogs completed otherwise we would be in trouble.He said that this could potentially be or last lesson and we needed to not only maintain our blogs but to improve them in any way possible.This means we have to update our blog page so it looks very nice and readable.If this is our last lesson on fuze then i am happy to say that i have enjoyed it and i didnt know that coding could be so fun.


text:
<!DOCTYPE html>
<link rel="match" href="filtered-color-expected.html">


text:
package org.apache.spark.sql.execution

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{Encoder, Row, SparkSession}
import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow}
import org.apache.spark.sql.catalyst.analysis.MultiInstanceRelation
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.catalyst.plans.physical.{Partitioning, UnknownPartitioning}
import org.apache.spark.sql.execution.metric.SQLMetrics
import org.apache.spark.sql.types.DataType
import org.apache.spark.util.Utils

object RDDConversions {
  def productToRowRdd[A <: Product](data: RDD[A], outputTypes: Seq[DataType]): RDD[InternalRow] = {
    data.mapPartitions { iterator =>
      val numColumns = outputTypes.length
      val mutableRow = new GenericInternalRow(numColumns)
      val converters = outputTypes.map(CatalystTypeConverters.createToCatalystConverter)
      iterator.map { r =>
        var i = 0
        while (i < numColumns) {
          mutableRow(i) = converters(i)(r.productElement(i))
          i += 1
        }

        mutableRow
      }
    }
  }

  /**
   * Convert the objects inside Row into the types Catalyst expected.
   */
  def rowToRowRdd(data: RDD[Row], outputTypes: Seq[DataType]): RDD[InternalRow] = {
    data.mapPartitions { iterator =>
      val numColumns = outputTypes.length
      val mutableRow = new GenericInternalRow(numColumns)
      val converters = outputTypes.map(CatalystTypeConverters.createToCatalystConverter)
      iterator.map { r =>
        var i = 0
        while (i < numColumns) {
          mutableRow(i) = converters(i)(r(i))
          i += 1
        }

        mutableRow
      }
    }
  }
}

object ExternalRDD {

  def apply[T: Encoder](rdd: RDD[T], session: SparkSession): LogicalPlan = {
    val externalRdd = ExternalRDD(CatalystSerde.generateObjAttr[T], rdd)(session)
    CatalystSerde.serialize[T](externalRdd)
  }
}

/** Logical plan node for scanning data from an RDD. */
case class ExternalRDD[T](
    outputObjAttr: Attribute,
    rdd: RDD[T])(session: SparkSession)
  extends LeafNode with ObjectProducer with MultiInstanceRelation {

  override protected final def otherCopyArgs: Seq[AnyRef] = session :: Nil

  override def newInstance(): ExternalRDD.this.type =
    ExternalRDD(outputObjAttr.newInstance(), rdd)(session).asInstanceOf[this.type]

  override protected def stringArgs: Iterator[Any] = Iterator(output)

  override def computeStats(): Statistics = Statistics(
    // TODO: Instead of returning a default value here, find a way to return a meaningful size
    // estimate for RDDs. See PR 1238 for more discussions.
    sizeInBytes = BigInt(session.sessionState.conf.defaultSizeInBytes)
  )
}

/** Physical plan node for scanning data from an RDD. */
case class ExternalRDDScanExec[T](
    outputObjAttr: Attribute,
    rdd: RDD[T]) extends LeafExecNode with ObjectProducerExec {

  override lazy val metrics = Map(
    "numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output rows"))

  protected override def doExecute(): RDD[InternalRow] = {
    val numOutputRows = longMetric("numOutputRows")
    val outputDataType = outputObjAttr.dataType
    rdd.mapPartitionsInternal { iter =>
      val outputObject = ObjectOperator.wrapObjectToRow(outputDataType)
      iter.map { value =>
        numOutputRows += 1
        outputObject(value)
      }
    }
  }

  override def simpleString: String = {
    s"Scan $nodeName${output.mkString("[", ",", "]")}"
  }
}

/** Logical plan node for scanning data from an RDD of InternalRow. */
case class LogicalRDD(
    output: Seq[Attribute],
    rdd: RDD[InternalRow],
    outputPartitioning: Partitioning = UnknownPartitioning(0),
    outputOrdering: Seq[SortOrder] = Nil,
    override val isStreaming: Boolean = false)(session: SparkSession)
  extends LeafNode with MultiInstanceRelation {

  override protected final def otherCopyArgs: Seq[AnyRef] = session :: Nil

  override def newInstance(): LogicalRDD.this.type = {
    val rewrite = output.zip(output.map(_.newInstance())).toMap

    val rewrittenPartitioning = outputPartitioning match {
      case p: Expression =>
        p.transform {
          case e: Attribute => rewrite.getOrElse(e, e)
        }.asInstanceOf[Partitioning]

      case p => p
    }

    val rewrittenOrdering = outputOrdering.map(_.transform {
      case e: Attribute => rewrite.getOrElse(e, e)
    }.asInstanceOf[SortOrder])

    LogicalRDD(
      output.map(rewrite),
      rdd,
      rewrittenPartitioning,
      rewrittenOrdering,
      isStreaming
    )(session).asInstanceOf[this.type]
  }

  override protected def stringArgs: Iterator[Any] = Iterator(output, isStreaming)

  override def computeStats(): Statistics = Statistics(
    // TODO: Instead of returning a default value here, find a way to return a meaningful size
    // estimate for RDDs. See PR 1238 for more discussions.
    sizeInBytes = BigInt(session.sessionState.conf.defaultSizeInBytes)
  )
}

/** Physical plan node for scanning data from an RDD of InternalRow. */
case class RDDScanExec(
    output: Seq[Attribute],
    rdd: RDD[InternalRow],
    override val nodeName: String,
    override val outputPartitioning: Partitioning = UnknownPartitioning(0),
    override val outputOrdering: Seq[SortOrder] = Nil) extends LeafExecNode {

  override lazy val metrics = Map(
    "numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of output rows"))

  protected override def doExecute(): RDD[InternalRow] = {
    val numOutputRows = longMetric("numOutputRows")
    rdd.mapPartitionsWithIndexInternal { (index, iter) =>
      val proj = UnsafeProjection.create(schema)
      proj.initialize(index)
      iter.map { r =>
        numOutputRows += 1
        proj(r)
      }
    }
  }

  override def simpleString: String = {
    s"Scan $nodeName${Utils.truncatedString(output, "[", ",", "]")}"
  }
}


text:
'use strict'

const lib = require('../lib/webhook-liaison.js')
const log = require('../lib/logger.js')

module.exports.handler = function(event, context) {
  console.log('event:', event)

  lib.process(event, function callback(results) {
    results.log()
    if(results.errors.length > 0)
      context.fail()
    else
      context.done(null, results)
  })
}


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE617_Reachable_Assertion__fgets_81a.cpp
Label Definition File: CWE617_Reachable_Assertion.label.xml
Template File: sources-sink-81a.tmpl.cpp
*/
/*
 * @description
 * CWE: 617 Reachable Assertion
 * BadSource: fgets Read data from the console using fgets()
 * GoodSource: Number greater than ASSERT_VALUE
 * Sinks:
 *    BadSink : Assert if n is less than or equal to ASSERT_VALUE
 * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference
 *
 * */

#include "std_testcase.h"
#include "CWE617_Reachable_Assertion__fgets_81.h"

#define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2)

namespace CWE617_Reachable_Assertion__fgets_81
{

#ifndef OMITBAD

void bad()
{
    int data;
    /* Initialize data */
    data = -1;
    {
        char inputBuffer[CHAR_ARRAY_SIZE] = "";
        /* POTENTIAL FLAW: Read data from the console using fgets() */
        if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL)
        {
            /* Convert to int */
            data = atoi(inputBuffer);
        }
        else
        {
            printLine("fgets() failed.");
        }
    }
    const CWE617_Reachable_Assertion__fgets_81_base& baseObject = CWE617_Reachable_Assertion__fgets_81_bad();
    baseObject.action(data);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
static void goodG2B()
{
    int data;
    /* Initialize data */
    data = -1;
    /* FIX: Use a value greater than the assert value */
    data = ASSERT_VALUE+1;
    const CWE617_Reachable_Assertion__fgets_81_base& baseObject = CWE617_Reachable_Assertion__fgets_81_goodG2B();
    baseObject.action(data);
}

void good()
{
    goodG2B();
}

#endif /* OMITGOOD */

} /* close namespace */

/* Below is the main(). It is only used when building this testcase on
 * its own for testing or for building a binary to use in testing binary
 * analysis tools. It is not used when compiling all the testcases as one
 * application, which is how source code analysis tools are tested.
 */

#ifdef INCLUDEMAIN

using namespace CWE617_Reachable_Assertion__fgets_81; /* so that we can use good and bad easily */

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
package edu.utah.further.core.api.concurrent;

import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import edu.utah.further.core.api.context.Api;

/**
 * A Java Concurrency Library {@link Future} represents the result of an asynchronous
 * computation. {@link PollingFuture} adds functionality to periodically poll the result.
 *

 * -----------------------------------------------------------------------------------

 * (c) 2008-2013 FURTHeR Project, Health Sciences IT, University of Utah

 * Contact: {@code <further@utah.edu>}

 * Biomedical Informatics, 26 South 2000 East

 * Room 5775 HSEB, Salt Lake City, UT 84112

 * Day Phone: 1-801-581-4080

 * -----------------------------------------------------------------------------------
 *
 * @author Oren E. Livne {@code <oren.livne@utah.edu>}
 * @version Feb 26, 2010
 */
@Api
public interface PollingFuture<V> extends Future<V>
{
	// ========================= METHODS ===================================

	/**
	 * Polls the tasks's result every so-often up to a timeout. The result is returned
	 * from the first polling period in which it is available, or null if it
	 * is not available. Similar to {@link Future#get(long, TimeUnit)} but does not throw
	 * any checked exceptions.
	 *
	 * @param period
	 *            time to wait between consecutive polling
	 * @param timeout
	 *            the maximum time to wait
	 * @param unit
	 *            the time unit of the timeout argument
	 * @return the computed result, or null if it is not yet available or
	 *         there was a failure to get it
	 */
	V poll(long period, long timeout, TimeUnit unit);
}


text:
package com.intellij.openapi.roots.ui.configuration.projectRoot.daemon;

import com.intellij.ui.navigation.Place;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @author nik
 */
public class ProjectStructureProblemDescription {
  private final String myMessage;
  private final String myDescription;
  private final Severity mySeverity;
  private final Place myPlace;
  private final List<ConfigurationErrorQuickFix> myFixes;

  public ProjectStructureProblemDescription(@NotNull String message, @Nullable String description, @NotNull Severity severity, @NotNull Place place,
                                            @NotNull List<ConfigurationErrorQuickFix> fixes) {
    myMessage = message;
    myDescription = description;
    mySeverity = severity;
    myPlace = place;
    myFixes = fixes;
  }

  public String getMessage() {
    return myMessage;
  }

  @Nullable
  public String getDescription() {
    return myDescription;
  }

  public List<ConfigurationErrorQuickFix> getFixes() {
    return myFixes;
  }

  public Severity getSeverity() {
    return mySeverity;
  }

  public Place getPlace() {
    return myPlace;
  }

  public enum Severity { ERROR, WARNING }
}


text:
package org.apache.calcite.sql.fun;

import org.apache.calcite.sql.SqlCallBinding;
import org.apache.calcite.sql.SqlFunction;
import org.apache.calcite.sql.SqlFunctionCategory;
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.SqlOperandCountRange;
import org.apache.calcite.sql.type.InferTypes;
import org.apache.calcite.sql.type.OperandTypes;
import org.apache.calcite.sql.type.ReturnTypes;
import org.apache.calcite.sql.type.SqlOperandCountRanges;

/**
 * SqlQuarterFunction represents the SQL:1999 standard {@code QUARTER}
 * function. Determines Quarter (1,2,3,4) of a given date.
 */
public class SqlQuarterFunction extends SqlFunction {
  //~ Constructors -----------------------------------------------------------

  public SqlQuarterFunction() {
    super("QUARTER",
        SqlKind.OTHER,
        ReturnTypes.BIGINT_NULLABLE,
        InferTypes.FIRST_KNOWN,
        OperandTypes.DATETIME,
        SqlFunctionCategory.TIMEDATE);
  }

  //~ Methods ----------------------------------------------------------------

  public SqlOperandCountRange getOperandCountRange() {
    return SqlOperandCountRanges.of(1);
  }

  public String getSignatureTemplate(int operandsCount) {
    assert 1 == operandsCount;
    return "{0}({1})";
  }

  public boolean checkOperandTypes(SqlCallBinding callBinding,
      boolean throwOnFailure) {
    return OperandTypes.DATETIME.checkSingleOperandType(callBinding,
        callBinding.operand(0), 0, throwOnFailure);
  }
}

// End SqlQuarterFunction.java


text:
import time
from datetime import datetime, timedelta

from traits.api import Property, String, Float, Any, Int, List, Instance

from pychron.core.helpers.timer import Timer
from pychron.experiment.duration_tracker import AutomatedRunDurationTracker
from pychron.loggable import Loggable
from pychron.pychron_constants import NULL_STR

# from pychron.core.ui.pie_clock import PieClockModel

class ExperimentStats(Loggable):
    elapsed = Property(depends_on='_elapsed')
    _elapsed = Float

    run_elapsed = Property(depends_on='_run_elapsed')
    _run_elapsed = Float

    remaining = Property(depends_on='_elapsed, _total_time')

    nruns = Int
    nruns_finished = Int
    etf = String
    start_at = String
    end_at = String
    run_duration = String
    current_run_duration = String
    total_time = Property(depends_on='_total_time')
    _total_time = Float

    _timer = Any

    delay_between_analyses = Float
    delay_before_analyses = Float
    delay_after_blank = Float
    delay_after_air = Float
    # _start_time = None
    _post = None

    # use_clock = Bool(False)
    # clock = Instance(PieClockModel, ())
    duration_tracker = Instance(AutomatedRunDurationTracker, ())
    _run_start = 0

    # experiment_queue = Any

    def calculate_duration(self, runs=None):
        self.duration_tracker.load()
        dur = self._calculate_duration(runs)
        self._total_time = dur
        return self._total_time

    def format_duration(self, dur, post=None, fmt='%H:%M:%S %a %m/%d'):
        if post is None:
            post = self._post
            if not post:
                post = datetime.now()

        dt = post + timedelta(seconds=int(dur))
        if fmt == 'iso':
            return dt.isoformat()
        else:
            return dt.strftime(fmt)

    def start_timer(self):
        st = time.time()
        self._post = datetime.now()

        def update_time():
            e = round(time.time() - st)
            d = {'_elapsed': e}
            if self._run_start:
                re = round(time.time() - self._run_start)
                d['_run_elapsed'] = re
            self.trait_set(**d)

        self._timer = Timer(1000, update_time)
        # self._timer.start()

    def stop_timer(self):
        self.debug('Stop timer. self._timer: {}'.format(self._timer))
        if self._timer:
            tt = self._total_time
            et = self._elapsed
            dt = tt - et
            self.info('Estimated total time= {:0.1f}, elapsed time= {:0.1f}, deviation= {:0.1f}'.format(tt, et, dt))
            self._timer.stop()

    def reset(self):
        # self._start_time = None
        self._post = None
        self.nruns_finished = 0
        self._elapsed = 0
        self._run_elapsed = 0
        self._run_start = 0

    def update_run_duration(self, run, t):
        a = self.duration_tracker
        a.update(run, t)

    def start_run(self, run):
        self._run_start = time.time()
        # self.setup_run_clock(run)

        self.current_run_duration = self.get_run_duration(run.spec, as_str=True)

    def get_run_duration(self, run, as_str=False):
        sh = run.script_hash
        if sh in self.duration_tracker:
            self.debug('using duration tracker value')
            rd = self.duration_tracker[sh]
        else:
            rd = run.get_estimated_duration(force=True)
        rd = round(rd)
        if as_str:
            rd = str(timedelta(seconds=rd))

        self.debug('run duration: {}'.format(rd))
        return rd

    def finish_run(self):
        self._run_start = 0
        self.nruns_finished += 1
        self.debug('finish run. runs completed={}'.format(self.nruns_finished))
        # if self.clock:
        #     self.clock.stop()

    def continue_run(self):
        pass

        # if self.clock:
        #     self.clock.finish_slice()

    # def setup_run_clock(self, run):
    #     if self.use_clock:
    #         ctx = run.spec.make_script_context()
    #         extraction_slice = run.extraction_script.calculate_estimated_duration(ctx)
    #         measurement_slice = run.measurement_script.calculate_estimated_duration(ctx)
    #
    #         def convert_hexcolor_to_int(c):
    #             c = c[1:]
    #             # func = lambda i: int(c[i:i + 2], 16)
    #             # return list(map(func, (0, 2, 4)))
    #             return [int(c[i:i + 2], 16) for i in (0, 2, 4)]
    #
    #         # ec, mc = list(map(convert_hexcolor_to_int,
    #         #                   (EXTRACTION_COLOR, MEASUREMENT_COLOR)))
    #         ec, mc = convert_hexcolor_to_int(EXTRACTION_COLOR), convert_hexcolor_to_int(MEASUREMENT_COLOR)
    #         self.clock.set_slices([extraction_slice, measurement_slice],
    #                               [ec, mc])
    #         self.clock.start()

    # private
    def _calculate_duration(self, runs):

        dur = 0
        if runs:
            script_ctx = dict()
            warned = []
            ni = len(runs)

            btw = 0
            run_dur = 0
            d = 0
            for a in runs:
                sh = a.script_hash

                if sh in self.duration_tracker:
                    # t = a.make_truncated_script_hash()
                    # if a.has_conditionals() and t in self.duration_tracker:
                    #     run_dur += self.duration_tracker.probability_model(sh, t)
                    # else:
                    #     run_dur += self.duration_tracker[sh]
                    run_dur += self.duration_tracker[sh]
                else:
                    run_dur += a.get_estimated_duration(script_ctx, warned, True)
                d = a.get_delay_after(self.delay_between_analyses, self.delay_after_blank, self.delay_after_air)
                btw += d

            # subtract the last delay_after because experiment doesn't delay after last analysis
            btw -= d

            dur = run_dur + self.delay_before_analyses + btw
            self.debug('nruns={} before={}, run_dur={}, btw={}'.format(ni, self.delay_before_analyses,
                                                                       run_dur, btw))

        return dur

    def _get_run_elapsed(self):
        return str(timedelta(seconds=self._run_elapsed))

    def _get_elapsed(self):
        return str(timedelta(seconds=self._elapsed))

    def _get_total_time(self):
        dur = timedelta(seconds=round(self._total_time))
        return str(dur)

    def _get_remaining(self):
        if not self._total_time:
            dur = NULL_STR
        else:
            dur = timedelta(seconds=round(self._total_time - self._elapsed))
        return str(dur)

class StatsGroup(ExperimentStats):
    experiment_queues = List

    # @caller
    def reset(self):
        # self.debug('resetting experiment stats. nruns={}, '
        #            'nqueues={}'.format(self.nruns, len(self.experiment_queues)))
        self.calculate(force=True)
        super(StatsGroup, self).reset()

    def calculate(self, force=False):
        """
            calculate the total duration
            calculate the estimated time of finish
        """

        if force or not self._total_time:
            self.nruns = sum([len(ei.cleaned_automated_runs) for ei in self.experiment_queues])

            self.debug('calculating experiment stats')
            tt = sum([ei.stats.calculate_duration(ei.cleaned_automated_runs)
                      for ei in self.experiment_queues])

            self.debug('total_time={}'.format(tt))
            self._total_time = tt
            self.etf = self.format_duration(tt)

    def recalculate_etf(self):
        tt = sum([ei.stats.calculate_duration(ei.cleaned_automated_runs)
                  for ei in self.experiment_queues])

        self._total_time = tt + self._elapsed
        self.etf = self.format_duration(tt, post=datetime.now())

    def calculate_at(self, sel, at_times=True):
        """
            calculate the time at which a selected run will execute
        """
        self.debug('calculating time of run {}'.format(sel.runid))
        st, et = self._calculate_at(sel)

        if at_times:
            self.end_at = self.format_duration(et)
            if st:
                self.start_at = self.format_duration(st)

    def get_endtime(self, sel):
        st, et = self._calculate_at(sel)
        return et

    def get_starttime(self, sel):
        st, et = self._calculate_at(sel)
        return st

    def _calculate_at(self, sel):
        et = 0
        st = 0
        for ei in self.experiment_queues:
            if sel in ei.cleaned_automated_runs:

                si = ei.cleaned_automated_runs.index(sel)

                st += ei.stats.calculate_duration(
                    ei.executed_runs + ei.cleaned_automated_runs[:si]) + ei.delay_between_analyses

                rd = self.get_run_duration(sel)
                et = st + rd

                rd = timedelta(seconds=round(rd))
                self.run_duration = str(rd)

                break
            else:
                et += ei.stats.calculate_duration()
        return st, et

    @property
    def etf_iso(self):
        return self.format_duration(self._total_time, fmt='iso')

# ============= EOF =============================================


text:
@interface IMWebViewTests ()

@property (nonatomic,strong) IMWebView *webView;

@end

@implementation IMWebViewTests

- (void)setUp
{
    [super setUp];

    self.webView = [[IMWebView alloc] init];
}

- (void)tearDown
{
    // Tear-down code here.

    [super tearDown];

    self.webView = nil;
}

- (void)testJqueryInjection
{
    [self.webView goToURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/1916643/SkoutLandingPage/index.html"] withCallback:^{
        NSLog(@"impressive");
    }];
}

@end


text:
YUI.add('aui-hsva-palette-modal', function (A, NAME) {

/**
 * The Color Picker Component
 *
 * @module aui-color-picker
 * @submodule aui-hsv-palette-modal
 */

var AArray = A.Array,
    AWidget = A.Widget,
    Lang = A.Lang,

    getClassName = A.getClassName,

    CSS_HSV_PALETTE_MODAL = getClassName('hsv-palette-modal'),

    /**
     * A base class for `HSVAPaletteModal`.
     *
     * @class A.HSVAPaletteModal
     * @extends A.Modal
     * @param {Object} config Object literal specifying widget configuration
     *     properties.
     * @constructor
     */
    HSVAPaletteModal = A.Base.create('hsv-palette-modal', A.Modal, [A.WidgetCssClass, A.WidgetToggle], {

        /**
         * Construction logic executed during `HSVAPaletteModal` instantiation.
         * Lifecycle.
         *
         * @method initializer
         * @protected
         */
        initializer: function() {
            var instance = this;

            instance.after('render', instance._renderHSVAPalette, instance);

            instance.on('selectedChange', instance._onSelectionChange, instance);
        },

        /**
         * Returns the currently selected value of the `HSVPalette`.
         *
         * @method _getSelected
         * @return {String} selected hex color value
         * @protected
         */
        _getSelected: function() {
            var instance = this;

            return instance._hsvPalette.get('selected');
        },

        /**
         * Sets selected value of the `HSVPalette`.
         *
         * @method _onSelectionChange
         * @param {EventFacade} event
         * @protected
         */
        _onSelectionChange: function(event) {
            var instance = this;

            if (event.src !== AWidget.UI_SRC) {
                instance._hsvPalette.set('selected', event.newVal);
            }
        },

        /**
         * Renders the `HSVPalette`.
         *
         * @method _renderHSVAPalette
         * @protected
         */
        _renderHSVAPalette: function() {
            var instance = this,
                body,
                contentBox,
                hsvClass,
                hsvOptions,
                useAlpha;

            contentBox = instance.get('contentBox');

            hsvOptions = instance.get('hsv');

            useAlpha = hsvOptions.alpha;

            hsvClass = A.HSVPalette;

            if (useAlpha) {
                hsvClass = A.HSVAPalette;
            }

            contentBox.addClass(CSS_HSV_PALETTE_MODAL);

            body = instance.getStdModNode(A.WidgetStdMod.BODY);

            instance._hsvPalette = new hsvClass(hsvOptions).render(body);

            if (instance.get('centered')) {
                instance.align();
            }

            instance._hsvPalette.after(
                'selectedChange',
                function(event) {
                    instance.set('selected', event.newVal, {
                        src: AWidget.UI_SRC
                    });
                }
            );
        }
    }, {

        /**
         * Static property used to define the default attribute
         * configuration for the `HSVAPaletteModal`.
         *
         * @property ATTRS
         * @type {Object}
         * @static
         */
        ATTRS: {

            /**
             * Configuration options for the `HSVPalette`.
             *
             * @attribute hsv
             * @type {Object}
             */
            hsv: {
                validator: Lang.isObject,
                value: {
                    alpha: false
                }
            },

            /**
             * Currently `selected` color value.
             *
             * @attribute selected
             * @default ''
             * @type {String}
             */
            selected: {
                getter: '_getSelected',
                validator: Lang.isString,
                value: ''
            }
        },

        /**
         * Static property provides a string to identify the CSS prefix.
         *
         * @property CSS_PREFIX
         * @type {String}
         * @static
         */
        CSS_PREFIX: getClassName('hsv-palette-modal'),

        /**
         * Static property provides a string to identify the class.
         *
         * @property NAME
         * @type {String}
         * @static
         */
        NAME: 'hsv-palette-modal',

        /**
         * Static property provides a string to identify the namespace.
         *
         * @property NS
         * @type {String}
         * @static
         */
        NS: 'hsv-palette-modal'
    });

A.HSVAPaletteModal = HSVAPaletteModal;

}, '2.5.0', {"requires": ["aui-hsva-palette", "aui-modal"], "skinnable": true});


text:
/*global Promise*/
 /*jshint -W083*/
 /*jshint esnext: true*/
 /*jshint moz: true*/
var todoMain = function (){

    var todoList = document.getElementById("todo-list");
    var todoListPlaceholder = document.getElementById("todo-list-placeholder");
    var form = document.getElementById("todo-form");
    var todoTitle = document.getElementById("new-todo");
    var messagesDiv = document.getElementById("messages");
    var incompleteTodoCount = 0;
    var todosLocal = new Map();
    var currentFilter = document.getElementsByClassName("btn-drop-filter")[0];
    var lastActionID = 0;
    var self = this;
    var nextErrorId = 0;
    var messages = new Map();

    this.filter = function(actionElement) {
        currentFilter = actionElement;
        var type = actionElement.value;
        var buts = document.getElementsByClassName("btn-drop-filter");

        for(var i = 0; i < buts.length; i++) {
            buts[i].className = buts[i].className.replace(" active ", "");
        }
        actionElement.className += " active ";

        for (i = 0; i < todoList.childNodes.length; i++) {
            var li = todoList.childNodes[i];
            var textDiv = document.getElementById(li.getAttribute("for"));
            if ((" " + textDiv.className + " ").indexOf(" completed ") > -1) {
                li.style.display = type === "active" ? "none" : "block";
            } else {
                li.style.display = type === "complete" ? "none" : "block";
            }
        }
    };

    this.deleteCompleted = function() {
        var promises = [];
        for (var todo of todosLocal.values()) {
            if (todo.isComplete) {
                promises.push(new Promise(function(resolve, reject) {deleteTodo(todo.id, resolve);}));
            }
        }
        Promise.all(promises).then(reloadTodoList);
    };

    form.onsubmit = function(event) {
        var title = todoTitle.value;
        createTodo(title);
        todoTitle.value = "";
        event.preventDefault();
    };

    function createTodo(title) {
        function optimisticCreateTodo(response){
            var loc = response.headers.get("location");
            var id = loc.substring(loc.lastIndexOf("/") + 1);
            todosLocal.set(id, {id : id, title : title, isComplete : false});
        }

        fetch("/api/todo", {
            method: "post",
            headers: {"Content-type": "application/json"},
            body: JSON.stringify({title: title}),
        })
        .then(checkStatus)
        .then(optimisticCreateTodo)
        .then(renderList)
        .catch(function(error) {
            renderMessageDialog("error", "Failed to create item. Server returned " +
                    error.status + " - " + error.responseText);
        });
        document.getElementById("scrollToMe").scrollIntoView();
    }
    function performActions(actions) {
        actions.forEach(function(actionOb) {
            switch (actionOb.action) {
                case "create" : todosLocal.set(actionOb.data.id, actionOb.data);
                    break;
                case "update" : todosLocal.set(actionOb.data.id, actionOb.data);
                    break;
                case "delete" : todosLocal.delete(actionOb.data.id);
            }
            lastActionID = actionOb.id > lastActionID ? actionOb.id : lastActionID;
        });
    }

    function mappify(arr) {
        arr.forEach(function(todo) {
            todosLocal.set(todo.id, todo);
        });
    }
    function getTodoList(callback) {
        if (lastActionID > 0) {
            fetch("/api/changes?lastActionID=" + lastActionID, {method: "get"})
            .then(checkStatus)
            .then(parseJSON)
            .then(performActions)
            .then(callback)
            .catch(function(error) {
                renderMessageDialog("error", "Failed to get updates. Server returned " +
                    this.status + " - " + this.responseText);
            });
        } else {
            fetch("/api/todo/", {method: "get"})
            .then(checkStatus)
            .then(parseJSON)
            .then(mappify)
            .then(callback)
            .catch(function(error) {
                renderMessageDialog("error", "Failed to get list. Server returned " +
                    this.status + " - " + this.responseText);
            });
            lastActionID++;
        }
    }

    function getTodo(id, callback) {

        fetch("/api/todo/" + id.toString() , {method: "get"})
            .then(checkStatus)
            .then(parseJSON)
            .then(callback)
            .catch(function(error) {
                renderMessageDialog("error", "Failed to get " +
                        id.toString() + ". Server returned " + error.status + " - " + error.responseText);
            });
    }

    function updateTodo(element, todoId) {
        var  todo = todosLocal.get(todoId.toString());
        var checked = element.className.indexOf(" active ") < 0 ;
        if(!checked){
            element.className = element.className.replace(" active ", "");
            element.textContent = "#";
        }else{
            element.className += " active ";
            element.textContent = "$";
        }

        function optimisticUpdatTodo(data) {
            todo.isComplete = checked;
            var textElm = document.getElementById(element.getAttribute("for"));
            if (checked) {
                textElm.className += " completed ";
            } else {
                textElm.className = textElm.className.replace(" completed ", "");
            }
        }
        if(todo !== undefined) {
            fetch("/api/todo/" + todo.id, {
                method : "put",
                headers : {"Content-type" : "application/json"},
                body : JSON.stringify({
                    title: todo.title,
                    isComplete: checked
                })
            })
            .then(checkStatus)
            .then(optimisticUpdatTodo)
            .catch(function(error) {
                    renderMessageDialog("error", "Failed to update item " +
                        todoId.toString() + ". Server returned " + error.status + " - " + error.responseText);
            });
        }
    }

    function deleteTodo(todoId, callback) {
        function optimisticDeleteTodo(response){
             todosLocal.delete(todoId.toString());
            renderList();
        }
        if(messages.get(todoId) !== undefined) {
            messages.delete(todoId);
            renderList();
        }else {
            fetch("/api/todo/" + todoId , {method: "delete"})
            .then(checkStatus)
            .then(optimisticDeleteTodo)
            .then(callback)
            .catch(function(error) {
                renderMessageDialog("error", "Failed to delete item " +
                    todoId.toString() + ". Server returned " + error.status + " - " + error.responseText);
                callback();
            });
        }
    }

    function reloadTodoList() {
        getTodoList(renderList);
    }

    function renderList(){
        var todoListBuff = document.createElement("ul");
        todoListBuff.className = "list-group todo-list-group";
        todoListBuff.id  = "todo-list";
        var parent = todoList.parentNode;

        todoListPlaceholder.style.display = "none";
        incompleteTodoCount = 0;
        var i = 0;
        var promises = [];
        for (var todo of todosLocal.values()) {
            promises.push(new Promise(function(resolve, reject) {
                renderTodo(todoListBuff, todo, i, "todo");
                i++;
                resolve();
            }));
        }
        for (var message of messages.values()) {
            promises.push(new Promise(function(resolve, reject) {
                renderTodo(todoListBuff, message, i, message.type);
                i++;
                resolve();
            }));
        }

        Promise.all(promises).then(function() {
            document.getElementById("count-label").textContent = "Total ToDos left to do: " +
                                                                incompleteTodoCount.toString();
            parent.replaceChild(todoListBuff, todoList);
            todoList = todoListBuff;
            self.filter(currentFilter);
        });
    }

    function renderTodo(ul, todo, i, type) {
        var x = String.fromCharCode(160);
        var listItem = document.createElement("li");
        listItem.className = "list-group-item background-coloured";
        listItem.setAttribute("for", "text" + todo.id);

        var row1 = createRow();
        row1.textContent = "# !/bin/" + type + x + todo.id + x + x;
        row1.className = "topRowDecoraction";

        var deleteButton = document.createElement("button");
        deleteButton.id = "deleteTODO" + i;
        deleteButton.onclick = function(){
            deleteTodo(todo.id);
        };
        deleteButton.className  = "deleteButton btn btn-danger btn-small-square";
        // deleteButton.textContent = "X"
        var deleteSpan = document.createElement("span");
        deleteSpan.className = "glyphicon glyphicon-remove wee-x-there";
        deleteButton.appendChild(deleteSpan);

        row1.appendChild(deleteButton);

        listItem.appendChild(row1);

        /*second row of todo*/
        var row2 = createRow();
        row2.className = "display-flex";

        /*second row checkbox*/
        var checkDiv = document.createElement("div");
        checkDiv.className = "checkbox-div";

        var completeBox = document.createElement("button");
        // completeBox.type = "button";
        completeBox.id = "cb" + todo.id;
        completeBox.setAttribute("for", "text" + todo.id);
        completeBox.className = " btn-checkbox";
        completeBox.textContent = "$";
        if(todo.isComplete) {
            completeBox.className += " active ";
            completeBox.textContent = "#";
        }
        completeBox.onclick = function() {
            updateTodo(completeBox, todo.id);
        };

        checkDiv.appendChild(completeBox);

        row2.appendChild(checkDiv);

        /*second row text*/
        var textDiv =document.createElement("div");
        textDiv.className = "flex-grow-2 title-div " + type;
        if (todo.isComplete) {
            textDiv.className += " completed ";
        }else {
            incompleteTodoCount++;
        }
        textDiv.textContent = todo.title;
        textDiv.id = "text" + todo.id;

        row2.appendChild(textDiv);

        listItem.appendChild(row2);

        ul.appendChild(listItem);
    }

    function createRow(){
        var row = document.createElement("div");
        row.className = "row";
        return row;
    }

    function renderMessageDialog(type, message) {
        var todoListBuff = document.createElement("ul");
        var messageOb = {type: type, title : message, id : "error" + nextErrorId ++, isComplete : false};
        messages.set(messageOb.id, messageOb);
        renderTodo(todoList, messageOb,0, type);

        messagesDiv.disabled = false;
        type = type === undefined ? "error" : type;
        var div = document.createElement("div");
        div.className = "dialog " + type;
        div.textContent = message;
        messagesDiv.insertBefore(div, messagesDiv.firstChild);
    }

    function checkStatus(response) {
        if (response.status >= 200 && response.status < 400) {
            return response;
        } else {
            var error = new Error(response.statusText);
            error.response = response;
            throw error;
        }
    }

    function parseJSON(response) {
        return response.json();
    }

    reloadTodoList();
    var timedReload = window.setInterval(reloadTodoList, 1000);
};
todoMain();


text:
<?php

namespace Docker\API\Normalizer;

use Joli\Jane\Reference\Reference;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer;

class VolumeConfigNormalizer extends SerializerAwareNormalizer implements DenormalizerInterface, NormalizerInterface
{
    public function supportsDenormalization($data, $type, $format = null)
    {
        if ($type !== 'Docker\\API\\Model\\VolumeConfig') {
            return false;
        }

        return true;
    }

    public function supportsNormalization($data, $format = null)
    {
        if ($data instanceof \Docker\API\Model\VolumeConfig) {
            return true;
        }

        return false;
    }

    public function denormalize($data, $class, $format = null, array $context = [])
    {
        if (empty($data)) {
            return null;
        }
        if (isset($data->{'$ref'})) {
            return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
        }
        $object = new \Docker\API\Model\VolumeConfig();
        if (!isset($context['rootSchema'])) {
            $context['rootSchema'] = $object;
        }
        if (property_exists($data, 'Name')) {
            $object->setName($data->{'Name'});
        }
        if (property_exists($data, 'Driver')) {
            $object->setDriver($data->{'Driver'});
        }
        if (property_exists($data, 'DriverOpts')) {
            $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
            foreach ($data->{'DriverOpts'} as $key => $value) {
                $values[$key] = $value;
            }
            $object->setDriverOpts($values);
        }

        return $object;
    }

    public function normalize($object, $format = null, array $context = [])
    {
        $data = new \stdClass();
        if (null !== $object->getName()) {
            $data->{'Name'} = $object->getName();
        }
        if (null !== $object->getDriver()) {
            $data->{'Driver'} = $object->getDriver();
        }
        if (null !== $object->getDriverOpts()) {
            $values = new \stdClass();
            foreach ($object->getDriverOpts() as $key => $value) {
                $values->{$key} = $value;
            }
            $data->{'DriverOpts'} = $values;
        }

        return $data;
    }
}


text:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Do not modify this file directly.  Instead, copy entries that you -->
<!-- wish to modify from this file into spatial-site.xml and change them -->
<!-- there.  If spatial-site.xml does not already exist, create it.      -->

<configuration>

<!--- global properties -->

<property>
  <name>spatialHadoop.storage.RTreeDegree</name>
  <value>11</value>
  <description>Default degree of RTrees built in blocks</description>
</property>

<property>
  <name>spatialHadoop.storage.RTreeBlockSize</name>
  <value>33554432</value>
  <description>Default block size for RTree files</description>
</property>

<property>
  <name>spatialHadoop.storage.RTreeBuildMode</name>
  <value>fast</value>
  <description>Which mode to use when building the RTree. Could be "fast" or "light"</description>
</property>

<property>
  <name>spatialHadoop.mapred.MaxShapesPerRead</name>
  <value>1000000</value>
  <description>Maximum number of shapes to read in one read operation and return when reading a file as array</description>
</property>

</configuration>