text
stringlengths 2
99.9k
| meta
dict |
|---|---|
namespace WebMarkupMin.Core
{
/// <summary>
/// Minification error information
/// </summary>
public class MinificationErrorInfo
{
/// <summary>
/// Gets a category name
/// </summary>
public string Category
{
get;
private set;
}
/// <summary>
/// Gets a message
/// </summary>
public string Message
{
get;
private set;
}
/// <summary>
/// Gets a line number on which the error occurred
/// </summary>
public int LineNumber
{
get;
private set;
}
/// <summary>
/// Gets a column number on which the error occurred
/// </summary>
public int ColumnNumber
{
get;
private set;
}
/// <summary>
/// Gets a source fragment
/// </summary>
public string SourceFragment
{
get;
private set;
}
/// <summary>
/// Constructs instance of error details
/// </summary>
/// <param name="message">Message</param>
public MinificationErrorInfo(string message)
: this(string.Empty, message, 0, 0, string.Empty)
{ }
/// <summary>
/// Constructs instance of error details
/// </summary>
/// <param name="category">Category name</param>
/// <param name="message">Message</param>
public MinificationErrorInfo(string category, string message)
: this(category, message, 0, 0, string.Empty)
{ }
/// <summary>
/// Constructs instance of error details
/// </summary>
/// <param name="message">Message</param>
/// <param name="lineNumber">Line number</param>
/// <param name="columnNumber">Column number</param>
/// <param name="sourceFragment">Fragment of source code</param>
public MinificationErrorInfo(string message, int lineNumber, int columnNumber, string sourceFragment)
: this(string.Empty, message, lineNumber, columnNumber, sourceFragment)
{ }
/// <summary>
/// Constructs instance of error details
/// </summary>
/// <param name="category">Category name</param>
/// <param name="message">Message</param>
/// <param name="lineNumber">Line number</param>
/// <param name="columnNumber">Column number</param>
/// <param name="sourceFragment">Fragment of source code</param>
public MinificationErrorInfo(string category, string message, int lineNumber, int columnNumber, string sourceFragment)
{
Category = category;
Message = message;
LineNumber = lineNumber;
ColumnNumber = columnNumber;
SourceFragment = sourceFragment;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model.transform;
import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;
import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;
/**
* CancelSpotFleetRequestsSuccessItem StAX Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CancelSpotFleetRequestsSuccessItemStaxUnmarshaller implements Unmarshaller<CancelSpotFleetRequestsSuccessItem, StaxUnmarshallerContext> {
public CancelSpotFleetRequestsSuccessItem unmarshall(StaxUnmarshallerContext context) throws Exception {
CancelSpotFleetRequestsSuccessItem cancelSpotFleetRequestsSuccessItem = new CancelSpotFleetRequestsSuccessItem();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
if (context.isStartOfDocument())
targetDepth += 1;
while (true) {
XMLEvent xmlEvent = context.nextEvent();
if (xmlEvent.isEndDocument())
return cancelSpotFleetRequestsSuccessItem;
if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
if (context.testExpression("currentSpotFleetRequestState", targetDepth)) {
cancelSpotFleetRequestsSuccessItem.setCurrentSpotFleetRequestState(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("previousSpotFleetRequestState", targetDepth)) {
cancelSpotFleetRequestsSuccessItem.setPreviousSpotFleetRequestState(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("spotFleetRequestId", targetDepth)) {
cancelSpotFleetRequestsSuccessItem.setSpotFleetRequestId(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
} else if (xmlEvent.isEndElement()) {
if (context.getCurrentDepth() < originalDepth) {
return cancelSpotFleetRequestsSuccessItem;
}
}
}
}
private static CancelSpotFleetRequestsSuccessItemStaxUnmarshaller instance;
public static CancelSpotFleetRequestsSuccessItemStaxUnmarshaller getInstance() {
if (instance == null)
instance = new CancelSpotFleetRequestsSuccessItemStaxUnmarshaller();
return instance;
}
}
|
{
"pile_set_name": "Github"
}
|
module Postal
module MessageDB
class Message
class NotFound < Postal::Error
end
def self.find_one(database, query)
query = {:id => query.to_i} if query.is_a?(Fixnum)
if message = database.select('messages', :where => query, :limit => 1).first
Message.new(database, message)
else
raise NotFound, "No message found matching provided query #{query}"
end
end
def self.find(database, options = {})
if messages = database.select('messages', options)
if messages.is_a?(Array)
messages.map { |m| Message.new(database, m) }
else
messages
end
else
[]
end
end
def self.find_with_pagination(database, page, options = {})
messages = database.select_with_pagination('messages', page, options)
messages[:records] = messages[:records].map { |m| Message.new(database, m) }
messages
end
attr_reader :database
def initialize(database, attributes)
@database = database
@attributes = attributes
end
#
# Return the server for this message
#
def server
@database.server
end
#
# Return the credential for this message
#
def credential
@credential ||= self.credential_id ? Credential.find_by_id(self.credential_id) : nil
end
#
# Return the route for this message
#
def route
@route ||= self.route_id ? Route.find_by_id(self.route_id) : nil
end
#
# Return the endpoint for this message
#
def endpoint
@endpoint ||= begin
if self.endpoint_type && self.endpoint_id
self.endpoint_type.constantize.find_by_id(self.endpoint_id)
elsif self.route && self.route.mode == 'Endpoint'
self.route.endpoint
end
end
end
#
# Return the credential for this message
#
def domain
@domain ||= self.domain_id ? Domain.find_by_id(self.domain_id) : nil
end
#
# Copy appropriate attributes from the raw message to the message itself
#
def copy_attributes_from_raw_message
if self.raw_message
self.subject = self.headers['subject']&.last
self.message_id = self.headers['message-id']&.last
if self.message_id
self.message_id = self.message_id.gsub(/.*</, '').gsub(/>.*/, '').strip
end
end
end
#
# Return the timestamp for this message
#
def timestamp
@timestamp ||= @attributes['timestamp'] ? Time.zone.at(@attributes['timestamp']) : nil
end
#
# Return the time that the last delivery was attempted
#
def last_delivery_attempt
@last_delivery_attempt ||= @attributes['last_delivery_attempt'] ? Time.zone.at(@attributes['last_delivery_attempt']) : nil
end
#
# Return the hold expiry for this message
#
def hold_expiry
@hold_expiry ||= @attributes['hold_expiry'] ? Time.zone.at(@attributes['hold_expiry']) : nil
end
#
# Has this message been read?
#
def read?
!!(loaded || clicked)
end
#
# Add a delivery attempt for this message
#
def create_delivery(status, options = {})
delivery = Delivery.create(self, options.merge(:status => status))
hold_expiry = status == 'Held' ? Postal.config.general.maximum_hold_expiry_days.days.from_now.to_f : nil
self.update(:status => status, :last_delivery_attempt => delivery.timestamp.to_f, :held => status == 'Held' ? 1 : 0, :hold_expiry => hold_expiry)
delivery
end
#
# Return all deliveries for this object
#
def deliveries
@deliveries ||= begin
@database.select('deliveries', :where => {:message_id => self.id}, :order => :timestamp).map do |hash|
Delivery.new(self, hash)
end
end
end
#
# Return all the clicks for this object
#
def clicks
@clicks ||= begin
clicks = @database.select('clicks', :where => {:message_id => self.id}, :order => :timestamp)
if clicks.empty?
[]
else
links = @database.select('links', :where => {:id => clicks.map { |c| c['link_id'].to_i }}).group_by { |l| l['id'] }
clicks.map do |hash|
Click.new(hash, links[hash['link_id']].first)
end
end
end
end
#
# Return all the loads for this object
#
def loads
@loads ||= begin
loads = @database.select('loads', :where => {:message_id => self.id}, :order => :timestamp)
loads.map do |hash|
Load.new(hash)
end
end
end
#
# Return all activity entries
#
def activity_entries
@activity_entries ||= (deliveries + clicks + loads).sort_by(&:timestamp)
end
#
# Provide access to set and get acceptable attributes
#
def method_missing(name, value = nil, &block)
if @attributes.has_key?(name.to_s)
@attributes[name.to_s]
elsif name.to_s =~ /\=\z/
@attributes[name.to_s.gsub('=', '').to_s] = value
else
nil
end
end
#
# Has this message been persisted to the database yet?
#
def persisted?
!@attributes['id'].nil?
end
#
# Save this message
#
def save
save_raw_message
persisted? ? _update : _create
self
end
#
# Update this message
#
def update(attributes_to_change)
@attributes = @attributes.merge(database.stringify_keys(attributes_to_change))
if persisted?
@database.update('messages', attributes_to_change, :where => {:id => self.id})
else
_create
end
end
#
# Delete the message from the database
#
def delete
if persisted?
@database.delete('messages', :where => {:id => self.id})
end
end
#
# Return the headers
#
def raw_headers
if self.raw_table
@raw_headers ||= @database.select(self.raw_table, :where => {:id => self.raw_headers_id}).first&.send(:[], 'data') || ""
else
""
end
end
#
# Return the full raw message body for this message.
#
def raw_body
if self.raw_table
@raw ||= @database.select(self.raw_table, :where => {:id => self.raw_body_id}).first&.send(:[], 'data') || ""
else
""
end
end
#
# Return the full raw message for this message
#
def raw_message
@raw_message ||= "#{raw_headers}\r\n\r\n#{raw_body}"
end
#
# Set the raw message ready for saving later
#
def raw_message=(raw)
@pending_raw_message = raw.force_encoding('BINARY')
end
#
# Save the raw message to the database as appropriate
#
def save_raw_message
if @pending_raw_message
self.size = @pending_raw_message.bytesize
date = Date.today
table_name, headers_id, body_id = @database.insert_raw_message(@pending_raw_message, date)
self.raw_table = table_name
self.raw_headers_id = headers_id
self.raw_body_id = body_id
@raw = nil
@raw_headers = nil
@headers = nil
@mail = nil
@pending_raw_message = nil
copy_attributes_from_raw_message
@database.query("UPDATE `#{@database.database_name}`.`raw_message_sizes` SET size = size + #{self.size} WHERE table_name = '#{table_name}'")
end
end
#
# Is there a raw message?
#
def raw_message?
!!self.raw_table
end
#
# Return the plain body for this message
#
def plain_body
mail&.plain_body
end
#
# Return the HTML body for this message
#
def html_body
mail&.html_body
end
#
# Return the HTML body with any tracking links
#
def html_body_without_tracking_image
html_body.gsub(/\<p class\=['"]ampimg['"].*?\<\/p\>/, '')
end
#
# Return all attachments for this message
#
def attachments
mail&.attachments || []
end
#
# Return the headers for this message
#
def headers
@headers ||= begin
mail = Mail.new(self.raw_headers)
mail.header.fields.each_with_object({}) do |field, hash|
hash[field.name.downcase] ||= []
begin
hash[field.name.downcase] << field.decoded
rescue Mail::Field::IncompleteParseError
# Never mind, move on to the next header
end
end
end
end
#
# Return the recipient domain for this message
#
def recipient_domain
self.rcpt_to ? self.rcpt_to.split('@').last : nil
end
#
# Create a new item in the message queue for this message
#
def add_to_message_queue(options = {})
QueuedMessage.create!(:message => self, :server_id => @database.server_id, :batch_key => self.batch_key, :domain => self.recipient_domain, :route_id => self.route_id, :manual => options[:manual]).id
end
#
# Return a suitable batch key for this message
#
def batch_key
case self.scope
when 'outgoing'
key = "outgoing-"
key += self.recipient_domain.to_s
when 'incoming'
key = "incoming-"
key += "rt:#{self.route_id}-ep:#{self.endpoint_id}-#{self.endpoint_type}"
else
key = nil
end
key
end
#
# Return the queued message
#
def queued_message
@queued_message ||= self.id ? QueuedMessage.where(:message_id => self.id, :server_id => @database.server_id).first : nil
end
#
# Return the spam status
#
def spam_status
return 'NotChecked' unless inspected == 1
spam == 1 ? 'Spam' : 'NotSpam'
end
#
# Has this message been held?
#
def held?
status == 'Held'
end
#
# Does this message have our DKIM header yet?
#
def has_outgoing_headers?
!!(raw_headers =~ /^X\-Postal\-MsgID\:/i)
end
#
# Add dkim header
#
def add_outgoing_headers
headers = []
if self.domain
dkim = Postal::DKIMHeader.new(self.domain, self.raw_message)
headers << dkim.dkim_header
end
headers << "X-Postal-MsgID: #{self.token}"
append_headers(*headers)
end
#
# Append a header to the existing headers
#
def append_headers(*headers)
new_headers = headers.join("\r\n")
new_headers = "#{new_headers}\r\n#{self.raw_headers}"
@database.update(self.raw_table, {:data => new_headers}, :where => {:id => self.raw_headers_id})
@raw_headers = new_headers
@raw_message = nil
@headers = nil
end
#
# Return a suitable
#
def webhook_hash
@webhook_hash ||= {
:id => self.id,
:token => self.token,
:direction => self.scope,
:message_id => self.message_id,
:to => self.rcpt_to,
:from => self.mail_from,
:subject => self.subject,
:timestamp => self.timestamp.to_f,
:spam_status => self.spam_status,
:tag => self.tag
}
end
#
# Mark this message as bounced
#
def bounce!(bounce_message)
create_delivery('Bounced', :details => "We've received a bounce message for this e-mail. See <msg:#{bounce_message.id}> for details.")
SendWebhookJob.queue(:main, :server_id => self.database.server_id, :event => "MessageBounced", :payload => {:_original_message => self.id, :_bounce => bounce_message.id})
end
#
# Should bounces be sent for this message?
#
def send_bounces?
self.bounce != 1 && self.mail_from.present?
end
#
# Add a load for this message
#
def create_load(request)
update('loaded' => Time.now.to_f) if loaded.nil?
database.insert(:loads, {:message_id => self.id, :ip_address => request.ip, :user_agent => request.user_agent, :timestamp => Time.now.to_f})
SendWebhookJob.queue(:main, :server_id => self.database.server_id, :event => 'MessageLoaded', :payload => {:_message => self.id, :ip_address => request.ip, :user_agent => request.user_agent})
end
#
# Create a new link
#
def create_link(url)
hash = Digest::SHA1.hexdigest(url.to_s)
token = Nifty::Utils::RandomString.generate(:length => 8)
database.insert(:links, {:message_id => self.id, :hash => hash, :url => url, :timestamp => Time.now.to_f, :token => token})
token
end
#
# Return a message object that this message is a reply to
#
def original_messages
return nil unless self.bounce == 1
other_message_ids = raw_message.scan(/\X\-Postal\-MsgID\:\s*([a-z0-9]+)/i).flatten
if other_message_ids.empty?
[]
else
database.messages(:where => {:token => other_message_ids})
end
end
#
# Was thsi message sent to a return path?
#
def rcpt_to_return_path?
!!(rcpt_to =~ /\@#{Regexp.escape(Postal.config.dns.custom_return_path_prefix)}\./)
end
#
# Inspect this message
#
def inspect_message
if result = MessageInspection.new(self.raw_message, self.scope&.to_sym)
# Update the messages table with the results of our inspection
update(:inspected => 1, :spam_score => result.filtered_spam_score, :threat => result.threat?, :threat_details => result.threat_message)
# Add any spam details into the spam checks database
self.database.insert_multi(:spam_checks, [:message_id, :code, :score, :description], result.filtered_spam_checks.map { |d| [self.id, d.code, d.score, d.description]})
# Return the result
result
end
end
#
# Return all spam checks for this message
#
def spam_checks
@spam_checks ||= self.database.select(:spam_checks, :where => {:message_id => self.id})
end
#
# Cancel the hold on this message
#
def cancel_hold
if self.status == 'Held'
create_delivery('HoldCancelled', :details => "The hold on this message has been removed without action.")
end
end
#
# Parse the contents of this message
#
def parse_content
parse_result = Postal::MessageParser.new(self)
if parse_result.actioned?
# Somethign was changed, update the raw message
@database.update(self.raw_table, {:data => parse_result.new_body}, :where => {:id => self.raw_body_id})
@raw = parse_result.new_body
@raw_message = nil
end
update('parsed' => 1, 'tracked_links' => parse_result.tracked_links, 'tracked_images' => parse_result.tracked_images)
end
#
# Has this message been parsed?
#
def parsed?
self.parsed == 1
end
#
# Should this message be parsed?
#
def should_parse?
parsed? == false && headers['x-amp'] != 'skip'
end
private
def _update
@database.update('messages', @attributes.reject {|k,v| k == :id }, :where => {:id => @attributes['id']})
end
def _create
self.timestamp = Time.now.to_f if self.timestamp.blank?
self.status = 'Pending' if self.status.blank?
self.token = Nifty::Utils::RandomString.generate(:length => 12) if self.token.blank?
last_id = @database.insert('messages', @attributes.reject {|k,v| k == :id })
@attributes['id'] = last_id
@database.statistics.increment_all(self.timestamp, self.scope)
Statistic.global.increment!(:total_messages)
Statistic.global.increment!("total_#{self.scope}".to_sym)
add_to_message_queue
end
def mail
# This version of mail is only used for accessing the bodies.
@mail ||= raw_message? ? Mail.new(raw_message) : nil
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace StyleCop.Analyzers.OrderingRules
{
using System;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using StyleCop.Analyzers.Helpers;
using StyleCop.Analyzers.Settings.ObjectModel;
/// <summary>
/// A constant field is placed beneath a non-constant field.
/// </summary>
/// <remarks>
/// <para>A violation of this rule occurs when a constant field is placed beneath a non-constant field. Constants
/// should be placed above fields to indicate that the two are fundamentally different types of elements with
/// different considerations for the compiler, different naming requirements, etc.</para>
/// </remarks>
[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal class SA1203ConstantsMustAppearBeforeFields : DiagnosticAnalyzer
{
/// <summary>
/// The ID for diagnostics produced by the <see cref="SA1203ConstantsMustAppearBeforeFields"/> analyzer.
/// </summary>
public const string DiagnosticId = "SA1203";
private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1203.md";
private static readonly LocalizableString Title = new LocalizableResourceString(nameof(OrderingResources.SA1203Title), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(OrderingResources.SA1203MessageFormat), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly LocalizableString Description = new LocalizableResourceString(nameof(OrderingResources.SA1203Description), OrderingResources.ResourceManager, typeof(OrderingResources));
private static readonly DiagnosticDescriptor Descriptor =
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.OrderingRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
private static readonly ImmutableArray<SyntaxKind> TypeDeclarationKinds =
ImmutableArray.Create(SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration);
private static readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> TypeDeclarationAction = HandleTypeDeclaration;
/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
ImmutableArray.Create(Descriptor);
/// <inheritdoc/>
public override void Initialize(AnalysisContext context)
{
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
context.EnableConcurrentExecution();
context.RegisterSyntaxNodeAction(TypeDeclarationAction, TypeDeclarationKinds);
}
private static void HandleTypeDeclaration(SyntaxNodeAnalysisContext context, StyleCopSettings settings)
{
var elementOrder = settings.OrderingRules.ElementOrder;
int constantIndex = elementOrder.IndexOf(OrderingTrait.Constant);
if (constantIndex < 0)
{
return;
}
var typeDeclaration = (TypeDeclarationSyntax)context.Node;
var members = typeDeclaration.Members;
var previousFieldConstant = true;
var previousFieldStatic = false;
var previousFieldReadonly = false;
var previousAccessLevel = AccessLevel.NotSpecified;
foreach (var member in members)
{
if (!(member is FieldDeclarationSyntax field))
{
continue;
}
AccessLevel currentAccessLevel = MemberOrderHelper.GetAccessLevelForOrdering(field, field.Modifiers);
bool currentFieldConstant = field.Modifiers.Any(SyntaxKind.ConstKeyword);
bool currentFieldReadonly = currentFieldConstant || field.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);
bool currentFieldStatic = currentFieldConstant || field.Modifiers.Any(SyntaxKind.StaticKeyword);
bool compareConst = true;
for (int j = 0; compareConst && j < constantIndex; j++)
{
switch (elementOrder[j])
{
case OrderingTrait.Accessibility:
if (currentAccessLevel != previousAccessLevel)
{
compareConst = false;
}
continue;
case OrderingTrait.Readonly:
if (currentFieldReadonly != previousFieldReadonly)
{
compareConst = false;
}
continue;
case OrderingTrait.Static:
if (currentFieldStatic != previousFieldStatic)
{
compareConst = false;
}
continue;
case OrderingTrait.Kind:
// Only fields may be marked const, and all fields have the same kind.
continue;
case OrderingTrait.Constant:
default:
continue;
}
}
if (compareConst)
{
if (!previousFieldConstant && currentFieldConstant)
{
context.ReportDiagnostic(Diagnostic.Create(Descriptor, NamedTypeHelpers.GetNameOrIdentifierLocation(member)));
}
}
previousFieldConstant = currentFieldConstant;
previousFieldReadonly = currentFieldReadonly;
previousFieldStatic = currentFieldStatic;
previousAccessLevel = currentAccessLevel;
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
[dist4]message_header // num_bytes
[u4]1 // version
[u4]0 // interface ID
[u4]0 // name
[u4]2 // flags: kMessageIsResponse is set in a request.
[u4]0 // padding
[u8]1 // request_id
[anchr]message_header
|
{
"pile_set_name": "Github"
}
|
package org.zarroboogs.weibo.activity;
//import com.google.android.gms.maps.CameraUpdate;
//import com.google.android.gms.maps.CameraUpdateFactory;
//import com.google.android.gms.maps.GoogleMap;
//import com.google.android.gms.maps.SupportMapFragment;
//import com.google.android.gms.maps.model.LatLng;
//import com.google.android.gms.maps.model.Marker;
//import com.google.android.gms.maps.model.MarkerOptions;
import org.zarroboogs.util.net.WeiboException;
import org.zarroboogs.weibo.BeeboApplication;
import org.zarroboogs.weibo.R;
import org.zarroboogs.weibo.asynctask.MyAsyncTask;
import org.zarroboogs.weibo.bean.GeoBean;
import org.zarroboogs.weibo.bean.MessageBean;
import org.zarroboogs.weibo.bean.data.NearbyStatusListBean;
import org.zarroboogs.weibo.dao.NearbyTimeLineDao;
import org.zarroboogs.weibo.support.utils.Utility;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ProgressBar;
import android.widget.Toast;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
public class NearbyTimeLineActivity extends AbstractAppActivity {
// private GoogleMap mMap;
private double lat;
private double lon;
private String locationStr;
// private Marker melbourne;
// private Map<Marker, MessageBean> bindEvent = new HashMap<Marker,
// MessageBean>();
private GetGoogleLocationInfo locationTask;
private FetchWeiboMsg fetchWeiboMsg;
private MenuItem refresh;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
// getActionBar().setDisplayShowHomeEnabled(false);
// getActionBar().setDisplayShowTitleEnabled(true);
// getActionBar().setDisplayHomeAsUpEnabled(false);
// getActionBar().setTitle(getString(R.string.nearby));
addLocation();
}
@Override
protected void onResume() {
super.onResume();
if (TextUtils.isEmpty(locationStr)) {
if (Utility.isTaskStopped(locationTask)) {
GeoBean geoBean = new GeoBean();
geoBean.setLatitude(lat);
geoBean.setLongitude(lon);
locationTask = new GetGoogleLocationInfo(geoBean);
locationTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
}
}
}
@Override
protected void onPause() {
super.onPause();
Utility.cancelTasks(locationTask);
}
private void setUpMapIfNeeded() {
// if (mMap == null) {
// mMap = ((SupportMapFragment)
// getSupportFragmentManager().findFragmentById(R.id.map))
// .getMap();
// if (mMap != null) {
// mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
//
// mMap.setOnInfoWindowClickListener(new
// GoogleMap.OnInfoWindowClickListener() {
// public void onInfoWindowClick(Marker marker) {
// MessageBean msg = bindEvent.get(marker);
// if (msg != null) {
// startActivityForResult(BrowserWeiboMsgActivity.newIntent(msg,
// GlobalContext.getInstance().getSpecialToken()), 0);
// }
// }
// });
//
// final LatLng MELBOURNE = new LatLng(lat, lon);
// melbourne = mMap.addMarker(new MarkerOptions()
// .position(MELBOURNE)
// .title(GlobalContext.getInstance().getCurrentAccountName())
// .snippet(String.format("[%f,%f]", lat, lon)
// ));
// melbourne.showInfoWindow();
// LatLng latLng = new LatLng(lat, lon);
// CameraUpdate update = CameraUpdateFactory.newLatLng(latLng);
// mMap.moveCamera(update);
//
// }
// }
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.actionbar_menu_nearbytimelineactivity, menu);
refresh = menu.findItem(R.id.refresh);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if (itemId == R.id.refresh) {
}
return super.onOptionsItemSelected(item);
}
private class GetGoogleLocationInfo extends MyAsyncTask<Void, String, String> {
GeoBean geoBean;
public GetGoogleLocationInfo(GeoBean geoBean) {
this.geoBean = geoBean;
}
@Override
protected String doInBackground(Void... params) {
Geocoder geocoder = new Geocoder(NearbyTimeLineActivity.this, Locale.getDefault());
List<Address> addresses = null;
try {
addresses = geocoder.getFromLocation(geoBean.getLat(), geoBean.getLon(), 1);
} catch (IOException e) {
cancel(true);
}
if (addresses != null && addresses.size() > 0) {
Address address = addresses.get(0);
StringBuilder builder = new StringBuilder();
int size = address.getMaxAddressLineIndex();
for (int i = 0; i < size; i++) {
builder.append(address.getAddressLine(i));
}
return builder.toString();
}
return "";
}
@Override
protected void onPostExecute(String s) {
// if (!TextUtils.isEmpty(s) && melbourne != null) {
// melbourne.showInfoWindow();
// getActionBar().setSubtitle(s);
// }
super.onPostExecute(s);
}
}
private void addLocation() {
LocationManager locationManager = (LocationManager) NearbyTimeLineActivity.this
.getSystemService(Context.LOCATION_SERVICE);
if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
&& !locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
Toast.makeText(NearbyTimeLineActivity.this, getString(R.string.please_open_gps), Toast.LENGTH_SHORT).show();
return;
}
Toast.makeText(NearbyTimeLineActivity.this, getString(R.string.gps_is_searching), Toast.LENGTH_SHORT).show();
if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000, 0, locationListener);
}
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, locationListener);
}
}
private void updateWithNewLocation(Location result) {
GeoBean geoBean = new GeoBean();
lat = result.getLatitude();
lon = result.getLongitude();
setUpMapIfNeeded();
geoBean.setLatitude(lat);
geoBean.setLongitude(lon);
if (Utility.isTaskStopped(locationTask)) {
locationTask = new GetGoogleLocationInfo(geoBean);
locationTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
}
if (Utility.isTaskStopped(fetchWeiboMsg)) {
fetchWeiboMsg = new FetchWeiboMsg();
fetchWeiboMsg.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
}
((LocationManager) NearbyTimeLineActivity.this.getSystemService(Context.LOCATION_SERVICE))
.removeUpdates(locationListener);
}
private final LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
updateWithNewLocation(location);
}
public void onProviderDisabled(String provider) {
}
public void onProviderEnabled(String provider) {
}
public void onStatusChanged(String provider, int status, Bundle extras) {
}
};
private class FetchWeiboMsg extends MyAsyncTask<Void, Void, NearbyStatusListBean> {
@Override
protected void onPreExecute() {
super.onPreExecute();
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ProgressBar pb = (ProgressBar) inflater.inflate(R.layout.editmyprofileactivity_refresh_actionbar_view_layout,
null);
refresh.setActionView(pb);
}
@Override
protected NearbyStatusListBean doInBackground(Void... params) {
try {
return new NearbyTimeLineDao(BeeboApplication.getInstance().getAccessToken(), lat, lon).get();
} catch (WeiboException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(NearbyStatusListBean nearbyStatusListBean) {
super.onPostExecute(nearbyStatusListBean);
if (refresh.getActionView() != null) {
refresh.getActionView().clearAnimation();
refresh.setActionView(null);
}
if (nearbyStatusListBean == null) {
return;
}
List<MessageBean> messageBeanList = nearbyStatusListBean.getItemList();
for (MessageBean msg : messageBeanList) {
GeoBean g = msg.getGeo();
if (g == null) {
continue;
}
// final LatLng MELBOURNE = new LatLng(g.getLat(), g.getLon());
// Marker melbourne = mMap.addMarker(new MarkerOptions()
// .position(MELBOURNE)
// .title(msg.getUser().getScreen_name())
// .snippet(msg.getText())
// );
// melbourne.showInfoWindow();
// bindEvent.put(melbourne, msg);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H
#define GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H
namespace grpc_core {
// Used for tracking file and line where a call is made for debug builds.
// No-op for non-debug builds.
// Callers can use the DEBUG_LOCATION macro in either case.
#ifndef NDEBUG
class DebugLocation {
public:
DebugLocation(const char* file, int line) : file_(file), line_(line) {}
bool Log() const { return true; }
const char* file() const { return file_; }
int line() const { return line_; }
private:
const char* file_;
const int line_;
};
#define DEBUG_LOCATION ::grpc_core::DebugLocation(__FILE__, __LINE__)
#else
class DebugLocation {
public:
bool Log() const { return false; }
const char* file() const { return nullptr; }
int line() const { return -1; }
};
#define DEBUG_LOCATION ::grpc_core::DebugLocation()
#endif
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H */
|
{
"pile_set_name": "Github"
}
|
Vassar College
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
Copyright (C) Marvell International Ltd. and its affiliates
This software file (the "File") is owned and distributed by Marvell
International Ltd. and/or its affiliates ("Marvell") under the following
alternative licensing terms. Once you have made an election to distribute the
File under one of the following license alternatives, please (i) delete this
introductory statement regarding license alternatives, (ii) delete the two
license alternatives that you have not elected to use and (iii) preserve the
Marvell copyright notice above.
********************************************************************************
Marvell Commercial License Option
If you received this File from Marvell and you have entered into a commercial
license agreement (a "Commercial License") with Marvell, the File is licensed
to you under the terms of the applicable Commercial License.
********************************************************************************
Marvell GPL License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File in accordance with the terms and conditions of the General
Public License Version 2, June 1991 (the "GPL License"), a copy of which is
available along with the File in the license.txt file or by writing to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or
on the worldwide web at http://www.gnu.org/licenses/gpl.txt.
THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY
DISCLAIMED. The GPL License provides additional details about this warranty
disclaimer.
********************************************************************************
Marvell BSD License Option
If you received this File from Marvell, you may opt to use, redistribute and/or
modify this File under the following licensing terms.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Marvell nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************/
#ifndef __INCmvSFlashH
#define __INCmvSFlashH
#include "mvTypes.h"
/* MCAROS */
#define MV_SFLASH_PAGE_ALLIGN_MASK(pgSz) (pgSz-1)
#define MV_ARRAY_SIZE(a) ((sizeof(a)) / (sizeof(a[0])))
/* Constants */
#define MV_INVALID_DEVICE_NUMBER 0xFFFFFFFF
/* 10 MHz is the minimum possible SPI frequency when tclk is set 200MHz*/
#define MV_SFLASH_BASIC_SPI_FREQ 10000000
/* enumerations */
typedef enum
{
MV_WP_NONE, /* Unprotect the whole chip */
MV_WP_UPR_1OF128, /* Write protect the upper 1/128 part */
MV_WP_UPR_1OF64, /* Write protect the upper 1/64 part */
MV_WP_UPR_1OF32, /* Write protect the upper 1/32 part */
MV_WP_UPR_1OF16, /* Write protect the upper 1/16 part */
MV_WP_UPR_1OF8, /* Write protect the upper 1/8 part */
MV_WP_UPR_1OF4, /* Write protect the upper 1/4 part */
MV_WP_UPR_1OF2, /* Write protect the upper 1/2 part */
MV_WP_ALL /* Write protect the whole chip */
} MV_SFLASH_WP_REGION;
/* Type Definitions */
typedef struct
{
MV_U8 opcdWREN; /* Write enable opcode */
MV_U8 opcdWRDI; /* Write disable opcode */
MV_U8 opcdRDID; /* Read ID opcode */
MV_U8 opcdRDSR; /* Read Status Register opcode */
MV_U8 opcdWRSR; /* Write Status register opcode */
MV_U8 opcdREAD; /* Read opcode */
MV_U8 opcdFSTRD; /* Fast Read opcode */
MV_U8 opcdPP; /* Page program opcode */
MV_U8 opcdSE; /* Sector erase opcode */
MV_U8 opcdBE; /* Bulk erase opcode */
MV_U8 opcdRES; /* Read electronic signature */
MV_U8 opcdPwrSave; /* Go into power save mode */
MV_U32 sectorSize; /* Size of each sector */
MV_U32 sectorNumber; /* Number of sectors */
MV_U32 pageSize; /* size of each page */
const char * deviceModel; /* string with the device model */
MV_U32 manufacturerId; /* The manufacturer ID */
MV_U32 deviceId; /* Device ID */
MV_U32 spiMaxFreq; /* The MAX frequency that can be used with the device */
MV_U32 spiMaxFastFreq; /* The MAX frequency that can be used with the device for fast reads */
MV_U32 spiFastRdDummyBytes; /* Number of dumy bytes to read before real data when working in fast read mode. */
} MV_SFLASH_DEVICE_PARAMS;
typedef struct
{
MV_U32 baseAddr; /* Flash Base Address used in fast mode */
MV_U8 manufacturerId; /* Manufacturer ID */
MV_U16 deviceId; /* Device ID */
MV_U32 sectorSize; /* Size of each sector - all the same */
MV_U32 sectorNumber; /* Number of sectors */
MV_U32 pageSize; /* Page size - affect allignment */
MV_U32 index; /* index of the device in the sflash table (internal parameter) */
} MV_SFLASH_INFO;
/* Function Prototypes */
/* Init */
MV_STATUS mvSFlashInit (MV_SFLASH_INFO * pFlinfo);
/* erase */
MV_STATUS mvSFlashSectorErase (MV_SFLASH_INFO * pFlinfo, MV_U32 secNumber);
MV_STATUS mvSFlashChipErase (MV_SFLASH_INFO * pFlinfo);
/* Read */
MV_STATUS mvSFlashBlockRd (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
MV_U8* pReadBuff, MV_U32 buffSize);
MV_STATUS mvSFlashFastBlockRd (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
MV_U8* pReadBuff, MV_U32 buffSize);
/* write regardless of the page boundaries and size limit per Page program command */
MV_STATUS mvSFlashBlockWr (MV_SFLASH_INFO * pFlinfo, MV_U32 offset,
MV_U8* pWriteBuff, MV_U32 buffSize);
/* Get IDs */
MV_STATUS mvSFlashIdGet (MV_SFLASH_INFO * pFlinfo, MV_U8* pManId, MV_U16* pDevId);
/* Set and Get the Write Protection region - if the Status register is not locked */
MV_STATUS mvSFlashWpRegionSet (MV_SFLASH_INFO * pFlinfo, MV_SFLASH_WP_REGION wpRegion);
MV_STATUS mvSFlashWpRegionGet (MV_SFLASH_INFO * pFlinfo, MV_SFLASH_WP_REGION * pWpRegion);
/* Lock the status register for writing - W/Vpp pin should be low to take effect */
MV_STATUS mvSFlashStatRegLock (MV_SFLASH_INFO * pFlinfo, MV_BOOL srLock);
/* Get the regions sizes */
MV_U32 mvSFlashSizeGet (MV_SFLASH_INFO * pFlinfo);
/* Cause the falsh device to go into power save mode */
MV_STATUS mvSFlashPowerSaveEnter(MV_SFLASH_INFO * pFlinfo);
MV_STATUS mvSFlashPowerSaveExit (MV_SFLASH_INFO * pFlinfo);
/* Retreive the string with the device manufacturer and model */
const MV_8 * mvSFlashModelGet (MV_SFLASH_INFO * pFlinfo);
#endif /* __INCmvSFlashH */
|
{
"pile_set_name": "Github"
}
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Quotes.sol 1`] = `
import 'someContract.sol';
import "someOtherContract.sol";
contract Foo {
string foo1 = 'foo';
string foo2 = "foo";
string spaces1 = 'the quick brown fox';
string spaces2 = "the quick brown fox";
string singleQuote = "don't do that";
string escapedSingleQuote = 'don\\'t do that';
string doubleQuote = 'Use " for quoting';
string escapedDoubleQuote = "Use \\" for quoting";
string singleQuotes = "don't do that, don't";
string escapedSingleQuotes = 'don\\'t do that, don\\'t';
string doubleQuotes = 'The "quick" brown fox';
string escapeDoubleQuotes = "The \\"quick\\" brown fox";
string hex1 = hex'DeadBeef';
string hex2 = hex"DeadBeef";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import 'someContract.sol';
import 'someOtherContract.sol';
contract Foo {
string foo1 = 'foo';
string foo2 = 'foo';
string spaces1 = 'the quick brown fox';
string spaces2 = 'the quick brown fox';
string singleQuote = "don't do that";
string escapedSingleQuote = "don't do that";
string doubleQuote = 'Use " for quoting';
string escapedDoubleQuote = 'Use " for quoting';
string singleQuotes = "don't do that, don't";
string escapedSingleQuotes = "don't do that, don't";
string doubleQuotes = 'The "quick" brown fox';
string escapeDoubleQuotes = 'The "quick" brown fox';
string hex1 = hex'DeadBeef';
string hex2 = hex'DeadBeef';
}
`;
exports[`Quotes.sol 2`] = `
import 'someContract.sol';
import "someOtherContract.sol";
contract Foo {
string foo1 = 'foo';
string foo2 = "foo";
string spaces1 = 'the quick brown fox';
string spaces2 = "the quick brown fox";
string singleQuote = "don't do that";
string escapedSingleQuote = 'don\\'t do that';
string doubleQuote = 'Use " for quoting';
string escapedDoubleQuote = "Use \\" for quoting";
string singleQuotes = "don't do that, don't";
string escapedSingleQuotes = 'don\\'t do that, don\\'t';
string doubleQuotes = 'The "quick" brown fox';
string escapeDoubleQuotes = "The \\"quick\\" brown fox";
string hex1 = hex'DeadBeef';
string hex2 = hex"DeadBeef";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import "someContract.sol";
import "someOtherContract.sol";
contract Foo {
string foo1 = "foo";
string foo2 = "foo";
string spaces1 = "the quick brown fox";
string spaces2 = "the quick brown fox";
string singleQuote = "don't do that";
string escapedSingleQuote = "don't do that";
string doubleQuote = 'Use " for quoting';
string escapedDoubleQuote = 'Use " for quoting';
string singleQuotes = "don't do that, don't";
string escapedSingleQuotes = "don't do that, don't";
string doubleQuotes = 'The "quick" brown fox';
string escapeDoubleQuotes = 'The "quick" brown fox';
string hex1 = hex"DeadBeef";
string hex2 = hex"DeadBeef";
}
`;
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.client.sniff;
import org.elasticsearch.client.RestClient;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* Sniffer builder. Helps creating a new {@link Sniffer}.
*/
public final class SnifferBuilder {
public static final long DEFAULT_SNIFF_INTERVAL = TimeUnit.MINUTES.toMillis(5);
public static final long DEFAULT_SNIFF_AFTER_FAILURE_DELAY = TimeUnit.MINUTES.toMillis(1);
private final RestClient restClient;
private long sniffIntervalMillis = DEFAULT_SNIFF_INTERVAL;
private long sniffAfterFailureDelayMillis = DEFAULT_SNIFF_AFTER_FAILURE_DELAY;
private NodesSniffer nodesSniffer;
/**
* Creates a new builder instance by providing the {@link RestClient} that will be used to communicate with elasticsearch
*/
SnifferBuilder(RestClient restClient) {
Objects.requireNonNull(restClient, "restClient cannot be null");
this.restClient = restClient;
}
/**
* Sets the interval between consecutive ordinary sniff executions in milliseconds. Will be honoured when
* sniffOnFailure is disabled or when there are no failures between consecutive sniff executions.
* @throws IllegalArgumentException if sniffIntervalMillis is not greater than 0
*/
public SnifferBuilder setSniffIntervalMillis(int sniffIntervalMillis) {
if (sniffIntervalMillis <= 0) {
throw new IllegalArgumentException("sniffIntervalMillis must be greater than 0");
}
this.sniffIntervalMillis = sniffIntervalMillis;
return this;
}
/**
* Sets the delay of a sniff execution scheduled after a failure (in milliseconds)
*/
public SnifferBuilder setSniffAfterFailureDelayMillis(int sniffAfterFailureDelayMillis) {
if (sniffAfterFailureDelayMillis <= 0) {
throw new IllegalArgumentException("sniffAfterFailureDelayMillis must be greater than 0");
}
this.sniffAfterFailureDelayMillis = sniffAfterFailureDelayMillis;
return this;
}
/**
* Sets the {@link NodesSniffer} to be used to read hosts. A default instance of {@link ElasticsearchNodesSniffer}
* is created when not provided. This method can be used to change the configuration of the {@link ElasticsearchNodesSniffer},
* or to provide a different implementation (e.g. in case hosts need to taken from a different source).
*/
public SnifferBuilder setNodesSniffer(NodesSniffer nodesSniffer) {
Objects.requireNonNull(nodesSniffer, "nodesSniffer cannot be null");
this.nodesSniffer = nodesSniffer;
return this;
}
/**
* Creates the {@link Sniffer} based on the provided configuration.
*/
public Sniffer build() {
if (nodesSniffer == null) {
this.nodesSniffer = new ElasticsearchNodesSniffer(restClient);
}
return new Sniffer(restClient, nodesSniffer, sniffIntervalMillis, sniffAfterFailureDelayMillis);
}
}
|
{
"pile_set_name": "Github"
}
|
package com.vladmihalcea.book.hpjp.util;
import com.vladmihalcea.book.hpjp.util.providers.Database;
/**
* AbstractCockroachDBIntegrationTest - Abstract CockroachDB IntegrationTest
*
* @author Vlad Mihalcea
*/
public abstract class AbstractCockroachDBIntegrationTest extends AbstractTest {
@Override
protected Database database() {
return Database.COCKROACHDB;
}
}
|
{
"pile_set_name": "Github"
}
|
import {
blockchainTests,
constants,
expect,
getRandomInteger,
randomAddress,
verifyEventsFromLogs,
} from '@0x/contracts-test-utils';
import { hexUtils, RawRevertError, StringRevertError } from '@0x/utils';
import { TestLibERC20TokenContract, TestLibERC20TokenTargetEvents } from './wrappers';
import { artifacts } from './artifacts';
blockchainTests('LibERC20Token', env => {
let testContract: TestLibERC20TokenContract;
const REVERT_STRING = 'WHOOPSIE';
const ENCODED_REVERT = new StringRevertError(REVERT_STRING).encode();
const ENCODED_TRUE = hexUtils.leftPad(1);
const ENCODED_FALSE = hexUtils.leftPad(0);
const ENCODED_TWO = hexUtils.leftPad(2);
const ENCODED_SHORT_TRUE = hexUtils.leftPad(2, 31);
const ENCODED_LONG_TRUE = hexUtils.leftPad(2, 33);
before(async () => {
testContract = await TestLibERC20TokenContract.deployFrom0xArtifactAsync(
artifacts.TestLibERC20Token,
env.provider,
env.txDefaults,
artifacts,
);
});
describe('approve()', () => {
it('calls the target with the correct arguments', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const { logs } = await testContract
.testApprove(false, ENCODED_REVERT, ENCODED_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
expect(logs).to.be.length(1);
verifyEventsFromLogs(logs, [{ spender, allowance }], TestLibERC20TokenTargetEvents.ApproveCalled);
});
it('succeeds if the target returns true', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
await testContract
.testApprove(false, ENCODED_REVERT, ENCODED_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
});
it('succeeds if the target returns nothing', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
await testContract
.testApprove(false, ENCODED_REVERT, constants.NULL_BYTES, spender, allowance)
.awaitTransactionSuccessAsync();
});
it('fails if the target returns false', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(false, ENCODED_REVERT, ENCODED_FALSE, spender, allowance)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_FALSE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns nonzero and not true', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(false, ENCODED_REVERT, ENCODED_TWO, spender, allowance)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_TWO);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns less than 32 bytes', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(false, ENCODED_REVERT, ENCODED_SHORT_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_SHORT_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns greater than 32 bytes', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(false, ENCODED_REVERT, ENCODED_LONG_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_LONG_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target reverts', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(true, ENCODED_REVERT, ENCODED_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
return expect(tx).to.revertWith(REVERT_STRING);
});
it('fails if the target reverts with no data', async () => {
const spender = randomAddress();
const allowance = getRandomInteger(0, 100e18);
const tx = testContract
.testApprove(true, constants.NULL_BYTES, ENCODED_TRUE, spender, allowance)
.awaitTransactionSuccessAsync();
return expect(tx).to.be.rejectedWith('revert');
});
});
describe('transfer()', () => {
it('calls the target with the correct arguments', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const { logs } = await testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_TRUE, to, amount)
.awaitTransactionSuccessAsync();
expect(logs).to.be.length(1);
verifyEventsFromLogs(logs, [{ to, amount }], TestLibERC20TokenTargetEvents.TransferCalled);
});
it('succeeds if the target returns true', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
await testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_TRUE, to, amount)
.awaitTransactionSuccessAsync();
});
it('succeeds if the target returns nothing', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
await testContract
.testTransfer(false, ENCODED_REVERT, constants.NULL_BYTES, to, amount)
.awaitTransactionSuccessAsync();
});
it('fails if the target returns false', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_FALSE, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_FALSE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns nonzero and not true', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_TWO, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_TWO);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns less than 32 bytes', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_SHORT_TRUE, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_SHORT_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns greater than 32 bytes', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(false, ENCODED_REVERT, ENCODED_LONG_TRUE, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_LONG_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target reverts', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(true, ENCODED_REVERT, ENCODED_TRUE, to, amount)
.awaitTransactionSuccessAsync();
return expect(tx).to.revertWith(REVERT_STRING);
});
it('fails if the target reverts with no data', async () => {
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransfer(true, constants.NULL_BYTES, ENCODED_TRUE, to, amount)
.awaitTransactionSuccessAsync();
return expect(tx).to.be.rejectedWith('revert');
});
});
describe('transferFrom()', () => {
it('calls the target with the correct arguments', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const { logs } = await testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
expect(logs).to.be.length(1);
verifyEventsFromLogs(logs, [{ from: owner, to, amount }], TestLibERC20TokenTargetEvents.TransferFromCalled);
});
it('succeeds if the target returns true', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
await testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
});
it('succeeds if the target returns nothing', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
await testContract
.testTransferFrom(false, ENCODED_REVERT, constants.NULL_BYTES, owner, to, amount)
.awaitTransactionSuccessAsync();
});
it('fails if the target returns false', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_FALSE, owner, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_FALSE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns nonzero and not true', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_TWO, owner, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_TWO);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns less than 32 bytes', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_SHORT_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_SHORT_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target returns greater than 32 bytes', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(false, ENCODED_REVERT, ENCODED_LONG_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
const expectedError = new RawRevertError(ENCODED_LONG_TRUE);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the target reverts', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(true, ENCODED_REVERT, ENCODED_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
return expect(tx).to.revertWith(REVERT_STRING);
});
it('fails if the target reverts with no data', async () => {
const owner = randomAddress();
const to = randomAddress();
const amount = getRandomInteger(0, 100e18);
const tx = testContract
.testTransferFrom(true, constants.NULL_BYTES, ENCODED_TRUE, owner, to, amount)
.awaitTransactionSuccessAsync();
return expect(tx).to.be.rejectedWith('revert');
});
});
describe('decimals()', () => {
const DEFAULT_DECIMALS = 18;
const ENCODED_ZERO = hexUtils.leftPad(0);
const ENCODED_SHORT_ZERO = hexUtils.leftPad(0, 31);
const ENCODED_LONG_ZERO = hexUtils.leftPad(0, 33);
const randomDecimals = () => Math.floor(Math.random() * 256) + 1;
it('returns the number of decimals defined by the token', async () => {
const decimals = randomDecimals();
const encodedDecimals = hexUtils.leftPad(decimals);
const result = await testContract.testDecimals(false, ENCODED_REVERT, encodedDecimals).callAsync();
return expect(result).to.bignumber.eq(decimals);
});
it('returns 0 if the token returns 0', async () => {
const result = await testContract.testDecimals(false, ENCODED_REVERT, ENCODED_ZERO).callAsync();
return expect(result).to.bignumber.eq(0);
});
it('returns 18 if the token returns less than 32 bytes', async () => {
const result = await testContract.testDecimals(false, ENCODED_REVERT, ENCODED_SHORT_ZERO).callAsync();
return expect(result).to.bignumber.eq(DEFAULT_DECIMALS);
});
it('returns 18 if the token returns greater than 32 bytes', async () => {
const result = await testContract.testDecimals(false, ENCODED_REVERT, ENCODED_LONG_ZERO).callAsync();
return expect(result).to.bignumber.eq(DEFAULT_DECIMALS);
});
it('returns 18 if the token reverts', async () => {
const result = await testContract.testDecimals(true, ENCODED_REVERT, ENCODED_ZERO).callAsync();
return expect(result).to.bignumber.eq(DEFAULT_DECIMALS);
});
});
});
|
{
"pile_set_name": "Github"
}
|
/*============================================================================
This C header template is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3e, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions, and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
=============================================================================*/
// Edit lines marked with `==>'. See "SoftFloat-source.html".
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
==> #define LITTLEENDIAN 1
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
==> #define INLINE inline
/*----------------------------------------------------------------------------
*----------------------------------------------------------------------------*/
==> #define THREAD_LOCAL _Thread_local
|
{
"pile_set_name": "Github"
}
|
// Copyright Jim Bosch 2010-2012.
// Copyright Stefan Seefeld 2016.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef boost_python_numpy_matrix_hpp_
#define boost_python_numpy_matrix_hpp_
/**
* @brief Object manager for numpy.matrix.
*/
#include <boost/python.hpp>
#include <boost/python/numpy/numpy_object_mgr_traits.hpp>
#include <boost/python/numpy/ndarray.hpp>
#include <boost/python/numpy/config.hpp>
namespace boost { namespace python { namespace numpy {
/**
* @brief A boost.python "object manager" (subclass of object) for numpy.matrix.
*
* @internal numpy.matrix is defined in Python, so object_manager_traits<matrix>::get_pytype()
* is implemented by importing numpy and getting the "matrix" attribute of the module.
* We then just hope that doesn't get destroyed while we need it, because if we put
* a dynamic python object in a static-allocated boost::python::object or handle<>,
* bad things happen when Python shuts down. I think this solution is safe, but I'd
* love to get that confirmed.
*/
class BOOST_NUMPY_DECL matrix : public ndarray
{
static object construct(object_cref obj, dtype const & dt, bool copy);
static object construct(object_cref obj, bool copy);
public:
BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(matrix, ndarray);
/// @brief Equivalent to "numpy.matrix(obj,dt,copy)" in Python.
explicit matrix(object const & obj, dtype const & dt, bool copy=true)
: ndarray(extract<ndarray>(construct(obj, dt, copy))) {}
/// @brief Equivalent to "numpy.matrix(obj,copy=copy)" in Python.
explicit matrix(object const & obj, bool copy=true)
: ndarray(extract<ndarray>(construct(obj, copy))) {}
/// \brief Return a view of the matrix with the given dtype.
matrix view(dtype const & dt) const;
/// \brief Copy the scalar (deep for all non-object fields).
matrix copy() const;
/// \brief Transpose the matrix.
matrix transpose() const;
};
/**
* @brief CallPolicies that causes a function that returns a numpy.ndarray to
* return a numpy.matrix instead.
*/
template <typename Base = default_call_policies>
struct as_matrix : Base
{
static PyObject * postcall(PyObject *, PyObject * result)
{
object a = object(handle<>(result));
numpy::matrix m(a, false);
Py_INCREF(m.ptr());
return m.ptr();
}
};
} // namespace boost::python::numpy
namespace converter
{
NUMPY_OBJECT_MANAGER_TRAITS(numpy::matrix);
}}} // namespace boost::python::converter
#endif
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2016 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., or visit: http://www.gnu.org/.
##
## Author(s): Stoq Team <stoq-devel@async.com.br>
##
from stoqlib.gui.dialogs.pindialog import PinDialog
from stoqlib.gui.test.uitestutils import GUITest
class TestPinDialog(GUITest):
def test_create(self):
with self.sysparam(USER_HASH='8e0c75ef763144eb9c0f39a8efa01452'):
dialog = PinDialog(self.store)
self.check_editor(dialog, 'dialog-pin-create')
|
{
"pile_set_name": "Github"
}
|
Request and Session Data
========================
GET and POST Data
-----------------
Many ruby frameworks provide helpers for accessing GET and POST data via some kind of generic accessor, such as a `params` method, but Rack already provides this functionality out of the box, and more.
```ruby
post '/' do
request.GET['view'] # Key/value pairs submitted in the query string of the URL.
request.POST['username'] # Key/value pairs submitted in the payload of a POST request.
request.params[:username] # A merged hash of GET and POST data.
request[:username] # Shortcut to merged hash of GET and POST data.
end
```
One of the few opinions Scorched does maintain (albeit without imposition), is that GET and POST data should be accessed by their respective methods. GET and POST data are semantically different, so if you're not concerned about where the data came from, it may be a good sign you're doing something wrong.
Uploaded files are also accessible as ordinary fields, except the associated value is a hash of properties, instead of a string. An example of an application that accepts file uploads is included in the "examples" directory of the Scorched git repository.
Cookies
-------
While Rack provides a relatively simple means of setting, retrieving and deleting cookies, Scorched aggregates those three actions into a single method, `cookie`, for the sake of brevity and simplicity.
```ruby
def '/' do
cookie :previous_page # Retrieves the cookie.
cookie :previous_page, '/search' # Sets the cookie
cookie :previous_page, nil # Deletes the cookies
end
```
For each of the above lines, the corresponding Rack methods are called, e.g. `Rack::Requeste#cookies`, `Rack::Response#set_cookie` and `Rack::Response#delete_cookie`. The values for setting and deleting a cookie can also be a hash, as per the documentation for `set_cookie` and `delete_cookie`. Deletion is still possible when a Hash is provided, as long as the `value` property is nil.
```ruby
def '/' do
cookie :view, path: '/account', value: 'datasheet' # Sets the cookie
cookie :view, path: '/account', value: nil # Deletes the cookie
end
```
Sessions
--------
Sessions are completely handled by Rack. For convenience, Scorched provides a `session` helper. This merely acts as an alias to `request['rack.session']`. It will raise an exception if called without any Rack session middleware loaded, such as `Rack::Session::Cookie`.
```ruby
class App < Scorched::Controller
middleware << proc {
use Rack::Session::Cookie, secret: 'blah'
}
get '/' do
session['logged_in'] ? 'You're currently logged in.' : 'Please login.'
end
end
```
###Flash Session Data
A common requirement for websites, especially web applications, is to provide a message on the next page load corresponding to an action that a user has just performed. A common framework idiom that Scorched happily implements are flash session variables - special session data that lives for only a single page load.
This isn't as trivial to implement as it may sound at a glance, which is why Scorched provides this helper out-of-the-box.
```ruby
get '/' do
"<span class="success">#{flash[:success]}</span>" if flash[:success]
end
post '/login' do
flash[:success] = 'Logged in successfully.'
end
```
The flash helper allows multiple sets of flash session data to be stored under different names. Because of how flash sessions are implemented, they're only deleted on the next page load if that particular flash data set is accessed. These properties of flash sessions can satisfy some interesting use cases. Here's a very uninteresting example:
```ruby
class App < Scorched::Controller
get '/' do
"<span class="success">#{flash[:success]}</span>" if flash[:success]
end
post '/login' do
flash[:success] = 'Logged in successfully.'
if user.membership_type == 'vip' && user.membership_expiry < 5
flash(:vip)[:warning] = 'Your VIP membership is about to expire, please renew it.'
end
end
controller '/vip' do
get '/' do
"<span class="warning">#{flash(:vip)[:warning]}</span>" if flash(:vip)[:warning]
end
end
end
```
In the rather contrived example above, when a VIP user logs in, a message is generated and stored as a flash session variable in the `:vip` flash data set. Because the `:vip` flash data set isn't accessed on the main page, it lives on until it's finally re-accessed on the VIP page.
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/python
# Copyright (C) Vladimir Prus 2010.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Test that build failure results in non-zero exit status
import BoostBuild
# Create a temporary working directory.
t = BoostBuild.Tester()
# Create the needed files.
t.write("jamroot.jam", """
exe hello : hello.cpp ;
""")
t.write("hello.cpp", """
int main() {
""")
t.run_build_system(status=1)
t.cleanup()
|
{
"pile_set_name": "Github"
}
|
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x00020000, LENGTH = 0x20000
RAM (rwx) : ORIGIN = 0x20002400, LENGTH = 0x1C00
}
INCLUDE "gcc_nrf51_common.ld"
|
{
"pile_set_name": "Github"
}
|
{
}
|
{
"pile_set_name": "Github"
}
|
local mType = Game.createMonsterType("Spider Queen")
local monster = {}
monster.description = "a spider queen"
monster.experience = 120
monster.outfit = {
lookType = 219,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0,
lookMount = 0
}
monster.health = 10000
monster.maxHealth = 10000
monster.race = "venom"
monster.corpse = 6060
monster.speed = 280
monster.summonCost = 0
monster.maxSummons = 0
monster.changeTarget = {
interval = 5000,
chance = 8
}
monster.strategiesTarget = {
nearest = 70,
health = 10,
damage = 10,
random = 10,
}
monster.flags = {
summonable = false,
attackable = true,
hostile = true,
convinceable = false,
pushable = false,
rewardBoss = true,
illusionable = true,
canPushItems = true,
canPushCreatures = false,
staticAttackChance = 90,
targetDistance = 1,
runHealth = 0,
healthHidden = false,
canWalkOnEnergy = false,
canWalkOnFire = false,
canWalkOnPoison = false
}
monster.light = {
level = 0,
color = 0
}
monster.voices = {
interval = 5000,
chance = 10,
}
monster.loot = {
}
monster.attacks = {
{name ="combat", type = COMBAT_PHYSICALDAMAGE, interval = 2000, chance = 100, skill = 60, attack = 40, effect = CONST_ME_DRAWBLOOD, condition = {type = CONDITION_POISON, startDamage = 80, interval = 4000}}
}
monster.defenses = {
defense = 5,
armor = 10
}
monster.elements = {
{type = COMBAT_PHYSICALDAMAGE, percent = 100},
{type = COMBAT_ENERGYDAMAGE, percent = 100},
{type = COMBAT_EARTHDAMAGE, percent = 100},
{type = COMBAT_FIREDAMAGE, percent = 100},
{type = COMBAT_LIFEDRAIN, percent = 0},
{type = COMBAT_MANADRAIN, percent = 0},
{type = COMBAT_DROWNDAMAGE, percent = 100},
{type = COMBAT_ICEDAMAGE, percent = 100},
{type = COMBAT_HOLYDAMAGE , percent = 100},
{type = COMBAT_DEATHDAMAGE , percent = 100}
}
monster.immunities = {
{type = "paralyze", condition = false},
{type = "outfit", condition = false},
{type = "invisible", condition = true},
{type = "bleed", condition = false}
}
mType.onThink = function(monster, interval)
end
mType.onAppear = function(monster, creature)
if monster:getType():isRewardBoss() then
monster:setReward(true)
end
end
mType.onDisappear = function(monster, creature)
end
mType.onMove = function(monster, creature, fromPosition, toPosition)
end
mType.onSay = function(monster, creature, type, message)
end
mType:register(monster)
|
{
"pile_set_name": "Github"
}
|
from .myAlg import *
|
{
"pile_set_name": "Github"
}
|
package robomaker
import (
"github.com/awslabs/goformation/v4/cloudformation/policies"
)
// SimulationApplication_SimulationSoftwareSuite AWS CloudFormation Resource (AWS::RoboMaker::SimulationApplication.SimulationSoftwareSuite)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-robomaker-simulationapplication-simulationsoftwaresuite.html
type SimulationApplication_SimulationSoftwareSuite struct {
// Name AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-robomaker-simulationapplication-simulationsoftwaresuite.html#cfn-robomaker-simulationapplication-simulationsoftwaresuite-name
Name string `json:"Name,omitempty"`
// Version AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-robomaker-simulationapplication-simulationsoftwaresuite.html#cfn-robomaker-simulationapplication-simulationsoftwaresuite-version
Version string `json:"Version,omitempty"`
// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`
// AWSCloudFormationUpdateReplacePolicy represents a CloudFormation UpdateReplacePolicy
AWSCloudFormationUpdateReplacePolicy policies.UpdateReplacePolicy `json:"-"`
// AWSCloudFormationDependsOn stores the logical ID of the resources to be created before this resource
AWSCloudFormationDependsOn []string `json:"-"`
// AWSCloudFormationMetadata stores structured data associated with this resource
AWSCloudFormationMetadata map[string]interface{} `json:"-"`
// AWSCloudFormationCondition stores the logical ID of the condition that must be satisfied for this resource to be created
AWSCloudFormationCondition string `json:"-"`
}
// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *SimulationApplication_SimulationSoftwareSuite) AWSCloudFormationType() string {
return "AWS::RoboMaker::SimulationApplication.SimulationSoftwareSuite"
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
template<typename T> using A = int; // expected-note 2{{previous}}
template<typename T> using A = char; // expected-error {{type alias template redefinition with different types ('char' vs 'int')}}
template<typename T1, typename T2> using A = T1; // expected-error {{too many template parameters in template redeclaration}}
template<typename T1, typename T2> using B = T1; // expected-note {{previous}}
template<typename T2, typename T1> using B = T1; // expected-error {{type alias template redefinition with different types}}
template<typename> struct S;
template<template<typename> class F> using FInt = F<int>;
template<typename X> using SXRInt = FInt<S<X>::template R>;
template<typename X> using SXRInt = typename S<X>::template R<int>; // ok, redeclaration.
template<template<typename> class> struct TT;
namespace FilterLookup {
TT<A> f(); // expected-note {{previous declaration is here}}
template<typename> using A = int;
TT<A> f(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
}
|
{
"pile_set_name": "Github"
}
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2013-2015, Image Engine Design Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// * Neither the name of Image Engine Design nor the names of any
// other contributors to this software may be used to endorse or
// promote products derived from this software without specific prior
// written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//////////////////////////////////////////////////////////////////////////
#include "IECoreHoudini/OBJ_SceneCacheTransform.h"
#include "IECoreHoudini/OBJ_SceneCacheGeometry.h"
#include "OP/OP_Layout.h"
#include "UT/UT_Version.h"
#if UT_MAJOR_VERSION_INT >= 16
#include "OP/OP_SubnetIndirectInput.h"
#endif
#include "PRM/PRM_ChoiceList.h"
#include "UT/UT_Interrupt.h"
#include "UT/UT_ValArray.h"
using namespace IECore;
using namespace IECoreScene;
using namespace IECoreHoudini;
const char *OBJ_SceneCacheTransform::typeName = "ieSceneCacheTransform";
int *OBJ_SceneCacheTransform::g_indirection = 0;
OBJ_SceneCacheTransform::OBJ_SceneCacheTransform( OP_Network *net, const char *name, OP_Operator *op ) : OBJ_SceneCacheNode<OBJ_SubNet>( net, name, op )
{
if ( !g_indirection )
{
g_indirection = OP_Parameters::allocIndirect( this->getParmList()->getEntries() );
}
}
OBJ_SceneCacheTransform::~OBJ_SceneCacheTransform()
{
}
OP_Node *OBJ_SceneCacheTransform::create( OP_Network *net, const char *name, OP_Operator *op )
{
return new OBJ_SceneCacheTransform( net, name, op );
}
PRM_Name OBJ_SceneCacheTransform::pHierarchy( "hierarchy", "Hierarchy" );
PRM_Name OBJ_SceneCacheTransform::pDepth( "depth", "Depth" );
PRM_Default OBJ_SceneCacheTransform::hierarchyDefault( SubNetworks );
PRM_Default OBJ_SceneCacheTransform::depthDefault( AllDescendants );
static PRM_Name hierarchyNames[] = {
PRM_Name( "0", "SubNetworks" ),
PRM_Name( "1", "Parenting" ),
PRM_Name( "2", "Flat Geometry" ),
PRM_Name( 0 ) // sentinal
};
static PRM_Name depthNames[] = {
PRM_Name( "0", "All Descendants" ),
PRM_Name( "1", "Children" ),
PRM_Name( 0 ) // sentinal
};
PRM_ChoiceList OBJ_SceneCacheTransform::hierarchyList( PRM_CHOICELIST_SINGLE, &hierarchyNames[0] );
PRM_ChoiceList OBJ_SceneCacheTransform::depthList( PRM_CHOICELIST_SINGLE, &depthNames[0] );
OP_TemplatePair *OBJ_SceneCacheTransform::buildParameters()
{
static OP_TemplatePair *templatePair = 0;
if ( !templatePair )
{
templatePair = new OP_TemplatePair( OBJ_SceneCacheNode<OBJ_SubNet>::buildParameters( buildExtraParameters() ) );
}
return templatePair;
}
OP_TemplatePair *OBJ_SceneCacheTransform::buildExtraParameters()
{
static PRM_Template *thisTemplate = 0;
if ( !thisTemplate )
{
thisTemplate = new PRM_Template[3];
thisTemplate[0] = PRM_Template(
PRM_INT, 1, &pHierarchy, &hierarchyDefault, &hierarchyList, 0, 0, 0, 0,
"Choose the node network style used when expanding. Parenting will create a graph using "
"node connections, SubNetworks will create a deep hierarchy, and Flat Geometry will "
"create a single OBJ and SOP."
);
thisTemplate[1] = PRM_Template(
PRM_INT, 1, &pDepth, &depthDefault, &depthList, 0, 0, 0, 0,
"Choose how deep to expand. All Descendants will expand everything below the specified root "
"path and Children will only expand the immediate children of the root path, which may "
"or may not contain geometry."
);
}
static OP_TemplatePair *templatePair = 0;
if ( !templatePair )
{
templatePair = new OP_TemplatePair( thisTemplate );
}
return templatePair;
}
void OBJ_SceneCacheTransform::expandHierarchy( const SceneInterface *scene )
{
if ( !scene )
{
return;
}
Parameters params;
params.geometryType = getGeometryType();
params.depth = (Depth)evalInt( pDepth.getToken(), 0, 0 );
params.hierarchy = (Hierarchy)evalInt( pHierarchy.getToken(), 0, 0 );
params.tagGroups = getTagGroups();
params.visibilityFilter = getVisibilityFilter();
getAttributeFilter( params.attributeFilter );
getAttributeCopy( params.attributeCopy );
getShapeFilter( params.shapeFilter );
getTagFilter( params.tagFilterStr );
getTagFilter( params.tagFilter );
getFullPathName( params.fullPathName );
if ( params.hierarchy == FlatGeometry )
{
// Collapse first, in case the immediate object was already created on during parent expansion
collapseHierarchy();
doExpandObject( scene, this, params );
setInt( pExpanded.getToken(), 0, 0, 1 );
return;
}
OBJ_Node *rootNode = this;
if ( scene->hasObject() )
{
Parameters rootParams( params );
rootParams.hierarchy = SubNetworks;
rootParams.depth = Children;
OBJ_Node *objNode = doExpandObject( scene, this, rootParams );
if ( params.hierarchy == Parenting )
{
rootNode = objNode;
}
}
else if ( params.hierarchy == Parenting )
{
/// \todo: this is terrible. can we use the subnet input instead?
rootNode = reinterpret_cast<OBJ_Node*>( createNode( "geo", "TMP" ) );
}
if ( params.hierarchy == Parenting )
{
rootNode->setIndirectInput( 0, this->getParentInput( 0 ) );
}
UT_Interrupt *progress = UTgetInterrupt();
if ( !progress->opStart( ( "Expand Hierarchy for " + getPath() ).c_str() ) )
{
return;
}
doExpandChildren( scene, rootNode, params );
setInt( pExpanded.getToken(), 0, 0, 1 );
if ( params.hierarchy == Parenting && !scene->hasObject() )
{
destroyNode( rootNode );
}
progress->opEnd();
}
OBJ_Node *OBJ_SceneCacheTransform::doExpandObject( const SceneInterface *scene, OP_Network *parent, const Parameters ¶ms )
{
const char *name = ( params.hierarchy == Parenting ) ? scene->name().c_str() : "geo";
OP_Node *opNode = parent->createNode( OBJ_SceneCacheGeometry::typeName, name );
OBJ_SceneCacheGeometry *geo = reinterpret_cast<OBJ_SceneCacheGeometry*>( opNode );
geo->referenceParent( pFile.getToken() );
if ( params.hierarchy == Parenting )
{
geo->setPath( scene );
}
else
{
geo->referenceParent( pRoot.getToken() );
geo->setIndirectInput( 0, parent->getParentInput( 0 ) );
}
Space space = ( params.depth == AllDescendants ) ? Path : ( params.hierarchy == Parenting ) ? Local : Object;
geo->setSpace( (OBJ_SceneCacheGeometry::Space)space );
geo->setGeometryType( (OBJ_SceneCacheGeometry::GeometryType)params.geometryType );
geo->setAttributeFilter( params.attributeFilter );
geo->setAttributeCopy( params.attributeCopy );
geo->setShapeFilter( params.shapeFilter );
geo->setFullPathName( params.fullPathName );
bool visible = tagged( scene, params.tagFilter );
if ( visible )
{
geo->setTagFilter( params.tagFilterStr );
geo->setTagGroups( params.tagGroups );
}
geo->setDisplay( visible );
geo->expandHierarchy( scene );
return geo;
}
OBJ_Node *OBJ_SceneCacheTransform::doExpandChild( const SceneInterface *scene, OP_Network *parent, const Parameters ¶ms )
{
OP_Node *opNode = parent->createNode( OBJ_SceneCacheTransform::typeName, scene->name().c_str() );
OBJ_SceneCacheTransform *xform = reinterpret_cast<OBJ_SceneCacheTransform*>( opNode );
xform->referenceParent( pFile.getToken() );
xform->setPath( scene );
xform->setSpace( Local );
xform->setGeometryType( (OBJ_SceneCacheTransform::GeometryType)params.geometryType );
xform->setAttributeFilter( params.attributeFilter );
xform->setAttributeCopy( params.attributeCopy );
xform->setShapeFilter( params.shapeFilter );
xform->setFullPathName( params.fullPathName );
xform->setInt( pHierarchy.getToken(), 0, 0, params.hierarchy );
xform->setInt( pDepth.getToken(), 0, 0, params.depth );
SceneInterface::NameList children;
scene->childNames( children );
if ( children.empty() && !scene->hasObject() )
{
xform->setInt( pExpanded.getToken(), 0, 0, 1 );
}
if ( tagged( scene, params.tagFilter ) )
{
xform->setTagFilter( params.tagFilterStr );
}
else
{
xform->setDisplay( false );
}
if ( params.hierarchy == SubNetworks )
{
xform->setIndirectInput( 0, parent->getParentInput( 0 ) );
}
return xform;
}
void OBJ_SceneCacheTransform::doExpandChildren( const SceneInterface *scene, OP_Network *parent, const Parameters ¶ms )
{
UT_Interrupt *progress = UTgetInterrupt();
progress->setLongOpText( ( "Expanding " + scene->name().string() ).c_str() );
if ( progress->opInterrupt() )
{
return;
}
OP_Network *inputNode = parent;
if ( params.hierarchy == Parenting )
{
parent = parent->getParent();
}
SceneInterface::NameList children;
scene->childNames( children );
for ( SceneInterface::NameList::const_iterator it=children.begin(); it != children.end(); ++it )
{
ConstSceneInterfacePtr child = scene->child( *it );
OBJ_Node *childNode = 0;
if ( params.hierarchy == SubNetworks )
{
childNode = doExpandChild( child.get(), parent, params );
if ( params.depth == AllDescendants && child->hasObject() && tagged( child.get(), params.tagFilter ) )
{
Parameters childParams( params );
childParams.depth = Children;
doExpandObject( child.get(), childNode, childParams );
}
}
else if ( params.hierarchy == Parenting )
{
if ( child->hasObject() )
{
Parameters childParams( params );
childParams.depth = Children;
childNode = doExpandObject( child.get(), parent, childParams );
}
else
{
childNode = doExpandChild( child.get(), parent, params );
}
childNode->setInput( 0, inputNode );
}
if ( params.depth == AllDescendants )
{
if ( params.hierarchy == SubNetworks && !tagged( child.get(), params.tagFilter ) )
{
// we don't expand non-tagged children for SubNetwork mode, but we
// do for Parenting mode, because otherwise the hierarchy would be
// stuck in an un-expandable state.
continue;
}
doExpandChildren( child.get(), childNode, params );
childNode->setInt( pExpanded.getToken(), 0, 0, 1 );
}
}
OP_Layout layout( parent );
#if UT_MAJOR_VERSION_INT >= 16
OP_SubnetIndirectInput *parentInput = parent->getParentInput( 0 );
layout.addLayoutItem( parentInput->getInputItem() );
for ( int i=0; i < parent->getNchildren(); ++i )
{
layout.addLayoutItem( parent->getChild( i ) );
}
#else
layout.addLayoutOp( parent->getParentInput( 0 ) );
for ( int i=0; i < parent->getNchildren(); ++i )
{
layout.addLayoutOp( parent->getChild( i ) );
}
#endif
layout.layoutOps( OP_LAYOUT_TOP_TO_BOT, parent, parent->getParentInput( 0 ) );
}
void OBJ_SceneCacheTransform::pushToHierarchy()
{
UT_String attribFilter, attribCopy, shapeFilter, fullPathName;
bool tagGroups = getTagGroups();
bool visibilityFilter = getVisibilityFilter();
getAttributeFilter( attribFilter );
getAttributeCopy( attribCopy );
getShapeFilter( shapeFilter );
getFullPathName( fullPathName );
GeometryType geometryType = getGeometryType();
UT_String tagFilterStr;
UT_StringMMPattern tagFilter;
getTagFilter( tagFilterStr );
tagFilter.compile( tagFilterStr );
UT_ValArray<OP_Node*> children;
int numSceneNodes = getOpsByName( OBJ_SceneCacheTransform::typeName, children );
for ( int i=0; i < numSceneNodes; ++i )
{
OBJ_SceneCacheTransform *xform = reinterpret_cast<OBJ_SceneCacheTransform*>( children( i ) );
xform->setAttributeFilter( attribFilter );
xform->setAttributeCopy( attribCopy );
xform->setShapeFilter( shapeFilter );
xform->setFullPathName( fullPathName );
xform->setGeometryType( geometryType );
std::string file;
bool visible = false;
if ( IECoreScene::ConstSceneInterfacePtr scene = xform->scene() )
{
if ( tagged( scene.get(), tagFilter ) )
{
visible = true;
xform->setTagFilter( tagFilterStr );
xform->setTagGroups( tagGroups );
xform->setVisibilityFilter( visibilityFilter );
if ( visibilityFilter )
{
xform->setVisibilityExpression();
}
else
{
xform->clearVisibilityExpression();
}
}
}
xform->setRender( visible );
xform->setDisplay( visible );
xform->pushToHierarchy();
}
children.clear();
numSceneNodes = getOpsByName( OBJ_SceneCacheGeometry::typeName, children );
for ( int i=0; i < numSceneNodes; ++i )
{
OBJ_SceneCacheGeometry *geo = reinterpret_cast<OBJ_SceneCacheGeometry*>( children( i ) );
geo->setAttributeFilter( attribFilter );
geo->setAttributeCopy( attribCopy );
geo->setShapeFilter( shapeFilter );
geo->setFullPathName( fullPathName );
geo->setGeometryType( (OBJ_SceneCacheGeometry::GeometryType)geometryType );
std::string file;
bool visible = false;
if ( IECoreScene::ConstSceneInterfacePtr scene = geo->scene() )
{
visible = tagged( scene.get(), tagFilter );
if ( visible )
{
geo->setTagFilter( tagFilterStr );
geo->setTagGroups( tagGroups );
geo->setVisibilityFilter( visibilityFilter );
if ( visibilityFilter )
{
geo->setVisibilityExpression();
}
else
{
geo->clearVisibilityExpression();
}
}
}
geo->setRender( visible );
geo->setDisplay( visible );
geo->pushToHierarchy();
}
}
OBJ_SceneCacheTransform::Parameters::Parameters()
{
}
OBJ_SceneCacheTransform::Parameters::Parameters( const Parameters &other )
{
geometryType = other.geometryType;
hierarchy = other.hierarchy;
depth = other.depth;
attributeFilter = other.attributeFilter;
attributeCopy = other.attributeCopy;
shapeFilter = other.shapeFilter;
tagFilterStr = other.tagFilterStr;
tagFilter.compile( tagFilterStr );
tagGroups = other.tagGroups;
visibilityFilter = other.visibilityFilter;
fullPathName = other.fullPathName;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Registration for LiveScene extra attributes
//////////////////////////////////////////////////////////////////////////////////////////
OBJ_SceneCacheTransform::LiveSceneAddOn OBJ_SceneCacheTransform::g_liveSceneAddOn;
OBJ_SceneCacheTransform::LiveSceneAddOn::LiveSceneAddOn()
{
LiveScene::registerCustomAttributes( OBJ_SceneCacheTransform::attributeNames, OBJ_SceneCacheTransform::readAttribute, true );
LiveScene::registerCustomTags( OBJ_SceneCacheTransform::hasTag, OBJ_SceneCacheTransform::readTags, true );
}
void OBJ_SceneCacheTransform::attributeNames( const OP_Node *node, SceneInterface::NameList &attrs )
{
// make sure its a SceneCacheNode
if ( !node->hasParm( pFile.getToken() ) || !node->hasParm( pRoot.getToken() ) )
{
return;
}
const SceneCacheNode<OP_Node> *sceneNode = reinterpret_cast< const SceneCacheNode<OP_Node>* >( node );
/// \todo: do we need to ensure the file exists first?
ConstSceneInterfacePtr scene = OBJ_SceneCacheTransform::scene( sceneNode->getFile(), sceneNode->getPath() );
if ( !scene )
{
return;
}
scene->attributeNames( attrs );
const char *expanded = pExpanded.getToken();
if ( node->hasParm( expanded ) && !node->evalInt( expanded, 0, 0 ) )
{
attrs.push_back( LinkedScene::linkAttribute );
}
}
IECore::ConstObjectPtr OBJ_SceneCacheTransform::readAttribute( const OP_Node *node, const SceneInterface::Name &name, double time )
{
// make sure its a SceneCacheNode
if ( !node->hasParm( pFile.getToken() ) || !node->hasParm( pRoot.getToken() ) )
{
return 0;
}
const SceneCacheNode<OP_Node> *sceneNode = reinterpret_cast< const SceneCacheNode<OP_Node>* >( node );
/// \todo: do we need to ensure the file exists first?
ConstSceneInterfacePtr scene = OBJ_SceneCacheTransform::scene( sceneNode->getFile(), sceneNode->getPath() );
if ( !scene )
{
return 0;
}
if ( name == LinkedScene::linkAttribute )
{
const char *expanded = pExpanded.getToken();
if ( node->hasParm( expanded ) && !node->evalInt( expanded, 0, 0 ) )
{
return LinkedScene::linkAttributeData( scene.get(), time );
}
return 0;
}
try
{
return scene->readAttribute( name, time );
}
catch( ... )
{
return 0;
}
}
bool OBJ_SceneCacheTransform::hasTag( const OP_Node *node, const SceneInterface::Name &tag, int filter )
{
// make sure its a SceneCacheNode
if ( !node->hasParm( pFile.getToken() ) || !node->hasParm( pRoot.getToken() ) )
{
return false;
}
const SceneCacheNode<OP_Node> *sceneNode = reinterpret_cast< const SceneCacheNode<OP_Node>* >( node );
/// \todo: do we need to ensure the file exists first?
ConstSceneInterfacePtr scene = OBJ_SceneCacheTransform::scene( sceneNode->getFile(), sceneNode->getPath() );
if ( !scene )
{
return false;
}
return scene->hasTag( tag, filter );
}
void OBJ_SceneCacheTransform::readTags( const OP_Node *node, SceneInterface::NameList &tags, int filter )
{
// make sure its a SceneCacheNode
if ( !node->hasParm( pFile.getToken() ) || !node->hasParm( pRoot.getToken() ) )
{
return;
}
const SceneCacheNode<OP_Node> *sceneNode = reinterpret_cast< const SceneCacheNode<OP_Node>* >( node );
/// \todo: do we need to ensure the file exists first?
ConstSceneInterfacePtr scene = OBJ_SceneCacheTransform::scene( sceneNode->getFile(), sceneNode->getPath() );
if ( !scene )
{
return;
}
scene->readTags( tags, filter );
}
int *OBJ_SceneCacheTransform::getIndirect() const
{
return g_indirection;
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.biezhi</groupId>
<artifactId>write-readable-code</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
|
{
"pile_set_name": "Github"
}
|
package com.company.shop.sys.service.modules.sys.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.company.shop.sys.service.modules.sys.entity.BuyLimitEntity;
import com.company.shop.sys.service.modules.sys.mapper.BuyLimitMapper;
import com.company.shop.sys.service.modules.sys.service.IBuyLimitService;
import com.company.shop.sys.service.utils.PrincipalUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service("buyLimitService")
public class BuyLimitServiceImpl extends ServiceImpl<BuyLimitMapper, BuyLimitEntity> implements IBuyLimitService {
@Override
public BuyLimitEntity getBuyLimit() {
return baseMapper.getLimit(PrincipalUtils.getUsername());
}
@Override
public int insertUserBuy(BuyLimitEntity buyLimitEntity) {
return insertOrUpdate(buyLimitEntity) ? 1 : 0;
}
}
|
{
"pile_set_name": "Github"
}
|
import inspect
import sys
import importlib
import types
from abc import abstractmethod
from collections import namedtuple
from inspect import isfunction
from mistpy.tags import SPARK_CONTEXT, SPARK_SESSION, HIVE_SESSION, HIVE_CONTEXT, SQL_CONTEXT
from mistpy.tags import tags as dec_tags
class ExecutableEntry(object):
def __init__(self, type_choice, args=None, tags=None):
self._type_choice = type_choice
if args is None:
args = []
if tags is None:
tags = set()
self._args = args
self._tags = tags
@property
def args_info(self):
return self._args
@property
def selected_spark_argument(self):
return self._type_choice
@property
def tags(self):
return self._tags
@abstractmethod
def invoke(self, context_wrapper, params):
pass
class FunctionEntry(ExecutableEntry):
def __init__(self, fn):
self._fn = fn
if hasattr(fn, 'args_def'):
args = fn.args_def
else:
args = []
type_choice = fn.type_choice
_tags = fn.fn_tags
super(FunctionEntry, self).__init__(type_choice, args, _tags)
def invoke(self, context_wrapper, params):
return self._fn(context_wrapper, **params)
ArgInfo = namedtuple('ArgInfo', ['name', 'type_hint'])
def extract_args_from_method_py2(method):
args_spec = inspect.getargspec(method)
user_args = args_spec.args[1:]
return list(map(lambda name: ArgInfo(name, None), user_args))
def extract_args_from_method_py3(method):
sign = inspect.signature(method)
result = []
user_params = list(sign.parameters.items())[1:]
for k, v in user_params:
result.append(ArgInfo(k, None))
return result
def extract_args_from_method(method):
if sys.version_info[0] == 2:
args = extract_args_from_method_py2(method)
else:
args = extract_args_from_method_py3(method)
return args
def is_mist_function(fn):
return hasattr(fn, 'fn_tags') and hasattr(fn, 'type_choice')
def get_metadata(fn):
if isfunction(fn):
if is_mist_function(fn):
return FunctionEntry(fn)
else:
raise Exception(fn.__name__ + ' is not a mist function')
def load_egg_entry(path, fn_name):
sys.path.append(path)
splitted = fn_name.split('.')
module_path = '.'.join(splitted[:-1])
fn_attr = splitted[-1]
module = importlib.import_module(module_path)
return getattr(module, fn_attr)
def load_one_file(path, fn_name):
with open(path) as file:
code = compile(file.read(), path, "exec")
user_job_module = types.ModuleType("<user_job>")
exec(code, user_job_module.__dict__)
return getattr(user_job_module, fn_name)
def load_entry_object(path, fn_name):
if (path.endswith(".egg")):
return load_egg_entry(path, fn_name)
else:
return load_one_file(path, fn_name)
def load_entry(path, fn_name):
module_entry = load_entry_object(path, fn_name)
return get_metadata(module_entry)
|
{
"pile_set_name": "Github"
}
|
/*-
* Copyright (c) 1997, Stefan Esser <se@FreeBSD.ORG>
* Copyright (c) 1997, 1998, 1999, Kenneth D. Merry <ken@FreeBSD.ORG>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
* $FreeBSD$
*
*/
#ifndef _SYS_PCIIO_H_
#define _SYS_PCIIO_H_
#include <sys/ioccom.h>
#define PCI_MAXNAMELEN 16
typedef enum {
PCI_GETCONF_LAST_DEVICE,
PCI_GETCONF_LIST_CHANGED,
PCI_GETCONF_MORE_DEVS,
PCI_GETCONF_ERROR
} pci_getconf_status;
typedef enum {
PCI_GETCONF_NO_MATCH = 0x0000,
PCI_GETCONF_MATCH_DOMAIN = 0x0001,
PCI_GETCONF_MATCH_BUS = 0x0002,
PCI_GETCONF_MATCH_DEV = 0x0004,
PCI_GETCONF_MATCH_FUNC = 0x0008,
PCI_GETCONF_MATCH_NAME = 0x0010,
PCI_GETCONF_MATCH_UNIT = 0x0020,
PCI_GETCONF_MATCH_VENDOR = 0x0040,
PCI_GETCONF_MATCH_DEVICE = 0x0080,
PCI_GETCONF_MATCH_CLASS = 0x0100
} pci_getconf_flags;
struct pcisel {
u_int32_t pc_domain; /* domain number */
u_int8_t pc_bus; /* bus number */
u_int8_t pc_dev; /* device on this bus */
u_int8_t pc_func; /* function on this device */
};
struct pci_conf {
struct pcisel pc_sel; /* domain+bus+slot+function */
u_int8_t pc_hdr; /* PCI header type */
u_int16_t pc_subvendor; /* card vendor ID */
u_int16_t pc_subdevice; /* card device ID, assigned by
card vendor */
u_int16_t pc_vendor; /* chip vendor ID */
u_int16_t pc_device; /* chip device ID, assigned by
chip vendor */
u_int8_t pc_class; /* chip PCI class */
u_int8_t pc_subclass; /* chip PCI subclass */
u_int8_t pc_progif; /* chip PCI programming interface */
u_int8_t pc_revid; /* chip revision ID */
char pd_name[PCI_MAXNAMELEN + 1]; /* device name */
u_long pd_unit; /* device unit number */
};
struct pci_match_conf {
struct pcisel pc_sel; /* domain+bus+slot+function */
char pd_name[PCI_MAXNAMELEN + 1]; /* device name */
u_long pd_unit; /* Unit number */
u_int16_t pc_vendor; /* PCI Vendor ID */
u_int16_t pc_device; /* PCI Device ID */
u_int8_t pc_class; /* PCI class */
pci_getconf_flags flags; /* Matching expression */
};
struct pci_conf_io {
u_int32_t pat_buf_len; /* pattern buffer length */
u_int32_t num_patterns; /* number of patterns */
struct pci_match_conf *patterns; /* pattern buffer */
u_int32_t match_buf_len; /* match buffer length */
u_int32_t num_matches; /* number of matches returned */
struct pci_conf *matches; /* match buffer */
u_int32_t offset; /* offset into device list */
u_int32_t generation; /* device list generation */
pci_getconf_status status; /* request status */
};
struct pci_io {
struct pcisel pi_sel; /* device to operate on */
int pi_reg; /* configuration register to examine */
int pi_width; /* width (in bytes) of read or write */
u_int32_t pi_data; /* data to write or result of read */
};
struct pci_bar_io {
struct pcisel pbi_sel; /* device to operate on */
int pbi_reg; /* starting address of BAR */
int pbi_enabled; /* decoding enabled */
uint64_t pbi_base; /* current value of BAR */
uint64_t pbi_length; /* length of BAR */
};
struct pci_vpd_element {
char pve_keyword[2];
uint8_t pve_flags;
uint8_t pve_datalen;
uint8_t pve_data[0];
};
#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */
#define PVE_FLAG_RW 0x02 /* Element is read/write */
#define PVE_NEXT(pve) \
((struct pci_vpd_element *)((char *)(pve) + \
sizeof(struct pci_vpd_element) + (pve)->pve_datalen))
struct pci_list_vpd_io {
struct pcisel plvi_sel; /* device to operate on */
size_t plvi_len; /* size of the data area */
struct pci_vpd_element *plvi_data;
};
#define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io)
#define PCIOCREAD _IOWR('p', 2, struct pci_io)
#define PCIOCWRITE _IOWR('p', 3, struct pci_io)
#define PCIOCATTACHED _IOWR('p', 4, struct pci_io)
#define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io)
#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io)
#endif /* !_SYS_PCIIO_H_ */
|
{
"pile_set_name": "Github"
}
|
{ stdenv
, fetchFromGitHub
, makeWrapper
, python
, fuse
, pkgconfig
, libpcap
, zlib
}:
stdenv.mkDerivation rec {
pname = "moosefs";
version = "3.0.114";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "0bilrzzlg599xy21cm7r0xb2sanngr74j3z03xgybcm10kl97i7j";
};
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs =
[ fuse libpcap zlib ];
postInstall = ''
substituteInPlace $out/sbin/mfscgiserv --replace "datapath=\"$out" "datapath=\""
wrapProgram $out/sbin/mfscgiserv \
--prefix PATH ":" "${python}/bin"
'';
meta = with stdenv.lib; {
homepage = "https://moosefs.com";
description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = [ maintainers.mfossen ];
};
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2017 ScyllaDB
*/
/*
* This file is part of Scylla.
*
* Scylla is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Scylla is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Scylla. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <algorithm>
#include <seastar/core/file.hh>
#include <seastar/core/seastar.hh>
#include "bytes.hh"
#include "log.hh"
namespace sstables {
extern logging::logger sstlog;
class integrity_checked_file_impl : public file_impl {
public:
integrity_checked_file_impl(sstring fname, file f);
virtual future<size_t> write_dma(uint64_t pos, const void* buffer, size_t len, const io_priority_class& pc) override;
virtual future<size_t> write_dma(uint64_t pos, std::vector<iovec> iov, const io_priority_class& pc) override;
virtual future<size_t> read_dma(uint64_t pos, void* buffer, size_t len, const io_priority_class& pc) override {
return get_file_impl(_file)->read_dma(pos, buffer, len, pc);
}
virtual future<size_t> read_dma(uint64_t pos, std::vector<iovec> iov, const io_priority_class& pc) override {
return get_file_impl(_file)->read_dma(pos, iov, pc);
}
virtual future<> flush(void) override {
return get_file_impl(_file)->flush();
}
virtual future<struct stat> stat(void) override {
return get_file_impl(_file)->stat();
}
virtual future<> truncate(uint64_t length) override {
return get_file_impl(_file)->truncate(length);
}
virtual future<> discard(uint64_t offset, uint64_t length) override {
return get_file_impl(_file)->discard(offset, length);
}
virtual future<> allocate(uint64_t position, uint64_t length) override {
return get_file_impl(_file)->allocate(position, length);
}
virtual future<uint64_t> size(void) override {
return get_file_impl(_file)->size();
}
virtual future<> close() override {
return get_file_impl(_file)->close();
}
// returns a handle for plain file, so make_checked_file() should be called
// on file returned by handle.
virtual std::unique_ptr<seastar::file_handle_impl> dup() override {
return get_file_impl(_file)->dup();
}
virtual subscription<directory_entry> list_directory(std::function<future<> (directory_entry de)> next) override {
return get_file_impl(_file)->list_directory(next);
}
virtual future<temporary_buffer<uint8_t>> dma_read_bulk(uint64_t offset, size_t range_size, const io_priority_class& pc) override {
return get_file_impl(_file)->dma_read_bulk(offset, range_size, pc);
}
private:
sstring _fname;
file _file;
};
inline file make_integrity_checked_file(sstring name, file f);
inline open_flags adjust_flags_for_integrity_checked_file(open_flags flags);
future<file>
open_integrity_checked_file_dma(std::string_view name, open_flags flags, file_open_options options) noexcept;
future<file>
open_integrity_checked_file_dma(std::string_view name, open_flags flags) noexcept;
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2015 Huan Du. All rights reserved.
// Licensed under the MIT license that can be found in the LICENSE file.
package xstrings
import (
"bytes"
)
const bufferMaxInitGrowSize = 2048
// Lazy initialize a buffer.
func allocBuffer(orig, cur string) *bytes.Buffer {
output := &bytes.Buffer{}
maxSize := len(orig) * 4
// Avoid to reserve too much memory at once.
if maxSize > bufferMaxInitGrowSize {
maxSize = bufferMaxInitGrowSize
}
output.Grow(maxSize)
output.WriteString(orig[:len(orig)-len(cur)])
return output
}
|
{
"pile_set_name": "Github"
}
|
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON object
json j =
{
{"pi", 3.141},
{"happy", true},
{"name", "Niels"},
{"nothing", nullptr},
{
"answer", {
{"everything", 42}
}
},
{"list", {1, 0, 2}},
{
"object", {
{"currency", "USD"},
{"value", 42.99}
}
}
};
// add new values
j["new"]["key"]["value"] = {"another", "list"};
// count elements
auto s = j.size();
j["size"] = s;
// pretty print with indent of 4 spaces
std::cout << std::setw(4) << j << '\n';
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************
HIDAPI - Multi-Platform library for
communication with HID devices.
Alan Ott
Signal 11 Software
8/22/2009
Copyright 2009, All Rights Reserved.
At the discretion of the user of this library,
this software may be licensed under the terms of the
GNU General Public License v3, a BSD-Style license, or the
original HIDAPI license as outlined in the LICENSE.txt,
LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
files located at the root of the source distribution.
These files may also be found in the public source
code repository located at:
http://github.com/signal11/hidapi .
********************************************************/
#include <windows.h>
#ifndef _NTDEF_
typedef LONG NTSTATUS;
#endif
#ifdef __MINGW32__
#include <ntdef.h>
#include <winbase.h>
#endif
#ifdef __CYGWIN__
#include <ntdef.h>
#define _wcsdup wcsdup
#endif
/* The maximum number of characters that can be passed into the
HidD_Get*String() functions without it failing.*/
#define MAX_STRING_WCHARS 0xFFF
/*#define HIDAPI_USE_DDK*/
#ifdef __cplusplus
extern "C" {
#endif
#include <setupapi.h>
#include <winioctl.h>
#ifdef HIDAPI_USE_DDK
#include <hidsdi.h>
#endif
/* Copied from inc/ddk/hidclass.h, part of the Windows DDK. */
#define HID_OUT_CTL_CODE(id) \
CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100)
#define HID_CTL_CODE(id) \
CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_HID_GET_REPORT_DESCRIPTOR HID_CTL_CODE(1)
#ifdef __cplusplus
} /* extern "C" */
#endif
#include <stdio.h>
#include <stdlib.h>
#include "hidapi.h"
#undef MIN
#define MIN(x,y) ((x) < (y)? (x): (y))
#ifdef _MSC_VER
/* Thanks Microsoft, but I know how to use strncpy(). */
#pragma warning(disable:4996)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HIDAPI_USE_DDK
/* Since we're not building with the DDK, and the HID header
files aren't part of the SDK, we have to define all this
stuff here. In lookup_functions(), the function pointers
defined below are set. */
typedef struct _HIDD_ATTRIBUTES{
ULONG Size;
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
typedef USHORT USAGE;
typedef struct _HIDP_CAPS {
USAGE Usage;
USAGE UsagePage;
USHORT InputReportByteLength;
USHORT OutputReportByteLength;
USHORT FeatureReportByteLength;
USHORT Reserved[17];
USHORT fields_not_used_by_hidapi[10];
} HIDP_CAPS, *PHIDP_CAPS;
typedef void* PHIDP_PREPARSED_DATA;
#define HIDP_STATUS_SUCCESS 0x110000
typedef BOOLEAN (__stdcall *HidD_GetAttributes_)(HANDLE device, PHIDD_ATTRIBUTES attrib);
typedef BOOLEAN (__stdcall *HidD_GetSerialNumberString_)(HANDLE device, PVOID buffer, ULONG buffer_len);
typedef BOOLEAN (__stdcall *HidD_GetManufacturerString_)(HANDLE handle, PVOID buffer, ULONG buffer_len);
typedef BOOLEAN (__stdcall *HidD_GetProductString_)(HANDLE handle, PVOID buffer, ULONG buffer_len);
typedef BOOLEAN (__stdcall *HidD_SetFeature_)(HANDLE handle, PVOID data, ULONG length);
typedef BOOLEAN (__stdcall *HidD_GetFeature_)(HANDLE handle, PVOID data, ULONG length);
typedef BOOLEAN (__stdcall *HidD_GetIndexedString_)(HANDLE handle, ULONG string_index, PVOID buffer, ULONG buffer_len);
typedef BOOLEAN (__stdcall *HidD_GetPreparsedData_)(HANDLE handle, PHIDP_PREPARSED_DATA *preparsed_data);
typedef BOOLEAN (__stdcall *HidD_FreePreparsedData_)(PHIDP_PREPARSED_DATA preparsed_data);
typedef NTSTATUS (__stdcall *HidP_GetCaps_)(PHIDP_PREPARSED_DATA preparsed_data, HIDP_CAPS *caps);
typedef BOOLEAN (__stdcall *HidD_SetNumInputBuffers_)(HANDLE handle, ULONG number_buffers);
static HidD_GetAttributes_ HidD_GetAttributes;
static HidD_GetSerialNumberString_ HidD_GetSerialNumberString;
static HidD_GetManufacturerString_ HidD_GetManufacturerString;
static HidD_GetProductString_ HidD_GetProductString;
static HidD_SetFeature_ HidD_SetFeature;
static HidD_GetFeature_ HidD_GetFeature;
static HidD_GetIndexedString_ HidD_GetIndexedString;
static HidD_GetPreparsedData_ HidD_GetPreparsedData;
static HidD_FreePreparsedData_ HidD_FreePreparsedData;
static HidP_GetCaps_ HidP_GetCaps;
static HidD_SetNumInputBuffers_ HidD_SetNumInputBuffers;
static HMODULE lib_handle = NULL;
static BOOLEAN initialized = FALSE;
#endif /* HIDAPI_USE_DDK */
struct hid_device_ {
HANDLE device_handle;
BOOL blocking;
USHORT output_report_length;
size_t input_report_length;
void *last_error_str;
DWORD last_error_num;
BOOL read_pending;
char *read_buf;
OVERLAPPED ol;
};
static hid_device *new_hid_device()
{
hid_device *dev = (hid_device*) calloc(1, sizeof(hid_device));
dev->device_handle = INVALID_HANDLE_VALUE;
dev->blocking = TRUE;
dev->output_report_length = 0;
dev->input_report_length = 0;
dev->last_error_str = NULL;
dev->last_error_num = 0;
dev->read_pending = FALSE;
dev->read_buf = NULL;
memset(&dev->ol, 0, sizeof(dev->ol));
dev->ol.hEvent = CreateEvent(NULL, FALSE, FALSE /*initial state f=nonsignaled*/, NULL);
return dev;
}
static void free_hid_device(hid_device *dev)
{
CloseHandle(dev->ol.hEvent);
CloseHandle(dev->device_handle);
LocalFree(dev->last_error_str);
free(dev->read_buf);
free(dev);
}
static void register_error(hid_device *device, const char *op)
{
WCHAR *ptr, *msg;
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPVOID)&msg, 0/*sz*/,
NULL);
/* Get rid of the CR and LF that FormatMessage() sticks at the
end of the message. Thanks Microsoft! */
ptr = msg;
while (*ptr) {
if (*ptr == '\r') {
*ptr = 0x0000;
break;
}
ptr++;
}
/* Store the message off in the Device entry so that
the hid_error() function can pick it up. */
LocalFree(device->last_error_str);
device->last_error_str = msg;
}
#ifndef HIDAPI_USE_DDK
static int lookup_functions()
{
lib_handle = LoadLibraryA("hid.dll");
if (lib_handle) {
#define RESOLVE(x) x = (x##_)GetProcAddress(lib_handle, #x); if (!x) return -1;
RESOLVE(HidD_GetAttributes);
RESOLVE(HidD_GetSerialNumberString);
RESOLVE(HidD_GetManufacturerString);
RESOLVE(HidD_GetProductString);
RESOLVE(HidD_SetFeature);
RESOLVE(HidD_GetFeature);
RESOLVE(HidD_GetIndexedString);
RESOLVE(HidD_GetPreparsedData);
RESOLVE(HidD_FreePreparsedData);
RESOLVE(HidP_GetCaps);
RESOLVE(HidD_SetNumInputBuffers);
#undef RESOLVE
}
else
return -1;
return 0;
}
#endif
static HANDLE open_device(const char *path, BOOL enumerate)
{
HANDLE handle;
DWORD desired_access = (enumerate)? 0: (GENERIC_WRITE | GENERIC_READ);
DWORD share_mode = FILE_SHARE_READ|FILE_SHARE_WRITE;
handle = CreateFileA(path,
desired_access,
share_mode,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,/*FILE_ATTRIBUTE_NORMAL,*/
0);
return handle;
}
int HID_API_EXPORT hid_init(void)
{
#ifndef HIDAPI_USE_DDK
if (!initialized) {
if (lookup_functions() < 0) {
hid_exit();
return -1;
}
initialized = TRUE;
}
#endif
return 0;
}
int HID_API_EXPORT hid_exit(void)
{
#ifndef HIDAPI_USE_DDK
if (lib_handle)
FreeLibrary(lib_handle);
lib_handle = NULL;
initialized = FALSE;
#endif
return 0;
}
struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id)
{
BOOL res;
struct hid_device_info *root = NULL; /* return object */
struct hid_device_info *cur_dev = NULL;
/* Windows objects for interacting with the driver. */
GUID InterfaceClassGuid = {0x4d1e55b2, 0xf16f, 0x11cf, {0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30} };
SP_DEVINFO_DATA devinfo_data;
SP_DEVICE_INTERFACE_DATA device_interface_data;
SP_DEVICE_INTERFACE_DETAIL_DATA_A *device_interface_detail_data = NULL;
HDEVINFO device_info_set = INVALID_HANDLE_VALUE;
int device_index = 0;
int i;
if (hid_init() < 0)
return NULL;
/* Initialize the Windows objects. */
memset(&devinfo_data, 0x0, sizeof(devinfo_data));
devinfo_data.cbSize = sizeof(SP_DEVINFO_DATA);
device_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
/* Get information for all the devices belonging to the HID class. */
device_info_set = SetupDiGetClassDevsA(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
/* Iterate over each device in the HID class, looking for the right one. */
for (;;) {
HANDLE write_handle = INVALID_HANDLE_VALUE;
DWORD required_size = 0;
HIDD_ATTRIBUTES attrib;
res = SetupDiEnumDeviceInterfaces(device_info_set,
NULL,
&InterfaceClassGuid,
device_index,
&device_interface_data);
if (!res) {
/* A return of FALSE from this function means that
there are no more devices. */
break;
}
/* Call with 0-sized detail size, and let the function
tell us how long the detail struct needs to be. The
size is put in &required_size. */
res = SetupDiGetDeviceInterfaceDetailA(device_info_set,
&device_interface_data,
NULL,
0,
&required_size,
NULL);
/* Allocate a long enough structure for device_interface_detail_data. */
device_interface_detail_data = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) malloc(required_size);
device_interface_detail_data->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);
/* Get the detailed data for this device. The detail data gives us
the device path for this device, which is then passed into
CreateFile() to get a handle to the device. */
res = SetupDiGetDeviceInterfaceDetailA(device_info_set,
&device_interface_data,
device_interface_detail_data,
required_size,
NULL,
NULL);
if (!res) {
/* register_error(dev, "Unable to call SetupDiGetDeviceInterfaceDetail");
Continue to the next device. */
goto cont;
}
/* Make sure this device is of Setup Class "HIDClass" and has a
driver bound to it. */
for (i = 0; ; i++) {
char driver_name[256];
/* Populate devinfo_data. This function will return failure
when there are no more interfaces left. */
res = SetupDiEnumDeviceInfo(device_info_set, i, &devinfo_data);
if (!res)
goto cont;
res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
SPDRP_CLASS, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL);
if (!res)
goto cont;
if (strcmp(driver_name, "HIDClass") == 0) {
/* See if there's a driver bound. */
res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
SPDRP_DRIVER, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL);
if (res)
break;
}
}
//wprintf(L"HandleName: %s\n", device_interface_detail_data->DevicePath);
/* Open a handle to the device */
write_handle = open_device(device_interface_detail_data->DevicePath, TRUE);
/* Check validity of write_handle. */
if (write_handle == INVALID_HANDLE_VALUE) {
/* Unable to open the device. */
//register_error(dev, "CreateFile");
goto cont_close;
}
/* Get the Vendor ID and Product ID for this device. */
attrib.Size = sizeof(HIDD_ATTRIBUTES);
HidD_GetAttributes(write_handle, &attrib);
//wprintf(L"Product/Vendor: %x %x\n", attrib.ProductID, attrib.VendorID);
/* Check the VID/PID to see if we should add this
device to the enumeration list. */
if ((vendor_id == 0x0 || attrib.VendorID == vendor_id) &&
(product_id == 0x0 || attrib.ProductID == product_id)) {
#define WSTR_LEN 512
const char *str;
struct hid_device_info *tmp;
PHIDP_PREPARSED_DATA pp_data = NULL;
HIDP_CAPS caps;
BOOLEAN res;
NTSTATUS nt_res;
wchar_t wstr[WSTR_LEN]; /* TODO: Determine Size */
size_t len;
/* VID/PID match. Create the record. */
tmp = (struct hid_device_info*) calloc(1, sizeof(struct hid_device_info));
if (cur_dev) {
cur_dev->next = tmp;
}
else {
root = tmp;
}
cur_dev = tmp;
/* Get the Usage Page and Usage for this device. */
res = HidD_GetPreparsedData(write_handle, &pp_data);
if (res) {
nt_res = HidP_GetCaps(pp_data, &caps);
if (nt_res == HIDP_STATUS_SUCCESS) {
cur_dev->usage_page = caps.UsagePage;
cur_dev->usage = caps.Usage;
}
HidD_FreePreparsedData(pp_data);
}
/* Fill out the record */
cur_dev->next = NULL;
str = device_interface_detail_data->DevicePath;
if (str) {
len = strlen(str);
cur_dev->path = (char*) calloc(len+1, sizeof(char));
strncpy(cur_dev->path, str, len+1);
cur_dev->path[len] = '\0';
}
else
cur_dev->path = NULL;
/* Serial Number */
res = HidD_GetSerialNumberString(write_handle, wstr, sizeof(wstr));
wstr[WSTR_LEN-1] = 0x0000;
if (res) {
cur_dev->serial_number = _wcsdup(wstr);
}
/* Manufacturer String */
res = HidD_GetManufacturerString(write_handle, wstr, sizeof(wstr));
wstr[WSTR_LEN-1] = 0x0000;
if (res) {
cur_dev->manufacturer_string = _wcsdup(wstr);
}
/* Product String */
res = HidD_GetProductString(write_handle, wstr, sizeof(wstr));
wstr[WSTR_LEN-1] = 0x0000;
if (res) {
cur_dev->product_string = _wcsdup(wstr);
}
/* VID/PID */
cur_dev->vendor_id = attrib.VendorID;
cur_dev->product_id = attrib.ProductID;
/* Release Number */
cur_dev->release_number = attrib.VersionNumber;
/* Interface Number. It can sometimes be parsed out of the path
on Windows if a device has multiple interfaces. See
http://msdn.microsoft.com/en-us/windows/hardware/gg487473 or
search for "Hardware IDs for HID Devices" at MSDN. If it's not
in the path, it's set to -1. */
cur_dev->interface_number = -1;
if (cur_dev->path) {
char *interface_component = strstr(cur_dev->path, "&mi_");
if (interface_component) {
char *hex_str = interface_component + 4;
char *endptr = NULL;
cur_dev->interface_number = strtol(hex_str, &endptr, 16);
if (endptr == hex_str) {
/* The parsing failed. Set interface_number to -1. */
cur_dev->interface_number = -1;
}
}
}
}
cont_close:
CloseHandle(write_handle);
cont:
/* We no longer need the detail data. It can be freed */
free(device_interface_detail_data);
device_index++;
}
/* Close the device information handle. */
SetupDiDestroyDeviceInfoList(device_info_set);
return root;
}
void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs)
{
/* TODO: Merge this with the Linux version. This function is platform-independent. */
struct hid_device_info *d = devs;
while (d) {
struct hid_device_info *next = d->next;
free(d->path);
free(d->serial_number);
free(d->manufacturer_string);
free(d->product_string);
free(d);
d = next;
}
}
HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)
{
/* TODO: Merge this functions with the Linux version. This function should be platform independent. */
struct hid_device_info *devs, *cur_dev;
const char *path_to_open = NULL;
hid_device *handle = NULL;
devs = hid_enumerate(vendor_id, product_id);
cur_dev = devs;
while (cur_dev) {
if (cur_dev->vendor_id == vendor_id &&
cur_dev->product_id == product_id) {
if (serial_number) {
if (wcscmp(serial_number, cur_dev->serial_number) == 0) {
path_to_open = cur_dev->path;
break;
}
}
else {
path_to_open = cur_dev->path;
break;
}
}
cur_dev = cur_dev->next;
}
if (path_to_open) {
/* Open the device */
handle = hid_open_path(path_to_open);
}
hid_free_enumeration(devs);
return handle;
}
HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path)
{
hid_device *dev;
HIDP_CAPS caps;
PHIDP_PREPARSED_DATA pp_data = NULL;
BOOLEAN res;
NTSTATUS nt_res;
if (hid_init() < 0) {
return NULL;
}
dev = new_hid_device();
/* Open a handle to the device */
dev->device_handle = open_device(path, FALSE);
/* Check validity of write_handle. */
if (dev->device_handle == INVALID_HANDLE_VALUE) {
/* Unable to open the device. */
register_error(dev, "CreateFile");
goto err;
}
/* Set the Input Report buffer size to 64 reports. */
res = HidD_SetNumInputBuffers(dev->device_handle, 64);
if (!res) {
register_error(dev, "HidD_SetNumInputBuffers");
goto err;
}
/* Get the Input Report length for the device. */
res = HidD_GetPreparsedData(dev->device_handle, &pp_data);
if (!res) {
register_error(dev, "HidD_GetPreparsedData");
goto err;
}
nt_res = HidP_GetCaps(pp_data, &caps);
if (nt_res != HIDP_STATUS_SUCCESS) {
register_error(dev, "HidP_GetCaps");
goto err_pp_data;
}
dev->output_report_length = caps.OutputReportByteLength;
dev->input_report_length = caps.InputReportByteLength;
HidD_FreePreparsedData(pp_data);
dev->read_buf = (char*) malloc(dev->input_report_length);
return dev;
err_pp_data:
HidD_FreePreparsedData(pp_data);
err:
free_hid_device(dev);
return NULL;
}
int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length)
{
DWORD bytes_written;
BOOL res;
OVERLAPPED ol;
unsigned char *buf;
memset(&ol, 0, sizeof(ol));
/* Make sure the right number of bytes are passed to WriteFile. Windows
expects the number of bytes which are in the _longest_ report (plus
one for the report number) bytes even if the data is a report
which is shorter than that. Windows gives us this value in
caps.OutputReportByteLength. If a user passes in fewer bytes than this,
create a temporary buffer which is the proper size. */
if (length >= dev->output_report_length) {
/* The user passed the right number of bytes. Use the buffer as-is. */
buf = (unsigned char *) data;
} else {
/* Create a temporary buffer and copy the user's data
into it, padding the rest with zeros. */
buf = (unsigned char *) malloc(dev->output_report_length);
memcpy(buf, data, length);
memset(buf + length, 0, dev->output_report_length - length);
length = dev->output_report_length;
}
res = WriteFile(dev->device_handle, buf, length, NULL, &ol);
if (!res) {
if (GetLastError() != ERROR_IO_PENDING) {
/* WriteFile() failed. Return error. */
register_error(dev, "WriteFile");
bytes_written = -1;
goto end_of_function;
}
}
/* Wait here until the write is done. This makes
hid_write() synchronous. */
res = GetOverlappedResult(dev->device_handle, &ol, &bytes_written, TRUE/*wait*/);
if (!res) {
/* The Write operation failed. */
register_error(dev, "WriteFile");
bytes_written = -1;
goto end_of_function;
}
end_of_function:
if (buf != data)
free(buf);
return bytes_written;
}
int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)
{
DWORD bytes_read = 0;
size_t copy_len = 0;
BOOL res;
/* Copy the handle for convenience. */
HANDLE ev = dev->ol.hEvent;
if (!dev->read_pending) {
/* Start an Overlapped I/O read. */
dev->read_pending = TRUE;
memset(dev->read_buf, 0, dev->input_report_length);
ResetEvent(ev);
res = ReadFile(dev->device_handle, dev->read_buf, dev->input_report_length, &bytes_read, &dev->ol);
if (!res) {
if (GetLastError() != ERROR_IO_PENDING) {
/* ReadFile() has failed.
Clean up and return error. */
CancelIo(dev->device_handle);
dev->read_pending = FALSE;
goto end_of_function;
}
}
}
if (milliseconds >= 0) {
/* See if there is any data yet. */
res = WaitForSingleObject(ev, milliseconds);
if (res != WAIT_OBJECT_0) {
/* There was no data this time. Return zero bytes available,
but leave the Overlapped I/O running. */
return 0;
}
}
/* Either WaitForSingleObject() told us that ReadFile has completed, or
we are in non-blocking mode. Get the number of bytes read. The actual
data has been copied to the data[] array which was passed to ReadFile(). */
res = GetOverlappedResult(dev->device_handle, &dev->ol, &bytes_read, TRUE/*wait*/);
/* Set pending back to false, even if GetOverlappedResult() returned error. */
dev->read_pending = FALSE;
if (res && bytes_read > 0) {
if (dev->read_buf[0] == 0x0) {
/* If report numbers aren't being used, but Windows sticks a report
number (0x0) on the beginning of the report anyway. To make this
work like the other platforms, and to make it work more like the
HID spec, we'll skip over this byte. */
bytes_read--;
copy_len = length > bytes_read ? bytes_read : length;
memcpy(data, dev->read_buf+1, copy_len);
}
else {
/* Copy the whole buffer, report number and all. */
copy_len = length > bytes_read ? bytes_read : length;
memcpy(data, dev->read_buf, copy_len);
}
}
end_of_function:
if (!res) {
register_error(dev, "GetOverlappedResult");
return -1;
}
return copy_len;
}
int HID_API_EXPORT HID_API_CALL hid_read(hid_device *dev, unsigned char *data, size_t length)
{
return hid_read_timeout(dev, data, length, (dev->blocking)? -1: 0);
}
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *dev, int nonblock)
{
dev->blocking = !nonblock;
return 0; /* Success */
}
int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length)
{
BOOL res = HidD_SetFeature(dev->device_handle, (PVOID)data, length);
if (!res) {
register_error(dev, "HidD_SetFeature");
return -1;
}
return length;
}
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length)
{
BOOL res;
#if 0
res = HidD_GetFeature(dev->device_handle, data, length);
if (!res) {
register_error(dev, "HidD_GetFeature");
return -1;
}
return 0; /* HidD_GetFeature() doesn't give us an actual length, unfortunately */
#else
DWORD bytes_returned;
OVERLAPPED ol;
memset(&ol, 0, sizeof(ol));
res = DeviceIoControl(dev->device_handle,
IOCTL_HID_GET_FEATURE,
data, length,
data, length,
&bytes_returned, &ol);
if (!res) {
if (GetLastError() != ERROR_IO_PENDING) {
/* DeviceIoControl() failed. Return error. */
register_error(dev, "Send Feature Report DeviceIoControl");
return -1;
}
}
/* Wait here until the write is done. This makes
hid_get_feature_report() synchronous. */
res = GetOverlappedResult(dev->device_handle, &ol, &bytes_returned, TRUE/*wait*/);
if (!res) {
/* The operation failed. */
register_error(dev, "Send Feature Report GetOverLappedResult");
return -1;
}
/* bytes_returned does not include the first byte which contains the
report ID. The data buffer actually contains one more byte than
bytes_returned. */
bytes_returned++;
return bytes_returned;
#endif
}
int HID_API_EXPORT HID_API_CALL hid_get_descriptor(hid_device *dev, unsigned char *data, size_t length)
{
BOOL res;
DWORD bytes_returned;
OVERLAPPED ol;
memset(&ol, 0, sizeof(ol));
res = DeviceIoControl(dev->device_handle,
IOCTL_HID_GET_REPORT_DESCRIPTOR,
data, length,
data, length,
&bytes_returned, &ol);
if (!res) {
if (GetLastError() != ERROR_IO_PENDING) {
/* DeviceIoControl() failed. Return error. */
register_error(dev, "Get Report Descriptor DeviceIoControl");
return -1;
}
}
res = GetOverlappedResult(dev->device_handle, &ol, &bytes_returned, TRUE/*wait*/);
if (!res) {
/* The operation failed. */
register_error(dev, "Get Report Descriptor GetOverLappedResult");
return -1;
}
return bytes_returned;
}
void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev)
{
if (!dev)
return;
CancelIo(dev->device_handle);
free_hid_device(dev);
}
int HID_API_EXPORT_CALL HID_API_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
BOOL res;
res = HidD_GetManufacturerString(dev->device_handle, string, sizeof(wchar_t) * MIN(maxlen, MAX_STRING_WCHARS));
if (!res) {
register_error(dev, "HidD_GetManufacturerString");
return -1;
}
return 0;
}
int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
BOOL res;
res = HidD_GetProductString(dev->device_handle, string, sizeof(wchar_t) * MIN(maxlen, MAX_STRING_WCHARS));
if (!res) {
register_error(dev, "HidD_GetProductString");
return -1;
}
return 0;
}
int HID_API_EXPORT_CALL HID_API_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
BOOL res;
res = HidD_GetSerialNumberString(dev->device_handle, string, sizeof(wchar_t) * MIN(maxlen, MAX_STRING_WCHARS));
if (!res) {
register_error(dev, "HidD_GetSerialNumberString");
return -1;
}
return 0;
}
int HID_API_EXPORT_CALL HID_API_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen)
{
BOOL res;
res = HidD_GetIndexedString(dev->device_handle, string_index, string, sizeof(wchar_t) * MIN(maxlen, MAX_STRING_WCHARS));
if (!res) {
register_error(dev, "HidD_GetIndexedString");
return -1;
}
return 0;
}
HID_API_EXPORT const wchar_t * HID_API_CALL hid_error(hid_device *dev)
{
return (wchar_t*)dev->last_error_str;
}
/*#define PICPGM*/
/*#define S11*/
#define P32
#ifdef S11
unsigned short VendorID = 0xa0a0;
unsigned short ProductID = 0x0001;
#endif
#ifdef P32
unsigned short VendorID = 0x04d8;
unsigned short ProductID = 0x3f;
#endif
#ifdef PICPGM
unsigned short VendorID = 0x04d8;
unsigned short ProductID = 0x0033;
#endif
#if 0
int __cdecl main(int argc, char* argv[])
{
int res;
unsigned char buf[65];
UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv);
/* Set up the command buffer. */
memset(buf,0x00,sizeof(buf));
buf[0] = 0;
buf[1] = 0x81;
/* Open the device. */
int handle = open(VendorID, ProductID, L"12345");
if (handle < 0)
printf("unable to open device\n");
/* Toggle LED (cmd 0x80) */
buf[1] = 0x80;
res = write(handle, buf, 65);
if (res < 0)
printf("Unable to write()\n");
/* Request state (cmd 0x81) */
buf[1] = 0x81;
write(handle, buf, 65);
if (res < 0)
printf("Unable to write() (2)\n");
/* Read requested state */
read(handle, buf, 65);
if (res < 0)
printf("Unable to read()\n");
/* Print out the returned buffer. */
for (int i = 0; i < 4; i++)
printf("buf[%d]: %d\n", i, buf[i]);
return 0;
}
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
|
{
"pile_set_name": "Github"
}
|
{
"farms": [
{
"name": "Ex-SMTP",
"backends": [
{
"name": "bck0",
"state": "down"
},
{
"name": "bck1",
"state": "down"
}
]
}
]
}
|
{
"pile_set_name": "Github"
}
|
const { HttpsUriPlugin } = require("../../../../").experiments.schemes;
/** @type {import("../../../../").Configuration} */
module.exports = {
mode: "development",
module: {
rules: [
{
test: /\.md$/,
loader: "./loaders/md-loader"
}
]
},
plugins: [new HttpsUriPlugin()]
};
|
{
"pile_set_name": "Github"
}
|
<ng-container [ngSwitch]="name">
<svg *ngSwitchCase="'menu'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
</svg>
<svg *ngSwitchCase="'account'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" />
</svg>
<svg *ngSwitchCase="'cart'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#ffffff" d="M17,18C15.89,18 15,18.89 15,20A2,2 0 0,0 17,22A2,2 0 0,0 19,20C19,18.89 18.1,18 17,18M1,2V4H3L6.6,11.59L5.24,14.04C5.09,14.32 5,14.65 5,15A2,2 0 0,0 7,17H19V15H7.42A0.25,0.25 0 0,1 7.17,14.75C7.17,14.7 7.18,14.66 7.2,14.63L8.1,13H15.55C16.3,13 16.96,12.58 17.3,11.97L20.88,5.5C20.95,5.34 21,5.17 21,5A1,1 0 0,0 20,4H5.21L4.27,2M7,18C5.89,18 5,18.89 5,20A2,2 0 0,0 7,22A2,2 0 0,0 9,20C9,18.89 8.1,18 7,18Z" />
</svg>
<svg *ngSwitchCase="'magnify'" style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="#303030" d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" />
</svg>
</ng-container>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env cabal
{- cabal:
build-depends: base, directory, hledger, text
-}
{-
hledger-check-tag-files cabal script (requires cabal 3+).
Read the default journal and give an error if any tag values
containing '/' do not exist as file paths.
Usage:
$ hledger-check-tag-files.hs # compiles every time (?)
or:
$ hledger check-tag-files # compiles every time (?)
-}
import Control.Monad
import qualified Data.Text as T
import Hledger.Cli
import System.Directory
import System.Exit
main = withJournalDo defcliopts $ \j -> do
let filetags = [ (t,v)
| (t',v') <- concatMap transactionAllTags $ jtxns j
, let t = T.unpack t'
, let v = T.unpack v'
, '/' `elem` v
]
forM_ filetags $ \(t,f) -> do
exists <- doesFileExist f
when (not exists) $ do
putStrLn $ "file not found in tag: " ++ t ++ ": " ++ f
exitFailure
|
{
"pile_set_name": "Github"
}
|
// go run mksyscall_solaris.go -illumos -tags illumos,amd64 syscall_illumos.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build illumos,amd64
package unix
import (
"unsafe"
)
//go:cgo_import_dynamic libc_readv readv "libc.so"
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
//go:cgo_import_dynamic libc_writev writev "libc.so"
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
//go:linkname procreadv libc_readv
//go:linkname procpreadv libc_preadv
//go:linkname procwritev libc_writev
//go:linkname procpwritev libc_pwritev
var (
procreadv,
procpreadv,
procwritev,
procpwritev syscallFunc
)
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovs []Iovec) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procreadv)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovs []Iovec, off int64) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpreadv)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovs []Iovec) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwritev)), 3, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), 0, 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovs []Iovec, off int64) (n int, err error) {
var _p0 *Iovec
if len(iovs) > 0 {
_p0 = &iovs[0]
}
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpwritev)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(iovs)), uintptr(off), 0, 0)
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
|
{
"pile_set_name": "Github"
}
|
"use strict";
var Long = require('../../../long').Long,
constants = require('./constants');
/**
* Parse data to 4 bytes which represents integer value.
*
* @fixme this is a super misleading function name and comment!
*
* @param {Mixed} data The data.
* @return {Buffer} The buffer containing the data.
*/
function writeByte (data) {
return Buffer.from([data]);
}
/**
* Parse data to 4 bytes which represents integer value.
*
* @param {Mixed} data The data to write.
* @return {Buffer} The buffer containing the data.
*/
function writeInt (data) {
var buf = Buffer.alloc(constants.BYTES_INT);
buf.writeInt32BE(data, 0);
return buf;
}
/**
* Parse data to 8 bytes which represents a long value.
*
* @param {Mixed} data The data to write.
* @return {Buffer} The buffer containing the data.
*/
function writeLong (data) {
var buf = Buffer.alloc(constants.BYTES_LONG),
value = Long.fromNumber(data);
buf.fill(0);
buf.writeInt32BE(value.high_, 0);
buf.writeInt32BE(value.low_, constants.BYTES_INT);
return buf;
}
/**
* Parse data to 2 bytes which represents short value.
*
* @param {Mixed} data The data to write.
* @return {Buffer} The buffer containing the data.
*/
function writeShort (data) {
var buf = Buffer.alloc(constants.BYTES_SHORT);
buf.writeInt16BE(data, 0);
return buf;
}
/**
* Write bytes to a buffer
* @param {Mixed} data The data to write.
* @return {Buffer} The buffer containing the data.
*/
function writeBytes (data) {
var length = data.length,
buf = Buffer.alloc(constants.BYTES_INT + length);
buf.writeInt32BE(length, 0);
data.copy(buf, constants.BYTES_INT);
return buf;
}
/**
* Parse string data to buffer with UTF-8 encoding.
*
* @param {Mixed} data The data to write.
* @return {Buffer} The buffer containing the data.
*/
function writeString (data) {
if (data === null) {
return writeInt(-1);
}
var stringBuf = encodeString(data),
length = stringBuf.length,
buf = Buffer.alloc(constants.BYTES_INT + length);
buf.writeInt32BE(length, 0);
stringBuf.copy(buf, constants.BYTES_INT, 0, stringBuf.length);
return buf;
}
function encodeString (data) {
return Buffer.from(data);
}
exports.writeByte = writeByte;
exports.writeBoolean = writeByte;
exports.writeBytes = writeBytes;
exports.writeShort = writeShort;
exports.writeInt = writeInt;
exports.writeLong = writeLong;
exports.writeString = writeString;
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="ir.ui.view" id="view_country_geonames_form">
<field name="name">res.country.geonames.form</field>
<field name="model">res.country</field>
<field name="inherit_id" ref="base.view_country_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<field name="code" position="after">
<field name="geonames_state_name_column" />
<field name="geonames_state_code_column" />
</field>
</field>
</record>
</odoo>
|
{
"pile_set_name": "Github"
}
|
// Package cmd used for command line options for the complete tool
package cmd
import (
"errors"
"flag"
"fmt"
"os"
"strings"
"github.com/posener/complete/cmd/install"
)
// CLI for command line
type CLI struct {
Name string
InstallName string
UninstallName string
install bool
uninstall bool
yes bool
}
const (
defaultInstallName = "install"
defaultUninstallName = "uninstall"
)
// Run is used when running complete in command line mode.
// this is used when the complete is not completing words, but to
// install it or uninstall it.
func (f *CLI) Run() bool {
err := f.validate()
if err != nil {
os.Stderr.WriteString(err.Error() + "\n")
os.Exit(1)
}
switch {
case f.install:
f.prompt()
err = install.Install(f.Name)
case f.uninstall:
f.prompt()
err = install.Uninstall(f.Name)
default:
// non of the action flags matched,
// returning false should make the real program execute
return false
}
if err != nil {
fmt.Printf("%s failed! %s\n", f.action(), err)
os.Exit(3)
}
fmt.Println("Done!")
return true
}
// prompt use for approval
// exit if approval was not given
func (f *CLI) prompt() {
defer fmt.Println(f.action() + "ing...")
if f.yes {
return
}
fmt.Printf("%s completion for %s? ", f.action(), f.Name)
var answer string
fmt.Scanln(&answer)
switch strings.ToLower(answer) {
case "y", "yes":
return
default:
fmt.Println("Cancelling...")
os.Exit(1)
}
}
// AddFlags adds the CLI flags to the flag set.
// If flags is nil, the default command line flags will be taken.
// Pass non-empty strings as installName and uninstallName to override the default
// flag names.
func (f *CLI) AddFlags(flags *flag.FlagSet) {
if flags == nil {
flags = flag.CommandLine
}
if f.InstallName == "" {
f.InstallName = defaultInstallName
}
if f.UninstallName == "" {
f.UninstallName = defaultUninstallName
}
if flags.Lookup(f.InstallName) == nil {
flags.BoolVar(&f.install, f.InstallName, false,
fmt.Sprintf("Install completion for %s command", f.Name))
}
if flags.Lookup(f.UninstallName) == nil {
flags.BoolVar(&f.uninstall, f.UninstallName, false,
fmt.Sprintf("Uninstall completion for %s command", f.Name))
}
if flags.Lookup("y") == nil {
flags.BoolVar(&f.yes, "y", false, "Don't prompt user for typing 'yes'")
}
}
// validate the CLI
func (f *CLI) validate() error {
if f.install && f.uninstall {
return errors.New("Install and uninstall are mutually exclusive")
}
return nil
}
// action name according to the CLI values.
func (f *CLI) action() string {
switch {
case f.install:
return "Install"
case f.uninstall:
return "Uninstall"
default:
return "unknown"
}
}
|
{
"pile_set_name": "Github"
}
|
{
"tests": [
{
"description": "Unix domain socket (absolute path with trailing slash)",
"uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock/",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Unix domain socket (absolute path without trailing slash)",
"uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Unix domain socket (absolute path with spaces in path)",
"uri": "mongodb://%2Ftmp%2F %2Fmongodb-27017.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/ /mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Multiple Unix domain sockets (absolute paths)",
"uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
},
{
"type": "unix",
"host": "/tmp/mongodb-27018.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Multiple hosts (absolute path and ipv4)",
"uri": "mongodb://127.0.0.1:27017,%2Ftmp%2Fmongodb-27017.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "ipv4",
"host": "127.0.0.1",
"port": 27017
},
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Multiple hosts (absolute path and hostname resembling relative path)",
"uri": "mongodb://mongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "hostname",
"host": "mongodb-27017.sock",
"port": null
},
{
"type": "unix",
"host": "/tmp/mongodb-27018.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Unix domain socket with auth database (absolute path)",
"uri": "mongodb://alice:foo@%2Ftmp%2Fmongodb-27017.sock/admin",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
}
],
"auth": {
"username": "alice",
"password": "foo",
"db": "admin"
},
"options": null
},
{
"description": "Unix domain socket with path resembling socket file (absolute path with trailing slash)",
"uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/path.to.sock/mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Unix domain socket with path resembling socket file (absolute path without trailing slash)",
"uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/path.to.sock/mongodb-27017.sock",
"port": null
}
],
"auth": null,
"options": null
},
{
"description": "Unix domain socket with path resembling socket file and auth (absolute path)",
"uri": "mongodb://bob:bar@%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/admin",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/path.to.sock/mongodb-27017.sock",
"port": null
}
],
"auth": {
"username": "bob",
"password": "bar",
"db": "admin"
},
"options": null
},
{
"description": "Multiple Unix domain sockets and auth DB (absolute path)",
"uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
},
{
"type": "unix",
"host": "/tmp/mongodb-27018.sock",
"port": null
}
],
"auth": {
"username": null,
"password": null,
"db": "admin"
},
"options": null
},
{
"description": "Multiple Unix domain sockets with auth DB (absolute path)",
"uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
},
{
"type": "unix",
"host": "/tmp/mongodb-27018.sock",
"port": null
}
],
"auth": {
"username": null,
"password": null,
"db": "admin"
},
"options": null
},
{
"description": "Multiple Unix domain sockets with auth and query string (absolute path)",
"uri": "mongodb://bob:bar@%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin?w=1",
"valid": true,
"warning": false,
"hosts": [
{
"type": "unix",
"host": "/tmp/mongodb-27017.sock",
"port": null
},
{
"type": "unix",
"host": "/tmp/mongodb-27018.sock",
"port": null
}
],
"auth": {
"username": "bob",
"password": "bar",
"db": "admin"
},
"options": {
"w": 1
}
}
]
}
|
{
"pile_set_name": "Github"
}
|
.syntax--comment {
color: #999988;
font-style: italic;
}
.syntax--string {
color: #D14;
}
// String interpolation in Ruby, CoffeeScript, and others
.syntax--string {
.syntax--source,
.syntax--meta.syntax--embedded.syntax--line {
color: #5A5A5A;
}
.syntax--punctuation.syntax--section.syntax--embedded {
color: #920B2D;
.syntax--source {
color: #920B2D; // Required for the end of embedded strings in Ruby #716
}
}
}
.syntax--constant {
&.syntax--numeric {
color: #D14;
}
&.syntax--language {
color: #606aa1;
}
&.syntax--character,
&.syntax--other {
color: #606aa1;
}
&.syntax--symbol {
color: #990073;
}
&.syntax--numeric.syntax--line-number.syntax--find-in-files .syntax--match {
color: rgba(143, 190, 0, 0.63);
}
}
.syntax--variable {
color: #008080;
&.syntax--parameter {
color: #606aa1;
}
}
// Keywords
.syntax--keyword {
color: #222;
font-weight: bold;
&.syntax--unit {
color: #445588;
}
&.syntax--special-method {
color: #0086B3;
}
}
.syntax--storage {
color: #222;
&.syntax--type {
color: #222;
}
}
.syntax--entity {
&.syntax--name.syntax--class {
text-decoration: underline;
color: #606aa1;
}
&.syntax--other.syntax--inherited-class {
text-decoration: underline;
color: #606aa1;
}
&.syntax--name.syntax--function {
color: #900;
}
&.syntax--name.syntax--tag {
color: #008080;
}
&.syntax--other.syntax--attribute-name {
color: #458;
font-weight: bold;
}
&.syntax--name.syntax--filename.syntax--find-in-files {
color: #E6DB74;
}
}
.syntax--support {
&.syntax--constant,
&.syntax--function,
&.syntax--type {
color: #458;
}
&.syntax--class {
color: #008080;
}
}
.syntax--invalid {
color: #F8F8F0;
background-color: #00A8C6;
&.syntax--deprecated {
color: #F8F8F0;
background-color: #8FBE00;
}
}
.syntax--meta {
&.syntax--structure.syntax--dictionary.syntax--json > .syntax--string.syntax--quoted.syntax--double.syntax--json,
&.syntax--structure.syntax--dictionary.syntax--json > .syntax--string.syntax--quoted.syntax--double.syntax--json .syntax--punctuation.syntax--string {
color: #000080;
}
&.syntax--structure.syntax--dictionary.syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--double.syntax--json {
color: #d14;
}
&.syntax--diff,
&.syntax--diff.syntax--header {
color: #75715E;
}
}
// CSS Styles
.syntax--css {
&.syntax--support.syntax--property-name {
font-weight: bold;
color: #333;
}
&.syntax--constant {
color: #099;
}
}
// Markdown
.syntax--source.syntax--gfm {
color: #444;
}
.syntax--gfm {
.syntax--markup.syntax--heading {
color: #111;
}
& .syntax--link {
color: #888;
}
.syntax--variable.syntax--list {
color: #888;
}
}
.syntax--markdown {
.syntax--paragraph {
color: #444;
}
.syntax--heading {
color: #111;
}
.syntax--link {
color: #888;
.syntax--string {
color: #888;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<p>Hello Instructor1 Course1,</p>
<p>The email below has been sent to students of course: [idOfTypicalCourse1] Typical Course 1 with 2 Evals.<br>
<br>
=== Email message as seen by the students ===</p>
<p>
The following feedback session is now closed. You can still view your submission by going to the link sent earlier, but you will not be able to edit existing responses or submit new responses.
<div>
<table style="max-width:600px;border:1px solid black;">
<tr>
<td style="padding:5px;">
<strong>
Course:
</strong>
</td>
<td style="padding:5px;">
[idOfTypicalCourse1] Typical Course 1 with 2 Evals
</td>
</tr>
<tr>
<td style="padding:5px;">
<strong>
Feedback Session Name:
</strong>
</td>
<td style="padding:5px;">
First feedback session
</td>
</tr>
<tr>
<td style="padding:5px;">
<strong>
Deadline:
</strong>
</td>
<td style="padding:5px;">
Fri, 30 Apr 2027, 11:59 PM SAST
</td>
</tr>
<tr>
<td style="padding:5px;vertical-align:top">
<strong>
Session Instructions:
</strong>
</td>
<td style="padding:5px;">
Please please fill in the following questions.
</td>
</tr>
</table>
</div>
<ul>
<li>
<strong>To view your feedback for the above session, please go to this Web address: </strong>
<a href="{in the actual email sent to the students, this will be the unique link}">{in the actual email sent to the students, this will be the unique link}</a>
</li>
<li>
The above link is unique to you. Please do not share it with others.
</li>
</ul>
</p>
<p>
<ul>
<li>
<strong>Requests for deadline extensions, problems regarding team/student data</strong> (e.g. wrong team, misspelled name),
and <strong>other non-technical queries</strong> about the feedback session:
<br>
Contact the instructors of the course: Instructor Not Yet Joined Course 1 (instructorNotYetJoinedCourse1@email.tmt), Instructor1 Course1 (instructor1@course1.tmt), Instructor3 Course1 (instructor3@course1.tmt)
</li>
<li>
<strong>Technical help regarding TEAMMATES</strong> (e.g. submission link is not working):
Email TEAMMATES support team at ${support.email}.
</li>
</ul>
</p>
<p>
Regards,
<br>TEAMMATES Team.
</p>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2012-2016 Broad Institute, Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.gatk.utils.commandline;
/**
* Represents a collection of parsed arguments for an argument source.
*
* Useful for printing out help documents.
*/
public abstract class ParsedArgs {
/**
* @return A compact description of the arguments from an provider/source.
*/
public abstract String getDescription();
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Except when the notation is "compact", the resolvedOptions().compactDisplay
// should be undefined.
//
// Test default
let nf = new Intl.NumberFormat();
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
nf = new Intl.NumberFormat("en");
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
const testData = [
["scientific"],
["engineering"],
["standard"],
];
for (const [notation] of testData) {
nf = new Intl.NumberFormat("en", {notation});
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
for (const compactDisplay of ["short", "long"]) {
nf = new Intl.NumberFormat("en", {compactDisplay, notation});
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
}
}
|
{
"pile_set_name": "Github"
}
|
import asyncio, aiohttp, json, time, logging
from asyncio import Future, Task
from aiohttp import web
from os import getenv
from handler.handler_controller import MessageHandler
from utils import parse_msg_flags
from utils import VkController
from utils import Message, LongpollEvent, ChatChangeEvent, CallbackEvent
from utils import MessageEventData
class Bot:
__slots__ = (
"api", "handler", "logger", "logger_file", "loop",
"tasks", "sessions", "requests", "settings"
)
def __init__(self, settings, logger=None, handler=None, loop=None):
self.settings = settings
if logger:
self.logger = logger
else:
self.logger = self.init_logger()
if loop:
self.loop = loop
else:
self.loop = asyncio.get_event_loop()
self.logger.info("Initializing bot")
self.requests = []
self.sessions = []
self.tasks = []
self.logger.info("Initializing vk clients")
self.api = VkController(settings, logger=self.logger, loop=self.loop)
self.logger.info("Loading plugins")
if handler:
self.handler = handler
else:
self.handler = MessageHandler(self, self.api, initiate_plugins=False)
self.handler.initiate_plugins()
self.logger.info("Bot successfully initialized")
def init_logger(self):
logger = logging.Logger("sketal", level=logging.DEBUG if self.settings.DEBUG else logging.INFO)
formatter = logging.Formatter(
fmt=u'[%(asctime)s] %(levelname)-8s: %(message)s',
datefmt='%y.%m.%d %H:%M:%S')
file_handler = logging.FileHandler('logs.txt')
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter)
self.logger_file = file_handler
stream_handler = logging.StreamHandler()
stream_handler.setLevel(level=logging.DEBUG if self.settings.DEBUG else logging.INFO)
stream_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.addHandler(stream_handler)
return logger
def add_task(self, task):
for ctask in self.tasks[::]:
if ctask.done() or ctask.cancelled():
self.tasks.remove(ctask)
if task.done() or task.cancelled():
return
self.tasks.append(task)
return task
async def init_long_polling(self, pack, update=0):
result = None
for _ in range(4):
result = await self.api(sender=self.api.target_client). \
messages.getLongPollServer(use_ssl=1, lp_version=2)
if result:
break
time.sleep(0.5)
if not result:
self.logger.error("Unable to connect to VK's long polling server.")
exit()
if update == 0:
pack[1] = "https://" + result['server']
pack[0]['key'] = result['key']
pack[0]['ts'] = result['ts']
elif update == 2:
pack[0]['key'] = result['key']
elif update == 3:
pack[0]['key'] = result['key']
pack[0]['ts'] = result['ts']
async def init_bots_long_polling(self, pack, update=0):
result = None
for _ in range(4):
result = await self.api(sender=self.api.target_client).\
groups.getLongPollServer(group_id=self.api.get_current_id())
if result:
break
time.sleep(0.5)
if not result:
self.logger.error("Unable to connect to VK's bots long polling server.")
exit()
if update == 0:
pack[1] = result['server']
pack[0]['key'] = result['key']
pack[0]['ts'] = result['ts']
elif update == 2:
pack[0]['key'] = result['key']
elif update == 3:
pack[0]['key'] = result['key']
pack[0]['ts'] = result['ts']
async def process_longpoll_event(self, new_event):
if not new_event:
return
event_id = new_event[0]
if event_id != 4:
evnt = LongpollEvent(self.api, event_id, new_event)
return await self.process_event(evnt)
data = MessageEventData()
data.msg_id = new_event[1]
data.attaches = new_event[6]
data.time = int(new_event[4])
if 'from' in data.attaches and len(new_event) > 3:
data.user_id = int(data.attaches.pop('from'))
data.chat_id = int(new_event[3]) - 2000000000
data.is_multichat = True
else:
data.user_id = int(new_event[3])
data.is_multichat = False
# https://vk.com/dev/using_longpoll_2
flags = parse_msg_flags(new_event[2])
if flags['outbox']:
if not self.settings.READ_OUT:
return
data.is_out = True
data.full_text = new_event[5].replace('<br>', '\n')
if "fwd" in data.attaches:
data.forwarded = MessageEventData.\
parse_brief_forwarded_messages_from_lp(data.attaches.pop("fwd"))
else:
data.forwarded = []
msg = Message(self.api, data)
if await self.check_event(data.user_id, data.chat_id, data.attaches):
msg.is_event = True
await self.process_message(msg)
async def longpoll_processor(self):
pack = [{'act': 'a_check', 'key': '', 'ts': 0, 'wait': 25, 'mode': 10,
'version': 2}, ""]
await self.init_long_polling(pack)
session = aiohttp.ClientSession(loop=self.loop)
self.sessions.append(session)
while True:
try:
requ = session.get(pack[1], params=pack[0])
except aiohttp.ClientOSError:
await asyncio.sleep(0.5)
continue
self.requests.append(requ)
try:
events = json.loads(await (await requ).text())
except aiohttp.ClientOSError:
try:
self.sessions.remove(session)
except ValueError:
pass
await asyncio.sleep(0.5)
session = aiohttp.ClientSession(loop=self.loop)
self.sessions.append(session)
continue
except (asyncio.TimeoutError, aiohttp.ServerDisconnectedError):
self.logger.warning("Long polling server doesn't respond. Changing server.")
await asyncio.sleep(0.5)
await self.init_long_polling(pack)
continue
except ValueError:
await asyncio.sleep(0.5)
continue
finally:
if requ in self.requests:
self.requests.remove(requ)
failed = events.get('failed')
if failed:
err_num = int(failed)
if err_num == 1: # 1 - update timestamp
if 'ts' not in events:
await self.init_long_polling(pack)
else:
pack[0]['ts'] = events['ts']
elif err_num in (2, 3): # 2, 3 - new data for long polling
await self.init_long_polling(pack, err_num)
continue
pack[0]['ts'] = events['ts']
for event in events['updates']:
asyncio.ensure_future(self.process_longpoll_event(event))
async def bots_longpoll_processor(self):
pack = [{'act': 'a_check', 'key': '', 'ts': 0,
'wait': 25}, ""]
await self.init_bots_long_polling(pack)
session = aiohttp.ClientSession(loop=self.loop)
self.sessions.append(session)
while True:
try:
requ = session.get(pack[1], params=pack[0])
except aiohttp.ClientOSError:
await asyncio.sleep(0.5)
continue
self.requests.append(requ)
try:
events = json.loads(await (await requ).text())
except aiohttp.ClientOSError:
try:
self.sessions.remove(session)
except ValueError:
pass
await asyncio.sleep(0.5)
session = aiohttp.ClientSession(loop=self.loop)
self.sessions.append(session)
continue
except (asyncio.TimeoutError, aiohttp.ServerDisconnectedError):
self.logger.warning("Long polling server doesn't respond. Changing server.")
await asyncio.sleep(0.5)
await self.init_bots_long_polling(pack)
continue
except ValueError:
await asyncio.sleep(0.5)
continue
finally:
if requ in self.requests:
self.requests.remove(requ)
failed = events.get('failed')
if failed:
err_num = int(failed)
if err_num == 1: # 1 - update timestamp
if 'ts' not in events:
await self.init_bots_long_polling(pack)
else:
pack[0]['ts'] = events['ts']
elif err_num in (2, 3): # 2, 3 - new data for long polling
await self.init_bots_long_polling(pack, err_num)
continue
pack[0]['ts'] = events['ts']
for event in events['updates']:
if "type" not in event or "object" not in event:
continue
data_type = event["type"]
obj = event["object"]
if "user_id" in obj:
obj['user_id'] = int(obj['user_id'])
if data_type == 'message_new':
await self.process_message(
Message(self.api, MessageEventData.from_message_body(obj)))
else:
await self.process_event(
CallbackEvent(self.api, data_type, obj))
async def callback_processor(self, request):
try:
data = await request.json()
if "type" not in data or "object" not in data:
raise ValueError("Damaged data received.")
except (UnicodeDecodeError, ValueError):
return web.Response(text="ok")
data_type = data["type"]
if data_type == "confirmation":
return web.Response(text=self.settings.CONF_CODE)
obj = data["object"]
if "user_id" in obj:
obj['user_id'] = int(obj['user_id'])
if data_type == 'message_new':
await self.process_message(
Message(self.api, MessageEventData.from_message_body(obj)))
else:
await self.process_event(
CallbackEvent(self.api, data_type, obj))
return web.Response(text="ok")
def longpoll_run(self, custom_process=False):
task = self.add_task(Task(self.longpoll_processor()))
if custom_process:
return task
self.logger.info("Started to process messages")
try:
self.loop.run_until_complete(task)
except (KeyboardInterrupt, SystemExit):
self.loop.run_until_complete(self.stop())
except asyncio.CancelledError:
pass
def bots_longpoll_run(self, custom_process=False):
task = self.add_task(Task(self.bots_longpoll_processor()))
if custom_process:
return task
self.logger.info("Started to process messages")
try:
self.loop.run_until_complete(task)
except (KeyboardInterrupt, SystemExit):
self.loop.run_until_complete(self.stop())
except asyncio.CancelledError:
pass
def callback_run(self, custom_process=False):
host = getenv('IP', '127.0.0.1')
port = int(getenv('PORT', 8000))
self.logger.info("Started to process messages")
try:
app = web.Application()
app.router.add_post('/', self.callback_processor)
runner = web.AppRunner(app)
self.loop.run_until_complete(runner.setup())
site = web.TCPSite(runner, host, port)
self.loop.run_until_complete(site.start())
except OSError:
self.logger.error("Address already in use: " + str(host) + ":" + str(port))
return
task = self.add_task(Future())
if custom_process:
return task
print("======== Running on http://{}:{} ========\n"
" (Press CTRL+C to quit)".format(*server.sockets[0].getsockname()))
try:
self.loop.run_until_complete(task)
except (KeyboardInterrupt, SystemExit):
self.loop.run_until_complete(runner.cleanup())
self.loop.run_until_complete(self.stop())
async def process_message(self, msg):
asyncio.ensure_future(self.handler.process(msg), loop=self.loop)
async def check_event(self, user_id, chat_id, attaches):
if chat_id != 0 and "source_act" in attaches:
photo = attaches.get("attach1_type") + attaches.get("attach1") if "attach1" in attaches else None
evnt = ChatChangeEvent(self.api, user_id, chat_id, attaches.get("source_act"),
int(attaches.get("source_mid", 0)), attaches.get("source_text"),
attaches.get("source_old_text"), photo, int(attaches.get("from", 0)))
await self.process_event(evnt)
return True
return False
async def process_event(self, evnt):
asyncio.ensure_future(self.handler.process_event(evnt), loop=self.loop)
def coroutine_exec(self, coroutine):
if asyncio.iscoroutine(coroutine) or isinstance(coroutine, asyncio.Future):
return self.loop.run_until_complete(coroutine)
return False
async def stop_tasks(self):
self.logger.info("Attempting stop bot")
for task in self.tasks:
try:
task.cancel()
except Exception:
pass
self.logger.info("Stopped to process messages")
async def stop(self):
self.logger.info("Attempting to turn bot off")
for session in self.sessions:
await session.close()
await self.handler.stop()
await self.api.stop()
for task in self.tasks:
try:
task.cancel()
except Exception:
pass
self.logger.removeHandler(self.logger_file)
self.logger_file.close()
self.logger.info("Stopped to process messages")
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright 2007-2016, Kaazing Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kaazing.gateway.transport.ws.bridge.filter;
import static org.kaazing.mina.core.buffer.IoBufferEx.FLAG_NONE;
import static org.kaazing.mina.core.buffer.IoBufferEx.FLAG_ZERO_COPY;
import java.nio.ByteBuffer;
import org.kaazing.gateway.transport.ws.bridge.filter.WsBuffer.WsSharedBuffer;
import org.kaazing.gateway.transport.ws.bridge.filter.WsBuffer.WsUnsharedBuffer;
import org.kaazing.mina.core.buffer.AbstractIoBufferAllocatorEx;
import org.kaazing.mina.core.buffer.IoBufferAllocatorEx;
import org.kaazing.mina.core.buffer.IoBufferEx;
public class WsBufferAllocator extends AbstractIoBufferAllocatorEx<WsBuffer> {
private final IoBufferAllocatorEx<?> parent;
private final int frameOffset;
public WsBufferAllocator(IoBufferAllocatorEx<?> parent) {
this(parent, true);
}
public WsBufferAllocator(IoBufferAllocatorEx<?> parent, boolean masking) {
this.parent = parent;
this.frameOffset = masking ? 6 : 2; // masking key overhead is 4 bytes
}
@Override
public ByteBuffer allocate(int capacity, int flags) {
boolean offset = (flags & FLAG_ZERO_COPY) != FLAG_NONE;
if (offset) {
int frameOffset = this.frameOffset;
if (capacity < 126) {
// no additional offset needed
}
else if (capacity < 65535) {
frameOffset += 2;
}
else {
frameOffset += 8;
}
ByteBuffer buf = parent.allocate(frameOffset + capacity, flags);
buf.position(buf.position() + frameOffset);
buf.limit(buf.position() + capacity);
return buf;
}
else {
// no offset
return parent.allocate(capacity, flags);
}
}
@Override
public WsBuffer wrap(ByteBuffer nioBuffer, int flags) {
boolean shared = (flags & IoBufferEx.FLAG_SHARED) != IoBufferEx.FLAG_NONE;
return shared ? new WsSharedBuffer(nioBuffer) : new WsUnsharedBuffer(nioBuffer);
}
}
|
{
"pile_set_name": "Github"
}
|
/* As the included file, but specifying ENOSYS with message.
#notarget: cris*-*-elf
#sim: --cris-unknown-syscall=enosys
#output: Unimplemented syscall: 0 (0x3, 0x2, 0x1, 0x4, 0x6, 0x5)\n
#output: ENOSYS\n
#output: xyzzy\n
*/
#include "syscall2.c"
|
{
"pile_set_name": "Github"
}
|
import logging
from owtf.config import config_handler
from owtf.plugin.params import plugin_params
DESCRIPTION = "Sends a bunch of URLs through selenium"
CATEGORIES = ["RCE", "SQLI", "XSS", "CHARSET"]
def run(PluginInfo):
Content = []
logging.info(
"WARNING: This plugin requires a small selenium installation, please run '%s' if you have issues"
% config.get_val("INSTALL_SCRIPT")
)
args = {
"Description": DESCRIPTION,
"Mandatory": {
"BASE_URL": "The URL to be pre-pended to the tests",
"CATEGORY": "Category to use (i.e. " + ", ".join(sorted(CATEGORIES)) + ")",
},
"Optional": {"REPEAT_DELIM": config_handler.get_val("REPEAT_DELIM_DESCRIP")},
}
for args in plugin_params.get_args(args, PluginInfo):
plugin_params.set_config(args)
InputFile = config_handler.get_val("SELENIUM_URL_VECTORS_" + args["CATEGORY"])
URLLauncher = ServiceLocator.get_component(
"selenium_handler"
).CreateURLLauncher(
{"BASE_URL": args["BASE_URL"], "INPUT_FILE": InputFile}
)
URLLauncher.run()
return Content
|
{
"pile_set_name": "Github"
}
|
CodeMirror.defineMode('rst', function(config, options) {
function setState(state, fn, ctx) {
state.fn = fn;
setCtx(state, ctx);
}
function setCtx(state, ctx) {
state.ctx = ctx || {};
}
function setNormal(state, ch) {
if (ch && (typeof ch !== 'string')) {
var str = ch.current();
ch = str[str.length-1];
}
setState(state, normal, {back: ch});
}
function hasMode(mode) {
return mode && CodeMirror.modes.hasOwnProperty(mode);
}
function getMode(mode) {
if (hasMode(mode)) {
return CodeMirror.getMode(config, mode);
} else {
return null;
}
}
var verbatimMode = getMode(options.verbatim);
var pythonMode = getMode('python');
var reSection = /^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/;
var reDirective = /^\s*\w([-:.\w]*\w)?::(\s|$)/;
var reHyperlink = /^\s*_[\w-]+:(\s|$)/;
var reFootnote = /^\s*\[(\d+|#)\](\s|$)/;
var reCitation = /^\s*\[[A-Za-z][\w-]*\](\s|$)/;
var reFootnoteRef = /^\[(\d+|#)\]_/;
var reCitationRef = /^\[[A-Za-z][\w-]*\]_/;
var reDirectiveMarker = /^\.\.(\s|$)/;
var reVerbatimMarker = /^::\s*$/;
var rePreInline = /^[-\s"([{</:]/;
var rePostInline = /^[-\s`'")\]}>/:.,;!?\\_]/;
var reExamples = /^\s+(>>>|In \[\d+\]:)\s/;
function normal(stream, state) {
var ch, sol, i;
if (stream.eat(/\\/)) {
ch = stream.next();
setNormal(state, ch);
return null;
}
sol = stream.sol();
if (sol && (ch = stream.eat(reSection))) {
for (i = 0; stream.eat(ch); i++);
if (i >= 3 && stream.match(/^\s*$/)) {
setNormal(state, null);
return 'header';
} else {
stream.backUp(i + 1);
}
}
if (sol && stream.match(reDirectiveMarker)) {
if (!stream.eol()) {
setState(state, directive);
}
return 'meta';
}
if (stream.match(reVerbatimMarker)) {
if (!verbatimMode) {
setState(state, verbatim);
} else {
var mode = verbatimMode;
setState(state, verbatim, {
mode: mode,
local: mode.startState()
});
}
return 'meta';
}
if (sol && stream.match(reExamples, false)) {
if (!pythonMode) {
setState(state, verbatim);
return 'meta';
} else {
var mode = pythonMode;
setState(state, verbatim, {
mode: mode,
local: mode.startState()
});
return null;
}
}
function testBackward(re) {
return sol || !state.ctx.back || re.test(state.ctx.back);
}
function testForward(re) {
return stream.eol() || stream.match(re, false);
}
function testInline(re) {
return stream.match(re) && testBackward(/\W/) && testForward(/\W/);
}
if (testInline(reFootnoteRef)) {
setNormal(state, stream);
return 'footnote';
}
if (testInline(reCitationRef)) {
setNormal(state, stream);
return 'citation';
}
ch = stream.next();
if (testBackward(rePreInline)) {
if ((ch === ':' || ch === '|') && stream.eat(/\S/)) {
var token;
if (ch === ':') {
token = 'builtin';
} else {
token = 'atom';
}
setState(state, inline, {
ch: ch,
wide: false,
prev: null,
token: token
});
return token;
}
if (ch === '*' || ch === '`') {
var orig = ch,
wide = false;
ch = stream.next();
if (ch == orig) {
wide = true;
ch = stream.next();
}
if (ch && !/\s/.test(ch)) {
var token;
if (orig === '*') {
token = wide ? 'strong' : 'em';
} else {
token = wide ? 'string' : 'string-2';
}
setState(state, inline, {
ch: orig, // inline() has to know what to search for
wide: wide, // are we looking for `ch` or `chch`
prev: null, // terminator must not be preceeded with whitespace
token: token // I don't want to recompute this all the time
});
return token;
}
}
}
setNormal(state, ch);
return null;
}
function inline(stream, state) {
var ch = stream.next(),
token = state.ctx.token;
function finish(ch) {
state.ctx.prev = ch;
return token;
}
if (ch != state.ctx.ch) {
return finish(ch);
}
if (/\s/.test(state.ctx.prev)) {
return finish(ch);
}
if (state.ctx.wide) {
ch = stream.next();
if (ch != state.ctx.ch) {
return finish(ch);
}
}
if (!stream.eol() && !rePostInline.test(stream.peek())) {
if (state.ctx.wide) {
stream.backUp(1);
}
return finish(ch);
}
setState(state, normal);
setNormal(state, ch);
return token;
}
function directive(stream, state) {
var token = null;
if (stream.match(reDirective)) {
token = 'attribute';
} else if (stream.match(reHyperlink)) {
token = 'link';
} else if (stream.match(reFootnote)) {
token = 'quote';
} else if (stream.match(reCitation)) {
token = 'quote';
} else {
stream.eatSpace();
if (stream.eol()) {
setNormal(state, stream);
return null;
} else {
stream.skipToEnd();
setState(state, comment);
return 'comment';
}
}
// FIXME this is unreachable
setState(state, body, {start: true});
return token;
}
function body(stream, state) {
var token = 'body';
if (!state.ctx.start || stream.sol()) {
return block(stream, state, token);
}
stream.skipToEnd();
setCtx(state);
return token;
}
function comment(stream, state) {
return block(stream, state, 'comment');
}
function verbatim(stream, state) {
if (!verbatimMode) {
return block(stream, state, 'meta');
} else {
if (stream.sol()) {
if (!stream.eatSpace()) {
setNormal(state, stream);
}
return null;
}
return verbatimMode.token(stream, state.ctx.local);
}
}
function block(stream, state, token) {
if (stream.eol() || stream.eatSpace()) {
stream.skipToEnd();
return token;
} else {
setNormal(state, stream);
return null;
}
}
return {
startState: function() {
return {fn: normal, ctx: {}};
},
copyState: function(state) {
return {fn: state.fn, ctx: state.ctx};
},
token: function(stream, state) {
var token = state.fn(stream, state);
return token;
}
};
}, "python");
CodeMirror.defineMIME("text/x-rst", "rst");
|
{
"pile_set_name": "Github"
}
|
'\" t
.\" Title: nvme-wdc-vs-drive-info
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 06/16/2020
.\" Manual: NVMe Manual
.\" Source: NVMe
.\" Language: English
.\"
.TH "NVME\-WDC\-VS\-DRIVE" "1" "06/16/2020" "NVMe" "NVMe Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
nvme-wdc-vs-drive-info \- Send the NVMe WDC vs\-drive\-info command, return result
.SH "SYNOPSIS"
.sp
.nf
\fInvme wdc vs\-drive\-info\fR <device>
.fi
.SH "DESCRIPTION"
.sp
For the NVMe device given, send the unique WDC vs\-drive\-info command and provide the additional drive information\&.
.sp
The <device> parameter is mandatory and must be the NVMe character device (ex: /dev/nvme0)\&.
.sp
This will only work on WDC devices supporting this feature\&. Results for any other device are undefined\&.
.sp
On success it returns 0, error code otherwise\&.
.SH "OUTPUT EXPLANATION"
.sp
There are 2 fields returned from this command:
.sp
Drive HW Revision
.sp
FTL Unit Size
.SH "EXAMPLE"
.sp
# nvme wdc vs\-drive\-info /dev/nvme0
.SH "NVME"
.sp
Part of the nvme\-user suite\&.
|
{
"pile_set_name": "Github"
}
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <ContactsFoundation/CNObservable.h>
@protocol CNCancelable, CNObservable;
@interface _CNSamplingObservable : CNObservable
{
id <CNObservable> _observable;
id <CNObservable> _sampler;
id _sample;
id <CNCancelable> _timer;
}
- (void).cxx_destruct;
@property(retain) id <CNCancelable> timer; // @synthesize timer=_timer;
@property(retain) id sample; // @synthesize sample=_sample;
@property(readonly, nonatomic) id <CNObservable> sampler; // @synthesize sampler=_sampler;
@property(readonly, nonatomic) id <CNObservable> observable; // @synthesize observable=_observable;
- (void)sendSampleToObserver:(id)arg1;
- (void)receiveResult:(id)arg1;
- (id)subscribe:(id)arg1;
- (id)initWithObservable:(id)arg1 sampler:(id)arg2;
@end
|
{
"pile_set_name": "Github"
}
|
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 15
productGUID: 1ff9ff210e8d84cec99d6d6379082df4
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: Klak
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 0
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
m_SplashScreenBackgroundLandscapeAspect: 1
m_SplashScreenBackgroundPortraitAspect: 1
m_SplashScreenBackgroundLandscapeUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenBackgroundPortraitUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenLogos: []
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 1
m_MTRendering: 1
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
iosAppInBackgroundBehavior: 0
displayResolutionDialog: 1
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
preserveFramebufferAlpha: 0
disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1
androidRenderOutsideSafeArea: 0
androidBlitType: 0
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 1
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0
deferSystemGesturesMode: 0
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
bakeCollisionMeshes: 0
forceSingleInstance: 0
resizableWindow: 0
useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games
gpuSkinning: 0
graphicsJobs: 0
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 0
allowFullscreenSwitch: 1
graphicsJobMode: 0
fullscreenMode: 1
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
metalFramebufferOnly: 0
xboxOneResolution: 0
xboxOneSResolution: 0
xboxOneXResolution: 3
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
xboxOneDisableEsram: 0
xboxOnePresentImmediateThreshold: 0
switchQueueCommandMemory: 0
vulkanEnableSetSRGBWrite: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.0
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 0
xboxOneEnable7thCore: 0
isWsaHolographicRemotingEnabled: 0
vrSettings:
cardboard:
depthFormat: 0
enableTransitionView: 0
daydream:
depthFormat: 0
useSustainedPerformanceMode: 0
enableVideoLayer: 0
useProtectedVideoMemory: 0
minimumSupportedHeadTracking: 0
maximumSupportedHeadTracking: 1
hololens:
depthFormat: 1
depthBufferSharingEnabled: 0
oculus:
sharedDepthBuffer: 0
dashSupport: 0
enable360StereoCapture: 0
protectGraphicsMemory: 0
enableFrameTimingStats: 0
useHDRDisplay: 0
m_ColorGamuts: 00000000
targetPixelDensity: 30
resolutionScalingMode: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Android: com.Company.ProductName
Standalone: unity.DefaultCompany.Klak
Tizen: com.Company.ProductName
iOS: com.Company.ProductName
tvOS: com.Company.ProductName
buildNumber:
iOS: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 16
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1
aotOptions:
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
keepLoadedShadersAlive: 0
StripUnusedMeshComponents: 0
VertexChannelCompressionMask: 214
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 9.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 9.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
iPhoneSplashScreen: {fileID: 0}
iPhoneHighResSplashScreen: {fileID: 0}
iPhoneTallHighResSplashScreen: {fileID: 0}
iPhone47inSplashScreen: {fileID: 0}
iPhone55inPortraitSplashScreen: {fileID: 0}
iPhone55inLandscapeSplashScreen: {fileID: 0}
iPhone58inPortraitSplashScreen: {fileID: 0}
iPhone58inLandscapeSplashScreen: {fileID: 0}
iPadPortraitSplashScreen: {fileID: 0}
iPadHighResPortraitSplashScreen: {fileID: 0}
iPadLandscapeSplashScreen: {fileID: 0}
iPadHighResLandscapeSplashScreen: {fileID: 0}
appleTVSplashScreen: {fileID: 0}
appleTVSplashScreen2x: {fileID: 0}
tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: []
tvOSTopShelfImageWideLayers: []
tvOSTopShelfImageWideLayers2x: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSUseLaunchScreenStoryboard: 0
iOSLaunchScreenCustomStoryboardPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 1
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
tvOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
appleEnableProMotion: 0
clonedFromGUID: 00000000000000000000000000000000
templatePackageId:
templateDefaultScene:
AndroidTargetArchitectures: 5
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 1
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons:
- m_BuildTarget:
m_Icons:
- serializedVersion: 2
m_Icon: {fileID: 0}
m_Width: 128
m_Height: 128
m_Kind: 0
m_BuildTargetPlatformIcons: []
m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs: []
m_BuildTargetVRSettings: []
m_BuildTargetEnableVuforiaSettings: []
openGLRequireES31: 0
openGLRequireES31AEP: 0
m_TemplateCustomTags: {}
mobileMTRendering:
iPhone: 1
tvOS: 1
m_BuildTargetGroupLightmapEncodingQuality:
- m_BuildTarget: Standalone
m_EncodingQuality: 1
- m_BuildTarget: XboxOne
m_EncodingQuality: 1
- m_BuildTarget: PS4
m_EncodingQuality: 1
m_BuildTargetGroupLightmapSettings: []
playModeTestRunnerEnabled: 0
runPlayModeTestAsEditModeTest: 0
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
switchTitleNames_0:
switchTitleNames_1:
switchTitleNames_2:
switchTitleNames_3:
switchTitleNames_4:
switchTitleNames_5:
switchTitleNames_6:
switchTitleNames_7:
switchTitleNames_8:
switchTitleNames_9:
switchTitleNames_10:
switchTitleNames_11:
switchTitleNames_12:
switchTitleNames_13:
switchTitleNames_14:
switchPublisherNames_0:
switchPublisherNames_1:
switchPublisherNames_2:
switchPublisherNames_3:
switchPublisherNames_4:
switchPublisherNames_5:
switchPublisherNames_6:
switchPublisherNames_7:
switchPublisherNames_8:
switchPublisherNames_9:
switchPublisherNames_10:
switchPublisherNames_11:
switchPublisherNames_12:
switchPublisherNames_13:
switchPublisherNames_14:
switchIcons_0: {fileID: 0}
switchIcons_1: {fileID: 0}
switchIcons_2: {fileID: 0}
switchIcons_3: {fileID: 0}
switchIcons_4: {fileID: 0}
switchIcons_5: {fileID: 0}
switchIcons_6: {fileID: 0}
switchIcons_7: {fileID: 0}
switchIcons_8: {fileID: 0}
switchIcons_9: {fileID: 0}
switchIcons_10: {fileID: 0}
switchIcons_11: {fileID: 0}
switchIcons_12: {fileID: 0}
switchIcons_13: {fileID: 0}
switchIcons_14: {fileID: 0}
switchSmallIcons_0: {fileID: 0}
switchSmallIcons_1: {fileID: 0}
switchSmallIcons_2: {fileID: 0}
switchSmallIcons_3: {fileID: 0}
switchSmallIcons_4: {fileID: 0}
switchSmallIcons_5: {fileID: 0}
switchSmallIcons_6: {fileID: 0}
switchSmallIcons_7: {fileID: 0}
switchSmallIcons_8: {fileID: 0}
switchSmallIcons_9: {fileID: 0}
switchSmallIcons_10: {fileID: 0}
switchSmallIcons_11: {fileID: 0}
switchSmallIcons_12: {fileID: 0}
switchSmallIcons_13: {fileID: 0}
switchSmallIcons_14: {fileID: 0}
switchManualHTML:
switchAccessibleURLs:
switchLegalInformation:
switchMainThreadStackSize: 1048576
switchPresenceGroupId:
switchLogoHandling: 0
switchReleaseVersion: 0
switchDisplayVersion: 1.0.0
switchStartupUserAccount: 0
switchTouchScreenUsage: 0
switchSupportedLanguagesMask: 0
switchLogoType: 0
switchApplicationErrorCodeCategory:
switchUserAccountSaveDataSize: 0
switchUserAccountSaveDataJournalSize: 0
switchApplicationAttribute: 0
switchCardSpecSize: -1
switchCardSpecClock: -1
switchRatingsMask: 0
switchRatingsInt_0: 0
switchRatingsInt_1: 0
switchRatingsInt_2: 0
switchRatingsInt_3: 0
switchRatingsInt_4: 0
switchRatingsInt_5: 0
switchRatingsInt_6: 0
switchRatingsInt_7: 0
switchRatingsInt_8: 0
switchRatingsInt_9: 0
switchRatingsInt_10: 0
switchRatingsInt_11: 0
switchLocalCommunicationIds_0:
switchLocalCommunicationIds_1:
switchLocalCommunicationIds_2:
switchLocalCommunicationIds_3:
switchLocalCommunicationIds_4:
switchLocalCommunicationIds_5:
switchLocalCommunicationIds_6:
switchLocalCommunicationIds_7:
switchParentalControl: 0
switchAllowsScreenshot: 1
switchAllowsVideoCapturing: 1
switchAllowsRuntimeAddOnContentInstall: 0
switchDataLossConfirmation: 0
switchUserAccountLockEnabled: 0
switchSupportedNpadStyles: 3
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64
switchTcpAutoSendBufferSizeMax: 256
switchTcpAutoReceiveBufferSizeMax: 256
switchUdpSendBufferSize: 9
switchUdpReceiveBufferSize: 42
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 1
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 60
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4StartupImagesFolder:
ps4IconImagesFolder:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 1
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4ProGarlicHeapSize: 2560
ps4Passcode: PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbEW
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
enableApplicationExit: 0
resetTempFolder: 1
restrictedAudioUsageRights: 0
ps4UseResolutionFallback: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 2
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4PatchDayOne: 0
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
monoEnv:
splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0}
spritePackerPolicy:
webGLMemorySize: 256
webGLExceptionSupport: 1
webGLNameFilesAsHashes: 0
webGLDataCaching: 0
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 1
webGLLinkerTarget: 0
webGLThreadsSupport: 0
scriptingDefineSymbols: {}
platformArchitecture:
iOS: 2
scriptingBackend:
Android: 0
Standalone: 0
WebGL: 1
WebPlayer: 0
iOS: 1
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild:
iOS: 1
allowUnsafeCode: 0
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
apiCompatibilityLevelPerPlatform: {}
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: Klak
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: Klak
wsaImages: {}
metroTileShortName:
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroSupportStreamingInstall: 0
metroLastRequiredScene: 0
metroDefaultTileSize: 1
metroTileForegroundText: 1
metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
metroCompilationOverrides: 1
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOneVersion: 1.0.0.0
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneLanguage:
- enus
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnableGPUVariability: 0
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
XboxOneXTitleMemory: 8
xboxOneScriptCompiler: 0
XboxOneOverrideIdentityName:
vrEditorSettings:
daydream:
daydreamIconForeground: {fileID: 0}
daydreamIconBackground: {fileID: 0}
cloudServicesEnabled: {}
luminIcon:
m_Name:
m_ModelFolderPath:
m_PortalFolderPath:
luminCert:
m_CertPath:
m_PrivateKeyPath:
luminIsChannelApp: 0
luminVersion:
m_VersionCode: 1
m_VersionName:
facebookSdkVersion: 7.9.4
facebookAppId:
facebookCookies: 1
facebookLogging: 1
facebookStatus: 1
facebookXfbml: 0
facebookFrictionlessRequests: 1
apiCompatibilityLevel: 6
cloudProjectId:
framebufferDepthMemorylessMode: 0
projectName:
organizationId:
cloudEnabled: 0
enableNativePlatformBackendsForNewInputSystem: 0
disableOldInputManagerSupport: 0
legacyClampBlendShapeWeights: 1
|
{
"pile_set_name": "Github"
}
|
package url
import (
"strconv"
)
type Encoding int
const (
EncodePath Encoding = 1 + iota
EncodeUserPassword
EncodeQueryComponent
EncodeFragment
)
type EscapeError string
func (e EscapeError) Error() string {
return "invalid URL escape " + strconv.Quote(string(e))
}
func ishex(c byte) bool {
switch {
case '0' <= c && c <= '9':
return true
case 'a' <= c && c <= 'f':
return true
case 'A' <= c && c <= 'F':
return true
}
return false
}
func unhex(c byte) byte {
switch {
case '0' <= c && c <= '9':
return c - '0'
case 'a' <= c && c <= 'f':
return c - 'a' + 10
case 'A' <= c && c <= 'F':
return c - 'A' + 10
}
return 0
}
// Return true if the specified character should be escaped when
// appearing in a URL string, according to RFC 3986.
// When 'all' is true the full range of reserved characters are matched.
func shouldEscape(c byte, mode Encoding) bool {
// §2.3 Unreserved characters (alphanum)
if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
return false
}
switch c {
case '-', '_', '.', '~': // §2.3 Unreserved characters (mark)
return false
case '$', '&', '+', ',', '/', ':', ';', '=', '?', '@': // §2.2 Reserved characters (reserved)
// Different sections of the URL allow a few of
// the reserved characters to appear unescaped.
switch mode {
case EncodePath: // §3.3
// The RFC allows : @ & = + $ but saves / ; , for assigning
// meaning to individual path segments. This package
// only manipulates the path as a whole, so we allow those
// last two as well. That leaves only ? to escape.
return c == '?'
case EncodeUserPassword: // §3.2.2
// The RFC allows ; : & = + $ , in userinfo, so we must escape only @ and /.
// The parsing of userinfo treats : as special so we must escape that too.
return c == '@' || c == '/' || c == ':'
case EncodeQueryComponent: // §3.4
// The RFC reserves (so we must escape) everything.
return true
case EncodeFragment: // §4.1
// The RFC text is silent but the grammar allows
// everything, so escape nothing.
return false
}
}
// Everything else must be escaped.
return true
}
// QueryUnescape does the inverse transformation of QueryEscape, converting
// %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if
// any % is not followed by two hexadecimal digits.
func QueryUnescape(s string) (string, error) {
return UnescapeEx(s, EncodeQueryComponent)
}
func Unescape(s string) (string, error) {
return UnescapeEx(s, EncodePath)
}
// UnescapeEx unescapes a string; the mode specifies
// which section of the URL string is being unescaped.
func UnescapeEx(s string, mode Encoding) (string, error) {
// Count %, check that they're well-formed.
n := 0
hasPlus := false
for i := 0; i < len(s); {
switch s[i] {
case '%':
n++
if i+2 >= len(s) || !ishex(s[i+1]) || !ishex(s[i+2]) {
s = s[i:]
if len(s) > 3 {
s = s[0:3]
}
return "", EscapeError(s)
}
i += 3
case '+':
hasPlus = mode == EncodeQueryComponent
i++
default:
i++
}
}
if n == 0 && !hasPlus {
return s, nil
}
t := make([]byte, len(s)-2*n)
j := 0
for i := 0; i < len(s); {
switch s[i] {
case '%':
t[j] = unhex(s[i+1])<<4 | unhex(s[i+2])
j++
i += 3
case '+':
if mode == EncodeQueryComponent {
t[j] = ' '
} else {
t[j] = '+'
}
j++
i++
default:
t[j] = s[i]
j++
i++
}
}
return string(t), nil
}
// QueryEscape escapes the string so it can be safely placed
// inside a URL query.
func QueryEscape(s string) string {
return EscapeEx(s, EncodeQueryComponent)
}
func Escape(s string) string {
return EscapeEx(s, EncodePath)
}
func EscapeEx(s string, mode Encoding) string {
spaceCount, hexCount := 0, 0
for i := 0; i < len(s); i++ {
c := s[i]
if shouldEscape(c, mode) {
if c == ' ' && mode == EncodeQueryComponent {
spaceCount++
} else {
hexCount++
}
}
}
if spaceCount == 0 && hexCount == 0 {
return s
}
t := make([]byte, len(s)+2*hexCount)
j := 0
for i := 0; i < len(s); i++ {
switch c := s[i]; {
case c == ' ' && mode == EncodeQueryComponent:
t[j] = '+'
j++
case shouldEscape(c, mode):
t[j] = '%'
t[j+1] = "0123456789ABCDEF"[c>>4]
t[j+2] = "0123456789ABCDEF"[c&15]
j += 3
default:
t[j] = s[i]
j++
}
}
return string(t)
}
|
{
"pile_set_name": "Github"
}
|
package logrus
import "time"
const defaultTimestampFormat = time.RFC3339
// The Formatter interface is used to implement a custom Formatter. It takes an
// `Entry`. It exposes all the fields, including the default ones:
//
// * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
// * `entry.Data["time"]`. The timestamp.
// * `entry.Data["level"]. The level the entry was logged at.
//
// Any additional fields added with `WithField` or `WithFields` are also in
// `entry.Data`. Format is expected to return an array of bytes which are then
// logged to `logger.Out`.
type Formatter interface {
Format(*Entry) ([]byte, error)
}
// This is to not silently overwrite `time`, `msg` and `level` fields when
// dumping it. If this code wasn't there doing:
//
// logrus.WithField("level", 1).Info("hello")
//
// Would just silently drop the user provided level. Instead with this code
// it'll logged as:
//
// {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."}
//
// It's not exported because it's still using Data in an opinionated way. It's to
// avoid code duplication between the two default formatters.
func prefixFieldClashes(data Fields) {
if t, ok := data["time"]; ok {
data["fields.time"] = t
}
if m, ok := data["msg"]; ok {
data["fields.msg"] = m
}
if l, ok := data["level"]; ok {
data["fields.level"] = l
}
}
|
{
"pile_set_name": "Github"
}
|
.ui-body-c, .ui-overlay-c {
border: 0px solid #aaa /*{c-body-border}*/;
color: #333 /*{c-body-color}*/;
text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #fff /*{c-body-shadow-color}*/;
/* background: transparent; */
background-color: transparent;
background-image:none;
background: none;
}
/* in case you want to change color of selector-circle
.ui-btn {
background: red;
background-color: red;
background-image:none;
}
*/
.ui-slider-input {
background: lightgrey;
background-color: lightgrey;
background-image:none;
}
.ui-slider-popup {
background: lightgrey;
background-color: lightgrey;
background-image:none;
}
/* fixes focus scrolling */
.ui-mobile .ui-page-active {
overflow: hidden;
}
/* fixes info button not centered */
.ui-footer-fixed {
padding-left: 0;
}
|
{
"pile_set_name": "Github"
}
|
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************
* Copyright (c) 2017 FreeCAD Developers *
* Author: Bernd Hahnebach <bernd@bimstatik.ch> *
* Based on src/Mod/Fem/Gui/DlgSettingsFemCcx.h *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#define FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
#include <Gui/PropertyPage.h>
namespace FemGui {
class Ui_DlgSettingsFemExportAbaqus;
class DlgSettingsFemExportAbaqusImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
public:
DlgSettingsFemExportAbaqusImp( QWidget* parent = 0 );
~DlgSettingsFemExportAbaqusImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
Ui_DlgSettingsFemExportAbaqus* ui;
};
} // namespace FemGui
#endif // FEMGUI_DLGSETTINGSFEMEXPORTABAQUSIMP_H
|
{
"pile_set_name": "Github"
}
|
import-module au
$releases = "http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html"
function global:au_SearchReplace {
@{
"$($Latest.PackageName).nuspec" = @{
"(\<dependency .+?`"$($Latest.PackageName).portable`" version=)`"([^`"]+)`"" = "`$1`"[$($Latest.Version)]`""
}
}
}
function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing
#https://the.earth.li/~sgtatham/putty/latest/x86/putty-0.67-installer.msi
$url32Installer = $download_page.links | ? href -match '\.msi$' | ? href -notmatch '64bit' | select -First 1 -expand href
$url64Installer = $download_page.links | ? href -match '64bit.*\.msi$' | select -First 1 -expand href
$version = $url32Installer -split '\-' | select -last 1 -skip 1
#https://the.earth.li/~sgtatham/putty/latest/x86/putty.zip
$rePortable = "putty.zip"
$portables = $download_page.links | ? href -match $rePortable | select -First 2 -expand href
$url32Portable = $download_page.links | ? href -match "w32.*$rePortable" | select -First 1 -expand href
$url64Portable = $download_page.links | ? href -match "w64.*$rePortable" | select -First 1 -expand href
if (!$url32Installer -or !$url64Installer -or !$url32Portable -or !$url64Portable) {
throw "Either 32bit or 64bit installer/portable was not found. Please check if naming have changed."
}
return @{
URL32Installer = $url32Installer
URL64Installer = $url64Installer
URL32Portable = $url32Portable
URL64Portable = $url64Portable
Version = $version
}
}
if ($MyInvocation.InvocationName -ne '.') { # run the update only if script is not sourced
update -ChecksumFor none
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
set -e
cd $(dirname $0)
. ../../common/config.sh
. ../../common/log.sh
log_start "$0" "usermod does not require a shadow file"
save_config
# restore the files on exit
trap 'log_status "$0" "FAILURE"; restore_config' 0
change_config
echo -n "Remove /etc/shadow..."
rm -f /etc/shadow
echo "done"
echo -n "Change the user's name (usermod -l foo2 foo)..."
usermod -l foo2 foo
echo "OK"
echo -n "Check the passwd file..."
../../common/compare_file.pl data/passwd /etc/passwd
echo "OK"
echo -n "Check the group file..."
../../common/compare_file.pl data/group /etc/group
echo "OK"
echo -n "Check the shadow file..."
test ! -f /etc/shadow
echo "OK"
echo -n "Check the gshadow file..."
../../common/compare_file.pl data/gshadow /etc/gshadow
echo "OK"
log_status "$0" "SUCCESS"
restore_config
trap '' 0
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
* Project: libspatialindex - A C++ library for spatial indexing
* Author: Marios Hadjieleftheriou, mhadji@gmail.com
******************************************************************************
* Copyright (c) 2002, Marios Hadjieleftheriou
*
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
******************************************************************************/
#include <spatialindex/tools/Tools.h>
#include <cmath>
#include <limits>
#include <set>
#define INSERT 1
#define DELETE 0
#define QUERY 2
class Region
{
public:
double m_xmin, m_ymin, m_xmax, m_ymax;
Region(double x1, double y1, double x2, double y2)
{
m_xmin = (x1 < x2) ? x1 : x2;
m_ymin = (y1 < y2) ? y1 : y2;
m_xmax = (x1 > x2) ? x1 : x2;
m_ymax = (y1 > y2) ? y1 : y2;
}
};
int main(int argc, char** argv)
{
if (argc != 3)
{
std::cerr << "Usage: " << argv[0] << " number_of_data time_instants." << std::endl;
return -1;
}
size_t simulationLength = atol(argv[2]);
size_t numberOfObjects = atol(argv[1]);
std::map<size_t, Region> data;
Tools::Random rnd;
for (size_t i = 0; i < numberOfObjects; i++)
{
double x = rnd.nextUniformDouble();
double y = rnd.nextUniformDouble();
double dx = rnd.nextUniformDouble(0.0001, 0.1);
double dy = rnd.nextUniformDouble(0.0001, 0.1);
Region r = Region(x, y, x + dx, y + dy);
data.insert(std::pair<size_t, Region>(i, r));
std::cout << INSERT << " " << i << " " << r.m_xmin << " " << r.m_ymin << " "
<< r.m_xmax << " " << r.m_ymax << std::endl;
}
if (simulationLength == 0)
{
for (size_t i = 0; i < 1000; i++)
{
double stx = rnd.nextUniformDouble();
double sty = rnd.nextUniformDouble();
std::cout << QUERY << " 9999999 " << stx << " " << sty << " " << (stx + 0.01) << " " << (sty + 0.01) << std::endl;
}
}
size_t A = static_cast<size_t>(std::floor(static_cast<double>(numberOfObjects) * 0.05));
for (size_t T = 1; T <= simulationLength; T++)
{
std::cerr << (simulationLength + 1 - T) << std::endl;
std::set<size_t> examined;
for (size_t a = 0; a < A; a++)
{
// find an id that is not yet examined.
size_t id = static_cast<size_t>(rnd.nextUniformLong(0, numberOfObjects));
std::set<size_t>::iterator itSet = examined.find(id);
while (itSet != examined.end())
{
id = static_cast<size_t>(rnd.nextUniformLong(0, numberOfObjects));
itSet = examined.find(id);
}
examined.insert(id);
std::map<size_t, Region>::iterator itMap = data.find(id);
assert(itMap != data.end());
std::cout << DELETE << " " << id << " " << (*itMap).second.m_xmin << " " << (*itMap).second.m_ymin << " "
<< (*itMap).second.m_xmax << " " << (*itMap).second.m_ymax << std::endl;
double x = rnd.nextUniformDouble();
double dx = rnd.nextUniformDouble(0.0001, 0.1);
(*itMap).second.m_xmin = x;
(*itMap).second.m_xmax = x + dx;
double y = rnd.nextUniformDouble();
double dy = rnd.nextUniformDouble(0.0001, 0.1);
(*itMap).second.m_ymin = y;
(*itMap).second.m_ymax = y + dy;
std::cout << INSERT << " " << id << " " << (*itMap).second.m_xmin << " " << (*itMap).second.m_ymin << " "
<< (*itMap).second.m_xmax << " " << (*itMap).second.m_ymax << std::endl;
}
double stx = rnd.nextUniformDouble();
double sty = rnd.nextUniformDouble();
std::cout << QUERY << " 9999999 " << stx << " " << sty << " " << (stx + 0.01) << " " << (sty + 0.01) << std::endl;
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import json
from json import encoder
import random
import string
import time
import os
import sys
import misc.utils as utils
def language_eval(dataset, preds, model_id, split):
import sys
sys.path.append("coco-caption")
annFile = 'coco-caption/annotations/captions_val2014.json'
from pycocotools.coco import COCO
from pycocoevalcap.eval import COCOEvalCap
encoder.FLOAT_REPR = lambda o: format(o, '.3f')
if not os.path.isdir('eval_results'):
os.mkdir('eval_results')
cache_path = os.path.join('eval_results/', model_id + '_' + split + '.json')
coco = COCO(annFile)
valids = coco.getImgIds()
# filter results to only those in MSCOCO validation set (will be about a third)
preds_filt = [p for p in preds if p['image_id'] in valids]
print('using %d/%d predictions' % (len(preds_filt), len(preds)))
json.dump(preds_filt, open(cache_path, 'w')) # serialize to temporary json file. Sigh, COCO API...
cocoRes = coco.loadRes(cache_path)
cocoEval = COCOEvalCap(coco, cocoRes)
cocoEval.params['image_id'] = cocoRes.getImgIds()
cocoEval.evaluate()
# create output dictionary
out = {}
for metric, score in cocoEval.eval.items():
out[metric] = score
imgToEval = cocoEval.imgToEval
for p in preds_filt:
image_id, caption = p['image_id'], p['caption']
imgToEval[image_id]['caption'] = caption
with open(cache_path, 'w') as outfile:
json.dump({'overall': out, 'imgToEval': imgToEval}, outfile)
return out
def eval_split(model, crit, loader, eval_kwargs={}):
verbose = eval_kwargs.get('verbose', True)
num_images = eval_kwargs.get('num_images', eval_kwargs.get('val_images_use', -1))
split = eval_kwargs.get('split', 'val')
lang_eval = eval_kwargs.get('language_eval', 0)
dataset = eval_kwargs.get('dataset', 'coco')
beam_size = eval_kwargs.get('beam_size', 1)
# Make sure in the evaluation mode
model.eval()
loader.reset_iterator(split)
n = 0
loss = 0
loss_sum = 0
loss_evals = 1e-8
predictions = []
while True:
data = loader.get_batch(split)
n = n + loader.batch_size
if data.get('labels', None) is not None:
# forward the model to get loss
tmp = [data['fc_feats'], data['att_feats'], data['labels'], data['masks']]
tmp = [Variable(torch.from_numpy(_), volatile=True).cuda() for _ in tmp]
fc_feats, att_feats, labels, masks = tmp
loss = crit(model(fc_feats, att_feats, labels), labels[:,1:], masks[:,1:]).data[0]
loss_sum = loss_sum + loss
loss_evals = loss_evals + 1
# forward the model to also get generated samples for each image
# Only leave one feature for each image, in case duplicate sample
tmp = [data['fc_feats'][np.arange(loader.batch_size) * loader.seq_per_img],
data['att_feats'][np.arange(loader.batch_size) * loader.seq_per_img]]
tmp = [Variable(torch.from_numpy(_), volatile=True).cuda() for _ in tmp]
fc_feats, att_feats = tmp
# forward the model to also get generated samples for each image
seq, _ = model.sample(fc_feats, att_feats, eval_kwargs)
#set_trace()
sents = utils.decode_sequence(loader.get_vocab(), seq)
for k, sent in enumerate(sents):
entry = {'image_id': data['infos'][k]['id'], 'caption': sent}
if eval_kwargs.get('dump_path', 0) == 1:
entry['file_name'] = data['infos'][k]['file_path']
predictions.append(entry)
if eval_kwargs.get('dump_images', 0) == 1:
# dump the raw image to vis/ folder
cmd = 'cp "' + os.path.join(eval_kwargs['image_root'], data['infos'][k]['file_path']) + '" vis/imgs/img' + str(len(predictions)) + '.jpg' # bit gross
print(cmd)
os.system(cmd)
if verbose:
print('image %s: %s' %(entry['image_id'], entry['caption']))
# if we wrapped around the split or used up val imgs budget then bail
ix0 = data['bounds']['it_pos_now']
ix1 = data['bounds']['it_max']
if num_images != -1:
ix1 = min(ix1, num_images)
for i in range(n - ix1):
predictions.pop()
if verbose:
print('evaluating validation preformance... %d/%d (%f)' %(ix0 - 1, ix1, loss))
if data['bounds']['wrapped']:
break
if num_images >= 0 and n >= num_images:
break
lang_stats = None
if lang_eval == 1:
lang_stats = language_eval(dataset, predictions, eval_kwargs['id'], split)
# Switch back to training mode
model.train()
return loss_sum/loss_evals, predictions, lang_stats
|
{
"pile_set_name": "Github"
}
|
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package odbc_test
import (
"database/sql"
"flag"
"fmt"
"testing"
"time"
_ "github.com/alexbrainman/odbc"
)
var (
fox = flag.String("fox", "testdata", "directory where foxpro tables reside")
)
func TestFoxPro(t *testing.T) {
conn := fmt.Sprintf("driver={Microsoft dBASE Driver (*.dbf)};driverid=277;dbq=%s;",
*fox)
db, err := sql.Open("odbc", conn)
if err != nil {
t.Fatal(err)
}
defer db.Close()
if err := db.Ping(); err != nil {
t.Skipf("skipping test: %v", err)
}
type row struct {
char string
num_2_0 sql.NullFloat64
num_20_0 float64
num_6_3 float32
date time.Time
float_2_0 float32
float_20_0 float64
float_6_3 float32
logical bool
memo sql.NullString
}
var tests = []row{
{
char: "123",
num_2_0: sql.NullFloat64{Float64: 1, Valid: true},
num_20_0: 1232543,
num_6_3: 12.73,
date: time.Date(2012, 5, 19, 0, 0, 0, 0, time.Local),
float_2_0: 23,
float_20_0: 12345678901234560,
float_6_3: 12.345,
logical: true,
memo: sql.NullString{String: "Hello", Valid: true},
},
{
char: "abcdef",
num_2_0: sql.NullFloat64{Float64: 23, Valid: true},
num_20_0: 4564568,
num_6_3: 2,
date: time.Date(2012, 5, 20, 0, 0, 0, 0, time.Local),
float_2_0: 1,
float_20_0: 234,
float_6_3: 0.123,
logical: false,
memo: sql.NullString{String: "", Valid: false},
},
{
char: "346546",
num_2_0: sql.NullFloat64{Float64: 4, Valid: true},
num_20_0: 1234567890123456000,
num_6_3: 99.99,
date: time.Date(2012, 5, 21, 0, 0, 0, 0, time.Local),
float_2_0: 23,
float_20_0: 457768,
float_6_3: 99,
logical: true,
memo: sql.NullString{String: "World", Valid: true},
},
{
char: "asasds",
num_2_0: sql.NullFloat64{Float64: 0, Valid: false},
num_20_0: 234456,
num_6_3: 0.123,
date: time.Date(2012, 5, 22, 0, 0, 0, 0, time.Local),
float_2_0: 65,
float_20_0: 234,
float_6_3: 1,
logical: false,
memo: sql.NullString{String: "12398y345 sdflkjdsfsd fds;lkdsfgl;sd", Valid: true},
},
}
const query = `select id,
char, num_2_0, num_20_0, num_6_3, date,
float_2_0, float_20_0, float_6_3, logical, memo
from fldtest`
rows, err := db.Query(query)
if err != nil {
t.Fatal(err)
}
for rows.Next() {
var id int
var r row
err = rows.Scan(&id,
&r.char, &r.num_2_0, &r.num_20_0, &r.num_6_3, &r.date,
&r.float_2_0, &r.float_20_0, &r.float_6_3, &r.logical, &r.memo)
if err != nil {
t.Fatal(err)
}
if id < 0 || len(tests) < id {
t.Errorf("unexpected row with id %d", id)
continue
}
x := tests[id]
if x.char != r.char {
t.Errorf("row %d: char expected %v, but received %v", id, x.char, r.char)
}
if x.num_2_0 != r.num_2_0 {
t.Errorf("row %d: num_2_0 expected %v, but received %v", id, x.num_2_0, r.num_2_0)
}
if x.num_20_0 != r.num_20_0 {
t.Errorf("row %d: num_20_0 expected %v, but received %v", id, x.num_20_0, r.num_20_0)
}
if x.num_6_3 != r.num_6_3 {
t.Errorf("row %d: num_6_3 expected %v, but received %v", id, x.num_6_3, r.num_6_3)
}
if x.date != r.date {
t.Errorf("row %d: date expected %v, but received %v", id, x.date, r.date)
}
if x.float_2_0 != r.float_2_0 {
t.Errorf("row %d: float_2_0 expected %v, but received %v", id, x.float_2_0, r.float_2_0)
}
if x.float_20_0 != r.float_20_0 {
t.Errorf("row %d: float_20_0 expected %v, but received %v", id, x.float_20_0, r.float_20_0)
}
if x.float_6_3 != r.float_6_3 {
t.Errorf("row %d: float_6_3 expected %v, but received %v", id, x.float_6_3, r.float_6_3)
}
if x.logical != r.logical {
t.Errorf("row %d: logical expected %v, but received %v", id, x.logical, r.logical)
}
if x.memo != r.memo {
t.Errorf("row %d: memo expected %v, but received %v", id, x.memo, r.memo)
}
}
err = rows.Err()
if err != nil {
t.Fatal(err)
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
syntax = "proto2";
package k8s.io.api.authentication.v1beta1;
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1beta1";
// ExtraValue masks the value so protobuf can generate
// +protobuf.nullable=true
// +protobuf.options.(gogoproto.goproto_stringer)=false
message ExtraValue {
// items, if empty, will result in an empty slice
repeated string items = 1;
}
// TokenReview attempts to authenticate a token to a known user.
// Note: TokenReview requests may be cached by the webhook token authenticator
// plugin in the kube-apiserver.
message TokenReview {
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec holds information about the request being evaluated
optional TokenReviewSpec spec = 2;
// Status is filled in by the server and indicates whether the request can be authenticated.
// +optional
optional TokenReviewStatus status = 3;
}
// TokenReviewSpec is a description of the token authentication request.
message TokenReviewSpec {
// Token is the opaque bearer token.
// +optional
optional string token = 1;
// Audiences is a list of the identifiers that the resource server presented
// with the token identifies as. Audience-aware token authenticators will
// verify that the token was intended for at least one of the audiences in
// this list. If no audiences are provided, the audience will default to the
// audience of the Kubernetes apiserver.
// +optional
repeated string audiences = 2;
}
// TokenReviewStatus is the result of the token authentication request.
message TokenReviewStatus {
// Authenticated indicates that the token was associated with a known user.
// +optional
optional bool authenticated = 1;
// User is the UserInfo associated with the provided token.
// +optional
optional UserInfo user = 2;
// Audiences are audience identifiers chosen by the authenticator that are
// compatible with both the TokenReview and token. An identifier is any
// identifier in the intersection of the TokenReviewSpec audiences and the
// token's audiences. A client of the TokenReview API that sets the
// spec.audiences field should validate that a compatible audience identifier
// is returned in the status.audiences field to ensure that the TokenReview
// server is audience aware. If a TokenReview returns an empty
// status.audience field where status.authenticated is "true", the token is
// valid against the audience of the Kubernetes API server.
// +optional
repeated string audiences = 4;
// Error indicates that the token couldn't be checked
// +optional
optional string error = 3;
}
// UserInfo holds the information about the user needed to implement the
// user.Info interface.
message UserInfo {
// The name that uniquely identifies this user among all active users.
// +optional
optional string username = 1;
// A unique value that identifies this user across time. If this user is
// deleted and another user by the same name is added, they will have
// different UIDs.
// +optional
optional string uid = 2;
// The names of groups this user is a part of.
// +optional
repeated string groups = 3;
// Any additional information provided by the authenticator.
// +optional
map<string, ExtraValue> extra = 4;
}
|
{
"pile_set_name": "Github"
}
|
define([
"../core",
"./var/rsingleTag",
"../manipulation" // buildFragment
], function( jQuery, rsingleTag ) {
// data: string of html
// context (optional): If specified, the fragment will be created in this context, defaults to document
// keepScripts (optional): If true, will include scripts passed in the html string
jQuery.parseHTML = function( data, context, keepScripts ) {
if ( !data || typeof data !== "string" ) {
return null;
}
if ( typeof context === "boolean" ) {
keepScripts = context;
context = false;
}
context = context || document;
var parsed = rsingleTag.exec( data ),
scripts = !keepScripts && [];
// Single tag
if ( parsed ) {
return [ context.createElement( parsed[1] ) ];
}
parsed = jQuery.buildFragment( [ data ], context, scripts );
if ( scripts && scripts.length ) {
jQuery( scripts ).remove();
}
return jQuery.merge( [], parsed.childNodes );
};
return jQuery.parseHTML;
});
|
{
"pile_set_name": "Github"
}
|
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/cave_tileset.png-35f3b332bde928f714f5f5095687e8bd.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://tiled/images/tilesets/cave_tileset.png"
dest_files=[ "res://.import/cave_tileset.png-35f3b332bde928f714f5f5095687e8bd.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
|
{
"pile_set_name": "Github"
}
|
/*
u8g_dev_st7920_128x64.c
Universal 8bit Graphics Library
Copyright (c) 2011, olikraus@gmail.com
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.
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.
*/
#include "u8g.h"
#define WIDTH 128
#define HEIGHT 64
#define PAGE_HEIGHT 8
/* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */
static const uint8_t u8g_dev_st7920_128x64_init_seq[] PROGMEM = {
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_ADR(0), /* instruction mode */
U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/
U8G_ESC_DLY(100), /* 8 Dez 2012: additional delay 100 ms because of reset*/
U8G_ESC_CS(1), /* enable chip */
U8G_ESC_DLY(50), /* delay 50 ms */
0x038, /* 8 Bit interface (DL=1), basic instruction set (RE=0) */
0x00c, /* display on, cursor & blink off; 0x08: all off */
0x006, /* Entry mode: Cursor move to right ,DDRAM address counter (AC) plus 1, no shift */
0x002, /* disable scroll, enable CGRAM adress */
0x001, /* clear RAM, needs 1.6 ms */
U8G_ESC_DLY(100), /* delay 100 ms */
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_END /* end of sequence */
};
uint8_t u8g_dev_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
{
switch(msg)
{
case U8G_DEV_MSG_INIT:
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7920_128x64_init_seq);
break;
case U8G_DEV_MSG_STOP:
break;
case U8G_DEV_MSG_PAGE_NEXT:
{
uint8_t y, i;
uint8_t *ptr;
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_SetAddress(u8g, dev, 0); /* cmd mode */
u8g_SetChipSelect(u8g, dev, 1);
y = pb->p.page_y0;
ptr = pb->buf;
for( i = 0; i < 8; i ++ )
{
u8g_SetAddress(u8g, dev, 0); /* cmd mode */
u8g_WriteByte(u8g, dev, 0x03e ); /* enable extended mode */
if ( y < 32 )
{
u8g_WriteByte(u8g, dev, 0x080 | y ); /* y pos */
u8g_WriteByte(u8g, dev, 0x080 ); /* set x pos to 0*/
}
else
{
u8g_WriteByte(u8g, dev, 0x080 | (y-32) ); /* y pos */
u8g_WriteByte(u8g, dev, 0x080 | 8); /* set x pos to 64*/
}
u8g_SetAddress(u8g, dev, 1); /* data mode */
u8g_WriteSequence(u8g, dev, WIDTH/8, ptr);
ptr += WIDTH/8;
y++;
}
u8g_SetChipSelect(u8g, dev, 0);
}
break;
}
return u8g_dev_pb8h1_base_fn(u8g, dev, msg, arg);
}
uint8_t u8g_dev_st7920_128x64_4x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
{
switch(msg)
{
case U8G_DEV_MSG_INIT:
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_400NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_st7920_128x64_init_seq);
break;
case U8G_DEV_MSG_STOP:
break;
case U8G_DEV_MSG_PAGE_NEXT:
{
uint8_t y, i;
uint8_t *ptr;
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_SetAddress(u8g, dev, 0); /* cmd mode */
u8g_SetChipSelect(u8g, dev, 1);
y = pb->p.page_y0;
ptr = pb->buf;
for( i = 0; i < 32; i ++ )
{
u8g_SetAddress(u8g, dev, 0); /* cmd mode */
u8g_WriteByte(u8g, dev, 0x03e ); /* enable extended mode */
if ( y < 32 )
{
u8g_WriteByte(u8g, dev, 0x080 | y ); /* y pos */
u8g_WriteByte(u8g, dev, 0x080 ); /* set x pos to 0*/
}
else
{
u8g_WriteByte(u8g, dev, 0x080 | (y-32) ); /* y pos */
u8g_WriteByte(u8g, dev, 0x080 | 8); /* set x pos to 64*/
}
u8g_SetAddress(u8g, dev, 1); /* data mode */
u8g_WriteSequence(u8g, dev, WIDTH/8, ptr);
ptr += WIDTH/8;
y++;
}
u8g_SetChipSelect(u8g, dev, 0);
}
break;
}
return u8g_dev_pb32h1_base_fn(u8g, dev, msg, arg);
}
U8G_PB_DEV(u8g_dev_st7920_128x64_sw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_fn, U8G_COM_ST7920_SW_SPI);
U8G_PB_DEV(u8g_dev_st7920_128x64_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_fn, U8G_COM_ST7920_HW_SPI);
U8G_PB_DEV(u8g_dev_st7920_128x64_8bit, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_fn, U8G_COM_FAST_PARALLEL);
U8G_PB_DEV(u8g_dev_st7920_128x64_custom, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7920_128x64_fn, u8g_com_arduino_st7920_custom_fn);
#define QWIDTH (WIDTH*4)
uint8_t u8g_dev_st7920_128x64_4x_buf[QWIDTH] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_st7920_128x64_4x_pb = { {32, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_st7920_128x64_4x_buf};
u8g_dev_t u8g_dev_st7920_128x64_4x_sw_spi = { u8g_dev_st7920_128x64_4x_fn, &u8g_dev_st7920_128x64_4x_pb, U8G_COM_ST7920_SW_SPI };
u8g_dev_t u8g_dev_st7920_128x64_4x_hw_spi = { u8g_dev_st7920_128x64_4x_fn, &u8g_dev_st7920_128x64_4x_pb, U8G_COM_ST7920_HW_SPI };
u8g_dev_t u8g_dev_st7920_128x64_4x_8bit = { u8g_dev_st7920_128x64_4x_fn, &u8g_dev_st7920_128x64_4x_pb, U8G_COM_FAST_PARALLEL };
u8g_dev_t u8g_dev_st7920_128x64_4x_custom = { u8g_dev_st7920_128x64_4x_fn, &u8g_dev_st7920_128x64_4x_pb, u8g_com_arduino_st7920_custom_fn };
|
{
"pile_set_name": "Github"
}
|
SourceFile
-[ Error message ]-
"Failed to open source_SourceFile"
-[ Description ]-
The vector Asset log displays this error when read-write-execute
permissions are not set properly. Permissions must be set for parent
folders up to the root level.
-[ Resolution ]-
At the command line, enter:
"sudo chmod -R a+r /gevol"
This command corrects the access permissions on all Fusion-related
files. If "/gevol" is not your asset root, replace it with the name of
your asset root.
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017 the ACRA team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.acra.util;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.acra.ACRA;
import static org.acra.ACRA.LOG_TAG;
/**
* Responsible for wrapping calls to PackageManager to ensure that they always complete without throwing RuntimeExceptions.
* Depending upon the state of the application it is possible that
* <ul>
* <li>Context has no PackageManager.</li>
* <li>PackageManager returned by Context throws RuntimeException("Package manager has died")
* because it cannot contact the remote PackageManager service.
* </li>
* </ul>
* I suspect that PackageManager death is caused during app installation.
* But we need to make ACRA bullet proof, so it's better to handle the condition safely so that the error report itself doesn't fail.
*
* @author William Ferguson
* @since 4.3.0
*/
public final class PackageManagerWrapper {
@NonNull
private final Context context;
public PackageManagerWrapper(@NonNull Context context) {
this.context = context;
}
/**
* @param permission Manifest.permission to check whether it has been granted.
* @return true if the permission has been granted to the app, false if it hasn't been granted or the PackageManager could not be contacted.
*/
public boolean hasPermission(@NonNull String permission) {
final PackageManager pm = context.getPackageManager();
if (pm == null) {
return false;
}
try {
return pm.checkPermission(permission, context.getPackageName()) == PackageManager.PERMISSION_GRANTED;
} catch (Exception e) {
// To catch RuntimeException("Package manager has died") that can occur on some version of Android,
// when the remote PackageManager is unavailable. I suspect this sometimes occurs when the App is being reinstalled.
return false;
}
}
/**
* @return PackageInfo for the current application or null if the PackageManager could not be contacted.
*/
@Nullable
public PackageInfo getPackageInfo() {
final PackageManager pm = context.getPackageManager();
if (pm == null) {
return null;
}
try {
return pm.getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
ACRA.log.w(LOG_TAG, "Failed to find PackageInfo for current App : " + context.getPackageName());
return null;
} catch (Exception e) {
// To catch RuntimeException("Package manager has died") that can occur on some version of Android,
// when the remote PackageManager is unavailable. I suspect this sometimes occurs when the App is being reinstalled.
return null;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<template>
<aside
:class="{
expanded,
'veui-console': true
}"
>
<h2 @click="expanded = !expanded">
<icon
name="ban"
label="Clear console"
flip="horizontal"
@click.native.stop="logs = []"
/>
<icon
:name="expanded ? 'chevron-down' : 'chevron-up'"
label="Toggle console"
/>
Console <small>({{ logs.length }})</small>
</h2>
<section
ref="logList"
class="output"
>
<pre
v-for="(logItem, index) in logs"
:key="`log-${index}`"
class="log"
><template v-if="logItem != null"><div v-if="typeof logItem === 'string'">{{ logItem }}</div><div
v-for="(line, i) in logItem"
v-else
:key="`line-${i}`"
class="line"
v-html="format(line)"
/></template><template
v-else
v-html="format(log)"
/></pre>
</section>
</aside>
</template>
<script>
import bus from './bus'
import Icon from 'veui/components/Icon'
import 'vue-awesome/icons/ban'
import 'veui-theme-dls-icons/chevron-up'
import 'veui-theme-dls-icons/chevron-down'
export default {
name: 'veui-console',
components: {
Icon
},
data () {
return {
expanded: false,
logs: []
}
},
watch: {
expanded (value) {
document.body.classList.toggle('console-expanded', value)
}
},
mounted () {
bus.$on('log', (...messages) => this.log(...messages))
},
methods: {
log (...messages) {
console.log(...messages)
this.logs.push(messages)
let el = this.$refs.logList
this.$nextTick(() => {
el.scrollTop = el.scrollHeight
})
},
format (text) {
if (text != null) {
return text
}
return `<span style="color: #ccc">${
text === '' ? 'empty' : String(text)
}</span>`
}
}
}
</script>
<style lang="less">
@import "~less-plugin-est/src/all.less";
@nav-width: 240px;
@light-bg-color: #f6f9ff;
@title-height: 30px;
@console-height: 40vh;
.veui-console {
position: fixed;
right: 0;
bottom: 0;
left: @nav-width;
background-color: #fff;
h2 {
.centered-line(@title-height);
margin: 0;
padding: 0 1em;
background-color: @light-bg-color;
font-size: 12px;
font-weight: 600;
color: #666;
cursor: pointer;
& > * {
margin-right: 5px;
}
.veui-icon {
vertical-align: middle;
}
small {
margin-left: 3px;
}
}
.output {
overflow: hidden;
height: 0;
margin: 0;
line-height: 20px;
font-size: 10px;
transition: height 0.2s;
.log {
position: relative;
min-height: 20px;
margin: 0;
padding: 0 1em;
border-bottom: 1px solid #f3f3f3;
.line:not(:last-child) {
border-bottom: 1px solid #f3f3f3;
}
&:last-child::before {
content: "";
.absolute(0, _, 0, 0);
width: 2px;
background-color: #369;
}
}
}
small {
color: #999;
}
&.expanded {
.output {
overflow: auto;
height: @console-height;
}
}
}
</style>
|
{
"pile_set_name": "Github"
}
|
.navbar {
padding-left: 25px;
}
.header-section {
padding: 30px 30px;
background: #222;
position: absolute;
top: 50px;
left: 0px;
width: 100%;
margin-left: 0;
color: #FFF;
}
.main {
padding-top: 20px;
min-height: 370px;
}
.footer-left {
padding-left: 30px;
float: left;
}
.btn {
text-align: left;
}
.btn-icon {
margin-left: 15px;
margin-right: 15px;
}
|
{
"pile_set_name": "Github"
}
|
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var preserveFirstComment = function() {
var set = false;
return function() {
if (set) return false;
set = true;
return true;
};
};
gulp.task('uglify', function() {
gulp.src('lib/marked.js')
.pipe(uglify({preserveComments: preserveFirstComment()}))
.pipe(concat('marked.min.js'))
.pipe(gulp.dest('.'));
});
gulp.task('default', ['uglify']);
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Mon Jun 29 06:45:47 CEST 2015 -->
<title>MatchingTask (Apache Ant API)</title>
<meta name="date" content="2015-06-29">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MatchingTask (Apache Ant API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ManifestTask.Mode.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/taskdefs/Mkdir.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/taskdefs/MatchingTask.html" target="_top">Frames</a></li>
<li><a href="MatchingTask.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.tools.ant.taskdefs</div>
<h2 title="Class MatchingTask" class="title">Class MatchingTask</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">org.apache.tools.ant.ProjectComponent</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">org.apache.tools.ant.Task</a></li>
<li>
<ul class="inheritance">
<li>org.apache.tools.ant.taskdefs.MatchingTask</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.lang.Cloneable, <a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/tools/ant/taskdefs/optional/Cab.html" title="class in org.apache.tools.ant.taskdefs.optional">Cab</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Checksum.html" title="class in org.apache.tools.ant.taskdefs">Checksum</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Copydir.html" title="class in org.apache.tools.ant.taskdefs">Copydir</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Delete.html" title="class in org.apache.tools.ant.taskdefs">Delete</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/depend/Depend.html" title="class in org.apache.tools.ant.taskdefs.optional.depend">Depend</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/DependSet.html" title="class in org.apache.tools.ant.taskdefs">DependSet</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.html" title="class in org.apache.tools.ant.taskdefs.optional.ejb">EjbJar</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/FixCRLF.html" title="class in org.apache.tools.ant.taskdefs">FixCRLF</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/image/Image.html" title="class in org.apache.tools.ant.taskdefs.optional.image">Image</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Javac.html" title="class in org.apache.tools.ant.taskdefs">Javac</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/jlink/JlinkTask.html" title="class in org.apache.tools.ant.taskdefs.optional.jlink">JlinkTask</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/jsp/JspC.html" title="class in org.apache.tools.ant.taskdefs.optional.jsp">JspC</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/Native2Ascii.html" title="class in org.apache.tools.ant.taskdefs.optional">Native2Ascii</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/NetRexxC.html" title="class in org.apache.tools.ant.taskdefs.optional">NetRexxC</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/RenameExtensions.html" title="class in org.apache.tools.ant.taskdefs.optional">RenameExtensions</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Replace.html" title="class in org.apache.tools.ant.taskdefs">Replace</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Rmic.html" title="class in org.apache.tools.ant.taskdefs">Rmic</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Tar.html" title="class in org.apache.tools.ant.taskdefs">Tar</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/i18n/Translate.html" title="class in org.apache.tools.ant.taskdefs.optional.i18n">Translate</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/optional/jsp/WLJspc.html" title="class in org.apache.tools.ant.taskdefs.optional.jsp">WLJspc</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/XSLTProcess.html" title="class in org.apache.tools.ant.taskdefs">XSLTProcess</a>, <a href="../../../../../org/apache/tools/ant/taskdefs/Zip.html" title="class in org.apache.tools.ant.taskdefs">Zip</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">MatchingTask</span>
extends <a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a>
implements <a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></pre>
<div class="block">This is an abstract task that should be used by all those tasks that
require to include or exclude files based on pattern matching.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.1</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#fileset">fileset</a></strong></code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.tools.ant.Task">
<!-- -->
</a>
<h3>Fields inherited from class org.apache.tools.ant.<a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></h3>
<code><a href="../../../../../org/apache/tools/ant/Task.html#target">target</a>, <a href="../../../../../org/apache/tools/ant/Task.html#taskName">taskName</a>, <a href="../../../../../org/apache/tools/ant/Task.html#taskType">taskType</a>, <a href="../../../../../org/apache/tools/ant/Task.html#wrapper">wrapper</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.tools.ant.ProjectComponent">
<!-- -->
</a>
<h3>Fields inherited from class org.apache.tools.ant.<a href="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</a></h3>
<code><a href="../../../../../org/apache/tools/ant/ProjectComponent.html#description">description</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#location">location</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#project">project</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#MatchingTask()">MatchingTask</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#add(org.apache.tools.ant.types.selectors.FileSelector)">add</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a> selector)</code>
<div class="block">add an arbitrary selector</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addAnd(org.apache.tools.ant.types.selectors.AndSelector)">addAnd</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/AndSelector.html" title="class in org.apache.tools.ant.types.selectors">AndSelector</a> selector)</code>
<div class="block">add an "And" selector entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addContains(org.apache.tools.ant.types.selectors.ContainsSelector)">addContains</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/ContainsSelector.html" title="class in org.apache.tools.ant.types.selectors">ContainsSelector</a> selector)</code>
<div class="block">add a contains selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector)">addContainsRegexp</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/ContainsRegexpSelector.html" title="class in org.apache.tools.ant.types.selectors">ContainsRegexpSelector</a> selector)</code>
<div class="block">add a regular expression selector entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addCustom(org.apache.tools.ant.types.selectors.ExtendSelector)">addCustom</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/ExtendSelector.html" title="class in org.apache.tools.ant.types.selectors">ExtendSelector</a> selector)</code>
<div class="block">add an extended selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addDate(org.apache.tools.ant.types.selectors.DateSelector)">addDate</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/DateSelector.html" title="class in org.apache.tools.ant.types.selectors">DateSelector</a> selector)</code>
<div class="block">add a selector date entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addDepend(org.apache.tools.ant.types.selectors.DependSelector)">addDepend</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/DependSelector.html" title="class in org.apache.tools.ant.types.selectors">DependSelector</a> selector)</code>
<div class="block">add a depends selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addDepth(org.apache.tools.ant.types.selectors.DepthSelector)">addDepth</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/DepthSelector.html" title="class in org.apache.tools.ant.types.selectors">DepthSelector</a> selector)</code>
<div class="block">add a depth selector entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addDifferent(org.apache.tools.ant.types.selectors.DifferentSelector)">addDifferent</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/DifferentSelector.html" title="class in org.apache.tools.ant.types.selectors">DifferentSelector</a> selector)</code>
<div class="block">add a type selector entry on the type list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addFilename(org.apache.tools.ant.types.selectors.FilenameSelector)">addFilename</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/FilenameSelector.html" title="class in org.apache.tools.ant.types.selectors">FilenameSelector</a> selector)</code>
<div class="block">add a selector filename entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addMajority(org.apache.tools.ant.types.selectors.MajoritySelector)">addMajority</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/MajoritySelector.html" title="class in org.apache.tools.ant.types.selectors">MajoritySelector</a> selector)</code>
<div class="block">add a majority selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector)">addModified</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.html" title="class in org.apache.tools.ant.types.selectors.modifiedselector">ModifiedSelector</a> selector)</code>
<div class="block">add the modified selector</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addNone(org.apache.tools.ant.types.selectors.NoneSelector)">addNone</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/NoneSelector.html" title="class in org.apache.tools.ant.types.selectors">NoneSelector</a> selector)</code>
<div class="block">add a "None" selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addNot(org.apache.tools.ant.types.selectors.NotSelector)">addNot</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/NotSelector.html" title="class in org.apache.tools.ant.types.selectors">NotSelector</a> selector)</code>
<div class="block">add a "Not" selector entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addOr(org.apache.tools.ant.types.selectors.OrSelector)">addOr</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/OrSelector.html" title="class in org.apache.tools.ant.types.selectors">OrSelector</a> selector)</code>
<div class="block">add an "Or" selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addPresent(org.apache.tools.ant.types.selectors.PresentSelector)">addPresent</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/PresentSelector.html" title="class in org.apache.tools.ant.types.selectors">PresentSelector</a> selector)</code>
<div class="block">add a present selector entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addSelector(org.apache.tools.ant.types.selectors.SelectSelector)">addSelector</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/SelectSelector.html" title="class in org.apache.tools.ant.types.selectors">SelectSelector</a> selector)</code>
<div class="block">add a "Select" selector entry on the selector list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addSize(org.apache.tools.ant.types.selectors.SizeSelector)">addSize</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/SizeSelector.html" title="class in org.apache.tools.ant.types.selectors">SizeSelector</a> selector)</code>
<div class="block">add a selector size entry on the selector list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#addType(org.apache.tools.ant.types.selectors.TypeSelector)">addType</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/TypeSelector.html" title="class in org.apache.tools.ant.types.selectors">TypeSelector</a> selector)</code>
<div class="block">add a type selector entry on the type list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#appendSelector(org.apache.tools.ant.types.selectors.FileSelector)">appendSelector</a></strong>(<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a> selector)</code>
<div class="block">Add a new selector into this container.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#createExclude()">createExclude</a></strong>()</code>
<div class="block">add a name entry on the exclude list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#createExcludesFile()">createExcludesFile</a></strong>()</code>
<div class="block">add a name entry on the include files list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#createInclude()">createInclude</a></strong>()</code>
<div class="block">add a name entry on the include list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#createIncludesFile()">createIncludesFile</a></strong>()</code>
<div class="block">add a name entry on the include files list</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/PatternSet.html" title="class in org.apache.tools.ant.types">PatternSet</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#createPatternSet()">createPatternSet</a></strong>()</code>
<div class="block">add a set of patterns</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/tools/ant/DirectoryScanner.html" title="class in org.apache.tools.ant">DirectoryScanner</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#getDirectoryScanner(java.io.File)">getDirectoryScanner</a></strong>(java.io.File baseDir)</code>
<div class="block">Returns the directory scanner needed to access the files to process.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#getImplicitFileSet()">getImplicitFileSet</a></strong>()</code>
<div class="block">Accessor for the implicit fileset.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#getSelectors(org.apache.tools.ant.Project)">getSelectors</a></strong>(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> p)</code>
<div class="block">Returns the set of selectors as an array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#hasSelectors()">hasSelectors</a></strong>()</code>
<div class="block">Indicates whether there are any selectors here.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#selectorCount()">selectorCount</a></strong>()</code>
<div class="block">Gives the count of the number of selectors in this container</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.Enumeration<<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#selectorElements()">selectorElements</a></strong>()</code>
<div class="block">Returns an enumerator for accessing the set of selectors.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setCaseSensitive(boolean)">setCaseSensitive</a></strong>(boolean isCaseSensitive)</code>
<div class="block">Sets case sensitivity of the file system</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setDefaultexcludes(boolean)">setDefaultexcludes</a></strong>(boolean useDefaultExcludes)</code>
<div class="block">Sets whether default exclusions should be used or not.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setExcludes(java.lang.String)">setExcludes</a></strong>(java.lang.String excludes)</code>
<div class="block">Sets the set of exclude patterns.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setExcludesfile(java.io.File)">setExcludesfile</a></strong>(java.io.File excludesfile)</code>
<div class="block">Sets the name of the file containing the includes patterns.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setFollowSymlinks(boolean)">setFollowSymlinks</a></strong>(boolean followSymlinks)</code>
<div class="block">Sets whether or not symbolic links should be followed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setIncludes(java.lang.String)">setIncludes</a></strong>(java.lang.String includes)</code>
<div class="block">Sets the set of include patterns.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setIncludesfile(java.io.File)">setIncludesfile</a></strong>(java.io.File includesfile)</code>
<div class="block">Sets the name of the file containing the includes patterns.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#setProject(org.apache.tools.ant.Project)">setProject</a></strong>(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project)</code>
<div class="block">Sets the project object of this component.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#XsetIgnore(java.lang.String)">XsetIgnore</a></strong>(java.lang.String ignoreString)</code>
<div class="block">List of filenames and directory names to not include.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/tools/ant/taskdefs/MatchingTask.html#XsetItems(java.lang.String)">XsetItems</a></strong>(java.lang.String itemString)</code>
<div class="block">Set this to be the items in the base directory that you want to be
included.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.tools.ant.Task">
<!-- -->
</a>
<h3>Methods inherited from class org.apache.tools.ant.<a href="../../../../../org/apache/tools/ant/Task.html" title="class in org.apache.tools.ant">Task</a></h3>
<code><a href="../../../../../org/apache/tools/ant/Task.html#bindToOwner(org.apache.tools.ant.Task)">bindToOwner</a>, <a href="../../../../../org/apache/tools/ant/Task.html#execute()">execute</a>, <a href="../../../../../org/apache/tools/ant/Task.html#getOwningTarget()">getOwningTarget</a>, <a href="../../../../../org/apache/tools/ant/Task.html#getRuntimeConfigurableWrapper()">getRuntimeConfigurableWrapper</a>, <a href="../../../../../org/apache/tools/ant/Task.html#getTaskName()">getTaskName</a>, <a href="../../../../../org/apache/tools/ant/Task.html#getTaskType()">getTaskType</a>, <a href="../../../../../org/apache/tools/ant/Task.html#getWrapper()">getWrapper</a>, <a href="../../../../../org/apache/tools/ant/Task.html#handleErrorFlush(java.lang.String)">handleErrorFlush</a>, <a href="../../../../../org/apache/tools/ant/Task.html#handleErrorOutput(java.lang.String)">handleErrorOutput</a>, <a href="../../../../../org/apache/tools/ant/Task.html#handleFlush(java.lang.String)">handleFlush</a>, <a href="../../../../../org/apache/tools/ant/Task.html#handleInput(byte[],%20int,%20int)">handleInput</a>, <a href="../../../../../org/apache/tools/ant/Task.html#handleOutput(java.lang.String)">handleOutput</a>, <a href="../../../../../org/apache/tools/ant/Task.html#init()">init</a>, <a href="../../../../../org/apache/tools/ant/Task.html#isInvalid()">isInvalid</a>, <a href="../../../../../org/apache/tools/ant/Task.html#log(java.lang.String)">log</a>, <a href="../../../../../org/apache/tools/ant/Task.html#log(java.lang.String,%20int)">log</a>, <a href="../../../../../org/apache/tools/ant/Task.html#log(java.lang.String,%20java.lang.Throwable,%20int)">log</a>, <a href="../../../../../org/apache/tools/ant/Task.html#log(java.lang.Throwable,%20int)">log</a>, <a href="../../../../../org/apache/tools/ant/Task.html#maybeConfigure()">maybeConfigure</a>, <a href="../../../../../org/apache/tools/ant/Task.html#perform()">perform</a>, <a href="../../../../../org/apache/tools/ant/Task.html#reconfigure()">reconfigure</a>, <a href="../../../../../org/apache/tools/ant/Task.html#setOwningTarget(org.apache.tools.ant.Target)">setOwningTarget</a>, <a href="../../../../../org/apache/tools/ant/Task.html#setRuntimeConfigurableWrapper(org.apache.tools.ant.RuntimeConfigurable)">setRuntimeConfigurableWrapper</a>, <a href="../../../../../org/apache/tools/ant/Task.html#setTaskName(java.lang.String)">setTaskName</a>, <a href="../../../../../org/apache/tools/ant/Task.html#setTaskType(java.lang.String)">setTaskType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.tools.ant.ProjectComponent">
<!-- -->
</a>
<h3>Methods inherited from class org.apache.tools.ant.<a href="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</a></h3>
<code><a href="../../../../../org/apache/tools/ant/ProjectComponent.html#clone()">clone</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#getDescription()">getDescription</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#getLocation()">getLocation</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#getProject()">getProject</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#setDescription(java.lang.String)">setDescription</a>, <a href="../../../../../org/apache/tools/ant/ProjectComponent.html#setLocation(org.apache.tools.ant.Location)">setLocation</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="fileset">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>fileset</h4>
<pre>protected <a href="../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a> fileset</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="MatchingTask()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MatchingTask</h4>
<pre>public MatchingTask()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="setProject(org.apache.tools.ant.Project)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setProject</h4>
<pre>public void setProject(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> project)</pre>
<div class="block">Sets the project object of this component. This method is used by
Project when a component is added to it so that the component has
access to the functions of the project. It should not be used
for any other purpose..</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/ProjectComponent.html#setProject(org.apache.tools.ant.Project)">setProject</a></code> in class <code><a href="../../../../../org/apache/tools/ant/ProjectComponent.html" title="class in org.apache.tools.ant">ProjectComponent</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>project</code> - Project in whose scope this component belongs.
Must not be <code>null</code>.</dd></dl>
</li>
</ul>
<a name="createInclude()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createInclude</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a> createInclude()</pre>
<div class="block">add a name entry on the include list</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a NameEntry object to be configured</dd></dl>
</li>
</ul>
<a name="createIncludesFile()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createIncludesFile</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a> createIncludesFile()</pre>
<div class="block">add a name entry on the include files list</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an NameEntry object to be configured</dd></dl>
</li>
</ul>
<a name="createExclude()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createExclude</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a> createExclude()</pre>
<div class="block">add a name entry on the exclude list</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an NameEntry object to be configured</dd></dl>
</li>
</ul>
<a name="createExcludesFile()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createExcludesFile</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/PatternSet.NameEntry.html" title="class in org.apache.tools.ant.types">PatternSet.NameEntry</a> createExcludesFile()</pre>
<div class="block">add a name entry on the include files list</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an NameEntry object to be configured</dd></dl>
</li>
</ul>
<a name="createPatternSet()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createPatternSet</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/PatternSet.html" title="class in org.apache.tools.ant.types">PatternSet</a> createPatternSet()</pre>
<div class="block">add a set of patterns</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>PatternSet object to be configured</dd></dl>
</li>
</ul>
<a name="setIncludes(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIncludes</h4>
<pre>public void setIncludes(java.lang.String includes)</pre>
<div class="block">Sets the set of include patterns. Patterns may be separated by a comma
or a space.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>includes</code> - the string containing the include patterns</dd></dl>
</li>
</ul>
<a name="XsetItems(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>XsetItems</h4>
<pre>public void XsetItems(java.lang.String itemString)</pre>
<div class="block">Set this to be the items in the base directory that you want to be
included. You can also specify "*" for the items (ie: items="*")
and it will include all the items in the base directory.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>itemString</code> - the string containing the files to include.</dd></dl>
</li>
</ul>
<a name="setExcludes(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExcludes</h4>
<pre>public void setExcludes(java.lang.String excludes)</pre>
<div class="block">Sets the set of exclude patterns. Patterns may be separated by a comma
or a space.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>excludes</code> - the string containing the exclude patterns</dd></dl>
</li>
</ul>
<a name="XsetIgnore(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>XsetIgnore</h4>
<pre>public void XsetIgnore(java.lang.String ignoreString)</pre>
<div class="block">List of filenames and directory names to not include. They should be
either , or " " (space) separated. The ignored files will be logged.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>ignoreString</code> - the string containing the files to ignore.</dd></dl>
</li>
</ul>
<a name="setDefaultexcludes(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDefaultexcludes</h4>
<pre>public void setDefaultexcludes(boolean useDefaultExcludes)</pre>
<div class="block">Sets whether default exclusions should be used or not.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>useDefaultExcludes</code> - "true"|"on"|"yes" when default exclusions
should be used, "false"|"off"|"no" when they
shouldn't be used.</dd></dl>
</li>
</ul>
<a name="getDirectoryScanner(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDirectoryScanner</h4>
<pre>protected <a href="../../../../../org/apache/tools/ant/DirectoryScanner.html" title="class in org.apache.tools.ant">DirectoryScanner</a> getDirectoryScanner(java.io.File baseDir)</pre>
<div class="block">Returns the directory scanner needed to access the files to process.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>baseDir</code> - the base directory to use with the fileset</dd>
<dt><span class="strong">Returns:</span></dt><dd>a directory scanner</dd></dl>
</li>
</ul>
<a name="setIncludesfile(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIncludesfile</h4>
<pre>public void setIncludesfile(java.io.File includesfile)</pre>
<div class="block">Sets the name of the file containing the includes patterns.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>includesfile</code> - A string containing the filename to fetch
the include patterns from.</dd></dl>
</li>
</ul>
<a name="setExcludesfile(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExcludesfile</h4>
<pre>public void setExcludesfile(java.io.File excludesfile)</pre>
<div class="block">Sets the name of the file containing the includes patterns.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>excludesfile</code> - A string containing the filename to fetch
the include patterns from.</dd></dl>
</li>
</ul>
<a name="setCaseSensitive(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCaseSensitive</h4>
<pre>public void setCaseSensitive(boolean isCaseSensitive)</pre>
<div class="block">Sets case sensitivity of the file system</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>isCaseSensitive</code> - "true"|"on"|"yes" if file system is case
sensitive, "false"|"off"|"no" when not.</dd></dl>
</li>
</ul>
<a name="setFollowSymlinks(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setFollowSymlinks</h4>
<pre>public void setFollowSymlinks(boolean followSymlinks)</pre>
<div class="block">Sets whether or not symbolic links should be followed.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>followSymlinks</code> - whether or not symbolic links should be followed</dd></dl>
</li>
</ul>
<a name="hasSelectors()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSelectors</h4>
<pre>public boolean hasSelectors()</pre>
<div class="block">Indicates whether there are any selectors here.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#hasSelectors()">hasSelectors</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>whether any selectors are in this container</dd></dl>
</li>
</ul>
<a name="selectorCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectorCount</h4>
<pre>public int selectorCount()</pre>
<div class="block">Gives the count of the number of selectors in this container</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#selectorCount()">selectorCount</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>the number of selectors in this container</dd></dl>
</li>
</ul>
<a name="getSelectors(org.apache.tools.ant.Project)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSelectors</h4>
<pre>public <a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a>[] getSelectors(<a href="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</a> p)</pre>
<div class="block">Returns the set of selectors as an array.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#getSelectors(org.apache.tools.ant.Project)">getSelectors</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>p</code> - the current project</dd>
<dt><span class="strong">Returns:</span></dt><dd>an array of selectors in this container</dd></dl>
</li>
</ul>
<a name="selectorElements()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectorElements</h4>
<pre>public java.util.Enumeration<<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a>> selectorElements()</pre>
<div class="block">Returns an enumerator for accessing the set of selectors.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#selectorElements()">selectorElements</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>an enumerator that goes through each of the selectors</dd></dl>
</li>
</ul>
<a name="appendSelector(org.apache.tools.ant.types.selectors.FileSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>appendSelector</h4>
<pre>public void appendSelector(<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a> selector)</pre>
<div class="block">Add a new selector into this container.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#appendSelector(org.apache.tools.ant.types.selectors.FileSelector)">appendSelector</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the new selector to add</dd></dl>
</li>
</ul>
<a name="addSelector(org.apache.tools.ant.types.selectors.SelectSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addSelector</h4>
<pre>public void addSelector(<a href="../../../../../org/apache/tools/ant/types/selectors/SelectSelector.html" title="class in org.apache.tools.ant.types.selectors">SelectSelector</a> selector)</pre>
<div class="block">add a "Select" selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addSelector(org.apache.tools.ant.types.selectors.SelectSelector)">addSelector</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addAnd(org.apache.tools.ant.types.selectors.AndSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAnd</h4>
<pre>public void addAnd(<a href="../../../../../org/apache/tools/ant/types/selectors/AndSelector.html" title="class in org.apache.tools.ant.types.selectors">AndSelector</a> selector)</pre>
<div class="block">add an "And" selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addAnd(org.apache.tools.ant.types.selectors.AndSelector)">addAnd</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addOr(org.apache.tools.ant.types.selectors.OrSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addOr</h4>
<pre>public void addOr(<a href="../../../../../org/apache/tools/ant/types/selectors/OrSelector.html" title="class in org.apache.tools.ant.types.selectors">OrSelector</a> selector)</pre>
<div class="block">add an "Or" selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addOr(org.apache.tools.ant.types.selectors.OrSelector)">addOr</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addNot(org.apache.tools.ant.types.selectors.NotSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addNot</h4>
<pre>public void addNot(<a href="../../../../../org/apache/tools/ant/types/selectors/NotSelector.html" title="class in org.apache.tools.ant.types.selectors">NotSelector</a> selector)</pre>
<div class="block">add a "Not" selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addNot(org.apache.tools.ant.types.selectors.NotSelector)">addNot</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addNone(org.apache.tools.ant.types.selectors.NoneSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addNone</h4>
<pre>public void addNone(<a href="../../../../../org/apache/tools/ant/types/selectors/NoneSelector.html" title="class in org.apache.tools.ant.types.selectors">NoneSelector</a> selector)</pre>
<div class="block">add a "None" selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addNone(org.apache.tools.ant.types.selectors.NoneSelector)">addNone</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addMajority(org.apache.tools.ant.types.selectors.MajoritySelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMajority</h4>
<pre>public void addMajority(<a href="../../../../../org/apache/tools/ant/types/selectors/MajoritySelector.html" title="class in org.apache.tools.ant.types.selectors">MajoritySelector</a> selector)</pre>
<div class="block">add a majority selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addMajority(org.apache.tools.ant.types.selectors.MajoritySelector)">addMajority</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addDate(org.apache.tools.ant.types.selectors.DateSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDate</h4>
<pre>public void addDate(<a href="../../../../../org/apache/tools/ant/types/selectors/DateSelector.html" title="class in org.apache.tools.ant.types.selectors">DateSelector</a> selector)</pre>
<div class="block">add a selector date entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addDate(org.apache.tools.ant.types.selectors.DateSelector)">addDate</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addSize(org.apache.tools.ant.types.selectors.SizeSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addSize</h4>
<pre>public void addSize(<a href="../../../../../org/apache/tools/ant/types/selectors/SizeSelector.html" title="class in org.apache.tools.ant.types.selectors">SizeSelector</a> selector)</pre>
<div class="block">add a selector size entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addSize(org.apache.tools.ant.types.selectors.SizeSelector)">addSize</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addFilename(org.apache.tools.ant.types.selectors.FilenameSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addFilename</h4>
<pre>public void addFilename(<a href="../../../../../org/apache/tools/ant/types/selectors/FilenameSelector.html" title="class in org.apache.tools.ant.types.selectors">FilenameSelector</a> selector)</pre>
<div class="block">add a selector filename entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addFilename(org.apache.tools.ant.types.selectors.FilenameSelector)">addFilename</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addCustom(org.apache.tools.ant.types.selectors.ExtendSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addCustom</h4>
<pre>public void addCustom(<a href="../../../../../org/apache/tools/ant/types/selectors/ExtendSelector.html" title="class in org.apache.tools.ant.types.selectors">ExtendSelector</a> selector)</pre>
<div class="block">add an extended selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addCustom(org.apache.tools.ant.types.selectors.ExtendSelector)">addCustom</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addContains(org.apache.tools.ant.types.selectors.ContainsSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addContains</h4>
<pre>public void addContains(<a href="../../../../../org/apache/tools/ant/types/selectors/ContainsSelector.html" title="class in org.apache.tools.ant.types.selectors">ContainsSelector</a> selector)</pre>
<div class="block">add a contains selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addContains(org.apache.tools.ant.types.selectors.ContainsSelector)">addContains</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addPresent(org.apache.tools.ant.types.selectors.PresentSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addPresent</h4>
<pre>public void addPresent(<a href="../../../../../org/apache/tools/ant/types/selectors/PresentSelector.html" title="class in org.apache.tools.ant.types.selectors">PresentSelector</a> selector)</pre>
<div class="block">add a present selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addPresent(org.apache.tools.ant.types.selectors.PresentSelector)">addPresent</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addDepth(org.apache.tools.ant.types.selectors.DepthSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDepth</h4>
<pre>public void addDepth(<a href="../../../../../org/apache/tools/ant/types/selectors/DepthSelector.html" title="class in org.apache.tools.ant.types.selectors">DepthSelector</a> selector)</pre>
<div class="block">add a depth selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addDepth(org.apache.tools.ant.types.selectors.DepthSelector)">addDepth</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addDepend(org.apache.tools.ant.types.selectors.DependSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDepend</h4>
<pre>public void addDepend(<a href="../../../../../org/apache/tools/ant/types/selectors/DependSelector.html" title="class in org.apache.tools.ant.types.selectors">DependSelector</a> selector)</pre>
<div class="block">add a depends selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addDepend(org.apache.tools.ant.types.selectors.DependSelector)">addDepend</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addContainsRegexp</h4>
<pre>public void addContainsRegexp(<a href="../../../../../org/apache/tools/ant/types/selectors/ContainsRegexpSelector.html" title="class in org.apache.tools.ant.types.selectors">ContainsRegexpSelector</a> selector)</pre>
<div class="block">add a regular expression selector entry on the selector list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector)">addContainsRegexp</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd></dl>
</li>
</ul>
<a name="addDifferent(org.apache.tools.ant.types.selectors.DifferentSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addDifferent</h4>
<pre>public void addDifferent(<a href="../../../../../org/apache/tools/ant/types/selectors/DifferentSelector.html" title="class in org.apache.tools.ant.types.selectors">DifferentSelector</a> selector)</pre>
<div class="block">add a type selector entry on the type list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addDifferent(org.apache.tools.ant.types.selectors.DifferentSelector)">addDifferent</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd><dt><span class="strong">Since:</span></dt>
<dd>ant 1.6</dd></dl>
</li>
</ul>
<a name="addType(org.apache.tools.ant.types.selectors.TypeSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addType</h4>
<pre>public void addType(<a href="../../../../../org/apache/tools/ant/types/selectors/TypeSelector.html" title="class in org.apache.tools.ant.types.selectors">TypeSelector</a> selector)</pre>
<div class="block">add a type selector entry on the type list</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addType(org.apache.tools.ant.types.selectors.TypeSelector)">addType</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd><dt><span class="strong">Since:</span></dt>
<dd>ant 1.6</dd></dl>
</li>
</ul>
<a name="addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addModified</h4>
<pre>public void addModified(<a href="../../../../../org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.html" title="class in org.apache.tools.ant.types.selectors.modifiedselector">ModifiedSelector</a> selector)</pre>
<div class="block">add the modified selector</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector)">addModified</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd><dt><span class="strong">Since:</span></dt>
<dd>ant 1.6</dd></dl>
</li>
</ul>
<a name="add(org.apache.tools.ant.types.selectors.FileSelector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>public void add(<a href="../../../../../org/apache/tools/ant/types/selectors/FileSelector.html" title="interface in org.apache.tools.ant.types.selectors">FileSelector</a> selector)</pre>
<div class="block">add an arbitrary selector</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html#add(org.apache.tools.ant.types.selectors.FileSelector)">add</a></code> in interface <code><a href="../../../../../org/apache/tools/ant/types/selectors/SelectorContainer.html" title="interface in org.apache.tools.ant.types.selectors">SelectorContainer</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>selector</code> - the selector to add</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.6</dd></dl>
</li>
</ul>
<a name="getImplicitFileSet()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getImplicitFileSet</h4>
<pre>protected final <a href="../../../../../org/apache/tools/ant/types/FileSet.html" title="class in org.apache.tools.ant.types">FileSet</a> getImplicitFileSet()</pre>
<div class="block">Accessor for the implicit fileset.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the implicit fileset</dd><dt><span class="strong">Since:</span></dt>
<dd>Ant 1.5.2</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/tools/ant/taskdefs/ManifestTask.Mode.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/tools/ant/taskdefs/Mkdir.html" title="class in org.apache.tools.ant.taskdefs"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/tools/ant/taskdefs/MatchingTask.html" target="_top">Frames</a></li>
<li><a href="MatchingTask.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<title>CodeMirror: Julia mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="julia.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Julia</a>
</ul>
</div>
<article>
<h2>Julia mode</h2>
<div><textarea id="code" name="code">
#numbers
1234
1234im
.234
.234im
2.23im
2.3f3
23e2
0x234
#strings
'a'
"asdf"
r"regex"
b"bytestring"
"""
multiline string
"""
#identifiers
a
as123
function_name!
#unicode identifiers
# a = x\ddot
a⃗ = ẍ
# a = v\dot
a⃗ = v̇
#F\vec = m \cdotp a\vec
F⃗ = m·a⃗
#literal identifier multiples
3x
4[1, 2, 3]
#dicts and indexing
x=[1, 2, 3]
x[end-1]
x={"julia"=>"language of technical computing"}
#exception handling
try
f()
catch
@printf "Error"
finally
g()
end
#types
immutable Color{T<:Number}
r::T
g::T
b::T
end
#functions
function change!(x::Vector{Float64})
for i = 1:length(x)
x[i] *= 2
end
end
#function invocation
f('b', (2, 3)...)
#operators
|=
&=
^=
\-
%=
*=
+=
-=
<=
>=
!=
==
%
*
+
-
<
>
!
=
|
&
^
\
?
~
:
$
<:
.<
.>
<<
<<=
>>
>>>>
>>=
>>>=
<<=
<<<=
.<=
.>=
.==
->
//
in
...
//
:=
.//=
.*=
./=
.^=
.%=
.+=
.-=
\=
\\=
||
===
&&
|=
.|=
<:
>:
|>
<|
::
x ? y : z
#macros
@spawnat 2 1+1
@eval(:x)
#keywords and operators
if else elseif while for
begin let end do
try catch finally return break continue
global local const
export import importall using
function macro module baremodule
type immutable quote
true false enumerate
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: {name: "julia",
},
lineNumbers: true,
indentUnit: 4,
matchBrackets: true
});
</script>
<p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p>
</article>
|
{
"pile_set_name": "Github"
}
|
define([
"./core",
"./attributes/attr",
"./attributes/prop",
"./attributes/classes",
"./attributes/val"
], function( jQuery ) {
// Return jQuery for attributes-only inclusion
return jQuery;
});
|
{
"pile_set_name": "Github"
}
|
package session
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/defaults"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
)
// A Session provides a central location to create service clients from and
// store configurations and request handlers for those services.
//
// Sessions are safe to create service clients concurrently, but it is not safe
// to mutate the Session concurrently.
//
// The Session satisfies the service client's client.ClientConfigProvider.
type Session struct {
Config *aws.Config
Handlers request.Handlers
}
// New creates a new instance of the handlers merging in the provided configs
// on top of the SDK's default configurations. Once the Session is created it
// can be mutated to modify the Config or Handlers. The Session is safe to be
// read concurrently, but it should not be written to concurrently.
//
// If the AWS_SDK_LOAD_CONFIG environment is set to a truthy value, the New
// method could now encounter an error when loading the configuration. When
// The environment variable is set, and an error occurs, New will return a
// session that will fail all requests reporting the error that occurred while
// loading the session. Use NewSession to get the error when creating the
// session.
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded, in addition to
// the shared credentials file (~/.aws/config). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file.
//
// Deprecated: Use NewSession functions to create sessions instead. NewSession
// has the same functionality as New except an error can be returned when the
// func is called instead of waiting to receive an error until a request is made.
func New(cfgs ...*aws.Config) *Session {
// load initial config from environment
envCfg := loadEnvConfig()
if envCfg.EnableSharedConfig {
s, err := newSession(envCfg, cfgs...)
if err != nil {
// Old session.New expected all errors to be discovered when
// a request is made, and would report the errors then. This
// needs to be replicated if an error occurs while creating
// the session.
msg := "failed to create session with AWS_SDK_LOAD_CONFIG enabled. " +
"Use session.NewSession to handle errors occurring during session creation."
// Session creation failed, need to report the error and prevent
// any requests from succeeding.
s = &Session{Config: defaults.Config()}
s.Config.MergeIn(cfgs...)
s.Config.Logger.Log("ERROR:", msg, "Error:", err)
s.Handlers.Validate.PushBack(func(r *request.Request) {
r.Error = err
})
}
return s
}
return oldNewSession(cfgs...)
}
// NewSession returns a new Session created from SDK defaults, config files,
// environment, and user provided config files. Once the Session is created
// it can be mutated to modify the Config or Handlers. The Session is safe to
// be read concurrently, but it should not be written to concurrently.
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded in addition to
// the shared credentials file (~/.aws/config). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file. Enabling the Shared Config will also allow the Session
// to be built with retrieving credentials with AssumeRole set in the config.
//
// See the NewSessionWithOptions func for information on how to override or
// control through code how the Session will be created. Such as specifying the
// config profile, and controlling if shared config is enabled or not.
func NewSession(cfgs ...*aws.Config) (*Session, error) {
envCfg := loadEnvConfig()
return newSession(envCfg, cfgs...)
}
// SharedConfigState provides the ability to optionally override the state
// of the session's creation based on the shared config being enabled or
// disabled.
type SharedConfigState int
const (
// SharedConfigStateFromEnv does not override any state of the
// AWS_SDK_LOAD_CONFIG env var. It is the default value of the
// SharedConfigState type.
SharedConfigStateFromEnv SharedConfigState = iota
// SharedConfigDisable overrides the AWS_SDK_LOAD_CONFIG env var value
// and disables the shared config functionality.
SharedConfigDisable
// SharedConfigEnable overrides the AWS_SDK_LOAD_CONFIG env var value
// and enables the shared config functionality.
SharedConfigEnable
)
// Options provides the means to control how a Session is created and what
// configuration values will be loaded.
//
type Options struct {
// Provides config values for the SDK to use when creating service clients
// and making API requests to services. Any value set in with this field
// will override the associated value provided by the SDK defaults,
// environment or config files where relevant.
//
// If not set, configuration values from from SDK defaults, environment,
// config will be used.
Config aws.Config
// Overrides the config profile the Session should be created from. If not
// set the value of the environment variable will be loaded (AWS_PROFILE,
// or AWS_DEFAULT_PROFILE if the Shared Config is enabled).
//
// If not set and environment variables are not set the "default"
// (DefaultSharedConfigProfile) will be used as the profile to load the
// session config from.
Profile string
// Instructs how the Session will be created based on the AWS_SDK_LOAD_CONFIG
// environment variable. By default a Session will be created using the
// value provided by the AWS_SDK_LOAD_CONFIG environment variable.
//
// Setting this value to SharedConfigEnable or SharedConfigDisable
// will allow you to override the AWS_SDK_LOAD_CONFIG environment variable
// and enable or disable the shared config functionality.
SharedConfigState SharedConfigState
}
// NewSessionWithOptions returns a new Session created from SDK defaults, config files,
// environment, and user provided config files. This func uses the Options
// values to configure how the Session is created.
//
// If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value
// the shared config file (~/.aws/config) will also be loaded in addition to
// the shared credentials file (~/.aws/config). Values set in both the
// shared config, and shared credentials will be taken from the shared
// credentials file. Enabling the Shared Config will also allow the Session
// to be built with retrieving credentials with AssumeRole set in the config.
//
// // Equivalent to session.New
// sess, err := session.NewSessionWithOptions(session.Options{})
//
// // Specify profile to load for the session's config
// sess, err := session.NewSessionWithOptions(session.Options{
// Profile: "profile_name",
// })
//
// // Specify profile for config and region for requests
// sess, err := session.NewSessionWithOptions(session.Options{
// Config: aws.Config{Region: aws.String("us-east-1")},
// Profile: "profile_name",
// })
//
// // Force enable Shared Config support
// sess, err := session.NewSessionWithOptions(session.Options{
// SharedConfigState: SharedConfigEnable,
// })
func NewSessionWithOptions(opts Options) (*Session, error) {
var envCfg envConfig
if opts.SharedConfigState == SharedConfigEnable {
envCfg = loadSharedEnvConfig()
} else {
envCfg = loadEnvConfig()
}
if len(opts.Profile) > 0 {
envCfg.Profile = opts.Profile
}
switch opts.SharedConfigState {
case SharedConfigDisable:
envCfg.EnableSharedConfig = false
case SharedConfigEnable:
envCfg.EnableSharedConfig = true
}
return newSession(envCfg, &opts.Config)
}
// Must is a helper function to ensure the Session is valid and there was no
// error when calling a NewSession function.
//
// This helper is intended to be used in variable initialization to load the
// Session and configuration at startup. Such as:
//
// var sess = session.Must(session.NewSession())
func Must(sess *Session, err error) *Session {
if err != nil {
panic(err)
}
return sess
}
func oldNewSession(cfgs ...*aws.Config) *Session {
cfg := defaults.Config()
handlers := defaults.Handlers()
// Apply the passed in configs so the configuration can be applied to the
// default credential chain
cfg.MergeIn(cfgs...)
if cfg.EndpointResolver == nil {
// An endpoint resolver is required for a session to be able to provide
// endpoints for service client configurations.
cfg.EndpointResolver = endpoints.DefaultResolver()
}
cfg.Credentials = defaults.CredChain(cfg, handlers)
// Reapply any passed in configs to override credentials if set
cfg.MergeIn(cfgs...)
s := &Session{
Config: cfg,
Handlers: handlers,
}
initHandlers(s)
return s
}
func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
cfg := defaults.Config()
handlers := defaults.Handlers()
// Get a merged version of the user provided config to determine if
// credentials were.
userCfg := &aws.Config{}
userCfg.MergeIn(cfgs...)
// Order config files will be loaded in with later files overwriting
// previous config file values.
cfgFiles := []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile}
if !envCfg.EnableSharedConfig {
// The shared config file (~/.aws/config) is only loaded if instructed
// to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG).
cfgFiles = cfgFiles[1:]
}
// Load additional config from file(s)
sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles)
if err != nil {
return nil, err
}
mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers)
s := &Session{
Config: cfg,
Handlers: handlers,
}
initHandlers(s)
return s, nil
}
func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers) {
// Merge in user provided configuration
cfg.MergeIn(userCfg)
// Region if not already set by user
if len(aws.StringValue(cfg.Region)) == 0 {
if len(envCfg.Region) > 0 {
cfg.WithRegion(envCfg.Region)
} else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 {
cfg.WithRegion(sharedCfg.Region)
}
}
// Configure credentials if not already set
if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {
if len(envCfg.Creds.AccessKeyID) > 0 {
cfg.Credentials = credentials.NewStaticCredentialsFromCreds(
envCfg.Creds,
)
} else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil {
cfgCp := *cfg
cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(
sharedCfg.AssumeRoleSource.Creds,
)
cfg.Credentials = stscreds.NewCredentials(
&Session{
Config: &cfgCp,
Handlers: handlers.Copy(),
},
sharedCfg.AssumeRole.RoleARN,
func(opt *stscreds.AssumeRoleProvider) {
opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName
if len(sharedCfg.AssumeRole.ExternalID) > 0 {
opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)
}
// MFA not supported
},
)
} else if len(sharedCfg.Creds.AccessKeyID) > 0 {
cfg.Credentials = credentials.NewStaticCredentialsFromCreds(
sharedCfg.Creds,
)
} else {
// Fallback to default credentials provider, include mock errors
// for the credential chain so user can identify why credentials
// failed to be retrieved.
cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{
VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
Providers: []credentials.Provider{
&credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)},
&credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)},
defaults.RemoteCredProvider(*cfg, handlers),
},
})
}
}
}
type credProviderError struct {
Err error
}
var emptyCreds = credentials.Value{}
func (c credProviderError) Retrieve() (credentials.Value, error) {
return credentials.Value{}, c.Err
}
func (c credProviderError) IsExpired() bool {
return true
}
func initHandlers(s *Session) {
// Add the Validate parameter handler if it is not disabled.
s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)
if !aws.BoolValue(s.Config.DisableParamValidation) {
s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)
}
}
// Copy creates and returns a copy of the current Session, coping the config
// and handlers. If any additional configs are provided they will be merged
// on top of the Session's copied config.
//
// // Create a copy of the current Session, configured for the us-west-2 region.
// sess.Copy(&aws.Config{Region: aws.String("us-west-2")})
func (s *Session) Copy(cfgs ...*aws.Config) *Session {
newSession := &Session{
Config: s.Config.Copy(cfgs...),
Handlers: s.Handlers.Copy(),
}
initHandlers(newSession)
return newSession
}
// ClientConfig satisfies the client.ConfigProvider interface and is used to
// configure the service client instances. Passing the Session to the service
// client's constructor (New) will use this method to configure the client.
func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {
// Backwards compatibility, the error will be eaten if user calls ClientConfig
// directly. All SDK services will use ClientconfigWithError.
cfg, _ := s.clientConfigWithErr(serviceName, cfgs...)
return cfg
}
func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) {
s = s.Copy(cfgs...)
var resolved endpoints.ResolvedEndpoint
var err error
region := aws.StringValue(s.Config.Region)
if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 {
resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL))
resolved.SigningRegion = region
} else {
resolved, err = s.Config.EndpointResolver.EndpointFor(
serviceName, region,
func(opt *endpoints.Options) {
opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL)
opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack)
},
)
}
return client.Config{
Config: s.Config,
Handlers: s.Handlers,
Endpoint: resolved.URL,
SigningRegion: resolved.SigningRegion,
SigningName: resolved.SigningName,
}, err
}
|
{
"pile_set_name": "Github"
}
|
package com.vaadin.util;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import org.junit.Test;
@SuppressWarnings("unused")
public class ReflectToolsGetFieldValueByTypeTest {
@Test
public void getFieldValue() {
class MyClass {
public Integer getField() {
return 1;
}
public void setField(Integer i) {
}
}
class MySubClass extends MyClass {
public String field = "Hello";
}
MySubClass myInstance = new MySubClass();
Field memberField;
Object fieldValue = false;
try {
memberField = myInstance.getClass().getField("field");
// Should get a String value. Without the third parameter (calling
// ReflectTools.getJavaFieldValue(Object object, LegacyField field))
// would
// get an Integer value
fieldValue = ReflectTools.getJavaFieldValue(myInstance, memberField,
String.class);
} catch (Exception e) {
}
assertTrue(fieldValue instanceof String);
}
@Test
public void getFieldValueViaGetter() {
class MyClass {
public Integer field = 1;
}
class MySubClass extends MyClass {
public String field = "Hello";
}
MySubClass myInstance = new MySubClass();
Field memberField;
try {
memberField = myInstance.getClass().getField("field");
// Should throw an IllegalArgument exception as the mySubClass class
// doesn't have an Integer field.
ReflectTools.getJavaFieldValue(myInstance, memberField,
Integer.class);
fail("Previous method call should have thrown an exception");
} catch (Exception e) {
}
}
}
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//External Bus Interface
namespace ExbusMode0{ ///<Mode Register 0
using Addr = Register::Address<0x4003f000,0xffffc400,0x00000000,unsigned>;
///select how to set the MOEX width
constexpr Register::FieldLocation<Addr,Register::maskFromRange(13,13),Register::ReadWriteAccess,unsigned> moexeup{};
///select a CS assertion from the start of accessing to the end of address output
constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,12),Register::ReadWriteAccess,unsigned> mpxcsof{};
///select whether or not the address is output to the data lines in multiplex mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> mpxdoff{};
///set up the polarity of the ALE signal
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,unsigned> aleinv{};
///select operation bus mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,unsigned> mpxmode{};
///select to which idle cycle the write data output is extended
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> shrtdout{};
///control the external RDY function
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> rdy{};
///NOR Flash memory page access mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> page{};
///NAND Flash memory mode
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> nand{};
///disable the write enable signal (MWEX) operation
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> weoff{};
///Read Byte Mask ON
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> rbmon{};
///specify Data Width
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,unsigned> wdth{};
}
namespace ExbusMode1{ ///<Mode Register 1
using Addr = Register::Address<0x4003f004,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode2{ ///<Mode Register 2
using Addr = Register::Address<0x4003f008,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode3{ ///<Mode Register 3
using Addr = Register::Address<0x4003f00c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode4{ ///<Mode Register 4
using Addr = Register::Address<0x4003f010,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode5{ ///<Mode Register 5
using Addr = Register::Address<0x4003f014,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode6{ ///<Mode Register 6
using Addr = Register::Address<0x4003f018,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusMode7{ ///<Mode Register 7
using Addr = Register::Address<0x4003f01c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim0{ ///<Timing Register 0
using Addr = Register::Address<0x4003f020,0x00000000,0x00000000,unsigned>;
///Write Idle Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,28),Register::ReadWriteAccess,unsigned> widlc{};
///Write Enable Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(27,24),Register::ReadWriteAccess,unsigned> wwec{};
///Write Address Setup cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,20),Register::ReadWriteAccess,unsigned> wadc{};
///Write Access Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,16),Register::ReadWriteAccess,unsigned> wacc{};
///Read Idle Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,12),Register::ReadWriteAccess,unsigned> ridlc{};
///First Read Address Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,8),Register::ReadWriteAccess,unsigned> fradc{};
///Read Address Setup cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,4),Register::ReadWriteAccess,unsigned> radc{};
///Read Access Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> racc{};
}
namespace ExbusTim1{ ///<Timing Register 1
using Addr = Register::Address<0x4003f024,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim2{ ///<Timing Register 2
using Addr = Register::Address<0x4003f028,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim3{ ///<Timing Register 3
using Addr = Register::Address<0x4003f02c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim4{ ///<Timing Register 4
using Addr = Register::Address<0x4003f030,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim5{ ///<Timing Register 5
using Addr = Register::Address<0x4003f034,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim6{ ///<Timing Register 6
using Addr = Register::Address<0x4003f038,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusTim7{ ///<Timing Register 7
using Addr = Register::Address<0x4003f03c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusArea0{ ///<Area Register 0
using Addr = Register::Address<0x4003f040,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea1{ ///<Area Register 1
using Addr = Register::Address<0x4003f044,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea2{ ///<Area Register 2
using Addr = Register::Address<0x4003f048,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea3{ ///<Area Register 3
using Addr = Register::Address<0x4003f04c,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea4{ ///<Area Register 4
using Addr = Register::Address<0x4003f050,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea5{ ///<Area Register 5
using Addr = Register::Address<0x4003f054,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea6{ ///<Area Register 6
using Addr = Register::Address<0x4003f058,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusArea7{ ///<Area Register 7
using Addr = Register::Address<0x4003f05c,0xff80ff00,0x00000000,unsigned>;
///address mask
constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,16),Register::ReadWriteAccess,unsigned> mask{};
///Address
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> addr{};
}
namespace ExbusAtim0{ ///<ALE Timing Register 0
using Addr = Register::Address<0x4003f060,0xfffff000,0x00000000,unsigned>;
///Address Latch Enable Width
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,8),Register::ReadWriteAccess,unsigned> alew{};
///Address Latch Enable Setup cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,4),Register::ReadWriteAccess,unsigned> ales{};
///Address Latch Cycle
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> alc{};
}
namespace ExbusAtim1{ ///<ALE Timing Register 1
using Addr = Register::Address<0x4003f064,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim2{ ///<ALE Timing Register 2
using Addr = Register::Address<0x4003f068,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim3{ ///<ALE Timing Register 3
using Addr = Register::Address<0x4003f06c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim4{ ///<ALE Timing Register 4
using Addr = Register::Address<0x4003f070,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim5{ ///<ALE Timing Register 5
using Addr = Register::Address<0x4003f074,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim6{ ///<ALE Timing Register 6
using Addr = Register::Address<0x4003f078,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusAtim7{ ///<ALE Timing Register 7
using Addr = Register::Address<0x4003f07c,0xffffffff,0x00000000,unsigned>;
}
namespace ExbusDclkr{ ///<Division Clock Register
using Addr = Register::Address<0x4003f300,0xffffffe0,0x00000000,unsigned>;
///MCLK ON
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> mclkon{};
///MCLK Division Ratio Setup
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,0),Register::ReadWriteAccess,unsigned> mdiv{};
}
}
|
{
"pile_set_name": "Github"
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
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("Halibut.SampleChatApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Halibut.SampleChatApp")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b00abcd0-3ca8-42a4-b771-b98b277caab1")]
// 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("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"pile_set_name": "Github"
}
|
Music_MatchVictory_Ch1: ; f7b61 (3d:7b61)
musicdc 17
vibrato_type 1
vibrato_delay 20
musice8 8
octave 3
duty 0
volume 176
speed 1
A_ 15
tie
A_ 9
volume 39
A_ 5
volume 176
A_ 7
volume 39
A_ 3
volume 176
F_ 7
volume 39
F_ 3
volume 176
A_ 7
volume 39
A_ 2
volume 176
B_ 11
volume 39
B_ 10
inc_octave
volume 176
C_ 10
volume 39
C_ 11
volume 176
D_ 10
volume 39
D_ 10
volume 176
C# 8
volume 39
C# 13
volume 176
D_ 5
volume 39
D_ 6
volume 176
speed 8
E_ 12
volume 39
E_ 4
music_end
Music_MatchVictory_Ch2: ; f7bb0 (3d:7bb0)
musicdc 17
vibrato_type 1
vibrato_delay 20
musice8 8
octave 3
duty 0
volume 176
speed 1
F_ 5
volume 39
F_ 5
dec_octave
volume 176
A_ 5
inc_octave
C_ 5
F_ 5
volume 39
F_ 4
volume 176
C_ 7
volume 39
C_ 3
dec_octave
volume 176
A_ 7
volume 39
A_ 3
inc_octave
volume 176
C_ 7
volume 39
C_ 2
volume 176
G_ 11
volume 39
G_ 10
volume 176
A_ 10
volume 39
A_ 11
volume 176
B_ 10
volume 39
B_ 10
volume 176
A_ 8
volume 39
A_ 13
volume 176
B_ 5
volume 39
B_ 6
inc_octave
volume 176
speed 8
C# 12
volume 39
C# 4
music_end
Music_MatchVictory_Ch3: ; f7c09 (3d:7c09)
musicdc 17
wave 1
volume 32
musice8 8
musice9 0
octave 1
speed 1
F_ 15
tie
F_ 9
rest 5
F_ 7
rest 3
F_ 7
rest 3
F_ 7
rest 2
G_ 11
rest 10
G_ 11
rest 10
G_ 10
rest 10
A_ 8
rest 13
E_ 5
rest 6
speed 8
A_ 12
music_end
; 0xf7c2e
|
{
"pile_set_name": "Github"
}
|
name: GitHub
url: http://www.github.com/
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// This tool generates types for the various XML formats of CLDR.
package main
import (
"archive/zip"
"bytes"
"encoding/xml"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"regexp"
"strings"
"golang.org/x/text/internal/gen"
)
var outputFile = flag.String("output", "xml.go", "output file name")
func main() {
flag.Parse()
r := gen.OpenCLDRCoreZip()
buffer, err := ioutil.ReadAll(r)
if err != nil {
log.Fatal("Could not read zip file")
}
r.Close()
z, err := zip.NewReader(bytes.NewReader(buffer), int64(len(buffer)))
if err != nil {
log.Fatalf("Could not read zip archive: %v", err)
}
var buf bytes.Buffer
version := gen.CLDRVersion()
for _, dtd := range files {
for _, f := range z.File {
if strings.HasSuffix(f.Name, dtd.file+".dtd") {
r, err := f.Open()
failOnError(err)
b := makeBuilder(&buf, dtd)
b.parseDTD(r)
b.resolve(b.index[dtd.top[0]])
b.write()
if b.version != "" && version != b.version {
println(f.Name)
log.Fatalf("main: inconsistent versions: found %s; want %s", b.version, version)
}
break
}
}
}
fmt.Fprintln(&buf, "// Version is the version of CLDR from which the XML definitions are generated.")
fmt.Fprintf(&buf, "const Version = %q\n", version)
gen.WriteGoFile(*outputFile, "cldr", buf.Bytes())
}
func failOnError(err error) {
if err != nil {
log.New(os.Stderr, "", log.Lshortfile).Output(2, err.Error())
os.Exit(1)
}
}
// configuration data per DTD type
type dtd struct {
file string // base file name
root string // Go name of the root XML element
top []string // create a different type for this section
skipElem []string // hard-coded or deprecated elements
skipAttr []string // attributes to exclude
predefined []string // hard-coded elements exist of the form <name>Elem
forceRepeat []string // elements to make slices despite DTD
}
var files = []dtd{
{
file: "ldmlBCP47",
root: "LDMLBCP47",
top: []string{"ldmlBCP47"},
skipElem: []string{
"cldrVersion", // deprecated, not used
},
},
{
file: "ldmlSupplemental",
root: "SupplementalData",
top: []string{"supplementalData"},
skipElem: []string{
"cldrVersion", // deprecated, not used
},
forceRepeat: []string{
"plurals", // data defined in plurals.xml and ordinals.xml
},
},
{
file: "ldml",
root: "LDML",
top: []string{
"ldml", "collation", "calendar", "timeZoneNames", "localeDisplayNames", "numbers",
},
skipElem: []string{
"cp", // not used anywhere
"special", // not used anywhere
"fallback", // deprecated, not used
"alias", // in Common
"default", // in Common
},
skipAttr: []string{
"hiraganaQuarternary", // typo in DTD, correct version included as well
},
predefined: []string{"rules"},
},
}
var comments = map[string]string{
"ldmlBCP47": `
// LDMLBCP47 holds information on allowable values for various variables in LDML.
`,
"supplementalData": `
// SupplementalData holds information relevant for internationalization
// and proper use of CLDR, but that is not contained in the locale hierarchy.
`,
"ldml": `
// LDML is the top-level type for locale-specific data.
`,
"collation": `
// Collation contains rules that specify a certain sort-order,
// as a tailoring of the root order.
// The parsed rules are obtained by passing a RuleProcessor to Collation's
// Process method.
`,
"calendar": `
// Calendar specifies the fields used for formatting and parsing dates and times.
// The month and quarter names are identified numerically, starting at 1.
// The day (of the week) names are identified with short strings, since there is
// no universally-accepted numeric designation.
`,
"dates": `
// Dates contains information regarding the format and parsing of dates and times.
`,
"localeDisplayNames": `
// LocaleDisplayNames specifies localized display names for for scripts, languages,
// countries, currencies, and variants.
`,
"numbers": `
// Numbers supplies information for formatting and parsing numbers and currencies.
`,
}
type element struct {
name string // XML element name
category string // elements contained by this element
signature string // category + attrKey*
attr []*attribute // attributes supported by this element.
sub []struct { // parsed and evaluated sub elements of this element.
e *element
repeat bool // true if the element needs to be a slice
}
resolved bool // prevent multiple resolutions of this element.
}
type attribute struct {
name string
key string
list []string
tag string // Go tag
}
var (
reHead = regexp.MustCompile(` *(\w+) +([\w\-]+)`)
reAttr = regexp.MustCompile(` *(\w+) *(?:(\w+)|\(([\w\- \|]+)\)) *(?:#([A-Z]*) *(?:\"([\.\d+])\")?)? *("[\w\-:]*")?`)
reElem = regexp.MustCompile(`^ *(EMPTY|ANY|\(.*\)[\*\+\?]?) *$`)
reToken = regexp.MustCompile(`\w\-`)
)
// builder is used to read in the DTD files from CLDR and generate Go code
// to be used with the encoding/xml package.
type builder struct {
w io.Writer
index map[string]*element
elem []*element
info dtd
version string
}
func makeBuilder(w io.Writer, d dtd) builder {
return builder{
w: w,
index: make(map[string]*element),
elem: []*element{},
info: d,
}
}
// parseDTD parses a DTD file.
func (b *builder) parseDTD(r io.Reader) {
for d := xml.NewDecoder(r); ; {
t, err := d.Token()
if t == nil {
break
}
failOnError(err)
dir, ok := t.(xml.Directive)
if !ok {
continue
}
m := reHead.FindSubmatch(dir)
dir = dir[len(m[0]):]
ename := string(m[2])
el, elementFound := b.index[ename]
switch string(m[1]) {
case "ELEMENT":
if elementFound {
log.Fatal("parseDTD: duplicate entry for element %q", ename)
}
m := reElem.FindSubmatch(dir)
if m == nil {
log.Fatalf("parseDTD: invalid element %q", string(dir))
}
if len(m[0]) != len(dir) {
log.Fatal("parseDTD: invalid element %q", string(dir), len(dir), len(m[0]), string(m[0]))
}
s := string(m[1])
el = &element{
name: ename,
category: s,
}
b.index[ename] = el
case "ATTLIST":
if !elementFound {
log.Fatalf("parseDTD: unknown element %q", ename)
}
s := string(dir)
m := reAttr.FindStringSubmatch(s)
if m == nil {
log.Fatal(fmt.Errorf("parseDTD: invalid attribute %q", string(dir)))
}
if m[4] == "FIXED" {
b.version = m[5]
} else {
switch m[1] {
case "draft", "references", "alt", "validSubLocales", "standard" /* in Common */ :
case "type", "choice":
default:
el.attr = append(el.attr, &attribute{
name: m[1],
key: s,
list: reToken.FindAllString(m[3], -1),
})
el.signature = fmt.Sprintf("%s=%s+%s", el.signature, m[1], m[2])
}
}
}
}
}
var reCat = regexp.MustCompile(`[ ,\|]*(?:(\(|\)|\#?[\w_-]+)([\*\+\?]?))?`)
// resolve takes a parsed element and converts it into structured data
// that can be used to generate the XML code.
func (b *builder) resolve(e *element) {
if e.resolved {
return
}
b.elem = append(b.elem, e)
e.resolved = true
s := e.category
found := make(map[string]bool)
sequenceStart := []int{}
for len(s) > 0 {
m := reCat.FindStringSubmatch(s)
if m == nil {
log.Fatalf("%s: invalid category string %q", e.name, s)
}
repeat := m[2] == "*" || m[2] == "+" || in(b.info.forceRepeat, m[1])
switch m[1] {
case "":
case "(":
sequenceStart = append(sequenceStart, len(e.sub))
case ")":
if len(sequenceStart) == 0 {
log.Fatalf("%s: unmatched closing parenthesis", e.name)
}
for i := sequenceStart[len(sequenceStart)-1]; i < len(e.sub); i++ {
e.sub[i].repeat = e.sub[i].repeat || repeat
}
sequenceStart = sequenceStart[:len(sequenceStart)-1]
default:
if in(b.info.skipElem, m[1]) {
} else if sub, ok := b.index[m[1]]; ok {
if !found[sub.name] {
e.sub = append(e.sub, struct {
e *element
repeat bool
}{sub, repeat})
found[sub.name] = true
b.resolve(sub)
}
} else if m[1] == "#PCDATA" || m[1] == "ANY" {
} else if m[1] != "EMPTY" {
log.Fatalf("resolve:%s: element %q not found", e.name, m[1])
}
}
s = s[len(m[0]):]
}
}
// return true if s is contained in set.
func in(set []string, s string) bool {
for _, v := range set {
if v == s {
return true
}
}
return false
}
var repl = strings.NewReplacer("-", " ", "_", " ")
// title puts the first character or each character following '_' in title case and
// removes all occurrences of '_'.
func title(s string) string {
return strings.Replace(strings.Title(repl.Replace(s)), " ", "", -1)
}
// writeElem generates Go code for a single element, recursively.
func (b *builder) writeElem(tab int, e *element) {
p := func(f string, x ...interface{}) {
f = strings.Replace(f, "\n", "\n"+strings.Repeat("\t", tab), -1)
fmt.Fprintf(b.w, f, x...)
}
if len(e.sub) == 0 && len(e.attr) == 0 {
p("Common")
return
}
p("struct {")
tab++
p("\nCommon")
for _, attr := range e.attr {
if !in(b.info.skipAttr, attr.name) {
p("\n%s string `xml:\"%s,attr\"`", title(attr.name), attr.name)
}
}
for _, sub := range e.sub {
if in(b.info.predefined, sub.e.name) {
p("\n%sElem", sub.e.name)
continue
}
if in(b.info.skipElem, sub.e.name) {
continue
}
p("\n%s ", title(sub.e.name))
if sub.repeat {
p("[]")
}
p("*")
if in(b.info.top, sub.e.name) {
p(title(sub.e.name))
} else {
b.writeElem(tab, sub.e)
}
p(" `xml:\"%s\"`", sub.e.name)
}
tab--
p("\n}")
}
// write generates the Go XML code.
func (b *builder) write() {
for i, name := range b.info.top {
e := b.index[name]
if e != nil {
fmt.Fprintf(b.w, comments[name])
name := title(e.name)
if i == 0 {
name = b.info.root
}
fmt.Fprintf(b.w, "type %s ", name)
b.writeElem(0, e)
fmt.Fprint(b.w, "\n")
}
}
}
|
{
"pile_set_name": "Github"
}
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from .. import models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
class SchemaOperations(object):
"""SchemaOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.schemaregistry._generated.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def get_by_id(
self,
schema_id, # type: str
**kwargs # type: Any
):
# type: (...) -> str
"""Get a registered schema by its unique ID reference.
Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique
within a namespace.
:param schema_id: References specific schema in registry namespace.
:type schema_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: str, or the result of cls(response)
:rtype: str
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[str]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2017-04"
accept = "application/json"
# Construct URL
url = self.get_by_id.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'schema-id': self._serialize.url("schema_id", schema_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize('object', response)
raise HttpResponseError(response=response, model=error)
response_headers = {}
response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
response_headers['X-Schema-Type']=self._deserialize('str', response.headers.get('X-Schema-Type'))
response_headers['X-Schema-Id']=self._deserialize('str', response.headers.get('X-Schema-Id'))
response_headers['X-Schema-Id-Location']=self._deserialize('str', response.headers.get('X-Schema-Id-Location'))
response_headers['X-Schema-Version']=self._deserialize('int', response.headers.get('X-Schema-Version'))
deserialized = self._deserialize('str', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, response_headers)
return deserialized
get_by_id.metadata = {'url': '/$schemagroups/getSchemaById/{schema-id}'} # type: ignore
def query_id_by_content(
self,
group_name, # type: str
schema_name, # type: str
x_schema_type, # type: Union[str, "models.SerializationType"]
schema_content, # type: str
**kwargs # type: Any
):
# type: (...) -> "models.SchemaId"
"""Get ID for existing schema.
Gets the ID referencing an existing schema within the specified schema group, as matched by
schema content comparison.
:param group_name: Schema group under which schema is registered. Group's serialization type
should match the serialization type specified in the request.
:type group_name: str
:param schema_name: Name of the registered schema.
:type schema_name: str
:param x_schema_type: Serialization type for the schema being registered.
:type x_schema_type: str or ~azure.schemaregistry._generated.models.SerializationType
:param schema_content: String representation of the registered schema.
:type schema_content: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SchemaId, or the result of cls(response)
:rtype: ~azure.schemaregistry._generated.models.SchemaId
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.SchemaId"]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2017-04"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.query_id_by_content.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'group-name': self._serialize.url("group_name", group_name, 'str'),
'schema-name': self._serialize.url("schema_name", schema_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['X-Schema-Type'] = self._serialize.header("x_schema_type", x_schema_type, 'str')
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(schema_content, 'str')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize('object', response)
raise HttpResponseError(response=response, model=error)
response_headers = {}
response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
response_headers['X-Schema-Type']=self._deserialize('str', response.headers.get('X-Schema-Type'))
response_headers['X-Schema-Id']=self._deserialize('str', response.headers.get('X-Schema-Id'))
response_headers['X-Schema-Id-Location']=self._deserialize('str', response.headers.get('X-Schema-Id-Location'))
response_headers['X-Schema-Version']=self._deserialize('int', response.headers.get('X-Schema-Version'))
deserialized = self._deserialize('SchemaId', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, response_headers)
return deserialized
query_id_by_content.metadata = {'url': '/$schemagroups/{group-name}/schemas/{schema-name}'} # type: ignore
def register(
self,
group_name, # type: str
schema_name, # type: str
x_schema_type, # type: Union[str, "models.SerializationType"]
schema_content, # type: str
**kwargs # type: Any
):
# type: (...) -> "models.SchemaId"
"""Register new schema.
Register new schema. If schema of specified name does not exist in specified group, schema is
created at version 1. If schema of specified name exists already in specified group, schema is
created at latest version + 1.
:param group_name: Schema group under which schema should be registered. Group's serialization
type should match the serialization type specified in the request.
:type group_name: str
:param schema_name: Name of schema being registered.
:type schema_name: str
:param x_schema_type: Serialization type for the schema being registered.
:type x_schema_type: str or ~azure.schemaregistry._generated.models.SerializationType
:param schema_content: String representation of the schema being registered.
:type schema_content: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: SchemaId, or the result of cls(response)
:rtype: ~azure.schemaregistry._generated.models.SchemaId
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.SchemaId"]
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2017-04"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.register.metadata['url'] # type: ignore
path_format_arguments = {
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
'group-name': self._serialize.url("group_name", group_name, 'str'),
'schema-name': self._serialize.url("schema_name", schema_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['X-Schema-Type'] = self._serialize.header("x_schema_type", x_schema_type, 'str')
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(schema_content, 'str')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize('object', response)
raise HttpResponseError(response=response, model=error)
response_headers = {}
response_headers['Location']=self._deserialize('str', response.headers.get('Location'))
response_headers['X-Schema-Type']=self._deserialize('str', response.headers.get('X-Schema-Type'))
response_headers['X-Schema-Id']=self._deserialize('str', response.headers.get('X-Schema-Id'))
response_headers['X-Schema-Id-Location']=self._deserialize('str', response.headers.get('X-Schema-Id-Location'))
response_headers['X-Schema-Version']=self._deserialize('int', response.headers.get('X-Schema-Version'))
deserialized = self._deserialize('SchemaId', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, response_headers)
return deserialized
register.metadata = {'url': '/$schemagroups/{group-name}/schemas/{schema-name}'} # type: ignore
|
{
"pile_set_name": "Github"
}
|
package us.ihmc.commonWalkingControlModules.capturePoint.smoothCMPBasedICPPlanner.CoPGeneration;
import static us.ihmc.robotics.Assert.*;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import us.ihmc.commonWalkingControlModules.configurations.CoPSplineType;
import us.ihmc.commonWalkingControlModules.capturePoint.smoothCMPBasedICPPlanner.WalkingTrajectoryType;
import us.ihmc.commons.Epsilons;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Disabled;
import us.ihmc.euclid.referenceFrame.FramePoint3D;
import us.ihmc.euclid.referenceFrame.ReferenceFrame;
import us.ihmc.euclid.referenceFrame.tools.ReferenceFrameTools;
import us.ihmc.commons.MathTools;
public class CoPTrajectoryTest
{
private static int maxNumberOfSegments = 2;
private static final ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame();
private static final double epsilon = Epsilons.ONE_BILLIONTH;
@AfterEach
public void tearDown()
{
ReferenceFrameTools.clearWorldFrameTree();
}
@Test
public void testLinear()
{
CoPTrajectory testTrajectory = new CoPTrajectory(CoPSplineType.LINEAR, maxNumberOfSegments, WalkingTrajectoryType.TRANSFER);
assertTrue(testTrajectory.getTrajectoryType() == WalkingTrajectoryType.TRANSFER);
assertTrue(testTrajectory.getMaxNumberOfSegments() == maxNumberOfSegments);
testTrajectory.reset();
testTrajectory.setNextSegment(0.0, 1.0, new FramePoint3D(worldFrame, 1.5, 2.6, 10.15), new FramePoint3D(worldFrame, 3.1, -1.5, 0.9));
assertTrue(testTrajectory.getNumberOfSegments() == 1);
assertTrue(testTrajectory.getSegment(0).getNumberOfCoefficients() == 2);
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(0), 1.5, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(1), 1.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(0), 2.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(1), -4.1, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(0), 10.15, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(1), -9.25, epsilon));
testTrajectory.setNextSegment(1.0, 2.0, new FramePoint3D(worldFrame, -2.5, -0.6, -0.8), new FramePoint3D(worldFrame, 1.1, -0.6, 20.5));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(0), 1.5, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(1), 1.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(0), 2.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(1), -4.1, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(0), 10.15, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(1), -9.25, epsilon));
assertTrue(testTrajectory.getNumberOfSegments() == 2);
assertTrue(testTrajectory.getSegment(1).getNumberOfCoefficients() == 2);
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(0), -6.1, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(1), 3.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(0), -0.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(0), -22.1, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(1), 21.3, epsilon));
}
@Test
public void testCubic()
{
CoPTrajectory testTrajectory = new CoPTrajectory(CoPSplineType.CUBIC, maxNumberOfSegments, WalkingTrajectoryType.SWING);
assertTrue(testTrajectory.getTrajectoryType() == WalkingTrajectoryType.SWING);
assertTrue(testTrajectory.getMaxNumberOfSegments() == maxNumberOfSegments);
testTrajectory.reset();
testTrajectory.setNextSegment(0.0, 1.0, new FramePoint3D(worldFrame, 1.5, 2.6, 10.15), new FramePoint3D(worldFrame, 3.1, -1.5, 0.9));
assertTrue(testTrajectory.getNumberOfSegments() == 1);
assertTrue(testTrajectory.getSegment(0).getNumberOfCoefficients() == 4);
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(0), 1.5, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(2), 4.8, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(3), -3.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(0), 2.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(2), -12.3, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(3), 8.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(0), 10.15, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(2), -27.75, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(3), 18.5, epsilon));
testTrajectory.setNextSegment(1.0, 2.0, new FramePoint3D(worldFrame, -2.5, -0.6, -0.8), new FramePoint3D(worldFrame, 1.1, -0.6, 20.5));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(0), 1.5, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(2), 4.8, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryX().getCoefficient(3), -3.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(0), 2.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(2), -12.3, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryY().getCoefficient(3), 8.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(0), 10.15, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(2), -27.75, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(0).getTrajectoryZ().getCoefficient(3), 18.5, epsilon));
assertTrue(testTrajectory.getNumberOfSegments() == 2);
assertTrue(testTrajectory.getSegment(1).getNumberOfCoefficients() == 4);
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(0), 15.5, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(1), -43.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(2), 32.4, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryX().getCoefficient(3), -7.2, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(0), -0.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(1), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(2), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryY().getCoefficient(3), 0.0, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(0), 105.7, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(1), -255.6, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(2), 191.7, epsilon));
assertTrue(MathTools.epsilonEquals(testTrajectory.getSegment(1).getTrajectoryZ().getCoefficient(3), -42.6, epsilon));
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017 BayLibre, SAS.
* Author: Neil Armstrong <narmstrong@baylibre.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <linux/clk-provider.h>
#include <linux/bitfield.h>
#include <linux/regmap.h>
#include "gxbb-aoclk.h"
/*
* The AO Domain embeds a dual/divider to generate a more precise
* 32,768KHz clock for low-power suspend mode and CEC.
* ______ ______
* | | | |
* ______ | Div1 |-| Cnt1 | ______
* | | /|______| |______|\ | |
* Xtal-->| Gate |---| ______ ______ X-X--| Gate |-->
* |______| | \| | | |/ | |______|
* | | Div2 |-| Cnt2 | |
* | |______| |______| |
* |_______________________|
*
* The dividing can be switched to single or dual, with a counter
* for each divider to set when the switching is done.
* The entire dividing mechanism can be also bypassed.
*/
#define CLK_CNTL0_N1_MASK GENMASK(11, 0)
#define CLK_CNTL0_N2_MASK GENMASK(23, 12)
#define CLK_CNTL0_DUALDIV_EN BIT(28)
#define CLK_CNTL0_OUT_GATE_EN BIT(30)
#define CLK_CNTL0_IN_GATE_EN BIT(31)
#define CLK_CNTL1_M1_MASK GENMASK(11, 0)
#define CLK_CNTL1_M2_MASK GENMASK(23, 12)
#define CLK_CNTL1_BYPASS_EN BIT(24)
#define CLK_CNTL1_SELECT_OSC BIT(27)
#define PWR_CNTL_ALT_32K_SEL GENMASK(13, 10)
struct cec_32k_freq_table {
unsigned long parent_rate;
unsigned long target_rate;
bool dualdiv;
unsigned int n1;
unsigned int n2;
unsigned int m1;
unsigned int m2;
};
static const struct cec_32k_freq_table aoclk_cec_32k_table[] = {
[0] = {
.parent_rate = 24000000,
.target_rate = 32768,
.dualdiv = true,
.n1 = 733,
.n2 = 732,
.m1 = 8,
.m2 = 11,
},
};
/*
* If CLK_CNTL0_DUALDIV_EN == 0
* - will use N1 divider only
* If CLK_CNTL0_DUALDIV_EN == 1
* - hold M1 cycles of N1 divider then changes to N2
* - hold M2 cycles of N2 divider then changes to N1
* Then we can get more accurate division.
*/
static unsigned long aoclk_cec_32k_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
struct aoclk_cec_32k *cec_32k = to_aoclk_cec_32k(hw);
unsigned long n1;
u32 reg0, reg1;
regmap_read(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL0, ®0);
regmap_read(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL1, ®1);
if (reg1 & CLK_CNTL1_BYPASS_EN)
return parent_rate;
if (reg0 & CLK_CNTL0_DUALDIV_EN) {
unsigned long n2, m1, m2, f1, f2, p1, p2;
n1 = FIELD_GET(CLK_CNTL0_N1_MASK, reg0) + 1;
n2 = FIELD_GET(CLK_CNTL0_N2_MASK, reg0) + 1;
m1 = FIELD_GET(CLK_CNTL1_M1_MASK, reg1) + 1;
m2 = FIELD_GET(CLK_CNTL1_M2_MASK, reg1) + 1;
f1 = DIV_ROUND_CLOSEST(parent_rate, n1);
f2 = DIV_ROUND_CLOSEST(parent_rate, n2);
p1 = DIV_ROUND_CLOSEST(100000000 * m1, f1 * (m1 + m2));
p2 = DIV_ROUND_CLOSEST(100000000 * m2, f2 * (m1 + m2));
return DIV_ROUND_UP(100000000, p1 + p2);
}
n1 = FIELD_GET(CLK_CNTL0_N1_MASK, reg0) + 1;
return DIV_ROUND_CLOSEST(parent_rate, n1);
}
static const struct cec_32k_freq_table *find_cec_32k_freq(unsigned long rate,
unsigned long prate)
{
int i;
for (i = 0 ; i < ARRAY_SIZE(aoclk_cec_32k_table) ; ++i)
if (aoclk_cec_32k_table[i].parent_rate == prate &&
aoclk_cec_32k_table[i].target_rate == rate)
return &aoclk_cec_32k_table[i];
return NULL;
}
static long aoclk_cec_32k_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{
const struct cec_32k_freq_table *freq = find_cec_32k_freq(rate,
*prate);
/* If invalid return first one */
if (!freq)
return aoclk_cec_32k_table[0].target_rate;
return freq->target_rate;
}
/*
* From the Amlogic init procedure, the IN and OUT gates needs to be handled
* in the init procedure to avoid any glitches.
*/
static int aoclk_cec_32k_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
const struct cec_32k_freq_table *freq = find_cec_32k_freq(rate,
parent_rate);
struct aoclk_cec_32k *cec_32k = to_aoclk_cec_32k(hw);
u32 reg = 0;
if (!freq)
return -EINVAL;
/* Disable clock */
regmap_update_bits(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL0,
CLK_CNTL0_IN_GATE_EN | CLK_CNTL0_OUT_GATE_EN, 0);
reg = FIELD_PREP(CLK_CNTL0_N1_MASK, freq->n1 - 1);
if (freq->dualdiv)
reg |= CLK_CNTL0_DUALDIV_EN |
FIELD_PREP(CLK_CNTL0_N2_MASK, freq->n2 - 1);
regmap_write(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL0, reg);
reg = FIELD_PREP(CLK_CNTL1_M1_MASK, freq->m1 - 1);
if (freq->dualdiv)
reg |= FIELD_PREP(CLK_CNTL1_M2_MASK, freq->m2 - 1);
regmap_write(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL1, reg);
/* Enable clock */
regmap_update_bits(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL0,
CLK_CNTL0_IN_GATE_EN, CLK_CNTL0_IN_GATE_EN);
udelay(200);
regmap_update_bits(cec_32k->regmap, AO_RTC_ALT_CLK_CNTL0,
CLK_CNTL0_OUT_GATE_EN, CLK_CNTL0_OUT_GATE_EN);
regmap_update_bits(cec_32k->regmap, AO_CRT_CLK_CNTL1,
CLK_CNTL1_SELECT_OSC, CLK_CNTL1_SELECT_OSC);
/* Select 32k from XTAL */
regmap_update_bits(cec_32k->regmap,
AO_RTI_PWR_CNTL_REG0,
PWR_CNTL_ALT_32K_SEL,
FIELD_PREP(PWR_CNTL_ALT_32K_SEL, 4));
return 0;
}
const struct clk_ops meson_aoclk_cec_32k_ops = {
.recalc_rate = aoclk_cec_32k_recalc_rate,
.round_rate = aoclk_cec_32k_round_rate,
.set_rate = aoclk_cec_32k_set_rate,
};
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PersonLoginMigration</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.PersonLoginMigration</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build windows
package fileutil
import (
"os"
"syscall"
)
// OpenDir opens a directory in windows with write access for syncing.
func OpenDir(path string) (*os.File, error) {
fd, err := openDir(path)
if err != nil {
return nil, err
}
return os.NewFile(uintptr(fd), path), nil
}
func openDir(path string) (fd syscall.Handle, err error) {
if len(path) == 0 {
return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND
}
pathp, err := syscall.UTF16PtrFromString(path)
if err != nil {
return syscall.InvalidHandle, err
}
access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE)
sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE)
createmode := uint32(syscall.OPEN_EXISTING)
fl := uint32(syscall.FILE_FLAG_BACKUP_SEMANTICS)
return syscall.CreateFile(pathp, access, sharemode, nil, createmode, fl, 0)
}
|
{
"pile_set_name": "Github"
}
|
/* Greek (el) initialisation for the jQuery UI date picker plugin. */
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
jQuery(function($){
$.datepicker.regional['el'] = {
closeText: 'Κλείσιμο',
prevText: 'Προηγούμενος',
nextText: 'Επόμενος',
currentText: 'Τρέχων Μήνας',
monthNames: ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάιος','Ιούνιος',
'Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος'],
monthNamesShort: ['Ιαν','Φεβ','Μαρ','Απρ','Μαι','Ιουν',
'Ιουλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],
dayNames: ['Κυριακή','Δευτέρα','Τρίτη','Τετάρτη','Πέμπτη','Παρασκευή','Σάββατο'],
dayNamesShort: ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ'],
dayNamesMin: ['Κυ','Δε','Τρ','Τε','Πε','Πα','Σα'],
weekHeader: 'Εβδ',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['el']);
});
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2014-present, The osquery authors
*
* This source code is licensed as defined by the LICENSE file found in the
* root directory of this source tree.
*
* SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
*/
#include <osquery/core/core.h>
#include <osquery/core/tables.h>
#include <osquery/logger/logger.h>
#include <osquery/tables/system/windows/registry.h>
#include <osquery/utils/conversions/tryto.h>
#include <osquery/utils/conversions/windows/windows_time.h>
#include <boost/algorithm/hex.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/optional.hpp>
#include <algorithm>
#include <string>
const int kWin8 = 256;
const int kWin10PreCreator = 96;
const int kWin10Creator = 104;
const std::string kWin8Start = "80";
const std::string kWin10Start = "30";
const std::string kWin10CreatorStart = "34";
const std::string kWin8110ShimcacheDelimiter = "31307473";
// Shimcache can be in multiple ControlSets (ControlSet001, ControlSet002, etc)
const std::string kShimcacheControlset =
"HKEY_LOCAL_MACHINE\\SYSTEM\\%ControlSet%\\Control\\Session "
"Manager\\AppCompatCache";
struct ShimcacheData {
std::string path;
long long last_modified;
boost::optional<bool> execution_flag;
};
namespace osquery {
namespace tables {
auto parseShimcacheData(const std::string& token,
const boost::optional<bool>& execution_flag_exists) {
ShimcacheData shimcache;
std::string path_length = token.substr(16, 4);
// swap endianess
std::reverse(path_length.begin(), path_length.end());
for (std::size_t i = 0; i < path_length.length(); i += 2) {
std::swap(path_length[i], path_length[i + 1]);
}
// Convert string to size_t for file path length
uint64_t shimcache_file_path =
tryTo<std::uint64_t>(path_length, 16).takeOr(0_sz);
// If the file path length is zero then there is no path
if (shimcache_file_path == 0) {
shimcache.last_modified = 0LL;
return shimcache;
}
// Registry data is in Unicode (extra 0x00)
std::string path = token.substr(20, (size_t)shimcache_file_path * 2);
boost::erase_all(path, "00");
// Windows Store entries have extra data, the extra data includes tabs in the
// entry (Unicode value 09). Convert to spaces due to table formatting
// issues
boost::replace_all(path, "09", "20");
std::string string_path;
// Convert hex path to readable string
try {
string_path = boost::algorithm::unhex(path);
} catch (const boost::algorithm::hex_decode_error& /* e */) {
LOG(WARNING) << "Failed to decode Shimcache hex values to string: " << path;
shimcache.last_modified = 0LL;
return shimcache;
}
shimcache.path = string_path;
size_t shimcache_modified_start = 0;
size_t execution_flag_start = 0;
// If execution flag exists set where the flag starts in the substring
if (execution_flag_exists == true) {
shimcache_modified_start = 40;
execution_flag_start = 24;
} else {
shimcache_modified_start = 20;
}
std::string shimcache_time = token.substr(
shimcache_modified_start + (size_t)shimcache_file_path * 2, 16);
// Sometimes Shimcache artifacts have 0 as timestamp, if so skip filetime
// converstion
shimcache.last_modified = (shimcache_time == "0000000000000000")
? 0LL
: littleEndianToUnixTime(shimcache_time);
if (execution_flag_exists == true) {
int shimcache_flag =
tryTo<int>(
token.substr(execution_flag_start + (size_t)shimcache_file_path * 2,
2),
16)
.takeOr(0);
// Perform Bitwise AND to determine TRUE or FALSE
if (shimcache_flag & 2) {
shimcache.execution_flag = true;
} else {
shimcache.execution_flag = false;
}
}
return shimcache;
}
void parseEntry(const Row& aKey, size_t& index, QueryData& results) {
boost::optional<bool> execution_flag_exists;
std::string delimter;
std::string data = aKey.at("data");
// Check if Registry data starts with any of supported WIN_START
// values and if the Shimcache delimiter exists at the specific
// substring
if ((boost::starts_with(data, kWin8Start)) &&
(data.substr(kWin8, 8) == kWin8110ShimcacheDelimiter)) {
execution_flag_exists = true;
delimter = kWin8110ShimcacheDelimiter;
} else if (boost::starts_with(data, kWin10Start) &&
(data.substr(kWin10PreCreator, 8) == kWin8110ShimcacheDelimiter)) {
delimter = kWin8110ShimcacheDelimiter;
} else if (boost::starts_with(data, kWin10CreatorStart) &&
(data.substr(kWin10Creator, 8) == kWin8110ShimcacheDelimiter)) {
delimter = kWin8110ShimcacheDelimiter;
} else {
LOG(WARNING) << "Unknown or unsupported shimcache data: "
<< data.substr(256, 8);
return;
}
bool first_run = true;
size_t pos = 0;
std::string token;
auto createRow = [&results, &index](const ShimcacheData& shimcache) {
Row r;
r["entry"] = INTEGER(index);
r["path"] = SQL_TEXT(shimcache.path);
r["modified_time"] = INTEGER(shimcache.last_modified);
if (shimcache.execution_flag.is_initialized()) {
if (shimcache.execution_flag.get()) {
r["execution_flag"] = INTEGER(1);
} else {
r["execution_flag"] = INTEGER(0);
}
} else {
r["execution_flag"] = INTEGER(-1);
}
results.push_back(std::move(r));
};
// Find all entries base on shimcache data delimter
while ((pos = data.find(delimter)) != std::string::npos) {
token = data.substr(0, pos);
// Skip all the data before the first delimter match
if (token.length() > 20) {
if (first_run) {
first_run = false;
data.erase(0, pos + delimter.length());
continue;
}
createRow(parseShimcacheData(token, execution_flag_exists));
index++;
} else {
LOG(ERROR) << "Shimcache entry does not meet length requirements: "
<< token;
}
data.erase(0, pos + delimter.length());
}
// Get last appcopmat entry
token = data.substr(0, pos);
if (token.length() > 20) {
createRow(parseShimcacheData(token, execution_flag_exists));
} else {
LOG(ERROR) << "Shimcache entry does not meet length requirements: "
<< token;
}
}
QueryData genShimcache(QueryContext& context) {
QueryData results;
std::set<std::string> shimcacheResults;
expandRegistryGlobs(kShimcacheControlset, shimcacheResults);
for (const auto& rKey : shimcacheResults) {
auto entry = rKey.find("Control\\Session Manager\\AppCompatCache");
if (entry == std::string::npos) {
continue;
}
QueryData entryResults;
size_t index = 1;
queryKey(rKey, entryResults);
for (const auto& aKey : entryResults) {
if (aKey.at("name") != "AppCompatCache") {
continue;
}
parseEntry(aKey, index, results);
}
}
return results;
}
} // namespace tables
} // namespace osquery
|
{
"pile_set_name": "Github"
}
|
glabel func_80B23254
/* 00564 80B23254 27BDFF78 */ addiu $sp, $sp, 0xFF78 ## $sp = FFFFFF78
/* 00568 80B23258 AFBF002C */ sw $ra, 0x002C($sp)
/* 0056C 80B2325C AFB00028 */ sw $s0, 0x0028($sp)
/* 00570 80B23260 AFA40088 */ sw $a0, 0x0088($sp)
/* 00574 80B23264 AFA5008C */ sw $a1, 0x008C($sp)
/* 00578 80B23268 AFA60090 */ sw $a2, 0x0090($sp)
/* 0057C 80B2326C AFA70094 */ sw $a3, 0x0094($sp)
/* 00580 80B23270 84AE07A0 */ lh $t6, 0x07A0($a1) ## 000007A0
/* 00584 80B23274 27A40044 */ addiu $a0, $sp, 0x0044 ## $a0 = FFFFFFBC
/* 00588 80B23278 00A03825 */ or $a3, $a1, $zero ## $a3 = 00000000
/* 0058C 80B2327C 000E7880 */ sll $t7, $t6, 2
/* 00590 80B23280 00AFC021 */ addu $t8, $a1, $t7
/* 00594 80B23284 8F190790 */ lw $t9, 0x0790($t8) ## 00000790
/* 00598 80B23288 8F29005C */ lw $t1, 0x005C($t9) ## 0000005C
/* 0059C 80B2328C AC890000 */ sw $t1, 0x0000($a0) ## FFFFFFBC
/* 005A0 80B23290 8F280060 */ lw $t0, 0x0060($t9) ## 00000060
/* 005A4 80B23294 AC880004 */ sw $t0, 0x0004($a0) ## FFFFFFC0
/* 005A8 80B23298 8F290064 */ lw $t1, 0x0064($t9) ## 00000064
/* 005AC 80B2329C AC890008 */ sw $t1, 0x0008($a0) ## FFFFFFC4
/* 005B0 80B232A0 8FA50088 */ lw $a1, 0x0088($sp)
/* 005B4 80B232A4 AFA7008C */ sw $a3, 0x008C($sp)
/* 005B8 80B232A8 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 00000024
/* 005BC 80B232AC 0C01E01A */ jal Math_Vec3f_Yaw
/* 005C0 80B232B0 AFA50038 */ sw $a1, 0x0038($sp)
/* 005C4 80B232B4 00028400 */ sll $s0, $v0, 16
/* 005C8 80B232B8 00108403 */ sra $s0, $s0, 16
/* 005CC 80B232BC 27A40044 */ addiu $a0, $sp, 0x0044 ## $a0 = FFFFFFBC
/* 005D0 80B232C0 0C01E027 */ jal Math_Vec3f_Pitch
/* 005D4 80B232C4 8FA50038 */ lw $a1, 0x0038($sp)
/* 005D8 80B232C8 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00
/* 005DC 80B232CC 00025023 */ subu $t2, $zero, $v0
/* 005E0 80B232D0 00102400 */ sll $a0, $s0, 16
/* 005E4 80B232D4 A7AA0040 */ sh $t2, 0x0040($sp)
/* 005E8 80B232D8 00042403 */ sra $a0, $a0, 16
/* 005EC 80B232DC E7A0006C */ swc1 $f0, 0x006C($sp)
/* 005F0 80B232E0 0C01DE1C */ jal Math_Sins
## sins?
/* 005F4 80B232E4 E7A00064 */ swc1 $f0, 0x0064($sp)
/* 005F8 80B232E8 E7A0003C */ swc1 $f0, 0x003C($sp)
/* 005FC 80B232EC 0C01DE0D */ jal Math_Coss
## coss?
/* 00600 80B232F0 87A40040 */ lh $a0, 0x0040($sp)
/* 00604 80B232F4 C7A40094 */ lwc1 $f4, 0x0094($sp)
/* 00608 80B232F8 C7A6003C */ lwc1 $f6, 0x003C($sp)
/* 0060C 80B232FC 87A40040 */ lh $a0, 0x0040($sp)
/* 00610 80B23300 46062202 */ mul.s $f8, $f4, $f6
/* 00614 80B23304 00000000 */ nop
/* 00618 80B23308 46080282 */ mul.s $f10, $f0, $f8
/* 0061C 80B2330C 0C01DE1C */ jal Math_Sins
## sins?
/* 00620 80B23310 E7AA0070 */ swc1 $f10, 0x0070($sp)
/* 00624 80B23314 C7B00094 */ lwc1 $f16, 0x0094($sp)
/* 00628 80B23318 00102400 */ sll $a0, $s0, 16
/* 0062C 80B2331C 00042403 */ sra $a0, $a0, 16
/* 00630 80B23320 46100482 */ mul.s $f18, $f0, $f16
/* 00634 80B23324 0C01DE0D */ jal Math_Coss
## coss?
/* 00638 80B23328 E7B20074 */ swc1 $f18, 0x0074($sp)
/* 0063C 80B2332C E7A0003C */ swc1 $f0, 0x003C($sp)
/* 00640 80B23330 0C01DE0D */ jal Math_Coss
## coss?
/* 00644 80B23334 87A40040 */ lh $a0, 0x0040($sp)
/* 00648 80B23338 C7A40094 */ lwc1 $f4, 0x0094($sp)
/* 0064C 80B2333C C7A6003C */ lwc1 $f6, 0x003C($sp)
/* 00650 80B23340 3C014120 */ lui $at, 0x4120 ## $at = 41200000
/* 00654 80B23344 44811000 */ mtc1 $at, $f2 ## $f2 = 10.00
/* 00658 80B23348 46062202 */ mul.s $f8, $f4, $f6
/* 0065C 80B2334C 3C013F00 */ lui $at, 0x3F00 ## $at = 3F000000
/* 00660 80B23350 44818000 */ mtc1 $at, $f16 ## $f16 = 0.50
/* 00664 80B23354 8FAB0088 */ lw $t3, 0x0088($sp)
/* 00668 80B23358 3C0F80B2 */ lui $t7, %hi(D_80B243C0) ## $t7 = 80B20000
/* 0066C 80B2335C E7B00068 */ swc1 $f16, 0x0068($sp)
/* 00670 80B23360 25EF43C0 */ addiu $t7, $t7, %lo(D_80B243C0) ## $t7 = 80B243C0
/* 00674 80B23364 46080282 */ mul.s $f10, $f0, $f8
/* 00678 80B23368 8FA80038 */ lw $t0, 0x0038($sp)
/* 0067C 80B2336C 27B90058 */ addiu $t9, $sp, 0x0058 ## $t9 = FFFFFFD0
/* 00680 80B23370 00102400 */ sll $a0, $s0, 16
/* 00684 80B23374 00042403 */ sra $a0, $a0, 16
/* 00688 80B23378 E7AA0078 */ swc1 $f10, 0x0078($sp)
/* 0068C 80B2337C 856D001C */ lh $t5, 0x001C($t3) ## 0000001C
/* 00690 80B23380 000D70C0 */ sll $t6, $t5, 3
/* 00694 80B23384 01CF1021 */ addu $v0, $t6, $t7
/* 00698 80B23388 24580004 */ addiu $t8, $v0, 0x0004 ## $t8 = 00000004
/* 0069C 80B2338C AFA20054 */ sw $v0, 0x0054($sp)
/* 006A0 80B23390 AFB80050 */ sw $t8, 0x0050($sp)
/* 006A4 80B23394 8D0A0000 */ lw $t2, 0x0000($t0) ## 00000000
/* 006A8 80B23398 AF2A0000 */ sw $t2, 0x0000($t9) ## FFFFFFD0
/* 006AC 80B2339C 8D090004 */ lw $t1, 0x0004($t0) ## 00000004
/* 006B0 80B233A0 AF290004 */ sw $t1, 0x0004($t9) ## FFFFFFD4
/* 006B4 80B233A4 8D0A0008 */ lw $t2, 0x0008($t0) ## 00000008
/* 006B8 80B233A8 AF2A0008 */ sw $t2, 0x0008($t9) ## FFFFFFD8
/* 006BC 80B233AC C7A40070 */ lwc1 $f4, 0x0070($sp)
/* 006C0 80B233B0 C7B20058 */ lwc1 $f18, 0x0058($sp)
/* 006C4 80B233B4 C7B00074 */ lwc1 $f16, 0x0074($sp)
/* 006C8 80B233B8 46022182 */ mul.s $f6, $f4, $f2
/* 006CC 80B233BC C7AA005C */ lwc1 $f10, 0x005C($sp)
/* 006D0 80B233C0 46028102 */ mul.s $f4, $f16, $f2
/* 006D4 80B233C4 46069201 */ sub.s $f8, $f18, $f6
/* 006D8 80B233C8 C7A60060 */ lwc1 $f6, 0x0060($sp)
/* 006DC 80B233CC 46045481 */ sub.s $f18, $f10, $f4
/* 006E0 80B233D0 E7A80058 */ swc1 $f8, 0x0058($sp)
/* 006E4 80B233D4 C7A80078 */ lwc1 $f8, 0x0078($sp)
/* 006E8 80B233D8 E7B2005C */ swc1 $f18, 0x005C($sp)
/* 006EC 80B233DC 46024402 */ mul.s $f16, $f8, $f2
/* 006F0 80B233E0 46103281 */ sub.s $f10, $f6, $f16
/* 006F4 80B233E4 0C01DE0D */ jal Math_Coss
## coss?
/* 006F8 80B233E8 E7AA0060 */ swc1 $f10, 0x0060($sp)
/* 006FC 80B233EC 8FA20090 */ lw $v0, 0x0090($sp)
/* 00700 80B233F0 3C0B80B2 */ lui $t3, %hi(D_80B24388) ## $t3 = 80B20000
/* 00704 80B233F4 256B4388 */ addiu $t3, $t3, %lo(D_80B24388) ## $t3 = 80B24388
/* 00708 80B233F8 00021080 */ sll $v0, $v0, 2
/* 0070C 80B233FC 004B1821 */ addu $v1, $v0, $t3
/* 00710 80B23400 C4640000 */ lwc1 $f4, 0x0000($v1) ## 00000000
/* 00714 80B23404 C7A20098 */ lwc1 $f2, 0x0098($sp)
/* 00718 80B23408 3C0180B2 */ lui $at, %hi(D_80B243A4) ## $at = 80B20000
/* 0071C 80B2340C 00220821 */ addu $at, $at, $v0
/* 00720 80B23410 46022482 */ mul.s $f18, $f4, $f2
/* 00724 80B23414 C42A43A4 */ lwc1 $f10, %lo(D_80B243A4)($at)
/* 00728 80B23418 C7A60058 */ lwc1 $f6, 0x0058($sp)
/* 0072C 80B2341C 00102400 */ sll $a0, $s0, 16
/* 00730 80B23420 00042403 */ sra $a0, $a0, 16
/* 00734 80B23424 AFA30038 */ sw $v1, 0x0038($sp)
/* 00738 80B23428 46120202 */ mul.s $f8, $f0, $f18
/* 0073C 80B2342C C7B2005C */ lwc1 $f18, 0x005C($sp)
/* 00740 80B23430 46025102 */ mul.s $f4, $f10, $f2
/* 00744 80B23434 46064400 */ add.s $f16, $f8, $f6
/* 00748 80B23438 46122200 */ add.s $f8, $f4, $f18
/* 0074C 80B2343C E7B0007C */ swc1 $f16, 0x007C($sp)
/* 00750 80B23440 0C01DE1C */ jal Math_Sins
## sins?
/* 00754 80B23444 E7A80080 */ swc1 $f8, 0x0080($sp)
/* 00758 80B23448 8FA30038 */ lw $v1, 0x0038($sp)
/* 0075C 80B2344C C7A20098 */ lwc1 $f2, 0x0098($sp)
/* 00760 80B23450 C7A60060 */ lwc1 $f6, 0x0060($sp)
/* 00764 80B23454 C4700000 */ lwc1 $f16, 0x0000($v1) ## 00000000
/* 00768 80B23458 3C014448 */ lui $at, 0x4448 ## $at = 44480000
/* 0076C 80B2345C 44814000 */ mtc1 $at, $f8 ## $f8 = 800.00
/* 00770 80B23460 46028282 */ mul.s $f10, $f16, $f2
/* 00774 80B23464 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000
/* 00778 80B23468 8FAC0054 */ lw $t4, 0x0054($sp)
/* 0077C 80B2346C 8FAD0050 */ lw $t5, 0x0050($sp)
/* 00780 80B23470 8FA4008C */ lw $a0, 0x008C($sp)
/* 00784 80B23474 27A5007C */ addiu $a1, $sp, 0x007C ## $a1 = FFFFFFF4
/* 00788 80B23478 27A60070 */ addiu $a2, $sp, 0x0070 ## $a2 = FFFFFFE8
/* 0078C 80B2347C 460A0102 */ mul.s $f4, $f0, $f10
/* 00790 80B23480 27A70064 */ addiu $a3, $sp, 0x0064 ## $a3 = FFFFFFDC
/* 00794 80B23484 AFAC0010 */ sw $t4, 0x0010($sp)
/* 00798 80B23488 46024402 */ mul.s $f16, $f8, $f2
/* 0079C 80B2348C AFAD0014 */ sw $t5, 0x0014($sp)
/* 007A0 80B23490 46043481 */ sub.s $f18, $f6, $f4
/* 007A4 80B23494 44813000 */ mtc1 $at, $f6 ## $f6 = 80.00
/* 007A8 80B23498 4600828D */ trunc.w.s $f10, $f16
/* 007AC 80B2349C 46023102 */ mul.s $f4, $f6, $f2
/* 007B0 80B234A0 E7B20084 */ swc1 $f18, 0x0084($sp)
/* 007B4 80B234A4 440F5000 */ mfc1 $t7, $f10
/* 007B8 80B234A8 00000000 */ nop
/* 007BC 80B234AC AFAF0018 */ sw $t7, 0x0018($sp)
/* 007C0 80B234B0 4600248D */ trunc.w.s $f18, $f4
/* 007C4 80B234B4 44199000 */ mfc1 $t9, $f18
/* 007C8 80B234B8 0C00A0A7 */ jal func_8002829C
/* 007CC 80B234BC AFB9001C */ sw $t9, 0x001C($sp)
/* 007D0 80B234C0 8FBF002C */ lw $ra, 0x002C($sp)
/* 007D4 80B234C4 8FB00028 */ lw $s0, 0x0028($sp)
/* 007D8 80B234C8 27BD0088 */ addiu $sp, $sp, 0x0088 ## $sp = 00000000
/* 007DC 80B234CC 03E00008 */ jr $ra
/* 007E0 80B234D0 00000000 */ nop
|
{
"pile_set_name": "Github"
}
|
//! # Example: Extended characters
//!
//! Demonstrate ability of most built in fonts to render extended characters.
use embedded_graphics::{
fonts::{Text, *},
pixelcolor::BinaryColor,
prelude::*,
style::TextStyle,
};
use embedded_graphics_simulator::{OutputSettingsBuilder, SimulatorDisplay, Window};
fn main() -> Result<(), core::convert::Infallible> {
let mut display: SimulatorDisplay<BinaryColor> = SimulatorDisplay::new(Size::new(1400, 160));
let test_text = "¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
let test_text_with_line_break = "¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ\nÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
// Show smallest font with black font on white background (default value for fonts)
Text::new(&format!("Font6x8 {}", test_text), Point::new(15, 15))
.into_styled(TextStyle::new(Font6x8, BinaryColor::On))
.draw(&mut display)?;
// 6x12 font doesn't have support for extended characters
Text::new(
"(Font6x12 does not support extended characters)",
Point::new(15, 30),
)
.into_styled(TextStyle::new(Font6x12, BinaryColor::On))
.draw(&mut display)?;
// Show 8x16 Font
Text::new(&format!("Font8x16 {}", test_text), Point::new(15, 45))
.into_styled(TextStyle::new(Font8x16, BinaryColor::On))
.draw(&mut display)?;
// Show 12x16 Font
Text::new(&format!("Font12x16 {}", test_text), Point::new(15, 65))
.into_styled(TextStyle::new(Font12x16, BinaryColor::On))
.draw(&mut display)?;
// Show 24x32 Font
Text::new(
&format!("Font24x32 {}", test_text_with_line_break),
Point::new(15, 85),
)
.into_styled(TextStyle::new(Font24x32, BinaryColor::On))
.draw(&mut display)?;
let output_settings = OutputSettingsBuilder::new().scale(1).build();
Window::new("Fonts", &output_settings).show_static(&display);
Ok(())
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Concrete start token class.
*/
class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag
{
}
// vim: et sw=4 sts=4
|
{
"pile_set_name": "Github"
}
|
package typings.dockerode.anon
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._
@js.native
trait End extends js.Object {
var End: String = js.native
var ExitCode: Double = js.native
var Output: String = js.native
var Start: String = js.native
}
object End {
@scala.inline
def apply(End: String, ExitCode: Double, Output: String, Start: String): End = {
val __obj = js.Dynamic.literal(End = End.asInstanceOf[js.Any], ExitCode = ExitCode.asInstanceOf[js.Any], Output = Output.asInstanceOf[js.Any], Start = Start.asInstanceOf[js.Any])
__obj.asInstanceOf[End]
}
@scala.inline
implicit class EndOps[Self <: End] (val x: Self) extends AnyVal {
@scala.inline
def duplicate: Self = (js.Dynamic.global.Object.assign(js.Dynamic.literal(), x)).asInstanceOf[Self]
@scala.inline
def combineWith[Other <: js.Any](other: Other): Self with Other = (js.Dynamic.global.Object.assign(js.Dynamic.literal(), x, other.asInstanceOf[js.Any])).asInstanceOf[Self with Other]
@scala.inline
def set(key: String, value: js.Any): Self = {
x.asInstanceOf[js.Dynamic].updateDynamic(key)(value)
x
}
@scala.inline
def setEnd(value: String): Self = this.set("End", value.asInstanceOf[js.Any])
@scala.inline
def setExitCode(value: Double): Self = this.set("ExitCode", value.asInstanceOf[js.Any])
@scala.inline
def setOutput(value: String): Self = this.set("Output", value.asInstanceOf[js.Any])
@scala.inline
def setStart(value: String): Self = this.set("Start", value.asInstanceOf[js.Any])
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#AA5677fc"
android:endColor="#AAe5e5ff"
android:type="linear" />
</shape>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/command_buffer/client/client_font_manager.h"
#include "base/logging.h"
namespace gpu {
namespace raster {
namespace {
class Serializer {
public:
Serializer(char* memory, uint32_t memory_size)
: memory_(memory), memory_size_(memory_size) {}
~Serializer() = default;
template <typename T>
void Write(const T* val) {
static_assert(base::is_trivially_copyable<T>::value, "");
WriteData(val, sizeof(T), alignof(T));
}
void WriteData(const void* input, uint32_t bytes, size_t alignment) {
AlignMemory(bytes, alignment);
if (bytes == 0)
return;
memcpy(memory_, input, bytes);
memory_ += bytes;
bytes_written_ += bytes;
}
private:
void AlignMemory(uint32_t size, size_t alignment) {
// Due to the math below, alignment must be a power of two.
DCHECK_GT(alignment, 0u);
DCHECK_EQ(alignment & (alignment - 1), 0u);
uintptr_t memory = reinterpret_cast<uintptr_t>(memory_);
size_t padding = ((memory + alignment - 1) & ~(alignment - 1)) - memory;
DCHECK_LE(bytes_written_ + size + padding, memory_size_);
memory_ += padding;
bytes_written_ += padding;
}
char* memory_ = nullptr;
uint32_t memory_size_ = 0u;
uint32_t bytes_written_ = 0u;
};
} // namespace
ClientFontManager::ClientFontManager(Client* client,
CommandBuffer* command_buffer)
: client_(client), command_buffer_(command_buffer), strike_server_(this) {}
ClientFontManager::~ClientFontManager() = default;
SkDiscardableHandleId ClientFontManager::createHandle() {
auto client_handle =
client_discardable_manager_.CreateHandle(command_buffer_);
if (client_handle.is_null())
return kInvalidSkDiscardableHandleId;
SkDiscardableHandleId handle_id = ++last_allocated_handle_id_;
discardable_handle_map_[handle_id] = client_handle;
// Handles start with a ref-count.
locked_handles_.insert(handle_id);
return handle_id;
}
bool ClientFontManager::lockHandle(SkDiscardableHandleId handle_id) {
// Already locked.
if (locked_handles_.find(handle_id) != locked_handles_.end())
return true;
auto it = discardable_handle_map_.find(handle_id);
if (it == discardable_handle_map_.end())
return false;
bool locked = client_discardable_manager_.LockHandle(it->second);
if (locked) {
locked_handles_.insert(handle_id);
return true;
}
discardable_handle_map_.erase(it);
return false;
}
bool ClientFontManager::isHandleDeleted(SkDiscardableHandleId handle_id) {
auto it = discardable_handle_map_.find(handle_id);
if (it == discardable_handle_map_.end())
return true;
if (client_discardable_manager_.HandleIsDeleted(it->second)) {
discardable_handle_map_.erase(it);
return true;
}
return false;
}
void ClientFontManager::Serialize() {
// TODO(khushalsagar): May be skia can track the size required so we avoid
// this copy.
std::vector<uint8_t> strike_data;
strike_server_.writeStrikeData(&strike_data);
const uint32_t num_handles_created =
last_allocated_handle_id_ - last_serialized_handle_id_;
if (strike_data.size() == 0u && num_handles_created == 0u &&
locked_handles_.size() == 0u) {
// No font data to serialize.
return;
}
// Size required for serialization.
base::CheckedNumeric<uint32_t> checked_bytes_required = 0;
// Skia data size.
checked_bytes_required += sizeof(uint32_t) + alignof(uint32_t) + 16;
checked_bytes_required += strike_data.size();
// num of handles created + SerializableHandles.
checked_bytes_required +=
sizeof(uint32_t) + alignof(uint32_t) + alignof(SerializableSkiaHandle);
checked_bytes_required +=
base::CheckMul(num_handles_created, sizeof(SerializableSkiaHandle));
// num of handles locked + DiscardableHandleIds.
checked_bytes_required +=
sizeof(uint32_t) + alignof(uint32_t) + alignof(SkDiscardableHandleId);
checked_bytes_required +=
base::CheckMul(locked_handles_.size(), sizeof(SkDiscardableHandleId));
uint32_t bytes_required = 0;
if (!checked_bytes_required.AssignIfValid(&bytes_required)) {
DLOG(FATAL) << "ClientFontManager::Serialize: font buffer overflow";
return;
}
// Allocate memory.
void* memory = client_->MapFontBuffer(bytes_required);
if (!memory) {
// We are likely in a context loss situation if mapped memory allocation
// for font buffer failed.
return;
}
Serializer serializer(reinterpret_cast<char*>(memory), bytes_required);
// Serialize all new handles.
serializer.Write<uint32_t>(&num_handles_created);
for (SkDiscardableHandleId handle_id = last_serialized_handle_id_ + 1;
handle_id <= last_allocated_handle_id_; handle_id++) {
auto it = discardable_handle_map_.find(handle_id);
DCHECK(it != discardable_handle_map_.end());
// We must have a valid |client_handle| here since all new handles are
// currently in locked state.
auto client_handle = client_discardable_manager_.GetHandle(it->second);
DCHECK(client_handle.IsValid());
SerializableSkiaHandle handle(handle_id, client_handle.shm_id(),
client_handle.byte_offset());
serializer.Write<SerializableSkiaHandle>(&handle);
}
// Serialize all locked handle ids, so the raster unlocks them when done.
DCHECK(base::IsValueInRangeForNumericType<uint32_t>(locked_handles_.size()));
const uint32_t num_locked_handles = locked_handles_.size();
serializer.Write<uint32_t>(&num_locked_handles);
for (auto handle_id : locked_handles_)
serializer.Write<SkDiscardableHandleId>(&handle_id);
// Serialize skia data.
DCHECK(base::IsValueInRangeForNumericType<uint32_t>(strike_data.size()));
const uint32_t skia_data_size = strike_data.size();
serializer.Write<uint32_t>(&skia_data_size);
serializer.WriteData(strike_data.data(), strike_data.size(), 16);
// Reset all state for what has been serialized.
last_serialized_handle_id_ = last_allocated_handle_id_;
locked_handles_.clear();
return;
}
} // namespace raster
} // namespace gpu
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2" xmlns:aapt="http://schemas.android.com/aapt">
<item>
<rotate android:drawable="@drawable/bi8" android:fromDegrees="0" android:toDegrees="1080" android:pivotX="50%" android:pivotY="50%"/>
</item>
</layer-list>
|
{
"pile_set_name": "Github"
}
|
---
title: "supervisor"
layout: formula
---
{{ content }}
|
{
"pile_set_name": "Github"
}
|
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18bb7490b">
<name type="corporate">
<namePart>United States Government Printing Office</namePart>
<role>
<roleTerm type="text" authority="marcrelator">printer</roleTerm>
<roleTerm type="code" authority="marcrelator">prt</roleTerm>
</role>
<role>
<roleTerm type="text" authority="marcrelator">distributor</roleTerm>
<roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
<namePart>United States</namePart>
<namePart>United States District Court Eastern District of Tennessee</namePart>
<role>
<roleTerm type="text" authority="marcrelator">author</roleTerm>
<roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
<description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
<collectionCode>USCOURTS</collectionCode>
<category>Judicial Publications</category>
<branch>judicial</branch>
<dateIngested>2015-03-18</dateIngested>
</extension>
<originInfo>
<publisher>Administrative Office of the United States Courts</publisher>
<dateIssued encoding="w3cdtf">2015-03-17</dateIssued>
<issuance>monographic</issuance>
</originInfo>
<physicalDescription>
<note type="source content type">deposited</note>
<digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017</identifier>
<identifier type="local">P0b002ee18bb7490b</identifier>
<recordInfo>
<recordContentSource authority="marcorg">DGPO</recordContentSource>
<recordCreationDate encoding="w3cdtf">2015-03-18</recordCreationDate>
<recordChangeDate encoding="w3cdtf">2015-03-18</recordChangeDate>
<recordIdentifier source="DGPO">USCOURTS-tned-4_14-cr-00017</recordIdentifier>
<recordOrigin>machine generated</recordOrigin>
<languageOfCataloging>
<languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-tned-4_14-cr-00017</accessId>
<courtType>District</courtType>
<courtCode>tned</courtCode>
<courtCircuit>6th</courtCircuit>
<courtState>Tennessee</courtState>
<courtSortOrder>2471</courtSortOrder>
<caseNumber>4:14-cr-00017</caseNumber>
<caseOffice>Winchester</caseOffice>
<caseType>criminal</caseType>
<party firstName="Robert" fullName="Robert Chad Short" lastName="Short" middleName="Chad" role="Defendant"></party>
<party fullName="USA" lastName="USA" role="Plaintiff"></party>
</extension>
<titleInfo>
<title>USA v. Short</title>
<partNumber>4:14-cr-00017</partNumber>
</titleInfo>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">4:14-cr-00017;14-017</identifier>
<name type="corporate">
<namePart>United States District Court Eastern District of Tennessee</namePart>
<namePart>6th Circuit</namePart>
<namePart>Winchester</namePart>
<affiliation>U.S. Courts</affiliation>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
<roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
<displayForm>Robert Chad Short</displayForm>
<namePart type="family">Short</namePart>
<namePart type="given">Robert</namePart>
<namePart type="termsOfAddress"></namePart>
<description>Defendant</description>
</name>
<name type="personal">
<displayForm>USA</displayForm>
<namePart type="family">USA</namePart>
<namePart type="given"></namePart>
<namePart type="termsOfAddress"></namePart>
<description>Plaintiff</description>
</name>
<extension>
<docClass>USCOURTS</docClass>
<accessId>USCOURTS-tned-4_14-cr-00017</accessId>
<courtType>District</courtType>
<courtCode>tned</courtCode>
<courtCircuit>6th</courtCircuit>
<courtState>Tennessee</courtState>
<courtSortOrder>2471</courtSortOrder>
<caseNumber>4:14-cr-00017</caseNumber>
<caseOffice>Winchester</caseOffice>
<caseType>criminal</caseType>
<party firstName="Robert" fullName="Robert Chad Short" lastName="Short" middleName="Chad" role="Defendant"></party>
<party fullName="USA" lastName="USA" role="Plaintiff"></party>
<state>Tennessee</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-tned-4_14-cr-00017-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-0/mods.xml">
<titleInfo>
<title>USA v. Short</title>
<subTitle>REPORT AND RECOMMENDATIONS as to Robert Chad Short re 14 MOTION to Suppress . Signed by Magistrate Judge Susan K Lee on 10/23/2014. (SAC, )</subTitle>
<partNumber>0</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2014-10-23</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-0.pdf">
<identifier type="FDsys Unique ID">D09002ee18bb79fcf</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-0</identifier>
<identifier type="former granule identifier">tned-4_14-cr-00017_0.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-0/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-0.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 4:14-cr-00017; USA v. Short; </searchTitle>
<courtName>United States District Court Eastern District of Tennessee</courtName>
<state>Tennessee</state>
<accessId>USCOURTS-tned-4_14-cr-00017-0</accessId>
<sequenceNumber>0</sequenceNumber>
<dateIssued>2014-10-23</dateIssued>
<docketText>REPORT AND RECOMMENDATIONS as to Robert Chad Short re 14 MOTION to Suppress . Signed by Magistrate Judge Susan K Lee on 10/23/2014. (SAC, )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-tned-4_14-cr-00017-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-1/mods.xml">
<titleInfo>
<title>USA v. Short</title>
<subTitle>ORDER denying 14 Motion to Suppress as to Robert Chad Short (1); adopting 29 Report and Recommendations as to Robert Chad Short (1). Signed by District Judge Harry S Mattice, Jr on 1/6/15. (GRE, )</subTitle>
<partNumber>1</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2015-01-06</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-1.pdf">
<identifier type="FDsys Unique ID">D09002ee18bb79fce</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-1</identifier>
<identifier type="former granule identifier">tned-4_14-cr-00017_1.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-1/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-1.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 4:14-cr-00017; USA v. Short; </searchTitle>
<courtName>United States District Court Eastern District of Tennessee</courtName>
<state>Tennessee</state>
<accessId>USCOURTS-tned-4_14-cr-00017-1</accessId>
<sequenceNumber>1</sequenceNumber>
<dateIssued>2015-01-06</dateIssued>
<docketText>ORDER denying 14 Motion to Suppress as to Robert Chad Short (1); adopting 29 Report and Recommendations as to Robert Chad Short (1). Signed by District Judge Harry S Mattice, Jr on 1/6/15. (GRE, )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-tned-4_14-cr-00017-2" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-2/mods.xml">
<titleInfo>
<title>USA v. Short</title>
<subTitle>REPORT AND RECOMMENDATIONS on Plea of Guilty as to Robert Chad Short Signed by Magistrate Judge Susan K Lee on 2/27/15. (GRE, )</subTitle>
<partNumber>2</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2015-02-27</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-2.pdf">
<identifier type="FDsys Unique ID">D09002ee18bb79f8a</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-2</identifier>
<identifier type="former granule identifier">tned-4_14-cr-00017_2.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-2/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-2.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 4:14-cr-00017; USA v. Short; </searchTitle>
<courtName>United States District Court Eastern District of Tennessee</courtName>
<state>Tennessee</state>
<accessId>USCOURTS-tned-4_14-cr-00017-2</accessId>
<sequenceNumber>2</sequenceNumber>
<dateIssued>2015-02-27</dateIssued>
<docketText>REPORT AND RECOMMENDATIONS on Plea of Guilty as to Robert Chad Short Signed by Magistrate Judge Susan K Lee on 2/27/15. (GRE, )</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-tned-4_14-cr-00017-3" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-3/mods.xml">
<titleInfo>
<title>USA v. Short</title>
<subTitle>ORDER adopting 40 Report and Recommendations on Plea of Guilty as to Robert Chad Short (1). Signed by District Judge Harry S Mattice, Jr on 3/17/15. (GRE, )</subTitle>
<partNumber>3</partNumber>
</titleInfo>
<originInfo>
<dateIssued>2015-03-17</dateIssued>
</originInfo>
<relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-3.pdf">
<identifier type="FDsys Unique ID">D09002ee18bb79fd0</identifier>
</relatedItem>
<identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-3</identifier>
<identifier type="former granule identifier">tned-4_14-cr-00017_3.pdf</identifier>
<location>
<url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-tned-4_14-cr-00017/USCOURTS-tned-4_14-cr-00017-3/content-detail.html</url>
<url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-tned-4_14-cr-00017/pdf/USCOURTS-tned-4_14-cr-00017-3.pdf</url>
</location>
<extension>
<searchTitle>USCOURTS 4:14-cr-00017; USA v. Short; </searchTitle>
<courtName>United States District Court Eastern District of Tennessee</courtName>
<state>Tennessee</state>
<accessId>USCOURTS-tned-4_14-cr-00017-3</accessId>
<sequenceNumber>3</sequenceNumber>
<dateIssued>2015-03-17</dateIssued>
<docketText>ORDER adopting 40 Report and Recommendations on Plea of Guilty as to Robert Chad Short (1). Signed by District Judge Harry S Mattice, Jr on 3/17/15. (GRE, )</docketText>
</extension>
</relatedItem>
</mods>
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.