text:
/*
 * BoostLog creates a thread for writing log messages without delaying the main process.
 * If you need to use the Boost thread library as a DLL for compatibility with the .NET CLR
 * you must define BOOST_THREAD_USE_DLL before including BoostLog.h
 */

#pragma once

#ifndef BoostLog_H_
#define BoostLog_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>

#include <boost/thread.hpp>

#include "SyncQueue.h"

enum LogLevel {
   LOG_TRACE = 0,
   LOG_INFO,
   LOG_WARNING,
   LOG_ERROR,
   LOG_FATAL,
   LOG_ALWAYS,  // special level to force output to the log
};

const char LOG_FIELD_SEPARATOR[] = ",";

LogLevel stringToEnum(std::string levelStr);

class CBoostLog {
public:

   // Write a log message to the static logger instance
   // Defaults to an INFO-level message.
   static void log(/* LogLevel msgLevel = INFO, */ const std::string& msg);

   // Write a log message to the static logger instance
   static void log(LogLevel msgLevel, const std::string& msg);

   // Dump a data buffer to the static logger instance
   // Defaults to a TRACE-level message.
   static void logDump(/* LogLevel msgLevel = TRACE, */ const std::string& prefix,
                       const std::vector<uint8_t>& data);

   static void logDump(LogLevel msgLevel, const std::string& prefix,
                       const std::vector<uint8_t>& data, int startIndex = 0, int length = -1);

   static CBoostLog& getInstance();

   // Constructor takes no parameters to make handling the static instance easier
   CBoostLog();
   // Destructor stops the logging thread and closes the log file
   ~CBoostLog();

   // openLog() should be called to initialize the logger before writing any
   // log messages. openLog causes the log files to be rotated, opened and
   // the logging thread started.
   void openLog(const std::string& logfile, int numBackups, int maxLogSize,
                LogLevel outLevel = LOG_INFO);

   // The start() and stop() method allow control of the logging thread.
   // Generally, you shouldn't need to call these methods unless you need
   // to interactively start and stop log output.

   void start();

   void stop();

   // Write a message with the specified log level
   void logMsg(LogLevel msgLevel, const std::string& msg);

private:
   // Returns: whether the rotate operation succeeded
   bool rotateLogs();
   void openFile(std::ios_base::openmode = std::ios_base::out);

   void logFromQueue(); // log thread

   void writeMsg(const std::string& msg);

   int            m_logLevel;
   int            m_numBackups;
   int            m_maxLogSize;
   std::string    m_filename;
   std::ofstream* m_log;
   boost::mutex   m_lock;

   bool           m_isRunning;
   boost::thread* m_logger;
   CSyncQueue<std::string> m_msgQueue;
};

#endif /* ! BoostLog_H_ */


text:
<?php

namespace PlaygroundDesign\Options;

use Laminas\Stdlib\AbstractOptions;

class ModuleOptions extends AbstractOptions
{
    /**
     * @var string
     */
    protected $actionEntityClass = 'PlaygroundDesign\Entity\Theme';

    /**
     * @var bool
     */
    protected $enableDefaultEntities = true;

    /**
     * Turn off strict options mode
     */
    protected $__strictMode__ = false;

    /**
     * drive path to game media files
     */
    protected $media_path = 'public/media/design';

    /**
     * url path to game media files
     */
    protected $media_url = 'media/design';

    /**
     * @var string
     */
    protected $companyEntityClass = 'PlaygroundDesign\Entity\Company';

    /**
     * Set page entity class name
     *
     * @param $pageEntityClass
     * @return ModuleOptions
     */
    public function setCompanyEntityClass($companyEntityClass)
    {
        $this->companyEntityClass = $companyeEntityClass;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getCompanyEntityClass()
    {
        return $this->companyEntityClass;
    }

    /*
     * @return \PlaygroundDesign\Options\ModuleOptions
     */
    public function setMediaPath($media_path)
    {
        $this->media_path = $media_path;

        return $this;
    }

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

    /**
     *
     * @param  string $media_url
     * @return \PlaygroundDesign\Options\ModuleOptions
     */
    public function setMediaUrl($media_url)
    {
        $this->media_url = $media_url;

        return $this;
    }

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

redpajama_set_name: RedPajamaGithub


text:
#ifndef SkUnitMapper_DEFINED
#define SkUnitMapper_DEFINED

#include "SkRefCnt.h"
#include "SkScalar.h"

#include "SkFlattenable.h"

class SkUnitMapper : public SkFlattenable {
public:
    SkUnitMapper() {}

    /** Given a value in [0..0xFFFF], return a value in the same range.
    */
    virtual uint16_t mapUnit16(uint16_t x) = 0;

protected:
    SkUnitMapper(SkFlattenableReadBuffer& rb) : SkFlattenable(rb) {}
};

#endif


text:
<?php

namespace Phlexible\Bundle\MediaManagerBundle\Command;

use Phlexible\Component\MediaManager\AttributeReader\AttributeBag;
use Phlexible\Component\MediaManager\Volume\ExtendedFileInterface;
use Phlexible\Component\MediaManager\Volume\ExtendedFileVersionInterface;
use Phlexible\Component\MediaManager\Volume\ExtendedFolderInterface;
use Phlexible\Component\MediaManager\Volume\ExtendedVolumeInterface;
use Phlexible\Component\Mime\MimeDetector;
use Phlexible\Component\Volume\FileSource\FilesystemFileSource;
use Phlexible\Component\Volume\Model\FolderIterator;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\File\File;

/**
 * Read command.
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class ReadCommand extends ContainerAwareCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('media-manager:read')
            ->addOption('volume', null, InputOption::VALUE_REQUIRED, 'Volume ID')
            ->addOption('folder', null, InputOption::VALUE_REQUIRED, 'Folder ID')
            ->addOption('file', null, InputOption::VALUE_REQUIRED, 'File ID')
            ->setDescription('Re-read all metadata');
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $volumeId = $input->getOption('volume');
        $folderId = $input->getOption('folder');
        $fileId = $input->getOption('file');

        $volumeManager = $this->getContainer()->get('phlexible_media_manager.volume_manager');

        if ($volumeId) {
            $volume = $volumeManager->get($volumeId);

            $this->readVolume($output, $volume);
        } elseif ($folderId) {
            $volume = $volumeManager->getByFolderId($folderId);
            $folder = $volume->findFolder($folderId);

            $this->readVolume($output, $volume, $folder);
        } elseif ($fileId) {
            $volume = $volumeManager->getByFileId($fileId);
            $file = $volume->findFile($fileId);

            $this->readFile($output, $volume, $file);

            $fileVersions = $volume->findFileVersions($fileId);

            foreach ($fileVersions as $fileVersion) {
                $this->readFileVersion($output, $volume, $fileVersion);
            }
        } else {
            foreach ($volumeManager->all() as $volume) {
                $this->readVolume($output, $volume);
            }
        }

        return 0;
    }

    private function readVolume(OutputInterface $output, ExtendedVolumeInterface $volume, ExtendedFolderInterface $folder = null)
    {
        $target = $volume;
        if (!$folder) {
            $folder = $volume->findRootFolder();
            $target = $folder;
        }

        $rii = new \RecursiveIteratorIterator(new FolderIterator($target), \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($rii as $folder) {
            $output->writeln('+ '.$folder->getName());
            foreach ($volume->findFilesByFolder($folder) as $file) {
                $this->readFile($output, $volume, $file);
            }
        }
    }

    private function readFile(OutputInterface $output, ExtendedVolumeInterface $volume, ExtendedFileInterface $file)
    {
        $output->writeln('  * '.$file->getId().' v'.$file->getVersion().' '.$file->getPhysicalPath().': ');
        $output->write('    > ');

        $mediaTypeManager = $this->getContainer()->get('phlexible_media_type.media_type_manager');
        $attributeReader = $this->getContainer()->get('phlexible_media_manager.attribute_reader');

        if (!file_exists($file->getPhysicalPath())) {
            $output->writeln('<error>File not found</error>');

            return;
        }

        $mimetype = (new File($file->getPhysicalPath()))->getMimeType();

        if (!$mimetype) {
            $output->write('<error>No mimetype</error> ');
            $mimetype = 'application/octet-stream';
            $mediaTypeName = 'binary';
        } else {
            $mediaType = $mediaTypeManager->findByMimetype($mimetype);
            if ($mediaType) {
                $mediaTypeName = $mediaType->getName();

                $fileSource = new FilesystemFileSource($file->getPhysicalPath(), $mimetype, filesize($file->getPhysicalPath()));
                if ($attributeReader->supports($fileSource, $mediaType)) {
                    $attributeBag = new AttributeBag($file->getAttributes());
                    $attributeReader->read($fileSource, $mediaType, $attributeBag);
                    $attributes = $file->getAttributes();
                    $attributes['fileattributes'] = $attributeBag->all();
                    $volume->setFileAttributes($file, $attributes, null);
                }
            } else {
                $output->write('<error>No media type found</error> ');
                $mediaTypeName = 'binary';
            }
        }

        $volume->setFileMediaType($file, $mediaTypeName, null);
        $volume->setFileMimetype($file, $mimetype, null);

        $output->writeln("$mimetype, $mediaTypeName, ".(isset($attributes) ? json_encode($attributes) : "No attributes"));
    }

    private function readFileVersion(OutputInterface $output, ExtendedVolumeInterface $volume, ExtendedFileVersionInterface $fileVersion)
    {
        $output->writeln('  * '.$fileVersion->getFileId().' v'.$fileVersion->getVersion().' '.$fileVersion->getPhysicalPath().': ');
        $output->write('    > ');

        $mimeDetector = $this->getContainer()->get('phlexible_media_tool.mime.detector');
        $mediaTypeManager = $this->getContainer()->get('phlexible_media_type.media_type_manager');
        $attributeReader = $this->getContainer()->get('phlexible_media_manager.attribute_reader');

        if (!file_exists($fileVersion->getPhysicalPath())) {
            $output->writeln('<error>File not found</error>');

            return;
        }

        $mimetype = $mimeDetector->detect($fileVersion->getPhysicalPath(), MimeDetector::RETURN_STRING);

        if (!$mimetype) {
            $mimetype = (new File($fileVersion->getPhysicalPath()))->getMimeType();
        }

        if (!$mimetype) {
            $output->write('<error>No mimetype</error> ');
            $mimetype = 'application/octet-stream';
            $mediaTypeName = 'binary';
        } else {
            $mediaType = $mediaTypeManager->findByMimetype($mimetype);
            if ($mediaType) {
                $mediaTypeName = $mediaType->getName();

                $fileSource = new FilesystemFileSource($fileVersion->getPhysicalPath(), $mimetype, filesize($fileVersion->getPhysicalPath()));
                if ($attributeReader->supports($fileSource, $mediaType)) {
                    $attributeBag = new AttributeBag($fileVersion->getAttributes());
                    $attributeReader->read($fileSource, $mediaType, $attributeBag);
                    $attributes = $fileVersion->getAttributes();
                    $attributes['fileattributes'] = $attributeBag->all();
                    $volume->setFileVersionAttributes($fileVersion, $attributes, null);
                }
            } else {
                $output->write('<error>No media type found</error> ');
                $mediaTypeName = 'binary';
            }
        }

        $volume->setFileVersionMediaType($fileVersion, $mediaTypeName, null);
        //$volume->setFileMimetype($file, $mimetype, null);

        $output->writeln("$mimetype, $mediaTypeName, ".(isset($attributes) ? json_encode($attributes) : "No attributes"));
    }
}


text:
The following items require short answers.

1. What is a variable and what is a type?
2. What is a statement and name 3 types of statements.
3. What is a function?
4. What is a function parameter and return type?

## Xcode

1. Which new project template do you always use? (screenshot required)
2. What is an outlet?
3. What is an action?
4. When there is an error, where does it print out? (screenshot required)
5. Print something to the console. (screenshot required)
6. Generate a key value coding compliant crash. 3 points (screenshot required)
7. What tab do you click on to fix broken connections (outlets/actions)? (screenshot required)
8. What tab do you click on to modify properties? (screenshot required)
9. What tab do you click on to associate a view controller with a Swift file? (screenshot required)
10. What tab do you click on to disable Auto Layout? (screenshot required)
11. Where do you go to rearrange the z order of subviews? Demo by adding a few subviews to a view controller. 2 points (screenshot required)
12. How do you embed a view controller into a navigation controller? (screenshot required)
13. How do you connect a view controller in a tab bar controller? (screenshot required)
14. How do you configure the icon and title of a tab bar item? (screenshot required)
15. Should a navigation controller contain a tab bar controller or should a tab bar controller contain several navigation controllers?

## iOS

1. Name 3 types of navigation in iOS.
2. Name 3 additional types of navigation that you've seen in the App Store.
3. When would you use a modal vs push navigation?
4. Would going to a detail view be a modal or push navigation?
5. Would logging in by a modal or push navigation?
6. Name 4 types of animations that you need as a designer (e.g., the ability to scale a view).


text:
<?php
// This file was auto-generated from sdk-root/src/data/cognito-idp/2016-04-18/paginators-1.json
return [ 'pagination' => [],];


text:
Tool to include a basic cms which can create pages hierarchy with "n" associated contents for each one. The content type included are:

* Text
* Text and image
* Image
* Gallery
* List
* Table
* Html
* Form
* File
* File list

## Requirements and installation

It requires:

* Django == 1.11
* PIL
* mptt
* tinymce
* suit
* filer

You can try it without django suit but it is highly recommendable. To install simply use

	pip install git+https://github.com/eliasfernandez/django-simplecms

...

## Configuration

### settings.py

Context processor must be loaded in a required order for cms to work. `cms` depends on `mptt`, `suit` depends on `cms` and `django.contrib.admin` relies on `suit`. A working order could be like this:

    INSTALLED_APPS = [
        ...
        'easy_thumbnails',
        'mptt',
        'cms',
        'suit',
        'filer',
        'django.contrib.admin',
        'web',
        ...
        ]

#### Template context processor

On the last line just add `cms.context_processors.page.processor` it will be the responsible of the hierarchy between the different elements.

    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    ...
                    'cms.context_processors.page.processor',
                ],
            },
        },
    ]

#### Other variables

`settings.HOME_SLUG` will be used as a proxy for the first page on the pagetree.

### urls.py
Just add a line including the cms urls module.

    urlpatterns = [
        ...
        url(r'^', include('cms.urls')),
    ]

## Initial data

For the structure to be created just migrate the cms app to the database structure:

    $: python manage.py migrate cms

Since that moment, you can start creating cms contents.

Enjoy and give me some feedback


text:
package raft

import (
	"log"
	"math/rand"
	"time"
)

type Role int

const (
	Follower Role = iota + 1
	Candidate
	Leader
)

//RaftServer :
type RaftServer struct {
	//Persistent state on all servers
	currentTerm int
	voteFor     int
	log         []int

	//Validate state for all servers
	commitIndex int
	lastApplied int

	//Leader state will reinit on election.
	nextIndex  []int
	matchIndex []int

	//Basic Server state
	id          int
	expiredTime int //Hearbit expired time (by millisecond.)
	role        Role
	nt          nodeNetwork
	msgRecvTime time.Time //Message receive time
	nodeList    []int     //id list exist in this network.
	term        int       //term about current time seq
	db          submittedItems

	isAlive bool //To determine if server still alive, for kill testing.

	//For candidator
	HasVoted      bool //To record if already vote others.
	acceptVoteMsg []Message
}

//NewServer :New a server and given a random expired time.
func NewServer(id int, role Role, nt nodeNetwork, nodeList ...int) *RaftServer {
	rand.Seed(time.Now().UnixNano())
	expiredMiliSec := rand.Intn(5) + 1
	serv := &RaftServer{id: id,
		role:        role,
		nt:          nt,
		expiredTime: expiredMiliSec,
		isAlive:     true,
		nodeList:    nodeList,
		db:          submittedItems{}}
	go serv.runServerLoop()
	return serv
}

//AssignAction : Assign a assign to any of server.
func (sev *RaftServer) AppendEntries(action datalog) {
	//TODO. Add action into logs and leader will announce to all other servers.
	switch sev.role {
	case Leader:
		//Apply to all followers
	case Candidate:
		//TBC.
	case Follower:
		//Run election to leader
		sev.requestVote(action)
	}
}

//Whoareyou :Check rule function for testing verification.
func (sev *RaftServer) Whoareyou() Role {
	return sev.role
}

func (sev *RaftServer) runServerLoop() {

	for {
		switch sev.role {
		case Leader:
			sev.runLeaderLoop()
		case Candidate:
			sev.runCandidateLoop()
		case Follower:
			sev.runFollowerLoop()
		}

		//timer base on milli-second.
		time.Sleep(100 * time.Millisecond)
	}
}

//For flower -> candidate
func (sev *RaftServer) requestVote(action datalog) {
	m := Message{from: sev.id,
		typ:          RequestVote,
		val:          action,
		term:         sev.term,
		lastLogIndex: 0}
	for _, node := range sev.nodeList {
		m.to = node
		sev.nt.send(m)
	}

	//Send request Vote and change self to Candidate.
	sev.roleChange(Candidate)
	log.Println("Now ID:", sev.id, " become candidate->", sev.role)
}

func (sev *RaftServer) sendHearbit() {
	latestData := sev.db.getLatestLogs()
	for _, node := range sev.nodeList {
		hbMsg := Message{from: sev.id, to: node, typ: Heartbit, val: *latestData}
		sev.nt.send(hbMsg)
	}
}

func (sev *RaftServer) runLeaderLoop() {
	log.Println("ID:", sev.id, " Run leader loop")
	sev.sendHearbit()

	recevMsg := sev.nt.recev()
	if recevMsg == nil {
		return
	}
	switch recevMsg.typ {
	case Heartbit:
		//TODO. other leaders HB, should not happen.
		return

	case HeartbitFeedback:
		//TODO. notthing happen in this.
		return

	case RequestVote:
		return
	case AcceptVote:
		return
	case WinningVote:
		return
	}
	//TODO. if get bigger TERM request, back to follower
}

func (sev *RaftServer) runCandidateLoop() {
	log.Println("ID:", sev.id, " Run candidate loop")
	//TODO. send RequestVote to all others
	recvMsg := sev.nt.recev()

	if recvMsg == nil {
		log.Println("ID:", sev.id, " no msg, return.")
		return
	}
	switch recvMsg.typ {
	case Heartbit:
		//TODO. Leader heartbit
		return
	case RequestVote:
		//TODO. other candidate request vote.
		return
	case AcceptVote:
		sev.acceptVoteMsg = append(sev.acceptVoteMsg, *recvMsg)
		log.Println("[candidate]: has ", len(sev.acceptVoteMsg), " still not reach ", sev.majorityCount())
		if len(sev.acceptVoteMsg) >= sev.majorityCount() {
			sev.roleChange(Leader)

			// send winvote to all and notify there is new leader
			for _, node := range sev.nodeList {
				hbMsg := Message{from: sev.id, to: node, typ: WinningVote}
				sev.nt.send(hbMsg)
			}
		}

		return
	case WinningVote:
		//Receive winvote from other candidate means we need goback to follower
		sev.roleChange(Follower)
		return

	}
	//TODO. check if prompt to leader.

	//TODO. If not, back to follower
}

func (sev *RaftServer) runFollowerLoop() {
	log.Println("ID:", sev.id, " Run follower loop")

	//TODO. check if leader no heartbeat to change to candidate.
	recvMsg := sev.nt.recev()

	if recvMsg == nil {
		log.Println("ID:", sev.id, " no msg, return.")
		return
	}
	switch recvMsg.typ {
	case Heartbit:
		// return
		if !sev.db.getLatestLogs().identical(recvMsg.GetVal()) {
			//Data not exist, add it. (TODO)
			sev.db.add(recvMsg.GetVal())
		}

		//Send it back HeartBeat
		recvMsg.to = recvMsg.from
		recvMsg.from = sev.id
		recvMsg.typ = HeartbitFeedback
		sev.nt.send(*recvMsg)
		return
	case RequestVote:
		//Handle Request Vote from candidate.
		//If doesn't vote before, will vote.
		if sev.voteFor == 0 {
			recvMsg.to = recvMsg.from
			recvMsg.from = sev.id
			recvMsg.typ = AcceptVote
			sev.nt.send(*recvMsg)
			sev.voteFor = recvMsg.from
		} else {
			//Don't do anything if you already vote.
			//Only vote when first candidate request vote comes.
		}
	case WinningVote:
		//Clean variables.
		sev.voteFor = recvMsg.from

	}
}

func (sev *RaftServer) majorityCount() int {
	return len(sev.nodeList)/2 + 1
}

func (sev *RaftServer) roleChange(newRole Role) {
	log.Println("note:", sev.id, " change role from ", sev.role, " to ", newRole)
	sev.role = newRole
}


text:
using Newtonsoft.Json;

namespace Kondor.Data.TelegramTypes
{
    public class CallbackQuery
    {
        [JsonProperty("id")]
        public string Id { get; set; }

        [JsonProperty("from")]
        public User From { get; set; }

        [JsonProperty("message")]
        public Message Message { get; set; }

        [JsonProperty("inline_message_id")]
        public string InlineMessageId { get; set; }

        [JsonProperty("chat_instance")]
        public string ChatInstance { get; set; }

        [JsonProperty("data")]
        public string Data { get; set; }

        [JsonProperty("game_short_name")]
        public string GameShortName { get; set; }
    }
}


text:
<!--
Copyright 2017 The Kubernetes Dashboard Authors.

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.
-->

<kd-resource-card-list selectable="false"
                       with-statuses="true"
                       select-id="{{::$ctrl.getSelectId()}}"
                       list="$ctrl.persistentVolumeClaimList"
                       list-resource="$ctrl.persistentVolumeClaimListResource">
  <kd-resource-card-list-header>
    <kd-resource-card-list-title ng-transclude="header">
      [[Persistent Volume Claims|Label which appears above the list of such objects.]]
    </kd-resource-card-list-title>
    <kd-resource-card-list-filter></kd-resource-card-list-filter>
  </kd-resource-card-list-header>

  <kd-zero-state ng-if="!$ctrl.persistentVolumeClaimList.listMeta.totalItems">
    <kd-zero-state-text ng-transclude="zerostate">
      [[There are no Persistent Volume Claims to display.|Text for persistent volume claim card list zerostate.]]
    </kd-zero-state-text>
  </kd-zero-state>
  <kd-resource-card-header-columns ng-show="$ctrl.persistentVolumeClaimList.listMeta.totalItems">
    <kd-resource-card-header-column size="small"
                                    grow="2"
                                    sortable="true"
                                    sort-id="$root.SortableProperties.NAME">
      [[Name|Label 'Name' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2"
                                    ng-if="$ctrl.areMultipleNamespacesSelected()">
      [[Namespace|Label 'Namespace' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Status|Label 'Status' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Volume|Label 'Volume' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Capacity|Label 'Capacity' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Access Modes|Label 'AccessModes' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="2">
      [[Storage Class|Label 'StorageClass' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="1"
                                    sortable="true"
                                    sort-id="$root.SortableProperties.AGE">
      [[Age|Label 'Age' which appears as a column label in the table of persistent volume claims (persistent volume claim list view).]]
    </kd-resource-card-header-column>
    <kd-resource-card-header-column size="small"
                                    grow="nogrow">
    </kd-resource-card-header-column>
  </kd-resource-card-header-columns>
  <kd-persistent-volume-claim-card dir-paginate="persistentVolumeClaim in $ctrl.persistentVolumeClaimList.items | itemsPerPage: default"
                                   pagination-id="{{::$ctrl.getSelectId()}}"
                                   persistent-volume-claim="persistentVolumeClaim"
                                   total-items="$ctrl.persistentVolumeClaimList.listMeta.totalItems">
  </kd-persistent-volume-claim-card>

  <kd-resource-card-list-footer>
    <kd-resource-card-list-pagination></kd-resource-card-list-pagination>
  </kd-resource-card-list-footer>
</kd-resource-card-list>


text:
package edu.stuy.util;

import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;

import edu.wpi.first.wpilibj.AnalogInput;
import edu.wpi.first.wpilibj.StuyGyroLib;

public class StuyGyro extends StuyGyroLib {

    private LinkedList<Double> gyroMeasurements;
    private Timer updateMeasurements;

    private final static int GYRO_MEASUREMENTS_SAMPLE_SIZE = 5;
    private final static int GYRO_UPDATE_PERIOD_MILLISECONDS = 10;

    public StuyGyro(AnalogInput channel) {
        super(channel);
        gyroMeasurements = new LinkedList<Double>();
        startGyroUpdateThread();
    }

    public StuyGyro(int channel) {
        super(channel);
        gyroMeasurements = new LinkedList<Double>();
        startGyroUpdateThread();
    }

    public void startGyroUpdateThread() {
        stopGyroUpdateThread();
        updateMeasurements = new Timer();
        updateMeasurements.schedule(new TimerTask() {
            public void run() {
                synchronized (StuyGyro.this) {
                    gyroMeasurements.add(getInstantaneousGyroAngleInDegrees());
                    if (gyroMeasurements.size() > GYRO_MEASUREMENTS_SAMPLE_SIZE) {
                        gyroMeasurements.removeFirst();
                    }
                }
            }
        }, 0, GYRO_UPDATE_PERIOD_MILLISECONDS);
    }

    public void stopGyroUpdateThread() {
        if (updateMeasurements != null) {
            updateMeasurements.cancel();
        }
    }

    public void resetGyroMeasurements() {
        gyroMeasurements.clear();
    }

    public double getInstantaneousGyroAngleInDegrees() {
        return getAngle();
    }

    public double getInstantaneousGyroAngleInRadians() {
        return Math.toRadians(getAngle());
    }

    public double getAveragedGyroAngle() {
        if (gyroMeasurements.isEmpty()) {
            return getInstantaneousGyroAngleInDegrees();
        }
        double min = gyroMeasurements.get(0);
        double max = min;
        double sum = min;
        synchronized (this) {
            for (int i = 1; i < gyroMeasurements.size(); i++) {
                double measure = gyroMeasurements.get(i);
                sum += measure;
                if (measure < min) {
                    min = measure;
                } else if (measure > max) {
                    max = measure;
                }
            }
            if (gyroMeasurements.size() >= 3) {
                return (sum - min - max) / (gyroMeasurements.size() - 2);
            } else {
                return sum / gyroMeasurements.size();
            }
        }
    }
}


text:
package com.app.multiimagepickercropper;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.rahul.media.main.MediaFactory;
import com.rahul.media.model.CustomGallery;
import com.rahul.media.model.Define;

import java.util.ArrayList;
import java.util.HashMap;

public class MainActivity extends AppCompatActivity implements OnClickListener {

    private ImageAdapter mImageAdapter;
    private MediaFactory mediaFactory;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Define.MEDIA_PROVIDER = getString(R.string.image_provider);
        Fresco.initialize(this);
        mMediaPathArrayList = new HashMap<>();
        mImageAdapter = new ImageAdapter(mMediaPathArrayList, this);
        ListView mListView = (ListView) findViewById(R.id.listview);
        mListView.setAdapter(mImageAdapter);

        findViewById(R.id.img_single_pick).setOnClickListener(this);
        findViewById(R.id.img_multiple_pick).setOnClickListener(this);

        findViewById(R.id.img_single_pick_camera).setOnClickListener(this);
        findViewById(R.id.img_multiple_pick_camera).setOnClickListener(this);

        findViewById(R.id.vid_single_pick).setOnClickListener(this);
        findViewById(R.id.vid_multiple_pick).setOnClickListener(this);

        findViewById(R.id.vid_single_pick_camera).setOnClickListener(this);
        findViewById(R.id.vid_multiple_pick_camera).setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        MediaFactory.MediaBuilder mediaBuilder = null;
        switch (v.getId()) {
            case R.id.img_single_pick:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .setPickCount(1)
                        .doCropping()
                        .isSquareCrop(false)
                        .withAspectRatio(16,9)
                        .fromGallery();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.img_multiple_pick:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .fromGallery()
                        .setPickCount(10)
                        .doCropping();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.img_single_pick_camera:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .isSquareCrop(false)
                        .fromCamera();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.img_multiple_pick_camera:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .fromCamera();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.vid_single_pick:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .takeVideo()
                        .fromGallery();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.vid_multiple_pick:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .takeVideo()
                        .setPickCount(5)
                        .fromGallery();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.vid_single_pick_camera:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .takeVideo()
                        .fromCamera();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;
            case R.id.vid_multiple_pick_camera:
                mediaBuilder = new MediaFactory.MediaBuilder(MainActivity.this)
                        .takeVideo()
                        .fromCamera();
                mediaFactory = MediaFactory.create().start(mediaBuilder);
                break;

        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        ArrayList<String> all_path = mediaFactory.onActivityResult(requestCode, resultCode, data);
        for (String string : all_path) {
            CustomGallery item = new CustomGallery();
            item.sdcardPath = string;
            item.sdCardUri = Uri.parse(string);

            MediaBean bean = new MediaBean();
            bean.setImage(true);
            bean.setImagePath(item.sdcardPath);
            bean.setImageUri(item.sdCardUri);
            mMediaPathArrayList.put(item.sdcardPath, bean);
        }
        mImageAdapter.customNotify(mMediaPathArrayList);
    }

    private HashMap<String, MediaBean> mMediaPathArrayList;

}


text:
namespace Microsoft.Azure.Management.WebSites.Models
{
    using Microsoft.Azure;
    using Microsoft.Azure.Management;
    using Microsoft.Azure.Management.WebSites;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    ///
    /// Description of a restore request.
    ///
    [Rest.Serialization.JsonTransformation]
    public partial class RestoreRequest : ProxyOnlyResource
    {
        ///
        /// Initializes a new instance of the RestoreRequest class.
        ///
        public RestoreRequest()
        {
          CustomInit();
        }

        ///
        /// Initializes a new instance of the RestoreRequest class.
        ///
        /// <param name="id">Resource Id.</param>
        /// <param name="name">Resource Name.</param>
        /// <param name="kind">Kind of resource.</param>
        /// <param name="type">Resource type.</param>
        /// <param name="storageAccountUrl">SAS URL to the container.</param>
        /// <param name="blobName">Name of a blob which contains the
        /// backup.</param>
        /// <param name="overwrite">true if the
        /// restore operation can overwrite target app; otherwise,
        /// false. true is
        /// needed if trying to restore over an existing app.</param>
        /// <param name="siteName">Name of an app.</param>
        /// <param name="databases">Collection of databases which should be
        /// restored. This list has to match the list of databases included in
        /// the backup.</param>
        /// <param name="ignoreConflictingHostNames">Changes a logic when
        /// restoring an app with custom domains. true
        /// to remove custom domains automatically. If
        /// false, custom domains are added to
        /// the app's object when it is being restored, but that might fail due
        /// to conflicts during the operation.</param>
        /// <param name="ignoreDatabases">Ignore the databases and only restore
        /// the site content</param>
        /// <param name="appServicePlan">Specify app service plan that will own
        /// restored site.</param>
        /// <param name="operationType">Operation type. Possible values
        /// include: 'Default', 'Clone', 'Relocation', 'Snapshot'</param>
        /// <param name="adjustConnectionStrings">true
        /// if SiteConfig.ConnectionStrings should be set in new app;
        /// otherwise, false.</param>
        /// <param name="hostingEnvironment">App Service Environment name, if
        /// needed (only when restoring an app to an App Service
        /// Environment).</param>
        public RestoreRequest(string id = default(string), string name = default(string), string kind = default(string), string type = default(string), string storageAccountUrl = default(string), string blobName = default(string), bool? overwrite = default(bool?), string siteName = default(string), IList<DatabaseBackupSetting> databases = default(IList<DatabaseBackupSetting>), bool? ignoreConflictingHostNames = default(bool?), bool? ignoreDatabases = default(bool?), string appServicePlan = default(string), BackupRestoreOperationType? operationType = default(BackupRestoreOperationType?), bool? adjustConnectionStrings = default(bool?), string hostingEnvironment = default(string))
            : base(id, name, kind, type)
        {
            StorageAccountUrl = storageAccountUrl;
            BlobName = blobName;
            Overwrite = overwrite;
            SiteName = siteName;
            Databases = databases;
            IgnoreConflictingHostNames = ignoreConflictingHostNames;
            IgnoreDatabases = ignoreDatabases;
            AppServicePlan = appServicePlan;
            OperationType = operationType;
            AdjustConnectionStrings = adjustConnectionStrings;
            HostingEnvironment = hostingEnvironment;
            CustomInit();
        }

        ///
        /// An initialization method that performs custom operations like setting defaults
        ///
        partial void CustomInit();

        ///
        /// Gets or sets SAS URL to the container.
        ///
        [JsonProperty(PropertyName = "properties.storageAccountUrl")]
        public string StorageAccountUrl { get; set; }

        ///
        /// Gets or sets name of a blob which contains the backup.
        ///
        [JsonProperty(PropertyName = "properties.blobName")]
        public string BlobName { get; set; }

        ///
        /// Gets or sets &lt;code&gt;true&lt;/code&gt; if the
        /// restore operation can overwrite target app; otherwise,
        /// &lt;code&gt;false&lt;/code&gt;.
        /// &lt;code&gt;true&lt;/code&gt; is needed if trying
        /// to restore over an existing app.
        ///
        [JsonProperty(PropertyName = "properties.overwrite")]
        public bool? Overwrite { get; set; }

        ///
        /// Gets or sets name of an app.
        ///
        [JsonProperty(PropertyName = "properties.siteName")]
        public string SiteName { get; set; }

        ///
        /// Gets or sets collection of databases which should be restored. This
        /// list has to match the list of databases included in the backup.
        ///
        [JsonProperty(PropertyName = "properties.databases")]
        public IList<DatabaseBackupSetting> Databases { get; set; }

        ///
        /// Gets or sets changes a logic when restoring an app with custom
        /// domains. &lt;code&gt;true&lt;/code&gt; to remove
        /// custom domains automatically. If
        /// &lt;code&gt;false&lt;/code&gt;, custom domains are
        /// added to
        /// the app's object when it is being restored, but that might fail due
        /// to conflicts during the operation.
        ///
        [JsonProperty(PropertyName = "properties.ignoreConflictingHostNames")]
        public bool? IgnoreConflictingHostNames { get; set; }

        ///
        /// Gets or sets ignore the databases and only restore the site content
        ///
        [JsonProperty(PropertyName = "properties.ignoreDatabases")]
        public bool? IgnoreDatabases { get; set; }

        ///
        /// Gets or sets specify app service plan that will own restored site.
        ///
        [JsonProperty(PropertyName = "properties.appServicePlan")]
        public string AppServicePlan { get; set; }

        ///
        /// Gets or sets operation type. Possible values include: 'Default',
        /// 'Clone', 'Relocation', 'Snapshot'
        ///
        [JsonProperty(PropertyName = "properties.operationType")]
        public BackupRestoreOperationType? OperationType { get; set; }

        ///
        /// Gets or sets &lt;code&gt;true&lt;/code&gt; if
        /// SiteConfig.ConnectionStrings should be set in new app; otherwise,
        /// &lt;code&gt;false&lt;/code&gt;.
        ///
        [JsonProperty(PropertyName = "properties.adjustConnectionStrings")]
        public bool? AdjustConnectionStrings { get; set; }

        ///
        /// Gets or sets app Service Environment name, if needed (only when
        /// restoring an app to an App Service Environment).
        ///
        [JsonProperty(PropertyName = "properties.hostingEnvironment")]
        public string HostingEnvironment { get; set; }

    }
}


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: javax.xml.xpath.XPathFunctionResolver
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_DECL
#define J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_DECL

namespace j2cpp { namespace javax { namespace xml { namespace xpath { class XPathFunction; } } } }
namespace j2cpp { namespace javax { namespace xml { namespace namespace { class QName; } } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }

#include <java/lang/Object.hpp>
#include <javax/xml/namespace/QName.hpp>
#include <javax/xml/xpath/XPathFunction.hpp>

namespace j2cpp {

namespace javax { namespace xml { namespace xpath {

	class XPathFunctionResolver;
	class XPathFunctionResolver
		: public object<XPathFunctionResolver>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)

		explicit XPathFunctionResolver(jobject jobj)
		: object<XPathFunctionResolver>(jobj)
		{
		}

		operator local_ref<java::lang::Object>() const;

		local_ref< javax::xml::xpath::XPathFunction > resolveFunction(local_ref< javax::xml::namespace::QName >  const&, jint);
	}; //class XPathFunctionResolver

} //namespace xpath
} //namespace xml
} //namespace javax

} //namespace j2cpp

#endif //J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_IMPL
#define J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_IMPL

namespace j2cpp {

javax::xml::xpath::XPathFunctionResolver::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

local_ref< javax::xml::xpath::XPathFunction > javax::xml::xpath::XPathFunctionResolver::resolveFunction(local_ref< javax::xml::namespace::QName > const &a0, jint a1)
{
	return call_method<
		javax::xml::xpath::XPathFunctionResolver::J2CPP_CLASS_NAME,
		javax::xml::xpath::XPathFunctionResolver::J2CPP_METHOD_NAME(0),
		javax::xml::xpath::XPathFunctionResolver::J2CPP_METHOD_SIGNATURE(0),
		local_ref< javax::xml::xpath::XPathFunction >
	>(get_jobject(), a0, a1);
}

J2CPP_DEFINE_CLASS(javax::xml::xpath::XPathFunctionResolver,"javax/xml/xpath/XPathFunctionResolver")
J2CPP_DEFINE_METHOD(javax::xml::xpath::XPathFunctionResolver,0,"resolveFunction","(Ljavax/xml/namespace/QName;I)Ljavax/xml/xpath/XPathFunction;")

} //namespace j2cpp

#endif //J2CPP_JAVAX_XML_XPATH_XPATHFUNCTIONRESOLVER_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
var div = thymol.thDocument.createElement( 'div' );
div.innerHTML = "This is a message from doesnotload.js.<br/>You could say this is self-contradictory.";
thymol.thDocument.body.appendChild( div );


text:
(function( $ ) {
	"use strict";

	pinpointApp.directive( "generalDirective", [ "PreferenceService", "UserConfigurationService", "AnalyticsService", "helpContentService",
		function ( PreferenceService, UserConfigService, AnalyticsService, helpContentService ) {
			return {
				restrict: "EA",
				replace: true,
				templateUrl: "features/configuration/general/general.html?v=" + G_BUILD_TIME,
				scope: {
					namespace: "@"
				},
				link: function( scope, element, attr ) {
					var $element = element;
					var $elFavoriteList = $element.find("ul.favorite-list");
					var myName = attr["name"];
					var $depthPopup = $element.find(".inout-bound");
					var bCloseDepthPopup = false;
					$element[ attr["initState"] ]();
					scope.savedFavoriteList = [];

					init();

					function renderList() {
						$elFavoriteList.empty();
						for( var i = 0 ; i < scope.savedFavoriteList.length ; i++ ) {
							var oFavor = scope.savedFavoriteList[i];
							renderElement( oFavor.applicationName, oFavor.serviceType, oFavor.code );
						}
					}
					function renderElement( appName, appType, code ) {
						$elFavoriteList.append(
							'
' + appName + '<button class="btn btn-danger btn-xs" style="float:right"></button>
'
						);
					}
					function init() {
						scope.depthList = PreferenceService.getDepthList();
						scope.caller = UserConfigService.getCaller();
						scope.callee = UserConfigService.getCallee();
						scope.periodTime = PreferenceService.getPeriodTime();
						scope.period = UserConfigService.getPeriod();
						UserConfigService.getFavoriteList(function(aFavoriteList) {
							scope.savedFavoriteList = aFavoriteList;
							renderList();
						}, true);
						scope.timezone = moment.tz.names();
						scope.userTimezone = UserConfigService.getTimezone();
						scope.newUserTimezone = UserConfigService.getTimezone();

						$element.find( "div.general-warning" ).html( helpContentService.configuration.general.warning );
						$element.find( "div.favorite-empty" ).html( helpContentService.configuration.general.empty );

						$depthPopup.on("hide.bs.dropdown", function( event ) {
							if ( bCloseDepthPopup === false ) {
								event.preventDefault();
								bCloseDepthPopup = false;
							}
						});
						$depthPopup.on("click", function() {
							bCloseDepthPopup = false;
						});
					}
					function addToFavoriteList( newAppName, newAppCode ) {
						AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_FAVORITE );
						UserConfigService.addFavorite( newAppName, newAppCode, function() {
							UserConfigService.getFavoriteList(function (aFavoriteList) {
								scope.savedFavoriteList = aFavoriteList;
								scope.$emit("up.changed.favorite");
								renderElement( newAppName.split("@")[0], newAppName.split("@")[1], newAppCode );
							}, true);
						});
					}
					scope.changeCaller = function( caller ) {
						scope.caller = caller;
						AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_DEPTH, scope.caller );
						UserConfigService.setCaller( scope.caller );
					};
					scope.changeCallee = function( callee ) {
						scope.callee = callee;
						AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_DEPTH, scope.callee );
						UserConfigService.setCallee( scope.callee );
					};
					scope.changePeriod = function() {
						AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_PERIOD, scope.period );
						UserConfigService.setPeriod( scope.period );
					};
					scope.removeFavorite = function( $event ) {
						var tagName = $event.target.tagName.toLowerCase();
						if ( tagName === "button" || tagName === "span" ) {
							var $elLi = $( $event.target ).parents("li");
							AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_FAVORITE );
							UserConfigService.removeFavorite( $elLi.attr("data-name"), $elLi.attr("data-type"), function() {
								UserConfigService.getFavoriteList(function (aFavoriteList) {
									scope.savedFavoriteList = aFavoriteList;
									scope.$emit("up.changed.favorite");
									$elLi.remove();
								}, true);
							});
						}
					};
					scope.applyNReload = function() {
						AnalyticsService.sendMain( AnalyticsService.CONST.CLK_GENERAL_SET_TIMEZONE, scope.newUserTimezone );
						UserConfigService.setTimezone( scope.newUserTimezone );
						window.location.reload(true);
					};

					scope.closeInOut = function() {
						bCloseDepthPopup = true;
						$depthPopup.trigger( "click.bs.dropdown" );
					};
					scope.$on( "configuration.general.initClose", function() {
						scope.closeInOut();
					});

					scope.$on( "configuration.selectMenu", function( event, selectedName ) {
						if ( myName === selectedName ) {
							$element.show();
						} else {
							$element.hide();
						}
					});
					scope.$on( "up.changed.application", function( event, invokeId, newAppName, newAppCode ) {
						addToFavoriteList( newAppName, newAppCode, invokeId );
						event.stopPropagation();
					});
				}
			};
		}
	]);
})( jQuery );


text:
import { Component, OnInit, OnDestroy, NgZone, HostBinding } from '@angular/core';
import { slideInDownAnimation } from '../../../app.animations';
import { Subscription } from 'rxjs/Subscription';

import { StepState, TdMediaService } from '../../../../platform/core';

@Component({
  selector: 'steps-demo',
  styleUrls: ['./steps.component.scss' ],
  templateUrl: './steps.component.html',
  animations: [slideInDownAnimation],
})
export class StepsDemoComponent implements OnInit, OnDestroy {

  @HostBinding('@routeAnimation') routeAnimation: boolean = true;
  @HostBinding('class.td-route-animation') classAnimation: boolean = true;

  stepsAttrs: Object[] = [{
    description: `Method to be executed when [onStepChange] event is emitted.
                  Emits an [IStepChangeEvent] implemented object.`,
    name: 'stepChange?',
    type: 'function($event)',
  }, {
    description: 'Defines if the mode of the [TdStepsComponent].  Defaults to [StepMode.Vertical | "vertical"]',
    name: 'mode?',
    type: 'StepMode or ["vertical" | "horizontal"]',
  }];

  stepAttrs: Object[] = [{
    description: 'Sets label of [TdStepComponent] header. Defaults to "Step #"',
    name: 'label?',
    type: 'string',
  }, {
    description: 'Sets sublabel of [TdStepComponent] header.',
    name: 'sublabel?',
    type: 'string',
  }, {
    description: 'Toggles [TdStepComponent] between active/deactive.',
    name: 'active?',
    type: 'boolean',
  }, {
    description: 'Disables icon and header, blocks click event and sets [TdStepComponent] to deactive if "true".',
    name: 'disabled?',
    type: 'boolean',
  }, {
    description: 'Sets state of [TdStepComponent] depending on value. Defaults to [StepState.None | "none"]',
    name: 'state?',
    type: 'StepState or ["none" | "required" | "complete"]',
  }, {
    description: ' Whether the ripple effect for this component is disabled',
    name: 'disableRipple?',
    type: 'boolean',
  }, {
    description: 'Event emitted when [TdStepComponent] is activated.',
    name: 'activated?',
    type: 'function()',
  }, {
    description: 'Event emitted when [TdStepComponent] is deactivated.',
    name: 'deactivated?',
    type: 'function()',
  }, {
    description: `Toggle active state of [TdStepComponent]. Retuns "true" if successful, else "false".
                  Can be accessed by referencing element in local variable.`,
    name: 'toggle',
    type: 'function()',
  }, {
    description: `Opens [TdStepComponent]. Retuns "true" if successful, else "false".
                  Can be accessed by referencing element in local variable.`,
    name: 'open',
    type: 'function()',
  }, {
    description: `Closes [TdStepComponent]. Retuns "true" if successful, else "false".
                  Can be accessed by referencing element in local variable.`,
    name: 'close',
    type: 'function()',
  }];

  querySubscription: Subscription;
  mode: number = 0;
  horizontal: boolean = true;
  isScreenGtSm: boolean = false;
  activeDeactiveStep1Msg: string = 'No select/deselect detected yet';
  stateStep2: StepState = StepState.Required;
  stateStep3: StepState = StepState.Complete;
  disabled: boolean = false;

  constructor(private _mediaService: TdMediaService, private _ngZone: NgZone) {
  }

  ngOnInit(): void {
    this.watchScreen();
  }
  ngOnDestroy(): void {
    this.querySubscription.unsubscribe();
  }

  watchScreen(): void {
    this._ngZone.run(() => {
      this.isScreenGtSm = this._mediaService.query('gt-sm');
    });
    this.querySubscription = this._mediaService.registerQuery('gt-sm').subscribe((matches: boolean) => {
      this._ngZone.run(() => {
        this.isScreenGtSm = matches;
        if (this.mode === 2) {
          this.horizontal = matches;
        }
      });
    });
  }

  modeChange(): void {
    if (this.mode === 2) {
      this.horizontal = this.isScreenGtSm;
    } else {
      this.horizontal = this.mode === 1;
    }
  }

  toggleRequiredStep2(): void {
    this.stateStep2 = (this.stateStep2 === StepState.Required ? StepState.None : StepState.Required);
  }

  toggleCompleteStep3(): void {
    this.stateStep3 = (this.stateStep3 === StepState.Complete ? StepState.None : StepState.Complete);
  }

  toggleDisabled(): void {
    this.disabled = !this.disabled;
  }

  activeStep1Event(): void {
    this.activeDeactiveStep1Msg = 'Active event emitted.';
  }

  deactiveStep1Event(): void {
    this.activeDeactiveStep1Msg = 'Deactive event emitted.';
  }
}


text:
//     Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using Microsoft.Dash.Common.Diagnostics;
using Microsoft.Dash.Common.Utils;
using Microsoft.WindowsAzure.Storage;

namespace Microsoft.Dash.Server.Utils
{
    public class HandlerResult
    {
        const string ResponseDateHeader         = "x-ms-date";

        public static HandlerResult Redirect(IHttpRequestWrapper requestWrapper, Uri location)
        {
            return Redirect(requestWrapper, location.ToString());
        }

        public static HandlerResult Redirect(IHttpRequestWrapper requestWrapper, string location)
        {
            return new HandlerResult
            {
                StatusCode = HttpStatusCode.Redirect,
                Location = location,
                Request = requestWrapper,
            };
        }

        public static HandlerResult FromException(StorageException ex)
        {
            return new HandlerResult
            {
                StatusCode = (HttpStatusCode)ex.RequestInformation.HttpStatusCode,
                ReasonPhrase = ex.RequestInformation.HttpStatusMessage,
                ErrorInformation = DashErrorInformation.Create(ex.RequestInformation.ExtendedErrorInformation),
            };
        }

        public IHttpRequestWrapper Request { get; private set; }
        public HttpStatusCode StatusCode { get; set; }
        public string ReasonPhrase { get; set; }
        public string Location { get; private set; }
        public ResponseHeaders Headers { get; set; }
        public DashErrorInformation ErrorInformation { get; set; }

        string _signedLocation;
        public string SignedLocation
        {
            get
            {
                if (String.IsNullOrWhiteSpace(this.Location))
                {
                    throw new InvalidOperationException("Cannot determine signed location until the Location property is set.");
                }
                if (String.IsNullOrWhiteSpace(_signedLocation))
                {
                    if (String.IsNullOrWhiteSpace(this.Request.AuthenticationScheme))
                    {
                        return String.Empty;
                    }
                    string responseDate = null;
                    if (this.Headers == null)
                    {
                        responseDate = DateTimeOffset.UtcNow.ToString("r");
                        this.Headers = new ResponseHeaders(new[] {
                            new KeyValuePair<string, string>(ResponseDateHeader, responseDate),
                        });
                    }
                    else if (!this.Headers.Contains(ResponseDateHeader))
                    {
                        responseDate = DateTimeOffset.UtcNow.ToString("r");
                        this.Headers.Append("Date", responseDate);
                    }
                    else
                    {
                        responseDate = this.Headers.Value<string>(ResponseDateHeader);
                    }
                    _signedLocation = SharedKeySignature.FormatSignatureHeader(this.Request.AuthenticationScheme,
                        SharedKeySignature.GenerateSignature(() => String.Format("{0}\n{1}\n{2}\n{3}",
                                                    this.Request.HttpMethod,
                                                    responseDate,
                                                    this.Location,
                                                    SharedKeySignature.GetCanonicalizedHeaders(this.Headers)),
                                                this.Request.AuthenticationKey));
                }
                return _signedLocation;
            }
        }
    }
}


text:
using System;
using System.Globalization;
/// <summary>
///System.IConvertible.ToUInt16(System.IFormatProvider)
/// </summary>
public class SingleToUInt16
{
    #region Public Methods
    public bool RunTests()
    {
        bool retVal = true;
        TestLibrary.TestFramework.LogInformation("[Positive]");
        retVal = PosTest1() && retVal;

        TestLibrary.TestFramework.LogInformation("[Negtive]");
        retVal = NegTest1() && retVal;
        retVal = NegTest2() && retVal;
        return retVal;
    }

    #region Positive Test Cases
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: Check a  random single.");

        try
        {
            Single i1 = TestLibrary.Generator.GetSingle(-55);
            short expectValue = 0;
            if (i1 > 0.5)
                expectValue = 1;
            else
                expectValue = 0;
            CultureInfo myCulture =  new CultureInfo("en-US");
            ushort actualValue = ((IConvertible)i1).ToUInt16(myCulture);
            if (actualValue != expectValue)
            {
                TestLibrary.TestFramework.LogError("001.1", "ToUInt16  return failed. ");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("001.2", "Unexpected exception: " + e);
            retVal = false;
        }

        return retVal;
    }

    public bool NegTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest1: Check a single which is  >UInt16.MaxValue.");

        try
        {
            Single i1 = (Single)(UInt16.MaxValue + 1);
            CultureInfo myCulture =  new CultureInfo("en-US");
            ushort actualValue = ((IConvertible)i1).ToUInt16(myCulture);
            TestLibrary.TestFramework.LogError("101.1", "ToUInt16  return failed. ");
            retVal = false;

        }
        catch (OverflowException)
        {

        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("101.2", "Unexpected exception: " + e);
            retVal = false;
        }

        return retVal;
    }
    public bool NegTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest2: Check a single which is  <UInt16.MinValue.");

        try
        {
            Single i1 = (Single)(UInt16.MinValue - 1);
            CultureInfo myCulture =  new CultureInfo("en-US");
            ushort actualValue = ((IConvertible)i1).ToUInt16(myCulture);
            TestLibrary.TestFramework.LogError("102.1", "ToUInt16  return failed. ");
            retVal = false;

        }
        catch (OverflowException)
        {

        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("102.2", "Unexpected exception: " + e);
            retVal = false;
        }

        return retVal;
    }
    #endregion

    #endregion

    public static int Main()
    {
        SingleToUInt16 test = new SingleToUInt16();

        TestLibrary.TestFramework.BeginTestCase("SingleToUInt16");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return 100;
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return 0;
        }
    }

}


text:
/* @flow */
import type { WrittenTemplate } from './types';

const fs = require('fs');
const path = require('path');
const mkdir = require('mkdirp');

type Modification = {
  file: string,
  modifier: (content: string | null, file: string) => string,
};

/**
 * Writes template from single entry to file.
 * Returns path of written file.
 *
 * @param {Object} entryConfig Parsed entry config
 * @returns {string}
 */
const writeEntry = (entryConfig: Object): string => {
  const destinationDirectory: string = path.join(
    process.cwd(),
    entryConfig.path,
  );
  const outputPath: string = path.join(
    destinationDirectory,
    entryConfig.filename,
  );
  if (!entryConfig.overwrite && fs.existsSync(outputPath)) {
    throw new Error(`File ${outputPath} alredy exists\n`);
  }
  mkdir.sync(destinationDirectory);
  fs.writeFileSync(outputPath, entryConfig.template, 'utf-8');
  return outputPath;
};

/**
 * Apply modifications to file specified in modify filed of generator config.
 * Path of modified file.
 *
 * @param {Modification} modification Single modification.
 * @returns {string}
 */
const applyModification = (modification: Modification): string => {
  let absolutePath: string = path.join(process.cwd(), modification.file);

  if (
    !modification.file.startsWith('.') &&
    !path.extname(absolutePath).length
  ) {
    absolutePath += '.js';
  }

  mkdir.sync(path.dirname(absolutePath));

  const modifiedContent: string = modification.modifier(
    fs.existsSync(absolutePath) ? fs.readFileSync(absolutePath, 'utf-8') : null,
    absolutePath,
  );

  if (typeof modifiedContent === 'string') {
    fs.writeFileSync(absolutePath, modifiedContent, 'utf-8');
  } else if (modifiedContent) {
    throw new Error(`Modified content for ${absolutePath} must be a string\n`);
  }

  return absolutePath;
};

/**
 * Writes template from entries to file.
 *
 * @param {Object} generatorConfig Parsed generator config
 * @returns {WrittenTemplate}
 */

module.exports = (generatorConfig: Object): WrittenTemplate => {
  let writtenEntries = [];
  let modifiedFiles = [];
  if (Array.isArray(generatorConfig.entries)) {
    writtenEntries = generatorConfig.entries.map(writeEntry);
  } else {
    writtenEntries = [writeEntry(generatorConfig.entry)];
  }
  if (generatorConfig.modify && Array.isArray(generatorConfig.modify)) {
    modifiedFiles = generatorConfig.modify.map(applyModification);
  } else if (generatorConfig.modify) {
    modifiedFiles = [applyModification(generatorConfig.modify)];
  }
  return {
    written: writtenEntries,
    modified: modifiedFiles,
  };
};


text:
@interface TopTabItemView ()

@property (weak, nonatomic) IBOutlet UIButton *channels;
@property (weak, nonatomic) IBOutlet UIButton *mine;
@property (weak, nonatomic) IBOutlet UIView *line;
@property (nonatomic, strong) UIButton * currentTab;

@end

@implementation TopTabItemView

- (IBAction)tabItemClick:(UIButton *)sender {

    if (self.currentTab == sender) return;

    sender.selected = YES;
    sender.userInteractionEnabled = NO;
    self.currentTab.selected = NO;
    self.currentTab.userInteractionEnabled = YES;
    self.currentTab = sender;
    [UIView animateWithDuration:0.3 animations:^{

        self.line.centerX = sender.centerX;
    } completion:^(BOOL finished) {

    }];
    if (self.tabBlock) self.tabBlock(sender.tag);
}

- (UIButton *)currentTab {
    if (_currentTab == nil) {
        _currentTab = self.channels;
    }
    return _currentTab;
}

@end


text:
using System.Runtime.Versioning;
using System.Threading.Tasks;

namespace System.Xml
{
    public partial class XmlUrlResolver : XmlResolver {

        // Maps a URI to an Object containing the actual resource.
        [ResourceConsumption(ResourceScope.Machine)]
        [ResourceExposure(ResourceScope.Machine)]
        public override async Task<Object> GetEntityAsync(Uri absoluteUri, string role, Type ofObjectToReturn) {
            if (ofObjectToReturn == null || ofObjectToReturn == typeof(System.IO.Stream) || ofObjectToReturn == typeof(System.Object)) {
                return await DownloadManager.GetStreamAsync(absoluteUri, _credentials, _proxy, _cachePolicy).ConfigureAwait(false);
            }
            else {
                throw new XmlException(Res.Xml_UnsupportedClass, string.Empty);
            }
        }
    }
}


text:
<?php namespace Noise\Reflection;

use Noise\Vote;
use Norm\Norm;
use ArrayHelper;

trait VoteReflection
{
    private function getUpvotesForThread($threadId)
    {
        return $this->getVotes(array('thread_id' => $threadId, 'type' => Vote::UP_VOTE));
    }

    private function getDownvotesForThread($threadId)
    {
        return $this->getVotes(array('thread_id' => $threadId, 'type' => Vote::DOWN_VOTE));
    }

    private function getUpvotesForPost($postId)
    {
        return $this->getVotes(array('post_id' => $postId, 'type' => Vote::UP_VOTE));
    }

    private function getDownvotesForPost($postId)
    {
        return $this->getVotes(array('post_id' => $postId, 'type' => Vote::DOWN_VOTE));
    }

    private function getVotes(array $criteria)
    {
        $upvotes = array();

        foreach (Norm::factory('Vote')->find($criteria) as $vote) {
            if (! is_null($vote)) {
                Norm::options('include', true);

                $vote = $vote->jsonSerialize();
                $upvotes[] = ArrayHelper::sanitize($vote, array('thread_id', 'post_id', 'type'));
            }
        }

        return $upvotes;
    }

    private function getVote($voteId)
    {
        $vote = Norm::factory('Vote')->findOne($voteId);

        if (! is_null($vote)) {
            Norm::options('include', true);

            $vote = ArrayHelper::sanitize($vote->jsonSerialize(), array('thread_id', 'post_id', 'type'));
        }

        return $vote;
    }

    private function newVote(array $data)
    {
        $connection = Norm::factory('Vote');
        $criteria = $data;
        $postId = $criteria['post_id'];

        unset($criteria['type']);

        $check = $connection->findOne($data);

        if (! is_null($check)) {
            $codeType = $check->get('type');
            $type = ($codeType === Vote::UP_VOTE) ? 'up' : 'down';

            return array(
                'error' => true,
                'message' => 'Cannot vote, because you have already voted ' . $type,
            );
        }

        $before = $connection->findOne($criteria);
        $neutral = false;

        // Because user has vote up and he wants to vote down, let's remove all votes and don't create any data
        if (! is_null($before)) {
            $before->remove();

            $neutral = true;
        } else {
            $vote = $connection->newInstance();

            $vote->set($data)->save();
        }

        return array(
            'neutral'   => $neutral,
            'upvotes'   => $this->getUpvotesForPost($postId),
            'downvotes' => $this->getDownvotesForPost($postId),
        );
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.google.android.gms.messaging.cpp" >
    <uses-sdk android:minSdkVersion='14'/>
    <application>
        <service
            android:name="MessageForwardingService"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:exported="true"/>
    </application>
</manifest>


text:
var join = require('path').join
var spawn = require('child_process').spawn

var concat = require('mississippi').concat
var log = require('npmlog')
var pipe = require('mississippi').pipe
var test = require('tap').test
var Bluebird = require('bluebird')

var rimraf = Bluebird.promisify(require('rimraf'))
var which = Bluebird.promisify(require('which'))

var scan = require('../lib/metadata/scan.js').default
var transcode = require('../lib/utils/transcode.js').default
var model = require('@packard/model')
var Track = model.Track

var metadata = require('./lib/metadata.js')

var root = join(__dirname, 'utils-transcode')

test('missing track', function (t) {
  t.throws(transcode)
  t.end()
})

test('missing destination', function (t) {
  t.throws(function () { transcode(new Track()) })
  t.end()
})

test('missing encoder', function (t) {
  t.throws(function () { transcode(new Track(), '/tmp') })
  t.end()
})

test('missing encoding profile', function (t) {
  t.throws(function () { transcode(new Track(), '/tmp', 'lame') })
  t.end()
})

test('simple transcoding', function (t) {
  var source = join(root, 'source')
  var destination = join(root, 'destination')

  var makeAlbum = rimraf(root).then(function () {
    return metadata.makeAlbum(
      source,
      '2012-01-20',
      'Gary Beck',
      'Feel It',
      [{ name: 'Feel It' }],
      '.flac',
      'silent'
    )
  })

  var readTrack = makeAlbum.then(function (paths) {
    log.silly('simpleTest', 'encoded', paths)
    return scan({ path: paths[0] }, new Map())
  })

  var runTranscode = readTrack.then(function (track) {
    return transcode(track, destination, 'lame', '-V0')
  })

  return runTranscode.then(function (path) {
    var ensureMp3val = which('mp3val')

    return ensureMp3val.then(function (mp3val) {
      return new Bluebird(function (resolve, reject) {
        var verifier = spawn(
          mp3val,
          [ path ],
          {}
        )

        pipe(verifier.stdout, concat({ encoding: 'string' }, function (output) {
          t.notMatch(output, /WARNING/m, 'no warnings from mp3val')
          t.match(
            output,
            /INFO.+166 MPEG frames \(MPEG 1 Layer III\), \+ID3v2, Xing header/m,
            'found expected stream content'
          )
        }))

        pipe(verifier.stderr, concat({ encoding: 'string' }, function (output) {
          t.notOk(output, 'no error output from mp3val')
        }))

        verifier.on('error', reject)
        verifier.on('close', function (code) {
          t.equal(code, 0, 'exited without issue')
          resolve()
        })
      })
    })
  })
})

test('cleanup', function (t) {
  return rimraf(root)
})


text:
// ----- this file has been automatically generated - do not edit
import { UAObject } from "node-opcua-address-space-base"
import { DataType } from "node-opcua-variant"
import { LocalizedText, QualifiedName } from "node-opcua-data-model"
import { NodeId } from "node-opcua-nodeid"
import { UInt32, UAString } from "node-opcua-basic-types"
import { DTArgument } from "node-opcua-nodeset-ua/source/dt_argument"
import { UAMachineComponents } from "node-opcua-nodeset-machinery/source/ua_machine_components"
import { EnumCoordinateSystem } from "./enum_coordinate_system"
import { DTUserProfile } from "./dt_user_profile"
import { UAConfigurationRules } from "./ua_configuration_rules"
import { UAGlassMachineIdentification } from "./ua_glass_machine_identification"
import { UAManualFolder } from "./ua_manual_folder"
import { UAProduction } from "./ua_production"
/**
 * |                |                                                  |
 * |----------------|--------------------------------------------------|
 * |namespace       |http://opcfoundation.org/UA/Glass/Flat/           |
 * |nodeClass       |ObjectType                                        |
 * |typedDefinition |13:GlassMachineType ns=13;i=1015                  |
 * |isAbstract      |false                                             |
 */
export interface UAGlassMachine_Base {
    components?: UAMachineComponents;
    configurationRules: UAConfigurationRules;
    identification: UAGlassMachineIdentification;
    maintenanceManuals?: UAManualFolder;
    operationManuals?: UAManualFolder;
    production: UAProduction;
}
export interface UAGlassMachine extends UAObject, UAGlassMachine_Base {
}


text:
<?php
namespace Latrell\AliyunSls;

use Aliyun_Sls_Client;
use Aliyun_Sls_Models_ListLogstoresRequest;
use Aliyun_Sls_Models_LogItem;
use Aliyun_Sls_Models_PutLogsRequest;
use Aliyun_Sls_Models_ListTopicsRequest;
use Aliyun_Sls_Models_GetHistogramsRequest;
use Aliyun_Sls_Models_GetLogsRequest;

class AliyunSls
{

	protected $client;

	protected $project, $logstore;

	public function __construct($endpoint, $access_key_id, $access_key, $project = '', $logstore = '')
	{
		$this->client = new Aliyun_Sls_Client($endpoint, $access_key_id, $access_key);

		$this->project = $project;
		$this->logstore = $logstore;
	}

	/**
	 * 列出Project下的所有Logstore名称。
	 *
	 * @param string $project
	 * @return Aliyun_Sls_Models_ListLogstoresResponse
	 */
	public function listLogstores($project = '')
	{
		$project = $project ?  : $this->project;

		$request = new Aliyun_Sls_Models_ListLogstoresRequest($project);
		$response = $this->client->listLogstores($request);
		return $response;
	}

	/**
	 * 向指定的Logstore写入日志。
	 *
	 * @param string $topic
	 * @param array $contents
	 * @param string $project
	 * @param string $logstore
	 * @return boolean
	 */
	public function putLogs($topic, $contents, $project = '', $logstore = '')
	{
		$project = $project ?  : $this->project;
		$logstore = $logstore ?  : $this->logstore;

		$log_item = new Aliyun_Sls_Models_LogItem();
		$log_item->setTime(time());
		$log_item->setContents($contents);
		$logitems = [
			$log_item
		];
		$request = new Aliyun_Sls_Models_PutLogsRequest($project, $logstore, $topic, null, $logitems);

		$response = $this->client->putLogs($request);

		return array_get($response->getAllHeaders(), '_info.http_code') === 200;
	}

	/**
	 * 列出Logstore中的日志主题。
	 *
	 * @param string $project
	 * @param string $logstore
	 * @return Aliyun_Sls_Models_ListTopicsResponse
	 */
	public function listTopics($project = '', $logstore = '')
	{
		$project = $project ?  : $this->project;
		$logstore = $logstore ?  : $this->logstore;

		$request = new Aliyun_Sls_Models_ListTopicsRequest($project, $logstore);

		$response = $this->client->listTopics($request);

		return $response;
	}

	/**
	 * 查询Logstore中的日志在时间轴上的分布。
	 *
	 * @param integer $from
	 * @param integer $to
	 * @param string $topic
	 * @param string $query
	 * @param string $project
	 * @param string $logstore
	 * @return Aliyun_Sls_Models_GetHistogramsResponse
	 */
	public function getHistograms($from = null, $to = null, $topic = null, $query = null, $project = null, $logstore = null)
	{
		$project = $project ?  : $this->project;
		$logstore = $logstore ?  : $this->logstore;

		$request = new Aliyun_Sls_Models_GetHistogramsRequest($project, $logstore, $from, $to, $topic, $query);

		$response = $this->client->getHistograms($request);

		return $response;
	}

	/**
	 * 查询Logstore中的日志数据。
	 *
	 * @param string $from
	 * @param string $to
	 * @param string $topic
	 * @param string $query
	 * @param string $line
	 * @param string $offset
	 * @param string $reverse
	 * @param string $project
	 * @param string $logstore
	 * @return Aliyun_Sls_Models_GetLogsResponse
	 */
	public function getLogs($from = null, $to = null, $topic = null, $query = null, $line = 100, $offset = null, $reverse = null, $project = null, $logstore = null)
	{
		$project = $project ?  : $this->project;
		$logstore = $logstore ?  : $this->logstore;

		$request = new Aliyun_Sls_Models_GetLogsRequest($project, $logstore, $from, $to, $topic, $query, $line, $offset, $reverse);

		$response = $this->client->getLogs($request);
		return $response;
	}

	public function getProject()
	{
		return $this->project;
	}

	public function setProject($value)
	{
		$this->project = $value;
		return $this;
	}

	public function getLogstore()
	{
		return $this->logstore;
	}

	public function setLogstore($value)
	{
		$this->logstore = $value;
		return $this;
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<title>Evitec Unify - Java Open Source Integration environment</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Content-Language" content="en-us">
	<link rel="stylesheet" href="css/main.css"></link>

Unify Platform

Complete Integration Environment.

Overview

We put together a collection of open source software. Then we added how we like to use it.

The result is a reference implementation for how we think building, testing, versioning, modeling, monitoring etc. can be done efficiently on an integration platform.

Check out (github)

Core - Main environment components.

unifyplatform.github.io - Code for this webpage.

Documentation

Wiki - All documentation, including the getting started guide.

Getting Started guide - A mandatory read for first time visitors.

Created By

Current version

0.0.1

2013 Evitec Unify AB


text:
(function($) {
    "use strict";

    $.fn.tabWidget = function(options) {
        var store = options && options.store;
	var selected = null;
	$("> a[href^='#']", this).click(function() {
            // Handle tab clicks
	    if (selected.data('tab') == $(this).data('tab')) {
		return false;
	    }
	    if (!selected.data('tab').confirmUnsaved()) {
		return false;
	    }
	    selected.data('tab').hide();
	    selected.parent().removeClass('selected');
	    selected = $(this);
	    selected.data('tab').show();
	    selected.parent().addClass('selected');
	    if (store) {
		$.storage.set(store, selected.data('tab').attr('id'));
	    }
	    return false;
	}).each(function() {
	    // Hide tabs
	    var tab = $(this.href.match(/(#.*)$/)[1]);
	    tab.hide();
	    $(this).data('tab', tab);
	});

        // Get selected tab from store
	if (store) {
	    var name = $.storage.get(store);
	    if (name) {
                selected = $("> a[href='#" + name + "']", this);
	    }
	}

        // Get selected tab by class
	if (!selected || selected.size() === 0) {
            selected = $(this).filter('.selected').find("> a[href^='#']");
	}

        // Select first tab
        if (!selected || selected.size() === 0) {
            selected = $(this).filter(':first').find("> a[href^='#']");
	}

	$(this).removeClass('selected');

	// Show initially selected tab
	if (selected && selected.data('tab')) {
	    selected.parent().addClass('selected');
	    selected.data('tab').show();
	}
    };
})(jQuery);


text:
package com.grapecity.debugrank.injection.module;

import android.app.Application;

import com.grapecity.debugrank.javalib.services.thread.IAppThreads;

import rx.Scheduler;
import rx.android.schedulers.AndroidSchedulers;

public class TestAppModule extends AppModule
{
    public TestAppModule(Application application)
    {
        super(application);
    }

    @Override
    IAppThreads providesAppThreads()
    {
        //run everything on main thread for espresso tests
        return new IAppThreads()
        {
            @Override
            public Scheduler mainThread()
            {
                return AndroidSchedulers.mainThread();
            }

            @Override
            public Scheduler newThread()
            {
                return AndroidSchedulers.mainThread();
            }
        };
    }
}


text:
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Highlights the controller when hovering over interactables
//
//=============================================================================

using UnityEngine;
using System.Collections;

namespace Valve.VR.InteractionSystem
{
	//-------------------------------------------------------------------------
	public class ControllerHoverHighlight : MonoBehaviour
	{
		public Material highLightMaterial;
		public bool fireHapticsOnHightlight = true;

		private Hand hand;

		private MeshRenderer bodyMeshRenderer;
		private MeshRenderer trackingHatMeshRenderer;
		private SteamVR_RenderModel renderModel;
		private bool renderModelLoaded = false;

		SteamVR_Events.Action renderModelLoadedAction;

		//-------------------------------------------------
		void Start()
		{
			hand = GetComponentInParent<Hand>();
		}

		//-------------------------------------------------
		void Awake()
		{
			renderModelLoadedAction = SteamVR_Events.RenderModelLoadedAction( OnRenderModelLoaded );
		}

		//-------------------------------------------------
		void OnEnable()
		{
			renderModelLoadedAction.enabled = true;
		}

		//-------------------------------------------------
		void OnDisable()
		{
			renderModelLoadedAction.enabled = false;
		}

		//-------------------------------------------------
		private void OnHandInitialized( int deviceIndex )
		{
			renderModel = gameObject.AddComponent<SteamVR_RenderModel>();
			renderModel.SetDeviceIndex( deviceIndex );
			renderModel.updateDynamically = false;
		}

		//-------------------------------------------------
		private void OnRenderModelLoaded( SteamVR_RenderModel renderModel, bool success )
		{
			if ( renderModel != this.renderModel )
			{
				return;
			}

			Transform bodyTransform = transform.Find( "body" );
			if ( bodyTransform != null )
			{
				bodyTransform.gameObject.layer = gameObject.layer;
				bodyTransform.gameObject.tag = gameObject.tag;
				bodyMeshRenderer = bodyTransform.GetComponent<MeshRenderer>();
				bodyMeshRenderer.material = highLightMaterial;
				bodyMeshRenderer.enabled = false;
			}

			Transform trackingHatTransform = transform.Find( "trackhat" );
			if ( trackingHatTransform != null )
			{
				trackingHatTransform.gameObject.layer = gameObject.layer;
				trackingHatTransform.gameObject.tag = gameObject.tag;
				trackingHatMeshRenderer = trackingHatTransform.GetComponent<MeshRenderer>();
				trackingHatMeshRenderer.material = highLightMaterial;
				trackingHatMeshRenderer.enabled = false;
			}

			foreach ( Transform child in transform )
			{
				if ( ( child.name != "body" ) && ( child.name != "trackhat" ) )
				{
					Destroy( child.gameObject );
				}
			}

			renderModelLoaded = true;
		}

		//-------------------------------------------------
		private void OnParentHandHoverBegin( Interactable other )
		{
			if ( !this.isActiveAndEnabled )
			{
				return;
			}

			if ( other.transform.parent != transform.parent )
			{
				ShowHighlight();
			}
		}

		//-------------------------------------------------
		private void OnParentHandHoverEnd( Interactable other )
		{
			HideHighlight();
		}

		//-------------------------------------------------
		private void OnParentHandInputFocusAcquired()
		{
			if ( !this.isActiveAndEnabled )
			{
				return;
			}

			if ( hand.hoveringInteractable && hand.hoveringInteractable.transform.parent != transform.parent )
			{
				ShowHighlight();
			}
		}

		//-------------------------------------------------
		private void OnParentHandInputFocusLost()
		{
			HideHighlight();
		}

		//-------------------------------------------------
		public void ShowHighlight()
		{
			if ( renderModelLoaded == false )
			{
				return;
			}

			if ( fireHapticsOnHightlight )
			{
				hand.controller.TriggerHapticPulse( 500 );
			}

			if ( bodyMeshRenderer != null )
			{
				bodyMeshRenderer.enabled = true;
			}

			if ( trackingHatMeshRenderer != null )
			{
				trackingHatMeshRenderer.enabled = true;
			}
		}

		//-------------------------------------------------
		public void HideHighlight()
		{
			if ( renderModelLoaded == false )
			{
				return;
			}

			if ( fireHapticsOnHightlight )
			{
				hand.controller.TriggerHapticPulse( 300 );
			}

			if ( bodyMeshRenderer != null )
			{
				bodyMeshRenderer.enabled = false;
			}

			if ( trackingHatMeshRenderer != null )
			{
				trackingHatMeshRenderer.enabled = false;
			}
		}
	}
}


text:
'use strict';

const dotenv = require('dotenv');
let FaceBookStrategy = require('passport-facebook').Strategy; // Import passport-facebook package
let TwitterStrategy = require('passport-twitter').Strategy; //Import passport-twitter package
let GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; //Import Passport Google package
let User = require('../server/model/user-model.js'); //Import user model
let session = require('express-session'); //import express session package
let jwt = require('jsonwebtoken'); //import jwt package
let secret = 'airbud'; //create custom secret to use with jwt

dotenv.load();

module.exports = function(app, passport) {
  //start passport configuration settings
  app.use(passport.initialize());
  app.use(passport.session());
  app.use(session({ secret: 'homeward bound', resave: false, saveUnitialized: true, cookie: {secure: false } }));
  //end passport configuration settings

  //serialize users once logged in
  passport.serializeUser(function(user, done) {
    //check if the user has an active account
    if (user.error) {
      token = 'uncomfirmed/error'; // NOTE: set url to different error page
    } else {
      token = jwt.sign({ username: user.username, email: user.email }, secret, {expiresIn: '24h' }); //if account is active, give user token
    }
  } else {
    token = 'inactive/error'; //if account not active, provide invalid token for use in redirecrting later
  }
  done(null, user.id); //return user Object
  );

  //Deserialize users once logged out
  passport.deserializeUser(function(id, done) {
    User.findById(id, function(err, user) {
      done(err, user); //complete deserializeUser and return done
    });
  });

  //Facebook Strategy
  passport.use(new FaceBookStrategy({
    clientId: process.env.FACEBOOK_CLIENT_ID, //replace with our facebook developer app client id
    clientSecret: process.env.FACEBOOK_CLIENT_SECRET, //replace with our fb developer client Secret
    callbackURL: 'http://localhost:8080/auth/facebook/callback', //replace with our fb developer app callback url
    profileFields: ['id', 'displayName', 'photos', 'email']
  },
    function(accessToken, refreshToken, profile, done) {
      User.findOne({ email: profile._json.email }).select('username active password email').exec(function(err, user) {
        if (err) done(err);

        if (user && user !== null) {
          done(null, user);
        } else {
          done(err);
        }
      });
    }));

    //Twitter Strategy
    passport.use(new TwitterStrategy({
      consumerKey: process.env.TWITTER_KEY, //replace with twitter dev ap consumer KEY
      consumerSecret: process.env.TWITTER_SECRET, //replace with twitter dev app consumer SECRET
      callbackURL: 'http://localhost:3000/auth/twitter/callback', //replace with twitter deve app callback url
      userProfileURL: 'https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true'
    },
    function(token, tokenSecret, profile, done) {
      if(profile.emails) {
        User.findOne({ email: profile.emails[0].value }).select('username active password email').exec(function(err, user) {
          if(err) {
            done(err);
          } else {
            if (user && user !== null) {
              done(null, user);
            } else {
              done(err);
            }
          }
        });
      } else {
        user = {}; //since no user object exists, create temporary one in order to return an error
        user.id = 'null'; //temp id
        user.active = true; //temp status
        user.error = true; //ensure error is known to exist
        done(null, user); //serialize and catch error
      }
    }
  ));

  //Google Strategy
  passport.use(new GoogleStrategy({
    clientID: process.env.GOOGLE_CLIENT_ID, //replace with google developer app client id
    clientSecret: process.env.GOOGLE_CLIENT_SECRET, //replace with google developer app client SECRET
    callbackURL: 'http://localhost:3000/auth/google/callback' //replace with google dev app callbackURL
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOne({ email: profile.emails[0].value}).select('username active password email').exec(function(err, user) {
      if(err) done(err);

      if (user && user !== null) {
        done(null, user);
      } else {
        done(err);
      }
    });
  }));

  //Google routes
  app.get('/auth/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/plug.login', 'profile', 'email'] }));
  app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/googleerror' }), function(req, res) {
    res.redirect('/google/' + token); //redirect user with newly assigned token
  });

  //Twitter routes
  app.get('/auth/twitter', passport.authenticate('twitter'));
  app.get('/auth/twitter/callback', passport.authenticate('twitter', { failureRedirect: '/twittererror' }), function(req, res) {
    res.redirect('/twitter/' + token); //redirect user with newly assigned token
  });

  //Facebook routes
  app.get('/auth/facebook', passport.authenticate('facebook', { scope: 'email' }));
  app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/facebookerror' }), function(req, res) {
    res.redirect('/facebook/' + token); //redirect user with newly assigned token
  });

  return passport; //return passport object
};


text:
An article
##########

:date: 2017-12-17
:author: An Author
:category: A category
:tags: A tag
:summary: Article summary.

There should be a category image + author's twitter in the social meta tag and
two badges with images on the bottom.


text:
package jtime

import (
	"fmt"
	"strconv"
	"time"
)

const (
	Version = "0.1.1"
)

// Time structure, embeds time.Time
type Time struct {
	time.Time
}

// Marshler interface for marshaling/umarshaling time
type Marshaler interface {
	Marshal(t Time) ([]byte, error)
	Unmarshal(data []byte) (Time, error)
}

var marshaler Marshaler

// SetMarshaler sets the current marshaller
func SetMarshaler(m Marshaler) {
	marshaler = m
}

// FormatMarshaler uses time.Time format strings
type FormatMarshaler struct {
	Format string
}

// Marshal will marshal to JSON string in Format
func (fm *FormatMarshaler) Marshal(t Time) ([]byte, error) {
	return []byte(`"` + t.Format(fm.Format) + `"`), nil
}

// Unmarshal from JSON string in Format
func (fm *FormatMarshaler) Unmarshal(data []byte) (Time, error) {
	if len(data) < 2 {
		return Time{}, fmt.Errorf("data too short - %v", data)
	}
	data = data[1 : len(data)-1]
	t, err := time.Parse(fm.Format, string(data))
	if err != nil {
		return Time{}, err
	}
	return Time{t}, err
}

// UnixMarshaler uses integers as format
type UnixMarshaler struct {
	MSec bool // Time in millseconds
}

// Marashal to JSON integer
func (um *UnixMarshaler) Marshal(t Time) ([]byte, error) {
	data := fmt.Sprintf("%d", t.Unix())
	if um.MSec {
		data = fmt.Sprintf("%s%03d", data, t.Nanosecond()/1000)
	}

	return []byte(data), nil
}

// Unmarshal from JSON integer
func (um *UnixMarshaler) Unmarshal(data []byte) (Time, error) {
	sec, err := strconv.ParseInt(string(data), 10, 64)
	if err != nil {
		return Time{}, err
	}
	nsec := int64(0)
	if um.MSec {
		tmp := sec
		sec = sec / 1000
		nsec = (tmp - sec) * 1000
	}

	return Time{time.Unix(sec, nsec)}, nil
}

func validJSONTime(t Time) bool {
	if y := t.Year(); y < 0 || y >= 10000 {
		return false
	}
	return true
}

// MarshalJSON implements the json.Marshaler interface.
func (t Time) MarshalJSON() ([]byte, error) {
	if !validJSONTime(t) {
		return nil, fmt.Errorf("jtime.Time.MarshalJson: year outside of range [0,9999]")
	}
	return marshaler.Marshal(t)
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (t *Time) UnmarshalJSON(data []byte) (err error) {
	*t, err = marshaler.Unmarshal(data)
	return
}

func init() {
	// Default behaviour
	SetMarshaler(&FormatMarshaler{time.RFC3339Nano})
}


text:
NSAttributedString HTML Additions

Introduction

This project aims to duplicate the methods present on Mac OSX which allow creation of NSAttributedString from HTML code.
This is useful for drawing simple rich text - like this document - without having to use a UIWebView.

Hi! I'm Oliver and I appreciate your help!

Features

At present the following tags are supported:

Headers H1 - H6

Paragraphs: P

Bold: B, STRONG

Italic: I, EM

Underline U

Superscript SUP and Subscript SUB, e.g. e = mc2 (Drawing missing)

Strike Out DEL, e.g. Something Removed

FONT (face,color and size 1-7)

Horizontal Rule HR (coloring via background-color style, simplified)

Hyperlinks A (Formatting only, clickable as custom view)

Unordered Lists LI

Ordered Lists OL

Currently attributes are inherited from enclosed tags via brute force. I don't know if this is accurate.

To Do

NSAttributedString+HTML

Variations of the HR tag, currently it's only drawn as single 1px line

DTAttributedTextView

Characters with super/subscript need baseline adjusted when drawn

There is still quite a few more things to do on the project. DEL, possibly CSS styles as they related to fonts and text formatting.

Please Help!

If you find brief test cases where the created NSAttributedString differs from the version on OSX please send them to us!

Follow @cocoanetics on Twitter

This code is covered by a BSD License. © 2011 Oliver Drobnik


text:
package Exo1;

/**
 * Created with IntelliJ IDEA.
 * User: padawan
 * Date: 12/2/13
 * Time: 8:50 AM
 * To change this template use File | Settings | File Templates.
 */
public class Collection {
    /*
    1.  LinkedList : liste chainée avec des éléments qui sont liées comme une chaine
        ArrayList  : liste comme un tableau

    2.  C'EST UNE CLASSE

    3.  Affiche tous les éléments passé en arguments
     */
}