text
stringlengths 2
99.9k
| meta
dict |
---|---|
/**
* Copyright(c) 2020-present, Odysseas Georgoudis & quill contributors.
* Distributed under the MIT License (http://opensource.org/licenses/MIT)
*/
#pragma once
#include "quill/LogLevel.h"
#include "quill/detail/misc/Common.h" // for filename_t
#include "quill/handlers/StreamHandler.h" // for StreamHandler
#include <array>
#include <string> // for string
namespace quill
{
#if defined(_WIN32)
/**
* Represents console colours
*/
class ConsoleColours
{
private:
// define our own to avoid including windows.h in the header..
using WORD = unsigned short;
public:
ConsoleColours();
~ConsoleColours() = default;
/**
* Sets some default colours for terminal
*/
void set_default_colours() noexcept;
/**
* Sets a custom colour per log level
* @param log_level the log level
* @param colour the colour
*/
void set_colour(LogLevel log_level, WORD colour) noexcept;
/**
* @return true if we are in terminal and have also enabled colours
*/
QUILL_NODISCARD bool can_use_colours() const noexcept;
/**
* @return true if we have setup colours
*/
QUILL_NODISCARD bool using_colours() const noexcept;
/**
* The colour for the given log level
* @param log_level the message log level
* @return the configured colour for this log level
*/
QUILL_NODISCARD WORD colour_code(LogLevel log_level) const noexcept;
static const WORD bold;
// Foreground colors
static const WORD black;
static const WORD red;
static const WORD green;
static const WORD yellow;
static const WORD blue;
static const WORD magenta;
static const WORD cyan;
static const WORD white;
// Background colors
static const WORD on_black;
static const WORD on_red;
static const WORD on_green;
static const WORD on_yellow;
static const WORD on_blue;
static const WORD on_magenta;
static const WORD on_cyan;
static const WORD on_white;
private:
friend class ConsoleHandler;
void _set_can_use_colours(FILE* file) noexcept;
private:
std::array<WORD, 10> _colours{}; /**< Colours per log level */
bool _using_colours{false};
bool _can_use_colours{false};
};
#else
/**
* Represents console colours
*/
class ConsoleColours
{
public:
ConsoleColours();
~ConsoleColours() = default;
/**
* Sets some default colours for terminal
*/
void set_default_colours() noexcept;
/**
* Sets a custom colour per log level
* @param log_level the log level
* @param colour the colour
*/
void set_colour(LogLevel log_level, std::string const& colour) noexcept;
/**
* @return true if we are in terminal and have also enabled colours
*/
QUILL_NODISCARD bool can_use_colours() const noexcept;
/**
* @return true if we have setup colours
*/
QUILL_NODISCARD bool using_colours() const noexcept;
/**
* The colour for the given log level
* @param log_level the message log level
* @return the configured colour for this log level
*/
QUILL_NODISCARD std::string const& colour_code(LogLevel log_level) const noexcept;
// Formatting codes
static const std::string reset;
static const std::string bold;
static const std::string dark;
static const std::string underline;
static const std::string blink;
static const std::string reverse;
static const std::string concealed;
static const std::string clear_line;
// Foreground colors
static const std::string black;
static const std::string red;
static const std::string green;
static const std::string yellow;
static const std::string blue;
static const std::string magenta;
static const std::string cyan;
static const std::string white;
// Background colors
static const std::string on_black;
static const std::string on_red;
static const std::string on_green;
static const std::string on_yellow;
static const std::string on_blue;
static const std::string on_magenta;
static const std::string on_cyan;
static const std::string on_white;
// Bold colors
static const std::string yellow_bold;
static const std::string red_bold;
static const std::string bold_on_red;
private:
friend class ConsoleHandler;
void _set_can_use_colours(FILE* file) noexcept;
private:
std::array<std::string, 10> _colours{}; /**< Colours per log level */
bool _using_colours{false};
bool _can_use_colours{false};
};
#endif
/**
* Creates a new instance of the FileHandler class.
* The specified file is opened and used as the stream for logging.
* If mode is not specified, "a" is used.
* By default, the file grows indefinitely.
*/
class ConsoleHandler : public StreamHandler
{
public:
ConsoleHandler(filename_t stream, FILE* file, ConsoleColours const& console_colours);
~ConsoleHandler() override = default;
/**
* Write a formatted log record to the stream
* @param formatted_log_record input log record to write
* @param log_record_timestamp log record timestamp
*/
QUILL_ATTRIBUTE_HOT void write(fmt::memory_buffer const& formatted_log_record,
std::chrono::nanoseconds log_record_timestamp,
LogLevel log_message_severity) override;
/**
* Used internally to enable the console colours on "stdout" handler which is already
* created by default without during construction.
*/
QUILL_ATTRIBUTE_COLD void enable_console_colours() noexcept;
private:
#if defined(_WIN32)
QUILL_NODISCARD ConsoleColours::WORD _set_foreground_colour(ConsoleColours::WORD attributes);
#endif
private:
ConsoleColours _console_colours;
};
} // namespace quill | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<binding.BindableFrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:binding="http://www.gueei.com/android-binding/"
android:layout_height="match_parent"
android:layout_width="match_parent"
binding:dataSource="DemoVm"
binding:layoutId="DemoLayout"
/> | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="3dp" />
<solid android:color="#dcdddd" />
</shape> | {
"pile_set_name": "Github"
} |
// **************************************************************************
// Generator: AngularDart Compiler
// **************************************************************************
import 'components.dart';
export 'components.dart';
import 'package:angular/src/di/reflector.dart' as _ngRef;
import 'package:angular/angular.template.dart' as _ref0;
import 'package:angular/src/core/linker/views/component_view.dart' as import0;
import 'components.dart' as import1;
import 'package:angular/src/core/linker/style_encapsulation.dart' as import2;
import 'package:angular/src/core/linker/views/view.dart' as import3;
import 'package:angular/src/core/change_detection/change_detection.dart';
import 'dart:html' as import5;
import 'package:angular/src/runtime.dart' as import6;
import 'package:angular/src/runtime/dom_helpers.dart' as import7;
import 'package:angular/angular.dart';
import 'package:angular/src/core/linker/views/host_view.dart' as import9;
final List<dynamic> styles$TestSubComponent = const [];
class ViewTestSubComponent0 extends import0.ComponentView<import1.TestSubComponent> {
static import2.ComponentStyles _componentStyles;
ViewTestSubComponent0(import3.View parentView, int parentIndex) : super(parentView, parentIndex, ChangeDetectionStrategy.CheckAlways) {
this.initComponentStyles();
this.rootElement = import5.document.createElement('test-bar');
}
static String get _debugComponentUrl {
return (import6.isDevMode ? 'asset:_goldens/test/files/directives/components.dart' : null);
}
@override
void build() {
final import5.HtmlElement parentRenderNode = this.initViewRoot();
final doc = import5.document;
final _el_0 = import7.appendDiv(doc, parentRenderNode);
final _text_1 = import7.appendText(_el_0, 'Bar');
}
static void _debugClearComponentStyles() {
_componentStyles = null;
}
void initComponentStyles() {
var styles = _componentStyles;
if (identical(styles, null)) {
_componentStyles = (styles = import2.ComponentStyles.unscoped(styles$TestSubComponent, _debugComponentUrl));
if (import6.isDevMode) {
import2.ComponentStyles.debugOnClear(_debugClearComponentStyles);
}
}
this.componentStyles = styles;
}
}
const _TestSubComponentNgFactory = ComponentFactory<import1.TestSubComponent>('test-bar', viewFactory_TestSubComponentHost0);
ComponentFactory<import1.TestSubComponent> get TestSubComponentNgFactory {
return _TestSubComponentNgFactory;
}
ComponentFactory<import1.TestSubComponent> createTestSubComponentFactory() {
return ComponentFactory('test-bar', viewFactory_TestSubComponentHost0);
}
final List<dynamic> styles$TestSubComponentHost = const [];
class _ViewTestSubComponentHost0 extends import9.HostView<import1.TestSubComponent> {
@override
void build() {
this.componentView = ViewTestSubComponent0(this, 0);
final _el_0 = this.componentView.rootElement;
this.component = import1.TestSubComponent();
this.initRootNode(_el_0);
}
}
import9.HostView<import1.TestSubComponent> viewFactory_TestSubComponentHost0() {
return _ViewTestSubComponentHost0();
}
var _visited = false;
void initReflector() {
if (_visited) {
return;
}
_visited = true;
_ngRef.registerComponent(TestSubComponent, createTestSubComponentFactory());
_ref0.initReflector();
}
| {
"pile_set_name": "Github"
} |
---
name: Custom
about: 'Anything else: questions, discussions, thanks, ascii-arts, ...'
title: ''
labels: discussion
assignees: moul
---
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<migration name="Add crops issue natures">
<item-creation item="issue_natures#bacterial_leaf_blight" parent="bacteria_disease" target="poa"/>
<item-creation item="issue_natures#bacterial_streak" parent="bacteria_disease" target="poa"/>
<item-creation item="issue_natures#common_bunt" parent="fungus_disease" cause="fungus" target="poa"/>
<item-creation item="issue_natures#fusarium_head_blight" parent="fungus_disease" cause="fungus" target="poa"/>
<item-creation item="issue_natures#black_rust" parent="fungus_disease" cause="fungus" target="poa"/>
<item-creation item="issue_natures#yellow_rust" parent="fungus_disease" cause="fungus" target="poa"/>
<item-creation item="issue_natures#wheat_powdery_mildew" parent="fungus_disease" cause="fungus" target="poa"/>
<item-creation item="issue_natures#septoria_blotch" parent="fungus_disease" cause="fungus" target="poa"/>
</migration>
| {
"pile_set_name": "Github"
} |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/apigatewayv2/ApiGatewayV2_EXPORTS.h>
#include <aws/apigatewayv2/ApiGatewayV2Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>
namespace Aws
{
namespace ApiGatewayV2
{
namespace Model
{
/**
* <p>Creates a VPC link</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/CreateVpcLinkRequest">AWS
* API Reference</a></p>
*/
class AWS_APIGATEWAYV2_API CreateVpcLinkRequest : public ApiGatewayV2Request
{
public:
CreateVpcLinkRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "CreateVpcLink"; }
Aws::String SerializePayload() const override;
/**
* <p>The name of the VPC link.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>The name of the VPC link.</p>
*/
inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
/**
* <p>The name of the VPC link.</p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>The name of the VPC link.</p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
/**
* <p>The name of the VPC link.</p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/**
* <p>The name of the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>The name of the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
/**
* <p>The name of the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithName(const char* value) { SetName(value); return *this;}
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline const Aws::Vector<Aws::String>& GetSecurityGroupIds() const{ return m_securityGroupIds; }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline bool SecurityGroupIdsHasBeenSet() const { return m_securityGroupIdsHasBeenSet; }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline void SetSecurityGroupIds(const Aws::Vector<Aws::String>& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds = value; }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline void SetSecurityGroupIds(Aws::Vector<Aws::String>&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds = std::move(value); }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithSecurityGroupIds(const Aws::Vector<Aws::String>& value) { SetSecurityGroupIds(value); return *this;}
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithSecurityGroupIds(Aws::Vector<Aws::String>&& value) { SetSecurityGroupIds(std::move(value)); return *this;}
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSecurityGroupIds(const Aws::String& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(value); return *this; }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSecurityGroupIds(Aws::String&& value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(std::move(value)); return *this; }
/**
* <p>A list of security group IDs for the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSecurityGroupIds(const char* value) { m_securityGroupIdsHasBeenSet = true; m_securityGroupIds.push_back(value); return *this; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline const Aws::Vector<Aws::String>& GetSubnetIds() const{ return m_subnetIds; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline bool SubnetIdsHasBeenSet() const { return m_subnetIdsHasBeenSet; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline void SetSubnetIds(const Aws::Vector<Aws::String>& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = value; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline void SetSubnetIds(Aws::Vector<Aws::String>&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = std::move(value); }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithSubnetIds(const Aws::Vector<Aws::String>& value) { SetSubnetIds(value); return *this;}
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline CreateVpcLinkRequest& WithSubnetIds(Aws::Vector<Aws::String>&& value) { SetSubnetIds(std::move(value)); return *this;}
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSubnetIds(const Aws::String& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSubnetIds(Aws::String&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(std::move(value)); return *this; }
/**
* <p>A list of subnet IDs to include in the VPC link.</p>
*/
inline CreateVpcLinkRequest& AddSubnetIds(const char* value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }
/**
* <p>A list of tags.</p>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetTags() const{ return m_tags; }
/**
* <p>A list of tags.</p>
*/
inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
/**
* <p>A list of tags.</p>
*/
inline void SetTags(const Aws::Map<Aws::String, Aws::String>& value) { m_tagsHasBeenSet = true; m_tags = value; }
/**
* <p>A list of tags.</p>
*/
inline void SetTags(Aws::Map<Aws::String, Aws::String>&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& WithTags(const Aws::Map<Aws::String, Aws::String>& value) { SetTags(value); return *this;}
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& WithTags(Aws::Map<Aws::String, Aws::String>&& value) { SetTags(std::move(value)); return *this;}
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(const Aws::String& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(Aws::String&& key, const Aws::String& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(const Aws::String& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(Aws::String&& key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), std::move(value)); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(const char* key, Aws::String&& value) { m_tagsHasBeenSet = true; m_tags.emplace(key, std::move(value)); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(Aws::String&& key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(std::move(key), value); return *this; }
/**
* <p>A list of tags.</p>
*/
inline CreateVpcLinkRequest& AddTags(const char* key, const char* value) { m_tagsHasBeenSet = true; m_tags.emplace(key, value); return *this; }
private:
Aws::String m_name;
bool m_nameHasBeenSet;
Aws::Vector<Aws::String> m_securityGroupIds;
bool m_securityGroupIdsHasBeenSet;
Aws::Vector<Aws::String> m_subnetIds;
bool m_subnetIdsHasBeenSet;
Aws::Map<Aws::String, Aws::String> m_tags;
bool m_tagsHasBeenSet;
};
} // namespace Model
} // namespace ApiGatewayV2
} // namespace Aws
| {
"pile_set_name": "Github"
} |
// <auto-generated />
using System;
using Blog.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Blog.Data.Migrations
{
[DbContext(typeof(BlogDbContext))]
[Migration("20181216122231_NullablePublishedOn")]
partial class NullablePublishedOn
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Blog.Data.Models.Article", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Content")
.IsRequired();
b.Property<bool>("IsPublic");
b.Property<DateTime?>("PublishedOn");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(40);
b.Property<string>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Articles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Discriminator")
.IsRequired();
b.Property<string>("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("LockoutEnabled");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash");
b.Property<string>("PhoneNumber");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<string>("SecurityStamp");
b.Property<bool>("TwoFactorEnabled");
b.Property<string>("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers");
b.HasDiscriminator<string>("Discriminator").HasValue("IdentityUser");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(128);
b.Property<string>("ProviderDisplayName");
b.Property<string>("UserId")
.IsRequired();
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("RoleId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
});
modelBuilder.Entity("Blog.Data.Models.User", b =>
{
b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");
b.HasDiscriminator().HasValue("User");
});
modelBuilder.Entity("Blog.Data.Models.Article", b =>
{
b.HasOne("Blog.Data.Models.User", "User")
.WithMany("Articles")
.HasForeignKey("UserId");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/swf/model/WorkflowTypeConfiguration.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SWF
{
namespace Model
{
WorkflowTypeConfiguration::WorkflowTypeConfiguration() :
m_defaultTaskStartToCloseTimeoutHasBeenSet(false),
m_defaultExecutionStartToCloseTimeoutHasBeenSet(false),
m_defaultTaskListHasBeenSet(false),
m_defaultTaskPriorityHasBeenSet(false),
m_defaultChildPolicy(ChildPolicy::NOT_SET),
m_defaultChildPolicyHasBeenSet(false),
m_defaultLambdaRoleHasBeenSet(false)
{
}
WorkflowTypeConfiguration::WorkflowTypeConfiguration(JsonView jsonValue) :
m_defaultTaskStartToCloseTimeoutHasBeenSet(false),
m_defaultExecutionStartToCloseTimeoutHasBeenSet(false),
m_defaultTaskListHasBeenSet(false),
m_defaultTaskPriorityHasBeenSet(false),
m_defaultChildPolicy(ChildPolicy::NOT_SET),
m_defaultChildPolicyHasBeenSet(false),
m_defaultLambdaRoleHasBeenSet(false)
{
*this = jsonValue;
}
WorkflowTypeConfiguration& WorkflowTypeConfiguration::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("defaultTaskStartToCloseTimeout"))
{
m_defaultTaskStartToCloseTimeout = jsonValue.GetString("defaultTaskStartToCloseTimeout");
m_defaultTaskStartToCloseTimeoutHasBeenSet = true;
}
if(jsonValue.ValueExists("defaultExecutionStartToCloseTimeout"))
{
m_defaultExecutionStartToCloseTimeout = jsonValue.GetString("defaultExecutionStartToCloseTimeout");
m_defaultExecutionStartToCloseTimeoutHasBeenSet = true;
}
if(jsonValue.ValueExists("defaultTaskList"))
{
m_defaultTaskList = jsonValue.GetObject("defaultTaskList");
m_defaultTaskListHasBeenSet = true;
}
if(jsonValue.ValueExists("defaultTaskPriority"))
{
m_defaultTaskPriority = jsonValue.GetString("defaultTaskPriority");
m_defaultTaskPriorityHasBeenSet = true;
}
if(jsonValue.ValueExists("defaultChildPolicy"))
{
m_defaultChildPolicy = ChildPolicyMapper::GetChildPolicyForName(jsonValue.GetString("defaultChildPolicy"));
m_defaultChildPolicyHasBeenSet = true;
}
if(jsonValue.ValueExists("defaultLambdaRole"))
{
m_defaultLambdaRole = jsonValue.GetString("defaultLambdaRole");
m_defaultLambdaRoleHasBeenSet = true;
}
return *this;
}
JsonValue WorkflowTypeConfiguration::Jsonize() const
{
JsonValue payload;
if(m_defaultTaskStartToCloseTimeoutHasBeenSet)
{
payload.WithString("defaultTaskStartToCloseTimeout", m_defaultTaskStartToCloseTimeout);
}
if(m_defaultExecutionStartToCloseTimeoutHasBeenSet)
{
payload.WithString("defaultExecutionStartToCloseTimeout", m_defaultExecutionStartToCloseTimeout);
}
if(m_defaultTaskListHasBeenSet)
{
payload.WithObject("defaultTaskList", m_defaultTaskList.Jsonize());
}
if(m_defaultTaskPriorityHasBeenSet)
{
payload.WithString("defaultTaskPriority", m_defaultTaskPriority);
}
if(m_defaultChildPolicyHasBeenSet)
{
payload.WithString("defaultChildPolicy", ChildPolicyMapper::GetNameForChildPolicy(m_defaultChildPolicy));
}
if(m_defaultLambdaRoleHasBeenSet)
{
payload.WithString("defaultLambdaRole", m_defaultLambdaRole);
}
return payload;
}
} // namespace Model
} // namespace SWF
} // namespace Aws
| {
"pile_set_name": "Github"
} |
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `-- ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
ServerName localhost
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet | {
"pile_set_name": "Github"
} |
<h1>Metadata, etc.</h1>
<p>I normally filter out things that look like metadata. Can’t do it any
more. I need to see all of the following:</p>
<pre class="example">
* DONE Handle inline formatting
CLOSED: [2009-12-26 Sat 21:41]
:PROPERTIES:
:ARCHIVE_TIME: 2009-12-26 Sat 22:16
:ARCHIVE_FILE: ~/brians-brain/content/projects/orgmode_parser.org
:ARCHIVE_OLPATH: <%= @page.title %>/Future Development
:ARCHIVE_CATEGORY: orgmode_parser
:ARCHIVE_TODO: DONE
:END:
I still need to handle:
- [ ] =Inline code=
How does the =emacs= HTML parser handle *inline* formatting? Ah,
it looks like it defines everything in =org-emphasis-alist= (line
2855 of =org.el=).
And then look at =org-emphasis-regexp-components=, line 2828 of
=org.el=. It looks like they just use a crazy regexp for inline
formatting. Which is good, because it means I can copy!
</pre>
| {
"pile_set_name": "Github"
} |
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// author: Javier López-Gómez <[email protected]>
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
#include "DefinitionShadower.h"
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/InterpreterCallbacks.h"
#include "cling/Utils/AST.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclContextInternals.h"
#include "clang/AST/Stmt.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Sema.h"
using namespace clang;
namespace cling {
/// \brief Returns whether the given source location is a Cling input line. If
/// it came from the prompt, the file is a virtual file with overriden contents.
static bool typedInClingPrompt(FullSourceLoc L) {
if (L.isInvalid())
return false;
const SourceManager &SM = L.getManager();
const FileID FID = SM.getFileID(L);
return SM.isFileOverridden(SM.getFileEntryForID(FID))
&& (SM.getFileID(SM.getIncludeLoc(FID)) == SM.getMainFileID());
}
/// \brief Returns whether the given {Function,Tag,Var}Decl/TemplateDecl is a definition.
static bool isDefinition(const Decl *D) {
if (auto FD = dyn_cast<FunctionDecl>(D))
return FD->isThisDeclarationADefinition();
if (auto TD = dyn_cast<TagDecl>(D))
return TD->isThisDeclarationADefinition();
if (auto VD = dyn_cast<VarDecl>(D))
return VD->isThisDeclarationADefinition();
if (auto TD = dyn_cast<TemplateDecl>(D))
return isDefinition(TD->getTemplatedDecl());
return true;
}
DefinitionShadower::DefinitionShadower(Sema& S, Interpreter& I)
: ASTTransformer(&S), m_Context(S.getASTContext()), m_Interp(I),
m_TU(S.getASTContext().getTranslationUnitDecl())
{}
bool DefinitionShadower::isClingShadowNamespace(const DeclContext *DC) {
auto NS = dyn_cast<NamespaceDecl>(DC);
return NS && NS->getName().startswith("__cling_N5");
}
void DefinitionShadower::hideDecl(clang::NamedDecl *D) const {
assert(isClingShadowNamespace(D->getDeclContext())
&& "D not in a __cling_N5xxx namespace?");
// FIXME: this hides a decl from SemaLookup (there is no unloading). For
// (large) L-values, this might be a memory leak. Should this be fixed?
if (Scope* S = m_Sema->getScopeForContext(m_TU)) {
S->RemoveDecl(D);
if (utils::Analyze::isOnScopeChains(D, *m_Sema))
m_Sema->IdResolver.RemoveDecl(D);
}
clang::StoredDeclsList &SDL = (*m_TU->getLookupPtr())[D->getDeclName()];
if (SDL.getAsVector() || SDL.getAsDecl() == D)
SDL.remove(D);
if (InterpreterCallbacks *IC = m_Interp.getCallbacks())
IC->DefinitionShadowed(D);
}
void DefinitionShadower::invalidatePreviousDefinitions(NamedDecl *D) const {
LookupResult Previous(*m_Sema, D->getDeclName(), D->getLocation(),
Sema::LookupOrdinaryName, Sema::ForRedeclaration);
m_Sema->LookupQualifiedName(Previous, m_TU);
for (auto Prev : Previous) {
if (Prev == D)
continue;
if (!isClingShadowNamespace(Prev->getDeclContext()))
continue;
if (isDefinition(Prev) && !isDefinition(D))
continue;
// If the found declaration is a function overload, do not invalidate it.
// For templated functions, Sema::IsOverload() does the right thing as per
// C++ [temp.over.link]p4.
if (isa<FunctionDecl>(Prev) && isa<FunctionDecl>(D)
&& m_Sema->IsOverload(cast<FunctionDecl>(D),
cast<FunctionDecl>(Prev), /*IsForUsingDecl=*/false))
continue;
if (isa<FunctionTemplateDecl>(Prev) && isa<FunctionTemplateDecl>(D)
&& m_Sema->IsOverload(cast<FunctionTemplateDecl>(D)->getTemplatedDecl(),
cast<FunctionTemplateDecl>(Prev)->getTemplatedDecl(),
/*IsForUsingDecl=*/false))
continue;
hideDecl(Prev);
// For unscoped enumerations, also invalidate all enumerators.
if (EnumDecl *ED = dyn_cast<EnumDecl>(Prev)) {
if (!ED->isTransparentContext())
continue;
for (auto &J : ED->decls())
if (NamedDecl *ND = dyn_cast<NamedDecl>(J))
hideDecl(ND);
}
}
// Ignore any forward declaration issued after a definition. Fixes "error
// : reference to 'xxx' is ambiguous" in `class C {}; class C; C foo;`.
if (!Previous.empty() && !isDefinition(D))
D->setInvalidDecl();
}
void DefinitionShadower::invalidatePreviousDefinitions(FunctionDecl *D) const {
const CompilationOptions &CO = getTransaction()->getCompilationOpts();
if (utils::Analyze::IsWrapper(D)) {
if (!CO.DeclarationExtraction)
return;
// DeclExtractor shall move local declarations to the TU. Invalidate all
// previous definitions (that may clash) before it runs.
auto CS = dyn_cast<CompoundStmt>(D->getBody());
for (auto &I : CS->body()) {
auto DS = dyn_cast<DeclStmt>(I);
if (!DS)
continue;
for (auto &J : DS->decls())
if (auto ND = dyn_cast<NamedDecl>(J))
invalidatePreviousDefinitions(ND);
}
} else
invalidatePreviousDefinitions(cast<NamedDecl>(D));
}
void DefinitionShadower::invalidatePreviousDefinitions(Decl *D) const {
if (auto FD = dyn_cast<FunctionDecl>(D))
invalidatePreviousDefinitions(FD);
else if (auto ND = dyn_cast<NamedDecl>(D))
invalidatePreviousDefinitions(ND);
}
ASTTransformer::Result DefinitionShadower::Transform(Decl* D) {
Transaction *T = getTransaction();
const CompilationOptions &CO = T->getCompilationOpts();
// Global declarations whose origin is the Cling prompt are subject to be
// nested in a `__cling_N5' namespace.
if (!CO.EnableShadowing
|| D->getLexicalDeclContext() != m_TU || D->isInvalidDecl()
|| isa<UsingDirectiveDecl>(D) || isa<UsingDecl>(D)
// FIXME: NamespaceDecl requires additional processing (TBD)
|| isa<NamespaceDecl>(D)
|| (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isTemplateInstantiation())
|| !typedInClingPrompt(FullSourceLoc{D->getLocation(),
m_Context.getSourceManager()}))
return Result(D, true);
// Each transaction gets at most a `__cling_N5xxx' namespace. If `T' already
// has one, reuse it.
auto NS = T->getDefinitionShadowNS();
if (!NS) {
NS = NamespaceDecl::Create(m_Context, m_TU, /*inline=*/true,
SourceLocation(), SourceLocation(),
&m_Context.Idents.get("__cling_N5"
+ std::to_string(m_UniqueNameCounter++)),
nullptr);
//NS->setImplicit();
m_TU->addDecl(NS);
T->setDefinitionShadowNS(NS);
}
m_TU->removeDecl(D);
if (isa<CXXRecordDecl>(D->getDeclContext()))
D->setLexicalDeclContext(NS);
else
D->setDeclContext(NS);
// An instantiated function template inherits the declaration context of the
// templated decl. This is used for name mangling; fix it to avoid clashing.
if (auto FTD = dyn_cast<FunctionTemplateDecl>(D))
FTD->getTemplatedDecl()->setDeclContext(NS);
NS->addDecl(D);
// Invalidate previous definitions so that LookupResult::resolveKind() does not
// mark resolution as ambiguous.
invalidatePreviousDefinitions(D);
return Result(D, true);
}
} // end namespace cling
| {
"pile_set_name": "Github"
} |
export * from "./aa";
| {
"pile_set_name": "Github"
} |
catherine deane ( jennifer lopez ) is a psychologist who has been hired to participate in a project where she can enter the minds of comatose victims and try to interact with their subconscious in an attempt to wake them up .
she has been experiencing moderate success with a young boy in a coma , but the boy's parents aren't happy with the apparent lack of progress and the toll of her job is having adverse affects on her regular life .
as if trying to assure the boy's parents wasn't hard enough on her , a new development arises that furthers the strain on deane's mental faculties .
a vicious serial killer named carl stargher ( vincent d'onofrio ) has been kidnapping women , locking them in an automated cell that drowns them slowly in a matter of days , then soaking the corpses in bleach to turn them into life-sized dolls .
just after kidnapping his latest victim and locking her in the cell , stargher has a traumatic experience that triggers a schizophrenic virus in his brain and causes him to sink in an eternal catatonia .
the police , led by fbi agent peter novak ( vince vaughn ) are able to locate stargher by some clues he left while dumping his previous victim's body , but they feel all hope is lost for his current victim due to his vegetative state .
in a last ditch attempt , they ask deane and the scientists that created the project to undergo the frightening task of entering stargher's mind to try and find the location of the victim locked in the deadly cell . . .
a cell which will completely fill with water in the next 40 hours !
initial reports about this film described it as a cross between the silence of the lambs and the matrix .
while it does share some characteristics with both films ( particularly the first forty minutes , which seem almost like a condensed version of lambs ) , the cell also seems to contain elements of dreamscape and brainstorm .
the buzz around this project is that first-time feature film director tarsem singh ( who won many awards for his video of r . e . m . 's " losing my religion " ) wanted a script that he could fashion images out of instead of a cohesive story , and a good portion of this film supports that theory .
despite the borrowed elements from the aforementioned films and a script that contains several logically questionable moments , the cell does feature some remarkable imagery .
all of the sequences where we delve into someone's mind are incredibly beautiful ( including the dank mind of stargher , whose thoughts are reminiscent of an h . r . giger painting come to life mixed with a tool music video ) , proving that singh is as adept at filming strange and wonderful images as his acclaim would lead us to believe .
the first sequence that takes place in stargher's mind is by far the best , featuring one of the most ingenious traps i've ever seen in a film ( involving a horse , which no one seeing this film will probably forget ) , a zoo-like display of stargher's victims which are animated like marionettes , and stargher himself in a giant purple cape that spans the walls of his mental throne room .
if the film had continued within this dirty monstrous world i would have deemed the film brilliant , but alas , the sequences only become more silly as they go along ( despite a painful nipple ring removal later in the film ) .
the cast is basically just an excuse for there to be some moderate plot semblance during the parade of images , but at least vincent d'onofrio turns in his usual bizarre and psychotic performance ( magnified by ten , thanks to the environment in which the film has been placed ) .
in my opinion , d'onofrio was one of the best creepy actors i have ever seen in a film , but his film choices as of late have been so completely awful ( i . e . -
the newton boys , feeling minnesota , the thirteenth floor , and the velocity of gary ) that i have begun to rethink my initial assessment of him .
the character of stargher is an excellent role for him though , and will probably lead to a bit of typecasting for him .
detractors of violence and disturbing images will want to stay far away from this film , as it contains heavy doses of both .
besides the nipple ring removal i mention above , there is also stargher's penchant for hanging suspended off of the floor by the rings that pierce his back and legs ( prior to his catatonia and capture ) which will have audiences recoiling .
a sequence where catherine enters stargher's mind and finds him recreating the disemboweling of his first victim is also pretty disquieting .
one moment also features a character having his intestines slowly removed from his body by an old fashioned hand cranked spit-like device .
as a narrative film , the cell is sorely lacking .
as a collection of images though , the cell is extremely well done .
although the latter sequences in the film contain fewer disturbing imagery than the first half , singh has done what he supposedly set out to do : make a film solely for the purpose of stringing some remarkable images together .
unfortunately , a well-written script should have been considered too , because without it the cell just seems like any other music video we could see on mtv ( provided , of course , that mtv allowed for the use of graphic violence and language in music videos ) .
| {
"pile_set_name": "Github"
} |
^CMake Error at TestToolsetXcodeBuildSystem1.cmake:[0-9]+ \(message\):
CMAKE_GENERATOR_TOOLSET is "Test Toolset,buildsystem=1" as expected.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
| {
"pile_set_name": "Github"
} |
// Copyright (C) 2020 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
// 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 3 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., 51
// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#pragma once
#include "system.hpp"
#include "third_party/minitrace.h"
#ifdef MTR_ENABLED
# include <string>
struct ArgsInfo;
class MiniTrace
{
public:
MiniTrace(const ArgsInfo& args_info);
~MiniTrace();
private:
const ArgsInfo& m_args_info;
const void* const m_trace_id;
std::string m_tmp_trace_file;
};
#endif
| {
"pile_set_name": "Github"
} |
package main
import "errors"
var (
errArgsNotAvail = errors.New("args not available")
errSnapMetaNil = errors.New("snap meta is nil")
errMd5NotMatch = errors.New("md5 not match")
errFileNotExist = errors.New("file not exist")
errHttp = errors.New("http resp error")
)
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7515.2" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7512"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Left Drawer Table View Controller-->
<scene sceneID="XlV-ZG-8V7">
<objects>
<tableViewController storyboardIdentifier="KGLeftDrawerViewControllerStoryboardId" id="yt2-uj-lft" customClass="LeftDrawerTableViewController" customModule="KGDrawerViewController" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="none" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="PgL-bO-Ph7">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="Gb1-mx-cQj">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="40" id="5hx-1h-rjK">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5hx-1h-rjK" id="G1m-iJ-gxH">
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="40" id="hka-zv-aKZ">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hka-zv-aKZ" id="SEg-dw-gjE">
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="LeftDrawerCell" rowHeight="64" id="c2L-fI-TYO">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="c2L-fI-TYO" id="FoO-Tz-DW8">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="o3S-59-mg4">
<rect key="frame" x="60" y="10" width="44" height="44"/>
<color key="tintColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" image="488-github">
<color key="titleColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="GitHub" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fZk-oN-KNb">
<rect key="frame" x="112" y="21" width="55" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.90196079015731812" green="0.90196079015731812" blue="0.90196079015731812" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="LeftDrawerCell" rowHeight="64" id="mtw-ln-Fyg">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mtw-ln-Fyg" id="fIC-ID-ZwQ">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ANI-0O-7DV">
<rect key="frame" x="60" y="8" width="44" height="44"/>
<color key="tintColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" image="665-gear">
<color key="titleColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Settings" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LhV-W7-csb">
<rect key="frame" x="112" y="19" width="63" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.90196079019999997" green="0.90196079019999997" blue="0.90196079019999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCellContentView>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="yt2-uj-lft" id="Ugd-nh-D0c"/>
<outlet property="delegate" destination="yt2-uj-lft" id="cgs-LZ-beT"/>
</connections>
</tableView>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="izT-hX-JeI" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-570" y="659"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="EFG-kA-5ei">
<objects>
<navigationController storyboardIdentifier="KGDrawerWebViewControllerStoryboardId" id="0EE-Gk-zoq" sceneMemberID="viewController">
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="F8d-gh-q47">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.38039215686274508" green="0.77647058823529413" blue="0.2627450980392157" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes">
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
<connections>
<segue destination="7Ug-iL-oHy" kind="relationship" relationship="rootViewController" id="wNK-NK-Cls"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ekw-Cg-knn" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="152" y="-55"/>
</scene>
<!--GitHub-->
<scene sceneID="Co7-Rd-Q0x">
<objects>
<viewController id="7Ug-iL-oHy" customClass="KGDrawerWebViewViewController" customModule="KGDrawerViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="TPg-nJ-6jh"/>
<viewControllerLayoutGuide type="bottom" id="cgv-Ue-9R2"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8pe-08-6H2">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="85Y-Mr-PWb">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</webView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="85Y-Mr-PWb" firstAttribute="width" secondItem="8pe-08-6H2" secondAttribute="width" id="5FU-Fx-Kg8"/>
<constraint firstAttribute="centerX" secondItem="85Y-Mr-PWb" secondAttribute="centerX" id="IE6-HM-N4l"/>
<constraint firstAttribute="centerY" secondItem="85Y-Mr-PWb" secondAttribute="centerY" id="VUW-hs-ver"/>
<constraint firstItem="85Y-Mr-PWb" firstAttribute="height" secondItem="8pe-08-6H2" secondAttribute="height" id="ZWH-Wy-x2x"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="GitHub" id="gH1-UW-Mr9">
<barButtonItem key="leftBarButtonItem" image="List" id="MCM-c3-smW">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="toggleLeftDrawer:" destination="7Ug-iL-oHy" id="MRC-v0-r0b"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" image="List" id="LXO-Vh-EP1">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="toggleRightDrawer:" destination="7Ug-iL-oHy" id="yBp-dB-hbz"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="webView" destination="85Y-Mr-PWb" id="NnR-G4-zfw"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mgg-89-M6x" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="152" y="659"/>
</scene>
<!--Drawer Settings-->
<scene sceneID="Ylc-bl-wg5">
<objects>
<tableViewController id="W6B-t9-T3o" customClass="KGDrawerSettingsTableViewController" customModule="KGDrawerViewController" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="grouped" separatorStyle="default" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="YwO-pr-Hrn">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
<sections>
<tableViewSection headerTitle="Animation Duration" id="ssE-aM-xnD">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="fCQ-8X-qbh">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fCQ-8X-qbh" id="7lt-Oi-2df">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m8l-Jb-7lG">
<rect key="frame" x="8" y="11" width="42" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="6FM-od-OeK"/>
<constraint firstAttribute="width" constant="42" id="gB7-wX-9AC"/>
</constraints>
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/>
<color key="textColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.69999999999999996" minValue="0.0" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="spl-2r-FfP">
<rect key="frame" x="56" y="7" width="538" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="FGH-Z4-eRA"/>
</constraints>
<connections>
<action selector="durationSliderChanged:" destination="W6B-t9-T3o" eventType="valueChanged" id="Ux4-SA-7Om"/>
</connections>
</slider>
</subviews>
<constraints>
<constraint firstItem="m8l-Jb-7lG" firstAttribute="top" secondItem="7lt-Oi-2df" secondAttribute="topMargin" constant="3" id="b0i-wU-KKN"/>
<constraint firstItem="spl-2r-FfP" firstAttribute="trailing" secondItem="7lt-Oi-2df" secondAttribute="trailingMargin" id="fV6-7n-FKt"/>
<constraint firstItem="spl-2r-FfP" firstAttribute="centerY" secondItem="m8l-Jb-7lG" secondAttribute="centerY" constant="0.5" id="hjT-2D-lAt"/>
<constraint firstItem="m8l-Jb-7lG" firstAttribute="leading" secondItem="7lt-Oi-2df" secondAttribute="leadingMargin" id="hso-N5-Z2U"/>
<constraint firstItem="spl-2r-FfP" firstAttribute="leading" secondItem="m8l-Jb-7lG" secondAttribute="trailing" constant="8" id="kcT-2e-SfG"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Animation Delay" id="4xh-Lc-trQ">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="cHK-cy-met">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="cHK-cy-met" id="HIW-pZ-0Nt">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Ft-bY-IgX">
<rect key="frame" x="8" y="11" width="42" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="42" id="R2M-De-MQi"/>
<constraint firstAttribute="height" constant="21" id="UxN-LR-XUs"/>
</constraints>
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/>
<color key="textColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="0.0" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="iCl-tw-tps">
<rect key="frame" x="56" y="7" width="538" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="m0u-jq-wjp"/>
</constraints>
<connections>
<action selector="delaySliderChanged:" destination="W6B-t9-T3o" eventType="valueChanged" id="Wso-kh-17Y"/>
</connections>
</slider>
</subviews>
<constraints>
<constraint firstItem="1Ft-bY-IgX" firstAttribute="top" secondItem="HIW-pZ-0Nt" secondAttribute="topMargin" constant="3" id="1Cp-0h-uil"/>
<constraint firstItem="iCl-tw-tps" firstAttribute="trailing" secondItem="HIW-pZ-0Nt" secondAttribute="trailingMargin" id="L96-uT-E6N"/>
<constraint firstItem="iCl-tw-tps" firstAttribute="centerY" secondItem="1Ft-bY-IgX" secondAttribute="centerY" constant="0.5" id="cnj-MK-MJ3"/>
<constraint firstItem="iCl-tw-tps" firstAttribute="leading" secondItem="1Ft-bY-IgX" secondAttribute="trailing" constant="8" id="rMb-22-p68"/>
<constraint firstItem="1Ft-bY-IgX" firstAttribute="leading" secondItem="HIW-pZ-0Nt" secondAttribute="leadingMargin" id="zOA-0t-mQT"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Initial Spring Velocity" id="74q-ml-od5">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="fAm-2F-sqv">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fAm-2F-sqv" id="CG6-fc-GId">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0ok-Ix-bw4">
<rect key="frame" x="8" y="11" width="48" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="48" id="Fk8-h7-FZh"/>
<constraint firstAttribute="height" constant="21" id="fjj-fe-nv7"/>
</constraints>
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/>
<color key="textColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="9.0999999999999996" minValue="0.0" maxValue="20" translatesAutoresizingMaskIntoConstraints="NO" id="986-59-Mvg">
<rect key="frame" x="56" y="7" width="538" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="kH8-cy-Onu"/>
</constraints>
<connections>
<action selector="springVelocitySliderChanged:" destination="W6B-t9-T3o" eventType="valueChanged" id="6cz-m5-Q3q"/>
</connections>
</slider>
</subviews>
<constraints>
<constraint firstItem="986-59-Mvg" firstAttribute="leading" secondItem="0ok-Ix-bw4" secondAttribute="trailing" constant="2" id="7Aq-G5-6Os"/>
<constraint firstItem="986-59-Mvg" firstAttribute="centerY" secondItem="0ok-Ix-bw4" secondAttribute="centerY" constant="0.5" id="RfL-xP-qcN"/>
<constraint firstItem="986-59-Mvg" firstAttribute="trailing" secondItem="CG6-fc-GId" secondAttribute="trailingMargin" id="T8K-ge-lNg"/>
<constraint firstItem="0ok-Ix-bw4" firstAttribute="leading" secondItem="CG6-fc-GId" secondAttribute="leadingMargin" id="osR-n8-xR0"/>
<constraint firstItem="0ok-Ix-bw4" firstAttribute="top" secondItem="CG6-fc-GId" secondAttribute="topMargin" constant="3" id="rp4-y3-adl"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Spring Damping" id="isO-sq-Udn">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="h3a-Ow-2yd">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="h3a-Ow-2yd" id="9R6-3q-v0G">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pu6-3g-sif">
<rect key="frame" x="8" y="11" width="42" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="42" id="LSh-hZ-Rkd"/>
<constraint firstAttribute="height" constant="21" id="UPF-nK-u5z"/>
</constraints>
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/>
<color key="textColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.80000000000000004" minValue="0.0" maxValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="b2y-UP-Ayq">
<rect key="frame" x="56" y="7" width="538" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="KZL-mM-Uqi"/>
</constraints>
<connections>
<action selector="springDampingSliderChanged:" destination="W6B-t9-T3o" eventType="valueChanged" id="udc-oE-ZVW"/>
</connections>
</slider>
</subviews>
<constraints>
<constraint firstItem="b2y-UP-Ayq" firstAttribute="leading" secondItem="Pu6-3g-sif" secondAttribute="trailing" constant="8" id="1Mq-cL-rpL"/>
<constraint firstItem="Pu6-3g-sif" firstAttribute="leading" secondItem="9R6-3q-v0G" secondAttribute="leadingMargin" id="Yww-I5-2Ou"/>
<constraint firstItem="Pu6-3g-sif" firstAttribute="top" secondItem="9R6-3q-v0G" secondAttribute="topMargin" constant="3" id="pgt-fn-o4y"/>
<constraint firstItem="b2y-UP-Ayq" firstAttribute="trailing" secondItem="9R6-3q-v0G" secondAttribute="trailingMargin" id="uZi-2D-hGg"/>
<constraint firstItem="b2y-UP-Ayq" firstAttribute="centerY" secondItem="Pu6-3g-sif" secondAttribute="centerY" constant="0.5" id="zRj-ap-lfU"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
<tableViewSection headerTitle="Defaults" id="294-1g-RUf">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" id="vLe-Ai-MEz">
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vLe-Ai-MEz" id="trS-8z-ptb">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="reset to default values" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wNt-Vk-TTP">
<rect key="frame" x="216" y="14" width="169" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="169" id="cBp-X3-pw6"/>
<constraint firstAttribute="height" constant="21" id="fkf-1d-XfK"/>
</constraints>
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="17"/>
<color key="textColor" red="0.29803922770000002" green="0.29803922770000002" blue="0.29803922770000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="centerY" secondItem="wNt-Vk-TTP" secondAttribute="centerY" constant="-3" id="PHr-XA-lXp"/>
<constraint firstAttribute="centerX" secondItem="wNt-Vk-TTP" secondAttribute="centerX" constant="-0.5" id="WbN-er-K3g"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="W6B-t9-T3o" id="Uag-KU-Npj"/>
<outlet property="delegate" destination="W6B-t9-T3o" id="A3b-bi-xa4"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Drawer Settings" id="heO-zX-qAH">
<barButtonItem key="leftBarButtonItem" image="List" id="kEa-KR-Fro">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="toggleLeftDrawer:" destination="W6B-t9-T3o" id="2Sa-Ef-AnZ"/>
</connections>
</barButtonItem>
<barButtonItem key="rightBarButtonItem" image="List" id="5rX-kB-5vU">
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="toggleRightDrawer:" destination="W6B-t9-T3o" id="u0W-xn-1M2"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="delayLabel" destination="1Ft-bY-IgX" id="s2H-jB-lSR"/>
<outlet property="delaySlider" destination="iCl-tw-tps" id="x7T-8D-ww4"/>
<outlet property="durationLabel" destination="m8l-Jb-7lG" id="DWw-tJ-52x"/>
<outlet property="durationSlider" destination="spl-2r-FfP" id="ReE-rv-TWf"/>
<outlet property="springDampingLabel" destination="Pu6-3g-sif" id="4ww-GC-h0y"/>
<outlet property="springDampingSlider" destination="b2y-UP-Ayq" id="75E-Yg-3jc"/>
<outlet property="springVelocityLabel" destination="0ok-Ix-bw4" id="WPz-xt-Iel"/>
<outlet property="springVelocitySlider" destination="986-59-Mvg" id="rdD-1A-WiD"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Nsk-1m-ORs" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="865" y="659"/>
</scene>
<!--Table View Controller-->
<scene sceneID="fEH-YX-N9V">
<objects>
<tableViewController storyboardIdentifier="KGRightDrawerViewControllerStoryboardId" id="auo-u2-R3y" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="vjy-pd-jYz">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<connections>
<outlet property="dataSource" destination="auo-u2-R3y" id="pRQ-w9-Ihu"/>
<outlet property="delegate" destination="auo-u2-R3y" id="L1g-tl-S8e"/>
</connections>
</tableView>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4VJ-3l-m4x" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1589" y="659"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="IMT-lY-uo6">
<objects>
<navigationController storyboardIdentifier="KGDrawerSettingsViewControllerStoryboardId" id="b4d-cV-MhQ" sceneMemberID="viewController">
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="AQ3-a5-v9q">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.40000000600000002" green="0.40000000600000002" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<textAttributes key="titleTextAttributes">
<fontDescription key="fontDescription" name="Futura-Medium" family="Futura" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</textAttributes>
</navigationBar>
<connections>
<segue destination="W6B-t9-T3o" kind="relationship" relationship="rootViewController" id="0h8-Tw-4g6"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Q3T-aU-h3M" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="865" y="-55"/>
</scene>
</scenes>
<resources>
<image name="488-github" width="26" height="26"/>
<image name="665-gear" width="28" height="28"/>
<image name="List" width="19" height="15"/>
</resources>
</document>
| {
"pile_set_name": "Github"
} |
spdlog is header only library.
Just copy the files to your build tree and use a C++11 compiler
Tested on:
gcc 4.8.1 and above
clang 3.5
Visual Studio 2013
gcc 4.8 flags: --std==c++11 -pthread -O3 -flto -Wl,--no-as-needed
gcc 4.9 flags: --std=c++11 -pthread -O3 -flto
see the makefile in the example folder
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en" data-auth="false" data-template="false">
<head>
<meta charset="utf-8" />
<title translate="yes">ዘግተው መውጣት</title>
<meta http-equiv="refresh" content="1;url=/account/signout-complete">
<link href="/public/pure-min.css" rel="stylesheet">
<link href="/public/content.css" rel="stylesheet">
<link href="/public/content-additional.css" rel="stylesheet">
<base target="_top" href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p class="entry-form" translate="yes">ዘግተው መውጣት እስኪጠናቀቅ ድረስ እባክዎ ይጠብቁ።</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"웹 브라우저로 접근할 수 있는 페이지에 있는 정보 중, 각자가 원하는 정보를 선택하여 로컬 컴퓨터로 가져오는 과정을 스크래핑 (scraping)이라 하며, 크롤링 (crawling)이라고 불리고 있으나, 크롤링은 정확히는 스크래핑과 차이가 있는 의미입니다. \n",
"\n",
"[참고](http://stackoverflow.com/questions/4327392/what-is-the-difference-between-web-crawling-and-web-scraping)\n",
"\n",
"스크래핑을 하기 위하여 beautiful soup 4라는 HTML parser와 beautiful soup 4가 이용하는 lxml 이라는 XML parser를 이용합니다. 각자의 가상 환경에 해당 패키지가 없다면 아래의 명령어를 통하여 패키지를 설치할 수 있습니다. \n",
"\n",
" pip install bs4\n",
" \n",
" pip install lxml\n",
"\n",
"이 외에도 다양한 스크래핑 도구들은 있습니다. \n",
"\n",
"또한 HTTP를 통하여 웹서버와 통신하기 위한 requests라는 패키지를 이용합니다. 이 역시 각자의 가상환경에 설치가 되어 있지 않다면 pip install requests를 하면 됩니다. anaconda 기본 패키지에는 위 세 도구 모두 설치되어 있습니다. \n",
"\n",
" pip install requests"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 웹페이지 탐색"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"네이버 영화에서 각 영화들을 클릭해보면 url에 공통된 부분이 있습니다. \n",
"\n",
" 'http://movie.naver.com/movie/bi/mi/basic.nhn?code=134963' # 라라랜드\n",
" 'http://movie.naver.com/movie/bi/mi/basic.nhn?code=126034' # 그래이트 워\n",
" 'http://movie.naver.com/movie/bi/mi/basic.nhn?code=127382' # 조작된 도시\n",
" \n",
"영화 아이디와 url의 공통된 부분을 합치면 각 영화에 해당하는 영화 url을 얻을 수 있습니다. 그렇기 때문에 url을 base와 id 부분으로 나눠서 만들며, 영화 아이디를 넣을 부분을 %s로 표시합니다. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from bs4 import BeautifulSoup\n",
"import os\n",
"import re\n",
"import requests\n",
"import sys\n",
"from pprint import pprint\n",
"\n",
"url_basic_base = 'http://movie.naver.com/movie/bi/mi/basic.nhn?code=%s'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"라라랜드 영화 아이디는 movie_id = 134963 입니다. 라라랜드 영화와 관련된 메타 데이터를 수집해 봅시다. "
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"movie_id = 134963 # LaLa Land"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 웹페이지 가져오기"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"requests는 네이버 영화 서버에 어떤 것을 요청할 수 있는 라이브러리입니다. requests의 requests.get(url)을 하면 해당 url의 서버로부터 웹페이지의 정보들을 얻어옵니다.\n",
"requests.get(url)의 return은 텍스트 외에도 header와 같은 많은 정보들을 포함합니다. 이 중에서 우리가 필요한 것은 text (html source)이기 때문에 requests.get(url).text를 html로 저장합니다. html의 type은 str입니다.\n",
"\n",
"BeautifulSoup(html, 'lxml')은 스트링 형식의 html을 lxml이라는 XML parser를 이용하여 문서를 구조화합니다.\n",
"웹페이지는 매우 긴 소스 코드로 이뤄져 있습니다. 브라우저 (크롬, 익스프롤러 등)는 이러한 복잡한 소스코드를 잘 구조화하여 화면에 보여주는 프로그램입니다. 매우 긴 코드지만 HTML은 구조화가 잘 되어 있습니다. 역으로 이 구조를 잘 파악하면 우리가 원하는 정보를 손쉽게 가져올 수 있는 것이죠. BeautifulSoup(html, 'lxml')을 한 번 실행함으로써 이미 HTML 문서는 다 구조화 되었습니다. 이제부터는 그 구조화된 문서로부터 우리가 원하는 정보를 가져올 것입니다."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"url = url_basic_base % movie_id\n",
"\n",
"r = requests.get(url)\n",
"html = r.text\n",
"page = BeautifulSoup(html, 'lxml')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"requests.get(url)의 결과물의 headers를 살펴보면, 해당 통신과 관련된 메타 정보들이 포함됨을 볼 수 있습니다. "
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Date': 'Fri, 12 Oct 2018 17:10:03 GMT', 'Pragma': 'no-cache', 'Expires': 'Thu, 01 Jan 1970 00:00:00 GMT', 'Cache-Control': 'no-cache, no-store', 'Content-Language': 'ko-KR', 'P3P': 'CP=\"ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC\", CP=\"ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC\"', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'Content-Length': '36680', 'Content-Type': 'text/html;charset=UTF-8', 'Referrer-Policy': 'unsafe-url', 'Server': 'nfront'}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r.headers"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 영화 제목 가져오기"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"영화의 영어 제목을 가져와 봅시다. \n",
"\n",
"\n",
"\n",
"좌측 상단에 영화 이름이 있습니다. 원하는 정보를 드래그한 뒤, 크롬의 Inspect (한글은 요소 탐색)을 눌러보시면 해당 부분의 source code가 우측에 하이라이팅 되어 나타납니다. La La Land라는 영화 제목은 strong이라는 태그 안에 들어있으며, 그 태그의 class는 h_movie2입니다. HTML에서 태그라는 것은 \"<>\"으로 시작하여 \"</ >\"으로 끝나는 부분입니다. 링크의 경우에는 \"\\<a>\"로 시작하여 \"\\</a>\"로 끝납니다. \n",
"\n",
"\"\\<strong class=h_movie2\">\"는 \"\\<div class=mv_info>\"아래에 있다는 것도 볼 수 있습니다. \n",
"\n",
" page.select('div[class=mv_info] strong[class=h_movie2]')\n",
"\n",
"위 코드는 mv_info라는 클래스 이름을 갖는 div 아래에 속한, class 이름이 h_movie2인 strong이라는 것을 찾아서 가져온다는 의미입니다. \n",
"\n",
"\n",
"\n",
"select의 결과는 하나가 아닐 수 있기 때문에 return type은 list입니다. 실제 우리의 데이터에서도 select에 해당하는 부분이 2개가 있었네요. 그 중 첫번째 부분만을 이용하겠습니다."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'list'>\n",
"2 \n",
"\n"
]
}
],
"source": [
"title = page.select('div[class=mv_info] strong[class=h_movie2]')\n",
"print(type(title))\n",
"print(len(title), '\\n')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[<strong class=\"h_movie2\" title=\"La La Land\t\t\t\t\t\t\t\t\t\t, \t\t\t\t\t2016\">La La Land\r\n",
"\t\t\t\t\t\r\n",
"\t\t\t\t\t, \r\n",
"\t\t\t\t\t2016</strong>, <strong class=\"h_movie2\" title=\"La La Land, 2016\">La La Land, 2016</strong>] \n",
"\n"
]
}
],
"source": [
"print(title, '\\n')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<strong class=\"h_movie2\" title=\"La La Land\t\t\t\t\t\t\t\t\t\t, \t\t\t\t\t2016\">La La Land\r\n",
"\t\t\t\t\t\r\n",
"\t\t\t\t\t, \r\n",
"\t\t\t\t\t2016</strong> \n",
"\n"
]
}
],
"source": [
"print(title[0], '\\n')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<strong class=\"h_movie2\" title=\"La La Land, 2016\">La La Land, 2016</strong> \n",
"\n"
]
}
],
"source": [
"print(title[1], '\\n')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"BeautifulSoup.select()의 return type은 bs4에서 만들어둔 클래스입니다. "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'bs4.element.Tag'>\n"
]
}
],
"source": [
"print(type(title[0]))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"bs4.element.Tag 안에는 HTML tag의 attribute 종류나 값과 같은 태그 정보를 가져오거나 텍스트 부분을 가져올 수 있는 기능이 있습니다. 영화 제목 La La Land, 2016은 텍스트 부분에 있으니 이를 가져오겠습니다. "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'La La Land\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t, \\r\\n\\t\\t\\t\\t\\t2016'"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"title[0].text"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\\r\\n 과 같은 줄바꿈 기호나 \\t과 같은 탭, 띄어쓰기 때문에 텍스트가 깔끔해 보이지 않습니다. 이를 제거하여 깔끔한 영화 제목을 가져옵니다. "
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'La La Land, 2016'"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"title[0].text.replace(\"\\t\", '').replace('\\r', '').replace('\\n', '')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"비슷하게 한국어 영화 제목도 가져와봅니다. "
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'라라랜드'"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"title = page.select('div[class=mv_info] h3[class=h_movie] a')\n",
"title[0].text"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"네이버 영화 페이지는 모든 영화에 대하여 각 영화에 해당하는 페이지의 내용만 바뀌며, 그 형식은 일정합니다. 즉 템플릿이 존재하는 웹페이지에서 스크래핑을 할 때는 해당 웹페이지들의 구조를 파악하면 됩니다. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## try - except를 통한 에러 방지\n",
"\n",
"for loop을 돌면서 여러 영화의 메타 정보를 가져오겠습니다. 그런데 중간에 Exception이 날 수 있습니다. 인터넷이 끊길 수도 있고, 형식이 잘 맞지 않는 HTML이 있을 수도 있습니다. 이 때 한 번 오류가 나면 프로그램이 멈출텐데, 오류가 나는 영화는 건너띄고 다음 영화의 정보를 얻어오고 싶다면 try - except 구문을 이용하면 됩니다\n",
"\n",
"아래의 코드는 i가 3일때 3앞에 a라는 문자를 붙여서 출력하는 코드입니다. 그리고 그 아래 코드는 i가 3일때 a를 붙인 뒤, j를 다시 integer로 casting하는 코드입니다. 그렇다면 i=3 일 때에는 a3을 인티저로 캐스팅 하지 못하여 오류가 납니다. 그리고 그 다음 i=4 일때는 실행이 되지 않습니다."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"a3\n",
"4\n"
]
}
],
"source": [
"for i in range(5): \n",
" \n",
" s = str(i) if i != 3 else 'a%d' % i\n",
" print(s)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"s = 0, j = 0\n",
"s = 1, j = 1\n",
"s = 2, j = 2\n"
]
},
{
"ename": "ValueError",
"evalue": "invalid literal for int() with base 10: 'a3'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-14-3b7fb2ffe570>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0ms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mi\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;36m3\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0;34m'a%d'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m's = %s, j = %d'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: 'a3'"
]
}
],
"source": [
"for i in range(5): \n",
" \n",
" s = str(i) if i != 3 else 'a%d' % i \n",
" j = int(s)\n",
" \n",
" print('s = %s, j = %d' % (s, j))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"오류가 날 수 있는 부분을 try - except로 감싸면 오류가 난 경우 print(e)에 의하여 오류 형태를 출력해주고 다음 for loop (i=4) 일때로 넘어가게 됩니다. Exception을 e라는 이름으로 받은 뒤 except 안에서 출력하면 해당 예외가 무엇이었는지 알 수 있습니다"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"s = 0, j = 0\n",
"s = 1, j = 1\n",
"s = 2, j = 2\n",
"invalid literal for int() with base 10: 'a3'\n",
"s = 4, j = 4\n"
]
}
],
"source": [
"errors = []\n",
"\n",
"for i in range(5): \n",
" try:\n",
" s = str(i) if i != 3 else 'a%d' % i \n",
" j = int(s)\n",
"\n",
" print('s = %s, j = %d' % (s, j))\n",
" except Exception as e:\n",
" print(e)\n",
" continue"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 여러 영화에 대하여 영화마다 제목 가져오기"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"기능별로 함수화를 하면 코드가 가독성이 좋아집니다"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"def get_soup(url):\n",
" try:\n",
" r = requests.get(url).text\n",
" return BeautifulSoup(r, 'lxml')\n",
" except Exception as e:\n",
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
" traceback_details = {\n",
" 'filename': exc_traceback.tb_frame.f_code.co_filename,\n",
" 'lineno' : exc_traceback.tb_lineno,\n",
" 'name' : exc_traceback.tb_frame.f_code.co_name,\n",
" 'type' : exc_type.__name__,\n",
" 'message' : str(e)\n",
" }\n",
" pprint(traceback_details)\n",
" return ''\n",
"\n",
"def _parse_title(page):\n",
" try: \n",
" return page.select('div[class=mv_info] h3[class=h_movie] a')[0].text.strip()\n",
" except:\n",
" return ''"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"range는 range(b, e)에 대하여 b부터 e까지의 숫자를 1씩 증가시키며 yield (return과 비슷) 합니다. "
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"134960: 그놈이다\n",
"134961: 어 라 말라\n",
"134962: 아이\n",
"134963: 라라랜드\n",
"134964: 콜 포 헬프\n"
]
}
],
"source": [
"for movie_id in range(134960, 134965):\n",
" url = url_basic_base % movie_id\n",
" page = get_soup(url)\n",
" title = _parse_title(page)\n",
" print('%d: %s' % (movie_id, title))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"range(b, e, s)를 하면 b 부터 e 까지 s 간격으로 출력됩니다"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 3, 5]"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"list(range(1, 6, 2))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Packing\n",
"\n",
"코드를 짤 때, 기능별로 함수를 나눠서 적어두면 좋습니다. parse_basic_page라는 함수를 보면, 제목을 가져오는 부분, 장르를 가져오는 부분 등을 나눠서 적어두었습니다. 가독성을 높여주며, 코드에 오류가 있을 때 수정하기가 용이해집니다"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"# Basic pages\n",
"def get_basic_page(movie_id):\n",
" url = url_basic_base % movie_id\n",
" return get_soup(url)\n",
"\n",
"def parse_basic_page(page):\n",
" movie = {}\n",
"\n",
" score = _parse_main_score(page)\n",
" movie['expert_score'] = score[0]\n",
" movie['netizen_score'] = score[1]\n",
"\n",
" movie['title'] = _parse_title(page)\n",
" movie['e_title'] = _parse_e_title(page)\n",
"\n",
" try:\n",
" basic_inf = page.select('dl[class=info_spec]')[0]\n",
" movie['genres'] = _parse_genres(page)\n",
" movie['countries'] = _parse_countries(page)\n",
" movie['running_time'] = _parse_running_time(page)\n",
" movie['open_dates'] = _parse_open_date(page)\n",
" movie['grade'] = _parse_grade(page)\n",
" return movie\n",
" except Exception as e:\n",
" exc_type, exc_value, exc_traceback = sys.exc_info()\n",
" traceback_details = {\n",
" 'filename': exc_traceback.tb_frame.f_code.co_filename,\n",
" 'lineno' : exc_traceback.tb_lineno,\n",
" 'name' : exc_traceback.tb_frame.f_code.co_name,\n",
" 'type' : exc_type.__name__,\n",
" 'message' : str(e)\n",
" }\n",
" return movie\n",
" \n",
"def _parse_title(page):\n",
" try: \n",
" return page.select('div[class=mv_info] h3[class=h_movie] a')[0].text.strip()\n",
" except:\n",
" return ''\n",
"\n",
"def _parse_e_title(page):\n",
" try:\n",
" return page.select('div[class=mv_info] strong[class=h_movie2]')[0].text.replace('\\r', '').replace('\\t', '').replace('\\n', '').strip()\n",
" except:\n",
" return ''\n",
"\n",
"def _parse_genres(page):\n",
" genres = page.select('a[href^=/movie/sdb/browsing/bmovie.nhn?genre=]')\n",
" return list({genre.text for genre in genres})\n",
" \n",
"def _parse_countries(page):\n",
" countries = page.select('a[href^=/movie/sdb/browsing/bmovie.nhn?nation=]')\n",
" return list({country.text for country in countries})\n",
" \n",
"def _parse_running_time(page):\n",
" running_time = 0\n",
" try:\n",
" running_time = re.search(r\"\\d+분\", page.text).group()[:-1]\n",
" except:\n",
" running_time = 0\n",
" return running_time\n",
"\n",
"def _parse_open_date(page):\n",
" return list({d for d in re.findall(r\"\\d+\\.\\d+\\.\\d+ 재*개봉\", page.text)})\n",
"\n",
"def _parse_grade(page):\n",
" try:\n",
" return page.select('a[href^=/movie/sdb/browsing/bmovie.nhn?grade]')[0].text\n",
" except:\n",
" return ''\n",
"\n",
"def _parse_main_score(page):\n",
" try:\n",
" main_score = page.select('div[class=main_score]')[0]\n",
" expert_score = main_score.select('div[class=spc_score_area] div[class=star_score]')[0].text.replace('\\n','')\n",
" netizen_score = main_score.select('div[class=score] div[class=star_score] span[class=st_off]')[0].text.replace('관람객 평점 ', '').replace('점', '')\n",
" return expert_score, netizen_score\n",
" except Exception as e:\n",
" # print('error from _parse_main_score', e)\n",
" return -1, -1"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'expert_score': '8.34',\n",
" 'netizen_score': '8.90',\n",
" 'title': '라라랜드',\n",
" 'e_title': 'La La Land, 2016',\n",
" 'genres': ['멜로/로맨스', '뮤지컬', '드라마'],\n",
" 'countries': ['미국'],\n",
" 'running_time': '127',\n",
" 'open_dates': [],\n",
" 'grade': '12세 관람가'}"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"movie_id = 134963\n",
"url = url_basic_base % movie_id\n",
"page = get_soup(url)\n",
"parse_basic_page(page)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"하지만 이런 작업들은 네이버 영화 서버의 입장에서는 디도스 공격과 다르지 않습니다. 알지 못하는 컴퓨터에서 비정상적으로 많은 requests를 요청하는 것이기 때문입니다. 가끔씩 어떤 서버들은 이러한 스크래핑 작업을 공격으로 오인하여 아이피를 차단하기도 합니다. 이를 막기 위해서는 적당히 쉬엄쉬엄 크롤링을 하는게 좋습니다. for loop을 돌면서 프로그램을 원하는 만큼 쉴 수 있습니다. 아래 코드는 for loop을 돌며 한 번 숫자를 출력한 뒤, 1.0초를 쉬어주는 것입니다. 영화 제목을 긁을 때에도 영화마다 어느 정도 시간을 주며 쉬어주는 것 (sleep)이 좋습니다."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"3\n",
"4\n",
"134960: 그놈이다\n",
"134961: 어 라 말라\n",
"134962: 아이\n",
"134963: 라라랜드\n",
"134964: 콜 포 헬프\n"
]
}
],
"source": [
"import time\n",
"\n",
"for i in range(5):\n",
" print(i)\n",
" time.sleep(1.0)\n",
" \n",
"for movie_id in range(134960, 134965):\n",
" url = url_basic_base % movie_id\n",
" page = get_soup(url)\n",
" title = _parse_title(page)\n",
" print('%d: %s' % (movie_id, title))\n",
" time.sleep(1.0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## User agent 설정"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"또한 네이버 영화 서버의 입장에서, 위의 코든느 자신의 정보를 제공하지 않은 체, 무명으로 접근하는 프로그램으로 인식할 수 있습니다. 어떤 서버들은 (예, IMDB) 이러한 요청에 대해서는 답변을 주지 않습니다. 이를 해결하기 위하여 requests를 보낼 때, 자신이 누구인지에 대한 정보를 넣어주면 좋습니다. user-agent를 header에 넣어서 requests를 보낼 수 있습니다. \n",
"\n",
" headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}\n",
"\n",
" response = requests.get(url, headers=headers)\n",
"\n",
"위와 같이 requests.get을 할 때, headers에 자신에 대한 정보를 적어주면 좋습니다. 어떤 user-agent를 적어야 하는지는 구글에 python requests user agent라는 제목으로 검색을 해보시면 많은 종류가 나올 겁니다. \n",
"\n",
"아래는 참고한 stackoverflow 주소입니다. fake_useragent라는 라이브러리도 있다고 합니다.\n",
"\n",
"http://stackoverflow.com/questions/27652543/how-to-use-python-requests-to-fake-a-browser-visit"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 파일 다운로드\n",
"\n",
"파이썬에서도 음악/사진 파일들을 다운로드 받을 수 있습니다. 다운로드라는 것도 서버와 내 컴퓨터 간의 통로를 열어두고, 전송이 되는 byte 정보들을 모아서 다시 음악, 사진 포멧으로 읽는 것입니다. 물론 스트리밍 서비스들은 temporal하게 내 컴퓨터에 데이터가 쌓이지 않게 막을 수도 있습니다. 그런 종류가 아니라, \\<a>라는 태그로 링크가 걸려있는 이미지 파일들을 다운로드 해보겠습니다. \n",
"\n",
"아래 코드는 urllib.request.urlopen을 통하여 서버와 내 컴퓨터 간의 통신 통로를 열어둡니다. while loop 안에서 열려진 통로에서 100000000 byte만큼의 정보를 가져와 buffer에 넣습니다. 그리고 이 정보를 미리 열어둔 downloaded_file이라는 파일에 적습니다. 주고 받은 정보가 텍스트가 아니라 바이트이기 때문에 'wb'로 파일을 열어둡니다. 다운로드가 모두 끝나면 열어둔 통신 서버를 닫고\n",
" \n",
" opened.close()\n",
" \n",
"열어둔 파일도 닫습니다. \n",
"\n",
" downloaded_file.close()\n",
" \n",
"다운로드가 성공적으로 되었다면 True가, 실패했다면 False가 return 되도록 try - except로 이 코드 부분을 감싸줍니다"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"import urllib\n",
"\n",
"def download_image(url, fname):\n",
" try:\n",
" downloaded_file = open(fname, \"wb\")\n",
" opened = urllib.request.urlopen(url)\n",
" while True:\n",
" buffer = opened.read(100000000)\n",
" if len(buffer) == 0:\n",
" break\n",
" downloaded_file.write(buffer)\n",
" downloaded_file.close()\n",
" opened.close()\n",
" return True\n",
" except:\n",
" return False\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"만든 함수로 google logo를 다운로드 받아봅니다. "
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"download_image('https://www.google.co.kr/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', 'google_logo.png')"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"다운로드한 이미지는 아래와 같습니다. \n",
"\n",
""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
| {
"pile_set_name": "Github"
} |
namespace UnityEditor.DelightingInternal
{
class DelightingTexturePostProcessor : AssetPostprocessor
{
void OnPreprocessTexture()
{
TextureImporter textureImporter = (TextureImporter)assetImporter;
// Game Assets --------------------------------------------------------------------
if (DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsBaseTextureSuffix))
{
textureImporter.textureType = TextureImporterType.Default;
textureImporter.sRGBTexture = true;
textureImporter.textureCompression = TextureImporterCompression.Uncompressed;
textureImporter.maxTextureSize = 8192;
}
else if (DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsMaskTextureSuffix)
|| DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsPositionsTextureSuffix)
|| DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsAmbientOcclusionTextureSuffix)
|| DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsNormalsTextureSuffix)
|| DelightingHelpers.IsPathSuffixed(assetPath, DelightingToolWindow.prefsBentNormalsTextureSuffix))
{
textureImporter.textureType = TextureImporterType.Default;
textureImporter.sRGBTexture = false;
textureImporter.textureCompression = TextureImporterCompression.Uncompressed;
textureImporter.maxTextureSize = 8192;
}
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright © 2014 Steve Francia <[email protected]>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package cast
import (
"encoding/json"
"errors"
"fmt"
"html/template"
"reflect"
"strconv"
"strings"
"time"
)
var errNegativeNotAllowed = errors.New("unable to cast negative value")
// ToTimeE casts an interface to a time.Time type.
func ToTimeE(i interface{}) (tim time.Time, err error) {
i = indirect(i)
switch v := i.(type) {
case time.Time:
return v, nil
case string:
return StringToDate(v)
case int:
return time.Unix(int64(v), 0), nil
case int64:
return time.Unix(v, 0), nil
case int32:
return time.Unix(int64(v), 0), nil
case uint:
return time.Unix(int64(v), 0), nil
case uint64:
return time.Unix(int64(v), 0), nil
case uint32:
return time.Unix(int64(v), 0), nil
default:
return time.Time{}, fmt.Errorf("unable to cast %#v of type %T to Time", i, i)
}
}
// ToDurationE casts an interface to a time.Duration type.
func ToDurationE(i interface{}) (d time.Duration, err error) {
i = indirect(i)
switch s := i.(type) {
case time.Duration:
return s, nil
case int, int64, int32, int16, int8, uint, uint64, uint32, uint16, uint8:
d = time.Duration(ToInt64(s))
return
case float32, float64:
d = time.Duration(ToFloat64(s))
return
case string:
if strings.ContainsAny(s, "nsuµmh") {
d, err = time.ParseDuration(s)
} else {
d, err = time.ParseDuration(s + "ns")
}
return
default:
err = fmt.Errorf("unable to cast %#v of type %T to Duration", i, i)
return
}
}
// ToBoolE casts an interface to a bool type.
func ToBoolE(i interface{}) (bool, error) {
i = indirect(i)
switch b := i.(type) {
case bool:
return b, nil
case nil:
return false, nil
case int:
if i.(int) != 0 {
return true, nil
}
return false, nil
case string:
return strconv.ParseBool(i.(string))
default:
return false, fmt.Errorf("unable to cast %#v of type %T to bool", i, i)
}
}
// ToFloat64E casts an interface to a float64 type.
func ToFloat64E(i interface{}) (float64, error) {
i = indirect(i)
switch s := i.(type) {
case float64:
return s, nil
case float32:
return float64(s), nil
case int:
return float64(s), nil
case int64:
return float64(s), nil
case int32:
return float64(s), nil
case int16:
return float64(s), nil
case int8:
return float64(s), nil
case uint:
return float64(s), nil
case uint64:
return float64(s), nil
case uint32:
return float64(s), nil
case uint16:
return float64(s), nil
case uint8:
return float64(s), nil
case string:
v, err := strconv.ParseFloat(s, 64)
if err == nil {
return v, nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to float64", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to float64", i, i)
}
}
// ToFloat32E casts an interface to a float32 type.
func ToFloat32E(i interface{}) (float32, error) {
i = indirect(i)
switch s := i.(type) {
case float64:
return float32(s), nil
case float32:
return s, nil
case int:
return float32(s), nil
case int64:
return float32(s), nil
case int32:
return float32(s), nil
case int16:
return float32(s), nil
case int8:
return float32(s), nil
case uint:
return float32(s), nil
case uint64:
return float32(s), nil
case uint32:
return float32(s), nil
case uint16:
return float32(s), nil
case uint8:
return float32(s), nil
case string:
v, err := strconv.ParseFloat(s, 32)
if err == nil {
return float32(v), nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to float32", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to float32", i, i)
}
}
// ToInt64E casts an interface to an int64 type.
func ToInt64E(i interface{}) (int64, error) {
i = indirect(i)
switch s := i.(type) {
case int:
return int64(s), nil
case int64:
return s, nil
case int32:
return int64(s), nil
case int16:
return int64(s), nil
case int8:
return int64(s), nil
case uint:
return int64(s), nil
case uint64:
return int64(s), nil
case uint32:
return int64(s), nil
case uint16:
return int64(s), nil
case uint8:
return int64(s), nil
case float64:
return int64(s), nil
case float32:
return int64(s), nil
case string:
v, err := strconv.ParseInt(s, 0, 0)
if err == nil {
return v, nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to int64", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to int64", i, i)
}
}
// ToInt32E casts an interface to an int32 type.
func ToInt32E(i interface{}) (int32, error) {
i = indirect(i)
switch s := i.(type) {
case int:
return int32(s), nil
case int64:
return int32(s), nil
case int32:
return s, nil
case int16:
return int32(s), nil
case int8:
return int32(s), nil
case uint:
return int32(s), nil
case uint64:
return int32(s), nil
case uint32:
return int32(s), nil
case uint16:
return int32(s), nil
case uint8:
return int32(s), nil
case float64:
return int32(s), nil
case float32:
return int32(s), nil
case string:
v, err := strconv.ParseInt(s, 0, 0)
if err == nil {
return int32(v), nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to int32", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to int32", i, i)
}
}
// ToInt16E casts an interface to an int16 type.
func ToInt16E(i interface{}) (int16, error) {
i = indirect(i)
switch s := i.(type) {
case int:
return int16(s), nil
case int64:
return int16(s), nil
case int32:
return int16(s), nil
case int16:
return s, nil
case int8:
return int16(s), nil
case uint:
return int16(s), nil
case uint64:
return int16(s), nil
case uint32:
return int16(s), nil
case uint16:
return int16(s), nil
case uint8:
return int16(s), nil
case float64:
return int16(s), nil
case float32:
return int16(s), nil
case string:
v, err := strconv.ParseInt(s, 0, 0)
if err == nil {
return int16(v), nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to int16", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to int16", i, i)
}
}
// ToInt8E casts an interface to an int8 type.
func ToInt8E(i interface{}) (int8, error) {
i = indirect(i)
switch s := i.(type) {
case int:
return int8(s), nil
case int64:
return int8(s), nil
case int32:
return int8(s), nil
case int16:
return int8(s), nil
case int8:
return s, nil
case uint:
return int8(s), nil
case uint64:
return int8(s), nil
case uint32:
return int8(s), nil
case uint16:
return int8(s), nil
case uint8:
return int8(s), nil
case float64:
return int8(s), nil
case float32:
return int8(s), nil
case string:
v, err := strconv.ParseInt(s, 0, 0)
if err == nil {
return int8(v), nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to int8", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to int8", i, i)
}
}
// ToIntE casts an interface to an int type.
func ToIntE(i interface{}) (int, error) {
i = indirect(i)
switch s := i.(type) {
case int:
return s, nil
case int64:
return int(s), nil
case int32:
return int(s), nil
case int16:
return int(s), nil
case int8:
return int(s), nil
case uint:
return int(s), nil
case uint64:
return int(s), nil
case uint32:
return int(s), nil
case uint16:
return int(s), nil
case uint8:
return int(s), nil
case float64:
return int(s), nil
case float32:
return int(s), nil
case string:
v, err := strconv.ParseInt(s, 0, 0)
if err == nil {
return int(v), nil
}
return 0, fmt.Errorf("unable to cast %#v of type %T to int", i, i)
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to int", i, i)
}
}
// ToUintE casts an interface to a uint type.
func ToUintE(i interface{}) (uint, error) {
i = indirect(i)
switch s := i.(type) {
case string:
v, err := strconv.ParseUint(s, 0, 0)
if err == nil {
return uint(v), nil
}
return 0, fmt.Errorf("unable to cast %#v to uint: %s", i, err)
case int:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case int64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case int32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case int16:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case int8:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case uint:
return s, nil
case uint64:
return uint(s), nil
case uint32:
return uint(s), nil
case uint16:
return uint(s), nil
case uint8:
return uint(s), nil
case float64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case float32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint(s), nil
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to uint", i, i)
}
}
// ToUint64E casts an interface to a uint64 type.
func ToUint64E(i interface{}) (uint64, error) {
i = indirect(i)
switch s := i.(type) {
case string:
v, err := strconv.ParseUint(s, 0, 64)
if err == nil {
return v, nil
}
return 0, fmt.Errorf("unable to cast %#v to uint64: %s", i, err)
case int:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case int64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case int32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case int16:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case int8:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case uint:
return uint64(s), nil
case uint64:
return s, nil
case uint32:
return uint64(s), nil
case uint16:
return uint64(s), nil
case uint8:
return uint64(s), nil
case float32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case float64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint64(s), nil
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to uint64", i, i)
}
}
// ToUint32E casts an interface to a uint32 type.
func ToUint32E(i interface{}) (uint32, error) {
i = indirect(i)
switch s := i.(type) {
case string:
v, err := strconv.ParseUint(s, 0, 32)
if err == nil {
return uint32(v), nil
}
return 0, fmt.Errorf("unable to cast %#v to uint32: %s", i, err)
case int:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case int64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case int32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case int16:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case int8:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case uint:
return uint32(s), nil
case uint64:
return uint32(s), nil
case uint32:
return s, nil
case uint16:
return uint32(s), nil
case uint8:
return uint32(s), nil
case float64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case float32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint32(s), nil
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to uint32", i, i)
}
}
// ToUint16E casts an interface to a uint16 type.
func ToUint16E(i interface{}) (uint16, error) {
i = indirect(i)
switch s := i.(type) {
case string:
v, err := strconv.ParseUint(s, 0, 16)
if err == nil {
return uint16(v), nil
}
return 0, fmt.Errorf("unable to cast %#v to uint16: %s", i, err)
case int:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case int64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case int32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case int16:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case int8:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case uint:
return uint16(s), nil
case uint64:
return uint16(s), nil
case uint32:
return uint16(s), nil
case uint16:
return s, nil
case uint8:
return uint16(s), nil
case float64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case float32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint16(s), nil
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to uint16", i, i)
}
}
// ToUint8E casts an interface to a uint type.
func ToUint8E(i interface{}) (uint8, error) {
i = indirect(i)
switch s := i.(type) {
case string:
v, err := strconv.ParseUint(s, 0, 8)
if err == nil {
return uint8(v), nil
}
return 0, fmt.Errorf("unable to cast %#v to uint8: %s", i, err)
case int:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case int64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case int32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case int16:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case int8:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case uint:
return uint8(s), nil
case uint64:
return uint8(s), nil
case uint32:
return uint8(s), nil
case uint16:
return uint8(s), nil
case uint8:
return s, nil
case float64:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case float32:
if s < 0 {
return 0, errNegativeNotAllowed
}
return uint8(s), nil
case bool:
if s {
return 1, nil
}
return 0, nil
case nil:
return 0, nil
default:
return 0, fmt.Errorf("unable to cast %#v of type %T to uint8", i, i)
}
}
// From html/template/content.go
// Copyright 2011 The Go Authors. All rights reserved.
// indirect returns the value, after dereferencing as many times
// as necessary to reach the base type (or nil).
func indirect(a interface{}) interface{} {
if a == nil {
return nil
}
if t := reflect.TypeOf(a); t.Kind() != reflect.Ptr {
// Avoid creating a reflect.Value if it's not a pointer.
return a
}
v := reflect.ValueOf(a)
for v.Kind() == reflect.Ptr && !v.IsNil() {
v = v.Elem()
}
return v.Interface()
}
// From html/template/content.go
// Copyright 2011 The Go Authors. All rights reserved.
// indirectToStringerOrError returns the value, after dereferencing as many times
// as necessary to reach the base type (or nil) or an implementation of fmt.Stringer
// or error,
func indirectToStringerOrError(a interface{}) interface{} {
if a == nil {
return nil
}
var errorType = reflect.TypeOf((*error)(nil)).Elem()
var fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
v := reflect.ValueOf(a)
for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() {
v = v.Elem()
}
return v.Interface()
}
// ToStringE casts an interface to a string type.
func ToStringE(i interface{}) (string, error) {
i = indirectToStringerOrError(i)
switch s := i.(type) {
case string:
return s, nil
case bool:
return strconv.FormatBool(s), nil
case float64:
return strconv.FormatFloat(s, 'f', -1, 64), nil
case float32:
return strconv.FormatFloat(float64(s), 'f', -1, 32), nil
case int:
return strconv.Itoa(s), nil
case int64:
return strconv.FormatInt(s, 10), nil
case int32:
return strconv.Itoa(int(s)), nil
case int16:
return strconv.FormatInt(int64(s), 10), nil
case int8:
return strconv.FormatInt(int64(s), 10), nil
case uint:
return strconv.FormatInt(int64(s), 10), nil
case uint64:
return strconv.FormatInt(int64(s), 10), nil
case uint32:
return strconv.FormatInt(int64(s), 10), nil
case uint16:
return strconv.FormatInt(int64(s), 10), nil
case uint8:
return strconv.FormatInt(int64(s), 10), nil
case []byte:
return string(s), nil
case template.HTML:
return string(s), nil
case template.URL:
return string(s), nil
case template.JS:
return string(s), nil
case template.CSS:
return string(s), nil
case template.HTMLAttr:
return string(s), nil
case nil:
return "", nil
case fmt.Stringer:
return s.String(), nil
case error:
return s.Error(), nil
default:
return "", fmt.Errorf("unable to cast %#v of type %T to string", i, i)
}
}
// ToStringMapStringE casts an interface to a map[string]string type.
func ToStringMapStringE(i interface{}) (map[string]string, error) {
var m = map[string]string{}
switch v := i.(type) {
case map[string]string:
return v, nil
case map[string]interface{}:
for k, val := range v {
m[ToString(k)] = ToString(val)
}
return m, nil
case map[interface{}]string:
for k, val := range v {
m[ToString(k)] = ToString(val)
}
return m, nil
case map[interface{}]interface{}:
for k, val := range v {
m[ToString(k)] = ToString(val)
}
return m, nil
case string:
err := jsonStringToObject(v, &m)
return m, err
default:
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]string", i, i)
}
}
// ToStringMapStringSliceE casts an interface to a map[string][]string type.
func ToStringMapStringSliceE(i interface{}) (map[string][]string, error) {
var m = map[string][]string{}
switch v := i.(type) {
case map[string][]string:
return v, nil
case map[string][]interface{}:
for k, val := range v {
m[ToString(k)] = ToStringSlice(val)
}
return m, nil
case map[string]string:
for k, val := range v {
m[ToString(k)] = []string{val}
}
case map[string]interface{}:
for k, val := range v {
switch vt := val.(type) {
case []interface{}:
m[ToString(k)] = ToStringSlice(vt)
case []string:
m[ToString(k)] = vt
default:
m[ToString(k)] = []string{ToString(val)}
}
}
return m, nil
case map[interface{}][]string:
for k, val := range v {
m[ToString(k)] = ToStringSlice(val)
}
return m, nil
case map[interface{}]string:
for k, val := range v {
m[ToString(k)] = ToStringSlice(val)
}
return m, nil
case map[interface{}][]interface{}:
for k, val := range v {
m[ToString(k)] = ToStringSlice(val)
}
return m, nil
case map[interface{}]interface{}:
for k, val := range v {
key, err := ToStringE(k)
if err != nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i)
}
value, err := ToStringSliceE(val)
if err != nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i)
}
m[key] = value
}
case string:
err := jsonStringToObject(v, &m)
return m, err
default:
return m, fmt.Errorf("unable to cast %#v of type %T to map[string][]string", i, i)
}
return m, nil
}
// ToStringMapBoolE casts an interface to a map[string]bool type.
func ToStringMapBoolE(i interface{}) (map[string]bool, error) {
var m = map[string]bool{}
switch v := i.(type) {
case map[interface{}]interface{}:
for k, val := range v {
m[ToString(k)] = ToBool(val)
}
return m, nil
case map[string]interface{}:
for k, val := range v {
m[ToString(k)] = ToBool(val)
}
return m, nil
case map[string]bool:
return v, nil
case string:
err := jsonStringToObject(v, &m)
return m, err
default:
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]bool", i, i)
}
}
// ToStringMapE casts an interface to a map[string]interface{} type.
func ToStringMapE(i interface{}) (map[string]interface{}, error) {
var m = map[string]interface{}{}
switch v := i.(type) {
case map[interface{}]interface{}:
for k, val := range v {
m[ToString(k)] = val
}
return m, nil
case map[string]interface{}:
return v, nil
case string:
err := jsonStringToObject(v, &m)
return m, err
default:
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]interface{}", i, i)
}
}
// ToStringMapIntE casts an interface to a map[string]int{} type.
func ToStringMapIntE(i interface{}) (map[string]int, error) {
var m = map[string]int{}
if i == nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int", i, i)
}
switch v := i.(type) {
case map[interface{}]interface{}:
for k, val := range v {
m[ToString(k)] = ToInt(val)
}
return m, nil
case map[string]interface{}:
for k, val := range v {
m[k] = ToInt(val)
}
return m, nil
case map[string]int:
return v, nil
case string:
err := jsonStringToObject(v, &m)
return m, err
}
if reflect.TypeOf(i).Kind() != reflect.Map {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int", i, i)
}
mVal := reflect.ValueOf(m)
v := reflect.ValueOf(i)
for _, keyVal := range v.MapKeys() {
val, err := ToIntE(v.MapIndex(keyVal).Interface())
if err != nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int", i, i)
}
mVal.SetMapIndex(keyVal, reflect.ValueOf(val))
}
return m, nil
}
// ToStringMapInt64E casts an interface to a map[string]int64{} type.
func ToStringMapInt64E(i interface{}) (map[string]int64, error) {
var m = map[string]int64{}
if i == nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int64", i, i)
}
switch v := i.(type) {
case map[interface{}]interface{}:
for k, val := range v {
m[ToString(k)] = ToInt64(val)
}
return m, nil
case map[string]interface{}:
for k, val := range v {
m[k] = ToInt64(val)
}
return m, nil
case map[string]int64:
return v, nil
case string:
err := jsonStringToObject(v, &m)
return m, err
}
if reflect.TypeOf(i).Kind() != reflect.Map {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int64", i, i)
}
mVal := reflect.ValueOf(m)
v := reflect.ValueOf(i)
for _, keyVal := range v.MapKeys() {
val, err := ToInt64E(v.MapIndex(keyVal).Interface())
if err != nil {
return m, fmt.Errorf("unable to cast %#v of type %T to map[string]int64", i, i)
}
mVal.SetMapIndex(keyVal, reflect.ValueOf(val))
}
return m, nil
}
// ToSliceE casts an interface to a []interface{} type.
func ToSliceE(i interface{}) ([]interface{}, error) {
var s []interface{}
switch v := i.(type) {
case []interface{}:
return append(s, v...), nil
case []map[string]interface{}:
for _, u := range v {
s = append(s, u)
}
return s, nil
default:
return s, fmt.Errorf("unable to cast %#v of type %T to []interface{}", i, i)
}
}
// ToBoolSliceE casts an interface to a []bool type.
func ToBoolSliceE(i interface{}) ([]bool, error) {
if i == nil {
return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i)
}
switch v := i.(type) {
case []bool:
return v, nil
}
kind := reflect.TypeOf(i).Kind()
switch kind {
case reflect.Slice, reflect.Array:
s := reflect.ValueOf(i)
a := make([]bool, s.Len())
for j := 0; j < s.Len(); j++ {
val, err := ToBoolE(s.Index(j).Interface())
if err != nil {
return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i)
}
a[j] = val
}
return a, nil
default:
return []bool{}, fmt.Errorf("unable to cast %#v of type %T to []bool", i, i)
}
}
// ToStringSliceE casts an interface to a []string type.
func ToStringSliceE(i interface{}) ([]string, error) {
var a []string
switch v := i.(type) {
case []interface{}:
for _, u := range v {
a = append(a, ToString(u))
}
return a, nil
case []string:
return v, nil
case string:
return strings.Fields(v), nil
case interface{}:
str, err := ToStringE(v)
if err != nil {
return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i)
}
return []string{str}, nil
default:
return a, fmt.Errorf("unable to cast %#v of type %T to []string", i, i)
}
}
// ToIntSliceE casts an interface to a []int type.
func ToIntSliceE(i interface{}) ([]int, error) {
if i == nil {
return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i)
}
switch v := i.(type) {
case []int:
return v, nil
}
kind := reflect.TypeOf(i).Kind()
switch kind {
case reflect.Slice, reflect.Array:
s := reflect.ValueOf(i)
a := make([]int, s.Len())
for j := 0; j < s.Len(); j++ {
val, err := ToIntE(s.Index(j).Interface())
if err != nil {
return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i)
}
a[j] = val
}
return a, nil
default:
return []int{}, fmt.Errorf("unable to cast %#v of type %T to []int", i, i)
}
}
// ToDurationSliceE casts an interface to a []time.Duration type.
func ToDurationSliceE(i interface{}) ([]time.Duration, error) {
if i == nil {
return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i)
}
switch v := i.(type) {
case []time.Duration:
return v, nil
}
kind := reflect.TypeOf(i).Kind()
switch kind {
case reflect.Slice, reflect.Array:
s := reflect.ValueOf(i)
a := make([]time.Duration, s.Len())
for j := 0; j < s.Len(); j++ {
val, err := ToDurationE(s.Index(j).Interface())
if err != nil {
return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i)
}
a[j] = val
}
return a, nil
default:
return []time.Duration{}, fmt.Errorf("unable to cast %#v of type %T to []time.Duration", i, i)
}
}
// StringToDate attempts to parse a string into a time.Time type using a
// predefined list of formats. If no suitable format is found, an error is
// returned.
func StringToDate(s string) (time.Time, error) {
return parseDateWith(s, []string{
time.RFC3339,
"2006-01-02T15:04:05", // iso8601 without timezone
time.RFC1123Z,
time.RFC1123,
time.RFC822Z,
time.RFC822,
time.RFC850,
time.ANSIC,
time.UnixDate,
time.RubyDate,
"2006-01-02 15:04:05.999999999 -0700 MST", // Time.String()
"2006-01-02",
"02 Jan 2006",
"2006-01-02T15:04:05-0700", // RFC3339 without timezone hh:mm colon
"2006-01-02 15:04:05 -07:00",
"2006-01-02 15:04:05 -0700",
"2006-01-02 15:04:05Z07:00", // RFC3339 without T
"2006-01-02 15:04:05Z0700", // RFC3339 without T or timezone hh:mm colon
"2006-01-02 15:04:05",
time.Kitchen,
time.Stamp,
time.StampMilli,
time.StampMicro,
time.StampNano,
})
}
func parseDateWith(s string, dates []string) (d time.Time, e error) {
for _, dateType := range dates {
if d, e = time.Parse(dateType, s); e == nil {
return
}
}
return d, fmt.Errorf("unable to parse date: %s", s)
}
// jsonStringToObject attempts to unmarshall a string as JSON into
// the object passed as pointer.
func jsonStringToObject(s string, v interface{}) error {
data := []byte(s)
return json.Unmarshal(data, v)
}
| {
"pile_set_name": "Github"
} |
Oracle EF Core Database Provider isn't supported officially yet. For more info see:
https://docs.microsoft.com/en-us/ef/core/providers/oracle/
There is a third-party provider; Devart EF Core Database Providers. This is a paid product and there are some [limitations](http://blog.devart.com/entity-framework-core-1-entity-framework-7-support.html#limitations).
When the Oracle EF Core Database Provider is released, a relevant document will be published here.
| {
"pile_set_name": "Github"
} |
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
Notes:
* Since Node.js >= 4,
[`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
now offers the same functionality natively (but without the "deep copy" option).
See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6).
* Some native implementations of `Object.assign` in both Node.js and many
browsers (since NPM modules are for the browser too) may not be fully
spec-compliant.
Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for
a compliant candidate.
## Installation
This package is available on [npm][npm-url] as: `extend`
``` sh
npm install extend
```
## Usage
**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
*Extend one object with one or more others, returning the modified object.*
**Example:**
``` js
var extend = require('extend');
extend(targetObject, object1, object2);
```
Keep in mind that the target object will be modified, and will be returned from extend().
If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).
Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
Warning: passing `false` as the first argument is not supported.
### Arguments
* `deep` *Boolean* (optional)
If set, the merge becomes recursive (i.e. deep copy).
* `target` *Object*
The object to extend.
* `object1` *Object*
The object that will be merged into the first.
* `objectN` *Object* (Optional)
More objects to merge into the first.
## License
`node-extend` is licensed under the [MIT License][mit-license-url].
## Acknowledgements
All credit to the jQuery authors for perfecting this amazing utility.
Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
[travis-url]: https://travis-ci.org/justmoon/node-extend
[npm-url]: https://npmjs.org/package/extend
[mit-license-url]: http://opensource.org/licenses/MIT
[github-justmoon]: https://github.com/justmoon
[github-insin]: https://github.com/insin
[github-ljharb]: https://github.com/ljharb
[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg
[deps-svg]: https://david-dm.org/justmoon/node-extend.svg
[deps-url]: https://david-dm.org/justmoon/node-extend
[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
| {
"pile_set_name": "Github"
} |
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// Simple test for a fuzzer. The fuzzer must find the string "Hi!".
#include <assert.h>
#include <cstdint>
#include <cstdlib>
#include <cstddef>
#include <iostream>
static volatile bool SeedLargeBuffer;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
assert(Data);
if (Size >= 4)
SeedLargeBuffer = true;
if (Size == 3 && SeedLargeBuffer && Data[3]) {
std::cout << "Woops, reading Data[3] w/o crashing\n";
exit(1);
}
return 0;
}
| {
"pile_set_name": "Github"
} |
// *****************************************************************************
//
// © Component Factory Pty Ltd 2017. All rights reserved.
// The software and associated documentation supplied hereunder are the
// proprietary information of Component Factory Pty Ltd, 13 Swallows Close,
// Mornington, Vic 3931, Australia and are supplied subject to licence terms.
//
// Version 4.6.0.0 www.ComponentFactory.com
// *****************************************************************************
using System;
using System.Text;
using System.Drawing;
using System.Drawing.Text;
using System.ComponentModel;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;
namespace ComponentFactory.Krypton.Toolkit
{
/// <summary>
/// Implement storage for list box specific values.
/// </summary>
public class PaletteListStateRedirect : PaletteDoubleRedirect
{
#region Instance Fields
private PaletteRedirect _redirect;
private PaletteTripleRedirect _itemRedirect;
#endregion
#region Identity
/// <summary>
/// Initialize a new instance of the PaletteListStateRedirect class.
/// </summary>
/// <param name="redirect">Inheritence redirection instance.</param>
/// <param name="backStyle">Initial background style.</param>
/// <param name="borderStyle">Initial border style.</param>
/// <param name="needPaint">Delegate for notifying paint requests.</param>
public PaletteListStateRedirect(PaletteRedirect redirect,
PaletteBackStyle backStyle,
PaletteBorderStyle borderStyle,
NeedPaintHandler needPaint)
: base(redirect, backStyle, borderStyle, needPaint)
{
Debug.Assert(redirect != null);
// Remember the redirect reference
_redirect = redirect;
// Create the item redirector
_itemRedirect = new PaletteTripleRedirect(redirect,
PaletteBackStyle.ButtonListItem,
PaletteBorderStyle.ButtonListItem,
PaletteContentStyle.ButtonListItem,
needPaint);
}
#endregion
#region IsDefault
/// <summary>
/// Gets a value indicating if all values are default.
/// </summary>
[Browsable(false)]
public override bool IsDefault
{
get
{
return (base.IsDefault && _itemRedirect.IsDefault);
}
}
#endregion
#region Item
/// <summary>
/// Gets the item appearance overrides.
/// </summary>
[KryptonPersist]
[Category("Visuals")]
[Description("Overrides for defining item appearance.")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public PaletteTripleRedirect Item
{
get { return _itemRedirect; }
}
private bool ShouldSerializeItem()
{
return !_itemRedirect.IsDefault;
}
#endregion
}
}
| {
"pile_set_name": "Github"
} |
/* (c) 2017 Open Source Geospatial Foundation - all rights reserved
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
// Implementation, v2.0-hudson-3037-ea3
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2007.07.27 at 11:06:51 PM CDT
//
package org.geoserver.wps.ppio.gpx;
import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.Element;
/**
* You can add extend GPX by adding your own elements from another schema here.
*
* <p>Java class for extensionsType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="extensionsType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*/
public class ExtensionsType {
protected List<Object> any;
/**
* Gets the value of the any property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is
* why there is not a <CODE>set</CODE> method for the any property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getAny().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link Object } {@link Element }
*/
public List<Object> getAny() {
if (any == null) {
any = new ArrayList<Object>();
}
return this.any;
}
}
| {
"pile_set_name": "Github"
} |
//tslint:disable
export let electionData: Object[] =
[
{ State: "Alabama", Trump:62.9,Clinton:34.6, WinPercentage: 62.9,Winner:"Trump", Population : 4780127 },
{ State: "Alaska", Trump:52.9,Clinton:37.7, WinPercentage: 52.9,Winner:"Trump", Population : 710249},
{ State: "Arkansas", Trump:60.6,Clinton:33.7, WinPercentage:60.6,Winner:"Trump", Population : 2915958 },
{ State: "Arizona", Trump:49.5,Clinton:45.4, WinPercentage:49.5,Winner:"Trump", Population : 6392307 },
{ State: "California", Trump:32.8,Clinton:61.6, WinPercentage: 61.6,Winner:"Clinton", Population : 37252895},
{ State: "Colorado", Trump:47.3,Clinton:44.4, WinPercentage: 47.3,Winner:"Trump", Population : 5029324 },
{ State: "Connecticut", Trump:41.2,Clinton:54.5, WinPercentage: 54.5,Winner:"Clinton", Population : 3574118},
{ State: "Delaware", Trump:53.4,Clinton:41.9, WinPercentage: 53.4,Winner:"Trump", Population : 897936 },
{ State: "District of Columbia", Trump:4.1,Clinton:92.8, WinPercentage: 92.8,Winner:"Clinton", Population : 693972 },
{ State: "Florida", Trump:49.1,Clinton:47.8 , WinPercentage: 49.1,Winner:"Trump", Population : 18804623},
{ State: "Georgia", Trump:51.3,Clinton:45.6 , WinPercentage:51.3,Winner:"Trump", Population : 9688681},
{ State: "Hawaii", Trump:62.2,Clinton:30, WinPercentage:62.2,Winner:"Trump", Population : 1360301 },
{ State: "Idaho", Trump:59.2,Clinton:27.6 , WinPercentage: 59.2,Winner:"Trump", Population : 1567652 },
{ State: "Illinois", Trump:55.4,Clinton:39.4, WinPercentage: 55.4,Winner:"Trump", Population : 12831549 },
{ State: "Indiana", Trump:57.2,Clinton:37.9 , WinPercentage:57.2,Winner:"Trump", Population : 6484229 },
{ State: "Iowa", Trump:51.8,Clinton:42.2, WinPercentage:51.8,Winner:"Trump", Population : 3046869 },
{ State: "Kansas", Trump:57.2,Clinton:36.2, WinPercentage:57.2,Winner:"Trump", Population : 2853132, },
{ State: "Kentucky", Trump:62.5,Clinton:32.7 , WinPercentage:62.5,Winner:"Trump", Population : 4339349 },
{ State: "Louisiana", Trump:58.1,Clinton:38.4 , WinPercentage:58.1,Winner:"Trump", Population : 4533479 },
{ State: "Maine", Trump:45.2,Clinton:47.9 , WinPercentage:47.9,Winner:"Clinton", Population : 1328361},
{ State: "Maryland", Trump:35.3,Clinton:60.5 , WinPercentage:60.5,Winner:"Clinton", Population : 5773785 },
{ State: "Massachusetts", Trump:33.5,Clinton:60.8, WinPercentage:60.8,Winner:"Clinton", Population : 6547817 },
{ State: "Michigan", Trump:47.6,Clinton:47.3 , WinPercentage:47.6,Winner:"Trump", Population : 9884129 },
{ State: "Minnesota", Trump:45.4,Clinton:46.9, WinPercentage:46.9,Winner:"Trump", Population : 5303925 },
{ State: "Mississippi", Trump:58.3,Clinton:39.7, WinPercentage:58.3,Winner:"Trump", Population : 2968103 },
{ State: "Missouri", Trump:57.1,Clinton:38.0, WinPercentage:57.1,Winner:"Trump", Population : 5988927 },
{ State: "Montana", Trump:56.5,Clinton:36.0, WinPercentage: 56.5,Winner:"Trump", Population : 989417 },
{ State: "Nebraska", Trump:60.3,Clinton:34.0 , WinPercentage:60.3,Winner:"Trump", Population : 1826341 },
{ State: "Nevada", Trump:45.5,Clinton:47.9, WinPercentage:47.9,Winner:"Clinton", Population : 2700691 },
{ State: "New Hampshire", Trump:47.2,Clinton:47.6 , WinPercentage: 47.6,Winner:"Clinton", Population : 1316466 },
{ State: "New Jersey", Trump:41.8,Clinton:55.0, WinPercentage:55,Winner:"Clinton", Population : 8791936},
{ State: "New Mexico", Trump:40.0,Clinton:48.3 , WinPercentage:48.3,Winner:"Clinton", Population : 2059192 },
{ State: "New York", Trump:37.5,Clinton:58.8 , WinPercentage:58.8,Winner:"Clinton", Population : 19378087},
{ State: "North Carolina", Trump:50.5,Clinton:46.7, WinPercentage:50.5,Winner:"Trump", Population : 9535692 },
{ State: "North Dakota", Trump:64.1,Clinton:27.8, WinPercentage:64.1,Winner:"Trump", Population : 672591 },
{ State: "Ohio", Trump:52.1,Clinton:43.5, WinPercentage:52.5,Winner:"Trump", Population : 11536725 },
{ State: "Oklahoma", Trump:65.3,Clinton:28.9, WinPercentage: 65.3,Winner:"Trump", Population : 3751616 },
{ State: "Oregon", Trump:41.1,Clinton:51.7, WinPercentage:51.7,Winner:"Clinton", Population : 3831073 },
{ State: "Pennsylvania", Trump:48.8,Clinton:47.6 , WinPercentage: 48.8,Winner:"Trump", Population : 12702887},
{ State: "Rhode Island", Trump:39.8,Clinton:55.4, WinPercentage: 55.4,Winner:"Clinton", Population : 1052931 },
{ State: "South Carolina", Trump:54.9,Clinton:40.8, WinPercentage:54.9,Winner:"Trump", Population : 4625401},
{ State: "South Dakota", Trump:61.5,Clinton:31.7, WinPercentage: 61.5,Winner:"Trump", Population : 814191 },
{ State: "Tennessee", Trump:61.1,Clinton:34.9, WinPercentage:61.1,Winner:"Trump", Population : 6346275},
{ State: "Texas", Trump:52.6,Clinton:43.4, WinPercentage:52.6,Winner:"Trump", Population : 25146105 },
{ State: "Utah", Trump:45.9,Clinton:27.8, WinPercentage:45.9,Winner:"Trump", Population : 2763888, },
{ State: "Vermont", Trump:39.7,Clinton:61.1, WinPercentage:61.1,Winner:"Clinton", Population : 625745 },
{ State: "Virginia", Trump:45.0,Clinton:49.9 , WinPercentage:49.9,Winner:"Clinton", Population : 8001045},
{ State: "Washington", Trump:4.1,Clinton:92.8 , WinPercentage:92.8,Winner:"Clinton", Population : 6724543 },
{ State: "Wisconsin", Trump:68.7,Clinton:26.5 , WinPercentage:68.7,Winner:"Trump", Population : 5687289},
{ State: "West Virginia", Trump:47.9,Clinton:46.9, WinPercentage:47.9,Winner:"Clinton", Population : 1853011 },
{ State: "Wyoming", Trump:70.1,Clinton:22.5, WinPercentage:70.1,Winner:"Trump", Population : 583767 }
];
| {
"pile_set_name": "Github"
} |
#pragma once
namespace systems {
namespace calendarsys {
void run(const double duration_ms);
}
} | {
"pile_set_name": "Github"
} |
.something {
background: black;
}
| {
"pile_set_name": "Github"
} |
ba166cd36099177b3942b16cd2c200fc *tests/data/fate/vsynth_lena-v408.avi
20282052 tests/data/fate/vsynth_lena-v408.avi
dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-v408.out.rawvideo
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200
| {
"pile_set_name": "Github"
} |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import { View } from 'react-native';
import { ApplePayButton, PaymentRequest } from 'react-native-payments';
type Props = {};
export default class App extends Component<Props> {
showPaymentSheet = () => {
const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS);
paymentRequest.show();
};
render() {
return (
<View style={{ margin: 50 }}>
<View style={{ height: 44 }}>
<ApplePayButton
type="plain"
style="black"
onPress={this.showPaymentSheet}
/>
</View>
</View>
);
}
}
const METHOD_DATA = [
{
supportedMethods: ['apple-pay'],
data: {
merchantIdentifier: 'merchant.com.your-app.namespace',
supportedNetworks: ['visa', 'mastercard', 'amex'],
countryCode: 'US',
currencyCode: 'USD',
},
},
];
const DETAILS = {
id: 'basic-example',
displayItems: [
{
label: 'Movie Ticket',
amount: { currency: 'USD', value: '15.00' },
},
],
total: {
label: 'Merchant Name',
amount: { currency: 'USD', value: '15.00' },
},
};
| {
"pile_set_name": "Github"
} |
// Copyright 2017 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 socket
const (
sysRECVMMSG = 0x157
sysSENDMMSG = 0x15d
)
| {
"pile_set_name": "Github"
} |
class GetterAccessLevel {
boolean isNone;
boolean isPrivate;
boolean isPackage;
boolean isProtected;
boolean isPublic;
String noneString;
String privateString;
String packageString;
String protectedString;
String publicString;
String value;
@java.lang.SuppressWarnings("all")
private boolean isPrivate() {
return this.isPrivate;
}
@java.lang.SuppressWarnings("all")
boolean isPackage() {
return this.isPackage;
}
@java.lang.SuppressWarnings("all")
protected boolean isProtected() {
return this.isProtected;
}
@java.lang.SuppressWarnings("all")
public boolean isPublic() {
return this.isPublic;
}
@java.lang.SuppressWarnings("all")
private String getPrivateString() {
return this.privateString;
}
@java.lang.SuppressWarnings("all")
String getPackageString() {
return this.packageString;
}
@java.lang.SuppressWarnings("all")
protected String getProtectedString() {
return this.protectedString;
}
@java.lang.SuppressWarnings("all")
public String getPublicString() {
return this.publicString;
}
@java.lang.SuppressWarnings("all")
public String getValue() {
return this.value;
}
}
| {
"pile_set_name": "Github"
} |
struct v2f_vertex_lit {
vec2 uv;
vec4 diff;
vec4 spec;
};
struct v2f_img {
vec4 pos;
vec2 uv;
};
struct appdata_img {
vec4 vertex;
vec2 texcoord;
};
struct SurfaceOutput {
vec3 Albedo;
vec3 Normal;
vec3 Emission;
float Specular;
float Gloss;
float Alpha;
};
struct Input {
vec2 uv_MainTex;
vec2 uv_BumpMap;
vec3 worldRefl;
vec3 viewDir;
vec3 TtoW0;
vec3 TtoW1;
vec3 TtoW2;
};
struct v2f_surf {
vec4 pos;
float fog;
vec4 hip_pack0;
vec3 viewDir;
vec4 hip_screen;
vec4 TtoW0;
vec4 TtoW1;
vec4 TtoW2;
};
struct appdata_full {
vec4 vertex;
vec4 tangent;
vec3 normal;
vec4 texcoord;
vec4 texcoord1;
vec4 color;
};
uniform sampler2D _BumpMap;
uniform vec4 _Color;
uniform samplerCube _Cube;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform float _Parallax;
uniform sampler2D _ParallaxMap;
uniform vec4 _ReflectColor;
uniform vec4 unity_Ambient;
vec4 UnpackNormal( in vec4 packednormal );
vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
void surf( in Input IN, inout SurfaceOutput o );
vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
vec4 frag_surf( in v2f_surf IN );
vec4 UnpackNormal( in vec4 packednormal ) {
vec4 normal;
normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
return normal;
}
vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
vec3 v;
h = ((h * height) - (height / 2.00000));
v = normalize( viewDir );
v.z += 0.420000;
return (h * (v.xy / v.z ));
}
void surf( in Input IN, inout SurfaceOutput o ) {
float h;
vec2 offset;
vec4 tex;
vec4 c;
vec3 worldRefl;
vec4 reflcol;
h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
offset = ParallaxOffset( h, _Parallax, IN.viewDir);
IN.uv_MainTex += offset;
IN.uv_BumpMap += offset;
tex = texture2D( _MainTex, IN.uv_MainTex);
c = (tex * _Color);
o.Albedo = c.xyz ;
o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, o.Normal), dot( IN.TtoW1, o.Normal), dot( IN.TtoW2, o.Normal)));
reflcol = textureCube( _Cube, worldRefl);
reflcol *= tex.w ;
o.Emission = (reflcol.xyz * _ReflectColor.xyz );
o.Alpha = (reflcol.w * _ReflectColor.w );
}
vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
vec4 c;
c.xyz = (s.Albedo * light.xyz );
c.w = s.Alpha;
return c;
}
vec4 frag_surf( in v2f_surf IN ) {
Input surfIN;
SurfaceOutput o;
vec4 light;
vec4 col;
surfIN.uv_MainTex = IN.hip_pack0.xy ;
surfIN.uv_BumpMap = IN.hip_pack0.zw ;
surfIN.worldRefl = vec3( IN.TtoW0.w , IN.TtoW1.w , IN.TtoW2.w );
surfIN.TtoW0 = IN.TtoW0.xyz ;
surfIN.TtoW1 = IN.TtoW1.xyz ;
surfIN.TtoW2 = IN.TtoW2.xyz ;
surfIN.viewDir = IN.viewDir;
o.Albedo = vec3( 0.000000);
o.Emission = vec3( 0.000000);
o.Specular = 0.000000;
o.Alpha = 0.000000;
o.Gloss = 0.000000;
surf( surfIN, o);
light = texture2DProj( _LightBuffer, IN.hip_screen);
light = ( -log2( light ) );
light.xyz += unity_Ambient.xyz ;
col = LightingLambert_PrePass( o, light);
col.xyz += o.Emission;
return col;
}
varying vec4 xlv_FOG;
void main() {
vec4 xl_retval;
v2f_surf xlt_IN;
xlt_IN.pos = vec4(0.0);
xlt_IN.fog = float( xlv_FOG);
xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
xlt_IN.viewDir = vec3( gl_TexCoord[1]);
xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
xlt_IN.TtoW0 = vec4( gl_TexCoord[3]);
xlt_IN.TtoW1 = vec4( gl_TexCoord[4]);
xlt_IN.TtoW2 = vec4( gl_TexCoord[5]);
xl_retval = frag_surf( xlt_IN);
gl_FragData[0] = vec4( xl_retval);
}
| {
"pile_set_name": "Github"
} |
package httptoo
import (
"context"
"io"
"net/http"
"sync"
"github.com/anacrolix/missinggo"
)
type responseWriter struct {
mu sync.Mutex
r http.Response
headerWritten missinggo.Event
bodyWriter io.WriteCloser
bodyClosed missinggo.SynchronizedEvent
}
var _ interface {
http.ResponseWriter
// We're able to emulate this easily enough.
http.CloseNotifier
} = &responseWriter{}
// Use Request.Context.Done instead.
func (me *responseWriter) CloseNotify() <-chan bool {
ret := make(chan bool, 1)
go func() {
<-me.bodyClosed.C()
ret <- true
}()
return ret
}
func (me *responseWriter) Header() http.Header {
if me.r.Header == nil {
me.r.Header = make(http.Header)
}
return me.r.Header
}
func (me *responseWriter) Write(b []byte) (int, error) {
me.mu.Lock()
if !me.headerWritten.IsSet() {
me.writeHeader(200)
}
me.mu.Unlock()
return me.bodyWriter.Write(b)
}
func (me *responseWriter) WriteHeader(status int) {
me.mu.Lock()
me.writeHeader(status)
me.mu.Unlock()
}
func (me *responseWriter) writeHeader(status int) {
if me.headerWritten.IsSet() {
return
}
me.r.StatusCode = status
me.headerWritten.Set()
}
func (me *responseWriter) runHandler(h http.Handler, req *http.Request) {
var pr *io.PipeReader
pr, me.bodyWriter = io.Pipe()
me.r.Body = struct {
io.Reader
io.Closer
}{pr, eventCloser{pr, &me.bodyClosed}}
// Shouldn't be writing to the response after the handler returns.
defer me.bodyWriter.Close()
// Send a 200 if nothing was written yet.
defer me.WriteHeader(200)
// Wrap the context in the given Request with one that closes when either
// the handler returns, or the response body is closed.
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
go func() {
<-me.bodyClosed.C()
cancel()
}()
h.ServeHTTP(me, req.WithContext(ctx))
}
type eventCloser struct {
c io.Closer
closed *missinggo.SynchronizedEvent
}
func (me eventCloser) Close() (err error) {
err = me.c.Close()
me.closed.Set()
return
}
func RoundTripHandler(req *http.Request, h http.Handler) (*http.Response, error) {
rw := responseWriter{}
go rw.runHandler(h, req)
<-rw.headerWritten.LockedChan(&rw.mu)
return &rw.r, nil
}
type InProcRoundTripper struct {
Handler http.Handler
}
func (me *InProcRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
return RoundTripHandler(req, me.Handler)
}
| {
"pile_set_name": "Github"
} |
[WHATWG URL 标志][WHATWG URL Standard]使用比传统的 API 更具选择性和更精细的方法来选择使用的编码字符。
WHATWG 算法定义了四个“百分比编码集”,它们描述了必须进行百分编码的字符范围:
* C0 控制百分比编码集,包括范围在 U+0000 至 U+001F(含)的代码点,以及大于 U+007E 的所有代码点。
* 片段百分比编码集,包括 C0 控制百分比编码集,以及代码点 U+0020、U+0022、U+003C、U+003E 和 U+006。
* 路径百分比编码集,包括 C0 控制百分比编码集,以及代码点 U+0020、U+0022、U+0023、U+003C、U+003E、U+003F、U+0060、U+007B 和 U+007D。
* 用户信息编码集,包括路径百分比编码集,以及代码点 U+002F、U+003A、U+003B、U+003D、U+0040、U+005B、U+005C、U+005D、U+005E 和 U+007C。
用户信息百分比编码集专门用于 URL 中用户名和密码部分的编码。
路径百分比编码集用于大多数 URL 的路径部分编码。
C0 控制百分比编码集则用于所有其他情况的编码,特别包括 URL 的分段部分,特殊条件下也包括主机及路径部分。
当主机名中出现非 ASCII 字符时,主机名将使用 [Punycode] 算法进行编码。
但是,主机名可能同时包含 Punycode 编码和百分比编码的字符:
```js
const myURL = new URL('https://%CF%80.example.com/foo');
console.log(myURL.href);
// 打印 https://xn--1xa.example.com/foo
console.log(myURL.origin);
// 打印 https://xn--1xa.example.com
```
| {
"pile_set_name": "Github"
} |
# Legal, if unusual, IRIs
BASE </http://example/page.html?query>
SELECT * WHERE { <a> <b> <¶m=value> }
| {
"pile_set_name": "Github"
} |
require('./funky/funky.theme.css');
require('./funky/funky.scss');
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2011-2014 Gael Guennebaud <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_BASIC_PRECONDITIONERS_H
#define EIGEN_BASIC_PRECONDITIONERS_H
namespace Eigen {
/** \ingroup IterativeLinearSolvers_Module
* \brief A preconditioner based on the digonal entries
*
* This class allows to approximately solve for A.x = b problems assuming A is a diagonal matrix.
* In other words, this preconditioner neglects all off diagonal entries and, in Eigen's language, solves for:
\code
A.diagonal().asDiagonal() . x = b
\endcode
*
* \tparam _Scalar the type of the scalar.
*
* \implsparsesolverconcept
*
* This preconditioner is suitable for both selfadjoint and general problems.
* The diagonal entries are pre-inverted and stored into a dense vector.
*
* \note A variant that has yet to be implemented would attempt to preserve the norm of each column.
*
* \sa class LeastSquareDiagonalPreconditioner, class ConjugateGradient
*/
template <typename _Scalar>
class DiagonalPreconditioner
{
typedef _Scalar Scalar;
typedef Matrix<Scalar,Dynamic,1> Vector;
public:
typedef typename Vector::StorageIndex StorageIndex;
enum {
ColsAtCompileTime = Dynamic,
MaxColsAtCompileTime = Dynamic
};
DiagonalPreconditioner() : m_isInitialized(false) {}
template<typename MatType>
explicit DiagonalPreconditioner(const MatType& mat) : m_invdiag(mat.cols())
{
compute(mat);
}
Index rows() const { return m_invdiag.size(); }
Index cols() const { return m_invdiag.size(); }
template<typename MatType>
DiagonalPreconditioner& analyzePattern(const MatType& )
{
return *this;
}
template<typename MatType>
DiagonalPreconditioner& factorize(const MatType& mat)
{
m_invdiag.resize(mat.cols());
for(int j=0; j<mat.outerSize(); ++j)
{
typename MatType::InnerIterator it(mat,j);
while(it && it.index()!=j) ++it;
if(it && it.index()==j && it.value()!=Scalar(0))
m_invdiag(j) = Scalar(1)/it.value();
else
m_invdiag(j) = Scalar(1);
}
m_isInitialized = true;
return *this;
}
template<typename MatType>
DiagonalPreconditioner& compute(const MatType& mat)
{
return factorize(mat);
}
/** \internal */
template<typename Rhs, typename Dest>
void _solve_impl(const Rhs& b, Dest& x) const
{
x = m_invdiag.array() * b.array() ;
}
template<typename Rhs> inline const Solve<DiagonalPreconditioner, Rhs>
solve(const MatrixBase<Rhs>& b) const
{
eigen_assert(m_isInitialized && "DiagonalPreconditioner is not initialized.");
eigen_assert(m_invdiag.size()==b.rows()
&& "DiagonalPreconditioner::solve(): invalid number of rows of the right hand side matrix b");
return Solve<DiagonalPreconditioner, Rhs>(*this, b.derived());
}
ComputationInfo info() { return Success; }
protected:
Vector m_invdiag;
bool m_isInitialized;
};
/** \ingroup IterativeLinearSolvers_Module
* \brief Jacobi preconditioner for LeastSquaresConjugateGradient
*
* This class allows to approximately solve for A' A x = A' b problems assuming A' A is a diagonal matrix.
* In other words, this preconditioner neglects all off diagonal entries and, in Eigen's language, solves for:
\code
(A.adjoint() * A).diagonal().asDiagonal() * x = b
\endcode
*
* \tparam _Scalar the type of the scalar.
*
* \implsparsesolverconcept
*
* The diagonal entries are pre-inverted and stored into a dense vector.
*
* \sa class LeastSquaresConjugateGradient, class DiagonalPreconditioner
*/
template <typename _Scalar>
class LeastSquareDiagonalPreconditioner : public DiagonalPreconditioner<_Scalar>
{
typedef _Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef DiagonalPreconditioner<_Scalar> Base;
using Base::m_invdiag;
public:
LeastSquareDiagonalPreconditioner() : Base() {}
template<typename MatType>
explicit LeastSquareDiagonalPreconditioner(const MatType& mat) : Base()
{
compute(mat);
}
template<typename MatType>
LeastSquareDiagonalPreconditioner& analyzePattern(const MatType& )
{
return *this;
}
template<typename MatType>
LeastSquareDiagonalPreconditioner& factorize(const MatType& mat)
{
// Compute the inverse squared-norm of each column of mat
m_invdiag.resize(mat.cols());
if(MatType::IsRowMajor)
{
m_invdiag.setZero();
for(Index j=0; j<mat.outerSize(); ++j)
{
for(typename MatType::InnerIterator it(mat,j); it; ++it)
m_invdiag(it.index()) += numext::abs2(it.value());
}
for(Index j=0; j<mat.cols(); ++j)
if(numext::real(m_invdiag(j))>RealScalar(0))
m_invdiag(j) = RealScalar(1)/numext::real(m_invdiag(j));
}
else
{
for(Index j=0; j<mat.outerSize(); ++j)
{
RealScalar sum = mat.col(j).squaredNorm();
if(sum>RealScalar(0))
m_invdiag(j) = RealScalar(1)/sum;
else
m_invdiag(j) = RealScalar(1);
}
}
Base::m_isInitialized = true;
return *this;
}
template<typename MatType>
LeastSquareDiagonalPreconditioner& compute(const MatType& mat)
{
return factorize(mat);
}
ComputationInfo info() { return Success; }
protected:
};
/** \ingroup IterativeLinearSolvers_Module
* \brief A naive preconditioner which approximates any matrix as the identity matrix
*
* \implsparsesolverconcept
*
* \sa class DiagonalPreconditioner
*/
class IdentityPreconditioner
{
public:
IdentityPreconditioner() {}
template<typename MatrixType>
explicit IdentityPreconditioner(const MatrixType& ) {}
template<typename MatrixType>
IdentityPreconditioner& analyzePattern(const MatrixType& ) { return *this; }
template<typename MatrixType>
IdentityPreconditioner& factorize(const MatrixType& ) { return *this; }
template<typename MatrixType>
IdentityPreconditioner& compute(const MatrixType& ) { return *this; }
template<typename Rhs>
inline const Rhs& solve(const Rhs& b) const { return b; }
ComputationInfo info() { return Success; }
};
} // end namespace Eigen
#endif // EIGEN_BASIC_PRECONDITIONERS_H
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2017, Ilya Etingof <[email protected]>
# License: http://pyasn1.sf.net/license.html
#
# Read bunch of ASN.1/PEM plain/encrypted private keys in PKCS#8
# format on stdin, parse each into plain text, then build substrate from it
#
import sys
from pyasn1.codec.der import decoder
from pyasn1.codec.der import encoder
from pyasn1_modules import pem
from pyasn1_modules import rfc5208
if len(sys.argv) != 1:
print("""Usage:
$ cat pkcs8key.pem | %s""" % sys.argv[0])
sys.exit(-1)
cnt = 0
while True:
idx, substrate = pem.readPemBlocksFromFile(
sys.stdin,
('-----BEGIN PRIVATE KEY-----', '-----END PRIVATE KEY-----'),
('-----BEGIN ENCRYPTED PRIVATE KEY-----', '-----END ENCRYPTED PRIVATE KEY-----')
)
if not substrate:
break
if idx == 0:
asn1Spec = rfc5208.PrivateKeyInfo()
elif idx == 1:
asn1Spec = rfc5208.EncryptedPrivateKeyInfo()
else:
break
key, rest = decoder.decode(substrate, asn1Spec=asn1Spec)
if rest:
substrate = substrate[:-len(rest)]
print(key.prettyPrint())
assert encoder.encode(key) == substrate, 'pkcs8 recode fails'
cnt += 1
print('*** %s PKCS#8 key(s) de/serialized' % cnt)
| {
"pile_set_name": "Github"
} |
#!/bin/ksh -p
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
#
# Copyright (c) 2016, 2017 by Delphix. All rights reserved.
#
. $STF_SUITE/tests/functional/channel_program/channel_common.kshlib
#
# DESCRIPTION:
# Promoting a clone should work correctly.
#
verify_runnable "global"
fs=$TESTPOOL/$TESTFS/testchild
clone=$TESTPOOL/$TESTFS/testchild_clone
snap=$fs@$TESTSNAP
function cleanup
{
for to_destroy in $fs $clone; do
datasetexists $to_destroy && log_must zfs destroy -R $to_destroy
done
}
log_onexit cleanup
log_must zfs create $fs
log_must zfs snapshot $snap
log_must zfs clone $snap $clone
log_must_program_sync $TESTPOOL - <<-EOF
assert(zfs.sync.promote("$clone") == 0)
EOF
log_pass "Promoting a clone with a channel program works."
| {
"pile_set_name": "Github"
} |
<Flex justify="between" style={[tableStyle.mainWrapper, tableStyle.noData]}>
<FlexItem flex>
<ActivityIndicator animating size="large"/>
<Text style={tableStyle.noDataText}>数据加载中。。。</Text>
</FlexItem>
</Flex>
| {
"pile_set_name": "Github"
} |
import pickle
import unittest
from softlearning.environments.utils import get_environment
from softlearning.samplers.remote_sampler import RemoteSampler
from softlearning.replay_pools.simple_replay_pool import SimpleReplayPool
from softlearning.policies.uniform_policy import UniformPolicy
class RemoteSamplerTest(unittest.TestCase):
def setUp(self):
self.env = get_environment('gym', 'Swimmer', 'Default', {})
self.policy = UniformPolicy(
input_shapes=(self.env.observation_space.shape, ),
output_shape=self.env.action_space.shape)
self.pool = SimpleReplayPool(
max_size=100,
observation_space=self.env.observation_space,
action_space=self.env.action_space)
self.remote_sampler = RemoteSampler(
max_path_length=10,
min_pool_size=10,
batch_size=10)
def test_initialization(self):
self.assertEqual(self.pool.size, 0)
self.remote_sampler.initialize(self.env, self.policy, self.pool)
self.remote_sampler.sample(timeout=10)
self.assertEqual(self.pool.size, 10)
def test_serialize_deserialize(self):
self.assertEqual(self.pool.size, 0)
self.remote_sampler.initialize(self.env, self.policy, self.pool)
self.remote_sampler.sample()
deserialized = pickle.loads(pickle.dumps(self.remote_sampler))
self.assertEqual(self.pool.size, 10)
self.remote_sampler.sample(timeout=10)
self.assertEqual(self.pool.size, 20)
deserialized = pickle.loads(pickle.dumps(self.remote_sampler))
self.assertTrue(isinstance(
deserialized.env, type(self.remote_sampler.env)))
self.assertEqual(
self.remote_sampler._n_episodes, deserialized._n_episodes)
self.assertEqual(
self.remote_sampler._max_path_return,
deserialized._max_path_return)
self.assertEqual(
self.remote_sampler._last_path_return,
deserialized._last_path_return)
self.assertEqual(
len(self.remote_sampler._last_n_paths),
len(deserialized._last_n_paths))
self.remote_sampler.sample(timeout=10)
deserialized.sample(timeout=10)
self.assertEqual(
self.remote_sampler._n_episodes, deserialized._n_episodes)
self.assertNotEqual(
self.remote_sampler._last_path_return,
deserialized._last_path_return)
self.assertEqual(
len(self.remote_sampler._last_n_paths),
len(deserialized._last_n_paths))
if __name__ == '__main__':
unittest.main()
| {
"pile_set_name": "Github"
} |
/* ===========================================================================
*
* This file is part of HISE.
* Copyright 2016 Christoph Hart
*
* HISE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HISE 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 HISE. If not, see <http://www.gnu.org/licenses/>.
*
* Commercial licenses for using HISE in an closed source project are
* available on request. Please visit the project's website to get more
* information about commercial licensing:
*
* http://www.hise.audio/
*
* HISE is based on the JUCE library,
* which must be separately licensed for closed source applications:
*
* http://www.juce.com
*
* ===========================================================================
*/
#ifndef RESIZABLE_HEIGHT_COMPONENT_H_INCLUDED
#define RESIZABLE_HEIGHT_COMPONENT_H_INCLUDED
#endif | {
"pile_set_name": "Github"
} |
@echo off
rem *** Usage ***
rem call 'GitShowBranch /i' for prompt initialization
rem you may change ConEmuGitPath variable, if git.exe/git.cmd is not in your %PATH%
rem Predefined dir where git binaries are stored
rem ConEmuGitPath must contain quoted path, if it has spaces for instance
if NOT DEFINED ConEmuGitPath (
rem set ConEmuGitPath=git
set ConEmuGitPath="%~d0\GitSDK\cmd\git.exe"
)
if NOT exist "%ConEmuGitPath%" (
set ConEmuGitPath=git
)
if /I "%~1" == "/i" (
if exist "%~dp0ConEmuC.exe" (
call "%~dp0ConEmuC.exe" /IsConEmu
if errorlevel 2 goto no_conemu
) else if exist "%~dp0ConEmuC64.exe" (
call "%~dp0ConEmuC64.exe" /IsConEmu
if errorlevel 2 goto no_conemu
)
call "%ConEmuGitPath%" --version
if errorlevel 1 (
call cecho "GIT not found, change your ConEmuGitPath environment variable"
goto :EOF
)
if defined ConEmuPrompt1 (
PROMPT %ConEmuPrompt1%$E]9;7;"cmd -cur_console:R /c%~nx0"$e\$E]9;8;"gitbranch"$e\%ConEmuPrompt2%%ConEmuPrompt3%
) else (
PROMPT $P$E]9;7;"cmd -cur_console:R /c%~nx0"$e\$E]9;8;"gitbranch"$e\$g
)
goto :EOF
) else if /I "%~1" == "/u" (
if defined ConEmuPrompt1 (
PROMPT %ConEmuPrompt1%%ConEmuPrompt2%%ConEmuPrompt3%
) else (
PROMPT $P$G
)
goto :EOF
)
if /I "%~1" == "/?" goto help
if /I "%~1" == "-?" goto help
if /I "%~1" == "-h" goto help
if /I "%~1" == "--help" goto help
goto run
:help
setlocal
call "%~dp0SetEscChar.cmd"
if "%ConEmuANSI%"=="ON" (
set white=%ESC%[1;37;40m
set red=%ESC%[1;31;40m
set normal=%ESC%[0m
) else (
set white=
set red=
set normal=
)
echo %white%%~nx0 description%normal%
echo You may see your current git branch in %white%cmd prompt%normal%
echo Just run `%red%%~nx0 /i%normal%` to setup it in the current cmd instance
echo And you will see smth like `%white%T:\ConEmu [daily +0 ~7 -0]^>%normal%`
echo If you see double `%red%^>^>%normal%` unset your `%white%FARHOME%normal%` env.variable
echo You may use it in %white%Far Manager%normal%,
echo set your Far %white%prompt%normal% to `%red%$p%%gitbranch%%%normal%` and call `%red%%~nx0%normal%`
echo after each command which can change your working directory state
echo Example: "%~dp0Addons\git.cmd"
goto :EOF
:inc_add
set /A gitbranch_add=%gitbranch_add%+1
goto :EOF
:inc_chg
set /A gitbranch_chg=%gitbranch_chg%+1
goto :EOF
:inc_del
set /A gitbranch_del=%gitbranch_del%+1
goto :EOF
:eval
rem Calculate changes count
if "%gitbranch_ln%" == "##" (
rem save first line, this must be branch
) else if "%gitbranch_ln:~0,2%" == "??" (
call :inc_add
) else if "%gitbranch_ln:~0,1%" == "A" (
call :inc_add
) else if "%gitbranch_ln:~0,1%" == "D" (
call :inc_del
) else if "%gitbranch_ln:~0,1%" == "M" (
call :inc_chg
)
goto :EOF
:calc
rem Ensure that gitbranch_ln has no line returns
set "gitbranch_ln=%~1"
call :eval
goto :EOF
:drop_ext
for /F "delims=." %%l in ("%gitbranch%") do set "gitbranch=%%l"
goto :EOF
:no_conemu
rem GitShowBranch works in ConEmu only
rem Also gitbranch can't be modified
rem because export will not be working
exit /b 0
goto :EOF
:run
if exist "%~dp0ConEmuC.exe" (
call "%~dp0ConEmuC.exe" /IsConEmu
if errorlevel 2 goto no_conemu
) else if exist "%~dp0ConEmuC64.exe" (
call "%~dp0ConEmuC64.exe" /IsConEmu
if errorlevel 2 goto no_conemu
)
rem let gitlogpath be folder to store git output
if "%TEMP:~-1%" == "\" (set "gitlogpath=%TEMP:~0,-1%") else (set "gitlogpath=%TEMP%")
set git_out=%gitlogpath%\conemu_git_%ConEmuServerPID%_1.log
set git_err=%gitlogpath%\conemu_git_%ConEmuServerPID%_2.log
rem Just to ensure that non-oem characters will not litter the prompt
set "ConEmu_SaveLang=%LANG%"
set LANG=en_US
rem Due to a bug(?) of cmd.exe we can't quote ConEmuGitPath variable
rem otherwise if it contains only unquoted "git" and matches "git.cmd" for example
rem the "%~dp0" macros in that cmd will return a crap.
call %ConEmuGitPath% -c color.status=false status --short --branch --porcelain 1>"%git_out%" 2>"%git_err%"
if errorlevel 1 (
set "LANG=%ConEmu_SaveLang%"
set ConEmu_SaveLang=
del "%git_out%">nul
del "%git_err%">nul
set gitbranch=
goto prepare
)
set "LANG=%ConEmu_SaveLang%"
set ConEmu_SaveLang=
rem Firstly check if it is not a git repository
rem Set "gitbranch" to full contents of %git_err% file
set /P gitbranch=<"%git_err%"
rem But we need only first line of it
set "gitbranch=%gitbranch%"
if NOT DEFINED gitbranch goto skip_not_a_git
if /I "%gitbranch:~0,16%" == "fatal: not a git" (
rem echo Not a .git repository
del "%git_out%">nul
del "%git_err%">nul
set gitbranch=
goto prepare
)
:skip_not_a_git
set gitbranch_add=0
set gitbranch_chg=0
set gitbranch_del=0
rem Set "gitbranch" to full contents of %git_out% file
set /P gitbranch=<"%git_out%"
rem But we need only first line of it
set "gitbranch=%gitbranch%"
rem To ensure that %git_out% does not contain brackets
pushd %gitlogpath%
for /F %%l in (conemu_git_%ConEmuServerPID%_1.log) do call :calc "%%l"
popd
rem echo done ':calc', br='%gitbranch%', ad='%gitbranch_add%', ch='%gitbranch_chg%', dl='%gitbranch_del%'
call %ConEmuGitPath% rev-parse --abbrev-ref HEAD 1>"%git_out%" 2>"%git_err%"
if errorlevel 1 (
set gitbranch=
) else (
set /P gitbranch=<"%git_out%"
)
del "%git_out%">nul
del "%git_err%">nul
if NOT DEFINED gitbranch (
set "gitbranch=-unknown-"
) else if "%gitbranch%" == "" (
set "gitbranch=-unknown-"
)
rem Are there changes? Or we need to display branch name only?
if "%gitbranch_add% %gitbranch_chg% %gitbranch_del%" == "0 0 0" (
set "gitbranch= [%gitbranch%]"
) else (
set "gitbranch= [%gitbranch% +%gitbranch_add% ~%gitbranch_chg% -%gitbranch_del%]"
)
rem echo "%gitbranch%"
:prepare
if NOT "%FARHOME%" == "" set gitbranch=%gitbranch%^>
:export
rem Export to parent Far Manager or cmd.exe processes
"%ConEmuBaseDir%\ConEmuC.exe" /silent /export=CON gitbranch
| {
"pile_set_name": "Github"
} |
//
// APIRequest+SendEmpty.swift
// CodyFire
//
// Created by Mihael Isaev on 16/10/2018.
//
import Foundation
import Alamofire
extension APIRequest {
func sendEmpty() {
do {
var originalRequest = try URLRequest(url: url, method: method, headers: headers)
originalRequest.timeoutInterval = responseTimeout
dataRequest = request(originalRequest)
dataRequest?.response { answer in
self.parseResponse(answer)
}
} catch {
parseError(._unknown, error, nil, "Unable to initialize URLRequest: \(error)")
}
}
}
| {
"pile_set_name": "Github"
} |
=======================
Extending/Embedding FAQ
=======================
.. only:: html
.. contents::
.. highlight:: c
.. XXX need review for Python 3.
Can I create my own functions in C?
-----------------------------------
Yes, you can create built-in modules containing functions, variables, exceptions
and even new types in C. This is explained in the document
:ref:`extending-index`.
Most intermediate or advanced Python books will also cover this topic.
Can I create my own functions in C++?
-------------------------------------
Yes, using the C compatibility features found in C++. Place ``extern "C" {
... }`` around the Python include files and put ``extern "C"`` before each
function that is going to be called by the Python interpreter. Global or static
C++ objects with constructors are probably not a good idea.
.. _c-wrapper-software:
Writing C is hard; are there any alternatives?
----------------------------------------------
There are a number of alternatives to writing your own C extensions, depending
on what you're trying to do.
.. XXX make sure these all work
`Cython <http://cython.org>`_ and its relative `Pyrex
<https://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ are compilers
that accept a slightly modified form of Python and generate the corresponding
C code. Cython and Pyrex make it possible to write an extension without having
to learn Python's C API.
If you need to interface to some C or C++ library for which no Python extension
currently exists, you can try wrapping the library's data types and functions
with a tool such as `SWIG <http://www.swig.org>`_. `SIP
<https://riverbankcomputing.com/software/sip/intro>`__, `CXX
<http://cxx.sourceforge.net/>`_ `Boost
<http://www.boost.org/libs/python/doc/index.html>`_, or `Weave
<https://github.com/scipy/weave>`_ are also
alternatives for wrapping C++ libraries.
How can I execute arbitrary Python statements from C?
-----------------------------------------------------
The highest-level function to do this is :c:func:`PyRun_SimpleString` which takes
a single string argument to be executed in the context of the module
``__main__`` and returns ``0`` for success and ``-1`` when an exception occurred
(including :exc:`SyntaxError`). If you want more control, use
:c:func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in
``Python/pythonrun.c``.
How can I evaluate an arbitrary Python expression from C?
---------------------------------------------------------
Call the function :c:func:`PyRun_String` from the previous question with the
start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it and
returns its value.
How do I extract C values from a Python object?
-----------------------------------------------
That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size`
returns its length and :c:func:`PyTuple_GetItem` returns the item at a specified
index. Lists have similar functions, :c:func:`PyListSize` and
:c:func:`PyList_GetItem`.
For bytes, :c:func:`PyBytes_Size` returns its length and
:c:func:`PyBytes_AsStringAndSize` provides a pointer to its value and its
length. Note that Python bytes objects may contain null bytes so C's
:c:func:`strlen` should not be used.
To test the type of an object, first make sure it isn't ``NULL``, and then use
:c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:`PyList_Check`, etc.
There is also a high-level API to Python objects which is provided by the
so-called 'abstract' interface -- read ``Include/abstract.h`` for further
details. It allows interfacing with any kind of Python sequence using calls
like :c:func:`PySequence_Length`, :c:func:`PySequence_GetItem`, etc. as well
as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et
al.) and mappings in the PyMapping APIs.
How do I use Py_BuildValue() to create a tuple of arbitrary length?
-------------------------------------------------------------------
You can't. Use :c:func:`PyTuple_Pack` instead.
How do I call an object's method from C?
----------------------------------------
The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary
method of an object. The parameters are the object, the name of the method to
call, a format string like that used with :c:func:`Py_BuildValue`, and the
argument values::
PyObject *
PyObject_CallMethod(PyObject *object, const char *method_name,
const char *arg_format, ...);
This works for any object that has methods -- whether built-in or user-defined.
You are responsible for eventually :c:func:`Py_DECREF`\ 'ing the return value.
To call, e.g., a file object's "seek" method with arguments 10, 0 (assuming the
file object pointer is "f")::
res = PyObject_CallMethod(f, "seek", "(ii)", 10, 0);
if (res == NULL) {
... an exception occurred ...
}
else {
Py_DECREF(res);
}
Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the
argument list, to call a function without arguments, pass "()" for the format,
and to call a function with one argument, surround the argument in parentheses,
e.g. "(i)".
How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?
----------------------------------------------------------------------------------------
In Python code, define an object that supports the ``write()`` method. Assign
this object to :data:`sys.stdout` and :data:`sys.stderr`. Call print_error, or
just allow the standard traceback mechanism to work. Then, the output will go
wherever your ``write()`` method sends it.
The easiest way to do this is to use the :class:`io.StringIO` class:
.. code-block:: pycon
>>> import io, sys
>>> sys.stdout = io.StringIO()
>>> print('foo')
>>> print('hello world!')
>>> sys.stderr.write(sys.stdout.getvalue())
foo
hello world!
A custom object to do the same would look like this:
.. code-block:: pycon
>>> import io, sys
>>> class StdoutCatcher(io.TextIOBase):
... def __init__(self):
... self.data = []
... def write(self, stuff):
... self.data.append(stuff)
...
>>> import sys
>>> sys.stdout = StdoutCatcher()
>>> print('foo')
>>> print('hello world!')
>>> sys.stderr.write(''.join(sys.stdout.data))
foo
hello world!
How do I access a module written in Python from C?
--------------------------------------------------
You can get a pointer to the module object as follows::
module = PyImport_ImportModule("<modulename>");
If the module hasn't been imported yet (i.e. it is not yet present in
:data:`sys.modules`), this initializes the module; otherwise it simply returns
the value of ``sys.modules["<modulename>"]``. Note that it doesn't enter the
module into any namespace -- it only ensures it has been initialized and is
stored in :data:`sys.modules`.
You can then access the module's attributes (i.e. any name defined in the
module) as follows::
attr = PyObject_GetAttrString(module, "<attrname>");
Calling :c:func:`PyObject_SetAttrString` to assign to variables in the module
also works.
How do I interface to C++ objects from Python?
----------------------------------------------
Depending on your requirements, there are many approaches. To do this manually,
begin by reading :ref:`the "Extending and Embedding" document
<extending-index>`. Realize that for the Python run-time system, there isn't a
whole lot of difference between C and C++ -- so the strategy of building a new
Python type around a C structure (pointer) type will also work for C++ objects.
For C++ libraries, see :ref:`c-wrapper-software`.
I added a module using the Setup file and the make fails; why?
--------------------------------------------------------------
Setup must end in a newline, if there is no newline there, the build process
fails. (Fixing this requires some ugly shell script hackery, and this bug is so
minor that it doesn't seem worth the effort.)
How do I debug an extension?
----------------------------
When using GDB with dynamically loaded extensions, you can't set a breakpoint in
your extension until your extension is loaded.
In your ``.gdbinit`` file (or interactively), add the command:
.. code-block:: none
br _PyImport_LoadDynamicModule
Then, when you run GDB:
.. code-block:: shell-session
$ gdb /local/bin/python
gdb) run myscript.py
gdb) continue # repeat until your extension is loaded
gdb) finish # so that your extension is loaded
gdb) br myfunction.c:50
gdb) continue
I want to compile a Python module on my Linux system, but some files are missing. Why?
--------------------------------------------------------------------------------------
Most packaged versions of Python don't include the
:file:`/usr/lib/python2.{x}/config/` directory, which contains various files
required for compiling Python extensions.
For Red Hat, install the python-devel RPM to get the necessary files.
For Debian, run ``apt-get install python-dev``.
How do I tell "incomplete input" from "invalid input"?
------------------------------------------------------
Sometimes you want to emulate the Python interactive interpreter's behavior,
where it gives you a continuation prompt when the input is incomplete (e.g. you
typed the start of an "if" statement or you didn't close your parentheses or
triple string quotes), but it gives you a syntax error message immediately when
the input is invalid.
In Python you can use the :mod:`codeop` module, which approximates the parser's
behavior sufficiently. IDLE uses this, for example.
The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` (perhaps
in a separate thread) and let the Python interpreter handle the input for
you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` to point at your
custom input function. See ``Modules/readline.c`` and ``Parser/myreadline.c``
for more hints.
However sometimes you have to run the embedded Python interpreter in the same
thread as your rest application and you can't allow the
:c:func:`PyRun_InteractiveLoop` to stop while waiting for user input. The one
solution then is to call :c:func:`PyParser_ParseString` and test for ``e.error``
equal to ``E_EOF``, which means the input is incomplete. Here's a sample code
fragment, untested, inspired by code from Alex Farber::
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <node.h>
#include <errcode.h>
#include <grammar.h>
#include <parsetok.h>
#include <compile.h>
int testcomplete(char *code)
/* code should end in \n */
/* return -1 for error, 0 for incomplete, 1 for complete */
{
node *n;
perrdetail e;
n = PyParser_ParseString(code, &_PyParser_Grammar,
Py_file_input, &e);
if (n == NULL) {
if (e.error == E_EOF)
return 0;
return -1;
}
PyNode_Free(n);
return 1;
}
Another solution is trying to compile the received string with
:c:func:`Py_CompileString`. If it compiles without errors, try to execute the
returned code object by calling :c:func:`PyEval_EvalCode`. Otherwise save the
input for later. If the compilation fails, find out if it's an error or just
more input is required - by extracting the message string from the exception
tuple and comparing it to the string "unexpected EOF while parsing". Here is a
complete example using the GNU readline library (you may want to ignore
**SIGINT** while calling readline())::
#include <stdio.h>
#include <readline.h>
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <object.h>
#include <compile.h>
#include <eval.h>
int main (int argc, char* argv[])
{
int i, j, done = 0; /* lengths of line, code */
char ps1[] = ">>> ";
char ps2[] = "... ";
char *prompt = ps1;
char *msg, *line, *code = NULL;
PyObject *src, *glb, *loc;
PyObject *exc, *val, *trb, *obj, *dum;
Py_Initialize ();
loc = PyDict_New ();
glb = PyDict_New ();
PyDict_SetItemString (glb, "__builtins__", PyEval_GetBuiltins ());
while (!done)
{
line = readline (prompt);
if (NULL == line) /* Ctrl-D pressed */
{
done = 1;
}
else
{
i = strlen (line);
if (i > 0)
add_history (line); /* save non-empty lines */
if (NULL == code) /* nothing in code yet */
j = 0;
else
j = strlen (code);
code = realloc (code, i + j + 2);
if (NULL == code) /* out of memory */
exit (1);
if (0 == j) /* code was empty, so */
code[0] = '\0'; /* keep strncat happy */
strncat (code, line, i); /* append line to code */
code[i + j] = '\n'; /* append '\n' to code */
code[i + j + 1] = '\0';
src = Py_CompileString (code, "<stdin>", Py_single_input);
if (NULL != src) /* compiled just fine - */
{
if (ps1 == prompt || /* ">>> " or */
'\n' == code[i + j - 1]) /* "... " and double '\n' */
{ /* so execute it */
dum = PyEval_EvalCode (src, glb, loc);
Py_XDECREF (dum);
Py_XDECREF (src);
free (code);
code = NULL;
if (PyErr_Occurred ())
PyErr_Print ();
prompt = ps1;
}
} /* syntax error or E_EOF? */
else if (PyErr_ExceptionMatches (PyExc_SyntaxError))
{
PyErr_Fetch (&exc, &val, &trb); /* clears exception! */
if (PyArg_ParseTuple (val, "sO", &msg, &obj) &&
!strcmp (msg, "unexpected EOF while parsing")) /* E_EOF */
{
Py_XDECREF (exc);
Py_XDECREF (val);
Py_XDECREF (trb);
prompt = ps2;
}
else /* some other syntax error */
{
PyErr_Restore (exc, val, trb);
PyErr_Print ();
free (code);
code = NULL;
prompt = ps1;
}
}
else /* some non-syntax error */
{
PyErr_Print ();
free (code);
code = NULL;
prompt = ps1;
}
free (line);
}
}
Py_XDECREF(glb);
Py_XDECREF(loc);
Py_Finalize();
exit(0);
}
How do I find undefined g++ symbols __builtin_new or __pure_virtual?
--------------------------------------------------------------------
To dynamically load g++ extension modules, you must recompile Python, relink it
using g++ (change LINKCC in the Python Modules Makefile), and link your
extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``).
Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)?
----------------------------------------------------------------------------------------------------------------
Yes, you can inherit from built-in classes such as :class:`int`, :class:`list`,
:class:`dict`, etc.
The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index.html)
provides a way of doing this from C++ (i.e. you can inherit from an extension
class written in C++ using the BPL).
| {
"pile_set_name": "Github"
} |
# SuperAgent
SuperAgent is a small progressive __client-side__ HTTP request library, and __Node.js__ module with the same API, sporting many high-level HTTP client features. View the [docs](http://visionmedia.github.com/superagent/).

## Installation
node:
```
$ npm install superagent
```
component:
```
$ component install visionmedia/superagent
```
with script tags use ./superagent.js
## Motivation
This library spawned from my frustration with jQuery's weak & inconsistent Ajax support. jQuery's API while having recently added some promise-like support, is largely static, forcing you to build up big objects containing all the header fields and options, not to mention most of the options are awkwardly named "type" instead of "method", etc. Onto examples!
The following is what you might typically do for a simple __GET__ with jQuery:
```js
$.get('/user/1', function(data, textStatus, xhr){
});
```
great, it's ok, but it's kinda lame having 3 arguments just to access something on the `xhr`. Our equivalent would be:
```js
request.get('/user/1', function(res){
});
```
the response object is an instanceof `request.Response`, encapsulating all of this information instead of throwing a bunch of arguments at you. For example we can check `res.status`, `res.header` for header fields, `res.text`, `res.body` etc.
An example of a JSON POST with jQuery typically might use `$.post()`, however once you need to start defining header fields you have to then re-write it using `$.ajax()`... so that might look like:
```js
$.ajax({
url: '/api/pet',
type: 'POST',
data: { name: 'Manny', species: 'cat' },
headers: { 'X-API-Key': 'foobar' }
}).success(function(res){
}).error(function(){
});
```
Not only is it ugly it's pretty opinionated, jQuery likes to special-case {4,5}xx, for example you cannot (easily at least) receive a parsed JSON response for say "400 Bad Request". This same request would look like this:
```js
request
.post('/api/pet')
.send({ name: 'Manny', species: 'cat' })
.set('X-API-Key', 'foobar')
.set('Accept', 'application/json')
.end(function(error, res){
});
```
building on the existing API internally we also provide something similar to `$.post()` for those times in life where your interactions are very basic:
```js
request.post('/api/pet', cat, function(error, res){
});
```
## Running node tests
Install dependencies:
$ npm install
Run em!
$ make test
## Running browser tests
Install the test server deps (nodejs / express):
$ npm install
Start the test server:
$ make test-server
Visit `localhost:4000/` in the browser.
## Browser build
The browser build of superagent is located in ./superagent.js
## Examples:
- [agency tests](https://github.com/visionmedia/superagent/blob/master/test/node/agency.js)
- [express demo app](https://github.com/hunterloftis/component-test/blob/master/lib/users/test/controller.test.js)
## Wiki
For superagent extensions such as couchdb and oauth visit the [wiki](https://github.com/visionmedia/superagent/wiki).
## License
MIT
| {
"pile_set_name": "Github"
} |
/*
* TEST SUITE FOR MB/WC FUNCTIONS IN CLIBRARY
*
* FILE: dat_wcstod.c
*
* WCSTOD: double wcstod (const wchar_t *np, wchar_t **endp);
*/
/*
* NOTE:
* need more test data!
*
*/
TST_WCSTOD tst_wcstod_loc [] = {
{
{ Twcstod, TST_LOC_de },
{
{
/*01*/
/*I*/
{{ 0x0030,0x0030,0x0030,0x002C,0x0030,0x0030,0x0030,0x0030,0x0000 }},
/*E*/
{ 0,1,0.0, 0.0, 0x0000 }
},
{
/*02*/
/*I*/
{{ 0x0031,0x0032,0x0033,0x002C,0x0034,0x0035,0x0036,0x0040,0x0000 }},
/*E*/
{ 0,1,123.456, 123.456, 0x0040 }
},
{ .is_last = 1 }
}
},
{
{ Twcstod, TST_LOC_enUS },
{
{
/*01*/
/*I*/
{{ 0x0030,0x0030,0x0030,0x002E,0x0030,0x0030,0x0030,0x0030,0x0000 }},
/*E*/
{ 0,1,0.0, 0.0, 0x0000 }
},
{
/*02*/
/*I*/
{{ 0x0031,0x0032,0x0033,0x002E,0x0034,0x0035,0x0036,0x0040,0x0000 }},
/*E*/
{ 0,1,123.456, 123.456, 0x0040 }
},
{ .is_last = 1 }
}
},
{
{ Twcstod, TST_LOC_eucJP },
{
{
/*01*/
/*I*/
{{ 0x0031,0x0032,0x0033,0x002E,0x0034,0x0035,0x0036,0x0040,0x0000 }},
/*E*/
{ 0,1,123.456, 123.456, 0x0040 }
},
{ .is_last = 1 }
}
},
{
{ Twcstod, TST_LOC_end }
}
};
| {
"pile_set_name": "Github"
} |
package org.corfudb.infrastructure.management;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.corfudb.infrastructure.management.failuredetector.ClusterGraph;
import org.corfudb.protocols.wireprotocol.ClusterState;
import org.corfudb.protocols.wireprotocol.NodeState;
import org.corfudb.protocols.wireprotocol.SequencerMetrics;
import org.corfudb.protocols.wireprotocol.failuredetector.NodeConnectivity;
import org.corfudb.protocols.wireprotocol.failuredetector.NodeRank;
import org.junit.Test;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.corfudb.infrastructure.management.NodeStateTestUtil.A;
import static org.corfudb.infrastructure.management.NodeStateTestUtil.B;
import static org.corfudb.infrastructure.management.NodeStateTestUtil.C;
import static org.corfudb.infrastructure.management.failuredetector.ClusterGraph.ClusterGraphHelper.cluster;
import static org.corfudb.protocols.wireprotocol.failuredetector.NodeConnectivity.ConnectionStatus.FAILED;
import static org.corfudb.protocols.wireprotocol.failuredetector.NodeConnectivity.ConnectionStatus.OK;
import static org.corfudb.protocols.wireprotocol.failuredetector.NodeConnectivity.connectivity;
import static org.corfudb.protocols.wireprotocol.failuredetector.NodeConnectivity.unavailable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class ClusterGraphTest {
@Test
public void testTransformation() {
NodeState a = NodeState.builder()
.sequencerMetrics(SequencerMetrics.READY)
.connectivity(connectivity(A, ImmutableMap.of(A, OK, B, OK, C, FAILED)))
.build();
NodeState b = NodeState.builder()
.sequencerMetrics(SequencerMetrics.READY)
.connectivity(connectivity(B, ImmutableMap.of(A, OK, B, OK, C, FAILED)))
.build();
NodeState c = unavailableNodeState(C);
ImmutableMap<String, NodeState> nodes = ImmutableMap.of(A, a, B, b, C, c);
ClusterState clusterState = ClusterState.builder()
.localEndpoint(A)
.nodes(nodes)
.unresponsiveNodes(ImmutableList.of())
.build();
ClusterGraph graph = ClusterGraph.toClusterGraph(clusterState);
assertEquals(graph.size(), nodes.size());
}
@Test
public void testToSymmetricForTwoNodes() {
NodeConnectivity a = connectivity(A, ImmutableMap.of(A, OK, B, FAILED));
NodeConnectivity b = connectivity(B, ImmutableMap.of(A, OK, B, OK));
ClusterGraph graph = cluster(A, ImmutableList.of(), a, b);
ClusterGraph symmetric = graph.toSymmetric();
assertEquals(FAILED, graph.getNodeConnectivity(A).getConnectionStatus(B));
assertEquals(OK, graph.getNodeConnectivity(B).getConnectionStatus(A));
assertEquals(FAILED, symmetric.getNodeConnectivity(A).getConnectionStatus(B));
assertEquals(FAILED, symmetric.getNodeConnectivity(B).getConnectionStatus(A));
}
@Test
public void testToSymmetricForThreeNodes() {
NodeConnectivity a = connectivity(A, ImmutableMap.of(A, OK, B, FAILED, C, FAILED));
NodeConnectivity b = connectivity(B, ImmutableMap.of(A, OK, B, OK, C, OK));
NodeConnectivity c = connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK));
ClusterGraph symmetric = cluster(A, ImmutableList.of(), a, b, c).toSymmetric();
assertEquals(FAILED, symmetric.getNodeConnectivity(B).getConnectionStatus(A));
assertEquals(FAILED, symmetric.getNodeConnectivity(C).getConnectionStatus(A));
symmetric = cluster(B, ImmutableList.of(), a, b, c).toSymmetric();
assertEquals(FAILED, symmetric.getNodeConnectivity(B).getConnectionStatus(A));
assertEquals(FAILED, symmetric.getNodeConnectivity(C).getConnectionStatus(A));
symmetric = cluster(C, ImmutableList.of(), a, b, c).toSymmetric();
assertEquals(FAILED, symmetric.getNodeConnectivity(B).getConnectionStatus(A));
assertEquals(FAILED, symmetric.getNodeConnectivity(C).getConnectionStatus(A));
}
@Test
public void testToSymmetricForThreeNodesWithUnavailableNodeB() {
NodeConnectivity a = connectivity(A, ImmutableMap.of(A, OK, B, FAILED, C, FAILED));
NodeConnectivity b = unavailable(B);
NodeConnectivity c = connectivity(C, ImmutableMap.of(A, OK, B, OK, C, OK));
ClusterGraph graph = cluster(A, ImmutableList.of(), a, b, c);
ClusterGraph symmetric = graph.toSymmetric();
NodeConnectivity symmetricNodeA = symmetric.getNodeConnectivity(A);
assertEquals(OK, symmetricNodeA.getConnectionStatus(A));
assertEquals(FAILED, symmetricNodeA.getConnectionStatus(B));
assertEquals(FAILED, symmetricNodeA.getConnectionStatus(C));
assertThatThrownBy(() -> symmetric.getNodeConnectivity(B).getConnectionStatus(A))
.isInstanceOf(IllegalStateException.class);
assertEquals(FAILED, symmetric.getNodeConnectivity(C).getConnectionStatus(A));
assertEquals(OK, symmetric.getNodeConnectivity(C).getConnectionStatus(B));
assertEquals(OK, symmetric.getNodeConnectivity(C).getConnectionStatus(C));
}
@Test
public void testDecisionMaker() {
NodeConnectivity a = connectivity(A, ImmutableMap.of(A, OK, B, OK, C, OK));
NodeConnectivity b = connectivity(B, ImmutableMap.of(A, FAILED, B, OK, C, OK));
NodeConnectivity c = connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK));
ClusterGraph graph = cluster(A, ImmutableList.of(), a, b, c);
Optional<NodeRank> decisionMaker = graph.toSymmetric().getDecisionMaker();
assertTrue(decisionMaker.isPresent());
assertEquals(decisionMaker.get(), new NodeRank(A, 2));
}
@Test
public void testFailedNode() {
ClusterGraph graph = cluster(
A,
ImmutableList.of(),
connectivity(A, ImmutableMap.of(A, OK, B, OK, C, OK)),
connectivity(B, ImmutableMap.of(A, FAILED, B, OK, C, OK)),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
Optional<NodeRank> failedNode = graph.toSymmetric().findFailedNode();
assertTrue(failedNode.isPresent());
assertEquals(failedNode.get(), new NodeRank(B, 1));
graph = cluster(
A,
ImmutableList.of(B),
connectivity(A, ImmutableMap.of(A, OK, B, OK, C, OK)),
connectivity(B, ImmutableMap.of(A, OK, B, OK, C, FAILED)),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
failedNode = graph.toSymmetric().findFailedNode();
assertFalse(failedNode.isPresent());
graph = cluster(
A,
ImmutableList.of(),
connectivity(A, ImmutableMap.of(A, OK, B, OK, C, OK)),
connectivity(B, ImmutableMap.of(A, OK, B, OK, C, FAILED)),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
failedNode = graph.toSymmetric().findFailedNode();
assertTrue(failedNode.isPresent());
assertEquals(failedNode.get(), new NodeRank(C, 2));
}
@Test
public void testFindFullyConnectedResponsiveNodes() {
ClusterGraph graph = cluster(
A,
ImmutableList.of(B),
connectivity(A, ImmutableMap.of(A, OK, B, FAILED, C, OK)),
unavailable(B),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
graph = graph.toSymmetric();
Optional<NodeRank> responsiveNode = graph.findFullyConnectedNode(C);
assertTrue(responsiveNode.isPresent());
assertEquals(new NodeRank(C, 2), responsiveNode.get());
graph = cluster(
A,
ImmutableList.of(C),
connectivity(A, ImmutableMap.of(A, OK, B, FAILED, C, OK)),
unavailable(B),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
responsiveNode = graph.toSymmetric().findFullyConnectedNode(C);
assertTrue(responsiveNode.isPresent());
assertEquals(C, responsiveNode.get().getEndpoint());
assertEquals(2, responsiveNode.get().getNumConnections());
graph = cluster(
A,
ImmutableList.of(B),
connectivity(A, ImmutableMap.of(A, OK, B, FAILED, C, OK)),
connectivity(B, ImmutableMap.of(A, FAILED, B, OK, C, FAILED)),
connectivity(C, ImmutableMap.of(A, OK, B, FAILED, C, OK))
);
graph = graph.toSymmetric();
responsiveNode = graph.findFullyConnectedNode(C);
assertTrue(responsiveNode.isPresent());
assertEquals(new NodeRank(C, 2), responsiveNode.get());
}
private NodeState unavailableNodeState(String endpoint) {
return new NodeState(
unavailable(endpoint),
SequencerMetrics.UNKNOWN
);
}
} | {
"pile_set_name": "Github"
} |
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->
{
_class = "CParticleSystemDefinition"
m_bShouldHitboxesFallbackToRenderBounds = false
m_nMaxParticles = 200
m_flConstantRadius = 1.0
m_ConstantColor = [ 252, 106, 0, 255 ]
m_flNoDrawTimeToGoToSleep = 2.0
m_bShouldSort = false
m_Renderers =
[
{
_class = "C_OP_RenderSprites"
m_nSequenceCombineMode = "SEQUENCE_COMBINE_MODE_USE_SEQUENCE_0"
m_bAdditive = true
m_flMinSize = 0.0025
m_flMaxSize = 0.0075
m_hTexture = resource:"materials/particle/yellowflare.vtex"
m_flAnimationRate = 1.0
m_bAnimateInFPS = true
},
]
m_Operators =
[
{
_class = "C_OP_BasicMovement"
m_Gravity = [ 0.0, 0.0, 40.0 ]
m_fDrag = 0.05
},
{
_class = "C_OP_Decay"
},
{
_class = "C_OP_FadeIn"
m_flFadeInTimeMax = 0.2
m_flFadeInTimeMin = 0.3
},
{
_class = "C_OP_FadeOut"
m_flFadeOutTimeMax = 0.5
m_flFadeOutTimeMin = 0.3
},
{
_class = "C_OP_OscillateVector"
m_bOffset = true
m_RateMin = [ -32.0, -32.0, -32.0 ]
m_RateMax = [ 32.0, 32.0, 32.0 ]
m_FrequencyMax = [ 2.0, 2.0, 2.0 ]
},
{
_class = "C_OP_PositionLock"
m_flRange = 200.0
m_flStartTime_max = -1.0
m_flStartTime_min = -1.0
},
]
m_Initializers =
[
{
_class = "C_INIT_RandomAlpha"
},
{
_class = "C_INIT_RandomColor"
m_ColorMin = [ 244, 155, 0, 255 ]
m_ColorMax = [ 255, 194, 161, 255 ]
},
{
_class = "C_INIT_RandomRotation"
},
{
_class = "C_INIT_RandomRadius"
m_flRadiusMax = 4.0
},
{
_class = "C_INIT_RandomLifeTime"
m_fLifetimeMin = 1.0
m_fLifetimeMax = 4.0
},
{
_class = "C_INIT_RandomSequence"
m_nSequenceMax = 63
},
{
_class = "C_INIT_CreateOnModel"
},
{
_class = "C_INIT_InitialVelocityNoise"
m_vecOutputMax = [ 164.0, 164.0, 64.0 ]
m_vecOutputMin = [ -164.0, -164.0, -16.0 ]
m_flNoiseScaleLoc = 0.1
m_flNoiseScale = 4.0
},
]
m_Emitters =
[
{
_class = "C_OP_ContinuousEmitter"
m_flEmitRate = 30.0
},
]
m_ForceGenerators =
[
{
_class = "C_OP_RandomForce"
m_MinForce = [ -150.0, -150.0, -150.0 ]
m_MaxForce = [ 150.0, 150.0, 150.0 ]
},
]
} | {
"pile_set_name": "Github"
} |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Remote File Inclusion Test Case</title>
</head>
<body>
<%@ include file="include.jsp"%>
<%
//*** Re-define Default Exposure Variables - Per Page ***
//CONTEXT_STREAM, FILE_CLASS, URL_CLASS, FTP_CLASS, INCLUDE, REDIRECT, FORWARD
fileAccessMethod = FileAccessMethod.URL_CLASS;
//NONE, WHITE_LIST, LOCAL_FOLDER_ONLY, PERMISSIONS,
//UNIX_TRAVESAL_INPUT_VALIDATION, UNIX_TRAVESAL_INPUT_REMOVAL,
//WINDOWS_TRAVESAL_INPUT_VALIDATION, WINDOWS_TRAVESAL_INPUT_REMOVAL,
//SLASH_INPUT_VALIDATION, SLASH_INPUT_REMOVAL,
//BACKSLASH_INPUT_VALIDATION, BACKSLASH_INPUT_REMOVAL,
//HTTP_INPUT_VALIDATION,HTTP_INPUT_REMOVAL
accessRestriction = FileAccessRestriction.NONE;
//FULL_PATH_INPUT, RELATIVE_INPUT, INVALID_INPUT , EMPTY_INPUT
defaultInputType = DefaultInputType.INVALID_INPUT;
//FULL_FILENAME, FILENAME_ONLY, DIRECTORY, EXTENSION
injectionContext = FileInjectionContext.FULL_FILENAME;
//ANY, NONE, SLASH_PREFIX, BACKSLASH_PREFIX,
//FTP_DIRECTIVE, HTTP_DIRECTIVE,
prefixRequired = PrefixRequirement.ANY;
//WINDOWS, UNIX
//osSimulated = OsType.WINDOWS;
//Use the default defined in include.jsp
//ERROR_500, ERROR_404, REDIRECT_302, ERROR_200, VALID_200, Identical_200
//invalidResponseType = ResponseType.ERROR_200;
//Use the default defined in include.jsp
//CONTENT_TYPE_TEXT_HTML ("text/html"), CONTENT_TYPE_STREAM ("application/octet-stream")
//validResposeStream = ContentConstants.CONTENT_TYPE_TEXT_HTML;
//OS_PATH, FILE_DIRECTIVE_URL, FTP_URL, HTTP_URL
pathType = PathType.HTTP_URL;
//LFI, RFI, DIRECTORY_TRAVERSAL, CODE_LFI, CODE_RFI, FALSE_POSITIVE
vulnerability = VulnerabilityType.RFI;
%>
<%@ include file="inclusion-logic.jsp"%> | {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Alipay.AopSdk.Core.Domain
{
/// <summary>
/// RecruitTool Data Structure.
/// </summary>
[Serializable]
public class RecruitTool : AopObject
{
/// <summary>
/// 招商结束时间
/// </summary>
[JsonProperty("end_time")]
public string EndTime { get; set; }
/// <summary>
/// 如果这个值是true,那么活动的参与门店不需要招商
/// </summary>
[JsonProperty("exclude_constraint_shops")]
public bool ExcludeConstraintShops { get; set; }
/// <summary>
/// 招商pid和pid对应的门店列表(对于品牌商,此字段必填,活动和券的适用门店为空。对于商圈,此字段需为空,门店需要填在活动和券的适用门店上)
/// </summary>
[JsonProperty("pid_shops")]
public List<PidShopInfo> PidShops { get; set; }
/// <summary>
/// 招商开始时间
/// </summary>
[JsonProperty("start_time")]
public string StartTime { get; set; }
}
} | {
"pile_set_name": "Github"
} |
import Foundation
class Script: WebAsset {
private var content: String?
private var url: URL?
required init(content: String) {
self.content = content
}
required init(url: URL) {
self.url = url
}
func getHTML() -> String {
if let url = url {
return "<script src=\"\(url.path)\"></script>"
} else {
return "<script>\(content ?? "")</script>"
}
}
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/python -tt
# Exercícios by Nick Parlante (CodingBat)
# A. near_ten
# Seja um n não negativo, retorna True se o número está a distância de
# pelo menos dois de um múltiplo de dez. Use a função resto da divisão.
# near_ten(12) -> True
# near_ten(17) -> False
# near_ten(19) -> True
def near_ten(n):
return n % 10 <= 2 or n % 10 >= 8
# B. lone_sum
# Soma maluca: some os números inteiros a, b, e c
# Se algum número aparecer repetido ele não conta na soma
# lone_sum(1, 2, 3) -> 6
# lone_sum(3, 2, 3) -> 2
# lone_sum(3, 3, 3) -> 0
def lone_sum(a, b, c):
if a == b == c:
return 0
if a == b:
return c
if b == c:
return a
if a == c:
return b
return a + b + c
# C. luck_sum
# Soma três inteiros a, b, c
# Se aparecer um 13 ele não conta e todos os da sua direita também
# lucky_sum(1, 2, 3) -> 6
# lucky_sum(1, 2, 13) -> 3
# lucky_sum(1, 13, 3) -> 1
def lucky_sum(a, b, c):
if a == 13:
return 0
if b == 13:
return a
if c == 13:
return a + b
return a + b + c
# D. double_char
# retorna os caracteres da string original duplicados
# double_char('The') -> 'TThhee'
# double_char('AAbb') -> 'AAAAbbbb'
# double_char('Hi-There') -> 'HHii--TThheerree'
def double_char(s):
return ''.join([c+c for c in s])
# E. count_hi
# conta o número de vezes que aparece a string 'hi'
# count_hi('abc hi ho') -> 1
# count_hi('ABChi hi') -> 2
# count_hi('hihi') -> 2
def count_hi(s):
return s.count('hi')
# F. cat_dog
# verifica se o aparece o mesmo número de vezes 'cat' e 'dog'
# cat_dog('catdog') -> True
# cat_dog('catcat') -> False
# cat_dog('1cat1cadodog') -> True
def cat_dog(s):
return s.count('cat') == s.count('dog')
# G. count_code
# conta quantas vezes aparece 'code'
# a letra 'd' pode ser trocada por outra qualquer
# assim 'coxe' ou 'coze' também são contadas como 'code'
# count_code('aaacodebbb') -> 1
# count_code('codexxcode') -> 2
# count_code('cozexxcope') -> 2
def count_code(s):
cont = 0
for k in range(len(s)-3):
if s[k:k+2] == 'co' and s[k+3] == 'e':
cont += 1
return cont
# H. end_other
# as duas strings devem ser convertidas para minúsculo via lower()
# depois disso verifique que no final da string b ocorre a string a
# ou se no final da string a ocorre a string b
# end_other('Hiabc', 'abc') -> True
# end_other('AbC', 'HiaBc') -> True
# end_other('abc', 'abXabc') -> True
def end_other(a, b):
a = a.lower()
b = b.lower()
return a.endswith(b) or b.endswith(a)
# I. count_evens
# conta os números pares da lista
# count_evens([2, 1, 2, 3, 4]) -> 3
# count_evens([2, 2, 0]) -> 3
# count_evens([1, 3, 5]) -> 0
def count_evens(nums):
return len([x for x in nums if x % 2 == 0])
# J. sum13
# retorna a soma dos números de uma lista
# 13 dá azar, você deverá ignorar o 13 e todos os números à sua direita
# sum13([1, 2, 2, 1]) -> 6
# sum13([1, 1]) -> 2
# sum13([1, 2, 2, 1, 13]) -> 6
# sum13([13, 1, 2, 3, 4]) -> 0
def sum13(nums):
if 13 in nums:
return sum(nums[:nums.index(13)])
return sum(nums)
# K. has22
# Verifica se na lista de números inteiros aparecem dois 2 consecutivos
# has22([1, 2, 2]) -> True
# has22([1, 2, 1, 2]) -> False
# has22([2, 1, 2]) -> False
def has22(nums):
return '2, 2' in str(nums)
# L. soma_na_lista
# Verifica se n é soma de dois números distintos da lista
# soma_na_lista(5, [1, 2, 3, 4]) -> True
# soma_na_lista(9, [1, 2, 3, 4]) -> False
# soma_na_lista(0, [1, 2, 3, 4]) -> False
# soma_na_lista(8, [1, 2, 3, 4]) -> False
# soma_na_lista(4, [2, 2, 2, 2]) -> False
# soma_na_lista(4, [2, 2, 1, 3]) -> True
# Hall of Fame: Raphael Castro 1a Turma Python para Zumbis
def soma_na_lista(n, lista):
return n in [x + y for x in lista for y in lista if x != y]
# M. desafio! faça somente se já tiver acabado o EP1 e todas as listas
# Fila de tijolos sem usar loops
# queremos montar uma fila de tijolos de um tamanho denominado meta
# temos tijolos pequenos (tamanho 1) e tijolos grandes (tamanho 5)
# retorna True se for possível montar a fila de tijolos
# é possível uma solução sem usar for ou while
# fila_tijolos(3, 1, 8) -> True
# fila_tijolos(3, 1, 9) -> False
# fila_tijolos(3, 2, 10) -> True
def fila_tijolos(n_peq, n_gra, meta):
return n_peq >= meta % 5 and n_peq + 5 * n_gra >= meta
# Provided simple test() function used in main() to print
# what each function returns vs. what it's supposed to return.
def test(obtido, esperado):
if obtido == esperado:
prefixo = ' Parabéns!'
else:
prefixo = ' Ainda não'
print ('%s obtido: %s esperado: %s'
% (prefixo, repr(obtido), repr(esperado)))
def main():
print ('Near_ten')
test(near_ten(12), True)
test(near_ten(17), False)
test(near_ten(19), True)
test(near_ten(31), True)
test(near_ten(6), False)
test(near_ten(10), True)
test(near_ten(11), True)
test(near_ten(21), True)
test(near_ten(22), True)
test(near_ten(23), False)
test(near_ten(54), False)
test(near_ten(155), False)
test(near_ten(158), True)
test(near_ten(3), False)
test(near_ten(1), True)
print ()
print ('Lone Sum')
test(lone_sum(1, 2, 3), 6)
test(lone_sum(3, 2, 3), 2)
test(lone_sum(3, 3, 3), 0)
test(lone_sum(9, 2, 2), 9)
test(lone_sum(2, 2, 9), 9)
test(lone_sum(2, 9, 2), 9)
test(lone_sum(2, 9, 3), 14)
test(lone_sum(4, 2, 3), 9)
test(lone_sum(1, 3, 1), 3)
print ()
print ('Lucky_sum')
test(lucky_sum(1, 2, 3), 6)
test(lucky_sum(1, 2, 13), 3)
test(lucky_sum(1, 13, 3), 1)
test(lucky_sum(1, 13, 13), 1)
test(lucky_sum(6, 5, 2), 13)
test(lucky_sum(13, 2, 3), 0)
test(lucky_sum(13, 2, 13), 0)
test(lucky_sum(13, 13, 2), 0)
test(lucky_sum(9, 4, 13), 13)
test(lucky_sum(8, 13, 2), 8)
test(lucky_sum(7, 2, 1), 10)
test(lucky_sum(3, 3, 13), 6)
print ()
print ('Double_char')
test(double_char('The'), 'TThhee')
test(double_char('AAbb'), 'AAAAbbbb')
test(double_char('Hi-There'), 'HHii--TThheerree')
test(double_char('Word!'), 'WWoorrdd!!')
test(double_char('!!'), '!!!!')
test(double_char(''), '')
test(double_char('a'), 'aa')
test(double_char('.'), '..')
test(double_char('aa'), 'aaaa')
print ()
print ('Count_hi')
test(count_hi('abc hi ho'), 1)
test(count_hi('ABChi hi'), 2)
test(count_hi('hihi'), 2)
test(count_hi('hiHIhi'), 2)
test(count_hi(''), 0)
test(count_hi('h'), 0)
test(count_hi('hi'), 1)
test(count_hi('Hi is no HI on ahI'), 0)
test(count_hi('hiho not HOHIhi'), 2)
print ()
print ('Cat_dog')
test(cat_dog('catdog'), True)
test(cat_dog('catcat'), False)
test(cat_dog('1cat1cadodog'), True)
test(cat_dog('catxxdogxxxdog'), False)
test(cat_dog('catxdogxdogxcat'), True)
test(cat_dog('catxdogxdogxca'), False)
test(cat_dog('dogdogcat'), False)
test(cat_dog('dogogcat'), True)
test(cat_dog('dog'), False)
test(cat_dog('cat'), False)
test(cat_dog('ca'), True)
test(cat_dog('c'), True)
test(cat_dog(''), True)
print ()
print ('Count_code')
test(count_code('aaacodebbb'), 1)
test(count_code('codexxcode'), 2)
test(count_code('cozexxcope'), 2)
test(count_code('cozfxxcope'), 1)
test(count_code('xxcozeyycop'), 1)
test(count_code('cozcop'), 0)
test(count_code('abcxyz'), 0)
test(count_code('code'), 1)
test(count_code('ode'), 0)
test(count_code('c'), 0)
test(count_code(''), 0)
test(count_code('AAcodeBBcoleCCccoreDD'), 3)
test(count_code('AAcodeBBcoleCCccorfDD'), 2)
test(count_code('coAcodeBcoleccoreDD'), 3)
print ()
print ('End_other')
test(end_other('Hiabc', 'abc'), True)
test(end_other('AbC', 'HiaBc'), True)
test(end_other('abc', 'abXabc'), True)
test(end_other('Hiabc', 'abcd'), False)
test(end_other('Hiabc', 'bc'), True)
test(end_other('Hiabcx', 'bc'), False)
test(end_other('abc', 'abc'), True)
test(end_other('xyz', '12xyz'), True)
test(end_other('yz', '12xz'), False)
test(end_other('Z', '12xz'), True)
test(end_other('12', '12'), True)
test(end_other('abcXYZ', 'abcDEF'), False)
test(end_other('ab', 'ab12'), False)
test(end_other('ab', '12ab'), True)
print ()
print ('Count_evens')
test(count_evens([2, 1, 2, 3, 4]), 3)
test(count_evens([2, 2, 0]), 3)
test(count_evens([1, 3, 5]), 0)
test(count_evens([]), 0)
test(count_evens([11, 9, 0, 1]), 1)
test(count_evens([2, 11, 9, 0]), 2)
test(count_evens([2]), 1)
test(count_evens([2, 5, 12]), 2)
print ()
print ('Sum13')
test(sum13([1, 2, 2, 1]), 6)
test(sum13([1, 1]), 2)
test(sum13([1, 2, 2, 1, 13]), 6)
test(sum13([1, 2, 13, 2, 1, 13]), 3)
test(sum13([13, 1, 2, 13, 2, 1, 13]), 0)
test(sum13([]), 0)
test(sum13([13]), 0)
test(sum13([13, 13]), 0)
test(sum13([13, 0, 13]), 0)
test(sum13([13, 1, 13]), 0)
test(sum13([5, 7, 2]), 14)
test(sum13([5, 13, 2]), 5)
test(sum13([0]), 0)
test(sum13([13, 0]), 0)
print ()
print ('Has22')
test(has22([1, 2, 2]), True)
test(has22([1, 2, 1, 2]), False)
test(has22([2, 1, 2]), False)
test(has22([2, 2, 1, 2]), True)
test(has22([1, 3, 2]), False)
test(has22([1, 3, 2, 2]), True)
test(has22([2, 3, 2, 2]), True)
test(has22([4, 2, 4, 2, 2, 5]), True)
test(has22([1, 2]), False)
test(has22([2, 2]), True)
test(has22([2]), False)
test(has22([]), False)
test(has22([3, 3, 2, 2]), True)
test(has22([5, 2, 5, 2]), False)
print ()
print ('Soma na lista')
test(soma_na_lista(5, [1, 2, 3, 4]), True)
test(soma_na_lista(9, [1, 2, 3, 4]), False)
test(soma_na_lista(0, [1, 2, 3, 4]), False)
test(soma_na_lista(8, [1, 2, 3, 4]), False)
test(soma_na_lista(4, [2, 2, 2, 2]), False)
test(soma_na_lista(4, [2, 2, 1, 3]), True)
test(soma_na_lista(42, [40, 2, 3, 39]), True)
print ()
print ('Fila de Tijolos')
test(fila_tijolos(3, 1, 8), True)
test(fila_tijolos(3, 1, 9), False)
test(fila_tijolos(3, 2, 10), True)
test(fila_tijolos(3, 2, 8), True)
test(fila_tijolos(3, 2, 9), False)
test(fila_tijolos(6, 1, 11), True)
test(fila_tijolos(6, 0, 11), False)
test(fila_tijolos(3, 1, 7), True)
test(fila_tijolos(1, 1, 7), False)
test(fila_tijolos(2, 1, 7), True)
test(fila_tijolos(7, 1, 11), True)
test(fila_tijolos(7, 1, 8), True)
test(fila_tijolos(7, 1, 13), False)
test(fila_tijolos(43, 1, 46), True)
test(fila_tijolos(40, 1, 46), False)
test(fila_tijolos(22, 2, 33), False)
test(fila_tijolos(0, 2, 10), True)
test(fila_tijolos(1000000, 1000, 1000100), True)
test(fila_tijolos(2, 1000000, 100003), False)
test(fila_tijolos(12, 2, 21), True)
if __name__ == '__main__':
main()
| {
"pile_set_name": "Github"
} |
before_install_package() {
build_package_warn_eol "$1"
}
install_git "8.x-next" "https://github.com/nodejs/node.git" "v8.x" standard
| {
"pile_set_name": "Github"
} |
/* sem_post -- post to a POSIX semaphore. Generic futex-using version.
Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <[email protected]>, 2003.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <sysdep.h>
#include <lowlevellock.h>
#include <internaltypes.h>
#include <semaphore.h>
#include <tls.h>
int
sem_post (sem_t *sem)
{
struct new_sem *isem = (struct new_sem *) sem;
__typeof (isem->value) cur;
do
{
cur = isem->value;
if (isem->value == SEM_VALUE_MAX)
{
__set_errno (EOVERFLOW);
return -1;
}
}
while (atomic_compare_and_exchange_bool_acq (&isem->value, cur + 1, cur));
atomic_full_barrier ();
if (isem->nwaiters > 0)
{
int err = lll_futex_wake (&isem->value, 1,
isem->private ^ FUTEX_PRIVATE_FLAG);
if (__builtin_expect (err, 0) < 0)
{
__set_errno (-err);
return -1;
}
}
return 0;
}
| {
"pile_set_name": "Github"
} |
[
["0","\u0000",127],
["8ea1","。",62],
["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],
["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],
["a2ba","∈∋⊆⊇⊂⊃∪∩"],
["a2ca","∧∨¬⇒⇔∀∃"],
["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],
["a2f2","ʼn♯♭♪†‡¶"],
["a2fe","◯"],
["a3b0","0",9],
["a3c1","A",25],
["a3e1","a",25],
["a4a1","ぁ",82],
["a5a1","ァ",85],
["a6a1","Α",16,"Σ",6],
["a6c1","α",16,"σ",6],
["a7a1","А",5,"ЁЖ",25],
["a7d1","а",5,"ёж",25],
["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],
["ada1","①",19,"Ⅰ",9],
["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],
["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],
["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],
["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],
["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],
["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],
["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],
["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],
["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],
["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],
["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],
["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],
["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],
["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],
["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],
["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],
["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],
["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],
["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],
["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],
["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],
["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],
["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],
["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],
["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],
["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],
["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],
["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],
["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],
["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],
["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],
["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],
["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],
["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],
["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],
["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],
["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],
["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],
["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],
["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],
["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],
["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],
["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],
["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],
["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],
["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],
["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],
["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],
["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],
["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],
["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],
["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],
["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],
["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],
["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],
["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],
["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],
["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],
["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],
["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],
["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],
["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],
["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],
["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],
["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],
["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],
["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],
["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],
["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],
["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],
["f4a1","堯槇遙瑤凜熙"],
["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],
["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],
["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],
["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],
["fcf1","ⅰ",9,"¬¦'""],
["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],
["8fa2c2","¡¦¿"],
["8fa2eb","ºª©®™¤№"],
["8fa6e1","ΆΈΉΊΪ"],
["8fa6e7","Ό"],
["8fa6e9","ΎΫ"],
["8fa6ec","Ώ"],
["8fa6f1","άέήίϊΐόςύϋΰώ"],
["8fa7c2","Ђ",10,"ЎЏ"],
["8fa7f2","ђ",10,"ўџ"],
["8fa9a1","ÆĐ"],
["8fa9a4","Ħ"],
["8fa9a6","IJ"],
["8fa9a8","ŁĿ"],
["8fa9ab","ŊØŒ"],
["8fa9af","ŦÞ"],
["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],
["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],
["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],
["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],
["8fabbd","ġĥíìïîǐ"],
["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],
["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],
["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],
["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],
["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],
["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],
["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],
["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],
["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],
["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],
["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],
["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],
["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],
["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],
["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],
["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],
["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],
["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],
["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],
["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],
["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],
["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],
["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],
["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],
["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],
["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],
["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],
["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],
["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],
["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],
["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],
["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],
["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],
["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],
["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],
["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],
["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],
["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],
["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],
["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],
["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],
["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],
["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],
["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],
["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],
["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],
["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],
["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],
["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],
["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],
["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],
["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],
["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],
["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],
["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],
["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],
["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],
["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],
["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],
["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],
["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],
["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],
["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]
]
| {
"pile_set_name": "Github"
} |
min-conflicts,97,0.817
| {
"pile_set_name": "Github"
} |
mlflow.sagemaker
================
.. automodule:: mlflow.sagemaker
:members:
:undoc-members:
:show-inheritance:
| {
"pile_set_name": "Github"
} |
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5.5
* @package PHPMailer
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2017 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* Get an OAuth2 token from an OAuth2 provider.
* * Install this script on your server so that it's accessible
* as [https/http]://<yourdomain>/<folder>/get_oauth_token.php
* e.g.: http://localhost/phpmailer/get_oauth_token.php
* * Ensure dependencies are installed with 'composer install'
* * Set up an app in your Google/Yahoo/Microsoft account
* * Set the script address as the app's redirect URL
* If no refresh token is obtained when running this file,
* revoke access to your app and run the script again.
*/
namespace PHPMailer\PHPMailer;
/**
* Aliases for League Provider Classes
* Make sure you have added these to your composer.json and run `composer install`
* Plenty to choose from here:
* @see http://oauth2-client.thephpleague.com/providers/thirdparty/
*/
// @see https://github.com/thephpleague/oauth2-google
use League\OAuth2\Client\Provider\Google;
// @see https://packagist.org/packages/hayageek/oauth2-yahoo
use Hayageek\OAuth2\Client\Provider\Yahoo;
// @see https://github.com/stevenmaguire/oauth2-microsoft
use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
if (!isset($_GET['code']) && !isset($_GET['provider'])) {
?>
<html>
<body>Select Provider:<br/>
<a href='?provider=Google'>Google</a><br/>
<a href='?provider=Yahoo'>Yahoo</a><br/>
<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/>
</body>
</html>
<?php
exit;
}
require 'vendor/autoload.php';
session_start();
$providerName = '';
if (array_key_exists('provider', $_GET)) {
$providerName = $_GET['provider'];
$_SESSION['provider'] = $providerName;
} elseif (array_key_exists('provider', $_SESSION)) {
$providerName = $_SESSION['provider'];
}
if (!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) {
exit('Only Google, Microsoft and Yahoo OAuth2 providers are currently supported in this script.');
}
//These details are obtained by setting up an app in the Google developer console,
//or whichever provider you're using.
$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com';
$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP';
//If this automatic URL doesn't work, set it yourself manually to the URL of this script
$redirectUri = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
//$redirectUri = 'http://localhost/PHPMailer/redirect';
$params = [
'clientId' => $clientId,
'clientSecret' => $clientSecret,
'redirectUri' => $redirectUri,
'accessType' => 'offline'
];
$options = [];
$provider = null;
switch ($providerName) {
case 'Google':
$provider = new Google($params);
$options = [
'scope' => [
'https://mail.google.com/'
]
];
break;
case 'Yahoo':
$provider = new Yahoo($params);
break;
case 'Microsoft':
$provider = new Microsoft($params);
$options = [
'scope' => [
'wl.imap',
'wl.offline_access'
]
];
break;
}
if (null === $provider) {
exit('Provider missing');
}
if (!isset($_GET['code'])) {
// If we don't have an authorization code then get one
$authUrl = $provider->getAuthorizationUrl($options);
$_SESSION['oauth2state'] = $provider->getState();
header('Location: ' . $authUrl);
exit;
// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
unset($_SESSION['oauth2state']);
unset($_SESSION['provider']);
exit('Invalid state');
} else {
unset($_SESSION['provider']);
// Try to get an access token (using the authorization code grant)
$token = $provider->getAccessToken(
'authorization_code',
[
'code' => $_GET['code']
]
);
// Use this to interact with an API on the users behalf
// Use this to get a new access token if the old one expires
echo 'Refresh Token: ', $token->getRefreshToken();
}
| {
"pile_set_name": "Github"
} |
package backoff
import "time"
/*
WithMaxRetries creates a wrapper around another BackOff, which will
return Stop if NextBackOff() has been called too many times since
the last time Reset() was called
Note: Implementation is not thread-safe.
*/
func WithMaxRetries(b BackOff, max uint64) BackOff {
return &backOffTries{delegate: b, maxTries: max}
}
type backOffTries struct {
delegate BackOff
maxTries uint64
numTries uint64
}
func (b *backOffTries) NextBackOff() time.Duration {
if b.maxTries > 0 {
if b.maxTries <= b.numTries {
return Stop
}
b.numTries++
}
return b.delegate.NextBackOff()
}
func (b *backOffTries) Reset() {
b.numTries = 0
b.delegate.Reset()
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace GitStatistics
{
public sealed class LineCounter
{
public event EventHandler Updated;
public int CommentLineCount { get; private set; }
public int TotalLineCount { get; private set; }
public int DesignerLineCount { get; private set; }
public int TestCodeLineCount { get; private set; }
public int BlankLineCount { get; private set; }
public int CodeLineCount { get; private set; }
public Dictionary<string, int> LinesOfCodePerExtension { get; } = new Dictionary<string, int>();
public void FindAndAnalyzeCodeFiles(string filePattern, string directoriesToIgnore, IEnumerable<string> filesToCheck)
{
var extensions = filePattern.Replace("*", "").Split(';').ToHashSet(StringComparer.InvariantCultureIgnoreCase);
var directoryFilter = directoriesToIgnore.Split(';');
var lastUpdate = DateTime.Now;
var timer = TimeSpan.FromMilliseconds(500);
foreach (var file in GetFiles())
{
if (DirectoryIsFiltered(file.Directory, directoryFilter))
{
continue;
}
AddFile(file);
if (DateTime.Now - lastUpdate > timer)
{
lastUpdate = DateTime.Now;
Updated?.Invoke(this, EventArgs.Empty);
}
}
return;
bool DirectoryIsFiltered(FileSystemInfo dir, IEnumerable<string> directoryFilters)
{
return directoryFilters.Any(
filter => dir.FullName.EndsWith(filter, StringComparison.InvariantCultureIgnoreCase));
}
IEnumerable<FileInfo> GetFiles()
{
foreach (var file in filesToCheck)
{
if (extensions.Contains(Path.GetExtension(file)))
{
FileInfo fileInfo;
try
{
fileInfo = new FileInfo(file);
}
catch
{
continue;
}
yield return fileInfo;
}
}
}
void AddFile(FileInfo file)
{
if (!file.Exists)
{
return;
}
var codeFile = CodeFile.Parse(file);
TotalLineCount += codeFile.TotalLineCount;
BlankLineCount += codeFile.BlankLineCount;
CommentLineCount += codeFile.CommentLineCount;
DesignerLineCount += codeFile.DesignerLineCount;
var extension = file.Extension.ToLower();
LinesOfCodePerExtension.TryGetValue(extension, out var linesForExtensions);
LinesOfCodePerExtension[extension] = linesForExtensions + codeFile.CodeLineCount;
CodeLineCount += codeFile.CodeLineCount;
if (codeFile.IsTestFile || file.Directory?.FullName.Contains("test", StringComparison.OrdinalIgnoreCase) == true)
{
TestCodeLineCount += codeFile.CodeLineCount;
}
}
}
}
} | {
"pile_set_name": "Github"
} |
import unittest
from test import support, mock_socket
import socket
import io
import smtpd
import asyncore
class DummyServer(smtpd.SMTPServer):
def __init__(self, localaddr, remoteaddr):
smtpd.SMTPServer.__init__(self, localaddr, remoteaddr)
self.messages = []
def process_message(self, peer, mailfrom, rcpttos, data):
self.messages.append((peer, mailfrom, rcpttos, data))
if data == 'return status':
return '250 Okish'
class DummyDispatcherBroken(Exception):
pass
class BrokenDummyServer(DummyServer):
def listen(self, num):
raise DummyDispatcherBroken()
class SMTPDServerTest(unittest.TestCase):
def setUp(self):
smtpd.socket = asyncore.socket = mock_socket
def test_process_message_unimplemented(self):
server = smtpd.SMTPServer('a', 'b')
conn, addr = server.accept()
channel = smtpd.SMTPChannel(server, conn, addr)
def write_line(line):
channel.socket.queue_recv(line)
channel.handle_read()
write_line(b'HELO example')
write_line(b'MAIL From:eggs@example')
write_line(b'RCPT To:spam@example')
write_line(b'DATA')
self.assertRaises(NotImplementedError, write_line, b'spam\r\n.\r\n')
def tearDown(self):
asyncore.close_all()
asyncore.socket = smtpd.socket = socket
class SMTPDChannelTest(unittest.TestCase):
def setUp(self):
smtpd.socket = asyncore.socket = mock_socket
self.old_debugstream = smtpd.DEBUGSTREAM
self.debug = smtpd.DEBUGSTREAM = io.StringIO()
self.server = DummyServer('a', 'b')
conn, addr = self.server.accept()
self.channel = smtpd.SMTPChannel(self.server, conn, addr)
def tearDown(self):
asyncore.close_all()
asyncore.socket = smtpd.socket = socket
smtpd.DEBUGSTREAM = self.old_debugstream
def write_line(self, line):
self.channel.socket.queue_recv(line)
self.channel.handle_read()
def test_broken_connect(self):
self.assertRaises(DummyDispatcherBroken, BrokenDummyServer, 'a', 'b')
def test_server_accept(self):
self.server.handle_accept()
def test_missing_data(self):
self.write_line(b'')
self.assertEqual(self.channel.socket.last,
b'500 Error: bad syntax\r\n')
def test_EHLO(self):
self.write_line(b'EHLO example')
self.assertEqual(self.channel.socket.last, b'250 HELP\r\n')
def test_EHLO_bad_syntax(self):
self.write_line(b'EHLO')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: EHLO hostname\r\n')
def test_EHLO_duplicate(self):
self.write_line(b'EHLO example')
self.write_line(b'EHLO example')
self.assertEqual(self.channel.socket.last,
b'503 Duplicate HELO/EHLO\r\n')
def test_EHLO_HELO_duplicate(self):
self.write_line(b'EHLO example')
self.write_line(b'HELO example')
self.assertEqual(self.channel.socket.last,
b'503 Duplicate HELO/EHLO\r\n')
def test_HELO(self):
name = smtpd.socket.getfqdn()
self.write_line(b'HELO example')
self.assertEqual(self.channel.socket.last,
'250 {}\r\n'.format(name).encode('ascii'))
def test_HELO_EHLO_duplicate(self):
self.write_line(b'HELO example')
self.write_line(b'EHLO example')
self.assertEqual(self.channel.socket.last,
b'503 Duplicate HELO/EHLO\r\n')
def test_HELP(self):
self.write_line(b'HELP')
self.assertEqual(self.channel.socket.last,
b'250 Supported commands: EHLO HELO MAIL RCPT ' + \
b'DATA RSET NOOP QUIT VRFY\r\n')
def test_HELP_command(self):
self.write_line(b'HELP MAIL')
self.assertEqual(self.channel.socket.last,
b'250 Syntax: MAIL FROM: <address>\r\n')
def test_HELP_command_unknown(self):
self.write_line(b'HELP SPAM')
self.assertEqual(self.channel.socket.last,
b'501 Supported commands: EHLO HELO MAIL RCPT ' + \
b'DATA RSET NOOP QUIT VRFY\r\n')
def test_HELO_bad_syntax(self):
self.write_line(b'HELO')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: HELO hostname\r\n')
def test_HELO_duplicate(self):
self.write_line(b'HELO example')
self.write_line(b'HELO example')
self.assertEqual(self.channel.socket.last,
b'503 Duplicate HELO/EHLO\r\n')
def test_HELO_parameter_rejected_when_extensions_not_enabled(self):
self.extended_smtp = False
self.write_line(b'HELO example')
self.write_line(b'MAIL from:<[email protected]> SIZE=1234')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: MAIL FROM: <address>\r\n')
def test_MAIL_allows_space_after_colon(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from: <[email protected]>')
self.assertEqual(self.channel.socket.last,
b'250 OK\r\n')
def test_extended_MAIL_allows_space_after_colon(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from: <[email protected]> size=20')
self.assertEqual(self.channel.socket.last,
b'250 OK\r\n')
def test_NOOP(self):
self.write_line(b'NOOP')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_HELO_NOOP(self):
self.write_line(b'HELO example')
self.write_line(b'NOOP')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_NOOP_bad_syntax(self):
self.write_line(b'NOOP hi')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: NOOP\r\n')
def test_QUIT(self):
self.write_line(b'QUIT')
self.assertEqual(self.channel.socket.last, b'221 Bye\r\n')
def test_HELO_QUIT(self):
self.write_line(b'HELO example')
self.write_line(b'QUIT')
self.assertEqual(self.channel.socket.last, b'221 Bye\r\n')
def test_QUIT_arg_ignored(self):
self.write_line(b'QUIT bye bye')
self.assertEqual(self.channel.socket.last, b'221 Bye\r\n')
def test_bad_state(self):
self.channel.smtp_state = 'BAD STATE'
self.write_line(b'HELO example')
self.assertEqual(self.channel.socket.last,
b'451 Internal confusion\r\n')
def test_command_too_long(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from: ' +
b'a' * self.channel.command_size_limit +
b'@example')
self.assertEqual(self.channel.socket.last,
b'500 Error: line too long\r\n')
def test_MAIL_command_limit_extended_with_SIZE(self):
self.write_line(b'EHLO example')
fill_len = self.channel.command_size_limit - len('MAIL from:<@example>')
self.write_line(b'MAIL from:<' +
b'a' * fill_len +
b'@example> SIZE=1234')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'MAIL from:<' +
b'a' * (fill_len + 26) +
b'@example> SIZE=1234')
self.assertEqual(self.channel.socket.last,
b'500 Error: line too long\r\n')
def test_data_longer_than_default_data_size_limit(self):
# Hack the default so we don't have to generate so much data.
self.channel.data_size_limit = 1048
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'DATA')
self.write_line(b'A' * self.channel.data_size_limit +
b'A\r\n.')
self.assertEqual(self.channel.socket.last,
b'552 Error: Too much mail data\r\n')
def test_MAIL_size_parameter(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL FROM:<eggs@example> SIZE=512')
self.assertEqual(self.channel.socket.last,
b'250 OK\r\n')
def test_MAIL_invalid_size_parameter(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL FROM:<eggs@example> SIZE=invalid')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: MAIL FROM: <address> [SP <mail-parameters>]\r\n')
def test_MAIL_RCPT_unknown_parameters(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL FROM:<eggs@example> ham=green')
self.assertEqual(self.channel.socket.last,
b'555 MAIL FROM parameters not recognized or not implemented\r\n')
self.write_line(b'MAIL FROM:<eggs@example>')
self.write_line(b'RCPT TO:<eggs@example> ham=green')
self.assertEqual(self.channel.socket.last,
b'555 RCPT TO parameters not recognized or not implemented\r\n')
def test_MAIL_size_parameter_larger_than_default_data_size_limit(self):
self.channel.data_size_limit = 1048
self.write_line(b'EHLO example')
self.write_line(b'MAIL FROM:<eggs@example> SIZE=2096')
self.assertEqual(self.channel.socket.last,
b'552 Error: message size exceeds fixed maximum message size\r\n')
def test_need_MAIL(self):
self.write_line(b'HELO example')
self.write_line(b'RCPT to:spam@example')
self.assertEqual(self.channel.socket.last,
b'503 Error: need MAIL command\r\n')
def test_MAIL_syntax_HELO(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from eggs@example')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: MAIL FROM: <address>\r\n')
def test_MAIL_syntax_EHLO(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from eggs@example')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: MAIL FROM: <address> [SP <mail-parameters>]\r\n')
def test_MAIL_missing_address(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from:')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: MAIL FROM: <address>\r\n')
def test_MAIL_chevrons(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from:<eggs@example>')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_MAIL_empty_chevrons(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from:<>')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_MAIL_quoted_localpart(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from: <"Fred Blogs"@example.com>')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.channel.mailfrom, '"Fred Blogs"@example.com')
def test_MAIL_quoted_localpart_no_angles(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from: "Fred Blogs"@example.com')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.channel.mailfrom, '"Fred Blogs"@example.com')
def test_MAIL_quoted_localpart_with_size(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from: <"Fred Blogs"@example.com> SIZE=1000')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.channel.mailfrom, '"Fred Blogs"@example.com')
def test_MAIL_quoted_localpart_with_size_no_angles(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL from: "Fred Blogs"@example.com SIZE=1000')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.channel.mailfrom, '"Fred Blogs"@example.com')
def test_nested_MAIL(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL from:eggs@example')
self.write_line(b'MAIL from:spam@example')
self.assertEqual(self.channel.socket.last,
b'503 Error: nested MAIL command\r\n')
def test_VRFY(self):
self.write_line(b'VRFY eggs@example')
self.assertEqual(self.channel.socket.last,
b'252 Cannot VRFY user, but will accept message and attempt ' + \
b'delivery\r\n')
def test_VRFY_syntax(self):
self.write_line(b'VRFY')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: VRFY <address>\r\n')
def test_EXPN_not_implemented(self):
self.write_line(b'EXPN')
self.assertEqual(self.channel.socket.last,
b'502 EXPN not implemented\r\n')
def test_no_HELO_MAIL(self):
self.write_line(b'MAIL from:<[email protected]>')
self.assertEqual(self.channel.socket.last,
b'503 Error: send HELO first\r\n')
def test_need_RCPT(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'DATA')
self.assertEqual(self.channel.socket.last,
b'503 Error: need RCPT command\r\n')
def test_RCPT_syntax_HELO(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From: eggs@example')
self.write_line(b'RCPT to eggs@example')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: RCPT TO: <address>\r\n')
def test_RCPT_syntax_EHLO(self):
self.write_line(b'EHLO example')
self.write_line(b'MAIL From: eggs@example')
self.write_line(b'RCPT to eggs@example')
self.assertEqual(self.channel.socket.last,
b'501 Syntax: RCPT TO: <address> [SP <mail-parameters>]\r\n')
def test_RCPT_lowercase_to_OK(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From: eggs@example')
self.write_line(b'RCPT to: <eggs@example>')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_no_HELO_RCPT(self):
self.write_line(b'RCPT to eggs@example')
self.assertEqual(self.channel.socket.last,
b'503 Error: send HELO first\r\n')
def test_data_dialog(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'RCPT To:spam@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'DATA')
self.assertEqual(self.channel.socket.last,
b'354 End data with <CR><LF>.<CR><LF>\r\n')
self.write_line(b'data\r\nmore\r\n.')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.server.messages,
[('peer', 'eggs@example', ['spam@example'], 'data\nmore')])
def test_DATA_syntax(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'DATA spam')
self.assertEqual(self.channel.socket.last, b'501 Syntax: DATA\r\n')
def test_no_HELO_DATA(self):
self.write_line(b'DATA spam')
self.assertEqual(self.channel.socket.last,
b'503 Error: send HELO first\r\n')
def test_data_transparency_section_4_5_2(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'DATA')
self.write_line(b'..\r\n.\r\n')
self.assertEqual(self.channel.received_data, '.')
def test_multiple_RCPT(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'RCPT To:ham@example')
self.write_line(b'DATA')
self.write_line(b'data\r\n.')
self.assertEqual(self.server.messages,
[('peer', 'eggs@example', ['spam@example','ham@example'], 'data')])
def test_manual_status(self):
# checks that the Channel is able to return a custom status message
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'DATA')
self.write_line(b'return status\r\n.')
self.assertEqual(self.channel.socket.last, b'250 Okish\r\n')
def test_RSET(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.write_line(b'RCPT To:spam@example')
self.write_line(b'RSET')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'MAIL From:foo@example')
self.write_line(b'RCPT To:eggs@example')
self.write_line(b'DATA')
self.write_line(b'data\r\n.')
self.assertEqual(self.server.messages,
[('peer', 'foo@example', ['eggs@example'], 'data')])
def test_HELO_RSET(self):
self.write_line(b'HELO example')
self.write_line(b'RSET')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
def test_RSET_syntax(self):
self.write_line(b'RSET hi')
self.assertEqual(self.channel.socket.last, b'501 Syntax: RSET\r\n')
def test_unknown_command(self):
self.write_line(b'UNKNOWN_CMD')
self.assertEqual(self.channel.socket.last,
b'500 Error: command "UNKNOWN_CMD" not ' + \
b'recognized\r\n')
def test_attribute_deprecations(self):
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__server
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__server = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__line
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__line = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__state
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__state = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__greeting
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__greeting = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__mailfrom
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__mailfrom = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__rcpttos
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__rcpttos = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__data
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__data = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__fqdn
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__fqdn = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__peer
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__peer = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__conn
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__conn = 'spam'
with support.check_warnings(('', DeprecationWarning)):
spam = self.channel._SMTPChannel__addr
with support.check_warnings(('', DeprecationWarning)):
self.channel._SMTPChannel__addr = 'spam'
class SMTPDChannelWithDataSizeLimitTest(unittest.TestCase):
def setUp(self):
smtpd.socket = asyncore.socket = mock_socket
self.old_debugstream = smtpd.DEBUGSTREAM
self.debug = smtpd.DEBUGSTREAM = io.StringIO()
self.server = DummyServer('a', 'b')
conn, addr = self.server.accept()
# Set DATA size limit to 32 bytes for easy testing
self.channel = smtpd.SMTPChannel(self.server, conn, addr, 32)
def tearDown(self):
asyncore.close_all()
asyncore.socket = smtpd.socket = socket
smtpd.DEBUGSTREAM = self.old_debugstream
def write_line(self, line):
self.channel.socket.queue_recv(line)
self.channel.handle_read()
def test_data_limit_dialog(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'RCPT To:spam@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'DATA')
self.assertEqual(self.channel.socket.last,
b'354 End data with <CR><LF>.<CR><LF>\r\n')
self.write_line(b'data\r\nmore\r\n.')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.assertEqual(self.server.messages,
[('peer', 'eggs@example', ['spam@example'], 'data\nmore')])
def test_data_limit_dialog_too_much_data(self):
self.write_line(b'HELO example')
self.write_line(b'MAIL From:eggs@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'RCPT To:spam@example')
self.assertEqual(self.channel.socket.last, b'250 OK\r\n')
self.write_line(b'DATA')
self.assertEqual(self.channel.socket.last,
b'354 End data with <CR><LF>.<CR><LF>\r\n')
self.write_line(b'This message is longer than 32 bytes\r\n.')
self.assertEqual(self.channel.socket.last,
b'552 Error: Too much mail data\r\n')
if __name__ == "__main__":
unittest.main()
| {
"pile_set_name": "Github"
} |
import unittest
from recipe_scrapers._schemaorg import SchemaOrg
class TestSchemaOrg(unittest.TestCase):
def setUp(self):
with open("tests/test_data/schemaorg.testhtml", encoding="utf-8") as pagedata:
self.schema = SchemaOrg(pagedata.read(), None)
def test_total_time_with_schema_missing_all_data(self):
keys = ["totalTime", "cookTime", "prepTime"]
for k in keys:
if k in self.schema.data:
del self.schema.data[k]
self.assertEqual(self.schema.total_time(), 0)
| {
"pile_set_name": "Github"
} |
{
"name": "transcripts",
"description": "Changelog episode transcripts in Markdown format",
"scripts": {
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
},
"repository": {
"type": "git",
"url": "git+https://github.com/thechangelog/transcripts.git"
},
"license": "CC-BY-4.0",
"bugs": {
"url": "https://github.com/thechangelog/transcripts/issues"
},
"homepage": "https://github.com/thechangelog/transcripts#readme",
"devDependencies": {
"all-contributors-cli": "^4.10.0"
}
}
| {
"pile_set_name": "Github"
} |
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2017. All rights reserved.
//
// Web: http://www.scichart.com
// Support: [email protected]
// Sales: [email protected]
//
// FlipAnimation.java is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
//******************************************************************************
package com.scichart.examples.components.SideMenuAnimations;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.view.animation.Animation;
import android.view.animation.Transformation;
public class FlipAnimation extends Animation {
private final float fromDegrees;
private final float toDegrees;
private final float centerX;
private final float centerY;
private Camera mCamera;
public FlipAnimation(float fromDegrees, float toDegrees, float centerX, float centerY) {
this.fromDegrees = fromDegrees;
this.toDegrees = toDegrees;
this.centerX = centerX;
this.centerY = centerY;
}
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
mCamera = new Camera();
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float degrees = fromDegrees + ((toDegrees - fromDegrees) * interpolatedTime);
final Matrix matrix = t.getMatrix();
final Camera camera = mCamera;
camera.save();
camera.rotateY(degrees);
camera.getMatrix(matrix);
camera.restore();
matrix.preTranslate(-centerX, -centerY);
matrix.postTranslate(centerX, centerY);
}
} | {
"pile_set_name": "Github"
} |
---
layout: default
---
<main class="content" role="main">
<article class="post single-post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header short-diver">
<h1 class="post-title" itemprop="name headline">{{ page.title }}</h1>
</header>
<section class="post-content short-diver" itemprop="articleBody">
{{content}}
</section>
</article>
</main>
{% include photoswipe.html %}
{% include post_scripts.html %} | {
"pile_set_name": "Github"
} |
// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=DEFAULT
// RUN: %clang -fsyntax-only -fdiagnostics-format=clang %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=DEFAULT
// RUN: %clang -fsyntax-only -fdiagnostics-format=clang -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=DEFAULT
//
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1300 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1800 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2013
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1900 -target x86_64-pc-win32 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2015
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fms-compatibility-version=13.00 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1800 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2013
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fmsc-version=1900 -target x86_64-pc-win32 -fshow-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2015
//
// RUN: %clang -fsyntax-only -fdiagnostics-format=vi %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=VI
//
// RUN: %clang -fsyntax-only -fdiagnostics-format=msvc -fno-show-column -fmsc-version=1900 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2015_ORIG
//
// RUN: %clang -fsyntax-only -fno-show-column %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=NO_COLUMN
//
// RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fmsc-version=1300 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010-FALLBACK
// RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fms-compatibility-version=13.00 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2010-FALLBACK
// RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fmsc-version=1800 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2013-FALLBACK
// RUN: not %clang -fsyntax-only -Werror -fdiagnostics-format=msvc-fallback -fmsc-version=1900 %s 2>&1 | FileCheck %s --strict-whitespace -check-prefix=MSVC2015-FALLBACK
#ifdef foo
#endif bad // extension!
// DEFAULT: {{.*}}:36:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC2010: {{.*}}(36,7) : warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC2013: {{.*}}(36,8) : warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC: {{.*\(36,[78]\) ?}}: warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC2015: {{.*}}(36,8): warning: extra tokens at end of #endif directive [-Wextra-tokens]
// VI: {{.*}} +36:8: warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC2015_ORIG: {{.*}}(36): warning: extra tokens at end of #endif directive [-Wextra-tokens]
// NO_COLUMN: {{.*}}:36: warning: extra tokens at end of #endif directive [-Wextra-tokens]
// MSVC2010-FALLBACK: {{.*}}(36,7) : error(clang): extra tokens at end of #endif directive
// MSVC2013-FALLBACK: {{.*}}(36,8) : error(clang): extra tokens at end of #endif directive
// MSVC2015-FALLBACK: {{.*}}(36,8): error(clang): extra tokens at end of #endif directive
int x;
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.nashorn.internal.runtime.linker;
/**
* <p>
* Implements the name mangling and demangling as specified by John Rose's
* <a href="https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm"
* target="_blank">"Symbolic Freedom in the VM"</a> article. Normally, you would
* mangle the names in the call sites as you're generating bytecode, and then
* demangle them when you receive them in bootstrap methods.
* </p>
* <p>
* This code is derived from sun.invoke.util.BytecodeName. Apart from subsetting that
* class, we don't want to create dependency between non-exported package from java.base
* to nashorn module.
* </p>
*
* <h3>Comment from BytecodeName class reproduced here:</h3>
*
* Includes universal mangling rules for the JVM.
*
* <h3>Avoiding Dangerous Characters </h3>
*
* <p>
* The JVM defines a very small set of characters which are illegal
* in name spellings. We will slightly extend and regularize this set
* into a group of <cite>dangerous characters</cite>.
* These characters will then be replaced, in mangled names, by escape sequences.
* In addition, accidental escape sequences must be further escaped.
* Finally, a special prefix will be applied if and only if
* the mangling would otherwise fail to begin with the escape character.
* This happens to cover the corner case of the null string,
* and also clearly marks symbols which need demangling.
* </p>
* <p>
* Dangerous characters are the union of all characters forbidden
* or otherwise restricted by the JVM specification,
* plus their mates, if they are brackets
* (<code><b>[</b></code> and <code><b>]</b></code>,
* <code><b><</b></code> and <code><b>></b></code>),
* plus, arbitrarily, the colon character <code><b>:</b></code>.
* There is no distinction between type, method, and field names.
* This makes it easier to convert between mangled names of different
* types, since they do not need to be decoded (demangled).
* </p>
* <p>
* The escape character is backslash <code><b>\</b></code>
* (also known as reverse solidus).
* This character is, until now, unheard of in bytecode names,
* but traditional in the proposed role.
*
* </p>
* <h3> Replacement Characters </h3>
*
*
* <p>
* Every escape sequence is two characters
* (in fact, two UTF8 bytes) beginning with
* the escape character and followed by a
* <cite>replacement character</cite>.
* (Since the replacement character is never a backslash,
* iterated manglings do not double in size.)
* </p>
* <p>
* Each dangerous character has some rough visual similarity
* to its corresponding replacement character.
* This makes mangled symbols easier to recognize by sight.
* </p>
* <p>
* The dangerous characters are
* <code><b>/</b></code> (forward slash, used to delimit package components),
* <code><b>.</b></code> (dot, also a package delimiter),
* <code><b>;</b></code> (semicolon, used in signatures),
* <code><b>$</b></code> (dollar, used in inner classes and synthetic members),
* <code><b><</b></code> (left angle),
* <code><b>></b></code> (right angle),
* <code><b>[</b></code> (left square bracket, used in array types),
* <code><b>]</b></code> (right square bracket, reserved in this scheme for language use),
* and <code><b>:</b></code> (colon, reserved in this scheme for language use).
* Their replacements are, respectively,
* <code><b>|</b></code> (vertical bar),
* <code><b>,</b></code> (comma),
* <code><b>?</b></code> (question mark),
* <code><b>%</b></code> (percent),
* <code><b>^</b></code> (caret),
* <code><b>_</b></code> (underscore), and
* <code><b>{</b></code> (left curly bracket),
* <code><b>}</b></code> (right curly bracket),
* <code><b>!</b></code> (exclamation mark).
* In addition, the replacement character for the escape character itself is
* <code><b>-</b></code> (hyphen),
* and the replacement character for the null prefix is
* <code><b>=</b></code> (equal sign).
* </p>
* <p>
* An escape character <code><b>\</b></code>
* followed by any of these replacement characters
* is an escape sequence, and there are no other escape sequences.
* An equal sign is only part of an escape sequence
* if it is the second character in the whole string, following a backslash.
* Two consecutive backslashes do <em>not</em> form an escape sequence.
* </p>
* <p>
* Each escape sequence replaces a so-called <cite>original character</cite>
* which is either one of the dangerous characters or the escape character.
* A null prefix replaces an initial null string, not a character.
* </p>
* <p>
* All this implies that escape sequences cannot overlap and may be
* determined all at once for a whole string. Note that a spelling
* string can contain <cite>accidental escapes</cite>, apparent escape
* sequences which must not be interpreted as manglings.
* These are disabled by replacing their leading backslash with an
* escape sequence (<code><b>\-</b></code>). To mangle a string, three logical steps
* are required, though they may be carried out in one pass:
* </p>
* <ol>
* <li>In each accidental escape, replace the backslash with an escape sequence
* (<code><b>\-</b></code>).</li>
* <li>Replace each dangerous character with an escape sequence
* (<code><b>\|</b></code> for <code><b>/</b></code>, etc.).</li>
* <li>If the first two steps introduced any change, <em>and</em>
* if the string does not already begin with a backslash, prepend a null prefix (<code><b>\=</b></code>).</li>
* </ol>
*
* To demangle a mangled string that begins with an escape,
* remove any null prefix, and then replace (in parallel)
* each escape sequence by its original character.
* <p>Spelling strings which contain accidental
* escapes <em>must</em> have them replaced, even if those
* strings do not contain dangerous characters.
* This restriction means that mangling a string always
* requires a scan of the string for escapes.
* But then, a scan would be required anyway,
* to check for dangerous characters.
*
* </p>
* <h3> Nice Properties </h3>
*
* <p>
* If a bytecode name does not contain any escape sequence,
* demangling is a no-op: The string demangles to itself.
* Such a string is called <cite>self-mangling</cite>.
* Almost all strings are self-mangling.
* In practice, to demangle almost any name “found in nature”,
* simply verify that it does not begin with a backslash.
* </p>
* <p>
* Mangling is a one-to-one function, while demangling
* is a many-to-one function.
* A mangled string is defined as <cite>validly mangled</cite> if
* it is in fact the unique mangling of its spelling string.
* Three examples of invalidly mangled strings are <code><b>\=foo</b></code>,
* <code><b>\-bar</b></code>, and <code><b>baz\!</b></code>, which demangle to <code><b>foo</b></code>, <code><b>\bar</b></code>, and
* <code><b>baz\!</b></code>, but then remangle to <code><b>foo</b></code>, <code><b>\bar</b></code>, and <code><b>\=baz\-!</b></code>.
* If a language back-end or runtime is using mangled names,
* it should never present an invalidly mangled bytecode
* name to the JVM. If the runtime encounters one,
* it should also report an error, since such an occurrence
* probably indicates a bug in name encoding which
* will lead to errors in linkage.
* However, this note does not propose that the JVM verifier
* detect invalidly mangled names.
* </p>
* <p>
* As a result of these rules, it is a simple matter to
* compute validly mangled substrings and concatenations
* of validly mangled strings, and (with a little care)
* these correspond to corresponding operations on their
* spelling strings.
* </p>
* <ul>
* <li>Any prefix of a validly mangled string is also validly mangled,
* although a null prefix may need to be removed.</li>
* <li>Any suffix of a validly mangled string is also validly mangled,
* although a null prefix may need to be added.</li>
* <li>Two validly mangled strings, when concatenated,
* are also validly mangled, although any null prefix
* must be removed from the second string,
* and a trailing backslash on the first string may need escaping,
* if it would participate in an accidental escape when followed
* by the first character of the second string.</li>
* </ul>
* <p>If languages that include non-Java symbol spellings use this
* mangling convention, they will enjoy the following advantages:
* </p>
* <ul>
* <li>They can interoperate via symbols they share in common.</li>
* <li>Low-level tools, such as backtrace printers, will have readable displays.</li>
* <li>Future JVM and language extensions can safely use the dangerous characters
* for structuring symbols, but will never interfere with valid spellings.</li>
* <li>Runtimes and compilers can use standard libraries for mangling and demangling.</li>
* <li>Occasional transliterations and name composition will be simple and regular,
* for classes, methods, and fields.</li>
* <li>Bytecode names will continue to be compact.
* When mangled, spellings will at most double in length, either in
* UTF8 or UTF16 format, and most will not change at all.</li>
* </ul>
*
*
* <h3> Suggestions for Human Readable Presentations </h3>
*
*
* <p>
* For human readable displays of symbols,
* it will be better to present a string-like quoted
* representation of the spelling, because JVM users
* are generally familiar with such tokens.
* We suggest using single or double quotes before and after
* mangled symbols which are not valid Java identifiers,
* with quotes, backslashes, and non-printing characters
* escaped as if for literals in the Java language.
* </p>
* <p>
* For example, an HTML-like spelling
* <code><b><pre></b></code> mangles to
* <code><b>\^pre\_</b></code> and could
* display more cleanly as
* <code><b>'<pre>'</b></code>,
* with the quotes included.
* Such string-like conventions are <em>not</em> suitable
* for mangled bytecode names, in part because
* dangerous characters must be eliminated, rather
* than just quoted. Otherwise internally structured
* strings like package prefixes and method signatures
* could not be reliably parsed.
* </p>
* <p>
* In such human-readable displays, invalidly mangled
* names should <em>not</em> be demangled and quoted,
* for this would be misleading. Likewise, JVM symbols
* which contain dangerous characters (like dots in field
* names or brackets in method names) should not be
* simply quoted. The bytecode names
* <code><b>\=phase\,1</b></code> and
* <code><b>phase.1</b></code> are distinct,
* and in demangled displays they should be presented as
* <code><b>'phase.1'</b></code> and something like
* <code><b>'phase'.1</b></code>, respectively.
* </p>
*/
public final class NameCodec {
private NameCodec() {
}
private static final char ESCAPE_C = '\\';
// empty escape sequence to avoid a null name or illegal prefix
private static final char NULL_ESCAPE_C = '=';
private static final String NULL_ESCAPE = ESCAPE_C+""+NULL_ESCAPE_C;
/**
* Canonical encoding for the empty name.
*/
public static final String EMPTY_NAME = new String(new char[] { ESCAPE_C, NULL_ESCAPE_C });
/**
* Encodes ("mangles") an unencoded symbolic name.
* @param name the symbolic name to mangle
* @return the mangled form of the symbolic name.
*/
public static String encode(final String name) {
final String bn = mangle(name);
assert((Object)bn == name || looksMangled(bn)) : bn;
assert(name.equals(decode(bn))) : name;
return bn;
}
/**
* Decodes ("demangles") an encoded symbolic name.
* @param name the symbolic name to demangle
* @return the demangled form of the symbolic name.
*/
public static String decode(final String name) {
String sn = name;
if (!sn.isEmpty() && looksMangled(name)) {
sn = demangle(name);
assert(name.equals(mangle(sn))) : name+" => "+sn+" => "+mangle(sn);
}
return sn;
}
private static boolean looksMangled(final String s) {
return s.charAt(0) == ESCAPE_C;
}
private static String mangle(final String s) {
if (s.length() == 0)
return NULL_ESCAPE;
// build this lazily, when we first need an escape:
StringBuilder sb = null;
for (int i = 0, slen = s.length(); i < slen; i++) {
final char c = s.charAt(i);
boolean needEscape = false;
if (c == ESCAPE_C) {
if (i+1 < slen) {
final char c1 = s.charAt(i+1);
if ((i == 0 && c1 == NULL_ESCAPE_C)
|| c1 != originalOfReplacement(c1)) {
// an accidental escape
needEscape = true;
}
}
} else {
needEscape = isDangerous(c);
}
if (!needEscape) {
if (sb != null) sb.append(c);
continue;
}
// build sb if this is the first escape
if (sb == null) {
sb = new StringBuilder(s.length()+10);
// mangled names must begin with a backslash:
if (s.charAt(0) != ESCAPE_C && i > 0)
sb.append(NULL_ESCAPE);
// append the string so far, which is unremarkable:
sb.append(s, 0, i);
}
// rewrite \ to \-, / to \|, etc.
sb.append(ESCAPE_C);
sb.append(replacementOf(c));
}
if (sb != null) return sb.toString();
return s;
}
private static String demangle(final String s) {
// build this lazily, when we first meet an escape:
StringBuilder sb = null;
int stringStart = 0;
if (s.startsWith(NULL_ESCAPE))
stringStart = 2;
for (int i = stringStart, slen = s.length(); i < slen; i++) {
char c = s.charAt(i);
if (c == ESCAPE_C && i+1 < slen) {
// might be an escape sequence
final char rc = s.charAt(i+1);
final char oc = originalOfReplacement(rc);
if (oc != rc) {
// build sb if this is the first escape
if (sb == null) {
sb = new StringBuilder(s.length());
// append the string so far, which is unremarkable:
sb.append(s, stringStart, i);
}
++i; // skip both characters
c = oc;
}
}
if (sb != null)
sb.append(c);
}
if (sb != null) return sb.toString();
return s.substring(stringStart);
}
private static final String DANGEROUS_CHARS = "\\/.;:$[]<>"; // \\ must be first
private static final String REPLACEMENT_CHARS = "-|,?!%{}^_";
private static final int DANGEROUS_CHAR_FIRST_INDEX = 1; // index after \\
private static final long[] SPECIAL_BITMAP = new long[2]; // 128 bits
static {
final String SPECIAL = DANGEROUS_CHARS + REPLACEMENT_CHARS;
for (final char c : SPECIAL.toCharArray()) {
SPECIAL_BITMAP[c >>> 6] |= 1L << c;
}
}
private static boolean isSpecial(final char c) {
if ((c >>> 6) < SPECIAL_BITMAP.length)
return ((SPECIAL_BITMAP[c >>> 6] >> c) & 1) != 0;
else
return false;
}
private static char replacementOf(final char c) {
if (!isSpecial(c)) return c;
final int i = DANGEROUS_CHARS.indexOf(c);
if (i < 0) return c;
return REPLACEMENT_CHARS.charAt(i);
}
private static char originalOfReplacement(final char c) {
if (!isSpecial(c)) return c;
final int i = REPLACEMENT_CHARS.indexOf(c);
if (i < 0) return c;
return DANGEROUS_CHARS.charAt(i);
}
private static boolean isDangerous(final char c) {
if (!isSpecial(c)) return false;
return (DANGEROUS_CHARS.indexOf(c) >= DANGEROUS_CHAR_FIRST_INDEX);
}
}
| {
"pile_set_name": "Github"
} |
diff -urpN a/drivers/i2c/busses/xgs_iproc_smbus.c b/drivers/i2c/busses/xgs_iproc_smbus.c
--- a/drivers/i2c/busses/xgs_iproc_smbus.c 2018-12-17 15:00:29.412457650 +0000
+++ b/drivers/i2c/busses/xgs_iproc_smbus.c 2018-12-17 15:01:26.255275662 +0000
@@ -52,6 +52,8 @@
(regval & ~(mask)) | \
((fldval) << (startbit))
+//#define IPROC_SMB_DBG 1
+
typedef enum iproc_smb_clk_freq {
I2C_SPEED_100KHz = 0,
I2C_SPEED_400KHz = 1,
@@ -178,7 +180,7 @@ static int iproc_smb_set_clk_freq(void _
SETREGFLDVAL(regval, val, CCB_SMB_TIMGCFG_MODE400_MASK,
CCB_SMB_TIMGCFG_MODE400_SHIFT);
writel(regval, base_addr + CCB_SMB_TIMGCFG_REG);
-
+
return 0;
}
@@ -208,9 +210,20 @@ static int iproc_smbus_block_init(struct
udelay(100);
/* Set default clock frequency */
- if (of_property_read_u32(dn, "clock-frequency", &i2c_clk_freq))
- /*no property available, use default: 100KHz*/
- i2c_clk_freq = I2C_SPEED_100KHz;
+ if (of_property_read_u32(dn, "clock-frequency", &i2c_clk_freq)) {
+ /*no property available, use default: 100KHz*/
+ i2c_clk_freq = 100000;
+ }
+
+/* Edgecore patch */
+ if (i2c_clk_freq == 400000) {
+ dev_info(dev->dev, "bus set to %u Hz\n", i2c_clk_freq);
+ i2c_clk_freq = I2C_SPEED_400KHz;
+ } else {
+ dev_info(dev->dev, "bus set to %u Hz\n", 100000);
+ i2c_clk_freq = I2C_SPEED_100KHz;
+ }
+
iproc_smb_set_clk_freq(base_addr, i2c_clk_freq);
/* Disable intrs */
@@ -577,7 +590,9 @@ static int iproc_smb_data_send(struct i2
if (regval != MSTR_STS_XACT_SUCCESS) {
/* We can flush Tx FIFO here */
+#ifdef IPROC_SMB_DBG
dev_err(dev->dev, "Send: Error in transaction\n");
+#endif
return -EREMOTEIO;
}
}
@@ -662,7 +677,9 @@ static int iproc_smb_data_recv(struct i2
if (regval != MSTR_STS_XACT_SUCCESS) {
/* We can flush Tx FIFO here */
+#ifdef IPROC_SMB_DBG
dev_info(dev->dev, "Error in transaction\n");
+#endif
return -EREMOTEIO;
}
}
@@ -840,8 +857,10 @@ static int iproc_smb_xfer(struct i2c_ada
}
if (rc < 0) {
+#ifdef IPROC_SMB_DBG
dev_info(dev->dev, "%s error accessing\n",
(read_write == I2C_SMBUS_READ) ? "Read" : "Write");
+#endif
up(&dev->xfer_lock);
return -EREMOTEIO;
}
@@ -856,7 +875,8 @@ static int iproc_smb_xfer(struct i2c_ada
}
}
- msleep(1);
+ /* Edge-core comments out the sleep to speed up EEPROM dump */
+ //msleep(1);
up(&dev->xfer_lock);
return (rc);
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
<title>SetPermissions Task</title>
</head>
<body>
<h2 id="setpermissions">SetPermissions</h2>
<p><em>Since Ant 1.10.0</em>.</p>
<h3>Description</h3>
<p>Changes the file permissions using Java's NIO support for permissions.</p>
<p>This task provides a subset of the platform specific abilities of <a href="chmod.html">chmod</a>
and <a href="attrib.html">attrib</a> in a platform independent way.</p>
<p>If no permissions are specified either via the mode or the permissions attribute, then all
permissions will be removed from the nested resources.</p>
<p>The task accepts arbitrary resources as part of the nested resource collections, but not all
resources support setting permissions. This task won't do anything for resources that don't support
setting permissions—for example URLs.</p>
<p>The permissions are applied to all resources contained within the nested resources
collections. You may want to ensure the collection only returns files or directories if you want
different sets of permissions to apply to either type of resource.</p>
<h3>Parameters</h3>
<table class="attr">
<tr>
<th scope="col">Attribute</th>
<th scope="col">Description</th>
<th scope="col">Required</th>
</tr>
<tr>
<td>permissions</td>
<td>The permissions to set as comma separated list of names
of <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/PosixFilePermission.html"
target="_top">PosixFilePermission</a> values.</td>
<td>No</td>
</tr>
<tr>
<td>mode</td>
<td>The permissions to set as traditional Unix three-digit octal number.</td>
<td>No</td>
</tr>
<tr>
<td>nonPosixMode</td>
<td>What to do if changing the permissions of a file is not possible because the file-system
doesn't support POSIX file permissions. Possible options are <q>fail</q> (fail the
build), <q>pass</q> (just log an error), <q>tryDosOrFail</q> (at least try to set the
read-only flag on DOS file systems, fail if that isn't possible either)
and <q>tryDosOrPass</q> (at least try to set the read-only flag on DOS file systems, just log
an error if that isn't possible either).</td>
<td>No; defaults to <q>fail</q></td>
</tr>
<tr>
<td>failonerror</td>
<td>Whether to stop the build if setting permissions fails.</td>
<td>No; defaults to <q>true</q></td>
</tr>
</table>
<h3>Parameters specified as nested elements</h3>
<h4>any resource collection</h4>
<p><a href="../Types/resources.html#collection">resource collections</a> are used to select groups
of resources.</p>
<h3>Examples</h3>
<p>Make the <samp>start.sh</samp> file readable and executable for anyone and in addition writable
by the owner.</p>
<pre>
<setpermissions mode="755">
<file file="${dist}/start.sh"/>
</setpermissions></pre>
<p>Make the <samp>start.sh</samp> file readable and executable for anyone and in addition writable
by the owner.</p>
<pre>
<setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE">
<file file="${dist}/start.sh"/>
</setpermissions></pre>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* The functions step along the lines from xLeft to xRight and apply
* the bilinear filtering.
*
*/
#include "vis_proto.h"
#include "mlib_image.h"
#include "mlib_ImageCopy.h"
#include "mlib_ImageAffine.h"
#include "mlib_v_ImageFilters.h"
#include "mlib_v_ImageChannelExtract.h"
/***************************************************************/
/*#define MLIB_VIS2*/
/***************************************************************/
#define DTYPE mlib_u8
#define FUN_NAME(CHAN) mlib_ImageAffine_u8_##CHAN##_bl
/***************************************************************/
static mlib_status FUN_NAME(2ch_na)(mlib_affine_param *param);
static mlib_status FUN_NAME(4ch_na)(mlib_affine_param *param);
/***************************************************************/
#ifdef MLIB_VIS2
#define MLIB_WRITE_BMASK(bmask) vis_write_bmask(bmask, 0)
#else
#define MLIB_WRITE_BMASK(bmask)
#endif /* MLIB_VIS2 */
/***************************************************************/
#define FILTER_BITS 8
/***************************************************************/
#undef DECLAREVAR
#define DECLAREVAR() \
DECLAREVAR0(); \
mlib_s32 *warp_tbl = param -> warp_tbl; \
mlib_s32 srcYStride = param -> srcYStride; \
mlib_u8 *dl; \
mlib_s32 i, size; \
mlib_d64 k05 = vis_to_double_dup(0x00080008); \
mlib_d64 d0, d1, d2, d3, dd
/***************************************************************/
#define FMUL_16x16(x, y) \
vis_fpadd16(vis_fmul8sux16(x, y), vis_fmul8ulx16(x, y))
/***************************************************************/
#define BUF_SIZE 512
/***************************************************************/
const mlib_u32 mlib_fmask_arr[] = {
0x00000000, 0x000000FF, 0x0000FF00, 0x0000FFFF,
0x00FF0000, 0x00FF00FF, 0x00FFFF00, 0x00FFFFFF,
0xFF000000, 0xFF0000FF, 0xFF00FF00, 0xFF00FFFF,
0xFFFF0000, 0xFFFF00FF, 0xFFFFFF00, 0xFFFFFFFF
};
/***************************************************************/
#define DOUBLE_4U16(x0, x1, x2, x3) \
vis_to_double((((x0 & 0xFFFE) << 15) | ((x1 & 0xFFFE) >> 1)), \
(((x2 & 0xFFFE) << 15) | ((x3 & 0xFFFE) >> 1)))
/***************************************************************/
#define BL_SUM(HL) \
delta1_x = vis_fpsub16(mask_7fff, deltax); \
delta1_y = vis_fpsub16(mask_7fff, deltay); \
\
d0 = vis_fmul8x16(vis_read_##HL(s0), delta1_x); \
d1 = vis_fmul8x16(vis_read_##HL(s1), deltax); \
d0 = vis_fpadd16(d0, d1); \
d0 = FMUL_16x16(d0, delta1_y); \
d2 = vis_fmul8x16(vis_read_##HL(s2), delta1_x); \
d3 = vis_fmul8x16(vis_read_##HL(s3), deltax); \
d2 = vis_fpadd16(d2, d3); \
d2 = FMUL_16x16(d2, deltay); \
dd = vis_fpadd16(d0, d2); \
dd = vis_fpadd16(dd, k05); \
df = vis_fpack16(dd); \
\
deltax = vis_fpadd16(deltax, dx64); \
deltay = vis_fpadd16(deltay, dy64); \
deltax = vis_fand(deltax, mask_7fff); \
deltay = vis_fand(deltay, mask_7fff)
/***************************************************************/
#define GET_FILTER_XY() \
mlib_d64 filterx, filtery, filterxy; \
mlib_s32 filterpos; \
filterpos = (X >> FILTER_SHIFT) & FILTER_MASK; \
filterx = *((mlib_d64 *) ((mlib_u8 *) mlib_filters_u8_bl + \
filterpos)); \
filterpos = (Y >> FILTER_SHIFT) & FILTER_MASK; \
filtery = *((mlib_d64 *) ((mlib_u8 *) mlib_filters_u8_bl + \
filterpos + 8*FILTER_SIZE)); \
filterxy = FMUL_16x16(filterx, filtery)
/***************************************************************/
#define LD_U8(sp, ind) vis_read_lo(vis_ld_u8(sp + ind))
#define LD_U16(sp, ind) vis_ld_u16(sp + ind)
/***************************************************************/
#define LOAD_1CH() \
s0 = vis_fpmerge(LD_U8(sp0, 0), LD_U8(sp2, 0)); \
s1 = vis_fpmerge(LD_U8(sp0, 1), LD_U8(sp2, 1)); \
s2 = vis_fpmerge(LD_U8(sp0, srcYStride), LD_U8(sp2, srcYStride)); \
s3 = vis_fpmerge(LD_U8(sp0, srcYStride + 1), \
LD_U8(sp2, srcYStride + 1)); \
\
t0 = vis_fpmerge(LD_U8(sp1, 0), LD_U8(sp3, 0)); \
t1 = vis_fpmerge(LD_U8(sp1, 1), LD_U8(sp3, 1)); \
t2 = vis_fpmerge(LD_U8(sp1, srcYStride), LD_U8(sp3, srcYStride)); \
t3 = vis_fpmerge(LD_U8(sp1, srcYStride + 1), \
LD_U8(sp3, srcYStride + 1)); \
\
s0 = vis_fpmerge(vis_read_lo(s0), vis_read_lo(t0)); \
s1 = vis_fpmerge(vis_read_lo(s1), vis_read_lo(t1)); \
s2 = vis_fpmerge(vis_read_lo(s2), vis_read_lo(t2)); \
s3 = vis_fpmerge(vis_read_lo(s3), vis_read_lo(t3))
/***************************************************************/
#define GET_POINTER(sp) \
sp = *(mlib_u8**)((mlib_u8*)lineAddr + PTR_SHIFT(Y)) + \
(X >> MLIB_SHIFT); \
X += dX; \
Y += dY
/***************************************************************/
#undef PREPARE_DELTAS
#define PREPARE_DELTAS \
if (warp_tbl != NULL) { \
dX = warp_tbl[2*j ]; \
dY = warp_tbl[2*j + 1]; \
dx64 = vis_to_double_dup((((dX << 1) & 0xFFFF) << 16) | ((dX << 1) & 0xFFFF)); \
dy64 = vis_to_double_dup((((dY << 1) & 0xFFFF) << 16) | ((dY << 1) & 0xFFFF)); \
}
/***************************************************************/
mlib_status FUN_NAME(1ch)(mlib_affine_param *param)
{
DECLAREVAR();
mlib_d64 mask_7fff = vis_to_double_dup(0x7FFF7FFF);
mlib_d64 dx64, dy64, deltax, deltay, delta1_x, delta1_y;
mlib_s32 off, x0, x1, x2, x3, y0, y1, y2, y3;
mlib_f32 *dp, fmask;
vis_write_gsr((1 << 3) | 7);
dx64 = vis_to_double_dup((((dX << 1) & 0xFFFF) << 16) | ((dX << 1) & 0xFFFF));
dy64 = vis_to_double_dup((((dY << 1) & 0xFFFF) << 16) | ((dY << 1) & 0xFFFF));
for (j = yStart; j <= yFinish; j++) {
mlib_u8 *sp0, *sp1, *sp2, *sp3;
mlib_d64 s0, s1, s2, s3, t0, t1, t2, t3;
mlib_f32 df;
NEW_LINE(1);
off = (mlib_s32)dl & 3;
dp = (mlib_f32*)(dl - off);
x0 = X - off*dX; y0 = Y - off*dY;
x1 = x0 + dX; y1 = y0 + dY;
x2 = x1 + dX; y2 = y1 + dY;
x3 = x2 + dX; y3 = y2 + dY;
deltax = DOUBLE_4U16(x0, x1, x2, x3);
deltay = DOUBLE_4U16(y0, y1, y2, y3);
if (off) {
mlib_s32 emask = vis_edge16((void*)(2*off), (void*)(2*(off + size - 1)));
off = 4 - off;
GET_POINTER(sp3);
sp0 = sp1 = sp2 = sp3;
if (off > 1 && size > 1) {
GET_POINTER(sp3);
}
if (off > 2) {
sp2 = sp3;
if (size > 2) {
GET_POINTER(sp3);
}
}
LOAD_1CH();
BL_SUM(lo);
fmask = ((mlib_f32*)mlib_fmask_arr)[emask];
*dp++ = vis_fors(vis_fands(fmask, df), vis_fandnots(fmask, dp[0]));
size -= off;
if (size < 0) size = 0;
}
#pragma pipeloop(0)
for (i = 0; i < size/4; i++) {
GET_POINTER(sp0);
GET_POINTER(sp1);
GET_POINTER(sp2);
GET_POINTER(sp3);
LOAD_1CH();
BL_SUM(lo);
dp[i] = df;
}
off = size & 3;
if (off) {
GET_POINTER(sp0);
sp1 = sp2 = sp3 = sp0;
if (off > 1) {
GET_POINTER(sp1);
}
if (off > 2) {
GET_POINTER(sp2);
}
LOAD_1CH();
BL_SUM(lo);
fmask = ((mlib_f32*)mlib_fmask_arr)[(0xF0 >> off) & 0x0F];
dp[i] = vis_fors(vis_fands(fmask, df), vis_fandnots(fmask, dp[i]));
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#undef GET_POINTER
#define GET_POINTER(sp) \
sp = *(mlib_u8**)((mlib_u8*)lineAddr + PTR_SHIFT(Y)) + \
2*(X >> MLIB_SHIFT); \
X += dX; \
Y += dY
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_2CH() \
s0 = vis_faligndata(LD_U16(sp1, 0), k05); \
s1 = vis_faligndata(LD_U16(sp1, 2), k05); \
s2 = vis_faligndata(LD_U16(sp1, srcYStride), k05); \
s3 = vis_faligndata(LD_U16(sp1, srcYStride + 2), k05); \
\
s0 = vis_faligndata(LD_U16(sp0, 0), s0); \
s1 = vis_faligndata(LD_U16(sp0, 2), s1); \
s2 = vis_faligndata(LD_U16(sp0, srcYStride), s2); \
s3 = vis_faligndata(LD_U16(sp0, srcYStride + 2), s3)
#define BL_SUM_2CH() BL_SUM(hi)
#else
#define LOAD_2CH() \
s0 = vis_bshuffle(LD_U16(sp0, 0), LD_U16(sp1, 0)); \
s1 = vis_bshuffle(LD_U16(sp0, 2), LD_U16(sp1, 2)); \
s2 = vis_bshuffle(LD_U16(sp0, srcYStride), \
LD_U16(sp1, srcYStride)); \
s3 = vis_bshuffle(LD_U16(sp0, srcYStride + 2), \
LD_U16(sp1, srcYStride + 2))
#define BL_SUM_2CH() BL_SUM(lo)
#endif /* MLIB_VIS2 */
/***************************************************************/
#undef PREPARE_DELTAS
#define PREPARE_DELTAS \
if (warp_tbl != NULL) { \
dX = warp_tbl[2*j ]; \
dY = warp_tbl[2*j + 1]; \
dx64 = vis_to_double_dup(((dX & 0xFFFF) << 16) | (dX & 0xFFFF)); \
dy64 = vis_to_double_dup(((dY & 0xFFFF) << 16) | (dY & 0xFFFF)); \
}
/***************************************************************/
mlib_status FUN_NAME(2ch)(mlib_affine_param *param)
{
DECLAREVAR();
mlib_d64 mask_7fff = vis_to_double_dup(0x7FFF7FFF);
mlib_d64 dx64, dy64, deltax, deltay, delta1_x, delta1_y;
mlib_s32 off, x0, x1, y0, y1;
if (((mlib_s32)lineAddr[0] | (mlib_s32)dstData | srcYStride | dstYStride) & 1) {
return FUN_NAME(2ch_na)(param);
}
vis_write_gsr((1 << 3) | 6);
MLIB_WRITE_BMASK(0x45cd67ef);
dx64 = vis_to_double_dup(((dX & 0xFFFF) << 16) | (dX & 0xFFFF));
dy64 = vis_to_double_dup(((dY & 0xFFFF) << 16) | (dY & 0xFFFF));
for (j = yStart; j <= yFinish; j++) {
mlib_u8 *sp0, *sp1;
mlib_d64 s0, s1, s2, s3;
mlib_f32 *dp, df, fmask;
NEW_LINE(2);
off = (mlib_s32)dl & 3;
dp = (mlib_f32*)(dl - off);
if (off) {
x0 = X - dX; y0 = Y - dY;
x1 = X; y1 = Y;
} else {
x0 = X; y0 = Y;
x1 = X + dX; y1 = Y + dY;
}
deltax = DOUBLE_4U16(x0, x0, x1, x1);
deltay = DOUBLE_4U16(y0, y0, y1, y1);
if (off) {
GET_POINTER(sp1);
sp0 = sp1;
LOAD_2CH();
BL_SUM_2CH();
fmask = ((mlib_f32*)mlib_fmask_arr)[0x3];
*dp++ = vis_fors(vis_fands(fmask, df), vis_fandnots(fmask, dp[0]));
size--;
}
if (size >= 2) {
GET_POINTER(sp0);
GET_POINTER(sp1);
LOAD_2CH();
#pragma pipeloop(0)
for (i = 0; i < (size - 2)/2; i++) {
BL_SUM_2CH();
GET_POINTER(sp0);
GET_POINTER(sp1);
LOAD_2CH();
*dp++ = df;
}
BL_SUM_2CH();
*dp++ = df;
}
if (size & 1) {
GET_POINTER(sp0);
sp1 = sp0;
LOAD_2CH();
BL_SUM_2CH();
fmask = ((mlib_f32*)mlib_fmask_arr)[0x0C];
*dp = vis_fors(vis_fands(fmask, df), vis_fandnots(fmask, *dp));
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
#ifndef MLIB_VIS2
#define LOAD_2CH_NA() \
s0 = vis_fpmerge(LD_U8(sp0, 0), LD_U8(sp1, 0)); \
s1 = vis_fpmerge(LD_U8(sp0, 2), LD_U8(sp1, 2)); \
s2 = vis_fpmerge(LD_U8(sp0, srcYStride), \
LD_U8(sp1, srcYStride)); \
s3 = vis_fpmerge(LD_U8(sp0, srcYStride + 2), \
LD_U8(sp1, srcYStride + 2)); \
\
t0 = vis_fpmerge(LD_U8(sp0, 1), LD_U8(sp1, 1)); \
t1 = vis_fpmerge(LD_U8(sp0, 3), LD_U8(sp1, 3)); \
t2 = vis_fpmerge(LD_U8(sp0, srcYStride + 1), \
LD_U8(sp1, srcYStride + 1)); \
t3 = vis_fpmerge(LD_U8(sp0, srcYStride + 3), \
LD_U8(sp1, srcYStride + 3)); \
\
s0 = vis_fpmerge(vis_read_lo(s0), vis_read_lo(t0)); \
s1 = vis_fpmerge(vis_read_lo(s1), vis_read_lo(t1)); \
s2 = vis_fpmerge(vis_read_lo(s2), vis_read_lo(t2)); \
s3 = vis_fpmerge(vis_read_lo(s3), vis_read_lo(t3))
#define BL_SUM_2CH_NA() BL_SUM(lo)
#else
#define LOAD_2CH_NA() \
vis_alignaddr(sp0, 0); \
spa = AL_ADDR(sp0, 0); \
s0 = vis_faligndata(spa[0], spa[1]); \
\
vis_alignaddr(sp1, 0); \
spa = AL_ADDR(sp1, 0); \
s1 = vis_faligndata(spa[0], spa[1]); \
\
vis_alignaddr(sp0, srcYStride); \
spa = AL_ADDR(sp0, srcYStride); \
s2 = vis_faligndata(spa[0], spa[1]); \
\
vis_alignaddr(sp1, srcYStride); \
spa = AL_ADDR(sp1, srcYStride); \
s3 = vis_faligndata(spa[0], spa[1]); \
\
s0 = vis_bshuffle(s0, s1); \
s2 = vis_bshuffle(s2, s3)
#define BL_SUM_2CH_NA() \
delta1_x = vis_fpsub16(mask_7fff, deltax); \
delta1_y = vis_fpsub16(mask_7fff, deltay); \
\
d0 = vis_fmul8x16(vis_read_hi(s0), delta1_x); \
d1 = vis_fmul8x16(vis_read_lo(s0), deltax); \
d0 = vis_fpadd16(d0, d1); \
d0 = FMUL_16x16(d0, delta1_y); \
d2 = vis_fmul8x16(vis_read_hi(s2), delta1_x); \
d3 = vis_fmul8x16(vis_read_lo(s2), deltax); \
d2 = vis_fpadd16(d2, d3); \
d2 = FMUL_16x16(d2, deltay); \
dd = vis_fpadd16(d0, d2); \
dd = vis_fpadd16(dd, k05); \
df = vis_fpack16(dd); \
\
deltax = vis_fpadd16(deltax, dx64); \
deltay = vis_fpadd16(deltay, dy64); \
deltax = vis_fand(deltax, mask_7fff); \
deltay = vis_fand(deltay, mask_7fff)
#endif /* MLIB_VIS2 */
/***************************************************************/
mlib_status FUN_NAME(2ch_na)(mlib_affine_param *param)
{
DECLAREVAR();
mlib_d64 mask_7fff = vis_to_double_dup(0x7FFF7FFF);
mlib_d64 dx64, dy64, deltax, deltay, delta1_x, delta1_y;
mlib_s32 max_xsize = param -> max_xsize, bsize;
mlib_s32 x0, x1, y0, y1;
mlib_f32 buff[BUF_SIZE], *pbuff = buff;
bsize = (max_xsize + 1)/2;
if (bsize > BUF_SIZE) {
pbuff = mlib_malloc(bsize*sizeof(mlib_f32));
if (pbuff == NULL) return MLIB_FAILURE;
}
vis_write_gsr((1 << 3) | 6);
MLIB_WRITE_BMASK(0x018923AB);
dx64 = vis_to_double_dup(((dX & 0xFFFF) << 16) | (dX & 0xFFFF));
dy64 = vis_to_double_dup(((dY & 0xFFFF) << 16) | (dY & 0xFFFF));
for (j = yStart; j <= yFinish; j++) {
mlib_u8 *sp0, *sp1;
mlib_d64 s0, s1, s2, s3;
#ifndef MLIB_VIS2
mlib_d64 t0, t1, t2, t3;
#else
mlib_d64 *spa;
#endif /* MLIB_VIS2 */
mlib_f32 *dp, df;
NEW_LINE(2);
dp = pbuff;
x0 = X; y0 = Y;
x1 = X + dX; y1 = Y + dY;
deltax = DOUBLE_4U16(x0, x0, x1, x1);
deltay = DOUBLE_4U16(y0, y0, y1, y1);
#pragma pipeloop(0)
for (i = 0; i < size/2; i++) {
GET_POINTER(sp0);
GET_POINTER(sp1);
LOAD_2CH_NA();
BL_SUM_2CH_NA();
*dp++ = df;
}
if (size & 1) {
GET_POINTER(sp0);
sp1 = sp0;
LOAD_2CH_NA();
BL_SUM_2CH_NA();
*dp++ = df;
}
mlib_ImageCopy_na((mlib_u8*)pbuff, dl, 2*size);
}
if (pbuff != buff) {
mlib_free(pbuff);
}
return MLIB_SUCCESS;
}
/***************************************************************/
#undef PREPARE_DELTAS
#define PREPARE_DELTAS \
if (warp_tbl != NULL) { \
dX = warp_tbl[2*j ]; \
dY = warp_tbl[2*j + 1]; \
}
/***************************************************************/
mlib_status FUN_NAME(3ch)(mlib_affine_param *param)
{
DECLAREVAR();
mlib_s32 max_xsize = param -> max_xsize;
mlib_f32 buff[BUF_SIZE], *pbuff = buff;
if (max_xsize > BUF_SIZE) {
pbuff = mlib_malloc(max_xsize*sizeof(mlib_f32));
if (pbuff == NULL) return MLIB_FAILURE;
}
vis_write_gsr(3 << 3);
for (j = yStart; j <= yFinish; j++) {
mlib_d64 *sp0, *sp1, s0, s1;
mlib_u8 *sp;
NEW_LINE(3);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
GET_FILTER_XY();
sp = *(mlib_u8**)((mlib_u8*)lineAddr + PTR_SHIFT(Y)) + 3*(X >> MLIB_SHIFT) - 1;
vis_alignaddr(sp, 0);
sp0 = AL_ADDR(sp, 0);
s0 = vis_faligndata(sp0[0], sp0[1]);
d0 = vis_fmul8x16au(vis_read_hi(s0), vis_read_hi(filterxy));
d1 = vis_fmul8x16al(vis_read_lo(s0), vis_read_hi(filterxy));
vis_alignaddr(sp, srcYStride);
sp1 = AL_ADDR(sp, srcYStride);
s1 = vis_faligndata(sp1[0], sp1[1]);
d2 = vis_fmul8x16au(vis_read_hi(s1), vis_read_lo(filterxy));
d3 = vis_fmul8x16al(vis_read_lo(s1), vis_read_lo(filterxy));
vis_alignaddr((void*)0, 2);
d0 = vis_fpadd16(d0, d2);
dd = vis_fpadd16(k05, d1);
dd = vis_fpadd16(dd, d3);
d0 = vis_faligndata(d0, d0);
dd = vis_fpadd16(dd, d0);
pbuff[i] = vis_fpack16(dd);
X += dX;
Y += dY;
}
mlib_v_ImageChannelExtract_U8_43L_D1((mlib_u8*)pbuff, dl, size);
}
if (pbuff != buff) {
mlib_free(pbuff);
}
return MLIB_SUCCESS;
}
/***************************************************************/
#define PROCESS_4CH(s0, s1, s2, s3) \
d0 = vis_fmul8x16au(s0, vis_read_hi(filterxy)); \
d1 = vis_fmul8x16al(s1, vis_read_hi(filterxy)); \
d2 = vis_fmul8x16au(s2, vis_read_lo(filterxy)); \
d3 = vis_fmul8x16al(s3, vis_read_lo(filterxy)); \
\
dd = vis_fpadd16(d0, k05); \
d1 = vis_fpadd16(d1, d2); \
dd = vis_fpadd16(dd, d3); \
dd = vis_fpadd16(dd, d1)
/***************************************************************/
mlib_status FUN_NAME(4ch)(mlib_affine_param *param)
{
DECLAREVAR();
if (((mlib_s32)lineAddr[0] | (mlib_s32)dstData | srcYStride | dstYStride) & 3) {
return FUN_NAME(4ch_na)(param);
}
vis_write_gsr(3 << 3);
srcYStride >>= 2;
for (j = yStart; j <= yFinish; j++) {
mlib_f32 *sp, s0, s1, s2, s3;
NEW_LINE(4);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
GET_FILTER_XY();
sp = *(mlib_f32**)((mlib_u8*)lineAddr + PTR_SHIFT(Y)) + (X >> MLIB_SHIFT);
s0 = sp[0];
s1 = sp[1];
s2 = sp[srcYStride];
s3 = sp[srcYStride + 1];
PROCESS_4CH(s0, s1, s2, s3);
((mlib_f32*)dl)[i] = vis_fpack16(dd);
X += dX;
Y += dY;
}
}
return MLIB_SUCCESS;
}
/***************************************************************/
mlib_status FUN_NAME(4ch_na)(mlib_affine_param *param)
{
DECLAREVAR();
mlib_s32 max_xsize = param -> max_xsize;
mlib_f32 buff[BUF_SIZE], *pbuff = buff;
if (max_xsize > BUF_SIZE) {
pbuff = mlib_malloc(max_xsize*sizeof(mlib_f32));
if (pbuff == NULL) return MLIB_FAILURE;
}
vis_write_gsr(3 << 3);
for (j = yStart; j <= yFinish; j++) {
mlib_d64 *sp0, *sp1, s0, s1;
mlib_u8 *sp;
NEW_LINE(4);
#pragma pipeloop(0)
for (i = 0; i < size; i++) {
GET_FILTER_XY();
sp = *(mlib_u8**)((mlib_u8*)lineAddr + PTR_SHIFT(Y)) + 4*(X >> MLIB_SHIFT);
vis_alignaddr(sp, 0);
sp0 = AL_ADDR(sp, 0);
s0 = vis_faligndata(sp0[0], sp0[1]);
vis_alignaddr(sp, srcYStride);
sp1 = AL_ADDR(sp, srcYStride);
s1 = vis_faligndata(sp1[0], sp1[1]);
PROCESS_4CH(vis_read_hi(s0), vis_read_lo(s0), vis_read_hi(s1), vis_read_lo(s1));
pbuff[i] = vis_fpack16(dd);
X += dX;
Y += dY;
}
mlib_ImageCopy_na((mlib_u8*)pbuff, dl, 4*size);
}
if (pbuff != buff) {
mlib_free(pbuff);
}
return MLIB_SUCCESS;
}
/***************************************************************/
| {
"pile_set_name": "Github"
} |
/* ----------------------------------------------------------------------
Axiom UI
Copyright (C) 2017-2020 Matt McManis
https://github.com/MattMcManis/Axiom
https://axiomui.github.io
[email protected]
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 3 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, see <http://www.gnu.org/licenses/>.
---------------------------------------------------------------------- */
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModel;
namespace Controls
{
namespace Video
{
namespace Codec
{
public class Theora
{
// ---------------------------------------------------------------------------
// Codec
// ---------------------------------------------------------------------------
public static ObservableCollection<ViewModel.Video.VideoCodec> codec = new ObservableCollection<ViewModel.Video.VideoCodec>()
{
new ViewModel.Video.VideoCodec()
{
Codec = "libtheora",
Parameters = ""
}
};
public static void Codec_Set()
{
// Combine Codec + Parameters
List<string> codec = new List<string>()
{
"-c:v",
Theora.codec.FirstOrDefault()?.Codec,
Theora.codec.FirstOrDefault()?.Parameters
};
VM.VideoView.Video_Codec = string.Join(" ", codec.Where(s => !string.IsNullOrEmpty(s)));
}
// ---------------------------------------------------------------------------
// Items Source
// ---------------------------------------------------------------------------
// -------------------------
// Encode Speed
// -------------------------
public static ObservableCollection<ViewModel.Video.VideoEncodeSpeed> encodeSpeed = new ObservableCollection<ViewModel.Video.VideoEncodeSpeed>()
{
new ViewModel.Video.VideoEncodeSpeed() { Name = "none", Command = ""},
};
// -------------------------
// Pixel Format
// -------------------------
public static ObservableCollection<string> pixelFormat = new ObservableCollection<string>()
{
"auto",
"yuv420p",
"yuv422p",
"yuv444p"
};
// -------------------------
// Quality
// -------------------------
public static ObservableCollection<ViewModel.Video.VideoQuality> quality = new ObservableCollection<ViewModel.Video.VideoQuality>()
{
new ViewModel.Video.VideoQuality() { Name = "Auto", CRF = "", CBR_BitMode = "-b:v", CBR = "", VBR_BitMode = "-q:v", VBR = "", MinRate = "", MaxRate = "", BufSize ="", NA = "3000K" },
new ViewModel.Video.VideoQuality() { Name = "Ultra", CRF = "", CBR_BitMode = "-b:v", CBR = "5000K", VBR_BitMode = "-q:v", VBR = "10", MinRate = "", MaxRate = "", BufSize ="" },
new ViewModel.Video.VideoQuality() { Name = "High", CRF = "", CBR_BitMode = "-b:v", CBR = "2500K", VBR_BitMode = "-q:v", VBR = "8", MinRate = "", MaxRate = "", BufSize ="" },
new ViewModel.Video.VideoQuality() { Name = "Medium", CRF = "", CBR_BitMode = "-b:v", CBR = "1300K", VBR_BitMode = "-q:v", VBR = "6", MinRate = "", MaxRate = "", BufSize ="" },
new ViewModel.Video.VideoQuality() { Name = "Low", CRF = "", CBR_BitMode = "-b:v", CBR = "600K", VBR_BitMode = "-q:v", VBR = "4", MinRate = "", MaxRate = "", BufSize ="" },
new ViewModel.Video.VideoQuality() { Name = "Sub", CRF = "", CBR_BitMode = "-b:v", CBR = "250K", VBR_BitMode = "-q:v", VBR = "2", MinRate = "", MaxRate = "", BufSize ="" },
new ViewModel.Video.VideoQuality() { Name = "Custom", CRF = "", CBR_BitMode = "-b:v", CBR = "", VBR_BitMode = "-q:v", VBR = "", MinRate = "", MaxRate = "", BufSize ="" }
};
// -------------------------
// Pass
// -------------------------
public static void EncodingPass()
{
// -------------------------
// Quality
// -------------------------
switch (VM.VideoView.Video_Quality_SelectedItem)
{
// Auto
case "Auto":
VM.VideoView.Video_Pass_Items = new ObservableCollection<string>()
{
"1 Pass"
};
VM.VideoView.Video_Pass_SelectedItem = "1 Pass";
VM.VideoView.Video_Pass_IsEnabled = false;
Controls.passUserSelected = false;
VM.VideoView.Video_CRF_IsEnabled = false;
break;
// Custom
case "Custom":
VM.VideoView.Video_Pass_Items = new ObservableCollection<string>()
{
"1 Pass"
};
VM.VideoView.Video_Pass_IsEnabled = false;
VM.VideoView.Video_CRF_IsEnabled = true;
break;
// None
case "None":
VM.VideoView.Video_Pass_Items = new ObservableCollection<string>()
{
"auto"
};
VM.VideoView.Video_Pass_IsEnabled = false;
VM.VideoView.Video_CRF_IsEnabled = false;
break;
// Presets: Ultra, High, Medium, Low, Sub
default:
VM.VideoView.Video_Pass_Items = new ObservableCollection<string>()
{
"1 Pass"
};
VM.VideoView.Video_Pass_IsEnabled = false;
VM.VideoView.Video_CRF_IsEnabled = false;
// Default to CRF
if (Controls.passUserSelected == false)
{
VM.VideoView.Video_Pass_SelectedItem = "1 Pass";
Controls.passUserSelected = true;
}
break;
}
// Clear TextBoxes
if (VM.VideoView.Video_Quality_SelectedItem == "Auto" ||
VM.VideoView.Video_Quality_SelectedItem == "Lossless" ||
VM.VideoView.Video_Quality_SelectedItem == "Custom" ||
VM.VideoView.Video_Quality_SelectedItem == "None"
)
{
VM.VideoView.Video_CRF_Text = string.Empty;
VM.VideoView.Video_BitRate_Text = string.Empty;
VM.VideoView.Video_MinRate_Text = string.Empty;
VM.VideoView.Video_MaxRate_Text = string.Empty;
VM.VideoView.Video_BufSize_Text = string.Empty;
}
}
// -------------------------
// Optimize
// -------------------------
public static ObservableCollection<ViewModel.Video.VideoOptimize> optimize = new ObservableCollection<ViewModel.Video.VideoOptimize>()
{
new ViewModel.Video.VideoOptimize() { Name = "None", Tune = "none", Profile = "none", Level = "none", Command = "" },
new ViewModel.Video.VideoOptimize() { Name = "Web", Tune = "none", Profile = "none", Level = "none", Command = "-movflags faststart" }
};
// -------------------------
// Tune
// -------------------------
public static ObservableCollection<string> tune = new ObservableCollection<string>()
{
"none"
};
// -------------------------
// Profile
// -------------------------
public static ObservableCollection<string> profile = new ObservableCollection<string>()
{
"none"
};
// -------------------------
// Level
// -------------------------
public static ObservableCollection<string> level = new ObservableCollection<string>()
{
"none"
};
// ---------------------------------------------------------------------------
// Controls Behavior
// ---------------------------------------------------------------------------
// -------------------------
// Items Source
// -------------------------
public static void Controls_ItemsSource()
{
// Encode Speed
VM.VideoView.Video_EncodeSpeed_Items = encodeSpeed;
// Pixel Format
VM.VideoView.Video_PixelFormat_Items = pixelFormat;
// Pass
//VM.VideoView.Video_Pass_Items = pass;
EncodingPass();
// Video Quality
VM.VideoView.Video_Quality_Items = quality;
// Optimize
VM.VideoView.Video_Optimize_Items = optimize;
// Tune
VM.VideoView.Video_Optimize_Tune_Items = tune;
// Profile
VM.VideoView.Video_Optimize_Profile_Items = profile;
// Level
VM.VideoView.Video_Optimize_Level_Items = level;
}
// -------------------------
// Selected Items
// -------------------------
public static void Controls_Selected()
{
// Pixel Format
VM.VideoView.Video_PixelFormat_SelectedItem = "yuv420p";
// Framerate
VM.VideoView.Video_FPS_SelectedItem = "auto";
}
// -------------------------
// Expanded
// -------------------------
public static void Controls_Expanded()
{
// None
}
// -------------------------
// Collapsed
// -------------------------
public static void Controls_Collapsed()
{
VM.VideoView.Video_Optimize_IsExpanded = false;
}
// -------------------------
// Checked
// -------------------------
public static void Controls_Checked()
{
// None
}
// -------------------------
// Unchecked
// -------------------------
public static void Controls_Unhecked()
{
// BitRate Mode
VM.VideoView.Video_VBR_IsChecked = false;
}
// -------------------------
// Enabled
// -------------------------
public static void Controls_Enable()
{
// Video Codec
VM.VideoView.Video_Codec_IsEnabled = true;
// HW Accel
VM.VideoView.Video_HWAccel_IsEnabled = true;
// Video Quality
VM.VideoView.Video_Quality_IsEnabled = true;
// Video VBR
VM.VideoView.Video_VBR_IsEnabled = true;
// Pixel Format
VM.VideoView.Video_PixelFormat_IsEnabled = true;
// FPS ComboBox
VM.VideoView.Video_FPS_IsEnabled = true;
// Speed
VM.VideoView.Video_Speed_IsEnabled = true;
// Optimize ComboBox
VM.VideoView.Video_Optimize_IsEnabled = true;
// Size
VM.VideoView.Video_Scale_IsEnabled = true;
// Scaling ComboBox
VM.VideoView.Video_ScalingAlgorithm_IsEnabled = true;
// Crop
VM.VideoView.Video_Crop_IsEnabled = true;
// Color Range
VM.VideoView.Video_Color_Range_IsEnabled = true;
// Color Space
VM.VideoView.Video_Color_Space_IsEnabled = true;
// Color Primaries
VM.VideoView.Video_Color_Primaries_IsEnabled = true;
// Color Transfer Characteristics
VM.VideoView.Video_Color_TransferCharacteristics_IsEnabled = true;
// Color Matrix
VM.VideoView.Video_Color_Matrix_IsEnabled = true;
// Subtitle Codec
VM.SubtitleView.Subtitle_Codec_IsEnabled = true;
// Subtitle Stream
VM.SubtitleView.Subtitle_Stream_IsEnabled = true;
// Filters
Filters.Video.VideoFilters_EnableAll();
}
// -------------------------
// Disabled
// -------------------------
public static void Controls_Disable()
{
// Video Encode Speed
VM.VideoView.Video_EncodeSpeed_IsEnabled = false;
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Jamie Matthews</author>
<description>YQL table for Last.fm Tag.search API method. Search for a tag by name. Returns matches sorted by relevance.</description>
<documentationURL>http://www.last.fm/api/show?service=273</documentationURL>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url>http://ws.audioscrobbler.com/2.0/?method=tag.search</url>
</urls>
<inputs>
<key id="limit" type="xs:string" paramType="query" required="false" />
<key id="page" type="xs:string" paramType="query" required="false" />
<key id="tag" type="xs:string" paramType="query" required="true" />
<key id="api_key" type="xs:string" paramType="query" required="true" />
</inputs>
</select>
</bindings>
</table>
| {
"pile_set_name": "Github"
} |
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: devapp-deployment
spec:
replicas: 2
template:
metadata:
labels:
app: devapp
annotations:
container.seccomp.security.alpha.kubernetes.io/devapp: docker/default
container.apparmor.security.beta.kubernetes.io/devapp: runtime/default
spec:
containers:
- name: devapp
image: gcr.io/go-dashboard-dev/devapp:latest
imagePullPolicy: Always
command: ["/devapp", "-listen=:80", "-autocert-bucket=golang-devapp-dev-autocert"]
readinessProbe:
httpGet:
path: /healthz
port: 80
ports:
- containerPort: 80
- containerPort: 443
resources:
requests:
cpu: "1"
memory: "2Gi"
limits:
memory: "4Gi"
| {
"pile_set_name": "Github"
} |
config BR2_PACKAGE_RAMSPEED
bool "ramspeed"
help
RAMspeed is a free open source command line utility
to measure cache and memory performance.
http://alasir.com/software/ramspeed/
| {
"pile_set_name": "Github"
} |
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2018 Jérémie Dumas <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_OPENGL_GLFW_IMGUI_IMGUITRAITS_H
#define IGL_OPENGL_GLFW_IMGUI_IMGUITRAITS_H
#include <imgui/imgui.h>
// Extend ImGui by populating its namespace directly
namespace ImGui
{
// Infer ImGuiDataType enum based on actual type
template<typename T>
class ImGuiDataTypeTraits
{
static const ImGuiDataType value; // link error
static const char * format;
};
template<>
class ImGuiDataTypeTraits<int>
{
static constexpr ImGuiDataType value = ImGuiDataType_S32;
static constexpr char format [] = "%d";
};
template<>
class ImGuiDataTypeTraits<unsigned int>
{
static constexpr ImGuiDataType value = ImGuiDataType_U32;
static constexpr char format [] = "%u";
};
template<>
class ImGuiDataTypeTraits<long long>
{
static constexpr ImGuiDataType value = ImGuiDataType_S64;
static constexpr char format [] = "%lld";
};
template<>
class ImGuiDataTypeTraits<unsigned long long>
{
static constexpr ImGuiDataType value = ImGuiDataType_U64;
static constexpr char format [] = "%llu";
};
template<>
class ImGuiDataTypeTraits<float>
{
static constexpr ImGuiDataType value = ImGuiDataType_Float;
static constexpr char format [] = "%.3f";
};
template<>
class ImGuiDataTypeTraits<double>
{
static constexpr ImGuiDataType value = ImGuiDataType_Double;
static constexpr char format [] = "%.6f";
};
} // namespace ImGui
#endif // IGL_OPENGL_GLFW_IMGUI_IMGUIHELPERS_H
| {
"pile_set_name": "Github"
} |
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
#define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
#include "llvm/DebugInfo/DIContext.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Object/Archive.h"
namespace llvm {
class StringRef;
namespace object {
class COFFObjectFile;
class COFFImportFile;
class MachOObjectFile;
class ObjectFile;
class Archive;
class RelocationRef;
}
extern cl::opt<std::string> TripleName;
extern cl::opt<std::string> ArchName;
extern cl::opt<std::string> MCPU;
extern cl::list<std::string> MAttrs;
extern cl::list<std::string> FilterSections;
extern cl::opt<bool> Disassemble;
extern cl::opt<bool> DisassembleAll;
extern cl::opt<bool> NoShowRawInsn;
extern cl::opt<bool> PrivateHeaders;
extern cl::opt<bool> FirstPrivateHeader;
extern cl::opt<bool> ExportsTrie;
extern cl::opt<bool> Rebase;
extern cl::opt<bool> Bind;
extern cl::opt<bool> LazyBind;
extern cl::opt<bool> WeakBind;
extern cl::opt<bool> RawClangAST;
extern cl::opt<bool> UniversalHeaders;
extern cl::opt<bool> ArchiveHeaders;
extern cl::opt<bool> IndirectSymbols;
extern cl::opt<bool> DataInCode;
extern cl::opt<bool> LinkOptHints;
extern cl::opt<bool> InfoPlist;
extern cl::opt<bool> DylibsUsed;
extern cl::opt<bool> DylibId;
extern cl::opt<bool> ObjcMetaData;
extern cl::opt<std::string> DisSymName;
extern cl::opt<bool> NonVerbose;
extern cl::opt<bool> Relocations;
extern cl::opt<bool> SectionHeaders;
extern cl::opt<bool> SectionContents;
extern cl::opt<bool> SymbolTable;
extern cl::opt<bool> UnwindInfo;
extern cl::opt<bool> PrintImmHex;
extern cl::opt<DIDumpType> DwarfDumpType;
// Various helper functions.
void error(std::error_code ec);
bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
void ParseInputMachO(StringRef Filename);
void printCOFFUnwindInfo(const object::COFFObjectFile* o);
void printMachOUnwindInfo(const object::MachOObjectFile* o);
void printMachOExportsTrie(const object::MachOObjectFile* o);
void printMachORebaseTable(const object::MachOObjectFile* o);
void printMachOBindTable(const object::MachOObjectFile* o);
void printMachOLazyBindTable(const object::MachOObjectFile* o);
void printMachOWeakBindTable(const object::MachOObjectFile* o);
void printELFFileHeader(const object::ObjectFile *o);
void printCOFFFileHeader(const object::ObjectFile *o);
void printCOFFSymbolTable(const object::COFFImportFile *i);
void printCOFFSymbolTable(const object::COFFObjectFile *o);
void printMachOFileHeader(const object::ObjectFile *o);
void printMachOLoadCommands(const object::ObjectFile *o);
void printWasmFileHeader(const object::ObjectFile *o);
void printExportsTrie(const object::ObjectFile *o);
void printRebaseTable(const object::ObjectFile *o);
void printBindTable(const object::ObjectFile *o);
void printLazyBindTable(const object::ObjectFile *o);
void printWeakBindTable(const object::ObjectFile *o);
void printRawClangAST(const object::ObjectFile *o);
void PrintRelocations(const object::ObjectFile *o);
void PrintSectionHeaders(const object::ObjectFile *o);
void PrintSectionContents(const object::ObjectFile *o);
void PrintSymbolTable(const object::ObjectFile *o, StringRef ArchiveName,
StringRef ArchitectureName = StringRef());
LLVM_ATTRIBUTE_NORETURN void error(Twine Message);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, std::error_code EC);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, llvm::Error E);
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef FileName,
StringRef ArchiveName,
llvm::Error E,
StringRef ArchitectureName
= StringRef());
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef ArchiveName,
const object::Archive::Child &C,
llvm::Error E,
StringRef ArchitectureName
= StringRef());
} // end namespace llvm
#endif
| {
"pile_set_name": "Github"
} |
<component name="libraryTable">
<library name="android-query-full.0.26.7">
<CLASSES>
<root url="jar://$PROJECT_DIR$/libs/android-query-full.0.26.7.jar!/" />
<root url="jar://$PROJECT_DIR$/libs/gdt_mob_release_v4.2.447.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/libs/android-query-full.0.26.7.jar!/" />
</SOURCES>
</library>
</component> | {
"pile_set_name": "Github"
} |
let _ref;
function _classNameTDZError(name) { throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); }
_ref = (_classNameTDZError("C"), C) + 3;
class C {}
C[_ref] = 3;
| {
"pile_set_name": "Github"
} |
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from mega_core import _C
# TODO: Use JIT to replace CUDA implementation in the future.
class _SigmoidFocalLoss(Function):
@staticmethod
def forward(ctx, logits, targets, gamma, alpha):
ctx.save_for_backward(logits, targets)
num_classes = logits.shape[1]
ctx.num_classes = num_classes
ctx.gamma = gamma
ctx.alpha = alpha
losses = _C.sigmoid_focalloss_forward(
logits, targets, num_classes, gamma, alpha
)
return losses
@staticmethod
@once_differentiable
def backward(ctx, d_loss):
logits, targets = ctx.saved_tensors
num_classes = ctx.num_classes
gamma = ctx.gamma
alpha = ctx.alpha
d_loss = d_loss.contiguous()
d_logits = _C.sigmoid_focalloss_backward(
logits, targets, d_loss, num_classes, gamma, alpha
)
return d_logits, None, None, None, None
sigmoid_focal_loss_cuda = _SigmoidFocalLoss.apply
def sigmoid_focal_loss_cpu(logits, targets, gamma, alpha):
num_classes = logits.shape[1]
dtype = targets.dtype
device = targets.device
class_range = torch.arange(1, num_classes+1, dtype=dtype, device=device).unsqueeze(0)
t = targets.unsqueeze(1)
p = torch.sigmoid(logits)
term1 = (1 - p) ** gamma * torch.log(p)
term2 = p ** gamma * torch.log(1 - p)
return -(t == class_range).float() * term1 * alpha - ((t != class_range) * (t >= 0)).float() * term2 * (1 - alpha)
class SigmoidFocalLoss(nn.Module):
def __init__(self, gamma, alpha):
super(SigmoidFocalLoss, self).__init__()
self.gamma = gamma
self.alpha = alpha
def forward(self, logits, targets):
device = logits.device
if logits.is_cuda:
loss_func = sigmoid_focal_loss_cuda
else:
loss_func = sigmoid_focal_loss_cpu
loss = loss_func(logits, targets, self.gamma, self.alpha)
return loss.sum()
def __repr__(self):
tmpstr = self.__class__.__name__ + "("
tmpstr += "gamma=" + str(self.gamma)
tmpstr += ", alpha=" + str(self.alpha)
tmpstr += ")"
return tmpstr
| {
"pile_set_name": "Github"
} |
# Uzbek translation for transmission
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the transmission package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: transmission\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-03 15:22-0600\n"
"PO-Revision-Date: 2012-01-16 21:32+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Uzbek <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Launchpad-Export-Date: 2013-06-26 02:13+0000\n"
"X-Generator: Launchpad (build 16681)\n"
#: ../gtk/actions.c:45
msgid "Sort by _Activity"
msgstr ""
#: ../gtk/actions.c:46
msgid "Sort by _Name"
msgstr "_Номи бўйича саралаш"
#: ../gtk/actions.c:47
msgid "Sort by _Progress"
msgstr ""
#: ../gtk/actions.c:48
msgid "Sort by _Queue"
msgstr ""
#: ../gtk/actions.c:49
msgid "Sort by Rati_o"
msgstr ""
#: ../gtk/actions.c:50
msgid "Sort by Stat_e"
msgstr ""
#: ../gtk/actions.c:51
msgid "Sort by A_ge"
msgstr ""
#: ../gtk/actions.c:52
msgid "Sort by Time _Left"
msgstr ""
#: ../gtk/actions.c:53
msgid "Sort by Si_ze"
msgstr ""
#: ../gtk/actions.c:70
msgid "_Show Transmission"
msgstr "_Transmissionni ko'rsatish"
#: ../gtk/actions.c:71
msgid "Message _Log"
msgstr ""
#: ../gtk/actions.c:86
msgid "Enable Alternative Speed _Limits"
msgstr ""
#: ../gtk/actions.c:87
msgid "_Compact View"
msgstr ""
#: ../gtk/actions.c:88
msgid "Re_verse Sort Order"
msgstr ""
#: ../gtk/actions.c:89
msgid "_Filterbar"
msgstr ""
#: ../gtk/actions.c:90
msgid "_Statusbar"
msgstr "_Holat paneli"
#: ../gtk/actions.c:91
msgid "_Toolbar"
msgstr "_Asboblar paneli"
#: ../gtk/actions.c:96
msgid "_File"
msgstr "_Fayl"
#: ../gtk/actions.c:97
msgid "_Torrent"
msgstr "_Torrent"
#: ../gtk/actions.c:98
msgid "_View"
msgstr "_Koʻrinish"
#: ../gtk/actions.c:99
msgid "_Sort Torrents By"
msgstr ""
#: ../gtk/actions.c:100
msgid "_Queue"
msgstr ""
#: ../gtk/actions.c:101 ../gtk/details.c:2426
msgid "_Edit"
msgstr "_Таҳрирлаш"
#: ../gtk/actions.c:102
msgid "_Help"
msgstr "_Yordam"
#: ../gtk/actions.c:103
msgid "Copy _Magnet Link to Clipboard"
msgstr ""
#: ../gtk/actions.c:104
msgid "Open _URL…"
msgstr ""
#: ../gtk/actions.c:104
msgid "Open URL…"
msgstr ""
#: ../gtk/actions.c:105 ../gtk/actions.c:106
msgid "Open a torrent"
msgstr "Torrent file ochish"
#: ../gtk/actions.c:107
msgid "_Start"
msgstr "Ишга _тушириш"
#: ../gtk/actions.c:107
msgid "Start torrent"
msgstr "Torrentni ishga tushirish"
#: ../gtk/actions.c:108
msgid "Start _Now"
msgstr "Hozir ishga tushirish"
#: ../gtk/actions.c:108
msgid "Start torrent now"
msgstr "Torrentni hozir ishga tushirish"
#: ../gtk/actions.c:109
msgid "_Statistics"
msgstr ""
#: ../gtk/actions.c:110
msgid "_Donate"
msgstr ""
#: ../gtk/actions.c:111
msgid "_Verify Local Data"
msgstr ""
#: ../gtk/actions.c:112
msgid "_Pause"
msgstr ""
#: ../gtk/actions.c:112
msgid "Pause torrent"
msgstr ""
#: ../gtk/actions.c:113
msgid "_Pause All"
msgstr ""
#: ../gtk/actions.c:113
msgid "Pause all torrents"
msgstr ""
#: ../gtk/actions.c:114
msgid "_Start All"
msgstr "_Hammasini Ishga tushirish"
#: ../gtk/actions.c:114
msgid "Start all torrents"
msgstr ""
#: ../gtk/actions.c:115
msgid "Set _Location…"
msgstr ""
#: ../gtk/actions.c:116
msgid "Remove torrent"
msgstr "Torrentni o'chirish"
#: ../gtk/actions.c:117
msgid "_Delete Files and Remove"
msgstr ""
#: ../gtk/actions.c:118
msgid "_New…"
msgstr ""
#: ../gtk/actions.c:118
msgid "Create a torrent"
msgstr "Torrent yaratish"
#: ../gtk/actions.c:119
msgid "_Quit"
msgstr "_Chiqish"
#: ../gtk/actions.c:120
msgid "Select _All"
msgstr "_Hammasini tanlash"
#: ../gtk/actions.c:121
msgid "Dese_lect All"
msgstr "Ҳамма белгиланган файлларни бе_кор қилиш"
#: ../gtk/actions.c:123
msgid "Torrent properties"
msgstr ""
#: ../gtk/actions.c:124
msgid "Open Fold_er"
msgstr ""
#: ../gtk/actions.c:126
msgid "_Contents"
msgstr "_Tarkibi"
#: ../gtk/actions.c:127
msgid "Ask Tracker for _More Peers"
msgstr ""
#: ../gtk/actions.c:128
msgid "Move to _Top"
msgstr ""
#: ../gtk/actions.c:129
msgid "Move _Up"
msgstr "_Yuqoriga koʻtarish"
#: ../gtk/actions.c:130
msgid "Move _Down"
msgstr ""
#: ../gtk/actions.c:131
msgid "Move to _Bottom"
msgstr ""
#: ../gtk/actions.c:132
msgid "Present Main Window"
msgstr ""
#: ../gtk/conf.c:331 ../gtk/conf.c:336
#, c-format
msgid "Importing \"%s\""
msgstr ""
#: ../gtk/details.c:448 ../gtk/details.c:460
msgid "Use global settings"
msgstr ""
#: ../gtk/details.c:449
msgid "Seed regardless of ratio"
msgstr ""
#: ../gtk/details.c:450
msgid "Stop seeding at ratio:"
msgstr ""
#: ../gtk/details.c:461
msgid "Seed regardless of activity"
msgstr ""
#: ../gtk/details.c:462
msgid "Stop seeding if idle for N minutes:"
msgstr ""
#: ../gtk/details.c:478 ../gtk/tr-prefs.c:1282
msgid "Speed"
msgstr "Тезлиги"
#: ../gtk/details.c:480
msgid "Honor global _limits"
msgstr ""
#: ../gtk/details.c:485
#, c-format
msgid "Limit _download speed (%s):"
msgstr ""
#: ../gtk/details.c:498
#, c-format
msgid "Limit _upload speed (%s):"
msgstr ""
#: ../gtk/details.c:511 ../gtk/open-dialog.c:351
msgid "Torrent _priority:"
msgstr ""
#: ../gtk/details.c:515
msgid "Seeding Limits"
msgstr ""
#: ../gtk/details.c:525
msgid "_Ratio:"
msgstr ""
#: ../gtk/details.c:534
msgid "_Idle:"
msgstr ""
#: ../gtk/details.c:537
msgid "Peer Connections"
msgstr ""
#: ../gtk/details.c:540
msgid "_Maximum peers:"
msgstr ""
#: ../gtk/details.c:559 ../gtk/torrent-cell-renderer.c:201
#: ../libtransmission/verify.c:273
msgid "Queued for verification"
msgstr ""
#: ../gtk/details.c:560
msgid "Verifying local data"
msgstr ""
#: ../gtk/details.c:561 ../gtk/torrent-cell-renderer.c:204
msgid "Queued for download"
msgstr ""
#: ../gtk/details.c:562 ../gtk/filter.c:702
msgctxt "Verb"
msgid "Downloading"
msgstr ""
#: ../gtk/details.c:563 ../gtk/torrent-cell-renderer.c:207
msgid "Queued for seeding"
msgstr ""
#: ../gtk/details.c:564 ../gtk/filter.c:703
msgctxt "Verb"
msgid "Seeding"
msgstr ""
#: ../gtk/details.c:565 ../gtk/filter.c:705 ../gtk/torrent-cell-renderer.c:198
msgid "Finished"
msgstr "Tugadi"
#: ../gtk/details.c:565 ../gtk/filter.c:704 ../gtk/torrent-cell-renderer.c:198
msgid "Paused"
msgstr "Пауза қилинган"
#: ../gtk/details.c:598
msgid "N/A"
msgstr "Мавжуд эмас"
#: ../gtk/details.c:610 ../gtk/file-list.c:610
msgid "Mixed"
msgstr "Aralash"
#: ../gtk/details.c:611
msgid "No Torrents Selected"
msgstr ""
#: ../gtk/details.c:633
msgid "Private to this tracker -- DHT and PEX disabled"
msgstr ""
#: ../gtk/details.c:635
msgid "Public torrent"
msgstr ""
#: ../gtk/details.c:658
#, c-format
msgid "Created by %1$s"
msgstr ""
#: ../gtk/details.c:660
#, c-format
msgid "Created on %1$s"
msgstr ""
#: ../gtk/details.c:662
#, c-format
msgid "Created by %1$s on %2$s"
msgstr ""
#: ../gtk/details.c:748
msgid "Unknown"
msgstr "Noma'lum"
#: ../gtk/details.c:776
#, c-format
msgid "%1$s (%2$'d piece @ %3$s)"
msgid_plural "%1$s (%2$'d pieces @ %3$s)"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/details.c:782
#, c-format
msgid "%1$s (%2$'d piece)"
msgid_plural "%1$s (%2$'d pieces)"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/details.c:816
#, c-format
msgid "%1$s (%2$s%%)"
msgstr ""
#: ../gtk/details.c:818
#, c-format
msgid "%1$s (%2$s%% of %3$s%% Available)"
msgstr ""
#: ../gtk/details.c:820
#, c-format
msgid "%1$s (%2$s%% of %3$s%% Available); %4$s Unverified"
msgstr ""
#: ../gtk/details.c:839
#, c-format
msgid "%1$s (+%2$s corrupt)"
msgstr ""
#: ../gtk/details.c:861
#, c-format
msgid "%s (Ratio: %s)"
msgstr ""
#: ../gtk/details.c:889
msgid "No errors"
msgstr ""
#: ../gtk/details.c:902
msgid "Never"
msgstr "Hech qachon"
#: ../gtk/details.c:906
msgid "Active now"
msgstr ""
#: ../gtk/details.c:910
#, c-format
msgid "%1$s ago"
msgstr ""
#: ../gtk/details.c:929
msgid "Activity"
msgstr ""
#: ../gtk/details.c:934
msgid "Torrent size:"
msgstr ""
#: ../gtk/details.c:939
msgid "Have:"
msgstr ""
#: ../gtk/details.c:944 ../gtk/stats.c:155 ../gtk/stats.c:172
msgid "Downloaded:"
msgstr ""
#: ../gtk/details.c:949 ../gtk/stats.c:152 ../gtk/stats.c:169
msgid "Uploaded:"
msgstr ""
#: ../gtk/details.c:954
msgid "State:"
msgstr "Штат:"
#: ../gtk/details.c:959
msgid "Running time:"
msgstr ""
#: ../gtk/details.c:964
msgid "Remaining time:"
msgstr ""
#: ../gtk/details.c:969
msgid "Last activity:"
msgstr ""
#: ../gtk/details.c:975
msgid "Error:"
msgstr "Хато:"
#: ../gtk/details.c:980
msgid "Details"
msgstr "Tafsilotlar"
#: ../gtk/details.c:986
msgid "Location:"
msgstr "Manzili:"
#: ../gtk/details.c:993
msgid "Hash:"
msgstr ""
#: ../gtk/details.c:999
msgid "Privacy:"
msgstr ""
#: ../gtk/details.c:1006
msgid "Origin:"
msgstr ""
#: ../gtk/details.c:1023
msgid "Comment:"
msgstr ""
#: ../gtk/details.c:1051
msgid "Webseeds"
msgstr ""
#: ../gtk/details.c:1053 ../gtk/details.c:1106
msgid "Down"
msgstr "Pastga"
#: ../gtk/details.c:1104
msgid "Address"
msgstr "Manzil"
#: ../gtk/details.c:1108
msgid "Up"
msgstr "Yuqoriga"
#: ../gtk/details.c:1109
msgid "Client"
msgstr "Klient"
#: ../gtk/details.c:1110
msgid "%"
msgstr "%"
#: ../gtk/details.c:1112
msgid "Up Reqs"
msgstr ""
#: ../gtk/details.c:1114
msgid "Dn Reqs"
msgstr ""
#: ../gtk/details.c:1116
msgid "Dn Blocks"
msgstr ""
#: ../gtk/details.c:1118
msgid "Up Blocks"
msgstr ""
#: ../gtk/details.c:1120
msgid "We Cancelled"
msgstr ""
#: ../gtk/details.c:1122
msgid "They Cancelled"
msgstr ""
#: ../gtk/details.c:1123
msgid "Flags"
msgstr "Байроқлар"
#: ../gtk/details.c:1478
msgid "Optimistic unchoke"
msgstr ""
#: ../gtk/details.c:1479
msgid "Downloading from this peer"
msgstr ""
#: ../gtk/details.c:1480
msgid "We would download from this peer if they would let us"
msgstr ""
#: ../gtk/details.c:1481
msgid "Uploading to peer"
msgstr ""
#: ../gtk/details.c:1482
msgid "We would upload to this peer if they asked"
msgstr ""
#: ../gtk/details.c:1483
msgid "Peer has unchoked us, but we're not interested"
msgstr ""
#: ../gtk/details.c:1484
msgid "We unchoked this peer, but they're not interested"
msgstr ""
#: ../gtk/details.c:1485
msgid "Encrypted connection"
msgstr ""
#: ../gtk/details.c:1486
msgid "Peer was found through Peer Exchange (PEX)"
msgstr ""
#: ../gtk/details.c:1487
msgid "Peer was found through DHT"
msgstr ""
#: ../gtk/details.c:1488
msgid "Peer is an incoming connection"
msgstr ""
#: ../gtk/details.c:1489
msgid "Peer is connected over µTP"
msgstr ""
#: ../gtk/details.c:1734 ../gtk/details.c:2441
msgid "Show _more details"
msgstr ""
#: ../gtk/details.c:1805
#, c-format
msgid "Got a list of %1$s%2$'d peers%3$s %4$s ago"
msgstr ""
#: ../gtk/details.c:1809
#, c-format
msgid "Peer list request %1$stimed out%2$s %3$s ago; will retry"
msgstr ""
#: ../gtk/details.c:1812
#, c-format
msgid "Got an error %1$s\"%2$s\"%3$s %4$s ago"
msgstr ""
#: ../gtk/details.c:1820
msgid "No updates scheduled"
msgstr ""
#: ../gtk/details.c:1825
#, c-format
msgid "Asking for more peers in %s"
msgstr ""
#: ../gtk/details.c:1829
msgid "Queued to ask for more peers"
msgstr ""
#: ../gtk/details.c:1834
#, c-format
msgid "Asking for more peers now… <small>%s</small>"
msgstr ""
#: ../gtk/details.c:1844
#, c-format
msgid "Tracker had %s%'d seeders and %'d leechers%s %s ago"
msgstr ""
#: ../gtk/details.c:1848
#, c-format
msgid "Got a scrape error \"%s%s%s\" %s ago"
msgstr ""
#: ../gtk/details.c:1858
#, c-format
msgid "Asking for peer counts in %s"
msgstr ""
#: ../gtk/details.c:1862
msgid "Queued to ask for peer counts"
msgstr ""
#: ../gtk/details.c:1867
#, c-format
msgid "Asking for peer counts now… <small>%s</small>"
msgstr ""
#: ../gtk/details.c:2137
msgid "List contains invalid URLs"
msgstr ""
#: ../gtk/details.c:2142
msgid "Please correct the errors and try again."
msgstr ""
#: ../gtk/details.c:2192
#, c-format
msgid "%s - Edit Trackers"
msgstr ""
#: ../gtk/details.c:2202
msgid "Tracker Announce URLs"
msgstr ""
#: ../gtk/details.c:2205 ../gtk/makemeta-ui.c:490
msgid ""
"To add a backup URL, add it on the line after the primary URL.\n"
"To add another primary URL, add it after a blank line."
msgstr ""
#: ../gtk/details.c:2302
#, c-format
msgid "%s - Add Tracker"
msgstr ""
#: ../gtk/details.c:2316
msgid "Tracker"
msgstr ""
#: ../gtk/details.c:2322
msgid "_Announce URL:"
msgstr ""
#: ../gtk/details.c:2397 ../gtk/details.c:2541 ../gtk/filter.c:323
msgid "Trackers"
msgstr ""
#: ../gtk/details.c:2421
msgid "_Add"
msgstr ""
#: ../gtk/details.c:2432
msgid "_Remove"
msgstr ""
#: ../gtk/details.c:2448
msgid "Show _backup trackers"
msgstr ""
#: ../gtk/details.c:2533 ../gtk/msgwin.c:440
msgid "Information"
msgstr ""
#: ../gtk/details.c:2537
msgid "Peers"
msgstr ""
#: ../gtk/details.c:2546
msgid "File listing not available for combined torrent properties"
msgstr ""
#: ../gtk/details.c:2550 ../gtk/makemeta-ui.c:437
msgid "Files"
msgstr ""
#: ../gtk/details.c:2554 ../gtk/tr-prefs.c:1239 ../gtk/tr-window.c:658
msgid "Options"
msgstr ""
#: ../gtk/details.c:2578
#, c-format
msgid "%s Properties"
msgstr ""
#: ../gtk/details.c:2589
#, c-format
msgid "%'d Torrent Properties"
msgstr ""
#: ../gtk/dialogs.c:95
#, c-format
msgid "Remove torrent?"
msgid_plural "Remove %d torrents?"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:101
#, c-format
msgid "Delete this torrent's downloaded files?"
msgid_plural "Delete these %d torrents' downloaded files?"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:111
msgid ""
"Once removed, continuing the transfer will require the torrent file or "
"magnet link."
msgid_plural ""
"Once removed, continuing the transfers will require the torrent files or "
"magnet links."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:117
msgid "This torrent has not finished downloading."
msgid_plural "These torrents have not finished downloading."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:123
msgid "This torrent is connected to peers."
msgid_plural "These torrents are connected to peers."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:130
msgid "One of these torrents is connected to peers."
msgid_plural "Some of these torrents are connected to peers."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/dialogs.c:137
msgid "One of these torrents has not finished downloading."
msgid_plural "Some of these torrents have not finished downloading."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/file-list.c:607 ../gtk/filter.c:348 ../gtk/util.c:471
msgid "High"
msgstr ""
#: ../gtk/file-list.c:608 ../gtk/filter.c:352 ../gtk/util.c:472
msgid "Normal"
msgstr ""
#: ../gtk/file-list.c:609 ../gtk/filter.c:356 ../gtk/util.c:473
msgid "Low"
msgstr ""
#: ../gtk/file-list.c:827 ../gtk/msgwin.c:305
msgid "Name"
msgstr ""
#. add "size" column
#: ../gtk/file-list.c:842
msgid "Size"
msgstr ""
#. add "progress" column
#: ../gtk/file-list.c:857
msgid "Have"
msgstr ""
#. add "enabled" column
#: ../gtk/file-list.c:870
msgid "Download"
msgstr ""
#. add priority column
#: ../gtk/file-list.c:886 ../gtk/filter.c:343
msgid "Priority"
msgstr ""
#: ../gtk/filter.c:315 ../gtk/filter.c:699
msgid "All"
msgstr ""
#: ../gtk/filter.c:329 ../gtk/tr-prefs.c:567 ../gtk/tr-prefs.c:1285
msgid "Privacy"
msgstr ""
#: ../gtk/filter.c:334
msgid "Public"
msgstr ""
#: ../gtk/filter.c:338
msgid "Private"
msgstr ""
#: ../gtk/filter.c:701
msgid "Active"
msgstr ""
#: ../gtk/filter.c:706
msgctxt "Verb"
msgid "Verifying"
msgstr ""
#: ../gtk/filter.c:707 ../gtk/msgwin.c:439
msgid "Error"
msgstr ""
#. add the activity combobox
#: ../gtk/filter.c:996
msgid "_Show:"
msgstr ""
#: ../gtk/main.c:308
#, c-format
msgid "Error registering Transmission as x-scheme-handler/magnet handler: %s"
msgstr ""
#: ../gtk/main.c:477
#, c-format
msgid ""
"Got signal %d; trying to shut down cleanly. Do it again if it gets stuck."
msgstr ""
#: ../gtk/main.c:610
msgid "Where to look for configuration files"
msgstr ""
#: ../gtk/main.c:611
msgid "Start with all torrents paused"
msgstr ""
#: ../gtk/main.c:612
msgid "Start minimized in notification area"
msgstr ""
#: ../gtk/main.c:613
msgid "Show version number and exit"
msgstr ""
#: ../gtk/main.c:630 ../gtk/transmission-gtk.desktop.in.h:1
msgid "Transmission"
msgstr ""
#. parse the command line
#: ../gtk/main.c:634
msgid "[torrent files or urls]"
msgstr ""
#: ../gtk/main.c:639
#, c-format
msgid ""
"%s\n"
"Run '%s --help' to see a full list of available command line options.\n"
msgstr ""
#: ../gtk/main.c:739
msgid ""
"Transmission is a file-sharing program. When you run a torrent, its data "
"will be made available to others by means of upload. You and you alone are "
"fully responsible for exercising proper judgement and abiding by your local "
"laws."
msgstr ""
#: ../gtk/main.c:741
msgid "I _Accept"
msgstr ""
#: ../gtk/main.c:963
msgid "<b>Closing Connections</b>"
msgstr ""
#: ../gtk/main.c:967
msgid "Sending upload/download totals to tracker…"
msgstr ""
#: ../gtk/main.c:972
msgid "_Quit Now"
msgstr ""
#: ../gtk/main.c:1030
msgid "Couldn't add corrupt torrent"
msgid_plural "Couldn't add corrupt torrents"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/main.c:1037
msgid "Couldn't add duplicate torrent"
msgid_plural "Couldn't add duplicate torrents"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/main.c:1336
msgid "A fast and easy BitTorrent client"
msgstr ""
#: ../gtk/main.c:1337
msgid "Copyright (c) The Transmission Project"
msgstr ""
#. Translators: translate "translator-credits" as your name
#. to have it appear in the credits in the "About"
#. dialog
#: ../gtk/main.c:1343
msgid "translator-credits"
msgstr ""
"Launchpad Contributions:\n"
" Sardorbek Pulatov https://launchpad.net/~prockrammer"
#: ../gtk/makemeta-ui.c:75
#, c-format
msgid "Creating \"%s\""
msgstr ""
#: ../gtk/makemeta-ui.c:77
#, c-format
msgid "Created \"%s\"!"
msgstr ""
#: ../gtk/makemeta-ui.c:79
#, c-format
msgid "Error: invalid announce URL \"%s\""
msgstr ""
#: ../gtk/makemeta-ui.c:81
#, c-format
msgid "Cancelled"
msgstr ""
#: ../gtk/makemeta-ui.c:83
#, c-format
msgid "Error reading \"%s\": %s"
msgstr ""
#: ../gtk/makemeta-ui.c:85
#, c-format
msgid "Error writing \"%s\": %s"
msgstr ""
#. how much data we've scanned through to generate checksums
#: ../gtk/makemeta-ui.c:102
#, c-format
msgid "Scanned %s"
msgstr ""
#: ../gtk/makemeta-ui.c:167 ../gtk/makemeta-ui.c:425
msgid "New Torrent"
msgstr ""
#: ../gtk/makemeta-ui.c:183
msgid "Creating torrent…"
msgstr ""
#: ../gtk/makemeta-ui.c:292
msgid "No source selected"
msgstr ""
#: ../gtk/makemeta-ui.c:298
#, c-format
msgid "%1$s; %2$'d File"
msgid_plural "%1$s; %2$'d Files"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/makemeta-ui.c:305
#, c-format
msgid "%1$'d Piece @ %2$s"
msgid_plural "%1$'d Pieces @ %2$s"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/makemeta-ui.c:439
msgid "Sa_ve to:"
msgstr ""
#: ../gtk/makemeta-ui.c:445
msgid "Source F_older:"
msgstr ""
#: ../gtk/makemeta-ui.c:457
msgid "Source _File:"
msgstr ""
#: ../gtk/makemeta-ui.c:469
msgid "<i>No source selected</i>"
msgstr ""
#: ../gtk/makemeta-ui.c:473
msgid "Properties"
msgstr ""
#: ../gtk/makemeta-ui.c:475
msgid "_Trackers:"
msgstr ""
#: ../gtk/makemeta-ui.c:497
msgid "Co_mment:"
msgstr ""
#: ../gtk/makemeta-ui.c:506
msgid "_Private torrent"
msgstr ""
#: ../gtk/msgwin.c:144
#, c-format
msgid "Couldn't save \"%s\""
msgstr ""
#: ../gtk/msgwin.c:205
msgid "Save Log"
msgstr ""
#: ../gtk/msgwin.c:300
msgid "Time"
msgstr ""
#: ../gtk/msgwin.c:310
msgid "Message"
msgstr ""
#: ../gtk/msgwin.c:441
msgid "Debug"
msgstr ""
#: ../gtk/msgwin.c:467
msgid "Message Log"
msgstr ""
#: ../gtk/msgwin.c:502
msgid "Level"
msgstr ""
#: ../gtk/notify.c:219
msgid "Open File"
msgstr ""
#: ../gtk/notify.c:224
msgid "Open Folder"
msgstr ""
#: ../gtk/notify.c:232
msgid "Torrent Complete"
msgstr ""
#: ../gtk/notify.c:254
msgid "Torrent Added"
msgstr ""
#: ../gtk/open-dialog.c:240
msgid "Torrent files"
msgstr ""
#: ../gtk/open-dialog.c:245
msgid "All files"
msgstr ""
#. make the dialog
#: ../gtk/open-dialog.c:270
msgid "Torrent Options"
msgstr ""
#: ../gtk/open-dialog.c:292 ../gtk/tr-prefs.c:334
msgid "Mo_ve .torrent file to the trash"
msgstr ""
#: ../gtk/open-dialog.c:294 ../gtk/tr-prefs.c:326
msgid "_Start when added"
msgstr ""
#. "torrent file" row
#: ../gtk/open-dialog.c:310
msgid "_Torrent file:"
msgstr ""
#: ../gtk/open-dialog.c:313
msgid "Select Source File"
msgstr ""
#: ../gtk/open-dialog.c:325
msgid "_Destination folder:"
msgstr ""
#: ../gtk/open-dialog.c:328
msgid "Select Destination Folder"
msgstr ""
#: ../gtk/open-dialog.c:427
msgid "Open a Torrent"
msgstr ""
#: ../gtk/open-dialog.c:443 ../gtk/tr-prefs.c:330
msgid "Show _options dialog"
msgstr ""
#: ../gtk/open-dialog.c:491
msgid "Open URL"
msgstr ""
#: ../gtk/open-dialog.c:504
msgid "Open torrent from URL"
msgstr ""
#: ../gtk/open-dialog.c:509
msgid "_URL"
msgstr ""
#: ../gtk/relocate.c:62
#, c-format
msgid "Moving \"%s\""
msgstr ""
#: ../gtk/relocate.c:84
msgid "Couldn't move torrent"
msgstr ""
#: ../gtk/relocate.c:125
msgid "This may take a moment…"
msgstr ""
#: ../gtk/relocate.c:156 ../gtk/relocate.c:176
msgid "Set Torrent Location"
msgstr ""
#: ../gtk/relocate.c:172 ../gtk/tr-prefs.c:269
msgid "Location"
msgstr ""
#: ../gtk/relocate.c:179
msgid "Torrent _location:"
msgstr ""
#: ../gtk/relocate.c:180
msgid "_Move from the current folder"
msgstr ""
#: ../gtk/relocate.c:183
msgid "Local data is _already there"
msgstr ""
#: ../gtk/stats.c:72 ../gtk/stats.c:164
#, c-format
msgid "Started %'d time"
msgid_plural "Started %'d times"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/stats.c:97
msgid "Reset your statistics?"
msgstr ""
#: ../gtk/stats.c:98
msgid ""
"These statistics are for your information only. Resetting them doesn't "
"affect the statistics logged by your BitTorrent trackers."
msgstr ""
#: ../gtk/stats.c:109 ../gtk/stats.c:137
msgid "_Reset"
msgstr ""
#: ../gtk/stats.c:134 ../gtk/tr-window.c:699
msgid "Statistics"
msgstr ""
#: ../gtk/stats.c:149
msgid "Current Session"
msgstr ""
#: ../gtk/stats.c:158 ../gtk/stats.c:175
msgid "Ratio:"
msgstr ""
#: ../gtk/stats.c:161 ../gtk/stats.c:178
msgid "Duration:"
msgstr ""
#: ../gtk/stats.c:163
msgid "Total"
msgstr ""
#. %1$s is how much we've got,
#. %2$s is how much we'll have when done,
#. %3$s%% is a percentage of the two
#: ../gtk/torrent-cell-renderer.c:61
#, c-format
msgid "%1$s of %2$s (%3$s%%)"
msgstr ""
#. %1$s is how much we've got,
#. %2$s is the torrent's total size,
#. %3$s%% is a percentage of the two,
#. %4$s is how much we've uploaded,
#. %5$s is our upload-to-download ratio,
#. %6$s is the ratio we want to reach before we stop uploading
#: ../gtk/torrent-cell-renderer.c:77
#, c-format
msgid "%1$s of %2$s (%3$s%%), uploaded %4$s (Ratio: %5$s Goal: %6$s)"
msgstr ""
#. %1$s is how much we've got,
#. %2$s is the torrent's total size,
#. %3$s%% is a percentage of the two,
#. %4$s is how much we've uploaded,
#. %5$s is our upload-to-download ratio
#: ../gtk/torrent-cell-renderer.c:93
#, c-format
msgid "%1$s of %2$s (%3$s%%), uploaded %4$s (Ratio: %5$s)"
msgstr ""
#. %1$s is the torrent's total size,
#. %2$s is how much we've uploaded,
#. %3$s is our upload-to-download ratio,
#. %4$s is the ratio we want to reach before we stop uploading
#: ../gtk/torrent-cell-renderer.c:110
#, c-format
msgid "%1$s, uploaded %2$s (Ratio: %3$s Goal: %4$s)"
msgstr ""
#. %1$s is the torrent's total size,
#. %2$s is how much we've uploaded,
#. %3$s is our upload-to-download ratio
#: ../gtk/torrent-cell-renderer.c:122
#, c-format
msgid "%1$s, uploaded %2$s (Ratio: %3$s)"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:136
msgid "Remaining time unknown"
msgstr ""
#. time remaining
#: ../gtk/torrent-cell-renderer.c:142
#, c-format
msgid "%s remaining"
msgstr ""
#. 1==down arrow, 2==down speed, 3==up arrow, 4==down speed
#: ../gtk/torrent-cell-renderer.c:167
#, c-format
msgid "%1$s %2$s, %3$s %4$s"
msgstr ""
#. bandwidth speed + unicode arrow
#: ../gtk/torrent-cell-renderer.c:172 ../gtk/torrent-cell-renderer.c:176
#, c-format
msgid "%1$s %2$s"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:179
msgid "Stalled"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:181 ../gtk/tr-icon.c:69
msgid "Idle"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:211
#, c-format
msgid "Verifying local data (%.1f%% tested)"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:222
#, c-format
msgid "Ratio %s"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:244
#, c-format
msgid "Tracker gave a warning: \"%s\""
msgstr ""
#: ../gtk/torrent-cell-renderer.c:245
#, c-format
msgid "Tracker gave an error: \"%s\""
msgstr ""
#: ../gtk/torrent-cell-renderer.c:246
#, c-format
msgid "Error: %s"
msgstr ""
#: ../gtk/torrent-cell-renderer.c:266
#, c-format
msgid "Downloading from %1$'d of %2$'d connected peer"
msgid_plural "Downloading from %1$'d of %2$'d connected peers"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/torrent-cell-renderer.c:275
#, c-format
msgid "Downloading metadata from %1$'d peer (%2$d%% done)"
msgid_plural "Downloading metadata from %1$'d peers (%2$d%% done)"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/torrent-cell-renderer.c:301
#, c-format
msgid "Seeding to %1$'d of %2$'d connected peer"
msgid_plural "Seeding to %1$'d of %2$'d connected peers"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/transmission-gtk.desktop.in.h:2
msgid "BitTorrent Client"
msgstr ""
#: ../gtk/transmission-gtk.desktop.in.h:3
msgid "Transmission BitTorrent Client"
msgstr ""
#: ../gtk/transmission-gtk.desktop.in.h:4
msgid "Download and share files over BitTorrent"
msgstr ""
#: ../gtk/tr-core.c:1181
#, c-format
msgid "Couldn't read \"%s\": %s"
msgstr ""
#: ../gtk/tr-core.c:1277
#, c-format
msgid "Skipping unknown torrent \"%s\""
msgstr ""
#: ../gtk/tr-core.c:1521
msgid "Inhibiting desktop hibernation"
msgstr ""
#: ../gtk/tr-core.c:1525
#, c-format
msgid "Couldn't inhibit desktop hibernation: %s"
msgstr ""
#: ../gtk/tr-core.c:1559
msgid "Allowing desktop hibernation"
msgstr ""
#: ../gtk/tr-icon.c:86 ../gtk/tr-icon.c:102
#, c-format
msgid "(Limit: %s)"
msgstr ""
#. %1$s: current upload speed
#. * %2$s: current upload limit, if any
#. * %3$s: current download speed
#. * %4$s: current download limit, if any
#: ../gtk/tr-icon.c:109
#, c-format
msgid ""
"Transmission\n"
"Up: %1$s %2$s\n"
"Down: %3$s %4$s"
msgstr ""
#: ../gtk/tr-prefs.c:272
msgid "Save to _Location:"
msgstr ""
#: ../gtk/tr-prefs.c:275
msgid "Queue"
msgstr ""
#: ../gtk/tr-prefs.c:277
msgid "Maximum active _downloads:"
msgstr ""
#: ../gtk/tr-prefs.c:281
msgid "Downloads sharing data in the last N minutes are _active:"
msgstr ""
#: ../gtk/tr-prefs.c:286 ../libtransmission/torrent.c:1919
msgid "Incomplete"
msgstr ""
#: ../gtk/tr-prefs.c:288
msgid "Append \"._part\" to incomplete files' names"
msgstr ""
#: ../gtk/tr-prefs.c:292
msgid "Keep _incomplete torrents in:"
msgstr ""
#: ../gtk/tr-prefs.c:299
msgid "Call _script when torrent is completed:"
msgstr ""
#: ../gtk/tr-prefs.c:324
msgctxt "Gerund"
msgid "Adding"
msgstr ""
#: ../gtk/tr-prefs.c:338
msgid "Automatically _add torrents from:"
msgstr ""
#: ../gtk/tr-prefs.c:346
msgctxt "Gerund"
msgid "Seeding"
msgstr ""
#: ../gtk/tr-prefs.c:348
msgid "Stop seeding at _ratio:"
msgstr ""
#: ../gtk/tr-prefs.c:355
msgid "Stop seeding if idle for _N minutes:"
msgstr ""
#: ../gtk/tr-prefs.c:378 ../gtk/tr-prefs.c:1291
msgid "Desktop"
msgstr ""
#: ../gtk/tr-prefs.c:380
msgid "_Inhibit hibernation when torrents are active"
msgstr ""
#: ../gtk/tr-prefs.c:384
msgid "Show Transmission icon in the _notification area"
msgstr ""
#: ../gtk/tr-prefs.c:389
msgid "Notification"
msgstr ""
#: ../gtk/tr-prefs.c:391
msgid "Show a notification when torrents are a_dded"
msgstr ""
#: ../gtk/tr-prefs.c:395
msgid "Show a notification when torrents _finish"
msgstr ""
#: ../gtk/tr-prefs.c:399
msgid "Play a _sound when torrents finish"
msgstr ""
#: ../gtk/tr-prefs.c:427
#, c-format
msgid "Blocklist contains %'d rule"
msgid_plural "Blocklist contains %'d rules"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/tr-prefs.c:460
#, c-format
msgid "Blocklist has %'d rule."
msgid_plural "Blocklist has %'d rules."
msgstr[0] ""
msgstr[1] ""
#: ../gtk/tr-prefs.c:464
msgid "<b>Update succeeded!</b>"
msgstr ""
#: ../gtk/tr-prefs.c:464
msgid "<b>Unable to update.</b>"
msgstr ""
#: ../gtk/tr-prefs.c:479
msgid "Update Blocklist"
msgstr ""
#: ../gtk/tr-prefs.c:481
msgid "Getting new blocklist…"
msgstr ""
#: ../gtk/tr-prefs.c:509
msgid "Allow encryption"
msgstr ""
#: ../gtk/tr-prefs.c:510
msgid "Prefer encryption"
msgstr ""
#: ../gtk/tr-prefs.c:511
msgid "Require encryption"
msgstr ""
#: ../gtk/tr-prefs.c:535
msgid "Blocklist"
msgstr ""
#: ../gtk/tr-prefs.c:537
msgid "Enable _blocklist:"
msgstr ""
#: ../gtk/tr-prefs.c:551
msgid "_Update"
msgstr ""
#: ../gtk/tr-prefs.c:561
msgid "Enable _automatic updates"
msgstr ""
#: ../gtk/tr-prefs.c:569
msgid "_Encryption mode:"
msgstr ""
#: ../gtk/tr-prefs.c:573
msgid "Use PE_X to find more peers"
msgstr ""
#: ../gtk/tr-prefs.c:575
msgid ""
"PEX is a tool for exchanging peer lists with the peers you're connected to."
msgstr ""
#: ../gtk/tr-prefs.c:579
msgid "Use _DHT to find more peers"
msgstr ""
#: ../gtk/tr-prefs.c:581
msgid "DHT is a tool for finding peers without a tracker."
msgstr ""
#: ../gtk/tr-prefs.c:585
msgid "Use _Local Peer Discovery to find more peers"
msgstr ""
#: ../gtk/tr-prefs.c:587
msgid "LPD is a tool for finding peers on your local network."
msgstr ""
#: ../gtk/tr-prefs.c:803
msgid "Web Client"
msgstr ""
#. "enabled" checkbutton
#: ../gtk/tr-prefs.c:806
msgid "_Enable web client"
msgstr ""
#: ../gtk/tr-prefs.c:812
msgid "_Open web client"
msgstr ""
#: ../gtk/tr-prefs.c:821
msgid "HTTP _port:"
msgstr ""
#. require authentication
#: ../gtk/tr-prefs.c:825
msgid "Use _authentication"
msgstr ""
#. username
#: ../gtk/tr-prefs.c:833
msgid "_Username:"
msgstr ""
#. password
#: ../gtk/tr-prefs.c:840
msgid "Pass_word:"
msgstr ""
#. require authentication
#: ../gtk/tr-prefs.c:848
msgid "Only allow these IP a_ddresses to connect:"
msgstr ""
#: ../gtk/tr-prefs.c:873
msgid "IP addresses may use wildcards, such as 192.168.*.*"
msgstr ""
#: ../gtk/tr-prefs.c:895
msgid "Addresses:"
msgstr ""
#: ../gtk/tr-prefs.c:1012
msgid "Every Day"
msgstr ""
#: ../gtk/tr-prefs.c:1013
msgid "Weekdays"
msgstr ""
#: ../gtk/tr-prefs.c:1014
msgid "Weekends"
msgstr ""
#: ../gtk/tr-prefs.c:1015
msgid "Sunday"
msgstr ""
#: ../gtk/tr-prefs.c:1016
msgid "Monday"
msgstr ""
#: ../gtk/tr-prefs.c:1017
msgid "Tuesday"
msgstr ""
#: ../gtk/tr-prefs.c:1018
msgid "Wednesday"
msgstr ""
#: ../gtk/tr-prefs.c:1019
msgid "Thursday"
msgstr ""
#: ../gtk/tr-prefs.c:1020
msgid "Friday"
msgstr ""
#: ../gtk/tr-prefs.c:1021
msgid "Saturday"
msgstr ""
#: ../gtk/tr-prefs.c:1052
msgid "Speed Limits"
msgstr ""
#: ../gtk/tr-prefs.c:1054
#, c-format
msgid "_Upload (%s):"
msgstr ""
#: ../gtk/tr-prefs.c:1061
#, c-format
msgid "_Download (%s):"
msgstr ""
#: ../gtk/tr-prefs.c:1072
msgid "Alternative Speed Limits"
msgstr ""
#: ../gtk/tr-prefs.c:1079
msgid "Override normal speed limits manually or at scheduled times"
msgstr ""
#: ../gtk/tr-prefs.c:1086
#, c-format
msgid "U_pload (%s):"
msgstr ""
#: ../gtk/tr-prefs.c:1090
#, c-format
msgid "Do_wnload (%s):"
msgstr ""
#: ../gtk/tr-prefs.c:1094
msgid "_Scheduled times:"
msgstr ""
#: ../gtk/tr-prefs.c:1099
msgid " _to "
msgstr ""
#: ../gtk/tr-prefs.c:1110
msgid "_On days:"
msgstr ""
#: ../gtk/tr-prefs.c:1143 ../gtk/tr-prefs.c:1212
msgid "Status unknown"
msgstr ""
#: ../gtk/tr-prefs.c:1167
msgid "Port is <b>open</b>"
msgstr ""
#: ../gtk/tr-prefs.c:1167
msgid "Port is <b>closed</b>"
msgstr ""
#: ../gtk/tr-prefs.c:1182
msgid "<i>Testing TCP port…</i>"
msgstr ""
#: ../gtk/tr-prefs.c:1205
msgid "Listening Port"
msgstr ""
#: ../gtk/tr-prefs.c:1207
msgid "_Port used for incoming connections:"
msgstr ""
#: ../gtk/tr-prefs.c:1215
msgid "Te_st Port"
msgstr ""
#: ../gtk/tr-prefs.c:1222
msgid "Pick a _random port every time Transmission is started"
msgstr ""
#: ../gtk/tr-prefs.c:1226
msgid "Use UPnP or NAT-PMP port _forwarding from my router"
msgstr ""
#: ../gtk/tr-prefs.c:1231
msgid "Peer Limits"
msgstr ""
#: ../gtk/tr-prefs.c:1234
msgid "Maximum peers per _torrent:"
msgstr ""
#: ../gtk/tr-prefs.c:1236
msgid "Maximum peers _overall:"
msgstr ""
#: ../gtk/tr-prefs.c:1242
msgid "Enable _uTP for peer communication"
msgstr ""
#: ../gtk/tr-prefs.c:1244
msgid "uTP is a tool for reducing network congestion."
msgstr ""
#: ../gtk/tr-prefs.c:1262
msgid "Transmission Preferences"
msgstr ""
#: ../gtk/tr-prefs.c:1276
msgid "Torrents"
msgstr ""
#: ../gtk/tr-prefs.c:1279
msgctxt "Gerund"
msgid "Downloading"
msgstr ""
#: ../gtk/tr-prefs.c:1288
msgid "Network"
msgstr ""
#: ../gtk/tr-prefs.c:1294
msgid "Web"
msgstr ""
#: ../gtk/tr-window.c:148
msgid "Torrent"
msgstr ""
#: ../gtk/tr-window.c:252
msgid "Total Ratio"
msgstr ""
#: ../gtk/tr-window.c:253
msgid "Session Ratio"
msgstr ""
#: ../gtk/tr-window.c:254
msgid "Total Transfer"
msgstr ""
#: ../gtk/tr-window.c:255
msgid "Session Transfer"
msgstr ""
#: ../gtk/tr-window.c:284
#, c-format
msgid ""
"Click to disable Alternative Speed Limits\n"
"(%1$s down, %2$s up)"
msgstr ""
#: ../gtk/tr-window.c:285
#, c-format
msgid ""
"Click to enable Alternative Speed Limits\n"
"(%1$s down, %2$s up)"
msgstr ""
#: ../gtk/tr-window.c:350
#, c-format
msgid "Tracker will allow requests in %s"
msgstr ""
#: ../gtk/tr-window.c:419
msgid "Unlimited"
msgstr ""
#: ../gtk/tr-window.c:486
msgid "Seed Forever"
msgstr ""
#: ../gtk/tr-window.c:524
msgid "Limit Download Speed"
msgstr ""
#: ../gtk/tr-window.c:528
msgid "Limit Upload Speed"
msgstr ""
#: ../gtk/tr-window.c:535
msgid "Stop Seeding at Ratio"
msgstr ""
#: ../gtk/tr-window.c:569
#, c-format
msgid "Stop at Ratio (%s)"
msgstr ""
#: ../gtk/tr-window.c:771
#, c-format
msgid "%1$'d of %2$'d Torrent"
msgid_plural "%1$'d of %2$'d Torrents"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/tr-window.c:777
#, c-format
msgid "%'d Torrent"
msgid_plural "%'d Torrents"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/tr-window.c:797 ../gtk/tr-window.c:825
#, c-format
msgid "Ratio: %s"
msgstr ""
#: ../gtk/tr-window.c:808
#, c-format
msgid "Down: %1$s, Up: %2$s"
msgstr ""
#: ../gtk/tr-window.c:819
#, c-format
msgid "size|Down: %1$s, Up: %2$s"
msgstr ""
#: ../gtk/util.c:38
msgid "KiB"
msgstr ""
#: ../gtk/util.c:39
msgid "MiB"
msgstr ""
#: ../gtk/util.c:40
msgid "GiB"
msgstr ""
#: ../gtk/util.c:41
msgid "TiB"
msgstr ""
#: ../gtk/util.c:44
msgid "kB"
msgstr ""
#: ../gtk/util.c:45
msgid "MB"
msgstr ""
#: ../gtk/util.c:46
msgid "GB"
msgstr ""
#: ../gtk/util.c:47
msgid "TB"
msgstr ""
#: ../gtk/util.c:50
msgid "kB/s"
msgstr ""
#: ../gtk/util.c:51
msgid "MB/s"
msgstr ""
#: ../gtk/util.c:52
msgid "GB/s"
msgstr ""
#: ../gtk/util.c:53
msgid "TB/s"
msgstr ""
#: ../cli/cli.c:115 ../gtk/util.c:87 ../libtransmission/utils.c:1509
msgid "None"
msgstr ""
#: ../gtk/util.c:108
#, c-format
msgid "%'d day"
msgid_plural "%'d days"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/util.c:109
#, c-format
msgid "%'d hour"
msgid_plural "%'d hours"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/util.c:110
#, c-format
msgid "%'d minute"
msgid_plural "%'d minutes"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/util.c:111
#, c-format
msgid "%'d second"
msgid_plural "%'d seconds"
msgstr[0] ""
msgstr[1] ""
#: ../gtk/util.c:223
#, c-format
msgid "The torrent file \"%s\" contains invalid data."
msgstr ""
#: ../gtk/util.c:224
#, c-format
msgid "The torrent file \"%s\" is already in use."
msgstr ""
#: ../gtk/util.c:225
#, c-format
msgid "The torrent file \"%s\" encountered an unknown error."
msgstr ""
#: ../gtk/util.c:233
msgid "Error opening torrent"
msgstr ""
#: ../gtk/util.c:540
#, c-format
msgid "Error opening \"%s\""
msgstr ""
#: ../gtk/util.c:543
#, c-format
msgid "Server returned \"%1$ld %2$s\""
msgstr ""
#: ../gtk/util.c:563
msgid "Unrecognized URL"
msgstr ""
#: ../gtk/util.c:565
#, c-format
msgid "Transmission doesn't know how to use \"%s\""
msgstr ""
#: ../gtk/util.c:570
#, c-format
msgid ""
"This magnet link appears to be intended for something other than BitTorrent. "
"BitTorrent magnet links have a section containing \"%s\"."
msgstr ""
#. did caller give us an uninitialized val?
#: ../libtransmission/bencode.c:1117
msgid "Invalid metadata"
msgstr ""
#: ../libtransmission/bencode.c:1723 ../libtransmission/bencode.c:1751
#, c-format
msgid "Couldn't save temporary file \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/bencode.c:1738
#, c-format
msgid "Saved \"%s\""
msgstr ""
#: ../libtransmission/bencode.c:1743 ../libtransmission/blocklist.c:417
#: ../libtransmission/rpcimpl.c:1260 ../libtransmission/rpcimpl.c:1271
#: ../libtransmission/rpcimpl.c:1287
#, c-format
msgid "Couldn't save file \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/blocklist.c:86 ../libtransmission/blocklist.c:325
#: ../libtransmission/utils.c:438
#, c-format
msgid "Couldn't read \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/blocklist.c:115
#, c-format
msgid "Blocklist \"%s\" contains %zu entries"
msgstr ""
#. don't try to display the actual lines - it causes issues
#: ../libtransmission/blocklist.c:368
#, c-format
msgid "blocklist skipped invalid address at line %d"
msgstr ""
#: ../libtransmission/blocklist.c:420
#, c-format
msgid "Blocklist \"%s\" updated with %zu entries"
msgstr ""
#: ../libtransmission/fdlimit.c:348 ../libtransmission/utils.c:574
#: ../libtransmission/utils.c:585
#, c-format
msgid "Couldn't create \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/fdlimit.c:369
#, c-format
msgid "Couldn't open \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/fdlimit.c:384
#, c-format
msgid "Couldn't truncate \"%1$s\": %2$s"
msgstr ""
#: ../libtransmission/fdlimit.c:670
#, c-format
msgid "Couldn't create socket: %s"
msgstr ""
#: ../libtransmission/makemeta.c:63
#, c-format
msgid "Torrent Creator is skipping file \"%s\": %s"
msgstr ""
#: ../libtransmission/metainfo.c:533
#, c-format
msgid "Invalid metadata entry \"%s\""
msgstr ""
#: ../libtransmission/natpmp.c:32
msgid "Port Forwarding (NAT-PMP)"
msgstr ""
#: ../libtransmission/natpmp.c:72
#, c-format
msgid "%s succeeded (%d)"
msgstr ""
#: ../libtransmission/natpmp.c:141
#, c-format
msgid "Found public address \"%s\""
msgstr ""
#: ../libtransmission/natpmp.c:176
#, c-format
msgid "no longer forwarding port %d"
msgstr ""
#: ../libtransmission/natpmp.c:221
#, c-format
msgid "Port %d forwarded successfully"
msgstr ""
#: ../libtransmission/net.c:268
#, c-format
msgid "Couldn't set source address %s on %d: %s"
msgstr ""
#: ../libtransmission/net.c:284
#, c-format
msgid "Couldn't connect socket %d to %s, port %d (errno %d - %s)"
msgstr ""
#: ../libtransmission/net.c:360
msgid "Is another copy of Transmission already running?"
msgstr ""
#: ../libtransmission/net.c:365
#, c-format
msgid "Couldn't bind port %d on %s: %s"
msgstr ""
#: ../libtransmission/net.c:367
#, c-format
msgid "Couldn't bind port %d on %s: %s (%s)"
msgstr ""
#: ../libtransmission/peer-msgs.c:1898
#, c-format
msgid "Please Verify Local Data! Piece #%zu is corrupt."
msgstr ""
#: ../libtransmission/port-forwarding.c:31
msgid "Port Forwarding"
msgstr ""
#: ../libtransmission/port-forwarding.c:58
msgid "Starting"
msgstr ""
#: ../libtransmission/port-forwarding.c:59
msgid "Forwarded"
msgstr ""
#: ../libtransmission/port-forwarding.c:60
msgid "Stopping"
msgstr ""
#: ../libtransmission/port-forwarding.c:61
msgid "Not forwarded"
msgstr ""
#: ../libtransmission/port-forwarding.c:91 ../libtransmission/torrent.c:2060
#, c-format
msgid "State changed from \"%1$s\" to \"%2$s\""
msgstr ""
#: ../libtransmission/port-forwarding.c:181
msgid "Stopped"
msgstr ""
#. first %s is the application name
#. second %s is the version number
#: ../libtransmission/session.c:722
#, c-format
msgid "%s %s started"
msgstr ""
#: ../libtransmission/session.c:1943
#, c-format
msgid "Loaded %d torrents"
msgstr ""
#: ../libtransmission/torrent.c:525
#, c-format
msgid "Tracker warning: \"%s\""
msgstr ""
#: ../libtransmission/torrent.c:532
#, c-format
msgid "Tracker error: \"%s\""
msgstr ""
#: ../libtransmission/torrent.c:787
msgid ""
"No data found! Ensure your drives are connected or use \"Set Location\". To "
"re-download, remove the torrent and re-add it."
msgstr ""
#: ../libtransmission/torrent.c:1677
msgid "Restarted manually -- disabling its seed ratio"
msgstr ""
#: ../libtransmission/torrent.c:1829
msgid "Removing torrent"
msgstr ""
#: ../libtransmission/torrent.c:1913
msgid "Done"
msgstr ""
#: ../libtransmission/torrent.c:1916
msgid "Complete"
msgstr ""
#: ../libtransmission/upnp.c:35
msgid "Port Forwarding (UPnP)"
msgstr ""
#: ../libtransmission/upnp.c:199
#, c-format
msgid "Found Internet Gateway Device \"%s\""
msgstr ""
#: ../libtransmission/upnp.c:202
#, c-format
msgid "Local Address is \"%s\""
msgstr ""
#: ../libtransmission/upnp.c:231
#, c-format
msgid "Port %d isn't forwarded"
msgstr ""
#: ../libtransmission/upnp.c:242
#, c-format
msgid "Stopping port forwarding through \"%s\", service \"%s\""
msgstr ""
#: ../libtransmission/upnp.c:275
#, c-format
msgid ""
"Port forwarding through \"%s\", service \"%s\". (local address: %s:%d)"
msgstr ""
#: ../libtransmission/upnp.c:280
msgid "Port forwarding successful!"
msgstr ""
#: ../libtransmission/utils.c:452
msgid "Not a regular file"
msgstr ""
#: ../libtransmission/utils.c:470
msgid "Memory allocation failed"
msgstr ""
#. Node exists but isn't a folder
#: ../libtransmission/utils.c:584
#, c-format
msgid "File \"%s\" is in the way"
msgstr ""
#: ../libtransmission/verify.c:229
msgid "Verifying torrent"
msgstr ""
#~ msgid "Open URL..."
#~ msgstr "URL ochish..."
#~ msgid "Open _URL..."
#~ msgstr "_URL ochish..."
#~ msgid "_New..."
#~ msgstr "Ya_ngi"
#~ msgid "Downloading"
#~ msgstr "Yozib olinmoqda"
| {
"pile_set_name": "Github"
} |
{
"images": [
{
"filename": "ic_import_export_white_48pt.png",
"idiom": "universal",
"scale": "1x"
},
{
"filename": "ic_import_export_white_48pt_2x.png",
"idiom": "universal",
"scale": "2x"
},
{
"filename": "ic_import_export_white_48pt_3x.png",
"idiom": "universal",
"scale": "3x"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
| {
"pile_set_name": "Github"
} |
import unittest
import os
from robot.utils.asserts import assert_equal, assert_not_none, assert_none, assert_true
from robot.utils import get_env_var, set_env_var, del_env_var, get_env_vars, unicode
TEST_VAR = 'TeST_EnV_vAR'
TEST_VAL = 'original value'
NON_ASCII_VAR = u'\xe4iti'
NON_ASCII_VAL = u'is\xe4'
class TestRobotEnv(unittest.TestCase):
def setUp(self):
os.environ[TEST_VAR] = TEST_VAL
def tearDown(self):
if TEST_VAR in os.environ:
del os.environ[TEST_VAR]
def test_get_env_var(self):
assert_not_none(get_env_var('PATH'))
assert_equal(get_env_var(TEST_VAR), TEST_VAL)
assert_none(get_env_var('NoNeXiStInG'))
assert_equal(get_env_var('NoNeXiStInG', 'default'), 'default')
def test_set_env_var(self):
set_env_var(TEST_VAR, 'new value')
assert_equal(os.getenv(TEST_VAR), 'new value')
def test_del_env_var(self):
old = del_env_var(TEST_VAR)
assert_none(os.getenv(TEST_VAR))
assert_equal(old, TEST_VAL)
assert_none(del_env_var(TEST_VAR))
def test_get_set_del_non_ascii_vars(self):
set_env_var(NON_ASCII_VAR, NON_ASCII_VAL)
assert_equal(get_env_var(NON_ASCII_VAR), NON_ASCII_VAL)
assert_equal(del_env_var(NON_ASCII_VAR), NON_ASCII_VAL)
assert_none(get_env_var(NON_ASCII_VAR))
def test_get_env_vars(self):
set_env_var(NON_ASCII_VAR, NON_ASCII_VAL)
vars = get_env_vars()
assert_true('PATH' in vars)
assert_equal(vars[self._upper_on_windows(TEST_VAR)], TEST_VAL)
assert_equal(vars[self._upper_on_windows(NON_ASCII_VAR)], NON_ASCII_VAL)
for k, v in vars.items():
assert_true(isinstance(k, unicode) and isinstance(v, unicode))
def _upper_on_windows(self, name):
return name if os.sep == '/' else name.upper()
if __name__ == '__main__':
unittest.main()
| {
"pile_set_name": "Github"
} |
---
title: 'Lync Server 2013: Replacing the XmlAdapter with a customized Persistent Chat Server Compliance adapter'
ms.reviewer:
ms.author: v-lanac
author: lanachin
f1.keywords:
- NOCSH
TOCTitle: Replacing the XmlAdapter with a customized Persistent Chat Server Compliance adapter
ms:assetid: 2cb70db2-663f-40a6-abcf-89ea7d4a8b65
ms:mtpsurl: https://technet.microsoft.com/en-us/library/JJ680106(v=OCS.15)
ms:contentKeyID: 49558152
ms.date: 07/23/2014
manager: serdars
mtps_version: v=OCS.15
---
<div data-xmlns="http://www.w3.org/1999/xhtml">
<div class="topic" data-xmlns="http://www.w3.org/1999/xhtml" data-msxsl="urn:schemas-microsoft-com:xslt" data-cs="https://msdn.microsoft.com/">
<div data-asp="https://msdn2.microsoft.com/asp">
# Replacing the XmlAdapter with a customized Persistent Chat Server Compliance adapter in Lync Server 2013
</div>
<div id="mainSection">
<div id="mainBody">
<span> </span>
_**Topic Last Modified:** 2012-11-01_
You can write a custom adapter instead of using the XmlAdapter that is installed with Persistent Chat Server. To accomplish this, you must provide a .NET Framework assembly that contains a public class that implements the **IComplianceAdapter** interface. You must place this assembly in the Persistent Chat Server installation folder of each server in your Persistent Chat Server pool. Any one of the Compliance servers can provide compliance data to your adapter, but the compliance servers will not provide duplicate compliance data to multiple instances of your adapter.
<div>
## Implementing the IComplianceAdapter interface
The interface is defined in the Compliance.dll assembly in the namespace `Microsoft.Rtc.Internal.Chat.Server.Compliance`. The interface defines two methods that your custom adapter must implement.
void SetConfig(AdapterConfig config)
The Persistent Chat Compliance server will call this method when the adapter first loads. The `AdapterConfig` contains the Persistent Chat compliance configuration that is relevant to the compliance adapter.
void Translate(ConversationCollection conversations)
The Persistent Chat Compliance server calls this method at periodic intervals as long as there is new data to translate. This time interval is equal to the `RunInterval` as set in the Persistent Chat Compliance configuration.
The `ConversationCollection` contains the conversation information that was collected from the last time this method was called.
</div>
</div>
<span> </span>
</div>
</div>
</div>
| {
"pile_set_name": "Github"
} |
{{ if eq .Dialect "postgres" }}
drop_table("cakes")
{{ end }} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Holo.NoActionBar"/>
</resources> | {
"pile_set_name": "Github"
} |
/*
* kmscon - Fragment Shader
*
* Copyright (c) 2011-2012 David Herrmann <[email protected]>
* Copyright (c) 2011 University of Tuebingen
*
* 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.
*/
/*
* Fragment Shader
* A basic fragment shader which applies a 2D texture.
*/
precision mediump float;
uniform sampler2D texture;
varying vec2 texpos;
void main()
{
gl_FragColor = texture2D(texture, texpos);
}
| {
"pile_set_name": "Github"
} |
#include <tinyhal.h>
#include "cmsis_generic.h"
// only one "generic" port supported for ITM tracing messages to hardware debugger
// so pInstance is ignored
static int ItmPort_Write( void* pInstance, const char* Data, size_t size )
{
for( int i = 0; i< size; ++i )
ITM_SendChar( Data[i] );
return size;
}
static IGenericPort const ItmPortItf =
{
// default returns TRUE
NULL, //BOOL (*Initialize)( void* pInstance );
// default returns TRUE
NULL, //BOOL (*Uninitialize)( void* pInstance );
// default return 0
ItmPort_Write, //int (*Write)( void* pInstance, const char* Data, size_t size );
// defualt return 0
NULL, //int (*Read)( void* pInstance, char* Data, size_t size );
// default return TRUE
NULL, //BOOL (*Flush)( void* pInstance );
// default do nothing
NULL, //void (*ProtectPins)( void* pInstance, BOOL On );
// default return FALSE
NULL, //BOOL (*IsSslSupported)( void* pInstance );
// default return FALSE
NULL, //BOOL (*UpgradeToSsl)( void* pInstance, const UINT8* pCACert, UINT32 caCertLen, const UINT8* pDeviceCert, UINT32 deviceCertLen, LPCSTR szTargetHost );
// default return FALSE
NULL, //BOOL (*IsUsingSsl)( void* pInstance );
};
extern const GenericPortTableEntry Itm0GenericPort =
{
ItmPortItf,
NULL
};
| {
"pile_set_name": "Github"
} |
.. _mapping:
Design
=======
This section introduces mapping as a tool for visual communication.
.. toctree::
:maxdepth: 1
symbology
style
.. note::
This section uses Open Geospatial Consortium (OGC) terminology in our description of geometry and spatial data. While the terms we use here are general purpose, they may differ slightly from those you are familiar with.
References:
* `Geographic Markup Language <http://www.opengeospatial.org/standards/gml>`_
* `OGC Reference Model <http://www.opengeospatial.org/standards/orm>`_ (OGC Portal)
* `ISO 19107 Geographic information -- Spatial schema <http://www.iso.org/iso/catalogue_detail.htm?csnumber=26012>`_ (ISO)
.. only:: instructor
.. admonition:: Instructor Notes
Additional Reference:
* http://www.markmonmonier.com/how_to_lie_with_maps_14880.htm
* http://www.worldatlas.com/mapterms.htm
| {
"pile_set_name": "Github"
} |
namespace eval ::tk {
::msgcat::mcset en "&Abort"
::msgcat::mcset en "&About..."
::msgcat::mcset en "All Files"
::msgcat::mcset en "Application Error"
::msgcat::mcset en "&Apply"
::msgcat::mcset en "Bold"
::msgcat::mcset en "Bold Italic"
::msgcat::mcset en "&Blue"
::msgcat::mcset en "Cancel"
::msgcat::mcset en "&Cancel"
::msgcat::mcset en "Cannot change to the directory \"%1\$s\".\nPermission denied."
::msgcat::mcset en "Choose Directory"
::msgcat::mcset en "Cl&ear"
::msgcat::mcset en "&Clear Console"
::msgcat::mcset en "Color"
::msgcat::mcset en "Console"
::msgcat::mcset en "&Copy"
::msgcat::mcset en "Cu&t"
::msgcat::mcset en "&Delete"
::msgcat::mcset en "Details >>"
::msgcat::mcset en "Directory \"%1\$s\" does not exist."
::msgcat::mcset en "&Directory:"
::msgcat::mcset en "&Edit"
::msgcat::mcset en "Effects"
::msgcat::mcset en "Error: %1\$s"
::msgcat::mcset en "E&xit"
::msgcat::mcset en "&File"
::msgcat::mcset en "File \"%1\$s\" already exists.\nDo you want to overwrite it?"
::msgcat::mcset en "File \"%1\$s\" already exists.\n\n"
::msgcat::mcset en "File \"%1\$s\" does not exist."
::msgcat::mcset en "File &name:"
::msgcat::mcset en "File &names:"
::msgcat::mcset en "Files of &type:"
::msgcat::mcset en "Fi&les:"
::msgcat::mcset en "&Filter"
::msgcat::mcset en "Fil&ter:"
::msgcat::mcset en "Font"
::msgcat::mcset en "&Font:"
::msgcat::mcset en "Font st&yle:"
::msgcat::mcset en "&Green"
::msgcat::mcset en "&Help"
::msgcat::mcset en "Hi"
::msgcat::mcset en "&Hide Console"
::msgcat::mcset en "&Ignore"
::msgcat::mcset en "Invalid file name \"%1\$s\"."
::msgcat::mcset en "Italic"
::msgcat::mcset en "Log Files"
::msgcat::mcset en "&No"
::msgcat::mcset en "&OK"
::msgcat::mcset en "OK"
::msgcat::mcset en "Ok"
::msgcat::mcset en "Open"
::msgcat::mcset en "&Open"
::msgcat::mcset en "Open Multiple Files"
::msgcat::mcset en "P&aste"
::msgcat::mcset en "&Quit"
::msgcat::mcset en "&Red"
::msgcat::mcset en "Regular"
::msgcat::mcset en "Replace existing file?"
::msgcat::mcset en "&Retry"
::msgcat::mcset en "Sample"
::msgcat::mcset en "&Save"
::msgcat::mcset en "Save As"
::msgcat::mcset en "Save To Log"
::msgcat::mcset en "Select Log File"
::msgcat::mcset en "Select a file to source"
::msgcat::mcset en "&Selection:"
::msgcat::mcset en "&Size:"
::msgcat::mcset en "Show &Hidden Directories"
::msgcat::mcset en "Show &Hidden Files and Directories"
::msgcat::mcset en "Skip Messages"
::msgcat::mcset en "&Source..."
::msgcat::mcset en "Stri&keout"
::msgcat::mcset en "Tcl Scripts"
::msgcat::mcset en "Tcl for Windows"
::msgcat::mcset en "Text Files"
::msgcat::mcset en "&Underline"
::msgcat::mcset en "&Yes"
::msgcat::mcset en "abort"
::msgcat::mcset en "blue"
::msgcat::mcset en "cancel"
::msgcat::mcset en "extension"
::msgcat::mcset en "extensions"
::msgcat::mcset en "green"
::msgcat::mcset en "ignore"
::msgcat::mcset en "ok"
::msgcat::mcset en "red"
::msgcat::mcset en "retry"
::msgcat::mcset en "yes"
}
| {
"pile_set_name": "Github"
} |
/* MAPIStoreMailMessage.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <[email protected]>
*
* This file 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, or (at your option)
* any later version.
*
* This file 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef MAPISTOREMAILMESSAGE_H
#define MAPISTOREMAILMESSAGE_H
#import "MAPIStoreMessage.h"
@class NSString;
@class NSArray;
@class NSMutableArray;
@class NSMutableDictionary;
@class MAPIStoreAppointmentWrapper;
@class MAPIStoreMailFolder;
@interface MAPIStoreMailMessage : MAPIStoreMessage
{
BOOL headerSetup;
BOOL mailIsEvent;
BOOL mailIsMeetingRequest;
BOOL mailIsSharingObject;
NSMutableArray *bodyContentKeys;
NSMutableDictionary *bodyPartsEncodings;
NSMutableDictionary *bodyPartsCharsets;
NSMutableDictionary *bodyPartsMimeTypes;
NSMutableDictionary *bodyPartsMixed;
NSString *headerCharset;
NSString *headerMimeType;
BOOL bodySetup;
NSArray *bodyContent;
BOOL fetchedAttachments;
MAPIStoreAppointmentWrapper *appointmentWrapper;
}
- (NSString *) subject;
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagFlagStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagMessageFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagFollowupIcon: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayTo: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayCc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayBcc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* batch-mode helpers */
- (void) setBodyContentFromRawData: (NSArray *) rawContent;
- (NSArray *) getBodyContent;
@end
#endif /* MAPISTOREMAILMESSAGE_H */
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2017-2018 TWO SIGMA OPEN SOURCE, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.twosigma.flint.timeseries.summarize
import com.twosigma.flint.timeseries._
import org.apache.commons.math3.primes
import org.apache.spark.sql.CatalystTypeConvertersWrapper
import org.apache.spark.sql.functions.col
sealed trait SummarizerProperty {
def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit
}
class SummarizerSuite extends TimeSeriesSuite {
// Use the smallest prime number that is larger than 32 as default parallelism.
override val defaultPartitionParallelism: Int = primes.Primes.nextPrime(32)
private val cycles = 10000L
private val frequency = 100000L
lazy val AllData = Seq(
new TimeSeriesGenerator(
sc,
begin = 0L,
end = cycles * frequency,
frequency = frequency
)(
uniform = false,
ids = Seq(1),
ratioOfCycleSize = 1.0,
columns = Seq(
"x0" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble()
},
"x1" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble()
},
"x2" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble()
},
"x3" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble()
},
"w1" -> { (_: Long, _: Int, rand: util.Random) =>
1.0
},
"w2" -> { (_: Long, _: Int, rand: util.Random) =>
Math.abs(rand.nextDouble())
}
),
numSlices = defaultPartitionParallelism,
seed = 31415926L
).generate(),
new TimeSeriesGenerator(
sc,
begin = 0L,
end = cycles * frequency,
frequency = frequency
)(
uniform = true,
ids = Seq(1),
ratioOfCycleSize = 1.0,
columns = Seq(
"x0" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble() - 1.0
},
"x1" -> { (_: Long, _: Int, rand: util.Random) =>
-1.0 * rand.nextDouble()
},
"x2" -> { (_: Long, _: Int, rand: util.Random) =>
10.0 * rand.nextDouble()
},
"x3" -> { (_: Long, _: Int, rand: util.Random) =>
rand.nextDouble() + 1.0
},
"w1" -> { (_: Long, _: Int, rand: util.Random) =>
1.0
},
"w2" -> { (_: Long, _: Int, rand: util.Random) =>
Math.abs(rand.nextDouble())
}
),
numSlices = defaultPartitionParallelism,
seed = 19811112L
).generate()
)
// Check if (a + b) + c = a + (b + c)
class AssociativeLawProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
val p = timeSeriesRdd.rdd.partitions.length
val maxDepth = Math.ceil(Math.log(p.toDouble) / Math.log(2.0)).toInt
val summarizedResults = (1 to maxDepth).map { depth =>
timeSeriesRdd
.asInstanceOf[TimeSeriesRDDImpl]
.summarizeInternal(summarizerFactory, Seq.empty, depth)
}
summarizedResults.foreach { result =>
assertAlmostEquals(summarizedResults.head, result)
}
}
override def toString: String = "AssociativeLawProperty"
}
// Check if 0 + 0 = 0
class IdentityProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
val summarizer = summarizerFactory.apply(timeSeriesRdd.schema)
val mergedZero = summarizer
.merge(summarizer.zero(), summarizer.zero())
.asInstanceOf[summarizer.U]
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
assertAlmostEquals(
toExternalRow(summarizer.render(summarizer.zero())),
toExternalRow(summarizer.render(mergedZero))
)
}
override def toString: String = "IdentityProperty"
}
// Check if 0 + a = a
class RightIdentityProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
val summarizer = summarizerFactory.apply(timeSeriesRdd.schema)
val rows = timeSeriesRdd.toDF.queryExecution.toRdd.take(100)
var nonZero = summarizer.zero()
rows.foreach { row =>
nonZero = summarizer.add(nonZero, row)
}
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
val rightMerged =
summarizer.merge(summarizer.zero(), nonZero).asInstanceOf[summarizer.U]
assertAlmostEquals(
toExternalRow(summarizer.render(nonZero)),
toExternalRow(summarizer.render(rightMerged))
)
}
override def toString: String = "RightIdentityProperty"
}
// Check if a + 0 = a
class LeftIdentityProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
val summarizer = summarizerFactory.apply(timeSeriesRdd.schema)
val rows = timeSeriesRdd.toDF.queryExecution.toRdd.map(_.copy).take(100)
var nonZero = summarizer.zero()
rows.foreach { row =>
nonZero = summarizer.add(nonZero, row)
}
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
val leftMerged =
summarizer.merge(nonZero, summarizer.zero()).asInstanceOf[summarizer.U]
assertAlmostEquals(
toExternalRow(summarizer.render(nonZero)),
toExternalRow(summarizer.render(leftMerged))
)
}
override def toString: String = "LeftIdentityProperty"
}
// Check that a + b does not modify b
// This invariant is necessary for Flipper
class ImmutableRightMergeProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
val summarizer = summarizerFactory.apply(timeSeriesRdd.schema)
val rows = timeSeriesRdd.toDF.queryExecution.toRdd.map(_.copy).take(100)
val (aRows, bRows) = rows.splitAt(50)
var a = summarizer.zero()
var bMerged = summarizer.zero()
var bUnmerged = summarizer.zero()
aRows.foreach { row =>
a = summarizer.add(a, row)
}
bRows.foreach { row =>
bMerged = summarizer.add(bMerged, row)
bUnmerged = summarizer.add(bUnmerged, row)
}
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
summarizer.merge(a, bMerged)
assertAlmostEquals(
toExternalRow(summarizer.render(bMerged)),
toExternalRow(summarizer.render(bUnmerged))
)
summarizer.merge(summarizer.zero(), bMerged)
assertAlmostEquals(
toExternalRow(summarizer.render(bMerged)),
toExternalRow(summarizer.render(bUnmerged))
)
}
override def toString: String = "ImmutableRightMergeProperty"
}
// Check if (a + b) + c - a = b + c
class LeftSubtractableProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
require(
summarizerFactory
.apply(timeSeriesRdd.schema)
.isInstanceOf[LeftSubtractableSummarizer]
)
val summarizer = summarizerFactory
.apply(timeSeriesRdd.schema)
.asInstanceOf[LeftSubtractableSummarizer]
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
val rows = timeSeriesRdd.toDF.queryExecution.toRdd.map(_.copy).take(1000)
var window = 11
require(rows.length > window)
while (window < rows.length) {
var i = 0
var s1 = summarizer.zero()
// Build up state for the first window
while (i < window) {
s1 = summarizer.add(s1, rows(i))
i += 1
}
while (i < rows.length) {
s1 = summarizer.add(s1, rows(i))
s1 = summarizer.subtract(s1, rows(i - window))
// Build up benchmark state
var s2 = summarizer.zero()
var j = i - window + 1
while (j <= i) {
s2 = summarizer.add(s2, rows(j))
j += 1
}
assertAlmostEquals(
toExternalRow(summarizer.render(s1)),
toExternalRow(summarizer.render(s2))
)
i += 1
}
window *= window
}
}
override def toString: String = "LeftSubtractableProperty"
}
class WindowProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
require(
summarizerFactory
.apply(timeSeriesRdd.schema)
.isInstanceOf[LeftSubtractableSummarizer]
)
val windowSize = 100L * frequency
val window = Windows.pastAbsoluteTime(s"$windowSize ns")
val end = timeSeriesRdd.toDF
.select(TimeSeriesRDD.timeColumnName)
.where(col(TimeSeriesRDD.timeColumnName) > (cycles - 2) * frequency)
.collect()
.last
.getAs[Long](TimeSeriesRDD.timeColumnName)
val lastWindow = timeSeriesRdd.deleteRows { r =>
r.getAs[Long](TimeSeriesRDD.timeColumnName) < window.of(end)._1
}
val lastWindowSummarized = lastWindow.summarize(summarizerFactory)
// We need to escape the column name to ensure that columns with names like "a.b" are handled well.
val nonTimeColumnNames = lastWindowSummarized.schema.fieldNames.filterNot(_ == TimeSeriesRDD.timeColumnName).map {
columnName => col(s"`$columnName`")
}
val expectedResults = lastWindowSummarized
.toDF
.select(nonTimeColumnNames: _*)
.head
val results = timeSeriesRdd
.summarizeWindows(
window,
summarizerFactory
)
.toDF
.where(col(TimeSeriesRDD.timeColumnName) === end)
.select(nonTimeColumnNames: _*)
.collect()
.last
assertAlmostEquals(results, expectedResults)
}
override def toString: String = "WindowProperty"
}
// Check if a - a = 0
class SubtractIdentityProperty extends SummarizerProperty {
override def test(
timeSeriesRdd: TimeSeriesRDD,
summarizerFactory: SummarizerFactory
): Unit = {
require(
summarizerFactory
.apply(timeSeriesRdd.schema)
.isInstanceOf[LeftSubtractableSummarizer]
)
val summarizer = summarizerFactory
.apply(timeSeriesRdd.schema)
.asInstanceOf[LeftSubtractableSummarizer]
val rows = timeSeriesRdd.toDF.queryExecution.toRdd.map(_.copy).take(100)
var subtracted = summarizer.zero()
rows.foreach { row =>
subtracted = summarizer.add(subtracted, row)
}
rows.foreach { row =>
subtracted = summarizer.subtract(subtracted, row)
}
val toExternalRow = CatalystTypeConvertersWrapper.toScalaRowConverter(
summarizer.outputSchema
)
assertAlmostEquals(
toExternalRow(summarizer.render(subtracted)),
toExternalRow(summarizer.render(summarizer.zero()))
)
// We could check that 0 - a throws an exception, but currently some summarizers do not check for this case.
}
override def toString: String = "SubtractIdentityProperty"
}
// A.k.a properties that are required by Flippable
lazy val AllProperties = Seq(
new AssociativeLawProperty,
new RightIdentityProperty,
new LeftIdentityProperty,
new IdentityProperty,
new ImmutableRightMergeProperty
)
lazy val AllPropertiesAndSubtractable: Seq[SummarizerProperty] = AllProperties ++ Seq(
new LeftSubtractableProperty,
new WindowProperty,
new SubtractIdentityProperty
)
def summarizerPropertyTest(properties: Seq[SummarizerProperty])(
summarizer: SummarizerFactory
): Unit = {
// Ensure data persists for all tests.
AllData.foreach { data =>
data.cache()
data.count()
}
properties.foreach { property =>
AllData.zipWithIndex.foreach {
case (data, i) =>
info(s"Satisfy property ${property.toString} with $i-th dataset")
property.test(data, summarizer)
}
}
AllData.foreach(_.unpersist())
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Javadoc API documentation for Fresco." />
<link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" />
<title>
com.facebook.imagepipeline.transformation Details - Fresco API
| Fresco
</title>
<link href="../../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../../assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="../../../../../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../../../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../../../assets/doclava-developer-docs.js" type="text/javascript"></script>
<script src="../../../../../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
setToRoot("../../../../", "../../../../../assets/");
</script>
<script src="../../../../../assets/doclava-developer-reference.js" type="text/javascript"></script>
<script src="../../../../../assets/navtree_data.js" type="text/javascript"></script>
<script src="../../../../../assets/customizations.js" type="text/javascript"></script>
<noscript>
<style type="text/css">
html,body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
</head>
<body class="">
<div id="header">
<div id="headerLeft">
<span id="masthead-title"><a href="../../../../packages.html">Fresco</a></span>
</div>
<div id="headerRight">
<div id="search" >
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box"
onsubmit="return submit_search()">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
title="search developer docs" name="q"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../')"
onkeyup="return search_changed(event, false, '../../../../')" />
<div id="search_filtered_div" class="no-display">
<table id="search_filtered" cellspacing=0>
</table>
</div>
</td>
<!-- <td class="gsc-search-button">
<input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button"> </div>
</td> -->
</tr></tbody>
</table>
</form>
</div><!-- searchForm -->
</div><!-- search -->
</div>
</div><!-- header -->
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav">
<div id="index-links">
<a href="../../../../packages.html" >Packages</a> |
<a href="../../../../classes.html" >Classes</a>
</div>
<ul>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/gif/package-summary.html">com.facebook.animated.gif</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/giflite/package-summary.html">com.facebook.animated.giflite</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/giflite/decoder/package-summary.html">com.facebook.animated.giflite.decoder</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/giflite/draw/package-summary.html">com.facebook.animated.giflite.draw</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/giflite/drawable/package-summary.html">com.facebook.animated.giflite.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/webp/package-summary.html">com.facebook.animated.webp</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/animated/webpdrawable/package-summary.html">com.facebook.animated.webpdrawable</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/binaryresource/package-summary.html">com.facebook.binaryresource</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/cache/common/package-summary.html">com.facebook.cache.common</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/cache/disk/package-summary.html">com.facebook.cache.disk</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/callercontext/package-summary.html">com.facebook.callercontext</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/activitylistener/package-summary.html">com.facebook.common.activitylistener</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/disk/package-summary.html">com.facebook.common.disk</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/executors/package-summary.html">com.facebook.common.executors</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/file/package-summary.html">com.facebook.common.file</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/internal/package-summary.html">com.facebook.common.internal</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/lifecycle/package-summary.html">com.facebook.common.lifecycle</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/logging/package-summary.html">com.facebook.common.logging</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/media/package-summary.html">com.facebook.common.media</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/memory/package-summary.html">com.facebook.common.memory</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/references/package-summary.html">com.facebook.common.references</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/statfs/package-summary.html">com.facebook.common.statfs</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/streams/package-summary.html">com.facebook.common.streams</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/time/package-summary.html">com.facebook.common.time</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/util/package-summary.html">com.facebook.common.util</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/common/webp/package-summary.html">com.facebook.common.webp</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/datasource/package-summary.html">com.facebook.datasource</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawable/base/package-summary.html">com.facebook.drawable.base</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/backends/pipeline/package-summary.html">com.facebook.drawee.backends.pipeline</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/backends/pipeline/debug/package-summary.html">com.facebook.drawee.backends.pipeline.debug</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/backends/pipeline/info/package-summary.html">com.facebook.drawee.backends.pipeline.info</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/backends/pipeline/info/internal/package-summary.html">com.facebook.drawee.backends.pipeline.info.internal</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/components/package-summary.html">com.facebook.drawee.components</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/controller/package-summary.html">com.facebook.drawee.controller</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/debug/package-summary.html">com.facebook.drawee.debug</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/debug/listener/package-summary.html">com.facebook.drawee.debug.listener</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/drawable/package-summary.html">com.facebook.drawee.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/generic/package-summary.html">com.facebook.drawee.generic</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/gestures/package-summary.html">com.facebook.drawee.gestures</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/interfaces/package-summary.html">com.facebook.drawee.interfaces</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/span/package-summary.html">com.facebook.drawee.span</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/drawee/view/package-summary.html">com.facebook.drawee.view</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/backend/package-summary.html">com.facebook.fresco.animation.backend</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/bitmap/package-summary.html">com.facebook.fresco.animation.bitmap</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/bitmap/cache/package-summary.html">com.facebook.fresco.animation.bitmap.cache</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/bitmap/preparation/package-summary.html">com.facebook.fresco.animation.bitmap.preparation</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/bitmap/wrapper/package-summary.html">com.facebook.fresco.animation.bitmap.wrapper</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/drawable/package-summary.html">com.facebook.fresco.animation.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/drawable/animator/package-summary.html">com.facebook.fresco.animation.drawable.animator</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/factory/package-summary.html">com.facebook.fresco.animation.factory</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/animation/frame/package-summary.html">com.facebook.fresco.animation.frame</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/middleware/package-summary.html">com.facebook.fresco.middleware</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/fresco/ui/common/package-summary.html">com.facebook.fresco.ui.common</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imageformat/package-summary.html">com.facebook.imageformat</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/animated/base/package-summary.html">com.facebook.imagepipeline.animated.base</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/animated/factory/package-summary.html">com.facebook.imagepipeline.animated.factory</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/animated/impl/package-summary.html">com.facebook.imagepipeline.animated.impl</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/animated/util/package-summary.html">com.facebook.imagepipeline.animated.util</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/backends/okhttp3/package-summary.html">com.facebook.imagepipeline.backends.okhttp3</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/backends/volley/package-summary.html">com.facebook.imagepipeline.backends.volley</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/bitmaps/package-summary.html">com.facebook.imagepipeline.bitmaps</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/cache/package-summary.html">com.facebook.imagepipeline.cache</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/common/package-summary.html">com.facebook.imagepipeline.common</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/core/package-summary.html">com.facebook.imagepipeline.core</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/datasource/package-summary.html">com.facebook.imagepipeline.datasource</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/debug/package-summary.html">com.facebook.imagepipeline.debug</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/decoder/package-summary.html">com.facebook.imagepipeline.decoder</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/drawable/package-summary.html">com.facebook.imagepipeline.drawable</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/filter/package-summary.html">com.facebook.imagepipeline.filter</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/image/package-summary.html">com.facebook.imagepipeline.image</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/instrumentation/package-summary.html">com.facebook.imagepipeline.instrumentation</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/listener/package-summary.html">com.facebook.imagepipeline.listener</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/memory/package-summary.html">com.facebook.imagepipeline.memory</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/multiuri/package-summary.html">com.facebook.imagepipeline.multiuri</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/nativecode/package-summary.html">com.facebook.imagepipeline.nativecode</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/platform/package-summary.html">com.facebook.imagepipeline.platform</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/postprocessors/package-summary.html">com.facebook.imagepipeline.postprocessors</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/producers/package-summary.html">com.facebook.imagepipeline.producers</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/request/package-summary.html">com.facebook.imagepipeline.request</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/systrace/package-summary.html">com.facebook.imagepipeline.systrace</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imagepipeline/transcoder/package-summary.html">com.facebook.imagepipeline.transcoder</a></li>
<li class="selected api apilevel-">
<a href="../../../../com/facebook/imagepipeline/transformation/package-summary.html">com.facebook.imagepipeline.transformation</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/imageutils/package-summary.html">com.facebook.imageutils</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/webpsupport/package-summary.html">com.facebook.webpsupport</a></li>
<li class="api apilevel-">
<a href="../../../../com/facebook/widget/text/span/package-summary.html">com.facebook.widget.text.span</a></li>
</ul><br/>
</div> <!-- end packages -->
</div> <!-- end resize-packages -->
<div id="classes-nav">
<ul>
<li><h2>Interfaces</h2>
<ul>
<li class="api apilevel-"><a href="../../../../com/facebook/imagepipeline/transformation/BitmapTransformation.html">BitmapTransformation</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none">
<div id="index-links">
<a href="../../../../packages.html" >Packages</a> |
<a href="../../../../classes.html" >Classes</a>
</div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
</div> <!-- end side-nav -->
<script>
if (!isMobile) {
//$("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../../");
} else {
addLoadEvent(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
}
//$("#swapper").css({borderBottom:"2px solid #aaa"});
} else {
swapNav(); // tree view should be used on mobile
}
</script>
<div class="g-unit" id="doc-content">
<div id="api-info-block">
<div class="api-level">
</div>
</div>
<div id="jd-header">
package
<h1>com.facebook.imagepipeline.transformation</b></h1>
<div class="jd-nav">
<a class="jd-navlink" href="package-summary.html">Classes</a> | Description
</div>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-">
<div class="jd-descr">
<p></p>
</div>
<div id="footer">
+Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
+</div> <!-- end footer - @generated -->
</div><!-- end jd-content -->
</div> <!-- end doc-content -->
</div> <!-- end body-content -->
<script type="text/javascript">
init(); /* initialize doclava-developer-docs.js */
</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Zhenjie Yan
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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:padding="15dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/text_color"
android:layout_marginStart="30dp"
android:layout_marginLeft="30dp"
tools:text="I.m Content"/>
</FrameLayout> | {
"pile_set_name": "Github"
} |
package cisv1
import (
"fmt"
"github.com/IBM-Cloud/bluemix-go/client"
)
// RateLimitRecord is a policy than can be applied to limit traffic within a customer domain
type RateLimitRecord struct {
ID string `json:"id,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Description string `json:"description,omitempty"`
Bypass []RateLimitByPass `json:"bypass,omitempty"`
Threshold int `json:"threshold"`
Period int `json:"period"`
Correlate *RateLimitCorrelate `json:"correlate,omitempty"`
Action RateLimitAction `json:"action"`
Match RateLimitMatch `json:"match"`
}
// RateLimitByPass ...
type RateLimitByPass struct {
Name string `json:"name"`
Value string `json:"value"`
}
// RateLimitCorrelate ...
type RateLimitCorrelate struct {
By string `json:"by"`
}
// RateLimitAction ...
type RateLimitAction struct {
Mode string `json:"mode"`
Timeout int `json:"timeout,omitempty"`
Response *ActionResponse `json:"response,omitempty"`
}
// ActionResponse ...
type ActionResponse struct {
ContentType string `json:"content_type,omitempty"`
Body string `json:"body,omitempty"`
}
// RateLimitMatch ...
type RateLimitMatch struct {
Request MatchRequest `json:"request"`
Response MatchResponse `json:"response"`
}
// MatchRequest ...
type MatchRequest struct {
Methods []string `json:"methods,omitempty"`
Schemes []string `json:"schemes,omitempty"`
URL string `json:"url,omitempty"`
}
// MatchResponse ...
type MatchResponse struct {
Statuses []int `json:"status,omitempty"`
OriginTraffic *bool `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value
Headers []MatchResponseHeader `json:"headers,omitempty"`
}
// MatchResponseHeader ...
type MatchResponseHeader struct {
Name string `json:"name,omitempty"`
Op string `json:"op,omitempty"`
Value string `json:"value,omitempty"`
}
//RateLimitResult ...
type RateLimitResult struct {
RateLimit RateLimitRecord `json:"result"`
Success bool `json:"success"`
Errors []Error `json:"errors"`
Messages []string `json:"messages"`
}
//RateLimitResults ...
type RateLimitResults struct {
RateLimitList []RateLimitRecord `json:"result"`
ResultsInfo ResultsCount `json:"result_info"`
Success bool `json:"success"`
Errors []Error `json:"errors"`
}
//RateLimit ...
type RateLimit interface {
ListRateLimit(cisID string, zoneID string) ([]RateLimitRecord, error)
GetRateLimit(cisID string, zoneID string, rateLimitID string) (*RateLimitRecord, error)
CreateRateLimit(cisID string, zoneID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error)
DeleteRateLimit(cisID string, zoneID string, rateLimitID string) error
UpdateRateLimit(cisID string, zoneID string, rateLimitID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error)
}
//RateLimit ...
type ratelimit struct {
client *client.Client
}
func newRateLimitAPI(c *client.Client) RateLimit {
return &ratelimit{
client: c,
}
}
func (r *ratelimit) ListRateLimit(cisID string, zoneID string) ([]RateLimitRecord, error) {
rateLimitResults := RateLimitResults{}
var rawURL string
rawURL = fmt.Sprintf("/v1/%s/zones/%s/rate_limits", cisID, zoneID)
_, err := r.client.Get(rawURL, &rateLimitResults, nil)
if err != nil {
return nil, err
}
return rateLimitResults.RateLimitList, err
}
func (r *ratelimit) GetRateLimit(cisID string, zoneID string, rateLimitID string) (*RateLimitRecord, error) {
rateLimitResult := RateLimitResult{}
var rawURL string
rawURL = fmt.Sprintf("/v1/%s/zones/%s/rate_limits/%s", cisID, zoneID, rateLimitID)
_, err := r.client.Get(rawURL, &rateLimitResult, nil)
if err != nil {
return nil, err
}
return &rateLimitResult.RateLimit, nil
}
func (r *ratelimit) DeleteRateLimit(cisID string, zoneID string, rateLimitID string) error {
var rawURL string
rawURL = fmt.Sprintf("/v1/%s/zones/%s/rate_limits/%s", cisID, zoneID, rateLimitID)
_, err := r.client.Delete(rawURL)
if err != nil {
return err
}
return nil
}
func (r *ratelimit) CreateRateLimit(cisID string, zoneID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error) {
rateLimitResult := RateLimitResult{}
var rawURL string
rawURL = fmt.Sprintf("/v1/%s/zones/%s/rate_limits", cisID, zoneID)
_, err := r.client.Post(rawURL, &rateLimitBody, &rateLimitResult)
if err != nil {
return nil, err
}
return &rateLimitResult.RateLimit, nil
}
func (r *ratelimit) UpdateRateLimit(cisID string, zoneID string, rateLimitID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error) {
rateLimitResult := RateLimitResult{}
var rawURL string
rawURL = fmt.Sprintf("/v1/%s/zones/%s/rate_limits/%s", cisID, zoneID, rateLimitID)
_, err := r.client.Put(rawURL, &rateLimitBody, &rateLimitResult)
if err != nil {
return nil, err
}
return &rateLimitResult.RateLimit, nil
}
| {
"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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.spring.cloud</groupId>
<artifactId>task-events</artifactId>
<version>2.3.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Task Events</name>
<description>Demo of publishing task events to Spring Cloud Streams</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
<relativePath />
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-dependencies</artifactId>
<version>2.3.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-dependencies</artifactId>
<version>3.1.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-task</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.