text:
<?php

namespace App\Modules\Nucleo\Controllers;

use App\Modules\Nucleo\Models\Perfils;
use App\Shared\Controllers\ControllerBase;

class PerfilsController extends ControllerBase {

    /**
     * initialize
     */
    public function initialize() {
        $this->tag->setTitle('Perfis');
        parent::initialize();

        $this->entity = new Perfils();
    }

    /**
     * Index action
     */
    public function indexAction() {
        try {
            $this->view->perfils = Perfils::find();
            $this->view->pesquisa = '';

            if ($this->request->isPost()) {

                $users = $this->request->getPost('userId', 'int');
                $groups = $this->request->getPost('groupId', 'int');

                $search = '1 = 1 ';
                if (!empty($this->request->getPost('userId'))) {
                    $search .= " AND UPPER(userId) LIKE UPPER('%{$users}%') ";
                }
                if (!empty($this->request->getPost('groupId'))) {
                    $search .= " AND UPPER(groupId) LIKE UPPER('%{$groups}%') ";
                }

                $this->view->perfils = Perfils::find($search);
                $this->view->pesquisa = 'Usuários: ' . $users . ' | Grupos: ' . $groups;
            }
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
        }
    }

    /**
     * Displays the creation form
     */
    public function newAction() {

    }

    /**
     * Edits a perfil
     *
     * @param string $id
     */
    public function editAction($id) {
        try {

            if ($this->request->isPost()) {
                throw new Exception('Acesso inválido a essa action!!!');
            }

            $perfil = Perfils::findFirstByid($id);
            if (!$perfil) {
                throw new Exception('Perfil não encontrado!');
            }

            $this->view->id = $perfil->id;

            $this->tag->setDefault('id', $perfil->getId());
            $this->tag->setDefault('userId', $perfil->getUserId());
            $this->tag->setDefault('groupId', $perfil->getGroupId());
            $this->tag->setDefault('module', $perfil->getModule());
            $this->tag->setDefault('controller', $perfil->getController());
            $this->tag->setDefault('action', $perfil->getAction());
            $this->tag->setDefault('permission', $perfil->getPermission());
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
            return $this->response->redirect('nucleo/perfils');
        }
    }

    /**
     * Creates a new perfil
     */
    public function createAction() {

        try {

            if (!$this->request->isPost()) {
                throw new Exception('Acesso não permitido a essa action.');
            }

            $perfil = new Perfils();

            $perfil->setId($perfil->autoincrement());
            if (!empty($this->request->getPost('userId'))) {
                $perfil->setUserId($this->request->getPost('userId'));
            } else {
                $perfil->setGroupId($this->request->getPost('groupId'));
            }

            $perfil->setModule($this->request->getPost('module'));
            $perfil->setController($this->request->getPost('controller'));
            $perfil->setAction($this->request->getPost('action'));
            $perfil->setPermission($this->request->getPost('permission'));

            if (!$perfil->create()) {
                $msg = '';
                foreach ($perfil->getMessages() as $message) {
                    $msg .= $message . '
';
                }
                throw new Exception($msg);
            }

            $this->flash->success('Perfil gravado com sucesso!!!');
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
        }
        return $this->response->redirect('nucleo/perfils');
    }

    /**
     * Saves a perfil edited
     *
     */
    public function saveAction() {

        try {

            if (!$this->request->isPost()) {
                throw new Exception('Acesso não permitido a essa action.');
            }

            $id = $this->request->getPost('id');

            $perfil = Perfils::findFirstByid($id);
            if (!$perfil) {
                throw new Exception('Perfil não encontrado!');
            }

            $perfil->setId($this->request->getPost('id'));
            if (!empty($this->request->getPost('userId'))) {
                $perfil->setUserId($this->request->getPost('userId'));
            } else {
                $perfil->setGroupId($this->request->getPost('groupId'));
            }
            $perfil->setModule($this->request->getPost('module'));
            $perfil->setController($this->request->getPost('controller'));
            $perfil->setAction($this->request->getPost('action'));
            $perfil->setPermission($this->request->getPost('permission'));

            if (!$perfil->update()) {

                $msg = '';
                foreach ($perfil->getMessages() as $message) {
                    $msg .= $message . '
';
                }
                throw new Exception($msg);
            }

            $this->flash->success('Perfil atualizado com sucesso!!!');
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
        }
        return $this->response->redirect('nucleo/perfils');
    }

    /**
     * Deletes a perfil
     *
     * @param string $id
     */
    public function deleteAction() {

        try {
            if (!$this->request->isPost()) {
                throw new Exception('Acesso não permitido a essa action.');
            }

            if ($this->request->isAjax()) {
                $this->view->disable();
            }

            $id = $this->request->getPost('id');

            $perfil = Perfils::findFirstByid($id);
            if (!$perfil) {
                throw new Exception('Perfil não encontrado!');
            }

            if (!$perfil->delete()) {

                $msg = '';
                foreach ($perfil->getMessages() as $message) {
                    $msg .= $message . '
';
                }
                throw new Exception($msg);
            }
            echo 'ok';
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
            return $this->response->redirect('nucleo/perfils');
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package co.cask.coopr.client.rest.handler;

import co.cask.coopr.client.rest.RestClientTest;
import com.google.gson.Gson;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.RequestLine;
import org.apache.http.entity.StringEntity;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpRequestHandler;

import java.io.IOException;
import java.util.List;
import javax.ws.rs.HttpMethod;

/**
 * This abstract class contains common logic for test handlers.
 *
 * @param <T> Type of requested object
 */
public abstract class AbstractAdminHandler<T> implements HttpRequestHandler {

  private static final Gson GSON = new Gson();
  private static final String COOPR_TENANT_ID_HEADER_NAME = "Coopr-TenantID";
  private static final String COOPR_USER_ID_HEADER_NAME = "Coopr-UserID";

  @Override
  public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException,
    IOException {

    RequestLine requestLine = request.getRequestLine();
    String method = requestLine.getMethod();
    String url = requestLine.getUri();
    int statusCode = HttpStatus.SC_OK;

    String userId = request.getFirstHeader(COOPR_USER_ID_HEADER_NAME).getValue();
    String tenantId = request.getFirstHeader(COOPR_TENANT_ID_HEADER_NAME).getValue();
    if (userId.equals(RestClientTest.TEST_USER_ID) && tenantId.equals(RestClientTest.TEST_TENANT_ID)) {
      if (HttpMethod.GET.equals(method) && getAllURL().equals(url)) {
        response.setEntity(new StringEntity(GSON.toJson(getAll())));
      } else if (HttpMethod.GET.equals(method)) {
        response.setEntity(new StringEntity(GSON.toJson(getSingle())));
      } else if (!HttpMethod.DELETE.equals(method)) {
        statusCode = HttpStatus.SC_BAD_REQUEST;
      }
    } else {
      statusCode = HandlerUtils.getStatusCodeByTestStatusUserId(userId);
    }
    response.setStatusCode(statusCode);
  }

  public abstract List<T> getAll();
  public abstract T getSingle();
  public abstract String getAllURL();
}


text:
import {Component} from 'angular2/core';
import {RouteParams, ROUTER_DIRECTIVES} from 'angular2/router';
//import {Http} from 'angular2/http';
import {Github} from '../../services/github';

@Component({
  selector: 'repo-detail',
  templateUrl: 'app/components/repo-detail/repo-detail.html',
  styleUrls: ['app/components/repo-detail/repo-detail.css'],
  providers: [],
  directives: [ROUTER_DIRECTIVES],
  pipes: []
})

export class RepoDetail {
  public repoDetails = {};

  constructor(routeParams: RouteParams, github: Github) {
    github.getRepoForOrg(routeParams.get('org'), routeParams.get('name'))
      .subscribe(repoDetails => {
        this.repoDetails = repoDetails;
      });
  }

}


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

namespace LibEDF_DotNet
{
    class EDFReader : BinaryReader
    {
        public EDFReader(FileStream fs) : base(fs) { }
        public EDFReader(byte[] edfBytes) : base(new MemoryStream(edfBytes)) { }

        public EDFHeader ReadHeader()
        {
            EDFHeader h = new EDFHeader();

            this.BaseStream.Seek(0, SeekOrigin.Begin);

            //------ Fixed length header part --------
            h.Version.Value                 = ReadAscii(HeaderItems.Version);
            h.PatientID.Value               = ReadAscii(HeaderItems.PatientID);
            h.RecordID.Value                = ReadAscii(HeaderItems.RecordID);
            h.StartDate.Value               = ReadAscii(HeaderItems.StartDate);
            h.StartTime.Value               = ReadAscii(HeaderItems.StartTime);
            h.NumberOfBytesInHeader.Value   = ReadInt16(HeaderItems.NumberOfBytesInHeader);
            h.Reserved.Value                = ReadAscii(HeaderItems.Reserved);
            h.NumberOfDataRecords.Value     = ReadInt16(HeaderItems.NumberOfDataRecords);
            h.DurationOfDataRecord.Value    = ReadInt16(HeaderItems.DurationOfDataRecord);
            h.NumberOfSignals.Value         = ReadInt16(HeaderItems.NumberOfSignals);

            //------ Variable length header part --------
            int ns = h.NumberOfSignals.Value;
            h.Labels.Value                      = ReadMultipleAscii(HeaderItems.Label, ns);
            h.TransducerType.Value              = ReadMultipleAscii(HeaderItems.TransducerType, ns);
            h.PhysicalDimension.Value           = ReadMultipleAscii(HeaderItems.PhysicalDimension, ns);
            h.PhysicalMinimum.Value             = ReadMultipleDouble(HeaderItems.PhysicalMinimum, ns);
            h.PhysicalMaximum.Value             = ReadMultipleDouble(HeaderItems.PhysicalMaximum, ns);
            h.DigitalMinimum.Value              = ReadMultipleInt(HeaderItems.DigitalMinimum, ns);
            h.DigitalMaximum.Value              = ReadMultipleInt(HeaderItems.DigitalMaximum, ns);
            h.Prefiltering.Value                = ReadMultipleAscii(HeaderItems.Prefiltering, ns);
            h.NumberOfSamplesInDataRecord.Value = ReadMultipleInt(HeaderItems.NumberOfSamplesInDataRecord, ns);
            h.SignalsReserved.Value             = ReadMultipleAscii(HeaderItems.SignalsReserved, ns);

            return h;
        }

        public EDFSignal[] ReadSignals()
        {
            EDFHeader header = ReadHeader();
            EDFSignal[] signals = new EDFSignal[header.NumberOfSignals.Value];

            for (int i = 0; i < signals.Length; i++) {
                signals[i] = new EDFSignal();
                signals[i].Label.Value = header.Labels.Value[i];
                signals[i].NumberOfSamples.Value = header.NumberOfSamplesInDataRecord.Value[i];
            }

            //Read the signal sample values
            int readPosition = header.NumberOfBytesInHeader.Value;

            for (int i = 0; i < signals.Length; i++)
            {
                signals[i].Samples = ReadSignalSamples(readPosition, signals[i].NumberOfSamples.Value);
                readPosition += signals[i].Samples.Length * 2; //2 bytes per integer.
            }

            return signals;
        }

        private short[] ReadSignalSamples(int startPosition, int numberOfSamples)
        {
            var samples = new List<short>();
            int countBytesRead = 0;

            this.BaseStream.Seek(startPosition, SeekOrigin.Begin);

            while (countBytesRead < numberOfSamples * 2) //2 bytes per integer
            {
                byte[] intBytes = this.ReadBytes(2);
                short intVal = BitConverter.ToInt16(intBytes, 0);
                samples.Add(intVal);
                countBytesRead += intBytes.Length;
            }

            return samples.ToArray();
        }

        private Int16 ReadInt16(EDFField itemInfo)
        {
            string strInt = ReadAscii(itemInfo).Trim();
            Int16 intResult = -1;
            try { intResult = Convert.ToInt16(strInt); }
            catch (Exception ex) { Console.WriteLine("Error, could not convert string to integer. " + ex.Message); }
            return intResult;
        }

        private string ReadAscii(EDFField itemInfo)
        {
            byte[] bytes = this.ReadBytes(itemInfo.AsciiLength);
            return AsciiString(bytes);
        }

        private string[] ReadMultipleAscii(EDFField itemInfo, int numberOfParts)
        {
            var parts = new List<string>();

            for (int i = 0; i < numberOfParts; i++) {
                byte[] bytes = this.ReadBytes(itemInfo.AsciiLength);
                parts.Add(AsciiString(bytes));
            }

            return parts.ToArray();
        }

        private int[] ReadMultipleInt(EDFField itemInfo, int numberOfParts)
        {
            var parts = new List<int>();

            for (int i = 0; i < numberOfParts; i++)
            {
                byte[] bytes = this.ReadBytes(itemInfo.AsciiLength);
                string ascii = AsciiString(bytes);
                parts.Add(Convert.ToInt32(ascii));
            }

            return parts.ToArray();
        }

        private double[] ReadMultipleDouble(EDFField itemInfo, int numberOfParts)
        {
            var parts = new List<double>();

            for (int i = 0; i < numberOfParts; i++)
            {
                byte[] bytes = this.ReadBytes(itemInfo.AsciiLength);
                string ascii = AsciiString(bytes);
                parts.Add(Convert.ToDouble(ascii));
            }

            return parts.ToArray();
        }

        private static string AsciiString(byte[] bytes)
        {
            return Encoding.ASCII.GetString(bytes);
        }
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace BehaviorUX
{
  public class NumberArrayPropertyField : ArrayPropertyField<int, NumberField>
  {
    protected override int GetDefaultValue()
    {
      return 0;
    }
  }
}


text:
<?php
/**
 * @category    Fishpig
 * @package     Fishpig_Wordpress
 * @license     http://fishpig.co.uk/license.txt
 * @author      Ben Tideswell <help@fishpig.co.uk>
 */
class Fishpig_Wordpress_PostController extends Fishpig_Wordpress_Controller_Abstract
{
	/**
	 * Used to do things en-masse
	 * eg. include canonical URL
	 *
	 * @return false|Mage_Core_Model_Abstract
	 */
	public function getEntityObject()
	{
		return $this->_initPost();
	}

	/**
	 * Display appropriate message for posted comment
	 *
	 * @return $this
	 */
	public function preDispatch()
	{
		parent::preDispatch();

		$this->_handlePostedComment();

		$post = $this->getEntityObject();

		if ($post->isBlogListingPage()) {
			return $this->_forward('index', 'index', 'wordpress');
		}

		return $this;
	}

	/**
	 * Display the post view page
	 *
	 */
	public function viewAction()
	{
		$post = $this->getEntityObject();

		$layoutHandles = array(
			'wordpress_post_view',
			'wordpress_' . $post->getPostType() . '_view',
		);

		$isHomepage = (bool)$this->getRequest()->getParam('is_homepage');

		if ($post->isHomepagePage() && !$isHomepage) {
			if (Mage::getUrl('', array('_current' => true, '_use_rewrite' => true)) !== Mage::helper('wordpress')->getUrl()) {
				return $this->_redirectUrl(Mage::helper('wordpress')->getUrl());
			}
		}

		if ($post->getTypeInstance()->isHierarchical()) {
			$buffer = $post->getParentPost();

			while ($buffer) {
				$layoutHandles[] = 'wordpress_' . $post->getPostType() . '_view_parent_' . $buffer->getId();

				// Legacy
				if ($post->isType('page')) {
					$layoutHandles[] = 'wordpress_' . $post->getPostType() . '_parent_' . $buffer->getId();
				}

				$buffer = $buffer->getParentPost();
			}
		}

		// Add the layout handle for the post type and ID
		$layoutHandles[] = 'wordpress_' . $post->getPostType() . '_view_' . $post->getId();

		if ($post->isHomepagePage() && $isHomepage) {
			$layoutHandles[] = 'wordpress_frontpage';
		}

		$this->_addCustomLayoutHandles($layoutHandles);
		$this->_initLayout();
		$this->_title(strip_tags($post->getPostTitle()));

		if (($headBlock = $this->getLayout()->getBlock('head')) !== false) {
			$headBlock->addItem(
				'link_rel',
				$post->getCommentFeedUrl(),
				sprintf('rel="alternate" type="application/rss+xml" title="%s » %s Comments Feed"',
					Mage::helper('wordpress')->getWpOption('blogname'),
					$post->getPostTitle()
				)
			);

			if (Mage::helper('wordpress')->getWpOption('default_ping_status') === 'open' && $post->getPingStatus() == 'open') {
				$headBlock->addItem('link_rel', Mage::helper('wordpress')->getBaseUrl() . 'xmlrpc.php', 'rel="pingback"');
			}
		}

		if ($post->getTypeInstance()->hasArchive()) {
			$this->addCrumb($post->getPostType() . '_archive', array('label' => $post->getTypeInstance()->getName(), 'link' => $post->getTypeInstance()->getArchiveUrl()));
		}

		if ($isHomepage) {
			$post->setCanonicalUrl(Mage::helper('wordpress')->getUrl());

			if (Mage::helper('wordpress')->getBlogRoute() === '') {
				$this->_crumbs = array();
			}
			else {
				array_pop($this->_crumbs);
			}
		}
		else if ($post->getTypeInstance()->isHierarchical()) {
			$posts = array();
			$buffer = $post;

			while ($buffer) {
				$this->_title(strip_tags($buffer->getPostTitle()));
				$posts[] = $buffer;
				$buffer = $buffer->getParentPost();
			}

			$posts = array_reverse($posts);

			// Remove current post from end array
			array_pop($posts);

			foreach($posts as $buffer) {
				$this->addCrumb('post_' . $buffer->getId(), array('label' => $buffer->getPostTitle(), 'link' => $buffer->getUrl()));
			}
		}
		else if ($taxonomy = $post->getTypeInstance()->getAnySupportedTaxonomy('category')) {
			if ($term = $post->getParentTerm($taxonomy->getTaxonomyType())) {
				$terms = array();

				while($term) {
					array_unshift($terms, $term);
					$term = $term->getParentTerm();
				}

				foreach($terms as $term) {
					$this->addCrumb('post_' . $term->getTaxonomyType() . '_' . $term->getId(), array('label' => $term->getName(), 'link' => $term->getUrl()));
				}
			}
		}

		if (!$isHomepage) {
			$this->addCrumb('post', array('label' => $post->getPostTitle()));
		}

		$this->renderLayout();
	}

	/**
	 * Display the appropriate message for a posted comment
	 *
	 * @return $this
	 */
	protected function _handlePostedComment()
	{
		$commentId = $this->getRequest()->getParam('comment');

		if ($commentId && $this->getRequest()->getActionName() === 'view') {
			$comment = Mage::getModel('wordpress/post_comment')->load($commentId);

			if ($comment->getId() && $comment->getPost()->getId() === $this->getEntityObject()->getId()) {
				if ($comment->isApproved()) {
					header('Location: ' . $comment->getUrl());
					exit;
				}
				else {
					Mage::getSingleton('core/session')->addSuccess($this->__('Your comment is awaiting moderation.'));
				}
			}
		}

		return $this;
	}

	/**
	 * Initialise the post model
	 * Provides redirects for Guid links when using permalinks
	 *
	 * @return false|Fishpig_Wordpress_Model_Post
	 */
	protected function _initPost()
	{
		if (($post = Mage::registry('wordpress_post')) !== null) {
			$previewId = $this->getRequest()->getParam('preview_id');

			if ($previewId === $post->getId()) {
				$posts = Mage::getResourceModel('wordpress/post_collection')
					->addFieldToFilter('post_parent', $post->getId())
					->addPostTypeFilter('revision')
					->setPageSize(1)
					->setOrder('post_modified', 'desc')
					->load();

				if (count($posts) > 0) {
					$post = $posts->getFirstItem();

					Mage::unregister('wordpress_post');
					Mage::register('wordpress_post', $post);

					return $post;
				}
			}

			return $post;
		}

		$isPreview = $this->getRequest()->getParam('preview', false);

		if ($postId = $this->getRequest()->getParam('p')) {
			$post = Mage::getModel('wordpress/post')->load($postId);

			if ($post->getId()) {
				if ($isPreview || $post->getTypeInstance() && $post->getTypeInstance()->useGuidLinks()) {
					Mage::register('wordpress_post', $post);

					return $post;
				}

				if ($post->canBeViewed()) {
					$this->_redirectUrl($post->getUrl());
					$this->getResponse()->sendHeaders();
					exit;
				}
			}
		}
		else if ($postId = $this->getRequest()->getParam('id')) {
			$post = Mage::getModel('wordpress/post')
				->setPostType($this->getRequest()->getParam('post_type', '*'))
				->load($postId);

			if ($post->getId() && ($post->canBeViewed() || $isPreview)) {
				Mage::register('wordpress_post', $post);

				return $post;
			}
		}

		return false;
	}

	/**
	 * Display the comments feed
	 *
	 * @return void
	 */
	public function feedAction()
	{
		return $this->commentsFeedAction();
	}
}


text:
using System;

namespace Microsoft.OData.ProxyExtensions.Lite
{
    public class ComplexTypeBase
    {
        private Func<Tuple<EntityBase, string>> _entity;

        protected ComplexTypeBase()
        {
        }

        public virtual void SetContainer(Func<Tuple<EntityBase, string>> entity)
        {
            _entity = entity;
        }

        protected Tuple<EntityBase, string> GetContainingEntity(string propertyName)
        {
            return _entity != null ? _entity() : null;
        }

        protected void OnPropertyChanged(string propertyName)
        {
            var tuple = GetContainingEntity(propertyName);

            if (tuple != null)
            {
                tuple.Item1.OnPropertyChanged(tuple.Item2);
            }
        }
    }
}


text:
Spectre
=======

Spectre is a simple, clean and awesome Ghost theme. Great for content and beautiful editorial imagery.


text:
  function getbyclassname(tagname,classname){//ͨ¹ýÀàÃû»ñÈ¡ÔªËغ¯Êý£¬²ÎÊýΪ¸¸ÔªËØ¡¢ÀàÃû£¬·µ»ØֵΪԪËØÊý×é
  var result=new Array();
  var allclass=document.getElementsByTagName(tagname);
  for (var i=0; i<allclass.length;i++ )
  {

   if(classname==allclass[i].className)
	   result.push(allclass[i]);
  }
  return result;
  }

function win(attr)
{//»ñÈ¡¿ÉÊÓÇø³ß´ç£¬²ÎÊýΪheight|width
	switch(attr)
		{
			case 'height'://»ñÈ¡´°¿Ú¸ß¶È
             if (window.innerHeight)
			{
                   winHeight = window.innerHeight;return winHeight;
			}else if ((document.body) && (document.body.clientHeight)){
                   winHeight = document.body.clientHeight;return winHeight;
			}
			if (document.documentElement  && document.documentElement.clientHeight)
             {
                 winHeight = document.documentElement.clientHeight;return winHeight;
             }
			 break;
			case 'width'://»ñÈ¡´°¿Ú¿í¶È
			  if (window.innerWidth){
                   winWidth = window.innerWidth;return winWidth;
			  }else if ((document.body) && (document.body.clientWidth)){
                   winWidth = document.body.clientWidth;   return winWidth;
			  }//ͨ¹ýÉîÈëDocumentÄÚ²¿¶Ôbody½øÐмì²â£¬»ñÈ¡´°¿Ú´óС
             if (document.documentElement  &&document.documentElement.clientWidth)
             {
                 winWidth = document.documentElement.clientWidth;return winWidth;
             }
			 break;
			 case 'scrollTop':
				var scrollTop;
				if(typeof window.pageYOffset != 'undefined'){
				scrollTop = window.pageYOffset;
				}
				else
				if(typeof document.compatMode != 'undefined' &&
				document.compatMode != 'BackCompat'){
				scrollTop = document.documentElement.scrollTop;
				}
				else
				if(typeof document.body != 'undefined'){
				scrollTop = document.body.scrollTop;
				}
				return scrollTop;break;
			default :return 0;break;
		}
}

  function css(obj, attr)
{
	var re=[];
		switch(attr){
		case 'rotate':var transformstr=obj.currentStyle?obj.currentStyle['transform']:document.defaultView.getComputedStyle(obj, false)['webkitTransform']||document.defaultView.getComputedStyle(obj, false)['msTransform']||document.defaultView.getComputedStyle(obj, false)['MozTransform']||document.defaultView.getComputedStyle(obj, false)['OTransform']||document.defaultView.getComputedStyle(obj, false)['transform']+"";
								var matrixarray=transformstr.split(",");
								re.push(Math.asin(matrixarray[1])/Math.PI*180);return re;break;
			default :
			re.push(parseInt(obj.currentStyle?obj.currentStyle[attr]:document.defaultView.getComputedStyle(obj, false)[attr]));return re;break;
		}
}
 function drag(obj){//ʵÏÖÍÏק£¬²ÎÊýΪ¶ÔÏó
	obj.onmousedown=function (ev){//°´ÏÂÊó±ê
	var oev=ev||event;
	var disX=oev.clientX-obj.offsetLeft;
	var disY=oev.clientY-obj.offsetTop;
	document.onmousemove=function (ev){//Í϶¯Êó±ê
	var oev=ev||event;
	var left=oev.clientX-disX;
	var top=oev.clientY-disY;
	obj.style.left=left+'px';//¸üжÔÏóµÄλÖÃ
	obj.style.top=top+'px';
	}
	document.onmouseup=function (){//̧ÆðÊó±ê
	document.onmousemove=null;
	document.onmouseup=null;
	}
	}
 }


text:
var binding = require('binding').Binding.create('fileManagerPrivate');
var eventBindings = require('event_bindings');

// Natives
var fileManagerPrivateNatives = requireNative('file_manager_private');
var fileBrowserHandlerNatives = requireNative('file_browser_handler');

// Internals
var fileManagerPrivateInternal =
    require('binding').Binding.create('fileManagerPrivateInternal').generate();

// Shorthands
var GetFileSystem = fileManagerPrivateNatives.GetFileSystem;
var GetExternalFileEntry = fileBrowserHandlerNatives.GetExternalFileEntry;

binding.registerCustomHook(function(bindingsAPI) {
  var apiFunctions = bindingsAPI.apiFunctions;

  apiFunctions.setCustomCallback('searchDrive',
      function(name, request, callback, response) {
    if (response && !response.error && response.entries) {
      response.entries = response.entries.map(function(entry) {
        return GetExternalFileEntry(entry);
      });
    }

    // So |callback| doesn't break if response is not defined.
    if (!response)
      response = {};

    if (callback)
      callback(response.entries, response.nextFeed);
  });

  apiFunctions.setCustomCallback('searchDriveMetadata',
      function(name, request, callback, response) {
    if (response && !response.error) {
      for (var i = 0; i < response.length; i++) {
        response[i].entry =
            GetExternalFileEntry(response[i].entry);
      }
    }

    // So |callback| doesn't break if response is not defined.
    if (!response)
      response = {};

    if (callback)
      callback(response);
  });

  apiFunctions.setHandleRequest('resolveIsolatedEntries',
                                function(entries, callback) {
    var urls = entries.map(function(entry) {
      return fileBrowserHandlerNatives.GetEntryURL(entry);
    });
    fileManagerPrivateInternal.resolveIsolatedEntries(urls, function(
        entryDescriptions) {
      callback(entryDescriptions.map(function(description) {
        return GetExternalFileEntry(description);
      }));
    });
  });

  apiFunctions.setHandleRequest('getEntryProperties',
                                function(entries, names, callback) {
    var urls = entries.map(function(entry) {
      return fileBrowserHandlerNatives.GetEntryURL(entry);
    });
    fileManagerPrivateInternal.getEntryProperties(urls, names, callback);
  });

  apiFunctions.setHandleRequest('addFileWatch', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.addFileWatch(url, callback);
  });

  apiFunctions.setHandleRequest('removeFileWatch', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.removeFileWatch(url, callback);
  });

  apiFunctions.setHandleRequest('getEntryActions', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.getEntryActions(url, callback);
  });

  apiFunctions.setHandleRequest('executeEntryAction', function(
        entry, actionId, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.executeEntryAction(url, actionId, callback);
  });

  apiFunctions.setHandleRequest('computeChecksum', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.computeChecksum(url, callback);
  });

  apiFunctions.setHandleRequest('getMimeType', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.getMimeType(url, callback);
  });

  apiFunctions.setHandleRequest('pinDriveFile', function(entry, pin, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.pinDriveFile(url, pin, callback);
  });

  apiFunctions.setHandleRequest('executeTask',
      function(taskId, entries, callback) {
        var urls = entries.map(function(entry) {
          return fileBrowserHandlerNatives.GetEntryURL(entry);
        });
        fileManagerPrivateInternal.executeTask(taskId, urls, callback);
      });

  apiFunctions.setHandleRequest('setDefaultTask',
      function(taskId, entries, mimeTypes, callback) {
        var urls = entries.map(function(entry) {
          return fileBrowserHandlerNatives.GetEntryURL(entry);
        });
        fileManagerPrivateInternal.setDefaultTask(
            taskId, urls, mimeTypes, callback);
      });

  apiFunctions.setHandleRequest('getFileTasks', function(entries, callback) {
    var urls = entries.map(function(entry) {
      return fileBrowserHandlerNatives.GetEntryURL(entry);
    });
    fileManagerPrivateInternal.getFileTasks(urls, callback);
  });

  apiFunctions.setHandleRequest('getShareUrl', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.getShareUrl(url, callback);
  });

  apiFunctions.setHandleRequest('getDownloadUrl', function(entry, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.getDownloadUrl(url, callback);
  });

  apiFunctions.setHandleRequest('requestDriveShare', function(
        entry, shareType, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.requestDriveShare(url, shareType, callback);
  });

  apiFunctions.setHandleRequest('setEntryTag', function(
        entry, visibility, key, value, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.setEntryTag(
        url, visibility, key, value, callback);
  });

  apiFunctions.setHandleRequest('cancelFileTransfers', function(
        entries, callback) {
    var urls = entries.map(function(entry) {
      return fileBrowserHandlerNatives.GetEntryURL(entry);
    });
    fileManagerPrivateInternal.cancelFileTransfers(urls, callback);
  });

  apiFunctions.setHandleRequest('startCopy', function(
        entry, parentEntry, newName, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    var parentUrl = fileBrowserHandlerNatives.GetEntryURL(parentEntry);
    fileManagerPrivateInternal.startCopy(
        url, parentUrl, newName, callback);
  });

  apiFunctions.setHandleRequest('zipSelection', function(
        parentEntry, entries, destName, callback) {
    var parentUrl = fileBrowserHandlerNatives.GetEntryURL(parentEntry);
    var urls = entries.map(function(entry) {
      return fileBrowserHandlerNatives.GetEntryURL(entry);
    });
    fileManagerPrivateInternal.zipSelection(
        parentUrl, urls, destName, callback);
  });

  apiFunctions.setHandleRequest('validatePathNameLength', function(
        entry, name, callback) {
    var url = fileBrowserHandlerNatives.GetEntryURL(entry);
    fileManagerPrivateInternal.validatePathNameLength(url, name, callback);
  });
});

eventBindings.registerArgumentMassager(
    'fileManagerPrivate.onDirectoryChanged', function(args, dispatch) {
  // Convert the entry arguments into a real Entry object.
  args[0].entry = GetExternalFileEntry(args[0].entry);
  dispatch(args);
});

exports.binding = binding.generate();


text:
namespace YAF.Controls
{

    public partial class ForumStatistics
    {

        /// <summary>
        /// UpdateStatsPanel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.UpdatePanel UpdateStatsPanel;

        /// <summary>
        /// StatsHeader control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.LocalizedLabel StatsHeader;

        /// <summary>
        /// StatsPostsTopicCount control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label StatsPostsTopicCount;

        /// <summary>
        /// StatsLastPostHolder control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.PlaceHolder StatsLastPostHolder;

        /// <summary>
        /// StatsLastPost control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label StatsLastPost;

        /// <summary>
        /// LastPostUserLink control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.UserLink LastPostUserLink;

        /// <summary>
        /// StatsMembersCount control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label StatsMembersCount;

        /// <summary>
        /// StatsNewestMember control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label StatsNewestMember;

        /// <summary>
        /// NewestMemberUserLink control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.UserLink NewestMemberUserLink;

        /// <summary>
        /// AntiSpamStatsHolder control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.PlaceHolder AntiSpamStatsHolder;

        /// <summary>
        /// StatsSpamDenied control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.LocalizedLabel StatsSpamDenied;

        /// <summary>
        /// StatsSpamBanned control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.LocalizedLabel StatsSpamBanned;

        /// <summary>
        /// StatsSpamReported control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::YAF.Web.Controls.LocalizedLabel StatsSpamReported;
    }
}


text:
<?php
namespace Th\FileDownloader\Exceptions;

/**
 * Exception class for handling exceptions while downloading files. The error codes can be found in the FileDownloader
 * class.
 *
 * @author Thomas Marinissen
 */
class DownloadException extends \Exception {

    /**
     * Create a new Download exception. The message sent is defined in the
     * privat codeToMessage method of this class.
     *
     * @param   int             The error message identifier
     */
    public function __construct($code) {
        // get the error message
        $message = $this->codeToMessage($code);

        // call the parent
        parent::__construct($message, $code);
    }

    /**
     * Method that switches the error code constants till it finds the messages
     * that belongs to the error code and then returns the message.
     *
     * @param   int                 The error code
     * @return  string              The error message
     */
    private function codeToMessage($code) {
        // get the error message belong to the given code
        switch ($code) {
            case \Th\FileDownloader::FILE_WRONG_MIME:
                $message = "File is of the wrong MIME type";
                break;
            case \Th\FileDownloader::FILE_WRONG_EXTENSION:
                $message = "File is of the wrong extension";
                break;
            case \Th\FileDownloader::INVALID_DOWNLOAD_DIR:
                $message = "User set download directory does not exist";
                break;
            default:
                $message = "Unknown download error";
                break;
        }

        // done, return the error message
        return $message;
    }
}


text:
Simple tracking plugins for Google Analytics inspired by (googleanalytics/autotrack)[<https://github.com/googleanalytics/autotrack>]

trackThis.js assumes you're using universal analytics and have included it in your project as per Google's instructions

## Plugins

Plugin                       | Description                                                                   | Default
---------------------------- | ----------------------------------------------------------------------------- | -------------------------
`trackThisIntraPageLink`     | Automatically track links which change the current page hash                  |
`trackThisLinkProtocol`      | Track links matching the given protocol                                       | mailto, tel
`trackThisFileDownload`      | Track file download links                                                     | pdf, zip, 7zip, doc, docx
`trackThisOpenExternalInTab` | Helper function to open all links pointing to a different domain in a new tab

## Installation

You can simply include the `dist/trackThis.js` file in your page, after your Google Analytics code if you like.

### Webpack, Browserify, etc...

Install from npm (using the `[githubUsername]/[project]` format)

```batch
npm install trackThis.js
```

```Javascript
import 'trackthis.js';

ga('require', 'trackThisIntraPageLink');
ga('require', 'trackThisLinkProtocol');
ga('require', 'trackThisFileDownload');
ga('require', 'trackThisOpenExternalInTab');
```

Or, just include the plugins you're interested in

```Javascript
import 'trackthis.js/src/plugins/TrackThisFileDownload';

ga('require', 'trackThisFileDownload');
```

## Setting Up

- Add universal analytics to your project
- Include trackThis.js
- Enable trackThis plugins via `ga('require', [pluginName])`
- Enjoy extra data directly to your analytics account

## Additional options

All examples provided below are the default values

### trackThisFileDownload

We can define which file extensions to track

```Javascript
import 'trackthis.js';

const options = {
  extensions: ['pdf', 'zip', '7zip', 'doc', 'docx']
};

ga('require', 'trackThisFileDownload', options);
```

### TrackThisLinkProtocol

Each protocol requires a `category` which is passed to Google Analytics as the `eventCategory`

```Javascript
import 'trackthis.js';

const options = {
  protocols: {
    'mailto:': {
      category: 'Mail send'
    },
    'tel:': {
      category: 'Phone number'
    }
  }
};

ga('require', 'trackThisLinkProtocol', options);
```


text:
"""Cache JIRA basic authentication sessions to disk for console apps.

Designed for command line programs/scripts as a context manager. When used, the JIRA class attempts to resume a
previously saved session stored on disk (by default in the user's home directory). If the session has expired or fails,
the user will be prompted for their credentials, and upon authentication the session cookie is cached to disk. The main
goal of this library is to avoid having the user repeatedly enter their JIRA credentials every time they use a console
application, either within the same process or when they re-run an application which uses this library.

https://github.com/Robpol86/jira-context
https://pypi.python.org/pypi/jira-context
"""

from __future__ import print_function
import base64
from getpass import getpass
import json
import os
import sys

import jira.client
from jira.exceptions import JIRAError

__author__ = '@Robpol86'
__license__ = 'MIT'
__version__ = '1.0.0'

_PY3 = bool(sys.version_info[0] == 3)
INPUT = input if _PY3 else raw_input

def _load_cookies(file_path):
    """Read cached cookies from file. Filters out everything but JSESSIONID.

    Positional arguments:
    file_path -- string representing the file path to where cookie data is to be stored on disk.

    Returns:
    Dict of cookies restored from file. Otherwise returns an empty dict.
    """
    # Check file.
    if not os.path.isfile(file_path) or not os.access(file_path, os.R_OK):
        return dict()

    # Read file.
    with open(file_path, 'rb') as f:
        contents = f.read(1024)
    if not contents:
        return dict()

    # Parse file.
    try:
        decoded = base64.b64decode(contents).decode('ascii')
        parsed = json.loads(decoded)
        sanitized = dict((k, v) for k, v in parsed.items() if k == 'JSESSIONID' and v.isalnum())
    except (AttributeError, TypeError, ValueError):
        return dict()

    return sanitized

def _save_cookies(file_path, dict_object):
    """Cache cookies dictionary to file. Filters out everything but JSESSIONID.

    Positional arguments:
    file_path -- string representing the file path to where cookie data is to be stored on disk.
    dict_object -- dict containing the current JIRA session via JIRA()._session.cookies.get_dict().
    """
    # Encode dict_object.
    sanitized = dict((k, v) for k, v in dict_object.items() if k == 'JSESSIONID' and str(v).isalnum())
    json_string = json.dumps(sanitized)
    encoded = base64.b64encode(json_string.encode('ascii'))

    # Remove existing files.
    try:
        os.remove(file_path)
    except OSError:
        pass

    # Write file.
    old_mask = os.umask(0o077)
    with open(file_path, 'wb') as f:
        f.seek(0)
        f.truncate()
        f.write(encoded)
        f.flush()
        if hasattr(os, 'fdatasync'):
            os.fdatasync(f.fileno())  # Linux only.
    os.umask(old_mask)

def _prompt(func, prompt):
    """Prompts user for data. This is for testing."""
    return func(prompt)

class JIRA(jira.client.JIRA):
    """jira.client.JIRA subclass, basically makes the original JIRA library context-aware.

    Authentication happens not during instantiation but when the context is entered (using the `with` statement). Cookie
    caching only happens on context exit (after the `with` code block) if authentication was successful and a new cookie
    was returned by the JIRA server.

    Class variables (persists until the application terminates):
    ABORTED_BY_USER -- False by default. Set to True if USER_CAN_ABORT is True and the user enters a blank username or
        password. If this variable is ever set to True, this class will never authenticate (both cookie or password
        methods).
    COOKIE_CACHE_FILE_PATH -- file path to the cache file used to store the base64 encoded session cookie.
    FORCE_USER -- if set to a string, user won't be prompted for their username. Value of this variable will be used
        instead.
    USER_CAN_ABORT -- by default if a user enters a blank username or password, it is understood that they do not want
        to authenticate to the JIRA server. Set this to False to send blank user/passwords to the JIRA server which will
        inevitably result in an authentication error, causing the program to prompt the user for their credentials
        again.

    Instance variables:
    prompt_for_credentials -- by default user will be prompted for credentials if cached cookies fail. If False the user
        won't be prompted for credentials. If cached cookies are valid then the program may be able to authenticate if
        they are not invalid. If cached cookies are not available or are invalid/expired and this is True, user will not
        be authenticated and `authentication_failed` will be set to True. This variable is useful to set during
        instantiation when used within a thread.
    authentication_failed -- will be set to True if authentication was not successful and user is not prompted for
        credentials.
    """

    ABORTED_BY_USER = False
    COOKIE_CACHE_FILE_PATH = os.path.join(os.path.expanduser('~'), '.jira_session_json')
    FORCE_USER = None
    MESSAGE_AUTH_ERROR = 'Error occurred, try again.'
    MESSAGE_AUTH_FAILURE = 'Authentication failed or bad password, try again.'
    PROMPT_PASS = 'JIRA password: '
    PROMPT_USER = 'JIRA username: '
    USER_CAN_ABORT = True

    def __init__(self, prompt_for_credentials=True, *args, **kwargs):
        self.authentication_failed = False
        self.prompt_for_credentials = prompt_for_credentials
        self.__authenticated_with_cookies = False  # True if cached cookies were used to authenticate successfully.
        self.__authenticated_with_password = False  # True if cached cookies were not used to authenticate successfully.
        self.__cached_cookies = _load_cookies(self.COOKIE_CACHE_FILE_PATH)
        self.__delayed_args = (args, kwargs)

    def __enter__(self):
        """Entering context, ask user for credentials if cookies fail."""
        if self.ABORTED_BY_USER:
            return self

        # Prompt for credentials until valid ones are given, user aborts, or user presses ctrl+c.
        while True:
            if self.__cached_cookies:
                # No need to prompt for credentials.
                authenticated = self.__authenticate()
            elif not self.prompt_for_credentials:
                # Unable to authenticate.
                self.authentication_failed = True
                return self
            else:
                username = self.FORCE_USER or _prompt(INPUT, self.PROMPT_USER)
                if not username and self.USER_CAN_ABORT:
                    JIRA.ABORTED_BY_USER = True
                    return self
                password = _prompt(getpass, self.PROMPT_PASS)
                if not password and self.USER_CAN_ABORT:
                    JIRA.ABORTED_BY_USER = True
                    return self
                authenticated = self.__authenticate((username, password))

            if authenticated:
                return self

    def __exit__(self, *_):
        """Caches cookies to disk if they have changed."""
        if self.ABORTED_BY_USER or self.authentication_failed:
            # Unable to authenticate, not saving cookies.
            return
        if self.__authenticated_with_cookies or not self.__cached_cookies:
            # Previous session resumed from cached cookies or no cookies to cache, not saving cookies.
            return
        _save_cookies(self.COOKIE_CACHE_FILE_PATH, self.__cached_cookies)

    def __authenticate(self, basic_auth=None):
        """Attempt to authenticate to the JIRA server with either cookies or basic authentication. Handles errors too.

        If self.prompt_for_credentials is True, prints error messages to stderr.

        Keyword arguments:
        basic_auth -- tuple to be passed to jira.client.JIRA.__init__() parent class. First string is the username,
            second string is the password. None if using cookie authentication.

        Returns:
        True if successfully authenticated, False otherwise.
        """
        try:
            # Call delayed __init__() method from parent class.
            args, kwargs = self.__delayed_args
            super(JIRA, self).__init__(basic_auth=basic_auth, *args, **kwargs)

            # Inject cached cookies.
            for k, v in self.__cached_cookies.items():
                self._session.cookies.set(k, v)

            # Validate cookies or credentials. May raise JIRAError.
            self.session()

        except JIRAError as e:
            if e.status_code != 401:
                # Some unknown error occurred.
                if self.prompt_for_credentials and self.MESSAGE_AUTH_ERROR:
                    print(self.MESSAGE_AUTH_ERROR, file=sys.stderr)
            elif self.__cached_cookies:
                # User has not entered a password. Probably invalid cookies, probably first iteration.
                pass
            else:
                # JIRAError raised HTTP 401 and cookies are not cached, invalid password.
                if self.prompt_for_credentials and self.MESSAGE_AUTH_FAILURE:
                    print(self.MESSAGE_AUTH_FAILURE, file=sys.stderr)
            self.authentication_failed = True
            self.__cached_cookies = dict()
            self.__authenticated_with_cookies = False
            self.__authenticated_with_password = False
            return False

        # Authentication was successful if this is reached.
        self.authentication_failed = False
        self.__cached_cookies = self._session.cookies.get_dict() if basic_auth else self.__cached_cookies
        self.__authenticated_with_cookies = not bool(basic_auth)
        self.__authenticated_with_password = bool(basic_auth)
        return True


text:
/**
 * Bootstrap Table norwegian translation
 * Author: Jim Nordbø, jim@nordb.no
 */

$.fn.bootstrapTable.locales['nb-NO'] = $.fn.bootstrapTable.locales['nb'] = {
  formatCopyRows () {
    return 'Copy Rows'
  },
  formatPrint () {
    return 'Print'
  },
  formatLoadingMessage () {
    return 'Oppdaterer, vennligst vent'
  },
  formatRecordsPerPage (pageNumber) {
    return `${pageNumber} poster pr side`
  },
  formatShowingRows (pageFrom, pageTo, totalRows, totalNotFiltered) {
    if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
      return `Viser ${pageFrom} til ${pageTo} av ${totalRows} rekker (filtered from ${totalNotFiltered} total rows)`
    }

    return `Viser ${pageFrom} til ${pageTo} av ${totalRows} rekker`
  },
  formatSRPaginationPreText () {
    return 'previous page'
  },
  formatSRPaginationPageText (page) {
    return `to page ${page}`
  },
  formatSRPaginationNextText () {
    return 'next page'
  },
  formatDetailPagination (totalRows) {
    return `Showing ${totalRows} rows`
  },
  formatClearSearch () {
    return 'Clear Search'
  },
  formatSearch () {
    return 'Søk'
  },
  formatNoMatches () {
    return 'Ingen poster funnet'
  },
  formatPaginationSwitch () {
    return 'Hide/Show pagination'
  },
  formatPaginationSwitchDown () {
    return 'Show pagination'
  },
  formatPaginationSwitchUp () {
    return 'Hide pagination'
  },
  formatRefresh () {
    return 'Oppdater'
  },
  formatToggleOn () {
    return 'Show card view'
  },
  formatToggleOff () {
    return 'Hide card view'
  },
  formatColumns () {
    return 'Kolonner'
  },
  formatColumnsToggleAll () {
    return 'Toggle all'
  },
  formatFullscreen () {
    return 'Fullscreen'
  },
  formatAllRows () {
    return 'All'
  },
  formatAutoRefresh () {
    return 'Auto Refresh'
  },
  formatExport () {
    return 'Export data'
  },
  formatJumpTo () {
    return 'GO'
  },
  formatAdvancedSearch () {
    return 'Advanced search'
  },
  formatAdvancedCloseButton () {
    return 'Close'
  },
  formatFilterControlSwitch () {
    return 'Hide/Show controls'
  },
  formatFilterControlSwitchHide () {
    return 'Hide controls'
  },
  formatFilterControlSwitchShow () {
    return 'Show controls'
  }
}

$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['nb-NO'])


text:
var express = require('express'),
    stylus = require('stylus'),
    nib = require('nib'),
    mongoose = require('mongoose'),
    fs = require('fs'),
    path = require('path');

//==================
// Initialization
//==================
var port = process.env.PORT || 3000;
var app = express();

// Include Models
mongoose.connect('mongodb://localhost/mentr');
var models_path = __dirname + '/schemas';
fs.readdirSync(models_path).forEach(function (file) {
    if (~file.indexOf('.js')) require(models_path + '/' + file)
});

// Index shared files
var shared_files = {};
var shared_path = __dirname + '/node_modules/shared/bin';
fs.readdirSync(shared_path).forEach(function (file) {
    if (~file.indexOf('.js')) {
        shared_files[file] = shared_path + '/' + file;
    }
});

// Index partials
var view_partials = [];
var partials_path = __dirname + '/views/partials';
fs.readdirSync(partials_path).forEach(function (file) {
    if (~file.indexOf('.jade')) {
        view_partials.push( file.substring(0, file.length-5) );
    }
});

//==================
// Configuration
//==================
app.configure(function () {
    app.set('port', port);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.set('view options', {layout:false});
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.cookieParser());

    app.use( '/api', require('./controllers/api/api.js') );
    app.use( require('./controllers/root.js') );
    app.get( '/shared/:filename', function(req, res) {
        var requestedFile = shared_files[req.param('filename')];
        if( requestedFile )
            res.sendfile( requestedFile );
        else
            res.send(404);
    });
    app.get( '/partials/:filename', function(req, res) {
        if( ~view_partials.indexOf(req.param('filename')) )
            res.render( 'partials/' + req.param('filename') );
        else
            res.send(404);
    });

    app.use(stylus.middleware({
        src: __dirname + '/public',
        debug: true,
        force: true,
        compile: function(str, path) {
            return stylus(str)
                .set('filename', path)
                .use( nib() );
        }
    }));
    app.use(express.static(path.join(__dirname + '/public')));
});

app.configure('development', function () {
    app.locals.pretty = true;
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

app.configure('production', function () {
    app.use(express.errorHandler());
});

//==================
// Start Server
//==================
app.listen(port, function () {
    console.log("Express server listening on port %d in %s mode", port, app.settings.env);
});


text:
<component name="libraryTable">
  <library name="Maven: com.cybersource:security:1.0">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/cybersource/security/1.0/security-1.0.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/cybersource/security/1.0/security-1.0-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/cybersource/security/1.0/security-1.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
(function(){

  angular
       .module('consumable')
       .controller('ConsumableController', [
          'consumableService', '$mdSidenav', '$mdBottomSheet', '$log', '$q',
          ConsumableController
       ]);

  /**
   * Main Controller for the Angular Material Starter App
   * @param $scope
   * @param $mdSidenav
   * @param avatarsService
   * @constructor
   */
  function ConsumableController( consumableService, $mdSidenav, $mdBottomSheet, $log, $q) {
    var self = this;
    console.log("created the User Controller");
    self.selected     = null;
    self.consumables        = [ ];
    self.selectUser   = selectUser;
    self.toggleList   = toggleUsersList;
    self.showContactOptions  = showContactOptions;

    // Load all registered users

    consumableService
          .loadAllConsumables()
          .then( function( consumables ) {
            self.consumables    = [].concat(consumables);
            self.selected = consumables[0];
          });

    // *********************************
    // Internal methods
    // *********************************

    /**
     * First hide the bottomsheet IF visible, then
     * hide or Show the 'left' sideNav area
     */
    function toggleUsersList() {

        //$mdSidenav('left').toggle();

    }

    /**
     * Select the current avatars
     * @param menuId
     */
    function selectUser ( consumable ) {
      self.selected = angular.isNumber(consumable) ? $scope.consumables[consumable] : consumable;
      self.toggleList();
    }

    /**
     * Show the bottom sheet
     */
    function showContactOptions($event) {
        var user = self.selected;

        return $mdBottomSheet.show({
          parent: angular.element(document.getElementById('content')),
          templateUrl: './src/users/view/contactSheet.html',
          controller: [ '$mdBottomSheet', ContactPanelController],
          controllerAs: "cp",
          bindToController : true,
          targetEvent: $event
        }).then(function(clickedItem) {
          clickedItem && $log.debug( clickedItem.name + ' clicked!');
        });

        /**
         * Bottom Sheet controller for the Avatar Actions
         */
        function ContactPanelController( $mdBottomSheet ) {
          this.user = user;
          this.actions = [
            { name: 'Phone'       , icon: 'phone'       , icon_url: 'assets/svg/phone.svg'},
            { name: 'Twitter'     , icon: 'twitter'     , icon_url: 'assets/svg/twitter.svg'},
            { name: 'Google+'     , icon: 'google_plus' , icon_url: 'assets/svg/google_plus.svg'},
            { name: 'Hangout'     , icon: 'hangouts'    , icon_url: 'assets/svg/hangouts.svg'}
          ];
          this.submitContact = function(action) {
            $mdBottomSheet.hide(action);
          };
        }
    }

  }

})();


text:
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace Stock_LUIS
{
    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Json settings
            config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
            config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented;
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings()
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                Formatting = Newtonsoft.Json.Formatting.Indented,
                NullValueHandling = NullValueHandling.Ignore,
            };

            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }
}


text:
class ModelNotCreated < StandardError
end

class SunspotError < StandardError
end


text:
Gerrit.install(function(self) {
    function onJenkinsbuildRevision(c) {
      var label = c.textfield();
      var button = c.button('Build on Jenkins', {onclick: function(){
        c.call(
          {label: label.value},
          function(r) {
            c.hide();
            window.alert(r);
            c.refresh();
          });
      }});
      c.popup(c.div(
        c.prependLabel('Build start', label),
        c.br(),
        button));
      label.focus();
    }
    self.onAction('revision', 'jenkinsbuild-revision', onJenkinsbuildRevision);
  });


text:
require 'importable/dsl'
require 'importable/report'
require 'active_support'

module Importable

  module ActiveRecord

    module Import
      extend ActiveSupport::Concern
      include Importable::DSL

      module ClassMethods

        def import(filename, options={})
          records = []
          report  = Report.new(filename)

          parse_csv(filename, options) do |attributes, lineno|
            record = create(attributes)

            if record.valid?
              yield record if block_given?
              records << record
            else
              report.report_errors(record.errors, lineno)
            end

          end

          report
        end

      end

    end

  end

end


text:
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*
 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
 Copyright (C) 2003, 2004 StatPro Italia srl
 Copyright (C) 2003 Nicolas Di Césaré
 Copyright (C) 2006, 2007 Cristina Duminuco
 Copyright (C) 2006 Ferdinando Ametrano
 Copyright (C) 2007 Giorgio Facchinetti

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

/*! \file floatingratecoupon.hpp
    \brief Coupon paying a variable index-based rate
*/

#ifndef quantlib_floating_rate_coupon_hpp
#define quantlib_floating_rate_coupon_hpp

#include <ql/cashflows/coupon.hpp>
#include <ql/patterns/visitor.hpp>
#include <ql/time/daycounter.hpp>
#include <ql/handle.hpp>

namespace QuantLib {

    class InterestRateIndex;
    class YieldTermStructure;
    class FloatingRateCouponPricer;

    //! base floating-rate coupon class
    class FloatingRateCoupon : public Coupon,
                               public Observer {
      public:
        FloatingRateCoupon(const Date& paymentDate,
                           Real nominal,
                           const Date& startDate,
                           const Date& endDate,
                           Natural fixingDays,
                           const boost::shared_ptr<InterestRateIndex>& index,
                           Real gearing = 1.0,
                           Spread spread = 0.0,
                           const Date& refPeriodStart = Date(),
                           const Date& refPeriodEnd = Date(),
                           const DayCounter& dayCounter = DayCounter(),
                           bool isInArrears = false);

        //! \name CashFlow interface
        //@{
        Real amount() const { return rate() * accrualPeriod() * nominal(); }
        //@}

        //! \name Coupon interface
        //@{
        Rate rate() const;
        Real price(const Handle<YieldTermStructure>& discountingCurve) const;
        DayCounter dayCounter() const { return dayCounter_; }
        Real accruedAmount(const Date&) const;
        //@}

        //! \name Inspectors
        //@{
        //! floating index
        const boost::shared_ptr<InterestRateIndex>& index() const;
        //! fixing days
        Natural fixingDays() const { return fixingDays_; }
        //! fixing date
        virtual Date fixingDate() const;
        //! index gearing, i.e. multiplicative coefficient for the index
        Real gearing() const { return gearing_; }
        //! spread paid over the fixing of the underlying index
        Spread spread() const { return spread_; }
        //! fixing of the underlying index
        virtual Rate indexFixing() const;
        //! convexity adjustment
        virtual Rate convexityAdjustment() const;
        //! convexity-adjusted fixing
        virtual Rate adjustedFixing() const;
        //! whether or not the coupon fixes in arrears
        bool isInArrears() const { return isInArrears_; }
        //@}

        //! \name Observer interface
        //@{
        void update() { notifyObservers(); }
        //@}

        //! \name Visitability
        //@{
        virtual void accept(AcyclicVisitor&);
        //@}

        void setPricer(const boost::shared_ptr<FloatingRateCouponPricer>&);
        boost::shared_ptr<FloatingRateCouponPricer> pricer() const;
      protected:
        //! convexity adjustment for the given index fixing
        Rate convexityAdjustmentImpl(Rate fixing) const;
        boost::shared_ptr<InterestRateIndex> index_;
        DayCounter dayCounter_;
        Natural fixingDays_;
        Real gearing_;
        Spread spread_;
        bool isInArrears_;
        boost::shared_ptr<FloatingRateCouponPricer> pricer_;
    };

    // inline definitions

    inline const boost::shared_ptr<InterestRateIndex>&
    FloatingRateCoupon::index() const {
        return index_;
    }

    inline Rate FloatingRateCoupon::convexityAdjustment() const {
        return convexityAdjustmentImpl(indexFixing());
    }

    inline Rate FloatingRateCoupon::adjustedFixing() const {
        return (rate()-spread())/gearing();
    }

    inline boost::shared_ptr<FloatingRateCouponPricer>
    FloatingRateCoupon::pricer() const {
        return pricer_;
    }

    inline Rate
    FloatingRateCoupon::convexityAdjustmentImpl(Rate fixing) const {
        return (gearing() == 0.0 ? 0.0 : adjustedFixing()-fixing);
    }

    inline void FloatingRateCoupon::accept(AcyclicVisitor& v) {
        Visitor<FloatingRateCoupon>* v1 =
            dynamic_cast<Visitor<FloatingRateCoupon>*>(&v);
        if (v1 != 0)
            v1->visit(*this);
        else
            Coupon::accept(v);
    }

}

#endif


text:
/**
 * 首页东阿新闻栏目
 */
var Path = window.location.href;
// 栏目切换
$().ready(
		function() {
			Path = Path.substr(0, Path.indexOf("index.htm"));
			$("#dongexinwen_t1").mouseenter(
					function() {
						$(".dongexinwen_div").css("display", "none");
						$("#dongexinwen_div1").css("display", "block");
						$(".dongexinwen_t_active").addClass("dongexinwen_t")
								.removeClass("dongexinwen_t_active");
						$(this).removeClass("dongexinwen_t").addClass(
								"dongexinwen_t_active");
						$(".dongexinwenReadMore").attr("href",
								Path + "news.htm");
					});
			$("#dongexinwen_t2").mouseenter(
					function() {
						$(".dongexinwen_div").css("display", "none");
						$("#dongexinwen_div2").css("display", "block");
						$(".dongexinwen_t_active").addClass("dongexinwen_t")
								.removeClass("dongexinwen_t_active");
						$(this).removeClass("dongexinwen_t").addClass(
								"dongexinwen_t_active");
						$(".dongexinwenReadMore").attr("href",
								Path + "zibuyangsheng.htm");
					});
			$("#dongexinwen_t3").mouseenter(
					function() {
						$(".dongexinwen_div").css("display", "none");
						$("#dongexinwen_div3").css("display", "block");
						$(".dongexinwen_t_active").addClass("dongexinwen_t")
								.removeClass("dongexinwen_t_active");
						$(this).removeClass("dongexinwen_t").addClass(
								"dongexinwen_t_active");
						$(".dongexinwenReadMore").attr("href",
								Path + "tender/zhaobiao.htm");
					});

		});
/**
 * 传统中药栏目切换
 */
var timer;// 定时器
var itemWidth;// 图片的宽度
var currentIndex = 1;// 当前显示
var durTime = 1000;// 动画时间
var delayTime = 3000;// 动画延迟时间
var isRunning=false;
function productChange(index) {
	currentIndex = index;
	// 修改顶部块的显示
	$(".gongsichanpindaohang1").removeClass("gongsichanpindaohang1").addClass(
			"gongsichanpindaohang2");
	$("#gongsichanpindaohang" + index).removeClass("gongsichanpindaohang2")
			.addClass("gongsichanpindaohang1");
	// 修改下面显示区域
	$(".gongsichanpinshow1").removeClass("gongsichanpinshow1").addClass(
			"gongsichanpinshow2");
	$("#gongsichanpindaohang" + index + "_show").removeClass(
			"gongsichanpinshow2").addClass("gongsichanpinshow1");
	clearInterval(timer);
	isRunning=false;
	if (index == 1) {
		timer = setInterval(function() {
			item1changeToLeft();
		}, delayTime);
	}
	if (index == 2) {
		timer = setInterval(function() {
			item2changeToLeft();
		}, delayTime);
	}
	if (index == 3) {
		timer = setInterval(function() {
			item3changeToLeft();
		}, delayTime);
	}

}

$().ready(function() {
	var contentWidth = parseInt($("#gongsichanpindaohang1_show").css("width"));
	itemWidth = contentWidth / 3;
	timer = setInterval(function() {
		item1changeToLeft();
	}, delayTime);
	$(".item").css("width", itemWidth);
});

function item1changeToLeft() {
	isRunning=true;
	var len = $("#content1 > div").size();
	if (len > 3) {
		var firstItem = $("#content1 > div").eq(0);
		$("#content1").animate({
			"left" : 0 - itemWidth
		}, durTime, function() {
			$(firstItem).remove();
			$("#content1").css("left", 0);
			$(firstItem).appendTo($("#content1"));
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}else{
		isRunning=false;
	}
}
function item2changeToLeft() {
	isRunning=true;
	var len = $("#content2 > div").size();
	if (len > 3) {
		var firstItem = $("#content2 > div").eq(0);
		$("#content2").animate({
			"left" : 0 - itemWidth
		}, durTime, function() {
			$(firstItem).remove();
			$("#content2").css("left", 0);
			$(firstItem).appendTo($("#content2"));
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}else{
		isRunning=false;
	}
}
function item3changeToLeft() {
	isRunning=true;
	var len = $("#content3 > div").size();
	if (len > 3) {
		var firstItem = $("#content3 > div").eq(0);
		$("#content3").animate({
			"left" : 0 - itemWidth
		}, durTime, function() {
			$(firstItem).remove();
			$("#content3").css("left", 0);
			$(firstItem).appendTo($("#content3"));
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}else{
		isRunning=false;
	}
}
function item1changeToRight() {
	isRunning=true;
	var len = $("#content1 > div").size();
	if (len > 3) {
		var lastItem = $("#content1 > div").eq(len-1);
		$(lastItem).remove();
		$(lastItem).prependTo($("#content1"));
		$("#content1").css("left",0-itemWidth);
		$("#content1").animate({
			"left" : 0
		}, durTime, function() {
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}
}
function item2changeToRight() {
	isRunning=true;
	var len = $("#content2 > div").size();
	if (len > 3) {
		var lastItem = $("#content2 > div").eq(len-1);
		$(lastItem).remove();
		$(lastItem).prependTo($("#content2"));
		$("#content2").css("left",0-itemWidth);
		$("#content2").animate({
			"left" : 0
		}, durTime, function() {
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}else{
		isRunning=false;
	}
}
function item3changeToRight() {
	isRunning=true;
	var len = $("#content3 > div").size();
	if (len > 3) {
		var lastItem = $("#content3 > div").eq(len-1);
		$(lastItem).remove();
		$(lastItem).prependTo($("#content3"));
		$("#content3").css("left",0-itemWidth);
		$("#content3").animate({
			"left" : 0
		}, durTime, function() {
			isRunning=false;
			clearInterval(timer);
			timer = setInterval(function() {
				item1changeToLeft();
			}, delayTime);
		});
	}else{
		isRunning=false;
	}
}
function scroll(dir) {
	if(isRunning){
		console.log(isRunning+"-->"+dir);
		return;
	}
	if (currentIndex == 1) {
		if (dir == "left") {
			clearInterval(timer);
			item1changeToLeft();
		}else{
			clearInterval(timer);
			item1changeToRight();
		}

	}
	if (currentIndex == 2) {
		if (dir == "left") {
			clearInterval(timer);
			item2changeToLeft();
		}else{
			clearInterval(timer);
			item2changeToRight();
		}

	}
	if (currentIndex == 3) {
		if (dir == "left") {
			clearInterval(timer);
			item3changeToLeft();
		}else{
			clearInterval(timer);
			item3changeToRight();
		}
	}
}


text:
namespace extensions {

namespace {

scoped_refptr<base::RefCountedMemory> BitmapToMemory(const SkBitmap* image) {
  base::RefCountedBytes* image_bytes = new base::RefCountedBytes;
  gfx::PNGCodec::EncodeBGRASkBitmap(*image, false, &image_bytes->data());
  return image_bytes;
}

SkBitmap DesaturateImage(const SkBitmap* image) {
  color_utils::HSL shift = {-1, 0, 0.6};
  return SkBitmapOperations::CreateHSLShiftedBitmap(*image, shift);
}

SkBitmap* ToBitmap(const unsigned char* data, size_t size) {
  SkBitmap* decoded = new SkBitmap();
  bool success = gfx::PNGCodec::Decode(data, size, decoded);
  DCHECK(success);
  return decoded;
}

}  // namespace

ExtensionIconSource::ExtensionIconSource(Profile* profile) : profile_(profile) {
}

struct ExtensionIconSource::ExtensionIconRequest {
  content::URLDataSource::GotDataCallback callback;
  scoped_refptr<const Extension> extension;
  bool grayscale;
  int size;
  ExtensionIconSet::MatchType match;
};

// static
GURL ExtensionIconSource::GetIconURL(const Extension* extension,
                                     int icon_size,
                                     ExtensionIconSet::MatchType match,
                                     bool grayscale,
                                     bool* exists) {
  if (exists) {
    *exists =
        IconsInfo::GetIconURL(extension, icon_size, match) != GURL::EmptyGURL();
  }

  GURL icon_url(base::StringPrintf("%s%s/%d/%d%s",
                                   chrome::kChromeUIExtensionIconURL,
                                   extension->id().c_str(),
                                   icon_size,
                                   match,
                                   grayscale ? "?grayscale=true" : ""));
  CHECK(icon_url.is_valid());
  return icon_url;
}

// static
SkBitmap* ExtensionIconSource::LoadImageByResourceId(int resource_id) {
  base::StringPiece contents =
      ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
          resource_id, ui::SCALE_FACTOR_100P);

  // Convert and return it.
  const unsigned char* data =
      reinterpret_cast<const unsigned char*>(contents.data());
  return ToBitmap(data, contents.length());
}

std::string ExtensionIconSource::GetSource() const {
  return chrome::kChromeUIExtensionIconHost;
}

std::string ExtensionIconSource::GetMimeType(const std::string&) const {
  // We need to explicitly return a mime type, otherwise if the user tries to
  // drag the image they get no extension.
  return "image/png";
}

void ExtensionIconSource::StartDataRequest(
    const std::string& path,
    const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
    const content::URLDataSource::GotDataCallback& callback) {
  // This is where everything gets started. First, parse the request and make
  // the request data available for later.
  static int next_id = 0;
  if (!ParseData(path, ++next_id, callback)) {
    // If the request data cannot be parsed, request parameters will not be
    // added to |request_map_|.
    // Send back the default application icon (not resized or desaturated) as
    // the default response.
    callback.Run(BitmapToMemory(GetDefaultAppImage()).get());
    return;
  }

  ExtensionIconRequest* request = GetData(next_id);
  ExtensionResource icon = IconsInfo::GetIconResource(
      request->extension.get(), request->size, request->match);

  if (icon.relative_path().empty()) {
    LoadIconFailed(next_id);
  } else {
    LoadExtensionImage(icon, next_id);
  }
}

ExtensionIconSource::~ExtensionIconSource() {
}

const SkBitmap* ExtensionIconSource::GetDefaultAppImage() {
  if (!default_app_data_.get())
    default_app_data_.reset(LoadImageByResourceId(IDR_APP_DEFAULT_ICON));

  return default_app_data_.get();
}

const SkBitmap* ExtensionIconSource::GetDefaultExtensionImage() {
  if (!default_extension_data_.get()) {
    default_extension_data_.reset(
        LoadImageByResourceId(IDR_EXTENSION_DEFAULT_ICON));
  }

  return default_extension_data_.get();
}

void ExtensionIconSource::FinalizeImage(const SkBitmap* image,
                                        int request_id) {
  SkBitmap bitmap;
  ExtensionIconRequest* request = GetData(request_id);
  if (request->grayscale)
    bitmap = DesaturateImage(image);
  else
    bitmap = *image;

  request->callback.Run(BitmapToMemory(&bitmap).get());
  ClearData(request_id);
}

void ExtensionIconSource::LoadDefaultImage(int request_id) {
  ExtensionIconRequest* request = GetData(request_id);
  const SkBitmap* default_image = NULL;

  if (request->extension->is_app())
    default_image = GetDefaultAppImage();
  else
    default_image = GetDefaultExtensionImage();

  SkBitmap resized_image(skia::ImageOperations::Resize(
      *default_image, skia::ImageOperations::RESIZE_LANCZOS3,
      request->size, request->size));

  // There are cases where Resize returns an empty bitmap, for example if you
  // ask for an image too large. In this case it is better to return the default
  // image than returning nothing at all.
  if (resized_image.empty())
    resized_image = *default_image;

  FinalizeImage(&resized_image, request_id);
}

void ExtensionIconSource::LoadExtensionImage(const ExtensionResource& icon,
                                             int request_id) {
  ExtensionIconRequest* request = GetData(request_id);
  ImageLoader::Get(profile_)->LoadImageAsync(
      request->extension.get(),
      icon,
      gfx::Size(request->size, request->size),
      base::Bind(&ExtensionIconSource::OnImageLoaded, AsWeakPtr(), request_id));
}

void ExtensionIconSource::LoadFaviconImage(int request_id) {
  favicon::FaviconService* favicon_service =
      FaviconServiceFactory::GetForProfile(profile_,
                                           ServiceAccessType::EXPLICIT_ACCESS);
  // Fall back to the default icons if the service isn't available.
  if (favicon_service == NULL) {
    LoadDefaultImage(request_id);
    return;
  }

  GURL favicon_url =
      AppLaunchInfo::GetFullLaunchURL(GetData(request_id)->extension.get());
  favicon_service->GetRawFaviconForPageURL(
      favicon_url,
      favicon_base::FAVICON,
      gfx::kFaviconSize,
      base::Bind(&ExtensionIconSource::OnFaviconDataAvailable,
                 base::Unretained(this),
                 request_id),
      &cancelable_task_tracker_);
}

void ExtensionIconSource::OnFaviconDataAvailable(
    int request_id,
    const favicon_base::FaviconRawBitmapResult& bitmap_result) {
  ExtensionIconRequest* request = GetData(request_id);

  // Fallback to the default icon if there wasn't a favicon.
  if (!bitmap_result.is_valid()) {
    LoadDefaultImage(request_id);
    return;
  }

  if (!request->grayscale) {
    // If we don't need a grayscale image, then we can bypass FinalizeImage
    // to avoid unnecessary conversions.
    request->callback.Run(bitmap_result.bitmap_data.get());
    ClearData(request_id);
  } else {
    FinalizeImage(ToBitmap(bitmap_result.bitmap_data->front(),
                           bitmap_result.bitmap_data->size()), request_id);
  }
}

void ExtensionIconSource::OnImageLoaded(int request_id,
                                        const gfx::Image& image) {
  if (image.IsEmpty())
    LoadIconFailed(request_id);
  else
    FinalizeImage(image.ToSkBitmap(), request_id);
}

void ExtensionIconSource::LoadIconFailed(int request_id) {
  ExtensionIconRequest* request = GetData(request_id);
  ExtensionResource icon = IconsInfo::GetIconResource(
      request->extension.get(), request->size, request->match);

  if (request->size == extension_misc::EXTENSION_ICON_BITTY)
    LoadFaviconImage(request_id);
  else
    LoadDefaultImage(request_id);
}

bool ExtensionIconSource::ParseData(
    const std::string& path,
    int request_id,
    const content::URLDataSource::GotDataCallback& callback) {
  // Extract the parameters from the path by lower casing and splitting.
  std::string path_lower = base::ToLowerASCII(path);
  std::vector<std::string> path_parts = base::SplitString(
      path_lower, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
  if (path_lower.empty() || path_parts.size() < 3)
    return false;

  std::string size_param = path_parts.at(1);
  std::string match_param = path_parts.at(2);
  match_param = match_param.substr(0, match_param.find('?'));

  int size;
  if (!base::StringToInt(size_param, &size))
    return false;
  if (size <= 0 || size > extension_misc::EXTENSION_ICON_GIGANTOR)
    return false;

  ExtensionIconSet::MatchType match_type;
  int match_num;
  if (!base::StringToInt(match_param, &match_num))
    return false;
  match_type = static_cast<ExtensionIconSet::MatchType>(match_num);
  if (!(match_type == ExtensionIconSet::MATCH_EXACTLY ||
        match_type == ExtensionIconSet::MATCH_SMALLER ||
        match_type == ExtensionIconSet::MATCH_BIGGER))
    match_type = ExtensionIconSet::MATCH_EXACTLY;

  std::string extension_id = path_parts.at(0);
  const Extension* extension = ExtensionSystem::Get(profile_)->
      extension_service()->GetInstalledExtension(extension_id);
  if (!extension)
    return false;

  bool grayscale = path_lower.find("grayscale=true") != std::string::npos;

  SetData(request_id, callback, extension, grayscale, size, match_type);

  return true;
}

void ExtensionIconSource::SetData(
    int request_id,
    const content::URLDataSource::GotDataCallback& callback,
    const Extension* extension,
    bool grayscale,
    int size,
    ExtensionIconSet::MatchType match) {
  std::unique_ptr<ExtensionIconRequest> request =
      base::MakeUnique<ExtensionIconRequest>();
  request->callback = callback;
  request->extension = extension;
  request->grayscale = grayscale;
  request->size = size;
  request->match = match;
  request_map_[request_id] = std::move(request);
}

ExtensionIconSource::ExtensionIconRequest* ExtensionIconSource::GetData(
    int request_id) {
  return request_map_[request_id].get();
}

void ExtensionIconSource::ClearData(int request_id) {
  request_map_.erase(request_id);
}

}  // namespace extensions


text:
SYNONYM

#### According to
IRMNG Homonym List

#### Published in
in Engler & Prantl, Nat. Pflanzenfam. (Leipzig), Teil. <b>I</b> 1: 379 (1897)

#### Original name
null

### Remarks
null


text:
void heapswap_$type ($type* v1, $type* v2);
void heapify_$type  ($type a[], int count, int root);
void heapbuild_$type($type a[], int count);
void heappush_$type ($type a[], int count);
void heappop_$type  ($type a[], int count);
void heapsort_$type ($type a[], int count);


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef CONF_QUICK_START_H_INCLUDED
#define CONF_QUICK_START_H_INCLUDED

//[definition_pwm]
/** PWM module to use */
#define PWM_MODULE      EXT1_PWM_MODULE
/** PWM output pin */
#define PWM_OUT_PIN     EXT1_PWM_0_PIN
/** PWM output pinmux */
#define PWM_OUT_MUX     EXT1_PWM_0_MUX
//[definition_pwm]

#endif /* CONF_QUICK_START_H_INCLUDED */


text:
package org.qi4j.index.elasticsearch.internal;

import org.qi4j.bootstrap.Assemblers;

public abstract class AbstractElasticSearchAssembler<AssemblerType>
    extends Assemblers.VisibilityIdentityConfig<AssemblerType>
{
    public AbstractElasticSearchAssembler()
    {
        identifiedBy( "es-indexing" );
    }
}


text:
package problems;

/**
 * The Boyer-Moore Vote Algorithm solves the majority vote problem in linear
 * time O(n) and O(1) space. The majority vote problem is to determine in any
 * given sequence of choices whether there is a choice with more occurrences
 * than all the others, and if so, to determine this choice. Mathematically,
 * given a finite sequence (length n) of numbers, the object is to find the
 * majority number defined as the number that appears more than n/2 times.
 *
 * @author Ajinkya Patil
 */
public class MajorityVote {
	public static Integer findMajority(int[] arr) {
		// Phase 1: Find a candidate for majority element
		int major = arr[0];
		int count = 1;
		for (int i = 1; i < arr.length; i++) {
			if (major == arr[i]) {
				count++;
			} else {
				count--;
			}
			if (count < 1) {
				count = 1;
				major = arr[i];
			}
		}

		// Phase 2: Check whether the candidate is majority element or not
		count = 0;
		for (int i = 0; i < arr.length; i++) {
			if (major == arr[i]) {
				count++;
			}
			if (count > arr.length / 2) {
				return new Integer(major);
			}
		}
		return null;
	}

	public static void main(String[] args) {
		int[] seq = new int[args.length];
		for (int i = 0; i < seq.length; i++) {
			seq[i] = Integer.parseInt(args[i]);
		}
		Integer major = findMajority(seq);
		System.out.println("Majority Vote: " + major);
	}
}


text:
var blog = angular.module('blog', ['ui.router', 'ngSanitize']);

blog.config(function($stateProvider, $urlRouterProvider) {

    // add 'ngSanitize' as additional module wide dependency
    // blog.requires.push('ngSanitize')

    $urlRouterProvider.otherwise('/');

    $stateProvider

        // HOME STATES AND NESTED VIEWS ========================================
        .state('index', {
            //abstract:true,
            url: '',
            templateUrl: 'components/blog/views/blogView.html'
        })

        .state('postDetails' ,{
            url:'/posts/:postTitle',
            templateUrl: 'components/blog/views/postDetail.html'
        })

    //$stateProvider
    //    .state('contacts.detail', {
    //        url: "/contacts/:contactId",
    //        templateUrl: 'contacts.detail.html',
    //        controller: function ($stateParams) {
    //            // If we got here from a url of /contacts/42
    //            expect($stateParams).toBe({contactId: "42"});
    //        }
    //    })

        // ABOUT PAGE AND MULTIPLE NAMED VIEWS =================================
        //.state('about', {
        //    url: '/about',
        //    views: {
        //        '': { templateUrl: 'partial-about.html' },
        //        'columnOne@about': { template: 'Look I am a column!' },
        //        'columnTwo@about': {
        //            templateUrl: 'table-data.html',
        //            controller: 'scotchController'
        //        }
        //    }
        //
        //});

});


text:
package pl.mk5.gdx.fireapp.promises;

import com.badlogic.gdx.utils.Array;

import pl.mk5.gdx.fireapp.functional.Consumer;

class ConsumerWrapper<T> implements Consumer<T> {

    private final Array<Consumer<T>> consumers = new Array<>();
    private boolean cleanAfterAccept;

    ConsumerWrapper() {
        this.cleanAfterAccept = true;
    }

    @Override
    public void accept(T t) {
        for (Consumer<T> consumer : consumers) {
            consumer.accept(t);
        }
        if (cleanAfterAccept)
            consumers.clear();
    }

    void addConsumer(Consumer<T> consumer) {
        this.consumers.add(consumer);
    }

    boolean isSet() {
        return consumers.size > 0;
    }

    Consumer<T> first() {
        return consumers.first();
    }

    public void setCleanAfterAccept(boolean cleanAfterAccept) {
        this.cleanAfterAccept = cleanAfterAccept;
    }
}


text:
package io.druid.collections.bitmap;

import org.roaringbitmap.IntIterator;

import java.nio.ByteBuffer;
import java.util.BitSet;
import java.util.NoSuchElementException;

/**
 * WrappedImmutableBitSetBitmap implements ImmutableBitmap for java.util.BitSet
 */
public class WrappedImmutableBitSetBitmap implements ImmutableBitmap
{
  protected final BitSet bitmap;

  public WrappedImmutableBitSetBitmap(BitSet bitmap)
  {
    this.bitmap = bitmap;
  }

  public WrappedImmutableBitSetBitmap()
  {
    this(new BitSet());
  }

  // WARNING: the current implementation of BitSet (1.7) copies the contents of ByteBuffer to
  // on heap!
  // TODO: make a new BitSet implementation which can use ByteBuffers properly.
  public WrappedImmutableBitSetBitmap(ByteBuffer byteBuffer)
  {
    this(BitSet.valueOf(byteBuffer));
  }

  @Override
  public IntIterator iterator()
  {
    return new BitSetIterator();
  }

  @Override
  public boolean get(int value)
  {
    return bitmap.get(value);
  }

  @Override
  public int size()
  {
    return bitmap.cardinality();
  }

  @Override
  public byte[] toBytes()
  {
    return bitmap.toByteArray();
  }

  @Override
  public int compareTo(ImmutableBitmap other)
  {
    // TODO: find out what this is supposed to even do
    BitSet otherSet = ((WrappedImmutableBitSetBitmap) other).bitmap;
    int lengthCompare = Integer.compare(otherSet.length(), bitmap.length());
    if (lengthCompare != 0) {
      return lengthCompare;
    }
    return Integer.compare(otherSet.nextSetBit(0), bitmap.nextSetBit(0));
  }

  @Override
  public boolean isEmpty()
  {
    return bitmap.isEmpty();
  }

  @Override
  public ImmutableBitmap union(ImmutableBitmap otherBitmap)
  {
    WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
    retval.or((WrappedBitSetBitmap) otherBitmap);
    return retval;
  }

  @Override
  public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
  {
    WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
    retval.and((WrappedBitSetBitmap) otherBitmap);
    return retval;
  }

  @Override
  public ImmutableBitmap difference(ImmutableBitmap otherBitmap)
  {
    WrappedBitSetBitmap retval = new WrappedBitSetBitmap((BitSet) bitmap.clone());
    retval.andNot((WrappedBitSetBitmap) otherBitmap);
    return retval;
  }

  private class BitSetIterator implements IntIterator
  {
    private int nextPos;

    BitSetIterator()
    {
      nextPos = bitmap.nextSetBit(0);
    }

    @Override
    public boolean hasNext()
    {
      return nextPos >= 0;
    }

    @Override
    public int next()
    {
      int pos = nextPos;
      if (pos < 0) {
        throw new NoSuchElementException();
      }
      nextPos = bitmap.nextSetBit(pos + 1);
      return pos;
    }

    @Override
    public IntIterator clone()
    {
      BitSetIterator newIt = new BitSetIterator();
      newIt.nextPos = nextPos;
      return newIt;
    }
  }

}


text:
ko.bindingHandlers.truncated = {
    update: function (element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor(), allBindings = allBindingsAccessor();

        // Next, whether or not the supplied model property is observable, get its current value
        var valueUnwrapped = ko.utils.unwrapObservable(value);

        var truncatedLength = allBindings.truncatedLength || 60;

        $(element).text(valueUnwrapped.truncate(truncatedLength));
        $(element).attr("title",valueUnwrapped);
    }
};

ko.bindingHandlers.shortTime = {
    update: function (element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor();
        // Next, whether or not the supplied model property is observable, get its current value
        var unwrappedDateAndTime = Date.create(ko.utils.unwrapObservable(value));

        $(element).text(unwrappedDateAndTime.format("{mm}:{ss}"));
    }
};

ko.bindingHandlers.shortDateTime = {
    update: function (element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor();
        // Next, whether or not the supplied model property is observable, get its current value
        var unwrappedDateAndTime = Date.create(ko.utils.unwrapObservable(value));

        $(element).text(unwrappedDateAndTime.format("{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}"));
    }
};

ko.bindingHandlers.formattedDateTime = {
    update: function (element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor();
        // Next, whether or not the supplied model property is observable, get its current value
        var unwrappedDateAndTime = Date.create(ko.utils.unwrapObservable(value.source));

        $(element).text(unwrappedDateAndTime.format(value.format || "full"));
    }
};

ko.bindingHandlers.timeAndDate = {
    update: function(element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor();
        // Next, whether or not the supplied model property is observable, get its current value
        var unwrappedDateAndTime = Date.create(ko.utils.unwrapObservable(value));
        $(element).text(unwrappedDateAndTime.format("{HH}:{mm} on {dd} {mon} {yyyy}"));
    }
};

ko.bindingHandlers.concatenated = {
    update: function (element, valueAccessor, allBindingsAccessor) {
        // First get the latest data that we're bound to
        var value = valueAccessor(), allBindings = allBindingsAccessor();

        var separator = allBindings.concatSeparator || ", ";

        // Next, whether or not the supplied model property is observable, get its current value
        var valueUnwrapped = ko.utils.unwrapObservable(value);

        $(element).text(valueUnwrapped.join(separator));
    }
};

ko.bindingHandlers.typeahead = {
    init: function (element, valueAccessor) {
        var binding = this;
        var elem = $(element);
        var value = valueAccessor();

        // Setup Bootstrap Typeahead for this element.
        elem.typeahead(
        {
            source: value.source,
            onselect: function (val) { value.target(val); }
        });

        // Set the value of the target when the field is blurred.
        elem.blur(function () { value.target(elem.val()); });
        /*
        elem.on('change', function(event) {
            console.log("Changed: " + event.target.value);
            value.target(event.target.value);
            elem.closest("form").find("button").trigger("click");
        });*/
    },
    update: function (element, valueAccessor) {
        var elem = $(element);
        var value = valueAccessor();
        elem.val(value.target());
    }

};

ko.bindingHandlers.popover = {
    update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
        var value = valueAccessor();
        if (ko.utils.unwrapObservable(value.visible)) {
            var tempElement = $('<div/>').get(0);
            $('body').append(tempElement);
            ko.renderTemplate(value.template, bindingContext, {}, tempElement, 'replaceChildren');
            $(element).popover({
                content: tempElement.innerHTML,
                html: true,
                placement: 'top',
                title: value.title,
                trigger: 'hover'
            });
            //clean up node
            tempElement.parentNode.removeChild(tempElement);
        };
    }
};

ko.bindingHandlers.enterkey = {
    init: function (element, valueAccessor, allBindingsAccessor, viewModel) {
        var allBindings = allBindingsAccessor();
        $(element).on('keypress', function (e) {
            var keyCode = e.which || e.keyCode;
            if (keyCode !== 13) {
                return true;
            }

            var target = e.target;
            target.blur();

            allBindings.enterkey.call(viewModel, viewModel, target, element);

            return false;
        });
    }
};


text:
create class xoo ( id int auto_increment , title varchar(100));

insert into xoo(title) values ('aaa');
insert into xoo(title) values ('bbb');
insert into xoo(title) values ('ccc');

select * from xoo order by 1;

update xoo set id = 100 where id = (select id from xoo where title = 'ccc');
insert into xoo(title) values ('ddd');
select * from xoo order by 1;

drop class xoo;


text:
@implementation CustomAnnotation
@synthesize coordinate;
@synthesize annotationTitle;
@synthesize annotationSubtitle;

- (NSString *)title {
    return annotationTitle;
}

- (NSString *)subtitle {
    return annotationSubtitle;
}

- (id)initWithLocationCoordinate:(CLLocationCoordinate2D) _coordinate
                           title:(NSString *)_annotationTitle subtitle:(NSString *)_annotationSubtitle {
    coordinate = _coordinate;
    self.annotationTitle = _annotationTitle;
    self.annotationSubtitle = _annotationSubtitle;
    return self;
}

//- (void) dealloc {
//    [annotationTitle release];
//    [annotationSubtitle release];
//    [super dealloc];
//}

@end


text:
<?php
declare(strict_types = 1);

namespace Innmind\Neo4j\ONM\Translation\Specification\Validator;

use Innmind\Neo4j\ONM\{
    Translation\Specification\Validator,
    Metadata\Entity,
    Metadata\Aggregate,
    Metadata\Relationship,
};
use Innmind\Specification\Specification;
use Innmind\Immutable\Map;
use function Innmind\Immutable\assertMap;

final class DelegationValidator implements Validator
{
    /** @var Map<string, Validator> */
    private Map $validators;

    /**
     * @param Map<string, Validator>|null $validators
     */
    public function __construct(Map $validators = null)
    {
        /**
         * @psalm-suppress InvalidArgument
         * @var Map<string, Validator>
         */
        $this->validators = $validators ?? Map::of('string', Validator::class)
            (Aggregate::class, new AggregateValidator)
            (Relationship::class, new RelationshipValidator);

        assertMap('string', Validator::class, $this->validators, 1);
    }

    public function __invoke(Specification $specification, Entity $meta): bool
    {
        $validate = $this->validators->get(\get_class($meta));

        return $validate($specification, $meta);
    }
}