text:
//
//  TriviaStatusView.m
//  Questionable
//
//  Created by Nur Monson on 3/27/07.
//  Copyright 2007 theidiotproject. All rights reserved.
//

#import "TriviaStatusView.h"

@implementation TriviaStatusView

- (id)initWithFrame:(NSRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    return self;
}

- (void)drawRect:(NSRect)rect {
	CGContextRef cxt = [[NSGraphicsContext currentContext] graphicsPort];
	NSRect bounds = [self bounds];

	CGContextSetRGBFillColor(cxt,0.8f,0.8f,0.8f,1.0f);
	CGContextFillRect(cxt, *(CGRect *)&bounds);

	CGContextSetLineWidth(cxt,2.0f);
	CGContextSetRGBStrokeColor(cxt,0.2f,0.2f,0.2f,0.5f);
	CGContextMoveToPoint(cxt,bounds.origin.x,bounds.origin.y+bounds.size.height);
	CGContextAddLineToPoint(cxt,bounds.origin.x+bounds.size.width,bounds.origin.y+bounds.size.height);
	CGContextStrokePath(cxt);
	/*
	TIPMutableGradientRef bgGradient = TIPMutableGradientCreate();
	TIPGradientAddRGBColorStop(bgGradient,0.0f,0.3f,0.3f,0.3f,1.0f);
	TIPGradientAddRGBColorStop(bgGradient,0.1f,0.6f,0.6f,0.6f,1.0f);

	TIPGradientAxialFillRect(cxt,bgGradient,CGRectMake(bounds.origin.x,bounds.origin.y+20.0f,bounds.size.width,bounds.size.height-20.0f),90.0f);
	TIPGradientRelease(bgGradient);
	 */
}

@end


text:
layout: post
title: Jekyll 博客主题 jekyll-bootstrap-blog 更新,支持语法高亮
date: 2016-01-03 02:41
author: admin
comments: true
categories: [Blog,Jekyll]
tags: [Blog,Jekyll,jekyll-bootstrap-blog]
---

## New Features and Enhancements

Todey, there are two features added in `jekyll-bootstrap-blog`:

* Syntax Highlighting (forked from <https://github.com/isagalaev/highlight.js>)
* Jekyll 3 Supported

<!-- more -->

The `jekyll-bootstrap-blog` is a theme for Jekyll to build a personal blog. See <https://github.com/waylau/jekyll-bootstrap-blog>

## Screenshots

![](http://99btgc01.info/uploads/2016/01/01.jpg)

![](http://99btgc01.info/uploads/2016/01/02%281%29.jpg)

## Demo

You can see the theme running on [my blog](http://www.waylau.com/).

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="dpi">xxhdpi</string>

</resources>


text:
[![build status](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitlab-ce/commits/master)
[![coverage report](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg?job=coverage)](https://gitlab.com/gitlab-org/gitlab-ce/commits/master)
[![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.svg)](https://codeclimate.com/github/gitlabhq/gitlabhq)
[![Core Infrastructure Initiative Best Practices](https://bestpractices.coreinfrastructure.org/projects/42/badge)](https://bestpractices.coreinfrastructure.org/projects/42)

## Canonical source

The canonical source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/).

## Open source software to collaborate on code

To see how GitLab looks please see the [features page on our website](https://about.gitlab.com/features/).

- Manage Git repositories with fine grained access controls that keep your code secure
- Perform code reviews and enhance collaboration with merge requests
- Each project can also have an issue tracker and a wiki
- Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
- Completely free and open source (MIT Expat license)
- Powered by [Ruby on Rails](https://github.com/rails/rails)

## Hiring

We're hiring developers, support people, and production engineers all the time, please see our [jobs page](https://about.gitlab.com/jobs/).

## Editions

There are two editions of GitLab:

- GitLab Community Edition (CE) is available freely under the MIT Expat license.
- GitLab Enterprise Edition (EE) includes [extra features](https://about.gitlab.com/features/#compare) that are more useful for organizations with more than 100 users. To use EE and get official support please [become a subscriber](https://about.gitlab.com/pricing/).

## Website

On [about.gitlab.com](https://about.gitlab.com/) you can find more information about:

- [Subscriptions](https://about.gitlab.com/pricing/)
- [Consultancy](https://about.gitlab.com/consultancy/)
- [Community](https://about.gitlab.com/community/)
- [Hosted GitLab.com](https://about.gitlab.com/gitlab-com/) use GitLab as a free service
- [GitLab Enterprise Edition](https://about.gitlab.com/features/#enterprise) with additional features aimed at larger organizations.
- [GitLab CI](https://about.gitlab.com/gitlab-ci/) a continuous integration (CI) server that is easy to integrate with GitLab.

## Requirements

Please see the [requirements documentation](doc/install/requirements.md) for system requirements and more information about the supported operating systems.

## Installation

The recommended way to install GitLab is with the [Omnibus packages](https://about.gitlab.com/downloads/) on our package server.
Compared to an installation from source, this is faster and less error prone.
Just select your operating system, download the respective package (Debian or RPM) and install it using the system's package manager.

There are various other options to install GitLab, please refer to the [installation page on the GitLab website](https://about.gitlab.com/installation/) for more information.

You can access a new installation with the login **`root`** and password **`5iveL!fe`**, after login you are required to set a unique password.

## Install a development environment

To work on GitLab itself, we recommend setting up your development environment with [the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit).
If you do not use the GitLab Development Kit you need to install and setup all the dependencies yourself, this is a lot of work and error prone.
One small thing you also have to do when installing it yourself is to copy the example development unicorn configuration file:

    cp config/unicorn.rb.example.development config/unicorn.rb

Instructions on how to start GitLab and how to run the tests can be found in the [development section of the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit#development).

## Software stack

GitLab is a Ruby on Rails application that runs on the following software:

- Ubuntu/Debian/CentOS/RHEL
- Ruby (MRI) 2.3
- Git 2.7.4+
- Redis 2.8+
- MySQL or PostgreSQL

For more information please see the [architecture documentation](http://doc.gitlab.com/ce/development/architecture.html).

## Third-party applications

There are a lot of [third-party applications integrating with GitLab](https://about.gitlab.com/applications/). These include GUI Git clients, mobile applications and API wrappers for various languages.

## GitLab release cycle

For more information about the release process see the [release documentation](https://gitlab.com/gitlab-org/release-tools/blob/master/README.md).

## Upgrading

For upgrading information please see our [update page](https://about.gitlab.com/update/).

## Documentation

All documentation can be found on [doc.gitlab.com/ce/](http://doc.gitlab.com/ce/).

## Getting help

Please see [Getting help for GitLab](https://about.gitlab.com/getting-help/) on our website for the many options to get help.

## Is it any good?

[Yes](https://news.ycombinator.com/item?id=3067434)

## Is it awesome?

Thanks for [asking this question](https://twitter.com/supersloth/status/489462789384056832) Joshua.
[These people](https://twitter.com/gitlab/favorites) seem to like it.


text:
title: "A Beard That Hides"
excerpt: "PaperFaces portrait of the Remi L. drawn with Paper by 53 on an iPad."
image:
  feature: paperfaces-remi-l-lg.jpg
  teaser: paperfaces-remi-l-teaser.jpg
  thumb: paperfaces-remi-l-150.jpg
tags: [portrait, illustration, Paper by 53, Sktchy, beard, Mix]
---

PaperFaces portrait of Remi L. inspired by a [photograph on Sktchy](http://sktchy.com/wIZBLC).

I started this drawing on a 3rd generation iPad with retina screen and finished it on the new iPad Air 2. The Air 2 feels so much more comfortable during long drawing sessions compared to the heavy brick that was the iPad 3.

The original drawing is [available on Mix](https://mix.fiftythree.com/11098-Michael-Rose/513427) if you want a closer look or to riff off of.

{% include boilerplate/paperfaces-3.html %}

Work in progress screen captures Made with Paper.


text:
module RallyAPI
    # query is like:
    # query_hash = {}
    # query_hash["find"] = { some json for a query} or true
    # query_hash["fields"] = ["State", "PlanEstimate"]
    # query_hash["pagesize"] = 1000
    # query_hash["sort"] = { _id: 1 }
    # query_hash["workspace"] = workspace oid for query uri

  #query info is the master hash instead of a bunch of instance variables
  class LookbackAPIQuery
    attr_accessor :query_info

    def initialize(query_hash = nil)
      @query_info = nil
      parse_query_hash(query_hash) if !query_hash.nil?
      self
    end

    def make_query_params
      query_params = {}
      query_params[:find]      = @query_string
      query_params[:workspace]  = @workspace["_ref"] if !@workspace.nil?
      query

      query_params
    end

    def validate(allowed_objects)
      errors = []

      if @type.nil?
        errors.push("Object type for query cannot be nil")
      end

      if @limit < 0
        errors.push("Stop after - #{@stop_after} - must be a number")
      end

      if @page_size < 0
        errors.push("Page size - #{@page_size} - must be a number")
      end

      if !@workspace.nil?
        errors.push("Workspace - #{@workspace} - must have a ref") if @workspace["_ref"].nil?
      end

      if !@project.nil?
        errors.push("Project - #{@project} - must have a ref") if @project["_ref"].nil?
      end

      if (allowed_objects[@type].nil?)
        errors.push( "Object Type #{@type} is not query-able: inspect RallyRestJson.rally_objects for allowed types" )
      end

      errors
    end

    private

    def parse_query_hash(query_hash)
      #@type               = query_hash[:type]
      #@query_string       = query_hash[:query_string]
      #@fetch              = query_hash[:fetch]
      #@project_scope_down = query_hash[:project_scope_down]
      #@project_scope_up   = query_hash[:project_scope_up]
      #@order              = query_hash[:order]
      #@page_size          = query_hash[:page_size]
      #@stop_after         = query_hash[:limit]
      @workspace      = query_hash[:workspace]
      #@project        = query_hash[:project]
    end

  end

end


text:
package com.navercorp.pinpoint.test.plugin;

import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;

import org.junit.runner.Description;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunListener;

import static com.navercorp.pinpoint.test.plugin.PinpointPluginTestConstants.*;

/**
 * @author Jongho Moon
 *
 */
public class PinpointPluginTestRunListener extends RunListener {
    public static final String UTF_8 = "UTF-8";
    private final PrintStream out;

    public PinpointPluginTestRunListener(OutputStream out) {
        this(out, UTF_8);
    }
    public PinpointPluginTestRunListener(OutputStream out, String encoding) {
        try {
            this.out = new PrintStream(out, true, encoding);
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException("encoding error. error:" + ex.getMessage(), ex);
        }
    }

    @Override
    public void testRunStarted(Description description) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testRunStarted");
    }

    @Override
    public void testRunFinished(Result result) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testRunFinished");
    }

    @Override
    public void testStarted(Description description) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testStarted" + JUNIT_OUTPUT_DELIMITER + description.getDisplayName());
    }

    @Override
    public void testFinished(Description description) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testFinished" + JUNIT_OUTPUT_DELIMITER + description.getDisplayName());
    }

    @Override
    public void testFailure(Failure failure) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testFailure" + JUNIT_OUTPUT_DELIMITER + failureToString(failure));
    }

    @Override
    public void testAssumptionFailure(Failure failure) {
        out.println(JUNIT_OUTPUT_DELIMITER + "testAssumptionFailure" + JUNIT_OUTPUT_DELIMITER + failureToString(failure));
    }

    @Override
    public void testIgnored(Description description) throws Exception {
        out.println(JUNIT_OUTPUT_DELIMITER + "testIgnored" + JUNIT_OUTPUT_DELIMITER + description.getDisplayName());
    }

    private String failureToString(Failure failure) {
        StringBuilder builder = new StringBuilder(64);

        builder.append(failure.getTestHeader());
        builder.append(JUNIT_OUTPUT_DELIMITER);
        builder.append(failure.getException().getClass().getName());
        builder.append(JUNIT_OUTPUT_DELIMITER);
        builder.append(failure.getMessage());
        builder.append(JUNIT_OUTPUT_DELIMITER);

        for (StackTraceElement e : failure.getException().getStackTrace()) {
            builder.append(e.getClassName());
            builder.append(',');
            builder.append(e.getMethodName());
            builder.append(',');
            builder.append(e.getFileName());
            builder.append(',');
            builder.append(e.getLineNumber());

            builder.append(JUNIT_OUTPUT_DELIMITER);
        }

        return builder.toString();
    }
}


text:
package org.elasticsearch.index.engine;

import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.SegmentReader;
import org.elasticsearch.common.breaker.CircuitBreaker;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
import org.elasticsearch.indices.breaker.CircuitBreakerService;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;

/**
 * A refresh listener that tracks the amount of memory used by segments in the accounting circuit breaker.
 */
final class RamAccountingRefreshListener implements BiConsumer<ElasticsearchDirectoryReader, ElasticsearchDirectoryReader> {

    private final CircuitBreakerService breakerService;

    RamAccountingRefreshListener(CircuitBreakerService breakerService) {
        this.breakerService = breakerService;
    }

    @Override
    public void accept(ElasticsearchDirectoryReader reader, ElasticsearchDirectoryReader previousReader) {
        final CircuitBreaker breaker = breakerService.getBreaker(CircuitBreaker.ACCOUNTING);

        // Construct a list of the previous segment readers, we only want to track memory used
        // by new readers, so these will be exempted from the circuit breaking accounting.
        //
        // The Core CacheKey is used as the key for the set so that deletions still keep the correct
        // accounting, as using the Reader or Reader's CacheKey causes incorrect accounting.
        final Set<IndexReader.CacheKey> prevReaders;
        if (previousReader == null) {
            prevReaders = Collections.emptySet();
        } else {
            final List<LeafReaderContext> previousReaderLeaves = previousReader.leaves();
            prevReaders = new HashSet<>(previousReaderLeaves.size());
            for (LeafReaderContext lrc : previousReaderLeaves) {
                prevReaders.add(Lucene.segmentReader(lrc.reader()).getCoreCacheHelper().getKey());
            }
        }

        for (LeafReaderContext lrc : reader.leaves()) {
            final SegmentReader segmentReader = Lucene.segmentReader(lrc.reader());
            // don't add the segment's memory unless it is not referenced by the previous reader
            // (only new segments)
            if (prevReaders.contains(segmentReader.getCoreCacheHelper().getKey()) == false) {
                final long ramBytesUsed = segmentReader.ramBytesUsed();
                // add the segment memory to the breaker (non-breaking)
                breaker.addWithoutBreaking(ramBytesUsed);
                // and register a listener for when the segment is closed to decrement the
                // breaker accounting
                segmentReader.getCoreCacheHelper().addClosedListener(k -> breaker.addWithoutBreaking(-ramBytesUsed));
            }
        }
    }
}


text:
<?php

namespace Fakeronline\GoldAccount\Utils;

use Exception;

class CURL{

    private $curl = null;
    private $timeOut = 10;

    public function __construct($url){
        $this->curl = curl_init();
        curl_setopt($this->curl, CURLOPT_TIMEOUT, $this->timeOut); //超时设置  单位:秒
        curl_setopt($this->curl, CURLOPT_URL, $url);

        curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);

        curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false); //证书
        curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false); //不验证证书
    }

    public function setHeader(array $header){
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $header);
        return $this;
    }

    public function setData($data = null){
        if(is_array($data)){
            curl_setopt($this->curl, CURLOPT_POSTFIELDS, http_build_query($data));
        }else{
            curl_setopt($this->curl, CURLOPT_POSTFIELDS, $data);
        }
        return $this;
    }

    public function setTimeOut($second){
        curl_setopt($this->curl, CURLOPT_TIMEOUT, $second); //超时设置  单位:秒
    }

    function get()
    {
        if(is_null($this->curl)){
            throw new Exception('实例丢失或未创建实例!');
        }

        return curl_exec($this->curl);
    }
}


text:
// Author: jmarantz@google.com (Joshua Marantz)

#include "pagespeed/kernel/base/time_util.h"

#include "base/logging.h"
#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/base/gtest.h"
#include "pagespeed/kernel/base/string.h"

namespace {

const char kApr5[] = "Mon, 05 Apr 2010 18:49:46 GMT";

// The time-conversion functions are only accurate to the second,
// and we will not be able to test for identity transforms if we
// are not using a multiple of 1000.
const int64 kTimestampMs = 718981 * 1000;

}  // namespace

namespace net_instaweb {

class TimeUtilTest : public testing::Test {
 protected:
  GoogleString GetTimeString(int64 time_ms) {
    GoogleString out;
    EXPECT_TRUE(ConvertTimeToString(time_ms, &out));
    return out;
  }

  int64 GetTimeValue(const GoogleString& time_str) {
    int64 val;
    CHECK(ConvertStringToTime(time_str, &val)) << "Time conversion failed";
    return val;
  }

  GoogleString out_;
};

TEST_F(TimeUtilTest, Test1970) {
  EXPECT_EQ("Thu, 01 Jan 1970 00:00:00 GMT", GetTimeString(0));
  EXPECT_EQ(1270493386000LL, GetTimeValue(kApr5));
}

TEST_F(TimeUtilTest, TestIdentity) {
  EXPECT_EQ(kTimestampMs, GetTimeValue(GetTimeString(kTimestampMs)));
  EXPECT_EQ(kApr5, GetTimeString(GetTimeValue(kApr5)));
}

}  // namespace net_instaweb


text:
from django.core import exceptions
from django.db import models
from django.utils.encoding import force_str

__all__ = ('AddressField', 'GeoLocationField')

def typename(obj):
    """Returns the type of obj as a string. More descriptive and specific than
    type(obj), and safe for any object, unlike __class__."""
    if hasattr(obj, '__class__'):
        return getattr(obj, '__class__').__name__
    else:
        return type(obj).__name__

class GeoPt(object):
    """A geographical point."""

    lat = None
    lon = None

    def __init__(self, lat, lon=None):
        """
        If the model field has 'blank=True' or 'null=True' then
        we can't always expect the GeoPt to be instantiated with
        a valid value. In this case we'll let GeoPt be instantiated
        as an empty item, and the string representation should be
        an empty string instead of 'lat,lon'.
        """
        if not lat:
            return

        if lon is None:
            lat, lon = self._split_geo_point(lat)
        self.lat = self._validate_geo_range(lat, 90)
        self.lon = self._validate_geo_range(lon, 180)

    def __str__(self):
        if self.lat is not None and self.lon is not None:
            return "%s,%s" % (self.lat, self.lon)
        return ''

    def __eq__(self, other):
        if isinstance(other, GeoPt):
            return bool(self.lat == other.lat and self.lon == other.lon)

    def __len__(self):
        return len(force_str(self))

    def _split_geo_point(self, geo_point):
        """splits the geo point into lat and lon"""
        try:
            lat, lon = geo_point.split(',')
            return lat, lon
        except (AttributeError, ValueError):
            m = 'Expected a "lat,long" formatted string; received %s (a %s).'
            raise exceptions.ValidationError(m % (geo_point,
                                                  typename(geo_point)))

    def _validate_geo_range(self, geo_part, range_val):
        try:
            geo_part = float(geo_part)
            if abs(geo_part) > range_val:
                m = 'Must be between -%s and %s; received %s'
                raise exceptions.ValidationError(m % (range_val, range_val,
                                                      geo_part))
        except (TypeError, ValueError):
            raise exceptions.ValidationError(
                'Expected float, received %s (a %s).' % (geo_part,
                                                         typename(geo_part)))
        return geo_part

class AddressField(models.CharField):
    pass

class GeoLocationField(models.CharField):
    """
    A geographical point, specified by floating-point latitude and longitude
    coordinates. Often used to integrate with mapping sites like Google Maps.
    May also be used as ICBM coordinates.

    This is the georss:point element. In XML output, the coordinates are
    provided as the lat and lon attributes. See: http://georss.org/

    Serializes to '<lat>,<lon>'. Raises BadValueError if it's passed an invalid
    serialized string, or if lat and lon are not valid floating points in the
    ranges [-90, 90] and [-180, 180], respectively.
    """
    description = "A geographical point, specified by floating-point latitude and longitude coordinates."

    def __init__(self, *args, **kwargs):
        kwargs['max_length'] = 100
        super(GeoLocationField, self).__init__(*args, **kwargs)

    def from_db_value(self, value, *args, **kwargs):
        return self.to_python(value)

    def to_python(self, value):
        if isinstance(value, GeoPt):
            return value
        return GeoPt(value)

    def get_prep_value(self, value):
        """prepare the value for database query"""
        if value is None:
            return None
        return force_str(self.to_python(value))

    def value_to_string(self, obj):
        value = self.value_from_object(obj)
        return self.get_prep_value(value)


text:
/**
 * This module contains logic for rendering a fake visual caret.
 *
 * @private
 * @class tinymce.caret.FakeCaret
 */
define("tinymce/caret/FakeCaret", [
	"tinymce/caret/CaretContainer",
	"tinymce/caret/CaretPosition",
	"tinymce/dom/NodeType",
	"tinymce/dom/RangeUtils",
	"tinymce/dom/DomQuery",
	"tinymce/geom/ClientRect",
	"tinymce/util/Delay"
], function(CaretContainer, CaretPosition, NodeType, RangeUtils, $, ClientRect, Delay) {
	var isContentEditableFalse = NodeType.isContentEditableFalse;

	return function(rootNode, isBlock) {
		var cursorInterval, $lastVisualCaret, caretContainerNode;

		function getAbsoluteClientRect(node, before) {
			var clientRect = ClientRect.collapse(node.getBoundingClientRect(), before),
				docElm, scrollX, scrollY, margin, rootRect;

			if (rootNode.tagName == 'BODY') {
				docElm = rootNode.ownerDocument.documentElement;
				scrollX = rootNode.scrollLeft || docElm.scrollLeft;
				scrollY = rootNode.scrollTop || docElm.scrollTop;
			} else {
				rootRect = rootNode.getBoundingClientRect();
				scrollX = rootNode.scrollLeft - rootRect.left;
				scrollY = rootNode.scrollTop - rootRect.top;
			}

			clientRect.left += scrollX;
			clientRect.right += scrollX;
			clientRect.top += scrollY;
			clientRect.bottom += scrollY;
			clientRect.width = 1;

			margin = node.offsetWidth - node.clientWidth;

			if (margin > 0) {
				if (before) {
					margin *= -1;
				}

				clientRect.left += margin;
				clientRect.right += margin;
			}

			return clientRect;
		}

		function trimInlineCaretContainers() {
			var contentEditableFalseNodes, node, sibling, i, data;

			contentEditableFalseNodes = $('*[contentEditable=false]', rootNode);
			for (i = 0; i < contentEditableFalseNodes.length; i++) {
				node = contentEditableFalseNodes[i];

				sibling = node.previousSibling;
				if (CaretContainer.endsWithCaretContainer(sibling)) {
					data = sibling.data;

					if (data.length == 1) {
						sibling.parentNode.removeChild(sibling);
					} else {
						sibling.deleteData(data.length - 1, 1);
					}
				}

				sibling = node.nextSibling;
				if (CaretContainer.startsWithCaretContainer(sibling)) {
					data = sibling.data;

					if (data.length == 1) {
						sibling.parentNode.removeChild(sibling);
					} else {
						sibling.deleteData(0, 1);
					}
				}
			}

			return null;
		}

		function show(before, node) {
			var clientRect, rng, container;

			hide();

			if (isBlock(node)) {
				caretContainerNode = CaretContainer.insertBlock('p', node, before);
				clientRect = getAbsoluteClientRect(node, before);
				$(caretContainerNode).css('top', clientRect.top);

				$lastVisualCaret = $('

').css(clientRect).appendTo(rootNode);

				if (before) {
					$lastVisualCaret.addClass('mce-visual-caret-before');
				}

				startBlink();

				rng = node.ownerDocument.createRange();
				container = caretContainerNode.firstChild;
				rng.setStart(container, 0);
				rng.setEnd(container, 1);
			} else {
				caretContainerNode = CaretContainer.insertInline(node, before);
				rng = node.ownerDocument.createRange();

				if (isContentEditableFalse(caretContainerNode.nextSibling)) {
					rng.setStart(caretContainerNode, 0);
					rng.setEnd(caretContainerNode, 0);
				} else {
					rng.setStart(caretContainerNode, 1);
					rng.setEnd(caretContainerNode, 1);
				}

				return rng;
			}

			return rng;
		}

		function hide() {
			trimInlineCaretContainers();

			if (caretContainerNode) {
				CaretContainer.remove(caretContainerNode);
				caretContainerNode = null;
			}

			if ($lastVisualCaret) {
				$lastVisualCaret.remove();
				$lastVisualCaret = null;
			}

			clearInterval(cursorInterval);
		}

		function startBlink() {
			cursorInterval = Delay.setInterval(function() {
				$('div.mce-visual-caret', rootNode).toggleClass('mce-visual-caret-hidden');
			}, 500);
		}

		function destroy() {
			Delay.clearInterval(cursorInterval);
		}

		function getCss() {
			return (
				'.mce-visual-caret {' +
					'position: absolute;' +
					'background-color: black;' +
					'background-color: currentcolor;' +
				'}' +
				'.mce-visual-caret-hidden {' +
					'display: none;' +
				'}' +
				'*[data-mce-caret] {' +
					'position: absolute;' +
					'left: -1000px;' +
					'right: auto;' +
					'top: 0;' +
					'margin: 0;' +
					'padding: 0;' +
				'}'
			);
		}

		return {
			show: show,
			hide: hide,
			getCss: getCss,
			destroy: destroy
		};
	};
});


text:
Personal website of Zuzana Kňazeová
Powered with Gatsby.

## List of commands
- install: `yarn run install`
- build: `yarn run build`
- serve build: `yarn run serve-build`
- develop: `yarn run develop`
- regenerate images only: `yarn run gulp`
- build but don't regenerate images: `yarn run buildwoimages`


text:
public interface IGameController
{
    void ProcessCommand(string input);

    void ProduceSummury();
}


text:
First the imports, this demo requires the `flask_restful` package.
Then we set up the Flask wsgi application object, `app` and the api wrapper, `api`.

```python
from flask import Flask
from flask_restful import Resource, Api

app = Flask(__name__)
api = Api(app)
```

# Flask Restful resources
We define a single `HelloWorld` resource, that responds with a simple json
object on a `GET` request.

```python
class HelloWorld(Resource):
    def get(self):
        return {'hello': 'world'}
```

# Routing
`api.add_resource()` wires the `Resource` class `HelloWorld` into the flask
router at `/`.

```
api.add_resource(HelloWorld, '/')
```

# Run Server
After we have created everything, we run the flask werkzeug server.

```
if __name__ == '__main__':
    app.run()
```


text:
class User < ActiveRecord::Base

  validates :username, presence: true, uniqueness: true
  validates :password, presence: true

  has_many :guesses
  has_many :companies, through: :guesses

  has_secure_password
end


text:
const repoUrl = 'https://github.com/clay/clay-kiln';
projectName = process.env.PROJECT_NAME || 'clay-kiln';
// See https://docusaurus.io/docs/site-config for all the possible
// site configuration options.

const siteConfig = {
  title: 'Kiln', // Title for your website.
  tagline: 'Editing tools for Clay',
  url: 'https://clay.github.io/', // Your website URL
  baseUrl: '/clay-kiln/', // Base URL for your project */
  // For github.io type URLs, you would set the url and baseUrl like:
  //   url: 'https://facebook.github.io',
  //   baseUrl: '/test-site/',

  // Used for publishing and more
  projectName,
  organizationName: 'kilnplatform',
  // For top-level user or org sites, the organization is still the same.
  // e.g., for the https://JoelMarcey.github.io site, it would be set like...
  //   organizationName: 'JoelMarcey'

  // For no header links in the top nav bar -> headerLinks: [],
  headerLinks: [
    { doc: 'intro', label: 'Introduction' },
    { href: repoUrl, label: 'Github' }
  ],

  /* path to images for header/footer */
  headerIcon: 'img/kiln.png',
  footerIcon: '',
  favicon: '',

  /* Colors for website */
  colors: {
    primaryColor: '#607d8b',
    secondaryColor: '#1976d2'
  },

  /* Custom fonts for website */
  /*
  fonts: {
    myFont: [
      "Times New Roman",
      "Serif"
    ],
    myOtherFont: [
      "-apple-system",
      "system-ui"
    ]
  },
  */

  // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
  copyright: `Copyright © ${new Date().getFullYear()} New York Media`,

  highlight: {
    // Highlight.js theme to use for syntax highlighting in code blocks.
    theme: 'default',
  },

  docsSideNavCollapsible: true,
  // Add custom scripts here that would be placed in <script> tags.
  scripts: ['https://buttons.github.io/buttons.js'],

  // On page navigation for the current documentation page.
  onPageNav: 'separate',
  // No .html extensions for paths.
  cleanUrl: true,

  // Open Graph and Twitter card images.
  ogImage: '',
  twitterImage: ''

  // Show documentation's last contributor's name.
  // enableUpdateBy: true,

  // Show documentation's last update time.
  // enableUpdateTime: true,

  // You may provide arbitrary config keys to be used as needed by your
  // template. For example, if you need your repo's URL...
  //   repoUrl: 'https://github.com/facebook/test-site',
};

module.exports = siteConfig;


text:
package repackaged.com.mangofactory.swagger.readers.operation.parameter;

import com.fasterxml.classmate.ResolvedType;
import com.fasterxml.classmate.TypeResolver;
import com.mangofactory.swagger.models.alternates.AlternateTypeProvider;
import com.mangofactory.swagger.models.dto.Parameter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static com.mangofactory.swagger.models.ResolvedTypes.*;
import static com.mangofactory.swagger.models.Types.*;
import static java.lang.reflect.Modifier.*;

class ModelAttributeParameterExpander {
  private static final Logger LOGGER = LoggerFactory.getLogger(ModelAttributeParameterExpander.class);
  private AlternateTypeProvider alternateTypeProvider;
  private TypeResolver resolver = new TypeResolver();

  public ModelAttributeParameterExpander(AlternateTypeProvider alternateTypeProvider) {
    this.alternateTypeProvider = alternateTypeProvider;
  }

  public void expand(final String parentName, final Class<?> paramType,
                     final List<Parameter> parameters) {

    Set<String> beanPropNames = getBeanPropertyNames(paramType);
    List<Field> fields = getAllFields(paramType);
    LOGGER.debug("Expanding parameter type: {}", paramType);
    for (Field field : fields) {
      LOGGER.debug("Attempting to expanding field: {}", field);

      if (isStatic(field.getModifiers()) || field.isSynthetic() || !beanPropNames.contains(field.getName())) {
        LOGGER.debug("Skipping expansion of field: {}, not a valid bean property", field);
        continue;
      }
      Class<?> resolvedType = getResolvedType(field);
      if (!typeBelongsToJavaPackage(resolvedType) && !field.getType().isEnum()) {
        if (!field.getType().equals(paramType)) {
          LOGGER.debug("Expanding complex field: {} with type: {}", field, resolvedType);
          expand(field.getName(), field.getType(), parameters);
          continue;
        } else {
          LOGGER.warn("Skipping expanding complex field: {} with type: {} as it is recursively defined", field,
                  resolvedType);
        }
      }

      String dataTypeName = typeNameFor(resolvedType);

      if (dataTypeName == null) {
        dataTypeName = resolvedType.getSimpleName();
      }
      LOGGER.debug("Building parameter for field: {}, with type: ", field, resolvedType);
      parameters.add(new ParameterBuilder()
              .forField(field)
              .withDataTypeName(dataTypeName)
              .withParentName(parentName)
              .build());

    }
  }

  private Class<?> getResolvedType(Field field) {
    Class<?> type = field.getType();
    ResolvedType resolvedType = asResolved(resolver, type);
    ResolvedType alternativeType = alternateTypeProvider.alternateFor(resolvedType);
    Class<?> erasedType = alternativeType.getErasedType();
    if (type != erasedType) {
      LOGGER.debug("Found alternative type [{}] for field: [{}-{}]", erasedType, field, type);
    }
    return erasedType;
  }

  private boolean typeBelongsToJavaPackage(Class<?> type) {
    return type.getPackage() == null
            || type.getPackage().getName().startsWith("java")
            || Collection.class.isAssignableFrom(type)
            || Map.class.isAssignableFrom(type);
  }

  private List<Field> getAllFields(final Class<?> type) {

    List<Field> result = new ArrayList<Field>();

    Class<?> i = type;
    while (i != null && i != Object.class) {
      result.addAll(Arrays.asList(i.getDeclaredFields()));
      i = i.getSuperclass();
    }

    return result;
  }

  private Set<String> getBeanPropertyNames(final Class<?> clazz) {

    try {
      Set<String> beanProps = new HashSet<String>();
      PropertyDescriptor[] propDescriptors = Introspector.getBeanInfo(clazz).getPropertyDescriptors();

      for (int i = 0; i < propDescriptors.length; i++) {

        if (propDescriptors[i].getReadMethod() != null && propDescriptors[i].getWriteMethod() != null) {
          beanProps.add(propDescriptors[i].getName());
        }
      }

      return beanProps;

    } catch (IntrospectionException e) {
      throw new RuntimeException(new StringBuilder("Failed to get bean properties on ").append(clazz).toString(), e);
    }

  }

}


text:
package org.apache.nifi.minifi.bootstrap.service;

import static org.apache.nifi.minifi.bootstrap.RunMiNiFi.CONF_DIR_KEY;
import static org.apache.nifi.minifi.bootstrap.RunMiNiFi.DEFAULT_LOGGER;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Properties;
import org.apache.nifi.bootstrap.util.OSUtils;

public class MiNiFiExecCommandProvider {

    private static final String DEFAULT_JAVA_CMD = "java";
    private static final String DEFAULT_LOG_DIR = "./logs";
    private static final String DEFAULT_LIB_DIR = "./lib";
    private static final String DEFAULT_CONF_DIR = "./conf";
    private static final String DEFAULT_CONFIG_FILE = DEFAULT_CONF_DIR + "/bootstrap.conf";
    private static final String WINDOWS_FILE_EXTENSION = ".exe";

    private final BootstrapFileProvider bootstrapFileProvider;

    public MiNiFiExecCommandProvider(BootstrapFileProvider bootstrapFileProvider) {
        this.bootstrapFileProvider = bootstrapFileProvider;
    }

    /**
     * Returns the process arguments required for the bootstrap to start the MiNiFi process.
     *
     * @param listenPort the port where the Bootstrap process is listening
     * @param workingDir working dir of the MiNiFi
     * @return the list of arguments to start the process
     * @throws IOException throws IOException if any of the configuration file read fails
     */
    public List<String> getMiNiFiExecCommand(int listenPort, File workingDir) throws IOException {
        Properties props = bootstrapFileProvider.getBootstrapProperties();
        File confDir = getFile(props.getProperty(CONF_DIR_KEY, DEFAULT_CONF_DIR).trim(), workingDir);
        File libDir = getFile(props.getProperty("lib.dir", DEFAULT_LIB_DIR).trim(), workingDir);
        String minifiLogDir = System.getProperty("org.apache.nifi.minifi.bootstrap.config.log.dir", DEFAULT_LOG_DIR).trim();

        List<String> cmd = new ArrayList<>();
        cmd.add(getJavaCommand(props));
        cmd.add("-classpath");
        cmd.add(buildClassPath(props, confDir, libDir));
        cmd.addAll(getJavaAdditionalArgs(props));
        cmd.add("-Dnifi.properties.file.path=" + getMiNiFiPropsFileName(props, confDir));
        cmd.add("-Dnifi.bootstrap.listen.port=" + listenPort);
        cmd.add("-Dapp=MiNiFi");
        cmd.add("-Dorg.apache.nifi.minifi.bootstrap.config.log.dir=" + minifiLogDir);
        cmd.add("org.apache.nifi.minifi.MiNiFi");

        return cmd;
    }

    private String getJavaCommand(Properties props) {
        String javaCmd = props.getProperty("java");
        if (javaCmd == null) {
            javaCmd = DEFAULT_JAVA_CMD;
        }
        if (javaCmd.equals(DEFAULT_JAVA_CMD)) {
            Optional.ofNullable(System.getenv("JAVA_HOME"))
                .map(javaHome -> getJavaCommandBasedOnExtension(javaHome, WINDOWS_FILE_EXTENSION)
                    .orElseGet(() -> getJavaCommandBasedOnExtension(javaHome, "").orElse(DEFAULT_JAVA_CMD)));
        }
        return javaCmd;
    }

    private Optional<String> getJavaCommandBasedOnExtension(String javaHome, String extension) {
        String javaCmd = null;
        File javaFile = new File(javaHome + File.separatorChar + "bin" + File.separatorChar + "java" + extension);
        if (javaFile.exists() && javaFile.canExecute()) {
            javaCmd = javaFile.getAbsolutePath();
        }
        return Optional.ofNullable(javaCmd);
    }

    private String buildClassPath(Properties props, File confDir, File libDir) {

        File[] libFiles = libDir.listFiles((dir, filename) -> filename.toLowerCase().endsWith(".jar"));
        if (libFiles == null || libFiles.length == 0) {
            throw new RuntimeException("Could not find lib directory at " + libDir.getAbsolutePath());
        }

        File[] confFiles = confDir.listFiles();
        if (confFiles == null || confFiles.length == 0) {
            throw new RuntimeException("Could not find conf directory at " + confDir.getAbsolutePath());
        }

        List<String> cpFiles = new ArrayList<>(confFiles.length + libFiles.length);
        cpFiles.add(confDir.getAbsolutePath());
        for (File file : libFiles) {
            cpFiles.add(file.getAbsolutePath());
        }
        cpFiles.addAll(getJava11Files(libDir));

        StringBuilder classPathBuilder = new StringBuilder();
        for (int i = 0; i < cpFiles.size(); i++) {
            String filename = cpFiles.get(i);
            classPathBuilder.append(filename);
            if (i < cpFiles.size() - 1) {
                classPathBuilder.append(File.pathSeparatorChar);
            }
        }

        return classPathBuilder.toString();
    }

    private List<String> getJava11Files(File libDir) {
        List<String> java11Files = new ArrayList();
        String runtimeJavaVersion = System.getProperty("java.version");
        DEFAULT_LOGGER.info("Runtime Java version: {}", runtimeJavaVersion);
        if (OSUtils.parseJavaVersion(runtimeJavaVersion) >= 11) {
            /* If running on Java 11 or greater, add the JAXB/activation/annotation libs to the classpath.
             *
             * TODO: Once the minimum Java version requirement of NiFi is 11, this processing should be removed.
             * JAXB/activation/annotation will be added as an actual dependency via pom.xml.
             */
            File libJava11Dir = getFile("java11", libDir);
            if (libJava11Dir.exists()) {
                for (File file : libJava11Dir.listFiles((dir, filename) -> filename.toLowerCase().endsWith(".jar"))) {
                    java11Files.add(file.getAbsolutePath());
                }
            }
        }
        return java11Files;
    }

    private List<String> getJavaAdditionalArgs(Properties props) {
        List<String> javaAdditionalArgs = new ArrayList<>();
        for (Entry<Object, Object> entry : props.entrySet()) {
            String key = (String) entry.getKey();
            String value = (String) entry.getValue();

            if (key.startsWith("java.arg")) {
                javaAdditionalArgs.add(value);
            }
        }
        return javaAdditionalArgs;
    }

    private String getMiNiFiPropsFileName(Properties props, File confDir) {
        String minifiPropsFilename = props.getProperty("props.file");
        if (minifiPropsFilename == null) {
            if (confDir.exists()) {
                minifiPropsFilename = new File(confDir, "nifi.properties").getAbsolutePath();
            } else {
                minifiPropsFilename = DEFAULT_CONFIG_FILE;
            }
        }

        return minifiPropsFilename.trim();
    }

    private File getFile(String filename, File workingDir) {
        File file = new File(filename);
        if (!file.isAbsolute()) {
            file = new File(workingDir, filename);
        }
        return file;
    }
}


text:
from __future__ import absolute_import
__author__ = 'katharine'

import pypkjs.PyV8 as v8

from .exceptions import JSRuntimeException

event = v8.JSExtension("runtime/event", """
    Event = function(event_type, event_init_dict) {
        var self = this;
        this.stopPropagation = function() {};
        this.stopImmediatePropagation = function() { self._aborted = true; }
        this.preventDefault = function() { self.defaultPrevented = true; }
        this.initEvent = function(event_type, bubbles, cancelable) {
            self.type = event_type;
            self.bubbles = bubbles;
            self.cancelable = cancelable
        };
        if(!event_init_dict) event_init_dict = {};

        this.type = event_type;
        this.bubbles = event_init_dict.bubbles || false;
        this.cancelable = event_init_dict.cancelable || false;
        this.defaultPrevented = false;
        this.target = null;
        this.currentTarget = null;
        this.eventPhase = 2;
        this._aborted = false;
    };
    Event.NONE = 0;
    Event.CAPTURING_PHASE = 1;
    Event.AT_TARGET = 2;
    Event.BUBBLING_PHASE = 3;
""")

Event = lambda runtime, *args: v8.JSObject.create(runtime.context.locals.Event, args)

class EventSourceMixin(object):
    def __init__(self, runtime):
        self.__listeners = {}
        self.__runtime = runtime
        super(EventSourceMixin, self).__init__()

    def addEventListener(self, event, listener, capture=False):
        self.__listeners.setdefault(event, []).append(listener)

    def removeEventListener(self, event, listener=None):
        if event not in self.__listeners:
            return
        if listener is None:
            del self.__listeners[event]
        else:
            for i, listener_i in enumerate(self.__listeners[event]):
                if listener_i == listener:
                    del listener[i]
                    break

    def triggerEvent(self, event_name, event=None, *params):
        if event is None:
            event = Event(self.__runtime, event_name)

        def go():
            for listener in self.__listeners.get(event_name, []):
                try:
                    listener.call(self, event, *params)
                except (v8.JSError, JSRuntimeException) as e:
                    self.__runtime.log_output(e.stackTrace)
                except Exception as e:
                    self.__runtime.log_output(e.message)
                    raise
                finally:
                    if event._aborted:
                        break
            #TODO: Figure out if these come before or after addEventListener handlers.
            try:
                dom_event = getattr(self, "on" + event_name)
            except AttributeError:
                pass
            else:
                try:
                    if dom_event is not None:
                        dom_event.call(self, event, *params)
                except (v8.JSError, JSRuntimeException) as e:
                    self.__runtime.log_output(e.stackTrace)
                except Exception as e:
                    self.__runtime.log_output(e.message)
                    raise

        self.__runtime.enqueue(go)


text:
package com.typesafe.akka.http.ext.controller.exception;

public class ActionInvocationException extends RuntimeException {

	private static final long serialVersionUID = 4965135803905009335L;

	public ActionInvocationException(Exception cause) {
		super(cause);
	}
}


text:
namespace factor
{

#if defined(WINDOWS) && defined(FACTOR_64)
	const cell seh_area_size = 1024;
#else
	const cell seh_area_size = 0;
#endif

struct code_heap {
	/* The actual memory area */
	segment *seg;

	/* Memory area reserved for SEH. Only used on Windows */
	char *seh_area;

	/* Memory allocator */
	free_list_allocator<code_block> *allocator;

	/* Keys are blocks which need to be initialized by initialize_code_block().
	Values are literal tables. Literal table arrays are GC roots until the
	time the block is initialized, after which point they are discarded. */
	std::map<code_block *, cell> uninitialized_blocks;

	/* Code blocks which may reference objects in the nursery */
	std::set<code_block *> points_to_nursery;

	/* Code blocks which may reference objects in aging space or the nursery */
	std::set<code_block *> points_to_aging;

	explicit code_heap(cell size);
	~code_heap();
	void write_barrier(code_block *compiled);
	void clear_remembered_set();
	bool uninitialized_p(code_block *compiled);
	bool marked_p(code_block *compiled);
	void set_marked_p(code_block *compiled);
	void clear_mark_bits();
	void free(code_block *compiled);
	void flush_icache();
};

struct code_heap_room {
	cell size;
	cell occupied_space;
	cell total_free;
	cell contiguous_free;
	cell free_block_count;
};

}


text:
import Data.IntSet (IntSet)
import qualified Data.IntSet as ISet
import Data.Set (Set)
import qualified Data.Set as Set
import Groups
import Subutils

main = mapM_ (putStrLn . bracket "{}" . ISet.toList)
 $ Set.toList $ subgroups group

subgroups :: Group -> Set IntSet
subgroups g = foldl (\subs c ->
  --foldl (flip Set.insert) subs $ map (addCycle c) $ Set.toList subs
  Set.union subs $ Set.map (addCycle c) subs
 ) cycles (tail $ Set.toList cycles)
 where cycles = Set.fromList $ map (ISet.fromList . g_cycle g) $ g_elems g
       addCycle cyc subgr = newClosure2 (g_oper g) subgr (ISet.toList cyc)


text:
<#PSScriptInfo
.VERSION 1.0.1
.GUID 5d501d8e-4c4d-472f-ae46-7ef3962f1712
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/xPSDesiredStateConfiguration
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>

#Requires -Module xPSDesiredStateConfiguration

<#
    .DESCRIPTION
        Configuration that removes a registry value.

    .PARAMETER Path
        The path to the key in the registry from which the value should be removed.

    .PARAMETER ValueName
        The name of the value to remove.

    .EXAMPLE
        xRegistry_RemoveValueConfig -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' -ValueName 'MyValue'

        Compiles a configuration that removes the registry value MyValue from
        the key 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'.
#>
Configuration xRegistry_RemoveValue_Config
{
    [CmdletBinding()]
    param
    (
        [Parameter(Mandatory = $true)]
        [System.String]
        $Path,

        [Parameter(Mandatory = $true)]
        [System.String]
        $ValueName
    )

    Import-DscResource -ModuleName xPSDesiredStateConfiguration

    Node localhost
    {
        xRegistry RemoveValue
        {
            Key       = $Path
            Ensure    = 'Absent'
            ValueName = $ValueName
        }
    }
}


text:
<?php

namespace mako\tests\unit\gatekeeper\entities\user;

use DateTime;
use mako\chrono\Time;
use mako\gatekeeper\entities\group\Group;
use mako\gatekeeper\entities\user\User;
use mako\gatekeeper\exceptions\GatekeeperException;
use mako\tests\TestCase;
use Mockery;

/**
 * @group unit
 */
class UserTest extends TestCase
{
	/**
	 *
	 */
	public function testGetId(): void
	{
		$user = new User(['id' => 1]);

		$this->assertSame(1, $user->getId());
	}

	/**
	 *
	 */
	public function testSetAndGetEmail(): void
	{
		$user = new User(['email' => 'foo@example.org']);

		$this->assertSame('foo@example.org', $user->getEmail());

		$user->setEmail('bar@example.org');

		$this->assertSame('bar@example.org', $user->getEmail());
	}

	/**
	 *
	 */
	public function testSetAndGetUsername(): void
	{
		$user = new User(['username' => 'foo']);

		$this->assertSame('foo', $user->getUsername());

		$user->setUsername('bar');

		$this->assertSame('bar', $user->getUsername());
	}

	/**
	 *
	 */
	public function testSetAndGetPassword(): void
	{
		$user = new User(['password' => 'hash'], true);

		$this->assertSame('hash', $user->getPassword());

		$user->setPassword('password');

		$this->assertNotSame('hash', $user->getPassword());

		$this->assertNotSame('password', $user->getPassword());
	}

	/**
	 *
	 */
	public function testSetAndGetIp(): void
	{
		$user = new User(['ip' => '::1']);

		$this->assertSame('::1', $user->getIp());

		$user->setIp('127.0.0.1');

		$this->assertSame('127.0.0.1', $user->getIp());
	}

	/**
	 *
	 */
	public function testGenerateActionTokenAndGetActionToken(): void
	{
		$user = new User(['action_token' => 'token']);

		$this->assertSame('token', $user->getActionToken());

		$token = $user->generateActionToken();

		$this->assertSame($token, $user->getActionToken());
	}

	/**
	 *
	 */
	public function testGenerateAccessTokenAndGetAccessToken(): void
	{
		$user = new User(['access_token' => 'token']);

		$this->assertSame('token', $user->getAccessToken());

		$token = $user->generateAccessToken();

		$this->assertSame($token, $user->getAccessToken());
	}

	/**
	 *
	 */
	public function testActiveDeactivateAndIsActivated(): void
	{
		$user = new User(['activated' => 0]);

		$this->assertFalse($user->isActivated());

		$user->activate();

		$this->assertTrue($user->isActivated());

		$user->deactivate();

		$this->assertFalse($user->isActivated());
	}

	/**
	 *
	 */
	public function testBanUnbanAndIsBanne(): void
	{
		$user = new User(['banned' => 0]);

		$this->assertFalse($user->isBanned());

		$user->ban();

		$this->assertTrue($user->isBanned());

		$user->unban();

		$this->assertFalse($user->isBanned());
	}

	/**
	 *
	 */
	public function testValidatePassword(): void
	{
		$user = new User(['password' => 'test']);

		$this->assertTrue($user->validatePassword('test', false));

		$this->assertFalse($user->validatePassword('nope', false));
	}

	/**
	 *
	 */
	public function testIsMemberOfForNonExistingUser(): void
	{
		$this->expectException(GatekeeperException::class);

		$this->expectExceptionMessage('You can only check memberships for users that exist in the database.');

		$user = new User;

		$user->isMemberOf('group');
	}

	/**
	 *
	 */
	public function testIsMemberof(): void
	{
		$user = new User([], false, true, true);

		/** @var \mako\gatekeeper\entities\group\GroupEntityInterface|\Mockery\MockInterface $group1 */
		$group1 = Mockery::mock(Group::class);

		$group1->shouldReceive('getId')->andReturn(1);
		$group1->shouldReceive('getName')->andReturn('foo');

		/** @var \mako\gatekeeper\entities\group\GroupEntityInterface|\Mockery\MockInterface $group2 */
		$group2 = Mockery::mock(Group::class);

		$group2->shouldReceive('getId')->andReturn(2);
		$group2->shouldReceive('getName')->andReturn('bar');

		$user->groups = [$group1, $group2];

		$this->assertFalse($user->isMemberOf(3));

		$this->assertFalse($user->isMemberOf('baz'));

		$this->assertTrue($user->isMemberOf(1));

		$this->assertTrue($user->isMemberOf('foo'));

		$this->assertTrue($user->isMemberOf([3, 1]));

		$this->assertTrue($user->isMemberOf(['baz', 'bar']));

	}

	/**
	 *
	 */
	public function testLockUntilLockedUntilUnlockandIsLocked(): void
	{
		$user = new User(['locked_until' => null]);

		//

		$this->assertNull($user->lockedUntil());

		$this->assertFalse($user->isLocked());

		//

		$user->lockUntil(new DateTime);

		$this->assertInstanceOf(DateTime::class, $user->lockedUntil());

		$this->assertTrue($user->isLocked());

		//

		$user->unlock();

		$this->assertNull($user->lockedUntil());

		$this->assertFalse($user->isLocked());
	}

	/**
	 *
	 */
	public function testGetFailedAttempts(): void
	{
		$user = new User(['failed_attempts' => 3]);

		$this->assertSame(3, $user->getFailedAttempts());
	}

	/**
	 *
	 */
	public function getLastFailAt(): void
	{
		$user = new User(['last_fail_at' => '2017-02-02 12:01:02']);

		$this->assertInstanceOf(Time::class, $user->getLastFailAt());

		$user = new User(['last_fail_at' => null]);

		$this->assertNull($user->getLastFailAt());
	}

	/**
	 *
	 */
	public function testThrottle(): void
	{
		$user = new User(['last_fail_at' => null, 'failed_attempts' => 0, 'locked_until' => null]);

		$user->throttle(2, 3600, false);

		$this->assertSame(1, $user->getFailedAttempts());

		$this->assertFalse($user->isLocked());

		$this->assertInstanceOf(Time::class, $user->getLastFailAt());

		$this->assertNull($user->lockedUntil());
	}

	/**
	 *
	 */
	public function testThrottleWithLimitReached(): void
	{
		$user = new User(['last_fail_at' => Time::now()->rewind(3500), 'failed_attempts' => 1, 'locked_until' => null]);

		$user->throttle(2, 3600, false);

		$this->assertSame(2, $user->getFailedAttempts());

		$this->assertTrue($user->isLocked());

		$this->assertInstanceOf(Time::class, $user->getLastFailAt());

		$this->assertInstanceOf(Time::class, $user->lockedUntil());
	}

	/**
	 *
	 */
	public function testResetThrottle(): void
	{
		$user = new User(['last_fail_at' => Time::now(), 'failed_attempts' => 1, 'locked_until' => Time::now()]);

		$this->assertInstanceOf(Time::class, $user->getLastFailAt());

		$this->assertInstanceOf(Time::class, $user->lockedUntil());

		$this->assertSame(1, $user->getFailedAttempts());

		$user->resetThrottle(false);

		$this->assertNull($user->getLastFailAt());

		$this->assertNull($user->lockedUntil());

		$this->assertSame(0, $user->getFailedAttempts());

	}
}


text:
import signal
import logging
from hephaestus import worker

signal_name_id_mapping = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items()))
     if v.startswith('SIG') and not v.startswith('SIG_'))

def signal_handler(sig, frame):
    signalhandlerLogger = logging.getLogger('hephaestus.startup')
    signalhandlerLogger.info('%s Signal Received' % signal_name_id_mapping[sig])
    worker.clean_shutdown()

signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGHUP, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)


text:
package metric

import (
	"context"
	"flag"

	"github.com/vmware/govmomi/govc/cli"
	"github.com/vmware/govmomi/vim25/methods"
	"github.com/vmware/govmomi/vim25/types"
)

type change struct {
	*PerformanceFlag

	level  int
	device int
}

func init() {
	cli.Register("metric.change", &change{})
}

func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.PerformanceFlag, ctx = NewPerformanceFlag(ctx)
	cmd.PerformanceFlag.Register(ctx, f)

	f.IntVar(&cmd.level, "level", 0, "Level for the aggregate counter")
	f.IntVar(&cmd.device, "device-level", 0, "Level for the per device counter")
}

func (cmd *change) Usage() string {
	return "NAME..."
}

func (cmd *change) Description() string {
	return `Change counter NAME levels.

Examples:
  govc metric.change -level 1 net.bytesRx.average net.bytesTx.average`
}

func (cmd *change) Process(ctx context.Context) error {
	if err := cmd.PerformanceFlag.Process(ctx); err != nil {
		return err
	}
	return nil
}

func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error {
	if f.NArg() == 0 || (cmd.level == 0 && cmd.device == 0) {
		return flag.ErrHelp
	}

	m, err := cmd.Manager(ctx)
	if err != nil {
		return err
	}

	counters, err := m.CounterInfoByName(ctx)
	if err != nil {
		return err
	}

	var mapping []types.PerformanceManagerCounterLevelMapping

	for _, name := range f.Args() {
		counter, ok := counters[name]
		if !ok {
			return cmd.ErrNotFound(name)
		}

		mapping = append(mapping, types.PerformanceManagerCounterLevelMapping{
			CounterId:      counter.Key,
			AggregateLevel: int32(cmd.level),
			PerDeviceLevel: int32(cmd.device),
		})
	}

	_, err = methods.UpdateCounterLevelMapping(ctx, m.Client(), &types.UpdateCounterLevelMapping{
		This:            m.Reference(),
		CounterLevelMap: mapping,
	})

	return err
}


text:
The Oracle Database Node.js driver powers high performance
Node.js applications.

Node-oracledb 0.4 supports basic and advanced Oracle features, including:

- SQL and PL/SQL Execution
- Query results as JavaScript objects or array
- Binding using JavaScript objects or arrays
- Conversion between JavaScript and Oracle types
- Transaction Management
- Connection Pooling
- [Database Resident Connection Pooling](http://docs.oracle.com/database/121/ADFNS/adfns_perf_scale.htm#ADFNS228) (DRCP)
- [External Authentication](http://docs.oracle.com/database/121/DBSEG/authentication.htm#DBSEG99840)
- [Statement Caching](http://docs.oracle.com/database/121/LNOCI/oci09adv.htm#i471377)
- [Client Result Caching](http://docs.oracle.com/database/121/ADFNS/adfns_perf_scale.htm#ADFNS464)
- [End-to-end tracing](http://docs.oracle.com/database/121/TGSQL/tgsql_trace.htm#CHDBDGIJ)
- High Availability Features
  - [Fast Application Notification](http://docs.oracle.com/database/121/ADFNS/adfns_avail.htm#ADFNS538) (FAN)
  - [Runtime Load Balancing](http://docs.oracle.com/database/121/ADFNS/adfns_perf_scale.htm#ADFNS515) (RLB)
  - [Transparent Application Failover](http://docs.oracle.com/database/121/ADFNS/adfns_avail.htm#ADFNS534) (TAF)

Node-oracledb 0.4 is a preview release.  We are actively working on
adding features including LOB support and batch fetching / streaming
of large query result sets.

Share your feedback at the Oracle Technology Network
[Node.js discussion forum](https://community.oracle.com/community/database/developer-tools/node_js/content)
so we can incorporate any fixes and "must-haves" into a 1.0 release
soon.  Issues with node-oracledb can also be reported
[here](https://github.com/oracle/node-oracledb/issues).

The driver is maintained by Oracle Corp.

The node-oracledb home page is on the
[Oracle Technology Network](http://www.oracle.com/technetwork/database/database-technologies/node_js/index.html).

### Example: Simple SELECT statement implementation in node-oracledb

```javascript
var oracledb = require('oracledb');

oracledb.getConnection(
  {
    user          : "hr",
    password      : "welcome",
    connectString : "localhost/XE"
  },
  function(err, connection)
  {
    if (err) {
      console.error(err.message);
      return;
    }
    connection.execute(
      "SELECT department_id, department_name "
    + "FROM departments "
    + "WHERE department_id = :did",
      [180],
      function(err, result)
      {
        if (err) {
          console.error(err.message);
          return;
        }
        console.log(result.rows);
      });
  });
```

With Oracle's sample HR schema, the output is:

```
[ [ 180, 'Construction' ] ]
```

There are more examples in the [examples](examples) directory.

##  2. Installation

The current release of node-oracledb is available only on GitHub.  The basic install steps are:

- Install the small, free [Oracle Instant Client](http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html) libraries if your database is remote, or have a local database such as the free [Oracle XE](http://www.oracle.com/technetwork/database/database-technologies/express-edition/overview/index.html) release.
- Clone this repository
- Run `npm install`

See [INSTALL](INSTALL.md) for details.

##  3. Documentation

See [Documentation for the Oracle Database Node.js Driver](doc/api.md)

##  4. Contributing

Node-oracledb is an open source project. See
[CONTRIBUTING](CONTRIBUTING.md)
for details.

##  5. Licence

Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.

You may not use the identified files except in compliance with the Apache
License, Version 2.0 (the "License.")

You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and
limitations under the License.


text:
import subprocess
from functools import partial

from libqtile import pangocffi
from libqtile.widget import base

class Cmus(base.ThreadPoolText):
    """A simple Cmus widget.

    Show the artist and album of now listening song and allow basic mouse
    control from the bar:

        - toggle pause (or play if stopped) on left click;
        - skip forward in playlist on scroll up;
        - skip backward in playlist on scroll down.

    Cmus (https://cmus.github.io) should be installed.
    """

    defaults = [
        ("play_color", "00ff00", "Text colour when playing."),
        ("noplay_color", "cecece", "Text colour when not playing."),
        ("update_interval", 0.5, "Update Time in seconds."),
    ]

    def __init__(self, **config):
        base.ThreadPoolText.__init__(self, "", **config)
        self.add_defaults(Cmus.defaults)
        self.status = ""
        self.local = None

        self.add_callbacks(
            {
                "Button1": self.play,
                "Button4": partial(subprocess.Popen, ["cmus-remote", "-n"]),
                "Button5": partial(subprocess.Popen, ["cmus-remote", "-r"]),
            }
        )

    def get_info(self):
        """Return a dictionary with info about the current cmus status."""
        try:
            output = self.call_process(["cmus-remote", "-C", "status"])
        except subprocess.CalledProcessError as err:
            output = err.output
        if output.startswith("status"):
            output = output.splitlines()
            info = {
                "status": "",
                "file": "",
                "artist": "",
                "album": "",
                "title": "",
                "stream": "",
            }

            for line in output:
                for data in info:
                    if data in line:
                        index = line.index(data)
                        if index < 5:
                            info[data] = line[len(data) + index :].strip()
                            break
                    elif line.startswith("set"):
                        return info
            return info

    def now_playing(self):
        """Return a string with the now playing info (Artist - Song Title)."""
        info = self.get_info()
        now_playing = ""
        if info:
            status = info["status"]
            if self.status != status:
                self.status = status
                if self.status == "playing":
                    self.layout.colour = self.play_color
                else:
                    self.layout.colour = self.noplay_color
            self.local = info["file"].startswith("/")
            title = info["title"]
            if self.local:
                artist = info["artist"]
                now_playing = "{0} - {1}".format(artist, title)
                if now_playing == " - ":
                    file_path = info["file"]
                    file_path = file_path.split("/")[-1]
                    now_playing = file_path
            else:
                if info["stream"]:
                    now_playing = info["stream"]
                else:
                    now_playing = title
            if now_playing:
                now_playing = "♫ {0}".format(now_playing)
        return pangocffi.markup_escape_text(now_playing)

    def play(self):
        """Play music if stopped, else toggle pause."""
        if self.status in ("playing", "paused"):
            subprocess.Popen(["cmus-remote", "-u"])
        elif self.status == "stopped":
            subprocess.Popen(["cmus-remote", "-p"])

    def poll(self):
        """Poll content for the text box."""
        return self.now_playing()


text:
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding model 'RawMeetingCommittee'
        db.create_table(u'raw_rawmeetingcommittee', (
            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('last_crawled', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('last_parsed', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('uid', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)),
            ('crawled_from', self.gf('django.db.models.fields.TextField')(blank=True)),
            ('slot_id', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('_committee_id', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('committee', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='meeting_committees', null=True, to=orm['raw.RawCommittee'])),
        ))
        db.send_create_signal(u'raw', ['RawMeetingCommittee'])

    def backwards(self, orm):
        # Deleting model 'RawMeetingCommittee'
        db.delete_table(u'raw_rawmeetingcommittee')

    models = {
        u'raw.rawcommittee': {
            'Meta': {'object_name': 'RawCommittee'},
            'code': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'name_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'name_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'url_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'url_e': ('django.db.models.fields.TextField', [], {'blank': 'True'})
        },
        u'raw.rawcommitteemembership': {
            'Meta': {'object_name': 'RawCommitteeMembership'},
            '_committee_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            '_member_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'committee': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'memberships'", 'null': 'True', 'to': u"orm['raw.RawCommittee']"}),
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'member': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'memberships'", 'null': 'True', 'to': u"orm['raw.RawScheduleMember']"}),
            'membership_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'post_c': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'post_e': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
        },
        u'raw.rawcouncilagenda': {
            'Meta': {'ordering': "['-uid']", 'object_name': 'RawCouncilAgenda'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'language': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'local_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'paper_number': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'url': ('django.db.models.fields.TextField', [], {'blank': 'True'})
        },
        u'raw.rawcouncilhansard': {
            'Meta': {'object_name': 'RawCouncilHansard'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'language': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'local_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'paper_number': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
        },
        u'raw.rawcouncilquestion': {
            'Meta': {'object_name': 'RawCouncilQuestion'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'language': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'number_and_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'raised_by': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'raw_date': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'reply_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'subject': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'subject_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
        },
        u'raw.rawcouncilvoteresult': {
            'Meta': {'object_name': 'RawCouncilVoteResult'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'pdf_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'pdf_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
            'raw_date': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'xml_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'xml_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
        },
        u'raw.rawmeeting': {
            'Meta': {'object_name': 'RawMeeting'},
            'agenda_url_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'agenda_url_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'meeting_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'meeting_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'slot_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'subject_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'subject_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'venue_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'})
        },
        u'raw.rawmeetingcommittee': {
            'Meta': {'object_name': 'RawMeetingCommittee'},
            '_committee_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'committee': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'meeting_committees'", 'null': 'True', 'to': u"orm['raw.RawCommittee']"}),
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'slot_id': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
        },
        u'raw.rawmember': {
            'Meta': {'object_name': 'RawMember'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'education_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'education_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'gender': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'homepage': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'honours_c': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'honours_e': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'name_c': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'name_e': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'occupation_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'occupation_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'photo_file': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'place_of_birth': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
            'service_c': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'service_e': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'title_c': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'title_e': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'year_of_birth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
        },
        u'raw.rawschedulemember': {
            'Meta': {'object_name': 'RawScheduleMember'},
            'crawled_from': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'english_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'first_name_c': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'first_name_e': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_crawled': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'last_name_c': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'last_name_e': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'last_parsed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'uid': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'})
        },
        u'raw.scrapejob': {
            'Meta': {'object_name': 'ScrapeJob'},
            'completed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'job_id': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'last_fetched': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'raw_response': ('django.db.models.fields.TextField', [], {}),
            'scheduled': ('django.db.models.fields.DateTimeField', [], {}),
            'spider': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        }
    }

    complete_apps = ['raw']


text:
package org.gradle.language.cpp.internal;

import org.gradle.language.cpp.CppSourceSet;
import org.gradle.language.nativeplatform.internal.AbstractHeaderExportingDependentSourceSet;

public class DefaultCppSourceSet extends AbstractHeaderExportingDependentSourceSet implements CppSourceSet {
    @Override
    protected String getLanguageName() {
        return "C++";
    }
}


text: DROP TABLE sources;


text:
package parser;

import java.sql.SQLException;

import org.antlr.v4.runtime.tree.ParseTreeListener;

/**
 * This interface defines a complete listener for a parse tree produced by
 * {@link TriALQLParser}.
 */
public interface TriALQLListener extends ParseTreeListener {
	/**
	 * Enter a parse tree produced by {@link TriALQLParser#parse}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterParse(TriALQLParser.ParseContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#parse}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitParse(TriALQLParser.ParseContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#block}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterBlock(TriALQLParser.BlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#block}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitBlock(TriALQLParser.BlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#selectBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectBlock(TriALQLParser.SelectBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#selectBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelectBlock(TriALQLParser.SelectBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#selectRecursionBlock}
	 * .
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectRecursionBlock(TriALQLParser.SelectRecursionBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#selectRecursionBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 * @throws SQLException
	 */
	void exitSelectRecursionBlock(TriALQLParser.SelectRecursionBlockContext ctx) throws SQLException;

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#selectJoinBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectJoinBlock(TriALQLParser.SelectJoinBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#selectJoinBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelectJoinBlock(TriALQLParser.SelectJoinBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#operatorBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterOperatorBlock(TriALQLParser.OperatorBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#operatorBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitOperatorBlock(TriALQLParser.OperatorBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#mergeBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterMergeBlock(TriALQLParser.MergeBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#mergeBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitMergeBlock(TriALQLParser.MergeBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#storeBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterStoreBlock(TriALQLParser.StoreBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#storeBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitStoreBlock(TriALQLParser.StoreBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#loadBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterLoadBlock(TriALQLParser.LoadBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#loadBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitLoadBlock(TriALQLParser.LoadBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#dropBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterDropBlock(TriALQLParser.DropBlockContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#dropBlock}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitDropBlock(TriALQLParser.DropBlockContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#equationList}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterEquationList(TriALQLParser.EquationListContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#equationList}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitEquationList(TriALQLParser.EquationListContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#equation}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterEquation(TriALQLParser.EquationContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#equation}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitEquation(TriALQLParser.EquationContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#equationOperator}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterEquationOperator(TriALQLParser.EquationOperatorContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#equationOperator}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitEquationOperator(TriALQLParser.EquationOperatorContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#term}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterTerm(TriALQLParser.TermContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#term}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitTerm(TriALQLParser.TermContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#literal}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterLiteral(TriALQLParser.LiteralContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#literal}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitLiteral(TriALQLParser.LiteralContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#selection}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelection(TriALQLParser.SelectionContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#selection}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelection(TriALQLParser.SelectionContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#selectionRecursion}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectionRecursion(TriALQLParser.SelectionRecursionContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#selectionRecursion}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelectionRecursion(TriALQLParser.SelectionRecursionContext ctx);

	/**
	 * Enter a parse tree produced by
	 * {@link TriALQLParser#selectionProvenanceCreator}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectionProvenanceCreator(TriALQLParser.SelectionProvenanceCreatorContext ctx);

	/**
	 * Exit a parse tree produced by
	 * {@link TriALQLParser#selectionProvenanceCreator}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelectionProvenanceCreator(TriALQLParser.SelectionProvenanceCreatorContext ctx);

	/**
	 * Enter a parse tree produced by
	 * {@link TriALQLParser#selectionProvenanceAppender}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterSelectionProvenanceAppender(TriALQLParser.SelectionProvenanceAppenderContext ctx);

	/**
	 * Exit a parse tree produced by
	 * {@link TriALQLParser#selectionProvenanceAppender}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitSelectionProvenanceAppender(TriALQLParser.SelectionProvenanceAppenderContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#recursionType}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterRecursionType(TriALQLParser.RecursionTypeContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#recursionType}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitRecursionType(TriALQLParser.RecursionTypeContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#kleeneDepth}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterKleeneDepth(TriALQLParser.KleeneDepthContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#kleeneDepth}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitKleeneDepth(TriALQLParser.KleeneDepthContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#filterExpr}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterFilterExpr(TriALQLParser.FilterExprContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#filterExpr}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitFilterExpr(TriALQLParser.FilterExprContext ctx);

	/**
	 * Enter a parse tree produced by {@link TriALQLParser#filterExprAnd}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void enterFilterExprAnd(TriALQLParser.FilterExprAndContext ctx);

	/**
	 * Exit a parse tree produced by {@link TriALQLParser#filterExprAnd}.
	 *
	 * @param ctx
	 *            the parse tree
	 */
	void exitFilterExprAnd(TriALQLParser.FilterExprAndContext ctx);
}


text:
require 'attribute_extras/extra_builder'
require 'attribute_extras/hook_builder'
require 'attribute_extras/modifier'
require 'logger'

# Used for automatic attribute manipulation
module AttributeExtras

  # the registered extras
  mattr_accessor :extras
  self.extras = []

  # wrap up configuration options into one block
  def self.configure(&block)
    yield self
  end

  # the logger for attribute extras
  def self.logger
    @logger ||= Logger.new($stderr)
  end

  # register the extra and build the functions
  def self.register_extra(verb, function, past:, validator:, options: nil)
    past ||= verb
    compiled_validator = validator.is_a?(Proc) ? validator : ->(options){ validator }
    options ||= ->(attribute){ {} }

    extra = ExtraBuilder.new(verb, past, function, compiled_validator, options).build
    hook = HookBuilder.new(verb, past).build

    self.const_set(:"#{verb.capitalize}Attributes", extra)
    self.extras << extra
    ActiveRecord::Base.extend(hook)
  end

  self.register_extra :nullify, ->(value, options){ value.presence },
    past: :nullified,
    validator: { format: { allow_nil: true, without: /\A\s*\z/ } }

  self.register_extra :strip, ->(value, options){ value.is_a?(String) ? value.strip : value },
    past: :stripped,
    validator: { format: { without: /\A\s+|\s+\z/ } }

  self.register_extra :truncate, ->(value, options){ value.is_a?(String) ? value[0...options[:limit]] : value },
    past: :truncated,
    validator: ->(options){ { length: { maximum: options[:limit] } } },
    options: ->(attribute){ { limit: self.columns_hash[attribute.to_s].limit } }

end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Text;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp
{
    internal sealed class UnaryOperatorOverloadResolutionResult
    {
        public readonly ArrayBuilder<UnaryOperatorAnalysisResult> Results;

        public UnaryOperatorOverloadResolutionResult()
        {
            this.Results = new ArrayBuilder<UnaryOperatorAnalysisResult>(10);
        }

        public bool AnyValid()
        {
            foreach (var result in Results)
            {
                if (result.IsValid)
                {
                    return true;
                }
            }

            return false;
        }

        public bool SingleValid()
        {
            bool oneValid = false;
            foreach (var result in Results)
            {
                if (result.IsValid)
                {
                    if (oneValid)
                    {
                        return false;
                    }

                    oneValid = true;
                }
            }

            return oneValid;
        }

        public UnaryOperatorAnalysisResult Best
        {
            get
            {
                UnaryOperatorAnalysisResult best = default(UnaryOperatorAnalysisResult);
                foreach (var result in Results)
                {
                    if (result.IsValid)
                    {
                        if (best.IsValid)
                        {
                            // More than one best applicable method
                            return default(UnaryOperatorAnalysisResult);
                        }
                        best = result;
                    }
                }

                return best;
            }
        }

#if DEBUG
        public string Dump()
        {
            if (Results.Count == 0)
            {
                return "Overload resolution failed because there were no candidate operators.";
            }

            var sb = new StringBuilder();
            if (this.Best.HasValue)
            {
                sb.AppendLine("Overload resolution succeeded and chose " + this.Best.Signature.ToString());
            }
            else if (CountKind(OperatorAnalysisResultKind.Applicable) > 1)
            {
                sb.AppendLine("Overload resolution failed because of ambiguous possible best operators.");
            }
            else
            {
                sb.AppendLine("Overload resolution failed because no operator was applicable.");
            }

            sb.AppendLine("Detailed results:");
            foreach (var result in Results)
            {
                sb.AppendFormat("operator: {0} reason: {1}\n", result.Signature.ToString(), result.Kind.ToString());
            }

            return sb.ToString();
        }

        private int CountKind(OperatorAnalysisResultKind kind)
        {
            int count = 0;
            for (int i = 0, n = this.Results.Count; i < n; i++)
            {
                if (this.Results[i].Kind == kind)
                {
                    count++;
                }
            }

            return count;
        }
#endif

        #region "Poolable"

        public static UnaryOperatorOverloadResolutionResult GetInstance()
        {
            return Pool.Allocate();
        }

        public void Free()
        {
            this.Results.Clear();
            Pool.Free(this);
        }

        //2) Expose the pool or the way to create a pool or the way to get an instance.
        //       for now we will expose both and figure which way works better
        public static readonly ObjectPool<UnaryOperatorOverloadResolutionResult> Pool = CreatePool();

        private static ObjectPool<UnaryOperatorOverloadResolutionResult> CreatePool()
        {
            ObjectPool<UnaryOperatorOverloadResolutionResult> pool = null;
            pool = new ObjectPool<UnaryOperatorOverloadResolutionResult>(() => new UnaryOperatorOverloadResolutionResult(), 10);
            return pool;
        }

        #endregion
    }
}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>include/bingham/gauss_mix.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>

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

Main Page

Classes

Files

        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)"
             onblur="searchBox.OnSearchFieldFocus(false)"
             onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

File Members

include/bingham/gauss_mix.h File Reference
#include "bingham.h"

Classes

struct  	gauss_mix_t

Functions

gauss_mix_t * 	new_gauss_mix (int dims, int k)

gauss_mix_t * 	gauss_mix_clone (gauss_mix_t *gm)

void 	free_gauss_mix (gauss_mix_t *gm)

gauss_mix_t * 	fit_gauss_mix (double **X, int npoints, int dims, double *w, unsigned int kmin, unsigned int kmax, double regularize, double th)

Function Documentation

          gauss_mix_t* fit_gauss_mix
          (
          double **
           X,

          int
           npoints,

          int
           dims,

          double *
           w,

          unsigned int
           kmin,

          unsigned int
           kmax,

          double
           regularize,

          double
           th

          )

          void free_gauss_mix
          (
          gauss_mix_t *
           gm
           )

          gauss_mix_t* gauss_mix_clone
          (
          gauss_mix_t *
           gm
           )

          gauss_mix_t* new_gauss_mix
          (
          int
           dims,

          int
           k

          )

 All Classes Files Functions Variables Typedefs Defines

<address style="text-align: right;">Generated on Wed Apr 18 11:36:55 2012 by

 1.6.3 </address>