text:
/************************************************************************************************
* Financial Table Plugin JS
* Description: Convenient and nice time saver for creating financial table to business standards.
* Author: Thomas Dintrone
* Version 1.0
************************************************************************************************/
function setTable(table, settings){
	// settings
    var config = {
        'dollarPosition': [0, 0, 0, 0, 0],
        'currentYear': 2,
		'textColor': '#000000',
		'row': [],
		'border': [],
		'firstColWidth': '400px',
    };
    if ( settings ){$.extend(config, settings);}

	// SET THE TABLE:
	$(table).addClass('selectedTable');
	$(table).find('th:first').addClass('firstCol').css({ width:config.firstColWidth });

	$(table + ' td').css({ color:config.textColor })

	colCount = $(table + ' tbody tr:first td').length;
	findRow = $(table).find('tbody tr');

	b = 0; // for border ** Started to wrk this out but didn't finish yet...
	$(findRow).each(function(i,e) {
		c 		= 1;
		posNum 	= -1;
		r 		= $(e).find('td');

		//$(r).text(b);

		if(config.row[b] == b+1) {
			var borderClass = 'border'+config.border[b];
			$(e).addClass(borderClass);
		}

		$(r).each(function(index, element) {
            $(element).addClass('col'+c);

			//Find the current year
			if(c == config.currentYear) {
				$(element).addClass('curYear');
			}

			if(c == 1) {
				// do nothing
			} else {
				// Do the Rest
				$(element).wrapInner('

');

				var pos = config.dollarPosition[posNum];
				//div = $(element).find('div');
				div = $(element);
				div.html(function(i, old){
					return old
							.replace('$', '$')
							.replace('(', '(')
							.replace(')', ')')
							.replace('%)', '%)')
							.replace('%', '%');
				});
			}
        	c++;
			posNum++;
		});

		b++;
     });

	$(table).css({ opacity:0, 'visibility':'visible' }).animate({ opacity:1 });
}


text:
package com.twu.biblioteca.service;

import com.twu.biblioteca.domain.model.Movie;
import com.twu.biblioteca.domain.repo.MovieRepo;
import com.twu.biblioteca.util.TestFixtures;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class MovieServiceTest extends TestFixtures {

    private MovieService movieService;
    private MovieRepo movieRepo;
    private SimpleDateFormat formatter;

    @Before
    public void setUp() {
        formatter = new SimpleDateFormat("yyyy");
        movieRepo = new MovieRepo();
        movieService = new MovieService(movieRepo);
    }

    @After
    public void tearDown() {
        formatter = null;
        movieRepo = null;
        movieService = null;
    }

    @Test
    public void should_fetch_list_of_movies_when_checked_out_movies_is_empty() throws ParseException {
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(6));
        assertThat(moviesCanCheckout.get(0).getId(), is("M-01"));
        assertThat(moviesCanCheckout.get(0).getName(), is("The Shawshank Redemption"));
        assertThat(moviesCanCheckout.get(0).getDirector(), is("Frank Darabont"));
        assertThat(moviesCanCheckout.get(0).getYear(), is(formatter.parse("1994")));
        assertThat(moviesCanCheckout.get(0).getRating(), is("10"));
    }

    @Test
    public void should_checkout_movie_success_when_movie_is_can_be_checked_out() {
        String message = movieService.checkoutMovie("M-03", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(moviesCanCheckout.get(2).getId(), is("M-04"));
        assertThat(message, is(SUCCESS_CHECKOUT_MOVIE_MESSAGE));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
    }

    @Test
    public void should_checkout_movie_failure_when_movie_is_not_exist() {
        String message = movieService.checkoutMovie("nonexistence", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(6));
        assertThat(moviesCanCheckout.get(2).getId(), is("M-03"));
        assertThat(message, is(FAILURE_CHECKOUT_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(0));
    }

    @Test
    public void should_checkout_movie_failure_when_movie_is_exist_in_checked_out_movies() {
        movieRepo.addCheckedOutMovie("M-03", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();
        String message = movieService.checkoutMovie("M-03", USER_ID);

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(moviesCanCheckout.get(2).getId(), is("M-04"));
        assertThat(message, is(FAILURE_CHECKOUT_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(1));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
    }

    @Test
    public void should_return_movie_success_when_movie_is_can_be_return() {
        movieRepo.addCheckedOutMovie("M-03", USER_ID);
        movieRepo.addCheckedOutMovie("M-04", USER_ID);
        String message = movieService.returnMovie("M-03", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(message, is(SUCCESS_RETURN_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(1));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-04"));
    }

    @Test
    public void should_return_movie_success_when_movie_is_checked_out_by_current_customer() {
        movieRepo.addCheckedOutMovie("M-03", "C00-0002");
        movieRepo.addCheckedOutMovie("M-04", USER_ID);
        String message = movieService.returnMovie("M-04", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(message, is(SUCCESS_RETURN_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(1));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
    }

    @Test
    public void should_return_movie_failure_when_movie_is_not_checked_out_by_current_customer() {
        movieRepo.addCheckedOutMovie("M-03", "C00-0002");
        movieRepo.addCheckedOutMovie("M-04", USER_ID);
        String message = movieService.returnMovie("M-03", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(4));
        assertThat(message, is(FAILURE_RETURN_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(2));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-04"));
    }

    @Test
    public void should_return_movie_failure_when_movie_is_not_exist() {
        movieRepo.addCheckedOutMovie("M-03", USER_ID);
        String message = movieService.returnMovie("M-08", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(message, is(FAILURE_RETURN_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(1));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
    }

    @Test
    public void should_return_movie_failure_when_movie_is_not_checked_out() {
        movieRepo.addCheckedOutMovie("M-03", USER_ID);
        String message = movieService.returnMovie("M-04", USER_ID);
        List<Movie> moviesCanCheckout = movieService.fetchMoviesCanCheckout();

        assertThat(moviesCanCheckout.size(), is(5));
        assertThat(message, is(FAILURE_RETURN_MOVIE_MESSAGE));
        assertThat(movieRepo.getCheckedOutMovies().size(), is(1));
        assertTrue(movieRepo.getCheckedOutMovies().containsKey("M-03"));
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta name="format-detection" content="telephone=no" />

  <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, height=device-height, target-densitydpi=device-dpi" />

  <meta name="msapplication-tap-highlight" content="no" />

  <title>快聚-我的生活</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf8">
  <link href="img/favicon.ico" type="image/x-icon" rel="shortcut icon" />

  <link href="dist/css/bootstrap.min.css" rel="stylesheet">

亿企富

伴随企业走向辉煌!

e启富

信息带动创新,知识激活力量!

商家快讯

吃住娱乐

公告板

旅游出差

特色产品

互动圈

生活用品

服务中介

企业采购

微网站

主页

商家

订单

我的


text:
<?php

namespace Opifer\CmsBundle\Controller\Backend;

use APY\DataGridBundle\Grid\Action\RowAction;
use APY\DataGridBundle\Grid\Column\ActionsColumn;
use APY\DataGridBundle\Grid\Column\JoinColumn;
use APY\DataGridBundle\Grid\Column\TextColumn;
use APY\DataGridBundle\Grid\Source\Entity;
use Opifer\FormBundle\Controller\PostController as BasePostController;
use Symfony\Component\HttpFoundation\Response;

class PostController extends BasePostController
{
    /**
     * index.
     *
     * @param int $formId
     *
     * @return Response
     */
    public function indexAction($formId)
    {
        $form = $this->get('opifer.form.form_manager')->getRepository()->find($formId);

        if (!$form) {
            return $this->createNotFoundException();
        }

        $source = new Entity('OpiferCmsBundle:Post');
        $tableAlias = $source->getTableAlias();
        $source->manipulateQuery(function ($query) use ($tableAlias, $form) {
            $query->andWhere($tableAlias.'.form = :form')->setParameter('form', $form);
        });

        $viewAction = new RowAction('view', 'opifer_form_post_view');
        $viewAction->setRouteParameters(['id']);

        $deleteAction = new RowAction('delete', 'opifer_form_post_delete');
        $deleteAction->setRouteParameters(['id']);

        $grid = $this->get('grid');
        $grid->setId('posts')
            ->setSource($source)
            ->addRowAction($viewAction)
            ->addRowAction($deleteAction);

        return $grid->getGridResponse('OpiferCmsBundle:Backend/Post:index.html.twig', ['form' => $form]);
    }

    public function listAction()
    {
        $source = new Entity('OpiferCmsBundle:Post');

        $formColumn = new TextColumn(['id' => 'posts', 'title' => 'Form', 'source' => false, 'filterable' => false, 'sortable' => false, 'safe' => false]);
        $formColumn->manipulateRenderCell(function ($value, $row, $router) {
            return 'generateUrl('opifer_form_form_edit', ['id'=> $row->getEntity()->getForm()->getId()]).'">'.$row->getEntity()->getForm()->getName().'';
        });

        $viewAction = new RowAction('view', 'opifer_form_post_view');
        $viewAction->setRouteParameters(['id']);

        $deleteAction = new RowAction('delete', 'opifer_form_post_delete');
        $deleteAction->setRouteParameters(['id']);

        $grid = $this->get('grid');
        $grid->setId('posts')
            ->setSource($source)
            ->addColumn($formColumn, 2)
            ->addRowAction($viewAction)
            ->addRowAction($deleteAction);

        return $grid->getGridResponse('OpiferCmsBundle:Backend/Post:list.html.twig');
    }
}


text:
'use strict';

// Declare app level module which depends on views, and components
var myApp = angular.module('myApp', [
  'ngRoute',
  'ui.bootstrap',
  'myApp.home',
  'myApp.register',
  'myApp.welcome',
  'myApp.addPost',
  'myApp.modal',
  'myApp.dmodal'
]);
myApp.
config(['$routeProvider', function($routeProvider) {
	   $routeProvider.when('/home', {
        templateUrl: 'home/home.html',
        controller: 'HomeCtrl',
        controllerAs: 'home'
    }).when('/register', {
        templateUrl: 'register/register.html',
        controller: 'RegisterCtrl',
        controllerAs: 'register'
    }).when('/welcome', {
        templateUrl: 'welcome/welcome.html',
        controller: 'WelcomeCtrl',
        controllerAs: 'welcome'
    }).when('/addPost', {
        templateUrl: 'addPost/addPost.html',
        controller: 'AddPostCtrl',
        controllerAs: 'addpost'
    });;
  $routeProvider.otherwise({redirectTo: '/home'});
}]);

myApp.value('baseUrl', 'https://glaring-heat-4420.firebaseio.com');


text:
A service has been introduced which runs a dockerised image of *journald-cloudwatch-logs*. This service forwards journald logs to AWS CloudWatch to a LogGroup with the name of .ClusterName and is run on all nodes (Etcds, Controllers and Workers).

*journald-cloudwatch-logs* is a goLang project https://github.com/saymedia/journald-cloudwatch-logs.

The default docker image *[jollinshead/journald-cloudwatch-logs](https://hub.docker.com/r/jollinshead/journald-cloudwatch-logs/)* is a wrapper around the go binary of *journald-cloudwatch-logs*.

This feature is disabled by default and configurable in cluster.yaml:

```
cloudWatchLogging:
 enabled: false
 retentionInDays: 7
```

The docker image is also configurable:

```
journaldCloudWatchLogsImage:
  repo: "jollinshead/journald-cloudwatch-logs"
  tag: "0.1"
  rktPullDocker: true
```

## kube-aws up/update feedback

During kube-aws up/update, filtered Journald logs can be printed to stdout. This may assist debugging.
The format of the messages are:
```
TimePassed   NodeName: "LogMessage"
```
For example:
```
+00:04:51	ip-10-29-29-100.us-west-2.compute.internal: "check-certification-validity.service: Failed to run 'start-pre' task: No such file or directory"
+00:04:52	ip-10-29-29-100.us-west-2.compute.internal: "check-certification-validity.service: Failed with result 'resources'."
+00:04:53	ip-10-29-29-100.us-west-2.compute.internal: "kubelet.service: Failed with result 'exit-code'."
```

This feature is configurable in cluster.yaml under the *cloudWatchLogging* section, and requires *cloudWatchLogging* to be enabled.
( Default values: )

```
cloudWatchLogging:
 enabled: false
 imageWithTag: jollinshead/journald-cloudwatch-logs:0.1
 retentionInDays: 7
 localStreaming:
  enabled: true
  filter:  `{ $.priority = "CRIT" || $.priority = "WARNING" && $.transport = "journal" && $.systemdUnit = "init.scope" }`
  interval: 60
```

NOTE: Due to high initial entropy, *.service* failures may occur during the early stages of booting.
In this context Entropy refers to the disorder of *.service*s (starting, failing, restarting).

### Parameters

#### Filter
By default the filter is configured for *.service* failures and messages flagged as 'critical'.
See [the official AWS documentation](http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) for more information.

#### Interval
Since some messages are produced frequently, to avoid excessive spam, an 'interval' parameter is provided.
This 'interval' value determines the time between printing two identical messages to stdout.


text:
/**
 * Created by yuxuan on 9/13/16.
 */
import io from 'socket.io-client'

const socket = io('http://' + location.hostname + ':3000')
function createInterface (method) {
  return function (path, data, cb) {
    this.emit('message', { method: method, path: path, data: data }, cb)
  }
}
function socketWrap (socket) {
  socket.get = createInterface('GET')
  socket.post = createInterface('POST')
  socket.put = createInterface('PUT')
  socket.delete = createInterface('DELETE')
  return socket
}
export default socketWrap(socket)


text:
import {registerPlugin} from '@webex/webex-core';
import Authorization from './authorization';
import config from './config';

const proxies = [
  'isAuthorizing',
  'isAuthenticating'
];

registerPlugin('authorization', Authorization, {
  config,
  proxies
});

export {default} from './authorization';
export {default as config} from './config';


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [puppeteer](./puppeteer.md) > [Protocol](./puppeteer.protocol.md) > [Page](./puppeteer.protocol.page.md) > [NavigateRequest](./puppeteer.protocol.page.navigaterequest.md) > [referrer](./puppeteer.protocol.page.navigaterequest.referrer.md)

## Protocol.Page.NavigateRequest.referrer property

Referrer URL.

<b>Signature:</b>

```typescript
referrer?: string;
```


text:
package com.find1x.gpms.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.jasper.tagplugins.jstl.core.If;
import org.apache.struts2.ServletActionContext;

import com.find1x.gpms.dao.SysControlDAO;
import com.find1x.gpms.dao.TeacherDAO;
import com.find1x.gpms.pojos.SysControl;
import com.find1x.gpms.pojos.Teacher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class AdminSysControlAction extends ActionSupport {

	ActionContext context = ActionContext.getContext();
	HttpServletRequest request = (HttpServletRequest) context
			.get(ServletActionContext.HTTP_REQUEST);
	HttpServletResponse response = (HttpServletResponse) context
			.get(ServletActionContext.HTTP_RESPONSE);
	HttpSession session = request.getSession();

	private static final long serialVersionUID = 1L;

	private String s1;
	private String s2;
	private String s3;
	private String s4;
	private String s5;
	private String s6;
	private String s7;
	private String s8;
	private String s9;
	private String s10;
	private String s11;

	@Override
	public String execute() throws Exception {
		SysControl sysControl = SysControlDAO.GetSysControl();
		;
		sysControl.setS1("true".equals(s1));
		sysControl.setS2("true".equals(s2));
		sysControl.setS3("true".equals(s3));
		sysControl.setS4("true".equals(s4));
		sysControl.setS5("true".equals(s5));
		sysControl.setS6("true".equals(s6));
		sysControl.setS7("true".equals(s7));
		sysControl.setS8("true".equals(s8));
		sysControl.setS9("true".equals(s9));
		sysControl.setS10("true".equals(s10));
		sysControl.setS11("true".equals(s11));
		SysControlDAO.saveSysControl(sysControl);
		return SUCCESS;
	}

	/**
	 * @return the s1
	 */
	public String getS1() {
		return s1;
	}

	/**
	 * @param s1
	 *            the s1 to set
	 */
	public void setS1(String s1) {
		this.s1 = s1;
	}

	/**
	 * @return the s2
	 */
	public String getS2() {
		return s2;
	}

	/**
	 * @param s2
	 *            the s2 to set
	 */
	public void setS2(String s2) {
		this.s2 = s2;
	}

	/**
	 * @return the s3
	 */
	public String getS3() {
		return s3;
	}

	/**
	 * @param s3
	 *            the s3 to set
	 */
	public void setS3(String s3) {
		this.s3 = s3;
	}

	/**
	 * @return the s4
	 */
	public String getS4() {
		return s4;
	}

	/**
	 * @param s4
	 *            the s4 to set
	 */
	public void setS4(String s4) {
		this.s4 = s4;
	}

	/**
	 * @return the s5
	 */
	public String getS5() {
		return s5;
	}

	/**
	 * @param s5
	 *            the s5 to set
	 */
	public void setS5(String s5) {
		this.s5 = s5;
	}

	/**
	 * @return the s6
	 */
	public String getS6() {
		return s6;
	}

	/**
	 * @param s6
	 *            the s6 to set
	 */
	public void setS6(String s6) {
		this.s6 = s6;
	}

	/**
	 * @return the s7
	 */
	public String getS7() {
		return s7;
	}

	/**
	 * @param s7
	 *            the s7 to set
	 */
	public void setS7(String s7) {
		this.s7 = s7;
	}

	/**
	 * @return the s8
	 */
	public String getS8() {
		return s8;
	}

	/**
	 * @param s8
	 *            the s8 to set
	 */
	public void setS8(String s8) {
		this.s8 = s8;
	}

	/**
	 * @return the s9
	 */
	public String getS9() {
		return s9;
	}

	/**
	 * @param s9
	 *            the s9 to set
	 */
	public void setS9(String s9) {
		this.s9 = s9;
	}

	/**
	 * @return the s10
	 */
	public String getS10() {
		return s10;
	}

	/**
	 * @param s10
	 *            the s10 to set
	 */
	public void setS10(String s10) {
		this.s10 = s10;
	}

	/**
	 * @return the s11
	 */
	public String getS11() {
		return s11;
	}

	/**
	 * @param s11
	 *            the s11 to set
	 */
	public void setS11(String s11) {
		this.s11 = s11;
	}
}


text:
package org.apache.accumulo.core.metadata;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;

import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.impl.AccumuloServerException;
import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.ScannerOptions;
import org.apache.accumulo.core.client.impl.TabletLocator;
import org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation;
import org.apache.accumulo.core.client.impl.TabletLocator.TabletLocations;
import org.apache.accumulo.core.client.impl.TabletLocatorImpl.TabletLocationObtainer;
import org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator;
import org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.ResultReceiver;
import org.apache.accumulo.core.client.impl.ThriftScanner;
import org.apache.accumulo.core.data.Column;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.PartialKey;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.data.impl.KeyExtent;
import org.apache.accumulo.core.data.thrift.IterInfo;
import org.apache.accumulo.core.iterators.user.WholeRowIterator;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
import org.apache.accumulo.core.util.OpTimer;
import org.apache.accumulo.core.util.TextUtil;
import org.apache.hadoop.io.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MetadataLocationObtainer implements TabletLocationObtainer {
  private static final Logger log = LoggerFactory.getLogger(MetadataLocationObtainer.class);

  private SortedSet<Column> locCols;
  private ArrayList<Column> columns;

  public MetadataLocationObtainer() {

    locCols = new TreeSet<Column>();
    locCols.add(new Column(TextUtil.getBytes(TabletsSection.CurrentLocationColumnFamily.NAME), null, null));
    locCols.add(TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.toColumn());
    columns = new ArrayList<Column>(locCols);
  }

  @Override
  public TabletLocations lookupTablet(ClientContext context, TabletLocation src, Text row, Text stopRow, TabletLocator parent)
      throws AccumuloSecurityException, AccumuloException {

    try {

      OpTimer timer = null;

      if (log.isTraceEnabled()) {
        log.trace("tid={} Looking up in {} row={} extent={} tserver={}", Thread.currentThread().getId(), src.tablet_extent.getTableId(),
            TextUtil.truncate(row), src.tablet_extent, src.tablet_location);
        timer = new OpTimer().start();
      }

      Range range = new Range(row, true, stopRow, true);

      TreeMap<Key,Value> encodedResults = new TreeMap<Key,Value>();
      TreeMap<Key,Value> results = new TreeMap<Key,Value>();

      // Use the whole row iterator so that a partial mutations is not read. The code that extracts locations for tablets does a sanity check to ensure there is
      // only one location. Reading a partial mutation could make it appear there are multiple locations when there are not.
      List<IterInfo> serverSideIteratorList = new ArrayList<IterInfo>();
      serverSideIteratorList.add(new IterInfo(10000, WholeRowIterator.class.getName(), "WRI"));
      Map<String,Map<String,String>> serverSideIteratorOptions = Collections.emptyMap();
      boolean more = ThriftScanner.getBatchFromServer(context, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, serverSideIteratorList,
          serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L, null);

      decodeRows(encodedResults, results);

      if (more && results.size() == 1) {
        range = new Range(results.lastKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME), true, new Key(stopRow).followingKey(PartialKey.ROW), false);
        encodedResults.clear();
        more = ThriftScanner.getBatchFromServer(context, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, serverSideIteratorList,
            serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L, null);

        decodeRows(encodedResults, results);
      }

      if (timer != null) {
        timer.stop();
        log.trace("tid={} Got {} results from {} in {}", Thread.currentThread().getId(), results.size(), src.tablet_extent,
            String.format("%.3f secs", timer.scale(TimeUnit.SECONDS)));
      }

      // if (log.isTraceEnabled()) log.trace("results "+results);

      return MetadataLocationObtainer.getMetadataLocationEntries(results);

    } catch (AccumuloServerException ase) {
      if (log.isTraceEnabled())
        log.trace("{} lookup failed, {} server side exception", src.tablet_extent.getTableId(), src.tablet_location);
      throw ase;
    } catch (NotServingTabletException e) {
      if (log.isTraceEnabled())
        log.trace("{} lookup failed, {} not serving {}", src.tablet_extent.getTableId(), src.tablet_location, src.tablet_extent);
      parent.invalidateCache(src.tablet_extent);
    } catch (AccumuloException e) {
      if (log.isTraceEnabled())
        log.trace("{} lookup failed", src.tablet_extent.getTableId(), e);
      parent.invalidateCache(context.getInstance(), src.tablet_location);
    }

    return null;
  }

  private void decodeRows(TreeMap<Key,Value> encodedResults, TreeMap<Key,Value> results) throws AccumuloException {
    for (Entry<Key,Value> entry : encodedResults.entrySet()) {
      try {
        results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()));
      } catch (IOException e) {
        throw new AccumuloException(e);
      }
    }
  }

  @Override
  public List<TabletLocation> lookupTablets(ClientContext context, String tserver, Map<KeyExtent,List<Range>> tabletsRanges, TabletLocator parent)
      throws AccumuloSecurityException, AccumuloException {

    final TreeMap<Key,Value> results = new TreeMap<Key,Value>();

    ResultReceiver rr = new ResultReceiver() {

      @Override
      public void receive(List<Entry<Key,Value>> entries) {
        for (Entry<Key,Value> entry : entries) {
          try {
            results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()));
          } catch (IOException e) {
            throw new RuntimeException(e);
          }
        }
      }
    };

    ScannerOptions opts = new ScannerOptions() {
      ScannerOptions setOpts() {
        this.fetchedColumns = locCols;
        // see comment in lookupTablet about why iterator is used
        addScanIterator(new IteratorSetting(10000, "WRI", WholeRowIterator.class.getName()));
        return this;
      }
    }.setOpts();

    Map<KeyExtent,List<Range>> unscanned = new HashMap<KeyExtent,List<Range>>();
    Map<KeyExtent,List<Range>> failures = new HashMap<KeyExtent,List<Range>>();
    try {
      TabletServerBatchReaderIterator.doLookup(context, tserver, tabletsRanges, failures, unscanned, rr, columns, opts, Authorizations.EMPTY);
      if (failures.size() > 0) {
        // invalidate extents in parents cache
        if (log.isTraceEnabled())
          log.trace("lookupTablets failed for {} extents", failures.size());
        parent.invalidateCache(failures.keySet());
      }
    } catch (IOException e) {
      log.trace("lookupTablets failed server={}", tserver, e);
      parent.invalidateCache(context.getInstance(), tserver);
    } catch (AccumuloServerException e) {
      log.trace("lookupTablets failed server={}", tserver, e);
      throw e;
    }

    return MetadataLocationObtainer.getMetadataLocationEntries(results).getLocations();
  }

  public static TabletLocations getMetadataLocationEntries(SortedMap<Key,Value> entries) {
    Key key;
    Value val;
    Text location = null;
    Text session = null;
    Value prevRow = null;
    KeyExtent ke;

    List<TabletLocation> results = new ArrayList<TabletLocation>();
    ArrayList<KeyExtent> locationless = new ArrayList<KeyExtent>();

    Text lastRowFromKey = new Text();

    // text obj below is meant to be reused in loop for efficiency
    Text colf = new Text();
    Text colq = new Text();

    for (Entry<Key,Value> entry : entries.entrySet()) {
      key = entry.getKey();
      val = entry.getValue();

      if (key.compareRow(lastRowFromKey) != 0) {
        prevRow = null;
        location = null;
        session = null;
        key.getRow(lastRowFromKey);
      }

      colf = key.getColumnFamily(colf);
      colq = key.getColumnQualifier(colq);

      // interpret the row id as a key extent
      if (colf.equals(TabletsSection.CurrentLocationColumnFamily.NAME) || colf.equals(TabletsSection.FutureLocationColumnFamily.NAME)) {
        if (location != null) {
          throw new IllegalStateException("Tablet has multiple locations : " + lastRowFromKey);
        }
        location = new Text(val.toString());
        session = new Text(colq);
      } else if (TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.equals(colf, colq)) {
        prevRow = new Value(val);
      }

      if (prevRow != null) {
        ke = new KeyExtent(key.getRow(), prevRow);
        if (location != null)
          results.add(new TabletLocation(ke, location.toString(), session.toString()));
        else
          locationless.add(ke);

        location = null;
        prevRow = null;
      }
    }

    return new TabletLocations(results, locationless);
  }
}


text:
<?php

namespace Phlexible\Bundle\ElementBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Element.
 *
 * @author Stephan Wentz <sw@brainbits.net>
 *
 * @ORM\Entity(repositoryClass="Phlexible\Bundle\ElementBundle\Entity\Repository\ElementRepository")
 * @ORM\Table(name="element")
 */
class Element
{
    /**
     * @var int
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="integer")
     */
    private $eid;

    /**
     * @var string
     * @ORM\Column(name="unique_id", type="string", length=255, nullable=true, unique=true)
     */
    private $uniqueId;

    /**
     * @var string
     * @ORM\Column(name="elementtype_id", type="string")
     * @TODO: elementSource?
     */
    private $elementtypeId;

    /**
     * @var string
     * @ORM\Column(name="master_language", type="string", length=2, options={"fixed"=true})
     */
    private $masterLanguage;

    /**
     * @var int
     * @ORM\Column(name="latest_version", type="integer")
     */
    private $latestVersion;

    /**
     * @var \DateTime
     * @ORM\Column(name="created_at", type="datetime")
     */
    private $createdAt;

    /**
     * @var string
     * @ORM\Column(name="create_user_id", type="string", length=36, options={"fixed"=true})
     */
    private $createUserId;

    /**
     * @return int
     */
    public function getEid()
    {
        return $this->eid;
    }

    /**
     * @param int $eid
     *
     * @return $this
     */
    public function setEid($eid)
    {
        $this->eid = $eid;

        return $this;
    }

    /**
     * @return string
     */
    public function getUniqueId()
    {
        return $this->uniqueId;
    }

    /**
     * @param string $uniqueId
     *
     * @return $this
     */
    public function setUniqueId($uniqueId)
    {
        $this->uniqueId = $uniqueId;

        return $this;
    }

    /**
     * @return string
     */
    public function getElementtypeId()
    {
        return $this->elementtypeId;
    }

    /**
     * @param string $elementtypeId
     *
     * @return $this
     */
    public function setElementtypeId($elementtypeId)
    {
        $this->elementtypeId = $elementtypeId;

        return $this;
    }

    /**
     * @return string
     */
    public function getMasterLanguage()
    {
        return $this->masterLanguage;
    }

    /**
     * @param string $masterLanguage
     *
     * @return $this
     */
    public function setMasterLanguage($masterLanguage)
    {
        $this->masterLanguage = $masterLanguage;

        return $this;
    }

    /**
     * @return int
     */
    public function getLatestVersion()
    {
        return $this->latestVersion;
    }

    /**
     * @param int $latestVersion
     *
     * @return $this
     */
    public function setLatestVersion($latestVersion)
    {
        $this->latestVersion = $latestVersion;

        return $this;
    }

    /**
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * @param \DateTime $createdAt
     *
     * @return $this
     */
    public function setCreatedAt(\DateTime $createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

    /**
     * @return string
     */
    public function getCreateUserId()
    {
        return $this->createUserId;
    }

    /**
     * @param string $createUserId
     *
     * @return $this
     */
    public function setCreateUserId($createUserId)
    {
        $this->createUserId = $createUserId;

        return $this;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Anubhav Gupta</title>
    <link rel="shortcut icon" href="img/a-icon.ico" />

    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

    <link rel="stylesheet" href="css/animate.min.css" type="text/css">

    <link rel="stylesheet" href="css/creative.css" type="text/css">

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Home

                        Contact

NYCe Taxi

CONCEPT

                    The overall objective of this project was to develop an algorithm that can be used to analyze the pattern in which cabs operate in a city to try and predict the tip can be expected per fare.
                    The idea for this project was based on the assumption that the trip history of cab drivers when combined with demographic data about the  model the tipping habits of people at different location, different points of times and for different kinds of trips. Using different machine learning techniques, we wanted to develop a system that would assign a given trip into specific classes designating tip amounts.

DATA

                    The dataset was obtained from the New York City Taxi and Limousine Commission(NYCT&L).  It covers four years of taxi operations in New York City and includes 697,622,444 trips.
                    Source of the dataset: http://publish.illinois.edu/dbwork/open-data/

                    he data consists of two parts - Trip data containing trip information like pickup_datetime, trip distance, trip time etc. and Fare data containing fare information like fare amount, tip amount etc.

                    We had latitude and longitude information in our trip data. We wanted to get information about the characteristics of the place like affluency, cost of living etc. Our initial plan was to split our latitude and longitude into the different boroughs. But the boroughs extend over a large area, so we instead decided to go with zip codes . We found open data which had zip codes  and the latitude-longitude pair for the centre of that zip code. We also scraped a website to obtain demographic information of a zip code. We joined these datasets and added in the attributes on demographic information to our  merged trip-fare dataset.

APPROACH

                    Like mentioned earlier, the dataset consists of trip and fare data. Our initial ideas were to predict peak hours in  the city and predict traffic at  different times as a function of the average speed. After further analysis and discussion we concluded these problem statements are good visualization projects and we looked at more machine learning based problem statement.

                    Wait time Prediction
                    Our next approach was to predict the wait time - the time a taxi driver has to wait in between trips. The dataset does not explicitly have the wait times. We would have had to derive the wait times between trips  from the pickup and dropoff timings and the passenger count information. We performed these data operations and figured out the dataset had 98% zero wait time and the rest of it was about an average of just one minute. Since the data was very skewed and since there was not much of a practical significance of the predicting wait time  problem we decided to try a explore the dataset with a slightly different angle. We found that our previous analysis could be leveraged to try and solve another challenging problem, that of tip prediction.

                    Tip Amount Prediction
                    We wanted to predict the tip amount a driver is likely to receive.
                    Since we found the data to be skewed for wait times, we wanted to confirm that was not the case for tip amounts. We found 50% of the data had zero tip. So, we were safe here. Our generic approach was to visualize the data to understand it better. This would give us information about outliers and incorrect (absurd values) that need to be removed. Apart from data cleaning, the other important affordance of the visualizations is the correlation we can derive between the different attributes and the tip amount.

ALGORITHMS USED

                    In order to analyze the Jeopardy data and generate insights out of it, we followed the a process that looked at the data using the following visualizations:

                        Classification Models

Support Vector Machines

Decision Trees

Random Forests

Adaboost

                        Regression Models

Linear Regression

SVM Regression

Lasso Regression

                   View Presentation

Visualizations

Correlations

Confusion Matrix

Get In Touch!


text:
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'

addMatchImageSnapshotCommand({
  customDiffDir: 'cypress/snapshots-diff',
  failureThreshold: 0.04, // threshold for entire image
  failureThresholdType: 'percent', // percent of image or number of pixels
  customDiffConfig: { threshold: 0.1 }, // threshold for each pixel
  capture: 'viewport' // capture viewport in screenshot
})

Cypress.Commands.add('waitForSplashscreen', () => {
  // Lading can be long on TravisCI.
  cy.get('[data-test=splash-screen]', { timeout: 60000 }).should('not.exist')
})

Cypress.Commands.add('waitForSpinner', () => {
  // Lading can be long on TravisCI.
  cy.get('[data-test=spinner]', { timeout: 60000 }).should('not.exist')
})

// Accepts array of page coordinates, e.g.:
// cy.drag('.map', [ { x: 700, y: 500 }, { x: 800, y: 500 } ])
Cypress.Commands.add('drag', (element, positions) => {
  const options = positions.map(pos => (
    { button: 0, clientX: pos.x, clientY: pos.y, pageX: pos.x, pageY: pos.y }
  ))
  options.forEach((opt, idx) => {
    cy.get(element).first().trigger(idx === 0 ? 'mousedown' : 'mousemove', opt)
    cy.wait(20)
  })
  cy.get(element).first().trigger('mouseup')
  cy.wait(20)
})


text:
package singleton.twoface

import impl._

object TwoFace {
  type Char[T0] = TwoFaceAny.Char[T0]
  val Char = TwoFaceAny.Char

  type Int[T0] = TwoFaceAny.Int[T0]
  val Int = TwoFaceAny.Int

  type Long[T0] = TwoFaceAny.Long[T0]
  val Long = TwoFaceAny.Long

  type Float[T0] = TwoFaceAny.Float[T0]
  val Float = TwoFaceAny.Float

  type Double[T0] = TwoFaceAny.Double[T0]
  val Double = TwoFaceAny.Double

  type String[T0] = TwoFaceAny.String[T0]
  val String = TwoFaceAny.String

  type Boolean[T0] = TwoFaceAny.Boolean[T0]
  val Boolean = TwoFaceAny.Boolean
}


text:
package org.kaaproject.kaa.client.channel;

import java.util.List;

import org.kaaproject.kaa.client.notification.NotificationProcessor;
import org.kaaproject.kaa.common.endpoint.gen.NotificationSyncRequest;
import org.kaaproject.kaa.common.endpoint.gen.NotificationSyncResponse;
import org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand;

/**
 * {@link KaaTransport} for the Notification service.
 * Updates the Notification manager state.
 *
 * @author Yaroslav Zeygerman
 *
 */
public interface NotificationTransport extends KaaTransport {

    /**
     * Creates a new Notification request.
     *
     * @return new Notification request.
     * @see NotificationSyncRequest
     *
     */
    NotificationSyncRequest createNotificationRequest();

    /**
     * Creates a new empty Notification request.
     *
     * @return new empty Notification request.
     * @see NotificationSyncRequest
     *
     */
    NotificationSyncRequest createEmptyNotificationRequest();

    /**
     * Updates the state of the Notification manager according to the given response.
     *
     * @param response the response from the server.
     * @see NotificationSyncResponse
     *
     */
    void onNotificationResponse(NotificationSyncResponse response) throws Exception;

    /**
     * Sets the given Notification processor.
     *
     * @param processor the Notification processor which to be set.
     * @see NotificationProcessor
     *
     */
    void setNotificationProcessor(NotificationProcessor processor);

    /**
     *
Notify about new subscription info.

     *
     *
Will be called when one either subscribes or unsubscribes
     * on\from some optional topic(s).

     *
     * @param commands Info about subscription actions (subscribe/unsubscribe).
     */
    void onSubscriptionChanged(List<SubscriptionCommand> commands);

}


text:
namespace proto_builder {

const std::string& DefaultHeaderTemplate();
const std::string& DefaultInterfaceTemplate();
const std::string& DefaultSourceTemplate();

}  // namespace proto_builder

#endif  // PROTO_BUILDER_PROTO_BUILDER_DATA_H_


text:
package org.apache.druid.cli.convert;

import com.google.common.collect.ImmutableMap;

import java.util.Map;
import java.util.Properties;

/**
 */
public class ChatHandlerConverter implements PropertyConverter
{

  private static final String PROPERTY = "druid.indexer.chathandler.publishDiscovery";

  @Override
  public boolean canHandle(String property)
  {
    return PROPERTY.equals(property);
  }

  @Override
  public Map<String, String> convert(Properties properties)
  {
    if (Boolean.parseBoolean(properties.getProperty(PROPERTY))) {
      return ImmutableMap.of("druid.indexer.task.chathandler.type", "curator");
    }
    return ImmutableMap.of();
  }
}


text:
/** \file     TComRom.h
    \brief    global variables & functions (header)
*/

#ifndef __TCOMROM__
#define __TCOMROM__

#include "CommonDef.h"

#include<stdio.h>
#include<iostream>

//! \ingroup TLibCommon
//! \{

// ====================================================================================================================
// Macros
// ====================================================================================================================

#define     MAX_CU_DEPTH            7                           // log2(LCUSize)
#define     MAX_CU_SIZE             (1<<(MAX_CU_DEPTH))         // maximum allowable size of CU
#define     MIN_PU_SIZE             4
#define     MAX_NUM_SPU_W           (MAX_CU_SIZE/MIN_PU_SIZE)   // maximum number of SPU in horizontal line

// ====================================================================================================================
// Initialize / destroy functions
// ====================================================================================================================

Void         initROM();
Void         destroyROM();
Void         initFrameScanXY( UInt* pBuff, UInt* pBuffX, UInt* pBuffY, Int iWidth, Int iHeight );
Void         initSigLastScan(UInt* pBuffZ, UInt* pBuffH, UInt* pBuffV, UInt* pBuffD, Int iWidth, Int iHeight, Int iDepth);
Void         initNonSquareSigLastScan(UInt* pBuffZ, UInt uiWidth, UInt uiHeight);
// ====================================================================================================================
// Data structure related table & variable
// ====================================================================================================================

// flexible conversion from relative to absolute index
extern       UInt   g_auiZscanToRaster[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
extern       UInt   g_auiRasterToZscan[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
extern       UInt   g_motionRefer[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];

Void         initZscanToRaster ( Int iMaxDepth, Int iDepth, UInt uiStartVal, UInt*& rpuiCurrIdx );
Void         initRasterToZscan ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth         );

Void          initMotionReferIdx ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );

// conversion of partition index to picture pel position
extern       UInt   g_auiRasterToPelX[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];
extern       UInt   g_auiRasterToPelY[ MAX_NUM_SPU_W*MAX_NUM_SPU_W ];

Void         initRasterToPelXY ( UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxDepth );

// global variable (LCU width/height, max. CU depth)
extern       UInt g_uiMaxCUWidth;
extern       UInt g_uiMaxCUHeight;
extern       UInt g_uiMaxCUDepth;
extern       UInt g_uiAddCUDepth;

extern       UInt g_auiPUOffset[8];

#define QUANT_IQUANT_SHIFT    20 // Q(QP%6) * IQ(QP%6) = 2^20
#define QUANT_SHIFT           14 // Q(4) = 2^14
#define SCALE_BITS            15 // Inherited from TMuC, pressumably for fractional bit estimates in RDOQ
#define MAX_TR_DYNAMIC_RANGE  15 // Maximum transform dynamic range (excluding sign bit)

#define SHIFT_INV_1ST          7 // Shift after first inverse transform stage
#define SHIFT_INV_2ND         12 // Shift after second inverse transform stage

extern Int g_quantScales[6];             // Q(QP%6)
extern Int g_invQuantScales[6];          // IQ(QP%6)
extern const short g_aiT4[4][4];
extern const short g_aiT8[8][8];
extern const short g_aiT16[16][16];
extern const short g_aiT32[32][32];

// ====================================================================================================================
// Luma QP to Chroma QP mapping
// ====================================================================================================================

extern const UChar  g_aucChromaScale      [52];

// ====================================================================================================================
// Scanning order & context mapping table
// ====================================================================================================================

extern       UInt*  g_auiFrameScanXY[ MAX_CU_DEPTH  ];    // raster index     from scanning index
extern       UInt*  g_auiFrameScanX [ MAX_CU_DEPTH  ];    // raster index (x) from scanning index
extern       UInt*  g_auiFrameScanY [ MAX_CU_DEPTH  ];    // raster index (y) from scanning index
extern       UInt*  g_auiSigLastScan[4][ MAX_CU_DEPTH ];  // raster index from scanning index (zigzag, hor, ver, diag)
extern UInt *g_sigScanNSQT[ 4 ]; // scan for non-square partitions
extern UInt g_sigCGScanNSQT[ 4 ][ 16 ]; // coarse-grain scan for non-square partitions

extern       UInt*  g_auiNonSquareSigLastScan[ 4 ];      // raster index from scanning index (zigzag)

extern const UInt   g_uiGroupIdx[ 32 ];
extern const UInt   g_uiMinInGroup[ 10 ];
extern const UInt   g_uiLastCtx[ 28 ];

extern const UInt   g_auiGoRiceRange[4];                  //!< maximum value coded with Rice codes
extern const UInt   g_auiGoRicePrefixLen[4];              //!< prefix length for each maximum value
extern const UInt   g_aauiGoRiceUpdate[4][16];            //!< parameter update rules for Rice codes

// ====================================================================================================================
// ADI table
// ====================================================================================================================

extern const UChar  g_aucIntraModeNumFast[7];

// ====================================================================================================================
// Angular Intra table
// ====================================================================================================================

extern const UChar g_aucIntraModeNumAng[7];
extern const UChar g_aucIntraModeBitsAng[7];
extern const UChar g_aucAngIntraModeOrder[NUM_INTRA_MODE];

// ====================================================================================================================
// Bit-depth
// ====================================================================================================================

extern       UInt g_uiBitDepth;
extern       UInt g_uiBitIncrement;
extern       UInt g_uiIBDI_MAX;
extern       UInt g_uiBASE_MAX;
extern       UInt g_uiPCMBitDepthLuma;
extern       UInt g_uiPCMBitDepthChroma;

// ====================================================================================================================
// Texture type to integer mapping
// ====================================================================================================================

extern const UChar g_aucConvertTxtTypeToIdx[4];

// ==========================================
// Mode-Dependent DST Matrices
extern const short g_as_DST_MAT_4 [4][4];
extern const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE];
extern const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE];
// ==========================================

// ====================================================================================================================
// Misc.
// ====================================================================================================================

extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2

#define ENC_DEC_TRACE 0

#if ENC_DEC_TRACE
extern FILE*  g_hTrace;
extern Bool   g_bJustDoIt;
extern const Bool g_bEncDecTraceEnable;
extern const Bool g_bEncDecTraceDisable;
extern UInt64 g_nSymbolCounter;

#define COUNTER_START    1
#define COUNTER_END      0 //( UInt64(1) << 63 )

#define DTRACE_CABAC_F(x)     if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "%f", x );
#define DTRACE_CABAC_V(x)     if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "%d", x );
#define DTRACE_CABAC_VL(x)    if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "%lld", x );
#define DTRACE_CABAC_T(x)     if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "%s", x );
#define DTRACE_CABAC_X(x)     if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "%x", x );
#define DTRACE_CABAC_R( x,y ) if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, x,    y );
#define DTRACE_CABAC_N        if ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) fprintf( g_hTrace, "\n"    );

#else

#define DTRACE_CABAC_F(x)
#define DTRACE_CABAC_V(x)
#define DTRACE_CABAC_VL(x)
#define DTRACE_CABAC_T(x)
#define DTRACE_CABAC_X(x)
#define DTRACE_CABAC_R( x,y )
#define DTRACE_CABAC_N

#endif

#define SCALING_LIST_NUM 6                         ///< list number for quantization matrix
#define SCALING_LIST_NUM_32x32 2                   ///< list number for quantization matrix 32x32
#define SCALING_LIST_REM_NUM 6
enum ScalingListDIR
{
  SCALING_LIST_SQT = 0,
  SCALING_LIST_VER,
  SCALING_LIST_HOR,
  SCALING_LIST_DIR_NUM
};
enum ScalingListSize
{
  SCALING_LIST_4x4 = 0,
  SCALING_LIST_8x8,
  SCALING_LIST_16x16,
  SCALING_LIST_32x32,
  SCALING_LIST_SIZE_NUM
};
enum ScalingListPredMode
{
  SCALING_LIST_PRED_COPY = 0,
  SCALING_LIST_PRED_DPCM,
  SCALING_LIST_PRED_NUM
};
static const char MatrixType[4][6][20] =
{
  {
  "INTRA4X4_LUMA",
  "INTRA4X4_CHROMAU",
  "INTRA4X4_CHROMAV",
  "INTER4X4_LUMA",
  "INTER4X4_CHROMAU",
  "INTER4X4_CHROMAV"
  },
  {
  "INTRA8X8_LUMA",
  "INTRA8X8_CHROMAU",
  "INTRA8X8_CHROMAV",
  "INTER8X8_LUMA",
  "INTER8X8_CHROMAU",
  "INTER8X8_CHROMAV"
  },
  {
  "INTRA16X16_LUMA",
  "INTRA16X16_CHROMAU",
  "INTRA16X16_CHROMAV",
  "INTER16X16_LUMA",
  "INTER16X16_CHROMAU",
  "INTER16X16_CHROMAV"
  },
  {
  "INTRA32X32_LUMA",
  "INTER32X32_LUMA",
  },
};
#define SCALING_LIST_START_VALUE 8                      ///< start value for dpcm mode
extern Int g_quantIntraDefault4x4[16];
extern Int g_quantIntraDefault8x8[64];
extern Int g_quantIntraDefault16x16[256];
extern Int g_quantIntraDefault32x32[1024];
extern Int g_quantInterDefault4x4[16];
extern Int g_quantInterDefault8x8[64];
extern Int g_quantInterDefault16x16[256];
extern Int g_quantInterDefault32x32[1024];
extern UInt g_scalingListSize [SCALING_LIST_SIZE_NUM];
extern UInt g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
extern UInt g_auiScalingListNum  [SCALING_LIST_SIZE_NUM];
extern Int  g_eTTable[4];
//! \}

#endif  //__TCOMROM__


text:
$(function() {
	$('.page-scroll').click(function() {
		if(location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
			if(target.length) {
				$('html,body').animate({
					scrollTop: (target.offset().top - 40) // adjust this according to your content
				}, 1000);
				return false;
			}
		}
	});
});


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Replication Benefits</title>
    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Getting Started with Replicated Berkeley DB Applications" />
    <link rel="up" href="introduction.html" title="Chapter 1. Introduction" />
    <link rel="prev" href="introduction.html" title="Chapter 1. Introduction" />
    <link rel="next" href="apioverview.html" title="The Replication APIs" />

Library Version 11.2.5.3

          Replication Benefits

          Prev
          Chapter 1. Introduction
           Next

Replication Benefits

            Replication offers your application a number of benefits that
            can be a tremendous help. Primarily replication's benefits
            revolve around performance, but there is also a benefit in
            terms of data durability guarantees.

            Briefly, the reasons why you might choose to implement
            replication in your DB application are:

                    Improve application reliability.

                    By spreading your data across multiple
                    machines, you can ensure that your
                    application's data continues to be
                    available even in the event of a
                    hardware failure on any given machine in
                    the replication group.

                    Improve read performance.

                    By using replication you can spread data reads across
                    multiple machines on your network. Doing so allows you
                    to vastly improve your application's read performance.
                    This strategy might be particularly interesting for
                    applications that have readers on remote network nodes;
                    you can push your data to the network's edges thereby
                    improving application data read responsiveness.

                    Additionally, depending on the portion of your data
                    that you read on a given replica, that replica may need
                    to cache part of your data, decreasing cache misses and
                    reducing I/O on the replica.

                   Improve transactional commit performance

                   In order to commit a transaction and achieve a
                   transactional durability guarantee, the commit must be
                   made durable. That is, the commit
                   must be written to disk (usually, but not always,
                   synchronously) before the application's thread of
                   control can continue operations.

                    Replication allows you to avoid this disk I/O and still
                    maintain a degree of durability by committing
                    to the network. In other words, you relax
                    your transactional durability guarantees on the master,
                    but by virtue of replicating the data across the
                    network you gain some additional durability guarantees
                    above what is provided locally.

                    Usually this strategy is implemented using some form of
                    an asynchronous transactional commit on the master.  In
                    this way your data writes will eventually be written to
                    disk, but your application will not have to wait for
                    the disk I/O to complete before continuing with its
                    next operation.

                    Note that it is possible to cause DB's replication
                    implementation to wait to hear from one or
                    more replicas as to whether they have successfully
                    saved the write before continuing. However, in this
                    case you might be trading performance for a even
                    higher durability guarantee (see below).

                   Improve data durability guarantee.

                    In a traditional transactional application, you commit your
                    transactions such that data modifications are saved to
                    disk. Beyond this, the durability of your data is
                    dependent upon the backup strategy that you choose to
                    implement for your site.

                    Replication allows you to increase this durability
                    guarantee by ensuring that data modifications are
                    written to multiple machines. This means that multiple
                    disks, disk controllers, power supplies, and CPUs are
                    used to ensure that your data modification makes it to
                    stable storage. In other words, replication allows you
                    to minimize the problem of a single point of failure
                    by using more hardware to guarantee your data writes.

                    If you are using replication for this reason, then you
                    probably will want to configure your application such
                    that it waits to hear about a successful commit from
                    one or more replicas before continuing with the next
                    operation. This will obviously impact your
                    application's write performance to some degree
                    — with the performance penalty being largely dependent
                    upon the speed and stability of the network connecting
                    your replication group.

                        For more information, see Permanent Message Handling.

          Prev

            Up

           Next

          Chapter 1. Introduction

            Home

           The Replication APIs


text:
/*** Directives and services for responding to idle users in AngularJS
* @author Mike Grabski <me@mikegrabski.com>
* @version v0.3.1
* @link https://github.com/HackedByChinese/ng-idle.git
* @license MIT
*/
(function (window, angular, undefined) {
    'use strict';

    // $keepalive service and provider
    function $KeepaliveProvider() {
    	var options = {
    		http: null,
    		interval: 10*60
    	};

    	this.http = function (value) {
            if (!value) throw new Error('Argument must be a string containing a URL, or an object containing the HTTP request configuration.');
    		if (angular.isString(value)) {
    			value = {url: value, method: 'GET'};
    		}

    		value['cache'] = false;

    		options.http = value;
    	}

    	this.interval = function (seconds) {
    		seconds = parseInt(seconds);

    		if (isNaN(seconds) || seconds <= 0) throw new Error('Interval must be expressed in seconds and be greater than 0.');
    		options.interval = seconds;
    	}

    	this.$get = function ($rootScope, $log, $timeout, $http) {

    		var state = {ping: null};

    		function handleResponse(data, status, onetimeonly) {
    			$rootScope.$broadcast('$keepaliveResponse', data, status);

    			if (!onetimeonly) schedulePing();
    		}

    		function schedulePing() {
    			state.ping = $timeout(ping, options.interval * 1000);
    		}

    		function ping(onetimeonly) {
    			$rootScope.$broadcast('$keepalive');

    			if (angular.isObject(options.http)) {
    			 	$http(options.http)
    			 		.success(function(data, status) {
    			 			handleResponse(data, status, onetimeonly);
    			 		})
    			 		.error(function(data, status) {
    			 			handleResponse(data, status, onetimeonly);
    			 		});
    			} else if (!onetimeonly) schedulePing();
    		};

    		return {
    			_options: function() {
    				return options;
    			},
    			start: function() {
    				$timeout.cancel(state.ping);

    				schedulePing();
    			},
    			stop: function() {
    				$timeout.cancel(state.ping);
    			},
    			ping: function() {
    				ping(true);
    			}
    		};
    	};
        this.$get.$inject = ['$rootScope', '$log', '$timeout', '$http'];
    }

    angular.module('ngIdle.keepalive', [])
        .provider('$keepalive', $KeepaliveProvider);

    // $idle service and provider
    function $IdleProvider() {

        var options = {
            idleDuration: 20 * 60, // in seconds (default is 20min)
            warningDuration: 30, // in seconds (default is 30sec)
            autoResume: true, // lets events automatically resume (unsets idle state/resets warning)
            events: 'mousemove keydown DOMMouseScroll mousewheel mousedown touchstart',
            keepalive: true
        };

        this.activeOn = function (events) {
            options.events = events;
        };

        this.idleDuration = function (seconds) {
        	if (seconds <= 0) throw new Error("idleDuration must be a value in seconds, greater than 0.");

        	options.idleDuration = seconds;
        };

        this.warningDuration = function (seconds) {
        	if (seconds < 0) throw new Error("warning must be a value in seconds, greatner than 0.");

        	options.warningDuration = seconds;
        };

        this.autoResume = function (value) {
        	options.autoResume = value === true;
        };

        this.keepalive = function (enabled) {
        	options.keepalive = enabled === true;
        };

        this.$get = function ($timeout, $log, $rootScope, $document, $keepalive) {
        	var state = {idle: null, warning: null, idling: false, running: false, countdown: null};

        	function startKeepalive() {
        		if (!options.keepalive) return;

        		if (state.running) $keepalive.ping();

        		$keepalive.start();
        	}

        	function stopKeepalive() {
        		if (!options.keepalive) return;

        		$keepalive.stop();
        	}

        	function toggleState() {
        		state.idling = !state.idling;
        		var name = state.idling ? 'Start' : 'End';

        		$rootScope.$broadcast('$idle' + name);

        		if (state.idling) {
        			stopKeepalive();
        			state.countdown = options.warningDuration;
        			countdown();
        		} else {
        			startKeepalive();
        		}
        	}

        	function countdown() {
        		if (state.countdown <= 0) {
        			$rootScope.$broadcast('$idleTimeout');
        		} else {
        			$rootScope.$broadcast('$idleWarn', state.countdown);

        			state.warning = $timeout(countdown, 1000);
        		}

        		state.countdown--;
        	}

            var svc = {
                _options: function() {
                    return options;
                },
                running: function() {
                	return state.running;
                },
                idling: function() {
                	return state.idling;
                },
                watch: function() {
                	$timeout.cancel(state.idle);
                	$timeout.cancel(state.warning);

					if (state.idling) toggleState();
					else if (!state.running) startKeepalive();

                	state.running = true;

                	state.idle = $timeout(toggleState, options.idleDuration * 1000);
                },
                unwatch: function() {
                	$timeout.cancel(state.idle);
                	$timeout.cancel(state.warning);

                	state.idling = false;
                	state.running = false;
                }
            };

            var interrupt = function () {
            	if (state.running && options.autoResume) svc.watch();
            };

            $document.find('body').on(options.events, interrupt);

            return svc;
        };
        this.$get.$inject = ['$timeout', '$log', '$rootScope', '$document', '$keepalive'];
    };

    angular.module('ngIdle.idle', [])
        .provider('$idle', $IdleProvider);

    angular.module('ngIdle.ngIdleCountdown', [])
        .directive('ngIdleCountdown', function() {
            return {
                restrict: 'A',
                scope: {
                    value: '=ngIdleCountdown'
                },
                link: function($scope) {
                    $scope.$on('$idleWarn', function(e, countdown) {
                        $scope.$apply(function() {
                            $scope.value = countdown;
                        });
                    });

                    $scope.$on('$idleTimeout', function() {
                        $scope.$apply(function() {
                            $scope.value = 0;
                        });
                    });
                }
            };
        });

    angular.module('ngIdle', ['ngIdle.keepalive', 'ngIdle.idle', 'ngIdle.ngIdleCountdown']);

})(window, window.angular);


text:
This is the dart portion of a [benchmarking test suite](../) comparing a variety of web development platforms.

## Versions

* [Dart SDK version >=1.6.0](http://www.dartlang.org/)
* [Dart args version 0.12.0+2](http://pub.dartlang.org/packages/args)
* [Dart crypto version 0.9.0](http://pub.dartlang.org/packages/crypto)
* [Dart mustache version 0.1.8](http://pub.dartlang.org/packages/mustache)
* [Dart postgresql version 0.2.14](http://pub.dartlang.org/packages/postgresql)
* [Dart yaml version 2.0.1+1](http://pub.dartlang.org/packages/yaml)

## Test URLs

### JSON Encoding Test

http://localhost:8080/

### Data-Store/Database Mapping Test

http://localhost:8080/db

### Variable Query Test

http://localhost:8080/db?queries=2

### Fortunes Test

http://localhost:8080/fortunes

### Data-Store/Database Update Test

http://localhost:8080/update

### Variable Update Test

http://localhost:8080/update?queries=2

### Plaintext Test

http://localhost:8080/plaintext


text:
package com.apexxs.neonblack.detection;

import com.apexxs.neonblack.dao.DetectedLocation;

import java.util.List;

public interface NERDetector
{
    public List<DetectedLocation> extractLocationNames(String text);
}


text:
<!DOCTYPE html>

<title>CSP sandbox test</title>

This is a sandboxed document:
Content-Security-Policy: sandbox allow-popups allow-pointer-lock allow-scripts


text:
require 'facter'
require 'puppet/util/warnings'
require 'forwardable'
require 'etc'

module Puppet::Util::SUIDManager
  include Puppet::Util::Warnings
  extend Forwardable

  # Note groups= is handled specially due to a bug in OS X 10.6, 10.7,
  # and probably upcoming releases...
  to_delegate_to_process = [ :euid=, :euid, :egid=, :egid, :uid=, :uid, :gid=, :gid, :groups ]

  to_delegate_to_process.each do |method|
    def_delegator Process, method
    module_function method
  end

  def osx_maj_ver
    return @osx_maj_ver unless @osx_maj_ver.nil?
    # 'kernel' is available without explicitly loading all facts
    if Facter.value('kernel') != 'Darwin'
      @osx_maj_ver = false
      return @osx_maj_ver
    end
    # But 'macosx_productversion_major' requires it.
    Facter.loadfacts
    @osx_maj_ver = Facter.value('macosx_productversion_major')
  end
  module_function :osx_maj_ver

  def groups=(grouplist)
    begin
      return Process.groups = grouplist
    rescue Errno::EINVAL => e
      #We catch Errno::EINVAL as some operating systems (OS X in particular) can
      # cause troubles when using Process#groups= to change *this* user / process
      # list of supplementary groups membership.  This is done via Ruby's function
      # "static VALUE proc_setgroups(VALUE obj, VALUE ary)" which is effectively
      # a wrapper for "int setgroups(size_t size, const gid_t *list)" (part of SVr4
      # and 4.3BSD but not in POSIX.1-2001) that fails and sets errno to EINVAL.
      #
      # This does not appear to be a problem with Ruby but rather an issue on the
      # operating system side.  Therefore we catch the exception and look whether
      # we run under OS X or not -- if so, then we acknowledge the problem and
      # re-throw the exception otherwise.
      if osx_maj_ver and not osx_maj_ver.empty?
        return true
      else
        raise e
      end
    end
  end
  module_function :groups=

  def self.root?
    return Process.uid == 0 unless Puppet.features.microsoft_windows?

    require 'puppet/util/windows/user'
    Puppet::Util::Windows::User.admin?
  end

  # Methods to handle changing uid/gid of the running process. In general,
  # these will noop or fail on Windows, and require root to change to anything
  # but the current uid/gid (which is a noop).

  # Runs block setting euid and egid if provided then restoring original ids.
  # If running on Windows or without root, the block will be run with the
  # current euid/egid.
  def asuser(new_uid=nil, new_gid=nil)
    return yield if Puppet.features.microsoft_windows?
    return yield unless root?
    return yield unless new_uid or new_gid

    old_euid, old_egid = self.euid, self.egid
    begin
      change_privileges(new_uid, new_gid, false)

      yield
    ensure
      change_privileges(new_uid ? old_euid : nil, old_egid, false)
    end
  end
  module_function :asuser

  # If `permanently` is set, will permanently change the uid/gid of the
  # process. If not, it will only set the euid/egid. If only uid is supplied,
  # the primary group of the supplied gid will be used. If only gid is
  # supplied, only gid will be changed. This method will fail if used on
  # Windows.
  def change_privileges(uid=nil, gid=nil, permanently=false)
    return unless uid or gid

    unless gid
      uid = convert_xid(:uid, uid)
      gid = Etc.getpwuid(uid).gid
    end

    change_group(gid, permanently)
    change_user(uid, permanently) if uid
  end
  module_function :change_privileges

  # Changes the egid of the process if `permanently` is not set, otherwise
  # changes gid. This method will fail if used on Windows, or attempting to
  # change to a different gid without root.
  def change_group(group, permanently=false)
    gid = convert_xid(:gid, group)
    raise Puppet::Error, "No such group #{group}" unless gid

    if permanently
      Process::GID.change_privilege(gid)
    else
      Process.egid = gid
    end
  end
  module_function :change_group

  # As change_group, but operates on uids. If changing user permanently,
  # supplementary groups will be set the to default groups for the new uid.
  def change_user(user, permanently=false)
    uid = convert_xid(:uid, user)
    raise Puppet::Error, "No such user #{user}" unless uid

    if permanently
      # If changing uid, we must be root. So initgroups first here.
      initgroups(uid)

      Process::UID.change_privilege(uid)
    else
      # We must be root to initgroups, so initgroups before dropping euid if
      # we're root, otherwise elevate euid before initgroups.
      # change euid (to root) first.
      if Process.euid == 0
        initgroups(uid)
        Process.euid = uid
      else
        Process.euid = uid
        initgroups(uid)
      end
    end
  end
  module_function :change_user

  # Make sure the passed argument is a number.
  def convert_xid(type, id)
    map = {:gid => :group, :uid => :user}
    raise ArgumentError, "Invalid id type #{type}" unless map.include?(type)
    ret = Puppet::Util.send(type, id)
    if ret == nil
      raise Puppet::Error, "Invalid #{map[type]}: #{id}"
    end
    ret
  end
  module_function :convert_xid

  # Initialize primary and supplemental groups to those of the target user.  We
  # take the UID and manually look up their details in the system database,
  # including username and primary group. This method will fail on Windows, or
  # if used without root to initgroups of another user.
  def initgroups(uid)
    pwent = Etc.getpwuid(uid)
    Process.initgroups(pwent.name, pwent.gid)
  end

  module_function :initgroups

  def run_and_capture(command, new_uid=nil, new_gid=nil)
    output = Puppet::Util.execute(command, :failonfail => false, :combine => true, :uid => new_uid, :gid => new_gid)
    [output, $CHILD_STATUS.dup]
  end
  module_function :run_and_capture
end


text:
package cn.tee3.n2m.ui.util;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
import cn.tee3.n2m.R;

public class FragmentUtil {

	public static void moveToRightFragment(ActionBarActivity activity, int containerViewId, Fragment fragment){
		FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
		transaction.setCustomAnimations(R.anim.translate_in_to_left, R.anim.translate_out_to_left);
		transaction.addToBackStack(null);
		transaction.replace(containerViewId, fragment);
		transaction.commit();
	}

	public static void moveToLeftFragment(ActionBarActivity activity,int containerViewId, Fragment fragment){
		FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
		transaction.setCustomAnimations(R.anim.translate_in_to_right, R.anim.translate_out_to_right);
		transaction.addToBackStack(null);
		transaction.replace(containerViewId, fragment);
		transaction.commit();
	}
}


text:
FactoryGirl.define do
  factory :contact do
    name { Faker::Name.name }
    email { Faker::Internet.email }
    message {"this is contact message"}
  end
end


text:
<?php

namespace Fabiang\ComposerLockMerge\Console\Exception;

use Fabiang\ComposerLockMerge\Exception\DomainException as BaseDomainException;

class DomainException extends BaseDomainException implements ExceptionInterface
{

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="node_modules/primer-css/build/build.css">
 <link rel="stylesheet" href="node_modules/octicons/build/font/octicons.css">
    <title>Interorbital Systems</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/custom.css" rel="stylesheet">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                    Toggle navigation

                </button>

		IOS

                        Home

                        Who We Are

			Launch Manifest

                        Press

		 <object
   type="image/svg+xml"
   height="240"
   width="290"
position=relative
top = 0px
align="left"
align="top"
   data="logo.svg">
</object>

Address: P.O. Box 662 Mojave, Ca 93502-0662 USA

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                    Toggle navigation

                </button>

                        Subscribe

                        Twitter

                        Facebook

                        FAQs


text:
class ParentForItemValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    record.errors.add(attribute, I18n.t('item.validation.parent_id')) if value <= 0
  end
end


text:
CREATE TABLE results (
  id VARCHAR ( 24 ) NOT NULL,
  datetime TIMESTAMP NOT NULL,
  url VARCHAR ( 255 ) NOT NULL,
  matches VARCHAR ( 255 ) NOT NULL,
  PRIMARY KEY(id, url)
);

# --- !Downs

DROP TABLE results;


text:
import fs from 'fs'
import path from 'path'
import express from 'express'
import logger from 'morgan'
import methodOverride from 'method-override'
import session from 'express-session'
import bodyParser from 'body-parser'
import cookieParser from 'cookie-parser'
import responseTime from 'response-time'
import compression from 'compression'
import errorHandler from 'errorhandler'
import route from './route'
import frontMiddleware from './front-middleware'
import { ENV, ROOT } from './config'

const app = express()
export default app

app.set('etag', false)
app.enable('trust proxy')

logger.token('date', () => new Date().toString())

// logger
if (ENV === 'production') {
	const logPath = path.join(ROOT, 'access.log')
	const accessLogStream = fs.createWriteStream(logPath, { flags: 'a' })
	app.use(logger('combined', { stream: accessLogStream }))
} else {
	app.use(logger('dev'))
}

// http method override by X-HTTP-Method-Override
app.use(methodOverride())

// session save
app.use(session({
	resave: true,
	saveUninitialized: false,
	secret: 'ustccjw',
}))

// body,cookie parse
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(cookieParser())

// add X-Response-Time
app.use(responseTime())

// compress
app.use(compression())

// error handle last
if (ENV === 'development') {
	app.use(errorHandler())
}

// frontend webpack watch
if (ENV === 'development') {
	frontMiddleware(app)
}

// route
route(app)


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.confluent.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for ProvisionState. */
public final class ProvisionState extends ExpandableStringEnum<ProvisionState> {
    /** Static value Accepted for ProvisionState. */
    public static final ProvisionState ACCEPTED = fromString("Accepted");

    /** Static value Creating for ProvisionState. */
    public static final ProvisionState CREATING = fromString("Creating");

    /** Static value Updating for ProvisionState. */
    public static final ProvisionState UPDATING = fromString("Updating");

    /** Static value Deleting for ProvisionState. */
    public static final ProvisionState DELETING = fromString("Deleting");

    /** Static value Succeeded for ProvisionState. */
    public static final ProvisionState SUCCEEDED = fromString("Succeeded");

    /** Static value Failed for ProvisionState. */
    public static final ProvisionState FAILED = fromString("Failed");

    /** Static value Canceled for ProvisionState. */
    public static final ProvisionState CANCELED = fromString("Canceled");

    /** Static value Deleted for ProvisionState. */
    public static final ProvisionState DELETED = fromString("Deleted");

    /** Static value NotSpecified for ProvisionState. */
    public static final ProvisionState NOT_SPECIFIED = fromString("NotSpecified");

    /**
     * Creates or finds a ProvisionState from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding ProvisionState.
     */
    @JsonCreator
    public static ProvisionState fromString(String name) {
        return fromString(name, ProvisionState.class);
    }

    /** @return known ProvisionState values. */
    public static Collection<ProvisionState> values() {
        return values(ProvisionState.class);
    }
}


text:
package jp.tricreo.schemagenerator.infrastructure.utils;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import jp.tricreo.schemagenerator.domain.model.Entity;
import jp.tricreo.schemagenerator.exception.CloneNotSupportedRuntimeException;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

import org.junit.Test;

/**
 * {@link CloneUtil}のためのテスト。
 *
 * @version $Id$
 * @author daisuke
 * @author j5ik2o
 */
public class CloneUtilTest {

	public static class SampleMainEntity implements
			Entity<SampleMainEntity, UUID> {

		private UUID identity;

		public SampleMainEntity(UUID id) {
			identity = id;
		}

		@Override
		public SampleMainEntity clone() {
			try {
				return (SampleMainEntity) super.clone();
			} catch (CloneNotSupportedException e) {
				throw new CloneNotSupportedRuntimeException(e);
			}
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj) {
				return true;
			}
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			SampleMainEntity other = (SampleMainEntity) obj;
			return sameIdentityAs(other);
		}

		@Override
		public UUID getIdentity() {
			return identity;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result =
					prime * result
							+ ((identity == null) ? 0 : identity.hashCode());
			return result;
		}

		@Override
		public boolean sameIdentityAs(SampleMainEntity other) {
			return other != null && identity.equals(other.identity);
		}

	}

	static final SampleMainEntity E1 = new SampleMainEntity(UUID.randomUUID());

	static final SampleMainEntity E2 = new SampleMainEntity(UUID.randomUUID());

	static final SampleMainEntity E3 = new SampleMainEntity(UUID.randomUUID());

	static final List<String> STR_LIST = Lists.newArrayList("a", "b", "c");

	static final Set<String> STR_SET = Sets.newHashSet("a", "b", "c");

	static final Map<String, String> STR_MAP = Maps.uniqueIndex(STR_LIST,
			new Function<String, String>() {

				public String apply(String from) {
					return from.toUpperCase();
				}
			});

	static final List<SampleMainEntity> ENT_LIST = Lists
		.newArrayList(new SampleMainEntity[] {
			E1,
			E2,
			E3
		});

	static final Set<SampleMainEntity> ENT_SET = Sets
		.newHashSet(new SampleMainEntity[] {
			E1,
			E2,
			E3
		});

	static final Map<UUID, SampleMainEntity> ENT_MAP = Maps.uniqueIndex(
			ENT_LIST, new Function<SampleMainEntity, UUID>() {

				public UUID apply(SampleMainEntity from) {
					return from.getIdentity();
				}
			});

	/**
	 * {@link CloneUtil#cloneEntityArrayList(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneEntityArrayList() throws Exception {
		List<SampleMainEntity> list = CloneUtil.cloneEntityArrayList(ENT_LIST);
		assertThat(list, is(not(sameInstance(ENT_LIST))));
		assertThat(Iterables.elementsEqual(list, ENT_LIST), is(true));
		assertThat(list.get(0), is(equalTo(ENT_LIST.get(0))));
		assertThat(list.get(0), is(not(sameInstance(ENT_LIST.get(0)))));
	}

	/**
	 * {@link CloneUtil#cloneEntityHashMap(Map)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneEntityHashMap() throws Exception {
		Map<UUID, SampleMainEntity> map = CloneUtil.cloneEntityHashMap(ENT_MAP);
		assertThat(Maps.difference(map, ENT_MAP).areEqual(), is(true));
		assertThat(map, is(not(sameInstance(ENT_MAP))));

		UUID uuid = Iterables.get(map.keySet(), 0);
		assertThat(map.get(uuid), is(equalTo(ENT_MAP.get(uuid))));
		assertThat(map.get(uuid), is(not(sameInstance(ENT_MAP.get(uuid)))));
	}

	/**
	 * {@link CloneUtil#cloneEntityArrayList(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneEntityHashSet() throws Exception {
		Set<SampleMainEntity> set = CloneUtil.cloneEntityHashSet(ENT_SET);
		assertThat(set.containsAll(ENT_SET), is(true));
		assertThat(ENT_SET.containsAll(set), is(true));

		SampleMainEntity e0 = Iterables.get(ENT_SET, 0);
		for (SampleMainEntity e : set) {
			if (e.equals(e0)) {
				assertThat(e, is(not(sameInstance(e0))));
			}
		}
	}

	/**
	 * {@link CloneUtil#cloneValueHashSet(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneEntityLinkedHashSet() throws Exception {
		Set<SampleMainEntity> set = CloneUtil.cloneEntityLinkedHashSet(ENT_SET);
		assertThat(Iterables.elementsEqual(set, ENT_SET), is(true));

		Iterator<SampleMainEntity> itrOrg = ENT_SET.iterator();
		for (SampleMainEntity ce : set) {
			SampleMainEntity oe = itrOrg.next();
			assertThat(ce, is(equalTo(oe)));
			assertThat(ce, is(not(sameInstance(oe))));
		}
	}

	/**
	 * {@link CloneUtil#cloneEntityArrayList(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneValueArrayList() throws Exception {
		List<String> list = CloneUtil.cloneValueArrayList(STR_LIST);
		assertThat(list, is(not(sameInstance(STR_LIST))));
		assertThat(Iterables.elementsEqual(list, STR_LIST), is(true));
		assertThat(list.get(0), is(equalTo(STR_LIST.get(0))));
		assertThat(list.get(0), is(sameInstance(STR_LIST.get(0))));
	}

	/**
	 * {@link CloneUtil#cloneEntityHashMap(Map)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneValueHashMap() throws Exception {
		Map<String, String> map = CloneUtil.cloneValueHashMap(STR_MAP);
		assertThat(Maps.difference(map, STR_MAP).areEqual(), is(true));
		assertThat(map, is(not(sameInstance(STR_MAP))));

		String key = Iterables.get(map.keySet(), 0);
		assertThat(map.get(key), is(equalTo(STR_MAP.get(key))));
		assertThat(map.get(key), is(sameInstance(STR_MAP.get(key))));
	}

	/**
	 * {@link CloneUtil#cloneValueHashSet(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneValueHashSet() throws Exception {
		Set<String> set = CloneUtil.cloneValueHashSet(STR_SET);
		assertThat(Iterables.elementsEqual(set, STR_SET), is(true));

		Iterator<String> itr = STR_SET.iterator();
		String e0 = itr.next();
		String e1 = itr.next();
		String e2 = itr.next();

		for (String e : set) {
			if (e.equals(e0)) {
				assertThat(e, is(sameInstance(e0)));
			} else if (e.equals(e1)) {
				assertThat(e, is(sameInstance(e1)));
			} else if (e.equals(e2)) {
				assertThat(e, is(sameInstance(e2)));
			} else {
				fail();
			}
		}
	}

	/**
	 * {@link CloneUtil#cloneValueHashSet(java.util.Collection)}のテスト。
	 *
	 * @throws Exception 例外が発生した場合
	 */
	@Test
	public void test_cloneValueLinkedHashSet() throws Exception {
		Set<String> set = CloneUtil.cloneValueLinkedHashSet(STR_SET);
		assertThat(Iterables.elementsEqual(set, STR_SET), is(true));

		Iterator<String> itrOrg = STR_SET.iterator();
		for (String ce : set) {
			String oe = itrOrg.next();
			assertThat(ce, is(equalTo(oe)));
			assertThat(ce, is(sameInstance(oe)));
		}
	}
}


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ("djasana", "0019_adds_project_is_template"),
    ]

    operations = [
        migrations.AddField(
            model_name="project",
            name="default_view",
            field=models.CharField(
                blank=True,
                choices=[
                    ("board", "board"),
                    ("calendar", "calendar"),
                    ("list", "list"),
                    ("timeline", "timeline"),
                ],
                max_length=16,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="project",
            name="layout",
            field=models.CharField(
                choices=[
                    ("board", "board"),
                    ("calendar", "calendar"),
                    ("list", "list"),
                    ("timeline", "timeline"),
                ],
                max_length=16,
            ),
        ),
    ]