text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Nop.Admin.Extensions;
using Nop.Admin.Models.Affiliates;
using Nop.Core;
using Nop.Core.Domain.Affiliates;
using Nop.Core.Domain.Directory;
using Nop.Services.Affiliates;
using Nop.Services.Catalog;
using Nop.Services.Customers;
using Nop.Services.Directory;
using Nop.Services.Helpers;
using Nop.Services.Localization;
using Nop.Services.Orders;
using Nop.Services.Security;
using Nop.Web.Framework.Controllers;
using Nop.Web.Framework.Kendoui;

namespace Nop.Admin.Controllers
{
    public partial class AffiliateController : BaseAdminController
    {
        #region Fields

        private readonly ILocalizationService _localizationService;
        private readonly IWorkContext _workContext;
        private readonly IDateTimeHelper _dateTimeHelper;
        private readonly IWebHelper _webHelper;
        private readonly ICountryService _countryService;
        private readonly IStateProvinceService _stateProvinceService;
        private readonly IPriceFormatter _priceFormatter;
        private readonly IAffiliateService _affiliateService;
        private readonly ICustomerService _customerService;
        private readonly IOrderService _orderService;
        private readonly IPermissionService _permissionService;

        #endregion

        #region Constructors

        public AffiliateController(ILocalizationService localizationService,
            IWorkContext workContext, IDateTimeHelper dateTimeHelper, IWebHelper webHelper,
            ICountryService countryService, IStateProvinceService stateProvinceService,
            IPriceFormatter priceFormatter, IAffiliateService affiliateService,
            ICustomerService customerService, IOrderService orderService,
            IPermissionService permissionService)
        {
            this._localizationService = localizationService;
            this._workContext = workContext;
            this._dateTimeHelper = dateTimeHelper;
            this._webHelper = webHelper;
            this._countryService = countryService;
            this._stateProvinceService = stateProvinceService;
            this._priceFormatter = priceFormatter;
            this._affiliateService = affiliateService;
            this._customerService = customerService;
            this._orderService = orderService;
            this._permissionService = permissionService;
        }

        #endregion

        #region Utilities

        [NonAction]
        protected virtual void PrepareAffiliateModel(AffiliateModel model, Affiliate affiliate, bool excludeProperties,
            bool prepareEntireAddressModel = true)
        {
            if (model == null)
                throw new ArgumentNullException("model");

            if (affiliate != null)
            {
                model.Id = affiliate.Id;
                model.Url = _webHelper.ModifyQueryString(_webHelper.GetStoreLocation(false), "affiliateid=" + affiliate.Id, null);
                if (!excludeProperties)
                {
                    model.AdminComment = affiliate.AdminComment;
                    model.Active = affiliate.Active;
                    model.Address = affiliate.Address.ToModel();
                }
            }

            if (prepareEntireAddressModel)
            {
                model.Address.FirstNameEnabled = true;
                model.Address.FirstNameRequired = true;
                model.Address.LastNameEnabled = true;
                model.Address.LastNameRequired = true;
                model.Address.EmailEnabled = true;
                model.Address.EmailRequired = true;
                model.Address.CompanyEnabled = true;
                model.Address.CountryEnabled = true;
                model.Address.StateProvinceEnabled = true;
                model.Address.CityEnabled = true;
                model.Address.CityRequired = true;
                model.Address.StreetAddressEnabled = true;
                model.Address.StreetAddressRequired = true;
                model.Address.StreetAddress2Enabled = true;
                model.Address.ZipPostalCodeEnabled = true;
                model.Address.ZipPostalCodeRequired = true;
                model.Address.PhoneEnabled = true;
                model.Address.PhoneRequired = true;
                model.Address.FaxEnabled = true;

                //address
                model.Address.AvailableCountries.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.SelectCountry"), Value = "0" });
                foreach (var c in _countryService.GetAllCountries(true))
                    model.Address.AvailableCountries.Add(new SelectListItem { Text = c.Name, Value = c.Id.ToString(), Selected = (affiliate != null && c.Id == affiliate.Address.CountryId) });

                var states = model.Address.CountryId.HasValue ? _stateProvinceService.GetStateProvincesByCountryId(model.Address.CountryId.Value, true).ToList() : new List<StateProvince>();
                if (states.Count > 0)
                {
                    foreach (var s in states)
                        model.Address.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (affiliate != null && s.Id == affiliate.Address.StateProvinceId) });
                }
                else
                    model.Address.AvailableStates.Add(new SelectListItem { Text = _localizationService.GetResource("Admin.Address.OtherNonUS"), Value = "0" });
            }
        }

        #endregion

        #region Methods

        //list
        public ActionResult Index()
        {
            return RedirectToAction("List");
        }

        public ActionResult List()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            return View();
        }

        [HttpPost]
        public ActionResult List(DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliates = _affiliateService.GetAllAffiliates(command.Page - 1, command.PageSize, true);
            var gridModel = new DataSourceResult
            {
                Data = affiliates.Select(x =>
                {
                    var m = new AffiliateModel();
                    PrepareAffiliateModel(m, x, false, false);
                    return m;
                }),
                Total = affiliates.TotalCount,
            };
            return Json(gridModel);
        }

        //create

        public ActionResult Create()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var model = new AffiliateModel();
            PrepareAffiliateModel(model, null, false);
            return View(model);
        }

        [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")]
        [FormValueRequired("save", "save-continue")]
        public ActionResult Create(AffiliateModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            if (ModelState.IsValid)
            {
                var affiliate = new Affiliate();

                affiliate.Active = model.Active;
                affiliate.AdminComment = model.AdminComment;
                affiliate.Address = model.Address.ToEntity();
                affiliate.Address.CreatedOnUtc = DateTime.UtcNow;
                //some validation
                if (affiliate.Address.CountryId == 0)
                    affiliate.Address.CountryId = null;
                if (affiliate.Address.StateProvinceId == 0)
                    affiliate.Address.StateProvinceId = null;
                _affiliateService.InsertAffiliate(affiliate);

                SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Added"));
                return continueEditing ? RedirectToAction("Edit", new { id = affiliate.Id }) : RedirectToAction("List");
            }

            //If we got this far, something failed, redisplay form
            PrepareAffiliateModel(model, null, true);
            return View(model);

        }

        //edit
        public ActionResult Edit(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(id);
            if (affiliate == null || affiliate.Deleted)
                //No affiliate found with the specified id
                return RedirectToAction("List");

            var model = new AffiliateModel();
            PrepareAffiliateModel(model, affiliate, false);
            return View(model);
        }

        [HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")]
        public ActionResult Edit(AffiliateModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(model.Id);
            if (affiliate == null || affiliate.Deleted)
                //No affiliate found with the specified id
                return RedirectToAction("List");

            if (ModelState.IsValid)
            {
                affiliate.Active = model.Active;
                affiliate.AdminComment = model.AdminComment;
                affiliate.Address = model.Address.ToEntity(affiliate.Address);
                //some validation
                if (affiliate.Address.CountryId == 0)
                    affiliate.Address.CountryId = null;
                if (affiliate.Address.StateProvinceId == 0)
                    affiliate.Address.StateProvinceId = null;
                _affiliateService.UpdateAffiliate(affiliate);

                SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Updated"));
                if (continueEditing)
                {
                    //selected tab
                    SaveSelectedTabIndex();

                    return RedirectToAction("Edit", new {id = affiliate.Id});
                }
                return RedirectToAction("List");
            }

            //If we got this far, something failed, redisplay form
            PrepareAffiliateModel(model, affiliate, true);
            return View(model);
        }

        //delete
        [HttpPost]
        public ActionResult Delete(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(id);
            if (affiliate == null)
                //No affiliate found with the specified id
                return RedirectToAction("List");

            _affiliateService.DeleteAffiliate(affiliate);
            SuccessNotification(_localizationService.GetResource("Admin.Affiliates.Deleted"));
            return RedirectToAction("List");
        }

        [HttpPost]
        public ActionResult AffiliatedOrderList(int affiliateId, DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(affiliateId);
            if (affiliate == null)
                throw new ArgumentException("No affiliate found with the specified id");

            var orders = _orderService.SearchOrders(affiliateId: affiliate.Id,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = orders.Select(order =>
                    {
                        var orderModel = new AffiliateModel.AffiliatedOrderModel();
                        orderModel.Id = order.Id;
                        orderModel.OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext);
                        orderModel.PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext);
                        orderModel.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext);
                        orderModel.OrderTotal = _priceFormatter.FormatPrice(order.OrderTotal, true, false);
                        orderModel.CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc);
                        return orderModel;
                    }),
                Total = orders.TotalCount
            };

            return Json(gridModel);
        }

        [HttpPost]
        public ActionResult AffiliatedCustomerList(int affiliateId, DataSourceRequest command)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageAffiliates))
                return AccessDeniedView();

            var affiliate = _affiliateService.GetAffiliateById(affiliateId);
            if (affiliate == null)
                throw new ArgumentException("No affiliate found with the specified id");

            var customers = _customerService.GetAllCustomers(
                affiliateId: affiliate.Id,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize);
            var gridModel = new DataSourceResult
            {
                Data = customers.Select(customer =>
                    {
                        var customerModel = new AffiliateModel.AffiliatedCustomerModel();
                        customerModel.Id = customer.Id;
                        customerModel.Name = customer.Email;
                        return customerModel;
                    }),
                Total = customers.TotalCount
            };

            return Json(gridModel);
        }
        #endregion
    }
}


text:
package io.fundrequest.social.gitter.api.impl;

import io.fundrequest.social.gitter.api.User;

public class UserMother {

    public static User user1() {
        final User user = new User();
        user.setId("53307831c3599d1de448e19a");
        user.setUsername("suprememoocow");
        user.setDisplayName("Andrew Newdigate");
        user.setUrl("/suprememoocow");
        user.setAvatarUrlSmall("https://avatars.githubusercontent.com/u/594566?");
        user.setAvatarUrlMedium("https://avatars.githubusercontent.com/u/594566?");
        return user;
    }
}

redpajama_set_name: RedPajamaGithub


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=4 sw=4 et tw=99 ft=cpp:
 *
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code, released
 * June 24, 2010.
 *
 * The Initial Developer of the Original Code is
 *    The Mozilla Foundation
 *
 * Contributor(s):
 *    Andreas Gal <gal@mozilla.com>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either of the GNU General Public License Version 2 or later (the "GPL"),
 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "jsapi.h"
#include "jswrapper.h"

// Xray wrappers re-resolve the original native properties on the native
// object and always directly access to those properties.

namespace xpc {

extern JSClass HolderClass;

template <typename Base>
class XrayWrapper : public Base {
  public:
    XrayWrapper(uintN flags);
    virtual ~XrayWrapper();

    virtual bool getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                       js::PropertyDescriptor *desc);
    virtual bool getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                          js::PropertyDescriptor *desc);
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);

    static XrayWrapper singleton;
};

}


text:
package bazendpoint

import (
	"context"
	"net/http"
	"runtime/debug"
	"time"

	"github.com/opentracing/opentracing-go"
	"github.com/pkg/errors"
	zanzibar "github.com/uber/zanzibar/runtime"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"

	workflow "github.com/uber/zanzibar/examples/example-gateway/build/endpoints/baz/workflow"
	endpointsIDlEndpointsBazBaz "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz"

	defaultExample "github.com/uber/zanzibar/examples/example-gateway/middlewares/default/default_example"
	defaultExample2 "github.com/uber/zanzibar/examples/example-gateway/middlewares/default/default_example2"

	module "github.com/uber/zanzibar/examples/example-gateway/build/endpoints/baz/module"
)

// SimpleServiceSillyNoopHandler is the handler for "/baz/silly-noop"
type SimpleServiceSillyNoopHandler struct {
	Dependencies *module.Dependencies
	endpoint     *zanzibar.RouterEndpoint
}

// NewSimpleServiceSillyNoopHandler creates a handler
func NewSimpleServiceSillyNoopHandler(deps *module.Dependencies) *SimpleServiceSillyNoopHandler {
	handler := &SimpleServiceSillyNoopHandler{
		Dependencies: deps,
	}
	handler.endpoint = zanzibar.NewRouterEndpoint(
		deps.Default.ContextExtractor, deps.Default,
		"baz", "sillyNoop",
		zanzibar.NewStack([]zanzibar.MiddlewareHandle{
			deps.Middleware.DefaultExample2.NewMiddlewareHandle(
				defaultExample2.Options{},
			),
			deps.Middleware.DefaultExample.NewMiddlewareHandle(
				defaultExample.Options{},
			),
		}, handler.HandleRequest).Handle,
	)

	return handler
}

// Register adds the http handler to the gateway's http router
func (h *SimpleServiceSillyNoopHandler) Register(g *zanzibar.Gateway) error {
	return g.HTTPRouter.Handle(
		"GET", "/baz/silly-noop",
		http.HandlerFunc(h.endpoint.HandleRequest),
	)
}

// HandleRequest handles "/baz/silly-noop".
func (h *SimpleServiceSillyNoopHandler) HandleRequest(
	ctx context.Context,
	req *zanzibar.ServerHTTPRequest,
	res *zanzibar.ServerHTTPResponse,
) context.Context {
	defer func() {
		if r := recover(); r != nil {
			stacktrace := string(debug.Stack())
			e := errors.Errorf("enpoint panic: %v, stacktrace: %v", r, stacktrace)
			ctx = h.Dependencies.Default.ContextLogger.ErrorZ(
				ctx,
				"Endpoint failure: endpoint panic",
				zap.Error(e),
				zap.String("stacktrace", stacktrace),
				zap.String("endpoint", h.endpoint.EndpointName))

			h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1)
			res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil)
		}
	}()

	// log endpoint request to downstream services
	if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil {
		zfields := []zapcore.Field{
			zap.String("endpoint", h.endpoint.EndpointName),
		}
		for _, k := range req.Header.Keys() {
			if val, ok := req.Header.Get(k); ok {
				zfields = append(zfields, zap.String(k, val))
			}
		}
		ctx = h.Dependencies.Default.ContextLogger.DebugZ(ctx, "endpoint request to downstream", zfields...)
	}

	w := workflow.NewSimpleServiceSillyNoopWorkflow(h.Dependencies)
	if span := req.GetSpan(); span != nil {
		ctx = opentracing.ContextWithSpan(ctx, span)
	}

	ctx, cliRespHeaders, err := w.Handle(ctx, req.Header)
	// map useful client response headers to server response
	if cliRespHeaders != nil {
		if val, ok := cliRespHeaders.Get(zanzibar.ClientResponseDurationKey); ok {
			if duration, err := time.ParseDuration(val); err == nil {
				res.DownstreamFinishTime = duration
			}
			cliRespHeaders.Unset(zanzibar.ClientResponseDurationKey)
		}
		if val, ok := cliRespHeaders.Get(zanzibar.ClientTypeKey); ok {
			res.ClientType = val
			cliRespHeaders.Unset(zanzibar.ClientTypeKey)
		}
	}

	if err != nil {

		switch errValue := err.(type) {

		case *endpointsIDlEndpointsBazBaz.AuthErr:
			res.WriteJSON(
				403, cliRespHeaders, errValue,
			)
			return ctx

		case *endpointsIDlEndpointsBazBaz.ServerErr:
			res.WriteJSON(
				500, cliRespHeaders, errValue,
			)
			return ctx

		default:
			res.SendError(500, "Unexpected server error", err)
			return ctx
		}

	}

	res.WriteJSONBytes(204, cliRespHeaders, nil)
	return ctx
}


text:
class CoveredZBorCar: public Car {
public:
	virtual int getResId();
	CoveredZBorCar(const Car::Holder& train, const Vec2& position);
	virtual ~CoveredZBorCar();
};

#endif


text:
cask "fabfilter-saturn" do
  version "2.03"
  sha256 "b4a86cc8e006adad410c9c7204b958b4cb1670c64a9eb5ab88f2fd788990541c"

  url "https://download.fabfilter.com/ffsaturn#{version.no_dots}.dmg"
  name "FabFilter Saturn"
  desc "Multiband distorsion/saturation plug-in"
  homepage "https://www.fabfilter.com/products/saturn-2-multiband-distortion-saturation-plug-in"

  livecheck do
    url "https://www.fabfilter.com/download"
    strategy :page_match do |page|
      match = page.match(%r{href=".*?/ffsaturn(\d)(\d\d)\.dmg}i)
      "#{match[1]}.#{match[2]}"
    end
  end

  depends_on macos: ">= :yosemite"

  pkg "FabFilter Saturn #{version} Installer.pkg"

  uninstall pkgutil: [
    "com.fabfilter.Saturn.#{version.major}",
  ]
end


text:
layout: project
title: Kawaii Aishiteru Wormhole Adventure
summary: "A dating sim made for Fuck This Jame 2014.
The goal was to make a game in a genre that you hate and/or know nothing about."
logo: kawalogo.png
color: rgb(17, 0, 88)
weight: 3
width: 2
height: 2
---

Platform: Phaser HTML5 engine for desktop and mobile browsers
Development: A fraction of 1 week
Team: 3
Source Code: [GitHub](https://github.com/foolmoron/Kawaii-Wormhole-Adventure)
My Role:

* All programming and design
* All writing (unfortunately)
* Non-character art


text:
class StaffplansController < ApplicationController
  def index
    @users = current_company.active_users.map(&:decorate)
  end

  def show
    @user = current_company.users.find(params[:id])
    @user_projects = @user.user_projects.for_company(current_company).includes(:work_weeks, :assignment_totals).to_a
  end

  def date_range
    @users = current_company.active_users.includes(:memberships, :staffplans_totals_view).to_a
    render(json: ActiveModel::ArraySerializer.new(@users, each_serializer: StaffplansListSerializer, from: params[:from], to: params[:to]))
  end
end


text:
<?php

namespace WildPHP\Modules\Aggregator;

use ValidationClosures\Types;
use WildPHP\Core\ComponentContainer;
use WildPHP\Core\Configuration\Configuration;
use WildPHP\Core\ContainerTrait;
use WildPHP\Core\Logger\Logger;
use Yoshi2889\Collections\Collection;

class SourceDictionary extends Collection
{
	use ContainerTrait;

	/**
	 * SourceDictionary constructor.
	 *
	 * @param ComponentContainer $container
	 */
	public function __construct(ComponentContainer $container)
	{
		$this->setContainer($container);
		parent::__construct(Types::instanceof(IAggregatorSource::class));
	}

	/**
	 * @return string[] The keys of all found sources.
	 */
	public function findAllSources()
	{
		$allSources = Configuration::fromContainer($this->getContainer())['aggregator']['sources'];

		$validSources = [];
		foreach ($allSources as $key => $source)
		{
			if (!class_exists($source))
				continue;

			$validSources[$key] = $source;
		}

		return $validSources;
	}

	/**
	 * @param string[] $sources
	 *
	 * @return array<string,IAggregatorSource> The keys of all loaded sources.
	 */
	public function loadSources($sources = [])
	{
		$loadedSources = [];
		foreach ($sources as $key => $source)
		{

			if (!($source = $this->loadSource($source, $key)))
				continue;

			/** @var $source IAggregatorSource */
			$this->offsetSet($key, $source);
			$loadedSources[$key] = $source;

			Logger::fromContainer($this->getContainer())
				->debug('[Aggregator] Added source', [
					'key' => $key,
					'class' => $source,
					'name' => $source->getReadableName(),
					'description' => $source->getDescription()
				]);
		}

		return $loadedSources;
	}

	/**
	 * @param string $source
	 * @param string $key
	 *
	 * @return boolean|IAggregatorSource
	 */
	public function loadSource($source, $key)
	{
		if ($this->offsetExists($key))
			return $this[$key];

		if (!class_exists($source) || empty($source) || empty($key))
			return false;

		$instance = new $source();

		if (!($instance instanceof IAggregatorSource))
			return false;

		return $instance;
	}
}


text:
<!DOCTYPE html>

    <title>CNLModelDictionary Protocol Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">

          CNLDataProvider Docs

         (33% documented)

        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>

            View on GitHub

      CNLDataProvider Reference

      CNLModelDictionary Protocol Reference

            Guides

                README

            Classes

                CNLCollectionViewLoadMoreCell

                CNLDataSource

                CNLDataViewerRefreshControl

                CNLModel

                CNLTableViewLoadMoreCell

            Enums

                CNLDataProviderContentStateKind

                CNLDataViewerCellAnimation

                CNLDataViewerScrollPosition

                CNLModelAPIMethod

            Extensions

                UICollectionView

                UITableView

            Instance Methods

                afterFetch()

                afterLoad()

                afterLoad(_:)

                beforeFetch()

                createItems(_:)

                fetchFromStart(completed:)

                fetchNext(completed:)

                fullRefresh(showActivity:)

                indexPathOfItem(check:)

                indexPathsOfItems(check:)

                initializeWith(dataSource:fetch:)

                itemAtIndexPath(indexPath:)

                itemCountInSection(section:)

                loadFromArray(_:)

                loadFromDictionary(_:)

                sectionForItem(item:)

                sectionTextForItem(item:)

                storeToArray()

                storeToDictionary()

                update(success:failed:)

                update(success:failed:)

                update(success:failed:)

                updateContentState()

                updateCounts()

                updateDataViewer(completed:)

                updateDataViewerPage(completed:)

            Instance Variables

                noData

                sectionCount

            Protocols

                CNLCanShowViewAcvtitity

                CNLDataProvider

                CNLDataProviderContentState

                CNLDataProviderEditable

                CNLDataSourceModel

                CNLDataViewer

                CNLDataViewerActivity

                CNLDataViewerCell

                CNLDataViewerHeader

                CNLDataViewerLoadMoreCell

                CNLDataViewerRefreshControlProtocol

                CNLModelAPI

                CNLModelAPIEndpoint

                CNLModelArray

                CNLModelDataLoadable

                CNLModelDictionary

                CNLModelDictionaryKeyStored

                CNLModelError

                CNLModelErrorKind

                CNLModelImageLoadable

                CNLModelIncrementalArray

                CNLModelIncrementalArrayElement

                CNLModelIncrementalArrayElementStates

                CNLModelIncrementalTokenizedArray

                CNLModelMetaArray

                CNLModelMetaArrayItem

                CNLModelNetwork

                CNLModelObject

                CNLModelObjectEditable

                CNLModelObjectPrimaryKey

                CNLModelObjectTokenized

                CNLRefreshableScrollView

            Static Methods

                loadFromArray(_:)

            Structs

                CNLDataProviderVariables

                CNLModelErrorAlert

                – Style

                CNLNetwork

                – Download

CNLModelDictionary

public protocol CNLModelDictionary

Base dictionary model

                    init()

Default initializer

Declaration

Swift

init()

                    init(dictionary:)

                        Default implementation

Initializer with values from the dictionary
Calls loadFromDictionary(_:) by default

Default Implementation

Default implementation. Initializer with values from the dictionary
Calls loadFromDictionary(_:) by default

Declaration

Swift

init?(dictionary: CNLDictionary?)

                    loadFromDictionary(_:)

                        Default implementation

Loads (deserialize) values from the dictionary

Default Implementation

Default implementation. Stub: does nothing.

Declaration

Swift

func loadFromDictionary(_ dictionary: CNLDictionary)

Parameters

                                dictionary

Source dictionary

                    storeToDictionary()

                        Default implementation

Stores (serialize) values to the dictionary

Default Implementation

Default implementation. Stub: returns empty dictionary

Declaration

Swift

func storeToDictionary() -> CNLDictionary

Return Value

Result dictionart

                    updateDictionary()

                        Default implementation

Updates model values. By default, calls updateDictionary(success:failed:) with empty closures.

Default Implementation

Default implementation. Calls updateDictionary(success:failed:) with empty closures.

Declaration

Swift

func updateDictionary()

                    updateDictionary(success:failed:)

                        Default implementation

Updates model values
By default, creates API struct instance returned by createAPI() function,
perform network request by CNLModel.networkProvider?.performRequest function.
When successed, try to deserialize values with loadFromDictionary(_:) function and invokes success callback.
Calls failed callback if any error occured during request

Default Implementation

Default implementation. Updates model values
Creates API struct instance returned by createAPI() function,
perform network request by CNLModel.networkProvider?.performRequest function.
When successed, try to deserialize values with loadFromDictionary(_:) function and invokes success callback.
Calls failed callback if any error occured during request

Declaration

Swift

func updateDictionary(success: @escaping CNLModel.Success, failed: @escaping CNLModel.Failed)

Parameters

                                success

Callback when operation was successfull

                                failed

Callback when operation was failed

© 2017 Complex Numbers. All rights reserved. (Last updated: 2017-07-10)

Generated by jazzy ♪♫ v0.8.2, a Realm project.


text:
<?php
session_start();
include 'includes.php';
$database = new Database();
$db = $database->getConnection();

$login = new Login();
$member = new Member($db);
if ($login->getSession()) {
    $member->getById($login->getSession());
    $smarty->assign('login',$member->getUsername());
    if ($member->getPermissions()->isAdmin()) {
        $smarty->assign('isadmin',true);
    }
}
else {
    $member = new Member($db);
    $member->isGuest(true); //Memberobject als gast aanmaken
}

$smarty->display('header.tpl');
echo PHP_EOL;

if (!$member->getUsername()) {
    //gebruiker niet ingelogd
    $smarty->display('not_logged_in.tpl');
}
else {
    $avatar_errors = array();
    if ((isset($_POST['Submit'])) && ($_POST['Submit'] == 'Upload')) {
        //Avatar geupload
        include_once('lib/phpthumb/ThumbLib.inc.php');

        if (!getimagesize($_FILES['avatar']['tmp_name'])) {
            //Geen geldige afbeelding
            array_push($avatar_errors,"Ongeldig bestandsformaat");
        }
        else {
            //Geldige afbeelding

            $imgtype = array(
                '1' => '.gif',
                '2' => '.jpg' ,
                '3' => '.png');

            //Breedte, hoogte, extensie ophalen
            list($width, $height, $type) = getimagesize($_FILES['avatar']['tmp_name']);

            //Extensie aan variabele toewijzen
            switch ($type) {
                case 1: $ext='.gif'; break;
                case 2: $ext = '.jpg';break;
                case 3: $ext='.png'; break;
            }

            //Afmetingen afbeelding controleren
            if ($width > 1000 || $height > 1000) {
                //Te grote afmetingen
                array_push($avatar_errors,"De afbeelding mag maximum 1000x1000 pixels groot zijn");
            }
            else {
                //Afbeelding niet te groot

                //Maximum grootte
                if ($_FILES['avatar']['size'] > 500000 ) {
                    //Afbeelding te groot
                    array_push($avatar_errors,"De afbeelding mag niet groter dan 500kB zijn");
                }
                else {
                    //Afbeelding niet te groot

                    $uploaddir = 'uploads/';
                    $secondname = rand(1,999);
                    $uploadfile = $uploaddir . "img-" .$login->getSession() . "-" . $secondname . $ext;

                    if (!move_uploaded_file($_FILES['avatar']['tmp_name'], $uploadfile )) {
                        array_push($avatar_errors,"De afbeelding kon niet geupload worden");
                    }
                    else {
                        $thumb = PhpThumbFactory::create($uploadfile);
                        $thumb->resize(100,100);
                        $thumb->save($uploadfile);

                        $member->setAvatar($uploadfile);
                        if (!$member->updateAvatar()) {
                            //Updaten in de database mislukt
                            array_push($avatar_errors,"De nieuwe afbeelding kon niet opgeslagen worden");
                        }
                        else {
                            //Updaten avatar gelukt
                        }
                    }
                }
            }
        }
    }
    $smarty->assign('avatar_errors',$avatar_errors);
    if (@is_array(getimagesize($member->getAvatar()))) {
        $smarty->assign('avatar',$member->getAvatar());
    }

    if ((isset($_POST['Submit'])) && ($_POST['Submit'] == 'Signature veranderen')) {
        $member->setSignature($_POST['signature']);
        $member->updateSignature();
    }

    if ($member->getSignature() != "") {
        $smarty->assign('signature',$member->getSignature());
    }

    $smarty->display('usercp.tpl');
}

echo PHP_EOL;
$smarty->display('footer.tpl');
?>


text:
<!DOCTYPE HTML>

<title>Uses of Interface com.brettonw.bedrock.database.Interface (Database 1.6.2 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-06-15">
<meta name="description" content="use: package: com.brettonw.bedrock.database, interface: Interface">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

Uses of Interface
com.brettonw.bedrock.database.Interface

Uses of Interface in com.brettonw.bedrock.database

Classes in com.brettonw.bedrock.database that implement Interface

Modifier and Type
Class
Description

class
MongoDatabase

Methods in com.brettonw.bedrock.database that return Interface

Modifier and Type
Method
Description

Interface
Interface.delete(String queryJson)

Interface
MongoDatabase.delete(String queryJson)

Interface
Interface.deleteAll()

Interface
MongoDatabase.deleteAll()

Interface
Interface.deleteMany(String queryJson)

Interface
MongoDatabase.deleteMany(String queryJson)

Interface
Interface.put(BagObject bagObject)

Interface
MongoDatabase.put(BagObject bagObject)

Interface
Interface.putMany(BagArray bagArray)

Interface
MongoDatabase.putMany(BagArray bagArray)

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Copyright © 2020. All rights reserved.


text:
external help file: Microsoft.Azure.Commands.Management.CognitiveServices.dll-Help.xml
ms.assetid: 386F09F0-2EEC-4B55-825C-F2E88D3B60AA
online version:
schema: 2.0.0
---

# Get-AzureRmCognitiveServicesAccountSkus

## SYNOPSIS
Gets the available SKUs for an account.

## SYNTAX

```
Get-AzureRmCognitiveServicesAccountSkus [-ResourceGroupName] <String> [-Name] <String> [<CommonParameters>]
```

## DESCRIPTION
The **Get-AzureRmCognitiveServicesAccountSkus** cmdlet gets the available SKUs for a Cognitive Services account.

The SKU is the tier plan for an account.
It defines the price, call limit, and rate for the account.
The F0 SKU is a free tier.
Paid tiers include S0, S1, S2, and so on.

## EXAMPLES

### 1:
```

```

## PARAMETERS

### -Name
Specifies the name of the account.

```yaml
Type: String
Parameter Sets: (All)
Aliases: CognitiveServicesAccountName, AccountName

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ResourceGroupName
Specifies the name of the resource group the account is assigned to.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

## RELATED LINKS


text:
import { Component } from '@angular/core';

/**
 * This class represents the lazy loaded AboutComponent.
 */
@Component({
  moduleId: module.id,
  selector: 'pkp-background',
  templateUrl: 'background.component.html',
  styleUrls: ['background.component.css']
})
export class BackgroundComponent { }


text:
var UserPrefs = {};

UserPrefs.bodyDivId = 'userprefs_page';

UserPrefs.NAME_IRL_MAX_LENGTH = 40;
UserPrefs.EMAIL_MAX_LENGTH = 254;
UserPrefs.MIN_IMAGE_SIZE = 80;
UserPrefs.MAX_IMAGE_SIZE = 200;
UserPrefs.GENDER_MAX_LENGTH = 100;
UserPrefs.HOMEPAGE_MAX_LENGTH = 100;
UserPrefs.COMMENT_MAX_LENGTH = 255;
UserPrefs.DEFAULT_COLORS = {
  'player_color': '#dd99dd',
  'opponent_color': '#ddffdd',
  'neutral_color_a': '#cccccc',
  'neutral_color_b': '#dddddd',
};
UserPrefs.ALTERNATE_GENDER_OPTION = 'It\'s complicated';

////////////////////////////////////////////////////////////////////////
// Action flow through this page:
// * UserPrefs.showLoggedInPage() is the landing function.  Always call
//   this first
// * UserPrefs.assemblePage(), which calls one of a number of functions
//   UserPrefs.action<SomeAction>()
// * each UserPrefs.action<SomeAction>() function must set UserPrefs.page and
//   UserPrefs.form, then call Login.arrangePage()
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
// GENERIC FUNCTIONS: these do not depend on the action being taken

UserPrefs.showLoggedInPage = function() {
  Env.callAsyncInParallel(
    [
      { 'func': Api.getButtonData, 'args': [ null ] },
      Api.getUserPrefsData,
    ], UserPrefs.assemblePage);
};

// Assemble and display the userprefs portion of the page
UserPrefs.assemblePage = function() {
  if (Api.user_prefs.load_status == 'ok') {

    // There's only one possible action, allowing the user to change
    // the preferences
    UserPrefs.actionSetPrefs();
  } else {
    UserPrefs.actionFailed();
  }
};

////////////////////////////////////////////////////////////////////////
// This section contains one page for each type of next action used for
// flow through the page being laid out by UserPrefs.js.
// Each function should start by populating UserPrefs.page and
// UserPrefs.form and end by invoking Login.arrangePage();

UserPrefs.actionFailed = function() {

  // Create empty page and undefined form objects to be filled later
  UserPrefs.page = $('<div>');
  UserPrefs.form = null;

  // No text because page data acquisition failed - Env.message
  // will tell the user what happened

  // Lay out the page
  Login.arrangePage(UserPrefs.page, UserPrefs.form, '#userprefs_action_button');
};

UserPrefs.actionSetPrefs = function() {
  // Include the option to leave them blank
  var buttons = { '': '' };
  var buttonSets = { '': '' };

  $.each(Api.button.list, function(button, buttonInfo) {
    buttonSets[buttonInfo.buttonSet] = buttonInfo.buttonSet;
    buttons[button] = button;
  });

  // Create empty page and undefined form objects to be filled later
  UserPrefs.page = $('<div>');
  UserPrefs.form = null;

  var prefsdiv = $('<div>');
  var prefsform = $('<form>', {
    'id': 'userprefs_action_form',
    'action': 'javascript:void(0);'
  });

  // We can't use a variable as a key when we're defining an object like this,
  // so we need to do that entry separately.
  var genderDefaults = {
    '': '',
    'Male': 'Male',
    'Female': 'Female',
  };
  genderDefaults[UserPrefs.ALTERNATE_GENDER_OPTION] =
    UserPrefs.ALTERNATE_GENDER_OPTION;

  var profileBlurb = 'These settings affect what appears on your profile page.';
  var profileSettings = {
    'name_irl': {
      'text': 'Real name',
      'type': 'text',
      'value': Api.user_prefs.name_irl,
      'length': UserPrefs.NAME_IRL_MAX_LENGTH,
    },
    'is_email_public': {
      'text': 'Make email address public',
      'type': 'checkbox',
      'checked': Api.user_prefs.is_email_public,
    },
    'dob': {
      'text': 'Birthday',
      'type': 'date',
      'value': {
        'month': Api.user_prefs.dob_month,
        'day': Api.user_prefs.dob_day,
      },
    },
    'gender_select': {
      'text': 'Gender',
      'type': 'select',
      'value': Api.user_prefs.gender,
      'source': genderDefaults,
    },
    'gender_text': {
      'text': 'Feel free to elaborate',
      'type': 'text',
      'value': Api.user_prefs.gender,
      'length': UserPrefs.GENDER_MAX_LENGTH,
    },
    'uses_gravatar': {
      'text': 'Use gravatar for profile image',
      'type': 'checkbox',
      'checked': Api.user_prefs.uses_gravatar,
    },
    'image_size': {
      'text': 'Gravatar image size',
      'type': 'text',
      'value': Api.user_prefs.image_size,
      'after': ' pixels',
    },
    'favorite_button': {
      'text': 'Favorite button',
      'type': 'select',
      'value': Api.user_prefs.favorite_button,
      'source': buttons,
    },
    'favorite_buttonset': {
      'text': 'Favorite button set',
      'type': 'select',
      'value': Api.user_prefs.favorite_buttonset,
      'source': buttonSets,
    },
    'homepage': {
      'text': 'Homepage',
      'type': 'text',
      'value': Api.user_prefs.homepage,
      'length': UserPrefs.HOMEPAGE_MAX_LENGTH,
    },
    'comment': {
      'text': 'Comment',
      'type': 'textarea',
      'value': Api.user_prefs.comment,
      'length': UserPrefs.COMMENT_MAX_LENGTH,
    },
  };

  var autoBlurb = 'These preferences configure things that the site can do ' +
    'automatically for you.';
  var autoPrefs = {
    'autoaccept': {
      'text': 'Automatically accept challenges from other players',
      'type': 'checkbox',
      'checked': Api.user_prefs.autoaccept,
    },
    'autopass': {
      'text': 'Automatically pass when you have no valid attack',
      'type': 'checkbox',
      'checked': Api.user_prefs.autopass,
    },
    'monitor_redirects_to_game': {
      'text': 'Redirect to waiting games when in Monitor mode',
      'type': 'checkbox',
      'checked': Api.user_prefs.monitor_redirects_to_game,
    },
    'monitor_redirects_to_forum': {
      'text': 'Redirect to new forum posts when in Monitor mode',
      'type': 'checkbox',
      'checked': Api.user_prefs.monitor_redirects_to_forum,
    },
    'automatically_monitor': {
      'text': 'Automatically Monitor after "Next game" runs out',
      'type': 'checkbox',
      'checked': Api.user_prefs.automatically_monitor,
    },
  };

  var gameplayBlurb = 'These preferences make advanced Button Men attacks ' +
    'available to you, at the expense of a more complex user experience.';
  var gameplayPrefs = {
    'fire_overshooting': {
      'text': 'Enable fire overshooting for power attacks',
      'type': 'checkbox',
      'checked': Api.user_prefs.fire_overshooting,
    },
  };

  var colorBlurb =
    'These are the colors used to represent each player in a game.';
  var colorPrefs = {
    'player_color': {
      'text': 'Your color',
      'type': 'color',
      'value': Api.user_prefs.player_color,
    },
    'opponent_color': {
      'text': 'Your opponent\'s color',
      'type': 'color',
      'value': Api.user_prefs.opponent_color,
    },
    'neutral_color_a': {
      'text': 'Neutral player color',
      'type': 'color',
      'value': Api.user_prefs.neutral_color_a,
    },
    'neutral_color_b': {
      'text': 'Neutral player opponent\'s color',
      'type': 'color',
      'value': Api.user_prefs.neutral_color_b,
    },
  };

  var accountBlurb = 'Current password is required to change email address ' +
    'or password.';
  var accountSettings = {
    'current_password': {
      'text': 'Current password',
      'type': 'password',
      'value': '',
    },
    'new_password': {
      'text': 'New password',
      'type': 'password',
      'value': '',
    },
    'confirm_new_password': {
      'text': 'Confirm new password',
      'type': 'password',
      'value': '',
    },
    'current_email': {
      'text': 'Current email address',
      'type': 'display',
      'value': Api.user_prefs.email,
      'length': UserPrefs.EMAIL_MAX_LENGTH,
    },
    'new_email': {
      'text': 'New email address',
      'type': 'text',
      'value': '',
      'length': UserPrefs.EMAIL_MAX_LENGTH,
    },
    'confirm_new_email': {
      'text': 'Confirm new email address',
      'type': 'text',
      'value': '',
    },
  };

  var browserBlurb = 'These preferences will only apply to the browser ' +
    'you\'re currently using.';
  var browserPrefs = {
    'noImages': {
      'text': 'Don\'t load button or player images',
      'type': 'checkbox',
      'checked': Env.getCookieNoImages(),
    },
    'compactMode': {
      'text': 'Use compact version of game interface',
      'type': 'checkbox',
      'checked': Env.getCookieCompactMode(),
    }
  };

  var prefsTable = $('<table>', { 'class': 'prefsTable', });
  prefsdiv.append(prefsTable);

  UserPrefs.appendToPreferencesTable(prefsTable, 'Profile Settings',
    profileBlurb, profileSettings);
  UserPrefs.appendToPreferencesTable(prefsTable, 'Automation Preferences',
    autoBlurb, autoPrefs);
  UserPrefs.appendToPreferencesTable(prefsTable, 'Gameplay Preferences',
    gameplayBlurb, gameplayPrefs);
  UserPrefs.appendToPreferencesTable(prefsTable, 'Color Preferences',
    colorBlurb, colorPrefs);
  UserPrefs.appendToPreferencesTable(prefsTable, 'Account Settings',
    accountBlurb, accountSettings);
  UserPrefs.appendToPreferencesTable(prefsTable, 'Browser Preferences',
    browserBlurb, browserPrefs);

  // Gender and gravatar inputs are dynamic
  var genderText = prefsTable.find('#userprefs_gender_text');
  var genderSelect = prefsTable.find('#userprefs_gender_select');
  if (Api.user_prefs.gender === '' || Api.user_prefs.gender == 'Male' ||
      Api.user_prefs.gender == 'Female') {
    genderText.closest('tr').hide();
    genderText.val('');
  } else if (Api.user_prefs.gender == UserPrefs.ALTERNATE_GENDER_OPTION) {
    genderText.val('');
  } else {
    genderSelect.val(UserPrefs.ALTERNATE_GENDER_OPTION);
  }
  genderSelect.change(function() {
    if (genderSelect.val() == UserPrefs.ALTERNATE_GENDER_OPTION) {
      genderText.closest('tr').show();
    } else {
      genderText.closest('tr').hide();
      genderText.val('');
    }
  });

  var gravatarCheck = prefsTable.find('#userprefs_uses_gravatar');
  var imageSizeText = prefsTable.find('#userprefs_image_size');
  if (!Api.user_prefs.uses_gravatar) {
    imageSizeText.closest('tr').hide();
    imageSizeText.val('');
  }
  gravatarCheck.change(function() {
    if (gravatarCheck.is(':checked')) {
      imageSizeText.closest('tr').show();
    } else {
      imageSizeText.closest('tr').hide();
      genderText.val('');
    }
  });

  // Form submission button
  prefsform.append($('<button>', {
    'id': 'userprefs_action_button',
    'text': 'Save preferences'
  }));
  prefsdiv.append(prefsform);

  UserPrefs.page.append(prefsdiv);

  // Function to invoke on button click
  UserPrefs.form = UserPrefs.formSetPrefs;

  // Lay out the page
  Login.arrangePage(UserPrefs.page, UserPrefs.form, '#userprefs_action_button');
};

////////////////////////////////////////////////////////////////////////
// These functions define form submissions, one per action type

UserPrefs.formSetPrefs = function() {
  Env.message = null;
  Env.showStatusMessage();

  var name_irl = $('#userprefs_name_irl').val();
  var is_email_public = $('#userprefs_is_email_public').prop('checked');
  var dob_month = $('#userprefs_dob_month').val();
  var dob_day = $('#userprefs_dob_day').val();
  var gender = $('#userprefs_gender_text').val();
  if (!gender) {
    gender = $('#userprefs_gender_select').val();
  }
  var uses_gravatar = $('#userprefs_uses_gravatar').prop('checked');
  var favorite_button = $('#userprefs_favorite_button').val();
  var favorite_buttonset = $('#userprefs_favorite_buttonset').val();
  var image_size = $('#userprefs_image_size').val();
  var homepage = $('#userprefs_homepage').val();
  var comment = $('#userprefs_comment').val();
  var autoaccept = $('#userprefs_autoaccept').prop('checked');
  var autopass = $('#userprefs_autopass').prop('checked');
  var fire_overshooting = $('#userprefs_fire_overshooting').prop('checked');
  var monitor_redirects_to_game =
    $('#userprefs_monitor_redirects_to_game').prop('checked');
  var monitor_redirects_to_forum =
    $('#userprefs_monitor_redirects_to_forum').prop('checked');
  var automatically_monitor =
    $('#userprefs_automatically_monitor').prop('checked');
  var player_color = $('#userprefs_player_color').spectrum('get');
  var opponent_color = $('#userprefs_opponent_color').spectrum('get');
  var neutral_color_a = $('#userprefs_neutral_color_a').spectrum('get');
  var neutral_color_b = $('#userprefs_neutral_color_b').spectrum('get');
  var current_password = $('#userprefs_current_password').val();
  var new_password = $('#userprefs_new_password').val();
  var confirm_new_password = $('#userprefs_confirm_new_password').val();
  var new_email = $('#userprefs_new_email').val();
  var confirm_new_email = $('#userprefs_confirm_new_email').val();
  var noImages = $('#userprefs_noImages').prop('checked');
  var compactMode = $('#userprefs_compactMode').prop('checked');

  var validationErrors = '';

  if ((dob_month !== 0 && dob_day === 0) ||
    (dob_month === 0 && dob_day !== 0)) {
    validationErrors += 'Birthday is incomplete. ';
  }

  if (image_size !== '') {
    if (isNaN(image_size)) {
      validationErrors += 'Gravatar size must be a number of pixels. ';
    } else {
      image_size = parseInt(image_size, 10);
      if (image_size < UserPrefs.MIN_IMAGE_SIZE ||
          image_size > UserPrefs.MAX_IMAGE_SIZE) {
        validationErrors +=
          'Gravatar size must be between ' + UserPrefs.MIN_IMAGE_SIZE +
          ' and ' + UserPrefs.MAX_IMAGE_SIZE + ' pixels. ';
      }
    }
  }

  if (new_password != confirm_new_password) {
    validationErrors += 'New passwords do not match. ';
  }
  if (new_email != confirm_new_email) {
    validationErrors += 'New email addresses do not match. ';
  }
  if (new_email && !new_email.match(Api.VALID_EMAIL_REGEX)) {
    validationErrors += 'Email address is formatted incorrectly. ';
  }
  if (new_password && !current_password) {
    validationErrors += 'Current password is required to change password. ';
  }
  if (new_email && !current_password) {
    validationErrors += 'Current password is required to change email. ';
  }

  if (validationErrors !== '') {
    Env.message = {
      'type': 'error',
      'text': validationErrors,
    };
    Env.showStatusMessage();
    return;
  }

  Env.setCookieNoImages(noImages);
  Env.setCookieCompactMode(compactMode);

  // Only pass these values if the user typed something in
  if (!current_password) {
    current_password = undefined;
  }
  if (!new_password) {
    new_password = undefined;
  }
  if (!new_email) {
    new_email = undefined;
  }

  if (!favorite_button) {
    favorite_button = undefined;
  }

  if (!favorite_buttonset) {
    favorite_buttonset = undefined;
  }

  if (!image_size) {
    image_size = undefined;
  }

  Api.apiFormPost(
    {
      'type': 'savePlayerInfo',
      'name_irl': name_irl,
      'is_email_public': is_email_public,
      'dob_month': dob_month,
      'dob_day': dob_day,
      'gender': gender,
      'favorite_button': favorite_button,
      'favorite_buttonset': favorite_buttonset,
      'image_size': image_size,
      'uses_gravatar': uses_gravatar,
      'homepage': homepage,
      'comment': comment,
      'autoaccept': autoaccept,
      'autopass': autopass,
      'fire_overshooting': fire_overshooting,
      'monitor_redirects_to_game': monitor_redirects_to_game,
      'monitor_redirects_to_forum': monitor_redirects_to_forum,
      'automatically_monitor': automatically_monitor,
      'player_color': player_color.toHexString(),
      'opponent_color': opponent_color.toHexString(),
      'neutral_color_a': neutral_color_a.toHexString(),
      'neutral_color_b': neutral_color_b.toHexString(),
      'current_password': current_password,
      'new_password': new_password,
      'new_email': new_email,
    },
    {
      'ok': { 'type': 'fixed', 'text': 'User details set successfully.', },
      'notok': { 'type': 'server', }
    },
    '#userprefs_action_button',
    UserPrefs.showLoggedInPage,
    UserPrefs.showLoggedInPage
  );
};

////////////////////////////////////////////////////////////////////////
// Utilty functions for building page elements

UserPrefs.appendToPreferencesTable = function(prefsTable, sectionTitle,
  sectionBlurb, prefs) {
  var titleRow = $('<tr>');
  prefsTable.append(titleRow);
  titleRow.append($('<th>', {
    'class': 'title2',
    'text': sectionTitle,
    'colspan': '2',
  }));

  var blurbRow = $('<tr>');
  prefsTable.append(blurbRow);
  blurbRow.append($('<td>', {
    'html': sectionBlurb,
    'style': 'font-style: italic;',
    'colspan': '2',
  }));

  $.each(prefs, function(entryKey, entryInfo) {
    var entryRow = $('<tr>');
    var labelText = entryInfo.text;
    if (labelText) {
      labelText += ':';
    }
    entryRow.append($('<td>', {
      'text': labelText,
      'class': 'label label_' + entryInfo.type,
    }));
    var entryInput = $('<td>', { 'class': 'value', });
    switch(entryInfo.type) {
    case 'display':
      entryInput.append($('<span>', { 'text': entryInfo.value, }));
      break;
    case 'date':
      var monthSelect = $('<select>', {
        'name': entryKey + '_month',
        'id': 'userprefs_' + entryKey + '_month',
      });
      entryInput.append(monthSelect);
      for (var monthIndex = 0; monthIndex <= 12; monthIndex++) {
        monthSelect.append($('<option>', {
          'value': monthIndex,
          'text': Api.MONTH_NAMES[monthIndex],
          'selected': (entryInfo.value.month == monthIndex),
        }));
      }

      var daySelect = $('<select>', {
        'name': entryKey + '_day',
        'id': 'userprefs_' + entryKey + '_day',
      });
      entryInput.append(daySelect);
      for (var dayIndex = 0; dayIndex <= 31; dayIndex++) {
        daySelect.append($('<option>', {
          'value': dayIndex,
          'text': (dayIndex === 0 ? 'Day' : dayIndex),
          'selected': (entryInfo.value.day == dayIndex),
        }));
      }

      break;
    case 'textarea':
      entryInput.append($('<textarea>', {
        'name': entryKey,
        'id': 'userprefs_' + entryKey,
        'maxlength': entryInfo.length,
        'rows': 6,
      }).val(entryInfo.value));
      break;
    case 'image':
      if (entryInfo.value) {
        var url = entryInfo.value;
        if (!url.match(/^http/i)) {
          url = 'http://' + url;
        }
        entryInput.append($('<img>', {
          'src': url,
          'class': 'profileImage',
        }));
      }
      break;
    case 'select':
      var select = $('<select>', {
        'name': entryKey,
        'id': 'userprefs_' + entryKey,
      });
      entryInput.append(select);
      $.each(entryInfo.source, function(key, value) {
        select.append($('<option>', {
          'text': key,
          'value': value,
        }));
      });
      select.val(entryInfo.value);
      break;
    case 'color':
      var colorPicker = $('<input>', {
        'type': 'text',
        'name': entryKey,
        'id': 'userprefs_' + entryKey,
      });
      entryInput.append(colorPicker);
      colorPicker.spectrum({
        'color': entryInfo.value,
        'showInput': true,
        'showInitial': true,
        'preferredFormat': 'hex',
        'localStorageKey': 'spectrum.bmColorPrefs',
      });

      entryInput.append(' ');
      var defaultColorLink = $('<span>', {
        'text': 'Default ',
        'class': 'pseudoLink',
      });
      entryInput.append(defaultColorLink);
      defaultColorLink.click(function() {
        colorPicker.spectrum('set', UserPrefs.DEFAULT_COLORS[entryKey]);
      });
      break;
    default:
      entryInput.append($('<input>', {
        'type': entryInfo.type,
        'name': entryKey,
        'id': 'userprefs_' + entryKey,
        'value': entryInfo.value,
        'checked': entryInfo.checked,
        'maxlength': entryInfo.length,
      }));
    }
    entryRow.append(entryInput);

    if (entryInfo.after) {
      entryInput.append(entryInfo.after);
    }
    prefsTable.append(entryRow);
  });

  var spacerRow = $('<tr>');
  prefsTable.append(spacerRow);
  spacerRow.append($('<td>', { 'colspan': '2', }).append(' '));
};


text:
apt_repository "apt-transport-s3" do
  uri "http://ppa.launchpad.net/skye-book/apt-transport-s3/ubuntu"
  distribution "precise"
  components ["main"]
  keyserver "keyserver.ubuntu.com"
  key "A9312DDD"
  action :add
end

# Install the package
package 'apt-transport-s3' do
  action :install
  options '--force-yes'
end


text:
from django.contrib.auth.decorators import permission_required

def events_permission_required(perm, login_url='/admin/login', raise_exception=False):
    """
    Sobrescreve o metodo que exige login para acessar a view
    Usar com decorator sobre o metodo que desejar o login:
    @method_decorator(events_login_required)
    """
    return permission_required(perm, login_url=login_url, raise_exception=raise_exception)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Dermea pseudotsugae A. Funk

### Remarks
null


text:
package com.sun.xml.internal.ws.api.model.wsdl.editable;

import com.sun.xml.internal.ws.api.model.ParameterBinding;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLPart;

public interface EditableWSDLPart extends WSDLPart {

    /**
     * Sets binding
     *
     * @param binding Binding
     */
    public void setBinding(ParameterBinding binding);

    /**
     * Sets index
     *
     * @param index Index
     */
    public void setIndex(int index);

}


text:
namespace OGL {
GLint getInternalFormat(GLenum pixelType);
}  // namespace OGL


text:
@implementation GroupedEnumerator {
    NSEnumerator *enumerator;
    int groupSize;
}

- (GroupedEnumerator *)initWithEnumerator:(NSEnumerator *)anEnumerator groupSize:(int)aGroupSize {
    self = [super init];
    enumerator = anEnumerator;
    groupSize = aGroupSize;
    return self;
}

- (id)nextObject {
    int position = 0;
    id item;
    NSMutableArray *collect = [NSMutableArray array];
    while(position < groupSize && (item = enumerator.nextObject) != nil) {
        [collect addObject:item];
        position++;
    }

    return (position == 0) ? nil : collect;
}

+ (GroupedEnumerator *)with:(NSEnumerator *)enumerator groupSize:(int)groupSize {
 return [[GroupedEnumerator alloc] initWithEnumerator:enumerator groupSize:groupSize];

}
@end


text:
package mobi.tjorn.parsers.gql;

import mobi.tjorn.shared.containers.Containers;
import mobi.tjorn.shared.containers.Sequence;

/**
 * @author yuri
 * @since 6/11/16.
 */
public class Projection implements Node {
    private final PropertyNameList projection;
    private final boolean distinct;
    private final DistinctOn distinctOn;

    Projection(PropertyNameList projection, boolean distinct, DistinctOn distinctOn) {
        this.projection = projection;
        this.distinct = distinct;
        this.distinctOn = distinctOn;
    }

    public PropertyNameList getProjection() {
        return projection;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public DistinctOn getDistinctOn() {
        return distinctOn;
    }

    @Override
    public Sequence<Node> children() {
        switch (getType()) {
            case DISTINCT_ON:
                return Containers.singletonSequence(distinctOn);
            case DISTINCT:
            case PARTIAL:
                return Containers.singletonSequence(projection);
            case FULL:
            default:
                return Containers.emptySequence();
        }
    }

    @Override
    public void accept(Visitor v) {
        v.visit(this);
    }

    public Type getType() {
        if (distinctOn != null) {
            return Type.DISTINCT_ON;
        }
        if (distinct) {
            return Type.DISTINCT;
        }
        if (projection != null) {
            return Type.PARTIAL;
        }
        return Type.FULL;
    }

    public enum Type { FULL, PARTIAL, DISTINCT, DISTINCT_ON }
}


text:
<?xml  version="1.0" encoding="UTF-8" ?>
<SamsungMobileFeauture>
  <Version>ED001</Version>
  <Country>SINGAPORE</Country>
  <CountryISO>SG</CountryISO>
  <SalesCode>MM1</SalesCode>
  <FeatureSet>
    <CscFeature_Framework_EnableThaiVietReshaping>TRUE</CscFeature_Framework_EnableThaiVietReshaping>
    <CscFeature_Sip_LangQwertyType4HwKey>HW_KEYBOARD_COUNTRY_TYPE_CHINESE</CscFeature_Sip_LangQwertyType4HwKey>
    <CscFeature_FMRadio_FrequencySpaceAs>100</CscFeature_FMRadio_FrequencySpaceAs>
    <CscFeature_FMRadio_DefaultChannelAs>87.5</CscFeature_FMRadio_DefaultChannelAs>
    <CscFeature_Web_SetUAProfile>http://wap.samsungmobile.com/uaprof/%s.xml</CscFeature_Web_SetUAProfile>
    <CscFeature_RIL_EnableRoamingIcon4NationalRoaming>TRUE</CscFeature_RIL_EnableRoamingIcon4NationalRoaming>
    <CscFeature_Setting_CustNetworkSelMenu4>OLB</CscFeature_Setting_CustNetworkSelMenu4>
    <CscFeature_Web_EnableAutoSimHomeUrlInProfile>TRUE</CscFeature_Web_EnableAutoSimHomeUrlInProfile>
    <CscFeature_Web_SetHomepageURL>https://www.m1.com.sg</CscFeature_Web_SetHomepageURL>
    <CscFeature_RIL_CallerIdMatchingDigit>8</CscFeature_RIL_CallerIdMatchingDigit>
    <CscFeature_Setting_EnableEditingIpVersionType>TRUE</CscFeature_Setting_EnableEditingIpVersionType>
    <CscFeature_Common_DisablePhoneNumberFormatting>TRUE</CscFeature_Common_DisablePhoneNumberFormatting>
    <CscFeature_Web_DisableMostVisitedHomepage>TRUE</CscFeature_Web_DisableMostVisitedHomepage>
    <CscFeature_Setting_IncludeApn4SwUpdate>TRUE</CscFeature_Setting_IncludeApn4SwUpdate>
    <CscFeature_Contact_ExportToSimPhoneAccountOnly>FALSE</CscFeature_Contact_ExportToSimPhoneAccountOnly>
    <CscFeature_Video_AddWidgetLayout>true</CscFeature_Video_AddWidgetLayout>
    <CscFeature_Wifi_EapMethodSetting>SIM, SingTel, Singtel WIFI</CscFeature_Wifi_EapMethodSetting>
    <CscFeature_Wifi_RemovableDefaultAP>TRUE</CscFeature_Wifi_RemovableDefaultAP>
    <CscFeature_Wifi_SetCountryInfo>TRUE</CscFeature_Wifi_SetCountryInfo>
    <CscFeature_RIL_EnableLaunchBrowser>TRUE</CscFeature_RIL_EnableLaunchBrowser>
    <CscFeature_RIL_DisplayStkUssdDialog>TRUE</CscFeature_RIL_DisplayStkUssdDialog>
    <CscFeature_Camera_CameraFlicker>50hz</CscFeature_Camera_CameraFlicker>
    <CscFeature_Contact_IgnoreSpaceDuringSearch>TRUE</CscFeature_Contact_IgnoreSpaceDuringSearch>
    <CscFeature_Common_Beep4NotiDuringCall>TRUE</CscFeature_Common_Beep4NotiDuringCall>
  </FeatureSet>
</SamsungMobileFeauture>


text:
using BizHawk.Common.BizInvoke;
using BizHawk.Emulation.Cores.Waterbox;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace BizHawk.Emulation.Cores.Consoles.Belogic
{
	public abstract class LibUzem : LibWaterboxCore
	{
		[StructLayout(LayoutKind.Sequential)]
		public new class FrameInfo : LibWaterboxCore.FrameInfo
		{
			public int ButtonsP1;
			public int ButtonsP2;
			public int ButtonsConsole;
		}

		[BizImport(CC)]
		public abstract bool Init();

		[BizImport(CC)]
		public abstract bool MouseEnabled();
	}
}


text:
package edu.asu.plp.controller;

import java.security.Principal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import edu.asu.plp.model.UserModel;
import edu.asu.plp.service.UserService;

@RestController
public class UserController {

	@Autowired
	UserService userService;

	@RequestMapping("/user")
	public Principal userLogin(Principal principal){
		return principal;
	}

	@RequestMapping(value="/saveUser", method=RequestMethod.POST)
	public void saveUser(@RequestBody UserModel user){

		userService.saveUser(user.email, user.firstName, user.lastName);
	}
}


text:
/*
  EditRenderer - Based in Matter JS
  */
se.EditRenderer = function (fillColor, strokeStyle, lineWidth, pointColor) {
  se.Renderer.call(this);
  this.color = fillColor;
  this.strokeStyle = strokeStyle;
  this.lineWidth = lineWidth;
  this.pointColor = pointColor;
};

se.inherit(se.Renderer, se.EditRenderer);

se.EditRenderer.prototype.render = function (ctx) {
  var part = this.parent.mesh;
  var c = ctx;

  if (part.vertices.length) {
    this.renderMesh(c);
    this.renderPoints(c);
  }
  this.renderPosition(c);
};

se.EditRenderer.prototype.renderPosition = function (c) {
  // Draw position
  c.beginPath();
  var pos = this.parent.transform.position;
  c.fillStyle = 'red';
  c.arc(pos.x, pos.y, 4, 0, 2 * Math.PI);
  c.fill();
};

se.EditRenderer.prototype.renderMesh = function (c) {
  var part = this.parent.mesh;
  c.beginPath();
  c.moveTo(part.vertices[0].x, part.vertices[0]);

  for (var j = 1; j < part.vertices.length; j++) {
    c.lineTo(part.vertices[j].x, part.vertices[j].y);
  }

  c.lineTo(part.vertices[0].x, part.vertices[0].y);
  c.closePath();

  c.fillStyle = this.color;
  if (this.strokeStyle) {
    c.lineWidth = this.lineWidth;
    c.strokeStyle = this.strokeStyle;
    c.stroke();
  }

  c.fill();
};
se.EditRenderer.prototype.renderPoints = function (c) {
  var part = this.parent.mesh;
  c.fillStyle = this.pointColor;
  c.strokeStyle = 'white';
  c.lineWidth = 1;
  for (var i = 0; i < part.vertices.length; i++) {
    c.beginPath();
    c.arc(part.vertices[i].x, part.vertices[i].y, 3, 0, 2 * Math.PI);
    c.fill();
    c.stroke();
  }
};

se.EditRenderer.prototype.json = function () {
  return {
    type: 'EditRenderer',
    fillColor: this.color,
    strokeStyle: this.strokeStyle,
    lineWidth: this.lineWidth,
    pointColor: this.pointColor
  };
};


text:
package com.researchspace.api.clientmodel;

import lombok.Data;

@Data
public class UserGroupInfo {

	private Long id;
	private String username;
	private String role;

}


text:
// .NAME vtkOpenGLContextDevice3D - OpenGL class drawing 3D primitives.
//
// .SECTION Description
// This defines the implementation of a 3D context device for drawing simple
// primitives.

#ifndef vtkOpenGLContextDevice3D_h
#define vtkOpenGLContextDevice3D_h

#include "vtkRenderingContextOpenGL2Module.h" // For export macro
#include "vtkContextDevice3D.h"
#include "vtkNew.h"             // For ivars.
#include <vector> // STL Header

class vtkBrush;
class vtkOpenGLContextDevice2D;
class vtkOpenGLHelper;
class vtkOpenGLRenderWindow;
class vtkPen;
class vtkRenderer;
class vtkShaderProgram;
class vtkTransform;

class VTKRENDERINGCONTEXTOPENGL2_EXPORT vtkOpenGLContextDevice3D : public vtkContextDevice3D
{
public:
  vtkTypeMacro(vtkOpenGLContextDevice3D, vtkContextDevice3D);
  void PrintSelf(ostream &os, vtkIndent indent);

  static vtkOpenGLContextDevice3D * New();

  // Description:
  // Draw a polyline between the specified points.
  void DrawPoly(const float *verts, int n, const unsigned char *colors, int nc);

  // Description:
  // Draw lines defined by specified pair of points.
  // \sa DrawPoly()
  void DrawLines(const float *verts, int n, const unsigned char *colors, int nc);

  // Description:
  // Draw points at the vertex positions specified.
  void DrawPoints(const float *verts, int n,
                  const unsigned char *colors, int nc);

  // Description:
  // Draw triangles to generate the specified mesh.
  void DrawTriangleMesh(const float *mesh, int n,
                        const unsigned char *colors, int nc);

  // Description:
  // Apply the supplied pen which controls the outlines of shapes, as well as
  // lines, points and related primitives. This makes a deep copy of the vtkPen
  // object in the vtkContext2D, it does not hold a pointer to the supplied object.
  void ApplyPen(vtkPen *pen);

  // Description:
  // Apply the supplied brush which controls the outlines of shapes, as well as
  // lines, points and related primitives. This makes a deep copy of the vtkBrush
  // object in the vtkContext2D, it does not hold a pointer to the supplied object.
  void ApplyBrush(vtkBrush *brush);

  // Description:
  // Set the model view matrix for the display
  void SetMatrix(vtkMatrix4x4 *m);

  // Description:
  // Set the model view matrix for the display
  void GetMatrix(vtkMatrix4x4 *m);

  // Description:
  // Multiply the current model view matrix by the supplied one
  void MultiplyMatrix(vtkMatrix4x4 *m);

  // Description:
  // Push the current matrix onto the stack.
  void PushMatrix();

  // Description:
  // Pop the current matrix off of the stack.
  void PopMatrix();

  // Description:
  // Supply a float array of length 4 with x1, y1, width, height specifying
  // clipping region for the device in pixels.
  void SetClipping(const vtkRecti &rect);

  // Description:
  // Enable or disable the clipping of the scene.
  void EnableClipping(bool enable);

  // Description:
  // Enable/Disable the specified clipping plane.
  // i is the index of the clipping plane being enabled or disabled (0 - 5).
  // planeEquation points to the four coefficients of the equation for the
  // clipping plane: Ax + By + Cz + D = 0.  This is the equation format
  // expected by glClipPlane.
  void EnableClippingPlane(int i, double *planeEquation);
  void DisableClippingPlane(int i);

  // Description
  // This must be set during initialization
  void Initialize(vtkRenderer *, vtkOpenGLContextDevice2D *);

  // Description:
  // Begin drawing, pass in the viewport to set up the view.
  virtual void Begin(vtkViewport* viewport);

protected:
  vtkOpenGLContextDevice3D();
  ~vtkOpenGLContextDevice3D();

  // Description:
  // Begin drawing, turn on the depth buffer.
  virtual void EnableDepthBuffer();

  // Description:
  // End drawing, turn off the depth buffer.
  virtual void DisableDepthBuffer();

  vtkOpenGLHelper *VCBO;  // vertex + color
  void ReadyVCBOProgram();
  vtkOpenGLHelper *VBO;  // vertex
  void ReadyVBOProgram();

  void SetMatrices(vtkShaderProgram *prog);
  void BuildVBO(vtkOpenGLHelper *cbo,
    const float *v, int nv,
    const unsigned char *coolors, int nc,
    float *tcoords);
  void CoreDrawTriangles(std::vector<float> &tverts);

  // do we have wide lines that require special handling
  virtual bool HaveWideLines();

  vtkTransform *ModelMatrix;

  // Description:
  // The OpenGL render window being used by the device
  vtkOpenGLRenderWindow* RenderWindow;

  // Description:
  // We need to store a pointer to get the camera mats
  vtkRenderer *Renderer;

  std::vector<bool> ClippingPlaneStates;
  std::vector<double> ClippingPlaneValues;

private:
  vtkOpenGLContextDevice3D(const vtkOpenGLContextDevice3D &) VTK_DELETE_FUNCTION;
  void operator=(const vtkOpenGLContextDevice3D &) VTK_DELETE_FUNCTION;

  // Description:
  // Private data pointer of the class
  class Private;
  Private *Storage;

  // we need a pointer to this because only
  // the 2D device gets a Begin and sets up
  // the ortho matrix
  vtkOpenGLContextDevice2D *Device2D;

  vtkNew<vtkBrush> Brush;
  vtkNew<vtkPen>   Pen;
};

#endif


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source:
// google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto

package com.google.cloud.aiplatform.v1beta1.schema.trainingjob.definition;

public final class AutoMLVideoClassificationProto {
  private AutoMLVideoClassificationProto() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassification_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassification_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassificationInputs_descriptor;
  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassificationInputs_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n_google/cloud/aiplatform/v1beta1/schema"
          + "/trainingjob/definition/automl_video_cla"
          + "ssification.proto\022=google.cloud.aiplatfo"
          + "rm.v1beta1.schema.trainingjob.definition"
          + "\"\213\001\n\031AutoMlVideoClassification\022n\n\006inputs"
          + "\030\001 \001(\0132^.google.cloud.aiplatform.v1beta1"
          + ".schema.trainingjob.definition.AutoMlVid"
          + "eoClassificationInputs\"\212\002\n\037AutoMlVideoCl"
          + "assificationInputs\022|\n\nmodel_type\030\001 \001(\0162h"
          + ".google.cloud.aiplatform.v1beta1.schema."
          + "trainingjob.definition.AutoMlVideoClassi"
          + "ficationInputs.ModelType\"i\n\tModelType\022\032\n"
          + "\026MODEL_TYPE_UNSPECIFIED\020\000\022\t\n\005CLOUD\020\001\022\026\n\022"
          + "MOBILE_VERSATILE_1\020\002\022\035\n\031MOBILE_JETSON_VE"
          + "RSATILE_1\020\003B\224\003\nAcom.google.cloud.aiplatf"
          + "orm.v1beta1.schema.trainingjob.definitio"
          + "nB\036AutoMLVideoClassificationProtoP\001Zggoo"
          + "gle.golang.org/genproto/googleapis/cloud"
          + "/aiplatform/v1beta1/schema/trainingjob/d"
          + "efinition;definition\252\002=Google.Cloud.AIPl"
          + "atform.V1Beta1.Schema.TrainingJob.Defini"
          + "tion\312\002=Google\\Cloud\\AIPlatform\\V1beta1\\S"
          + "chema\\TrainingJob\\Definition\352\002CGoogle::C"
          + "loud::AIPlatform::V1beta1::Schema::Train"
          + "ingJob::Definitionb\006proto3"
    };
    descriptor =
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
            descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
    internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassification_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassification_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassification_descriptor,
            new java.lang.String[] {
              "Inputs",
            });
    internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassificationInputs_descriptor =
        getDescriptor().getMessageTypes().get(1);
    internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassificationInputs_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_aiplatform_v1beta1_schema_trainingjob_definition_AutoMlVideoClassificationInputs_descriptor,
            new java.lang.String[] {
              "ModelType",
            });
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
<?php

defined('C5_EXECUTE') or die("Access Denied.");

use Concrete\Core\Form\Service\Form;
use Concrete\Core\Support\Facade\Application;
use Concrete\Core\Validation\CSRF\Token;

/** @var array $logModes */
/** @var string $logMode */

$app = Application::getFacadeApplication();
/** @var Form $form */
$form = $app->make(Form::class);
/** @var Token $token */
$token = $app->make(Token::class);
?>

<form action="#" method="post">
    <?php echo $token->output("change_mail_logging"); ?>

        <?php echo $form->label("logMode", t("Log Mode")); ?>
        <?php echo $form->select("logMode", $logModes, $logMode); ?>

            <?php echo $form->submit('save', t('Save'), ['class' => 'btn btn-primary float-end']); ?>

</form>


text:
package uk.ac.ebi.embl.api.validation.dao.model;

import java.util.HashMap;
import java.util.Map;

public class SampleEntity {
    public Map<String, String> getAttributes() {
        return attributes;
    }

    public void setAttributes(Map<String, String> attributes) {
        this.attributes = attributes;
    }

    Map<String,String> attributes = new HashMap<>();

}


text:
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde.fs import File, Folder
from hyde.model import Expando
from hyde.generator import Generator
from hyde.site import Site

LESS_SOURCE = File(__file__).parent.child_folder('less')
TEST_SITE = File(__file__).parent.parent.child_folder('_test')

class TestLess(object):

    def setUp(self):
        TEST_SITE.make()
        TEST_SITE.parent.child_folder(
                    'sites/test_jinja').copy_contents_to(TEST_SITE)
        LESS_SOURCE.copy_contents_to(TEST_SITE.child('content/media/css'))
        File(TEST_SITE.child('content/media/css/site.css')).delete()

    def tearDown(self):
        TEST_SITE.delete()

    def test_can_execute_less(self):
        s = Site(TEST_SITE)
        s.config.plugins = ['hyde.ext.plugins.less.LessCSSPlugin']
        source = TEST_SITE.child('content/media/css/site.less')
        target = File(Folder(s.config.deploy_root_path).child('media/css/site.css'))
        gen = Generator(s)
        gen.generate_resource_at_path(source)

        assert target.exists
        text = target.read_all()
        expected_text = File(LESS_SOURCE.child('expected-site.css')).read_all()

        assert text == expected_text
        return


text:
<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
    <display-name>TIS2 Semantic search</display-name>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
</web-app>


text:
<?php

namespace rock\snippets;

use rock\helpers\Instance;
use rock\image\ImageProvider;
use rock\image\ThumbInterface;
use rock\template\Html;
use rock\template\Template;

/**
 * Snippet "Thumb"
 * @package rock\snippets\
 *
 * @see Thumb
 */
class ThumbSnippet extends Snippet
{
    /**
     * Src to image.
     * @var string
     */
    public $src;
    /**
     * width
     * @var
     */
    public $w;
    /**
     * height
     * @var
     */
    public $h;
    /**
     * quality
     * @var
     */
    public $q;
    /**
     * attr "class"
     * @var
     */
    public $_class;
    /**
     * attr "alt"
     * @var
     */
    public $alt;
    public $title;
    /** @var  string */
    public $dummy;
    public $const = 1;
    /**
     * @inheritdoc
     */
    public $sanitize = Template::SANITIZE_DISABLE;

    /** @var  ImageProvider|string|array */
    public $imageProvider = 'imageProvider';

    public function init()
    {
        parent::init();
        $this->imageProvider = Instance::ensure($this->imageProvider);
    }

    public function get()
    {
        if (empty($this->src)) {
            if (empty($this->dummy)) {
                return '';
            }
            $this->src = $this->dummy;
        }

        $options = [
            'class' => $this->_class,
            'alt' => $this->template->replace($this->alt),
            'title' => $this->title,
        ];
        $src = $this->imageProvider->get($this->src, $this->w, $this->h);

        if (!((int)$this->const & ThumbInterface::WITHOUT_WIDTH_HEIGHT)) {
            $options['width'] = $this->imageProvider->width;
            $options['height'] = $this->imageProvider->height;
        }

        return (int)$this->const & ThumbInterface::OUTPUT_IMG ? Html::img($src, $options) : $src;
    }
}


text:
#include <kdbconfig.h>
#include <kdbmacros.h>

#ifdef __cplusplus
extern "C" {
#endif

void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...)
#ifdef __GNUC__
	__attribute__ ((format (printf, 5, 6))) __attribute__ ((__noreturn__))
#else
#ifdef __clang_analyzer__
	// For scan-build / clang analyzer to detect our assertions abort
	__attribute__ ((analyzer_noreturn))
#endif
#endif
	;

#ifdef __cplusplus
}
#endif

#ifdef ELEKTRA_BMC
#undef NDEBUG
#include <assert.h>
#define ELEKTRA_ASSERT(EXPR, ...) assert (EXPR)
#else
#if DEBUG
#define ELEKTRA_ASSERT(EXPR, ...) ((EXPR)) ? (void) (0) : elektraAbort (ELEKTRA_STRINGIFY (EXPR), __func__, __FILE__, __LINE__, __VA_ARGS__)
#else
#define ELEKTRA_ASSERT(EXPR, ...)
#endif
#define ELEKTRA_NOT_NULL(argument) ELEKTRA_ASSERT (argument, "The variable `" #argument "` contains `NULL`.")
#endif


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

<title>NativeClustering (apache-cassandra API)</title>
<meta name="date" content="2016-06-06">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.db

Class NativeClustering

java.lang.Object

org.apache.cassandra.db.AbstractClusteringPrefix

org.apache.cassandra.db.NativeClustering

All Implemented Interfaces:

IMeasurableMemory, Clusterable, Clustering, ClusteringPrefix

public class NativeClustering
extends AbstractClusteringPrefix
implements Clustering

Nested Class Summary

Nested classes/interfaces inherited from interface org.apache.cassandra.db.Clustering

Clustering.Serializer

Nested classes/interfaces inherited from interface org.apache.cassandra.db.ClusteringPrefix

ClusteringPrefix.Deserializer, ClusteringPrefix.Kind

Field Summary

Fields inherited from interface org.apache.cassandra.db.Clustering

EMPTY, serializer, STATIC_CLUSTERING

Constructor Summary

Constructors

Constructor and Description

NativeClustering(NativeAllocator allocator,
                OpOrder.Group writeOp,
                Clustering clustering)

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.nio.ByteBuffer
get(int i)

Retrieves the ith value of this prefix.

java.nio.ByteBuffer[]
getRawValues()

The values of this prefix as an array.

ClusteringPrefix.Kind
kind()

int
size()

The number of values in this prefix.

long
unsharedHeapSize()

long
unsharedHeapSizeExcludingData()

Methods inherited from class org.apache.cassandra.db.AbstractClusteringPrefix

clustering, dataSize, digest, equals, hashCode

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface org.apache.cassandra.db.Clustering

copy, make, toCQLString, toString

Methods inherited from interface org.apache.cassandra.db.ClusteringPrefix

dataSize, digest

Methods inherited from interface org.apache.cassandra.db.Clusterable

clustering

Constructor Detail

NativeClustering

public NativeClustering(NativeAllocator allocator,
                        OpOrder.Group writeOp,
                        Clustering clustering)

Method Detail

kind

public ClusteringPrefix.Kind kind()

Specified by:

kind in interface ClusteringPrefix

size

public int size()

Description copied from interface: ClusteringPrefix

The number of values in this prefix.

 There can't be more values that the this is a prefix of has of clustering columns.

Specified by:

size in interface ClusteringPrefix

Returns:

the number of values in this prefix.

get

public java.nio.ByteBuffer get(int i)

Description copied from interface: ClusteringPrefix

Retrieves the ith value of this prefix.

Specified by:

get in interface ClusteringPrefix

Parameters:

i - the index of the value to retrieve. Must be such that 0 <= i < size().

Returns:

the ith value of this prefix. Note that a value can be null.

getRawValues

public java.nio.ByteBuffer[] getRawValues()

Description copied from interface: ClusteringPrefix

The values of this prefix as an array.

 Please note that this may or may not require an array creation. So 1) you should *not*
 modify the returned array and 2) it's more efficient to use ClusteringPrefix.size() and
 ClusteringPrefix.get(int) unless you actually need an array.

Specified by:

getRawValues in interface ClusteringPrefix

Returns:

the values for this prefix as an array.

unsharedHeapSize

public long unsharedHeapSize()

Specified by:

unsharedHeapSize in interface IMeasurableMemory

Returns:

the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed,
 i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are
 referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.

unsharedHeapSizeExcludingData

public long unsharedHeapSizeExcludingData()

Specified by:

unsharedHeapSizeExcludingData in interface Clustering

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2016 The Apache Software Foundation


text:
class AdminUser < ApplicationRecord
  has_many :restaurants
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable,
         :recoverable, :rememberable, :trackable, :validatable
end


text:
FROM ygrenzinger/archlinux-arm
MAINTAINER ralph.greschner.dev@gmail.com

RUN pacman -Syyu --noconfirm; pacman-db-upgrade;
RUN pacman -S mongodb --noconfirm; mkdir -p /data/db;
ADD run.sh /run.sh
RUN chmod a+x /run.sh

VOLUME ["/data"]
EXPOSE 27017

CMD ["/run.sh"]


text: git workflows - especially for ci


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Inquilino extends CI_Controller {

    function __construct() {
        parent::__construct();
        /* Carrega o modelo */
        $this->load->model('Inquilino_model', 'model', TRUE);
    }

    function index() {
        $data['dados_inquilino'] = $this->db->get('inquilino')->result();
        $this->load->view('inquilino_list', $data);
    }

    function novo() {
        $data['dados_uf'] = $this->db->get('uf')->result();
        $this->load->view('inquilino_novo', $data);
    }

    function editar($id) {

        $data['dados_inquilino'] = $this->model->editar($id);
        $this->load->view('inquilino_edit', $data);
    }

    function atualizar() {

        $data['id'] = $this->input->post('id');
        $data['nome_inquilino'] = $this->input->post('nome');
        $data['contato'] = $this->input->post('contato');
        $data['setor_depto'] = $this->input->post('setor_depto');
        $data['logradouro'] = $this->input->post('logradouro');
        $data['numero'] = $this->input->post('numero');
        $data['complemento'] = $this->input->post('complemento');
        $data['bairro'] = $this->input->post('bairro');
        $data['cidade'] = $this->input->post('cidade');
        $data['uf'] = $this->input->post('uf');
        $data['cep'] = $this->input->post('cep');
        $data['telefone'] = $this->input->post('telefone');
        $data['celular'] = $this->input->post('celular');
        $data['email'] = $this->input->post('email');
        $data['observacoes'] = $this->input->post('observacoes');
        $data['cpf'] = $this->input->post('cpf');
        $data['rg'] = $this->input->post('rg');

        /* Executa a função atualizar do modelo passando como parâmetro os dados obtidos do formulário */
         if ($this->model->atualizar($data)) {
            echo "salvo_sucesso";
        } else {
            echo "salvo_erro";
        }

    }

    function deletar($id) {
        if ($this->model->deletar($id)) {
            redirect('Inquilino');
        } else {
            log_message('error', 'Erro ao deletar o registro.');
        }
    }

    function inserir() {

        $data['nome_inquilino'] = $this->input->post('nome');
        $data['contato'] = $this->input->post('contato');
        $data['setor_depto'] = $this->input->post('setor_depto');
        $data['logradouro'] = $this->input->post('logradouro');
        $data['numero'] = $this->input->post('numero');
        $data['complemento'] = $this->input->post('complemento');
        $data['bairro'] = $this->input->post('bairro');
        $data['cidade'] = $this->input->post('cidade');
        $data['uf'] = $this->input->post('uf');
        $data['cep'] = $this->input->post('cep');
        $data['telefone'] = $this->input->post('telefone');
        $data['celular'] = $this->input->post('celular');
        $data['email'] = $this->input->post('email');
        $data['observacoes'] = $this->input->post('observacoes');
        $data['cpf'] = $this->input->post('cpf');
        $data['rg'] = $this->input->post('rg');
        if ($this->model->inserir($data)) {
            echo "salvo_sucesso";
        } else {
            echo "salvo_erro";
        }

        //log_message('error', 'Erro ao inserir o registro.');
    }

}


text:
package org.apache.geronimo.mail.util;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Base64
{
    private static final Encoder encoder = new Base64Encoder();

    /**
     * encode the input data producing a base 64 encoded byte array.
     *
     * @return a byte array containing the base 64 encoded data.
     */
    public static byte[] encode(
        byte[]    data)
    {
        // just forward to the general array encoder.
        return encode(data, 0, data.length);
    }

    /**
     * encode the input data producing a base 64 encoded byte array.
     *
     * @param data   The data array to encode.
     * @param offset The starting offset within the data array.
     * @param length The length of the data to encode.
     *
     * @return a byte array containing the base 64 encoded data.
     */
    public static byte[] encode(
        byte[]    data,
        int       offset,
        int       length)
    {
        ByteArrayOutputStream    bOut = new ByteArrayOutputStream();

        try
        {
            encoder.encode(data, 0, data.length, bOut);
        }
        catch (IOException e)
        {
            throw new RuntimeException("exception encoding base64 string: " + e);
        }

        return bOut.toByteArray();
    }

    /**
     * Encode the byte data to base 64 writing it to the given output stream.
     *
     * @return the number of bytes produced.
     */
    public static int encode(
        byte[]                data,
        OutputStream    out)
        throws IOException
    {
        return encoder.encode(data, 0, data.length, out);
    }

    /**
     * Encode the byte data to base 64 writing it to the given output stream.
     *
     * @return the number of bytes produced.
     */
    public static int encode(
        byte[]                data,
        int                    off,
        int                    length,
        OutputStream    out)
        throws IOException
    {
        return encoder.encode(data, off, length, out);
    }

    /**
     * decode the base 64 encoded input data. It is assumed the input data is valid.
     *
     * @return a byte array representing the decoded data.
     */
    public static byte[] decode(
        byte[]    data)
    {
        // just decode the entire array of data.
        return decode(data, 0, data.length);
    }

    /**
     * decode the base 64 encoded input data. It is assumed the input data is valid.
     *
     * @param data   The data array to decode.
     * @param offset The offset of the data array.
     * @param length The length of data to decode.
     *
     * @return a byte array representing the decoded data.
     */
    public static byte[] decode(
        byte[]    data,
        int       offset,
        int       length)
    {
        ByteArrayOutputStream    bOut = new ByteArrayOutputStream();

        try
        {
            encoder.decode(data, offset, length, bOut);
        }
        catch (IOException e)
        {
            throw new RuntimeException("exception decoding base64 string: " + e);
        }

        return bOut.toByteArray();
    }

    /**
     * decode the base 64 encoded String data - whitespace will be ignored.
     *
     * @return a byte array representing the decoded data.
     */
    public static byte[] decode(
        String    data)
    {
        ByteArrayOutputStream    bOut = new ByteArrayOutputStream();

        try
        {
            encoder.decode(data, bOut);
        }
        catch (IOException e)
        {
            throw new RuntimeException("exception decoding base64 string: " + e);
        }

        return bOut.toByteArray();
    }

    /**
     * decode the base 64 encoded String data writing it to the given output stream,
     * whitespace characters will be ignored.
     *
     * @return the number of bytes produced.
     */
    public static int decode(
        String                data,
        OutputStream    out)
        throws IOException
    {
        return encoder.decode(data, out);
    }

    /**
     * decode the base 64 encoded String data writing it to the given output stream,
     * whitespace characters will be ignored.
     *
     * @param data   The array data to decode.
     * @param out    The output stream for the data.
     *
     * @return the number of bytes produced.
     * @exception IOException
     */
    public static int decode(byte [] data, OutputStream out) throws IOException
    {
        return encoder.decode(data, 0, data.length, out);
    }
}