text stringlengths 2 1.04M | meta dict |
|---|---|
social-img: /img/boot-start-social.jpg
layout: jobs
title: Offres d'emploi
permalink: /fr/jobs/
language: fr
--- | {
"content_hash": "57c3fcbf9b3871e9e17014fe11d3f3af",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 18.666666666666668,
"alnum_prop": 0.7410714285714286,
"repo_name": "boot-start/boot-start.github.io",
"id": "46e510d40572ea1b9b64945da8e39afe6e7234a3",
"size": "116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jobs.fr.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "113653"
},
{
"name": "HTML",
"bytes": "200842"
},
{
"name": "JavaScript",
"bytes": "140173"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_242) on Wed Mar 18 16:20:53 CET 2020 -->
<title>org.acra.attachment</title>
<meta name="date" content="2020-03-18">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../../../org/acra/attachment/package-summary.html" target="classFrame">org.acra.attachment</a></h1>
<div class="indexContainer">
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
<li><a href="AttachmentUriProvider.html" title="interface in org.acra.attachment" target="classFrame"><span class="interfaceName">AttachmentUriProvider</span></a></li>
</ul>
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="AcraContentProvider.html" title="class in org.acra.attachment" target="classFrame">AcraContentProvider</a></li>
<li><a href="DefaultAttachmentProvider.html" title="class in org.acra.attachment" target="classFrame">DefaultAttachmentProvider</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "bea351b4905fa26368e7178fa64f92d7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 167,
"avg_line_length": 47.8,
"alnum_prop": 0.702928870292887,
"repo_name": "ACRA/acra",
"id": "57015d518f5592982a6e2da47cf45760e0661f11",
"size": "1195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/static/javadoc/5.5.0/org/acra/attachment/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1328"
},
{
"name": "Java",
"bytes": "16532"
},
{
"name": "JavaScript",
"bytes": "5285"
},
{
"name": "Kotlin",
"bytes": "407998"
},
{
"name": "Shell",
"bytes": "199"
}
],
"symlink_target": ""
} |
package watchserver.server;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
import org.apache.log4j.Logger;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import rapture.app.RaptureAppService;
import rapture.common.exception.ExceptionToString;
import rapture.common.exception.RaptureException;
import rapture.config.ConfigLoader;
import rapture.kernel.ContextFactory;
import rapture.kernel.Kernel;
import watchserver.util.SourceType;
import watchserver.util.FTPConfig;
import watchserver.util.LocalConfig;
import watchserver.util.ConfigException;
/**
* WatchServer monitors directories and takes actions as described in the
* associated Rapture system configuration (//sys.config/watchserver/config)
* document.
*
* This document details directories and maps to an action (e.g. script,
* workflow) in the Rapture system.
*
* @author jonathan-major
*/
public final class WatchServer {
private static Logger log = Logger.getLogger(WatchServer.class);
private static final String CONFIG_URI = "watchserver/config";
private static List<LocalConfig> localconfigs = new ArrayList<LocalConfig>();
private static List<FTPConfig> ftpconfigs = new ArrayList<FTPConfig>();
private static String rawConfig;
public static void main(String[] args) {
try {
Kernel.initBootstrap(ImmutableMap.of("STD", ConfigLoader.getConf().StandardTemplate), WatchServer.class, false);
RaptureAppService.setupApp("WatchServer");
} catch (RaptureException e1) {
log.error("Failed to start WatchServer with " + ExceptionToString.format(e1));
System.exit(-1);
}
try {
rawConfig = Kernel.getSys().retrieveSystemConfig(ContextFactory.getKernelUser(), "CONFIG", CONFIG_URI);
} catch (Exception e) {
log.error("Failed to load configuration from " + CONFIG_URI, e);
System.exit(-1);
}
log.info("------------------------------------------------------");
try{
JSONParser jsonParser = new JSONParser();
JSONObject jsonObject = (JSONObject) jsonParser.parse(rawConfig);
JSONArray sources = (JSONArray) jsonObject.get("sources");
Iterator<?> it = sources.iterator();
ObjectMapper mapper = new ObjectMapper();
while (it.hasNext()) {
JSONObject source = (JSONObject) it.next();
switch (SourceType.valueOf(source.get("type").toString().toUpperCase())) {
case LOCAL:
LocalConfig localconfig = mapper.readValue(source.get("config").toString(), LocalConfig.class);
localconfig.setSourceType(SourceType.LOCAL);
localconfigs.add(localconfig);
log.info("Loaded config for Local folder: " + localconfig.getFolder());
break;
case FTP:
FTPConfig ftpconfig = mapper.readValue(source.get("config").toString(), FTPConfig.class);
ftpconfig.setSourceType(SourceType.FTP);
ftpconfigs.add(ftpconfig);
log.info("Loaded config for FTP folder: " + ftpconfig.getFolder() + ftpconfig.getConnection().getPathtomonitor());
break;
case SFTP:
log.info("SFTP NooP");
break;
default:
throw new Exception("SourceType " + source.get("type").toString().toUpperCase() + " not supported!");
}
}
} catch (ConfigException e) {
log.error("ConfigException handling configuration from " + CONFIG_URI, e);
System.exit(-1);
} catch (JsonParseException e) {
log.error("Json Parse Exception handling configuration from " + CONFIG_URI, e);
System.exit(-1);
} catch (JsonMappingException e) {
log.error("Json Mapping Exception handling configuration from " + CONFIG_URI, e);
System.exit(-1);
} catch (IOException e) {
log.error("IO Exception handling configuration from " + CONFIG_URI, e);
System.exit(-1);
} catch (Exception e) {
log.error("Exception handling configuration from " + CONFIG_URI, e);
System.exit(-1);
}
log.info("------------------------------------------------------");
for (LocalConfig config:localconfigs) {
new WatchLocalRunner(config).startThread();
log.info("Local Directory Monitor setup for " + config.getFolder());
}
for (FTPConfig config:ftpconfigs) {
new WatchFTPRunner(config).startThread();
log.info("FTP Monitor setup for " + config.getFolder());
}
log.info("------------------------------------------------------");
log.info("WatchServer started and ready to process events.");
}
}
| {
"content_hash": "95d6f2c7d231da176dae2176c9f5c8ab",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 138,
"avg_line_length": 44.63636363636363,
"alnum_prop": 0.6011849657470839,
"repo_name": "RapturePlatform/Rapture",
"id": "54230978d4567d452c08078ad3fb6809aca81654",
"size": "6565",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Apps/WatchServer/src/main/java/watchserver/server/WatchServer.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "165"
},
{
"name": "C++",
"bytes": "352203"
},
{
"name": "CMake",
"bytes": "964"
},
{
"name": "CSS",
"bytes": "27828"
},
{
"name": "GAP",
"bytes": "232048"
},
{
"name": "HTML",
"bytes": "122945"
},
{
"name": "Java",
"bytes": "8792874"
},
{
"name": "JavaScript",
"bytes": "149972"
},
{
"name": "PLpgSQL",
"bytes": "1760"
},
{
"name": "Python",
"bytes": "50042"
},
{
"name": "Ruby",
"bytes": "1150"
},
{
"name": "SQLPL",
"bytes": "985"
},
{
"name": "Shell",
"bytes": "14185"
},
{
"name": "Smalltalk",
"bytes": "30643"
},
{
"name": "TeX",
"bytes": "100992"
},
{
"name": "Thrift",
"bytes": "149"
},
{
"name": "Vim script",
"bytes": "900"
}
],
"symlink_target": ""
} |
// This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2015-2016 Oslo and Akershus University College of Applied Sciences
// and Alfred Bratterud
//
// 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.
#ifndef HTTP_STATUS_LINE_HPP
#define HTTP_STATUS_LINE_HPP
#include <regex>
#include "version.hpp"
#include "status_codes.hpp"
namespace http {
/**
* @brief This class respresents a
* response message status-line
*/
class Status_line {
public:
/**
* @brief Constructor to create the status line
* by supplying the version of the message
* and the status code
*
* @param version:
* The version of the message
*
* @param code:
* The status code
*/
explicit constexpr Status_line(const Version version, const Code code) noexcept;
/**
* @brief Constructor to construct a status-line
* from the incoming character stream of
* data which is a {std::string} object
*
* @tparam T response:
* The character stream of data
*/
template
<
typename T,
typename = std::enable_if_t
<std::is_same
<std::string, std::remove_const_t
<std::remove_reference_t<T>>>::value>
>
explicit Status_line(T&& response);
/**
* @brief Default copy constructor
*/
Status_line(const Status_line&) noexcept = default;
/**
* @brief Default move constructor
*/
Status_line(Status_line&&) noexcept = default;
/**
* @brief Default destructor
*/
~Status_line() noexcept = default;
/**
* @brief Default copy assignment operator
*/
Status_line& operator = (const Status_line&) noexcept = default;
/**
* @brief Default move assignment operator
*/
Status_line& operator = (Status_line&&) noexcept = default;
/**
* @brief Get the version of the message
*
* @return Version of the message
*/
constexpr Version get_version() const noexcept;
/**
* @brief Set the version of the message
*
* @param version:
* Version of the message
*/
void set_version(const Version version) noexcept;
/**
* @brief Get message status code
*
* @return Status code of the message
*/
constexpr Code get_code() const noexcept;
/**
* @brief Set the message status code
*
* @param code:
* Status code of the message
*/
void set_code(const Code code) noexcept;
/**
* @brief Get a string representation of
* this class
*
* @return A string representation
*/
std::string to_string() const;
/**
* @brief Operator to transform this class
* into string form
*/
operator std::string () const;
private:
//---------------------------
// Class data members
Version version_;
Code code_;
//---------------------------
}; //< class Status_line
/**
* @brief This class is used to represent an error that occurred
* from within the operations of class Status_line
*/
class Status_line_error : public std::runtime_error {
using runtime_error::runtime_error;
};
/**--v----------- Implementation Details -----------v--**/
inline constexpr Status_line::Status_line(const Version version, const Code code) noexcept
: version_{version}
, code_{code}
{}
template <typename Response, typename>
inline Status_line::Status_line(Response&& response) {
if (response.empty() or response.size() < 16 /*<-(16) minimum response length */) {
throw Status_line_error {"Invalid response"};
}
bool is_canonical_line_ending {false};
// Extract {Status-Line} from response
std::string status_line;
std::size_t index;
if ((index = response.find("\r\n")) not_eq std::string::npos) {
status_line = response.substr(0, index);
is_canonical_line_ending = true;
} else if ((index = response.find('\n')) not_eq std::string::npos) {
status_line = response.substr(0, index);
} else {
throw Status_line_error {"Invalid line-ending"};
}
const static std::regex status_line_pattern
{
"HTTP/(\\d+)\\.(\\d+) " //< Protocol Version {Major.Minor}
"(\\d{3}) " //< Response Code
"[a-z A-Z]+" //< Response Code Description
};
std::smatch m;
if (not std::regex_match(status_line, m, status_line_pattern)) {
throw Status_line_error {"Invalid response line: " + status_line};
}
version_ = Version(std::stoi(m[1]), std::stoi(m[2]));
code_ = std::stoi(m[3]);
// Trim the response for further processing
if (is_canonical_line_ending) {
response = response.substr(index + 2);
} else {
response = response.substr(index + 1);
}
}
inline constexpr Version Status_line::get_version() const noexcept {
return version_;
}
inline void Status_line::set_version(const Version version) noexcept {
version_ = version;
}
inline constexpr Code Status_line::get_code() const noexcept {
return code_;
}
inline void Status_line::set_code(const Code code) noexcept {
code_ = code;
}
inline std::string Status_line::to_string() const {
std::ostringstream stat_line;
//---------------------------
stat_line << version_ << " "
<< code_ << " "
<< code_description(code_) << "\r\n";
//---------------------------
return stat_line.str();
}
inline Status_line::operator std::string () const {
return to_string();
}
inline std::ostream& operator << (std::ostream& output_device, const Status_line& stat_line) {
return output_device << stat_line.to_string();
}
/**--^----------- Implementation Details -----------^--**/
} //< namespace http
#endif //< HTTP_STATUS_LINE_HPP
| {
"content_hash": "d5aa43290ff374c48dcdacda152cf3a1",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 94,
"avg_line_length": 25.3125,
"alnum_prop": 0.6301234567901235,
"repo_name": "hioa-cs/http",
"id": "2e97dacef6b8c18ea86bdde830d069717208ba20",
"size": "6075",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "inc/status_line.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "475545"
},
{
"name": "Makefile",
"bytes": "1369"
},
{
"name": "Shell",
"bytes": "894"
}
],
"symlink_target": ""
} |
using System;
namespace IronSharp.IronWorker
{
public class ScheduleOptionsBuilder : ScheduleOptions
{
public ScheduleOptionsBuilder(DateTime now)
{
Now = now;
}
public DateTime Now { get; set; }
public ScheduleOptionsBuilder Delay(TimeSpan delay)
{
return StartingOn(Now + delay);
}
public ScheduleOptionsBuilder StopAt(DateTime endAt)
{
EndAt = endAt;
return this;
}
public ScheduleOptionsBuilder NeverStop()
{
EndAt = null;
RunTimes = null;
return this;
}
public ScheduleOptionsBuilder StopAfterNumberOfRuns(int times)
{
RunTimes = times;
return this;
}
public ScheduleOptionsBuilder RunFor(TimeSpan duration)
{
return StopAt(Now + duration);
}
public ScheduleOptionsBuilder StartingOn(DateTime startAt)
{
StartAt = startAt;
return this;
}
public ScheduleOptionsBuilder WithFrequency(TimeSpan frequency)
{
RunEvery = frequency.Seconds;
return this;
}
public ScheduleOptionsBuilder WithPriority(TaskPriority priority)
{
Priority = priority;
return this;
}
}
} | {
"content_hash": "0b74057be46ebfb367ae461a2e481513",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 73,
"avg_line_length": 22.950819672131146,
"alnum_prop": 0.5485714285714286,
"repo_name": "iron-io/iron_dotnet",
"id": "06787c27c6453db6549e5122d153c3f85eaf02e6",
"size": "1402",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/IronSharp.IronWorker/Schedules/ScheduleOptionsBuilder.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "208489"
}
],
"symlink_target": ""
} |
const try_it = true;
if (try_it) console.log('Garlic gum is not funny');
| {
"content_hash": "3636988519db15cf1f8ae2771d640856",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 51,
"avg_line_length": 36.5,
"alnum_prop": 0.684931506849315,
"repo_name": "evmorov/lang-compare",
"id": "9bdab56e5b9abf3b54d98af849fb3d37d058050f",
"size": "73",
"binary": false,
"copies": "2",
"ref": "refs/heads/source",
"path": "code/javascript/other-structure-boolean.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "763"
},
{
"name": "CoffeeScript",
"bytes": "9790"
},
{
"name": "HTML",
"bytes": "3762"
},
{
"name": "Java",
"bytes": "20287"
},
{
"name": "JavaScript",
"bytes": "8285"
},
{
"name": "PHP",
"bytes": "8387"
},
{
"name": "Python",
"bytes": "8674"
},
{
"name": "Ruby",
"bytes": "16009"
}
],
"symlink_target": ""
} |
using UnityEngine;
using System.Collections;
public class Sun_Scale : MonoBehaviour {
Vector3 cur_scale ;
Transform glow;
Transform flares;
Transform flares_big;
private float saturation_old;
private float contrast_old;
private float brightness_old;
private float edge_brightness_old;
private float hue_old;
//private float Epsilon = 1e-10f;
// Use this for initialization
void Start () {
cur_scale = this.transform.localScale;
glow = this.transform.FindChild("Glow");
flares = this.transform.FindChild("Flares");
flares_big = this.transform.FindChild("Flares_big");
glow.GetComponent<ParticleSystem>().startSize = glow.GetComponent<ParticleSystem>().startSize*cur_scale.x;
flares.GetComponent<ParticleSystem>().startSize = flares.GetComponent<ParticleSystem>().startSize*cur_scale.x;
flares_big.GetComponent<ParticleSystem>().startSize = flares_big.GetComponent<ParticleSystem>().startSize*cur_scale.x;
}
}
| {
"content_hash": "cedead65cb145fe23f2091d14fc970be",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 120,
"avg_line_length": 28.696969696969695,
"alnum_prop": 0.7581837381203802,
"repo_name": "TentacleGuitar/TentacleGuitar",
"id": "771b1e44b401ef4c0f0c87a65d529c9a9a7ee2fb",
"size": "949",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Toolkit/Sun_for_5/Scripts&Shaders/Sun_Scale.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "850698"
},
{
"name": "GLSL",
"bytes": "67067"
}
],
"symlink_target": ""
} |
module Fog
module OpenStack
class Compute
class Real
def list_snapshots_detail(options = {})
request(
:expects => 200,
:method => 'GET',
:path => 'os-snapshots/detail',
:query => options
)
end
end
class Mock
def list_snapshots_detail(_options = {})
response = Excon::Response.new
response.status = 200
snapshots = data[:snapshots].values
response.body = {'snapshots' => snapshots}
response
end
end
end
end
end
| {
"content_hash": "c6e4549dae0d1a963d6fca5d09628424",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 52,
"avg_line_length": 23.192307692307693,
"alnum_prop": 0.49585406301824214,
"repo_name": "fog/fog-openstack",
"id": "5acd89803dd8fbed97813ee1022adef3876c2c72",
"size": "603",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/fog/openstack/compute/requests/list_snapshots_detail.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "1590195"
},
{
"name": "Shell",
"bytes": "144"
}
],
"symlink_target": ""
} |
package org.pentaho.di.imp.rule;
import java.util.List;
import junit.framework.TestCase;
import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.plugins.ImportRulePluginType;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.imp.rules.JobHasNoDisabledHopsImportRule;
import org.pentaho.di.job.JobHopMeta;
import org.pentaho.di.job.JobMeta;
import org.pentaho.di.job.entries.special.JobEntrySpecial;
import org.pentaho.di.job.entry.JobEntryCopy;
public class JobHasNoDisabledHopsImportRuleIT extends TestCase {
@Override
protected void setUp() throws Exception {
KettleEnvironment.init();
}
public void testRule() throws Exception {
// Create a job to test.
//
JobMeta jobMeta = new JobMeta();
// Add 3 dummy steps connected with hops.
//
JobEntryCopy lastCopy = null;
for ( int i = 0; i < 3; i++ ) {
JobEntrySpecial dummy = new JobEntrySpecial();
dummy.setDummy( true );
dummy.setName( "dummy" + ( i + 1 ) );
JobEntryCopy copy = new JobEntryCopy( dummy );
copy.setLocation( 50 + i * 50, 50 );
copy.setDrawn();
jobMeta.addJobEntry( copy );
if ( lastCopy != null ) {
JobHopMeta hop = new JobHopMeta( lastCopy, copy );
jobMeta.addJobHop( hop );
}
lastCopy = copy;
}
// Load the plugin to test from the registry.
//
PluginRegistry registry = PluginRegistry.getInstance();
PluginInterface plugin = registry.findPluginWithId( ImportRulePluginType.class, "JobHasNoDisabledHops" );
assertNotNull( "The 'job has no disabled hops' rule could not be found in the plugin registry!", plugin );
JobHasNoDisabledHopsImportRule rule = (JobHasNoDisabledHopsImportRule) registry.loadClass( plugin );
assertNotNull( "The 'job has no disabled hops' class could not be loaded by the plugin registry!", plugin );
rule.setEnabled( true );
List<ImportValidationFeedback> feedback = rule.verifyRule( jobMeta );
assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
assertTrue(
"An approval ruling was expected",
feedback.get( 0 ).getResultType() == ImportValidationResultType.APPROVAL );
jobMeta.getJobHop( 0 ).setEnabled( false );
feedback = rule.verifyRule( jobMeta );
assertTrue( "We didn't get any feedback from the 'job has no disabled hops'", !feedback.isEmpty() );
assertTrue(
"An error ruling was expected", feedback.get( 0 ).getResultType() == ImportValidationResultType.ERROR );
rule.setEnabled( false );
feedback = rule.verifyRule( jobMeta );
assertTrue( "We didn't expect any feedback from the 'job has no disabled hops' while disabled", feedback
.isEmpty() );
}
}
| {
"content_hash": "ffb796c0e1e9e629b4e4d0fca79f26fb",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 112,
"avg_line_length": 34.5,
"alnum_prop": 0.7009544008483564,
"repo_name": "cjsonger/pentaho-kettle",
"id": "d5e2139e8db427ca1d26b99be80d3e69e6922c71",
"size": "3733",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "integration/src/it/java/org/pentaho/di/imp/rule/JobHasNoDisabledHopsImportRuleIT.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "29200"
},
{
"name": "CSS",
"bytes": "55052"
},
{
"name": "GAP",
"bytes": "4005"
},
{
"name": "HTML",
"bytes": "66893"
},
{
"name": "Java",
"bytes": "40225684"
},
{
"name": "JavaScript",
"bytes": "109021"
},
{
"name": "Shell",
"bytes": "29752"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "6e024177d1bb600b42077313e0a4cd1a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "41001fb317acfaa21a5653d31f2cd32e5404a50a",
"size": "175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Polygonaceae/Oxygonum/Oxygonum hastatum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
class GURL;
namespace base {
class Pickle;
}
namespace gfx {
class ImageSkia;
class Vector2d;
}
namespace ui {
struct FileInfo;
///////////////////////////////////////////////////////////////////////////////
//
// OSExchangeData
// An object that holds interchange data to be sent out to OS services like
// clipboard, drag and drop, etc. This object exposes an API that clients can
// use to specify raw data and its high level type. This object takes care of
// translating that into something the OS can understand.
//
///////////////////////////////////////////////////////////////////////////////
// NOTE: Support for html and file contents is required by TabContentViewWin.
// TabContentsViewGtk uses a different class to handle drag support that does
// not use OSExchangeData. As such, file contents and html support is only
// compiled on windows.
class UI_BASE_EXPORT OSExchangeData {
public:
// Enumeration of the known formats.
enum Format {
STRING = 1 << 0,
URL = 1 << 1,
FILE_NAME = 1 << 2,
PICKLED_DATA = 1 << 3,
#if defined(OS_WIN)
FILE_CONTENTS = 1 << 4,
#endif
#if defined(USE_AURA)
HTML = 1 << 5,
#endif
};
// Controls whether or not filenames should be converted to file: URLs when
// getting a URL.
enum FilenameToURLPolicy { CONVERT_FILENAMES, DO_NOT_CONVERT_FILENAMES, };
// Encapsulates the info about a file to be downloaded.
struct UI_BASE_EXPORT DownloadFileInfo {
DownloadFileInfo(const base::FilePath& filename,
DownloadFileProvider* downloader);
~DownloadFileInfo();
base::FilePath filename;
scoped_refptr<DownloadFileProvider> downloader;
};
// Provider defines the platform specific part of OSExchangeData that
// interacts with the native system.
class UI_BASE_EXPORT Provider {
public:
Provider() {}
virtual ~Provider() {}
virtual Provider* Clone() const = 0;
virtual void MarkOriginatedFromRenderer() = 0;
virtual bool DidOriginateFromRenderer() const = 0;
virtual void SetString(const base::string16& data) = 0;
virtual void SetURL(const GURL& url, const base::string16& title) = 0;
virtual void SetFilename(const base::FilePath& path) = 0;
virtual void SetFilenames(const std::vector<FileInfo>& file_names) = 0;
virtual void SetPickledData(const Clipboard::FormatType& format,
const base::Pickle& data) = 0;
virtual bool GetString(base::string16* data) const = 0;
virtual bool GetURLAndTitle(FilenameToURLPolicy policy,
GURL* url,
base::string16* title) const = 0;
virtual bool GetFilename(base::FilePath* path) const = 0;
virtual bool GetFilenames(std::vector<FileInfo>* file_names) const = 0;
virtual bool GetPickledData(const Clipboard::FormatType& format,
base::Pickle* data) const = 0;
virtual bool HasString() const = 0;
virtual bool HasURL(FilenameToURLPolicy policy) const = 0;
virtual bool HasFile() const = 0;
virtual bool HasCustomFormat(const Clipboard::FormatType& format) const = 0;
#if (!defined(OS_CHROMEOS) && defined(USE_X11)) || defined(OS_WIN)
virtual void SetFileContents(const base::FilePath& filename,
const std::string& file_contents) = 0;
#endif
#if defined(OS_WIN)
virtual bool GetFileContents(base::FilePath* filename,
std::string* file_contents) const = 0;
virtual bool HasFileContents() const = 0;
virtual void SetDownloadFileInfo(const DownloadFileInfo& download) = 0;
#endif
#if defined(USE_AURA)
virtual void SetHtml(const base::string16& html, const GURL& base_url) = 0;
virtual bool GetHtml(base::string16* html, GURL* base_url) const = 0;
virtual bool HasHtml() const = 0;
#endif
#if defined(USE_AURA)
virtual void SetDragImage(const gfx::ImageSkia& image,
const gfx::Vector2d& cursor_offset) = 0;
virtual const gfx::ImageSkia& GetDragImage() const = 0;
virtual const gfx::Vector2d& GetDragImageOffset() const = 0;
#endif
};
// Creates the platform specific Provider.
static Provider* CreateProvider();
OSExchangeData();
// Creates an OSExchangeData with the specified provider. OSExchangeData
// takes ownership of the supplied provider.
explicit OSExchangeData(Provider* provider);
~OSExchangeData();
// Returns the Provider, which actually stores and manages the data.
const Provider& provider() const { return *provider_; }
Provider& provider() { return *provider_; }
// Marks drag data as tainted if it originates from the renderer. This is used
// to avoid granting privileges to a renderer when dragging in tainted data,
// since it could allow potential escalation of privileges.
void MarkOriginatedFromRenderer();
bool DidOriginateFromRenderer() const;
// These functions add data to the OSExchangeData object of various Chrome
// types. The OSExchangeData object takes care of translating the data into
// a format suitable for exchange with the OS.
// NOTE WELL: Typically, a data object like this will contain only one of the
// following types of data. In cases where more data is held, the
// order in which these functions are called is _important_!
// ---> The order types are added to an OSExchangeData object controls
// the order of enumeration in our IEnumFORMATETC implementation!
// This comes into play when selecting the best (most preferable)
// data type for insertion into a DropTarget.
void SetString(const base::string16& data);
// A URL can have an optional title in some exchange formats.
void SetURL(const GURL& url, const base::string16& title);
// A full path to a file.
void SetFilename(const base::FilePath& path);
// Full path to one or more files. See also SetFilenames() in Provider.
void SetFilenames(
const std::vector<FileInfo>& file_names);
// Adds pickled data of the specified format.
void SetPickledData(const Clipboard::FormatType& format,
const base::Pickle& data);
// These functions retrieve data of the specified type. If data exists, the
// functions return and the result is in the out parameter. If the data does
// not exist, the out parameter is not touched. The out parameter cannot be
// NULL.
// GetString() returns the plain text representation of the pasteboard
// contents.
bool GetString(base::string16* data) const;
bool GetURLAndTitle(FilenameToURLPolicy policy,
GURL* url,
base::string16* title) const;
// Return the path of a file, if available.
bool GetFilename(base::FilePath* path) const;
bool GetFilenames(std::vector<FileInfo>* file_names) const;
bool GetPickledData(const Clipboard::FormatType& format,
base::Pickle* data) const;
// Test whether or not data of certain types is present, without actually
// returning anything.
bool HasString() const;
bool HasURL(FilenameToURLPolicy policy) const;
bool HasFile() const;
bool HasCustomFormat(const Clipboard::FormatType& format) const;
// Returns true if this OSExchangeData has data in any of the formats in
// |formats| or any custom format in |custom_formats|.
bool HasAnyFormat(int formats,
const std::set<Clipboard::FormatType>& types) const;
#if defined(OS_WIN)
// Adds the bytes of a file (CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR on
// Windows).
void SetFileContents(const base::FilePath& filename,
const std::string& file_contents);
bool GetFileContents(base::FilePath* filename,
std::string* file_contents) const;
// Adds a download file with full path (CF_HDROP).
void SetDownloadFileInfo(const DownloadFileInfo& download);
#endif
#if defined(USE_AURA)
// Adds a snippet of HTML. |html| is just raw html but this sets both
// text/html and CF_HTML.
void SetHtml(const base::string16& html, const GURL& base_url);
bool GetHtml(base::string16* html, GURL* base_url) const;
#endif
private:
// Provides the actual data.
scoped_ptr<Provider> provider_;
DISALLOW_COPY_AND_ASSIGN(OSExchangeData);
};
} // namespace ui
#endif // UI_BASE_DRAGDROP_OS_EXCHANGE_DATA_H_
| {
"content_hash": "b5a9f352c5ef4c4f00e39377a6261dc7",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 80,
"avg_line_length": 39.041666666666664,
"alnum_prop": 0.6712913553895411,
"repo_name": "Workday/OpenFrame",
"id": "5160530fb39b871286364508a32274b642aef9f8",
"size": "9040",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ui/base/dragdrop/os_exchange_data.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
require 'gitlab/satellite/satellite'
class Projects::MergeRequestsController < Projects::ApplicationController
before_filter :module_enabled
before_filter :merge_request, only: [:edit, :update, :show, :commits, :diffs, :automerge, :automerge_check, :ci_status]
before_filter :closes_issues, only: [:edit, :update, :show, :commits, :diffs]
before_filter :validates_merge_request, only: [:show, :diffs]
before_filter :define_show_vars, only: [:show, :diffs]
# Allow read any merge_request
before_filter :authorize_read_merge_request!
# Allow write(create) merge_request
before_filter :authorize_write_merge_request!, only: [:new, :create]
# Allow modify merge_request
before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
def index
@merge_requests = MergeRequestsLoadContext.new(project, current_user, params).execute
assignee_id, milestone_id = params[:assignee_id], params[:milestone_id]
@assignee = @project.team.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero?
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
end
def show
respond_to do |format|
format.html
format.js
format.diff { render text: @merge_request.to_diff(current_user) }
format.patch { render text: @merge_request.to_patch(current_user) }
end
end
def diffs
@commit = @merge_request.last_commit
@comments_allowed = @reply_allowed = true
@comments_target = {noteable_type: 'MergeRequest',
noteable_id: @merge_request.id}
@line_notes = @merge_request.notes.where("line_code is not null")
end
def new
@merge_request = MergeRequest.new(params[:merge_request])
@merge_request.source_project = @project unless @merge_request.source_project
@merge_request.target_project = @project unless @merge_request.target_project
@target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names
@source_project = @merge_request.source_project
@merge_request
end
def edit
@source_project = @merge_request.source_project
@target_project = @merge_request.target_project
@target_branches = @merge_request.target_project.repository.branch_names
end
def create
@merge_request = MergeRequest.new(params[:merge_request])
@merge_request.author = current_user
@target_branches ||= []
if @merge_request.save
@merge_request.reload_code
redirect_to [@merge_request.target_project, @merge_request], notice: 'Merge request was successfully created.'
else
@source_project = @merge_request.source_project
@target_project = @merge_request.target_project
render action: "new"
end
end
def update
if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
@merge_request.reload_code
@merge_request.mark_as_unchecked
redirect_to [@merge_request.target_project, @merge_request], notice: 'Merge request was successfully updated.'
else
render "edit"
end
end
def automerge_check
if @merge_request.unchecked?
@merge_request.check_if_can_be_merged
end
render json: {merge_status: @merge_request.merge_status_name}
rescue Gitlab::SatelliteNotExistError
render json: {merge_status: :no_satellite}
end
def automerge
return access_denied! unless allowed_to_merge?
if @merge_request.opened? && @merge_request.can_be_merged?
@merge_request.should_remove_source_branch = params[:should_remove_source_branch]
@merge_request.automerge!(current_user)
@status = true
else
@status = false
end
end
def branch_from
#This is always source
@source_project = @merge_request.nil? ? @project : @merge_request.source_project
@commit = @repository.commit(params[:ref]) if params[:ref].present?
end
def branch_to
@target_project = selected_target_project
@commit = @target_project.repository.commit(params[:ref]) if params[:ref].present?
end
def update_branches
@target_project = selected_target_project
@target_branches = @target_project.repository.branch_names
@target_branches
end
def ci_status
status = project.gitlab_ci_service.commit_status(merge_request.last_commit.sha)
response = {status: status}
render json: response
end
protected
def selected_target_project
((@project.id.to_s == params[:target_project_id]) || @project.forked_project_link.nil?) ? @project : @project.forked_project_link.forked_from_project
end
def merge_request
@merge_request ||= @project.merge_requests.find_by_iid!(params[:id])
end
def closes_issues
@closes_issues ||= @merge_request.closes_issues
end
def authorize_modify_merge_request!
return render_404 unless can?(current_user, :modify_merge_request, @merge_request)
end
def authorize_admin_merge_request!
return render_404 unless can?(current_user, :admin_merge_request, @merge_request)
end
def module_enabled
return render_404 unless @project.merge_requests_enabled
end
def validates_merge_request
# Show git not found page if target branch doesn't exist
return invalid_mr unless @merge_request.target_project.repository.branch_names.include?(@merge_request.target_branch)
# Show git not found page if source branch doesn't exist
# and there is no saved commits between source & target branch
return invalid_mr if !@merge_request.source_project.repository.branch_names.include?(@merge_request.source_branch) && @merge_request.commits.blank?
end
def define_show_vars
# Build a note object for comment form
@note = @project.notes.new(noteable: @merge_request)
# Get commits from repository
# or from cache if already merged
@commits = @merge_request.commits
@allowed_to_merge = allowed_to_merge?
@show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge
@target_type = :merge_request
@target_id = @merge_request.id
end
def allowed_to_merge?
action = if project.protected_branch?(@merge_request.target_branch)
:push_code_to_protected_branches
else
:push_code
end
can?(current_user, action, @project)
end
def invalid_mr
# Render special view for MR with removed source or target branch
render 'invalid'
end
end
| {
"content_hash": "abcbd70f6ef958074ecfda3add2871b2",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 153,
"avg_line_length": 33.67357512953368,
"alnum_prop": 0.6994922295737805,
"repo_name": "goeun/myRepo",
"id": "55d2c3f04fc8e09e26acf59e4b9a8b0f562045cc",
"size": "6499",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/projects/merge_requests_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11861"
},
{
"name": "CoffeeScript",
"bytes": "51698"
},
{
"name": "JavaScript",
"bytes": "46781"
},
{
"name": "Ruby",
"bytes": "982067"
},
{
"name": "Shell",
"bytes": "1241"
}
],
"symlink_target": ""
} |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from orcid_api_v3.models.external_i_ds_v30_rc1 import ExternalIDsV30Rc1 # noqa: F401,E501
from orcid_api_v3.models.last_modified_date_v30_rc1 import LastModifiedDateV30Rc1 # noqa: F401,E501
from orcid_api_v3.models.work_summary_v30_rc1 import WorkSummaryV30Rc1 # noqa: F401,E501
class WorkGroupV30Rc1(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'last_modified_date': 'LastModifiedDateV30Rc1',
'external_ids': 'ExternalIDsV30Rc1',
'work_summary': 'list[WorkSummaryV30Rc1]'
}
attribute_map = {
'last_modified_date': 'last-modified-date',
'external_ids': 'external-ids',
'work_summary': 'work-summary'
}
def __init__(self, last_modified_date=None, external_ids=None, work_summary=None): # noqa: E501
"""WorkGroupV30Rc1 - a model defined in Swagger""" # noqa: E501
self._last_modified_date = None
self._external_ids = None
self._work_summary = None
self.discriminator = None
if last_modified_date is not None:
self.last_modified_date = last_modified_date
if external_ids is not None:
self.external_ids = external_ids
if work_summary is not None:
self.work_summary = work_summary
@property
def last_modified_date(self):
"""Gets the last_modified_date of this WorkGroupV30Rc1. # noqa: E501
:return: The last_modified_date of this WorkGroupV30Rc1. # noqa: E501
:rtype: LastModifiedDateV30Rc1
"""
return self._last_modified_date
@last_modified_date.setter
def last_modified_date(self, last_modified_date):
"""Sets the last_modified_date of this WorkGroupV30Rc1.
:param last_modified_date: The last_modified_date of this WorkGroupV30Rc1. # noqa: E501
:type: LastModifiedDateV30Rc1
"""
self._last_modified_date = last_modified_date
@property
def external_ids(self):
"""Gets the external_ids of this WorkGroupV30Rc1. # noqa: E501
:return: The external_ids of this WorkGroupV30Rc1. # noqa: E501
:rtype: ExternalIDsV30Rc1
"""
return self._external_ids
@external_ids.setter
def external_ids(self, external_ids):
"""Sets the external_ids of this WorkGroupV30Rc1.
:param external_ids: The external_ids of this WorkGroupV30Rc1. # noqa: E501
:type: ExternalIDsV30Rc1
"""
self._external_ids = external_ids
@property
def work_summary(self):
"""Gets the work_summary of this WorkGroupV30Rc1. # noqa: E501
:return: The work_summary of this WorkGroupV30Rc1. # noqa: E501
:rtype: list[WorkSummaryV30Rc1]
"""
return self._work_summary
@work_summary.setter
def work_summary(self, work_summary):
"""Sets the work_summary of this WorkGroupV30Rc1.
:param work_summary: The work_summary of this WorkGroupV30Rc1. # noqa: E501
:type: list[WorkSummaryV30Rc1]
"""
self._work_summary = work_summary
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(WorkGroupV30Rc1, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, WorkGroupV30Rc1):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| {
"content_hash": "4fb764c6417fdb7d4aa9b5074474bff4",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 119,
"avg_line_length": 31.98170731707317,
"alnum_prop": 0.5971401334604385,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "97f852fb34675f6400efe9769efab6a0e808dca2",
"size": "5262",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "orcid_api_v3/models/work_group_v30_rc1.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20266"
},
{
"name": "Dockerfile",
"bytes": "3303"
},
{
"name": "HTML",
"bytes": "239338"
},
{
"name": "JavaScript",
"bytes": "2240"
},
{
"name": "Makefile",
"bytes": "600"
},
{
"name": "PLpgSQL",
"bytes": "2581"
},
{
"name": "Python",
"bytes": "7935510"
},
{
"name": "Shell",
"bytes": "12088"
}
],
"symlink_target": ""
} |
import unittest
import imath
import IECore
import Gaffer
import GafferTest
import GafferScene
import GafferSceneTest
class RenderControllerTest( GafferSceneTest.SceneTestCase ) :
def testConstructorAndAccessors( self ) :
sphere = GafferScene.Sphere()
context1 = Gaffer.Context()
renderer = GafferScene.Private.IECoreScenePreview.Renderer.create(
"OpenGL",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Interactive
)
controller = GafferScene.RenderController( sphere["out"], context1, renderer )
self.assertTrue( controller.renderer().isSame( renderer ) )
self.assertTrue( controller.getScene().isSame( sphere["out"] ) )
self.assertTrue( controller.getContext().isSame( context1 ) )
cube = GafferScene.Cube()
context2 = Gaffer.Context()
controller.setScene( cube["out"] )
controller.setContext( context2 )
self.assertTrue( controller.getScene().isSame( cube["out"] ) )
self.assertTrue( controller.getContext().isSame( context2 ) )
def testBoundUpdate( self ) :
sphere = GafferScene.Sphere()
group = GafferScene.Group()
group["in"][0].setInput( sphere["out"] )
renderer = GafferScene.Private.IECoreScenePreview.Renderer.create(
"OpenGL",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Interactive
)
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.update()
self.assertEqual(
renderer.command( "gl:queryBound", {} ),
group["out"].bound( "/" )
)
sphere["transform"]["translate"]["x"].setValue( 1 )
controller.update()
self.assertEqual(
renderer.command( "gl:queryBound", {} ),
group["out"].bound( "/" )
)
def testUpdateMatchingPaths( self ) :
sphere = GafferScene.Sphere()
group = GafferScene.Group()
group["in"][0].setInput( sphere["out"] )
group["in"][1].setInput( sphere["out"] )
renderer = GafferScene.Private.IECoreScenePreview.Renderer.create(
"OpenGL",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Interactive
)
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 3 )
controller.update()
def bound( path ) :
renderer.option( "gl:selection", IECore.PathMatcherData( IECore.PathMatcher( [ path ] ) ) )
return renderer.command( "gl:queryBound", { "selection" : True } )
boundOrig = sphere["out"].bound( "/sphere" )
self.assertEqual( bound( "/group/sphere" ), boundOrig )
self.assertEqual( bound( "/group/sphere1" ), boundOrig )
sphere["radius"].setValue( 2 )
self.assertEqual( bound( "/group/sphere" ), boundOrig )
self.assertEqual( bound( "/group/sphere1" ), boundOrig )
controller.updateMatchingPaths( IECore.PathMatcher( [ "/group/sphere" ] ) )
boundUpdated = sphere["out"].bound( "/sphere" )
self.assertEqual( bound( "/group/sphere" ), boundUpdated )
self.assertEqual( bound( "/group/sphere1" ), boundOrig )
controller.update()
self.assertEqual( bound( "/group/sphere" ), boundUpdated )
self.assertEqual( bound( "/group/sphere1" ), boundUpdated )
def testUpdateMatchingPathsAndInheritedTransforms( self ) :
sphere = GafferScene.Sphere()
group = GafferScene.Group()
group["in"][0].setInput( sphere["out"] )
group["in"][1].setInput( sphere["out"] )
renderer = GafferScene.Private.IECoreScenePreview.Renderer.create(
"OpenGL",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Interactive
)
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 3 )
controller.update()
def bound( path ) :
renderer.option( "gl:selection", IECore.PathMatcherData( IECore.PathMatcher( [ path ] ) ) )
return renderer.command( "gl:queryBound", { "selection" : True } )
untranslatedBound = group["out"].bound( "/group/sphere" ) * group["out"].fullTransform( "/group/sphere" )
self.assertEqual( bound( "/group/sphere" ), untranslatedBound )
self.assertEqual( bound( "/group/sphere1" ), untranslatedBound )
group["transform"]["translate"]["x"].setValue( 2 )
translatedBound = group["out"].bound( "/group/sphere" ) * group["out"].fullTransform( "/group/sphere" )
controller.updateMatchingPaths( IECore.PathMatcher( [ "/group/sphere" ] ) )
self.assertEqual( bound( "/group/sphere" ), translatedBound )
self.assertEqual( bound( "/group/sphere1" ), untranslatedBound )
controller.update()
self.assertEqual( bound( "/group/sphere" ), translatedBound )
self.assertEqual( bound( "/group/sphere1" ), translatedBound )
def testUpdateRemoveFromLightSet( self ) :
sphere = GafferScene.Sphere()
lightSet = GafferScene.Set()
lightSet["in"].setInput( sphere["out"] )
lightSet["name"].setValue( '__lights' )
lightSet["paths"].setValue( IECore.StringVectorData( [ '/sphere' ] ) )
renderer = GafferScene.Private.IECoreScenePreview.Renderer.create(
"OpenGL",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Interactive
)
controller = GafferScene.RenderController( sphere["out"], Gaffer.Context(), renderer )
controller.update()
self.assertEqual(
renderer.command( "gl:queryBound", {} ),
lightSet["out"].bound( "/" )
)
controller.setScene( lightSet["out"] )
controller.update()
self.assertEqual(
renderer.command( "gl:queryBound", {} ),
lightSet["out"].bound( "/" )
)
# While doing this exact same thing worked the first time, there was a bug where
# rendering geo that had previously been rendered in the lights pass would fail.
controller.setScene( sphere["out"] )
controller.update()
self.assertEqual(
renderer.command( "gl:queryBound", {} ),
lightSet["out"].bound( "/" )
)
def testLightLinks( self ) :
sphere = GafferScene.Sphere()
attributes = GafferScene.StandardAttributes()
attributes["in"].setInput( sphere["out"] )
attributes["attributes"]["linkedLights"]["enabled"].setValue( True )
attributes["attributes"]["linkedLights"]["value"].setValue( "defaultLights" )
attributes["attributes"]["doubleSided"]["enabled"].setValue( True )
attributes["attributes"]["doubleSided"]["value"].setValue( False )
lightA = GafferSceneTest.TestLight()
lightA["name"].setValue( "lightA" )
lightA["sets"].setValue( "A" )
lightB = GafferSceneTest.TestLight()
lightB["name"].setValue( "lightB" )
lightB["sets"].setValue( "B" )
group = GafferScene.Group()
group["in"][0].setInput( attributes["out"] )
group["in"][1].setInput( lightA["out"] )
group["in"][2].setInput( lightB["out"] )
renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer()
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 10 )
controller.update()
capturedSphere = renderer.capturedObject( "/group/sphere" )
capturedLightA = renderer.capturedObject( "/group/lightA" )
capturedLightB = renderer.capturedObject( "/group/lightB" )
# Since the linking expression is "defaultLights" and there are
# no non-default lights, we don't expect to have light links.
self.assertEqual( capturedSphere.capturedLinks( "lights" ), None )
self.assertEqual( capturedSphere.numLinkEdits( "lights" ), 1 )
# If we restrict to just one set of lights, then we expect an
# edit to update the links.
attributes["attributes"]["linkedLights"]["value"].setValue( "A" )
controller.update()
self.assertEqual( capturedSphere.capturedLinks( "lights" ), { capturedLightA } )
self.assertEqual( capturedSphere.numLinkEdits( "lights" ), 2 )
# Likewise if we restrict to the other set of lights.
attributes["attributes"]["linkedLights"]["value"].setValue( "B" )
controller.update()
self.assertEqual( capturedSphere.capturedLinks( "lights" ), { capturedLightB } )
self.assertEqual( capturedSphere.numLinkEdits( "lights" ), 3 )
# If we change an attribute which has no bearing on light linking,
# we don't want links to be emitted again. Attributes change frequently
# and light linking can be expensive.
attributes["attributes"]["doubleSided"]["value"].setValue( True )
controller.update()
self.assertEqual( capturedSphere.capturedLinks( "lights" ), { capturedLightB } )
self.assertEqual( capturedSphere.numLinkEdits( "lights" ), 3 )
del capturedSphere, capturedLightA, capturedLightB
@GafferTest.TestRunner.PerformanceTestMethod()
def testLightLinkPerformance( self ) :
numSpheres = 10000
numLights = 1000
# Make a bunch of spheres
sphere = GafferScene.Sphere()
spherePlane = GafferScene.Plane()
spherePlane["name"].setValue( "spheres" )
spherePlane["divisions"].setValue( imath.V2i( 1, numSpheres / 2 - 1 ) )
sphereInstancer = GafferScene.Instancer()
sphereInstancer["in"].setInput( spherePlane["out"] )
sphereInstancer["prototypes"].setInput( sphere["out"] )
sphereInstancer["parent"].setValue( "/spheres" )
# Make a bunch of lights
light = GafferSceneTest.TestLight()
lightPlane = GafferScene.Plane()
lightPlane["name"].setValue( "lights" )
lightPlane["divisions"].setValue( imath.V2i( 1, numLights / 2 - 1 ) )
lightInstancer = GafferScene.Instancer()
lightInstancer["in"].setInput( lightPlane["out"] )
lightInstancer["prototypes"].setInput( light["out"] )
lightInstancer["parent"].setValue( "/lights" )
# Make a single non-default light. This
# will trigger linking of all the others.
nonDefaultLight = GafferSceneTest.TestLight()
nonDefaultLight["defaultLight"].setValue( False )
# Group everything into one scene
group = GafferScene.Group()
group["in"][0].setInput( sphereInstancer["out"] )
group["in"][1].setInput( lightInstancer["out"] )
group["in"][2].setInput( nonDefaultLight["out"] )
# See how quickly we can output those links
renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer()
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 10 )
with GafferTest.TestRunner.PerformanceScope() :
controller.update()
# Sanity check that we did output links as expected.
links = renderer.capturedObject( "/group/spheres/instances/sphere/0" ).capturedLinks( "lights" )
self.assertEqual( len( links ), numLights )
def testHideLinkedLight( self ) :
# One default light and one non-default light, which will
# result in light links being emitted to the renderer.
defaultLight = GafferSceneTest.TestLight()
defaultLight["name"].setValue( "defaultLight" )
defaultLightAttributes = GafferScene.StandardAttributes()
defaultLightAttributes["in"].setInput( defaultLight["out"] )
nonDefaultLight = GafferSceneTest.TestLight()
nonDefaultLight["name"].setValue( "nonDefaultLight" )
nonDefaultLight["defaultLight"].setValue( False )
plane = GafferScene.Plane()
group = GafferScene.Group()
group["in"][0].setInput( defaultLightAttributes["out"] )
group["in"][1].setInput( nonDefaultLight["out"] )
group["in"][2].setInput( plane["out"] )
# Output a scene. Only the default light should be linked.
renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer()
controller = GafferScene.RenderController( group["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 10 )
controller.update()
capturedPlane = renderer.capturedObject( "/group/plane" )
self.assertEqual( capturedPlane.capturedLinks( "lights" ), { renderer.capturedObject( "/group/defaultLight" ) } )
# Hide the default light. It should be removed from the render,
# and the plane should be linked to an empty light set.
defaultLightAttributes["attributes"]["visibility"]["enabled"].setValue( True )
defaultLightAttributes["attributes"]["visibility"]["value"].setValue( False )
controller.update()
self.assertIsNone( renderer.capturedObject( "/group/defaultLight" ) )
self.assertEqual( capturedPlane.capturedLinks( "lights" ), set() )
def testAttributeDirtyPropagation( self ) :
sphere = GafferScene.Sphere()
group = GafferScene.Group()
options = GafferScene.StandardOptions()
sphereSet = GafferScene.Set()
sphereSet["name"].setValue( "render:spheres" )
setFilter = GafferScene.PathFilter()
setFilter["paths"].setValue( IECore.StringVectorData( [ "/group/sphere" ] ) )
sphereSet["filter"].setInput( setFilter["out"] )
group["in"][0].setInput( sphere["out"] )
options["in"].setInput( group["out"] )
sphereSet["in"].setInput( options["out"] )
globalAttr = GafferScene.CustomAttributes()
globalAttrPlug = Gaffer.NameValuePlug( "user:globalAttr", IECore.IntData( 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )
globalAttr["attributes"].addChild( globalAttrPlug )
globalAttr["global"].setValue( True )
groupAttr = GafferScene.CustomAttributes()
groupAttrPlug = Gaffer.NameValuePlug( "localAttr1", IECore.IntData( 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )
groupAttr["attributes"].addChild( groupAttrPlug )
groupAttrFilter = GafferScene.PathFilter()
groupAttr["filter"].setInput( groupAttrFilter["out"] )
groupAttrFilter["paths"].setValue( IECore.StringVectorData( [ "/group" ] ) )
sphereAttr = GafferScene.CustomAttributes()
sphereAttrPlug = Gaffer.NameValuePlug( "user:localAttr2", IECore.IntData( 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )
sphereAttr["attributes"].addChild( sphereAttrPlug )
sphereAttrFilter = GafferScene.PathFilter()
sphereAttr["filter"].setInput( sphereAttrFilter["out"] )
sphereAttrFilter["paths"].setValue( IECore.StringVectorData( [ "/group/sphere" ] ) )
globalAttr["in"].setInput( sphereSet["out"] )
groupAttr["in"].setInput( globalAttr["out"] )
sphereAttr["in"].setInput( groupAttr["out"] )
renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer()
controller = GafferScene.RenderController( sphereAttr["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 10 )
controller.update()
capturedSphere = renderer.capturedObject( "/group/sphere" )
self.assertEqual( capturedSphere.numAttributeEdits(), 1 )
self.assertEqual(
capturedSphere.capturedAttributes().attributes(),
IECore.CompoundObject( {
"user:globalAttr" : IECore.IntData( 0 ),
"localAttr1" : IECore.IntData( 0 ),
"user:localAttr2" : IECore.IntData( 0 ),
"sets" : IECore.InternedStringVectorData( [ "spheres" ] )
} )
)
sphereAttrPlug["value"].setValue( 1 )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 2 )
self.assertEqual(
capturedSphere.capturedAttributes().attributes(),
IECore.CompoundObject( {
"user:globalAttr" : IECore.IntData( 0 ),
"localAttr1" : IECore.IntData( 0 ),
"user:localAttr2" : IECore.IntData( 1 ),
"sets" : IECore.InternedStringVectorData( [ "spheres" ] )
} )
)
groupAttrPlug["value"].setValue( 2 )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 3 )
self.assertEqual(
capturedSphere.capturedAttributes().attributes(),
IECore.CompoundObject( {
"user:globalAttr" : IECore.IntData( 0 ),
"localAttr1" : IECore.IntData( 2 ),
"user:localAttr2" : IECore.IntData( 1 ),
"sets" : IECore.InternedStringVectorData( [ "spheres" ] )
} )
)
globalAttrPlug["value"].setValue( 3 )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 4 )
self.assertEqual(
capturedSphere.capturedAttributes().attributes(),
IECore.CompoundObject( {
"user:globalAttr" : IECore.IntData( 3 ),
"localAttr1" : IECore.IntData( 2 ),
"user:localAttr2" : IECore.IntData( 1 ),
"sets" : IECore.InternedStringVectorData( [ "spheres" ] )
} )
)
sphereSet["enabled"].setValue( False )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 5 )
self.assertEqual(
capturedSphere.capturedAttributes().attributes(),
IECore.CompoundObject( {
"user:globalAttr" : IECore.IntData( 3 ),
"localAttr1" : IECore.IntData( 2 ),
"user:localAttr2" : IECore.IntData( 1 ),
"sets" : IECore.InternedStringVectorData( [ ] )
} )
)
options["options"]["renderCamera"]["enabled"].setValue( True )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 5 )
options["options"]["renderCamera"]["value"].setValue( "/camera" )
controller.update()
self.assertEqual( capturedSphere.numAttributeEdits(), 5 )
del capturedSphere
def testNullObjects( self ) :
camera = GafferScene.Camera()
sphere = GafferScene.Sphere()
light = GafferSceneTest.TestLight()
lightAttr = GafferScene.StandardAttributes()
lightAttr["in"].setInput( sphere["out"] )
lightAttr["attributes"]["linkedLights"]["enabled"].setValue( True )
lightAttr["attributes"]["linkedLights"]["value"].setValue( "defaultLights" )
group = GafferScene.Group()
group["in"][0].setInput( camera["out"] )
group["in"][1].setInput( sphere["out"] )
group["in"][2].setInput( light["out"] )
allFilter = GafferScene.PathFilter()
allFilter["paths"].setValue( IECore.StringVectorData( [ "..." ] ) )
attr = GafferScene.CustomAttributes()
unrenderableAttrPlug = Gaffer.NameValuePlug( "cr:unrenderable", IECore.BoolData( True ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic )
attr["attributes"].addChild( unrenderableAttrPlug )
attr["filter"].setInput( allFilter["out"] )
attr["in"].setInput( group["out"] )
renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer()
controller = GafferScene.RenderController( attr["out"], Gaffer.Context(), renderer )
controller.setMinimumExpansionDepth( 10 )
controller.update()
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "a52b83202c264b15e92a54aaafbda61d",
"timestamp": "",
"source": "github",
"line_count": 495,
"max_line_length": 154,
"avg_line_length": 35.63232323232323,
"alnum_prop": 0.7148769701780248,
"repo_name": "lucienfostier/gaffer",
"id": "8e69d1d763834a0f2387e43e6195cf3bb5118c33",
"size": "19441",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "python/GafferSceneTest/RenderControllerTest.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "41979"
},
{
"name": "C++",
"bytes": "7610953"
},
{
"name": "CMake",
"bytes": "85201"
},
{
"name": "GLSL",
"bytes": "6236"
},
{
"name": "Python",
"bytes": "7892655"
},
{
"name": "Shell",
"bytes": "15031"
}
],
"symlink_target": ""
} |
//! rhombus.effect.js
//! authors: Spencer Phippen, Tim Grant
//! license: MIT
/**
* An effect in the audio graph.
* @name Effect
* @interface
* @memberof Rhombus
* @implements {Rhombus.GraphNode}
*/
/**
* @returns {Array} An array of all the possible effect strings that can be passed into {@link Rhombus#addEffect}.
*/
Rhombus.prototype.effectTypes = function() {
return ["dist", "filt", "eq", "dely", "comp", "gain", "bitc", "revb", "chor", "scpt"];
};
/**
* @returns {Array} An array of the strings to display in the UI for each effect type, parallel with {@link Rhombus#effectTypes}.
*/
Rhombus.prototype.effectDisplayNames = function() {
return ["Distortion", "Filter", "EQ", "Delay", "Compressor", "Gain", "Bitcrusher", "Reverb", "Chorus", "Script"];
};
/**
* Adds an effect of the given type to the current song.
* @param {String} type A type from the array returned from {@link Rhombus#effectTypes}.
* @returns {Number} The id of the newly added effect
*/
Rhombus.prototype.addEffect = function(type, json) {
function masterAdded(song) {
var effs = song.getEffects();
var effIds = Object.keys(song.getEffects());
for (var i = 0; i < effIds.length; i++) {
var effId = effIds[i];
var eff = effs[effId];
if (eff.isMaster()) {
return true;
}
}
return false;
}
var ctrMap = {
"dist" : Rhombus._Distortion,
"filt" : Rhombus._Filter,
"eq" : Rhombus._EQ,
"dely" : Rhombus._Delay,
"comp" : Rhombus._Compressor,
"gain" : Rhombus._Gainer,
"bitc" : Rhombus._BitCrusher,
"revb" : Rhombus._Reverb,
"chor" : Rhombus._Chorus,
"scpt" : Rhombus._Script
};
var options, go, gi, id, graphX, graphY, code;
if (isDefined(json)) {
options = json._params;
go = json._graphOutputs;
gi = json._graphInputs;
id = json._id;
graphX = json._graphX;
graphY = json._graphY;
code = json._code;
}
var ctr;
if (type === "mast") {
if (masterAdded(this._song)) {
return;
}
ctr = Rhombus._Master;
} else {
ctr = ctrMap[type];
}
if (notDefined(ctr)) {
ctr = ctrMap["dist"];
}
var eff;
if (isDefined(code)) {
eff = new ctr(code);
} else {
eff = new ctr();
}
if (isNull(eff) || notDefined(eff)) {
return;
}
eff._r = this;
eff.setGraphX(graphX);
eff.setGraphY(graphY);
if (isNull(id) || notDefined(id)) {
this._newId(eff);
} else {
this._setId(eff, id);
}
eff._type = type;
eff._currentParams = {};
eff._trackParams(options);
var def = Rhombus._map.generateDefaultSetObj(eff._unnormalizeMap);
eff._normalizedObjectSet(def, true);
eff._normalizedObjectSet(options, true);
if (ctr === Rhombus._Master) {
eff._graphSetup(1, 1, 0, 0);
} else {
eff._graphSetup(1, 1, 1, 0);
}
eff._graphType = "effect";
if (isDefined(go)) {
Rhombus.Util.numberifyOutputs(go);
eff._graphOutputs = go;
}
if (isDefined(gi)) {
Rhombus.Util.numberifyInputs(gi);
eff._graphInputs = gi;
}
var that = this;
var effects = this._song._effects;
this.Undo._addUndoAction(function() {
delete effects[eff._id];
});
effects[eff._id] = eff;
return eff._id;
};
/**
* Removes the effect with the given id from the current song.
* The master effect cannot be removed.
*
* @param {Rhombus.Effect|Number} effectOrId The effect to remove, or its id.
* @returns {Boolean} true if the effect was in the song, false otherwise
*/
Rhombus.prototype.removeEffect = function(effectOrId) {
function inToId(effectOrId) {
var id;
if (typeof effectOrId === "object") {
id = effectOrId._id;
} else {
id = +effectOrId;
}
return id;
}
var id = inToId(effectOrId);
if (id < 0) {
return;
}
var effect = this._song._effects[id];
if (effect.isMaster()) {
return;
}
var gi = effect.graphInputs();
var go = effect.graphOutputs();
var that = this;
this.Undo._addUndoAction(function() {
that._song._effects[id] = effect;
effect._restoreConnections(go, gi);
});
effect._removeConnections();
delete this._song._effects[id];
// exercise the nuclear option
this.killAllNotes();
};
Rhombus._makeEffectMap = function(obj) {
var newObj = {};
for (var key in obj) {
newObj[key] = obj[key];
}
newObj["dry/wet"] = [Rhombus._map.mapIdentity, Rhombus._map.rawDisplay, 1.0];
newObj["gain"] = [Rhombus._map.mapLinear(0, 2), Rhombus._map.rawDisplay, 1.0/2.0];
newObj = Rhombus._makeAudioNodeMap(newObj);
return newObj;
};
Rhombus._addEffectFunctions = function(ctr) {
function normalizedObjectSet(params, internal) {
if (notObject(params)) {
return;
}
if (!internal) {
var that = this;
var oldParams = this._currentParams;
this._r.Undo._addUndoAction(function() {
that._normalizedObjectSet(oldParams, true);
});
}
this._trackParams(params);
var unnormalized = Rhombus._map.unnormalizedParams(params, this._unnormalizeMap, true);
this.set(unnormalized);
}
/**
* @returns {Boolean} true if this effect is the master effect, false otherwise.
* @memberof Rhombus.Effect.prototype
*/
function isMaster() {
return false;
}
function toJSON(params) {
var jsonVersion = {
"_id": this._id,
"_type": this._type,
"_params": this._currentParams,
"_graphOutputs": this._graphOutputs,
"_graphInputs": this._graphInputs,
"_graphX": this._graphX,
"_graphY": this._graphY
};
if (isDefined(this._code)) {
jsonVersion._code = this._code;
}
return jsonVersion;
}
ctr.prototype._normalizedObjectSet = normalizedObjectSet;
Rhombus._addParamFunctions(ctr);
Rhombus._addGraphFunctions(ctr);
Rhombus._addAudioNodeFunctions(ctr);
ctr.prototype.toJSON = toJSON;
ctr.prototype.isMaster = isMaster;
// Swizzle out the set method for one that does gain + dry/wet.
var oldSet = ctr.prototype.set;
ctr.prototype.set = function(options) {
oldSet.apply(this, arguments);
if (isDefined(options)) {
if (isDefined(options.gain)) {
this.output.gain.value = options.gain;
}
if (isDefined(options["dry/wet"])) {
this.setWet(options["dry/wet"]);
}
}
};
ctr.prototype._setAutomationValueAtTime = function(value, time) {
var base = this._currentParams.gain;
var finalNormalized = this._getAutomationModulatedValue(base, value);
var finalVal = this._unnormalizeMap.gain[0](finalNormalized);
this.output.gain.setValueAtTime(finalVal, time);
}
};
| {
"content_hash": "b6734b6f2ba50b4322809f35ca828e2a",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 129,
"avg_line_length": 24.935606060606062,
"alnum_prop": 0.6257025672185933,
"repo_name": "soundsplosion/Rhombus",
"id": "1a36f492b07a23fec340f50f211c673a64488ee4",
"size": "6583",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/rhombus.effect.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5264"
},
{
"name": "JavaScript",
"bytes": "746244"
},
{
"name": "Shell",
"bytes": "390"
}
],
"symlink_target": ""
} |
<?php
/**
* community event api actions.
*
* @package OpenPNE
* @subpackage communityEventCommentActions
* @author Shunsuke Watanabe <watanabe@craftgear.net>
* @author tatsuya ichikawa <ichikawa@tejimaya.com>
*/
class communityEventCommentActions extends opJsonApiActions
{
public function preExecute()
{
parent::preExecute();
$this->member = $this->getUser()->getMember();
}
public function executeSearch(sfWebRequest $request)
{
$this->forward400If('' === (string)$request['community_event_id'], 'community_event_id parameter is not specified.');
$event = Doctrine::getTable('CommunityEvent')->findOneById($request['community_event_id']);
$event->actAs('opIsCreatableCommunityTopicBehavior');
$this->forward400If(false === $event->isViewableCommunityTopic($event->getCommunity(), $this->member->getId()), 'you are not allowed to view this event and comments on this community');
$limit = isset($request['count']) ? $request['count'] : sfConfig::get('op_json_api_limit', 15);
$query = Doctrine::getTable('CommunityEventComment')->createQuery('c')
->where('community_event_id = ?', $event->getId())
->orderBy('created_at desc')
->limit($limit);
if(isset($request['max_id']))
{
$query->addWhere('id <= ?', $request['max_id']);
}
if(isset($request['since_id']))
{
$query->addWhere('id > ?', $request['since_id']);
}
$this->memberId = $this->getUser()->getMemberId();
$this->comments = $query->execute();
}
public function executePost(sfWebRequest $request)
{
$this->forward400If('' === (string)$request['community_event_id'], 'community_event_id parameter is not specified.');
$this->forward400If('' === (string)$request['body'], 'body parameter is not specified.');
$comment = new CommunityEventComment();
$comment->setMemberId($this->member->getId());
$comment->setCommunityEventId($request['community_event_id']);
$this->forward400If(false === $comment->getCommunityEvent()->isCreatableCommunityEventComment($this->member->getId()), 'you are not allowed to create comments on this event');
$comment->setBody($request['body']);
$comment->save();
$this->memberId = $this->getUser()->getMemberId();
$this->comment = $comment;
}
public function executeDelete(sfWebRequest $request)
{
$id = $request['id'];
$this->forward400If('' === (string)$id, 'id parameter is not specified.');
$comment = Doctrine::getTable('CommunityEventComment')->findOneById($id);
$this->forward400If(false === $comment, 'the comment does not exist. id:'.$id);
$this->forward400If(false === $comment->isDeletable($this->member->getId()), 'you can not delete this comment. id:'.$id);
$isDeleted = $comment->delete();
if ($isDeleted)
{
$this->comment = $comment;
}
else
{
$this->forward400('failed to delete the comment. errorStack:'.$comment->getErrorStackAsString());
}
}
}
| {
"content_hash": "147e354e001ecf478b42ad8fa2301bd7",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 189,
"avg_line_length": 33.355555555555554,
"alnum_prop": 0.6515656229180546,
"repo_name": "tejima/opCommunityTopicPlugin",
"id": "c6f6e6e5bd110bbc652b7dc27a59cd19805830ac",
"size": "3253",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "apps/api/modules/communityEventComment/actions/actions.class.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2545"
},
{
"name": "PHP",
"bytes": "436220"
}
],
"symlink_target": ""
} |
using System;
using System.Security.Authentication;
namespace AlexPilotti.FTPS.Common
{
public enum ETransferMode { ASCII, Binary }
public enum ETextEncoding { ASCII, UTF8 }
public class FTPReply
{
private int code;
private string message;
public int Code
{
get { return code; }
set { code = value; }
}
public string Message
{
get { return message; }
set { message = value; }
}
public override string ToString()
{
return string.Format("{0} {1}", Code, Message);
}
}
public class DirectoryListItem
{
private string flags;
private string owner;
private string group;
private bool isDirectory;
private bool isSymLink;
private string name;
private ulong size;
private DateTime creationTime;
private string symLinkTargetPath;
public ulong Size
{
get { return size; }
set { size = value; }
}
public string SymLinkTargetPath
{
get { return symLinkTargetPath; }
set { symLinkTargetPath = value; }
}
public string Flags
{
get { return flags; }
set { flags = value; }
}
public string Owner
{
get { return owner; }
set { owner = value; }
}
public string Group
{
get { return group; }
set { group = value; }
}
public bool IsDirectory
{
get { return isDirectory; }
set { isDirectory = value; }
}
public bool IsSymLink
{
get { return isSymLink; }
set { isSymLink = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public DateTime CreationTime
{
get { return creationTime; }
set { creationTime = value; }
}
}
/// <summary>
/// Encapsulates the SSL/TLS algorithms connection information.
/// </summary>
public class SslInfo
{
SslProtocols sslProtocol;
CipherAlgorithmType cipherAlgorithm;
int cipherStrength;
HashAlgorithmType hashAlgorithm;
int hashStrength;
ExchangeAlgorithmType keyExchangeAlgorithm;
int keyExchangeStrength;
public SslProtocols SslProtocol
{
get { return sslProtocol; }
set { sslProtocol = value; }
}
public CipherAlgorithmType CipherAlgorithm
{
get { return cipherAlgorithm; }
set { cipherAlgorithm = value; }
}
public int CipherStrength
{
get { return cipherStrength; }
set { cipherStrength = value; }
}
public HashAlgorithmType HashAlgorithm
{
get { return hashAlgorithm; }
set { hashAlgorithm = value; }
}
public int HashStrength
{
get { return hashStrength; }
set { hashStrength = value; }
}
public ExchangeAlgorithmType KeyExchangeAlgorithm
{
get { return keyExchangeAlgorithm; }
set { keyExchangeAlgorithm = value; }
}
public int KeyExchangeStrength
{
get { return keyExchangeStrength; }
set { keyExchangeStrength = value; }
}
public override string ToString()
{
return SslProtocol.ToString() + ", " +
CipherAlgorithm.ToString() + " (" + cipherStrength.ToString() + " bit), " +
KeyExchangeAlgorithm.ToString() + " (" + keyExchangeStrength.ToString() + " bit), " +
HashAlgorithm.ToString() + " (" + hashStrength.ToString() + " bit)";
}
}
public class LogCommandEventArgs : EventArgs
{
public LogCommandEventArgs(string commandText)
: base()
{
this.CommandText = commandText;
}
public string CommandText { get; private set; }
}
public class LogServerReplyEventArgs : EventArgs
{
public LogServerReplyEventArgs(FTPReply serverReply)
: base()
{
this.ServerReply = serverReply;
}
public FTPReply ServerReply { get; private set; }
}
}
| {
"content_hash": "13529ebc8e7d3fe87bf7a171919a948d",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 104,
"avg_line_length": 23.857894736842105,
"alnum_prop": 0.5193028899183764,
"repo_name": "udotdevelopment/ATSPM",
"id": "b91b119adfed2e36cad5ecf050ec5349942427ff",
"size": "5331",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "FTPSClient/FTPSClient/Common.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "507"
},
{
"name": "C#",
"bytes": "6376155"
},
{
"name": "CSS",
"bytes": "120997"
},
{
"name": "HTML",
"bytes": "931688"
},
{
"name": "JavaScript",
"bytes": "818463"
},
{
"name": "Rich Text Format",
"bytes": "40945"
},
{
"name": "TSQL",
"bytes": "51043"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
World Register of Marine Species
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "eb01cbc5df6070a7c2e7e8f20f41d2db",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 32,
"avg_line_length": 9.76923076923077,
"alnum_prop": 0.7007874015748031,
"repo_name": "mdoering/backbone",
"id": "212fbc56142279d12a3ed8c62a4bbd19e28b8161",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bacillariophyta/Bacillariophyceae/Radiopalma/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace StartupDelayer
{
class DelayedProgram
{
public string Name { get; set; }
public int Delay { get; set; }
private string _path;
public string Path
{
get { return _path; }
set
{
value.Trim();
if(value[0] == '\"')
value = value.Remove(0, 1);
if(value[value.Length - 1] == '\"')
value = value.Remove(value.Length - 1);
_path = value;
}
}
public DelayedProgram(string name, string path, int delay)
{
this.Name = name;
this.Path = path;
this.Delay = delay;
}
/// <summary>
/// Copy Constructor
/// </summary>
/// <param name="prog"></param>
public DelayedProgram(DelayedProgram prog)
{
this.Name = prog.Name;
this.Path = prog.Path;
this.Delay = prog.Delay;
}
/// <summary>
/// Constructor to deserialize this object
/// </summary>
/// <param name="serialized">Serialized values of this object</param>
public DelayedProgram(string serialized)
{
Regex matcher = new Regex("^<(.*)><(.*)><([0-9]*)>;$", RegexOptions.IgnoreCase);
Match match = matcher.Match(serialized);
if(match.Success)
{
this.Name = match.Groups[1].Value;
this.Path = match.Groups[2].Value;
this.Delay = Convert.ToInt32(match.Groups[3].Value);
}
}
/// <summary>
/// Returns the 'serialized' representation of this object
/// </summary>
/// <returns></returns>
public string GetSerialized()
{
return "<" + this.Name + "><" + this.Path + "><" + this.Delay + ">;";
}
}
} | {
"content_hash": "71691b4179f5c09d337a1b4d61a73d8f",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 92,
"avg_line_length": 29.643835616438356,
"alnum_prop": 0.47088724584103514,
"repo_name": "CapCalamity/StartupDelayer",
"id": "8c1d4e33eaa998c9baa67f7f3da81a0cc9f02127",
"size": "2166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "StartupDelayer/DelayedProgram.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "17108"
}
],
"symlink_target": ""
} |
#include "common.h"
uint32_t libhashkit_one_at_a_time(const char *key, size_t key_length)
{
return hashkit_one_at_a_time(key, key_length, NULL);
}
uint32_t libhashkit_fnv1_64(const char *key, size_t key_length)
{
return hashkit_fnv1_64(key, key_length, NULL);
}
uint32_t libhashkit_fnv1a_64(const char *key, size_t key_length)
{
return hashkit_fnv1a_64(key, key_length, NULL);
}
uint32_t libhashkit_fnv1_32(const char *key, size_t key_length)
{
return hashkit_fnv1_32(key, key_length, NULL);
}
uint32_t libhashkit_fnv1a_32(const char *key, size_t key_length)
{
return hashkit_fnv1a_32(key, key_length, NULL);
}
uint32_t libhashkit_fnv1a_compat(const char *key, size_t key_length)
{
return hashkit_fnv1a_compat(key, key_length, NULL);
}
uint32_t libhashkit_crc32(const char *key, size_t key_length)
{
return hashkit_crc32(key, key_length, NULL);
}
#ifdef HAVE_HSIEH_HASH
uint32_t libhashkit_hsieh(const char *key, size_t key_length)
{
return hashkit_hsieh(key, key_length, NULL);
}
#endif
uint32_t libhashkit_murmur(const char *key, size_t key_length)
{
return hashkit_murmur(key, key_length, NULL);
}
uint32_t libhashkit_jenkins(const char *key, size_t key_length)
{
return hashkit_jenkins(key, key_length, NULL);
}
uint32_t libhashkit_md5(const char *key, size_t key_length)
{
return hashkit_md5(key, key_length, NULL);
}
void libhashkit_md5_signature(const unsigned char *key, size_t length, unsigned char *result)
{
md5_signature(key, (uint32_t)length, result);
}
| {
"content_hash": "674d162555c74d66eaa5e5e6f33b7de9",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 93,
"avg_line_length": 22.818181818181817,
"alnum_prop": 0.7197875166002656,
"repo_name": "dpaneda/libmemcached",
"id": "9cdec7110ebc79f3489e5510fe6c74612fc527cb",
"size": "1705",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libhashkit/algorithm.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1148065"
},
{
"name": "C++",
"bytes": "59929"
},
{
"name": "D",
"bytes": "923"
},
{
"name": "Objective-C",
"bytes": "19031"
},
{
"name": "Perl",
"bytes": "123973"
},
{
"name": "Python",
"bytes": "25472"
},
{
"name": "Shell",
"bytes": "295121"
}
],
"symlink_target": ""
} |
"""async14tcpserver.py: TCP Echo server protocol
Usage:
async14tcpserver.py
"""
import asyncio
async def handle_echo(reader, writer):
data = await reader.read(100)
message = data.decode()
addr = writer.get_extra_info('peername')
print(f"Received {message} from {addr}")
print(f"Send: {message}", flush=True)
writer.write(data)
await writer.drain()
print("Close the client socket", flush=True)
writer.close()
def main():
loop = asyncio.get_event_loop()
coro = asyncio.start_server(handle_echo, '127.0.0.1', 8888, loop=loop)
server = loop.run_until_complete(coro)
# Serve requests until Ctrl+C is pressed
print(f'Serving on {server.sockets[0].getsockname()}', flush=True)
try:
loop.run_forever()
except KeyboardInterrupt:
pass
# Close the server
server.close()
loop.run_until_complete(server.wait_closed())
loop.close()
if __name__ == '__main__':
main()
| {
"content_hash": "55ab822066ca0d7363c9bae8d4735cc5",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 24.075,
"alnum_prop": 0.6479750778816199,
"repo_name": "showa-yojyo/bin",
"id": "8f3e3a42c243e7a74f515e2bd4e1f6159e3bcd2a",
"size": "985",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "async/async14tcpserver.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "298627"
},
{
"name": "Shell",
"bytes": "1566"
}
],
"symlink_target": ""
} |
export declare function memoize(target: any, name: any, descriptor: any): void;
export declare function memoizeall(target: any): any;
| {
"content_hash": "c6c82dea15a92e64722b7075c0a8d281",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 79,
"avg_line_length": 67,
"alnum_prop": 0.7761194029850746,
"repo_name": "pskhodad/mathmate-templates",
"id": "75e84b8c87c86496478757dc953a7887646948a6",
"size": "134",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dist/decorators/memoize.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "TypeScript",
"bytes": "27896"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types = 1);
namespace WebHemi\Data\Entity;
use WebHemi\DateTime;
/**
* Class FilesystemMetaEntity
*/
class FilesystemMetaEntity extends AbstractEntity
{
/**
* @var array
*/
protected $container = [
'id_filesystem_meta' => null,
'fk_filesystem' => null,
'meta_key' => null,
'meta_data' => null,
'date_created' => null,
'date_modified' => null,
];
/**
* @param int $identifier
* @return FilesystemMetaEntity
*/
public function setFilesystemrMetaId(int $identifier) : FilesystemMetaEntity
{
$this->container['id_filesystem_meta'] = $identifier;
return $this;
}
/**
* @return int|null
*/
public function getFilesystemMetaId() : ? int
{
return !is_null($this->container['id_filesystem_meta'])
? (int) $this->container['id_filesystem_meta']
: null;
}
/**
* @param int $userIdentifier
* @return FilesystemMetaEntity
*/
public function setFilesystemId(int $userIdentifier) : FilesystemMetaEntity
{
$this->container['fk_filesystem'] = $userIdentifier;
return $this;
}
/**
* @return int|null
*/
public function getFilesystemId() : ? int
{
return !is_null($this->container['fk_filesystem'])
? (int) $this->container['fk_filesystem']
: null;
}
/**
* @param string $metaKey
* @return FilesystemMetaEntity
*/
public function setMetaKey(string $metaKey) : FilesystemMetaEntity
{
$this->container['meta_key'] = $metaKey;
return $this;
}
/**
* @return null|string
*/
public function getMetaKey() : ? string
{
return $this->container['meta_key'];
}
/**
* @param string $metaData
* @return FilesystemMetaEntity
*/
public function setMetaData(string $metaData) : FilesystemMetaEntity
{
$this->container['meta_data'] = $metaData;
return $this;
}
/**
* @return null|string
*/
public function getMetaData() : ? string
{
return $this->container['meta_data'];
}
/**
* @param DateTime $dateTime
* @return FilesystemMetaEntity
*/
public function setDateCreated(DateTime $dateTime) : FilesystemMetaEntity
{
$this->container['date_created'] = $dateTime->format('Y-m-d H:i:s');
return $this;
}
/**
* @return null|DateTime
*/
public function getDateCreated() : ? DateTime
{
return !empty($this->container['date_created'])
? new DateTime($this->container['date_created'])
: null;
}
/**
* @param DateTime $dateTime
* @return FilesystemMetaEntity
*/
public function setDateModified(DateTime $dateTime) : FilesystemMetaEntity
{
$this->container['date_modified'] = $dateTime->format('Y-m-d H:i:s');
return $this;
}
/**
* @return null|DateTime
*/
public function getDateModified() : ? DateTime
{
return !empty($this->container['date_modified'])
? new DateTime($this->container['date_modified'])
: null;
}
}
| {
"content_hash": "c0665cc42691cb39717c2aeed5c7dd00",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 80,
"avg_line_length": 22.224489795918366,
"alnum_prop": 0.5613712886440159,
"repo_name": "Gixx/WebHemi",
"id": "7e494e5b1a810e59a609d4908a97111e6ff1f69f",
"size": "3480",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/WebHemi/Data/Entity/FilesystemMetaEntity.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21370"
},
{
"name": "HTML",
"bytes": "83237"
},
{
"name": "JavaScript",
"bytes": "90842"
},
{
"name": "PHP",
"bytes": "847577"
},
{
"name": "PLpgSQL",
"bytes": "39602"
},
{
"name": "Shell",
"bytes": "13810"
}
],
"symlink_target": ""
} |
package org.vasttrafik.wso2.carbon.community.api.model;
import java.io.Serializable;
/**
* Java bean for 'Category' entity
*
* @author Lars Andersson
*
*/
public final class CategoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------
// ENTITY PRIMARY KEY ( BASED ON A SINGLE FIELD )
//----------------------------------------------------------------------
// DB : com_id int identity
private Integer id;
//----------------------------------------------------------------------
// ENTITY DATA FIELDS
//----------------------------------------------------------------------
// DB : com_name varchar
private String name;
// DB : com_image_url varchar
private String imageUrl;
// DB : com_is_public tinyint
private Boolean isPublic;
// DB : com_num_forums
private Integer numForums;
//----------------------------------------------------------------------
// GETTER & SETTER FOR THE KEY FIELD
//----------------------------------------------------------------------
public void setId( Integer id ) {
this.id = id ;
}
public Integer getId() {
return this.id;
}
//----------------------------------------------------------------------
// GETTERS & SETTERS FOR FIELDS
//----------------------------------------------------------------------
/**
* Sets the name value
* @param name The value to set.
*/
public void setName( String name ) {
this.name = name;
}
/**
* Retrieves the name value
* @return The name value.
*/
public String getName() {
return this.name;
}
/**
* Sets the imageUrl value
* @param imageUrl The value to set.
*/
public void setImageUrl( String imageUrl ) {
this.imageUrl = imageUrl;
}
/**
* Retrieves the imageUrl value
* @return The imageUrl value.
*/
public String getImageUrl() {
return this.imageUrl;
}
public Boolean getIsPublic() {
return isPublic;
}
public void setIsPublic(Boolean isPublic) {
this.isPublic = isPublic;
}
public Integer getNumForums() {
return numForums;
}
public void setNumForums(Integer numForums) {
this.numForums = numForums;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(id);
sb.append("|");
sb.append(name);
sb.append("|");
sb.append(isPublic);
sb.append("|");
sb.append(imageUrl);
sb.append("|");
sb.append(numForums);
return sb.toString();
}
}
| {
"content_hash": "55f011ca1e7175b12e6c08f633771cb3",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 80,
"avg_line_length": 25.10091743119266,
"alnum_prop": 0.45796783625730997,
"repo_name": "vasttrafik/wso2-community-api",
"id": "dc6750fb2821f948964989eaa6c1764492861489",
"size": "2736",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/src/main/java/org/vasttrafik/wso2/carbon/community/api/model/CategoryDTO.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "621760"
},
{
"name": "TSQL",
"bytes": "3232"
}
],
"symlink_target": ""
} |
package org.apache.camel.component.lucene.springboot;
import org.apache.camel.component.lucene.LuceneConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* To insert or query from Apache Lucene databases.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@ConfigurationProperties(prefix = "camel.component.lucene")
public class LuceneComponentConfiguration {
/**
* To use a shared lucene configuration
*/
private LuceneConfiguration config;
public LuceneConfiguration getConfig() {
return config;
}
public void setConfig(LuceneConfiguration config) {
this.config = config;
}
} | {
"content_hash": "beb10fc2e76bd6c1204211227ddf16ad",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 25.962962962962962,
"alnum_prop": 0.7360912981455064,
"repo_name": "jmandawg/camel",
"id": "cd514f7d97cf0b33e0fd292ddbb77d0ddedb3b3d",
"size": "1504",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "components/camel-lucene/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentConfiguration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "106"
},
{
"name": "CSS",
"bytes": "30373"
},
{
"name": "Eagle",
"bytes": "2898"
},
{
"name": "Elm",
"bytes": "5970"
},
{
"name": "FreeMarker",
"bytes": "11410"
},
{
"name": "Groovy",
"bytes": "53008"
},
{
"name": "HTML",
"bytes": "177803"
},
{
"name": "Java",
"bytes": "53296685"
},
{
"name": "JavaScript",
"bytes": "90232"
},
{
"name": "Protocol Buffer",
"bytes": "578"
},
{
"name": "Python",
"bytes": "36"
},
{
"name": "Ruby",
"bytes": "4802"
},
{
"name": "Scala",
"bytes": "322615"
},
{
"name": "Shell",
"bytes": "18818"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "284394"
}
],
"symlink_target": ""
} |
const DrawCard = require('../../drawcard.js');
class Yoren extends DrawCard {
setupCardAbilities() {
this.reaction({
when: {
onCardEntersPlay: event => event.card === this && event.playingType === 'marshal'
},
target: {
cardCondition: card => card.location === 'discard pile' && card.getType() === 'character' && card.owner !== this.controller && card.getCost() <= 3 && this.controller.canPutIntoPlay(card)
},
handler: context => {
this.controller.putIntoPlay(context.target);
this.game.addMessage('{0} uses {1} to put {2} into play from {3}\'s discard pile under their control', this.controller, this, context.target, context.target.owner);
}
});
}
}
Yoren.code = '01129';
module.exports = Yoren;
| {
"content_hash": "3da7f3aebd52eef6979a69b29498675d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 202,
"avg_line_length": 39.13636363636363,
"alnum_prop": 0.562137049941928,
"repo_name": "cryogen/gameteki",
"id": "ba00b3cd3e54099841731a51932f6017fe35e011",
"size": "861",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "server/game/cards/01-Core/Yoren.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "32422"
},
{
"name": "HTML",
"bytes": "1200"
},
{
"name": "JavaScript",
"bytes": "2322467"
}
],
"symlink_target": ""
} |
//******************************************************************************************************
// AssemblyInfo.cs - Gbtc
//
// Copyright © 2013, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), 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.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 05/09/2013 - J. Ritchie Carroll
// Generated original version of source code.
//
//******************************************************************************************************
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WavSubscriptionDemo")]
[assembly: AssemblyDescription("WAV File Player GEP Subcription Demo")]
[assembly: AssemblyCompany("Grid Protection Alliance")]
[assembly: AssemblyProduct("Grid Solutions Framework")]
[assembly: AssemblyCopyright("Copyright © GPA, 2013. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug Build")]
#else
[assembly: AssemblyConfiguration("Release Build")]
#endif
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("2.2.72.0")]
[assembly: AssemblyVersion("2.2.72.0")]
[assembly: AssemblyFileVersion("2.2.72.0")]
[assembly: AssemblyInformationalVersion("2.2.72-beta")]
| {
"content_hash": "d774c9cdfe86f9c226aca2588ea6245e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 105,
"avg_line_length": 45.19512195121951,
"alnum_prop": 0.6894225580140313,
"repo_name": "rmc00/gsf",
"id": "ebd1ed4499aa307b1de3324781f84f4800bd2478",
"size": "3710",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Applications/Wave Demo Apps/WavSubscriptionDemo/Properties/AssemblyInfo.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "17182"
},
{
"name": "Batchfile",
"bytes": "8635"
},
{
"name": "C",
"bytes": "24478"
},
{
"name": "C#",
"bytes": "30052352"
},
{
"name": "C++",
"bytes": "135084"
},
{
"name": "CMake",
"bytes": "3519"
},
{
"name": "CSS",
"bytes": "4763"
},
{
"name": "HTML",
"bytes": "3914"
},
{
"name": "Java",
"bytes": "955418"
},
{
"name": "JavaScript",
"bytes": "1274735"
},
{
"name": "Objective-C",
"bytes": "173"
},
{
"name": "PLSQL",
"bytes": "107859"
},
{
"name": "PLpgSQL",
"bytes": "88792"
},
{
"name": "Pascal",
"bytes": "515"
},
{
"name": "SQLPL",
"bytes": "186015"
},
{
"name": "ShaderLab",
"bytes": "137"
},
{
"name": "Shell",
"bytes": "11035"
},
{
"name": "Smalltalk",
"bytes": "8510"
},
{
"name": "Visual Basic",
"bytes": "72875"
},
{
"name": "XSLT",
"bytes": "1070"
}
],
"symlink_target": ""
} |
function Task(gulp) {
/*
* Rutas
*/
var baseDirStatic = __dirname + "/../source/static";
var baseDirStylus = __dirname + "/../source/stylus";
var pathStaticDest = '../public/static';
/*
* npm dependientes
*/
var stylus = require('gulp-stylus'),
spritesmith = require("gulp.spritesmith"),
runSequence = require("run-sequence"),
argv = require('yargs').argv,
uglifycss = require('gulp-uglifycss'),
gulpif = require("gulp-if"),
merge = require('merge-stream'),
plumberNotifier = require("gulp-plumber-notifier");
/**
* Tarea para compilar sprites
* (gulp sprites:compile)
*/
gulp.task("sprites:compile", function () {
var spriteData = gulp.src(baseDirStatic + "/img/_sprites/main_sprite/*.png")
.pipe(spritesmith({
algorithm: "binary-tree",
imgPath : "../../img/main_sprite.png",
imgName : "main_sprite.png",
cssName : "main_sprite.styl"
}));
var imgStream = spriteData.img.pipe(gulp.dest(pathStaticDest + "/img"));
var cssStream = spriteData.css.pipe(gulp.dest(baseDirStylus + "/_config"));
return merge(imgStream, cssStream);
});
gulp.task('sprites', function(cb) {
return runSequence('sprites:compile', cb);
});
}
module.exports = Task; | {
"content_hash": "e51cac1c09a7246927c3f5e49c9ae0a7",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 30.108695652173914,
"alnum_prop": 0.5740072202166066,
"repo_name": "jjhoncv/dmv",
"id": "0fa73a18476a570a5a892e947ab10be0e1d59fa0",
"size": "1385",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/tasks/gulp-sprites.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "118"
},
{
"name": "CSS",
"bytes": "9726"
},
{
"name": "HTML",
"bytes": "27209"
},
{
"name": "JavaScript",
"bytes": "21369"
},
{
"name": "PHP",
"bytes": "58815"
}
],
"symlink_target": ""
} |
export * from './MasterDataService';
| {
"content_hash": "07c64f127f578b939bfd710ae841c44b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 36,
"avg_line_length": 37,
"alnum_prop": 0.7297297297297297,
"repo_name": "Clemens85/runningdinner",
"id": "7bb1ead37d8e1b30441bd091e74f6838b9452c55",
"size": "37",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "runningdinner-client/packages/shared/src/masterdata/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9964"
},
{
"name": "HTML",
"bytes": "220884"
},
{
"name": "Java",
"bytes": "1059912"
},
{
"name": "JavaScript",
"bytes": "915942"
},
{
"name": "Less",
"bytes": "18959"
},
{
"name": "Shell",
"bytes": "3096"
},
{
"name": "TypeScript",
"bytes": "656882"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>JtwigServlet</servlet-name>
<servlet-class>org.jtwig.example.HelloWorldServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JtwigServlet</servlet-name>
<url-pattern>/index</url-pattern>
</servlet-mapping>
</web-app> | {
"content_hash": "51b40038e063c0ffcdc2d51d31d7ac01",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 110,
"avg_line_length": 38.6,
"alnum_prop": 0.6545768566493955,
"repo_name": "lyncodev/jtwig-examples",
"id": "ff902d3d76eaab0f470befc76bec0bda58b3b5c6",
"size": "579",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "gradle-jtwig-web-simple/src/main/webapp/WEB-INF/web.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "520"
},
{
"name": "HTML",
"bytes": "7316"
},
{
"name": "Java",
"bytes": "35872"
},
{
"name": "JavaScript",
"bytes": "3080"
},
{
"name": "Shell",
"bytes": "1473"
},
{
"name": "TypeScript",
"bytes": "1310"
}
],
"symlink_target": ""
} |
This is just a Docker image builder to be used with the [PCF Tile Generator](https://github.com/cf-platform-eng/tile-generator).
## Copyright
Copyright (c) 2016 Pivotal Software Inc. See [LICENSE](https://github.com/cf-platform-eng/docker-tile-example/blob/master/LICENSE) for details.
| {
"content_hash": "f4ebf13b2b6bb139ac63b95352441280",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 143,
"avg_line_length": 57.6,
"alnum_prop": 0.7708333333333334,
"repo_name": "cf-platform-eng/docker-tile-example",
"id": "597eb2f81f88f729e4faed7c80d47df8d6d9f516",
"size": "379",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "436"
},
{
"name": "Shell",
"bytes": "886"
}
],
"symlink_target": ""
} |
A credit card validator for [Parsley.js](http://parsleyjs.org/) including validation for specific brands
# Brands Validation
This plugins offers validation for the following credit card brands:
* Amex
* China Union Pay
* Dankort
* Diners Club CarteBlanche
* Diners Club International
* Diners Club US & Canada
* Discover
* JCB
* Laser
* Maestro
* Mastercard
* Visa
* Visa Electron
# Usage
#### Credit Card Number
If you just want to check if the credit card number is valid, simply add the **data-parsley-creditcard** attribute to your input:
`<input required="required" data-parsley-creditcard="" type="tel">`
#### Credit Card Number for specific brands
If you want to check if the credit card number is valid and also check if is for a specific brand, simply add the **data-parsley-creditcard** attribute to your input with the value as the allowed brands, separeted with commas:
`<input required="required" data-parsley-creditcard="visa,mastercard" type="tel">`
#### Card CVC
To validate the card cvc code, add the **data-parsley-cvv** attribute to your input:
`<input required="required" data-parsley-cvv="" type="tel">`
#### Card Expiry Date
To validate the card expiry date, add the **data-parsley-expirydate** attribute to your input:
`<input required="required" data-parsley-expirydate="" type="tel">`
| {
"content_hash": "1c87b9576e581c745c7585037b3ed95e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 226,
"avg_line_length": 33.8974358974359,
"alnum_prop": 0.7488653555219364,
"repo_name": "gpassarelli/parsley.js-credit-card-validator",
"id": "c960822031d9d9fc2774c5cc0f5d1af500ad7673",
"size": "1359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import {isIE10} from './setup';
import * as assert from 'assert';
import isolate from '@cycle/isolate';
import xs, {Stream, MemoryStream} from 'xstream';
import delay from 'xstream/extra/delay';
import concat from 'xstream/extra/concat';
import {setup, run as cycleRun} from '@cycle/run';
const Snabbdom = require('snabbdom-pragma');
import {
h,
svg,
div,
thunk,
span,
h2,
h3,
h4,
button,
select,
option,
p,
makeDOMDriver,
DOMSource,
MainDOMSource,
VNode,
} from '../../src/index';
declare global {
namespace JSX {
interface Element extends VNode {} // tslint:disable-line
interface IntrinsicElements {
[elemName: string]: any;
}
}
}
function createRenderTarget(id: string | null = null) {
const element = document.createElement('div');
element.className = 'cycletest';
if (id) {
element.id = id;
}
document.body.appendChild(element);
return element;
}
describe('DOM Rendering', function() {
it('should render DOM elements even when DOMSource is not utilized', function(done) {
function main() {
return {
DOM: xs.of(
div('.my-render-only-container', [h2('Cycle.js framework')])
),
};
}
cycleRun(main, {
DOM: makeDOMDriver(createRenderTarget()),
});
setTimeout(() => {
const myContainer = document.querySelector(
'.my-render-only-container'
) as HTMLElement;
assert.notStrictEqual(myContainer, null);
assert.notStrictEqual(typeof myContainer, 'undefined');
assert.strictEqual(myContainer.tagName, 'DIV');
const header = myContainer.querySelector('h2') as HTMLElement;
assert.notStrictEqual(header, null);
assert.notStrictEqual(typeof header, 'undefined');
assert.strictEqual(header.textContent, 'Cycle.js framework');
done();
}, 150);
});
it('should support snabbdom dataset module by default', function(done) {
const thisBrowserSupportsDataset =
typeof document.createElement('DIV').dataset !== 'undefined';
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(
div('.my-class', {
dataset: {foo: 'Foo'},
})
),
};
}
if (!thisBrowserSupportsDataset) {
done();
} else {
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const elem = root.querySelector('.my-class') as HTMLElement;
assert.notStrictEqual(elem, null);
assert.notStrictEqual(typeof elem, 'undefined');
assert.strictEqual(elem.tagName, 'DIV');
assert.strictEqual(elem.dataset.foo, 'Foo');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
}
});
it('should render in a DocumentFragment as container', function(done) {
if (isIE10) {
done();
return;
}
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(
select('.my-class', [
option({attrs: {value: 'foo'}}, 'Foo'),
option({attrs: {value: 'bar'}}, 'Bar'),
option({attrs: {value: 'baz'}}, 'Baz'),
])
),
};
}
const docfrag = document.createDocumentFragment();
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(docfrag),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const selectEl = root.querySelector('.my-class') as HTMLElement;
assert.notStrictEqual(selectEl, null);
assert.notStrictEqual(typeof selectEl, 'undefined');
assert.strictEqual(selectEl.tagName, 'SELECT');
const options = selectEl.querySelectorAll('option');
assert.strictEqual(options.length, 3);
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
it('should convert a simple virtual-dom <select> to DOM element', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(
select('.my-class', [
option({attrs: {value: 'foo'}}, 'Foo'),
option({attrs: {value: 'bar'}}, 'Bar'),
option({attrs: {value: 'baz'}}, 'Baz'),
])
),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const selectEl = root.querySelector('.my-class') as HTMLElement;
assert.notStrictEqual(selectEl, null);
assert.notStrictEqual(typeof selectEl, 'undefined');
assert.strictEqual(selectEl.tagName, 'SELECT');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
it('should convert a simple virtual-dom <select> (JSX) to DOM element', function(done) {
function app(_sources: {DOM: DOMSource}) {
return {
DOM: xs.of(
<select className="my-class">
<option value="foo">Foo</option>
<option value="bar">Bar</option>
<option value="baz">Baz</option>
</select>
),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const selectEl = root.querySelector('.my-class') as HTMLSelectElement;
assert.notStrictEqual(selectEl, null);
assert.notStrictEqual(typeof selectEl, 'undefined');
assert.strictEqual(selectEl.tagName, 'SELECT');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
it('should reuse existing DOM tree under the given root element', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(
select('.my-class', [
option({attrs: {value: 'foo'}}, 'Foo'),
option({attrs: {value: 'bar'}}, 'Bar'),
option({attrs: {value: 'baz'}}, 'Baz'),
])
),
};
}
// Create DOM tree with 2 <option>s under <select>
const rootElem = createRenderTarget();
const selectElem = document.createElement('SELECT');
selectElem.className = 'my-class';
rootElem.appendChild(selectElem);
const optionElem1 = document.createElement('OPTION');
optionElem1.setAttribute('value', 'foo');
optionElem1.textContent = 'Foo';
selectElem.appendChild(optionElem1);
const optionElem2 = document.createElement('OPTION');
optionElem2.setAttribute('value', 'bar');
optionElem2.textContent = 'Bar';
selectElem.appendChild(optionElem2);
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(rootElem),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
assert.strictEqual(root.childNodes.length, 1);
const selectEl = root.childNodes[0] as HTMLElement;
assert.strictEqual(selectEl.tagName, 'SELECT');
assert.strictEqual(selectEl.childNodes.length, 3);
const option1 = selectEl.childNodes[0] as HTMLElement;
const option2 = selectEl.childNodes[1] as HTMLElement;
const option3 = selectEl.childNodes[2] as HTMLElement;
assert.strictEqual(option1.tagName, 'OPTION');
assert.strictEqual(option2.tagName, 'OPTION');
assert.strictEqual(option3.tagName, 'OPTION');
assert.strictEqual(option1.textContent, 'Foo');
assert.strictEqual(option2.textContent, 'Bar');
assert.strictEqual(option3.textContent, 'Baz');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
it('should give elements as a value-over-time', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.merge(xs.of(h2('.value-over-time', 'Hello test')), xs.never()),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
let firstSubscriberRan = false;
let secondSubscriberRan = false;
const element$ = sources.DOM.select(':root').element();
element$
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
assert.strictEqual(firstSubscriberRan, false);
firstSubscriberRan = true;
const header = root.querySelector('.value-over-time') as HTMLElement;
assert.notStrictEqual(header, null);
assert.notStrictEqual(typeof header, 'undefined');
assert.strictEqual(header.tagName, 'H2');
},
});
setTimeout(() => {
// This samples the element$ after 400ms, and should synchronously get
// some element into the subscriber.
assert.strictEqual(secondSubscriberRan, false);
element$.take(1).addListener({
next: (root: Element) => {
assert.strictEqual(secondSubscriberRan, false);
secondSubscriberRan = true;
const header = root.querySelector('.value-over-time') as HTMLElement;
assert.notStrictEqual(header, null);
assert.notStrictEqual(typeof header, 'undefined');
assert.strictEqual(header.tagName, 'H2');
setTimeout(() => {
dispose();
done();
});
},
});
assert.strictEqual(secondSubscriberRan, true);
}, 400);
dispose = run();
});
it('should have DevTools flag in elements source stream', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.merge(xs.of(h2('.value-over-time', 'Hello test')), xs.never()),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
const element$ = sources.DOM.select(':root').elements();
assert.strictEqual((element$ as any)._isCycleSource, 'DOM');
done();
});
it('should have DevTools flag in element source stream', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.merge(xs.of(h2('.value-over-time', 'Hello test')), xs.never()),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
const element$ = sources.DOM.select(':root').element();
assert.strictEqual((element$ as any)._isCycleSource, 'DOM');
done();
});
it('should allow snabbdom Thunks in the VTree', function(done) {
function renderThunk(greeting: string) {
return h4('Constantly ' + greeting);
}
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs
.periodic(10)
.take(5)
.map(i => div([thunk('h4', 'key1', renderThunk, ['hello' + 0])])),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const h4Elem = root.querySelector('h4') as HTMLElement;
assert.notStrictEqual(h4Elem, null);
assert.notStrictEqual(typeof h4Elem, 'undefined');
assert.strictEqual(h4Elem.tagName, 'H4');
assert.strictEqual(h4Elem.textContent, 'Constantly hello0');
dispose();
done();
},
});
dispose = run();
});
it('should render embedded HTML within SVG <foreignObject>', function(done) {
const thisBrowserSupportsForeignObject = (document as any).implementation.hasFeature(
'www.http://w3.org/TR/SVG11/feature#Extensibility',
'1.1'
);
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(
svg({attrs: {width: 150, height: 50}}, [
svg.foreignObject({attrs: {width: '100%', height: '100%'}}, [
p('.embedded-text', 'This is HTML embedded in SVG'),
]),
])
),
};
}
if (!thisBrowserSupportsForeignObject) {
done();
} else {
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const embeddedHTML = root.querySelector(
'p.embedded-text'
) as HTMLElement;
assert.strictEqual(
embeddedHTML.namespaceURI,
'http://www.w3.org/1999/xhtml'
);
assert.notStrictEqual(embeddedHTML.clientWidth, 0);
assert.notStrictEqual(embeddedHTML.clientHeight, 0);
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
}
});
it('should filter out null/undefined children', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs
.periodic(10)
.take(5)
.map(i =>
div('.parent', [
'Child 1',
null,
h4('.child3', [
null,
'Grandchild 31',
div('.grandchild32', [null, 'Great grandchild 322']),
]),
undefined,
])
),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const divParent = root.querySelector('div.parent') as HTMLElement;
const h4Child = root.querySelector('h4.child3') as HTMLElement;
const grandchild = root.querySelector(
'div.grandchild32'
) as HTMLElement;
assert.strictEqual(divParent.childNodes.length, 2);
assert.strictEqual(h4Child.childNodes.length, 2);
assert.strictEqual(grandchild.childNodes.length, 1);
dispose();
done();
},
});
dispose = run();
});
it('should render correctly even if hyperscript-helper first is empty string', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(h4('', {}, ['Hello world'])),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const H4 = root.querySelector('h4') as HTMLElement;
assert.strictEqual(H4.textContent, 'Hello world');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
it('should render textContent "0" given hyperscript content value number 0', function(done) {
function app(_sources: {DOM: MainDOMSource}) {
return {
DOM: xs.of(div('.my-class', 0)),
};
}
const {sinks, sources, run} = setup(app, {
DOM: makeDOMDriver(createRenderTarget()),
});
let dispose: any;
sources.DOM.select(':root')
.element()
.drop(1)
.take(1)
.addListener({
next: (root: Element) => {
const divEl = root.querySelector('.my-class') as HTMLElement;
assert.strictEqual(divEl.textContent, '0');
setTimeout(() => {
dispose();
done();
});
},
});
dispose = run();
});
});
| {
"content_hash": "557f2916e34efc880a8eb979c3eee253",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 97,
"avg_line_length": 28.54922279792746,
"alnum_prop": 0.5514821536600121,
"repo_name": "staltz/cycle",
"id": "fc43564dc9608b1821a9a6b638e6e9ccd5073658",
"size": "16530",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "dom/test/browser/render.tsx",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "462"
},
{
"name": "JavaScript",
"bytes": "13795"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "a6ad29ad0ea953461a78d5024c4ea890",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "08873d2a08e55a0880bc7158e1d99e6df63579c9",
"size": "180",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Urticaceae/Elatostema/Elatostema ambiguum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#ifndef __G_SIMPLE_IO_STREAM_H__
#define __G_SIMPLE_IO_STREAM_H__
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
#error "Only <gio/gio.h> can be included directly."
#endif
#include <gio/giotypes.h>
#include <gio/giostream.h>
G_BEGIN_DECLS
#define G_TYPE_SIMPLE_IO_STREAM (g_simple_io_stream_get_type ())
#define G_SIMPLE_IO_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_SIMPLE_IO_STREAM, GSimpleIOStream))
#define G_IS_SIMPLE_IO_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_SIMPLE_IO_STREAM))
GLIB_AVAILABLE_IN_2_44
GType g_simple_io_stream_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_44
GIOStream *g_simple_io_stream_new (GInputStream *input_stream,
GOutputStream *output_stream);
G_END_DECLS
#endif /* __G_SIMPLE_IO_STREAM_H__ */
| {
"content_hash": "5d4f96dac52128fdd7665acf9cc6e5e7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 127,
"avg_line_length": 33.535714285714285,
"alnum_prop": 0.597444089456869,
"repo_name": "BigBoss424/portfolio",
"id": "37919d32f52a42a22d71acd485c2d0e9d673b08d",
"size": "1722",
"binary": false,
"copies": "15",
"ref": "refs/heads/master",
"path": "v8/development/node_modules/favicons/node_modules/sharp/vendor/include/glib-2.0/gio/gsimpleiostream.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ar" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About TacoCoin</source>
<translation>عن TacoCoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>TacoCoin</b> version</source>
<translation>نسخة <b>TacoCoin</b></translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Litecoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>دفتر العناوين</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>أنقر على الماوس مرتين لتعديل عنوان</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>قم بعمل عنوان جديد</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>قم بنسخ القوانين المختارة لحافظة النظام</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your TacoCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a TacoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified TacoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&أمسح</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your TacoCoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR TACOCOINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-56"/>
<source>TacoCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your tacocoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Show information about TacoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a TacoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for TacoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>TacoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About TacoCoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your TacoCoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified TacoCoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>TacoCoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Litecoin network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid TacoCoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Litecoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid TacoCoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>TacoCoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Litecoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Litecoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Litecoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the Litecoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Litecoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show TacoCoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Litecoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Litecoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start tacocoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Litecoin-Qt help message to get a list with possible Litecoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>TacoCoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>TacoCoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the Litecoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Litecoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a TacoCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this TacoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified TacoCoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a TacoCoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter Litecoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Litecoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>TacoCoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or tacocoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: tacocoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: tacocoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9333 or testnet: 19333)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=tacocoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Litecoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Litecoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Litecoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Litecoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Litecoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Litecoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Litecoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | {
"content_hash": "d8028b9249c10c5ddb8f4bbd50be176e",
"timestamp": "",
"source": "github",
"line_count": 2917,
"max_line_length": 395,
"avg_line_length": 33.44154953719575,
"alnum_prop": 0.5877558970363612,
"repo_name": "ImYourVirus/TacoCoin",
"id": "c9bc717fc81abc4a80f9db1aa46ea5d84e01e508",
"size": "97649",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_ar.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "103297"
},
{
"name": "C++",
"bytes": "2512795"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "IDL",
"bytes": "14634"
},
{
"name": "Objective-C",
"bytes": "5864"
},
{
"name": "Python",
"bytes": "69714"
},
{
"name": "Shell",
"bytes": "9702"
},
{
"name": "TypeScript",
"bytes": "5236417"
}
],
"symlink_target": ""
} |
package com.hackoeur.jglm;
import com.hackoeur.jglm.support.FastMath;
/**
* Utility methods that replace OpenGL and GLU matrix functions there were
* deprecated in GL 3.0.
*
* @author James Royalty
*/
public final class Matrices {
/**
* Creates a perspective projection matrix using field-of-view and
* aspect ratio to determine the left, right, top, bottom planes. This
* method is analogous to the now deprecated {@code gluPerspective} method.
*
* @param fovy field of view angle, in degrees, in the {@code y} direction
* @param aspect aspect ratio that determines the field of view in the x
* direction. The aspect ratio is the ratio of {@code x} (width) to
* {@code y} (height).
* @param zNear near plane distance from the viewer to the near clipping plane (always positive)
* @param zFar far plane distance from the viewer to the far clipping plane (always positive)
* @return
*/
public static final Mat4 perspective(final float fovy, final float aspect, final float zNear, final float zFar) {
final float halfFovyRadians = (float) FastMath.toRadians( (fovy / 2.0f) );
final float range = (float) FastMath.tan(halfFovyRadians) * zNear;
final float left = -range * aspect;
final float right = range * aspect;
final float bottom = -range;
final float top = range;
return new Mat4(
(2f * zNear) / (right - left), 0f, 0f, 0f,
0f, (2f * zNear) / (top - bottom), 0f, 0f,
0f, 0f, -(zFar + zNear) / (zFar - zNear), -1f,
0f, 0f, -(2f * zFar * zNear) / (zFar - zNear), 0f
);
}
/**
* Creates a perspective projection matrix (frustum) using explicit
* values for all clipping planes. This method is analogous to the now
* deprecated {@code glFrustum} method.
*
* @param left left vertical clipping plane
* @param right right vertical clipping plane
* @param bottom bottom horizontal clipping plane
* @param top top horizontal clipping plane
* @param nearVal distance to the near depth clipping plane (must be positive)
* @param farVal distance to the far depth clipping plane (must be positive)
* @return
*/
public static final Mat4 frustum(final float left, final float right, final float bottom, final float top, final float nearVal, final float farVal) {
final float m00 = (2f * nearVal) / (right - left);
final float m11 = (2f * nearVal) / (top - bottom);
final float m20 = (right + left) / (right - left);
final float m21 = (top + bottom) / (top - bottom);
final float m22 = -(farVal + nearVal) / (farVal - nearVal);
final float m23 = -1f;
final float m32 = -(2f * farVal * nearVal) / (farVal - nearVal);
return new Mat4(
m00, 0f, 0f, 0f,
0f, m11, 0f, 0f,
m20, m21, m22, m23,
0f, 0f, m32, 0f
);
}
/**
* Defines a viewing transformation. This method is analogous to the now
* deprecated {@code gluLookAt} method.
*
* @param eye position of the eye point
* @param center position of the reference point
* @param up direction of the up vector
* @return
*/
public static final Mat4 lookAt(final Vec3 eye, final Vec3 center, final Vec3 up) {
final Vec3 f = center.subtract(eye).getUnitVector();
Vec3 u = up.getUnitVector();
final Vec3 s = f.cross(u).getUnitVector();
u = s.cross(f);
return new Mat4(
s.x, u.x, -f.x, 0f,
s.y, u.y, -f.y, 0f,
s.z, u.z, -f.z, 0f,
-s.dot(eye), -u.dot(eye), f.dot(eye), 1f
);
}
/**
* Creates an orthographic projection matrix. This method is analogous to the now
* deprecated {@code glOrtho} method.
*
* @param left left vertical clipping plane
* @param right right vertical clipping plane
* @param bottom bottom horizontal clipping plane
* @param top top horizontal clipping plane
* @param zNear distance to nearer depth clipping plane (negative if the plane is to be behind the viewer)
* @param zFar distance to farther depth clipping plane (negative if the plane is to be behind the viewer)
* @return
*/
public static final Mat4 ortho(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
final float m00 = 2f / (right - left);
final float m11 = 2f / (top - bottom);
final float m22 = -2f / (zFar - zNear);
final float m30 = - (right + left) / (right - left);
final float m31 = - (top + bottom) / (top - bottom);
final float m32 = - (zFar + zNear) / (zFar - zNear);
return new Mat4(
m00, 0f, 0f, 0f,
0f, m11, 0f, 0f,
0f, 0f, m22, 0f,
m30, m31, m32, 1f
);
}
/**
* Creates a 2D orthographic projection matrix. This method is analogous to the now
* deprecated {@code gluOrtho2D} method.
*
* @param left left vertical clipping plane
* @param right right vertical clipping plane
* @param bottom bottom horizontal clipping plane
* @param top top horizontal clipping plane
* @return
*/
public static final Mat4 ortho2d(final float left, final float right, final float bottom, final float top) {
final float m00 = 2f / (right - left);
final float m11 = 2f / (top - bottom);
final float m22 = -1f;
final float m30 = - (right + left) / (right - left);
final float m31 = - (top + bottom) / (top - bottom);
return new Mat4(
m00, 0f, 0f, 0f,
0f, m11, 0f, 0f,
0f, 0f, m22, 0f,
m30, m31, 0f, 1f
);
}
/**
* Creates a rotation matrix for the given angle (in rad) around the given
* axis.
*
* @param phi The angle (in rad).
* @param axis The axis to rotate around. Must be a unit-axis.
* @return This matrix, rotated around the given axis.
*/
public static Mat4 rotate(final float phi, final Vec3 axis) {
double rcos = FastMath.cos(phi);
double rsin = FastMath.sin(phi);
float x = axis.x;
float y = axis.y;
float z = axis.z;
Vec4 v1 = new Vec4((float) (rcos + x * x * (1 - rcos)), (float) (z * rsin + y * x * (1 - rcos)), (float) (-y * rsin + z * x * (1 - rcos)), 0);
Vec4 v2 = new Vec4((float) (-z * rsin + x * y * (1 - rcos)), (float) (rcos + y * y * (1 - rcos)), (float) (x * rsin + z * y * (1 - rcos)), 0);
Vec4 v3 = new Vec4((float) (y * rsin + x * z * (1 - rcos)), (float) (-x * rsin + y * z * (1 - rcos)), (float) (rcos + z * z * (1 - rcos)), 0);
Vec4 v4 = new Vec4(0, 0, 0, 1);
return new Mat4(v1, v2, v3, v4);
}
public static Mat4 invert(final Mat4 matrix){
final float a[][] = new float[][]{{matrix.m00, matrix.m10, matrix.m20, matrix.m30},
{matrix.m01, matrix.m11, matrix.m21, matrix.m31},
{matrix.m02, matrix.m12, matrix.m22, matrix.m32},
{matrix.m03, matrix.m13, matrix.m23, matrix.m33}};
final int n = 4;
float[][] inverted = invert(a,
n);
return new Mat4(inverted[0][0], inverted[1][0], inverted[2][0], inverted[3][0],
inverted[0][1], inverted[1][1], inverted[2][1], inverted[3][1],
inverted[0][2], inverted[1][2], inverted[2][2], inverted[3][2],
inverted[0][3], inverted[1][3], inverted[2][3], inverted[3][3]);
}
public static Mat3 invert(final Mat3 matrix){
final float a[][] = new float[][]{{matrix.m00, matrix.m10, matrix.m20},
{matrix.m01, matrix.m11, matrix.m21},
{matrix.m02, matrix.m12, matrix.m22}};
final int n = 3;
float[][] inverted = invert(a,
n);
return new Mat3(inverted[0][0], inverted[1][0], inverted[2][0],
inverted[0][1], inverted[1][1], inverted[2][1],
inverted[0][2], inverted[1][2], inverted[2][2]);
}
private static float[][] invert(final float[][] a,
final int n){
float x[][] = new float[n][n];
float b[][] = new float[n][n];
int index[] = new int[n];
for (int i = 0; i < n; ++i) {
b[i][i] = 1;
}
// Transform the a into an upper triangle
gaussian(a, index);
// Update the a b[i][j] with the ratios stored
for (int i = 0; i < n - 1; ++i){
for (int j = i + 1; j < n; ++j){
for (int k = 0; k < n; ++k){
b[index[j]][k] -= a[index[j]][i] * b[index[i]][k];
}
}
}
// Perform backward substitutions
for (int i = 0; i < n; ++i){
x[n - 1][i] = b[index[n - 1]][i] / a[index[n - 1]][n - 1];
for (int j = n - 2; j >= 0; --j){
x[j][i] = b[index[j]][i];
for (int k = j + 1; k < n; ++k){
x[j][i] -= a[index[j]][k] * x[k][i];
}
x[j][i] /= a[index[j]][j];
}
}
return x;
}
// Method to carry out the partial-pivoting Gaussian
// elimination. Here index[] stores pivoting order.
private static void gaussian(float a[][],
int index[]) {
int n = index.length;
float c[] = new float[n];
// Initialize the index
for (int i = 0; i < n; ++i) {
index[i] = i;
}
// Find the rescaling factors, one from each row
for (int i = 0; i < n; ++i){
float c1 = 0;
for (int j = 0; j < n; ++j){
float c0 = Math.abs(a[i][j]);
if (c0 > c1) {
c1 = c0;
}
}
c[i] = c1;
}
// Search the pivoting element from each column
int k = 0;
for (int j = 0; j < n - 1; ++j){
float pi1 = 0;
for (int i = j; i < n; ++i){
float pi0 = Math.abs(a[index[i]][j]);
pi0 /= c[index[i]];
if (pi0 > pi1) {
pi1 = pi0;
k = i;
}
}
// Interchange rows according to the pivoting order
int itmp = index[j];
index[j] = index[k];
index[k] = itmp;
for (int i = j + 1; i < n; ++i){
float pj = a[index[i]][j] / a[index[j]][j];
// Record pivoting ratios below the diagonal
a[index[i]][j] = pj;
// Modify other elements accordingly
for (int l = j + 1; l < n; ++l){
a[index[i]][l] -= pj * a[index[j]][l];
}
}
}
}
} | {
"content_hash": "dba373cd668a8d154275c5036d01506f",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 150,
"avg_line_length": 33.704626334519574,
"alnum_prop": 0.6034209692746278,
"repo_name": "jroyalty/jglm",
"id": "695022db48afdfcf9df478b99b80f087c7d294be",
"size": "10074",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/hackoeur/jglm/Matrices.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "493615"
}
],
"symlink_target": ""
} |
package io.openshift.appdev.missioncontrol.service.github.impl.kohsuke;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Logger;
import io.openshift.appdev.missioncontrol.service.github.api.GitHubRepository;
import org.kohsuke.github.GHRepository;
/**
* Kohsuke implementation of a {@link GitHubRepository}
*
* @author <a href="mailto:alr@redhat.com">Andrew Lee Rubinger</a>
*/
class KohsukeGitHubRepositoryImpl implements GitHubRepository {
/**
* Creates a new instance with the specified, required delegate
*
* @param repository
*/
KohsukeGitHubRepositoryImpl(final GHRepository repository) {
assert repository != null : "repository must be specified";
this.delegate = repository;
}
private final GHRepository delegate;
private Logger log = Logger.getLogger(KohsukeGitHubRepositoryImpl.class.getName());
/**
* {@inheritDoc}
*/
@Override
public String getFullName() {
return delegate.getFullName();
}
/**
* {@inheritDoc}
*/
@Override
public URI getHomepage() {
try {
return delegate.getHtmlUrl().toURI();
} catch (final URISyntaxException urise) {
throw new InvalidPathException("GitHub Homepage URL can't be represented as URI", urise);
}
}
@Override
public URI getGitCloneUri() {
try {
return new URI(delegate.gitHttpTransportUrl());
} catch (URISyntaxException e) {
throw new RuntimeException("Exception occurred while trying to get the clone URL for repo '" + delegate.getFullName() + "'", e);
}
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return delegate.getDescription();
}
}
| {
"content_hash": "193c9e5218c7be9bd82d694dc431a45e",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 140,
"avg_line_length": 26.573529411764707,
"alnum_prop": 0.6508024349750968,
"repo_name": "redhat-developer-tooling/katapult",
"id": "479e966c8a846806ed1b2ec57bfbc270eb70a4b6",
"size": "1807",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "services/github-service-impl/src/main/java/io/openshift/appdev/missioncontrol/service/github/impl/kohsuke/KohsukeGitHubRepositoryImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "8687"
}
],
"symlink_target": ""
} |
module DataCleaningAlgorithmsHelper
end
| {
"content_hash": "db805ed6c52f085273f171db34260c7d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 35,
"avg_line_length": 20,
"alnum_prop": 0.925,
"repo_name": "JiroKokubunji/orchestra",
"id": "3be29602583b26e38d416fb18d28b8bf92f4b8bc",
"size": "40",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/helpers/data_cleaning_algorithms_helper.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4143"
},
{
"name": "CoffeeScript",
"bytes": "1055"
},
{
"name": "HTML",
"bytes": "29746"
},
{
"name": "JavaScript",
"bytes": "4441"
},
{
"name": "Ruby",
"bytes": "66559"
}
],
"symlink_target": ""
} |
package scouter.client.popup;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import scouter.client.Images;
import scouter.client.xlog.views.XLogViewPainter;
import scouter.util.CastUtil;
public class XLogYValueMaxDialog {
private final Display display;
private Shell dialog;
Text maxValue;
XLogViewPainter viewPainter;
public XLogYValueMaxDialog(Display display, XLogViewPainter viewPainter) {
this.display = display;
this.viewPainter = viewPainter;
}
public void show() {
dialog = setDialogLayout();
dialog.pack();
Rectangle rect = dialog.getBounds ();
Point cursorLocation = Display.getCurrent().getCursorLocation();
dialog.setLocation (cursorLocation.x - (rect.width / 2), cursorLocation.y - (rect.height / 2));
dialog.open();
}
public void show(final String date) {
dialog = setDialogLayout();
dialog.pack();
// POSITION SETTING - SCREEN CENTER
Monitor primaryMonitor = display.getPrimaryMonitor ();
Rectangle bounds = primaryMonitor.getBounds ();
Rectangle rect = dialog.getBounds ();
int x = bounds.x + (bounds.width - rect.width) / 2 ;
int y = bounds.y + (bounds.height - rect.height) / 2 ;
dialog.setLocation (x, y);
dialog.open();
}
public void close(){
if(!dialog.isDisposed()){
dialog.dispose();
dialog = null;
}
}
private Shell setDialogLayout() {
final Shell dialog = new Shell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
dialog.setText("Set Max Value");
GridLayout gridLayout = new GridLayout(3, false);
gridLayout.verticalSpacing = 8;
dialog.setLayout(gridLayout);
Label label = new Label(dialog, SWT.NULL);
label.setText("Y axis max : ");
maxValue = new Text(dialog, SWT.SINGLE | SWT.BORDER);
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.widthHint = 100;
gridData.horizontalSpan = 2;
maxValue.setLayoutData(gridData);
maxValue.setText(CastUtil.cString(viewPainter.getYValue()));
maxValue.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
if(e.keyCode == 27){
close();
}
}
public void keyReleased(KeyEvent e) {}
});
Label warn = new Label(dialog, SWT.NULL);
warn.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
warn.setText("Max value > 0.05");
gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.horizontalAlignment = GridData.END;
warn.setLayoutData(gridData);
Button setValueBtn = new Button(dialog, SWT.PUSH);
setValueBtn.setText("Set value");
gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.horizontalAlignment = GridData.END;
setValueBtn.setLayoutData(gridData);
setValueBtn.addListener(SWT.Selection, new Listener(){
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Selection:
double newVal = CastUtil.cdouble(maxValue.getText());
if(newVal < 0.05){
newVal = 0.05;
}
viewPainter.setYValueMaxValue(newVal);
close();
break;
}
}
});
maxValue.selectAll();
dialog.setDefaultButton(setValueBtn);
return dialog;
}
}
| {
"content_hash": "161fadf1b364a63f540ccdef1b820815",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 100,
"avg_line_length": 29,
"alnum_prop": 0.677560473494596,
"repo_name": "TheOpenCloudEngine/scouter",
"id": "85d488530424024930038f984f94185939ce93c7",
"size": "4506",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "scouter.client/src/scouter/client/popup/XLogYValueMaxDialog.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "140"
},
{
"name": "HTML",
"bytes": "23338"
},
{
"name": "Java",
"bytes": "5344091"
},
{
"name": "Python",
"bytes": "57669"
},
{
"name": "Scala",
"bytes": "585521"
},
{
"name": "Shell",
"bytes": "426"
}
],
"symlink_target": ""
} |
require "spec_helper"
describe ActiveEnum::Storage::MemoryStore do
attr_accessor :store
class TestMemoryStoreEnum < ActiveEnum::Base; end
class TestOtherAREnum < ActiveEnum::Base; end
describe '#set' do
it 'should store value of id and name' do
store.set 1, 'test name'
store.values.should == [[1, 'test name']]
end
it 'should store value of id, name and meta hash' do
store.set 1, 'test name', :description => 'meta'
store.values.should == [[1, 'test name', {:description => 'meta'}]]
end
it 'should raise error if duplicate id' do
expect {
store.set 1, 'Name 1'
store.set 1, 'Other Name'
}.to raise_error(ActiveEnum::DuplicateValue)
end
it 'should raise error if duplicate name' do
expect {
store.set 1, 'Name 1'
store.set 2, 'Name 1'
}.to raise_error(ActiveEnum::DuplicateValue)
end
it 'should raise error if duplicate name matches title-case name' do
expect {
store.set 1, 'Name 1'
store.set 2, 'name 1'
}.to raise_error(ActiveEnum::DuplicateValue)
end
end
describe "#values" do
it 'should return array of stored values' do
store.set 1, 'Name 1'
store.values.should == [[1, 'Name 1']]
end
it 'should return values for set enum only' do
alt_store.set 1, 'Other Name 1'
store.set 1, 'Name 1'
store.values.should == [[1, 'Name 1']]
end
end
describe "#get_by_id" do
it 'should return the value for a given id' do
store.set 1, 'test name', :description => 'meta'
store.get_by_id(1).should == [1, 'test name', {:description => "meta"}]
end
it 'should return nil when id not found' do
store.get_by_id(1).should be_nil
end
end
describe "#get_by_name" do
it 'should return the value for a given name' do
store.set 1, 'test name'
store.get_by_name('test name').should == [1, 'test name']
end
it 'should return the value with title-cased name for a given lowercase name' do
store.set 1, 'Test Name'
store.get_by_name('test name').should == [1, 'Test Name']
end
it 'should return nil when name not found' do
store.get_by_name('test name').should be_nil
end
end
describe "#sort!" do
it 'should sort values ascending when passed :asc' do
@order = :asc
store.set 2, 'Name 2'
store.set 1, 'Name 1'
store.values.should == [[1,'Name 1'], [2, 'Name 2']]
end
it 'should sort values descending when passed :desc' do
@order = :desc
store.set 1, 'Name 1'
store.set 2, 'Name 2'
store.values.should == [[2, 'Name 2'], [1,'Name 1']]
end
it 'should not sort values when passed :natural' do
@order = :natural
store.set 1, 'Name 1'
store.set 3, 'Name 3'
store.set 2, 'Name 2'
store.values.should == [[1,'Name 1'], [3,'Name 3'], [2, 'Name 2']]
end
end
def store
@store ||= ActiveEnum::Storage::MemoryStore.new(TestMemoryStoreEnum, @order)
end
def alt_store
@alt_store ||= ActiveEnum::Storage::MemoryStore.new(TestOtherAREnum, :asc)
end
end
| {
"content_hash": "c51b10b43e81700828ea6a4b04bb09f7",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 84,
"avg_line_length": 27.95575221238938,
"alnum_prop": 0.6058879392212726,
"repo_name": "estum/active_enum",
"id": "638f962d6012b4fbecc1c674f1d77a72b5c37f12",
"size": "3159",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/active_enum/storage/memory_store_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "53407"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SignalGo.Drawing.Shapes
{
internal static class MatrixUtil
{
internal static void TransformRect(ref Rectangle rect, ref Matrix matrix)
{
if (rect.IsEmpty)
return;
MatrixTypes type = matrix._type;
if (type == MatrixTypes.TRANSFORM_IS_IDENTITY)
return;
if ((type & MatrixTypes.TRANSFORM_IS_SCALING) != MatrixTypes.TRANSFORM_IS_IDENTITY)
{
rect._x *= matrix._m11;
rect._y *= matrix._m22;
rect._width *= matrix._m11;
rect._height *= matrix._m22;
if (rect._width < 0.0)
{
rect._x += rect._width;
rect._width = -rect._width;
}
if (rect._height < 0.0)
{
rect._y += rect._height;
rect._height = -rect._height;
}
}
if ((type & MatrixTypes.TRANSFORM_IS_TRANSLATION) != MatrixTypes.TRANSFORM_IS_IDENTITY)
{
rect._x += matrix._offsetX;
rect._y += matrix._offsetY;
}
if (type != MatrixTypes.TRANSFORM_IS_UNKNOWN)
return;
Point point1 = matrix.Transform(rect.TopLeft);
Point point2 = matrix.Transform(rect.TopRight);
Point point3 = matrix.Transform(rect.BottomRight);
Point point4 = matrix.Transform(rect.BottomLeft);
rect._x = Math.Min(Math.Min(point1.X, point2.X), Math.Min(point3.X, point4.X));
rect._y = Math.Min(Math.Min(point1.Y, point2.Y), Math.Min(point3.Y, point4.Y));
rect._width = Math.Max(Math.Max(point1.X, point2.X), Math.Max(point3.X, point4.X)) - rect._x;
rect._height = Math.Max(Math.Max(point1.Y, point2.Y), Math.Max(point3.Y, point4.Y)) - rect._y;
}
internal static void MultiplyMatrix(ref Matrix matrix1, ref Matrix matrix2)
{
MatrixTypes type1 = matrix1._type;
MatrixTypes type2 = matrix2._type;
if (type2 == MatrixTypes.TRANSFORM_IS_IDENTITY)
return;
if (type1 == MatrixTypes.TRANSFORM_IS_IDENTITY)
matrix1 = matrix2;
else if (type2 == MatrixTypes.TRANSFORM_IS_TRANSLATION)
{
matrix1._offsetX += matrix2._offsetX;
matrix1._offsetY += matrix2._offsetY;
if (type1 == MatrixTypes.TRANSFORM_IS_UNKNOWN)
return;
matrix1._type |= MatrixTypes.TRANSFORM_IS_TRANSLATION;
}
else if (type1 == MatrixTypes.TRANSFORM_IS_TRANSLATION)
{
double offsetX = matrix1._offsetX;
double offsetY = matrix1._offsetY;
matrix1 = matrix2;
matrix1._offsetX = offsetX * matrix2._m11 + offsetY * matrix2._m21 + matrix2._offsetX;
matrix1._offsetY = offsetX * matrix2._m12 + offsetY * matrix2._m22 + matrix2._offsetY;
if (type2 == MatrixTypes.TRANSFORM_IS_UNKNOWN)
matrix1._type = MatrixTypes.TRANSFORM_IS_UNKNOWN;
else
matrix1._type = MatrixTypes.TRANSFORM_IS_TRANSLATION | MatrixTypes.TRANSFORM_IS_SCALING;
}
else
{
switch ((MatrixTypes)((int)type1 << 4) | type2)
{
case (MatrixTypes)34:
matrix1._m11 *= matrix2._m11;
matrix1._m22 *= matrix2._m22;
break;
case (MatrixTypes)35:
matrix1._m11 *= matrix2._m11;
matrix1._m22 *= matrix2._m22;
matrix1._offsetX = matrix2._offsetX;
matrix1._offsetY = matrix2._offsetY;
matrix1._type = MatrixTypes.TRANSFORM_IS_TRANSLATION | MatrixTypes.TRANSFORM_IS_SCALING;
break;
case (MatrixTypes)36:
case (MatrixTypes)52:
case (MatrixTypes)66:
case (MatrixTypes)67:
case (MatrixTypes)68:
matrix1 = new Matrix(matrix1._m11 * matrix2._m11 + matrix1._m12 * matrix2._m21, matrix1._m11 * matrix2._m12 + matrix1._m12 * matrix2._m22, matrix1._m21 * matrix2._m11 + matrix1._m22 * matrix2._m21, matrix1._m21 * matrix2._m12 + matrix1._m22 * matrix2._m22, matrix1._offsetX * matrix2._m11 + matrix1._offsetY * matrix2._m21 + matrix2._offsetX, matrix1._offsetX * matrix2._m12 + matrix1._offsetY * matrix2._m22 + matrix2._offsetY);
break;
case (MatrixTypes)50:
matrix1._m11 *= matrix2._m11;
matrix1._m22 *= matrix2._m22;
matrix1._offsetX *= matrix2._m11;
matrix1._offsetY *= matrix2._m22;
break;
case (MatrixTypes)51:
matrix1._m11 *= matrix2._m11;
matrix1._m22 *= matrix2._m22;
matrix1._offsetX = matrix2._m11 * matrix1._offsetX + matrix2._offsetX;
matrix1._offsetY = matrix2._m22 * matrix1._offsetY + matrix2._offsetY;
break;
}
}
}
internal static void PrependOffset(ref Matrix matrix, double offsetX, double offsetY)
{
if (matrix._type == MatrixTypes.TRANSFORM_IS_IDENTITY)
{
matrix = new Matrix(1.0, 0.0, 0.0, 1.0, offsetX, offsetY);
matrix._type = MatrixTypes.TRANSFORM_IS_TRANSLATION;
}
else
{
matrix._offsetX += matrix._m11 * offsetX + matrix._m21 * offsetY;
matrix._offsetY += matrix._m12 * offsetX + matrix._m22 * offsetY;
if (matrix._type == MatrixTypes.TRANSFORM_IS_UNKNOWN)
return;
matrix._type |= MatrixTypes.TRANSFORM_IS_TRANSLATION;
}
}
}
}
| {
"content_hash": "8ec1760a36f81328ab96598a31734271",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 453,
"avg_line_length": 46.97037037037037,
"alnum_prop": 0.5018135940703359,
"repo_name": "SignalGo/SignalGo-full-net",
"id": "befed231ece42eb32ed2beadf6d681be0b88d5e9",
"size": "6343",
"binary": false,
"copies": "1",
"ref": "refs/heads/netstandard",
"path": "SignalGo.Utilities/Drawing/Shapes/MatrixUtil.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1651376"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Application;
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\Config\FileLocator;
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
/**
* @author Paweł Jędrzejewski <pawel@sylius.org>
* @author Gonzalo Vilaseca <gvilaseca@reiss.co.uk>
*/
class Kernel extends HttpKernel
{
public const VERSION = '1.0.0';
public const VERSION_ID = '10000';
public const MAJOR_VERSION = '1';
public const MINOR_VERSION = '0';
public const RELEASE_VERSION = '0';
public const EXTRA_VERSION = '';
/**
* {@inheritdoc}
*/
public function registerBundles(): array
{
$bundles = [
new \Sylius\Bundle\OrderBundle\SyliusOrderBundle(),
new \Sylius\Bundle\MoneyBundle\SyliusMoneyBundle(),
new \Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle(),
new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(),
new \Sylius\Bundle\ProductBundle\SyliusProductBundle(),
new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(),
new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(),
new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(),
new \Sylius\Bundle\PaymentBundle\SyliusPaymentBundle(),
new \Sylius\Bundle\MailerBundle\SyliusMailerBundle(),
new \Sylius\Bundle\PromotionBundle\SyliusPromotionBundle(),
new \Sylius\Bundle\AddressingBundle\SyliusAddressingBundle(),
new \Sylius\Bundle\InventoryBundle\SyliusInventoryBundle(),
new \Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle(),
new \Sylius\Bundle\UserBundle\SyliusUserBundle(),
new \Sylius\Bundle\CustomerBundle\SyliusCustomerBundle(),
new \Sylius\Bundle\UiBundle\SyliusUiBundle(),
new \Sylius\Bundle\ReviewBundle\SyliusReviewBundle(),
new \Sylius\Bundle\CoreBundle\SyliusCoreBundle(),
new \Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
new \Sylius\Bundle\GridBundle\SyliusGridBundle(),
new \winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Symfony\Bundle\MonologBundle\MonologBundle(),
new \Symfony\Bundle\SecurityBundle\SecurityBundle(),
new \Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new \Symfony\Bundle\TwigBundle\TwigBundle(),
new \Sonata\CoreBundle\SonataCoreBundle(),
new \Sonata\BlockBundle\SonataBlockBundle(),
new \Sonata\IntlBundle\SonataIntlBundle(),
new \Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new \JMS\SerializerBundle\JMSSerializerBundle(),
new \FOS\RestBundle\FOSRestBundle(),
new \Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
new \Knp\Bundle\MenuBundle\KnpMenuBundle(),
new \Liip\ImagineBundle\LiipImagineBundle(),
new \Payum\Bundle\PayumBundle\PayumBundle(),
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new \WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new \Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new \Sylius\Bundle\FixturesBundle\SyliusFixturesBundle(),
new \Sylius\Bundle\PayumBundle\SyliusPayumBundle(), // must be added after PayumBundle.
new \Sylius\Bundle\ThemeBundle\SyliusThemeBundle(), // must be added after FrameworkBundle
new \Symfony\Bundle\WebServerBundle\WebServerBundle(), // allows to run build in web server. Not recommended for prod environment
];
if (in_array($this->getEnvironment(), ['dev', 'test', 'test_cached'], true)) {
$bundles[] = new \Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new \Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
}
return $bundles;
}
/**
* {@inheritdoc}
*/
protected function getContainerBaseClass(): string
{
if (in_array($this->getEnvironment(), ['test', 'test_cached'], true)) {
return MockerContainer::class;
}
return parent::getContainerBaseClass();
}
/**
* {@inheritdoc}
*/
protected function getContainerLoader(ContainerInterface $container): LoaderInterface
{
$locator = new FileLocator($this, $this->getRootDir() . '/Resources');
$resolver = new LoaderResolver([
new XmlFileLoader($container, $locator),
new YamlFileLoader($container, $locator),
new IniFileLoader($container, $locator),
new PhpFileLoader($container, $locator),
new DirectoryLoader($container, $locator),
new ClosureLoader($container),
]);
return new DelegatingLoader($resolver);
}
/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
$file = $this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.local.yml';
if (is_file($file)) {
$loader->load($file);
}
}
/**
* {@inheritdoc}
*/
public function getCacheDir(): string
{
if ($this->isVagrantEnvironment()) {
return '/dev/shm/sylius/cache/' . $this->getEnvironment();
}
return dirname($this->getRootDir()) . '/var/cache/' . $this->getEnvironment();
}
/**
* {@inheritdoc}
*/
public function getLogDir(): string
{
if ($this->isVagrantEnvironment()) {
return '/dev/shm/sylius/logs';
}
return dirname($this->getRootDir()) . '/var/logs';
}
/**
* @return bool
*/
protected function isVagrantEnvironment(): bool
{
return (getenv('HOME') === '/home/vagrant' || getenv('VAGRANT') === 'VAGRANT') && is_dir('/dev/shm');
}
}
| {
"content_hash": "d5e4d0ead2fe6a6f34d5a001fe339ac8",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 141,
"avg_line_length": 39.82222222222222,
"alnum_prop": 0.6602957589285714,
"repo_name": "rainlike/justshop",
"id": "d7f29d471cfb58338566260c5793be6c2da77937",
"size": "7381",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Application/Kernel.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1153"
},
{
"name": "CSS",
"bytes": "821"
},
{
"name": "HTML",
"bytes": "17134"
},
{
"name": "JavaScript",
"bytes": "1135"
},
{
"name": "PHP",
"bytes": "110346"
},
{
"name": "Shell",
"bytes": "400"
}
],
"symlink_target": ""
} |
namespace IronJS.Tests.UnitTests.Sputnik.Conformance.NativeECMAScriptObjects.TheMathObject.FunctionPropertiesOfTheMathObject
{
using System;
using NUnit.Framework;
[TestFixture]
public class RandomTests : SputnikTestFixture
{
public RandomTests()
: base(@"Conformance\15_Native_ECMA_Script_Objects\15.8_The_Math_Object\15.8.2_Function_Properties_of_the_Math_Object\15.8.2.14_random")
{
}
[Test]
[Category("Sputnik Conformance")]
[Category("ECMA 15.8.2.14")]
[TestCase("S15.8.2.14_A1.js", Description = "Math.random() returns a number value with positive sign, greater than or equal to 0 but less than 1")]
public void MathRandomReturnsANumberValueWithPositiveSignGreaterThanOrEqualTo0ButLessThan1(string file)
{
RunFile(file);
}
}
} | {
"content_hash": "670980d2033470af4c7123b35be2e4cf",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 155,
"avg_line_length": 37.47826086956522,
"alnum_prop": 0.6774941995359629,
"repo_name": "hnafar/IronJS",
"id": "516ba4898a4d0e73c6dd077a4cdbdc8e28ad161c",
"size": "884",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Src/Tests/UnitTests/Sputnik/Conformance/NativeECMAScriptObjects/TheMathObject/FunctionPropertiesOfTheMathObject/RandomTests.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "280"
},
{
"name": "C#",
"bytes": "2984769"
},
{
"name": "CSS",
"bytes": "1167"
},
{
"name": "F#",
"bytes": "353515"
},
{
"name": "HTML",
"bytes": "9405"
},
{
"name": "JavaScript",
"bytes": "19853921"
},
{
"name": "Python",
"bytes": "13630"
},
{
"name": "Shell",
"bytes": "1454"
}
],
"symlink_target": ""
} |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 24, 2016 at 08:39 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 7.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `design_aura`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(3) NOT NULL,
`first_name` varchar(25) NOT NULL,
`last_name` varchar(25) NOT NULL,
`email` varchar(255) NOT NULL,
`mobile1` varchar(15) NOT NULL,
`mobile2` varchar(15) NOT NULL,
`password` char(60) NOT NULL,
`role` char(5) NOT NULL,
`created_on` datetime NOT NULL,
`last_login` datetime NOT NULL,
`last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`account_status` char(1) NOT NULL DEFAULT '1',
`deleted` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `aura_admin_sessions`
--
CREATE TABLE `aura_admin_sessions` (
`id` varchar(40) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`timestamp` int(10) UNSIGNED NOT NULL DEFAULT '0',
`data` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `blogs`
--
CREATE TABLE `blogs` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(200) NOT NULL,
`body` longtext NOT NULL,
`author` varchar(30) NOT NULL,
`default_image` varchar(100) DEFAULT NULL,
`uploaded_by` int(11) NOT NULL,
`date_created` datetime NOT NULL,
`last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`published` char(1) NOT NULL DEFAULT '0',
`edited_after_published` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `bl_comments`
--
CREATE TABLE `bl_comments` (
`id` int(10) UNSIGNED NOT NULL,
`comment_body` text NOT NULL,
`username` varchar(20) DEFAULT NULL,
`blog_id` int(10) UNSIGNED NOT NULL,
`date_added` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `bl_replies`
--
CREATE TABLE `bl_replies` (
`id` int(10) UNSIGNED NOT NULL,
`reply_body` text NOT NULL,
`username` varchar(20) DEFAULT NULL,
`comment_id` int(10) UNSIGNED NOT NULL,
`date_added` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `projects`
--
CREATE TABLE `projects` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(50) NOT NULL,
`description` text,
`default_image` varchar(100) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`category_id` tinyint(4) NOT NULL,
`tags` varchar(50) DEFAULT NULL,
`date_created` datetime NOT NULL,
`last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pr_categories`
--
CREATE TABLE `pr_categories` (
`id` tinyint(4) NOT NULL,
`name` varchar(50) NOT NULL,
`date_added` datetime NOT NULL,
`added_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pr_comments`
--
CREATE TABLE `pr_comments` (
`id` int(10) UNSIGNED NOT NULL,
`comment_body` text NOT NULL,
`username` varchar(20) DEFAULT NULL,
`project_id` int(10) UNSIGNED NOT NULL,
`date_added` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pr_images`
--
CREATE TABLE `pr_images` (
`id` int(10) UNSIGNED NOT NULL,
`project_id` int(10) UNSIGNED NOT NULL,
`image_link` varchar(100) NOT NULL,
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pr_replies`
--
CREATE TABLE `pr_replies` (
`id` int(10) UNSIGNED NOT NULL,
`reply_body` text NOT NULL,
`username` varchar(20) DEFAULT NULL,
`comment_id` int(10) UNSIGNED NOT NULL,
`date_added` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pr_tags`
--
CREATE TABLE `pr_tags` (
`id` tinyint(4) NOT NULL,
`name` varchar(50) NOT NULL,
`date_added` datetime NOT NULL,
`added_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(25) NOT NULL,
`first_name` varchar(20) NOT NULL,
`last_name` varchar(20) NOT NULL,
`email` varchar(100) NOT NULL,
`profession` varchar(100) NOT NULL,
`mobile_1` varchar(15) NOT NULL,
`mobile_2` varchar(15) DEFAULT NULL,
`password` char(60) NOT NULL,
`logo` varchar(100) DEFAULT NULL,
`street` text,
`city` varchar(20) DEFAULT NULL,
`state` varchar(20) DEFAULT NULL,
`country` varchar(20) DEFAULT NULL,
`account_status` char(1) NOT NULL DEFAULT '1',
`signup_date` datetime NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`login_status` char(1) NOT NULL DEFAULT '0',
`last_login` datetime DEFAULT NULL,
`deleted` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `mobile1` (`mobile1`);
--
-- Indexes for table `aura_admin_sessions`
--
ALTER TABLE `aura_admin_sessions`
ADD KEY `ci_sessions_timestamp` (`timestamp`);
--
-- Indexes for table `blogs`
--
ALTER TABLE `blogs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `title` (`title`),
ADD KEY `uploaded_by` (`uploaded_by`);
--
-- Indexes for table `bl_comments`
--
ALTER TABLE `bl_comments`
ADD PRIMARY KEY (`id`),
ADD KEY `blog_id` (`blog_id`);
--
-- Indexes for table `bl_replies`
--
ALTER TABLE `bl_replies`
ADD PRIMARY KEY (`id`),
ADD KEY `comment_id` (`comment_id`);
--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
ADD PRIMARY KEY (`id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `category_id` (`category_id`);
--
-- Indexes for table `pr_categories`
--
ALTER TABLE `pr_categories`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`),
ADD KEY `added_by` (`added_by`);
--
-- Indexes for table `pr_comments`
--
ALTER TABLE `pr_comments`
ADD PRIMARY KEY (`id`),
ADD KEY `project_id` (`project_id`);
--
-- Indexes for table `pr_images`
--
ALTER TABLE `pr_images`
ADD PRIMARY KEY (`id`),
ADD KEY `project_id` (`project_id`);
--
-- Indexes for table `pr_replies`
--
ALTER TABLE `pr_replies`
ADD PRIMARY KEY (`id`),
ADD KEY `comment_id` (`comment_id`);
--
-- Indexes for table `pr_tags`
--
ALTER TABLE `pr_tags`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name` (`name`),
ADD KEY `added_by` (`added_by`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `mobile_1` (`mobile_1`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(3) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `blogs`
--
ALTER TABLE `blogs`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bl_comments`
--
ALTER TABLE `bl_comments`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bl_replies`
--
ALTER TABLE `bl_replies`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `projects`
--
ALTER TABLE `projects`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_categories`
--
ALTER TABLE `pr_categories`
MODIFY `id` tinyint(4) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_comments`
--
ALTER TABLE `pr_comments`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_images`
--
ALTER TABLE `pr_images`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_replies`
--
ALTER TABLE `pr_replies`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_tags`
--
ALTER TABLE `pr_tags`
MODIFY `id` tinyint(4) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `blogs`
--
ALTER TABLE `blogs`
ADD CONSTRAINT `blogs_ibfk_1` FOREIGN KEY (`uploaded_by`) REFERENCES `admin` (`id`);
--
-- Constraints for table `bl_comments`
--
ALTER TABLE `bl_comments`
ADD CONSTRAINT `bl_comments_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `bl_replies`
--
ALTER TABLE `bl_replies`
ADD CONSTRAINT `bl_replies_ibfk_1` FOREIGN KEY (`comment_id`) REFERENCES `bl_comments` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `projects`
--
ALTER TABLE `projects`
ADD CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `projects_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `pr_categories` (`id`);
--
-- Constraints for table `pr_categories`
--
ALTER TABLE `pr_categories`
ADD CONSTRAINT `pr_categories_ibfk_1` FOREIGN KEY (`added_by`) REFERENCES `admin` (`id`) ON DELETE NO ACTION;
--
-- Constraints for table `pr_comments`
--
ALTER TABLE `pr_comments`
ADD CONSTRAINT `pr_comments_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `pr_images`
--
ALTER TABLE `pr_images`
ADD CONSTRAINT `pr_images_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `pr_replies`
--
ALTER TABLE `pr_replies`
ADD CONSTRAINT `pr_replies_ibfk_1` FOREIGN KEY (`comment_id`) REFERENCES `pr_comments` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `pr_tags`
--
ALTER TABLE `pr_tags`
ADD CONSTRAINT `pr_tags_ibfk_1` FOREIGN KEY (`added_by`) REFERENCES `admin` (`id`) ON DELETE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| {
"content_hash": "1c648f309daccbbb505cbe04a1b37b04",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 114,
"avg_line_length": 26.532879818594104,
"alnum_prop": 0.6448166823348431,
"repo_name": "amirsanni/aura_admin",
"id": "22a9a920e8588f5ed81ec042e4a84a821309ee07",
"size": "11701",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "design_aura.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1252"
},
{
"name": "CSS",
"bytes": "156007"
},
{
"name": "HTML",
"bytes": "5764"
},
{
"name": "JavaScript",
"bytes": "124365"
},
{
"name": "PHP",
"bytes": "8541050"
}
],
"symlink_target": ""
} |
module Aws::CloudWatch
module Types
# Represents the history of a specific alarm.
#
# @!attribute [rw] alarm_name
# The descriptive name for the alarm.
# @return [String]
#
# @!attribute [rw] timestamp
# The time stamp for the alarm history item.
# @return [Time]
#
# @!attribute [rw] history_item_type
# The type of alarm history item.
# @return [String]
#
# @!attribute [rw] history_summary
# A summary of the alarm history, in text format.
# @return [String]
#
# @!attribute [rw] history_data
# Data about the alarm, in JSON format.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/AlarmHistoryItem AWS API Documentation
#
class AlarmHistoryItem < Struct.new(
:alarm_name,
:timestamp,
:history_item_type,
:history_summary,
:history_data)
include Aws::Structure
end
# Represents a specific dashboard.
#
# @!attribute [rw] dashboard_name
# The name of the dashboard.
# @return [String]
#
# @!attribute [rw] dashboard_arn
# The Amazon Resource Name (ARN) of the dashboard.
# @return [String]
#
# @!attribute [rw] last_modified
# The time stamp of when the dashboard was last modified, either by an
# API call or through the console. This number is expressed as the
# number of milliseconds since Jan 1, 1970 00:00:00 UTC.
# @return [Time]
#
# @!attribute [rw] size
# The size of the dashboard, in bytes.
# @return [Integer]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DashboardEntry AWS API Documentation
#
class DashboardEntry < Struct.new(
:dashboard_name,
:dashboard_arn,
:last_modified,
:size)
include Aws::Structure
end
# An error or warning for the operation.
#
# @!attribute [rw] data_path
# The data path related to the message.
# @return [String]
#
# @!attribute [rw] message
# A message describing the error or warning.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DashboardValidationMessage AWS API Documentation
#
class DashboardValidationMessage < Struct.new(
:data_path,
:message)
include Aws::Structure
end
# Encapsulates the statistical data that CloudWatch computes from metric
# data.
#
# @!attribute [rw] timestamp
# The time stamp used for the data point.
# @return [Time]
#
# @!attribute [rw] sample_count
# The number of metric values that contributed to the aggregate value
# of this data point.
# @return [Float]
#
# @!attribute [rw] average
# The average of the metric values that correspond to the data point.
# @return [Float]
#
# @!attribute [rw] sum
# The sum of the metric values for the data point.
# @return [Float]
#
# @!attribute [rw] minimum
# The minimum metric value for the data point.
# @return [Float]
#
# @!attribute [rw] maximum
# The maximum metric value for the data point.
# @return [Float]
#
# @!attribute [rw] unit
# The standard unit for the data point.
# @return [String]
#
# @!attribute [rw] extended_statistics
# The percentile statistic for the data point.
# @return [Hash<String,Float>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Datapoint AWS API Documentation
#
class Datapoint < Struct.new(
:timestamp,
:sample_count,
:average,
:sum,
:minimum,
:maximum,
:unit,
:extended_statistics)
include Aws::Structure
end
# @note When making an API call, you may pass DeleteAlarmsInput
# data as a hash:
#
# {
# alarm_names: ["AlarmName"], # required
# }
#
# @!attribute [rw] alarm_names
# The alarms to be deleted.
# @return [Array<String>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarmsInput AWS API Documentation
#
class DeleteAlarmsInput < Struct.new(
:alarm_names)
include Aws::Structure
end
# @note When making an API call, you may pass DeleteDashboardsInput
# data as a hash:
#
# {
# dashboard_names: ["DashboardName"], # required
# }
#
# @!attribute [rw] dashboard_names
# The dashboards to be deleted. This parameter is required.
# @return [Array<String>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboardsInput AWS API Documentation
#
class DeleteDashboardsInput < Struct.new(
:dashboard_names)
include Aws::Structure
end
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboardsOutput AWS API Documentation
#
class DeleteDashboardsOutput < Aws::EmptyStructure; end
# @note When making an API call, you may pass DescribeAlarmHistoryInput
# data as a hash:
#
# {
# alarm_name: "AlarmName",
# history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
# start_date: Time.now,
# end_date: Time.now,
# max_records: 1,
# next_token: "NextToken",
# }
#
# @!attribute [rw] alarm_name
# The name of the alarm.
# @return [String]
#
# @!attribute [rw] history_item_type
# The type of alarm histories to retrieve.
# @return [String]
#
# @!attribute [rw] start_date
# The starting date to retrieve alarm history.
# @return [Time]
#
# @!attribute [rw] end_date
# The ending date to retrieve alarm history.
# @return [Time]
#
# @!attribute [rw] max_records
# The maximum number of alarm history records to retrieve.
# @return [Integer]
#
# @!attribute [rw] next_token
# The token returned by a previous call to indicate that there is more
# data available.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryInput AWS API Documentation
#
class DescribeAlarmHistoryInput < Struct.new(
:alarm_name,
:history_item_type,
:start_date,
:end_date,
:max_records,
:next_token)
include Aws::Structure
end
# @!attribute [rw] alarm_history_items
# The alarm histories, in JSON format.
# @return [Array<Types::AlarmHistoryItem>]
#
# @!attribute [rw] next_token
# The token that marks the start of the next batch of returned
# results.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistoryOutput AWS API Documentation
#
class DescribeAlarmHistoryOutput < Struct.new(
:alarm_history_items,
:next_token)
include Aws::Structure
end
# @note When making an API call, you may pass DescribeAlarmsForMetricInput
# data as a hash:
#
# {
# metric_name: "MetricName", # required
# namespace: "Namespace", # required
# statistic: "SampleCount", # accepts SampleCount, Average, Sum, Minimum, Maximum
# extended_statistic: "ExtendedStatistic",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# period: 1,
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# }
#
# @!attribute [rw] metric_name
# The name of the metric.
# @return [String]
#
# @!attribute [rw] namespace
# The namespace of the metric.
# @return [String]
#
# @!attribute [rw] statistic
# The statistic for the metric, other than percentiles. For percentile
# statistics, use `ExtendedStatistics`.
# @return [String]
#
# @!attribute [rw] extended_statistic
# The percentile statistic for the metric. Specify a value between
# p0.0 and p100.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions associated with the metric. If the metric has any
# associated dimensions, you must specify them in order for the call
# to succeed.
# @return [Array<Types::Dimension>]
#
# @!attribute [rw] period
# The period, in seconds, over which the statistic is applied.
# @return [Integer]
#
# @!attribute [rw] unit
# The unit for the metric.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricInput AWS API Documentation
#
class DescribeAlarmsForMetricInput < Struct.new(
:metric_name,
:namespace,
:statistic,
:extended_statistic,
:dimensions,
:period,
:unit)
include Aws::Structure
end
# @!attribute [rw] metric_alarms
# The information for each alarm with the specified metric.
# @return [Array<Types::MetricAlarm>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsForMetricOutput AWS API Documentation
#
class DescribeAlarmsForMetricOutput < Struct.new(
:metric_alarms)
include Aws::Structure
end
# @note When making an API call, you may pass DescribeAlarmsInput
# data as a hash:
#
# {
# alarm_names: ["AlarmName"],
# alarm_name_prefix: "AlarmNamePrefix",
# state_value: "OK", # accepts OK, ALARM, INSUFFICIENT_DATA
# action_prefix: "ActionPrefix",
# max_records: 1,
# next_token: "NextToken",
# }
#
# @!attribute [rw] alarm_names
# The names of the alarms.
# @return [Array<String>]
#
# @!attribute [rw] alarm_name_prefix
# The alarm name prefix. If this parameter is specified, you cannot
# specify `AlarmNames`.
# @return [String]
#
# @!attribute [rw] state_value
# The state value to be used in matching alarms.
# @return [String]
#
# @!attribute [rw] action_prefix
# The action name prefix.
# @return [String]
#
# @!attribute [rw] max_records
# The maximum number of alarm descriptions to retrieve.
# @return [Integer]
#
# @!attribute [rw] next_token
# The token returned by a previous call to indicate that there is more
# data available.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsInput AWS API Documentation
#
class DescribeAlarmsInput < Struct.new(
:alarm_names,
:alarm_name_prefix,
:state_value,
:action_prefix,
:max_records,
:next_token)
include Aws::Structure
end
# @!attribute [rw] metric_alarms
# The information for the specified alarms.
# @return [Array<Types::MetricAlarm>]
#
# @!attribute [rw] next_token
# The token that marks the start of the next batch of returned
# results.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmsOutput AWS API Documentation
#
class DescribeAlarmsOutput < Struct.new(
:metric_alarms,
:next_token)
include Aws::Structure
end
# Expands the identity of a metric.
#
# @note When making an API call, you may pass Dimension
# data as a hash:
#
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# }
#
# @!attribute [rw] name
# The name of the dimension.
# @return [String]
#
# @!attribute [rw] value
# The value representing the dimension measurement.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Dimension AWS API Documentation
#
class Dimension < Struct.new(
:name,
:value)
include Aws::Structure
end
# Represents filters for a dimension.
#
# @note When making an API call, you may pass DimensionFilter
# data as a hash:
#
# {
# name: "DimensionName", # required
# value: "DimensionValue",
# }
#
# @!attribute [rw] name
# The dimension name to be matched.
# @return [String]
#
# @!attribute [rw] value
# The value of the dimension to be matched.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DimensionFilter AWS API Documentation
#
class DimensionFilter < Struct.new(
:name,
:value)
include Aws::Structure
end
# @note When making an API call, you may pass DisableAlarmActionsInput
# data as a hash:
#
# {
# alarm_names: ["AlarmName"], # required
# }
#
# @!attribute [rw] alarm_names
# The names of the alarms.
# @return [Array<String>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActionsInput AWS API Documentation
#
class DisableAlarmActionsInput < Struct.new(
:alarm_names)
include Aws::Structure
end
# @note When making an API call, you may pass EnableAlarmActionsInput
# data as a hash:
#
# {
# alarm_names: ["AlarmName"], # required
# }
#
# @!attribute [rw] alarm_names
# The names of the alarms.
# @return [Array<String>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActionsInput AWS API Documentation
#
class EnableAlarmActionsInput < Struct.new(
:alarm_names)
include Aws::Structure
end
# @note When making an API call, you may pass GetDashboardInput
# data as a hash:
#
# {
# dashboard_name: "DashboardName", # required
# }
#
# @!attribute [rw] dashboard_name
# The name of the dashboard to be described.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboardInput AWS API Documentation
#
class GetDashboardInput < Struct.new(
:dashboard_name)
include Aws::Structure
end
# @!attribute [rw] dashboard_arn
# The Amazon Resource Name (ARN) of the dashboard.
# @return [String]
#
# @!attribute [rw] dashboard_body
# The detailed information about the dashboard, including what widgets
# are included and their location on the dashboard. For more
# information about the `DashboardBody` syntax, see
# CloudWatch-Dashboard-Body-Structure.
# @return [String]
#
# @!attribute [rw] dashboard_name
# The name of the dashboard.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboardOutput AWS API Documentation
#
class GetDashboardOutput < Struct.new(
:dashboard_arn,
:dashboard_body,
:dashboard_name)
include Aws::Structure
end
# @note When making an API call, you may pass GetMetricDataInput
# data as a hash:
#
# {
# metric_data_queries: [ # required
# {
# id: "MetricId", # required
# metric_stat: {
# metric: { # required
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# },
# period: 1, # required
# stat: "Stat", # required
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# },
# expression: "MetricExpression",
# label: "MetricLabel",
# return_data: false,
# },
# ],
# start_time: Time.now, # required
# end_time: Time.now, # required
# next_token: "NextToken",
# scan_by: "TimestampDescending", # accepts TimestampDescending, TimestampAscending
# max_datapoints: 1,
# }
#
# @!attribute [rw] metric_data_queries
# The metric queries to be returned. A single `GetMetricData` call can
# include as many as 100 `MetricDataQuery` structures. Each of these
# structures can specify either a metric to retrieve, or a math
# expression to perform on retrieved data.
# @return [Array<Types::MetricDataQuery>]
#
# @!attribute [rw] start_time
# The time stamp indicating the earliest data to be returned.
# @return [Time]
#
# @!attribute [rw] end_time
# The time stamp indicating the latest data to be returned.
# @return [Time]
#
# @!attribute [rw] next_token
# Include this value, if it was returned by the previous call, to get
# the next set of data points.
# @return [String]
#
# @!attribute [rw] scan_by
# The order in which data points should be returned.
# `TimestampDescending` returns the newest data first and paginates
# when the `MaxDatapoints` limit is reached. `TimestampAscending`
# returns the oldest data first and paginates when the `MaxDatapoints`
# limit is reached.
# @return [String]
#
# @!attribute [rw] max_datapoints
# The maximum number of data points the request should return before
# paginating. If you omit this, the default of 100,800 is used.
# @return [Integer]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricDataInput AWS API Documentation
#
class GetMetricDataInput < Struct.new(
:metric_data_queries,
:start_time,
:end_time,
:next_token,
:scan_by,
:max_datapoints)
include Aws::Structure
end
# @!attribute [rw] metric_data_results
# The metrics that are returned, including the metric name, namespace,
# and dimensions.
# @return [Array<Types::MetricDataResult>]
#
# @!attribute [rw] next_token
# A token that marks the next batch of returned results.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricDataOutput AWS API Documentation
#
class GetMetricDataOutput < Struct.new(
:metric_data_results,
:next_token)
include Aws::Structure
end
# @note When making an API call, you may pass GetMetricStatisticsInput
# data as a hash:
#
# {
# namespace: "Namespace", # required
# metric_name: "MetricName", # required
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# start_time: Time.now, # required
# end_time: Time.now, # required
# period: 1, # required
# statistics: ["SampleCount"], # accepts SampleCount, Average, Sum, Minimum, Maximum
# extended_statistics: ["ExtendedStatistic"],
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# }
#
# @!attribute [rw] namespace
# The namespace of the metric, with or without spaces.
# @return [String]
#
# @!attribute [rw] metric_name
# The name of the metric, with or without spaces.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions. If the metric contains multiple dimensions, you must
# include a value for each dimension. CloudWatch treats each unique
# combination of dimensions as a separate metric. If a specific
# combination of dimensions was not published, you can't retrieve
# statistics for it. You must specify the same dimensions that were
# used when the metrics were created. For an example, see [Dimension
# Combinations][1] in the *Amazon CloudWatch User Guide*. For more
# information about specifying dimensions, see [Publishing Metrics][2]
# in the *Amazon CloudWatch User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations
# [2]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html
# @return [Array<Types::Dimension>]
#
# @!attribute [rw] start_time
# The time stamp that determines the first data point to return. Start
# times are evaluated relative to the time that CloudWatch receives
# the request.
#
# The value specified is inclusive; results include data points with
# the specified time stamp. The time stamp must be in ISO 8601 UTC
# format (for example, 2016-10-03T23:00:00Z).
#
# CloudWatch rounds the specified time stamp as follows:
#
# * Start time less than 15 days ago - Round down to the nearest whole
# minute. For example, 12:32:34 is rounded down to 12:32:00.
#
# * Start time between 15 and 63 days ago - Round down to the nearest
# 5-minute clock interval. For example, 12:32:34 is rounded down to
# 12:30:00.
#
# * Start time greater than 63 days ago - Round down to the nearest
# 1-hour clock interval. For example, 12:32:34 is rounded down to
# 12:00:00.
#
# If you set `Period` to 5, 10, or 30, the start time of your request
# is rounded down to the nearest time that corresponds to even 5-,
# 10-, or 30-second divisions of a minute. For example, if you make a
# query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the
# start time of your request is rounded down and you receive data from
# 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the
# previous 5 minutes of data, using a period of 5 seconds, you receive
# data timestamped between 15:02:15 and 15:07:15.
# @return [Time]
#
# @!attribute [rw] end_time
# The time stamp that determines the last data point to return.
#
# The value specified is exclusive; results include data points up to
# the specified time stamp. The time stamp must be in ISO 8601 UTC
# format (for example, 2016-10-10T23:00:00Z).
# @return [Time]
#
# @!attribute [rw] period
# The granularity, in seconds, of the returned data points. For
# metrics with regular resolution, a period can be as short as one
# minute (60 seconds) and must be a multiple of 60. For
# high-resolution metrics that are collected at intervals of less than
# one minute, the period can be 1, 5, 10, 30, 60, or any multiple of
# 60. High-resolution metrics are those metrics stored by a
# `PutMetricData` call that includes a `StorageResolution` of 1
# second.
#
# If the `StartTime` parameter specifies a time stamp that is greater
# than 3 hours ago, you must specify the period as follows or no data
# points in that time range is returned:
#
# * Start time between 3 hours and 15 days ago - Use a multiple of 60
# seconds (1 minute).
#
# * Start time between 15 and 63 days ago - Use a multiple of 300
# seconds (5 minutes).
#
# * Start time greater than 63 days ago - Use a multiple of 3600
# seconds (1 hour).
# @return [Integer]
#
# @!attribute [rw] statistics
# The metric statistics, other than percentile. For percentile
# statistics, use `ExtendedStatistics`. When calling
# `GetMetricStatistics`, you must specify either `Statistics` or
# `ExtendedStatistics`, but not both.
# @return [Array<String>]
#
# @!attribute [rw] extended_statistics
# The percentile statistics. Specify values between p0.0 and p100.
# When calling `GetMetricStatistics`, you must specify either
# `Statistics` or `ExtendedStatistics`, but not both.
# @return [Array<String>]
#
# @!attribute [rw] unit
# The unit for a given metric. Metrics may be reported in multiple
# units. Not supplying a unit results in all units being returned. If
# you specify only a unit that the metric does not report, the results
# of the call are null.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsInput AWS API Documentation
#
class GetMetricStatisticsInput < Struct.new(
:namespace,
:metric_name,
:dimensions,
:start_time,
:end_time,
:period,
:statistics,
:extended_statistics,
:unit)
include Aws::Structure
end
# @!attribute [rw] label
# A label for the specified metric.
# @return [String]
#
# @!attribute [rw] datapoints
# The data points for the specified metric.
# @return [Array<Types::Datapoint>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricStatisticsOutput AWS API Documentation
#
class GetMetricStatisticsOutput < Struct.new(
:label,
:datapoints)
include Aws::Structure
end
# @note When making an API call, you may pass ListDashboardsInput
# data as a hash:
#
# {
# dashboard_name_prefix: "DashboardNamePrefix",
# next_token: "NextToken",
# }
#
# @!attribute [rw] dashboard_name_prefix
# If you specify this parameter, only the dashboards with names
# starting with the specified string are listed. The maximum length is
# 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and
# "\_".
# @return [String]
#
# @!attribute [rw] next_token
# The token returned by a previous call to indicate that there is more
# data available.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboardsInput AWS API Documentation
#
class ListDashboardsInput < Struct.new(
:dashboard_name_prefix,
:next_token)
include Aws::Structure
end
# @!attribute [rw] dashboard_entries
# The list of matching dashboards.
# @return [Array<Types::DashboardEntry>]
#
# @!attribute [rw] next_token
# The token that marks the start of the next batch of returned
# results.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListDashboardsOutput AWS API Documentation
#
class ListDashboardsOutput < Struct.new(
:dashboard_entries,
:next_token)
include Aws::Structure
end
# @note When making an API call, you may pass ListMetricsInput
# data as a hash:
#
# {
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue",
# },
# ],
# next_token: "NextToken",
# }
#
# @!attribute [rw] namespace
# The namespace to filter against.
# @return [String]
#
# @!attribute [rw] metric_name
# The name of the metric to filter against.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions to filter against.
# @return [Array<Types::DimensionFilter>]
#
# @!attribute [rw] next_token
# The token returned by a previous call to indicate that there is more
# data available.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsInput AWS API Documentation
#
class ListMetricsInput < Struct.new(
:namespace,
:metric_name,
:dimensions,
:next_token)
include Aws::Structure
end
# @!attribute [rw] metrics
# The metrics.
# @return [Array<Types::Metric>]
#
# @!attribute [rw] next_token
# The token that marks the start of the next batch of returned
# results.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListMetricsOutput AWS API Documentation
#
class ListMetricsOutput < Struct.new(
:metrics,
:next_token)
include Aws::Structure
end
# A message returned by the `GetMetricData`API, including a code and a
# description.
#
# @!attribute [rw] code
# The error code or status code associated with the message.
# @return [String]
#
# @!attribute [rw] value
# The message text.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MessageData AWS API Documentation
#
class MessageData < Struct.new(
:code,
:value)
include Aws::Structure
end
# Represents a specific metric.
#
# @note When making an API call, you may pass Metric
# data as a hash:
#
# {
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# }
#
# @!attribute [rw] namespace
# The namespace of the metric.
# @return [String]
#
# @!attribute [rw] metric_name
# The name of the metric.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions for the metric.
# @return [Array<Types::Dimension>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/Metric AWS API Documentation
#
class Metric < Struct.new(
:namespace,
:metric_name,
:dimensions)
include Aws::Structure
end
# Represents an alarm.
#
# @!attribute [rw] alarm_name
# The name of the alarm.
# @return [String]
#
# @!attribute [rw] alarm_arn
# The Amazon Resource Name (ARN) of the alarm.
# @return [String]
#
# @!attribute [rw] alarm_description
# The description of the alarm.
# @return [String]
#
# @!attribute [rw] alarm_configuration_updated_timestamp
# The time stamp of the last update to the alarm configuration.
# @return [Time]
#
# @!attribute [rw] actions_enabled
# Indicates whether actions should be executed during any changes to
# the alarm state.
# @return [Boolean]
#
# @!attribute [rw] ok_actions
# The actions to execute when this alarm transitions to the `OK` state
# from any other state. Each action is specified as an Amazon Resource
# Name (ARN).
# @return [Array<String>]
#
# @!attribute [rw] alarm_actions
# The actions to execute when this alarm transitions to the `ALARM`
# state from any other state. Each action is specified as an Amazon
# Resource Name (ARN).
# @return [Array<String>]
#
# @!attribute [rw] insufficient_data_actions
# The actions to execute when this alarm transitions to the
# `INSUFFICIENT_DATA` state from any other state. Each action is
# specified as an Amazon Resource Name (ARN).
# @return [Array<String>]
#
# @!attribute [rw] state_value
# The state value for the alarm.
# @return [String]
#
# @!attribute [rw] state_reason
# An explanation for the alarm state, in text format.
# @return [String]
#
# @!attribute [rw] state_reason_data
# An explanation for the alarm state, in JSON format.
# @return [String]
#
# @!attribute [rw] state_updated_timestamp
# The time stamp of the last update to the alarm state.
# @return [Time]
#
# @!attribute [rw] metric_name
# The name of the metric associated with the alarm.
# @return [String]
#
# @!attribute [rw] namespace
# The namespace of the metric associated with the alarm.
# @return [String]
#
# @!attribute [rw] statistic
# The statistic for the metric associated with the alarm, other than
# percentile. For percentile statistics, use `ExtendedStatistic`.
# @return [String]
#
# @!attribute [rw] extended_statistic
# The percentile statistic for the metric associated with the alarm.
# Specify a value between p0.0 and p100.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions for the metric associated with the alarm.
# @return [Array<Types::Dimension>]
#
# @!attribute [rw] period
# The period, in seconds, over which the statistic is applied.
# @return [Integer]
#
# @!attribute [rw] unit
# The unit of the metric associated with the alarm.
# @return [String]
#
# @!attribute [rw] evaluation_periods
# The number of periods over which data is compared to the specified
# threshold.
# @return [Integer]
#
# @!attribute [rw] datapoints_to_alarm
# The number of datapoints that must be breaching to trigger the
# alarm.
# @return [Integer]
#
# @!attribute [rw] threshold
# The value to compare with the specified statistic.
# @return [Float]
#
# @!attribute [rw] comparison_operator
# The arithmetic operation to use when comparing the specified
# statistic and threshold. The specified statistic value is used as
# the first operand.
# @return [String]
#
# @!attribute [rw] treat_missing_data
# Sets how this alarm is to handle missing data points. If this
# parameter is omitted, the default behavior of `missing` is used.
# @return [String]
#
# @!attribute [rw] evaluate_low_sample_count_percentile
# Used only for alarms based on percentiles. If `ignore`, the alarm
# state does not change during periods with too few data points to be
# statistically significant. If `evaluate` or this parameter is not
# used, the alarm is always evaluated and possibly changes state no
# matter how many data points are available.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricAlarm AWS API Documentation
#
class MetricAlarm < Struct.new(
:alarm_name,
:alarm_arn,
:alarm_description,
:alarm_configuration_updated_timestamp,
:actions_enabled,
:ok_actions,
:alarm_actions,
:insufficient_data_actions,
:state_value,
:state_reason,
:state_reason_data,
:state_updated_timestamp,
:metric_name,
:namespace,
:statistic,
:extended_statistic,
:dimensions,
:period,
:unit,
:evaluation_periods,
:datapoints_to_alarm,
:threshold,
:comparison_operator,
:treat_missing_data,
:evaluate_low_sample_count_percentile)
include Aws::Structure
end
# This structure indicates the metric data to return, and whether this
# call is just retrieving a batch set of data for one metric, or is
# performing a math expression on metric data. A single `GetMetricData`
# call can include up to 100 `MetricDataQuery` structures.
#
# @note When making an API call, you may pass MetricDataQuery
# data as a hash:
#
# {
# id: "MetricId", # required
# metric_stat: {
# metric: { # required
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# },
# period: 1, # required
# stat: "Stat", # required
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# },
# expression: "MetricExpression",
# label: "MetricLabel",
# return_data: false,
# }
#
# @!attribute [rw] id
# A short name used to tie this structure to the results in the
# response. This name must be unique within a single call to
# `GetMetricData`. If you are performing math expressions on this set
# of data, this name represents that data and can serve as a variable
# in the mathematical expression. The valid characters are letters,
# numbers, and underscore. The first character must be a lowercase
# letter.
# @return [String]
#
# @!attribute [rw] metric_stat
# The metric to be returned, along with statistics, period, and units.
# Use this parameter only if this structure is performing a data
# retrieval and not performing a math expression on the returned data.
#
# Within one MetricDataQuery structure, you must specify either
# `Expression` or `MetricStat` but not both.
# @return [Types::MetricStat]
#
# @!attribute [rw] expression
# The math expression to be performed on the returned data, if this
# structure is performing a math expression. For more information
# about metric math expressions, see [Metric Math Syntax and
# Functions][1] in the *Amazon CloudWatch User Guide*.
#
# Within one MetricDataQuery structure, you must specify either
# `Expression` or `MetricStat` but not both.
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax
# @return [String]
#
# @!attribute [rw] label
# A human-readable label for this metric or expression. This is
# especially useful if this is an expression, so that you know what
# the value represents. If the metric or expression is shown in a
# CloudWatch dashboard widget, the label is shown. If Label is
# omitted, CloudWatch generates a default.
# @return [String]
#
# @!attribute [rw] return_data
# Indicates whether to return the time stamps and raw data values of
# this metric. If you are performing this call just to do math
# expressions and do not also need the raw data returned, you can
# specify `False`. If you omit this, the default of `True` is used.
# @return [Boolean]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricDataQuery AWS API Documentation
#
class MetricDataQuery < Struct.new(
:id,
:metric_stat,
:expression,
:label,
:return_data)
include Aws::Structure
end
# A `GetMetricData` call returns an array of `MetricDataResult`
# structures. Each of these structures includes the data points for that
# metric, along with the time stamps of those data points and other
# identifying information.
#
# @!attribute [rw] id
# The short name you specified to represent this metric.
# @return [String]
#
# @!attribute [rw] label
# The human-readable label associated with the data.
# @return [String]
#
# @!attribute [rw] timestamps
# The time stamps for the data points, formatted in Unix timestamp
# format. The number of time stamps always matches the number of
# values and the value for Timestamps\[x\] is Values\[x\].
# @return [Array<Time>]
#
# @!attribute [rw] values
# The data points for the metric corresponding to `Timestamps`. The
# number of values always matches the number of time stamps and the
# time stamp for Values\[x\] is Timestamps\[x\].
# @return [Array<Float>]
#
# @!attribute [rw] status_code
# The status of the returned data. `Complete` indicates that all data
# points in the requested time range were returned. `PartialData`
# means that an incomplete set of data points were returned. You can
# use the `NextToken` value that was returned and repeat your request
# to get more data points. `NextToken` is not returned if you are
# performing a math expression. `InternalError` indicates that an
# error occurred. Retry your request using `NextToken`, if present.
# @return [String]
#
# @!attribute [rw] messages
# A list of messages with additional information about the data
# returned.
# @return [Array<Types::MessageData>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricDataResult AWS API Documentation
#
class MetricDataResult < Struct.new(
:id,
:label,
:timestamps,
:values,
:status_code,
:messages)
include Aws::Structure
end
# Encapsulates the information sent to either create a metric or add new
# values to be aggregated into an existing metric.
#
# @note When making an API call, you may pass MetricDatum
# data as a hash:
#
# {
# metric_name: "MetricName", # required
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# timestamp: Time.now,
# value: 1.0,
# statistic_values: {
# sample_count: 1.0, # required
# sum: 1.0, # required
# minimum: 1.0, # required
# maximum: 1.0, # required
# },
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# storage_resolution: 1,
# }
#
# @!attribute [rw] metric_name
# The name of the metric.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions associated with the metric.
# @return [Array<Types::Dimension>]
#
# @!attribute [rw] timestamp
# The time the metric data was received, expressed as the number of
# milliseconds since Jan 1, 1970 00:00:00 UTC.
# @return [Time]
#
# @!attribute [rw] value
# The value for the metric.
#
# Although the parameter accepts numbers of type Double, CloudWatch
# rejects values that are either too small or too large. Values must
# be in the range of 8.515920e-109 to 1.174271e+108 (Base 10) or
# 2e-360 to 2e360 (Base 2). In addition, special values (for example,
# NaN, +Infinity, -Infinity) are not supported.
# @return [Float]
#
# @!attribute [rw] statistic_values
# The statistical values for the metric.
# @return [Types::StatisticSet]
#
# @!attribute [rw] unit
# The unit of the metric.
# @return [String]
#
# @!attribute [rw] storage_resolution
# Valid values are 1 and 60. Setting this to 1 specifies this metric
# as a high-resolution metric, so that CloudWatch stores the metric
# with sub-minute resolution down to one second. Setting this to 60
# specifies this metric as a regular-resolution metric, which
# CloudWatch stores at 1-minute resolution. Currently, high resolution
# is available only for custom metrics. For more information about
# high-resolution metrics, see [High-Resolution Metrics][1] in the
# *Amazon CloudWatch User Guide*.
#
# This field is optional, if you do not specify it the default of 60
# is used.
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html#high-resolution-metrics
# @return [Integer]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricDatum AWS API Documentation
#
class MetricDatum < Struct.new(
:metric_name,
:dimensions,
:timestamp,
:value,
:statistic_values,
:unit,
:storage_resolution)
include Aws::Structure
end
# This structure defines the metric to be returned, along with the
# statistics, period, and units.
#
# @note When making an API call, you may pass MetricStat
# data as a hash:
#
# {
# metric: { # required
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# },
# period: 1, # required
# stat: "Stat", # required
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# }
#
# @!attribute [rw] metric
# The metric to return, including the metric name, namespace, and
# dimensions.
# @return [Types::Metric]
#
# @!attribute [rw] period
# The period to use when retrieving the metric.
# @return [Integer]
#
# @!attribute [rw] stat
# The statistic to return. It can include any CloudWatch statistic or
# extended statistic.
# @return [String]
#
# @!attribute [rw] unit
# The unit to use for the returned data points.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/MetricStat AWS API Documentation
#
class MetricStat < Struct.new(
:metric,
:period,
:stat,
:unit)
include Aws::Structure
end
# @note When making an API call, you may pass PutDashboardInput
# data as a hash:
#
# {
# dashboard_name: "DashboardName", # required
# dashboard_body: "DashboardBody", # required
# }
#
# @!attribute [rw] dashboard_name
# The name of the dashboard. If a dashboard with this name already
# exists, this call modifies that dashboard, replacing its current
# contents. Otherwise, a new dashboard is created. The maximum length
# is 255, and valid characters are A-Z, a-z, 0-9, "-", and "\_".
# This parameter is required.
# @return [String]
#
# @!attribute [rw] dashboard_body
# The detailed information about the dashboard in JSON format,
# including the widgets to include and their location on the
# dashboard. This parameter is required.
#
# For more information about the syntax, see
# CloudWatch-Dashboard-Body-Structure.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboardInput AWS API Documentation
#
class PutDashboardInput < Struct.new(
:dashboard_name,
:dashboard_body)
include Aws::Structure
end
# @!attribute [rw] dashboard_validation_messages
# If the input for `PutDashboard` was correct and the dashboard was
# successfully created or modified, this result is empty.
#
# If this result includes only warning messages, then the input was
# valid enough for the dashboard to be created or modified, but some
# elements of the dashboard may not render.
#
# If this result includes error messages, the input was not valid and
# the operation failed.
# @return [Array<Types::DashboardValidationMessage>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboardOutput AWS API Documentation
#
class PutDashboardOutput < Struct.new(
:dashboard_validation_messages)
include Aws::Structure
end
# @note When making an API call, you may pass PutMetricAlarmInput
# data as a hash:
#
# {
# alarm_name: "AlarmName", # required
# alarm_description: "AlarmDescription",
# actions_enabled: false,
# ok_actions: ["ResourceName"],
# alarm_actions: ["ResourceName"],
# insufficient_data_actions: ["ResourceName"],
# metric_name: "MetricName", # required
# namespace: "Namespace", # required
# statistic: "SampleCount", # accepts SampleCount, Average, Sum, Minimum, Maximum
# extended_statistic: "ExtendedStatistic",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# period: 1, # required
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# evaluation_periods: 1, # required
# datapoints_to_alarm: 1,
# threshold: 1.0, # required
# comparison_operator: "GreaterThanOrEqualToThreshold", # required, accepts GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
# treat_missing_data: "TreatMissingData",
# evaluate_low_sample_count_percentile: "EvaluateLowSampleCountPercentile",
# }
#
# @!attribute [rw] alarm_name
# The name for the alarm. This name must be unique within the AWS
# account.
# @return [String]
#
# @!attribute [rw] alarm_description
# The description for the alarm.
# @return [String]
#
# @!attribute [rw] actions_enabled
# Indicates whether actions should be executed during any changes to
# the alarm state.
# @return [Boolean]
#
# @!attribute [rw] ok_actions
# The actions to execute when this alarm transitions to an `OK` state
# from any other state. Each action is specified as an Amazon Resource
# Name (ARN).
#
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
# arn:aws:automate:*region*\:ec2:terminate \|
# arn:aws:automate:*region*\:ec2:recover \|
# arn:aws:sns:*region*\:*account-id*\:*sns-topic-name* \|
# arn:aws:autoscaling:*region*\:*account-id*\:scalingPolicy:*policy-id*
# autoScalingGroupName/*group-friendly-name*\:policyName/*policy-friendly-name*
#
# Valid Values (for use with IAM roles):
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
# @return [Array<String>]
#
# @!attribute [rw] alarm_actions
# The actions to execute when this alarm transitions to the `ALARM`
# state from any other state. Each action is specified as an Amazon
# Resource Name (ARN).
#
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
# arn:aws:automate:*region*\:ec2:terminate \|
# arn:aws:automate:*region*\:ec2:recover \|
# arn:aws:sns:*region*\:*account-id*\:*sns-topic-name* \|
# arn:aws:autoscaling:*region*\:*account-id*\:scalingPolicy:*policy-id*
# autoScalingGroupName/*group-friendly-name*\:policyName/*policy-friendly-name*
#
# Valid Values (for use with IAM roles):
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
# @return [Array<String>]
#
# @!attribute [rw] insufficient_data_actions
# The actions to execute when this alarm transitions to the
# `INSUFFICIENT_DATA` state from any other state. Each action is
# specified as an Amazon Resource Name (ARN).
#
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
# arn:aws:automate:*region*\:ec2:terminate \|
# arn:aws:automate:*region*\:ec2:recover \|
# arn:aws:sns:*region*\:*account-id*\:*sns-topic-name* \|
# arn:aws:autoscaling:*region*\:*account-id*\:scalingPolicy:*policy-id*
# autoScalingGroupName/*group-friendly-name*\:policyName/*policy-friendly-name*
#
# Valid Values (for use with IAM roles):
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
# \|
# arn:aws:swf:*region*\:\\\{*account-id*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
# @return [Array<String>]
#
# @!attribute [rw] metric_name
# The name for the metric associated with the alarm.
# @return [String]
#
# @!attribute [rw] namespace
# The namespace for the metric associated with the alarm.
# @return [String]
#
# @!attribute [rw] statistic
# The statistic for the metric associated with the alarm, other than
# percentile. For percentile statistics, use `ExtendedStatistic`. When
# you call `PutMetricAlarm`, you must specify either `Statistic` or
# `ExtendedStatistic,` but not both.
# @return [String]
#
# @!attribute [rw] extended_statistic
# The percentile statistic for the metric associated with the alarm.
# Specify a value between p0.0 and p100. When you call
# `PutMetricAlarm`, you must specify either `Statistic` or
# `ExtendedStatistic,` but not both.
# @return [String]
#
# @!attribute [rw] dimensions
# The dimensions for the metric associated with the alarm.
# @return [Array<Types::Dimension>]
#
# @!attribute [rw] period
# The period, in seconds, over which the specified statistic is
# applied. Valid values are 10, 30, and any multiple of 60.
#
# Be sure to specify 10 or 30 only for metrics that are stored by a
# `PutMetricData` call with a `StorageResolution` of 1. If you specify
# a period of 10 or 30 for a metric that does not have sub-minute
# resolution, the alarm still attempts to gather data at the period
# rate that you specify. In this case, it does not receive data for
# the attempts that do not correspond to a one-minute data resolution,
# and the alarm may often lapse into INSUFFICENT\_DATA status.
# Specifying 10 or 30 also sets this alarm as a high-resolution alarm,
# which has a higher charge than other alarms. For more information
# about pricing, see [Amazon CloudWatch Pricing][1].
#
# An alarm's total current evaluation period can be no longer than
# one day, so `Period` multiplied by `EvaluationPeriods` cannot be
# more than 86,400 seconds.
#
#
#
# [1]: https://aws.amazon.com/cloudwatch/pricing/
# @return [Integer]
#
# @!attribute [rw] unit
# The unit of measure for the statistic. For example, the units for
# the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks
# the number of bytes that an instance receives on all network
# interfaces. You can also specify a unit when you create a custom
# metric. Units help provide conceptual meaning to your data. Metric
# data points that specify a unit of measure, such as Percent, are
# aggregated separately.
#
# If you specify a unit, you must use a unit that is appropriate for
# the metric. Otherwise, the CloudWatch alarm can get stuck in the
# `INSUFFICIENT DATA` state.
# @return [String]
#
# @!attribute [rw] evaluation_periods
# The number of periods over which data is compared to the specified
# threshold. If you are setting an alarm which requires that a number
# of consecutive data points be breaching to trigger the alarm, this
# value specifies that number. If you are setting an "M out of N"
# alarm, this value is the N.
#
# An alarm's total current evaluation period can be no longer than
# one day, so this number multiplied by `Period` cannot be more than
# 86,400 seconds.
# @return [Integer]
#
# @!attribute [rw] datapoints_to_alarm
# The number of datapoints that must be breaching to trigger the
# alarm. This is used only if you are setting an "M out of N" alarm.
# In that case, this value is the M. For more information, see
# [Evaluating an Alarm][1] in the *Amazon CloudWatch User Guide*.
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation
# @return [Integer]
#
# @!attribute [rw] threshold
# The value against which the specified statistic is compared.
# @return [Float]
#
# @!attribute [rw] comparison_operator
# The arithmetic operation to use when comparing the specified
# statistic and threshold. The specified statistic value is used as
# the first operand.
# @return [String]
#
# @!attribute [rw] treat_missing_data
# Sets how this alarm is to handle missing data points. If
# `TreatMissingData` is omitted, the default behavior of `missing` is
# used. For more information, see [Configuring How CloudWatch Alarms
# Treats Missing Data][1].
#
# Valid Values: `breaching | notBreaching | ignore | missing`
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data
# @return [String]
#
# @!attribute [rw] evaluate_low_sample_count_percentile
# Used only for alarms based on percentiles. If you specify `ignore`,
# the alarm state does not change during periods with too few data
# points to be statistically significant. If you specify `evaluate` or
# omit this parameter, the alarm is always evaluated and possibly
# changes state no matter how many data points are available. For more
# information, see [Percentile-Based CloudWatch Alarms and Low Data
# Samples][1].
#
# Valid Values: `evaluate | ignore`
#
#
#
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarmInput AWS API Documentation
#
class PutMetricAlarmInput < Struct.new(
:alarm_name,
:alarm_description,
:actions_enabled,
:ok_actions,
:alarm_actions,
:insufficient_data_actions,
:metric_name,
:namespace,
:statistic,
:extended_statistic,
:dimensions,
:period,
:unit,
:evaluation_periods,
:datapoints_to_alarm,
:threshold,
:comparison_operator,
:treat_missing_data,
:evaluate_low_sample_count_percentile)
include Aws::Structure
end
# @note When making an API call, you may pass PutMetricDataInput
# data as a hash:
#
# {
# namespace: "Namespace", # required
# metric_data: [ # required
# {
# metric_name: "MetricName", # required
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# timestamp: Time.now,
# value: 1.0,
# statistic_values: {
# sample_count: 1.0, # required
# sum: 1.0, # required
# minimum: 1.0, # required
# maximum: 1.0, # required
# },
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
# storage_resolution: 1,
# },
# ],
# }
#
# @!attribute [rw] namespace
# The namespace for the metric data.
#
# You cannot specify a namespace that begins with "AWS/". Namespaces
# that begin with "AWS/" are reserved for use by Amazon Web Services
# products.
# @return [String]
#
# @!attribute [rw] metric_data
# The data for the metric.
# @return [Array<Types::MetricDatum>]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricDataInput AWS API Documentation
#
class PutMetricDataInput < Struct.new(
:namespace,
:metric_data)
include Aws::Structure
end
# @note When making an API call, you may pass SetAlarmStateInput
# data as a hash:
#
# {
# alarm_name: "AlarmName", # required
# state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
# state_reason: "StateReason", # required
# state_reason_data: "StateReasonData",
# }
#
# @!attribute [rw] alarm_name
# The name for the alarm. This name must be unique within the AWS
# account. The maximum length is 255 characters.
# @return [String]
#
# @!attribute [rw] state_value
# The value of the state.
# @return [String]
#
# @!attribute [rw] state_reason
# The reason that this alarm is set to this specific state, in text
# format.
# @return [String]
#
# @!attribute [rw] state_reason_data
# The reason that this alarm is set to this specific state, in JSON
# format.
# @return [String]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmStateInput AWS API Documentation
#
class SetAlarmStateInput < Struct.new(
:alarm_name,
:state_value,
:state_reason,
:state_reason_data)
include Aws::Structure
end
# Represents a set of statistics that describes a specific metric.
#
# @note When making an API call, you may pass StatisticSet
# data as a hash:
#
# {
# sample_count: 1.0, # required
# sum: 1.0, # required
# minimum: 1.0, # required
# maximum: 1.0, # required
# }
#
# @!attribute [rw] sample_count
# The number of samples used for the statistic set.
# @return [Float]
#
# @!attribute [rw] sum
# The sum of values for the sample set.
# @return [Float]
#
# @!attribute [rw] minimum
# The minimum value of the sample set.
# @return [Float]
#
# @!attribute [rw] maximum
# The maximum value of the sample set.
# @return [Float]
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/StatisticSet AWS API Documentation
#
class StatisticSet < Struct.new(
:sample_count,
:sum,
:minimum,
:maximum)
include Aws::Structure
end
end
end
| {
"content_hash": "b2786257d90ecd0f5e23e5fc1045477b",
"timestamp": "",
"source": "github",
"line_count": 1791,
"max_line_length": 382,
"avg_line_length": 36.790619765494135,
"alnum_prop": 0.6117586353426819,
"repo_name": "llooker/aws-sdk-ruby",
"id": "62a332d5461aaeccaf3b7ba4332d3625d65b13a3",
"size": "66100",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/types.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1075"
},
{
"name": "Gherkin",
"bytes": "65602"
},
{
"name": "HTML",
"bytes": "31300"
},
{
"name": "JavaScript",
"bytes": "529"
},
{
"name": "Ruby",
"bytes": "50268337"
}
],
"symlink_target": ""
} |
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.seaborne.patch.binary.thrift;
@SuppressWarnings("all")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-08-10")
public class RDF_Quad implements org.apache.thrift.TBase<RDF_Quad, RDF_Quad._Fields>, java.io.Serializable, Cloneable, Comparable<RDF_Quad> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RDF_Quad");
private static final org.apache.thrift.protocol.TField S_FIELD_DESC = new org.apache.thrift.protocol.TField("S", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField P_FIELD_DESC = new org.apache.thrift.protocol.TField("P", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final org.apache.thrift.protocol.TField O_FIELD_DESC = new org.apache.thrift.protocol.TField("O", org.apache.thrift.protocol.TType.STRUCT, (short)3);
private static final org.apache.thrift.protocol.TField G_FIELD_DESC = new org.apache.thrift.protocol.TField("G", org.apache.thrift.protocol.TType.STRUCT, (short)4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RDF_QuadStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RDF_QuadTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable RDF_Term S; // required
public @org.apache.thrift.annotation.Nullable RDF_Term P; // required
public @org.apache.thrift.annotation.Nullable RDF_Term O; // required
public @org.apache.thrift.annotation.Nullable RDF_Term G; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
S((short)1, "S"),
P((short)2, "P"),
O((short)3, "O"),
G((short)4, "G");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // S
return S;
case 2: // P
return P;
case 3: // O
return O;
case 4: // G
return G;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {_Fields.G};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.S, new org.apache.thrift.meta_data.FieldMetaData("S", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
tmpMap.put(_Fields.P, new org.apache.thrift.meta_data.FieldMetaData("P", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
tmpMap.put(_Fields.O, new org.apache.thrift.meta_data.FieldMetaData("O", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
tmpMap.put(_Fields.G, new org.apache.thrift.meta_data.FieldMetaData("G", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RDF_Term.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RDF_Quad.class, metaDataMap);
}
public RDF_Quad() {
}
public RDF_Quad(
RDF_Term S,
RDF_Term P,
RDF_Term O)
{
this();
this.S = S;
this.P = P;
this.O = O;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public RDF_Quad(RDF_Quad other) {
if (other.isSetS()) {
this.S = new RDF_Term(other.S);
}
if (other.isSetP()) {
this.P = new RDF_Term(other.P);
}
if (other.isSetO()) {
this.O = new RDF_Term(other.O);
}
if (other.isSetG()) {
this.G = new RDF_Term(other.G);
}
}
public RDF_Quad deepCopy() {
return new RDF_Quad(this);
}
@Override
public void clear() {
this.S = null;
this.P = null;
this.O = null;
this.G = null;
}
@org.apache.thrift.annotation.Nullable
public RDF_Term getS() {
return this.S;
}
public RDF_Quad setS(@org.apache.thrift.annotation.Nullable RDF_Term S) {
this.S = S;
return this;
}
public void unsetS() {
this.S = null;
}
/** Returns true if field S is set (has been assigned a value) and false otherwise */
public boolean isSetS() {
return this.S != null;
}
public void setSIsSet(boolean value) {
if (!value) {
this.S = null;
}
}
@org.apache.thrift.annotation.Nullable
public RDF_Term getP() {
return this.P;
}
public RDF_Quad setP(@org.apache.thrift.annotation.Nullable RDF_Term P) {
this.P = P;
return this;
}
public void unsetP() {
this.P = null;
}
/** Returns true if field P is set (has been assigned a value) and false otherwise */
public boolean isSetP() {
return this.P != null;
}
public void setPIsSet(boolean value) {
if (!value) {
this.P = null;
}
}
@org.apache.thrift.annotation.Nullable
public RDF_Term getO() {
return this.O;
}
public RDF_Quad setO(@org.apache.thrift.annotation.Nullable RDF_Term O) {
this.O = O;
return this;
}
public void unsetO() {
this.O = null;
}
/** Returns true if field O is set (has been assigned a value) and false otherwise */
public boolean isSetO() {
return this.O != null;
}
public void setOIsSet(boolean value) {
if (!value) {
this.O = null;
}
}
@org.apache.thrift.annotation.Nullable
public RDF_Term getG() {
return this.G;
}
public RDF_Quad setG(@org.apache.thrift.annotation.Nullable RDF_Term G) {
this.G = G;
return this;
}
public void unsetG() {
this.G = null;
}
/** Returns true if field G is set (has been assigned a value) and false otherwise */
public boolean isSetG() {
return this.G != null;
}
public void setGIsSet(boolean value) {
if (!value) {
this.G = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case S:
if (value == null) {
unsetS();
} else {
setS((RDF_Term)value);
}
break;
case P:
if (value == null) {
unsetP();
} else {
setP((RDF_Term)value);
}
break;
case O:
if (value == null) {
unsetO();
} else {
setO((RDF_Term)value);
}
break;
case G:
if (value == null) {
unsetG();
} else {
setG((RDF_Term)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case S:
return getS();
case P:
return getP();
case O:
return getO();
case G:
return getG();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case S:
return isSetS();
case P:
return isSetP();
case O:
return isSetO();
case G:
return isSetG();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof RDF_Quad)
return this.equals((RDF_Quad)that);
return false;
}
public boolean equals(RDF_Quad that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_S = true && this.isSetS();
boolean that_present_S = true && that.isSetS();
if (this_present_S || that_present_S) {
if (!(this_present_S && that_present_S))
return false;
if (!this.S.equals(that.S))
return false;
}
boolean this_present_P = true && this.isSetP();
boolean that_present_P = true && that.isSetP();
if (this_present_P || that_present_P) {
if (!(this_present_P && that_present_P))
return false;
if (!this.P.equals(that.P))
return false;
}
boolean this_present_O = true && this.isSetO();
boolean that_present_O = true && that.isSetO();
if (this_present_O || that_present_O) {
if (!(this_present_O && that_present_O))
return false;
if (!this.O.equals(that.O))
return false;
}
boolean this_present_G = true && this.isSetG();
boolean that_present_G = true && that.isSetG();
if (this_present_G || that_present_G) {
if (!(this_present_G && that_present_G))
return false;
if (!this.G.equals(that.G))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetS()) ? 131071 : 524287);
if (isSetS())
hashCode = hashCode * 8191 + S.hashCode();
hashCode = hashCode * 8191 + ((isSetP()) ? 131071 : 524287);
if (isSetP())
hashCode = hashCode * 8191 + P.hashCode();
hashCode = hashCode * 8191 + ((isSetO()) ? 131071 : 524287);
if (isSetO())
hashCode = hashCode * 8191 + O.hashCode();
hashCode = hashCode * 8191 + ((isSetG()) ? 131071 : 524287);
if (isSetG())
hashCode = hashCode * 8191 + G.hashCode();
return hashCode;
}
@Override
public int compareTo(RDF_Quad other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetS()).compareTo(other.isSetS());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetS()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.S, other.S);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetP()).compareTo(other.isSetP());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetP()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.P, other.P);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetO()).compareTo(other.isSetO());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetO()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.O, other.O);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetG()).compareTo(other.isSetG());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetG()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.G, other.G);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("RDF_Quad(");
boolean first = true;
sb.append("S:");
if (this.S == null) {
sb.append("null");
} else {
sb.append(this.S);
}
first = false;
if (!first) sb.append(", ");
sb.append("P:");
if (this.P == null) {
sb.append("null");
} else {
sb.append(this.P);
}
first = false;
if (!first) sb.append(", ");
sb.append("O:");
if (this.O == null) {
sb.append("null");
} else {
sb.append(this.O);
}
first = false;
if (isSetG()) {
if (!first) sb.append(", ");
sb.append("G:");
if (this.G == null) {
sb.append("null");
} else {
sb.append(this.G);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (S == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'S' was not present! Struct: " + toString());
}
if (P == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'P' was not present! Struct: " + toString());
}
if (O == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'O' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class RDF_QuadStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public RDF_QuadStandardScheme getScheme() {
return new RDF_QuadStandardScheme();
}
}
private static class RDF_QuadStandardScheme extends org.apache.thrift.scheme.StandardScheme<RDF_Quad> {
public void read(org.apache.thrift.protocol.TProtocol iprot, RDF_Quad struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // S
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.S = new RDF_Term();
struct.S.read(iprot);
struct.setSIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // P
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.P = new RDF_Term();
struct.P.read(iprot);
struct.setPIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // O
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.O = new RDF_Term();
struct.O.read(iprot);
struct.setOIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // G
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.G = new RDF_Term();
struct.G.read(iprot);
struct.setGIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, RDF_Quad struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.S != null) {
oprot.writeFieldBegin(S_FIELD_DESC);
struct.S.write(oprot);
oprot.writeFieldEnd();
}
if (struct.P != null) {
oprot.writeFieldBegin(P_FIELD_DESC);
struct.P.write(oprot);
oprot.writeFieldEnd();
}
if (struct.O != null) {
oprot.writeFieldBegin(O_FIELD_DESC);
struct.O.write(oprot);
oprot.writeFieldEnd();
}
if (struct.G != null) {
if (struct.isSetG()) {
oprot.writeFieldBegin(G_FIELD_DESC);
struct.G.write(oprot);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class RDF_QuadTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public RDF_QuadTupleScheme getScheme() {
return new RDF_QuadTupleScheme();
}
}
private static class RDF_QuadTupleScheme extends org.apache.thrift.scheme.TupleScheme<RDF_Quad> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Quad struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.S.write(oprot);
struct.P.write(oprot);
struct.O.write(oprot);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetG()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetG()) {
struct.G.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, RDF_Quad struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.S = new RDF_Term();
struct.S.read(iprot);
struct.setSIsSet(true);
struct.P = new RDF_Term();
struct.P.read(iprot);
struct.setPIsSet(true);
struct.O = new RDF_Term();
struct.O.read(iprot);
struct.setOIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.G = new RDF_Term();
struct.G.read(iprot);
struct.setGIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| {
"content_hash": "bd335d2d9afe33b3a8247b7c87340c0d",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 168,
"avg_line_length": 30.014471780028945,
"alnum_prop": 0.6235776277724204,
"repo_name": "afs/rdf-delta",
"id": "96d3d04c6d472220eb5174ca0d266292f65c1f59",
"size": "20740",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "rdf-patch/src/main/java/org/seaborne/patch/binary/thrift/RDF_Quad.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1510869"
},
{
"name": "Shell",
"bytes": "6757"
},
{
"name": "Thrift",
"bytes": "4002"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
uses()->group('management', 'management.logs');
beforeEach(function(): void {
$this->endpoint = $this->api->mock()->logs();
});
test('getAll() issues valid requests', function(): void {
$this->endpoint->getAll();
expect($this->api->getRequestMethod())->toEqual('GET');
expect($this->api->getRequestUrl())->toStartWith('https://' . $this->api->mock()->getConfiguration()->getDomain() . '/api/v2/logs');
});
test('get() issues valid requests', function(): void {
$logId = uniqid();
$this->endpoint->get($logId);
expect($this->api->getRequestMethod())->toEqual('GET');
expect($this->api->getRequestUrl())->toStartWith('https://' . $this->api->mock()->getConfiguration()->getDomain() . '/api/v2/logs/' . $logId);
});
| {
"content_hash": "5ea8e02ca50e57800f02857209be5b70",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 146,
"avg_line_length": 31.36,
"alnum_prop": 0.6237244897959183,
"repo_name": "auth0/auth0-PHP",
"id": "3448fae93c86672b87541b6922c90ec128eb5fb7",
"size": "784",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "tests/Unit/API/Management/LogsTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "890189"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Add Behaviors to Objects with <code>mix</code></title>
<style type="text/css">
/*margin and padding on body element
can introduce errors in determining
element position and are not recommended;
we turn them off as a foundation for YUI
CSS treatments. */
body {
margin:0;
padding:0;
}
</style>
<link type="text/css" rel="stylesheet" href="../../build/cssfonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yui/yui-debug.js"></script>
<!--there is no custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>Add Behaviors to Objects with <code>mix</code></h1>
<div class="exampleIntro">
<p>Static classes in JavaScript are implemented as object literals
with keys corresponding to public class methods. As such, static classes
aren't candidates for instantiation or prototype extention. To add
functionality to static classes, you need to work with the class's object
literal & and that's what YUI's <code>mix</code> method helps you to do.</p>
<p>Click the button below to call methods <code>mix</code>ed into a static class, then read the tutorial below for more information about using <code>mix</code>.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<input type="button" name="demo_btn" id="demo_btn" value="click"/>
<div id="demo_logger"></div>
<script type="text/javascript">
YUI({base:"../../build/", timeout: 10000, filter:"debug", logInclude: {example:true}}).use("node",
// This method is in the core of the library, so we don't have to use() any
// additional modules to access it. However, this example requires 'node'.
function(Y) {
Y.namespace('example.addons');
Y.example.addons.Logging = function () {
var logger = null;
return {
initLogger : function (logNode) {
if (!logger) {
logger = Y.get(logNode);
}
},
log : function (message) {
if (logger) {
logger.set('innerHTML', logger.get('innerHTML') + '<p>' + message + '</p>');
}
}
}
}();
Y.example.PageController = function () {
var app_const = 12345;
return {
getConst : function () { return app_const },
logConst : function () {
this.initLogger('#demo_logger');
this.log('PageController class constant = ' +
this.getConst() +
'. Logged courtesy of augmentation');
}
};
}();
Y.mix(
Y.example.PageController,
Y.example.addons.Logging);
Y.on('click', Y.example.PageController.logConst,
'#demo_btn', Y.example.PageController);
});
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>
<!-- presentbright.corp.yahoo.com uncompressed/chunked Tue Dec 9 15:45:55 PST 2008 -->
| {
"content_hash": "818ed6efcddccabb03401fc33c49ef0c",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 165,
"avg_line_length": 32.02020202020202,
"alnum_prop": 0.5962145110410094,
"repo_name": "kernow/js_state_machine",
"id": "af157c7da8f66d1ca823758344dcf69c6609f32b",
"size": "3170",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/js/yui/examples/yui/yui-mix_clean.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "32806"
}
],
"symlink_target": ""
} |
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik;
/**
* Http helper: static file server proxy, with compression, caching, isHttps() helper...
*
* Used to server piwik.js and the merged+minified CSS and JS files
*
*/
class ProxyHttp
{
const DEFLATE_ENCODING_REGEX = '/(?:^|, ?)(deflate)(?:,|$)/';
const GZIP_ENCODING_REGEX = '/(?:^|, ?)((x-)?gzip)(?:,|$)/';
/**
* Returns true if the current request appears to be a secure HTTPS connection
*
* @return bool
*/
public static function isHttps()
{
return Url::getCurrentScheme() === 'https';
}
/**
* Serve static files through php proxy.
*
* It performs the following actions:
* - Checks the file is readable or returns "HTTP/1.0 404 Not Found"
* - Returns "HTTP/1.1 304 Not Modified" after comparing the HTTP_IF_MODIFIED_SINCE
* with the modification date of the static file
* - Will try to compress the static file according to HTTP_ACCEPT_ENCODING. Compressed files are store in
* the /tmp directory. If compressing extensions are not available, a manually gzip compressed file
* can be provided in the /tmp directory. It has to bear the same name with an added .gz extension.
* Using manually compressed static files requires you to manually update the compressed file when
* the static file is updated.
* - Overrides server cache control config to allow caching
* - Sends Very Accept-Encoding to tell proxies to store different version of the static file according
* to users encoding capacities.
*
* Warning:
* Compressed filed are stored in the /tmp directory.
* If this method is used with two files bearing the same name but located in different locations,
* there is a risk of conflict. One file could be served with the content of the other.
* A future upgrade of this method would be to recreate the directory structure of the static file
* within a /tmp/compressed-static-files directory.
*
* @param string $file The location of the static file to serve
* @param string $contentType The content type of the static file.
* @param bool $expireFarFuture Day in the far future to set the Expires header to.
* Should be set to false for files that should not be cached.
* @param int|false $byteStart The starting byte in the file to serve. If false, the data from the beginning
* of the file will be served.
* @param int|false $byteEnd The ending byte in the file to serve. If false, the data from $byteStart to the
* end of the file will be served.
*/
public static function serverStaticFile($file, $contentType, $expireFarFutureDays = 100, $byteStart = false,
$byteEnd = false)
{
// if the file cannot be found return HTTP status code '404'
if (!file_exists($file)) {
self::setHttpStatus('404 Not Found');
return;
}
$modifiedSince = Http::getModifiedSinceHeader();
$fileModifiedTime = @filemtime($file);
$lastModified = gmdate('D, d M Y H:i:s', $fileModifiedTime) . ' GMT';
// set some HTTP response headers
self::overrideCacheControlHeaders('public');
@header('Vary: Accept-Encoding');
@header('Content-Disposition: inline; filename=' . basename($file));
if ($expireFarFutureDays) {
// Required by proxy caches potentially in between the browser and server to cache the request indeed
@header(self::getExpiresHeaderForFutureDay($expireFarFutureDays));
}
// Return 304 if the file has not modified since
if ($modifiedSince === $lastModified) {
self::setHttpStatus('304 Not Modified');
return;
}
// if we have to serve the file, serve it now, either in the clear or compressed
if ($byteStart === false) {
$byteStart = 0;
}
if ($byteEnd === false) {
$byteEnd = filesize($file);
}
$compressed = false;
$encoding = '';
$compressedFileLocation = AssetManager::getInstance()->getAssetDirectory() . '/' . basename($file);
if (!($byteStart == 0
&& $byteEnd == filesize($file))
) {
$compressedFileLocation .= ".$byteStart.$byteEnd";
}
$phpOutputCompressionEnabled = self::isPhpOutputCompressed();
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && !$phpOutputCompressionEnabled) {
list($encoding, $extension) = self::getCompressionEncodingAcceptedByClient();
$filegz = $compressedFileLocation . $extension;
if (self::canCompressInPhp()) {
if (!empty($encoding)) {
// compress the file if it doesn't exist or is newer than the existing cached file, and cache
// the compressed result
if (self::shouldCompressFile($file, $filegz)) {
self::compressFile($file, $filegz, $encoding, $byteStart, $byteEnd);
}
$compressed = true;
$file = $filegz;
$byteStart = 0;
$byteEnd = filesize($file);
}
} else {
// if a compressed file exists, the file was manually compressed so we just serve that
if ($extension == '.gz'
&& !self::shouldCompressFile($file, $filegz)
) {
$compressed = true;
$file = $filegz;
$byteStart = 0;
$byteEnd = filesize($file);
}
}
}
@header('Last-Modified: ' . $lastModified);
if (!$phpOutputCompressionEnabled) {
@header('Content-Length: ' . ($byteEnd - $byteStart));
}
if (!empty($contentType)) {
@header('Content-Type: ' . $contentType);
}
if ($compressed) {
@header('Content-Encoding: ' . $encoding);
}
if (!_readfile($file, $byteStart, $byteEnd)) {
self::setHttpStatus('505 Internal server error');
}
}
/**
* Test if php output is compressed
*
* @return bool True if php output is (or suspected/likely) to be compressed
*/
public static function isPhpOutputCompressed()
{
// Off = ''; On = '1'; otherwise, it's a buffer size
$zlibOutputCompression = ini_get('zlib.output_compression');
// could be ob_gzhandler, ob_deflatehandler, etc
$outputHandler = ini_get('output_handler');
// output handlers can be stacked
$obHandlers = array_filter(ob_list_handlers(), function ($var) {
return $var !== "default output handler";
});
// user defined handler via wrapper
if (!defined('PIWIK_TEST_MODE')) {
$autoPrependFile = ini_get('auto_prepend_file');
$autoAppendFile = ini_get('auto_append_file');
}
return !empty($zlibOutputCompression) ||
!empty($outputHandler) ||
!empty($obHandlers) ||
!empty($autoPrependFile) ||
!empty($autoAppendFile);
}
/**
* Workaround IE bug when downloading certain document types over SSL and
* cache control headers are present, e.g.,
*
* Cache-Control: no-cache
* Cache-Control: no-store,max-age=0,must-revalidate
* Pragma: no-cache
*
* @see http://support.microsoft.com/kb/316431/
* @see RFC2616
*
* @param string $override One of "public", "private", "no-cache", or "no-store". (optional)
*/
public static function overrideCacheControlHeaders($override = null)
{
if ($override || self::isHttps()) {
@header('Pragma: ');
@header('Expires: ');
if (in_array($override, array('public', 'private', 'no-cache', 'no-store'))) {
@header("Cache-Control: $override, must-revalidate");
} else {
@header('Cache-Control: must-revalidate');
}
}
}
/**
* Set response header, e.g., HTTP/1.0 200 Ok
*
* @param string $status Status
* @return bool
*/
protected static function setHttpStatus($status)
{
if (strpos(PHP_SAPI, '-fcgi') === false) {
@header($_SERVER['SERVER_PROTOCOL'] . ' ' . $status);
} else {
// FastCGI
@header('Status: ' . $status);
}
}
/**
* Returns a formatted Expires HTTP header for a certain number of days in the future. The result
* can be used in a call to `header()`.
*/
private function getExpiresHeaderForFutureDay($expireFarFutureDays)
{
return "Expires: " . gmdate('D, d M Y H:i:s', time() + 86400 * (int)$expireFarFutureDays) . ' GMT';
}
private static function getCompressionEncodingAcceptedByClient()
{
$acceptEncoding = $_SERVER['HTTP_ACCEPT_ENCODING'];
if (preg_match(self::DEFLATE_ENCODING_REGEX, $acceptEncoding, $matches)) {
return array('deflate', '.deflate');
} else if (preg_match(self::GZIP_ENCODING_REGEX, $acceptEncoding, $matches)) {
return array('gzip', '.gz');
} else {
return array(false, false);
}
}
private static function canCompressInPhp()
{
return extension_loaded('zlib') && function_exists('file_get_contents') && function_exists('file_put_contents');
}
private static function shouldCompressFile($fileToCompress, $compressedFilePath)
{
$toCompressLastModified = @filemtime($fileToCompress);
$compressedLastModified = @filemtime($compressedFilePath);
return !file_exists($compressedFilePath) || ($toCompressLastModified > $compressedLastModified);
}
private static function compressFile($fileToCompress, $compressedFilePath, $compressionEncoding, $byteStart,
$byteEnd)
{
$data = file_get_contents($fileToCompress);
$data = substr($data, $byteStart, $byteEnd - $byteStart);
if ($compressionEncoding == 'deflate') {
$data = gzdeflate($data, 9);
} else if ($compressionEncoding == 'gzip' || $compressionEncoding == 'x-gzip') {
$data = gzencode($data, 9);
}
file_put_contents($compressedFilePath, $data);
}
} | {
"content_hash": "e175cca5a8bbf1127b001a05fbefbb24",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 120,
"avg_line_length": 37.721254355400696,
"alnum_prop": 0.5753740993903566,
"repo_name": "ACOKing/ArcherSys",
"id": "cb1fa654d37030e8f3219da21b5e4cc89dcdb989",
"size": "10826",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "piwik/core/ProxyHttp.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "67515"
},
{
"name": "C",
"bytes": "3774"
},
{
"name": "C#",
"bytes": "22990"
},
{
"name": "CSS",
"bytes": "3962087"
},
{
"name": "JavaScript",
"bytes": "10147893"
},
{
"name": "Makefile",
"bytes": "1502"
},
{
"name": "PHP",
"bytes": "36479079"
},
{
"name": "Perl",
"bytes": "31322"
},
{
"name": "Python",
"bytes": "65317"
},
{
"name": "Shell",
"bytes": "97302"
}
],
"symlink_target": ""
} |
<?php
namespace MakePrintable\Exceptions;
class RuntimeException extends \Exception
{
public function __construct($message)
{
$this->message = $message;
}
}
| {
"content_hash": "b1648b1dcfe0aa8ed860ef7febb6a623",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 41,
"avg_line_length": 14.909090909090908,
"alnum_prop": 0.7317073170731707,
"repo_name": "XZzYassin/MakePrintable_PHP",
"id": "b9b1269d039e52e0cba7991ed18db8b541f02891",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MakePrintable/Exceptions/RuntimeException.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "8701"
}
],
"symlink_target": ""
} |
import rope.base.builtins
import rope.base.codeanalyze
import rope.base.pynames
from rope.base import ast, exceptions, utils
class Scope(object):
def __init__(self, pycore, pyobject, parent_scope):
self.pycore = pycore
self.pyobject = pyobject
self.parent = parent_scope
def get_names(self):
"""Return the names defined or imported in this scope"""
return self.pyobject.get_attributes()
def get_defined_names(self):
"""Return the names defined in this scope"""
return self.pyobject._get_structural_attributes()
def get_name(self, name):
"""Return name `PyName` defined in this scope"""
if name not in self.get_names():
raise exceptions.NameNotFoundError('name %s not found' % name)
return self.get_names()[name]
def __getitem__(self, key):
"""The same as ``get_name(key)``"""
return self.get_name(key)
def __contains__(self, key):
"""The same as ``key in self.get_names()``"""
return key in self.get_names()
@utils.saveit
def get_scopes(self):
"""Return the subscopes of this scope
The returned scopes should be sorted by the order they appear.
"""
return self._create_scopes()
def lookup(self, name):
if name in self.get_names():
return self.get_names()[name]
if self.parent is not None:
return self.parent._propagated_lookup(name)
return None
def get_propagated_names(self):
"""Return the visible names of this scope
Return the names defined in this scope that are visible from
scopes containing this scope. This method returns the same
dictionary returned by `get_names()` except for `ClassScope`
which returns an empty dict.
"""
return self.get_names()
def _propagated_lookup(self, name):
if name in self.get_propagated_names():
return self.get_propagated_names()[name]
if self.parent is not None:
return self.parent._propagated_lookup(name)
return None
def _create_scopes(self):
return [pydefined.get_scope()
for pydefined in self.pyobject._get_defined_objects()]
def _get_global_scope(self):
current = self
while current.parent is not None:
current = current.parent
return current
def get_start(self):
return self.pyobject.get_ast().lineno
def get_body_start(self):
body = self.pyobject.get_ast().body
if body:
return body[0].lineno
return self.get_start()
def get_end(self):
pymodule = self._get_global_scope().pyobject
return pymodule.logical_lines.logical_line_in(self.logical_end)[1]
@utils.saveit
def get_logical_end(self):
global_scope = self._get_global_scope()
return global_scope._scope_finder.find_scope_end(self)
start = property(get_start)
end = property(get_end)
logical_end = property(get_logical_end)
def get_kind(self):
pass
class GlobalScope(Scope):
def __init__(self, pycore, module):
super(GlobalScope, self).__init__(pycore, module, None)
self.names = module._get_concluded_data()
def get_start(self):
return 1
def get_kind(self):
return 'Module'
def get_name(self, name):
try:
return self.pyobject[name]
except exceptions.AttributeNotFoundError:
if name in self.builtin_names:
return self.builtin_names[name]
raise exceptions.NameNotFoundError('name %s not found' % name)
def get_names(self):
if self.names.get() is None:
result = dict(self.builtin_names)
result.update(super(GlobalScope, self).get_names())
self.names.set(result)
return self.names.get()
def get_inner_scope_for_line(self, lineno, indents=None):
return self._scope_finder.get_holding_scope(self, lineno, indents)
def get_inner_scope_for_offset(self, offset):
return self._scope_finder.get_holding_scope_for_offset(self, offset)
@property
@utils.saveit
def _scope_finder(self):
return _HoldingScopeFinder(self.pyobject)
@property
def builtin_names(self):
return rope.base.builtins.builtins.get_attributes()
class FunctionScope(Scope):
def __init__(self, pycore, pyobject, visitor):
super(FunctionScope, self).__init__(pycore, pyobject,
pyobject.parent.get_scope())
self.names = None
self.returned_asts = None
self.is_generator = None
self.defineds = None
self.visitor = visitor
def _get_names(self):
if self.names is None:
self._visit_function()
return self.names
def _visit_function(self):
if self.names is None:
new_visitor = self.visitor(self.pycore, self.pyobject)
for n in ast.get_child_nodes(self.pyobject.get_ast()):
ast.walk(n, new_visitor)
self.names = new_visitor.names
self.names.update(self.pyobject.get_parameters())
self.returned_asts = new_visitor.returned_asts
self.is_generator = new_visitor.generator
self.defineds = new_visitor.defineds
def _get_returned_asts(self):
if self.names is None:
self._visit_function()
return self.returned_asts
def _is_generator(self):
if self.is_generator is None:
self._get_returned_asts()
return self.is_generator
def get_names(self):
return self._get_names()
def _create_scopes(self):
if self.defineds is None:
self._visit_function()
return [pydefined.get_scope() for pydefined in self.defineds]
def get_kind(self):
return 'Function'
def invalidate_data(self):
for pyname in self.get_names().values():
if isinstance(pyname, (rope.base.pynames.AssignedName,
rope.base.pynames.EvaluatedName)):
pyname.invalidate()
class ClassScope(Scope):
def __init__(self, pycore, pyobject):
super(ClassScope, self).__init__(pycore, pyobject,
pyobject.parent.get_scope())
def get_kind(self):
return 'Class'
def get_propagated_names(self):
return {}
class _HoldingScopeFinder(object):
def __init__(self, pymodule):
self.pymodule = pymodule
def get_indents(self, lineno):
return rope.base.codeanalyze.count_line_indents(
self.lines.get_line(lineno))
def _get_scope_indents(self, scope):
return self.get_indents(scope.get_start())
def get_holding_scope(self, module_scope, lineno, line_indents=None):
if line_indents is None:
line_indents = self.get_indents(lineno)
current_scope = module_scope
new_scope = current_scope
while new_scope is not None and \
(new_scope.get_kind() == 'Module' or
self._get_scope_indents(new_scope) <= line_indents):
current_scope = new_scope
if current_scope.get_start() == lineno and \
current_scope.get_kind() != 'Module':
return current_scope
new_scope = None
for scope in current_scope.get_scopes():
if scope.get_start() <= lineno:
if lineno <= scope.get_end():
new_scope = scope
break
else:
break
return current_scope
def _is_empty_line(self, lineno):
line = self.lines.get_line(lineno)
return line.strip() == '' or line.lstrip().startswith('#')
def _get_body_indents(self, scope):
return self.get_indents(scope.get_body_start())
def get_holding_scope_for_offset(self, scope, offset):
return self.get_holding_scope(
scope, self.lines.get_line_number(offset))
def find_scope_end(self, scope):
if not scope.parent:
return self.lines.length()
end = scope.pyobject.get_ast().body[-1].lineno
scope_start = self.pymodule.logical_lines.logical_line_in(scope.start)
if scope_start[1] >= end:
# handling one-liners
body_indents = self._get_scope_indents(scope) + 4
else:
body_indents = self._get_body_indents(scope)
for l in self.logical_lines.generate_starts(
min(end + 1, self.lines.length()), self.lines.length() + 1):
if not self._is_empty_line(l):
if self.get_indents(l) < body_indents:
return end
else:
end = l
return end
@property
def lines(self):
return self.pymodule.lines
@property
def code(self):
return self.pymodule.source_code
@property
def logical_lines(self):
return self.pymodule.logical_lines
class TemporaryScope(Scope):
"""Currently used for list comprehensions and generator expressions
These scopes do not appear in the `get_scopes()` method of their
parent scopes.
"""
def __init__(self, pycore, parent_scope, names):
super(TemporaryScope, self).__init__(
pycore, parent_scope.pyobject, parent_scope)
self.names = names
def get_names(self):
return self.names
def get_defined_names(self):
return self.names
def _create_scopes(self):
return []
def get_kind(self):
return 'Temporary'
| {
"content_hash": "a6187797136db7f70faa1a7eb73f9a2d",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 78,
"avg_line_length": 31.05732484076433,
"alnum_prop": 0.5917760459392944,
"repo_name": "JetChars/vim",
"id": "0bed19a92912ccda603e3f470ca48154c417bb59",
"size": "9752",
"binary": false,
"copies": "21",
"ref": "refs/heads/master",
"path": "vim/bundle/python-mode/pymode/libs2/rope/base/pyscopes.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CoffeeScript",
"bytes": "1402"
},
{
"name": "Erlang",
"bytes": "6887"
},
{
"name": "GCC Machine Description",
"bytes": "525"
},
{
"name": "Go",
"bytes": "2239"
},
{
"name": "HTML",
"bytes": "134"
},
{
"name": "JavaScript",
"bytes": "2128"
},
{
"name": "Makefile",
"bytes": "2763"
},
{
"name": "Python",
"bytes": "3294722"
},
{
"name": "Ruby",
"bytes": "40061"
},
{
"name": "Shell",
"bytes": "4058"
},
{
"name": "VimL",
"bytes": "5034489"
}
],
"symlink_target": ""
} |
<?php
namespace NextEvent\PHPSDK\Service;
use GuzzleHttp\Client as HTTPClient;
use GuzzleHttp\Exception\ClientException;
use NextEvent\PHPSDK\Exception\APIResponseException;
use NextEvent\PHPSDK\Exception\InvalidArgumentException;
use NextEvent\PHPSDK\Exception\PaymentNotFoundException;
use NextEvent\PHPSDK\Model\APIResponse;
use NextEvent\PHPSDK\Model\Payment;
use NextEvent\PHPSDK\Model\Token;
use NextEvent\PHPSDK\Util\Env;
use NextEvent\PHPSDK\Util\Log\Logger;
use Psr\Log\LoggerInterface;
/**
*
* Utility class for connecting to NextEvent's Payment Service API
*
* @internal
* @package NextEvent\PHPSDK\Service
*/
class PaymentClient
{
/**
* @var HTTPClient
*/
protected $httpClient;
/**
* @var LoggerInterface
*/
protected $logger;
/**
* PaymentClient constructor
*
* @param LoggerInterface $logger
*/
public function __construct($logger)
{
$this->logger = Logger::wrapLogger($logger);
$verify = true;
if (Env::getEnv() === 'TEST' || Env::getEnv() === 'DEV') {
$verify = false;
}
$httpClientDefaults = [
'headers' => ['Accept' => 'application/json'],
'timeout' => 10,
'verify' => $verify
];
// reflect user language in SDK requests
if (Env::getVar('locale')) {
$httpClientDefaults['headers']['Accept-Language'] = Env::getVar('locale');
} else if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$httpClientDefaults['headers']['Accept-Language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
$this->httpClient = new HTTPClient(
[
'base_uri' => Env::getVar('payment_service_url'),
'defaults' => $httpClientDefaults
]
);
}
/**
* Settle payment
*
* Confirm successful payment for the previously requested authorization
*
* @param Token $paymentToken Payment service access token
* @param Payment $payment Payment authorization object
* @param array $customer customer information
* @param string $transactionId Reference transaction-id if you have one
* @return array Hash array with Payment transaction data
* @throws PaymentNotFoundException
* @throws APIResponseException
* @throws \Exception
*/
public function settlePayment(
$paymentToken,
$payment,
$customer,
$transactionId = null
)
{
if (!($payment instanceof Payment && $payment->isValid() && !$payment->isExpired())) {
throw new InvalidArgumentException('require $payment argument to be instance of \NextEvent\PHPSDK\Model\Payment');
}
$options = [
'headers' => ['Authorization' => $paymentToken->getAuthorizationHeader()],
'json' => [
'uuid' => $payment->getUUID(),
'reference' => $payment->getReference(),
'authorization' => $payment->getAuthorization(),
'status' => 'settled',
'transaction-id' => $transactionId,
'customer' => $customer
]
];
try {
$response = $this->httpClient->post('/payment/ipn/external', $options);
if ($response->getStatusCode() !== 200)
throw new APIResponseException('Unexpected response', $response->getStatusCode());
$apiResponse = new APIResponse($response);
$this->logger->info('Payment successfully settled',
array_merge(
['invoiceUUID' => $payment->getUUID(), 'transactionId' => $transactionId, 'result' => $apiResponse->getContent()],
$apiResponse->toLogContext()
)
);
return (array)$apiResponse->getContent() + ['requestId' => $apiResponse->getRequestID()];
} catch (ClientException $ex) {
if ($ex->getResponse()->getStatusCode() === 404) {
$this->logger->error('Payment settlement failed: PaymentNotFound', ['invoiceUUID' => $payment->getUUID(), 'transactionId' => $transactionId]);
throw new PaymentNotFoundException($ex);
} else {
$this->logger->error('Payment settlement failed', ['invoiceUUID' => $payment->getUUID(), 'transactionId' => $transactionId, 'exception' => $ex->getMessage()]);
throw new APIResponseException($ex);
}
}
}
/**
* Abort payment with reason
*
* @param Token $paymentToken Payment service access token
* @param Payment $payment Payment authorization object
* @param string $reason Reason why payment is aborted
* @return bool True if service accepted the cancellation
* @throws PaymentNotFoundException
* @throws APIResponseException
* @throws \Exception
*/
public function abortPayment($paymentToken, $payment, $reason)
{
if (!($payment instanceof Payment && $payment->isValid())) {
throw new InvalidArgumentException('require $payment argument to be instance of \NextEvent\PHPSDK\Model\Payment');
}
$options = [
'headers' => ['Authorization' => $paymentToken->getAuthorizationHeader()],
'json' => [
'uuid' => $payment->getUUID(),
'reference' => $payment->getReference(),
'authorization' => $payment->getAuthorization(),
'status' => 'aborted',
'reason' => $reason
]
];
try {
$response = $this->httpClient->post('/payment/ipn/external', $options);
$success = $response->getStatusCode() === 200;
$apiResponse = new APIResponse($response);
$this->logger->info(
$success ? 'Payment aborted' : 'Payment not aborted',
array_merge(
['success' => $success, 'invoiceUUID' => $payment->getUUID(), 'result' => $apiResponse->getContent()],
$apiResponse->toLogContext()
)
);
return $success;
} catch (ClientException $ex) {
if ($ex->getResponse()->getStatusCode() === 404) {
$this->logger->error('Payment abortion failed: PaymentNotFound', ['invoiceUUID' => $payment->getUUID()]);
throw new PaymentNotFoundException($ex);
} else {
$this->logger->error('Payment abortion failed', ['invoiceUUID' => $payment->getUUID(), 'exception' => $ex->getMessage()]);
throw new APIResponseException($ex);
}
}
}
}
| {
"content_hash": "a61991f51f11a703b624c167d7b7bcf0",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 167,
"avg_line_length": 33,
"alnum_prop": 0.6350389137274384,
"repo_name": "nextevent-com/php-sdk",
"id": "599146dc8abd5ec1d5d70700657cffa935fb6da9",
"size": "6039",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Service/PaymentClient.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3573"
},
{
"name": "PHP",
"bytes": "244488"
}
],
"symlink_target": ""
} |
package gov.nih.nci.nbia.deletion;
import java.io.File;
import java.io.FilenameFilter;
import java.util.List;
import java.util.Map;
/**
* Image File Deletion Service Implementation
* @author zhoujim
*
*/
public class ImageFileDeletionServiceImpl implements ImageFileDeletionService {
public void removeImageFiles(Map<String, List<String>> files)
{
List<String> dicomFilePath = files.get("dicom");
if (dicomFilePath != null && dicomFilePath.size() > 0)
{
removeImageFiles(dicomFilePath);
}
List<String> annotationFilePath = files.get("annotation");
if (annotationFilePath != null && annotationFilePath.size() > 0)
{
removeAnnotationFiles(annotationFilePath);
}
}
public void removeImageFiles(List<String> fileNames)
{
for (String path : fileNames)
{
File file = new File(path);
file.delete();
}
removeRelatedFile(fileNames);
}
/**
* Remove all thumb nail images
* @param fileNames
*/
public void removeRelatedFile(List<String> fileNames)
{
for (String name : fileNames)
{
File f = new File(name);
String dir = f.getParent();
if (dir == null) // avoid null point exception
{
dir = ".";
}
String fileName = f.getName();
File directory = new File(dir);
ThumbNailFileFilter tnff = new ThumbNailFileFilter();
tnff.setPattern(fileName+"[");
String[] filterName = directory.list(tnff);
//Not CTP upload files, it is MIRC uploaded Files
if (filterName == null || filterName.length <= 0)
{
removeMIRCRelatedFile(dir, fileName);
}
//remove CTP uploaded files
else
{
for (String s : filterName)
{
File deleteFile = new File(dir+File.separator+s);
if (deleteFile != null)
{
deleteFile.delete();
}
}
}
}
}
public void removeMIRCRelatedFile(String dir, String name)
{
File directory = new File(dir);
String fileNameWithoutExt = name.substring(0, name.lastIndexOf('.'));
ThumbNailFileFilter tnff = new ThumbNailFileFilter();
tnff.setPattern(fileNameWithoutExt+"_");
String[] filterName = directory.list(tnff);
if (filterName == null)
{
return;
}
for (String s : filterName)
{
System.out.println("file: " + dir + "/"+s);
File deleteFile = new File(dir + File.separator + s);
if (deleteFile != null)
{
deleteFile.delete();
}
}
}
/**
* find the corrected Image JPEG file
* @author zhoujim
*
*/
public class ThumbNailFileFilter implements FilenameFilter
{
String pattern = "";
public void setPattern(String str)
{
pattern = str;
}
public boolean accept(File dir, String name)
{
return name.startsWith(pattern);
}
}
public void removeAnnotationFiles(List<String> fileNames)
{
for (String path : fileNames)
{
File file = new File(path);
file.delete();
}
}
}
| {
"content_hash": "6e2cca084dcc9eda89c88f65854082f8",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 21.9609375,
"alnum_prop": 0.6613304873710424,
"repo_name": "NCIP/national-biomedical-image-archive",
"id": "e98d4680df6812bdaebab1daeef3d86c31271cc5",
"size": "3018",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "software/nbia-dao/src/gov/nih/nci/nbia/deletion/ImageFileDeletionServiceImpl.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "300"
},
{
"name": "CSS",
"bytes": "24518"
},
{
"name": "Groovy",
"bytes": "38152"
},
{
"name": "HTML",
"bytes": "683022"
},
{
"name": "Java",
"bytes": "4480887"
},
{
"name": "JavaScript",
"bytes": "109669"
},
{
"name": "PLSQL",
"bytes": "35795"
},
{
"name": "Perl",
"bytes": "4919"
},
{
"name": "Shell",
"bytes": "744"
},
{
"name": "XSLT",
"bytes": "215237"
}
],
"symlink_target": ""
} |
package workbench.gui.editor;
import workbench.resource.ResourceMgr;
import workbench.gui.completion.InsertColumnMatcher;
import workbench.gui.completion.ParameterTipProvider;
import workbench.gui.sql.EditorPanel;
import workbench.gui.sql.SqlPanel;
import workbench.sql.parser.ScriptParser;
/**
* A class to provide tooltips for an INSERT statement.
*
* @author Thomas Kellerer
*/
public class InsertTipProvider
implements ParameterTipProvider
{
private SqlPanel sqlPanel;
private int lastCommandStart = Integer.MAX_VALUE;
private int lastCommandEnd = -1;
private String lastCommand;
private long lastParseTime = 0;
public InsertTipProvider(SqlPanel panel)
{
this.sqlPanel = panel;
}
@Override
public String getCurrentTooltip()
{
EditorPanel editor = sqlPanel.getEditor();
int currentPosition = editor.getCaretPosition();
// Cache the last used statement (and it's bounds), so that we do not need
// to parse the whole editor script each time a tooltip is requested
if (editor.isModifiedAfter(lastParseTime) || currentPosition < lastCommandStart || currentPosition > lastCommandEnd)
{
lastParseTime = System.currentTimeMillis();
ScriptParser parser = ScriptParser.createScriptParser(sqlPanel.getConnection());
parser.setScript(editor.getText());
int index = parser.getCommandIndexAtCursorPos(editor.getCaretPosition());
if (index < 0)
{
return null;
}
lastCommand = parser.getCommand(index);
lastCommandStart = parser.getStartPosForCommand(index);
lastCommandEnd = parser.getEndPosForCommand(index);
}
if (lastCommand == null)
{
lastParseTime = 0;
lastCommandStart = Integer.MAX_VALUE;
lastCommandEnd = 0;
return null;
}
int positionInStatement = currentPosition - lastCommandStart;
InsertColumnMatcher matcher = new InsertColumnMatcher(sqlPanel.getConnection(), lastCommand);
String tip = matcher.getTooltipForPosition(positionInStatement);
if (tip == null)
{
if (matcher.inColumnList(positionInStatement))
{
tip = ResourceMgr.getString("ErrNoInsertVal");
}
if (matcher.inValueList(positionInStatement))
{
tip = ResourceMgr.getString("ErrNoInsertCol");
}
}
return tip;
}
}
| {
"content_hash": "983d62bd9554ee79041bc52378c851e8",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 118,
"avg_line_length": 27.625,
"alnum_prop": 0.7520361990950226,
"repo_name": "Taller/sqlworkbench-plus",
"id": "c89a784cb187709b1a1f0920d4f15464a3ecc97e",
"size": "2999",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/workbench/gui/editor/InsertTipProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4060"
},
{
"name": "CSS",
"bytes": "4714"
},
{
"name": "HTML",
"bytes": "103882"
},
{
"name": "Java",
"bytes": "12464050"
},
{
"name": "Lex",
"bytes": "53858"
},
{
"name": "Shell",
"bytes": "2206"
},
{
"name": "Visual Basic",
"bytes": "1211"
},
{
"name": "XSLT",
"bytes": "231405"
}
],
"symlink_target": ""
} |
Create a new Luya Project
================
First of all you have to install the `fxp/composer-asset-plugin` plugin, which is required by Yii to install bower packages via composer:
```
composer global require "fxp/composer-asset-plugin:1.0.3"
```
Open your Terminal and execute the `create-project` to checkout the kickstarter/example project.
```
composer create-project zephir/luya-kickstarter:dev-master
```
This above command will create a folder (inside of your current folder where the `composer create-project` command was execute) named __luya-kickstarter__. After the command is finished (can take some time) you can move all the files where ever you want to have them.
Go into your configs folder inside your application and copy the dist template files to original php files:
```
cp server.php.dist server.php
cp prep.php.dist prep.php
cp local.php.dist local.php
```
Now change the database connection inside the `configs/local.php` file to your custom config. You should open all config files once to change values and understand the behavior. After successfully setting up your database connection, you have to reopen your Terminal and change into your project `public_html` directory:
```
cd /path/to/your/project/public_html
```
now execute the php command
```
php index.php migrate
```
It will ask for your permissions to execute the database migrations.
now execute the php command:
```
php index.php setup
```
The setup proccess will ask you for an email and password to store your personal login data inside the database (of course the password will be encrypted).
You can now log in into your administration interface http://localhost/project/__admin__. When you have successfull logged into the administration area, navigate to __Administration -> Gruppen__ click on `Berechtigung` in the first group. A modal dialog will display all rights, select all and save. Now you have the ability to administrate all sections. enjoy!
PHP Settings
------------
|Config |Value
|--- |----
|short_open_tags | 1
|memory_limit |512
|max_execution_time|60
|post_max_size|16M
|upload_max_filesize|16M | {
"content_hash": "570c1272f2fc7a7f5a66c6079a7caf92",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 362,
"avg_line_length": 36.03389830508475,
"alnum_prop": 0.7605832549388523,
"repo_name": "cangsalak/luya",
"id": "5dbfb56b73345452e2d68e3a0d0f1e78bfe8424a",
"size": "2126",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/guide/en/install.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1306"
},
{
"name": "CSS",
"bytes": "180627"
},
{
"name": "HTML",
"bytes": "2264"
},
{
"name": "JavaScript",
"bytes": "104522"
},
{
"name": "PHP",
"bytes": "634492"
},
{
"name": "Ruby",
"bytes": "1408"
},
{
"name": "Shell",
"bytes": "1638"
}
],
"symlink_target": ""
} |
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/input/TeX/config.js
*
* Initializes the TeX InputJax (the main definition is in
* MathJax/jax/input/TeX/jax.js, which is loaded when needed).
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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.
*/
MathJax.InputJax.TeX = MathJax.InputJax({
id: "TeX",
version: "2.7.5",
directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
config: {
TagSide: "right",
TagIndent: "0.8em",
MultLineWidth: "85%",
equationNumbers: {
autoNumber: "none", // "AMS" for standard AMS numbering,
// or "all" for all displayed equations
formatNumber: function (n) {return n},
formatTag: function (n) {return '('+n+')'},
formatID: function (n) {return 'mjx-eqn-'+String(n).replace(/\s/g,"_")},
formatURL: function (id,base) {return base+'#'+encodeURIComponent(id)},
useLabelIds: true
}
},
resetEquationNumbers: function () {} // filled in by AMSmath extension
});
MathJax.InputJax.TeX.Register("math/tex");
MathJax.InputJax.TeX.loadComplete("config.js");
| {
"content_hash": "6199d31ab38b783b1f7d4049b191f1c4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 82,
"avg_line_length": 36.2037037037037,
"alnum_prop": 0.6046035805626598,
"repo_name": "amueller/odsc-masterclass-2017-morning",
"id": "3750b3d8307ae6e306abd5ac184fe8ed42d99d80",
"size": "1955",
"binary": false,
"copies": "15",
"ref": "refs/heads/master",
"path": "slides/MathJax/unpacked/jax/input/TeX/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "151727"
},
{
"name": "Python",
"bytes": "3704"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "09687af5ed8373b9de5a133ede0da1e7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "761ff2b5794c39727c5b20f7972d68630874e4e2",
"size": "198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Echinofossulocactus/Echinofossulocactus violaciflorus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
require 'rails_helper'
RSpec.describe StarMathImporter do
describe '#import_row' do
context 'math file' do
let(:file) { File.open("#{Rails.root}/spec/fixtures/fake_star_math.csv") }
let(:transformer) { StarMathCsvTransformer.new }
let(:csv) { transformer.transform(file) }
let(:math_importer) { described_class.new }
let(:import) { csv.each { |row| math_importer.import_row(row) } }
context 'with good data' do
context 'existing student' do
let!(:student) { FactoryGirl.create(:student_we_want_to_update) }
it 'creates a new student assessment' do
expect { import }.to change { StudentAssessment.count }.by 1
end
it 'creates a new STAR MATH assessment' do
import
student_assessment = StudentAssessment.last
assessment = student_assessment.assessment
expect(assessment.family).to eq "STAR"
expect(assessment.subject).to eq "Mathematics"
end
it 'sets math percentile rank correctly' do
import
expect(StudentAssessment.last.percentile_rank).to eq 70
end
it 'sets date taken correctly' do
import
expect(StudentAssessment.last.date_taken).to eq Date.new(2015, 1, 21)
end
it 'does not create a new student' do
expect { import }.to change(Student, :count).by 0
end
end
context 'student does not exist' do
it 'does not create a new student assessment' do
expect { import }.to change { StudentAssessment.count }.by 0
end
it 'does not create a new student' do
expect { import }.to change(Student, :count).by 0
end
end
end
context 'with bad data' do
let(:file) { File.open("#{Rails.root}/spec/fixtures/bad_star_reading_data.csv") }
let(:transformer) { StarMathCsvTransformer.new }
let(:csv) { transformer.transform(file) }
let(:math_importer) { StarMathImporter.new }
it 'raises an error' do
expect { import }.to raise_error NoMethodError
end
end
end
end
end
| {
"content_hash": "dd8958076cb803e04b4346254975c6d2",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 89,
"avg_line_length": 35.20634920634921,
"alnum_prop": 0.5960324616771867,
"repo_name": "erose/studentinsights",
"id": "cb85a9c86e0cfab571a370933524f892f88daafd",
"size": "2218",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/importers/file_importers/star_math_importer_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15335"
},
{
"name": "Emacs Lisp",
"bytes": "93"
},
{
"name": "HTML",
"bytes": "32104"
},
{
"name": "JavaScript",
"bytes": "354531"
},
{
"name": "Ruby",
"bytes": "394735"
},
{
"name": "Shell",
"bytes": "22198"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Keyframes test</title>
<style type="text/css" media="screen">
#box {
position: absolute;
left: 0;
top: 100px;
height: 100px;
width: 100px;
background-color: blue;
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "anim";
-webkit-animation-iteration-count: 0.3;
}
@-webkit-keyframes "anim" {
from { left: 50px; }
20% { left: 100px; }
40% { left: 100px; }
60% { left: 200px; }
80% { left: 200px; }
to { left: 300px; }
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
document.addEventListener("webkitAnimationEnd", function(event){
var result;
if (event.elapsedTime > 0 && event.elapsedTime < 1)
result = "PASS end of animation";
else
result = "FAIL end of animation";
document.getElementById('result').innerHTML = result;
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>
</head>
<body>
This test performs an animation of the left property with a non integer iteration count.
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>
| {
"content_hash": "e943f299ed7ef639ba4d432678414819",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 102,
"avg_line_length": 28.661016949152543,
"alnum_prop": 0.5860437610881135,
"repo_name": "crosswalk-project/blink-crosswalk-efl",
"id": "450ee30348a0a29be9453c865dbf84febd407d1a",
"size": "1691",
"binary": false,
"copies": "4",
"ref": "refs/heads/efl/crosswalk-10/39.0.2171.19",
"path": "LayoutTests/animations/keyframes-iteration-count-non-integer.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "14584"
},
{
"name": "Bison",
"bytes": "64128"
},
{
"name": "C",
"bytes": "1509300"
},
{
"name": "C++",
"bytes": "40536721"
},
{
"name": "CSS",
"bytes": "531170"
},
{
"name": "Java",
"bytes": "66510"
},
{
"name": "JavaScript",
"bytes": "26453909"
},
{
"name": "Makefile",
"bytes": "653"
},
{
"name": "Objective-C",
"bytes": "31620"
},
{
"name": "Objective-C++",
"bytes": "377325"
},
{
"name": "PHP",
"bytes": "167892"
},
{
"name": "Perl",
"bytes": "583834"
},
{
"name": "Python",
"bytes": "3857224"
},
{
"name": "Ruby",
"bytes": "141818"
},
{
"name": "Shell",
"bytes": "8923"
},
{
"name": "XSLT",
"bytes": "49099"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Parmelia camtschadalis var. subamericana Zahlbr.
### Remarks
null | {
"content_hash": "cfc3575237dfcb5e81c9e0930e6939f4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 11.76923076923077,
"alnum_prop": 0.7320261437908496,
"repo_name": "mdoering/backbone",
"id": "6c3b2d1ba21b3ab5c893fc786428b8c3293d38a6",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Parmeliaceae/Xanthoparmelia/Xanthoparmelia camtschadalis/Parmelia camtschadalis subamericana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.kuali.kra.irb.actions.submit;
import org.kuali.kra.drools.brms.FactBean;
import org.kuali.kra.irb.Protocol;
import org.kuali.kra.irb.actions.ProtocolAction;
/*
* This is the post condition attributes for a protocol action
*/
public class ProtocolUndoActionMapping implements FactBean {
String actionTypeCode;
String submissionTypeCode;
String protocolStatusCode;
boolean protocolSubmissionToBeDeleted = false;
Protocol protocol;
ProtocolSubmission protocolSubmission;
ProtocolAction protocolAction;
public ProtocolUndoActionMapping(String actionTypeCode, String submissionTypeCode, String protocolStatusCode) {
super();
this.actionTypeCode=actionTypeCode;
this.submissionTypeCode = submissionTypeCode;
this.protocolStatusCode = protocolStatusCode;
}
public ProtocolSubmission getProtocolSubmission() {
return protocolSubmission;
}
public void setProtocolSubmission(ProtocolSubmission protocolSubmission) {
this.protocolSubmission = protocolSubmission;
}
public String getActionTypeCode() {
return actionTypeCode;
}
public void setActionTypeCode(String actionTypeCode) {
this.actionTypeCode = actionTypeCode;
}
public String getSubmissionTypeCode() {
return submissionTypeCode;
}
public void setSubmissionTypeCode(String submissionTypeCode) {
this.submissionTypeCode = submissionTypeCode;
}
public String getProtocolStatusCode() {
return protocolStatusCode;
}
public void setProtocolStatusCode(String protocolStatusCode) {
this.protocolStatusCode = protocolStatusCode;
}
public Protocol getProtocol() {
return protocol;
}
public void setProtocol(Protocol protocol) {
this.protocol = protocol;
}
public ProtocolAction getProtocolAction() {
return protocolAction;
}
public void setProtocolAction(ProtocolAction protocolAction) {
this.protocolAction = protocolAction;
}
public boolean isProtocolSubmissionToBeDeleted() {
return protocolSubmissionToBeDeleted;
}
public void setProtocolSubmissionToBeDeleted(boolean protocolSubmissionToBeDeleted) {
this.protocolSubmissionToBeDeleted = protocolSubmissionToBeDeleted;
}
}
| {
"content_hash": "f021732eff827c0ad721be5154011d7b",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 115,
"avg_line_length": 27.238636363636363,
"alnum_prop": 0.7150604922820192,
"repo_name": "vivantech/kc_fixes",
"id": "b61857bc6daa5c63d0f42340ec35c0b3a58301c7",
"size": "3020",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/kuali/kra/irb/actions/submit/ProtocolUndoActionMapping.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "595"
},
{
"name": "CSS",
"bytes": "1277181"
},
{
"name": "HTML",
"bytes": "21478104"
},
{
"name": "Java",
"bytes": "25178010"
},
{
"name": "JavaScript",
"bytes": "7250670"
},
{
"name": "PHP",
"bytes": "15534"
},
{
"name": "PLSQL",
"bytes": "374321"
},
{
"name": "Perl",
"bytes": "1278"
},
{
"name": "Scheme",
"bytes": "8283377"
},
{
"name": "Shell",
"bytes": "1100"
},
{
"name": "XSLT",
"bytes": "17866049"
}
],
"symlink_target": ""
} |
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. xml to make Docutils-native XML files
echo. pseudoxml to make pseudoxml-XML files for display purposes
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\DjangoCTEForest.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\DjangoCTEForest.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf
cd %BUILDDIR%/..
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "latexpdfja" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
cd %BUILDDIR%/latex
make all-pdf-ja
cd %BUILDDIR%/..
echo.
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
if "%1" == "xml" (
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The XML files are in %BUILDDIR%/xml.
goto end
)
if "%1" == "pseudoxml" (
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
goto end
)
:end
| {
"content_hash": "58cf5da6357f2d638d877d205b519393",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 79,
"avg_line_length": 27.760330578512395,
"alnum_prop": 0.6757963679666568,
"repo_name": "feincms/form_designer",
"id": "d9222830355fe9b6935b0694ef870d754b484d0d",
"size": "6718",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "docs/make.bat",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "443"
},
{
"name": "HTML",
"bytes": "1447"
},
{
"name": "Python",
"bytes": "50952"
}
],
"symlink_target": ""
} |
import { TestSuite, Test, BeforeAll } from "jec-juta";
import { expect } from "chai";
import { DomainConfigImpl } from "../../../../../../src/com/onsoft/glasscat/context/domains/DomainConfigImpl";
import { DomainConfig } from "jec-glasscat-config";
@TestSuite({
description: "Test the DomainConfigImpl class properties"
})
export class DomainConfigImplTest {
public config:DomainConfig = null;
@BeforeAll()
public initTest():void {
this.config = new DomainConfigImpl();
}
@Test({
description: "should have a 'domains' property set to 'null'"
})
public domainsTest():void {
expect(this.config).to.have.property("domains", null);
}
} | {
"content_hash": "fcfe6c59d52c69914d41b7dcbe3e41a6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 110,
"avg_line_length": 27.708333333333332,
"alnum_prop": 0.6902255639097744,
"repo_name": "pechemann/jec-glasscat-core",
"id": "9eb655a3316fb3b0dbbe9f75abead58699933122",
"size": "1348",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/com/onsoft/glasscat/context/domains/DomainConfigImplTest.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "987"
},
{
"name": "JavaScript",
"bytes": "4256"
},
{
"name": "TypeScript",
"bytes": "1090066"
}
],
"symlink_target": ""
} |
package ru.napadovskiu.servlets;
import ru.napadovskiu.store.UserStore;
import ru.napadovskiu.users.User;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Timestamp;
import java.util.concurrent.CopyOnWriteArrayList;
public class UserServlet extends HttpServlet {
private final UserStore usersStore = UserStore.getInstance();
/**
*
* @param req
* @param resp
* @throws ServletException
* @throws IOException
*/
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
CopyOnWriteArrayList<User> arrayList = usersStore.selectAllUser();
resp.setContentType("text/html");
PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
// for (User user: arrayList) {
// printWriter.append("user name :" + user.getName() + " user login: " + user.getLogin() + " user email: " + user.getEmail() + "\n");
// }
printWriter.flush();
}
/**
*
* @param req
* @param resp
* @throws ServletException
* @throws IOException
*/
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
String responce;
Timestamp dateOfCreate = new Timestamp(System.currentTimeMillis());
User user = new User(req.getParameter("name"), req.getParameter("login"), req.getParameter("email"), dateOfCreate);
boolean result = this.usersStore.addUser(user);
if (result) {
responce = "User add successfully, user name: " + user.getName() + " user login: " + user.getLogin() + " user email " + user.getEmail();
} else {
responce = "It's not possible to add a user";
}
printWriter.write(responce);
printWriter.flush();
}
/**
*
* @param req
* @param resp
* @throws ServletException
* @throws IOException
*/
@Override
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
String responce;
String email = req.getParameter("email");
String name = req.getParameter("name");
String login = req.getParameter("login");
boolean result = this.usersStore.updateUser(name, login, email);
if (result) {
responce = "User update successfully";
} else {
responce = "It's not possible to add a user";
}
printWriter.write(responce);
printWriter.flush();
}
/**
*
* @param req
* @param resp
* @throws ServletException
* @throws IOException
*/
@Override
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/html");
String responce;
String email = req.getParameter("email");
PrintWriter printWriter = new PrintWriter(resp.getOutputStream());
boolean result = this.usersStore.deleteUser(email);
if (result) {
responce = "User delete successfully";
} else {
responce = "User with email " + email + " do not exist";
}
printWriter.write(responce);
printWriter.flush();
}
}
| {
"content_hash": "828db10e798af0d8b9da35805927f892",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 148,
"avg_line_length": 32.78260869565217,
"alnum_prop": 0.6408488063660478,
"repo_name": "bessovistnyj/jvm-byte-code",
"id": "1350db3e8e45e9eb6447320a0c9b608dcb48742b",
"size": "3770",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ServletJSP/2.CrudServlet/src/main/java/ru/napadovskiu/servlets/UserServlet.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5013"
},
{
"name": "Java",
"bytes": "810013"
},
{
"name": "JavaScript",
"bytes": "20360"
},
{
"name": "XSLT",
"bytes": "532"
}
],
"symlink_target": ""
} |
* Take the VS solution `Methods` and refactor its code to follow the guidelines of high-quality methods.
* Ensure:
* you handle errors correctly
* when the methods cannot do what their name says, throw an exception (do not return wrong result).
* good cohesion and coupling
* good naming
* no side effects, etc. | {
"content_hash": "7f22cf41a8e9d2eef526255895404f62",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 104,
"avg_line_length": 45.285714285714285,
"alnum_prop": 0.7539432176656151,
"repo_name": "ilian1902/TelerikAcademy",
"id": "403569d4030e5a05121483afcc7b567c8c9f892f",
"size": "377",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "HightQualityCode/Homework/Methods - Homework/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1217372"
},
{
"name": "CSS",
"bytes": "60008"
},
{
"name": "HTML",
"bytes": "123301"
},
{
"name": "JavaScript",
"bytes": "39370"
}
],
"symlink_target": ""
} |
from pyspider.libs.base_handler import *
class Handler(BaseHandler):
'''
this is a sample handler
'''
@every(minutes=24 * 60, seconds=0)
def on_start(self):
self.crawl('http://scrapy.org/', callback=self.index_page)
@config(age=10 * 24 * 60 * 60)
def index_page(self, response):
for each in response.doc('a[href^="http://"]').items():
self.crawl(each.attr.href, callback=self.detail_page)
def detail_page(self, response):
return {
"url": response.url,
"title": response.doc('title').text(),
}
| {
"content_hash": "c5b27bde3d050279b72aed845c9a096f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 27.181818181818183,
"alnum_prop": 0.5769230769230769,
"repo_name": "t4skforce/pyspider",
"id": "d973bdaa916d00abaad2e423092245700046d155",
"size": "718",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "pyspider/libs/sample_handler.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "21118"
},
{
"name": "JavaScript",
"bytes": "34090"
},
{
"name": "Python",
"bytes": "271384"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FluentAssertions.Json.Net45.Specs")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("FluentAssertions.Json.Net45.Specs")]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("63a1554c-db57-463a-9df4-2748eb403dd9")]
| {
"content_hash": "ed57180eb4d4d90cff1c3e43cb1fe9d7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 84,
"avg_line_length": 46,
"alnum_prop": 0.7926421404682275,
"repo_name": "msackton/FluentAssertions",
"id": "686f5cf3dbb791eca5e2198053db15a3f003d1e1",
"size": "600",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Tests/FluentAssertions.Json.Net45.Specs/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "691"
},
{
"name": "C#",
"bytes": "3539401"
},
{
"name": "PowerShell",
"bytes": "48311"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for ol/renderer/canvas/canvasvectortilelayerrenderer.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../../prettify.css" />
<link rel="stylesheet" href="../../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../../index.html">all files</a> / <a href="index.html">ol/renderer/canvas/</a> canvasvectortilelayerrenderer.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">87.61% </span>
<span class="quiet">Statements</span>
<span class='fraction'>198/226</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">61.11% </span>
<span class="quiet">Branches</span>
<span class='fraction'>44/72</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.61% </span>
<span class="quiet">Lines</span>
<span class='fraction'>198/226</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">42×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-no"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">goog.provide('ol.renderer.canvas.VectorTileLayer');
goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.vec.Mat4');
goog.require('ol.Feature');
goog.require('ol.TileRange');
goog.require('ol.TileState');
goog.require('ol.VectorTile');
goog.require('ol.ViewHint');
goog.require('ol.dom');
goog.require('ol.extent');
goog.require('ol.layer.VectorTile');
goog.require('ol.proj.Units');
goog.require('ol.render.EventType');
goog.require('ol.render.canvas.ReplayGroup');
goog.require('ol.renderer.canvas.Layer');
goog.require('ol.renderer.vector');
goog.require('ol.size');
goog.require('ol.source.VectorTile');
goog.require('ol.tilecoord');
goog.require('ol.vec.Mat4');
/**
* @constructor
* @extends {ol.renderer.canvas.Layer}
* @param {ol.layer.VectorTile} layer VectorTile layer.
*/
ol.renderer.canvas.VectorTileLayer = function(layer) {
goog.base(this, layer);
/**
* @private
* @type {CanvasRenderingContext2D}
*/
this.context_ = ol.dom.createCanvasContext2D();
/**
* @private
* @type {boolean}
*/
this.dirty_ = false;
/**
* @private
* @type {Array.<ol.VectorTile>}
*/
this.renderedTiles_ = [];
/**
* @private
* @type {ol.Extent}
*/
this.tmpExtent_ = ol.extent.createEmpty();
/**
* @private
* @type {ol.Size}
*/
this.tmpSize_ = [NaN, NaN];
/**
* @private
* @type {!goog.vec.Mat4.Number}
*/
this.tmpTransform_ = goog.vec.Mat4.createNumber();
};
goog.inherits(ol.renderer.canvas.VectorTileLayer, ol.renderer.canvas.Layer);
/**
* @inheritDoc
*/
ol.renderer.canvas.VectorTileLayer.prototype.composeFrame =
function(frameState, layerState, context) {
var pixelRatio = frameState.pixelRatio;
var skippedFeatureUids = layerState.managed ?
frameState.skippedFeatureUids : <span class="branch-1 cbranch-no" title="branch not covered" >{};</span>
var viewState = frameState.viewState;
var center = viewState.center;
var projection = viewState.projection;
var resolution = viewState.resolution;
var rotation = viewState.rotation;
var layer = this.getLayer();
var source = layer.getSource();
goog.asserts.assertInstanceof(source, ol.source.VectorTile,
'Source is an ol.source.VectorTile');
var transform = this.getTransform(frameState, 0);
this.dispatchPreComposeEvent(context, frameState, transform);
var replayContext;
<span class="missing-if-branch" title="if path not taken" >I</span>if (layer.hasListener(ol.render.EventType.RENDER)) {
// resize and clear
<span class="cstat-no" title="statement not covered" > this.context_.canvas.width = context.canvas.width;</span>
<span class="cstat-no" title="statement not covered" > this.context_.canvas.height = context.canvas.height;</span>
<span class="cstat-no" title="statement not covered" > replayContext = this.context_;</span>
} else {
replayContext = context;
}
// for performance reasons, context.save / context.restore is not used
// to save and restore the transformation matrix and the opacity.
// see http://jsperf.com/context-save-restore-versus-variable
var alpha = replayContext.globalAlpha;
replayContext.globalAlpha = layerState.opacity;
var tilesToDraw = this.renderedTiles_;
var tileGrid = source.getTileGrid();
var currentZ, i, ii, origin, scale, tile, tileExtent, tileSize;
var tilePixelRatio, tilePixelResolution, tilePixelSize, tileResolution;
for (i = 0, ii = tilesToDraw.length; i < ii; ++i) {
tile = tilesToDraw[i];
currentZ = tile.getTileCoord()[0];
tileSize = tileGrid.getTileSize(currentZ);
tilePixelSize = source.getTilePixelSize(currentZ, pixelRatio, projection);
tilePixelRatio = tilePixelSize[0] /
ol.size.toSize(tileSize, this.tmpSize_)[0];
tileResolution = tileGrid.getResolution(currentZ);
tilePixelResolution = tileResolution / tilePixelRatio;
<span class="missing-if-branch" title="if path not taken" >I</span>if (tile.getProjection().getUnits() == ol.proj.Units.TILE_PIXELS) {
<span class="cstat-no" title="statement not covered" > origin = ol.extent.getTopLeft(tileGrid.getTileCoordExtent(</span>
tile.getTileCoord(), this.tmpExtent_));
<span class="cstat-no" title="statement not covered" > transform = ol.vec.Mat4.makeTransform2D(this.tmpTransform_,</span>
pixelRatio * frameState.size[0] / 2,
pixelRatio * frameState.size[1] / 2,
pixelRatio * tilePixelResolution / resolution,
pixelRatio * tilePixelResolution / resolution,
viewState.rotation,
(origin[0] - center[0]) / tilePixelResolution,
(center[1] - origin[1]) / tilePixelResolution);
}
tile.getReplayState().replayGroup.replay(replayContext, pixelRatio,
transform, rotation, skippedFeatureUids);
}
transform = this.getTransform(frameState, 0);
<span class="missing-if-branch" title="if path not taken" >I</span>if (replayContext != context) {
<span class="cstat-no" title="statement not covered" > this.dispatchRenderEvent(replayContext, frameState, transform);</span>
<span class="cstat-no" title="statement not covered" > context.drawImage(replayContext.canvas, 0, 0);</span>
}
replayContext.globalAlpha = alpha;
this.dispatchPostComposeEvent(context, frameState, transform);
};
/**
* @param {ol.VectorTile} tile Tile.
* @param {ol.layer.VectorTile} layer Vector tile layer.
* @param {number} pixelRatio Pixel ratio.
*/
ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
layer, pixelRatio) {
var revision = layer.getRevision();
var renderOrder = layer.getRenderOrder() || null;
var replayState = tile.getReplayState();
<span class="missing-if-branch" title="if path not taken" >I</span>if (!replayState.dirty && replayState.renderedRevision == revision &&
<span class="branch-2 cbranch-no" title="branch not covered" > replayState.renderedRenderOrder == renderOrder)</span> {
<span class="cstat-no" title="statement not covered" > return;</span>
}
// FIXME dispose of old replayGroup in post render
goog.dispose(replayState.replayGroup);
replayState.replayGroup = null;
replayState.dirty = false;
var source = layer.getSource();
goog.asserts.assertInstanceof(source, ol.source.VectorTile,
'Source is an ol.source.VectorTile');
var tileGrid = source.getTileGrid();
var tileCoord = tile.getTileCoord();
var pixelSpace = tile.getProjection().getUnits() == ol.proj.Units.TILE_PIXELS;
var extent;
<span class="missing-if-branch" title="if path not taken" >I</span>if (pixelSpace) {
<span class="cstat-no" title="statement not covered" > var tilePixelSize = source.getTilePixelSize(tileCoord[0], pixelRatio,</span>
tile.getProjection());
<span class="cstat-no" title="statement not covered" > extent = [0, 0, tilePixelSize[0], tilePixelSize[1]];</span>
} else {
extent = tileGrid.getTileCoordExtent(tileCoord);
}
var resolution = tileGrid.getResolution(tileCoord[0]);
var tileResolution = pixelSpace ? <span class="branch-0 cbranch-no" title="branch not covered" >source.getTilePixelRatio() </span>: resolution;
replayState.dirty = false;
var replayGroup = new ol.render.canvas.ReplayGroup(0, extent,
tileResolution, layer.getRenderBuffer());
var squaredTolerance = ol.renderer.vector.getSquaredTolerance(
tileResolution, pixelRatio);
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @this {ol.renderer.canvas.VectorTileLayer}
*/
function renderFeature(feature) {
var styles;
if (feature.getStyleFunction()) {
goog.asserts.assertInstanceof(feature, ol.Feature, 'Got an ol.Feature');
styles = feature.getStyleFunction().call(feature, resolution);
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (layer.getStyleFunction()) {
styles = layer.getStyleFunction()(feature, resolution);
}
<span class="missing-if-branch" title="else path not taken" >E</span>if (styles) {
var dirty = this.renderFeature(feature, squaredTolerance, styles,
replayGroup);
this.dirty_ = this.dirty_ || dirty;
replayState.dirty = replayState.dirty || dirty;
}
}
var features = tile.getFeatures();
<span class="missing-if-branch" title="if path not taken" >I</span>if (renderOrder && <span class="branch-1 cbranch-no" title="branch not covered" >renderOrder !== replayState.renderedRenderOrder)</span> {
<span class="cstat-no" title="statement not covered" > features.sort(renderOrder);</span>
}
features.forEach(renderFeature, this);
replayGroup.finish();
replayState.renderedRevision = revision;
replayState.renderedRenderOrder = renderOrder;
replayState.replayGroup = replayGroup;
};
/**
* @inheritDoc
*/
ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate =
function(coordinate, frameState, callback, thisArg) {
var resolution = frameState.viewState.resolution;
var rotation = frameState.viewState.rotation;
var layer = this.getLayer();
var layerState = frameState.layerStates[goog.getUid(layer)];
/** @type {Object.<string, boolean>} */
var features = {};
var replayables = this.renderedTiles_;
var source = layer.getSource();
goog.asserts.assertInstanceof(source, ol.source.VectorTile,
'Source is an ol.source.VectorTile');
var tileGrid = source.getTileGrid();
var found, tileSpaceCoordinate;
var i, ii, origin, replayGroup;
var tile, tileCoord, tileExtent, tilePixelRatio, tileResolution, tileSize;
for (i = 0, ii = replayables.length; i < ii; ++i) {
tile = replayables[i];
tileCoord = tile.getTileCoord();
tileExtent = source.getTileGrid().getTileCoordExtent(tileCoord,
this.tmpExtent_);
<span class="missing-if-branch" title="if path not taken" >I</span>if (!ol.extent.containsCoordinate(tileExtent, coordinate)) {
<span class="cstat-no" title="statement not covered" > continue;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (tile.getProjection().getUnits() === ol.proj.Units.TILE_PIXELS) {
<span class="cstat-no" title="statement not covered" > origin = ol.extent.getTopLeft(tileExtent);</span>
<span class="cstat-no" title="statement not covered" > tilePixelRatio = source.getTilePixelRatio();</span>
<span class="cstat-no" title="statement not covered" > tileResolution = tileGrid.getResolution(tileCoord[0]) / tilePixelRatio;</span>
<span class="cstat-no" title="statement not covered" > tileSize = ol.size.toSize(tileGrid.getTileSize(tileCoord[0]));</span>
<span class="cstat-no" title="statement not covered" > tileSpaceCoordinate = [</span>
(coordinate[0] - origin[0]) / tileResolution,
(origin[1] - coordinate[1]) / tileResolution
];
<span class="cstat-no" title="statement not covered" > resolution = tilePixelRatio;</span>
} else {
tileSpaceCoordinate = coordinate;
}
replayGroup = tile.getReplayState().replayGroup;
found = found || replayGroup.forEachFeatureAtCoordinate(
tileSpaceCoordinate, resolution, rotation,
layerState.managed ? <span class="branch-0 cbranch-no" title="branch not covered" >frameState.skippedFeatureUids </span>: {},
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {?} Callback result.
*/
function(feature) {
goog.asserts.assert(feature, 'received a feature');
var key = goog.getUid(feature).toString();
if (!(key in features)) {
features[key] = true;
return callback.call(thisArg, feature, layer);
}
});
}
return found;
};
/**
* Handle changes in image style state.
* @param {goog.events.Event} event Image style change event.
* @private
*/
ol.renderer.canvas.VectorTileLayer.prototype.handleStyleImageChange_ =
<span class="fstat-no" title="function not covered" > function(event) {</span>
<span class="cstat-no" title="statement not covered" > this.renderIfReadyAndVisible();</span>
};
/**
* @inheritDoc
*/
ol.renderer.canvas.VectorTileLayer.prototype.prepareFrame =
function(frameState, layerState) {
var layer = /** @type {ol.layer.Vector} */ (this.getLayer());
goog.asserts.assertInstanceof(layer, ol.layer.VectorTile,
'layer is an instance of ol.layer.VectorTile');
var source = layer.getSource();
goog.asserts.assertInstanceof(source, ol.source.VectorTile,
'Source is an ol.source.VectorTile');
this.updateAttributions(
frameState.attributions, source.getAttributions());
this.updateLogos(frameState, source);
var animating = frameState.viewHints[ol.ViewHint.ANIMATING];
var interacting = frameState.viewHints[ol.ViewHint.INTERACTING];
var updateWhileAnimating = layer.getUpdateWhileAnimating();
var updateWhileInteracting = layer.getUpdateWhileInteracting();
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this.dirty_ && (!updateWhileAnimating && animating) ||
(!updateWhileInteracting && interacting)) {
<span class="cstat-no" title="statement not covered" > return true;</span>
}
var extent = frameState.extent;
<span class="missing-if-branch" title="if path not taken" >I</span>if (layerState.extent) {
<span class="cstat-no" title="statement not covered" > extent = ol.extent.getIntersection(extent, layerState.extent);</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if (ol.extent.isEmpty(extent)) {
// Return false to prevent the rendering of the layer.
<span class="cstat-no" title="statement not covered" > return false;</span>
}
var viewState = frameState.viewState;
var projection = viewState.projection;
var resolution = viewState.resolution;
var pixelRatio = frameState.pixelRatio;
var tileGrid = source.getTileGrid();
var resolutions = tileGrid.getResolutions();
var z = resolutions.length - 1;
while (z > 0 && resolutions[z] < resolution) {
--z;
}
var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
this.updateUsedTiles(frameState.usedTiles, source, z, tileRange);
this.manageTilePyramid(frameState, source, tileGrid, pixelRatio,
projection, extent, z, layer.getPreload());
this.scheduleExpireCache(frameState, source);
/**
* @type {Object.<number, Object.<string, ol.VectorTile>>}
*/
var tilesToDrawByZ = {};
tilesToDrawByZ[z] = {};
var findLoadedTiles = this.createLoadedTileFinder(source, projection,
tilesToDrawByZ);
var useInterimTilesOnError = layer.getUseInterimTilesOnError();
var tmpExtent = this.tmpExtent_;
var tmpTileRange = new ol.TileRange(0, 0, 0, 0);
var childTileRange, fullyLoaded, tile, tileState, x, y;
for (x = tileRange.minX; x <= tileRange.maxX; ++x) {
for (y = tileRange.minY; y <= tileRange.maxY; ++y) {
tile = source.getTile(z, x, y, pixelRatio, projection);
goog.asserts.assertInstanceof(tile, ol.VectorTile,
'Tile is an ol.VectorTile');
tileState = tile.getState();
<span class="missing-if-branch" title="else path not taken" >E</span>if (tileState == ol.TileState.LOADED ||
<span class="branch-1 cbranch-no" title="branch not covered" > tileState == ol.TileState.EMPTY </span>||
(<span class="branch-2 cbranch-no" title="branch not covered" >tileState == ol.TileState.ERROR </span>&& <span class="branch-3 cbranch-no" title="branch not covered" >!useInterimTilesOnError)</span>) {
tilesToDrawByZ[z][ol.tilecoord.toString(tile.tileCoord)] = tile;
continue;
}
<span class="cstat-no" title="statement not covered" > fullyLoaded = tileGrid.forEachTileCoordParentTileRange(</span>
tile.tileCoord, findLoadedTiles, null, tmpTileRange, tmpExtent);
<span class="cstat-no" title="statement not covered" > if (!fullyLoaded) {</span>
<span class="cstat-no" title="statement not covered" > childTileRange = tileGrid.getTileCoordChildTileRange(</span>
tile.tileCoord, tmpTileRange, tmpExtent);
<span class="cstat-no" title="statement not covered" > if (childTileRange) {</span>
<span class="cstat-no" title="statement not covered" > findLoadedTiles(z + 1, childTileRange);</span>
}
}
}
}
this.dirty_ = false;
/** @type {Array.<number>} */
var zs = Object.keys(tilesToDrawByZ).map(Number);
zs.sort();
var replayables = [];
var i, ii, currentZ, tileCoordKey, tilesToDraw;
for (i = 0, ii = zs.length; i < ii; ++i) {
currentZ = zs[i];
tilesToDraw = tilesToDrawByZ[currentZ];
for (tileCoordKey in tilesToDraw) {
tile = tilesToDraw[tileCoordKey];
<span class="missing-if-branch" title="else path not taken" >E</span>if (tile.getState() == ol.TileState.LOADED) {
replayables.push(tile);
this.createReplayGroup(tile, layer, pixelRatio);
}
}
}
this.renderedTiles_ = replayables;
return true;
};
/**
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @param {number} squaredTolerance Squared tolerance.
* @param {Array.<ol.style.Style>} styles Array of styles
* @param {ol.render.canvas.ReplayGroup} replayGroup Replay group.
* @return {boolean} `true` if an image is loading.
*/
ol.renderer.canvas.VectorTileLayer.prototype.renderFeature =
function(feature, squaredTolerance, styles, replayGroup) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!styles) {
<span class="cstat-no" title="statement not covered" > return false;</span>
}
var i, ii, loading = false;
for (i = 0, ii = styles.length; i < ii; ++i) {
loading = ol.renderer.vector.renderFeature(
replayGroup, feature, styles[i], squaredTolerance,
this.handleStyleImageChange_, this) || loading;
}
return loading;
};
</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Nov 06 2015 19:36:11 GMT+0100 (CET)
</div>
</div>
<script src="../../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../../sorter.js"></script>
</body>
</html>
| {
"content_hash": "92abec4ac972414ede7824cefc0cb107",
"timestamp": "",
"source": "github",
"line_count": 1391,
"max_line_length": 219,
"avg_line_length": 31.298346513299784,
"alnum_prop": 0.6916804483645719,
"repo_name": "LeoLombardi/tos-laimas-compass",
"id": "ca5377b64b7d122254ccc59ebbe2319e72146146",
"size": "43734",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tos-laimas-compass-win32-x64/resources/app/node_modules/openlayers/coverage/ol/renderer/canvas/canvasvectortilelayerrenderer.js.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "44"
},
{
"name": "CSS",
"bytes": "24604"
},
{
"name": "HTML",
"bytes": "94277"
},
{
"name": "JavaScript",
"bytes": "32929"
},
{
"name": "Lua",
"bytes": "3226"
}
],
"symlink_target": ""
} |
package com.intellij.util.text;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.CharsetToolkit;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class XmlCharsetDetector {
@NonNls private static final String XML_PROLOG_START = "<?xml";
@NonNls private static final byte[] XML_PROLOG_START_BYTES = CharsetToolkit.getUtf8Bytes(XML_PROLOG_START);
@NonNls private static final String ENCODING = "encoding";
@NonNls private static final byte[] ENCODING_BYTES = CharsetToolkit.getUtf8Bytes(ENCODING);
@NonNls private static final String XML_PROLOG_END = "?>";
@NonNls private static final byte[] XML_PROLOG_END_BYTES = CharsetToolkit.getUtf8Bytes(XML_PROLOG_END);
@Nullable
public static String extractXmlEncodingFromProlog(byte @NotNull [] bytes) {
int index = 0;
if (CharsetToolkit.hasUTF8Bom(bytes)) {
index = CharsetToolkit.UTF8_BOM.length;
}
index = skipWhiteSpace(index, bytes);
if (!ArrayUtil.startsWith(bytes, index, XML_PROLOG_START_BYTES)) return null;
index += XML_PROLOG_START_BYTES.length;
while (index < bytes.length) {
index = skipWhiteSpace(index, bytes);
if (ArrayUtil.startsWith(bytes, index, XML_PROLOG_END_BYTES)) return null;
if (ArrayUtil.startsWith(bytes, index, ENCODING_BYTES)) {
index += ENCODING_BYTES.length;
index = skipWhiteSpace(index, bytes);
if (index >= bytes.length || bytes[index] != '=') continue;
index++;
index = skipWhiteSpace(index, bytes);
if (index >= bytes.length || bytes[index] != '\'' && bytes[index] != '\"') continue;
byte quote = bytes[index];
index++;
StringBuilder encoding = new StringBuilder();
while (index < bytes.length) {
if (bytes[index] == quote) return encoding.toString();
encoding.append((char)bytes[index++]);
}
}
index++;
}
return null;
}
@Nullable
public static String extractXmlEncodingFromProlog(@NotNull CharSequence text) {
int index = 0;
index = skipWhiteSpace(index, text);
if (!StringUtil.startsWith(text, index, XML_PROLOG_START)) return null;
index += XML_PROLOG_START.length();
while (index < text.length()) {
index = skipWhiteSpace(index, text);
if (StringUtil.startsWith(text, index, XML_PROLOG_END)) return null;
if (StringUtil.startsWith(text, index, ENCODING)) {
index += ENCODING.length();
index = skipWhiteSpace(index, text);
if (index >= text.length() || text.charAt(index) != '=') continue;
index++;
index = skipWhiteSpace(index, text);
if (index >= text.length()) continue;
char quote = text.charAt(index);
if (quote != '\'' && quote != '\"') continue;
index++;
StringBuilder encoding = new StringBuilder();
while (index < text.length()) {
char c = text.charAt(index);
if (c == quote) return encoding.toString();
encoding.append(c);
index++;
}
}
index++;
}
return null;
}
private static int skipWhiteSpace(int start, byte @NotNull [] bytes) {
while (start < bytes.length) {
char c = (char)bytes[start];
if (!Character.isWhitespace(c)) break;
start++;
}
return start;
}
private static int skipWhiteSpace(int start, @NotNull CharSequence text) {
while (start < text.length()) {
char c = text.charAt(start);
if (!Character.isWhitespace(c)) break;
start++;
}
return start;
}
}
| {
"content_hash": "7e14d19e649445902b45c135f7d6751a",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 109,
"avg_line_length": 36.09803921568628,
"alnum_prop": 0.6401412275936991,
"repo_name": "leafclick/intellij-community",
"id": "41f8c0c6b9cdc474e48b7d8f91a418111e71ea1c",
"size": "4282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/util/src/com/intellij/util/text/XmlCharsetDetector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Threading;
using System.Threading.Tasks;
namespace EasyNetQ
{
/// <summary>
/// Allow to add multiple asynchronous message handlers
/// </summary>
public interface IReceiveRegistration
{
/// <summary>
/// Add an asynchronous message handler to this receiver
/// </summary>
/// <typeparam name="T">The type of message to receive</typeparam>
/// <param name="onMessage">The message handler</param>
/// <returns>'this' for fluent configuration</returns>
IReceiveRegistration Add<T>(Func<T, CancellationToken, Task> onMessage);
}
}
| {
"content_hash": "57279a379522c4cd8455d5f3881142e9",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 32.05,
"alnum_prop": 0.6443057722308893,
"repo_name": "zidad/EasyNetQ",
"id": "a620c154715d7eaf016b29b7da7f1521b508a4c0",
"size": "643",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/EasyNetQ/IReceiveRegistration.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "947"
},
{
"name": "C#",
"bytes": "1592649"
},
{
"name": "JavaScript",
"bytes": "1022"
},
{
"name": "PLpgSQL",
"bytes": "2807"
},
{
"name": "TSQL",
"bytes": "5424"
}
],
"symlink_target": ""
} |
/* $Id$ */
#ifndef DNS_CALLBACKS_H
#define DNS_CALLBACKS_H 1
/*! \file dns/callbacks.h */
/***
*** Imports
***/
#include <isc/lang.h>
#include <dns/types.h>
ISC_LANG_BEGINDECLS
/***
*** Types
***/
struct dns_rdatacallbacks {
/*%
* dns_load_master calls this when it has rdatasets to commit.
*/
dns_addrdatasetfunc_t add;
/*%
* dns_load_master / dns_rdata_fromtext call this to issue a error.
*/
void (*error)(struct dns_rdatacallbacks *, const char *, ...);
/*%
* dns_load_master / dns_rdata_fromtext call this to issue a warning.
*/
void (*warn)(struct dns_rdatacallbacks *, const char *, ...);
/*%
* Private data handles for use by the above callback functions.
*/
void *add_private;
void *error_private;
void *warn_private;
};
/***
*** Initialization
***/
void
dns_rdatacallbacks_init(dns_rdatacallbacks_t *callbacks);
/*%<
* Initialize 'callbacks'.
*
*
* \li 'error' and 'warn' are set to default callbacks that print the
* error message through the DNS library log context.
*
*\li All other elements are initialized to NULL.
*
* Requires:
* \li 'callbacks' is a valid dns_rdatacallbacks_t,
*/
void
dns_rdatacallbacks_init_stdio(dns_rdatacallbacks_t *callbacks);
/*%<
* Like dns_rdatacallbacks_init, but logs to stdio.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_CALLBACKS_H */
| {
"content_hash": "0b90eb8df1ee34c04b4dbc2932602083",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 70,
"avg_line_length": 18.569444444444443,
"alnum_prop": 0.6574420344053852,
"repo_name": "dplbsd/soc2013",
"id": "b686647b7d61629dd12deb3042f3f73a4e10394b",
"size": "2196",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "head/contrib/bind9/lib/dns/include/dns/callbacks.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "AGS Script",
"bytes": "62471"
},
{
"name": "Assembly",
"bytes": "4478661"
},
{
"name": "Awk",
"bytes": "278525"
},
{
"name": "Batchfile",
"bytes": "20417"
},
{
"name": "C",
"bytes": "383420305"
},
{
"name": "C++",
"bytes": "72796771"
},
{
"name": "CSS",
"bytes": "109748"
},
{
"name": "ChucK",
"bytes": "39"
},
{
"name": "D",
"bytes": "3784"
},
{
"name": "DIGITAL Command Language",
"bytes": "10640"
},
{
"name": "DTrace",
"bytes": "2311027"
},
{
"name": "Emacs Lisp",
"bytes": "65902"
},
{
"name": "EmberScript",
"bytes": "286"
},
{
"name": "Forth",
"bytes": "184405"
},
{
"name": "GAP",
"bytes": "72156"
},
{
"name": "Groff",
"bytes": "32248806"
},
{
"name": "HTML",
"bytes": "6749816"
},
{
"name": "IGOR Pro",
"bytes": "6301"
},
{
"name": "Java",
"bytes": "112547"
},
{
"name": "KRL",
"bytes": "4950"
},
{
"name": "Lex",
"bytes": "398817"
},
{
"name": "Limbo",
"bytes": "3583"
},
{
"name": "Logos",
"bytes": "187900"
},
{
"name": "Makefile",
"bytes": "3551839"
},
{
"name": "Mathematica",
"bytes": "9556"
},
{
"name": "Max",
"bytes": "4178"
},
{
"name": "Module Management System",
"bytes": "817"
},
{
"name": "NSIS",
"bytes": "3383"
},
{
"name": "Objective-C",
"bytes": "836351"
},
{
"name": "PHP",
"bytes": "6649"
},
{
"name": "Perl",
"bytes": "5530761"
},
{
"name": "Perl6",
"bytes": "41802"
},
{
"name": "PostScript",
"bytes": "140088"
},
{
"name": "Prolog",
"bytes": "29514"
},
{
"name": "Protocol Buffer",
"bytes": "61933"
},
{
"name": "Python",
"bytes": "299247"
},
{
"name": "R",
"bytes": "764"
},
{
"name": "Rebol",
"bytes": "738"
},
{
"name": "Ruby",
"bytes": "45958"
},
{
"name": "Scilab",
"bytes": "197"
},
{
"name": "Shell",
"bytes": "10501540"
},
{
"name": "SourcePawn",
"bytes": "463194"
},
{
"name": "SuperCollider",
"bytes": "80208"
},
{
"name": "Tcl",
"bytes": "80913"
},
{
"name": "TeX",
"bytes": "719821"
},
{
"name": "VimL",
"bytes": "22201"
},
{
"name": "XS",
"bytes": "25451"
},
{
"name": "XSLT",
"bytes": "31488"
},
{
"name": "Yacc",
"bytes": "1857830"
}
],
"symlink_target": ""
} |
package io.novaordis.gld.api.jms.embedded;
import javax.jms.Destination;
import javax.jms.JMSException;
/**
* @author Ovidiu Feodorov <ovidiu@novaordis.com>
* @since 9/7/17
*/
public interface TestableMessageProducer {
// Constants -------------------------------------------------------------------------------------------------------
// Static ----------------------------------------------------------------------------------------------------------
// Public ----------------------------------------------------------------------------------------------------------
boolean isClosed();
Destination getDestination() throws JMSException;
}
| {
"content_hash": "342ce720d396740a97889555ac95edd5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 120,
"avg_line_length": 28.125,
"alnum_prop": 0.37037037037037035,
"repo_name": "NovaOrdis/gld",
"id": "dde4dd68946bc3046791f95f2b96c6069c6b3509",
"size": "1275",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/api/src/main/java/io/novaordis/gld/api/jms/embedded/TestableMessageProducer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1983846"
},
{
"name": "Shell",
"bytes": "15581"
}
],
"symlink_target": ""
} |
#ifndef DocumentXPathEvaluator_h
#define DocumentXPathEvaluator_h
#include "core/dom/DocumentSupplementable.h"
#include "core/xml/XPathEvaluator.h"
#include "core/xml/XPathNSResolver.h"
namespace blink {
class ExceptionState;
class XPathExpression;
class XPathResult;
class DocumentXPathEvaluator FINAL : public NoBaseWillBeGarbageCollected<DocumentXPathEvaluator>, public DocumentSupplement {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DocumentXPathEvaluator);
public:
static DocumentXPathEvaluator& from(DocumentSupplementable&);
static PassRefPtrWillBeRawPtr<XPathExpression> createExpression(DocumentSupplementable&,
const String& expression, PassRefPtrWillBeRawPtr<XPathNSResolver>, ExceptionState&);
static PassRefPtrWillBeRawPtr<XPathNSResolver> createNSResolver(DocumentSupplementable&, Node* nodeResolver);
static PassRefPtrWillBeRawPtr<XPathResult> evaluate(DocumentSupplementable&,
const String& expression, Node* contextNode, PassRefPtrWillBeRawPtr<XPathNSResolver>,
unsigned short type, XPathResult*, ExceptionState&);
virtual void trace(Visitor*) OVERRIDE;
private:
DocumentXPathEvaluator();
static const char* supplementName() { return "DocumentXPathEvaluator"; }
RefPtrWillBeMember<XPathEvaluator> m_xpathEvaluator;
};
} // namespace blink
#endif // DocumentXPathEvaluator_h
| {
"content_hash": "3d19346222df9bd1d70522fd3a1a745f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 125,
"avg_line_length": 33.975,
"alnum_prop": 0.8013245033112583,
"repo_name": "android-ia/platform_external_chromium_org_third_party_WebKit",
"id": "fd3dd954cb8ffc3dc05e38e6f0abf496177d0f56",
"size": "2716",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "Source/core/xml/DocumentXPathEvaluator.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "14584"
},
{
"name": "Batchfile",
"bytes": "35"
},
{
"name": "C",
"bytes": "109380"
},
{
"name": "C++",
"bytes": "41913393"
},
{
"name": "CSS",
"bytes": "386919"
},
{
"name": "Groff",
"bytes": "26536"
},
{
"name": "HTML",
"bytes": "11501040"
},
{
"name": "Java",
"bytes": "66510"
},
{
"name": "JavaScript",
"bytes": "9328662"
},
{
"name": "Makefile",
"bytes": "99861997"
},
{
"name": "Objective-C",
"bytes": "48021"
},
{
"name": "Objective-C++",
"bytes": "377388"
},
{
"name": "PHP",
"bytes": "3941"
},
{
"name": "Perl",
"bytes": "490099"
},
{
"name": "Python",
"bytes": "3712782"
},
{
"name": "Ruby",
"bytes": "141818"
},
{
"name": "Shell",
"bytes": "8806"
},
{
"name": "Yacc",
"bytes": "64394"
}
],
"symlink_target": ""
} |
Ruby Client Library for Cisco UCS Manager that could be used for Infrastructure Automation.
To see an example of how ucslib is being used, checkout the ucs and ucs-solo Chef Cookbooks created by Velankani Information Systems, Inc here - https://github.com/velankanisys/chef-cookbooks
In addition there is a knife plugin that use ucslib as well - https://github.com/velankanisys/knife-ucs
** Version 0.1.9 has been released **
0.1.9
Updates to allow SSL to be ignored if desired, still defaults to verify_ssl =True
Abstracted out the Rest post call to allow for easier global changes down the road
0.1.8
Namespace updates (clean up) and support for ruby 2.1.0
0.1.7
Multi-chassis server pool creation
0.1.6:
Set syslog server implemented in provisioner
0.1.5:
Moved update boot policy to Update instead of manage
Disabled Parser code for now to allow ucslib to work on Debian Squeeze running Ruby1.9.1
0.1.4:
Bug fixes.
0.1.3:
Host firmware XML change for UCS 2.1.
0.1.2:
Bug fixes.
0.1.1:
1. Provision has set_ vs create_ methods. Please update your apps.
2. Added Manage functions to associate service profiles to server pools
## Install
gem install ucslib
## Usage (example pry session)
[1] pry(main)> require 'ucslib'
=> true
[2] pry(main)> authjson = { :username => 'admin', :password => 'admin', :ip => '172.16.192.175', :verify_ssl => "false"}.to_json
=> "{\"username\":\"admin\",\"password\":\"admin\",\"ip\":\"172.16.192.175\",\"verify_ssl_\":\"false\"}"
[3] pry(main)> ucs = UCS.new(authjson)
Your credentials are username: admin password: admin ip: 172.16.192.175 url https://172.16.192.175/nuova
=> #<UCS:0x007fd269d1eb18>
[4] pry(main)> token = ucs.get_token(authjson)
=> "{\"cookie\":\"1398284131/87cdd12e-7cb4-4e0d-b39d-e39a827e3870\",\"username\":\"admin\",\"password\":\"admin\",\"ip\":\"172.16.192.175\"}"
[5] pry(main)> inventory = ucs.discover(token)
Hit q to quit
=> #(Document:0x3fd4a6f99e70 {
name = "document",
children = [
#(Element:0x3fd4a6f9954c {
name = "configResolveClasses",
attributes = [
#(Attr:0x3fd4a6f99254 {
name = "cookie",
value = "1398284407/c298b159-0cee-434a-ae55-c116b8cd19fe"
}),
#(Attr:0x3fd4a6f99240 { name = "response", value = "yes" })],
children = [
#(Text " "),
#(Element:0x3fd4a6fa1b20 {
name = "outConfigs",
children = [
#(Text " "),
#(Element:0x3fd4a6fa10d0 {
name = "topSystem",
attributes = [
#(Attr:0x3fd4a6fa0e3c {
name = "address",
value = "172.16.192.175"
}),
#(Attr:0x3fd4a6fa0e28 {
name = "currentTime",
value = "2014-04-23T20:29:13.906"
}),
#(Attr:0x3fd4a6fa0e14 { name = "descr", value = "" }),
#(Attr:0x3fd4a6fa0e00 { name = "dn", value = "sys" }),
#(Attr:0x3fd4a6fa0dec { name = "ipv6Addr", value = "::" }),
#(Attr:0x3fd4a6fa0dd8 { name = "mode", value = "cluster" }),
#(Attr:0x3fd4a6fa0dc4 {
name = "name",
value = "UCSPE-172-16-192-175"
}),
#(Attr:0x3fd4a6fa0db0 { name = "owner", value = "" }),
#(Attr:0x3fd4a6fa0d9c { name = "site", value = "" }),
#(Attr:0x3fd4a6fa0d88 {
name = "systemUpTime",
value = "00:06:18:58"
[6] pry(main)>ucs.list_blades(inventory)
Blade : 1/1 model: N20-B6620-1 with serial: 3324 is powered: on
Blade : 1/2 model: N20-B6620-1 with serial: 3325 is powered: on
Blade : 1/5 model: UCSB-B200-M3 with serial: 3327 is powered: on
Blade : 1/6 model: N20-B6625-1 with serial: 3328 is powered: on
Blade : 1/3 model: N20-B6620-2 with serial: 3326 is powered: on
Blade : 1/7 model: N20-B6740-2 with serial: 3329 is powered: on
=> 0
[7] pry(main)>vlan200 = { :vlan_id => '200', :vlan_name => 'OpenStack-Mgmt' }.to_json
=> "{\"vlan_id\":\"200\",\"vlan_name\":\"OpenStack-Mgmt\"}"
[8] pry(main)> ucs.set_vlan(vlan200)
=> " <configConfMos cookie=\"1398291606/fe13664b-b79d-4ac7-9d0f-98cedffd1c5e\" response=\"yes\"> <outConfigs> <pair key=\"fabric/lan/net-OpenStack-Mgmt\"> <fabricVlan childAction=\"deleteNonPresent\" cloud=\"ethlan\" compressionType=\"included\" configIssues=\"\" defaultNet=\"no\" dn=\"fabric/lan/net-OpenStack-Mgmt\" epDn=\"\" fltAggr=\"0\" global=\"0\" id=\"200\" ifRole=\"network\" ifType=\"virtual\" local=\"0\" locale=\"external\" mcastPolicyName=\"\" name=\"OpenStack-Mgmt\" operMcastPolicyName=\"\" operState=\"ok\" peerDn=\"\" policyOwner=\"local\" pubNwDn=\"\" pubNwId=\"1\" pubNwName=\"\" sharing=\"none\" status=\"created\" switchId=\"dual\" transport=\"ether\" type=\"lan\"/> </pair> </outConfigs> </configConfMos>"
[9] pry(main)> ucs.delete_vlan(vlan200)
=> " <configConfMos cookie=\"1398291606/fe13664b-b79d-4ac7-9d0f-98cedffd1c5e\" response=\"yes\"> <outConfigs> <pair key=\"fabric/lan/net-OpenStack-Mgmt\"> <fabricVlan cloud=\"ethlan\" compressionType=\"included\" configIssues=\"\" defaultNet=\"no\" dn=\"fabric/lan/net-OpenStack-Mgmt\" epDn=\"\" fltAggr=\"0\" global=\"0\" id=\"200\" ifRole=\"network\" ifType=\"virtual\" local=\"0\" locale=\"external\" mcastPolicyName=\"\" name=\"OpenStack-Mgmt\" operMcastPolicyName=\"org-root/mc-policy-default\" operState=\"ok\" peerDn=\"\" policyOwner=\"local\" pubNwDn=\"\" pubNwId=\"1\" pubNwName=\"\" sharing=\"none\" status=\"deleted\" switchId=\"dual\" transport=\"ether\" type=\"lan\"/> </pair> </outConfigs> </configConfMos>"
[10] pry(main)>
Just do "require ucslib" in your apps. Below is an IRB session to highlight some capabilities.
## Features
1. List inventory of UCS components
2. Provision - turn up ports, create port channels, pools, service profiles
3. Retrieve stats
## Issues and Project Management
Checkout [Pivotal Tracker][1]
## ToDo
Documentation, Documentation, Documentation!
## Contributing to ucslib
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
* Start a feature/bugfix branch.
* Commit and push until you are happy with your contribution.
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
## Copyright
Copyright (c) 2012 - 2014 Murali Raju. See LICENSE.txt for further details.
[1]: https://www.pivotaltracker.com/s/projects/1065870
| {
"content_hash": "69cebed7d79b626cb2349c797daec90d",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 732,
"avg_line_length": 45.34415584415584,
"alnum_prop": 0.6321065444651296,
"repo_name": "murraju/ucslib",
"id": "31819cb80673a46c873379ceb017cc9f6b97e5ad",
"size": "7002",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "13693"
},
{
"name": "HTML",
"bytes": "276464"
},
{
"name": "JavaScript",
"bytes": "5783"
},
{
"name": "Ruby",
"bytes": "84866"
}
],
"symlink_target": ""
} |
package models
import javax.inject.Inject
import anorm.SqlParser._
import anorm._
import play.api.db.DBApi
case class Company(id: Option[Long] = None, name: String)
@javax.inject.Singleton
class CompanyService @Inject() (dbapi: DBApi) {
private val db = dbapi.database("default")
/**
* Parse a Company from a ResultSet
*/
val simple = {
get[Option[Long]]("company.id") ~
get[String]("company.name") map {
case id~name => Company(id, name)
}
}
/**
* Construct the Map[String,String] needed to fill a select options set.
*/
def options: Seq[(String,String)] = db.withConnection { implicit connection =>
SQL("select * from company order by name").as(simple *).
foldLeft[Seq[(String, String)]](Nil) { (cs, c) =>
c.id.fold(cs) { id => cs :+ (id.toString -> c.name) }
}
}
}
| {
"content_hash": "f5b33c9fb6b5511c1c7860bd2d8f34af",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6284023668639053,
"repo_name": "play2-maven-plugin/play2-maven-test-projects",
"id": "73cc19d6bca8af2e0d6e0b114e6b9b797c63c5b6",
"size": "845",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "play25/scala/anorm-example/app/models/CompanyService.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "526310"
},
{
"name": "CoffeeScript",
"bytes": "229857"
},
{
"name": "HTML",
"bytes": "911016"
},
{
"name": "Java",
"bytes": "1189699"
},
{
"name": "JavaScript",
"bytes": "985367"
},
{
"name": "Scala",
"bytes": "1048410"
},
{
"name": "TSQL",
"bytes": "1803347"
}
],
"symlink_target": ""
} |
rm setup.cfg # setup.cfg sets installation path to /opt/graphite
$PYTHON setup.py install
# Add more build steps here, if they are necessary.
# See
# http://docs.continuum.io/conda/build.html
# for a list of environment variables that are set during the build process.
| {
"content_hash": "8d6d85d82d521606cdda26bb59431517",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 76,
"avg_line_length": 33.875,
"alnum_prop": 0.7638376383763837,
"repo_name": "hajs/pylodger",
"id": "6b35a8dd14d6169ce7fc19d96acdacd0ac0b033d",
"size": "284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "recipes/admin/graphite/carbon/build.sh",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "4466"
},
{
"name": "Python",
"bytes": "33569"
},
{
"name": "Shell",
"bytes": "75014"
}
],
"symlink_target": ""
} |
package metrics
import (
"container/list"
"encoding/json"
"fmt"
"io"
"sync"
"time"
"github.com/blevesearch/bleve/index/store"
"github.com/blevesearch/bleve/registry"
"github.com/rcrowley/go-metrics"
)
const Name = "metrics"
type Store struct {
o store.KVStore
TimerReaderGet metrics.Timer
TimerReaderPrefixIterator metrics.Timer
TimerReaderRangeIterator metrics.Timer
TimerWriterExecuteBatch metrics.Timer
TimerIteratorSeek metrics.Timer
TimerIteratorNext metrics.Timer
TimerBatchMerge metrics.Timer
m sync.Mutex // Protects the fields that follow.
errors *list.List // Capped list of StoreError's.
}
func New(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error) {
name, ok := config["kvStoreName_actual"].(string)
if !ok || name == "" {
return nil, fmt.Errorf("metrics: missing kvStoreName_actual,"+
" config: %#v", config)
}
if name == Name {
return nil, fmt.Errorf("metrics: circular kvStoreName_actual")
}
ctr := registry.KVStoreConstructorByName(name)
if ctr == nil {
return nil, fmt.Errorf("metrics: no kv store constructor,"+
" kvStoreName_actual: %s", name)
}
kvs, err := ctr(mo, config)
if err != nil {
return nil, err
}
return &Store{
o: kvs,
TimerReaderGet: metrics.NewTimer(),
TimerReaderPrefixIterator: metrics.NewTimer(),
TimerReaderRangeIterator: metrics.NewTimer(),
TimerWriterExecuteBatch: metrics.NewTimer(),
TimerIteratorSeek: metrics.NewTimer(),
TimerIteratorNext: metrics.NewTimer(),
TimerBatchMerge: metrics.NewTimer(),
errors: list.New(),
}, nil
}
func init() {
registry.RegisterKVStore(Name, New)
}
func (s *Store) Close() error {
return s.o.Close()
}
func (s *Store) Reader() (store.KVReader, error) {
o, err := s.o.Reader()
if err != nil {
s.AddError("Reader", err, nil)
return nil, err
}
return &Reader{s: s, o: o}, nil
}
func (s *Store) Writer() (store.KVWriter, error) {
o, err := s.o.Writer()
if err != nil {
s.AddError("Writer", err, nil)
return nil, err
}
return &Writer{s: s, o: o}, nil
}
// Metric specific code below:
const MaxErrors = 100
type StoreError struct {
Time string
Op string
Err string
Key string
}
func (s *Store) AddError(op string, err error, key []byte) {
e := &StoreError{
Time: time.Now().Format(time.RFC3339Nano),
Op: op,
Err: fmt.Sprintf("%v", err),
Key: string(key),
}
s.m.Lock()
for s.errors.Len() >= MaxErrors {
s.errors.Remove(s.errors.Front())
}
s.errors.PushBack(e)
s.m.Unlock()
}
func (s *Store) WriteJSON(w io.Writer) {
w.Write([]byte(`{"TimerReaderGet":`))
WriteTimerJSON(w, s.TimerReaderGet)
w.Write([]byte(`,"TimerReaderPrefixIterator":`))
WriteTimerJSON(w, s.TimerReaderPrefixIterator)
w.Write([]byte(`,"TimerReaderRangeIterator":`))
WriteTimerJSON(w, s.TimerReaderRangeIterator)
w.Write([]byte(`,"TimerWriterExecuteBatch":`))
WriteTimerJSON(w, s.TimerWriterExecuteBatch)
w.Write([]byte(`,"TimerIteratorSeek":`))
WriteTimerJSON(w, s.TimerIteratorSeek)
w.Write([]byte(`,"TimerIteratorNext":`))
WriteTimerJSON(w, s.TimerIteratorNext)
w.Write([]byte(`,"TimerBatchMerge":`))
WriteTimerJSON(w, s.TimerBatchMerge)
w.Write([]byte(`,"Errors":[`))
s.m.Lock()
e := s.errors.Front()
i := 0
for e != nil {
se, ok := e.Value.(*StoreError)
if ok && se != nil {
if i > 0 {
w.Write([]byte(","))
}
buf, err := json.Marshal(se)
if err == nil {
w.Write(buf)
}
}
e = e.Next()
i = i + 1
}
s.m.Unlock()
w.Write([]byte(`]`))
w.Write([]byte(`}`))
}
func (s *Store) WriteCSVHeader(w io.Writer) {
WriteTimerCSVHeader(w, "TimerReaderGet")
WriteTimerCSVHeader(w, "TimerReaderPrefixIterator")
WriteTimerCSVHeader(w, "TimerReaderRangeIterator")
WriteTimerCSVHeader(w, "TimerWtierExecuteBatch")
WriteTimerCSVHeader(w, "TimerIteratorSeek")
WriteTimerCSVHeader(w, "TimerIteratorNext")
WriteTimerCSVHeader(w, "TimerBatchMerge")
}
func (s *Store) WriteCSV(w io.Writer) {
WriteTimerCSV(w, s.TimerReaderGet)
WriteTimerCSV(w, s.TimerReaderPrefixIterator)
WriteTimerCSV(w, s.TimerReaderRangeIterator)
WriteTimerCSV(w, s.TimerWriterExecuteBatch)
WriteTimerCSV(w, s.TimerIteratorSeek)
WriteTimerCSV(w, s.TimerIteratorNext)
WriteTimerCSV(w, s.TimerBatchMerge)
}
| {
"content_hash": "20b4848405af6a2572cd3202c23d3135",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 88,
"avg_line_length": 23.65934065934066,
"alnum_prop": 0.680678123548537,
"repo_name": "kevgs/bleve",
"id": "fab47afdfe0b2d5dce542ec060c5f27384b1bd29",
"size": "5080",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index/store/metrics/store.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "1382694"
},
{
"name": "HTML",
"bytes": "25447"
},
{
"name": "JavaScript",
"bytes": "35220"
},
{
"name": "Protocol Buffer",
"bytes": "309"
},
{
"name": "Shell",
"bytes": "241"
},
{
"name": "Yacc",
"bytes": "4141"
}
],
"symlink_target": ""
} |
'use strict';
// An object to represent one of a Char's four sides: for every Char added as a
// path in the maze, four CharSide objects are added to a list; a list that is shuffled
// to randomly select the next path to connect in the maze.
module.exports = {
init: function(ofChar, whichSide) {
if (!('ch' in ofChar) || !('topLeftX' in ofChar) || !('topLeftY' in ofChar) || !('connected' in ofChar)) {
throw new Error('Arg "ofChar" doesn\'t look like it delegates to Char.js');
}
// A reference to the Char object this Side belongs to.
this.ofChar = ofChar;
if (['top', 'bottom', 'left', 'right'].indexOf(whichSide) < 0) {
throw new Error('Arg "whichSide" must be either top, bottom, left or right; got "' + whichSide + '"');
}
// One of: top, right, bottom, left.
this.whichSide = whichSide;
},
getNameOfOppositeSide: function() {
var lookupTable = {
'top': 'bottom',
'right': 'left',
'bottom': 'top',
'left': 'right'
};
return lookupTable[this.whichSide];
}
};
| {
"content_hash": "05a8b2fbad5c553f8e29868d01974ede",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 31.944444444444443,
"alnum_prop": 0.5678260869565217,
"repo_name": "jesse-blake/text-maze",
"id": "6c471ac7089b9ac34015a5993a6643a427de6a58",
"size": "1150",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/utils/CharSide.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "80958"
}
],
"symlink_target": ""
} |
<!-- BEGIN: content -->
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
<div class="promotion_list">
<div id="reviewEdit"></div>
<table cellspacing="0">
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Created</th>
<th>Product</th>
<th>Published</th>
</tr>
</thead>
<tbody>
<!-- BEGIN: item -->
<tr>
<td><a title="Edit Review" onclick="makeAjaxRequest('#reviews_page', '/request/bo/component/ecommerce/product_review_edit~id={ITEM.id}~'); return false" href="#reviews_page">{ITEM.title|htmlspecialchars}</a></td>
<td><a href="/backoffice/customers/{ITEM.customer_id}/detail">{ITEM.author_name|htmlspecialchars} (ID {ITEM.customer_id})</a></td>
<td>{ITEM.created}</td>
<td><a href="/backoffice/products/{ITEM.node_id}/edit">{ITEM.node_id}</a></td>
<td>{ITEM.publish}</td>
</tr>
<!-- END: item -->
<!-- BEGIN: empty -->
<tr>
<td class="empty" colspan="5">No comments yet.</td>
</tr>
<!-- END: empty -->
</tbody>
<tfoot>
{PAGINATION}
</tfoot>
</table>
</div>
<!-- END: content -->
| {
"content_hash": "2cda50957451be2da20851a62f764992",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 216,
"avg_line_length": 26.738095238095237,
"alnum_prop": 0.5814781834372217,
"repo_name": "chrisblackni/onxshop",
"id": "201d2f4d4ae107da6897c6b43f9fc6d11eced0a0",
"size": "1123",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "templates/bo/component/ecommerce/product_review_list.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "17"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "251826"
},
{
"name": "HTML",
"bytes": "1456886"
},
{
"name": "JavaScript",
"bytes": "577601"
},
{
"name": "PHP",
"bytes": "22186480"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Shell",
"bytes": "9451"
}
],
"symlink_target": ""
} |
class Immutable
@dbh = false
@@ssdbh = false
class << self
#
# Selfie to get Config
#
def config
RConfig.global
end
#
# Selfie to get routes
#
def routes
RConfig.routes;
end
#
# Selfie to get logger
#
def log
Logger.new('migration.log', 0, 100 * 1024 * 1024)
end
def debuglog
Logger.new('audio_debug.log', 0, 100 * 1024 * 1024)
end
#
# Selfie to get logger
#
def baseURL
return "http://milacron.crossroads.net"
end
#
# Selfie to get database handler
#
def dbh
begin
if (@dbh)
return @dbh
else
return self.getconnection
end
end
end
#
# Silverstripe database handler
#
def ssdbh
begin
if (@@ssdbh)
return @@ssdbh
else
return self.getSilverstripeConnection
end
end
end
#
# This method returns the connection handler
# TODO : - Research on Persistance
#
def getconnection
connection_string = 'DBI:Mysql:' + self.config.db_name + ':' + self.config.db_host
@dbh = DBI.connect("#{connection_string}", self.config.db_user_name, self.config.db_password)
rescue DBI::DatabaseError => e
puts 'An error occurred while initializing DB handler check migration log for more details '
self.log.error "Error code: #{e.err}"
self.log.error "Error message: #{e.errstr}"
end
#
# This method returns the connection handler
# TODO : - Research on Persistance
#
def getSilverstripeConnection
connection_string = 'DBI:Mysql:' + self.config.ss_db_name + ':' + self.config.ss_db_host;
@@ssdbh = DBI.connect("#{connection_string}", self.config.ss_db_username, self.config.ss_db_password);
rescue DBI::DatabaseError => e
puts 'An error occurred while initializing DB handler check migration log for more details '
self.log.error "Error code: #{e.err}"
self.log.error "Error message: #{e.errstr}"
end
#
# This method returns the s3 connection handler
# TODO : - Research on Persistance
#
def getS3
AWS.config(
:region => 'us-east-1',
:access_key_id => self.config.s3_access_key_id,
:secret_access_key => self.config.s3_secret_access_key
)
s3 = AWS::S3.new
return s3
end
end
end
| {
"content_hash": "423a72e3b6567f114cdb835aa8134096",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 108,
"avg_line_length": 22.422018348623855,
"alnum_prop": 0.5838788870703764,
"repo_name": "crdschurch/utilities",
"id": "ea45556747cce5b7cc7c3bbca4b92f2c6aa5c9b2",
"size": "2817",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2016 migration/classes/helpers/immutable.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "353684"
},
{
"name": "CSS",
"bytes": "3449"
},
{
"name": "HTML",
"bytes": "5711"
},
{
"name": "JavaScript",
"bytes": "16736"
},
{
"name": "PowerShell",
"bytes": "5592"
},
{
"name": "Python",
"bytes": "7560"
},
{
"name": "Ruby",
"bytes": "294706"
},
{
"name": "SQLPL",
"bytes": "31054"
},
{
"name": "TypeScript",
"bytes": "9793"
}
],
"symlink_target": ""
} |
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'database_cleaner'
require 'voice_extension'
require 'shoulda/matchers'
require 'factory_girl'
FactoryGirl.find_definitions
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
Dir[Rails.root.join("spec/lib/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rspec
config.before(:suite) do
DatabaseCleaner[:mongoid].clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner[:mongoid].clean
end
config.after(:each) do
DatabaseCleaner[:mongoid].clean
end
end | {
"content_hash": "436579ceca01809166cbf6bf1a94da5f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 27.6875,
"alnum_prop": 0.7223476297968398,
"repo_name": "AnyPresence/voice_extension",
"id": "56310a9d9f3c60ac51b15b63be279a8db2804203",
"size": "886",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/spec_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3487"
},
{
"name": "CoffeeScript",
"bytes": "229"
},
{
"name": "JavaScript",
"bytes": "1892"
},
{
"name": "Ruby",
"bytes": "55308"
}
],
"symlink_target": ""
} |
void BaseTest::SetUp() {
ASSERT_TRUE(base::PathService::Get(base::DIR_SOURCE_ROOT, &test_dir_));
test_dir_ = test_dir_.AppendASCII("courgette");
test_dir_ = test_dir_.AppendASCII("testdata");
}
void BaseTest::TearDown() {
}
// Reads a test file into a string.
std::string BaseTest::FileContents(const char* file_name) const {
base::FilePath file_path = test_dir_;
file_path = file_path.AppendASCII(file_name);
std::string file_bytes;
EXPECT_TRUE(base::ReadFileToString(file_path, &file_bytes));
return file_bytes;
}
std::string BaseTest::FilesContents(std::list<std::string> file_names) const {
std::string result;
std::list<std::string>::iterator file_name = file_names.begin();
while (file_name != file_names.end()) {
result += FileContents(file_name->c_str());
file_name++;
}
return result;
}
| {
"content_hash": "434e5c4bf787191115ff4450cadfc20d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 78,
"avg_line_length": 26.21875,
"alnum_prop": 0.6793802145411204,
"repo_name": "scheib/chromium",
"id": "972105bf4a0d20a68c904a77a29dcce68e215beb",
"size": "1118",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "courgette/base_test_unittest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>pi-agm: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.0 / pi-agm - 1.2.3</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
pi-agm
<small>
1.2.3
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-23 11:02:22 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-23 11:02:22 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
name: "coq-pi-agm"
version: "1.2.3"
maintainer: "yves.bertot@inria.fr"
homepage: "http://www-sop.inria.fr/members/Yves.Bertot/"
bug-reports: "yves.bertot@inria.fr"
license: "CeCILL-B"
build: [["coq_makefile" "-f" "_CoqProject" "-o" "Makefile" ]
[ make "-j" "%{jobs}%" ]]
install: [ make "install" "DEST='%{lib}%/coq/user-contrib/pi_agm'" ]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/pi_agm'" ]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
"coq-coquelicot" {>= "3" & < "4~"}
"coq-interval" {>= "3.1" & < "4"}
]
tags: [ "keyword:real analysis" "keyword:pi" "category:Mathematics/Real Calculus and Topology" ]
authors: [ "Yves Bertot <yves.bertot@inria.fr>" ]
synopsis:
"Computing thousands or millions of digits of PI with arithmetic-geometric means"
description: """
This is a proof of correctness for two algorithms to compute PI to high
precision using arithmetic-geometric means. A first file contains
the calculus-based proofs for an abstract view of the algorithm, where all
numbers are real numbers. A second file describes how to approximate all
computations using large integers. Other files describe the second algorithm
which is close to the one used in mpfr, for instance.
The whole development can be used to produce mathematically proved and
formally verified approximations of PI."""
url {
src: "https://github.com/ybertot/pi-agm/archive/v1.2.3.zip"
checksum: "md5=2772bb7581b79dded0fde1f1d3b2143c"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-pi-agm.1.2.3 coq.8.5.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0).
The following dependencies couldn't be met:
- coq-pi-agm -> coq >= 8.9 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pi-agm.1.2.3</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "08e38d2b01d9fad7617fef385c1ab7a0",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 159,
"avg_line_length": 43.58522727272727,
"alnum_prop": 0.5562508147568765,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "d88980e9e7bdc6866fc01646a90b4ea75540638b",
"size": "7696",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.5.0/pi-agm/1.2.3.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
#pragma once
#include <aws/elasticbeanstalk/ElasticBeanstalk_EXPORTS.h>
#include <aws/elasticbeanstalk/ElasticBeanstalkRequest.h>
namespace Aws
{
namespace ElasticBeanstalk
{
namespace Model
{
/**
*/
class AWS_ELASTICBEANSTALK_API ListAvailableSolutionStacksRequest : public ElasticBeanstalkRequest
{
public:
ListAvailableSolutionStacksRequest();
Aws::String SerializePayload() const override;
};
} // namespace Model
} // namespace ElasticBeanstalk
} // namespace Aws
| {
"content_hash": "c0608c5c36b1b49a952d57d9a6e4c379",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 100,
"avg_line_length": 19.84,
"alnum_prop": 0.7661290322580645,
"repo_name": "ambasta/aws-sdk-cpp",
"id": "615367301e959d1a40c205d66b8a8817c990e73a",
"size": "1069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-elasticbeanstalk/include/aws/elasticbeanstalk/model/ListAvailableSolutionStacksRequest.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2305"
},
{
"name": "C++",
"bytes": "74273816"
},
{
"name": "CMake",
"bytes": "412257"
},
{
"name": "Java",
"bytes": "229873"
},
{
"name": "Python",
"bytes": "62933"
}
],
"symlink_target": ""
} |
@*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - info@scireum.de
*@
@args List buckets, String baseUrl, String accessKey, String secretKey
@extends(view.main.html, title: "Start")
@section(sidebar) {
<div class="well">
<dl>
<dt>Storage Path</dt>
<dd><small>@baseUrl</small></dd>
</dl>
<dl>
<dt>Access Key</dt>
<dd><small>@accessKey</small></dd>
</dl>
<dl>
<dt>Secret Key</dt>
<dd><small>@secretKey</small></dd>
</dl>
</div>
}
<div class="well">
<div class="pull-left">
<form class="form-inline" action="@prefix/" method="post">
<input type="text" name="bucketName" placeholder="New Bucket..." autofocus />
<button type="submit" class="btn btn-success">Create</button>
</form>
</div>
<div class="pull-right">
<a class="btn" href="@prefix/">@i18n("NLS.refresh")</a>
</div>
<span class="clearfix"></span>
</div>
<table class="table table-striped table-bordered">
<tr>
<td colspan="2">Bucket</td>
</tr>
@if(buckets.isEmpty()) {
<tr>
<td colspan="2"><i>No buckets found...</i></td>
</tr>
}
@for(ninja.Bucket bucket : buckets) {
<tr @if(bucket.isPrivate()) { class="error" }>
<td>
<a href="@prefix/ui/@bucket.getName()">@bucket.getName()</a>
@if(bucket.isPrivate()) {
<br /><span class="muted">private</span>
}
</td>
<td class="align-center span2"><a href="@prefix/ui/@bucket.getName()/delete" class="btn btn-danger">@i18n("NLS.delete")</a></td>
</tr>
}
</table>
| {
"content_hash": "1c4ad621ea667ee0047f243a652e063f",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 140,
"avg_line_length": 29.515625,
"alnum_prop": 0.501852832186342,
"repo_name": "ocadaruma/s3ninja",
"id": "d48ff7d76242168c3fe4af853a961b848e387cca",
"size": "1889",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/main/resources/view/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2412"
},
{
"name": "Groovy",
"bytes": "4837"
},
{
"name": "HTML",
"bytes": "18603"
},
{
"name": "Java",
"bytes": "68894"
},
{
"name": "JavaScript",
"bytes": "37142"
}
],
"symlink_target": ""
} |
//===--- GenDecl.cpp - IR Generation for Declarations ---------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file implements IR generation for local and global
// declarations in Swift.
//
//===----------------------------------------------------------------------===//
#include "swift/AST/ASTContext.h"
#include "swift/AST/Decl.h"
#include "swift/AST/DiagnosticEngine.h"
#include "swift/AST/DiagnosticsIRGen.h"
#include "swift/AST/GenericEnvironment.h"
#include "swift/AST/GenericSignature.h"
#include "swift/AST/IRGenOptions.h"
#include "swift/AST/Module.h"
#include "swift/AST/NameLookup.h"
#include "swift/AST/Pattern.h"
#include "swift/AST/ProtocolConformance.h"
#include "swift/AST/TypeMemberVisitor.h"
#include "swift/AST/Types.h"
#include "swift/ClangImporter/ClangModule.h"
#include "swift/Demangling/ManglingMacros.h"
#include "swift/IRGen/Linking.h"
#include "swift/Runtime/HeapObject.h"
#include "swift/SIL/FormalLinkage.h"
#include "swift/SIL/SILDebugScope.h"
#include "swift/SIL/SILModule.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/GlobalDecl.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeBuilder.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Path.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "ConstantBuilder.h"
#include "Explosion.h"
#include "FixedTypeInfo.h"
#include "GenCall.h"
#include "GenClass.h"
#include "GenDecl.h"
#include "GenMeta.h"
#include "GenObjC.h"
#include "GenOpaque.h"
#include "GenType.h"
#include "IRGenDebugInfo.h"
#include "IRGenFunction.h"
#include "IRGenMangler.h"
#include "IRGenModule.h"
#include "LoadableTypeInfo.h"
#include "Signature.h"
#include "StructLayout.h"
using namespace swift;
using namespace irgen;
bool IRGenerator::tryEnableLazyTypeMetadata(NominalTypeDecl *Nominal) {
// When compiling with -Onone keep all metadata for the debugger. Even if it
// is not used by the program itself.
if (!Opts.shouldOptimize())
return false;
switch (Nominal->getKind()) {
case DeclKind::Enum:
case DeclKind::Struct:
break;
default:
// Keep all metadata for classes, because a class can be instantiated by
// using the library function _typeByName or NSClassFromString.
return false;
}
switch (getDeclLinkage(Nominal)) {
case FormalLinkage::PublicUnique:
case FormalLinkage::PublicNonUnique:
// We can't remove metadata for externally visible types.
return false;
case FormalLinkage::HiddenUnique:
case FormalLinkage::HiddenNonUnique:
// In non-whole-module mode, also internal types are visible externally.
if (!SIL.isWholeModule())
return false;
break;
case FormalLinkage::Private:
break;
}
assert(eligibleLazyMetadata.count(Nominal) == 0);
eligibleLazyMetadata.insert(Nominal);
return true;
}
namespace {
/// Add methods, properties, and protocol conformances from a JITed extension
/// to an ObjC class using the ObjC runtime.
///
/// This must happen after ObjCProtocolInitializerVisitor if any @objc protocols
/// were defined in the TU.
class CategoryInitializerVisitor
: public ClassMemberVisitor<CategoryInitializerVisitor>
{
IRGenFunction &IGF;
IRGenModule &IGM = IGF.IGM;
IRBuilder &Builder = IGF.Builder;
llvm::Constant *class_replaceMethod;
llvm::Constant *class_addProtocol;
llvm::Constant *classMetadata;
llvm::Constant *metaclassMetadata;
public:
CategoryInitializerVisitor(IRGenFunction &IGF, ExtensionDecl *ext)
: IGF(IGF)
{
class_replaceMethod = IGM.getClassReplaceMethodFn();
class_addProtocol = IGM.getClassAddProtocolFn();
CanType origTy = ext->getAsNominalTypeOrNominalTypeExtensionContext()
->getDeclaredType()->getCanonicalType();
classMetadata =
tryEmitConstantHeapMetadataRef(IGM, origTy, /*allowUninit*/ true);
assert(classMetadata &&
"extended objc class doesn't have constant metadata?!");
classMetadata = llvm::ConstantExpr::getBitCast(classMetadata,
IGM.ObjCClassPtrTy);
metaclassMetadata = IGM.getAddrOfMetaclassObject(
origTy.getClassOrBoundGenericClass(),
NotForDefinition);
metaclassMetadata = llvm::ConstantExpr::getBitCast(metaclassMetadata,
IGM.ObjCClassPtrTy);
// We need to make sure the Objective-C runtime has initialized our
// class. If you try to add or replace a method to a class that isn't
// initialized yet, the Objective-C runtime will crash in the calls
// to class_replaceMethod or class_addProtocol.
Builder.CreateCall(IGM.getGetInitializedObjCClassFn(), classMetadata);
// Register ObjC protocol conformances.
for (auto *p : ext->getLocalProtocols()) {
if (!p->isObjC())
continue;
llvm::Value *protoRef = IGM.getAddrOfObjCProtocolRef(p, NotForDefinition);
auto proto = Builder.CreateLoad(protoRef, IGM.getPointerAlignment());
Builder.CreateCall(class_addProtocol, {classMetadata, proto});
}
}
void visitMembers(ExtensionDecl *ext) {
for (Decl *member : ext->getMembers())
visit(member);
}
void visitTypeDecl(TypeDecl *type) {
// We'll visit nested types separately if necessary.
}
void visitMissingMemberDecl(MissingMemberDecl *placeholder) {}
void visitFuncDecl(FuncDecl *method) {
if (!requiresObjCMethodDescriptor(method)) return;
// Don't emit getters/setters for @NSManaged methods.
if (method->getAttrs().hasAttribute<NSManagedAttr>())
return;
llvm::Constant *name, *imp, *types;
emitObjCMethodDescriptorParts(IGM, method,
/*extended*/false,
/*concrete*/true,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
llvm::Value *args[] = {
method->isStatic() ? metaclassMetadata : classMetadata,
sel,
imp,
types
};
Builder.CreateCall(class_replaceMethod, args);
}
// Can't be added in an extension.
void visitDestructorDecl(DestructorDecl *dtor) {}
void visitConstructorDecl(ConstructorDecl *constructor) {
if (!requiresObjCMethodDescriptor(constructor)) return;
llvm::Constant *name, *imp, *types;
emitObjCMethodDescriptorParts(IGM, constructor, /*extended*/false,
/*concrete*/true,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
llvm::Value *args[] = {
classMetadata,
sel,
imp,
types
};
Builder.CreateCall(class_replaceMethod, args);
}
void visitPatternBindingDecl(PatternBindingDecl *binding) {
// Ignore the PBD and just handle the individual vars.
}
void visitVarDecl(VarDecl *prop) {
if (!requiresObjCPropertyDescriptor(IGM, prop)) return;
// FIXME: register property metadata in addition to the methods.
// ObjC doesn't have a notion of class properties, so we'd only do this
// for instance properties.
// Don't emit getters/setters for @NSManaged properties.
if (prop->getAttrs().hasAttribute<NSManagedAttr>())
return;
llvm::Constant *name, *imp, *types;
emitObjCGetterDescriptorParts(IGM, prop,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
auto theClass = prop->isStatic() ? metaclassMetadata : classMetadata;
llvm::Value *getterArgs[] = {theClass, sel, imp, types};
Builder.CreateCall(class_replaceMethod, getterArgs);
if (prop->isSettable(prop->getDeclContext())) {
emitObjCSetterDescriptorParts(IGM, prop,
name, types, imp);
sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
llvm::Value *setterArgs[] = {theClass, sel, imp, types};
Builder.CreateCall(class_replaceMethod, setterArgs);
}
}
void visitSubscriptDecl(SubscriptDecl *subscript) {
assert(!subscript->isStatic() && "objc doesn't support class subscripts");
if (!requiresObjCSubscriptDescriptor(IGM, subscript)) return;
llvm::Constant *name, *imp, *types;
emitObjCGetterDescriptorParts(IGM, subscript,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
llvm::Value *getterArgs[] = {classMetadata, sel, imp, types};
Builder.CreateCall(class_replaceMethod, getterArgs);
if (subscript->isSettable()) {
emitObjCSetterDescriptorParts(IGM, subscript,
name, types, imp);
sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(),
name);
llvm::Value *setterArgs[] = {classMetadata, sel, imp, types};
Builder.CreateCall(class_replaceMethod, setterArgs);
}
}
};
/// Create a descriptor for JITed @objc protocol using the ObjC runtime.
class ObjCProtocolInitializerVisitor
: public ClassMemberVisitor<ObjCProtocolInitializerVisitor>
{
IRGenFunction &IGF;
IRGenModule &IGM = IGF.IGM;
IRBuilder &Builder = IGF.Builder;
llvm::Constant *objc_getProtocol,
*objc_allocateProtocol,
*objc_registerProtocol,
*protocol_addMethodDescription,
*protocol_addProtocol;
llvm::Value *NewProto = nullptr;
public:
ObjCProtocolInitializerVisitor(IRGenFunction &IGF)
: IGF(IGF)
{
objc_getProtocol = IGM.getGetObjCProtocolFn();
objc_allocateProtocol = IGM.getAllocateObjCProtocolFn();
objc_registerProtocol = IGM.getRegisterObjCProtocolFn();
protocol_addMethodDescription = IGM.getProtocolAddMethodDescriptionFn();
protocol_addProtocol = IGM.getProtocolAddProtocolFn();
}
void visitMembers(ProtocolDecl *proto) {
// Check if the ObjC runtime already has a descriptor for this
// protocol. If so, use it.
SmallString<32> buf;
auto protocolName
= IGM.getAddrOfGlobalString(proto->getObjCRuntimeName(buf));
auto existing = Builder.CreateCall(objc_getProtocol, protocolName);
auto isNull = Builder.CreateICmpEQ(existing,
llvm::ConstantPointerNull::get(IGM.ProtocolDescriptorPtrTy));
auto existingBB = IGF.createBasicBlock("existing_protocol");
auto newBB = IGF.createBasicBlock("new_protocol");
auto contBB = IGF.createBasicBlock("cont");
Builder.CreateCondBr(isNull, newBB, existingBB);
// Nothing to do if there's already a descriptor.
Builder.emitBlock(existingBB);
Builder.CreateBr(contBB);
Builder.emitBlock(newBB);
// Allocate the protocol descriptor.
NewProto = Builder.CreateCall(objc_allocateProtocol, protocolName);
// Add the parent protocols.
for (auto parentProto : proto->getInheritedProtocols()) {
if (!parentProto->isObjC())
continue;
llvm::Value *parentRef = IGM.getAddrOfObjCProtocolRef(parentProto,
NotForDefinition);
parentRef = IGF.Builder.CreateBitCast(parentRef,
IGM.ProtocolDescriptorPtrTy
->getPointerTo());
auto parent = Builder.CreateLoad(parentRef,
IGM.getPointerAlignment());
Builder.CreateCall(protocol_addProtocol, {NewProto, parent});
}
// Add the members.
for (Decl *member : proto->getMembers())
visit(member);
// Register it.
Builder.CreateCall(objc_registerProtocol, NewProto);
Builder.CreateBr(contBB);
// Store the reference to the runtime's idea of the protocol descriptor.
Builder.emitBlock(contBB);
auto result = Builder.CreatePHI(IGM.ProtocolDescriptorPtrTy, 2);
result->addIncoming(existing, existingBB);
result->addIncoming(NewProto, newBB);
llvm::Value *ref = IGM.getAddrOfObjCProtocolRef(proto, NotForDefinition);
ref = IGF.Builder.CreateBitCast(ref,
IGM.ProtocolDescriptorPtrTy->getPointerTo());
Builder.CreateStore(result, ref, IGM.getPointerAlignment());
}
void visitTypeDecl(TypeDecl *type) {
// We'll visit nested types separately if necessary.
}
void visitMissingMemberDecl(MissingMemberDecl *placeholder) {}
void visitAbstractFunctionDecl(AbstractFunctionDecl *method) {
llvm::Constant *name, *imp, *types;
emitObjCMethodDescriptorParts(IGM, method, /*extended*/true,
/*concrete*/false,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(), name);
llvm::Value *args[] = {
NewProto, sel, types,
// required?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
!method->getAttrs().hasAttribute<OptionalAttr>()),
// instance?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
isa<ConstructorDecl>(method) || method->isInstanceMember()),
};
Builder.CreateCall(protocol_addMethodDescription, args);
}
void visitPatternBindingDecl(PatternBindingDecl *binding) {
// Ignore the PBD and just handle the individual vars.
}
void visitAbstractStorageDecl(AbstractStorageDecl *prop) {
// TODO: Add properties to protocol.
llvm::Constant *name, *imp, *types;
emitObjCGetterDescriptorParts(IGM, prop,
name, types, imp);
// When generating JIT'd code, we need to call sel_registerName() to force
// the runtime to unique the selector.
llvm::Value *sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(), name);
llvm::Value *getterArgs[] = {
NewProto, sel, types,
// required?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
!prop->getAttrs().hasAttribute<OptionalAttr>()),
// instance?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
prop->isInstanceMember()),
};
Builder.CreateCall(protocol_addMethodDescription, getterArgs);
if (prop->isSettable(nullptr)) {
emitObjCSetterDescriptorParts(IGM, prop, name, types, imp);
sel = Builder.CreateCall(IGM.getObjCSelRegisterNameFn(), name);
llvm::Value *setterArgs[] = {
NewProto, sel, types,
// required?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
!prop->getAttrs().hasAttribute<OptionalAttr>()),
// instance?
llvm::ConstantInt::get(IGM.ObjCBoolTy,
prop->isInstanceMember()),
};
Builder.CreateCall(protocol_addMethodDescription, setterArgs);
}
}
};
} // end anonymous namespace
namespace {
class PrettySourceFileEmission : public llvm::PrettyStackTraceEntry {
const SourceFile &SF;
public:
explicit PrettySourceFileEmission(const SourceFile &SF) : SF(SF) {}
void print(raw_ostream &os) const override {
os << "While emitting IR for source file " << SF.getFilename() << '\n';
}
};
} // end anonymous namespace
/// Emit all the top-level code in the source file.
void IRGenModule::emitSourceFile(SourceFile &SF, unsigned StartElem) {
PrettySourceFileEmission StackEntry(SF);
// Emit types and other global decls.
for (unsigned i = StartElem, e = SF.Decls.size(); i != e; ++i)
emitGlobalDecl(SF.Decls[i]);
for (auto *localDecl : SF.LocalTypeDecls)
emitGlobalDecl(localDecl);
SF.forAllVisibleModules([&](swift::ModuleDecl::ImportedModule import) {
swift::ModuleDecl *next = import.second;
if (next->getName() == SF.getParentModule()->getName())
return;
next->collectLinkLibraries([this](LinkLibrary linkLib) {
this->addLinkLibrary(linkLib);
});
});
if (ObjCInterop)
this->addLinkLibrary(LinkLibrary("objc", LibraryKind::Library));
}
/// Collect elements of an already-existing global list with the given
/// \c name into \c list.
///
/// We use this when Clang code generation might populate the list.
static void collectGlobalList(IRGenModule &IGM,
SmallVectorImpl<llvm::WeakTrackingVH> &list,
StringRef name) {
if (auto *existing = IGM.Module.getGlobalVariable(name)) {
auto *globals = cast<llvm::ConstantArray>(existing->getInitializer());
for (auto &use : globals->operands()) {
auto *global = use.get();
list.push_back(global);
}
existing->eraseFromParent();
}
std::for_each(list.begin(), list.end(),
[](const llvm::WeakTrackingVH &global) {
assert(!isa<llvm::GlobalValue>(global) ||
!cast<llvm::GlobalValue>(global)->isDeclaration() &&
"all globals in the 'used' list must be definitions");
});
}
/// Emit a global list, i.e. a global constant array holding all of a
/// list of values. Generally these lists are for various LLVM
/// metadata or runtime purposes.
static llvm::GlobalVariable *
emitGlobalList(IRGenModule &IGM, ArrayRef<llvm::WeakTrackingVH> handles,
StringRef name, StringRef section,
llvm::GlobalValue::LinkageTypes linkage,
llvm::Type *eltTy,
bool isConstant) {
// Do nothing if the list is empty.
if (handles.empty()) return nullptr;
// For global lists that actually get linked (as opposed to notional
// ones like @llvm.used), it's important to set an explicit alignment
// so that the linker doesn't accidentally put padding in the list.
Alignment alignment = IGM.getPointerAlignment();
// We have an array of value handles, but we need an array of constants.
SmallVector<llvm::Constant*, 8> elts;
elts.reserve(handles.size());
for (auto &handle : handles) {
auto elt = cast<llvm::Constant>(&*handle);
if (elt->getType() != eltTy)
elt = llvm::ConstantExpr::getBitCast(elt, eltTy);
elts.push_back(elt);
}
auto varTy = llvm::ArrayType::get(eltTy, elts.size());
auto init = llvm::ConstantArray::get(varTy, elts);
auto var = new llvm::GlobalVariable(IGM.Module, varTy, isConstant, linkage,
init, name);
var->setSection(section);
var->setAlignment(alignment.getValue());
// Mark the variable as used if doesn't have external linkage.
// (Note that we'd specifically like to not put @llvm.used in itself.)
if (llvm::GlobalValue::isLocalLinkage(linkage))
IGM.addUsedGlobal(var);
return var;
}
void IRGenModule::emitRuntimeRegistration() {
// Duck out early if we have nothing to register.
if (ProtocolConformances.empty()
&& RuntimeResolvableTypes.empty()
&& (!ObjCInterop || (ObjCProtocols.empty() &&
ObjCClasses.empty() &&
ObjCCategoryDecls.empty())))
return;
// Find the entry point.
SILFunction *EntryPoint =
getSILModule().lookUpFunction(SWIFT_ENTRY_POINT_FUNCTION);
// If we're debugging (and not in the REPL), we don't have a
// main. Find a function marked with the LLDBDebuggerFunction
// attribute instead.
if (!EntryPoint && Context.LangOpts.DebuggerSupport) {
for (SILFunction &SF : getSILModule()) {
if (SF.hasLocation()) {
if (Decl* D = SF.getLocation().getAsASTNode<Decl>()) {
if (auto *FD = dyn_cast<FuncDecl>(D)) {
if (FD->getAttrs().hasAttribute<LLDBDebuggerFunctionAttr>()) {
EntryPoint = &SF;
break;
}
}
}
}
}
}
if (!EntryPoint)
return;
llvm::Function *EntryFunction = Module.getFunction(EntryPoint->getName());
if (!EntryFunction)
return;
// Create a new function to contain our logic.
auto fnTy = llvm::FunctionType::get(VoidTy, /*varArg*/ false);
auto RegistrationFunction = llvm::Function::Create(fnTy,
llvm::GlobalValue::PrivateLinkage,
"runtime_registration",
getModule());
RegistrationFunction->setAttributes(constructInitialAttributes());
// Insert a call into the entry function.
{
llvm::BasicBlock *EntryBB = &EntryFunction->getEntryBlock();
llvm::BasicBlock::iterator IP = EntryBB->getFirstInsertionPt();
IRBuilder Builder(getLLVMContext(),
DebugInfo && !Context.LangOpts.DebuggerSupport);
Builder.llvm::IRBuilderBase::SetInsertPoint(EntryBB, IP);
if (DebugInfo && !Context.LangOpts.DebuggerSupport)
DebugInfo->setEntryPointLoc(Builder);
Builder.CreateCall(RegistrationFunction, {});
}
IRGenFunction RegIGF(*this, RegistrationFunction);
if (DebugInfo && !Context.LangOpts.DebuggerSupport)
DebugInfo->emitArtificialFunction(RegIGF, RegistrationFunction);
// Register ObjC protocols, classes, and extensions we added.
if (ObjCInterop) {
if (!ObjCProtocols.empty()) {
// We need to initialize ObjC protocols in inheritance order, parents
// first.
llvm::DenseSet<ProtocolDecl*> protos;
for (auto &proto : ObjCProtocols)
protos.insert(proto.first);
llvm::SmallVector<ProtocolDecl*, 4> protoInitOrder;
std::function<void(ProtocolDecl*)> orderProtocol
= [&](ProtocolDecl *proto) {
// Recursively put parents first.
for (auto parent : proto->getInheritedProtocols())
orderProtocol(parent);
// Skip if we don't need to reify this protocol.
auto found = protos.find(proto);
if (found == protos.end())
return;
protos.erase(found);
protoInitOrder.push_back(proto);
};
while (!protos.empty()) {
orderProtocol(*protos.begin());
}
// Visit the protocols in the order we established.
for (auto *proto : protoInitOrder) {
ObjCProtocolInitializerVisitor(RegIGF)
.visitMembers(proto);
}
}
for (llvm::WeakTrackingVH &ObjCClass : ObjCClasses) {
RegIGF.Builder.CreateCall(getInstantiateObjCClassFn(), {ObjCClass});
}
for (ExtensionDecl *ext : ObjCCategoryDecls) {
CategoryInitializerVisitor(RegIGF, ext).visitMembers(ext);
}
}
// Register Swift protocol conformances if we added any.
if (!ProtocolConformances.empty()) {
llvm::Constant *conformances = emitProtocolConformances();
llvm::Constant *beginIndices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, 0),
};
auto begin = llvm::ConstantExpr::getGetElementPtr(
/*Ty=*/nullptr, conformances, beginIndices);
llvm::Constant *endIndices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, ProtocolConformances.size()),
};
auto end = llvm::ConstantExpr::getGetElementPtr(
/*Ty=*/nullptr, conformances, endIndices);
RegIGF.Builder.CreateCall(getRegisterProtocolConformancesFn(), {begin, end});
}
if (!RuntimeResolvableTypes.empty()) {
llvm::Constant *records = emitTypeMetadataRecords();
llvm::Constant *beginIndices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, 0),
};
auto begin = llvm::ConstantExpr::getGetElementPtr(
/*Ty=*/nullptr, records, beginIndices);
llvm::Constant *endIndices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, RuntimeResolvableTypes.size()),
};
auto end = llvm::ConstantExpr::getGetElementPtr(
/*Ty=*/nullptr, records, endIndices);
RegIGF.Builder.CreateCall(getRegisterTypeMetadataRecordsFn(), {begin, end});
}
RegIGF.Builder.CreateRetVoid();
}
/// Add the given global value to @llvm.used.
///
/// This value must have a definition by the time the module is finalized.
void IRGenModule::addUsedGlobal(llvm::GlobalValue *global) {
LLVMUsed.push_back(global);
}
/// Add the given global value to @llvm.compiler.used.
///
/// This value must have a definition by the time the module is finalized.
void IRGenModule::addCompilerUsedGlobal(llvm::GlobalValue *global) {
LLVMCompilerUsed.push_back(global);
}
/// Add the given global value to the Objective-C class list.
void IRGenModule::addObjCClass(llvm::Constant *classPtr, bool nonlazy) {
ObjCClasses.push_back(classPtr);
if (nonlazy)
ObjCNonLazyClasses.push_back(classPtr);
}
/// Add the given protocol conformance to the list of conformances for which
/// runtime records will be emitted in this translation unit.
void IRGenModule::addProtocolConformanceRecord(
NormalProtocolConformance *conformance) {
ProtocolConformances.push_back(conformance);
}
static bool
hasExplicitProtocolConformance(NominalTypeDecl *decl) {
auto conformances = decl->getAllConformances();
for (auto conformance : conformances) {
// inherited protocols do not emit explicit conformance records
// TODO any special handling required for Specialized conformances?
if (conformance->getKind() == ProtocolConformanceKind::Inherited)
continue;
auto P = conformance->getProtocol();
// @objc protocols do not have conformance records
if (P->isObjC())
continue;
return true;
}
return false;
}
void IRGenModule::addRuntimeResolvableType(CanType type) {
// Don't emit type metadata records for types that can be found in the protocol
// conformance table as the runtime will search both tables when resolving a
// type by name.
if (NominalTypeDecl *Nominal = type->getAnyNominal()) {
if (!hasExplicitProtocolConformance(Nominal))
RuntimeResolvableTypes.push_back(type);
// As soon as the type metadata is available, all the type's conformances
// must be available, too. The reason is that a type (with the help of its
// metadata) can be checked at runtime if it conforms to a protocol.
addLazyConformances(Nominal);
}
}
void IRGenModule::addLazyConformances(NominalTypeDecl *Nominal) {
for (const ProtocolConformance *Conf : Nominal->getAllConformances()) {
IRGen.addLazyWitnessTable(Conf);
}
}
std::string IRGenModule::GetObjCSectionName(StringRef Section,
StringRef MachOAttributes) {
assert(Section.substr(0, 2) == "__" && "expected the name to begin with __");
switch (TargetInfo.OutputObjectFormat) {
case llvm::Triple::UnknownObjectFormat:
llvm_unreachable("must know the object file format");
case llvm::Triple::MachO:
return MachOAttributes.empty()
? ("__DATA," + Section).str()
: ("__DATA," + Section + "," + MachOAttributes).str();
case llvm::Triple::ELF:
return Section.substr(2).str();
case llvm::Triple::COFF:
return ("." + Section.substr(2) + "$B").str();
case llvm::Triple::Wasm:
error(SourceLoc(), "wasm is not a supported object file format");
}
llvm_unreachable("unexpected object file format");
}
void IRGenModule::SetCStringLiteralSection(llvm::GlobalVariable *GV,
ObjCLabelType Type) {
switch (TargetInfo.OutputObjectFormat) {
case llvm::Triple::UnknownObjectFormat:
llvm_unreachable("must know the object file format");
case llvm::Triple::MachO:
switch (Type) {
case ObjCLabelType::ClassName:
GV->setSection("__TEXT,__objc_classname,cstring_literals");
return;
case ObjCLabelType::MethodVarName:
GV->setSection("__TEXT,__objc_methname,cstring_literals");
return;
case ObjCLabelType::MethodVarType:
GV->setSection("__TEXT,__objc_methtype,cstring_literals");
return;
case ObjCLabelType::PropertyName:
GV->setSection("__TEXT,__cstring,cstring_literals");
return;
}
case llvm::Triple::ELF:
return;
case llvm::Triple::COFF:
return;
case llvm::Triple::Wasm:
error(SourceLoc(), "wasm is not a supported object file format");
return;
}
llvm_unreachable("unexpected object file format");
}
void IRGenModule::emitGlobalLists() {
if (ObjCInterop) {
// Objective-C class references go in a variable with a meaningless
// name but a magic section.
emitGlobalList(*this, ObjCClasses, "objc_classes",
GetObjCSectionName("__objc_classlist",
"regular,no_dead_strip"),
llvm::GlobalValue::InternalLinkage, Int8PtrTy, false);
// So do categories.
emitGlobalList(*this, ObjCCategories, "objc_categories",
GetObjCSectionName("__objc_catlist",
"regular,no_dead_strip"),
llvm::GlobalValue::InternalLinkage, Int8PtrTy, false);
// Emit nonlazily realized class references in a second magic section to make
// sure they are realized by the Objective-C runtime before any instances
// are allocated.
emitGlobalList(*this, ObjCNonLazyClasses, "objc_non_lazy_classes",
GetObjCSectionName("__objc_nlclslist",
"regular,no_dead_strip"),
llvm::GlobalValue::InternalLinkage, Int8PtrTy, false);
}
// @llvm.used
// Collect llvm.used globals already in the module (coming from ClangCodeGen).
collectGlobalList(*this, LLVMUsed, "llvm.used");
emitGlobalList(*this, LLVMUsed, "llvm.used", "llvm.metadata",
llvm::GlobalValue::AppendingLinkage,
Int8PtrTy,
false);
// Collect llvm.compiler.used globals already in the module (coming
// from ClangCodeGen).
collectGlobalList(*this, LLVMCompilerUsed, "llvm.compiler.used");
emitGlobalList(*this, LLVMCompilerUsed, "llvm.compiler.used", "llvm.metadata",
llvm::GlobalValue::AppendingLinkage,
Int8PtrTy,
false);
}
void IRGenerator::emitGlobalTopLevel() {
// Generate order numbers for the functions in the SIL module that
// correspond to definitions in the LLVM module.
unsigned nextOrderNumber = 0;
for (auto &silFn : PrimaryIGM->getSILModule().getFunctions()) {
// Don't bother adding external declarations to the function order.
if (!silFn.isDefinition()) continue;
FunctionOrder.insert(std::make_pair(&silFn, nextOrderNumber++));
}
for (SILGlobalVariable &v : PrimaryIGM->getSILModule().getSILGlobals()) {
Decl *decl = v.getDecl();
CurrentIGMPtr IGM = getGenModule(decl ? decl->getDeclContext() : nullptr);
IGM->emitSILGlobalVariable(&v);
}
PrimaryIGM->emitCoverageMapping();
// Emit SIL functions.
for (SILFunction &f : PrimaryIGM->getSILModule()) {
// Only eagerly emit functions that are externally visible.
if (!f.isPossiblyUsedExternally())
continue;
CurrentIGMPtr IGM = getGenModule(&f);
IGM->emitSILFunction(&f);
}
// Emit static initializers.
for (auto Iter : *this) {
IRGenModule *IGM = Iter.second;
IGM->emitSILStaticInitializers();
}
// Emit witness tables.
for (SILWitnessTable &wt : PrimaryIGM->getSILModule().getWitnessTableList()) {
CurrentIGMPtr IGM = getGenModule(wt.getConformance()->getDeclContext());
if (!canEmitWitnessTableLazily(&wt)) {
IGM->emitSILWitnessTable(&wt);
}
}
for (auto Iter : *this) {
IRGenModule *IGM = Iter.second;
IGM->finishEmitAfterTopLevel();
}
}
void IRGenModule::finishEmitAfterTopLevel() {
// Emit the implicit import of the swift standard library.
if (DebugInfo) {
std::pair<swift::Identifier, swift::SourceLoc> AccessPath[] = {
{ Context.StdlibModuleName, swift::SourceLoc() }
};
auto Imp = ImportDecl::create(Context,
getSwiftModule(),
SourceLoc(),
ImportKind::Module, SourceLoc(),
AccessPath);
DebugInfo->emitImport(Imp);
}
}
static void emitLazyTypeMetadata(IRGenModule &IGM, NominalTypeDecl *Nominal) {
if (auto sd = dyn_cast<StructDecl>(Nominal)) {
return emitStructMetadata(IGM, sd);
} else if (auto ed = dyn_cast<EnumDecl>(Nominal)) {
emitEnumMetadata(IGM, ed);
} else if (auto pd = dyn_cast<ProtocolDecl>(Nominal)) {
IGM.emitProtocolDecl(pd);
} else {
llvm_unreachable("should not have enqueued a class decl here!");
}
}
void IRGenerator::emitProtocolConformances() {
for (auto &m : *this) {
m.second->emitProtocolConformances();
}
}
void IRGenerator::emitTypeMetadataRecords() {
for (auto &m : *this) {
m.second->emitTypeMetadataRecords();
}
}
/// Emit any lazy definitions (of globals or functions or whatever
/// else) that we require.
void IRGenerator::emitLazyDefinitions() {
while (!LazyMetadata.empty() ||
!LazyFunctionDefinitions.empty() ||
!LazyFieldTypeAccessors.empty() ||
!LazyWitnessTables.empty()) {
// Emit any lazy type metadata we require.
while (!LazyMetadata.empty()) {
NominalTypeDecl *Nominal = LazyMetadata.pop_back_val();
assert(scheduledLazyMetadata.count(Nominal) == 1);
if (eligibleLazyMetadata.count(Nominal) != 0) {
CurrentIGMPtr IGM = getGenModule(Nominal->getDeclContext());
emitLazyTypeMetadata(*IGM.get(), Nominal);
}
}
while (!LazyFieldTypeAccessors.empty()) {
auto accessor = LazyFieldTypeAccessors.pop_back_val();
emitFieldTypeAccessor(*accessor.IGM, accessor.type, accessor.fn,
accessor.fieldTypes);
}
while (!LazyWitnessTables.empty()) {
SILWitnessTable *wt = LazyWitnessTables.pop_back_val();
CurrentIGMPtr IGM = getGenModule(wt->getConformance()->getDeclContext());
IGM->emitSILWitnessTable(wt);
}
// Emit any lazy function definitions we require.
while (!LazyFunctionDefinitions.empty()) {
SILFunction *f = LazyFunctionDefinitions.pop_back_val();
CurrentIGMPtr IGM = getGenModule(f);
assert(!f->isPossiblyUsedExternally()
&& "function with externally-visible linkage emitted lazily?");
IGM->emitSILFunction(f);
}
}
}
void IRGenerator::emitEagerClassInitialization() {
if (ClassesForEagerInitialization.empty())
return;
// Emit the register function in the primary module.
IRGenModule *IGM = getPrimaryIGM();
llvm::Function *RegisterFn = llvm::Function::Create(
llvm::FunctionType::get(IGM->VoidTy, false),
llvm::GlobalValue::PrivateLinkage,
"_swift_eager_class_initialization");
IGM->Module.getFunctionList().push_back(RegisterFn);
IRGenFunction RegisterIGF(*IGM, RegisterFn);
RegisterFn->setAttributes(IGM->constructInitialAttributes());
RegisterFn->setCallingConv(IGM->DefaultCC);
for (ClassDecl *CD : ClassesForEagerInitialization) {
Type Ty = CD->getDeclaredType();
llvm::Value *MetaData = RegisterIGF.emitTypeMetadataRef(getAsCanType(Ty));
assert(CD->getAttrs().hasAttribute<StaticInitializeObjCMetadataAttr>());
// Get the metadata to make sure that the class is registered. We need to
// add a use (empty inline asm instruction) for the metadata. Otherwise
// llvm would optimize the metadata accessor call away because it's
// defined as "readnone".
llvm::FunctionType *asmFnTy =
llvm::FunctionType::get(IGM->VoidTy, {MetaData->getType()},
false /* = isVarArg */);
llvm::InlineAsm *inlineAsm =
llvm::InlineAsm::get(asmFnTy, "", "r", true /* = SideEffects */);
RegisterIGF.Builder.CreateAsmCall(inlineAsm, MetaData);
}
RegisterIGF.Builder.CreateRetVoid();
// Add the registration function as a static initializer. We use a priority
// slightly lower than used for C++ global constructors, so that the code is
// executed before C++ global constructors (in case someone uses archives
// from a C++ global constructor).
llvm::appendToGlobalCtors(IGM->Module, RegisterFn, 60000, nullptr);
}
/// Emit symbols for eliminated dead methods, which can still be referenced
/// from other modules. This happens e.g. if a public class contains a (dead)
/// private method.
void IRGenModule::emitVTableStubs() {
llvm::Function *stub = nullptr;
for (auto I = getSILModule().zombies_begin();
I != getSILModule().zombies_end(); ++I) {
const SILFunction &F = *I;
if (! F.isExternallyUsedSymbol())
continue;
if (!stub) {
// Create a single stub function which calls swift_deletedMethodError().
stub = llvm::Function::Create(llvm::FunctionType::get(VoidTy, false),
llvm::GlobalValue::InternalLinkage,
"_swift_dead_method_stub");
stub->setAttributes(constructInitialAttributes());
Module.getFunctionList().push_back(stub);
stub->setCallingConv(DefaultCC);
auto *entry = llvm::BasicBlock::Create(getLLVMContext(), "entry", stub);
auto *errorFunc = getDeletedMethodErrorFn();
llvm::CallInst::Create(errorFunc, ArrayRef<llvm::Value *>(), "", entry);
new llvm::UnreachableInst(getLLVMContext(), entry);
}
// For each eliminated method symbol create an alias to the stub.
auto *alias = llvm::GlobalAlias::create(llvm::GlobalValue::ExternalLinkage,
F.getName(), stub);
if (F.getEffectiveSymbolLinkage() == SILLinkage::Hidden)
alias->setVisibility(llvm::GlobalValue::HiddenVisibility);
if (useDllStorage())
alias->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass);
}
}
void IRGenModule::emitTypeVerifier() {
// Look up the types to verify.
SmallVector<CanType, 4> TypesToVerify;
for (auto name : IRGen.Opts.VerifyTypeLayoutNames) {
// Look up the name in the module.
SmallVector<ValueDecl*, 1> lookup;
swift::ModuleDecl *M = getSwiftModule();
M->lookupMember(lookup, M, DeclName(Context.getIdentifier(name)),
Identifier());
if (lookup.empty()) {
Context.Diags.diagnose(SourceLoc(), diag::type_to_verify_not_found,
name);
continue;
}
TypeDecl *typeDecl = nullptr;
for (auto decl : lookup) {
if (auto td = dyn_cast<TypeDecl>(decl)) {
if (typeDecl) {
Context.Diags.diagnose(SourceLoc(), diag::type_to_verify_ambiguous,
name);
goto next;
}
typeDecl = td;
break;
}
}
if (!typeDecl) {
Context.Diags.diagnose(SourceLoc(), diag::type_to_verify_not_found, name);
continue;
}
{
auto type = typeDecl->getDeclaredInterfaceType();
if (type->hasTypeParameter()) {
Context.Diags.diagnose(SourceLoc(), diag::type_to_verify_dependent,
name);
continue;
}
TypesToVerify.push_back(type->getCanonicalType());
}
next:;
}
if (TypesToVerify.empty())
return;
// Find the entry point.
SILFunction *EntryPoint =
getSILModule().lookUpFunction(SWIFT_ENTRY_POINT_FUNCTION);
if (!EntryPoint)
return;
llvm::Function *EntryFunction = Module.getFunction(EntryPoint->getName());
if (!EntryFunction)
return;
// Create a new function to contain our logic.
auto fnTy = llvm::FunctionType::get(VoidTy, /*varArg*/ false);
auto VerifierFunction = llvm::Function::Create(fnTy,
llvm::GlobalValue::PrivateLinkage,
"type_verifier",
getModule());
VerifierFunction->setAttributes(constructInitialAttributes());
// Insert a call into the entry function.
{
llvm::BasicBlock *EntryBB = &EntryFunction->getEntryBlock();
llvm::BasicBlock::iterator IP = EntryBB->getFirstInsertionPt();
IRBuilder Builder(getLLVMContext(), DebugInfo);
Builder.llvm::IRBuilderBase::SetInsertPoint(EntryBB, IP);
if (DebugInfo)
DebugInfo->setEntryPointLoc(Builder);
Builder.CreateCall(VerifierFunction, {});
}
IRGenTypeVerifierFunction VerifierIGF(*this, VerifierFunction);
VerifierIGF.emit(TypesToVerify);
}
/// Get SIL-linkage for something that's not required to be visible
/// and doesn't actually need to be uniqued.
static SILLinkage getNonUniqueSILLinkage(FormalLinkage linkage,
ForDefinition_t forDefinition) {
switch (linkage) {
case FormalLinkage::PublicUnique:
case FormalLinkage::PublicNonUnique:
return (forDefinition ? SILLinkage::Shared : SILLinkage::PublicExternal);
case FormalLinkage::HiddenUnique:
case FormalLinkage::HiddenNonUnique:
return (forDefinition ? SILLinkage::Shared : SILLinkage::HiddenExternal);
case FormalLinkage::Private:
return SILLinkage::Private;
}
llvm_unreachable("bad formal linkage");
}
SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
// For when `this` is a protocol conformance of some kind.
auto getLinkageAsConformance = [&] {
return getLinkageForProtocolConformance(
getProtocolConformance()->getRootNormalConformance(), forDefinition);
};
switch (getKind()) {
// Most type metadata depend on the formal linkage of their type.
case Kind::ValueWitnessTable: {
auto type = getType();
// Builtin types, (), () -> () and so on are in the runtime.
if (!type.getAnyNominal())
return getSILLinkage(FormalLinkage::PublicUnique, forDefinition);
// Imported types.
if (getTypeMetadataAccessStrategy(type) ==
MetadataAccessStrategy::NonUniqueAccessor)
return SILLinkage::Shared;
// Everything else is only referenced inside its module.
return SILLinkage::Private;
}
case Kind::TypeMetadataLazyCacheVariable: {
auto type = getType();
// Imported types, non-primitive structural types.
if (getTypeMetadataAccessStrategy(type) ==
MetadataAccessStrategy::NonUniqueAccessor)
return SILLinkage::Shared;
// Everything else is only referenced inside its module.
return SILLinkage::Private;
}
case Kind::TypeMetadata:
if (isMetadataPattern())
return SILLinkage::Private;
switch (getMetadataAddress()) {
case TypeMetadataAddress::FullMetadata:
// The full metadata object is private to the containing module.
return SILLinkage::Private;
case TypeMetadataAddress::AddressPoint: {
auto *nominal = getType().getAnyNominal();
return getSILLinkage(nominal
? getDeclLinkage(nominal)
: FormalLinkage::PublicUnique,
forDefinition);
}
}
// ...but we don't actually expose individual value witnesses (right now).
case Kind::ValueWitness:
return getNonUniqueSILLinkage(getDeclLinkage(getType().getAnyNominal()),
forDefinition);
// Foreign type metadata candidates are always shared; the runtime
// does the uniquing.
case Kind::ForeignTypeMetadataCandidate:
return SILLinkage::Shared;
case Kind::TypeMetadataAccessFunction:
switch (getTypeMetadataAccessStrategy(getType())) {
case MetadataAccessStrategy::PublicUniqueAccessor:
return getSILLinkage(FormalLinkage::PublicUnique, forDefinition);
case MetadataAccessStrategy::HiddenUniqueAccessor:
return getSILLinkage(FormalLinkage::HiddenUnique, forDefinition);
case MetadataAccessStrategy::PrivateAccessor:
return getSILLinkage(FormalLinkage::Private, forDefinition);
case MetadataAccessStrategy::NonUniqueAccessor:
return SILLinkage::Shared;
}
llvm_unreachable("bad metadata access kind");
case Kind::ObjCClassRef:
return SILLinkage::Private;
case Kind::Function:
case Kind::Other:
case Kind::ObjCClass:
case Kind::ObjCMetaclass:
case Kind::SwiftMetaclassStub:
case Kind::FieldOffset:
case Kind::NominalTypeDescriptor:
case Kind::ClassMetadataBaseOffset:
case Kind::ProtocolDescriptor:
return getSILLinkage(getDeclLinkage(getDecl()), forDefinition);
case Kind::DirectProtocolWitnessTable:
case Kind::ProtocolWitnessTableAccessFunction:
return getLinkageAsConformance();
case Kind::ProtocolWitnessTableLazyAccessFunction:
case Kind::ProtocolWitnessTableLazyCacheVariable: {
auto *nominal = getType().getAnyNominal();
assert(nominal);
if (getDeclLinkage(nominal) == FormalLinkage::Private ||
getLinkageAsConformance() == SILLinkage::Private) {
return SILLinkage::Private;
} else {
return SILLinkage::Shared;
}
}
case Kind::AssociatedTypeMetadataAccessFunction:
case Kind::AssociatedTypeWitnessTableAccessFunction:
case Kind::GenericProtocolWitnessTableCache:
case Kind::GenericProtocolWitnessTableInstantiationFunction:
return SILLinkage::Private;
case Kind::SILFunction:
return getSILFunction()->getEffectiveSymbolLinkage();
case Kind::SILGlobalVariable:
return getSILGlobalVariable()->getLinkage();
case Kind::ReflectionBuiltinDescriptor:
case Kind::ReflectionFieldDescriptor: {
// Reflection descriptors for imported types have shared linkage,
// since we may emit them in other TUs in the same module.
if (auto *nominal = getType().getAnyNominal())
if (getDeclLinkage(nominal) == FormalLinkage::PublicNonUnique)
return SILLinkage::Shared;
return SILLinkage::Private;
}
case Kind::ReflectionAssociatedTypeDescriptor:
if (getLinkageAsConformance() == SILLinkage::Shared)
return SILLinkage::Shared;
return SILLinkage::Private;
case Kind::ReflectionSuperclassDescriptor:
if (getDeclLinkage(getDecl()) == FormalLinkage::PublicNonUnique)
return SILLinkage::Shared;
return SILLinkage::Private;
}
llvm_unreachable("bad link entity kind");
}
static bool isAvailableExternally(IRGenModule &IGM, const DeclContext *dc) {
dc = dc->getModuleScopeContext();
if (isa<ClangModuleUnit>(dc) ||
dc == IGM.getSILModule().getAssociatedContext())
return false;
return true;
}
static bool isAvailableExternally(IRGenModule &IGM, const Decl *decl) {
return isAvailableExternally(IGM, decl->getDeclContext());
}
static bool isAvailableExternally(IRGenModule &IGM, Type type) {
if (auto decl = type->getAnyNominal())
return isAvailableExternally(IGM, decl->getDeclContext());
return true;
}
bool LinkEntity::isAvailableExternally(IRGenModule &IGM) const {
switch (getKind()) {
case Kind::ValueWitnessTable:
case Kind::TypeMetadata:
return ::isAvailableExternally(IGM, getType());
case Kind::ForeignTypeMetadataCandidate:
assert(!::isAvailableExternally(IGM, getType()));
return false;
case Kind::ObjCClass:
case Kind::ObjCMetaclass:
// FIXME: Removing this triggers a linker bug
return true;
case Kind::SwiftMetaclassStub:
case Kind::ClassMetadataBaseOffset:
case Kind::NominalTypeDescriptor:
case Kind::ProtocolDescriptor:
return ::isAvailableExternally(IGM, getDecl());
case Kind::DirectProtocolWitnessTable:
return ::isAvailableExternally(IGM, getProtocolConformance()->getDeclContext());
case Kind::ObjCClassRef:
case Kind::ValueWitness:
case Kind::TypeMetadataAccessFunction:
case Kind::TypeMetadataLazyCacheVariable:
case Kind::Function:
case Kind::Other:
case Kind::FieldOffset:
case Kind::ProtocolWitnessTableAccessFunction:
case Kind::ProtocolWitnessTableLazyAccessFunction:
case Kind::ProtocolWitnessTableLazyCacheVariable:
case Kind::AssociatedTypeMetadataAccessFunction:
case Kind::AssociatedTypeWitnessTableAccessFunction:
case Kind::GenericProtocolWitnessTableCache:
case Kind::GenericProtocolWitnessTableInstantiationFunction:
case Kind::SILFunction:
case Kind::SILGlobalVariable:
case Kind::ReflectionBuiltinDescriptor:
case Kind::ReflectionFieldDescriptor:
case Kind::ReflectionAssociatedTypeDescriptor:
case Kind::ReflectionSuperclassDescriptor:
llvm_unreachable("Relative reference to unsupported link entity");
}
llvm_unreachable("bad link entity kind");
}
static std::tuple<llvm::GlobalValue::LinkageTypes,
llvm::GlobalValue::VisibilityTypes,
llvm::GlobalValue::DLLStorageClassTypes>
getIRLinkage(const UniversalLinkageInfo &info, SILLinkage linkage,
ForDefinition_t isDefinition,
bool isWeakImported) {
#define RESULT(LINKAGE, VISIBILITY, DLL_STORAGE) \
std::make_tuple(llvm::GlobalValue::LINKAGE##Linkage, \
llvm::GlobalValue::VISIBILITY##Visibility, \
llvm::GlobalValue::DLL_STORAGE##StorageClass)
// Use protected visibility for public symbols we define on ELF. ld.so
// doesn't support relative relocations at load time, which interferes with
// our metadata formats. Default visibility should suffice for other object
// formats.
llvm::GlobalValue::VisibilityTypes PublicDefinitionVisibility =
info.IsELFObject ? llvm::GlobalValue::ProtectedVisibility
: llvm::GlobalValue::DefaultVisibility;
llvm::GlobalValue::DLLStorageClassTypes ExportedStorage =
info.UseDLLStorage ? llvm::GlobalValue::DLLExportStorageClass
: llvm::GlobalValue::DefaultStorageClass;
llvm::GlobalValue::DLLStorageClassTypes ImportedStorage =
info.UseDLLStorage ? llvm::GlobalValue::DLLImportStorageClass
: llvm::GlobalValue::DefaultStorageClass;
switch (linkage) {
case SILLinkage::Public:
return std::make_tuple(llvm::GlobalValue::ExternalLinkage,
PublicDefinitionVisibility, ExportedStorage);
case SILLinkage::Shared:
case SILLinkage::SharedExternal:
return isDefinition ? RESULT(LinkOnceODR, Hidden, Default)
: RESULT(External, Hidden, Default);
case SILLinkage::Hidden:
return RESULT(External, Hidden, Default);
case SILLinkage::Private: {
auto linkage = info.needLinkerToMergeDuplicateSymbols()
? llvm::GlobalValue::LinkOnceODRLinkage
: llvm::GlobalValue::InternalLinkage;
auto visibility = info.shouldAllPrivateDeclsBeVisibleFromOtherFiles()
? llvm::GlobalValue::HiddenVisibility
: llvm::GlobalValue::DefaultVisibility;
return std::make_tuple(linkage, visibility,
llvm::GlobalValue::DefaultStorageClass);
}
case SILLinkage::PublicExternal: {
if (isDefinition) {
return std::make_tuple(llvm::GlobalValue::AvailableExternallyLinkage,
llvm::GlobalValue::DefaultVisibility,
ExportedStorage);
}
auto linkage = isWeakImported ? llvm::GlobalValue::ExternalWeakLinkage
: llvm::GlobalValue::ExternalLinkage;
return std::make_tuple(linkage, llvm::GlobalValue::DefaultVisibility,
ImportedStorage);
}
case SILLinkage::HiddenExternal:
case SILLinkage::PrivateExternal:
return std::make_tuple(isDefinition
? llvm::GlobalValue::AvailableExternallyLinkage
: llvm::GlobalValue::ExternalLinkage,
llvm::GlobalValue::HiddenVisibility,
ImportedStorage);
}
llvm_unreachable("bad SIL linkage");
}
/// Given that we're going to define a global value but already have a
/// forward-declaration of it, update its linkage.
static void updateLinkageForDefinition(IRGenModule &IGM,
llvm::GlobalValue *global,
const LinkEntity &entity) {
// TODO: there are probably cases where we can avoid redoing the
// entire linkage computation.
UniversalLinkageInfo linkInfo(IGM);
auto linkage =
getIRLinkage(linkInfo, entity.getLinkage(ForDefinition),
ForDefinition, entity.isWeakImported(IGM.getSwiftModule()));
global->setLinkage(std::get<0>(linkage));
global->setVisibility(std::get<1>(linkage));
global->setDLLStorageClass(std::get<2>(linkage));
// Everything externally visible is considered used in Swift.
// That mostly means we need to be good at not marking things external.
//
// Exclude "main", because it should naturally be used, and because adding it
// to llvm.used leaves a dangling use when the REPL attempts to discard
// intermediate mains.
if (LinkInfo::isUsed(std::get<0>(linkage), std::get<1>(linkage),
std::get<2>(linkage)) &&
global->getName() != SWIFT_ENTRY_POINT_FUNCTION)
IGM.addUsedGlobal(global);
}
LinkInfo LinkInfo::get(IRGenModule &IGM, const LinkEntity &entity,
ForDefinition_t isDefinition) {
return LinkInfo::get(IGM, IGM.getSwiftModule(), entity, isDefinition);
}
LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo,
ModuleDecl *swiftModule, const LinkEntity &entity,
ForDefinition_t isDefinition) {
LinkInfo result;
entity.mangle(result.Name);
std::tie(result.Linkage, result.Visibility, result.DLLStorageClass) =
getIRLinkage(linkInfo, entity.getLinkage(isDefinition),
isDefinition, entity.isWeakImported(swiftModule));
result.ForDefinition = isDefinition;
return result;
}
LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo,
StringRef name,
SILLinkage linkage,
ForDefinition_t isDefinition,
bool isWeakImported) {
LinkInfo result;
result.Name += name;
std::tie(result.Linkage, result.Visibility, result.DLLStorageClass) =
getIRLinkage(linkInfo, linkage,
isDefinition, isWeakImported);
result.ForDefinition = isDefinition;
return result;
}
static bool isPointerTo(llvm::Type *ptrTy, llvm::Type *objTy) {
return cast<llvm::PointerType>(ptrTy)->getElementType() == objTy;
}
/// Get or create an LLVM function with these linkage rules.
llvm::Function *irgen::createFunction(IRGenModule &IGM,
LinkInfo &linkInfo,
const Signature &signature,
llvm::Function *insertBefore,
OptimizationMode FuncOptMode) {
auto name = linkInfo.getName();
llvm::Function *existing = IGM.Module.getFunction(name);
if (existing) {
if (isPointerTo(existing->getType(), signature.getType()))
return cast<llvm::Function>(existing);
IGM.error(SourceLoc(),
"program too clever: function collides with existing symbol " +
name);
// Note that this will implicitly unique if the .unique name is also taken.
existing->setName(name + ".unique");
}
llvm::Function *fn =
llvm::Function::Create(signature.getType(), linkInfo.getLinkage(), name);
fn->setVisibility(linkInfo.getVisibility());
fn->setDLLStorageClass(linkInfo.getDLLStorage());
fn->setCallingConv(signature.getCallingConv());
if (insertBefore) {
IGM.Module.getFunctionList().insert(insertBefore->getIterator(), fn);
} else {
IGM.Module.getFunctionList().push_back(fn);
}
llvm::AttrBuilder initialAttrs;
IGM.constructInitialFnAttributes(initialAttrs, FuncOptMode);
// Merge initialAttrs with attrs.
auto updatedAttrs =
signature.getAttributes().addAttributes(IGM.getLLVMContext(),
llvm::AttributeList::FunctionIndex,
initialAttrs);
if (!updatedAttrs.isEmpty())
fn->setAttributes(updatedAttrs);
// Everything externally visible is considered used in Swift.
// That mostly means we need to be good at not marking things external.
//
// Exclude "main", because it should naturally be used, and because adding it
// to llvm.used leaves a dangling use when the REPL attempts to discard
// intermediate mains.
if (linkInfo.isUsed() && name != SWIFT_ENTRY_POINT_FUNCTION) {
IGM.addUsedGlobal(fn);
}
return fn;
}
bool LinkInfo::isUsed(llvm::GlobalValue::LinkageTypes Linkage,
llvm::GlobalValue::VisibilityTypes Visibility,
llvm::GlobalValue::DLLStorageClassTypes DLLStorage) {
// Everything externally visible is considered used in Swift.
// That mostly means we need to be good at not marking things external.
return Linkage == llvm::GlobalValue::ExternalLinkage &&
(Visibility == llvm::GlobalValue::DefaultVisibility ||
Visibility == llvm::GlobalValue::ProtectedVisibility) &&
(DLLStorage == llvm::GlobalValue::DefaultStorageClass ||
DLLStorage == llvm::GlobalValue::DLLExportStorageClass);
}
/// Get or create an LLVM global variable with these linkage rules.
llvm::GlobalVariable *swift::irgen::createVariable(
IRGenModule &IGM, LinkInfo &linkInfo, llvm::Type *storageType,
Alignment alignment, DebugTypeInfo DbgTy, Optional<SILLocation> DebugLoc,
StringRef DebugName) {
auto name = linkInfo.getName();
llvm::GlobalValue *existingValue = IGM.Module.getNamedGlobal(name);
if (existingValue) {
auto existingVar = dyn_cast<llvm::GlobalVariable>(existingValue);
if (existingVar && isPointerTo(existingVar->getType(), storageType))
return existingVar;
IGM.error(SourceLoc(),
"program too clever: variable collides with existing symbol " +
name);
// Note that this will implicitly unique if the .unique name is also taken.
existingValue->setName(name + ".unique");
}
auto var = new llvm::GlobalVariable(IGM.Module, storageType,
/*constant*/ false, linkInfo.getLinkage(),
/*initializer*/ nullptr, name);
var->setVisibility(linkInfo.getVisibility());
var->setDLLStorageClass(linkInfo.getDLLStorage());
var->setAlignment(alignment.getValue());
// Everything externally visible is considered used in Swift.
// That mostly means we need to be good at not marking things external.
if (linkInfo.isUsed()) {
IGM.addUsedGlobal(var);
}
if (IGM.DebugInfo && !DbgTy.isNull() && linkInfo.isForDefinition())
IGM.DebugInfo->emitGlobalVariableDeclaration(
var, DebugName.empty() ? name : DebugName, name, DbgTy,
var->hasInternalLinkage(), DebugLoc);
return var;
}
/// Emit a global declaration.
void IRGenModule::emitGlobalDecl(Decl *D) {
switch (D->getKind()) {
case DeclKind::Extension:
return emitExtension(cast<ExtensionDecl>(D));
case DeclKind::Protocol:
return emitProtocolDecl(cast<ProtocolDecl>(D));
case DeclKind::PatternBinding:
// The global initializations are in SIL.
return;
case DeclKind::Param:
llvm_unreachable("there are no global function parameters");
case DeclKind::Subscript:
llvm_unreachable("there are no global subscript operations");
case DeclKind::EnumCase:
case DeclKind::EnumElement:
llvm_unreachable("there are no global enum elements");
case DeclKind::Constructor:
llvm_unreachable("there are no global constructor");
case DeclKind::Destructor:
llvm_unreachable("there are no global destructor");
case DeclKind::MissingMember:
llvm_unreachable("there are no global member placeholders");
case DeclKind::TypeAlias:
case DeclKind::GenericTypeParam:
case DeclKind::AssociatedType:
case DeclKind::IfConfig:
return;
case DeclKind::Enum:
return emitEnumDecl(cast<EnumDecl>(D));
case DeclKind::Struct:
return emitStructDecl(cast<StructDecl>(D));
case DeclKind::Class:
return emitClassDecl(cast<ClassDecl>(D));
// These declarations are only included in the debug info.
case DeclKind::Import:
if (DebugInfo)
DebugInfo->emitImport(cast<ImportDecl>(D));
return;
// We emit these as part of the PatternBindingDecl.
case DeclKind::Var:
return;
case DeclKind::Func:
// Handled in SIL.
return;
case DeclKind::TopLevelCode:
// All the top-level code will be lowered separately.
return;
// Operator decls aren't needed for IRGen.
case DeclKind::InfixOperator:
case DeclKind::PrefixOperator:
case DeclKind::PostfixOperator:
case DeclKind::PrecedenceGroup:
return;
case DeclKind::Module:
return;
}
llvm_unreachable("bad decl kind!");
}
Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
const TypeInfo &ti,
ForDefinition_t forDefinition) {
if (auto clangDecl = var->getClangDecl()) {
auto addr = getAddrOfClangGlobalDecl(cast<clang::VarDecl>(clangDecl),
forDefinition);
// If we're not emitting this to define it, make sure we cast it to the
// right type.
if (!forDefinition) {
auto ptrTy = ti.getStorageType()->getPointerTo();
addr = llvm::ConstantExpr::getBitCast(addr, ptrTy);
}
auto alignment =
Alignment(getClangASTContext().getDeclAlign(clangDecl).getQuantity());
return Address(addr, alignment);
}
LinkEntity entity = LinkEntity::forSILGlobalVariable(var);
ResilienceExpansion expansion = getResilienceExpansionForLayout(var);
llvm::Type *storageType;
Size fixedSize;
Alignment fixedAlignment;
if (var->isInitializedObject()) {
assert(ti.isFixedSize(expansion));
StructLayout *Layout = StaticObjectLayouts[var].get();
if (!Layout) {
// Create the layout (includes the llvm type) for the statically
// initialized object and store it for later.
ObjectInst *OI = cast<ObjectInst>(var->getStaticInitializerValue());
llvm::SmallVector<SILType, 16> TailTypes;
for (SILValue TailOp : OI->getTailElements()) {
TailTypes.push_back(TailOp->getType());
}
Layout = getClassLayoutWithTailElems(*this,
var->getLoweredType(), TailTypes);
StaticObjectLayouts[var] = std::unique_ptr<StructLayout>(Layout);
}
storageType = Layout->getType();
fixedSize = Layout->getSize();
fixedAlignment = Layout->getAlignment();
assert(fixedAlignment >= TargetInfo.HeapObjectAlignment);
} else if (ti.isFixedSize(expansion)) {
// Allocate static storage.
auto &fixedTI = cast<FixedTypeInfo>(ti);
storageType = fixedTI.getStorageType();
fixedSize = fixedTI.getFixedSize();
fixedAlignment = fixedTI.getFixedAlignment();
} else {
// Allocate a fixed-size buffer and possibly heap-allocate a payload at
// runtime if the runtime size of the type does not fit in the buffer.
storageType = getFixedBufferTy();
fixedSize = Size(DataLayout.getTypeAllocSize(storageType));
fixedAlignment = Alignment(DataLayout.getABITypeAlignment(storageType));
}
// Check whether we've created the global variable already.
// FIXME: We should integrate this into the LinkEntity cache more cleanly.
auto gvar = Module.getGlobalVariable(var->getName(), /*allowInternal*/ true);
if (gvar) {
if (forDefinition)
updateLinkageForDefinition(*this, gvar, entity);
} else {
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
llvm::Type *storageTypeWithContainer = storageType;
if (var->isInitializedObject()) {
// A statically initialized object must be placed into a container struct
// because the swift_initStaticObject needs a swift_once_t at offset -1:
// struct Container {
// swift_once_t token[fixedAlignment / sizeof(swift_once_t)];
// HeapObject object;
// };
std::string typeName = storageType->getStructName().str() + 'c';
assert(fixedAlignment >= getPointerAlignment());
unsigned numTokens = fixedAlignment.getValue() /
getPointerAlignment().getValue();
storageTypeWithContainer = llvm::StructType::create(getLLVMContext(),
{llvm::ArrayType::get(OnceTy, numTokens), storageType}, typeName);
gvar = createVariable(*this, link, storageTypeWithContainer,
fixedAlignment);
} else {
auto DbgTy = DebugTypeInfo::getGlobal(var, storageTypeWithContainer,
fixedSize, fixedAlignment);
if (var->getDecl()) {
// If we have the VarDecl, use it for more accurate debugging information.
gvar = createVariable(*this, link, storageTypeWithContainer,
fixedAlignment, DbgTy, SILLocation(var->getDecl()),
var->getDecl()->getName().str());
} else {
Optional<SILLocation> loc;
if (var->hasLocation())
loc = var->getLocation();
gvar = createVariable(*this, link, storageTypeWithContainer,
fixedAlignment, DbgTy, loc, var->getName());
}
}
/// Add a zero initializer.
if (forDefinition)
gvar->setInitializer(llvm::Constant::getNullValue(storageTypeWithContainer));
}
llvm::Constant *addr = gvar;
if (var->isInitializedObject()) {
// Project out the object from the container.
llvm::Constant *Indices[2] = {
llvm::ConstantExpr::getIntegerValue(Int32Ty, APInt(32, 0)),
llvm::ConstantExpr::getIntegerValue(Int32Ty, APInt(32, 1))
};
// Return the address of the initialized object itself (and not the address
// to a reference to it).
addr = llvm::ConstantExpr::getGetElementPtr(nullptr, gvar, Indices);
}
addr = llvm::ConstantExpr::getBitCast(addr, storageType->getPointerTo());
return Address(addr, Alignment(gvar->getAlignment()));
}
/// Return True if the function \p f is a 'readonly' function. Checking
/// for the SIL @effects(readonly) attribute is not enough because this
/// definition does not match the definition of the LLVM readonly function
/// attribute. In this function we do the actual check.
static bool isReadOnlyFunction(SILFunction *f) {
// Check if the function has any 'owned' parameters. Owned parameters may
// call the destructor of the object which could violate the readonly-ness
// of the function.
if (f->hasOwnedParameters() || f->hasIndirectFormalResults())
return false;
auto Eff = f->getEffectsKind();
// Swift's readonly does not automatically match LLVM's readonly.
// Swift SIL optimizer relies on @effects(readonly) to remove e.g.
// dead code remaining from initializers of strings or dictionaries
// of variables that are not used. But those initializers are often
// not really readonly in terms of LLVM IR. For example, the
// Dictionary.init() is marked as @effects(readonly) in Swift, but
// it does invoke reference-counting operations.
if (Eff == EffectsKind::ReadOnly || Eff == EffectsKind::ReadNone) {
// TODO: Analyze the body of function f and return true if it is
// really readonly.
return false;
}
return false;
}
static clang::GlobalDecl getClangGlobalDeclForFunction(const clang::Decl *decl) {
if (auto ctor = dyn_cast<clang::CXXConstructorDecl>(decl))
return clang::GlobalDecl(ctor, clang::Ctor_Complete);
if (auto dtor = dyn_cast<clang::CXXDestructorDecl>(decl))
return clang::GlobalDecl(dtor, clang::Dtor_Complete);
return clang::GlobalDecl(cast<clang::FunctionDecl>(decl));
}
/// Find the entry point for a SIL function.
llvm::Function *IRGenModule::getAddrOfSILFunction(SILFunction *f,
ForDefinition_t forDefinition) {
LinkEntity entity = LinkEntity::forSILFunction(f);
// Check whether we've created the function already.
// FIXME: We should integrate this into the LinkEntity cache more cleanly.
llvm::Function *fn = Module.getFunction(f->getName());
if (fn) {
if (forDefinition) updateLinkageForDefinition(*this, fn, entity);
return fn;
}
// If it's a Clang declaration, ask Clang to generate the IR declaration.
// This might generate new functions, so we should do it before computing
// the insert-before point.
llvm::Constant *clangAddr = nullptr;
if (auto clangDecl = f->getClangDecl()) {
auto globalDecl = getClangGlobalDeclForFunction(clangDecl);
clangAddr = getAddrOfClangGlobalDecl(globalDecl, forDefinition);
}
bool isDefinition = f->isDefinition();
bool hasOrderNumber = isDefinition;
unsigned orderNumber = ~0U;
llvm::Function *insertBefore = nullptr;
// If the SIL function has a definition, we should have an order
// number for it; make sure to insert it in that position relative
// to other ordered functions.
if (hasOrderNumber) {
orderNumber = IRGen.getFunctionOrder(f);
if (auto emittedFunctionIterator
= EmittedFunctionsByOrder.findLeastUpperBound(orderNumber))
insertBefore = *emittedFunctionIterator;
}
// If it's a Clang declaration, check whether Clang gave us a declaration.
if (clangAddr) {
fn = dyn_cast<llvm::Function>(clangAddr->stripPointerCasts());
// If we have a function, move it to the appropriate position.
if (fn) {
if (hasOrderNumber) {
auto &fnList = Module.getFunctionList();
fnList.remove(fn);
fnList.insert(llvm::Module::iterator(insertBefore), fn);
EmittedFunctionsByOrder.insert(orderNumber, fn);
}
return fn;
}
// Otherwise, if we have a lazy definition for it, be sure to queue that up.
} else if (isDefinition && !forDefinition && !f->isPossiblyUsedExternally()) {
IRGen.addLazyFunction(f);
}
Signature signature = getSignature(f->getLoweredFunctionType());
auto &attrs = signature.getMutableAttributes();
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
if (f->getInlineStrategy() == NoInline) {
attrs = attrs.addAttribute(signature.getType()->getContext(),
llvm::AttributeList::FunctionIndex,
llvm::Attribute::NoInline);
}
if (isReadOnlyFunction(f)) {
attrs = attrs.addAttribute(signature.getType()->getContext(),
llvm::AttributeList::FunctionIndex,
llvm::Attribute::ReadOnly);
}
fn = createFunction(*this, link, signature, insertBefore,
f->getOptimizationMode());
// If we have an order number for this function, set it up as appropriate.
if (hasOrderNumber) {
EmittedFunctionsByOrder.insert(orderNumber, fn);
}
return fn;
}
static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
llvm::Constant *global,
StringRef globalName) {
auto gotEquivalent = new llvm::GlobalVariable(IGM.Module,
global->getType(),
/*constant*/ true,
llvm::GlobalValue::PrivateLinkage,
global,
llvm::Twine("got.") + globalName);
gotEquivalent->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
return gotEquivalent;
}
static llvm::Constant *getElementBitCast(llvm::Constant *ptr,
llvm::Type *newEltType) {
auto ptrType = cast<llvm::PointerType>(ptr->getType());
if (ptrType->getElementType() == newEltType) {
return ptr;
} else {
auto newPtrType = newEltType->getPointerTo(ptrType->getAddressSpace());
return llvm::ConstantExpr::getBitCast(ptr, newPtrType);
}
}
/// Return a reference to an object that's suitable for being used for
/// the given kind of reference.
///
/// Note that, if the requested reference kind is a relative reference.
/// the returned constant will not actually be a relative reference.
/// To form the actual relative reference, you must pass the returned
/// result to emitRelativeReference, passing the correct base-address
/// information.
ConstantReference
IRGenModule::getAddrOfLLVMVariable(LinkEntity entity, Alignment alignment,
ConstantInit definition,
llvm::Type *defaultType,
DebugTypeInfo debugType,
SymbolReferenceKind refKind) {
switch (refKind) {
case SymbolReferenceKind::Relative_Direct:
case SymbolReferenceKind::Far_Relative_Direct:
assert(!definition);
// FIXME: don't just fall through; force the creation of a weak
// definition so that we can emit a relative reference.
LLVM_FALLTHROUGH;
case SymbolReferenceKind::Absolute:
return { getAddrOfLLVMVariable(entity, alignment, definition,
defaultType, debugType),
ConstantReference::Direct };
case SymbolReferenceKind::Relative_Indirectable:
case SymbolReferenceKind::Far_Relative_Indirectable:
assert(!definition);
return getAddrOfLLVMVariableOrGOTEquivalent(entity, alignment, defaultType);
}
llvm_unreachable("bad reference kind");
}
/// A convenient wrapper around getAddrOfLLVMVariable which uses the
/// default type as the definition type.
llvm::Constant *
IRGenModule::getAddrOfLLVMVariable(LinkEntity entity, Alignment alignment,
ForDefinition_t forDefinition,
llvm::Type *defaultType,
DebugTypeInfo debugType) {
auto definition =
(forDefinition ? ConstantInit::getDelayed(defaultType) : ConstantInit());
return getAddrOfLLVMVariable(entity, alignment, definition,
defaultType, debugType);
}
/// Get or create an llvm::GlobalVariable.
///
/// If a definition type is given, the result will always be an
/// llvm::GlobalVariable of that type. Otherwise, the result will
/// have type pointerToDefaultType and may involve bitcasts.
llvm::Constant *
IRGenModule::getAddrOfLLVMVariable(LinkEntity entity, Alignment alignment,
ConstantInit definition,
llvm::Type *defaultType,
DebugTypeInfo DbgTy) {
// This function assumes that 'globals' only contains GlobalValue
// values for the entities that it will look up.
llvm::Type *definitionType = (definition ? definition.getType() : nullptr);
auto &entry = GlobalVars[entity];
if (entry) {
auto existing = cast<llvm::GlobalValue>(entry);
// If we're looking to define something, we may need to replace a
// forward declaration.
if (definitionType) {
assert(existing->isDeclaration() && "already defined");
assert(entry->getType()->getPointerElementType() == defaultType);
updateLinkageForDefinition(*this, existing, entity);
// If the existing entry is a variable of the right type,
// set the initializer on it and return.
if (auto var = dyn_cast<llvm::GlobalVariable>(existing)) {
if (definitionType == var->getValueType()) {
if (definition.hasInit())
definition.getInit().installInGlobal(var);
return var;
}
}
// Fall out to the case below, clearing the name so that
// createVariable doesn't detect a collision.
entry->setName("");
// Otherwise, we have a previous declaration or definition which
// we need to ensure has the right type.
} else {
return getElementBitCast(entry, defaultType);
}
}
ForDefinition_t forDefinition = (ForDefinition_t) (definitionType != nullptr);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
// Clang may have defined the variable already.
if (auto existing = Module.getNamedGlobal(link.getName()))
return getElementBitCast(existing, defaultType);
// If we're not defining the object now, forward declare it with the default
// type.
if (!definitionType) definitionType = defaultType;
// Create the variable.
auto var = createVariable(*this, link, definitionType, alignment, DbgTy);
// Install the concrete definition if we have one.
if (definition && definition.hasInit()) {
definition.getInit().installInGlobal(var);
}
// If we have an existing entry, destroy it, replacing it with the
// new variable.
if (entry) {
auto existing = cast<llvm::GlobalValue>(entry);
auto castVar = getElementBitCast(var, defaultType);
existing->replaceAllUsesWith(castVar);
existing->eraseFromParent();
}
// If there's also an existing GOT-equivalent entry, rewrite it too, since
// LLVM won't recognize a global with bitcasts in its initializers as GOT-
// equivalent. rdar://problem/22388190
auto foundGOTEntry = GlobalGOTEquivalents.find(entity);
if (foundGOTEntry != GlobalGOTEquivalents.end() && foundGOTEntry->second) {
auto existingGOTEquiv = cast<llvm::GlobalVariable>(foundGOTEntry->second);
// Make a new GOT equivalent referring to the new variable with its
// definition type.
auto newGOTEquiv = createGOTEquivalent(*this, var, var->getName());
auto castGOTEquiv = llvm::ConstantExpr::getBitCast(newGOTEquiv,
existingGOTEquiv->getType());
existingGOTEquiv->replaceAllUsesWith(castGOTEquiv);
existingGOTEquiv->eraseFromParent();
GlobalGOTEquivalents[entity] = newGOTEquiv;
}
// Cache and return.
entry = var;
return var;
}
/// Get or create a "GOT equivalent" llvm::GlobalVariable, if applicable.
///
/// Creates a private, unnamed constant containing the address of another
/// global variable. LLVM can replace relative references to this variable with
/// relative references to the GOT entry for the variable in the object file.
ConstantReference
IRGenModule::getAddrOfLLVMVariableOrGOTEquivalent(LinkEntity entity,
Alignment alignment,
llvm::Type *defaultType) {
// Ensure the variable is at least forward-declared.
if (entity.isForeignTypeMetadataCandidate()) {
auto foreignCandidate
= getAddrOfForeignTypeMetadataCandidate(entity.getType());
(void)foreignCandidate;
} else {
getAddrOfLLVMVariable(entity, alignment, ConstantInit(),
defaultType, DebugTypeInfo());
}
// Guess whether a global entry is a definition from this TU. This isn't
// bulletproof, but at the point we emit conformance tables, we're far enough
// along that we should have emitted any metadata objects we were going to.
auto isDefinition = [&](llvm::Constant *global) -> bool {
// We only emit aliases for definitions. (An extern alias would be an
// extern global.)
if (isa<llvm::GlobalAlias>(global))
return true;
// Global vars are definitions if they have an initializer.
if (auto var = dyn_cast<llvm::GlobalVariable>(global))
return var->hasInitializer();
// Assume anything else isn't a definition.
return false;
};
// If the variable isn't public, or has already been defined in this TU,
// then it definitely doesn't need a GOT entry, and we can
// relative-reference it directly.
//
// TODO: Internal symbols from other TUs we know are destined to be linked
// into the same image as us could use direct
// relative references too, to avoid producing unnecessary GOT entries in
// the final image.
auto entry = GlobalVars[entity];
if (!entity.isAvailableExternally(*this) || isDefinition(entry)) {
// FIXME: Relative references to aliases break MC on 32-bit Mach-O
// platforms (rdar://problem/22450593 ), so substitute an alias with its
// aliasee to work around that.
if (auto alias = dyn_cast<llvm::GlobalAlias>(entry))
entry = alias->getAliasee();
return {entry, ConstantReference::Direct};
}
auto &gotEntry = GlobalGOTEquivalents[entity];
if (gotEntry) {
return {gotEntry, ConstantReference::Indirect};
}
// Look up the global variable.
auto global = cast<llvm::GlobalValue>(entry);
// Use it as the initializer for an anonymous constant. LLVM can treat this as
// equivalent to the global's GOT entry.
llvm::SmallString<64> name;
entity.mangle(name);
auto gotEquivalent = createGOTEquivalent(*this, global, name);
gotEntry = gotEquivalent;
return {gotEquivalent, ConstantReference::Indirect};
}
namespace {
struct TypeEntityInfo {
ProtocolConformanceFlags flags;
LinkEntity entity;
llvm::Type *defaultTy, *defaultPtrTy;
};
} // end anonymous namespace
static TypeEntityInfo
getTypeEntityInfo(IRGenModule &IGM, CanType conformingType) {
TypeMetadataRecordKind typeKind;
Optional<LinkEntity> entity;
llvm::Type *defaultTy, *defaultPtrTy;
auto nom = conformingType->getAnyNominal();
auto clas = dyn_cast<ClassDecl>(nom);
if (doesConformanceReferenceNominalTypeDescriptor(IGM, conformingType)) {
// Conformances for generics and concrete subclasses of generics
// are represented by referencing the nominal type descriptor.
typeKind = TypeMetadataRecordKind::UniqueNominalTypeDescriptor;
entity = LinkEntity::forNominalTypeDescriptor(nom);
defaultTy = IGM.NominalTypeDescriptorTy;
defaultPtrTy = IGM.NominalTypeDescriptorPtrTy;
} else if (clas) {
if (clas->isForeign()) {
typeKind = TypeMetadataRecordKind::NonuniqueDirectType;
entity = LinkEntity::forForeignTypeMetadataCandidate(conformingType);
defaultTy = IGM.TypeMetadataStructTy;
defaultPtrTy = IGM.TypeMetadataPtrTy;
} else {
// TODO: We should indirectly reference classes. For now directly
// reference the class object, which is totally wrong for ObjC interop.
typeKind = TypeMetadataRecordKind::UniqueDirectClass;
if (hasKnownSwiftMetadata(IGM, clas))
entity = LinkEntity::forTypeMetadata(
conformingType,
TypeMetadataAddress::AddressPoint,
/*isPattern*/ false);
else
entity = LinkEntity::forObjCClass(clas);
defaultTy = IGM.TypeMetadataStructTy;
defaultPtrTy = IGM.TypeMetadataPtrTy;
}
} else {
// Metadata for Clang types should be uniqued like foreign classes.
if (isa<ClangModuleUnit>(nom->getModuleScopeContext())) {
typeKind = TypeMetadataRecordKind::NonuniqueDirectType;
entity = LinkEntity::forForeignTypeMetadataCandidate(conformingType);
defaultTy = IGM.TypeMetadataStructTy;
defaultPtrTy = IGM.TypeMetadataPtrTy;
} else {
// We can reference the canonical metadata for native value types
// directly.
typeKind = TypeMetadataRecordKind::UniqueDirectType;
entity = LinkEntity::forTypeMetadata(
conformingType,
TypeMetadataAddress::AddressPoint,
/*isPattern*/ false);
defaultTy = IGM.TypeMetadataStructTy;
defaultPtrTy = IGM.TypeMetadataPtrTy;
}
}
auto flags = ProtocolConformanceFlags().withTypeKind(typeKind);
return {flags, *entity, defaultTy, defaultPtrTy};
}
/// Form an LLVM constant for the relative distance between a reference
/// (appearing at gep (0, indices) of `base`) and `target`.
llvm::Constant *
IRGenModule::emitRelativeReference(ConstantReference target,
llvm::Constant *base,
ArrayRef<unsigned> baseIndices) {
llvm::Constant *relativeAddr =
emitDirectRelativeReference(target.getValue(), base, baseIndices);
// If the reference is indirect, flag it by setting the low bit.
// (All of the base, direct target, and GOT entry need to be pointer-aligned
// for this to be OK.)
if (target.isIndirect()) {
relativeAddr = llvm::ConstantExpr::getAdd(relativeAddr,
llvm::ConstantInt::get(RelativeAddressTy, 1));
}
return relativeAddr;
}
/// Form an LLVM constant for the relative distance between a reference
/// (appearing at gep (0, indices...) of `base`) and `target`. For now,
/// for this to succeed portably, both need to be globals defined in the
/// current translation unit.
llvm::Constant *
IRGenModule::emitDirectRelativeReference(llvm::Constant *target,
llvm::Constant *base,
ArrayRef<unsigned> baseIndices) {
// Convert the target to an integer.
auto targetAddr = llvm::ConstantExpr::getPtrToInt(target, SizeTy);
SmallVector<llvm::Constant*, 4> indices;
indices.push_back(llvm::ConstantInt::get(Int32Ty, 0));
for (unsigned baseIndex : baseIndices) {
indices.push_back(llvm::ConstantInt::get(Int32Ty, baseIndex));
};
// Drill down to the appropriate address in the base, then convert
// that to an integer.
auto baseElt = llvm::ConstantExpr::getInBoundsGetElementPtr(
base->getType()->getPointerElementType(), base, indices);
auto baseAddr = llvm::ConstantExpr::getPtrToInt(baseElt, SizeTy);
// The relative address is the difference between those.
auto relativeAddr = llvm::ConstantExpr::getSub(targetAddr, baseAddr);
// Relative addresses can be 32-bit even on 64-bit platforms.
if (SizeTy != RelativeAddressTy)
relativeAddr = llvm::ConstantExpr::getTrunc(relativeAddr,
RelativeAddressTy);
return relativeAddr;
}
/// Emit the protocol conformance list and return it.
llvm::Constant *IRGenModule::emitProtocolConformances() {
// Do nothing if the list is empty.
if (ProtocolConformances.empty())
return nullptr;
// Define the global variable for the conformance list.
ConstantInitBuilder builder(*this);
auto recordsArray = builder.beginArray(ProtocolConformanceRecordTy);
for (auto *conformance : ProtocolConformances) {
auto record = recordsArray.beginStruct(ProtocolConformanceRecordTy);
emitAssociatedTypeMetadataRecord(conformance);
// Relative reference to the nominal type descriptor.
auto descriptorRef = getAddrOfLLVMVariableOrGOTEquivalent(
LinkEntity::forProtocolDescriptor(conformance->getProtocol()),
getPointerAlignment(), ProtocolDescriptorStructTy);
record.addRelativeAddress(descriptorRef);
// Relative reference to the type entity info.
auto typeEntity = getTypeEntityInfo(*this,
conformance->getType()->getCanonicalType());
auto typeRef = getAddrOfLLVMVariableOrGOTEquivalent(
typeEntity.entity, getPointerAlignment(), typeEntity.defaultTy);
record.addRelativeAddress(typeRef);
// Figure out what kind of witness table we have.
auto flags = typeEntity.flags;
llvm::Constant *witnessTableVar;
if (!isResilient(conformance->getProtocol(),
ResilienceExpansion::Maximal) &&
conformance->getConditionalRequirements().empty()) {
flags = flags.withConformanceKind(
ProtocolConformanceReferenceKind::WitnessTable);
// If the conformance is in this object's table, then the witness table
// should also be in this object file, so we can always directly reference
// it.
witnessTableVar = getAddrOfWitnessTable(conformance);
} else {
if (conformance->getConditionalRequirements().empty()) {
flags = flags.withConformanceKind(
ProtocolConformanceReferenceKind::WitnessTableAccessor);
} else {
flags = flags.withConformanceKind(
ProtocolConformanceReferenceKind::ConditionalWitnessTableAccessor);
}
witnessTableVar = getAddrOfWitnessTableAccessFunction(
conformance, ForDefinition);
}
// Relative reference to the witness table.
auto witnessTableRef =
ConstantReference(witnessTableVar, ConstantReference::Direct);
record.addRelativeAddress(witnessTableRef);
// Flags.
record.addInt(Int32Ty, flags.getValue());
record.finishAndAddTo(recordsArray);
}
// FIXME: This needs to be a linker-local symbol in order for Darwin ld to
// resolve relocations relative to it.
auto var = recordsArray.finishAndCreateGlobal("\x01l_protocol_conformances",
getPointerAlignment(),
/*isConstant*/ true,
llvm::GlobalValue::PrivateLinkage);
StringRef sectionName;
switch (TargetInfo.OutputObjectFormat) {
case llvm::Triple::MachO:
sectionName = "__TEXT, __swift2_proto, regular, no_dead_strip";
break;
case llvm::Triple::ELF:
sectionName = "swift2_protocol_conformances";
break;
case llvm::Triple::COFF:
sectionName = ".sw2prtc$B";
break;
default:
llvm_unreachable("Don't know how to emit protocol conformances for "
"the selected object format.");
}
var->setSection(sectionName);
addUsedGlobal(var);
return var;
}
/// Emit type metadata for types that might not have explicit protocol conformances.
llvm::Constant *IRGenModule::emitTypeMetadataRecords() {
std::string sectionName;
switch (TargetInfo.OutputObjectFormat) {
case llvm::Triple::MachO:
sectionName = "__TEXT, __swift2_types, regular, no_dead_strip";
break;
case llvm::Triple::ELF:
sectionName = "swift2_type_metadata";
break;
case llvm::Triple::COFF:
sectionName = ".sw2tymd$B";
break;
default:
llvm_unreachable("Don't know how to emit type metadata table for "
"the selected object format.");
}
// Do nothing if the list is empty.
if (RuntimeResolvableTypes.empty())
return nullptr;
// Define the global variable for the conformance list.
// We have to do this before defining the initializer since the entries will
// contain offsets relative to themselves.
auto arrayTy = llvm::ArrayType::get(TypeMetadataRecordTy,
RuntimeResolvableTypes.size());
// FIXME: This needs to be a linker-local symbol in order for Darwin ld to
// resolve relocations relative to it.
auto var = new llvm::GlobalVariable(Module, arrayTy,
/*isConstant*/ true,
llvm::GlobalValue::PrivateLinkage,
/*initializer*/ nullptr,
"\x01l_type_metadata_table");
SmallVector<llvm::Constant *, 8> elts;
for (auto type : RuntimeResolvableTypes) {
auto typeEntity = getTypeEntityInfo(*this, type);
auto typeRef = getAddrOfLLVMVariableOrGOTEquivalent(
typeEntity.entity, getPointerAlignment(), typeEntity.defaultTy);
unsigned arrayIdx = elts.size();
llvm::Constant *recordFields[] = {
emitRelativeReference(typeRef, var, { arrayIdx, 0 }),
llvm::ConstantInt::get(Int32Ty, typeEntity.flags.getValue()),
};
auto record = llvm::ConstantStruct::get(TypeMetadataRecordTy,
recordFields);
elts.push_back(record);
}
auto initializer = llvm::ConstantArray::get(arrayTy, elts);
var->setInitializer(initializer);
var->setSection(sectionName);
var->setAlignment(getPointerAlignment().getValue());
addUsedGlobal(var);
return var;
}
/// Fetch a global reference to a reference to the given Objective-C class.
/// The result is of type ObjCClassPtrTy->getPointerTo().
Address IRGenModule::getAddrOfObjCClassRef(ClassDecl *theClass) {
assert(ObjCInterop && "getting address of ObjC class ref in no-interop mode");
Alignment alignment = getPointerAlignment();
LinkEntity entity = LinkEntity::forObjCClassRef(theClass);
auto DbgTy = DebugTypeInfo::getObjCClass(
theClass, ObjCClassPtrTy, getPointerSize(), getPointerAlignment());
auto addr = getAddrOfLLVMVariable(entity, alignment, ConstantInit(),
ObjCClassPtrTy, DbgTy);
// Define it lazily.
if (auto global = dyn_cast<llvm::GlobalVariable>(addr)) {
if (global->isDeclaration()) {
global->setSection(GetObjCSectionName("__objc_classrefs",
"regular,no_dead_strip"));
global->setLinkage(llvm::GlobalVariable::PrivateLinkage);
global->setExternallyInitialized(true);
global->setInitializer(getAddrOfObjCClass(theClass, NotForDefinition));
addCompilerUsedGlobal(global);
}
}
return Address(addr, alignment);
}
/// Fetch a global reference to the given Objective-C class. The
/// result is of type ObjCClassPtrTy.
llvm::Constant *IRGenModule::getAddrOfObjCClass(ClassDecl *theClass,
ForDefinition_t forDefinition) {
assert(ObjCInterop && "getting address of ObjC class in no-interop mode");
assert(!theClass->isForeign());
LinkEntity entity = LinkEntity::forObjCClass(theClass);
auto DbgTy = DebugTypeInfo::getObjCClass(
theClass, ObjCClassPtrTy, getPointerSize(), getPointerAlignment());
auto addr = getAddrOfLLVMVariable(entity, getPointerAlignment(),
forDefinition, ObjCClassStructTy, DbgTy);
return addr;
}
/// Fetch the declaration of a metaclass object. The result is always a
/// GlobalValue of ObjCClassPtrTy, and is either the Objective-C metaclass or
/// the Swift metaclass stub, depending on whether the class is published as an
/// ObjC class.
llvm::Constant *
IRGenModule::getAddrOfMetaclassObject(ClassDecl *decl,
ForDefinition_t forDefinition) {
assert((!decl->isGenericContext() || decl->hasClangNode()) &&
"generic classes do not have a static metaclass object");
auto entity = decl->getMetaclassKind() == ClassDecl::MetaclassKind::ObjC
? LinkEntity::forObjCMetaclass(decl)
: LinkEntity::forSwiftMetaclassStub(decl);
auto DbgTy = DebugTypeInfo::getObjCClass(
decl, ObjCClassPtrTy, getPointerSize(), getPointerAlignment());
auto addr = getAddrOfLLVMVariable(entity, getPointerAlignment(),
forDefinition, ObjCClassStructTy, DbgTy);
return addr;
}
/// Fetch the type metadata access function for a non-generic type.
llvm::Function *
IRGenModule::getAddrOfTypeMetadataAccessFunction(CanType type,
ForDefinition_t forDefinition) {
assert(!type->hasArchetype() && !type->hasTypeParameter());
NominalTypeDecl *Nominal = type->getNominalOrBoundGenericNominal();
IRGen.addLazyTypeMetadata(Nominal);
LinkEntity entity = LinkEntity::forTypeMetadataAccessFunction(type);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto fnType = llvm::FunctionType::get(TypeMetadataPtrTy, false);
Signature signature(fnType, llvm::AttributeList(), DefaultCC);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Fetch the type metadata access function for the given generic type.
llvm::Function *
IRGenModule::getAddrOfGenericTypeMetadataAccessFunction(
NominalTypeDecl *nominal,
ArrayRef<llvm::Type *> genericArgs,
ForDefinition_t forDefinition) {
assert(nominal->isGenericContext());
assert(!genericArgs.empty() ||
nominal->getGenericSignature()->areAllParamsConcrete());
IRGen.addLazyTypeMetadata(nominal);
auto type = nominal->getDeclaredType()->getCanonicalType();
assert(type->hasUnboundGenericType());
LinkEntity entity = LinkEntity::forTypeMetadataAccessFunction(type);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto fnType = llvm::FunctionType::get(TypeMetadataPtrTy, genericArgs, false);
Signature signature(fnType, llvm::AttributeList(), DefaultCC);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Get or create a type metadata cache variable. These are an
/// implementation detail of type metadata access functions.
llvm::Constant *
IRGenModule::getAddrOfTypeMetadataLazyCacheVariable(CanType type,
ForDefinition_t forDefinition) {
assert(!type->hasArchetype() && !type->hasTypeParameter());
LinkEntity entity = LinkEntity::forTypeMetadataLazyCacheVariable(type);
return getAddrOfLLVMVariable(entity, getPointerAlignment(), forDefinition,
TypeMetadataPtrTy, DebugTypeInfo());
}
/// Define the metadata for a type.
///
/// Some type metadata has information before the address point that the
/// public symbol for the metadata references. This function will rewrite any
/// existing external declaration to the address point as an alias into the
/// full metadata object.
llvm::GlobalValue *IRGenModule::defineTypeMetadata(CanType concreteType,
bool isIndirect,
bool isPattern,
bool isConstant,
ConstantInitFuture init,
llvm::StringRef section) {
assert(init);
assert(!isIndirect && "indirect type metadata not used yet");
/// For concrete metadata, we want to use the initializer on the
/// "full metadata", and define the "direct" address point as an alias.
/// For generic metadata patterns, the address point is always at the
/// beginning of the template (for now...).
TypeMetadataAddress addrKind;
llvm::Type *defaultVarTy;
unsigned adjustmentIndex;
Alignment alignment = getPointerAlignment();
if (isPattern) {
addrKind = TypeMetadataAddress::AddressPoint;
defaultVarTy = TypeMetadataPatternStructTy;
adjustmentIndex = MetadataAdjustmentIndex::None;
} else if (concreteType->getClassOrBoundGenericClass()) {
addrKind = TypeMetadataAddress::FullMetadata;
defaultVarTy = FullHeapMetadataStructTy;
adjustmentIndex = MetadataAdjustmentIndex::Class;
} else {
addrKind = TypeMetadataAddress::FullMetadata;
defaultVarTy = FullTypeMetadataStructTy;
adjustmentIndex = MetadataAdjustmentIndex::ValueType;
}
auto entity = LinkEntity::forTypeMetadata(concreteType, addrKind, isPattern);
auto DbgTy = DebugTypeInfo::getMetadata(MetatypeType::get(concreteType),
defaultVarTy->getPointerTo(), Size(0),
Alignment(1));
// Define the variable.
llvm::GlobalVariable *var = cast<llvm::GlobalVariable>(
getAddrOfLLVMVariable(entity, alignment, init, defaultVarTy, DbgTy));
var->setConstant(isConstant);
if (!section.empty())
var->setSection(section);
// Keep type metadata around for all types, although the runtime can currently
// only perform name lookup of non-generic types.
addRuntimeResolvableType(concreteType);
// For metadata patterns, we're done.
if (isPattern)
return var;
// For concrete metadata, declare the alias to its address point.
auto directEntity = LinkEntity::forTypeMetadata(concreteType,
TypeMetadataAddress::AddressPoint,
/*isPattern*/ false);
llvm::Constant *addr = var;
// Do an adjustment if necessary.
if (adjustmentIndex) {
llvm::Constant *indices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, adjustmentIndex)
};
addr = llvm::ConstantExpr::getInBoundsGetElementPtr(/*Ty=*/nullptr,
addr, indices);
}
addr = llvm::ConstantExpr::getBitCast(addr, TypeMetadataPtrTy);
// Check for an existing forward declaration of the address point.
auto &directEntry = GlobalVars[directEntity];
llvm::GlobalValue *existingVal = nullptr;
if (directEntry) {
existingVal = cast<llvm::GlobalValue>(directEntry);
// Clear the existing value's name so we can steal it.
existingVal->setName("");
}
LinkInfo link = LinkInfo::get(*this, directEntity, ForDefinition);
auto *ptrTy = cast<llvm::PointerType>(addr->getType());
auto *alias = llvm::GlobalAlias::create(
ptrTy->getElementType(), ptrTy->getAddressSpace(), link.getLinkage(),
link.getName(), addr, &Module);
alias->setVisibility(link.getVisibility());
alias->setDLLStorageClass(link.getDLLStorage());
// The full metadata is used based on the visibility of the address point,
// not the metadata itself.
if (link.isUsed()) {
addUsedGlobal(var);
addUsedGlobal(alias);
}
// Replace an existing external declaration for the address point.
if (directEntry) {
auto existingVal = cast<llvm::GlobalValue>(directEntry);
// FIXME: MC breaks when emitting alias references on some platforms
// (rdar://problem/22450593 ). Work around this by referring to the aliasee
// instead.
llvm::Constant *aliasCast = alias->getAliasee();
aliasCast = llvm::ConstantExpr::getBitCast(aliasCast,
directEntry->getType());
existingVal->replaceAllUsesWith(aliasCast);
existingVal->eraseFromParent();
}
directEntry = alias;
return alias;
}
/// Fetch the declaration of the metadata (or metadata template) for a
/// type.
///
/// If the definition type is specified, the result will always be a
/// GlobalValue of the given type, which may not be at the
/// canonical address point for a type metadata.
///
/// If the definition type is not specified, then:
/// - if the metadata is indirect, then the result will not be adjusted
/// and it will have the type pointer-to-T, where T is the type
/// of a direct metadata;
/// - if the metadata is a pattern, then the result will not be
/// adjusted and it will have TypeMetadataPatternPtrTy;
/// - otherwise it will be adjusted to the canonical address point
/// for a type metadata and it will have type TypeMetadataPtrTy.
llvm::Constant *IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
bool isPattern) {
return getAddrOfTypeMetadata(concreteType, isPattern,
SymbolReferenceKind::Absolute).getDirectValue();
}
ConstantReference IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
bool isPattern,
SymbolReferenceKind refKind) {
assert(isPattern || !isa<UnboundGenericType>(concreteType));
llvm::Type *defaultVarTy;
unsigned adjustmentIndex;
Alignment alignment = getPointerAlignment();
ClassDecl *ObjCClass = nullptr;
// Patterns use the pattern type and no adjustment.
if (isPattern) {
defaultVarTy = TypeMetadataPatternStructTy;
adjustmentIndex = 0;
// Objective-C classes use the ObjC class object.
} else if (isa<ClassType>(concreteType) &&
!hasKnownSwiftMetadata(*this,
cast<ClassType>(concreteType)->getDecl())) {
defaultVarTy = TypeMetadataStructTy;
adjustmentIndex = 0;
ObjCClass = cast<ClassType>(concreteType)->getDecl();
// The symbol for other nominal type metadata is generated at the address
// point.
} else if (isa<ClassType>(concreteType) ||
isa<BoundGenericClassType>(concreteType)) {
assert(!concreteType->getClassOrBoundGenericClass()->isForeign()
&& "metadata for foreign classes should be emitted as "
"foreign candidate");
defaultVarTy = TypeMetadataStructTy;
adjustmentIndex = 0;
} else if (auto nom = concreteType->getAnyNominal()) {
assert(!isa<ClangModuleUnit>(nom->getModuleScopeContext())
&& "metadata for foreign type should be emitted as "
"foreign candidate");
(void)nom;
defaultVarTy = TypeMetadataStructTy;
adjustmentIndex = 0;
} else {
// FIXME: Non-nominal metadata provided by the C++ runtime is exported
// with the address of the start of the full metadata object, since
// Clang doesn't provide an easy way to emit symbols aliasing into the
// middle of an object.
defaultVarTy = FullTypeMetadataStructTy;
adjustmentIndex = MetadataAdjustmentIndex::ValueType;
}
// If this is a use, and the type metadata is emitted lazily,
// trigger lazy emission of the metadata.
if (NominalTypeDecl *Nominal = concreteType->getAnyNominal()) {
IRGen.addLazyTypeMetadata(Nominal);
}
LinkEntity entity
= ObjCClass ? LinkEntity::forObjCClass(ObjCClass)
: LinkEntity::forTypeMetadata(concreteType,
TypeMetadataAddress::AddressPoint,
isPattern);
auto DbgTy =
ObjCClass
? DebugTypeInfo::getObjCClass(ObjCClass, ObjCClassPtrTy,
getPointerSize(), getPointerAlignment())
: DebugTypeInfo::getMetadata(MetatypeType::get(concreteType),
defaultVarTy->getPointerTo(), Size(0),
Alignment(1));
auto addr = getAddrOfLLVMVariable(entity, alignment, ConstantInit(),
defaultVarTy, DbgTy, refKind);
// FIXME: MC breaks when emitting alias references on some platforms
// (rdar://problem/22450593 ). Work around this by referring to the aliasee
// instead.
if (auto alias = dyn_cast<llvm::GlobalAlias>(addr.getValue()))
addr = ConstantReference(alias->getAliasee(), addr.isIndirect());
// Adjust if necessary.
if (adjustmentIndex) {
llvm::Constant *indices[] = {
llvm::ConstantInt::get(Int32Ty, 0),
llvm::ConstantInt::get(Int32Ty, adjustmentIndex)
};
addr = ConstantReference(
llvm::ConstantExpr::getInBoundsGetElementPtr(
/*Ty=*/nullptr, addr.getValue(), indices),
addr.isIndirect());
}
return addr;
}
/// Returns the address of a class metadata base offset.
llvm::Constant *
IRGenModule::getAddrOfClassMetadataBaseOffset(ClassDecl *D,
ForDefinition_t forDefinition) {
LinkEntity entity = LinkEntity::forClassMetadataBaseOffset(D);
return getAddrOfLLVMVariable(entity, getPointerAlignment(), forDefinition,
SizeTy, DebugTypeInfo());
}
/// Return the address of a nominal type descriptor. Right now, this
/// must always be for purposes of defining it.
llvm::Constant *IRGenModule::getAddrOfNominalTypeDescriptor(NominalTypeDecl *D,
ConstantInitFuture definition) {
assert(definition && "not defining nominal type descriptor?");
auto entity = LinkEntity::forNominalTypeDescriptor(D);
return getAddrOfLLVMVariable(entity, getPointerAlignment(),
definition,
definition.getType(),
DebugTypeInfo());
}
llvm::Constant *IRGenModule::getAddrOfProtocolDescriptor(ProtocolDecl *D,
ConstantInit definition) {
if (D->isObjC()) {
assert(!definition &&
"cannot define an @objc protocol descriptor this way");
return getAddrOfObjCProtocolRecord(D, NotForDefinition);
}
auto entity = LinkEntity::forProtocolDescriptor(D);
return getAddrOfLLVMVariable(entity, getPointerAlignment(), definition,
ProtocolDescriptorStructTy, DebugTypeInfo());
}
/// Fetch the declaration of the ivar initializer for the given class.
Optional<llvm::Function*> IRGenModule::getAddrOfIVarInitDestroy(
ClassDecl *cd,
bool isDestroyer,
bool isForeign,
ForDefinition_t forDefinition) {
auto silRef = SILDeclRef(cd,
isDestroyer
? SILDeclRef::Kind::IVarDestroyer
: SILDeclRef::Kind::IVarInitializer)
.asForeign(isForeign);
// Find the SILFunction for the ivar initializer or destroyer.
if (auto silFn = getSILModule().lookUpFunction(silRef)) {
return getAddrOfSILFunction(silFn, forDefinition);
}
return None;
}
/// Returns the address of a value-witness function.
llvm::Function *IRGenModule::getAddrOfValueWitness(CanType abstractType,
ValueWitness index,
ForDefinition_t forDefinition) {
// We shouldn't emit value witness symbols for generic type instances.
assert(!isa<BoundGenericType>(abstractType) &&
"emitting value witness for generic type instance?!");
LinkEntity entity = LinkEntity::forValueWitness(abstractType, index);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto signature = getValueWitnessSignature(index);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Returns the address of a value-witness table. If a definition
/// type is provided, the table is created with that type; the return
/// value will be an llvm::GlobalValue. Otherwise, the result will
/// have type WitnessTablePtrTy.
llvm::Constant *
IRGenModule::getAddrOfValueWitnessTable(CanType concreteType,
ConstantInit definition) {
LinkEntity entity = LinkEntity::forValueWitnessTable(concreteType);
return getAddrOfLLVMVariable(entity, getPointerAlignment(), definition,
WitnessTableTy, DebugTypeInfo());
}
static Address getAddrOfSimpleVariable(IRGenModule &IGM,
llvm::DenseMap<LinkEntity, llvm::Constant*> &cache,
LinkEntity entity,
llvm::Type *type,
Alignment alignment,
ForDefinition_t forDefinition) {
// Check whether it's already cached.
llvm::Constant *&entry = cache[entity];
if (entry) {
auto existing = cast<llvm::GlobalValue>(entry);
assert(alignment == Alignment(existing->getAlignment()));
if (forDefinition) updateLinkageForDefinition(IGM, existing, entity);
return Address(entry, alignment);
}
// Otherwise, we need to create it.
LinkInfo link = LinkInfo::get(IGM, entity, forDefinition);
auto addr = createVariable(IGM, link, type, alignment);
addr->setConstant(true);
entry = addr;
return Address(addr, alignment);
}
/// getAddrOfFieldOffset - Get the address of the global variable
/// which contains an offset to apply to either an object (if direct)
/// or a metadata object in order to find an offset to apply to an
/// object (if indirect).
///
/// The result is always a GlobalValue.
Address IRGenModule::getAddrOfFieldOffset(VarDecl *var, bool isIndirect,
ForDefinition_t forDefinition) {
LinkEntity entity = LinkEntity::forFieldOffset(var, isIndirect);
return getAddrOfSimpleVariable(*this, GlobalVars, entity,
SizeTy, getPointerAlignment(),
forDefinition);
}
void IRGenModule::emitNestedTypeDecls(DeclRange members) {
for (Decl *member : members) {
switch (member->getKind()) {
case DeclKind::Import:
case DeclKind::TopLevelCode:
case DeclKind::Protocol:
case DeclKind::Extension:
case DeclKind::InfixOperator:
case DeclKind::PrefixOperator:
case DeclKind::PostfixOperator:
case DeclKind::Param:
case DeclKind::Module:
case DeclKind::PrecedenceGroup:
llvm_unreachable("decl not allowed in type context");
case DeclKind::IfConfig:
continue;
case DeclKind::PatternBinding:
case DeclKind::Var:
case DeclKind::Subscript:
case DeclKind::Func:
case DeclKind::Constructor:
case DeclKind::Destructor:
case DeclKind::EnumCase:
case DeclKind::EnumElement:
case DeclKind::MissingMember:
// Skip non-type members.
continue;
case DeclKind::AssociatedType:
case DeclKind::GenericTypeParam:
// Do nothing.
continue;
case DeclKind::TypeAlias:
// Do nothing.
continue;
case DeclKind::Enum:
emitEnumDecl(cast<EnumDecl>(member));
continue;
case DeclKind::Struct:
emitStructDecl(cast<StructDecl>(member));
continue;
case DeclKind::Class:
emitClassDecl(cast<ClassDecl>(member));
continue;
}
}
}
static bool shouldEmitCategory(IRGenModule &IGM, ExtensionDecl *ext) {
for (auto conformance : ext->getLocalConformances()) {
if (conformance->getProtocol()->isObjC())
return true;
}
for (auto member : ext->getMembers()) {
if (auto func = dyn_cast<FuncDecl>(member)) {
if (requiresObjCMethodDescriptor(func))
return true;
} else if (auto constructor = dyn_cast<ConstructorDecl>(member)) {
if (requiresObjCMethodDescriptor(constructor))
return true;
} else if (auto var = dyn_cast<VarDecl>(member)) {
if (requiresObjCPropertyDescriptor(IGM, var))
return true;
} else if (auto subscript = dyn_cast<SubscriptDecl>(member)) {
if (requiresObjCSubscriptDescriptor(IGM, subscript))
return true;
}
}
return false;
}
void IRGenModule::emitExtension(ExtensionDecl *ext) {
emitNestedTypeDecls(ext->getMembers());
// Generate a category if the extension either introduces a
// conformance to an ObjC protocol or introduces a method
// that requires an Objective-C entry point.
ClassDecl *origClass = ext->getExtendedType()->getClassOrBoundGenericClass();
if (!origClass)
return;
if (shouldEmitCategory(*this, ext)) {
assert(origClass && !origClass->isForeign() &&
"foreign types cannot have categories emitted");
llvm::Constant *category = emitCategoryData(*this, ext);
category = llvm::ConstantExpr::getBitCast(category, Int8PtrTy);
ObjCCategories.push_back(category);
ObjCCategoryDecls.push_back(ext);
}
}
/// Create an allocation on the stack.
Address IRGenFunction::createAlloca(llvm::Type *type,
Alignment alignment,
const llvm::Twine &name) {
llvm::AllocaInst *alloca =
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), name,
AllocaIP);
alloca->setAlignment(alignment.getValue());
return Address(alloca, alignment);
}
/// Create an allocation of an array on the stack.
Address IRGenFunction::createAlloca(llvm::Type *type,
llvm::Value *ArraySize,
Alignment alignment,
const llvm::Twine &name) {
llvm::AllocaInst *alloca =
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), ArraySize,
alignment.getValue(), name, AllocaIP);
return Address(alloca, alignment);
}
/// Allocate a fixed-size buffer on the stack.
Address IRGenFunction::createFixedSizeBufferAlloca(const llvm::Twine &name) {
return createAlloca(IGM.getFixedBufferTy(),
getFixedBufferAlignment(IGM),
name);
}
/// Get or create a global string constant.
///
/// \returns an i8* with a null terminator; note that embedded nulls
/// are okay
///
/// FIXME: willBeRelativelyAddressed is only needed to work around an ld64 bug
/// resolving relative references to coalesceable symbols.
/// It should be removed when fixed. rdar://problem/22674524
llvm::Constant *IRGenModule::getAddrOfGlobalString(StringRef data,
bool willBeRelativelyAddressed) {
// Check whether this string already exists.
auto &entry = GlobalStrings[data];
if (entry.second) {
// FIXME: Clear unnamed_addr if the global will be relative referenced
// to work around an ld64 bug. rdar://problem/22674524
if (willBeRelativelyAddressed)
entry.first->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::None);
return entry.second;
}
entry = createStringConstant(data, willBeRelativelyAddressed);
return entry.second;
}
/// Get or create a global UTF-16 string constant.
///
/// \returns an i16* with a null terminator; note that embedded nulls
/// are okay
llvm::Constant *IRGenModule::getAddrOfGlobalUTF16String(StringRef utf8) {
// Check whether this string already exists.
auto &entry = GlobalUTF16Strings[utf8];
if (entry) return entry;
// If not, first transcode it to UTF16.
SmallVector<llvm::UTF16, 128> buffer(utf8.size() + 1); // +1 for ending nulls.
const llvm::UTF8 *fromPtr = (const llvm::UTF8 *) utf8.data();
llvm::UTF16 *toPtr = &buffer[0];
(void) ConvertUTF8toUTF16(&fromPtr, fromPtr + utf8.size(),
&toPtr, toPtr + utf8.size(),
llvm::strictConversion);
// The length of the transcoded string in UTF-8 code points.
size_t utf16Length = toPtr - &buffer[0];
// Null-terminate the UTF-16 string.
*toPtr = 0;
ArrayRef<llvm::UTF16> utf16(&buffer[0], utf16Length + 1);
auto init = llvm::ConstantDataArray::get(LLVMContext, utf16);
auto global = new llvm::GlobalVariable(Module, init->getType(), true,
llvm::GlobalValue::PrivateLinkage,
init);
global->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
// Drill down to make an i16*.
auto zero = llvm::ConstantInt::get(SizeTy, 0);
llvm::Constant *indices[] = { zero, zero };
auto address = llvm::ConstantExpr::getInBoundsGetElementPtr(
global->getValueType(), global, indices);
// Cache and return.
entry = address;
return address;
}
static llvm::Constant *getMetatypeDeclarationFor(IRGenModule &IGM,
StringRef name) {
auto *storageType = IGM.ObjCClassStructTy;
// We may have defined the variable already.
if (auto existing = IGM.Module.getNamedGlobal(name))
return getElementBitCast(existing, storageType);
auto linkage = llvm::GlobalValue::ExternalLinkage;
auto visibility = llvm::GlobalValue::DefaultVisibility;
auto storageClass = llvm::GlobalValue::DefaultStorageClass;
auto var = new llvm::GlobalVariable(IGM.Module, storageType,
/*constant*/ false, linkage,
/*initializer*/ nullptr, name);
var->setVisibility(visibility);
var->setDLLStorageClass(storageClass);
var->setAlignment(IGM.getPointerAlignment().getValue());
return var;
}
#define STRINGIFY_IMPL(x) #x
#define REALLY_STRINGIFY( x) STRINGIFY_IMPL(x)
llvm::Constant *
IRGenModule::getAddrOfGlobalConstantString(StringRef utf8) {
auto &entry = GlobalConstantStrings[utf8];
if (entry)
return entry;
// If not, create it. This implicitly adds a trailing null.
auto data = llvm::ConstantDataArray::getString(LLVMContext, utf8);
auto *dataTy = data->getType();
llvm::Type *constantStringTy[] = {
RefCountedStructTy,
Int32Ty,
Int32Ty,
Int8Ty,
dataTy
};
auto *ConstantStringTy =
llvm::StructType::get(getLLVMContext(), constantStringTy,
/*packed*/ false);
auto metaclass = getMetatypeDeclarationFor(
*this, REALLY_STRINGIFY(CLASS_METADATA_SYM(s20_Latin1StringStorage)));
metaclass = llvm::ConstantExpr::getBitCast(metaclass, TypeMetadataPtrTy);
// Get a reference count of two.
auto *refCountInit = llvm::ConstantInt::get(
IntPtrTy,
InlineRefCountBits(1 /* "extra" strong ref count*/, 1 /* unowned count */)
.getBitsValue());
auto *count = llvm::ConstantInt::get(Int32Ty, utf8.size());
// Capacity is length plus one because of the implicitly added '\0'
// character.
auto *capacity = llvm::ConstantInt::get(Int32Ty, utf8.size() + 1);
auto *flags = llvm::ConstantInt::get(Int8Ty, 0);
llvm::Constant *heapObjectHeaderFields[] = {
metaclass, refCountInit
};
auto *initRefCountStruct = llvm::ConstantStruct::get(
RefCountedStructTy, makeArrayRef(heapObjectHeaderFields));
llvm::Constant *fields[] = {
initRefCountStruct, count, capacity, flags, data};
auto *init =
llvm::ConstantStruct::get(ConstantStringTy, makeArrayRef(fields));
auto global = new llvm::GlobalVariable(Module, init->getType(), true,
llvm::GlobalValue::PrivateLinkage,
init);
global->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
// Cache string entry.
entry = global;
return global;
}
llvm::Constant *
IRGenModule::getAddrOfGlobalUTF16ConstantString(StringRef utf8) {
auto &entry = GlobalConstantUTF16Strings[utf8];
if (entry)
return entry;
// If not, first transcode it to UTF16.
SmallVector<llvm::UTF16, 128> buffer(utf8.size() + 1); // +1 for ending nulls.
const llvm::UTF8 *fromPtr = (const llvm::UTF8 *) utf8.data();
llvm::UTF16 *toPtr = &buffer[0];
(void) ConvertUTF8toUTF16(&fromPtr, fromPtr + utf8.size(),
&toPtr, toPtr + utf8.size(),
llvm::strictConversion);
// The length of the transcoded string in UTF-8 code points.
size_t utf16Length = toPtr - &buffer[0];
// Null-terminate the UTF-16 string.
*toPtr = 0;
ArrayRef<llvm::UTF16> utf16(&buffer[0], utf16Length + 1);
auto *data = llvm::ConstantDataArray::get(LLVMContext, utf16);
auto *dataTy = data->getType();
llvm::Type *constantUTFStringTy[] = {
RefCountedStructTy,
Int32Ty,
Int32Ty,
Int8Ty,
Int8Ty, // For 16-byte alignment.
dataTy
};
auto *ConstantUTFStringTy =
llvm::StructType::get(getLLVMContext(), constantUTFStringTy,
/*packed*/ false);
auto metaclass = getMetatypeDeclarationFor(
*this, REALLY_STRINGIFY(CLASS_METADATA_SYM(s19_UTF16StringStorage)));
metaclass = llvm::ConstantExpr::getBitCast(metaclass, TypeMetadataPtrTy);
// Get a reference count of two.
auto *refCountInit = llvm::ConstantInt::get(
IntPtrTy,
InlineRefCountBits(1 /* "extra" strong ref count*/, 1 /* unowned count */)
.getBitsValue());
auto *count = llvm::ConstantInt::get(Int32Ty, utf16Length);
auto *capacity = llvm::ConstantInt::get(Int32Ty, utf16Length + 1);
auto *flags = llvm::ConstantInt::get(Int8Ty, 0);
auto *padding = llvm::ConstantInt::get(Int8Ty, 0);
llvm::Constant *heapObjectHeaderFields[] = {
metaclass, refCountInit
};
auto *initRefCountStruct = llvm::ConstantStruct::get(
RefCountedStructTy, makeArrayRef(heapObjectHeaderFields));
llvm::Constant *fields[] = {
initRefCountStruct, count, capacity, flags, padding, data};
auto *init =
llvm::ConstantStruct::get(ConstantUTFStringTy, makeArrayRef(fields));
auto global = new llvm::GlobalVariable(Module, init->getType(), true,
llvm::GlobalValue::PrivateLinkage,
init);
global->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global);
// Cache string entry.
entry = global;
return global;
}
/// Do we have to use resilient access patterns when working with this
/// declaration?
///
/// IRGen is primarily concerned with resilient handling of the following:
/// - For structs, a struct's size might change
/// - For enums, new cases can be added
/// - For classes, the superclass might change the size or number
/// of stored properties
bool IRGenModule::isResilient(NominalTypeDecl *D, ResilienceExpansion expansion) {
return !D->hasFixedLayout(getSwiftModule(), expansion);
}
// The most general resilience expansion where the given declaration is visible.
ResilienceExpansion
IRGenModule::getResilienceExpansionForAccess(NominalTypeDecl *decl) {
if (decl->getModuleContext() == getSwiftModule() &&
decl->getEffectiveAccess() < AccessLevel::Public)
return ResilienceExpansion::Maximal;
return ResilienceExpansion::Minimal;
}
// The most general resilience expansion which has knowledge of the declaration's
// layout. Calling isResilient() with this scope will always return false.
ResilienceExpansion
IRGenModule::getResilienceExpansionForLayout(NominalTypeDecl *decl) {
if (isResilient(decl, ResilienceExpansion::Minimal))
return ResilienceExpansion::Maximal;
return getResilienceExpansionForAccess(decl);
}
// The most general resilience expansion which has knowledge of the global
// variable's layout.
ResilienceExpansion
IRGenModule::getResilienceExpansionForLayout(SILGlobalVariable *global) {
if (hasPublicVisibility(global->getLinkage()))
return ResilienceExpansion::Minimal;
return ResilienceExpansion::Maximal;
}
llvm::Constant *IRGenModule::
getAddrOfGenericWitnessTableCache(const NormalProtocolConformance *conf,
ForDefinition_t forDefinition) {
auto entity = LinkEntity::forGenericProtocolWitnessTableCache(conf);
auto expectedTy = getGenericWitnessTableCacheTy();
return getAddrOfLLVMVariable(entity, getPointerAlignment(), forDefinition,
expectedTy, DebugTypeInfo());
}
llvm::Function *
IRGenModule::getAddrOfGenericWitnessTableInstantiationFunction(
const NormalProtocolConformance *conf) {
auto forDefinition = ForDefinition;
LinkEntity entity =
LinkEntity::forGenericProtocolWitnessTableInstantiationFunction(conf);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto fnType = llvm::FunctionType::get(
VoidTy, {WitnessTablePtrTy, TypeMetadataPtrTy, Int8PtrPtrTy},
/*varargs*/ false);
Signature signature(fnType, llvm::AttributeList(), DefaultCC);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
llvm::StructType *IRGenModule::getGenericWitnessTableCacheTy() {
if (auto ty = GenericWitnessTableCacheTy) return ty;
GenericWitnessTableCacheTy = llvm::StructType::create(getLLVMContext(),
{
// WitnessTableSizeInWords
Int16Ty,
// WitnessTablePrivateSizeInWords
Int16Ty,
// Protocol
RelativeAddressTy,
// Pattern
RelativeAddressTy,
// Instantiator
RelativeAddressTy,
// PrivateData
RelativeAddressTy
}, "swift.generic_witness_table_cache");
return GenericWitnessTableCacheTy;
}
/// Fetch the witness table access function for a protocol conformance.
llvm::Function *
IRGenModule::getAddrOfWitnessTableAccessFunction(
const NormalProtocolConformance *conf,
ForDefinition_t forDefinition) {
IRGen.addLazyWitnessTable(conf);
LinkEntity entity = LinkEntity::forProtocolWitnessTableAccessFunction(conf);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
llvm::FunctionType *fnType;
if (conf->witnessTableAccessorRequiresArguments()) {
// conditional requirements are passed indirectly, as an array of witness
// tables.
fnType = llvm::FunctionType::get(
WitnessTablePtrTy, {TypeMetadataPtrTy, WitnessTablePtrPtrTy, SizeTy},
false);
} else {
fnType = llvm::FunctionType::get(WitnessTablePtrTy, false);
}
Signature signature(fnType, llvm::AttributeList(), DefaultCC);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Fetch the lazy witness table access function for a protocol conformance.
llvm::Function *
IRGenModule::getAddrOfWitnessTableLazyAccessFunction(
const NormalProtocolConformance *conf,
CanType conformingType,
ForDefinition_t forDefinition) {
LinkEntity entity =
LinkEntity::forProtocolWitnessTableLazyAccessFunction(conf, conformingType);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
llvm::FunctionType *fnType
= llvm::FunctionType::get(WitnessTablePtrTy, false);
Signature signature(fnType, llvm::AttributeList(), DefaultCC);
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Get or create a witness table cache variable. These are an
/// implementation detail of witness table lazy access functions.
llvm::Constant *
IRGenModule::getAddrOfWitnessTableLazyCacheVariable(
const NormalProtocolConformance *conf,
CanType conformingType,
ForDefinition_t forDefinition) {
assert(!conformingType->hasArchetype());
LinkEntity entity =
LinkEntity::forProtocolWitnessTableLazyCacheVariable(conf, conformingType);
return getAddrOfLLVMVariable(entity, getPointerAlignment(),
forDefinition, WitnessTablePtrTy,
DebugTypeInfo());
}
/// Look up the address of a witness table.
///
/// TODO: This needs to take a flag for the access mode of the witness table,
/// which may be direct, lazy, or a runtime instantiation template.
/// TODO: Use name from witness table here to lookup witness table instead of
/// recomputing it.
llvm::Constant*
IRGenModule::getAddrOfWitnessTable(const NormalProtocolConformance *conf,
ConstantInit definition) {
IRGen.addLazyWitnessTable(conf);
auto entity = LinkEntity::forDirectProtocolWitnessTable(conf);
return getAddrOfLLVMVariable(entity, getPointerAlignment(), definition,
WitnessTableTy, DebugTypeInfo());
}
llvm::Function *
IRGenModule::getAddrOfAssociatedTypeMetadataAccessFunction(
const NormalProtocolConformance *conformance,
AssociatedType association) {
auto forDefinition = ForDefinition;
LinkEntity entity =
LinkEntity::forAssociatedTypeMetadataAccessFunction(conformance,
association);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto signature = getAssociatedTypeMetadataAccessFunctionSignature();
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
llvm::Function *
IRGenModule::getAddrOfAssociatedTypeWitnessTableAccessFunction(
const NormalProtocolConformance *conformance,
const AssociatedConformance &association) {
auto forDefinition = ForDefinition;
LinkEntity entity =
LinkEntity::forAssociatedTypeWitnessTableAccessFunction(conformance,
association);
llvm::Function *&entry = GlobalFuncs[entity];
if (entry) {
if (forDefinition) updateLinkageForDefinition(*this, entry, entity);
return entry;
}
auto signature = getAssociatedTypeWitnessTableAccessFunctionSignature();
LinkInfo link = LinkInfo::get(*this, entity, forDefinition);
entry = createFunction(*this, link, signature);
return entry;
}
/// Should we be defining the given helper function?
static llvm::Function *shouldDefineHelper(IRGenModule &IGM,
llvm::Constant *fn,
bool setIsNoInline) {
auto *def = dyn_cast<llvm::Function>(fn);
if (!def) return nullptr;
if (!def->empty()) return nullptr;
def->setLinkage(llvm::Function::LinkOnceODRLinkage);
def->setVisibility(llvm::Function::HiddenVisibility);
def->setDLLStorageClass(llvm::GlobalVariable::DefaultStorageClass);
def->setDoesNotThrow();
def->setCallingConv(IGM.DefaultCC);
if (setIsNoInline)
def->addFnAttr(llvm::Attribute::NoInline);
return def;
}
/// Get or create a helper function with the given name and type, lazily
/// using the given generation function to fill in its body.
///
/// The helper function will be shared between translation units within the
/// current linkage unit, so choose the name carefully to ensure that it
/// does not collide with any other helper function. In general, it should
/// be a Swift-specific C reserved name; that is, it should start with
// "__swift".
llvm::Constant *
IRGenModule::getOrCreateHelperFunction(StringRef fnName, llvm::Type *resultTy,
ArrayRef<llvm::Type*> paramTys,
llvm::function_ref<void(IRGenFunction &IGF)> generate,
bool setIsNoInline) {
llvm::FunctionType *fnTy =
llvm::FunctionType::get(resultTy, paramTys, false);
llvm::Constant *fn = Module.getOrInsertFunction(fnName, fnTy);
if (llvm::Function *def = shouldDefineHelper(*this, fn, setIsNoInline)) {
IRGenFunction IGF(*this, def);
if (DebugInfo)
DebugInfo->emitArtificialFunction(IGF, def);
generate(IGF);
}
return fn;
}
llvm::Constant *IRGenModule::getOrCreateRetainFunction(const TypeInfo &objectTI,
Type t,
llvm::Type *llvmType) {
auto *loadableTI = dyn_cast<LoadableTypeInfo>(&objectTI);
assert(loadableTI && "Should only be called on Loadable types");
IRGenMangler mangler;
std::string funcName = mangler.mangleOutlinedRetainFunction(t);
llvm::Type *argTys[] = {llvmType};
return getOrCreateHelperFunction(
funcName, llvmType, argTys,
[&](IRGenFunction &IGF) {
auto it = IGF.CurFn->arg_begin();
Address addr(&*it++, loadableTI->getFixedAlignment());
Explosion loaded;
loadableTI->loadAsTake(IGF, addr, loaded);
Explosion out;
loadableTI->copy(IGF, loaded, out, irgen::Atomicity::Atomic);
(void)out.claimAll();
IGF.Builder.CreateRet(addr.getAddress());
},
true /*setIsNoInline*/);
}
llvm::Constant *
IRGenModule::getOrCreateReleaseFunction(const TypeInfo &objectTI, Type t,
llvm::Type *llvmType) {
auto *loadableTI = dyn_cast<LoadableTypeInfo>(&objectTI);
assert(loadableTI && "Should only be called on Loadable types");
IRGenMangler mangler;
std::string funcName = mangler.mangleOutlinedReleaseFunction(t);
llvm::Type *argTys[] = {llvmType};
return getOrCreateHelperFunction(
funcName, llvmType, argTys,
[&](IRGenFunction &IGF) {
auto it = IGF.CurFn->arg_begin();
Address addr(&*it++, loadableTI->getFixedAlignment());
Explosion loaded;
loadableTI->loadAsTake(IGF, addr, loaded);
loadableTI->consume(IGF, loaded, irgen::Atomicity::Atomic);
IGF.Builder.CreateRet(addr.getAddress());
},
true /*setIsNoInline*/);
}
void IRGenModule::generateCallToOutlinedCopyAddr(
IRGenFunction &IGF, const TypeInfo &objectTI, Address dest, Address src,
SILType T, const OutlinedCopyAddrFunction MethodToCall,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
llvm::SmallVector<llvm::Value *, 4> argsVec;
argsVec.push_back(src.getAddress());
argsVec.push_back(dest.getAddress());
if (typeToMetadataVec) {
for (auto &typeDataPair : *typeToMetadataVec) {
auto *metadata = typeDataPair.second;
assert(metadata && metadata->getType() == IGF.IGM.TypeMetadataPtrTy &&
"Expeceted TypeMetadataPtrTy");
argsVec.push_back(metadata);
}
}
llvm::Type *llvmType = dest->getType();
auto *outlinedF =
(this->*MethodToCall)(objectTI, llvmType, T, typeToMetadataVec);
llvm::Function *fn = dyn_cast<llvm::Function>(outlinedF);
assert(fn && "Expected llvm::Function");
fn->setLinkage(llvm::GlobalValue::InternalLinkage);
llvm::CallInst *call = IGF.Builder.CreateCall(outlinedF, argsVec);
call->setCallingConv(DefaultCC);
}
void IRGenModule::generateCallToOutlinedDestroy(
IRGenFunction &IGF, const TypeInfo &objectTI, Address addr, SILType T,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
IRGenMangler mangler;
CanType canType = T.getSwiftRValueType();
std::string funcName = mangler.mangleOutlinedDestroyFunction(canType, this);
llvm::SmallVector<llvm::Type *, 4> argsTysVec;
llvm::SmallVector<llvm::Value *, 4> argsVec;
llvm::Type *llvmType = addr.getType();
argsTysVec.push_back(llvmType);
argsVec.push_back(addr.getAddress());
if (typeToMetadataVec) {
for (auto &typeDataPair : *typeToMetadataVec) {
auto *metadata = typeDataPair.second;
assert(metadata && metadata->getType() == IGF.IGM.TypeMetadataPtrTy &&
"Expeceted TypeMetadataPtrTy");
argsTysVec.push_back(metadata->getType());
argsVec.push_back(metadata);
}
}
auto *outlinedF = getOrCreateHelperFunction(
funcName, llvmType, argsTysVec,
[&](IRGenFunction &IGF) {
auto it = IGF.CurFn->arg_begin();
Address addr(&*it++, objectTI.getBestKnownAlignment());
if (typeToMetadataVec) {
for (auto &typeDataPair : *typeToMetadataVec) {
llvm::Value *arg = &*it++;
CanType abstractType = typeDataPair.first;
getArgAsLocalSelfTypeMetadata(IGF, arg, abstractType);
}
}
objectTI.destroy(IGF, addr, T, true);
IGF.Builder.CreateRet(addr.getAddress());
},
true /*setIsNoInline*/);
if (T.hasArchetype()) {
llvm::Function *fn = dyn_cast<llvm::Function>(outlinedF);
assert(fn && "Expected llvm::Function");
fn->setLinkage(llvm::GlobalValue::InternalLinkage);
}
llvm::CallInst *call = IGF.Builder.CreateCall(outlinedF, argsVec);
call->setCallingConv(DefaultCC);
}
llvm::Constant *IRGenModule::getOrCreateOutlinedCopyAddrHelperFunction(
const TypeInfo &objectTI, llvm::Type *llvmType, SILType addrTy,
std::string funcName,
llvm::function_ref<void(const TypeInfo &objectTI, IRGenFunction &IGF,
Address dest, Address src, SILType T)>
Generate,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
llvm::SmallVector<llvm::Type *, 4> argsTysVec;
argsTysVec.push_back(llvmType);
argsTysVec.push_back(llvmType);
if (typeToMetadataVec) {
for (auto &typeDataPair : *typeToMetadataVec) {
auto *metadata = typeDataPair.second;
argsTysVec.push_back(metadata->getType());
}
}
return getOrCreateHelperFunction(
funcName, llvmType, argsTysVec,
[&](IRGenFunction &IGF) {
auto it = IGF.CurFn->arg_begin();
Address src(&*it++, objectTI.getBestKnownAlignment());
Address dest(&*it++, objectTI.getBestKnownAlignment());
if (typeToMetadataVec) {
for (auto &typeDataPair : *typeToMetadataVec) {
llvm::Value *arg = &*it++;
CanType abstractType = typeDataPair.first;
getArgAsLocalSelfTypeMetadata(IGF, arg, abstractType);
}
}
Generate(objectTI, IGF, dest, src, addrTy);
IGF.Builder.CreateRet(dest.getAddress());
},
true /*setIsNoInline*/);
}
llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithTakeFunction(
const TypeInfo &objectTI, llvm::Type *llvmType, SILType addrTy,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
IRGenMangler mangler;
CanType canType = addrTy.getSwiftRValueType();
std::string funcName =
mangler.mangleOutlinedInitializeWithTakeFunction(canType, this);
auto GenFunc = [](const TypeInfo &objectTI, IRGenFunction &IGF, Address dest,
Address src, SILType T) {
objectTI.initializeWithTake(IGF, dest, src, T, true);
};
return getOrCreateOutlinedCopyAddrHelperFunction(
objectTI, llvmType, addrTy, funcName, GenFunc, typeToMetadataVec);
}
llvm::Constant *IRGenModule::getOrCreateOutlinedInitializeWithCopyFunction(
const TypeInfo &objectTI, llvm::Type *llvmType, SILType addrTy,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
IRGenMangler mangler;
CanType canType = addrTy.getObjectType().getSwiftRValueType();
std::string funcName =
mangler.mangleOutlinedInitializeWithCopyFunction(canType, this);
auto GenFunc = [](const TypeInfo &objectTI, IRGenFunction &IGF, Address dest,
Address src, SILType T) {
objectTI.initializeWithCopy(IGF, dest, src, T, true);
};
return getOrCreateOutlinedCopyAddrHelperFunction(
objectTI, llvmType, addrTy, funcName, GenFunc, typeToMetadataVec);
}
llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithTakeFunction(
const TypeInfo &objectTI, llvm::Type *llvmType, SILType addrTy,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
IRGenMangler mangler;
CanType canType = addrTy.getObjectType().getSwiftRValueType();
std::string funcName =
mangler.mangleOutlinedAssignWithTakeFunction(canType, this);
auto GenFunc = [](const TypeInfo &objectTI, IRGenFunction &IGF, Address dest,
Address src, SILType T) {
objectTI.assignWithTake(IGF, dest, src, T, true);
};
return getOrCreateOutlinedCopyAddrHelperFunction(
objectTI, llvmType, addrTy, funcName, GenFunc, typeToMetadataVec);
}
llvm::Constant *IRGenModule::getOrCreateOutlinedAssignWithCopyFunction(
const TypeInfo &objectTI, llvm::Type *llvmType, SILType addrTy,
const llvm::MapVector<CanType, llvm::Value *> *typeToMetadataVec) {
IRGenMangler mangler;
CanType canType = addrTy.getObjectType().getSwiftRValueType();
std::string funcName =
mangler.mangleOutlinedAssignWithCopyFunction(canType, this);
auto GenFunc = [](const TypeInfo &objectTI, IRGenFunction &IGF, Address dest,
Address src, SILType T) {
objectTI.assignWithCopy(IGF, dest, src, T, true);
};
return getOrCreateOutlinedCopyAddrHelperFunction(
objectTI, llvmType, addrTy, funcName, GenFunc, typeToMetadataVec);
}
// IRGen is only multi-threaded during LLVM part
// We don't need to be thread safe even
// We are working on the primary module *before* LLVM
unsigned IRGenModule::getCanTypeID(const CanType type) {
if (this != IRGen.getPrimaryIGM()) {
return IRGen.getPrimaryIGM()->getCanTypeID(type);
}
auto it = typeToUniqueID.find(type.getPointer());
if (it != typeToUniqueID.end()) {
return it->second;
}
++currUniqueID;
typeToUniqueID[type.getPointer()] = currUniqueID;
return currUniqueID;
}
| {
"content_hash": "90aa9eeb4ce32504b35d96defe62e61b",
"timestamp": "",
"source": "github",
"line_count": 3794,
"max_line_length": 84,
"avg_line_length": 38.27780706378493,
"alnum_prop": 0.6629873438640463,
"repo_name": "frootloops/swift",
"id": "2fce470cd943da1ee147dece59f7fc7799e3851e",
"size": "145226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/IRGen/GenDecl.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "34"
},
{
"name": "C",
"bytes": "71563"
},
{
"name": "C++",
"bytes": "26067180"
},
{
"name": "CMake",
"bytes": "386418"
},
{
"name": "D",
"bytes": "1107"
},
{
"name": "DTrace",
"bytes": "2438"
},
{
"name": "Emacs Lisp",
"bytes": "57055"
},
{
"name": "LLVM",
"bytes": "62046"
},
{
"name": "Makefile",
"bytes": "1841"
},
{
"name": "Objective-C",
"bytes": "333187"
},
{
"name": "Objective-C++",
"bytes": "200829"
},
{
"name": "Perl",
"bytes": "2211"
},
{
"name": "Python",
"bytes": "1018108"
},
{
"name": "Ruby",
"bytes": "2091"
},
{
"name": "Shell",
"bytes": "198717"
},
{
"name": "Swift",
"bytes": "21669370"
},
{
"name": "Vim script",
"bytes": "15610"
}
],
"symlink_target": ""
} |
<?php
include('../form/connection.php');
include ('../function/functions.php');
class GeoJsonDbSyncer {
protected $brgyData;
protected $db;
public function __construct() {
$this->db = new db();
$file = file_get_contents('../../system/geojson-coords.json');
$jsonData = json_decode($file, true);
$this->brgyData = $this->extractBrgyData($jsonData);
}
protected function extractBrgyData($data) {
$result = [];
foreach($data['features'] as $brgy) {
$name = $brgy['properties']['NAME_3'];
$coords = [];
foreach($brgy['geometry']['coordinates'][0] as $dcoords) {
$lat = $dcoords[1];
$lng = $dcoords[0];
array_push($coords, ["lat" => $lat, "lng" => $lng]);
}
array_push($result, [
"name" => $name,
"coords" => $coords
]);
}
return $result;
}
protected function insertBarangay($name) {
$brgyQuery = "INSERT INTO barangay (NAME, DISTRICT, isCoastal)
VALUES ('{$name}', 3, 0);";
return $this->db->connection->query($brgyQuery);
}
protected function insertCoordinates($id, $lat, $lng) {
$coordQuery = "INSERT INTO barangay_coordinates (BARANGAY, LAT, LNG)
VALUES ({$id}, {$lat}, {$lng});";
return $this->db->connection->query($coordQuery);
}
protected function insertInfo($id) {
$infoQuery = "INSERT INTO barangay_info (BARANGAY, MEN, WOMEN,
MINORS, ADULTS, PWD, T_HOUSES, C_HOUSES, L_HOUSES,
CL_HOUSES, Area, isFloodProne)
VALUES ($id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)";
return $this->db->connection->query($infoQuery);
}
public function dbSync() {
$successCount = 0;
foreach($this->brgyData as $brgy) {
$isBrgyInserted = $this->insertBarangay($brgy["name"]);
$isInfoInserted = false;
$isCoordinatesInserted = true;
if ($isBrgyInserted) {
$brgy_id = $this->db->connection->insert_id;
$isInfoInserted = $this->insertInfo($brgy_id);
foreach($brgy["coords"] as $coords) {
$res = $this->insertCoordinates($brgy_id, $coords["lat"], $coords["lng"]);
if (!$res) {
$isCoordinatesInserted = false;
}
}
}
if ($isBrgyInserted && $isInfoInserted && $isCoordinatesInserted) {
$successCount++;
}
}
return $successCount;
}
public function printAllBrgy() {
foreach($this->brgyData as $brgy) {
echo "{$brgy["name"]}\n";
foreach($brgy["coords"] as $coords) {
echo "LAT:{$coords["lat"]} LNG:{$coords["lng"]}\n";
}
}
}
}
$syncer = new GeoJsonDbSyncer();
$results = $syncer->dbSync();
echo "{$results} barangays successfully added.";
?> | {
"content_hash": "f74162c4984205030b718ad05cfd9d93",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 94,
"avg_line_length": 29.528301886792452,
"alnum_prop": 0.49456869009584664,
"repo_name": "Ashenzor/CDRRMO-Website",
"id": "7ce34069915991a28326c6ea6a12967683512259",
"size": "3130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/classes/GeoJsonDbSyncer.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "25853"
},
{
"name": "JavaScript",
"bytes": "589286"
},
{
"name": "PHP",
"bytes": "1261189"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ASCII">
<link rel="stylesheet" href="style.css" type="text/css">
<title>MXML Only Components - Adobe Flex 2 Language Reference</title>
</head>
<body class="classFrameContent">
<h3>MXML Only Components</h3>
<a href="mxml/binding.html" target="classFrame"><mx:Binding></a>
<br>
<a href="mxml/component.html" target="classFrame"><mx:Component></a>
<br>
<a href="mxml/metadata.html" target="classFrame"><mx:Metadata></a>
<br>
<a href="mxml/model.html" target="classFrame"><mx:Model></a>
<br>
<a href="mxml/script.html" target="classFrame"><mx:Script></a>
<br>
<a href="mxml/style.html" target="classFrame"><mx:Style></a>
<br>
<a href="mxml/xml.html" target="classFrame"><mx:XML></a>
<br>
<a href="mxml/xmlList.html" target="classFrame"><mx:XMLList></a>
<br>
</body>
<!--v. 2.0.8-->
</html>
| {
"content_hash": "b2b0369c48e1ebbebacfae72b31f92c0",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 102,
"avg_line_length": 23.08888888888889,
"alnum_prop": 0.6669874879692012,
"repo_name": "yelizariev/apivk",
"id": "5a57d45bddf248562e7b5292476712ebcc23ef9f",
"size": "1039",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/mxml-tags.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "131179"
}
],
"symlink_target": ""
} |
using ChessboardXaml.WinPhone.Resources;
namespace ChessboardXaml.WinPhone
{
/// <summary>
/// Provides access to string resources.
/// </summary>
public class LocalizedStrings
{
private static AppResources _localizedResources = new AppResources();
public AppResources LocalizedResources { get { return _localizedResources; } }
}
}
| {
"content_hash": "285760ec21aa77d62ed5ea54c39da263",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 26.785714285714285,
"alnum_prop": 0.6933333333333334,
"repo_name": "weima-sage/xamarin-forms-book-preview-2",
"id": "9e7f6f495194fdf2782b1990814032f86014927a",
"size": "377",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "Chapter14/ChessboardXaml/ChessboardXaml/ChessboardXaml.WinPhone/LocalizedStrings.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "10990170"
},
{
"name": "F#",
"bytes": "495342"
}
],
"symlink_target": ""
} |
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# 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 Geoscience Australia 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.
#===============================================================================
'''
Created on 12/03/2015
@author: Alex Ip
'''
import sys
import os
import logging
import ConfigParser
import collections
from _gdfutils import log_multiline
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO) # Logging level for this module
class ConfigFile(object):
def _parse_config_file(self):
'''
Function to return a nested dict of config file entries
Returns:
dict {<section_name>: {<key>: <value>,... },... }
'''
logger.debug('Opening config file %s', self._path)
config_parser = ConfigParser.SafeConfigParser(allow_no_value=True)
config_parser.read(self._path)
config_dict = collections.OrderedDict() # Need to preserve order of sections
for section_name in config_parser.sections():
section_dict = {}
config_dict[section_name.lower()] = section_dict
for attribute_name in config_parser.options(section_name):
attribute_value = config_parser.get(section_name, attribute_name)
section_dict[attribute_name.lower()] = attribute_value
log_multiline(logger.debug, config_dict, 'config_dict', '\t')
return config_dict
def __init__(self, path):
'''Constructor for class ConfigFile
Parameters:
path: Path to valid config file (required)
'''
log_multiline(logger.debug, path, 'path', '\t')
self._path = os.path.abspath(path)
assert os.path.exists(self._path), "%s does not exist" % self._path
self._configuration = self._parse_config_file()
log_multiline(logger.debug, self.__dict__, 'ConfigFile.__dict__', '\t')
@property
def path(self):
return self._path
@property
def configuration(self):
return self._configuration.copy()
| {
"content_hash": "6baee4fb152a22ac7dca5e9c3c8fa12e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 86,
"avg_line_length": 40.858695652173914,
"alnum_prop": 0.6264964086193137,
"repo_name": "GeoscienceAustralia/gdf",
"id": "56a587f3966ad184259485d75eea3563aea9e314",
"size": "3782",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gdf/_config_file.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "273579"
},
{
"name": "Shell",
"bytes": "9222"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Mirò</title>
<meta name="description" content="Mirò musical services">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Diego A. Riveros">
<!-- FONTS -->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Dosis:300,400,700,800" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/entypo.css">
<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/slick.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/jquery.mb.YTPlayer.min.css">
<link rel="stylesheet" href="css/main.css">
<!-- Favicon -->
<link rel="apple-touch-icon" href="img/icon.png">
<link rel="icon" type="image/png" href="img/fav.png">
<script src="js/vendor/modernizr.js"></script>
<!-- Shortcodes -->
<style>
.shortcode {
position: relative;
padding: 8em 0 10em;
}
.shortcode-title {
display: block;
margin: 2em 0;
padding: 0.5em 1em;
color: #fff;
background: #bec6c4;
text-align: center;
}
.grid-tables .row {
margin-bottom: 1em;
}
.grid-tables p {
background: #FFF;
padding: 0.625em;
}
.example-slider {
list-style: none;
padding: 0;
margin: 0;
cursor: grab;
}
.icon-samples {
text-align: center;
font-family: inherit;
}
.icon-samples .icon {
font-size: 1.5em;
padding: 1em;
line-height: 2;
}
.lato {
font-family: Lato;
}
</style>
</head>
<body class="portofolio">
<!-- Preloader -->
<div class="preloader flex flex-middle flex-center">
<div class="wrapper">
<div class="loader"></div>
</div>
</div>
<!-- Navbar -->
<nav class="navbar navbar-burger navbar-fixed-top is-transparent" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index-fr.html">Mirò</a>
<ul class="nav navbar-nav navbar-right">
<li><a href="portofolio.html"><span class="glyphicon glyphicon-bold"></span> EN</a></li>
</ul>
<span class="sr-only">Toggle navigation</span>
<button class="icon icon-menu burger-menu"></button>
</div>
<div class="menu-wrapper">
<div class="overlay-menu flex flex-middle">
<ul class="navigation" role="menubar">
<li role="menuitem"><a href="index-fr.html">Acceuil</a></li>
<li role="menuitem"><a href="about-fr.html">À propos</a></li>
<li role="menuitem"><a href="contact-fr.html">Contact</a></li>
<li role="menuitem"><a href="portofolio-fr.html">Portfolio</a></li>
<li role="menuitem"><a href="https://github.com/miromusic" target="_blank">Logiciels</a></li>
<li role="menuitem"><a href="https://soundcloud.com/diegoariveros" target="_blank">Musique</a></li>
</ul>
</div>
</div>
</div>
</nav>
<!-- Header -->
<header class="site-header" role="banner">
<div class="container">
<div class="row">
<div class="col-xs-12">
<hgroup class="title-group">
<h1 class="bigtitle">Portofolio</h1>
<h4>Mirò services musicaux</h4>
</hgroup>
</div>
</div>
</div>
</header>
<!-- Slider -->
<section class="shortcode">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<ul class="example-slider">
<li><img src="img/pianotxt.jpg" alt="img" /></li>
<li><img src="img/suzitxt.jpg" alt="img" /></li>
<li><img src="img/ti-claudetxt.jpg" alt="img" /></li>
<li><img src="img/geeksoundtxt.jpg" alt="img" /></li>
<!-- Scripts used in Shortcodes -->
<script>
$(document).ready(function () {
$('.example-slider').slick({
slide: 'ul>li',
autoplay: true,
autoplaySpeed: 5000,
dots: true
});
});
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</ul>
</div>
</div>
</section>
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/users/8267611&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe>
<!-- Footer -->
<footer class="footer" role="contentinfo">
<div class="container">
<div class="row">
<div class="col-md-12">
<!--<ul class="social-list">
<li><a href="#" class="icon icon-facebook"></a></li>
<li><a href="#" class="icon icon-twitter"></a></li>
<li><a href="#" class="icon icon-pinterest"></a></li>
<li><a href="#" class="icon icon-flickr"></a></li>
<li><a href="#" class="icon icon-dribbble"></a></li>
<li><a href="#" class="icon icon-behance"></a></li>
</ul>-->
<nav class="foter-navbar" role="navigation">
<ul class="footer-nav" role="menubar">
<li role="menuitem"><a href="about-fr.html">À propos</a></li>
<li role="menuitem"><a href="contact-fr.html">Contact</a></li>
<li role="menuitem"><a href="portofolio-fr.html">Portfolio</a></li>
<li role="menuitem"><a href="https://github.com/miromusic" target="_blank">Logiciels</a></li>
<li role="menuitem"><a href="https://soundcloud.com/diegoariveros" target="_blank">Musique</a></li>
</ul>
</nav>
<p class="copyright">© <time datetime="2016">2016</time> Mirò, All Rights Reserved by Diego A. Riveros</p>
</div>
</div>
</div>
</footer>
<!-- Scripts
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script>
<script src="js/vendor/jquery.appear.js"></script>
<script src="js/vendor/slick.min.js"></script>
<script src="js/vendor/jquery.countTo.js"></script>
<script src="js/vendor/jquery.parallax.min.js"></script>
<script src="js/vendor/jquery.magnific-popup.min.js"></script>
<!-- Background video -->
<script src="js/vendor/jquery.mb.YTPlayer.min.js"></script>
<script src="js/main.js"></script>
<!-- Scripts used in Shortcodes -->
<script>
$(document).ready(function () {
$('.example-slider').slick({
slide: 'ul>li',
autoplay: true,
autoplaySpeed: 5000,
dots: true
});
});
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</body>
</html> | {
"content_hash": "a72212321ce2d1e19847140a248f4560",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 293,
"avg_line_length": 42.796208530805686,
"alnum_prop": 0.4415282392026578,
"repo_name": "miromusic/miromusic.github.io",
"id": "d8b9f0ee3042d92b54992e469d0aae374fb512d9",
"size": "9137",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "portofolio-fr.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "68143"
},
{
"name": "HTML",
"bytes": "89079"
},
{
"name": "JavaScript",
"bytes": "17133"
},
{
"name": "PHP",
"bytes": "244226"
}
],
"symlink_target": ""
} |
using LinqToDB.Mapping;
#pragma warning disable 1573, 1591
#nullable enable
namespace Cli.Default.Oracle
{
[Table("TestIdentity")]
public class TestIdentity
{
[Column("ID", IsPrimaryKey = true)] public decimal Id { get; set; } // NUMBER
}
}
| {
"content_hash": "5c4d2a73ef72d9d3d5e41ef99e24f68e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 19.153846153846153,
"alnum_prop": 0.714859437751004,
"repo_name": "LinqToDB4iSeries/linq2db",
"id": "dded662c160ac2a54e6e7b7d8af79028c3499215",
"size": "689",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tests/Tests.T4/Cli/Default/Oracle/TestIdentity.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "29203"
},
{
"name": "C#",
"bytes": "18569855"
},
{
"name": "F#",
"bytes": "15865"
},
{
"name": "PLSQL",
"bytes": "29278"
},
{
"name": "PLpgSQL",
"bytes": "15809"
},
{
"name": "PowerShell",
"bytes": "5130"
},
{
"name": "SQLPL",
"bytes": "10530"
},
{
"name": "Shell",
"bytes": "29373"
},
{
"name": "Smalltalk",
"bytes": "11"
},
{
"name": "TSQL",
"bytes": "104099"
},
{
"name": "Visual Basic .NET",
"bytes": "3871"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<!--
<parameters>
<parameter key="workshop_blog.example.class">workshop\BlogBundle\Example</parameter>
</parameters>
<services>
<service id="workshop_blog.example" class="%workshop_blog.example.class%">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
</service>
</services>
-->
</container>
| {
"content_hash": "149f764f51487d9c2cef1e6924f1ef0c",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 120,
"avg_line_length": 35.25,
"alnum_prop": 0.6439716312056738,
"repo_name": "neoshadybeat/workshop-uca-sf2",
"id": "f13aa145a228c71525bd785c9acf40be49897a99",
"size": "705",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/workshop/BlogBundle/Resources/config/services.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1"
},
{
"name": "PHP",
"bytes": "100032"
},
{
"name": "Perl",
"bytes": "794"
}
],
"symlink_target": ""
} |
<?php
class ZendX_Wsdl_Api_Urrea_Clientes {
/**
*
* Funcion que permite comprobar que exista el usuario y contraseña
*
* @param string $usernane
* @param string $psw
* @return string
*/
public static function getClienteInfo($usernane, $psw) {
/* arreglo de retorno */
date_default_timezone_set('America/Mexico_City');
$array = array('login' => false);
/* verificar que los datos de logueo sean verdaderos */
$clientesMapper = new Wsdl_Model_ModclientesMapper();
/* si el cliente existe y se puede loguear */
$info = $clientesMapper->canLogin($usernane, $psw);
if ($info !== null) {
/* empezando a armar el array respuesta */
$array = array('login' => true);
/* obtener estado de cuenta */
$puntosM = new Wsdl_Model_ModpuntosMapper();
$array['info'] = $info;
$array['puntos'] = $puntosM->getPuntosDisponibles($info['id']);
}
/* retornar valores del arreglo */
return ZendX_Utilities_SecurityWSCheck::crypt(json_encode($array));
}
/**
*
* @param string $params
* @return string
*/
public static function createClient($params) {
if (null !== $params) {
$info = self::_getArray($params);
$clientesMappr = new Wsdl_Model_ModclientesMapper();
/* arreglo de retorno */
$clienteObj = new Wsdl_Model_Modclientes($info);
$return = $clientesMappr->write($clienteObj);
return ZendX_Utilities_SecurityWSCheck::crypt(json_encode($return));
}
throw new Exception('Usuario inexistente', '10', '');
}
/**
*
* @param string $params
* @return string
*/
private static function _getArray($params) {
$jsonParser = new ZendX_Action_Helper_Jsontoarray();
$datos = ZendX_Utilities_SecurityWSCheck::decrypt($params);
return $jsonParser->setJsontoarray($datos);
}
} | {
"content_hash": "b56f31ba05e8a5a6e5cdb091f113f552",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 80,
"avg_line_length": 32.3968253968254,
"alnum_prop": 0.5727584517393435,
"repo_name": "davichos/rstws",
"id": "e236484a0c5b305338045715cc436deccda2d4c1",
"size": "2042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "library/ZendX/Wsdl/Api/Urrea/Clientes.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "434175"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?><pnTable><name>Master Precipitable Water Category Table</name><grib2TableName>Precipitable Water Category Table</grib2TableName><updatedDTG>201403050101</updatedDTG><tableStatus setDTG="2009111712">current</tableStatus><reference>
<title>Product Name Standard Document</title>
<docId>P-3146-2.2</docId>
<version>2.2</version>
<dtg>May 2012</dtg>
<organization>Fleet Numerical Meteorology and Oceanography Center</organization>
<infoUsed>Precipitable Water Category Table</infoUsed>
</reference><reference>
<title>GRIB 2</title>
<docId>FM 92-XII</docId>
<version>12.0.0</version>
<organization>World Meteorological Organization</organization>
<infoUsed>GRIB2 Precipitable Water Category, table 4.202</infoUsed>
</reference><fnmocTable><entry><fnmocId>0</fnmocId><grib2Id>0-191</grib2Id><name>reserved</name><status>current</status><wmoStatus>operational</wmoStatus></entry><entry><fnmocId>192</fnmocId><grib2Id>192-254</grib2Id><name>Reserved for local use</name><status>current</status><wmoStatus>operational</wmoStatus></entry><entry><fnmocId>255</fnmocId><grib2Id>255</grib2Id><name>Missing</name><status>current</status><wmoStatus>operational</wmoStatus></entry></fnmocTable></pnTable> | {
"content_hash": "d66e746b290c1fba1b9d6cd754c9b37e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 480,
"avg_line_length": 91,
"alnum_prop": 0.7598116169544741,
"repo_name": "Unidata/netcdf-java",
"id": "46496b2e368edc71eab24b5c4ef86d47bc3efbb3",
"size": "1274",
"binary": false,
"copies": "1",
"ref": "refs/heads/maint-5.x",
"path": "grib/src/main/sources/fnmoc/US058MMTA-ALPdoc.pntabs-prodname-masterPrecipWaterCat.GRIB2.Tbl4.202.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AGS Script",
"bytes": "708007"
},
{
"name": "C",
"bytes": "404428"
},
{
"name": "C++",
"bytes": "10772"
},
{
"name": "CSS",
"bytes": "13861"
},
{
"name": "Groovy",
"bytes": "95588"
},
{
"name": "HTML",
"bytes": "3774351"
},
{
"name": "Java",
"bytes": "21758821"
},
{
"name": "Makefile",
"bytes": "2434"
},
{
"name": "Objective-J",
"bytes": "28890"
},
{
"name": "Perl",
"bytes": "7860"
},
{
"name": "PowerShell",
"bytes": "678"
},
{
"name": "Python",
"bytes": "20750"
},
{
"name": "Roff",
"bytes": "34262"
},
{
"name": "Shell",
"bytes": "18859"
},
{
"name": "Tcl",
"bytes": "5307"
},
{
"name": "Vim Script",
"bytes": "88"
},
{
"name": "Visual Basic 6.0",
"bytes": "1269"
},
{
"name": "Yacc",
"bytes": "25086"
}
],
"symlink_target": ""
} |
class Category < ActiveRecord::Base
end
| {
"content_hash": "e69ecbc0b57a723c192b3e7929afa83a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 13.666666666666666,
"alnum_prop": 0.7804878048780488,
"repo_name": "wait4pumpkin/pityboy",
"id": "7d93ac5e3188a6fd035ef1b5ca778d971b7bfc27",
"size": "41",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "models/category.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8283"
},
{
"name": "JavaScript",
"bytes": "4765"
},
{
"name": "Ruby",
"bytes": "29565"
}
],
"symlink_target": ""
} |
<?php
use App\Helpers\CategoryFunctions;
/**
* Class ConstructionArchitectureCategories
*
* A trait used to seed Construction and Architecture sub-categories.
*
* @author Rob Attfield <emailme@robertattfield> <http://www.robertattfield.com>
*/
trait ConstructionArchitectureCategories{
public static function create(){
$categories = [
[
'name' => 'Architecture',
],
[
'name' => 'Drafting',
],
[
'name' => 'Estimation',
],
[
'name' => 'Health and Safety',
],
[
'name' => 'Interior Design',
],
[
'name' => 'Labouring',
],
[
'name' => 'Machine Operators',
],
[
'name' => 'Planning',
],
[
'name' => 'Project and Contracts Management',
],
[
'name' => 'Quantity Surveying',
],
[
'name' => 'Site Management',
],
[
'name' => 'Supervisors and Forepersons',
],
[
'name' => 'Surveying',
],
];
CategoryFunctions::createCategory('Construction and Architecture', $categories);
}
} | {
"content_hash": "7f6658c0eb2e28aeb40b566db09e8b76",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 88,
"avg_line_length": 24.203389830508474,
"alnum_prop": 0.39985994397759106,
"repo_name": "rattfieldnz/jobs-aggregator",
"id": "d6f15c3eb50177a3870653a81c74aeed89fdf97c",
"size": "1428",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/database/seeds/categories/sub_categories/ConstructionArchitectureCategories.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "412"
},
{
"name": "CSS",
"bytes": "72"
},
{
"name": "JavaScript",
"bytes": "503"
},
{
"name": "PHP",
"bytes": "165481"
}
],
"symlink_target": ""
} |
define(function (require, exports, module) {
"use strict";
// External dependencies.
var Backbone = require("backbone");
require("threejs");
//var THREE = require("threejs");
// Defining the view
var GameView = Backbone.View.extend({
/**
*
*/
el: "#gameView",
/**
*
*/
initialize: function () {
console.log("Init GameView");
this.render();
},
/**
*
*/
events: {
},
/**
*
*/
renderer: null,
/**
*
*/
scene: null,
/**
*
*/
camara: null,
/**
*
*/
cube: null,
/**
*
*/
render: function () {
console.log("Render GameView");
var width = this.$el.width();
var height = this.$el.height();
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
this.renderer = new THREE.WebGLRenderer();
this.renderer.setSize(width, height);
this.$el.append(this.renderer.domElement);
var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new THREE.MeshBasicMaterial({
color: 0x003300
});
this.cube = new THREE.Mesh(geometry, material);
this.scene.add(this.cube);
this.camera.position.z = 5;
this.render3dBinded = _.bind(this.render3d, this);
this.render3dBinded();
},
/**
*
*/
render3dBinded: null,
/**
*
*/
render3d: function () {
this.cube.rotation.x += 0.1;
this.cube.rotation.y += 0.1;
requestAnimationFrame(this.render3dBinded);
this.renderer.render(this.scene, this.camera);
}
});
module.exports = GameView;
});
| {
"content_hash": "e06a9e4af92bd8c6d7d7ddcf9e542a05",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 85,
"avg_line_length": 20.435643564356436,
"alnum_prop": 0.43992248062015504,
"repo_name": "fjguerrero/lanzabolas",
"id": "303d67f47be4f9d01684e6871555fadce4c546c6",
"size": "2064",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/GameView.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "403"
},
{
"name": "CoffeeScript",
"bytes": "4812"
},
{
"name": "JavaScript",
"bytes": "13759"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - BIRD.G118</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
BIRD.G118
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a>
<!-- Modal Structure -->
<div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => BIRD.G118
[family] => Bird G118
[brand] => Bird
[model] => G118
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>BIRD </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] =>
[browser] => BIRD
[version] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.21101</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 0
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Bird
[mobile_model] => G118
[version] =>
[is_android] =>
[browser_name] => unknown
[operating_system_family] => unknown
[operating_system_version] =>
[is_ios] =>
[producer] => Bird
[operating_system] => unknown
[mobile_screen_width] => 0
[mobile_browser] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td>feature phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.006</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] =>
[operatingSystem] => Array
(
)
[device] => Array
(
[brand] => BI
[brandName] => Bird
[model] => G118
[device] => 3
[deviceName] => feature phone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] =>
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] => 1
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.003</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] =>
[minor] =>
[patch] =>
[family] => Other
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => Bird
[model] => G118
[family] => Bird G118
)
[originalUserAgent] => BIRD.G118
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UserAgentStringCom<br /><small></small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[device] => Array
(
[type] => mobile
[subtype] => feature
[manufacturer] => Bird
[model] => G118
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Bird</td><td>G118</td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.019</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => false
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => true
[is_html_preferred] => false
[advertised_device_os] =>
[advertised_device_os_version] =>
[advertised_browser] =>
[advertised_browser_version] =>
[complete_device_name] => Bird G118
[device_name] => Bird G118
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Bird
[model_name] => G118
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => false
[can_skip_aligned_link_row] => false
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] => Openwave Mobile Browser
[mobile_browser_version] => 6.1
[device_os_version] =>
[pointing_method] =>
[release_date] => 2002_august
[marketing_name] =>
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => true
[built_in_back_button_support] => true
[card_title_support] => false
[softkey_support] => true
[table_support] => true
[numbered_menus] => true
[menu_with_select_element_recommended] => true
[menu_with_list_of_links_recommended] => false
[icons_on_menu_items_support] => true
[break_list_of_links_with_br_element_recommended] => false
[access_key_support] => true
[wrap_mode_support] => true
[times_square_mode_support] => true
[deck_prefetch_support] => true
[elective_forms_recommended] => false
[wizards_recommended] => true
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => true
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => false
[xhtml_supports_forms_in_table] => false
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => true
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => true
[xhtml_supports_inline_input] => true
[xhtml_supports_monospace_font] => true
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => true
[xhtml_nowrap_mode] => true
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #99CCFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => true
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => iso8859
[opwv_xhtml_extensions_support] => true
[xhtml_make_phone_call_string] => wtai://wp/mc;
[xhtmlmp_preferred_mime_type] => application/vnd.wap.xhtml+xml
[xhtml_table_support] => true
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => not_supported
[cookie_support] => true
[accept_third_party_cookie] => false
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => false
[ajax_manipulate_css] => false
[ajax_support_getelementbyid] => false
[ajax_support_inner_html] => false
[ajax_xhr_type] => none
[ajax_manipulate_dom] => false
[ajax_support_events] => false
[ajax_support_event_listener] => false
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 1
[preferred_markup] => html_wi_oma_xhtmlmp_1_0
[wml_1_1] => true
[wml_1_2] => true
[wml_1_3] => true
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => true
[html_wi_imode_html_2] => true
[html_wi_imode_html_3] => true
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => true
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => true
[html_web_3_2] => false
[html_web_4_0] => false
[voicexml] => false
[multipart_support] => true
[total_cache_disable_support] => false
[time_to_live_support] => true
[resolution_width] => 128
[resolution_height] => 160
[columns] => 11
[max_image_width] => 120
[max_image_height] => 130
[rows] => 6
[physical_screen_width] => 27
[physical_screen_height] => 27
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => false
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 256
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => false
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => true
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 4096
[max_url_length_in_requests] => 128
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => true
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => true
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[wap_push_support] => true
[connectionless_service_indication] => true
[connectionless_service_load] => false
[connectionless_cache_operation] => true
[connectionoriented_unconfirmed_service_indication] => true
[connectionoriented_unconfirmed_service_load] => true
[connectionoriented_unconfirmed_cache_operation] => true
[connectionoriented_confirmed_service_indication] => true
[connectionoriented_confirmed_service_load] => true
[connectionoriented_confirmed_cache_operation] => true
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => true
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => false
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => false
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => false
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[is_sencha_touch_ok] => false
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-05-10 08:08:33</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {
"content_hash": "ce2053595a533cc6a9cce873705f951d",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 956,
"avg_line_length": 40.923863636363635,
"alnum_prop": 0.5072334990142449,
"repo_name": "ThaDafinser/UserAgentParserComparison",
"id": "cbd4ede2a9c95f40e51288e257b8688ef2fcd465",
"size": "36014",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "v5/user-agent-detail/d5/30/d53044f3-698d-4d6b-9776-4d65e4f08db4.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2060859160"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.