text:
import { GraphQLList } from 'graphql';

import TagType from '../types/TagType';
import Tag from '../models/Tag';
import knex from '../knex';

const tags = {
  type: new GraphQLList(TagType),

  resolve: (parent, args, { viewer, loaders }) =>
    knex('tags')
      .pluck('id')
      .then(tagIds => tagIds.map(tId => Tag.gen(viewer, tId, loaders))),
};

export default tags;

redpajama_set_name: RedPajamaGithub


text:
Welcome and thank you for your interest in contributing to the QuantConnect Lean open source project.  This document aims to describe the preferred workflow contributors should follow when contributing new source code to the project. This Git workflow is inspired greatly by the [irON-Parsers Contributors Guide](https://github.com/structureddynamics/irON-Parsers/wiki/Collaboration%3A-git-development-workflow).

# Contributing

## Who is a Collaborator?

A collaborator is someone with write access to the QuantConnect Lean repository. Collaborators merge pull requests from contributors.

## Who is a Contributor?

A contributor can be anyone! It could be you. Continue reading this section if you wish to get involved and contribute back to the QuantConnect Lean open source project!

## Code Style and Testing

Code reviewers will be expecting to see code that follows Microsoft's C# guidelines. There are a few resources available [here](https://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx) and [here](https://msdn.microsoft.com/en-us/library/ff926074.aspx).

All pull requests must be accompanied by units tests. If it is a new feature, the tests should highlight expected use cases as well as edge cases, if applicable. If it is a bugfix, there should be tests that expose the bug in question.

## Initial Setup

* Setup a [GitHub](https://github.com/) account
* [Fork](https://help.github.com/articles/fork-a-repo/) the [repository](https://github.com/QuantConnect/Lean) of the project
* Clone your fork locally

```bash
$ git clone https://github.com/username/Lean.git
```

* Navigate to the QuantConnect Lean directory and add the upstream remote

```bash
$ cd Lean
$ git remote add upstream https://github.com/QuantConnect/Lean.git
```

The remote upstream branch links your fork of Lean with our master copy, so when you perform a `git pull --rebase` you'll be getting updates from our repository.

## Keeping your master up-to-date!
Now that you've defined the `remote upstream branch`, you can refresh your local copy of master with the following commands:

```bash
$ git checkout master
$ git pull --rebase
```

This will checkout your local master branch and then merge changes in from the remote upstream branch. We use [rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase) to reduce noise from merge commits.

# Branching Model

If unfamiliar with git branches, please read this [short guide on branches](https://www.atlassian.com/git/tutorials/using-branches/).

The following names will be used to differentiate between the different repositories:

* **upstream** - The 'official' QuantConnect Lean [repository](https://github.com/QuantConnect/Lean.git) (what is on QuantConnect's GitHub account)
* **origin** - Your fork of the official repository on GitHub (what is on your GitHub account)
* **local** - This will be your local clone of **origin** (what is on your computer)

As a **contributor** you will push your completed **local** topic branch to **origin**. As a **contributor** you will pull your updates from **upstream**. As a **collaborator** (write-access) you will merge branches from **contributors** into **upstream**.

## Primary Branch

The upstream repository holds a single primary branch that we maintain:

* **upstream/master** - This is the where main development takes place

## Topic Branches

Topic branches are for contributors to develop bug fixes and new features so that they can be easily merged to **master**. They must follow a few simple rules for consistency:

* Must branch off from **master**
* Must be meged back into **master**
* Consider using the GitHub issue number in the branch name

Topic branches should exist in your **local** and **origin** repositories only. Submitting a pull request will request a merge from your topic branch to our **upstream/master** branch.

## Working on topic branches

First create a new branch for the work you'd like to perform:

```bash
$ git checkout -b issue-123/short-issue-description
Switched to a new branch 'issue-123/short-issue-description'
```

Now perform some work and commit changes. Always review your changes before committing

```bash
$ git status
$ git diff
$ git add --all
$ git commit
```

When committing, be sure to follow [best practices](https://github.com/erlang/otp/wiki/Writing-good-commit-messages) writing good commit descriptions.

After performing some work you'll want to merge in changes from the **upstream/master**. You can use the following two commands in order to assist upstream merging:

```bash
$ git fetch upstream
$ git rebase upstream/master issue-123/short-issue-description
```

The `git fetch upstream` command will download the **upstream** repository to your computer but not merge it. The `rebase upstream/master issue-123/short-issue-description` command will [rebase](https://www.atlassian.com/git/tutorials/rewriting-history/git-commit--amend) your changes on top of **upstream/master**. This will make the review process easier for **collaborators**.

> CAUTION Please note that once you have pushed your branch remotely you MUST NOT rebase!

If you need to merge changes in after pushing your branch to **origin**, use the following:

```bash
$ git pull upstream/master
```

When topic branches are finished and ready for review, they should be pushed back to **origin**.

```bash
$ git push origin issue-123/short-issue-description
To git@github.com:username/Lean.git
    * [new branch]       issue-123/short-issue-description -> issue-123/short-issue-description
```

Now you're ready to send a [pull request](https://help.github.com/articles/using-pull-requests/) from this branch to **upstream/master** and update the GitHub issue tracker to let a collaborator know that your branch is ready to be reviewed and merged.  If extra changes are required as part of the review process, make those changes on the topic branch and re-push. First re-checkout the topic branch you made your original changes on:

```bash
$ git checkout issue-123/short-issue-description
```

Now make responses to the review comments, commit, and re-push your changes:

```bash
$ git add --all
$ git commit
$ git push
```


text:
ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.acronym "JSON"
  inflect.acronym "IBAN"
end


text:
<?php
//
// Copyright (c) 2008-2016 Decibel Technology Limited.
//
namespace app\decibel\stream;

/**
 * Handles an exception occurring when reading from a stream.
 *
 * @author        Timothy de Paris
 */
class DStreamReadException extends DStreamException
{
    /**
     * Creates a new {@link DStreamReadException}.
     *
     * @param    DReadableStream $stream  The stream the error occurred in.
     * @param    string          $message Description of the error.
     *
     * @return    static
     */
    public function __construct(DReadableStream $stream, $message = '')
    {
        parent::__construct(array(
                                'stream'  => (string)$stream,
                                'message' => $message,
                            ));
    }
}


text:
package me.deftware.client.framework.math.position;

import me.deftware.client.framework.math.box.DoubleBoundingBox;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;

/**
 * @author Deftware
 */
public class ChunkBlockPosition extends BlockPosition {

	private final ChunkPos chunk;

	public ChunkBlockPosition(ChunkPos chunk) {
		super(null);
		this.chunk = chunk;
	}

	@Override
	public double getX() {
		return chunk.getStartPos().getX();
	}

	@Override
	public double getY() {
		return chunk.getStartPos().getY();
	}

	@Override
	public double getZ() {
		return chunk.getStartPos().getZ();
	}

	public double getStartX() {
		return chunk.getStartX();
	}

	public double getEndX() {
		return chunk.getEndX();
	}

	public double getStartZ() {
		return chunk.getStartZ();
	}

	public double getEndZ() {
		return chunk.getEndZ();
	}

	@Override
	public BlockPos getMinecraftBlockPos() {
		return chunk.getStartPos();
	}

	public BlockPosition getCenterBlockPos() {
		return DoubleBlockPosition.fromMinecraftBlockPos(getMinecraftBlockPos());
	}

	public DoubleBoundingBox getBoundingBox() {
		return new DoubleBoundingBox(getStartX(), 0, getStartZ(), getEndX(), 255, getEndZ());
	}

}


text:
Text plugin

      {{ token.id }}

      <token ng-class="{selected: state.isSelected(token.id)}"></token>


text:
using HomeWork.Services;
using HomeWork.ViewModels;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Newtonsoft.Json;
using Microsoft.Practices.Unity;
using System.Web;
using System.Web.Mvc;
using HomeWork.Model;
using System.Collections.Generic;
using System.Dynamic;

namespace HomeWork.Controllers
{

    public class HomeController : Controller
    {
        public HomeController()
        {
            //vm = new HomeWorkViewModel(
            //    new Dal.ApplicationDbContext(),
            //    UserManager.FindById(User.Identity.GetUserId())
            //);
        }

        public ActionResult Index()
        {
            if (Request.IsAuthenticated)
                return Redirect("/Home/UserHome");
            return View();
        }

        [Authorize()]
        public ActionResult UserHome()
        {
            IUnityContainer unityContainer = UnityConfig.GetConfiguredContainer();
            Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
            HomeWorkService service = new HomeWorkService(context);

            ViewBag.Semester = service.GetCurrentSemester(User.Identity.GetUserId());
            ViewBag.Assignments = service.GetAssignmentsForSemester(ViewBag.Semester);
            ViewBag.Courses = service.GetCoursesForSemester(ViewBag.Semester);
            return View();
        }

        public ContentResult Assignments()
        {

            // need to not use unity here, just testing
            var unityContainer = UnityConfig.GetConfiguredContainer();
            Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
            HomeWorkService service = new HomeWorkService(context);
            ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());

            IList<ICourse> courses = service.GetCoursesForSemester(semester);
            IList<IAssignment> assignments = service.GetAssignmentsForSemester(semester);

            dynamic data = new ExpandoObject();
            data.Semester = semester;
            data.Courses = courses;
            data.Assignments = assignments;

            string converted = JsonConvert.SerializeObject(
                data,
                Formatting.Indented,
                new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects });

            return Content(converted, "application/json");
        }

        public ContentResult CurrentCourses()
        {

            // need to not use unity here, just testing
            var unityContainer = UnityConfig.GetConfiguredContainer();
            Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
            HomeWorkService service = new HomeWorkService(context);
            ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());

            string converted = JsonConvert.SerializeObject(
                service.GetCoursesForSemester(semester),
                Formatting.Indented,
                new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects });

            return Content(converted, "application/json");
        }

        public ContentResult CurrentAssignments()
        {

            // need to not use unity here, just testing
            var unityContainer = UnityConfig.GetConfiguredContainer();
            Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
            HomeWorkService service = new HomeWorkService(context);
            ISemester semester = service.GetCurrentSemester(User.Identity.GetUserId());

            string converted = JsonConvert.SerializeObject(
                service.GetAssignmentsForSemester(semester),
                Formatting.Indented,
                new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects });

            return Content(converted, "application/json");
        }

        public ContentResult CurrentSemester()
        {

            // need to not use unity here, just testing
            var unityContainer = UnityConfig.GetConfiguredContainer();
            Data.IHomeWorkContext context = unityContainer.Resolve<Data.IHomeWorkContext>();
            HomeWorkService service = new HomeWorkService(context);

            //var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
            //json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
            Model.IUser user = new Model.User { Id = User.Identity.GetUserId(), Email = UserManager.FindById(User.Identity.GetUserId()).Email};

            HomeWorkViewModel vm = new HomeWorkViewModel(service, user);
            //JsonSerializerSettings settings = new JsonSerializerSettings
            //{
            //    PreserveReferencesHandling = PreserveReferencesHandling.Objects
            //};

            string converted = JsonConvert.SerializeObject(vm.CurrentSemester, Formatting.Indented,
                new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.Objects });

            //string converted = JsonConvert.SerializeObject(vm.GetCurrentSemester(User.Identity.GetUserId()));
            return Content(converted, "application/json");
        }

        private ApplicationUserManager UserManager
        {
            get
            {
                return HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
            }
        }
    }
}


text:
<meta charset="UTF-8">
<title>WithFrameTests.pageWithIFramesUrl - balin</title>
<link rel="stylesheet" href="../../../style.css">

balin / com.github.epadronu.balin.core / WithFrameTests / pageWithIFramesUrl

pageWithIFramesUrl

@JvmStatic val pageWithIFramesUrl: String


text:
package org.evilbinary.tv.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

/**
 * 作者:evilbinary on 2/2/16.
 * 邮箱:rootdebug@163.com
 */
public class TvZorderLinearLayout  extends LinearLayout {
        private int position = 0;

        public TvZorderLinearLayout(Context context) {
            super(context);

        }

        public TvZorderLinearLayout(Context context, AttributeSet attrs) {
            super(context, attrs);
            this.setChildrenDrawingOrderEnabled(true);
        }

        public void setCurrentPosition(int pos) {
            this.position = pos;
        }

        @Override
        protected int getChildDrawingOrder(int childCount, int i) {
            View v = getFocusedChild();
            int pos = indexOfChild(v);
            if (pos >= 0 && pos < childCount)
                setCurrentPosition(pos);
            if (i == childCount - 1) {//这是最后一个需要刷新的item
                return position;
            }
            if (i == position) {//这是原本要在最后一个刷新的item
                return childCount - 1;
            }
            return i;//正常次序的item
        }

}


text:
<?php
//php artisan make:model Ispit
namespace Fakultet;
use Illuminate\Database\Eloquent\Model;

class Ispit extends Model
{
    protected $table    = 'ispit';
    public    $fillable = [
        'mbrStud',
        'sifPred',
        'sifNastavnik',
        'datIspit',
        'ocjena',
        'created_at',
        'updated_at'];

}


text:
haskell-hacking
===============

my hacking with haskell


text:
package org.apache.giraph.zk;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.concurrent.atomic.AtomicInteger;

import org.apache.giraph.time.Time;
import org.apache.giraph.zk.BspEvent;
import org.apache.giraph.zk.PredicateLock;
import org.apache.hadoop.util.Progressable;
import org.junit.Before;
import org.junit.Test;

/**
 * Ensure that PredicateLock objects work correctly.
 */
public class TestPredicateLock {
  /** How many times was progress called? */
  private AtomicInteger progressCalled = new AtomicInteger(0);

  private static class SignalThread extends Thread {
    private final BspEvent event;
    public SignalThread(BspEvent event) {
      this.event = event;
    }
    public void run() {
      try {
        Thread.sleep(500);
      } catch (InterruptedException e) {
      }
      event.signal();
    }
  }

  private Progressable stubContext;

  private Progressable getStubProgressable() {
    if (stubContext == null)
      stubContext = new Progressable() {
        @Override
        public void progress() {
          progressCalled.incrementAndGet();
        }
      };
    return stubContext;
  }

  @Before
  public void setUp() {
    progressCalled.set(0);
  }

  /**
   * SMake sure the the event is not signaled.
   */
  @Test
  public void testWaitMsecsNoEvent() {
    Time mockTime = mock(Time.class);
    when(mockTime.getMilliseconds()).
        thenReturn(0L).thenReturn(2L);
    BspEvent event = new PredicateLock(getStubProgressable(), 1, mockTime);
    boolean gotPredicate = event.waitMsecs(1);
    assertFalse(gotPredicate);
    assertEquals(0, progressCalled.get());
    when(mockTime.getMilliseconds()).
        thenReturn(0L).thenReturn(0L).thenReturn(2L);
    gotPredicate = event.waitMsecs(1);
    assertFalse(gotPredicate);
    assertEquals(1, progressCalled.get());
  }

  /**
   * Single threaded case where the event is signaled.
   */
  @Test
  public void testEvent() {
    Time mockTime = mock(Time.class);
    when(mockTime.getMilliseconds()).
        thenReturn(0L).thenReturn(2L);
    BspEvent event = new PredicateLock(getStubProgressable(), 1, mockTime);
    event.signal();
    boolean gotPredicate = event.waitMsecs(2);
    assertTrue(gotPredicate);
    event.reset();
    when(mockTime.getMilliseconds()).
        thenReturn(0L).thenReturn(2L);
    gotPredicate = event.waitMsecs(0);
    assertFalse(gotPredicate);
  }

  /**
   * Thread signaled test for {@link PredicateLock#waitForever()}
   */
  @Test
  public void testWaitForever() {
    BspEvent event = new PredicateLock(getStubProgressable());
    Thread signalThread = new SignalThread(event);
    signalThread.start();
    event.waitForever();
    try {
      signalThread.join();
    } catch (InterruptedException e) {
    }
    assertTrue(event.waitMsecs(0));
  }

  /**
   * Thread signaled test to make sure the the event is signaled correctly
   *
   * @throws InterruptedException
   */
  @Test
  public void testWaitMsecs() {
    BspEvent event = new PredicateLock(getStubProgressable());
    Thread signalThread = new SignalThread(event);
    signalThread.start();
    boolean gotPredicate = event.waitMsecs(2000);
    assertTrue(gotPredicate);
    try {
      signalThread.join();
    } catch (InterruptedException e) {
    }
    gotPredicate = event.waitMsecs(0);
    assertTrue(gotPredicate);
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>org.jsoup (jsoup 1.8.4-SNAPSHOT API)</title>
<meta name="date" content="2015-11-06">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

程序包 org.jsoup

Contains the main Jsoup class, which provides convenient static access to the jsoup functionality.

请参阅: 说明

接口概要

接口
说明

Connection

A Connection provides a convenient interface to fetch content from the web, and parse them into Documents.

Connection.Base<T extends Connection.Base>

Common methods for Requests and Responses

Connection.KeyVal

A Key Value tuple.

Connection.Request

Represents a HTTP request.

Connection.Response

Represents a HTTP response.

类概要

类
说明

Jsoup

The core public access point to the jsoup functionality.

枚举概要

枚举
说明

Connection.Method

GET and POST http methods.

异常错误概要

异常错误
说明

HttpStatusException

Signals that a HTTP request resulted in a not OK HTTP response.

UnsupportedMimeTypeException

Signals that a HTTP response returned a mime type that is not supported.

程序包org.jsoup的说明

Contains the main Jsoup class, which provides convenient static access to the jsoup functionality.

概览

程序包

类

使用

树

已过时

索引

帮助

上一个程序包

下一个程序包

框架

无框架

所有类

Copyright © 2009-2015 Jonathan Hedley. All Rights Reserved.


text:
$.components.register("nprogress", {
  mode: "init",
  defaults: {
    minimum: 0.15,
    trickleRate: .07,
    trickleSpeed: 360,
    showSpinner: false,
    template: '

'
  },
  init: function() {
    if (typeof NProgress === "undefined") return;
    var defaults = $.components.getDefaults('nprogress');
    NProgress.configure(defaults);
  }
});


text:
<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
        <link type="text/css" rel="stylesheet" href="style13.css"/>
	<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">

<title>
    DSS Individual Statistics Page
</title>

      Doctor Shift Scheduler

 Home

            Statistics

 Individual Statistics

 Group Statistics

   Vacations

   Doctors

  Logout

Individual Doctor Statistics

   <button type="button" class="btn btn-default dropdown-toggle"
      data-toggle="dropdown">
      Select a Doctor
   </button>

AndrewMitchell

PaulMathew

KevinAnderson

PeterBatterson

GeoffreySanders

RebeccaFiala

JohnBell

AmyKavanagh

MaxwellGarett

  Initials : AM

  Doctor Name: Andrew Mitchell

  Number of weekdays worked : 	  4

  Number of weekends worked : 	  5

  Number of holidays worked : 	  8

  Number of days worked as On Site doctor : 	  10

  Number of days worked as On Call Doctor : 	  12

  Initials : PM

  Doctor Name: Paul Mathew

  Number of weekdays worked : 	  6

  Number of weekends worked : 	  7

  Number of holidays worked : 	  10

  Number of days worked as On Site doctor : 	  12

  Number of days worked as On Call Doctor : 	  8

  Initials : KA

  Doctor Name: Kevin Anderson

  Number of weekdays worked : 	  4

  Number of weekends worked : 	  5

  Number of holidays worked : 	  12

  Number of days worked as On Site doctor : 	  5

  Number of days worked as On Call Doctor : 	  15

  Initials : PB

  Doctor Name: Peter Batterson

  Number of weekdays worked : 	  15

  Number of weekends worked : 	  10

  Number of holidays worked : 	  9

  Number of days worked as On Site doctor : 	  3

  Number of days worked as On Call Doctor : 	  5

  Initials : GS

  Doctor Name: Geoffrey Sanders

  Number of weekdays worked : 	  20

  Number of weekends worked : 	  7

  Number of holidays worked : 	  2

  Number of days worked as On Site doctor : 	  0

  Number of days worked as On Call Doctor : 	  12

  Initials : RF

  Doctor Name: Rebecca Fiala

  Number of weekdays worked : 	  13

  Number of weekends worked : 	  8

  Number of holidays worked : 	  10

  Number of days worked as On Site doctor : 	  11

  Number of days worked as On Call Doctor : 	  15

  Initials : JB

  Doctor Name: John Bell

  Number of weekdays worked : 	  17

  Number of weekends worked : 	  10

  Number of holidays worked : 	  6

  Number of days worked as On Site doctor : 	  10

  Number of days worked as On Call Doctor : 	  0

  Initials : AK

  Doctor Name: Amy Kavanagh

  Number of weekdays worked : 	  20

  Number of weekends worked : 	  7

  Number of holidays worked : 	  9

  Number of days worked as On Site doctor : 	  2

  Number of days worked as On Call Doctor : 	  4

  Initials : MG

  Doctor Name: Maxwell Garrett

  Number of weekdays worked : 	  25

  Number of weekends worked : 	  17

  Number of holidays worked : 	  8

  Number of days worked as On Site doctor : 	  15

  Number of days worked as On Call Doctor : 	  10

About

Contact


text:
<?php

namespace Grav\Plugin\Login\Events;

use Grav\Common\User\User;
use RocketTheme\Toolbox\Event\Event;

/**
 * Class UserLoginEvent
 * @package Grav\Common\User\Events
 *
 * @property int                $status
 * @property array              $credentials
 * @property string|string[]    $authorize
 * @property array              $options
 * @property User               $user
 * @property string             $message
 *
 */
class UserLoginEvent extends Event
{
    /**
     * Undefined event state.
     */
    const AUTHENTICATION_UNDEFINED = 0;

    /**
     * onUserAuthenticate success.
     */
    const AUTHENTICATION_SUCCESS = 1;

    /**
     * onUserAuthenticate fails on bad username/password.
     */
    const AUTHENTICATION_FAILURE = 2;

    /**
     * onUserAuthenticate fails on auth cancellation.
     */
    const AUTHENTICATION_CANCELLED = 4;

    /**
     * onUserAuthorizeLogin fails on expired account.
     */
    const AUTHORIZATION_EXPIRED = 8;

    /**
     * onUserAuthorizeLogin is delayed until user has performed extra action(s).
     */
    const AUTHORIZATION_DELAYED = 16;

    /**
     * onUserAuthorizeLogin fails for other reasons.
     */
    const AUTHORIZATION_DENIED = 32;

    /**
     * UserLoginEvent constructor.
     * @param array $items
     */
    public function __construct(array $items = [])
    {
        $items += [
            'credentials' => [],
            'options' => [],
            'authorize' => 'site.login',
            'status' => static::AUTHENTICATION_UNDEFINED,
            'user' => null,
            'message' => ''
        ];
        $items['credentials'] += ['username' => '', 'password' => ''];

        parent::__construct($items);

        if (!$this->offsetExists('user')) {
            $this->offsetSet('user', User::load($this['credentials']['username']));
        }
    }

    public function isSuccess()
    {
        $status = $this->offsetGet('status');
        $failure = static::AUTHENTICATION_FAILURE | static::AUTHENTICATION_CANCELLED | static::AUTHORIZATION_EXPIRED
            | static::AUTHORIZATION_DENIED;

        return ($status & static::AUTHENTICATION_SUCCESS) && !($status & $failure);
    }

    public function isDelayed()
    {
        return $this->isSuccess() && ($this->offsetGet('status') & static::AUTHORIZATION_DELAYED);
    }

    /**
     * @return int
     */
    public function getStatus()
    {
        return (int)$this->offsetGet('status');
    }

    /**
     * @param int $status
     * @return $this
     */
    public function setStatus($status)
    {
        $this->offsetSet('status', $this->offsetGet('status') | (int)$status);

        return $this;
    }

    /**
     * @return array
     */
    public function getCredentials()
    {
        return $this->offsetGet('credentials') + ['username' => '', 'password' => ''];
    }

    /**
     * @param string $name
     * @return mixed
     */
    public function getCredential($name)
    {
        return isset($this->items['credentials'][$name]) ? $this->items['credentials'][$name] : null;
    }

    /**
     * @param string $name
     * @param mixed $value
     * @return $this
     */
    public function setCredential($name, $value)
    {
        $this->items['credentials'][$name] = $value;

        return $this;
    }

    /**
     * @return array
     */
    public function getOptions()
    {
        return $this->offsetGet('options');
    }

    /**
     * @param string $name
     * @return mixed
     */
    public function getOption($name)
    {
        return isset($this->items['options'][$name]) ? $this->items['options'][$name] : null;
    }

    /**
     * @param string $name
     * @param mixed $value
     * @return $this
     */
    public function setOption($name, $value)
    {
        $this->items['options'][$name] = $value;

        return $this;
    }

    /**
     * @return User
     */
    public function getUser()
    {
        return $this->offsetGet('user');
    }

    /**
     * @param User $user
     * @return $this
     */
    public function setUser(User $user)
    {
        $this->offsetSet('user', $user);

        return $this;
    }

    /**
     * @return array
     */
    public function getAuthorize()
    {
        return (array)$this->offsetGet('authorize');
    }

    /**
     * @param string $message
     * @return $this
     */
    public function setMessage($message)
    {
        $this->items['message'] = (string)$message;

        return $this;
    }

    /**
     * Magic setter method
     *
     * @param mixed $offset Asset name value
     * @param mixed $value  Asset value
     */
    public function __set($offset, $value)
    {
        $this->offsetSet($offset, $value);
    }

    /**
     * Magic getter method
     *
     * @param  mixed $offset Asset name value
     * @return mixed         Asset value
     */
    public function __get($offset)
    {
        return $this->offsetGet($offset);
    }

    /**
     * Magic method to determine if the attribute is set
     *
     * @param  mixed   $offset Asset name value
     * @return boolean         True if the value is set
     */
    public function __isset($offset)
    {
        return $this->offsetExists($offset);
    }

    /**
     * Magic method to unset the attribute
     *
     * @param mixed $offset The name value to unset
     */
    public function __unset($offset)
    {
        $this->offsetUnset($offset);
    }
}


text:
import numpy as np
import itertools
from sklearn.model_selection import KFold

def kfold(k, entries):
    kf = KFold(n_splits=k, shuffle=True)
    return kf.split(entries)

def kfold_entries(k, entries):
    unique = np.unique(entries)
    kf = KFold(n_splits=k, shuffle=True)
    for train_indices_entries, test_indices_entries in kf.split(unique):
        train_indices = [i for i, x in enumerate(entries) if x in train_indices_entries]
        test_indices = [i for i, x in enumerate(entries) if x in test_indices_entries]
        yield train_indices, test_indices

def kfold_entries_plus(k, entries, plus):
    unique = np.unique(entries)
    kf = KFold(n_splits=k, shuffle=True)
    for train_indices_entries, test_indices_entries in kf.split(unique):

        train = {key: [] for key in train_indices_entries}
        test = {key: [] for key in test_indices_entries}
        for i, x in enumerate(entries):
            if x in train_indices_entries:
                train[x].append(i)
            if x in test_indices_entries:
                test[x].append(i)

        plus_list = []

        for test_key in test.keys():
            for _ in range(plus):
                n = len(test[test_key])
                if n <= 1:
                    break
                i = np.random.randint(n - 1)
                element = test[test_key].pop(i)
                plus_list.append(element)

        train_indices = np.array(list(itertools.chain(plus_list, *train.values())))
        test_indices = np.array(list(itertools.chain(*test.values())))

        yield train_indices, test_indices


text:
layout: page
title: Key Blue Trade Trade Fair
date: 2016-05-24
author: Jacob Mcgee
tags: weekly links, java
status: published
summary: Fusce gravida pellentesque efficitur. Nullam nec.
banner: images/banner/leisure-04.jpg
booking:
  startDate: 10/09/2016
  endDate: 10/14/2016
  ctyhocn: GLHMSHX
  groupCode: KBTTF
published: true
---
Duis volutpat blandit bibendum. Duis convallis, lectus dignissim pulvinar mollis, risus sapien commodo velit, eget egestas purus turpis nec nibh. Quisque pretium vestibulum ipsum a mollis. Cras id molestie magna, eu ultrices libero. Curabitur scelerisque a arcu eget consequat. Phasellus eu ipsum vestibulum, facilisis libero eu, elementum est. Mauris laoreet tincidunt euismod.

* Aenean vehicula elit ut enim lobortis, et pharetra mauris egestas
* Nunc sit amet turpis et ligula venenatis convallis sit amet vel velit
* Nam eu lorem faucibus orci elementum facilisis quis faucibus odio
* Nulla tristique velit vitae congue placerat.

Phasellus quis tellus tempus, convallis arcu sed, pharetra mi. In eget nunc nunc. Phasellus posuere laoreet pretium. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse a tortor sed dui consectetur lacinia id quis lorem. Donec id sodales leo. Duis tristique vitae enim eu mattis. Integer nisl nunc, ornare sit amet viverra vel, ullamcorper vitae odio. Praesent tincidunt sapien eu enim tincidunt, a feugiat sem pellentesque. Aliquam interdum ultricies accumsan. Sed aliquam et nibh nec molestie. Cras facilisis sollicitudin urna, in tincidunt nisl aliquet vel. Aenean aliquam congue commodo. Cras efficitur felis id libero pellentesque pretium. Nam vehicula felis lorem, nec rutrum tellus accumsan eleifend.


text:
<!DOCTYPE HTML>

		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>MPAdViewDelegate Protocol Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 963)" />

MoPubSDK

				MoPub

MPAdViewDelegate Protocol Reference

					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents">Table of Contents</button>

					<select id="jumpTo">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<option value="instance_methods">Instance Methods</option>

	<option value="//api/name/adViewDidFailToLoadAd:">    - adViewDidFailToLoadAd:</option>

	<option value="//api/name/adViewDidLoadAd:">    - adViewDidLoadAd:</option>

	<option value="//api/name/didDismissModalViewForAd:">    - didDismissModalViewForAd:</option>

	<option value="//api/name/viewControllerForPresentingModalView">    - viewControllerForPresentingModalView</option>

	<option value="//api/name/willLeaveApplicationFromAd:">    - willLeaveApplicationFromAd:</option>

	<option value="//api/name/willPresentModalViewForAd:">    - willPresentModalViewForAd:</option>

</select>

Overview

Tasks

Managing Modal Content Presentation

Detecting When a Banner Ad is Loaded

Detecting When a User Interacts With the Ad View

Instance Methods

adViewDidFailToLoadAd:

adViewDidLoadAd:

didDismissModalViewForAd:

viewControllerForPresentingModalView

willLeaveApplicationFromAd:

willPresentModalViewForAd:

Index

Hierarchy

MPAdViewDelegate Protocol Reference

	Conforms to
	NSObject

	Declared in
	MPAdView.h

Overview

The delegate of an MPAdView object must adopt the MPAdViewDelegate protocol. It must
implement viewControllerForPresentingModalView to provide a root view controller from which
the ad view should present modal content.

Optional methods of this protocol allow the delegate to be notified of banner success or
failure, as well as other lifecycle events.

Tasks

Managing Modal Content Presentation

		– viewControllerForPresentingModalView

	required method

Detecting When a Banner Ad is Loaded

		– adViewDidLoadAd:

		– adViewDidFailToLoadAd:

Detecting When a User Interacts With the Ad View

		– willPresentModalViewForAd:

		– didDismissModalViewForAd:

		– willLeaveApplicationFromAd:

Instance Methods

adViewDidFailToLoadAd:

Sent when an ad view fails to load an ad.

- (void)adViewDidFailToLoadAd:(MPAdView *)view

Parameters

view

The ad view sending the message.

Discussion

To avoid displaying blank ads, you should hide the ad view in response to this message.

Declared In

		MPAdView.h

adViewDidLoadAd:

Sent when an ad view successfully loads an ad.

- (void)adViewDidLoadAd:(MPAdView *)view

Parameters

view

The ad view sending the message.

Discussion

Your implementation of this method should insert the ad view into the view hierarchy, if you
have not already done so.

Declared In

		MPAdView.h

didDismissModalViewForAd:

Sent when an ad view has dismissed its modal content, returning control to your application.

- (void)didDismissModalViewForAd:(MPAdView *)view

Parameters

view

The ad view sending the message.

Discussion

Your implementation of this method should resume any application activity that was paused
in response to willPresentModalViewForAd:.

Declared In

		MPAdView.h

viewControllerForPresentingModalView

Asks the delegate for a view controller to use for presenting modal content, such as the in-app
browser that can appear when an ad is tapped.

- (UIViewController *)viewControllerForPresentingModalView

Return Value

A view controller that should be used for presenting modal content.

Declared In

		MPAdView.h

willLeaveApplicationFromAd:

Sent when a user is about to leave your application as a result of tapping
on an ad.

- (void)willLeaveApplicationFromAd:(MPAdView *)view

Parameters

view

The ad view sending the message.

Discussion

Your application will be moved to the background shortly after this method is called.

Declared In

		MPAdView.h

willPresentModalViewForAd:

Sent when an ad view is about to present modal content.

- (void)willPresentModalViewForAd:(MPAdView *)view

Parameters

view

The ad view sending the message.

Discussion

This method is called when the user taps on the ad view. Your implementation of this method
should pause any application activity that requires user interaction.

Declared In

		MPAdView.h

Index

Hierarchy

© 2015 MoPub. All rights reserved. (Last updated: 2015-10-07)

						Generated by appledoc 2.2 (build 963).


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mapsv2"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!-- External storage for caching. -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- Maps API needs OpenGL ES 2.0. -->
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <!--
         ** You need to replace the key below with your own key. **
         The example key below will not be accepted because it is not linked to the
         certificate which you will use to sign this application.
         See: https://developers.google.com/maps/documentation/android/start
         for instructions on how to get your own key.
        -->
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyDNqkMxf-9LIgsjs91xC6-KygnMo8T4Amg" />

        <activity
            android:name="com.example.mapsv2.ClustersAreListsActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


text:
#include "src/sksl/SkSLAnalysis.h"

#include "include/core/SkSpan.h"
#include "include/core/SkTypes.h"
#include "include/private/SkSLDefines.h"
#include "include/private/SkSLIRNode.h"
#include "include/private/SkSLLayout.h"
#include "include/private/SkSLModifiers.h"
#include "include/private/SkSLProgramElement.h"
#include "include/private/SkSLSampleUsage.h"
#include "include/private/SkSLStatement.h"
#include "include/private/SkTArray.h"
#include "include/private/SkTHash.h"
#include "include/sksl/SkSLErrorReporter.h"
#include "src/sksl/SkSLBuiltinTypes.h"
#include "src/sksl/SkSLCompiler.h"
#include "src/sksl/SkSLConstantFolder.h"
#include "src/sksl/SkSLContext.h"
#include "src/sksl/SkSLIntrinsicList.h"
#include "src/sksl/analysis/SkSLNoOpErrorReporter.h"
#include "src/sksl/analysis/SkSLProgramUsage.h"
#include "src/sksl/analysis/SkSLProgramVisitor.h"
#include "src/sksl/ir/SkSLBinaryExpression.h"
#include "src/sksl/ir/SkSLBlock.h"
#include "src/sksl/ir/SkSLChildCall.h"
#include "src/sksl/ir/SkSLConstructor.h"
#include "src/sksl/ir/SkSLDoStatement.h"
#include "src/sksl/ir/SkSLExpression.h"
#include "src/sksl/ir/SkSLExpressionStatement.h"
#include "src/sksl/ir/SkSLExternalFunctionCall.h"
#include "src/sksl/ir/SkSLFieldAccess.h"
#include "src/sksl/ir/SkSLForStatement.h"
#include "src/sksl/ir/SkSLFunctionCall.h"
#include "src/sksl/ir/SkSLFunctionDeclaration.h"
#include "src/sksl/ir/SkSLFunctionDefinition.h"
#include "src/sksl/ir/SkSLIfStatement.h"
#include "src/sksl/ir/SkSLIndexExpression.h"
#include "src/sksl/ir/SkSLPostfixExpression.h"
#include "src/sksl/ir/SkSLPrefixExpression.h"
#include "src/sksl/ir/SkSLProgram.h"
#include "src/sksl/ir/SkSLReturnStatement.h"
#include "src/sksl/ir/SkSLSwitchCase.h"
#include "src/sksl/ir/SkSLSwitchStatement.h"
#include "src/sksl/ir/SkSLSwizzle.h"
#include "src/sksl/ir/SkSLTernaryExpression.h"
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLVarDeclarations.h"
#include "src/sksl/ir/SkSLVariable.h"
#include "src/sksl/ir/SkSLVariableReference.h"
#include "src/sksl/transform/SkSLProgramWriter.h"

#include <optional>
#include <string>
#include <string_view>

namespace SkSL {

namespace {

// Visitor that determines the merged SampleUsage for a given child in the program.
class MergeSampleUsageVisitor : public ProgramVisitor {
public:
    MergeSampleUsageVisitor(const Context& context,
                            const Variable& child,
                            bool writesToSampleCoords)
            : fContext(context), fChild(child), fWritesToSampleCoords(writesToSampleCoords) {}

    SampleUsage visit(const Program& program) {
        fUsage = SampleUsage(); // reset to none
        INHERITED::visit(program);
        return fUsage;
    }

    int elidedSampleCoordCount() const { return fElidedSampleCoordCount; }

protected:
    const Context& fContext;
    const Variable& fChild;
    const bool fWritesToSampleCoords;
    SampleUsage fUsage;
    int fElidedSampleCoordCount = 0;

    bool visitExpression(const Expression& e) override {
        // Looking for child(...)
        if (e.is<ChildCall>() && &e.as<ChildCall>().child() == &fChild) {
            // Determine the type of call at this site, and merge it with the accumulated state
            const ExpressionArray& arguments = e.as<ChildCall>().arguments();
            SkASSERT(arguments.size() >= 1);

            const Expression* maybeCoords = arguments[0].get();
            if (maybeCoords->type().matches(*fContext.fTypes.fFloat2)) {
                // If the coords are a direct reference to the program's sample-coords, and those
                // coords are never modified, we can conservatively turn this into PassThrough
                // sampling. In all other cases, we consider it Explicit.
                if (!fWritesToSampleCoords && maybeCoords->is<VariableReference>() &&
                    maybeCoords->as<VariableReference>().variable()->modifiers().fLayout.fBuiltin ==
                            SK_MAIN_COORDS_BUILTIN) {
                    fUsage.merge(SampleUsage::PassThrough());
                    ++fElidedSampleCoordCount;
                } else {
                    fUsage.merge(SampleUsage::Explicit());
                }
            } else {
                // child(inputColor) or child(srcColor, dstColor) -> PassThrough
                fUsage.merge(SampleUsage::PassThrough());
            }
        }

        return INHERITED::visitExpression(e);
    }

    using INHERITED = ProgramVisitor;
};

// Visitor that searches for child calls from a function other than main()
class SampleOutsideMainVisitor : public ProgramVisitor {
public:
    SampleOutsideMainVisitor() {}

    bool visitExpression(const Expression& e) override {
        if (e.is<ChildCall>()) {
            return true;
        }
        return INHERITED::visitExpression(e);
    }

    bool visitProgramElement(const ProgramElement& p) override {
        return p.is<FunctionDefinition>() &&
               !p.as<FunctionDefinition>().declaration().isMain() &&
               INHERITED::visitProgramElement(p);
    }

    using INHERITED = ProgramVisitor;
};

class ReturnsNonOpaqueColorVisitor : public ProgramVisitor {
public:
    ReturnsNonOpaqueColorVisitor() {}

    bool visitStatement(const Statement& s) override {
        if (s.is<ReturnStatement>()) {
            const Expression* e = s.as<ReturnStatement>().expression().get();
            bool knownOpaque = e && e->type().slotCount() == 4 &&
                               ConstantFolder::GetConstantValueForVariable(*e)
                                               ->getConstantValue(/*n=*/3)
                                               .value_or(0) == 1;
            return !knownOpaque;
        }
        return INHERITED::visitStatement(s);
    }

    bool visitExpression(const Expression& e) override {
        // No need to recurse into expressions, these can never contain return statements
        return false;
    }

    using INHERITED = ProgramVisitor;
    using INHERITED::visitProgramElement;
};

// Visitor that counts the number of nodes visited
class NodeCountVisitor : public ProgramVisitor {
public:
    NodeCountVisitor(int limit) : fLimit(limit) {}

    int visit(const Statement& s) {
        this->visitStatement(s);
        return fCount;
    }

    bool visitExpression(const Expression& e) override {
        ++fCount;
        return (fCount >= fLimit) || INHERITED::visitExpression(e);
    }

    bool visitProgramElement(const ProgramElement& p) override {
        ++fCount;
        return (fCount >= fLimit) || INHERITED::visitProgramElement(p);
    }

    bool visitStatement(const Statement& s) override {
        ++fCount;
        return (fCount >= fLimit) || INHERITED::visitStatement(s);
    }

private:
    int fCount = 0;
    int fLimit;

    using INHERITED = ProgramVisitor;
};

class VariableWriteVisitor : public ProgramVisitor {
public:
    VariableWriteVisitor(const Variable* var)
        : fVar(var) {}

    bool visit(const Statement& s) {
        return this->visitStatement(s);
    }

    bool visitExpression(const Expression& e) override {
        if (e.is<VariableReference>()) {
            const VariableReference& ref = e.as<VariableReference>();
            if (ref.variable() == fVar &&
                (ref.refKind() == VariableReference::RefKind::kWrite ||
                 ref.refKind() == VariableReference::RefKind::kReadWrite ||
                 ref.refKind() == VariableReference::RefKind::kPointer)) {
                return true;
            }
        }
        return INHERITED::visitExpression(e);
    }

private:
    const Variable* fVar;

    using INHERITED = ProgramVisitor;
};

// This isn't actually using ProgramVisitor, because it only considers a subset of the fields for
// any given expression kind. For instance, when indexing an array (e.g. `x[1]`), we only want to
// know if the base (`x`) is assignable; the index expression (`1`) doesn't need to be.
class IsAssignableVisitor {
public:
    IsAssignableVisitor(ErrorReporter* errors) : fErrors(errors) {}

    bool visit(Expression& expr, Analysis::AssignmentInfo* info) {
        int oldErrorCount = fErrors->errorCount();
        this->visitExpression(expr);
        if (info) {
            info->fAssignedVar = fAssignedVar;
        }
        return fErrors->errorCount() == oldErrorCount;
    }

    void visitExpression(Expression& expr) {
        switch (expr.kind()) {
            case Expression::Kind::kVariableReference: {
                VariableReference& varRef = expr.as<VariableReference>();
                const Variable* var = varRef.variable();
                if (var->modifiers().fFlags & (Modifiers::kConst_Flag | Modifiers::kUniform_Flag)) {
                    fErrors->error(expr.fPosition, "cannot modify immutable variable '" +
                            std::string(var->name()) + "'");
                } else {
                    SkASSERT(fAssignedVar == nullptr);
                    fAssignedVar = &varRef;
                }
                break;
            }
            case Expression::Kind::kFieldAccess:
                this->visitExpression(*expr.as<FieldAccess>().base());
                break;

            case Expression::Kind::kSwizzle: {
                const Swizzle& swizzle = expr.as<Swizzle>();
                this->checkSwizzleWrite(swizzle);
                this->visitExpression(*swizzle.base());
                break;
            }
            case Expression::Kind::kIndex:
                this->visitExpression(*expr.as<IndexExpression>().base());
                break;

            case Expression::Kind::kPoison:
                break;

            default:
                fErrors->error(expr.fPosition, "cannot assign to this expression");
                break;
        }
    }

private:
    void checkSwizzleWrite(const Swizzle& swizzle) {
        int bits = 0;
        for (int8_t idx : swizzle.components()) {
            SkASSERT(idx >= SwizzleComponent::X && idx <= SwizzleComponent::W);
            int bit = 1 << idx;
            if (bits & bit) {
                fErrors->error(swizzle.fPosition,
                               "cannot write to the same swizzle field more than once");
                break;
            }
            bits |= bit;
        }
    }

    ErrorReporter* fErrors;
    VariableReference* fAssignedVar = nullptr;

    using INHERITED = ProgramVisitor;
};

}  // namespace

////////////////////////////////////////////////////////////////////////////////
// Analysis

SampleUsage Analysis::GetSampleUsage(const Program& program,
                                     const Variable& child,
                                     bool writesToSampleCoords,
                                     int* elidedSampleCoordCount) {
    MergeSampleUsageVisitor visitor(*program.fContext, child, writesToSampleCoords);
    SampleUsage result = visitor.visit(program);
    if (elidedSampleCoordCount) {
        *elidedSampleCoordCount += visitor.elidedSampleCoordCount();
    }
    return result;
}

bool Analysis::ReferencesBuiltin(const Program& program, int builtin) {
    SkASSERT(program.fUsage);
    for (const auto& [variable, counts] : program.fUsage->fVariableCounts) {
        if (counts.fRead > 0 && variable->modifiers().fLayout.fBuiltin == builtin) {
            return true;
        }
    }
    return false;
}

bool Analysis::ReferencesSampleCoords(const Program& program) {
    return Analysis::ReferencesBuiltin(program, SK_MAIN_COORDS_BUILTIN);
}

bool Analysis::ReferencesFragCoords(const Program& program) {
    return Analysis::ReferencesBuiltin(program, SK_FRAGCOORD_BUILTIN);
}

bool Analysis::CallsSampleOutsideMain(const Program& program) {
    SampleOutsideMainVisitor visitor;
    return visitor.visit(program);
}

bool Analysis::CallsColorTransformIntrinsics(const Program& program) {
    for (auto [fn, count] : program.usage()->fCallCounts) {
        if (count != 0 && (fn->intrinsicKind() == k_toLinearSrgb_IntrinsicKind ||
                           fn->intrinsicKind() == k_fromLinearSrgb_IntrinsicKind)) {
            return true;
        }
    }
    return false;
}

bool Analysis::ReturnsOpaqueColor(const FunctionDefinition& function) {
    ReturnsNonOpaqueColorVisitor visitor;
    return !visitor.visitProgramElement(function);
}

bool Analysis::ContainsRTAdjust(const Expression& expr) {
    class ContainsRTAdjustVisitor : public ProgramVisitor {
    public:
        bool visitExpression(const Expression& expr) override {
            if (expr.is<VariableReference>() &&
                expr.as<VariableReference>().variable()->name() == Compiler::RTADJUST_NAME) {
                return true;
            }
            return INHERITED::visitExpression(expr);
        }

        using INHERITED = ProgramVisitor;
    };

    ContainsRTAdjustVisitor visitor;
    return visitor.visitExpression(expr);
}

bool Analysis::IsCompileTimeConstant(const Expression& expr) {
    class IsCompileTimeConstantVisitor : public ProgramVisitor {
    public:
        bool visitExpression(const Expression& expr) override {
            switch (expr.kind()) {
                case Expression::Kind::kLiteral:
                    // Literals are compile-time constants.
                    return false;

                case Expression::Kind::kConstructorArray:
                case Expression::Kind::kConstructorCompound:
                case Expression::Kind::kConstructorDiagonalMatrix:
                case Expression::Kind::kConstructorMatrixResize:
                case Expression::Kind::kConstructorSplat:
                case Expression::Kind::kConstructorStruct:
                    // Constructors might be compile-time constants, if they are composed entirely
                    // of literals and constructors. (Casting constructors are intentionally omitted
                    // here. If the value inside was a compile-time constant, we would have not have
                    // generated a cast at all.)
                    return INHERITED::visitExpression(expr);

                default:
                    // This expression isn't a compile-time constant.
                    fIsConstant = false;
                    return true;
            }
        }

        bool fIsConstant = true;
        using INHERITED = ProgramVisitor;
    };

    IsCompileTimeConstantVisitor visitor;
    visitor.visitExpression(expr);
    return visitor.fIsConstant;
}

bool Analysis::DetectVarDeclarationWithoutScope(const Statement& stmt, ErrorReporter* errors) {
    // A variable declaration can create either a lone VarDeclaration or an unscoped Block
    // containing multiple VarDeclaration statements. We need to detect either case.
    const Variable* var;
    if (stmt.is<VarDeclaration>()) {
        // The single-variable case. No blocks at all.
        var = stmt.as<VarDeclaration>().var();
    } else if (stmt.is<Block>()) {
        // The multiple-variable case: an unscoped, non-empty block...
        const Block& block = stmt.as<Block>();
        if (block.isScope() || block.children().empty()) {
            return false;
        }
        // ... holding a variable declaration.
        const Statement& innerStmt = *block.children().front();
        if (!innerStmt.is<VarDeclaration>()) {
            return false;
        }
        var = innerStmt.as<VarDeclaration>().var();
    } else {
        // This statement wasn't a variable declaration. No problem.
        return false;
    }

    // Report an error.
    SkASSERT(var);
    if (errors) {
        errors->error(var->fPosition,
                      "variable '" + std::string(var->name()) + "' must be created in a scope");
    }
    return true;
}

int Analysis::NodeCountUpToLimit(const FunctionDefinition& function, int limit) {
    return NodeCountVisitor{limit}.visit(*function.body());
}

bool Analysis::StatementWritesToVariable(const Statement& stmt, const Variable& var) {
    return VariableWriteVisitor(&var).visit(stmt);
}

bool Analysis::IsAssignable(Expression& expr, AssignmentInfo* info, ErrorReporter* errors) {
    NoOpErrorReporter unusedErrors;
    return IsAssignableVisitor{errors ? errors : &unusedErrors}.visit(expr, info);
}

bool Analysis::UpdateVariableRefKind(Expression* expr,
                                     VariableReference::RefKind kind,
                                     ErrorReporter* errors) {
    Analysis::AssignmentInfo info;
    if (!Analysis::IsAssignable(*expr, &info, errors)) {
        return false;
    }
    if (!info.fAssignedVar) {
        if (errors) {
            errors->error(expr->fPosition, "can't assign to expression '" + expr->description() +
                    "'");
        }
        return false;
    }
    info.fAssignedVar->setRefKind(kind);
    return true;
}

class ES2IndexingVisitor : public ProgramVisitor {
public:
    ES2IndexingVisitor(ErrorReporter& errors) : fErrors(errors) {}

    bool visitStatement(const Statement& s) override {
        if (s.is<ForStatement>()) {
            const ForStatement& f = s.as<ForStatement>();
            SkASSERT(f.initializer() && f.initializer()->is<VarDeclaration>());
            const Variable* var = f.initializer()->as<VarDeclaration>().var();
            auto [iter, inserted] = fLoopIndices.insert(var);
            SkASSERT(inserted);
            bool result = this->visitStatement(*f.statement());
            fLoopIndices.erase(iter);
            return result;
        }
        return INHERITED::visitStatement(s);
    }

    bool visitExpression(const Expression& e) override {
        if (e.is<IndexExpression>()) {
            const IndexExpression& i = e.as<IndexExpression>();
            if (!Analysis::IsConstantIndexExpression(*i.index(), &fLoopIndices)) {
                fErrors.error(i.fPosition, "index expression must be constant");
                return true;
            }
        }
        return INHERITED::visitExpression(e);
    }

    using ProgramVisitor::visitProgramElement;

private:
    ErrorReporter& fErrors;
    std::set<const Variable*> fLoopIndices;
    using INHERITED = ProgramVisitor;
};

void Analysis::ValidateIndexingForES2(const ProgramElement& pe, ErrorReporter& errors) {
    ES2IndexingVisitor visitor(errors);
    visitor.visitProgramElement(pe);
}

////////////////////////////////////////////////////////////////////////////////
// ProgramVisitor

bool ProgramVisitor::visit(const Program& program) {
    for (const ProgramElement* pe : program.elements()) {
        if (this->visitProgramElement(*pe)) {
            return true;
        }
    }
    return false;
}

template <typename T> bool TProgramVisitor<T>::visitExpression(typename T::Expression& e) {
    switch (e.kind()) {
        case Expression::Kind::kExternalFunctionReference:
        case Expression::Kind::kFunctionReference:
        case Expression::Kind::kLiteral:
        case Expression::Kind::kMethodReference:
        case Expression::Kind::kPoison:
        case Expression::Kind::kSetting:
        case Expression::Kind::kTypeReference:
        case Expression::Kind::kVariableReference:
            // Leaf expressions return false
            return false;

        case Expression::Kind::kBinary: {
            auto& b = e.template as<BinaryExpression>();
            return (b.left() && this->visitExpressionPtr(b.left())) ||
                   (b.right() && this->visitExpressionPtr(b.right()));
        }
        case Expression::Kind::kChildCall: {
            // We don't visit the child variable itself, just the arguments
            auto& c = e.template as<ChildCall>();
            for (auto& arg : c.arguments()) {
                if (arg && this->visitExpressionPtr(arg)) { return true; }
            }
            return false;
        }
        case Expression::Kind::kConstructorArray:
        case Expression::Kind::kConstructorArrayCast:
        case Expression::Kind::kConstructorCompound:
        case Expression::Kind::kConstructorCompoundCast:
        case Expression::Kind::kConstructorDiagonalMatrix:
        case Expression::Kind::kConstructorMatrixResize:
        case Expression::Kind::kConstructorScalarCast:
        case Expression::Kind::kConstructorSplat:
        case Expression::Kind::kConstructorStruct: {
            auto& c = e.asAnyConstructor();
            for (auto& arg : c.argumentSpan()) {
                if (this->visitExpressionPtr(arg)) { return true; }
            }
            return false;
        }
        case Expression::Kind::kExternalFunctionCall: {
            auto& c = e.template as<ExternalFunctionCall>();
            for (auto& arg : c.arguments()) {
                if (this->visitExpressionPtr(arg)) { return true; }
            }
            return false;
        }
        case Expression::Kind::kFieldAccess:
            return this->visitExpressionPtr(e.template as<FieldAccess>().base());

        case Expression::Kind::kFunctionCall: {
            auto& c = e.template as<FunctionCall>();
            for (auto& arg : c.arguments()) {
                if (arg && this->visitExpressionPtr(arg)) { return true; }
            }
            return false;
        }
        case Expression::Kind::kIndex: {
            auto& i = e.template as<IndexExpression>();
            return this->visitExpressionPtr(i.base()) || this->visitExpressionPtr(i.index());
        }
        case Expression::Kind::kPostfix:
            return this->visitExpressionPtr(e.template as<PostfixExpression>().operand());

        case Expression::Kind::kPrefix:
            return this->visitExpressionPtr(e.template as<PrefixExpression>().operand());

        case Expression::Kind::kSwizzle: {
            auto& s = e.template as<Swizzle>();
            return s.base() && this->visitExpressionPtr(s.base());
        }

        case Expression::Kind::kTernary: {
            auto& t = e.template as<TernaryExpression>();
            return this->visitExpressionPtr(t.test()) ||
                   (t.ifTrue() && this->visitExpressionPtr(t.ifTrue())) ||
                   (t.ifFalse() && this->visitExpressionPtr(t.ifFalse()));
        }
        default:
            SkUNREACHABLE;
    }
}

template <typename T> bool TProgramVisitor<T>::visitStatement(typename T::Statement& s) {
    switch (s.kind()) {
        case Statement::Kind::kBreak:
        case Statement::Kind::kContinue:
        case Statement::Kind::kDiscard:
        case Statement::Kind::kNop:
            // Leaf statements just return false
            return false;

        case Statement::Kind::kBlock:
            for (auto& stmt : s.template as<Block>().children()) {
                if (stmt && this->visitStatementPtr(stmt)) {
                    return true;
                }
            }
            return false;

        case Statement::Kind::kSwitchCase: {
            auto& sc = s.template as<SwitchCase>();
            return this->visitStatementPtr(sc.statement());
        }
        case Statement::Kind::kDo: {
            auto& d = s.template as<DoStatement>();
            return this->visitExpressionPtr(d.test()) || this->visitStatementPtr(d.statement());
        }
        case Statement::Kind::kExpression:
            return this->visitExpressionPtr(s.template as<ExpressionStatement>().expression());

        case Statement::Kind::kFor: {
            auto& f = s.template as<ForStatement>();
            return (f.initializer() && this->visitStatementPtr(f.initializer())) ||
                   (f.test() && this->visitExpressionPtr(f.test())) ||
                   (f.next() && this->visitExpressionPtr(f.next())) ||
                   this->visitStatementPtr(f.statement());
        }
        case Statement::Kind::kIf: {
            auto& i = s.template as<IfStatement>();
            return (i.test() && this->visitExpressionPtr(i.test())) ||
                   (i.ifTrue() && this->visitStatementPtr(i.ifTrue())) ||
                   (i.ifFalse() && this->visitStatementPtr(i.ifFalse()));
        }
        case Statement::Kind::kReturn: {
            auto& r = s.template as<ReturnStatement>();
            return r.expression() && this->visitExpressionPtr(r.expression());
        }
        case Statement::Kind::kSwitch: {
            auto& sw = s.template as<SwitchStatement>();
            if (this->visitExpressionPtr(sw.value())) {
                return true;
            }
            for (auto& c : sw.cases()) {
                if (this->visitStatementPtr(c)) {
                    return true;
                }
            }
            return false;
        }
        case Statement::Kind::kVarDeclaration: {
            auto& v = s.template as<VarDeclaration>();
            return v.value() && this->visitExpressionPtr(v.value());
        }
        default:
            SkUNREACHABLE;
    }
}

template <typename T> bool TProgramVisitor<T>::visitProgramElement(typename T::ProgramElement& pe) {
    switch (pe.kind()) {
        case ProgramElement::Kind::kExtension:
        case ProgramElement::Kind::kFunctionPrototype:
        case ProgramElement::Kind::kInterfaceBlock:
        case ProgramElement::Kind::kModifiers:
        case ProgramElement::Kind::kStructDefinition:
            // Leaf program elements just return false by default
            return false;

        case ProgramElement::Kind::kFunction:
            return this->visitStatementPtr(pe.template as<FunctionDefinition>().body());

        case ProgramElement::Kind::kGlobalVar:
            return this->visitStatementPtr(pe.template as<GlobalVarDeclaration>().declaration());

        default:
            SkUNREACHABLE;
    }
}

template class TProgramVisitor<ProgramVisitorTypes>;
template class TProgramVisitor<ProgramWriterTypes>;

}  // namespace SkSL


text:
package mods.belgabor.bitdrawers.core;

import com.jaquadro.minecraft.chameleon.Chameleon;
import com.jaquadro.minecraft.chameleon.resources.ModelRegistry;
import com.jaquadro.minecraft.storagedrawers.client.renderer.TileEntityDrawersRenderer;
import mods.belgabor.bitdrawers.BitDrawers;
import mods.belgabor.bitdrawers.block.BlockBitController;
import mods.belgabor.bitdrawers.block.BlockBitDrawers;
import mods.belgabor.bitdrawers.block.tile.TileBitController;
import mods.belgabor.bitdrawers.block.tile.TileBitDrawers;
import mods.belgabor.bitdrawers.client.model.BitDrawerModel;
import mods.belgabor.bitdrawers.item.ItemBitController;
import mods.belgabor.bitdrawers.item.ItemBitDrawer;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

/**
 * Created by Belgabor on 18.07.2016.
 */
public class BlockRegistry {
    public static BlockBitDrawers bitDrawer;
    public static BlockBitController bitController;

    public void init() {
        bitDrawer = new BlockBitDrawers("bitdrawer");
        GameRegistry.register(bitDrawer);
        GameRegistry.register((new ItemBitDrawer(bitDrawer)).setRegistryName(bitDrawer.getRegistryName()));
        GameRegistry.registerTileEntity(TileBitDrawers.class, bitDrawer.getRegistryName().toString());
        bitController = new BlockBitController("bitcontroller");
        if (BitDrawers.config.enableBitController) {
            GameRegistry.register(bitController);
            GameRegistry.register((new ItemBitController(bitController)).setRegistryName(bitController.getRegistryName()));
            GameRegistry.registerTileEntity(TileBitController.class, bitController.getRegistryName().toString());
        }
    }

    @SideOnly(Side.CLIENT)
    public void initClient() {
        bitDrawer.initDynamic();
        ClientRegistry.bindTileEntitySpecialRenderer(TileBitDrawers.class, new TileEntityDrawersRenderer());
        ModelRegistry modelRegistry = Chameleon.instance.modelRegistry;

        modelRegistry.registerModel(new BitDrawerModel.Register());
        if (BitDrawers.config.enableBitController) {
            modelRegistry.registerItemVariants(bitController);
        }
    }
}


text:
#region Using Directives

using System.Reflection;
using System.Runtime.InteropServices;

#endregion

#region General Assembly Information

[assembly: AssemblyTitle("IocAbstractions Console Sample")]
[assembly: AssemblyDescription("A console application, which showcases the abilities of the IoC Abstractions framework.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IoC Abstractions")]
[assembly: AssemblyCopyright("Copyright © David Neumann & Lukas Rögner 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("4ab43f60-f2fd-43e4-b33c-3927d8ffa9f2")]

#endregion

#region Assembly Version Information

[assembly: AssemblyVersion("0.1.0.*")]
[assembly: AssemblyFileVersion("0.1.0.0")]

#endregion


text:
.toolbox-fetcher-overlay{
	background : grey ;
  display:-webkit-flex ;
  display: flex ;
}
.toolbox-fetcher-loader{
	width: 40px ;
	height: 40px ;
	background: grey;
	border : 2px solid white ;
	border-radius : 22px ;
	animation: circle 1s linear infinite ;
}
.toolbox-fetcher-loader-hand{
	width: 20px ;
	border : 1px solid white ;
	transform : translate(20px, 20px) ;
}
@keyframes circle {
	from { transform : rotate(0deg) ;}
	to {transform : rotate(360deg) ;}
}


text:
require "openid"
require "openid/store/filesystem"
require "openid/extensions/ax"
require "openid/extensions/pape"
require "attributes"
require "helpers"

class MojeID
  include MojeIDAttributes

  MOJEID_ENDPOINT = "https://mojeid.cz/endpoint/"
  MOJEID_ENDPOINT_TEST = "https://mojeid.fred.nic.cz/endpoint/"

  @test = false

  def initialize(options={:test => false})
    @test = options[:test]
  end

  class DiscoveryFailure < OpenID::DiscoveryFailure; end

  attr_accessor :return_to, :realm, :auth_request, :auth_response, :ax_request, :ax_response, :xrds_result

  def self.get_openid_store(filestore_path)
    OpenID::Store::Filesystem.new(filestore_path)
  end

  def self.get_consumer(session, store)
    OpenID::Consumer.new(session, store)
  end

  def fetch_request(consumer)
    identifier = @test ? MOJEID_ENDPOINT_TEST : MOJEID_ENDPOINT
    process_discovery(consumer, identifier)
    @ax_request = OpenID::AX::FetchRequest.new
    @auth_request
  end

  def fetch_response(consumer, params, request, current_url)
    process_response_by_type(:get, consumer, params, request, current_url)
    @auth_response
  end

  def store_request(consumer)
    identifier = @test ? MOJEID_ENDPOINT_TEST : MOJEID_ENDPOINT
    process_discovery(consumer, identifier)
    @ax_request = OpenID::AX::StoreRequest.new
  end

  def store_response(consumer, params, request, current_url)
    process_response_by_type(:put, consumer, params, request, current_url)
    @auth_response
  end

  # Add attributes you would like to read about user, to request.
  # You can pass attribute as array and change options like ns_alias or require.
  # * example: @moje_id.add_attributes(['http://axschema.org/namePerson', nil, false])
  # * or simple : @moje_id.add_attributes('http://axschema.org/namePerson')
  def add_attributes(attributes=[])
    attributes.each do |attribute|
      attribute.is_a?(Array) ? add_attribute(attribute[0], attribute[1], attribute[2]) : add_attribute(attribute)
    end
    pack_attributes_into_request
  end

  # Add attributes and they values which you would like to update user profile, to the request.
  # Accepts hash like { 'http://axschema.org/namePerson' => 'my new great name' }.
  def update_attributes(data={})
    data.each { |attribute, value| set_attribute(attribute, value) }
    pack_attributes_into_request
  end

  # returns the url you have to redirect after you compose your request
  def redirect_url(immediate=false)
    @auth_request.redirect_url(realm, return_to, immediate)
  end

  def response_status
    case @auth_response.status
    when OpenID::Consumer::FAILURE then return :failure
    when OpenID::Consumer::SUCCESS then return :success
    when OpenID::Consumer::SETUP_NEEDED then return :setup_needed
    when OpenID::Consumer::CANCEL then return :cancel
    else return :unknown
    end
  end

  # Return data parsed to a Hash.
  def data
    @ax_response.data rescue {}
  end

  private

  def process_discovery(consumer, identifier)
    begin
      @auth_request = consumer.begin(identifier)
    rescue OpenID::DiscoveryFailure => f
      raise DiscoveryFailure.new(f.message, f.http_response)
    end
    @xrds_result = OpenID::Yadis::DiscoveryResult.new(@return_to)
  end

  def process_response_by_type(type, consumer, params, request, current_url)
    @auth_response = consumer.complete(params.reject { |k, v| request.path_parameters.key?(k.to_sym) }, current_url)
    if @auth_response.status == OpenID::Consumer::SUCCESS
      if type == :get
        @ax_response = OpenID::AX::FetchResponse.from_success_response(@auth_response)
      elsif type == :put
        @ax_response = OpenID::AX::StoreResponse.from_success_response(@auth_response)
      end
    end
  end

  # Check if the attribute is available. You can find full list of attributes in lib/attributes.rb
  def self.is_attribute_available?(attribute)
    MojeIDAttributes::AVAILABLE_ATTRIBUTES.include?(attribute) ? true : raise("'#{attribute}' is not available")
  end

  def add_attribute(attribute, ns_alias=nil, required=false)
    if MojeID.is_attribute_available?(attribute)
      @ax_request.add(OpenID::AX::AttrInfo.new(attribute, ns_alias, required))
    end
  end

  # Pack attributes and theirs values to request when you would like to store attribute.
  def set_attribute(attribute, value)
    if is_attribute_available?(attribute)
      fetch_request.set_values(attribute, value)
    end
  end

  def pack_attributes_into_request
    @auth_request.add_extension(@ax_request)
  end

end


text:
using System;
using System.Collections.Generic;

namespace FairyGUI
{
	/// <summary>
	///
	/// </summary>
	public class TreeNode
	{
		/// <summary>
		///
		/// </summary>
		public object data;

		/// <summary>
		///
		/// </summary>
		public TreeNode parent { get; private set; }

		/// <summary>
		///
		/// </summary>
		public TreeView tree { get; private set; }

		/// <summary>
		///
		/// </summary>
		public GComponent cell { get; internal set; }

		/// <summary>
		///
		/// </summary>
		public int level { get; private set; }

		private List<TreeNode> _children;
		private bool _expanded;

		/// <summary>
		///
		/// </summary>
		/// <param name="hasChild"></param>
		public TreeNode(bool hasChild)
		{
			if (hasChild)
				_children = new List<TreeNode>();
		}

		/// <summary>
		///
		/// </summary>
		public bool expanded
		{
			get
			{
				return _expanded;
			}

			set
			{
				if (_children == null)
					return;

				if (_expanded != value)
				{
					_expanded = value;
					if (tree != null)
					{
						if (_expanded)
							tree.AfterExpanded(this);
						else
							tree.AfterCollapsed(this);
					}
				}
			}
		}

		/// <summary>
		///
		/// </summary>
		public bool isFolder
		{
			get { return _children != null; }
		}

		/// <summary>
		///
		/// </summary>
		public string text
		{
			get
			{
				if (cell != null)
					return cell.text;
				else
					return null;
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child"></param>
		/// <returns></returns>
		public TreeNode AddChild(TreeNode child)
		{
			AddChildAt(child, _children.Count);
			return child;
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child"></param>
		/// <param name="index"></param>
		/// <returns></returns>
		public TreeNode AddChildAt(TreeNode child, int index)
		{
			if (child == null)
				throw new Exception("child is null");

			int numChildren = _children.Count;

			if (index >= 0 && index <= numChildren)
			{
				if (child.parent == this)
				{
					SetChildIndex(child, index);
				}
				else
				{
					if (child.parent != null)
						child.parent.RemoveChild(child);

					int cnt = _children.Count;
					if (index == cnt)
						_children.Add(child);
					else
						_children.Insert(index, child);

					child.parent = this;
					child.level = this.level + 1;
					child.SetTree(this.tree);
					if (this.cell != null && this.cell.parent != null && _expanded)
						tree.AfterInserted(child);
				}

				return child;
			}
			else
			{
				throw new Exception("Invalid child index");
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child"></param>
		/// <returns></returns>
		public TreeNode RemoveChild(TreeNode child)
		{
			int childIndex = _children.IndexOf(child);
			if (childIndex != -1)
			{
				RemoveChildAt(childIndex);
			}
			return child;
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="index"></param>
		/// <returns></returns>
		public TreeNode RemoveChildAt(int index)
		{
			if (index >= 0 && index < numChildren)
			{
				TreeNode child = _children[index];
				_children.RemoveAt(index);

				child.parent = null;
				if (tree != null)
				{
					child.SetTree(null);
					tree.AfterRemoved(child);
				}

				return child;
			}
			else
			{
				throw new Exception("Invalid child index");
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="beginIndex"></param>
		/// <param name="endIndex"></param>
		public void RemoveChildren(int beginIndex = 0, int endIndex = -1)
		{
			if (endIndex < 0 || endIndex >= numChildren)
				endIndex = numChildren - 1;

			for (int i = beginIndex; i <= endIndex; ++i)
				RemoveChildAt(beginIndex);
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="index"></param>
		/// <returns></returns>
		public TreeNode GetChildAt(int index)
		{
			if (index >= 0 && index < numChildren)
				return _children[index];
			else
				throw new Exception("Invalid child index");
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child"></param>
		/// <returns></returns>
		public int GetChildIndex(TreeNode child)
		{
			return _children.IndexOf(child);
		}

		/// <summary>
		///
		/// </summary>
		/// <returns></returns>
		public TreeNode GetPrevSibling()
		{
			if (parent == null)
				return null;

			int i = parent._children.IndexOf(this);
			if (i <= 0)
				return null;

			return parent._children[i - 1];
		}

		/// <summary>
		///
		/// </summary>
		/// <returns></returns>
		public TreeNode GetNextSibling()
		{
			if (parent == null)
				return null;

			int i = parent._children.IndexOf(this);
			if (i < 0 || i >= parent._children.Count - 1)
				return null;

			return parent._children[i + 1];
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child"></param>
		/// <param name="index"></param>
		public void SetChildIndex(TreeNode child, int index)
		{
			int oldIndex = _children.IndexOf(child);
			if (oldIndex == -1)
				throw new Exception("Not a child of this container");

			int cnt = _children.Count;
			if (index < 0)
				index = 0;
			else if (index > cnt)
				index = cnt;

			if (oldIndex == index)
				return;

			_children.RemoveAt(oldIndex);
			_children.Insert(index, child);
			if (this.cell != null && this.cell.parent != null && _expanded)
				tree.AfterMoved(child);
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="child1"></param>
		/// <param name="child2"></param>
		public void SwapChildren(TreeNode child1, TreeNode child2)
		{
			int index1 = _children.IndexOf(child1);
			int index2 = _children.IndexOf(child2);
			if (index1 == -1 || index2 == -1)
				throw new Exception("Not a child of this container");
			SwapChildrenAt(index1, index2);
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="index1"></param>
		/// <param name="index2"></param>
		public void SwapChildrenAt(int index1, int index2)
		{
			TreeNode child1 = _children[index1];
			TreeNode child2 = _children[index2];

			SetChildIndex(child1, index2);
			SetChildIndex(child2, index1);
		}

		/// <summary>
		///
		/// </summary>
		public int numChildren
		{
			get { return (null == _children) ? 0 : _children.Count; }
		}

		internal void SetTree(TreeView value)
		{
			tree = value;
			if (tree != null && tree.treeNodeWillExpand != null && _expanded)
				tree.treeNodeWillExpand(this, true);

			if (_children != null)
			{
				int cnt = _children.Count;
				for (int i = 0; i < cnt; i++)
				{
					TreeNode node = _children[i];
					node.level = level + 1;
					node.SetTree(value);
				}
			}
		}
	}
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
	value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var RsvpCard = function (_Component) {
	_inherits(RsvpCard, _Component);

	function RsvpCard(props) {
		_classCallCheck(this, RsvpCard);

		var _this = _possibleConstructorReturn(this, (RsvpCard.__proto__ || Object.getPrototypeOf(RsvpCard)).call(this, props));

		var state = {};
		_this.props.fields.map(function (field, index) {
			state[field.name + '-' + _this.props.index] = '';
		});
		_this.state = state;
		return _this;
	}

	_createClass(RsvpCard, [{
		key: 'getSelectOptions',
		value: function getSelectOptions(field, parentIndex) {
			return field.options.map(function (option, index) {
				return _react2.default.createElement(
					'option',
					{ key: 'select-option-' + parentIndex + '-' + index, value: option.value },
					option.label
				);
			});
		}
	}, {
		key: 'getFields',
		value: function getFields() {
			var _this2 = this;

			return this.props.fields.map(function (field, index) {
				if (field.type == 'text') {
					return _react2.default.createElement(
						'div',
						{ key: "rsvp-" + index },
						_react2.default.createElement(
							'label',
							{ className: 'rsvp-cards--label', htmlFor: field.name },
							field.label
						),
						_react2.default.createElement('input', {
							name: field.name + '-' + _this2.props.index,
							type: field.type,
							className: 'rsvp-cards--textbox',
							onChange: _this2.props.onChange
						})
					);
				} else {
					return _react2.default.createElement(
						'div',
						{ key: "rsvp-" + index },
						_react2.default.createElement(
							'label',
							{ className: 'rsvp-cards--label', htmlFor: field.name },
							field.label
						),
						_react2.default.createElement(
							'select',
							{
								name: field.name + '-' + _this2.props.index,
								onChange: _this2.props.onChange,
								className: 'rsvp-cards--select',
								value: _this2.state[field.name + '-' + _this2.props.index].value
							},
							_react2.default.createElement('option', null),
							_this2.getSelectOptions(field, index)
						)
					);
				}
			});
		}
	}, {
		key: 'render',
		value: function render() {
			return _react2.default.createElement(
				'div',
				{ className: 'rsvp-cards--item', key: 'render-cards-item-' + this.props.index },
				this.getFields()
			);
		}
	}]);

	return RsvpCard;
}(_react.Component);

exports.default = RsvpCard;


text:
import { Component } from '@angular/core';
import { Title } from '@angular/platform-browser';
/**
 * Admin role component
 * Created by maxu0 on 2017/6/13.
 */
@Component({
  template: `<router-outlet></router-outlet>`
})
export class RoleComponent {

  constructor(private pageTitle: Title) {
    this.pageTitle.setTitle(`Admin-role`);
  }

}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.identitylink.service.impl.persistence.entity.data.impl.cachematcher;

import java.util.Map;

import org.flowable.common.engine.impl.persistence.cache.CachedEntityMatcherAdapter;
import org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntity;

/**
 * @author Tijs Rademakers
 */
public class IdentityLinksByScopeIdAndTypeMatcher extends CachedEntityMatcherAdapter<IdentityLinkEntity> {

    @Override
    public boolean isRetained(IdentityLinkEntity entity, Object parameter) {
        @SuppressWarnings("unchecked")
        Map<String, String> parameterMap = (Map<String, String>) parameter;
        return entity.getScopeId() != null && entity.getScopeId().equals(parameterMap.get("scopeId")) &&
                        entity.getScopeType() != null && entity.getScopeType().equals(parameterMap.get("scopeType"));
    }

}


text:
$(function() {

    /*
        Default popup
    */

    $('.open-in-modal').on('click', function(e) {
        e.preventDefault();

        var anchor = $(this).attr('href');
        var title = $(this).data('title');

        $('#modal .modal-title-container .modal-title').html(title);

        $('#modal').modal().open({
            onOpen: function(el, options){
                $.get(anchor, function(response){
                    $('#modal .modal-content-container').html(response);

                    $('.modal-content-container .open-in-modal').on('click', function(e) {
                        e.preventDefault();
                        var anchor = $(this).attr('href');

                        $.get(anchor, function(response){
                            $('#modal .modal-content-container').html(response);
                        });
                    });
                });
            }
        });
    });

    /*
        Success popup
    */

    $('.success-popup').on('click', function(e) {
        //console.log('Словили');
        e.preventDefault();
        $('#success-popup').modal().open();
    });

    /*
        Google maps popup
    */

    $('.open-in-modal.gmap').on('click', function(e) {
        e.preventDefault();

        var anchor = $(this).attr('href');
        var title = $(this).data('title');

        $('#modal .modal-content-container').empty();

        $('#modal .modal-title-container .modal-title').html(title);
        $('#modal').css('width', '766px');

        $('#modal').modal().open({
            onOpen: function(el, options){
                $.get(anchor, function(response){
                    $('#modal .modal-content-container').html(response);

                    var script = document.createElement("script");
                    script.type = "text/javascript";
                    script.src = "https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=showMapsStep1";
                    document.body.appendChild(script);

                    $('#modal .modal-close').click(function(e) {
                        e.preventDefault();
                        $.modal().close();
                        $('#modal .modal-content-container').empty();
                    });
                });
            }
        });
    });

    /*
        Modal close button
    */

    $('#modal .modal-close').on('click', function(e){
        e.preventDefault();
        $.modal().close();
        $('#modal .modal-content-container').empty();
    });

    $('#success-popup .modal-close').on('click', function(e){
        e.preventDefault();
        $.modal().close();
        $('#success-popup .success-popup-content h1').empty();
        $('#success-popup .success-popup-content p').empty();
    });

    /*
        Dropdown menu
    */

    $('.dropdown-toggle').dropdown();

    /*
        Prettify selects
    */
	if ($.fn.chosen) {
		$('select.pretty').chosen({
			disable_search: true,
			inherit_select_classes: true
		}).on('change', function(){
			var box = $(this).data('chosen').container || $(this);
			box[$(this).val() ? 'addClass' : 'removeClass']('selected');
		});
	}

    showMessagesQueue();

});

function initMyCandidates() {
    function hideVisitDateInners() {
        $('.dates-col .dates-inner').hide();
    }

    function hideCandidates() {
        $('.candidates-col .candidates-inner').hide();
        $('.date-item').removeClass('active');
    }

    hideVisitDateInners();
    $('.property-item').click(function () {
        hideVisitDateInners();
        $('.property-item').removeClass('active');

        $('.dates-col .dates-inner[data-property-id="' + $(this).attr('data-property-id') + '"]').show();
        $(this).addClass('active');

        var count = $('.dates-col .dates-inner[data-property-id="' + $(this).attr('data-property-id') + '"]').find('.c_candidate_block.date-item').length - 2;

        if (count == 0) {
            $('span#visit-dates-title').hide();
        } else {
            $('span#visit-dates-title').show();
        }

        $('div#p'+$(this).attr('data-property-id')+'-wating-candidates-item').click();
    });

    hideCandidates();
    $('.date-item').click(function () {
        hideCandidates();
        $('.candidates-col .candidates-inner[data-candidates-for="' + $(this).attr('id') + '"]').show();

        if ($('.candidates-col .candidates-inner[data-candidates-for="' + $(this).attr('id') + '"]').find('div.attente-block').length == 0) {
            $('#no-candidates').show();
        } else {
            $('#no-candidates').hide();
        }
        if ($(this).hasClass('inactive')) return false;
        $(this).addClass('active');
    });

    $('.date-item').each(function() {
        if (typeof $(this).attr('data-visit-date-id') != 'undefined') {
            if ($('.candidates-col .candidates-inner[data-candidates-for="' + $(this).attr('id') + '"]').find('div.attente-block').length == 0) {
                $(this).addClass('inactive');
            }
        }
    });

    $('div.property-item.c_annonce_block.active').click();
}

var messagesQueue = new Array();

function showMessagesQueue() {
    if (messagesQueue.length == 0) return;
    for (var i=0; i<messagesQueue.length; i++) {
        if (messagesQueue[i].showed === false) {
            messagesQueue[i].showed = true;
            showSuccessMessage(messagesQueue[i].title, messagesQueue[i].body);
            return ;
        }
    }
}

function addToMessagesQueue(title, body) {
    messagesQueue[messagesQueue.length] = {'title': title, 'body': body, 'showed': false};
}

function showSuccessMessage(title, body) {
    var $contentContaigner = $('#success-popup .success-popup-content');
    $contentContaigner.find('h1').text(title);
    $contentContaigner.find('p').text(body);

    $('#success-popup').modal().open({
        onClose: function(el, options){
            showMessagesQueue();
        }
    });
}


text:
<!doctype html>

	<meta charset="utf-8">
	<title>TESTING APPLICATION title HOLDER</title>

Seung Eun Narm/h1>

Surprize App

The purpose of this application is to create a surprize text, picture, or video which someone can unlock if they 1) have the password or 2) the timer (countdown) reaches zero.

Project Idea

Timer (Countdown)/li>

Password

...


text:
<?php

namespace App\Repositories;

use App\Models\Interaction;
use App\Models\User;
use App\Repositories\Traits\ByCurrentUser;
use Illuminate\Support\Collection;

class InteractionRepository extends Repository
{
    use ByCurrentUser;

    /** @return Collection|array<Interaction> */
    public function getUserFavorites(User $user): Collection
    {
        return $this->model
            ->newQuery()
            ->where([
                'user_id' => $user->id,
                'liked' => true,
            ])
            ->with('song')
            ->pluck('song');
    }

    /** @return array<Interaction> */
    public function getRecentlyPlayed(User $user, ?int $count = null): array
    {
        $query = $this->model
            ->newQuery()
            ->where('user_id', $user->id)
            ->where('play_count', '>', 0)
            ->latest('updated_at');

        if ($count) {
            $query = $query->take($count);
        }

        return $query->pluck('song_id')->all();
    }
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0017_auto_20170127_1535'),
    ]

    operations = [
        migrations.AlterField(
            model_name='project',
            name='themes',
            field=models.ManyToManyField(to='projects.Theme', verbose_name='Th\xe9matiques'),
        ),
    ]


text:
Imports System.Runtime.InteropServices

<ComVisible(True), ClassInterface(ClassInterfaceType.AutoDual)> _
Public Class SuperCalcEngine

    Public Function MultiplyThem(v1 As Double, v2 As Double) As Double
        Return v1 * v2
    End Function

    Public ReadOnly Property Version As String
        Get
            Return "SuperCalcEngine Version 0.1"
        End Get
    End Property
End Class


text:
import test from 'ava';

import { makeTitleFunc, TestType, ProductEpic, RepoPackage, } from '../testing';
import { testArgumentError, } from '../testing/argument-error-helpers';

import ArgumentZeroError from '../src/argument-zero-error';

////////////////////////////////////////////////////////////////////////////////////////////////////
const title = makeTitleFunc(
  ProductEpic.Util,
  RepoPackage.Util,
  'ArgumentZeroError');
////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////
// constructor_name_message

//////////////
// Smoke tests

test(
  title(
    TestType.Smoke,
    'constructor_name_message',
    'name-specified'),
  async t => {
  await Promise.resolve();

  t.plan(2);
  testArgumentError({
    classConstructor: ArgumentZeroError,
    defaultMessage: 'Argument must have a truthy value. Yours is \'zero\'',
    errorMessage: undefined,
    parameterName: 'Name',
    test: t,
  });
});

//////////////
// Unit tests

test(
  title(
    TestType.Unit,
    'constructor_name_message',
    'all-specified'),
  async t => {
  await Promise.resolve();

  t.plan(2);
  testArgumentError({
    classConstructor: ArgumentZeroError,
    defaultMessage: undefined,
    errorMessage: 'Message',
    parameterName: 'Name',
    test: t,
  });
});

test(
  title(
    TestType.Unit,
    'constructor_name_message',
    'message-specified'),
  async t => {
  await Promise.resolve();

  t.plan(2);
  testArgumentError({
    classConstructor: ArgumentZeroError,
    defaultMessage: undefined,
    errorMessage: 'Message',
    parameterName: undefined,
    test: t,
  });
});

test(
  title(
    TestType.Unit,
    'constructor_name_message',
    'none-specified'),
  async t => {
  await Promise.resolve();

  t.plan(2);
  testArgumentError({
    classConstructor: ArgumentZeroError,
    defaultMessage: 'Argument must have a truthy value. Yours is \'zero\'',
    errorMessage: undefined,
    parameterName: undefined,
    test: t,
  });
});


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- WARNING: THIS FILE WILL BE OVERWRITTEN AT BUILD TIME-->
<resources>
    <string name="godot_project_name_string">godot-project-name-de</string>
</resources>


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
 "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://pcwin1036.campus.tue.nl/CaaDB</property>
        <property name="connection.username">root</property>
        <property name="connection.password">l0zink@</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">update</property>

        <!-- Mapping entities -->
        <mapping class="ooti.caa.model.University" />
        <mapping class="ooti.caa.model.Faculty" />
        <mapping class="ooti.caa.model.StudyProgram" />
        <mapping class="ooti.caa.model.Course" />
        <mapping class="ooti.caa.model.Advice" />
        <mapping class="ooti.caa.model.Student" />
        <mapping class="ooti.caa.model.Evaluation" />
    </session-factory>
</hibernate-configuration>