answer stringlengths 15 1.25M |
|---|
using System;
using System.Collections.Generic;
namespace UnityEngine.InputNew
{
[Serializable]
public class <API key>
{
public int controlIndex;
public SerializableType deviceType;
public virtual <API key> Clone()
{
var clone = (<API key>) Activator.CreateInstance(GetType());
clone.controlIndex = controlIndex;
clone.deviceType = new SerializableType(deviceType);
return clone;
}
public override string ToString()
{
return string.Format( "(device:{0}, control:{1})", deviceType.Name, controlIndex );
}
public void <API key>(Dictionary<Type, List<int>> <API key>)
{
List<int> entries;
if (!<API key>.TryGetValue(deviceType, out entries))
{
entries = new List<int>();
<API key>[deviceType] = entries;
}
entries.Add(controlIndex);
}
}
} |
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="description" content="<%= htmlWebpackPlugin.options.title %>">
<% if (webpackConfig.htmlElements.headTags) { %>
<!-- Configured Head Tags -->
<%= webpackConfig.htmlElements.headTags %>
<% } %>
<!-- base url -->
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="<API key>+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="<API key>" crossorigin="anonymous"></script>
</head>
<body>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- <script src="js/bootstrap.min.js"></script> -->
<app>
Loading...
</app>
<!-- Google Analytics: change UA-71073175-1 to be your site's ID -->
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-71073175-1', 'auto');
ga('send', 'pageview');
</script>
<% if (htmlWebpackPlugin.options.metadata.isDevServer && htmlWebpackPlugin.options.metadata.HMR !== true) { %>
<!-- Webpack Dev Server reload -->
<script src="/webpack-dev-server.js"></script>
<% } %>
</body>
</html> |
// Code generated by protoc-gen-go.
// source: serving/tensorflow/core/protobuf/worker_service.proto
// DO NOT EDIT!
/*
Package tensorflow_grpc is a generated protocol buffer package.
It is generated from these files:
serving/tensorflow/core/protobuf/worker_service.proto
It has these top-level messages:
*/
package tensorflow_grpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import tensorflow21 "tensorflow/core/protobuf"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.<API key> // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.<API key>
// Client API for WorkerService service
type WorkerServiceClient interface {
// See worker.proto for details.
GetStatus(ctx context.Context, in *tensorflow21.GetStatusRequest, opts ...grpc.CallOption) (*tensorflow21.GetStatusResponse, error)
// See worker.proto for details.
CreateWorkerSession(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error)
// See worker.proto for details.
RegisterGraph(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error)
// See worker.proto for details.
DeregisterGraph(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error)
// See worker.proto for details.
RunGraph(ctx context.Context, in *tensorflow21.RunGraphRequest, opts ...grpc.CallOption) (*tensorflow21.RunGraphResponse, error)
// See worker.proto for details.
CleanupGraph(ctx context.Context, in *tensorflow21.CleanupGraphRequest, opts ...grpc.CallOption) (*tensorflow21.<API key>, error)
// See worker.proto for details.
CleanupAll(ctx context.Context, in *tensorflow21.CleanupAllRequest, opts ...grpc.CallOption) (*tensorflow21.CleanupAllResponse, error)
// See worker.proto for details.
RecvTensor(ctx context.Context, in *tensorflow21.RecvTensorRequest, opts ...grpc.CallOption) (*tensorflow21.RecvTensorResponse, error)
// See worker.proto for details.
Logging(ctx context.Context, in *tensorflow21.LoggingRequest, opts ...grpc.CallOption) (*tensorflow21.LoggingResponse, error)
// See worker.proto for details.
Tracing(ctx context.Context, in *tensorflow21.TracingRequest, opts ...grpc.CallOption) (*tensorflow21.TracingResponse, error)
}
type workerServiceClient struct {
cc *grpc.ClientConn
}
func <API key>(cc *grpc.ClientConn) WorkerServiceClient {
return &workerServiceClient{cc}
}
func (c *workerServiceClient) GetStatus(ctx context.Context, in *tensorflow21.GetStatusRequest, opts ...grpc.CallOption) (*tensorflow21.GetStatusResponse, error) {
out := new(tensorflow21.GetStatusResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/GetStatus", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) CreateWorkerSession(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error) {
out := new(tensorflow21.<API key>)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/CreateWorkerSession", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) RegisterGraph(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error) {
out := new(tensorflow21.<API key>)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/RegisterGraph", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) DeregisterGraph(ctx context.Context, in *tensorflow21.<API key>, opts ...grpc.CallOption) (*tensorflow21.<API key>, error) {
out := new(tensorflow21.<API key>)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/DeregisterGraph", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) RunGraph(ctx context.Context, in *tensorflow21.RunGraphRequest, opts ...grpc.CallOption) (*tensorflow21.RunGraphResponse, error) {
out := new(tensorflow21.RunGraphResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/RunGraph", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) CleanupGraph(ctx context.Context, in *tensorflow21.CleanupGraphRequest, opts ...grpc.CallOption) (*tensorflow21.<API key>, error) {
out := new(tensorflow21.<API key>)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/CleanupGraph", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) CleanupAll(ctx context.Context, in *tensorflow21.CleanupAllRequest, opts ...grpc.CallOption) (*tensorflow21.CleanupAllResponse, error) {
out := new(tensorflow21.CleanupAllResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/CleanupAll", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) RecvTensor(ctx context.Context, in *tensorflow21.RecvTensorRequest, opts ...grpc.CallOption) (*tensorflow21.RecvTensorResponse, error) {
out := new(tensorflow21.RecvTensorResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/RecvTensor", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) Logging(ctx context.Context, in *tensorflow21.LoggingRequest, opts ...grpc.CallOption) (*tensorflow21.LoggingResponse, error) {
out := new(tensorflow21.LoggingResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/Logging", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workerServiceClient) Tracing(ctx context.Context, in *tensorflow21.TracingRequest, opts ...grpc.CallOption) (*tensorflow21.TracingResponse, error) {
out := new(tensorflow21.TracingResponse)
err := grpc.Invoke(ctx, "/tensorflow.grpc.WorkerService/Tracing", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for WorkerService service
type WorkerServiceServer interface {
// See worker.proto for details.
GetStatus(context.Context, *tensorflow21.GetStatusRequest) (*tensorflow21.GetStatusResponse, error)
// See worker.proto for details.
CreateWorkerSession(context.Context, *tensorflow21.<API key>) (*tensorflow21.<API key>, error)
// See worker.proto for details.
RegisterGraph(context.Context, *tensorflow21.<API key>) (*tensorflow21.<API key>, error)
// See worker.proto for details.
DeregisterGraph(context.Context, *tensorflow21.<API key>) (*tensorflow21.<API key>, error)
// See worker.proto for details.
RunGraph(context.Context, *tensorflow21.RunGraphRequest) (*tensorflow21.RunGraphResponse, error)
// See worker.proto for details.
CleanupGraph(context.Context, *tensorflow21.CleanupGraphRequest) (*tensorflow21.<API key>, error)
// See worker.proto for details.
CleanupAll(context.Context, *tensorflow21.CleanupAllRequest) (*tensorflow21.CleanupAllResponse, error)
// See worker.proto for details.
RecvTensor(context.Context, *tensorflow21.RecvTensorRequest) (*tensorflow21.RecvTensorResponse, error)
// See worker.proto for details.
Logging(context.Context, *tensorflow21.LoggingRequest) (*tensorflow21.LoggingResponse, error)
// See worker.proto for details.
Tracing(context.Context, *tensorflow21.TracingRequest) (*tensorflow21.TracingResponse, error)
}
func <API key>(s *grpc.Server, srv WorkerServiceServer) {
s.RegisterService(&<API key>, srv)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.GetStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).GetStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/GetStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).GetStatus(ctx, req.(*tensorflow21.GetStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.<API key>)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).CreateWorkerSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/CreateWorkerSession",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).CreateWorkerSession(ctx, req.(*tensorflow21.<API key>))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.<API key>)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).RegisterGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/RegisterGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).RegisterGraph(ctx, req.(*tensorflow21.<API key>))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.<API key>)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).DeregisterGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/DeregisterGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).DeregisterGraph(ctx, req.(*tensorflow21.<API key>))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.RunGraphRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).RunGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/RunGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).RunGraph(ctx, req.(*tensorflow21.RunGraphRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.CleanupGraphRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).CleanupGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/CleanupGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).CleanupGraph(ctx, req.(*tensorflow21.CleanupGraphRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.CleanupAllRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).CleanupAll(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/CleanupAll",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).CleanupAll(ctx, req.(*tensorflow21.CleanupAllRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.RecvTensorRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).RecvTensor(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/RecvTensor",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).RecvTensor(ctx, req.(*tensorflow21.RecvTensorRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.LoggingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).Logging(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/Logging",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).Logging(ctx, req.(*tensorflow21.LoggingRequest))
}
return interceptor(ctx, in, info, handler)
}
func <API key>(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.<API key>) (interface{}, error) {
in := new(tensorflow21.TracingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkerServiceServer).Tracing(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/tensorflow.grpc.WorkerService/Tracing",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkerServiceServer).Tracing(ctx, req.(*tensorflow21.TracingRequest))
}
return interceptor(ctx, in, info, handler)
}
var <API key> = grpc.ServiceDesc{
ServiceName: "tensorflow.grpc.WorkerService",
HandlerType: (*WorkerServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetStatus",
Handler: <API key>,
},
{
MethodName: "CreateWorkerSession",
Handler: <API key>,
},
{
MethodName: "RegisterGraph",
Handler: <API key>,
},
{
MethodName: "DeregisterGraph",
Handler: <API key>,
},
{
MethodName: "RunGraph",
Handler: <API key>,
},
{
MethodName: "CleanupGraph",
Handler: <API key>,
},
{
MethodName: "CleanupAll",
Handler: <API key>,
},
{
MethodName: "RecvTensor",
Handler: <API key>,
},
{
MethodName: "Logging",
Handler: <API key>,
},
{
MethodName: "Tracing",
Handler: <API key>,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "serving/tensorflow/core/protobuf/worker_service.proto",
}
func init() {
proto.RegisterFile("serving/tensorflow/core/protobuf/worker_service.proto", fileDescriptor0)
}
var fileDescriptor0 = []byte{
// 357 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xd1, 0x4e, 0xc2, 0x30,
0x14, 0x86, 0xf5, 0x06, 0xf4, 0x44, 0x42, 0x52, 0xee, 0x06, 0x28, 0x62, 0xd4, 0x3b, 0x96, 0x48,
0x7c, 0x00, 0x86, 0x06, 0x13, 0x35, 0xc1, 0x41, 0x62, 0xe2, 0x8d, 0x19, 0xf3, 0x50, 0x17, 0x67,
0x3b, 0xdb, 0x0e, 0x9e, 0xcb, 0x37, 0x34, 0x6e, 0x2d, 0x74, 0x3a, 0xe0, 0xf6, 0xff, 0xbf, 0xff,
0x5b, 0xb3, 0xe4, 0xc0, 0xb5, 0x44, 0xb1, 0x88, 0x18, 0x75, 0x15, 0x32, 0xc9, 0xc5, 0x3c, 0xe6,
0x4b, 0x37, 0xe4, 0x02, 0xdd, 0x44, 0x70, 0xc5, 0x67, 0xe9, 0xdc, 0x5d, 0x72, 0xf1, 0x81, 0xe2,
0x35, 0xe3, 0x42, 0xec, 0x65, 0x39, 0xa9, 0xaf, 0xf1, 0x1e, 0x15, 0x49, 0xe8, 0x9c, 0xef, 0xd8,
0xe7, 0xbb, 0xab, 0xef, 0x0a, 0xd4, 0x9e, 0xb3, 0x60, 0x92, 0xfb, 0xc8, 0x1d, 0x1c, 0x8e, 0x50,
0x4d, 0x54, 0xa0, 0x52, 0x49, 0x5a, 0x3d, 0xcb, 0xbb, 0x8a, 0x7d, 0xfc, 0x4a, 0x51, 0x2a, 0xa7,
0xbd, 0xa1, 0x95, 0x09, 0x67, 0x12, 0xc9, 0x1c, 0x1a, 0x43, 0x81, 0x81, 0x42, 0xf3, 0x01, 0x29,
0x23, 0xce, 0xc8, 0x85, 0xbd, 0x2a, 0x01, 0x8c, 0xfd, 0x72, 0x27, 0xa7, 0xbf, 0x33, 0x85, 0x9a,
0x8f, 0x34, 0x92, 0x0a, 0xc5, 0x48, 0x04, 0xc9, 0x3b, 0xe9, 0xd8, 0xcb, 0x42, 0x65, 0xdc, 0xa7,
0x5b, 0x08, 0x6d, 0x7d, 0x81, 0xfa, 0x0d, 0x8a, 0x82, 0xb7, 0x6b, 0xaf, 0xfe, 0x94, 0xc6, 0x7c,
0xb6, 0x95, 0xd1, 0xee, 0x5b, 0x38, 0xf0, 0x53, 0x96, 0x4b, 0x9b, 0x85, 0xa7, 0xe8, 0xd4, 0xd8,
0x5a, 0xe5, 0xa5, 0xd6, 0x3c, 0xc1, 0xd1, 0x30, 0xc6, 0x80, 0xa5, 0x49, 0xae, 0x3a, 0x29, 0xfc,
0x31, 0xab, 0x31, 0xba, 0xce, 0x66, 0x40, 0x2b, 0xef, 0x01, 0x74, 0x3e, 0x88, 0x63, 0xd2, 0x2e,
0xe1, 0x07, 0x71, 0x6c, 0x74, 0xc7, 0x9b, 0x6a, 0x2d, 0x7b, 0x04, 0xf0, 0x31, 0x5c, 0x4c, 0x33,
0xa8, 0x28, 0x5b, 0xe7, 0xa5, 0x32, 0xbb, 0xce, 0x65, 0xdd, 0x3d, 0xe2, 0x41, 0xf5, 0x81, 0x53,
0x1a, 0x31, 0x4a, 0x1c, 0x1b, 0xd6, 0xa1, 0x11, 0x35, 0x4b, 0x3b, 0xfd, 0x24, 0x0f, 0xaa, 0x53,
0x11, 0x84, 0xff, 0x1c, 0x3a, 0x2c, 0x75, 0xac, 0xba, 0xdc, 0xe1, 0xf5, 0xc1, 0xe1, 0x82, 0xda,
0xc4, 0x5b, 0x24, 0x95, 0x48, 0x99, 0x8a, 0x3e, 0xd1, 0x6b, 0x14, 0xce, 0x69, 0xfc, 0x7b, 0x65,
0x72, 0xbc, 0x3f, 0xab, 0x64, 0xf7, 0xd6, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x63, 0x8d,
0x91, 0xe0, 0x03, 0x00, 0x00,
} |
<?php
declare(strict_types=1);
namespace ParkManager\Module\CoreModule\Tests\Infrastructure\UserInterface\Web\Common;
use ParkManager\Module\CoreModule\Infrastructure\UserInterface\Web\Common\TwigResponse;
use PHPUnit\Framework\TestCase;
/**
* @internal
*/
final class TwigResponseTest extends TestCase
{
/** @test */
public function it_is_constructable(): void
{
$response = new TwigResponse('@CoreModule/client/show_user.html.twig', ['foo' => 'bar']);
self::assertSame(200, $response->getStatusCode());
self::assertSame('@CoreModule/client/show_user.html.twig', $response->getTemplate());
self::assertSame(['foo' => 'bar'], $response-><API key>());
}
/** @test */
public function <API key>(): void
{
$response = new TwigResponse('@CoreModule/client/show_user.html.twig', ['foo' => 'bar'], 400);
self::assertSame(400, $response->getStatusCode());
self::assertSame('@CoreModule/client/show_user.html.twig', $response->getTemplate());
self::assertSame(['foo' => 'bar'], $response-><API key>());
}
/** @test */
public function <API key>(): void
{
$response = new TwigResponse('@CoreModule/client/show_user.html.twig', ['foo' => 'bar'], 200, ['X-Foo' => 'bar']);
self::assertEquals('bar', $response->headers->get('X-Foo'));
}
} |
import { metaFor } from '../../utils';
import { render } from 'htmlbars-runtime';
export default function componentHook(renderNode, env, scope, tagName, params, attrs, templates, visitor) {
const renderOptions = {};
const { contextualElement } = renderNode;
let element;
if (contextualElement === scope.self) {
element = contextualElement;
renderOptions.renderNode = renderNode;
} else {
element = env.dom.createElement(tagName);
renderNode.setNode(element);
}
const meta = metaFor(element);
meta.<API key> = true;
for (const name in attrs) {
const value = env.hooks.getValue(attrs[name]);
if (element.getAttribute(name) !== value) {
element.setAttribute(name, value);
}
}
meta.<API key> = false;
if (renderNode.lastResult) {
renderNode.lastResult.rerender();
} else {
const fragment = render(templates.default, env, scope, renderOptions).fragment;
element.appendChild(fragment);
}
} |
using log4net;
using System.Data;
using System.Reflection;
namespace ConnectR.Infrastructure.Database
{
public class LoggingDatabase : NPoco.Database
{
private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public LoggingDatabase(<API key> connectionString) : base(connectionString.ConnectionString, connectionString.ProviderName) { }
protected override void OnExecutingCommand(IDbCommand cmd)
{
if (log.IsDebugEnabled)
{
log.Debug(FormatCommand(cmd));
}
}
protected override void OnException(System.Exception exception)
{
base.OnException(exception);
if (log.IsErrorEnabled)
{
log.Error(exception);
}
}
}
} |
function Parent(name) {
this.name = name || 'Adam';
}
Parent.prototype.say = function () {
return this.name;
};
function Child(name) {
}
inherit(Child, Parent);
function inherit(C, P) {
C.prototype = new P();
}
/**
* #2 -
*
* - this
* - this .
* -
*/
function Child(a, c, b, d) {
Parent.apply(this, arguments);
}
function Article() {
this.tags = ['js', 'css'];
}
var article = new Article();
//
function BlogPost() {}
BlogPost.prototype = article;
var blog = new BlogPost();
//
function StaticPage() {
Article.call(this);
}
var page = new StaticPage();
console.log(article.hasOwnProperty(('tags'))); // true
console.log(blog.hasOwnProperty(('tags'))); // false
console.log(page.hasOwnProperty(('tags'))); // true
blog.tags.push('html');
page.tags.push('php');
console.log(article.tags.join(', ')); // "js, css, html"
function Cat() {
this.legs = 4;
this.say = function () {
return "meaowww";
}
}
function Bird() {
this.wings = 2;
this.fly = true;
}
function CatWings() {
Cat.apply(this);
Bird.apply(this);
}
var jane = new CatWings();
console.dir(jane); // fly: true, legs: 4, wings:2, say: function()
function Child(a, c, b, d) {
Parent.apply(this, arguments);
}
Child.prototype = new Parent();
function Parent(name) {
this.name = name || 'Adam';
}
Parent.prototype.say = function () {
return this.name;
};
function Child(name) {
Parent.apply(this, arguments);
}
Child.prototype = new Parent();
var kid = new Child("Patrick");
console.log(kid.name); // "Patrick"
console.log(kid.say()); // "Patrick"
delete kid.name;
console.log(kid.say()); // "Adam"
function inherit(C, P) {
C.prototype = P.prototype;
}
function inherit(C, P) {
var f = function () {};
F.prototype = P.prototype;
C.prototype = new F();
}
function inherit(C, P) {
var f = function () {};
F.prototype = P.prototype;
C.prototype = new F();
C.uber = P.prototype; // super
}
function inherit(C, P) {
var F = function () {};
F.prototype = P.prototype;
C.prototype = new F();
C.uber = P.prototype;
C.prototype.constructor = C;
}
var inherit = (function () {
var F = function () {};
return function (C, P) {
F.prototype = P.prototype;
C.prototype = new F();
C.uber = P.prototype;
C.prototype.constructor = C;
};
}());
/**
* Klass
*/
var klass = function (Parent, props) {
var Child, F, i;
Child = function () {
if (Child.uber && Child.uber.hasOwnProperty("__construct")) {
Child.uber.__construct.apply(this, arguments);
}
if (Child.prototype.hasOwnProperty("__construct")) {
Child.prototype.__construct.apply(this, arguments);
}
};
Parent = Parent || Object;
F = function () {};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.uber = Parent.prototype;
Child.prototype.constructor = Child;
for (i in props) {
if (props.hasOwnProperty(i)) {
Child.prototype[i] = props[i];
}
}
return Child;
}; |
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cassert>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MAXN=4E4+10;
int pri[MAXN],cnt,k,m,tot;
bool vis[MAXN];
vector<int> Ans;
void sieve()
{
for(int i=2;i<MAXN;i++)
{
if(!vis[i]) pri[++cnt]=i;
for(int j=1;j<=cnt&&pri[j]*i<MAXN;j++)
{
vis[i*pri[j]]=1;
if(i%pri[j]==0) break;
}
}
}
bool isp(int x)
{
if(x<MAXN) return !vis[x];
for(int i=2;i*i<=x;i++)
if(x%i==0) return 0;
return 1;
}
void dfs(int x,ll now,ll rst)
{
if(rst==1) return Ans.push_back(now);
if(rst-1>pri[cnt]&&isp(rst-1)) Ans.push_back(now*(rst-1));
if(rst<pri[x]) return;
ll sum=1,p=1;
for(int y=x;1ll*pri[y]<=rst&&y<cnt;y++)
for(sum=1+pri[y],p=pri[y];sum<=rst;p*=pri[y],sum+=p)
if(!(rst%sum))
dfs(y+1,now*p,rst/sum);
}
bool solve()
{
if(scanf("%d",&m)==EOF) return 0;
Ans.clear();
dfs(1,1,m);sort(Ans.begin(),Ans.end());
printf("%d\n",Ans.size());
for(int i=0;i<Ans.size();i++)
printf("%d%c",Ans[i],i==Ans.size()-1?'\n':' ');
return 1;
}
int main()
{
sieve();
while(solve());
} |
'use strict';
var registerService = require('services/register');
var utils = require('utils');
var name = 'services.question';
registerService('factory', name, [require('services/http_service'),
require('services/parallel_promise'),
require('services/serial_promise'),
require('services/promise'),
require('services/progress'),
require('services/media_service'),
require('services/<API key>'),
require('services/api_url'),
require('models/question'),
require('models/comment'),
require('services/error'),
function(HttpService, ParallelPromise, SerialPromise, Promise, Progress,
MediaService, <API key>, ApiUrlService, QuestionModel,
CommentModel, ErrorService) {
function QuestionService() {
}
var currentQuestion = null;
var <API key> = false;
var <API key> = false;
QuestionService.setCurrentQuestion = function(q) {
currentQuestion = q;
if (q) {
<API key> = false;
<API key> = false;
}
}
QuestionService.<API key> = function(q) {
if (currentQuestion) {
if (currentQuestion.id === q.id) {
currentQuestion.fromModel(q);
}
}
}
QuestionService.getCurrentQuestion = function() {
return currentQuestion;
}
QuestionService.<API key> = function() {
return <API key>;
}
QuestionService.<API key> = function() {
return <API key>;
}
QuestionService.dataResolverFn = function(state, params) {
if ('main.page.question.default' === state) {
return Promise(function(resolve, reject) {
if (!params.questionId) {
reject(ErrorService.localError("Missing question id!"));
} else {
QuestionService.getQuestion(params.questionId)
.then(function(question) {
QuestionService.setCurrentQuestion(question);
resolve();
})
.catch(function(error) {
QuestionService.setCurrentQuestion(null);
// Just like with the user, if we get an error,
// we want to display feedback on the page itself as to what
// went wrong, so we allow the request to finish (by resolving),
// but we set some internal stuff so we can get a better idea of what
// happened, so we can show the user on the page.
if (true === ErrorService.isForbidden(error)) {
<API key> = true;
resolve();
} else if (true === ErrorService.isNotFound(error)) {
<API key> = true;
resolve();
} else {
reject(error);
}
})
}
});
} else {
QuestionService.setCurrentQuestion(null);
}
}
QuestionService.ask = function(questionModel) {
var <API key> = questionModel.clone();
var <API key> = [
function(existingData, index, forNotify) {
return Promise(function(resolve, reject, notify) {
if (false === forNotify) {
<API key>.<API key>(questionModel)
.then(function(picture) {
questionModel.preview_pictures[0] = picture;
resolve();
})
.catch(function(error) {
reject(error);
})
}
});
},
function(existingData, index, forNotify) {
var <API key> = utils.map(questionModel.pictures, function(pictureModel) {
return function(forNotify) {
return MediaService.uploadMedia('question_picture', pictureModel, forNotify);
}
});
var videoUploadFnArray = utils.map(questionModel.videos, function(videoModel) {
return function(forNotify) {
return MediaService.uploadMedia('question_video', videoModel, forNotify);
}
});
var <API key> = utils.map(questionModel.preview_pictures, function(previewPictureModel) {
return function(forNotify) {
return MediaService.uploadMedia('question_preview', previewPictureModel, forNotify);
}
});
var mediaUploadFnArray = utils.merge(<API key>, videoUploadFnArray, <API key>);
if (true === forNotify) {
return ParallelPromise.getProgressSum(mediaUploadFnArray);
} else {
return ParallelPromise.withNotify(mediaUploadFnArray)
}
},
function(existingData, index, forNotify) {
// Upload to the server.
// At this point, all models are filled with their correct
// URL's and such from the media uploader.
if (false === forNotify) {
return Promise(function(resolve, reject, notify) {
// Create the new question here
HttpService.post(ApiUrlService([
{
name: 'Question'
},
{
name: 'Ask'
}
]), null, {question: questionModel.toObject(true)})
.then(function(data) {
resolve({question: new QuestionModel(data.data, true)})
})
.catch(function(error) {
reject(error);
})
})
}
}
];
return Promise(function(resolve, reject, notify) {
SerialPromise.withNotify(<API key>, null, ['question'], true)
.then(function(question) {
resolve(question);
}, null, function(progress) {
notify(progress);
})
.catch(function(error) {
// We want to revert back to the file models, instead of having
// uploaded URL's?
// !!! Do we want to do this?
questionModel.fromModel(<API key>);
reject(error);
});
});
}
QuestionService.saveQuestion = function(question, oldQuestion) {
return Promise(function(resolve, reject, notify) {
var patch = question.createPatch(oldQuestion, true);
if (!patch.length) {
resolve(question);
} else {
HttpService.patch(ApiUrlService.getObjectUrl('Question', question.id),
null, {data: patch})
.then(function(data) {
var question = new QuestionModel(data.data, true);
QuestionService.<API key>(question);
resolve(question);
})
.catch(function(error) {
reject(error);
})
}
});
}
QuestionService.<API key> = function(question, comment) {
return Promise(function(resolve, reject, notify) {
HttpService.post(ApiUrlService([
{
name: 'Question',
paramArray: [question.id]
},
{
name: 'Comment'
}
]), null, {comment: comment.toObject(true)})
.then(function(data) {
resolve(new CommentModel(data.data, true));
})
.catch(function(error) {
reject(error);
});
});
}
QuestionService.getQuestion = function(questionId) {
return Promise(function(resolve, reject) {
HttpService.get(ApiUrlService.getObjectUrl('Question', questionId))
.then(function(data) {
resolve(new QuestionModel(data.data, true));
})
.catch(function(error) {
reject(error);
})
});
}
return QuestionService;
}])
module.exports = name; |
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta charset="utf-8" />
<title>pymatgen.analysis.wulff — pymatgen 2019.10.16 documentation</title>
<link rel="stylesheet" href="../../../_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="<API key>" data-url_root="../../../" src="../../../_static/<API key>.js"></script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=<API key>"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2019.10.16 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
<li class="nav-item nav-item-2"><a href="../../pymatgen.html" accesskey="U">pymatgen</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pymatgen.analysis.wulff</h1><div class="highlight"><pre>
<span></span><span class="c1"># coding: utf-8</span>
<span class="c1">
<span class="c1">
<span class="sd">"""</span>
<span class="sd">This module define a WulffShape class to generate the Wulff shape from</span>
<span class="sd">a lattice, a list of indices and their corresponding surface energies,</span>
<span class="sd">and the total area and volume of the wulff shape,the weighted surface energy,</span>
<span class="sd">the anisotropy and shape_factor can also be calculated.</span>
<span class="sd">In support of plotting from a given view in terms of miller index.</span>
<span class="sd">The lattice is from the conventional unit cell, and (hkil) for hexagonal</span>
<span class="sd">lattices.</span>
<span class="sd">If you use this code extensively, consider citing the following:</span>
<span class="sd">Tran, R.; Xu, Z.; Radhakrishnan, B.; Winston, D.; Persson, K. A.; Ong, S. P.</span>
<span class="sd">(2016). Surface energies of elemental crystals. Scientific Data.</span>
<span class="sd">"""</span>
<span class="kn">from</span> <span class="nn">pymatgen.core.structure</span> <span class="k">import</span> <span class="n">Structure</span>
<span class="kn">from</span> <span class="nn">pymatgen.util.coord</span> <span class="k">import</span> <span class="n">get_angle</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">scipy</span> <span class="k">as</span> <span class="nn">sp</span>
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="k">import</span> <span class="n">ConvexHull</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="n">__author__</span> <span class="o">=</span> <span class="s1">'Zihan Xu, Richard Tran, Shyue Ping Ong'</span>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">'0.1'</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">'Zihan Xu'</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">'zix009@eng.ucsd.edu'</span>
<span class="n">__date__</span> <span class="o">=</span> <span class="s1">'May 5 2016'</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
<div class="viewcode-block" id="hkl_tuple_to_str"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.hkl_tuple_to_str">[docs]</a><span class="k">def</span> <span class="nf">hkl_tuple_to_str</span><span class="p">(</span><span class="n">hkl</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Prepare for display on plots</span>
<span class="sd"> "(hkl)" for surfaces</span>
<span class="sd"> Agrs:</span>
<span class="sd"> hkl: in the form of [h, k, l] or (h, k, l)</span>
<span class="sd"> """</span>
<span class="n">str_format</span> <span class="o">=</span> <span class="s1">'($'</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">hkl</span><span class="p">:</span>
<span class="k">if</span> <span class="n">x</span> <span class="o"><</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">str_format</span> <span class="o">+=</span> <span class="s1">'</span><span class="se">\\</span><span class="s1">overline{'</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="s1">'}'</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">str_format</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="n">str_format</span> <span class="o">+=</span> <span class="s1">'$)'</span>
<span class="k">return</span> <span class="n">str_format</span></div>
<div class="viewcode-block" id="get_tri_area"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.get_tri_area">[docs]</a><span class="k">def</span> <span class="nf">get_tri_area</span><span class="p">(</span><span class="n">pts</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Given a list of coords for 3 points,</span>
<span class="sd"> Compute the area of this triangle.</span>
<span class="sd"> Args:</span>
<span class="sd"> pts: [a, b, c] three points</span>
<span class="sd"> """</span>
<span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span> <span class="o">=</span> <span class="n">pts</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pts</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">pts</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="n">v1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">b</span><span class="p">)</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="n">v2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="o">-</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="n">area_tri</span> <span class="o">=</span> <span class="nb">abs</span><span class="p">(</span><span class="n">sp</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">sp</span><span class="o">.</span><span class="n">cross</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">v2</span><span class="p">))</span> <span class="o">/</span> <span class="mi">2</span><span class="p">)</span>
<span class="k">return</span> <span class="n">area_tri</span></div>
<div class="viewcode-block" id="WulffFacet"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.WulffFacet">[docs]</a><span class="k">class</span> <span class="nc">WulffFacet</span><span class="p">:</span>
<span class="sd">"""</span>
<span class="sd"> Helper container for each Wulff plane.</span>
<span class="sd"> """</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">normal</span><span class="p">,</span> <span class="n">e_surf</span><span class="p">,</span> <span class="n">normal_pt</span><span class="p">,</span> <span class="n">dual_pt</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">m_ind_orig</span><span class="p">,</span>
<span class="n">miller</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> :param normal:</span>
<span class="sd"> :param e_surf:</span>
<span class="sd"> :param normal_pt:</span>
<span class="sd"> :param dual_pt:</span>
<span class="sd"> :param index:</span>
<span class="sd"> :param m_ind_orig:</span>
<span class="sd"> :param miller:</span>
<span class="sd"> """</span>
<span class="bp">self</span><span class="o">.</span><span class="n">normal</span> <span class="o">=</span> <span class="n">normal</span>
<span class="bp">self</span><span class="o">.</span><span class="n">e_surf</span> <span class="o">=</span> <span class="n">e_surf</span>
<span class="bp">self</span><span class="o">.</span><span class="n">normal_pt</span> <span class="o">=</span> <span class="n">normal_pt</span>
<span class="bp">self</span><span class="o">.</span><span class="n">dual_pt</span> <span class="o">=</span> <span class="n">dual_pt</span>
<span class="bp">self</span><span class="o">.</span><span class="n">index</span> <span class="o">=</span> <span class="n">index</span>
<span class="bp">self</span><span class="o">.</span><span class="n">m_ind_orig</span> <span class="o">=</span> <span class="n">m_ind_orig</span>
<span class="bp">self</span><span class="o">.</span><span class="n">miller</span> <span class="o">=</span> <span class="n">miller</span>
<span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">outer_lines</span> <span class="o">=</span> <span class="p">[]</span></div>
<div class="viewcode-block" id="WulffShape"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.WulffShape">[docs]</a><span class="k">class</span> <span class="nc">WulffShape</span><span class="p">:</span>
<span class="sd">"""</span>
<span class="sd"> Generate Wulff Shape from list of miller index and surface energies,</span>
<span class="sd"> with given conventional unit cell.</span>
<span class="sd"> surface energy (Jm^2) is the length of normal.</span>
<span class="sd"> Wulff shape is the convex hull.</span>
<span class="sd"> Based on:</span>
<span class="sd"> http://scipy.github.io/devdocs/generated/scipy.spatial.ConvexHull.html</span>
<span class="sd"> Process:</span>
<span class="sd"> 1. get wulff simplices</span>
<span class="sd"> 2. label with color</span>
<span class="sd"> 3. get wulff_area and other properties</span>
<span class="sd"> .. attribute:: debug (bool)</span>
<span class="sd"> .. attribute:: alpha</span>
<span class="sd"> transparency</span>
<span class="sd"> .. attribute:: color_set</span>
<span class="sd"> .. attribute:: grid_off (bool)</span>
<span class="sd"> .. attribute:: axis_off (bool)</span>
<span class="sd"> .. attribute:: show_area</span>
<span class="sd"> .. attribute:: off_color</span>
<span class="sd"> color of facets off wulff</span>
<span class="sd"> .. attribute:: structure</span>
<span class="sd"> Structure object, input conventional unit cell (with H ) from lattice</span>
<span class="sd"> .. attribute:: miller_list</span>
<span class="sd"> list of input miller index, for hcp in the form of hkil</span>
<span class="sd"> .. attribute:: hkl_list</span>
<span class="sd"> modify hkill to hkl, in the same order with input_miller</span>
<span class="sd"> .. attribute:: e_surf_list</span>
<span class="sd"> list of input surface energies, in the same order with input_miller</span>
<span class="sd"> .. attribute:: lattice</span>
<span class="sd"> Lattice object, the input lattice for the conventional unit cell</span>
<span class="sd"> .. attribute:: facets</span>
<span class="sd"> [WulffFacet] for all facets considering symm</span>
<span class="sd"> .. attribute:: dual_cv_simp</span>
<span class="sd"> simplices from the dual convex hull (dual_pt)</span>
<span class="sd"> .. attribute:: wulff_pt_list</span>
<span class="sd"> .. attribute:: wulff_cv_simp</span>
<span class="sd"> simplices from the convex hull of wulff_pt_list</span>
<span class="sd"> .. attribute:: on_wulff</span>
<span class="sd"> list for all input_miller, True is on wulff.</span>
<span class="sd"> .. attribute:: color_area</span>
<span class="sd"> list for all input_miller, total area on wulff, off_wulff = 0.</span>
<span class="sd"> .. attribute:: miller_area</span>
<span class="sd"> ($hkl$): area for all input_miller</span>
<span class="sd"> """</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">lattice</span><span class="p">,</span> <span class="n">miller_list</span><span class="p">,</span> <span class="n">e_surf_list</span><span class="p">,</span> <span class="n">symprec</span><span class="o">=</span><span class="mf">1e-5</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Args:</span>
<span class="sd"> lattice: Lattice object of the conventional unit cell</span>
<span class="sd"> miller_list ([(hkl), ...]: list of hkl or hkil for hcp</span>
<span class="sd"> e_surf_list ([float]): list of corresponding surface energies</span>
<span class="sd"> symprec (float): for recp_operation, default is 1e-5.</span>
<span class="sd"> """</span>
<span class="k">if</span> <span class="nb">any</span><span class="p">([</span><span class="n">se</span> <span class="o"><</span> <span class="mi">0</span> <span class="k">for</span> <span class="n">se</span> <span class="ow">in</span> <span class="n">e_surf_list</span><span class="p">]):</span>
<span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">"Unphysical (negative) surface energy detected."</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">color_ind</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">miller_list</span><span class="p">)))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">input_miller_fig</span> <span class="o">=</span> <span class="p">[</span><span class="n">hkl_tuple_to_str</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">miller_list</span><span class="p">]</span>
<span class="c1"># store input data</span>
<span class="bp">self</span><span class="o">.</span><span class="n">structure</span> <span class="o">=</span> <span class="n">Structure</span><span class="p">(</span><span class="n">lattice</span><span class="p">,</span> <span class="p">[</span><span class="s2">"H"</span><span class="p">],</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">([</span><span class="nb">tuple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">miller_list</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">hkl_list</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">([(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">x</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">miller_list</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">e_surf_list</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">e_surf_list</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">lattice</span> <span class="o">=</span> <span class="n">lattice</span>
<span class="bp">self</span><span class="o">.</span><span class="n">symprec</span> <span class="o">=</span> <span class="n">symprec</span>
<span class="c1"># 2. get all the data for wulff construction</span>
<span class="c1"># get all the surface normal from get_all_miller_e()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">facets</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_all_miller_e</span><span class="p">()</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">))</span>
<span class="c1"># 3. consider the dual condition</span>
<span class="n">dual_pts</span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span><span class="o">.</span><span class="n">dual_pt</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">]</span>
<span class="n">dual_convex</span> <span class="o">=</span> <span class="n">ConvexHull</span><span class="p">(</span><span class="n">dual_pts</span><span class="p">)</span>
<span class="n">dual_cv_simp</span> <span class="o">=</span> <span class="n">dual_convex</span><span class="o">.</span><span class="n">simplices</span>
<span class="c1"># simplices (ndarray of ints, shape (nfacet, ndim))</span>
<span class="c1"># list of [i, j, k] , ndim = 3</span>
<span class="c1"># i, j, k: ind for normal_e_m</span>
<span class="c1"># recalculate the dual of dual, get the wulff shape.</span>
<span class="c1"># conner <-> surface</span>
<span class="c1"># get cross point from the simplices of the dual convex hull</span>
<span class="n">wulff_pt_list</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n"><API key></span><span class="p">(</span><span class="n">dual_simp</span><span class="p">)</span>
<span class="k">for</span> <span class="n">dual_simp</span> <span class="ow">in</span> <span class="n">dual_cv_simp</span><span class="p">]</span>
<span class="n">wulff_convex</span> <span class="o">=</span> <span class="n">ConvexHull</span><span class="p">(</span><span class="n">wulff_pt_list</span><span class="p">)</span>
<span class="n">wulff_cv_simp</span> <span class="o">=</span> <span class="n">wulff_convex</span><span class="o">.</span><span class="n">simplices</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="nb">str</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">))</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">wulff_cv_simp</span><span class="p">]))</span>
<span class="c1"># store simplices and convex</span>
<span class="bp">self</span><span class="o">.</span><span class="n">dual_cv_simp</span> <span class="o">=</span> <span class="n">dual_cv_simp</span>
<span class="bp">self</span><span class="o">.</span><span class="n">wulff_pt_list</span> <span class="o">=</span> <span class="n">wulff_pt_list</span>
<span class="bp">self</span><span class="o">.</span><span class="n">wulff_cv_simp</span> <span class="o">=</span> <span class="n">wulff_cv_simp</span>
<span class="bp">self</span><span class="o">.</span><span class="n">wulff_convex</span> <span class="o">=</span> <span class="n">wulff_convex</span>
<span class="bp">self</span><span class="o">.</span><span class="n">on_wulff</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">color_area</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_simpx_plane</span><span class="p">()</span>
<span class="n">miller_area</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">m</span><span class="p">,</span> <span class="n">in_mill_fig</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">input_miller_fig</span><span class="p">):</span>
<span class="n">miller_area</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
<span class="n">in_mill_fig</span> <span class="o">+</span> <span class="s1">' : '</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">color_area</span><span class="p">[</span><span class="n">m</span><span class="p">],</span> <span class="mi">4</span><span class="p">)))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">miller_area</span> <span class="o">=</span> <span class="n">miller_area</span>
<span class="k">def</span> <span class="nf">_get_all_miller_e</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> from self:</span>
<span class="sd"> get miller_list(unique_miller), e_surf_list and symmetry</span>
<span class="sd"> operations(symmops) according to lattice</span>
<span class="sd"> apply symmops to get all the miller index, then get normal,</span>
<span class="sd"> get all the facets functions for wulff shape calculation:</span>
<span class="sd"> |normal| = 1, e_surf is plane's distance to (0, 0, 0),</span>
<span class="sd"> normal[0]x + normal[1]y + normal[2]z = e_surf</span>
<span class="sd"> return:</span>
<span class="sd"> [WulffFacet]</span>
<span class="sd"> """</span>
<span class="n">all_hkl</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">color_ind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">color_ind</span>
<span class="n">planes</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">recp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">structure</span><span class="o">.</span><span class="n">lattice</span><span class="o">.</span><span class="n"><API key></span>
<span class="n">recp_symmops</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">lattice</span><span class="o">.</span><span class="n"><API key></span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">symprec</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="p">(</span><span class="n">hkl</span><span class="p">,</span> <span class="n">energy</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="nb">zip</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">hkl_list</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">e_surf_list</span><span class="p">)):</span>
<span class="k">for</span> <span class="n">op</span> <span class="ow">in</span> <span class="n">recp_symmops</span><span class="p">:</span>
<span class="n">miller</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">([</span><span class="nb">int</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">op</span><span class="o">.</span><span class="n">operate</span><span class="p">(</span><span class="n">hkl</span><span class="p">)])</span>
<span class="k">if</span> <span class="n">miller</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">all_hkl</span><span class="p">:</span>
<span class="n">all_hkl</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">miller</span><span class="p">)</span>
<span class="n">normal</span> <span class="o">=</span> <span class="n">recp</span><span class="o">.</span><span class="n"><API key></span><span class="p">(</span><span class="n">miller</span><span class="p">)</span>
<span class="n">normal</span> <span class="o">/=</span> <span class="n">sp</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">normal</span><span class="p">)</span>
<span class="n">normal_pt</span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span> <span class="o">*</span> <span class="n">energy</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">normal</span><span class="p">]</span>
<span class="n">dual_pt</span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span> <span class="o">/</span> <span class="n">energy</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">normal</span><span class="p">]</span>
<span class="n">color_plane</span> <span class="o">=</span> <span class="n">color_ind</span><span class="p">[</span><span class="nb">divmod</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">color_ind</span><span class="p">))[</span><span class="mi">1</span><span class="p">]]</span>
<span class="n">planes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">WulffFacet</span><span class="p">(</span><span class="n">normal</span><span class="p">,</span> <span class="n">energy</span><span class="p">,</span> <span class="n">normal_pt</span><span class="p">,</span>
<span class="n">dual_pt</span><span class="p">,</span> <span class="n">color_plane</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">hkl</span><span class="p">))</span>
<span class="c1"># sort by e_surf</span>
<span class="n">planes</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="o">.</span><span class="n">e_surf</span><span class="p">)</span>
<span class="k">return</span> <span class="n">planes</span>
<span class="k">def</span> <span class="nf"><API key></span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dual_simp</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> |normal| = 1, e_surf is plane's distance to (0, 0, 0),</span>
<span class="sd"> plane function:</span>
<span class="sd"> normal[0]x + normal[1]y + normal[2]z = e_surf</span>
<span class="sd"> from self:</span>
<span class="sd"> normal_e_m to get the plane functions</span>
<span class="sd"> dual_simp: (i, j, k) simplices from the dual convex hull</span>
<span class="sd"> i, j, k: plane index(same order in normal_e_m)</span>
<span class="sd"> """</span>
<span class="n">matrix_surfs</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">[</span><span class="n">dual_simp</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span><span class="o">.</span><span class="n">normal</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="n">matrix_e</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">[</span><span class="n">dual_simp</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span><span class="o">.</span><span class="n">e_surf</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="n">cross_pt</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">sp</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">inv</span><span class="p">(</span><span class="n">matrix_surfs</span><span class="p">),</span> <span class="n">matrix_e</span><span class="p">)</span>
<span class="k">return</span> <span class="n">cross_pt</span>
<span class="k">def</span> <span class="nf">_get_simpx_plane</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Locate the plane for simpx of on wulff_cv, by comparing the center of</span>
<span class="sd"> the simpx triangle with the plane functions.</span>
<span class="sd"> """</span>
<span class="n">on_wulff</span> <span class="o">=</span> <span class="p">[</span><span class="kc">False</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">)</span>
<span class="n">surface_area</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.0</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">)</span>
<span class="k">for</span> <span class="n">simpx</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">wulff_cv_simp</span><span class="p">:</span>
<span class="n">pts</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">wulff_pt_list</span><span class="p">[</span><span class="n">simpx</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="n">center</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">pts</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">/</span> <span class="mf">3.0</span>
<span class="c1"># check whether the center of the simplices is on one plane</span>
<span class="k">for</span> <span class="n">plane</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">:</span>
<span class="n">abs_diff</span> <span class="o">=</span> <span class="nb">abs</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">plane</span><span class="o">.</span><span class="n">normal</span><span class="p">,</span> <span class="n">center</span><span class="p">)</span> <span class="o">-</span> <span class="n">plane</span><span class="o">.</span><span class="n">e_surf</span><span class="p">)</span>
<span class="k">if</span> <span class="n">abs_diff</span> <span class="o"><</span> <span class="mf">1e-5</span><span class="p">:</span>
<span class="n">on_wulff</span><span class="p">[</span><span class="n">plane</span><span class="o">.</span><span class="n">index</span><span class="p">]</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">surface_area</span><span class="p">[</span><span class="n">plane</span><span class="o">.</span><span class="n">index</span><span class="p">]</span> <span class="o">+=</span> <span class="n">get_tri_area</span><span class="p">(</span><span class="n">pts</span><span class="p">)</span>
<span class="n">plane</span><span class="o">.</span><span class="n">points</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">pts</span><span class="p">)</span>
<span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">simpx</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">simpx</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span>
<span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">simpx</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">simpx</span><span class="p">[</span><span class="mi">2</span><span class="p">]])</span>
<span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">simpx</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">simpx</span><span class="p">[</span><span class="mi">2</span><span class="p">]])</span>
<span class="c1"># already find the plane, move to the next simplices</span>
<span class="k">break</span>
<span class="k">for</span> <span class="n">plane</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">:</span>
<span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
<span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span> <span class="o">=</span> <span class="p">[</span><span class="n">line</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span>
<span class="k">if</span> <span class="n">plane</span><span class="o">.</span><span class="n">outer_lines</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">]</span>
<span class="k">return</span> <span class="n">on_wulff</span><span class="p">,</span> <span class="n">surface_area</span>
<span class="k">def</span> <span class="nf">_get_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">color_set</span><span class="p">,</span> <span class="n">alpha</span><span class="p">,</span> <span class="n">off_color</span><span class="p">,</span> <span class="n">custom_colors</span><span class="o">=</span><span class="p">{}):</span>
<span class="sd">"""</span>
<span class="sd"> assign colors according to the surface energies of on_wulff facets.</span>
<span class="sd"> return:</span>
<span class="sd"> (color_list, color_proxy, <API key>, miller_on_wulff,</span>
<span class="sd"> <API key>)</span>
<span class="sd"> """</span>
<span class="kn">import</span> <span class="nn">matplotlib</span> <span class="k">as</span> <span class="nn">mpl</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="n">color_list</span> <span class="o">=</span> <span class="p">[</span><span class="n">off_color</span><span class="p">]</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">hkl_list</span><span class="p">)</span>
<span class="n"><API key></span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">miller_on_wulff</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">e_surf_on_wulff</span> <span class="o">=</span> <span class="p">[(</span><span class="n">i</span><span class="p">,</span> <span class="n">e_surf</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">e_surf</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">e_surf_list</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_wulff</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
<span class="n">c_map</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(</span><span class="n">color_set</span><span class="p">)</span>
<span class="n">e_surf_on_wulff</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">reverse</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n"><API key></span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">e_surf_on_wulff</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">e_surf_on_wulff</span><span class="p">)</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
<span class="n">cnorm</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="nb">min</span><span class="p">(</span><span class="n"><API key></span><span class="p">),</span>
<span class="n">vmax</span><span class="o">=</span><span class="nb">max</span><span class="p">(</span><span class="n"><API key></span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># if there is only one hkl on wulff, choose the color of the median</span>
<span class="n">cnorm</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="nb">min</span><span class="p">(</span><span class="n"><API key></span><span class="p">)</span> <span class="o">-</span> <span class="mf">0.1</span><span class="p">,</span>
<span class="n">vmax</span><span class="o">=</span><span class="nb">max</span><span class="p">(</span><span class="n"><API key></span><span class="p">)</span> <span class="o">+</span> <span class="mf">0.1</span><span class="p">)</span>
<span class="n">scalar_map</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">ScalarMappable</span><span class="p">(</span><span class="n">norm</span><span class="o">=</span><span class="n">cnorm</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">c_map</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">e_surf</span> <span class="ow">in</span> <span class="n">e_surf_on_wulff</span><span class="p">:</span>
<span class="n">color_list</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">scalar_map</span><span class="o">.</span><span class="n">to_rgba</span><span class="p">(</span><span class="n">e_surf</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="n">alpha</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">tuple</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="ow">in</span> <span class="n">custom_colors</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">color_list</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">custom_colors</span><span class="p">[</span><span class="nb">tuple</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">[</span><span class="n">i</span><span class="p">])]</span>
<span class="n"><API key></span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
<span class="n">plt</span><span class="o">.</span><span class="n">Rectangle</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">fc</span><span class="o">=</span><span class="n">color_list</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">alpha</span><span class="o">=</span><span class="n">alpha</span><span class="p">))</span>
<span class="n">miller_on_wulff</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">input_miller_fig</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
<span class="n">scalar_map</span><span class="o">.</span><span class="n">set_array</span><span class="p">([</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">e_surf_on_wulff</span><span class="p">])</span>
<span class="n">color_proxy</span> <span class="o">=</span> <span class="p">[</span><span class="n">plt</span><span class="o">.</span><span class="n">Rectangle</span><span class="p">((</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">fc</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="n">alpha</span><span class="p">)</span>
<span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">color_list</span><span class="p">]</span>
<span class="k">return</span> <span class="n">color_list</span><span class="p">,</span> <span class="n">color_proxy</span><span class="p">,</span> <span class="n"><API key></span><span class="p">,</span> <span class="n">miller_on_wulff</span><span class="p">,</span> <span class="n"><API key></span>
<div class="viewcode-block" id="WulffShape.show"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.WulffShape.show">[docs]</a> <span class="k">def</span> <span class="nf">show</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sa">r</span><span class="sd">"""</span>
<span class="sd"> Show the Wulff plot.</span>
<span class="sd"> Args:</span>
<span class="sd"> *args: Passed to get_plot.</span>
<span class="sd"> **kwargs: Passed to get_plot.</span>
<span class="sd"> """</span>
<span class="bp">self</span><span class="o">.</span><span class="n">get_plot</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span><span class="o">.</span><span class="n">show</span><span class="p">()</span></div>
<div class="viewcode-block" id="WulffShape.get_line_in_facet"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.WulffShape.get_line_in_facet">[docs]</a> <span class="k">def</span> <span class="nf">get_line_in_facet</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">facet</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns the sorted pts in a facet used to draw a line</span>
<span class="sd"> """</span>
<span class="n">lines</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">facet</span><span class="o">.</span><span class="n">outer_lines</span><span class="p">)</span>
<span class="n">pt</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">prev</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">while</span> <span class="nb">len</span><span class="p">(</span><span class="n">lines</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
<span class="k">if</span> <span class="n">prev</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">l</span> <span class="o">=</span> <span class="n">lines</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">l</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">lines</span><span class="p">):</span>
<span class="k">if</span> <span class="n">prev</span> <span class="ow">in</span> <span class="n">l</span><span class="p">:</span>
<span class="n">l</span> <span class="o">=</span> <span class="n">lines</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
<span class="k">if</span> <span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">prev</span><span class="p">:</span>
<span class="n">l</span><span class="o">.</span><span class="n">reverse</span><span class="p">()</span>
<span class="k">break</span>
<span class="c1"># make sure the lines are connected one by one.</span>
<span class="c1"># find the way covering all pts and facets</span>
<span class="n">pt</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">wulff_pt_list</span><span class="p">[</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span><span class="o">.</span><span class="n">tolist</span><span class="p">())</span>
<span class="n">pt</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">wulff_pt_list</span><span class="p">[</span><span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]]</span><span class="o">.</span><span class="n">tolist</span><span class="p">())</span>
<span class="n">prev</span> <span class="o">=</span> <span class="n">l</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="k">return</span> <span class="n">pt</span></div>
<div class="viewcode-block" id="WulffShape.get_plot"><a class="viewcode-back" href="../../../pymatgen.analysis.wulff.html#pymatgen.analysis.wulff.WulffShape.get_plot">[docs]</a> <span class="k">def</span> <span class="nf">get_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">color_set</span><span class="o">=</span><span class="s1">'PuBu'</span><span class="p">,</span> <span class="n">grid_off</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">axis_off</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">show_area</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">off_color</span><span class="o">=</span><span class="s1">'red'</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">bar_pos</span><span class="o">=</span><span class="p">(</span><span class="mf">0.75</span><span class="p">,</span> <span class="mf">0.15</span><span class="p">,</span> <span class="mf">0.05</span><span class="p">,</span> <span class="mf">0.65</span><span class="p">),</span> <span class="n">bar_on</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">units_in_JPERM2</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">legend_on</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">aspect_ratio</span><span class="o">=</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">8</span><span class="p">),</span> <span class="n">custom_colors</span><span class="o">=</span><span class="p">{}):</span>
<span class="sd">"""</span>
<span class="sd"> Get the Wulff shape plot.</span>
<span class="sd"> Args:</span>
<span class="sd"> color_set: default is 'PuBu'</span>
<span class="sd"> grid_off (bool): default is True</span>
<span class="sd"> axis_off (bool): default is Ture</span>
<span class="sd"> show_area (bool): default is False</span>
<span class="sd"> alpha (float): chosen from 0 to 1 (float), default is 1</span>
<span class="sd"> off_color: Default color for facets not present on the Wulff shape.</span>
<span class="sd"> direction: default is (1, 1, 1)</span>
<span class="sd"> bar_pos: default is [0.75, 0.15, 0.05, 0.65]</span>
<span class="sd"> bar_on (bool): default is False</span>
<span class="sd"> legend_on (bool): default is True</span>
<span class="sd"> aspect_ratio: default is (8, 8)</span>
<span class="sd"> custom_colors ({(h,k,l}: [r,g,b,alpha}): Customize color of each</span>
<span class="sd"> facet with a dictionary. The key is the corresponding Miller</span>
<span class="sd"> index and value is the color. Undefined facets will use default</span>
<span class="sd"> color site. Note: If you decide to set your own colors, it</span>
<span class="sd"> probably won't make any sense to have the color bar on.</span>
<span class="sd"> Return:</span>
<span class="sd"> (matplotlib.pyplot)</span>
<span class="sd"> """</span>
<span class="kn">import</span> <span class="nn">matplotlib</span> <span class="k">as</span> <span class="nn">mpl</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">mpl_toolkits.mplot3d</span> <span class="k">as</span> <span class="nn">mpl3</span>
<span class="n">color_list</span><span class="p">,</span> <span class="n">color_proxy</span><span class="p">,</span> <span class="n"><API key></span><span class="p">,</span> <span class="n">miller_on_wulff</span><span class="p">,</span> <span class="n">e_surf_on_wulff</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_colors</span><span class="p">(</span>
<span class="n">color_set</span><span class="p">,</span> <span class="n">alpha</span><span class="p">,</span> <span class="n">off_color</span><span class="p">,</span> <span class="n">custom_colors</span><span class="o">=</span><span class="n">custom_colors</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">direction</span><span class="p">:</span>
<span class="c1"># If direction is not specified, use the miller indices of</span>
<span class="c1"># maximum area.</span>
<span class="n">direction</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">area_fraction_dict</span><span class="o">.</span><span class="n">items</span><span class="p">(),</span>
<span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">()</span>
<span class="n">fig</span><span class="o">.</span><span class="n">set_size_inches</span><span class="p">(</span><span class="n">aspect_ratio</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">aspect_ratio</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<span class="n">azim</span><span class="p">,</span> <span class="n">elev</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_azimuth_elev</span><span class="p">([</span><span class="n">direction</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">direction</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
<span class="n">direction</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]])</span>
<span class="n">wulff_pt_list</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">wulff_pt_list</span>
<span class="n">ax</span> <span class="o">=</span> <span class="n">mpl3</span><span class="o">.</span><span class="n">Axes3D</span><span class="p">(</span><span class="n">fig</span><span class="p">,</span> <span class="n">azim</span><span class="o">=</span><span class="n">azim</span><span class="p">,</span> <span class="n">elev</span><span class="o">=</span><span class="n">elev</span><span class="p">)</span>
<span class="k">for</span> <span class="n">plane</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">:</span>
<span class="c1"># check whether [pts] is empty</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">plane</span><span class="o">.</span><span class="n">points</span><span class="p">)</span> <span class="o"><</span> <span class="mi">1</span><span class="p">:</span>
<span class="c1"># empty, plane is not on_wulff.</span>
<span class="k">continue</span>
<span class="c1"># assign the color for on_wulff facets according to its</span>
<span class="c1"># index and the color_list for on_wulff</span>
<span class="n">plane_color</span> <span class="o">=</span> <span class="n">color_list</span><span class="p">[</span><span class="n">plane</span><span class="o">.</span><span class="n">index</span><span class="p">]</span>
<span class="n">pt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_line_in_facet</span><span class="p">(</span><span class="n">plane</span><span class="p">)</span>
<span class="c1"># plot from the sorted pts from [simpx]</span>
<span class="n">tri</span> <span class="o">=</span> <span class="n">mpl3</span><span class="o">.</span><span class="n">art3d</span><span class="o">.</span><span class="n">Poly3DCollection</span><span class="p">([</span><span class="n">pt</span><span class="p">])</span>
<span class="n">tri</span><span class="o">.</span><span class="n">set_color</span><span class="p">(</span><span class="n">plane_color</span><span class="p">)</span>
<span class="n">tri</span><span class="o">.</span><span class="n">set_edgecolor</span><span class="p">(</span><span class="s2">"#808080"</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">add_collection3d</span><span class="p">(</span><span class="n">tri</span><span class="p">)</span>
<span class="c1"># set ranges of x, y, z</span>
<span class="c1"># find the largest distance between on_wulff pts and the origin,</span>
<span class="c1"># to ensure complete and consistent display for all directions</span>
<span class="n">r_range</span> <span class="o">=</span> <span class="nb">max</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">wulff_pt_list</span><span class="p">])</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">([</span><span class="o">-</span><span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">,</span> <span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">])</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">([</span><span class="o">-</span><span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">,</span> <span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">])</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_zlim</span><span class="p">([</span><span class="o">-</span><span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">,</span> <span class="n">r_range</span> <span class="o">*</span> <span class="mf">1.1</span><span class="p">])</span>
<span class="c1"># add legend</span>
<span class="k">if</span> <span class="n">legend_on</span><span class="p">:</span>
<span class="n">color_proxy</span> <span class="o">=</span> <span class="n">color_proxy</span>
<span class="k">if</span> <span class="n">show_area</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n">color_proxy</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_area</span><span class="p">,</span> <span class="n">loc</span><span class="o">=</span><span class="s1">'upper left'</span><span class="p">,</span>
<span class="n">bbox_to_anchor</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">fancybox</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">shadow</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">legend</span><span class="p">(</span><span class="n"><API key></span><span class="p">,</span> <span class="n">miller_on_wulff</span><span class="p">,</span>
<span class="n">loc</span><span class="o">=</span><span class="s1">'upper center'</span><span class="p">,</span>
<span class="n">bbox_to_anchor</span><span class="o">=</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">ncol</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">fancybox</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">shadow</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s1">'x'</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s1">'y'</span><span class="p">)</span>
<span class="n">ax</span><span class="o">.</span><span class="n">set_zlabel</span><span class="p">(</span><span class="s1">'z'</span><span class="p">)</span>
<span class="c1"># Add colorbar</span>
<span class="k">if</span> <span class="n">bar_on</span><span class="p">:</span>
<span class="n">cmap</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(</span><span class="n">color_set</span><span class="p">)</span>
<span class="n">cmap</span><span class="o">.</span><span class="n">set_over</span><span class="p">(</span><span class="s1">'0.25'</span><span class="p">)</span>
<span class="n">cmap</span><span class="o">.</span><span class="n">set_under</span><span class="p">(</span><span class="s1">'0.75'</span><span class="p">)</span>
<span class="n">bounds</span> <span class="o">=</span> <span class="p">[</span><span class="nb">round</span><span class="p">(</span><span class="n">e</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">e_surf_on_wulff</span><span class="p">]</span>
<span class="n">bounds</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mf">1.2</span> <span class="o">*</span> <span class="n">bounds</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
<span class="n">norm</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">BoundaryNorm</span><span class="p">(</span><span class="n">bounds</span><span class="p">,</span> <span class="n">cmap</span><span class="o">.</span><span class="n">N</span><span class="p">)</span>
<span class="c1"># display surface energies</span>
<span class="n">ax1</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_axes</span><span class="p">(</span><span class="n">bar_pos</span><span class="p">)</span>
<span class="n">cbar</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colorbar</span><span class="o">.</span><span class="n">ColorbarBase</span><span class="p">(</span>
<span class="n">ax1</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="n">cmap</span><span class="p">,</span> <span class="n">norm</span><span class="o">=</span><span class="n">norm</span><span class="p">,</span> <span class="n">boundaries</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">bounds</span> <span class="o">+</span> <span class="p">[</span><span class="mi">10</span><span class="p">],</span>
<span class="n">extend</span><span class="o">=</span><span class="s1">'both'</span><span class="p">,</span> <span class="n">ticks</span><span class="o">=</span><span class="n">bounds</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">spacing</span><span class="o">=</span><span class="s1">'proportional'</span><span class="p">,</span>
<span class="n">orientation</span><span class="o">=</span><span class="s1">'vertical'</span><span class="p">)</span>
<span class="n">units</span> <span class="o">=</span> <span class="s2">"$J/m^2$"</span> <span class="k">if</span> <span class="n">units_in_JPERM2</span> <span class="k">else</span> <span class="sa">r</span><span class="s2">"$eV/\AA^2$"</span>
<span class="n">cbar</span><span class="o">.</span><span class="n">set_label</span><span class="p">(</span><span class="s1">'Surface Energies (</span><span class="si">%s</span><span class="s1">)'</span> <span class="o">%</span> <span class="p">(</span><span class="n">units</span><span class="p">),</span> <span class="n">fontsize</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
<span class="k">if</span> <span class="n">grid_off</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">grid</span><span class="p">(</span><span class="s1">'off'</span><span class="p">)</span>
<span class="k">if</span> <span class="n">axis_off</span><span class="p">:</span>
<span class="n">ax</span><span class="o">.</span><span class="n">axis</span><span class="p">(</span><span class="s1">'off'</span><span class="p">)</span>
<span class="k">return</span> <span class="n">plt</span></div>
<span class="k">def</span> <span class="nf">_get_azimuth_elev</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">miller_index</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Args:</span>
<span class="sd"> miller_index: viewing direction</span>
<span class="sd"> Returns:</span>
<span class="sd"> azim, elev for plotting</span>
<span class="sd"> """</span>
<span class="k">if</span> <span class="n">miller_index</span> <span class="o">==</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="ow">or</span> <span class="n">miller_index</span> <span class="o">==</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">):</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">90</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">cart</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">lattice</span><span class="o">.</span><span class="n"><API key></span><span class="p">(</span><span class="n">miller_index</span><span class="p">)</span>
<span class="n">azim</span> <span class="o">=</span> <span class="n">get_angle</span><span class="p">([</span><span class="n">cart</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">cart</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="n">v</span> <span class="o">=</span> <span class="p">[</span><span class="n">cart</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">cart</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="mi">0</span><span class="p">]</span>
<span class="n">elev</span> <span class="o">=</span> <span class="n">get_angle</span><span class="p">(</span><span class="n">cart</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
<span class="k">return</span> <span class="n">azim</span><span class="p">,</span> <span class="n">elev</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">volume</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Volume of the Wulff shape</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">wulff_convex</span><span class="o">.</span><span class="n">volume</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">miller_area_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns {hkl: area_hkl on wulff}</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="nb">dict</span><span class="p">(</span><span class="nb">zip</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">color_area</span><span class="p">))</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">miller_energy_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns {hkl: surface energy_hkl}</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="nb">dict</span><span class="p">(</span><span class="nb">zip</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_list</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">e_surf_list</span><span class="p">))</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">surface_area</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Total surface area of Wulff shape.</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="nb">sum</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">miller_area_dict</span><span class="o">.</span><span class="n">values</span><span class="p">())</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf"><API key></span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns:</span>
<span class="sd"> sum(surface_energy_hkl * area_hkl)/ sum(area_hkl)</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n"><API key></span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">surface_area</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">area_fraction_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns:</span>
<span class="sd"> (dict): {hkl: area_hkl/total area on wulff}</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="p">{</span><span class="n">hkl</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_area_dict</span><span class="p">[</span><span class="n">hkl</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">surface_area</span>
<span class="k">for</span> <span class="n">hkl</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_area_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">()}</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">anisotropy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns:</span>
<span class="sd"> (float) Coefficient of Variation from weighted surface energy</span>
<span class="sd"> The ideal sphere is 0.</span>
<span class="sd"> """</span>
<span class="n">square_diff_energy</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">weighted_energy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n"><API key></span>
<span class="n">area_frac_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">area_fraction_dict</span>
<span class="n">miller_energy_dict</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_energy_dict</span>
<span class="k">for</span> <span class="n">hkl</span> <span class="ow">in</span> <span class="n">miller_energy_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">square_diff_energy</span> <span class="o">+=</span> <span class="p">(</span><span class="n">miller_energy_dict</span><span class="p">[</span><span class="n">hkl</span><span class="p">]</span> <span class="o">-</span> <span class="n">weighted_energy</span><span class="p">)</span> \
<span class="o">**</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">area_frac_dict</span><span class="p">[</span><span class="n">hkl</span><span class="p">]</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">square_diff_energy</span><span class="p">)</span> <span class="o">/</span> <span class="n">weighted_energy</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">shape_factor</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> This is useful for determining the critical nucleus size.</span>
<span class="sd"> A large shape factor indicates great anisotropy.</span>
<span class="sd"> See Ballufi, R. W., Allen, S. M. & Carter, W. C. Kinetics</span>
<span class="sd"> of Materials. (John Wiley & Sons, 2005), p.461</span>
<span class="sd"> Returns:</span>
<span class="sd"> (float) Shape factor.</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">surface_area</span> <span class="o">/</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">volume</span> <span class="o">**</span> <span class="p">(</span><span class="mi">2</span> <span class="o">/</span> <span class="mi">3</span><span class="p">))</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">effective_radius</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Radius of the Wulffshape when the</span>
<span class="sd"> Wulffshape is approximated as a sphere.</span>
<span class="sd"> Returns:</span>
<span class="sd"> (float) radius.</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="p">((</span><span class="mi">3</span> <span class="o">/</span> <span class="mi">4</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">volume</span> <span class="o">/</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">))</span> <span class="o">**</span> <span class="p">(</span><span class="mi">1</span> <span class="o">/</span> <span class="mi">3</span><span class="p">)</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf"><API key></span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Total surface energy of the Wulff shape.</span>
<span class="sd"> Returns:</span>
<span class="sd"> (float) sum(surface_energy_hkl * area_hkl)</span>
<span class="sd"> """</span>
<span class="n">tot_surface_energy</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">for</span> <span class="n">hkl</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_energy_dict</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">tot_surface_energy</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">miller_energy_dict</span><span class="p">[</span><span class="n">hkl</span><span class="p">]</span> <span class="o">*</span> \
<span class="bp">self</span><span class="o">.</span><span class="n">miller_area_dict</span><span class="p">[</span><span class="n">hkl</span><span class="p">]</span>
<span class="k">return</span> <span class="n">tot_surface_energy</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">tot_corner_sites</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns the number of vertices in the convex hull.</span>
<span class="sd"> Useful for identifying catalytically active sites.</span>
<span class="sd"> """</span>
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">wulff_convex</span><span class="o">.</span><span class="n">vertices</span><span class="p">)</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">tot_edges</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Returns the number of edges in the convex hull.</span>
<span class="sd"> Useful for identifying catalytically active sites.</span>
<span class="sd"> """</span>
<span class="n">all_edges</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">facet</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">facets</span><span class="p">:</span>
<span class="n">edges</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">pt</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_line_in_facet</span><span class="p">(</span><span class="n">facet</span><span class="p">)</span>
<span class="n">lines</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">p</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">pt</span><span class="p">):</span>
<span class="k">if</span> <span class="n">i</span> <span class="o">==</span> <span class="nb">len</span><span class="p">(</span><span class="n">pt</span><span class="p">)</span> <span class="o">/</span> <span class="mi">2</span><span class="p">:</span>
<span class="k">break</span>
<span class="n">lines</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="nb">tuple</span><span class="p">([</span><span class="nb">tuple</span><span class="p">(</span><span class="n">pt</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="mi">2</span><span class="p">]),</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">pt</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">])]))))</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">p</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">lines</span><span class="p">):</span>
<span class="k">if</span> <span class="n">p</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">all_edges</span><span class="p">:</span>
<span class="n">edges</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
<span class="n">all_edges</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">edges</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="n">all_edges</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="<API key>">
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pymatgen 2019.10.16 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
<li class="nav-item nav-item-2"><a href="../../pymatgen.html" >pymatgen</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https:
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html> |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<!--<meta content="width=device-width, initial-scale=1.0" name="viewport">-->
<link href="/static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/static/css/common.css" rel="stylesheet" type="text/css" />
<script src="/static/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
{% block other_css %}{% endblock %}
<title>Gallery</title>
</head>
<body>
{% block content %}{% endblock %}
<script src="/static/js/jquery-ui-1.10.4.min.js" type="text/javascript"></script>
<script src="/static/js/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="/static/js/jquery.fileupload.js" type="text/javascript"></script>
<script src="/static/js/masonry.pkgd.js" type="text/javascript"></script>
<script src="/static/js/common.js" type="text/javascript"></script>
<script src="/static/js/ajax_client.js" type="text/javascript"></script>
{% block other_js %}{% endblock %}
</body>
</html> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Vietnamese Tutsplus Translation Team</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="/assets/css/main.css">
</head>
<body>
<div class="outer-wrapper d-md-flex align-items-stretch">
<div class="nav-wrapper d-md-flex flex-column bg-inverse">
<div class="collapse bg-inverse mb-auto" id="navbarHeader">
<div class="container">
<div class="row">
<div class="col-sm-8 col-md-12 py-4">
<h4 class="text-white">Về chúng tôi</h4>
<p class="text-muted mb-0">Chúng tôi đã dành thời gian, công sức, và sự đam mê để dịch những bài viết hay và bổ ích trên tutsplus, không chỉ là để giúp các bạn dễ đọc cũng như tìm hiểu, mà còn là một cách để giúp các bạn nâng cao vốn tiếng Anh bằng cách đọc song ngữ. Chúng tôi hy vọng các bạn cũng như chúng tôi, cũng đam mê và thích thú những bài viết trên tutsplus!</p>
</div>
<div class="col-sm-4 col-md-12 py-4 py-md-0">
<ul class="nav flex-column mb-3">
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
<li class="nav-item"><a class="nav-link pl-0 pr-0" href="http:
</ul>
<h4 class="text-white">Liên hệ</h4>
<ul class="list-unstyled">
<li><a href="https://twitter.com/TutsplusTeam" class="text-white">Twitter</a></li>
<li><a href="https:
<li><a href="mailto:mouoccuatoi@gmail.com" class="text-white">Email</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="navbar navbar-inverse bg-inverse px-md-0">
<div class="container d-flex <API key>">
<a href="http:
<button class="navbar-toggler d-md-none" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="row">
<div class="col">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">10 Template Ionic Tuyệt đẹp</h1>
<p class="post-meta">
<time datetime="2016-03-04T22:45:46+07:00" itemprop="datePublished">
Mar 4, 2016
</time>
</p>
</header>
<div class="post-content" itemprop="articleBody">
<p>Ionic là một framework phổ biến để tạo ra các ứng dụng lai hiện đại, dành cho thiết bị di động, sử dụng JavaScript, HTML và CSS. Ionic tận dụng AngularJS và…</p>
</div>
</article>
</div>
</div>
</div>
</div>
<footer class="footer bg-faded">
<div class="container text-center">
<span class="text-muted">© 2017 DAI PHONG | Made with </span>
</div>
</footer>
<!-- Bootstrap core JavaScript
===============================================
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/<API key>" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="<API key>/<API key>" crossorigin="anonymous"></script>
<script src="/assets/js/bootstrap.min.js"></script>
</body>
</html> |
@extends('layouts.text')
@section('content')
The first coding style analysis of the "{{ $branch }}" branch on "{{ $repo }}" has passed.
You can see the details at {{ $link }}.
@stop |
import numpy as np
from lie_learn.groups.SO3 import *
def <API key>():
def is_equal(R1, R2, p):
if p == 'Q':
# Quaternions are only defined up to a sign, so check each row, what sign we need
for i in range(R1.shape[0]):
if not (np.allclose(R1[i, ...], R2[i, ...]) or np.allclose(R1[i, ...], -R2[i, ...])):
return False
return True
elif p == 'EV':
# Euler vector (x,y,z,theta) == (-x,-y,-z,-theta mod 2pi)
for i in range(R1.shape[0]):
R2i = np.array([-R2[i, 0], -R2[i, 1], -R2[i, 2], (-R2[i, 3]) % (2 * np.pi)])
if not (np.allclose(R1[i, ...], R2[i, ...]) or np.allclose(R1[i, ], R2i)):
return False
return True
else:
return np.allclose(R1, R2)
for p1 in parameterizations:
for p2 in parameterizations:
# Create two random rotations in 313 Euler angles
R1_EA313 = (np.random.rand(3) * np.array([2 * np.pi, np.pi, 2 * np.pi]))[np.newaxis, :]
R2_EA313 = (np.random.rand(3) * np.array([2 * np.pi, np.pi, 2 * np.pi]))[np.newaxis, :]
R_EA313 = np.r_[R1_EA313, R2_EA313]
R1_p1 = change_coordinates(p_from='EA313', p_to=p1, g=R1_EA313)
R1_p2 = change_coordinates(p_from='EA313', p_to=p2, g=R1_EA313)
R2_p1 = change_coordinates(p_from='EA313', p_to=p1, g=R2_EA313)
R2_p2 = change_coordinates(p_from='EA313', p_to=p2, g=R2_EA313)
R_p1 = change_coordinates(p_from='EA313', p_to=p1, g=R_EA313)
R_p2 = change_coordinates(p_from='EA313', p_to=p2, g=R_EA313)
R1_p2_from_R1_p1 = change_coordinates(p_from=p1, p_to=p2, g=R1_p1)
R1_p1_from_R1_p2 = change_coordinates(p_from=p2, p_to=p1, g=R1_p2)
R2_p2_from_R2_p1 = change_coordinates(p_from=p1, p_to=p2, g=R2_p1)
R2_p1_from_R2_p2 = change_coordinates(p_from=p2, p_to=p1, g=R2_p2)
R_p2_from_R_p1 = change_coordinates(p_from=p1, p_to=p2, g=R_p1)
R_p1_from_R_p2 = change_coordinates(p_from=p2, p_to=p1, g=R_p2)
assert is_equal(R1_p1_from_R1_p2, R1_p1, p1), (
p1 + ' to ' + p2 + ' | R1_p1: ' + str(R1_p1) + ' | R1_p2: ' + str(R1_p2) + ' | R1_p1_from_R1_p2: ' +
str(R1_p1_from_R1_p2))
assert is_equal(R2_p1_from_R2_p2, R2_p1, p1), (
p1 + ' to ' + p2 + ' | R2_p1: ' + str(R2_p1) + ' | R2_p2: ' + str(R2_p2) + ' | R2_p1_from_R2_p2: ' +
str(R2_p1_from_R2_p2))
assert is_equal(R_p1_from_R_p2, R_p1, p1), (
p1 + ' to ' + p2 + ' | R_p1: ' + str(R_p1) + ' | R_p2: ' + str(R_p2) + ' | R_p1_from_R_p2: ' +
str(R_p1_from_R_p2))
assert is_equal(R1_p2_from_R1_p1, R1_p2, p2), (
p1 + ' to ' + p2 + ' | R1_p1: ' + str(R1_p1) + ' | R1_p2: ' + str(R1_p2) + ' | R1_p2_from_R1_p1: ' +
str(R1_p2_from_R1_p1))
assert is_equal(R2_p2_from_R2_p1, R2_p2, p2), (
p1 + ' to ' + p2 + ' | R2_p1: ' + str(R2_p1) + ' | R2_p2: ' + str(R2_p2) + ' | R2_p2_from_R2_p1: ' +
str(R2_p2_from_R2_p1))
assert is_equal(R_p2_from_R_p1, R_p2, p2), (
p1 + ' to ' + p2 + ' | R_p1: ' + str(R_p1) + ' | R_p2: ' + str(R_p2) + ' | R_p2_from_R_p1: ' +
str(R_p2_from_R_p1))
def test_invert():
for p in parameterizations:
R_EA = np.random.rand(4, 5, 6, 3) * np.array([2 * np.pi, np.pi, 2 * np.pi])[None, None, None, :]
R_p = change_coordinates(R_EA, p_from='EA313', p_to=p)
R_p_inv = invert(R_p, parameterization=p)
e = compose(R_p, R_p_inv, parameterization=p)
eM = change_coordinates(e, p_from=p, p_to='MAT')
assert np.isclose(np.sum(eM - np.eye(3)), 0.0), 'not the identity: ' + eM |
CREATE DATABASE IF NOT EXISTS DUTY_ROSTER;
USE DUTY_ROSTER;
CREATE TABLE IF NOT EXISTS Member (
ID int NOT NULL AUTO_INCREMENT,
NAME varchar(30) NOT NULL,
ADDRESS varchar(50),
SUBURB varchar(30),
STATE varchar(20),
POSTCODE varchar(10),
SPOUSE_ID int,
HOME_PHONE varchar(20),
MOBILE_PHONE varchar(20),
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS DUTY (
ID INT,
NAME VARCHAR(255),
DESCRIPTION VARCHAR(1024),
PRIMARY KEY (ID)
);
CREATE TABLE IF NOT EXISTS CAPABILITY (
MEMBER_ID INT,
DUTY_ID INT,
FOREIGN KEY (MEMBER_ID) REFERENCES MEMBER (ID),
FOREIGN KEY (DUTY_ID) REFERENCES DUTY (ID)
);
INSERT INTO MEMBER (ID, NAME, ADDRESS, SUBURB, STATE, POSTCODE, SPOUSE_ID, HOME_PHONE, MOBILE_PHONE) VALUES (1, "Bob Smith", "21 Test Way", "TestVille", "VIC", "3689", 2, "03 5776 3454", "0436 655 354");
INSERT INTO MEMBER (ID, NAME, ADDRESS, SUBURB, STATE, POSTCODE, SPOUSE_ID, HOME_PHONE, MOBILE_PHONE) VALUES (2, "Mary Smith", "21 Test Way", "TestVille", "VIC", "3689", 1, "03 5776 3454", "0454 646 756");
INSERT INTO MEMBER (ID, NAME, ADDRESS, SUBURB, STATE, POSTCODE, SPOUSE_ID, HOME_PHONE, MOBILE_PHONE) VALUES (3, "Lauren Jones", "34 Handy Place", "Horrortown", "VIC", "3267", null,"03 9765 3456", "0426 456 467");
INSERT INTO DUTY (ID, NAME, DESCRIPTION) VALUES (1, "Chairman", "The person who runs the meeting");
INSERT INTO DUTY (ID, NAME, DESCRIPTION) VALUES (2, "Reader", "The person allocated to read the chosen portion of scripture");
INSERT INTO DUTY (ID, NAME, DESCRIPTION) VALUES (3, "Pianist", "The person allocated to play the piano to accompany the congregation");
INSERT INTO CAPABILITY (MEMBER_ID, DUTY_ID) VALUES (1, 1);
INSERT INTO CAPABILITY (MEMBER_ID, DUTY_ID) VALUES (1, 2);
INSERT INTO CAPABILITY (MEMBER_ID, DUTY_ID) VALUES (3, 3); |
require 'minitest_helper'
class <API key> < Minitest::Test
def <API key>
assert_equal "User: Failed to request blah",
Multiconnect::Error::UnsuccessfulRequest.new(class: User, action: "blah").message
end
end |
import { helpers } from 'utils';
import { Handlebars } from 'lib';
import list from 'list';
import template from '../templates/panel.hbs';
import ListItemView from './MembersListItemView';
const config = {
CHILD_HEIGHT: 34
};
const classes = {
EMPTY_VIEW: '<API key>'
};
export default Marionette.LayoutView.extend({
initialize(options) {
helpers.ensureOption(options, 'collection');
},
template: Handlebars.compile(template),
className: 'dd-list',
regions: {
listRegion: '.js-list-region',
scrollbarRegion: '.js-scrollbar-region'
},
onShow() {
this.listBundle = list.factory.createDefaultList({
collection: this.collection,
listViewOptions: {
childView: ListItemView,
childViewOptions: {
reqres: this.reqres
},
emptyViewOptions: {
className: classes.EMPTY_VIEW
},
childHeight: config.CHILD_HEIGHT,
height: 'auto',
maxRows: 12
}
});
this.listenTo(this.listBundle.listView, 'childview:member:select', (view, model) => {
this.trigger('member:select', model);
});
this.listRegion.show(this.listBundle.listView);
this.scrollbarRegion.show(this.listBundle.scrollbarView);
},
handleCommand(command) {
switch (command) {
case 'up':
this.listBundle.listView.moveCursorBy(-1, false);
break;
case 'down':
this.listBundle.listView.moveCursorBy(1, false);
break;
default:
break;
}
}
}); |
package pl.grzeslowski.jsupla.protocoljava.impl.serializers;
import pl.grzeslowski.jsupla.protocol.api.structs.cs.ClientServer;
import pl.grzeslowski.jsupla.protocol.api.structs.dcs.DeviceClientServer;
import pl.grzeslowski.jsupla.protocol.api.structs.ds.DeviceServer;
import pl.grzeslowski.jsupla.protocol.api.structs.sc.ServerClient;
import pl.grzeslowski.jsupla.protocol.api.structs.sd.ServerDevice;
import pl.grzeslowski.jsupla.protocol.api.structs.sdc.ServerDeviceClient;
import pl.grzeslowski.jsupla.protocol.api.types.Proto;
import pl.grzeslowski.jsupla.protocoljava.api.entities.ChannelValue;
import pl.grzeslowski.jsupla.protocoljava.api.entities.Timeval;
import pl.grzeslowski.jsupla.protocoljava.api.entities.cs.ClientServerEntity;
import pl.grzeslowski.jsupla.protocoljava.api.entities.dcs.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.entities.ds.DeviceChannel;
import pl.grzeslowski.jsupla.protocoljava.api.entities.ds.DeviceChannelB;
import pl.grzeslowski.jsupla.protocoljava.api.entities.ds.DeviceServerEntity;
import pl.grzeslowski.jsupla.protocoljava.api.entities.sc.ServerClientEntity;
import pl.grzeslowski.jsupla.protocoljava.api.entities.sd.FirmwareUpdateUrl;
import pl.grzeslowski.jsupla.protocoljava.api.entities.sd.ServerDeviceEntity;
import pl.grzeslowski.jsupla.protocoljava.api.entities.sdc.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.Serializer;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.TimevalSerializer;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.cs.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.dcs.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.ds.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.ds.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.ds.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.sc.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.sd.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.sd.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.serializers.sdc.<API key>;
import pl.grzeslowski.jsupla.protocoljava.api.types.Entity;
import javax.validation.constraints.NotNull;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
public class SerializerImpl implements Serializer<Entity, Proto> {
private final <API key><ClientServerEntity, ClientServer> <API key>;
private final <API key><<API key>, DeviceClientServer>
<API key>;
private final <API key><DeviceServerEntity, DeviceServer> <API key>;
private final <API key><ServerClientEntity, ServerClient> <API key>;
private final <API key><ServerDeviceEntity, ServerDevice> <API key>;
private final <API key><<API key>, ServerDeviceClient>
<API key>;
private final <API key> <API key>;
private final <API key> <API key>;
private final <API key> <API key>;
private final <API key> <API key>;
private final TimevalSerializer timevalSerializer;
public SerializerImpl(final <API key><ClientServerEntity, ClientServer> <API key>,
final <API key><<API key>, DeviceClientServer>
<API key>,
final <API key><DeviceServerEntity, DeviceServer> <API key>,
final <API key><ServerClientEntity, ServerClient> <API key>,
final <API key><ServerDeviceEntity, ServerDevice> <API key>,
final <API key><<API key>, ServerDeviceClient>
<API key>,
final <API key> <API key>,
final <API key> <API key>,
final <API key> <API key>,
final <API key> <API key>,
final TimevalSerializer timevalSerializer) {
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.<API key> = requireNonNull(<API key>);
this.timevalSerializer = requireNonNull(timevalSerializer);
}
@Override
public Proto serialize(@NotNull final Entity entity) {
if (entity instanceof ClientServerEntity) {
return <API key>.serialize((ClientServerEntity) entity);
} else if (entity instanceof <API key>) {
return <API key>.serialize((<API key>) entity);
} else if (entity instanceof DeviceServerEntity) {
return <API key>.serialize((DeviceServerEntity) entity);
} else if (entity instanceof ServerClientEntity) {
return <API key>.serialize((ServerClientEntity) entity);
} else if (entity instanceof ServerDeviceEntity) {
return <API key>.serialize((ServerDeviceEntity) entity);
} else if (entity instanceof <API key>) {
return <API key>.serialize((<API key>) entity);
}
return commonClasses(entity);
}
private Proto commonClasses(final Entity entity) {
if (entity instanceof DeviceChannelB) {
return <API key>.serialize((DeviceChannelB) entity);
} else if (entity instanceof DeviceChannel) {
return <API key>.serialize((DeviceChannel) entity);
} else if (entity instanceof FirmwareUpdateUrl) {
return <API key>.serialize((FirmwareUpdateUrl) entity);
} else if (entity instanceof ChannelValue) {
return <API key>.serialize((ChannelValue) entity);
} else if (entity instanceof Timeval) {
return timevalSerializer.serialize((Timeval) entity);
}
throw new <API key>(format("Don't know how to map this class \"%s\" to serializer! %s",
entity.getClass(), entity));
}
} |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M17.71 7.71L12 2h-1v7.59L6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 11 14.41V22h1l5.71-5.71-4.3-4.29 4.3-4.29zM13 5.83l1.88 1.88L13 9.59V5.83zm1.88 10.46L13 18.17v-3.76l1.88 1.88z" />
, 'BluetoothOutlined'); |
title: Box React component
# Box
<p class="description">Box компонент используется как обертка компонента для большинства CSS utility.</p>
The Box component packages [all the style functions](/system/basics/#all-inclusive) that are exposed in `@material-ui/system`. It's created using the [`styled()`](/styles/api/#<API key>) function of `@material-ui/styles`.
[The palette](/system/palette/) style function.
Box компонент оборачивает ваш компонент. Создает новый DOM элемент, `<div>` по умолчанию, но может быть изменен `component` свойством. Давайте предположим вы хотите использовать`<span>` взамен:
jsx
<Box component="span" m={1}>
<Button />
</Box>
Это работает превосходно когда изменения могут быть изолированы в новый DOM элемент. Для сущности, вы можете изменить margin(внешний отступ) таким образом.
Тем не менее, иногда вам нужно ориентироваться на базовый элемент DOM. Например, вы хотите изменить цвет текста кнопки. Компонент Button определяет свой собственный цвет. Наследование CSS не помогает. Чтобы обойти проблему, у вас есть два варианта:
1. Использовать [`React.cloneElement()`](https://reactjs.org/docs/react-api.html#cloneelement)
The Box component has a `clone` property to enable the usage of the clone element method of React.
jsx
<Box color="text.primary" clone>
<Button />
</Box>
2. Use render props
The Box children accepts a render props function. You can pull out the `className`.
jsx
<Box color="text.primary">
{props => <Button {...props} />}
</Box>
> The CSS specificity relies on the import order. If you want the guarantee that the wrapped component's style will be overridden, you need to import the Box last.
## API
jsx
import Box from '@material-ui/core/Box';
| Name | Type | Default | Description |
|:
| <span class="prop-name required">children *</span> | <span class="prop-type">union: node |<br /> func<br /></span> | | Box render function or node. |
| <span class="prop-name">clone</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the box will recycle its children DOM element. It's using `React.cloneElement` internally. |
| <span class="prop-name">component</span> | <span class="prop-type">union: string |<br /> func |<br /> object<br /></span> | <span class="prop-default">'div'</span> | The component used for the root node. Either a string to use a DOM element or a component. |
Any other properties supplied will be used by [the style functions](/system/basics/#all-inclusive) or spread to the root element. |
{% if th %}
<tr>
<th>Nível</th>
<th>Insumo</th>
<th>Cor</th>
<th>Tamanho</th>
<th>Reposição</th>
<th style="text-align: right;">Mínimo</th>
<th style="text-align: right;">Múltiplo</th>
<th style="text-align: right;">Estoque</th>
<th>Unid.</th>
<th style="text-align: right;">Necess.</th>
<th style="text-align: right;">Previsão</th>
<th style="text-align: right;">Receb.</th>
<th style="text-align: right;">Compra<br/>sugerida</th>
<th>Chegada</th>
<th style="text-align: right;">Excesso</th>
</tr>
{% else %}
{% if data %}
{% for row in data %}
<tr id="id_{{ nivel }}_{{ ref }}_{{ cor }}_{{ tam }}" class="key_ref _ref_{{ nivel }}{{ ref }}{{ cor }}{{ tam_order }}
{% if comprar > 0 %}flag_comprar
{% elif excesso > 0 and recebimentos > 0 %}flag_exc_com_receb
{% elif excesso > 0 and recebimentos == 0 %}flag_exc_sem_receb
{% elif comprar == 0 and excesso == 0 %}flag_zerado
{% endif %}
">
<td>{{ nivel }}</td>
<td><a href="{% url 'insumo:mapa' nivel ref cor tam %}" target="_blank">{{ row.REF }}<span class="glyphicon glyphicon-link" aria-hidden="true"></span></a></td>
<td>{{ row.COR }}</td>
<td>{{ row.TAM }}</td>
<td>{{ row.REP_STR }}</td>
<td style="text-align: right;">{{ row.STQ_MIN }}</td>
<td style="text-align: right;">{{ row.LOTE_MULTIPLO }}</td>
<td style="text-align: right;">{{ row.QUANT }}</td>
<td>{{ row.UNID }}</td>
<td style="text-align: right;">{{ necessidade }}</td>
<td style="text-align: right;">{{ previsao }}</td>
<td style="text-align: right;">{{ recebimentos }}</td>
<td style="text-align: right;">{{ comprar }}</td>
<td>{{ dt_chegada }}</td>
<td style="text-align: right;">{{ excesso }}</td>
</tr>
{% endfor %}
{% endif %}
{% endif %} |
import 'vs/css!./media/editorpicker';
import * as nls from 'vs/nls';
import { URI } from 'vs/base/common/uri';
import { <API key> } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { IAutoFocus, Mode, IEntryRunContext, <API key>, IModel } from 'vs/base/parts/quickopen/common/quickOpen';
import { QuickOpenModel, QuickOpenEntry, QuickOpenEntryGroup, <API key> } from 'vs/base/parts/quickopen/browser/quickOpenModel';
import { IModeService } from 'vs/editor/common/services/modeService';
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { IModelService } from 'vs/editor/common/services/modelService';
import { QuickOpenHandler } from 'vs/workbench/browser/quickopen';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { <API key>, IEditorGroup, EditorsOrder, GroupsOrder } from 'vs/workbench/services/group/common/editorGroupsService';
import { <API key> } from 'vs/platform/instantiation/common/instantiation';
import { EditorInput, toResource } from 'vs/workbench/common/editor';
import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer';
import { CancellationToken } from 'vs/base/common/cancellation';
export class EditorPickerEntry extends QuickOpenEntryGroup {
constructor(
private editor: EditorInput,
private _group: IEditorGroup,
@IModeService private modeService: IModeService,
@IModelService private modelService: IModelService
) {
super();
}
getLabelOptions(): <API key> {
return {
extraClasses: getIconClasses(this.modelService, this.modeService, this.getResource()),
italic: !this._group.isPinned(this.editor)
};
}
getLabel(): string {
return this.editor.getName();
}
getIcon(): string {
return this.editor.isDirty() ? 'dirty' : '';
}
get group(): IEditorGroup {
return this._group;
}
getResource(): URI {
return toResource(this.editor, { supportSideBySide: true });
}
getAriaLabel(): string {
return nls.localize('entryAriaLabel', "{0}, editor group picker", this.getLabel());
}
getDescription(): string {
return this.editor.getDescription();
}
run(mode: Mode, context: IEntryRunContext): boolean {
if (mode === Mode.OPEN) {
return this.runOpen(context);
}
return super.run(mode, context);
}
private runOpen(context: IEntryRunContext): boolean {
this._group.openEditor(this.editor);
return true;
}
}
export abstract class BaseEditorPicker extends QuickOpenHandler {
private scorerCache: ScorerCache;
constructor(
@<API key> protected <API key>: <API key>,
@IEditorService protected editorService: IEditorService,
@<API key> protected editorGroupService: <API key>
) {
super();
this.scorerCache = Object.create(null);
}
getResults(searchValue: string, <API key>): Thenable<QuickOpenModel> {
const editorEntries = this.getEditorEntries();
if (!editorEntries.length) {
return Promise.resolve(null);
}
// Prepare search for scoring
const query = prepareQuery(searchValue);
const entries = editorEntries.filter(e => {
if (!query.value) {
return true;
}
const itemScore = scoreItem(e, query, true, <API key>, this.scorerCache);
if (!itemScore.score) {
return false;
}
e.setHighlights(itemScore.labelMatch, itemScore.descriptionMatch);
return true;
});
// Sorting
if (query.value) {
const groups = this.editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE);
entries.sort((e1, e2) => {
if (e1.group !== e2.group) {
return groups.indexOf(e1.group) - groups.indexOf(e2.group); // older groups first
}
return compareItemsByScore(e1, e2, query, true, <API key>, this.scorerCache);
});
}
// Grouping (for more than one group)
if (this.editorGroupService.count > 1) {
let lastGroup: IEditorGroup;
entries.forEach(e => {
if (!lastGroup || lastGroup !== e.group) {
e.setGroupLabel(e.group.label);
e.setShowBorder(!!lastGroup);
lastGroup = e.group;
}
});
}
return Promise.resolve(new QuickOpenModel(entries));
}
onClose(canceled: boolean): void {
this.scorerCache = Object.create(null);
}
protected abstract getEditorEntries(): EditorPickerEntry[];
}
export class <API key> extends BaseEditorPicker {
static readonly ID = 'workbench.picker.activeEditors';
protected getEditorEntries(): EditorPickerEntry[] {
return this.group.getEditors(EditorsOrder.<API key>).map((editor, index) => this.<API key>.createInstance(EditorPickerEntry, editor, this.group));
}
private get group(): IEditorGroup {
return this.editorGroupService.activeGroup;
}
getEmptyLabel(searchString: string): string {
if (searchString) {
return nls.localize('<API key>', "No matching opened editor found in group");
}
return nls.localize('noOpenedEditors', "List of opened editors is currently empty in group");
}
getAutoFocus(searchValue: string, context: { model: IModel<QuickOpenEntry>, <API key>?: <API key> }): IAutoFocus {
if (searchValue || !context.<API key>) {
return {
autoFocusFirstEntry: true
};
}
const isShiftNavigate = (context.<API key> && context.<API key>.keybindings.some(k => {
const [firstPart, chordPart] = k.getParts();
if (chordPart) {
return false;
}
return firstPart.shiftKey;
}));
if (isShiftNavigate) {
return {
autoFocusLastEntry: true
};
}
const editors = this.group.count;
return {
autoFocusFirstEntry: editors === 1,
<API key>: editors > 1
};
}
}
export class AllEditorsPicker extends BaseEditorPicker {
static readonly ID = 'workbench.picker.editors';
protected getEditorEntries(): EditorPickerEntry[] {
const entries: EditorPickerEntry[] = [];
this.editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE).forEach(group => {
group.editors.forEach(editor => {
entries.push(this.<API key>.createInstance(EditorPickerEntry, editor, group));
});
});
return entries;
}
getEmptyLabel(searchString: string): string {
if (searchString) {
return nls.localize('noResultsFound', "No matching opened editor found");
}
return nls.localize('<API key>', "List of opened editors is currently empty");
}
getAutoFocus(searchValue: string, context: { model: IModel<QuickOpenEntry>, <API key>?: <API key> }): IAutoFocus {
if (searchValue) {
return {
autoFocusFirstEntry: true
};
}
return super.getAutoFocus(searchValue, context);
}
} |
## About
Testing Meteor code is very slow when using the built-in `meteor test` command.
These stubs will help you get rid of the dependencies which are not present in
your project's `node_modules` directory. Use the setup below which does most of
the actual magic. :)
## Installation
`npm i -D jest-meteor-stubs` or `yarn add -D jest-meteor-stubs`
## How it works
Jest preprocesses the files to be executed through the test runner. When pulling
in dependencies, i.e. using `require` (in ES6 `import`), similar to the default
behavior of Node.js, the resolver will look for them in a local directory named
`node_modules`. However, Meteor injects additional modules when running `meteor`
instead of plain Node.js, which do not reside in this directory. Jest allows you
to overcome this issue by providing additional locations where the load should
look for modules.
## Usage
Add this module's `lib/` directory to the `modulePaths` in your Jest config.
For Meteor packages, you will need to use `moduleNameMapper` to rewrite the
module names to use `_` instead of `:` for the namespaces as `:` is not allowed
by some file/operating systems.
The configuration has to be in `jest.config.js` in Jest 20 because of
[a bug in the mapper](https://github.com/facebook/jest/issues/3716).
Here is a working example:
javascript
module.exports = {
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
<API key>: [
'js',
'jsx',
],
modulePaths: [
'<rootDir>/node_modules/',
'<rootDir>/node_modules/jest-meteor-stubs/lib/',
],
moduleNameMapper: {
'^(.*):(.*)$': '$1_$2',
},
<API key>: [
'/^imports\\/.*\\.jsx?$/',
'/^node_modules/',
],
};
## Examples
Please see [this demo](https://github.com/orangecms/jest-meteor-demo)
for a small example. :) |
# Custom mapper sample for CodeMap plugin
# This script defines a mandatory `def generate(file)` and module attribute map_syntax:
# - `def generate(file)`
# The routine analyses the file content and produces the 'code map' representing the content structure.
# In this case it builds the list of sections (lines that start with `#` character) in the py file.
# - `map_syntax`
# Optional attribute that defines syntax highlight to be used for the code map text
# The map format: <item title>:<item position in source code>
# You may need to restart Sublime Text to reload the mapper
import codecs
import sublime
try:
installed = sublime.load_settings('Package Control.sublime-settings').get('installed_packages')
except:
installed = []
# `map_syntax` is a syntax highlighting that will be applied to CodeMap at runtime
# you can set it to the custom or built-in language definitions
if 'TypeScript' in installed:
map_syntax = 'Packages/TypeScript/TypeScript.tmLanguage'
else:
# fallback as TypeScript is not installed
map_syntax = 'Packages/Python/Python.tmLanguage'
def generate(file):
return ts_mapper.generate(file)
class ts_mapper():
def generate(file):
def str_of(count, char):
text = ''
for i in range(count):
text = text + char
return text
# Pasrse
item_max_length = 0
members = []
try:
with codecs.open(file, "r", encoding='utf8') as f:
lines = f.read().split('\n')
line_num = 0
last_type = ''
last_indent = 0
for line in lines:
line = line.replace('\t', ' ')
line_num = line_num + 1
code_line = line.lstrip()
info = None
indent_level = len(line) - len(code_line);
def parse_as_class(keyword, line):
if code_line.startswith(keyword+' ') or code_line.startswith('export '+keyword+' ') :
last_type = keyword
last_indent = indent_level
if code_line.startswith('export '+keyword+' '):
line = line.replace('export '+keyword+' ', keyword+' ')
display_line = line.rpartition('implements')[0]
if not display_line:
display_line = line.rpartition('{')[0]
if not display_line:
display_line = line.rstrip()
# class <API key> implements HoverProvider {
info = (line_num,
keyword,
display_line.split('(')[0].split(':')[0].rstrip()+' {}', # suffix brackets make it valid TS syntax
indent_level)
return info
# miss C# here :)
# info = parse_as_class('class', line) ??
# parse_as_class('interface', line) ??
# parse_as_class('whatever', line)
info = parse_as_class('class', line)
if not info:
info = parse_as_class('interface', line)
if info:
pass
elif code_line.startswith('function ') or code_line.startswith('export function ') :
if last_type == 'function' and indent_level > last_indent:
continue # private class functions
last_type = 'function'
last_indent = indent_level
info = (line_num,
'function',
line.split('(')[0].rstrip()+'()',
indent_level)
elif code_line.startswith('public '):
last_type = 'public '
last_indent = indent_level
info = (line_num,
'public ',
line.replace('public ', '').split('(')[0].rstrip()+'()',
indent_level)
if info:
length = len(info[2])
if item_max_length < length:
item_max_length = length
members.append(info)
except Exception as err:
print ('CodeMap-py:', err)
members.clear()
# format
map = ''
last_indent = 0
last_type = ''
for line, content_type, content, indent in members:
extra_line = ''
if indent == last_indent:
if content_type != last_type:
extra_line = '\n'
elif content_type == 'class' or content_type == 'interface':
extra_line = '\n'
preffix = str_of(indent, ' ')
lean_content = content[indent:]
suffix = str_of(item_max_length-len(content), ' ')
map = map + extra_line + preffix + lean_content + suffix +' :'+str(line) +'\n'
last_indent = indent
last_type = content_type
# print(map)
return map |
namespace SocialNetwork.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
public class User
{
private ICollection<Image> images;
private ICollection<Post> posts;
public User()
{
this.images = new HashSet<Image>();
this.posts = new HashSet<Post>();
}
public int UserId { get; set; }
[Required]
[MaxLength(20)]
[Index(IsUnique = true)]
public string Username { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime RegistrationDate { get; set; }
public virtual ICollection<Image> Images
{
get { return images; }
set { images = value; }
}
public virtual ICollection<Post> Posts
{
get { return posts; }
set { posts = value; }
}
}
} |
# Makefile for the decluniupptrait module of the Blaze test suite
# This file is part of the Blaze library. You can redistribute it and/or modify it under
# forms, with or without modification, are permitted provided that the following conditions
# are met:
# provided with the distribution.
# 3. Neither the names of the Blaze development group nor the names of its contributors
# may be used to endorse or promote products derived from this software without specific
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
# Including the compiler and library settings
ifneq ($(MAKECMDGOALS),reset)
ifneq ($(MAKECMDGOALS),clean)
-include ../../../Makeconfig
endif
endif
# Setting the source, object and dependency files |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/css/css_compiled/<API key>.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/<API key>.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="<API key>">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.<API key>').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.<API key>').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="<API key>">
<div class="form-window-login">
<div class="<API key>">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/bootstrap/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="farbtastic.js.html#">Sign Up »</a>
<a href="farbtastic.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="farbtastic.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/css/css_compiled/<API key>.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/<API key>.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="<API key>">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.<API key>').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.<API key>').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="<API key>">
<div class="form-window-login">
<div class="<API key>">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/images/photon/plugins/elrte/js/plugins/prettify/js/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="jquery.flot.js.html#">Sign Up »</a>
<a href="jquery.flot.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="jquery.flot.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html> |
(function() {
'use strict';
angular
.module('app.directives')
.directive('ccWidgetHeader', ccWidgetHeader);
/* @ngInject */
function ccWidgetHeader () {
//Usage:
//<div <API key> title="vm.map.title"></div>
// Creates:
// <div <API key>=""
// title="Avengers Movie"
// allow-collapse="true" </div>
var directive = {
// link: link,
scope: {
'title': '@',
'subtitle': '@',
'rightText': '@',
'allowCollapse': '@'
},
templateUrl: 'scripts/directives/ccwidgetheader/ccwidgetheader.html',
restrict: 'A'
};
return directive;
// function link(scope, element, attrs) {
// attrs.$set('class', 'widget-head');
}
})(); |
# -*- coding: utf-8 -*-
from .exceptions import ResultNotReady
from json.encoder import JSONEncoder
from functools import wraps
__all__ = [
'Future',
'IS',
'ISINSTANCE'
]
def IS(instance, other): # noqa
"""
Support the `future is other` use-case.
Can't override the language so we built a function.
Will work on non-future objects too.
:param instance: future or any python object
:param other: object to compare.
:return:
"""
try:
instance = instance.<API key> # noqa
except AttributeError:
pass
try:
other = other.<API key>
except AttributeError:
pass
return instance is other
def ISINSTANCE(instance, A_tuple): # noqa
"""
Allows you to do isinstance checks on futures.
Really, I discourage this because duck-typing is usually better.
But this can provide you with a way to use isinstance with futures.
Works with other objects too.
:param instance:
:param A_tuple:
:return:
"""
try:
instance = instance.<API key>
except AttributeError:
pass
return isinstance(instance, A_tuple)
class Future(object):
"""
An object returned from all our Pipeline calls.
"""
__slots__ = ['_result']
def set(self, data):
"""
Write the data into the object.
Note that I intentionally did not declare `result` in
the constructor.
I want an error to happen if you try to access it
before it is set.
:param data: any python object
:return: None
"""
self._result = data
@property
def result(self):
"""
Get the underlying result.
Usually one of the data types returned by redis-py.
:return: None, str, int, list, set, dict
"""
try:
return self._result
except AttributeError:
pass
raise ResultNotReady('Wait until after the pipeline executes.')
def IS(self, other):
"""
Allows you to do identity comparisons on the underlying object.
:param other: Mixed
:return: bool
"""
return self.result is other
def isinstance(self, other):
"""
allows you to check the instance type of the underlying result.
:param other:
:return:
"""
return isinstance(self.result, other)
def id(self):
"""
Get the object id of the underlying result.
"""
return id(self.result)
def __repr__(self):
"""
Magic method in python used to override the behavor of repr(future)
:return: str
"""
try:
return repr(self.result)
except ResultNotReady:
return repr(None)
def __str__(self):
"""
Magic method in python used to override the behavor of str(future)
:return:
"""
return str(self.result)
def __lt__(self, other):
"""
Magic method in python used to override the behavor of future < other
:param other: Any python object, usually numeric
:return: bool
"""
return self.result < other
def __le__(self, other):
"""
Magic method in python used to override the behavor of future <= other
:param other: Any python object, usually numeric
:return: bool
"""
return self.result <= other
def __gt__(self, other):
"""
Magic method in python used to override the behavor of future > other
:param other: Any python object, usually numeric
:return: bool
"""
return self.result > other
def __ge__(self, other):
"""
Magic method in python used to override the behavor of future >= other
:param other: Any python object, usually numeric
:return: bool
"""
return self.result >= other
def __hash__(self):
"""
Magic method in python used to override the behavor of hash(future)
:return: int
"""
return hash(self.result)
def __eq__(self, other):
"""
Magic method in python used to override the behavor of future == other
:param other: Any python object
:return: bool
"""
return self.result == other
def __ne__(self, other):
"""
Magic method in python used to override the behavor of future != other
:param other: Any python object
:return: bool
"""
return self.result != other
def __nonzero__(self):
"""
Magic method in python used to override the behavor of bool(future)
:return: bool
"""
return bool(self.result)
def __bytes__(self):
"""
Magic method in python used to coerce object: bytes(future)
:return: bytes
"""
return bytes(self.result)
def __bool__(self):
"""
Magic method in python used to coerce object: bool(future)
:return: bool
"""
return bool(self.result)
def __call__(self, *args, **kwargs):
"""
Magic method in python used to invoke a future:
future(*args, **kwargs)
:param args: tuple
:param kwargs: dict
:return: Unknown, defined by object
"""
return self.result(*args, **kwargs)
def __len__(self):
"""
Magic method in python used to determine length: len(future)
:return: int
"""
return len(self.result)
def __iter__(self):
"""
Magic method in python to support iteration.
Example:
.. code-block:: python
future = Future()
future.set([1, 2, 3])
for row in future:
print(row)
:return: iterable generator
"""
for item in self.result:
yield item
def __contains__(self, item):
"""
Magic python method supporting: `item in future`
:param item: any python object
:return: bool
"""
return item in self.result
def __reversed__(self):
"""
Magic python method to emulate: reversed(future)
:return: list
"""
return reversed(self.result)
def __getitem__(self, item):
"""
Used to emulate dictionary access of an element: future[key]
:param item: usually str, key name of dict.
:return: element, type unknown
"""
return self.result[item]
def __int__(self):
"""
Magic method in python to coerce to int: int(future)
:return:
"""
return int(self.result)
def __float__(self):
"""
Magic method in python to coerce to float: float(future)
:return: float
"""
return float(self.result)
def __round__(self, ndigits=0):
"""
Magic method in python to round: round(future, 1)
:param ndigits: int
:return: float, int
"""
return round(self.result, ndigits=ndigits)
def __add__(self, other):
"""
support addition: result = future + 1
:param other: int, float, str, list
:return: int, float, str, list
"""
return self.result + other
def __sub__(self, other):
"""
support subtraction: result = future - 1
:param other: int, float, str, list
:return: int, float, str, list
"""
return self.result - other
def __mul__(self, other):
"""
support multiplication: result = future * 2
:param other: int, float, str, list
:return: int, float, str, list
"""
return self.result * other
def __mod__(self, other):
"""
support modulo: result = future % 2
:param other: int, float, str, list
:return: int, float, str, list
"""
return self.result % other
def __div__(self, other):
"""
support division: result = future / 2
for python 2
:param other: int, float
:return: int, float
"""
return self.result / other
def __truediv__(self, other):
"""
support division: result = future / 2
for python 3
:param other: int, float
:return: int, float
"""
return self.result / other
def __floordiv__(self, other):
"""
support floor division: result = future // 2
:param other: int, float
:return: int, float
"""
return self.result // other
def __pow__(self, power, modulo=None):
"""
supports raising to a power: result = pow(future, 3)
:param power: int
:param modulo:
:return: int, float
"""
return pow(self.result, power, modulo)
def __lshift__(self, other):
"""
bitwise operation: result = future << other
"""
return self.result << other
def __rshift__(self, other):
"""
bitwise operation: result = future >> other
"""
return self.result >> other
def __and__(self, other):
"""
bitwise operation: result = future & other
"""
return self.result & other
def __xor__(self, other):
"""
bitwise operation: result = future ^ other
"""
return self.result ^ other
def __or__(self, other):
"""
bitwise operation: result = future | other
"""
return self.result | other
def __radd__(self, other):
"""
addition operation: result = other + future
"""
return other + self.result
def __rsub__(self, other):
"""
subtraction operation: result = other - future
"""
return other - self.result
def __rmul__(self, other):
"""
multiplication operation: result = other * future
"""
return self.result * other
def __rmod__(self, other):
"""
use as modulo: result = other * future
"""
return other % self.result
def __rdiv__(self, other):
"""
use as divisor: result = other / future
python 2
"""
return other / self.result
def __rtruediv__(self, other):
"""
use as divisor: result = other / future
python 3
"""
return other / self.result
def __rfloordiv__(self, other):
"""
floor divisor: result other // future
"""
return other // self.result
def __rpow__(self, other):
"""
reverse power: other ** future
"""
return other ** self.result
def __rlshift__(self, other):
"""
result = other << future
"""
return other << self.result
def __rrshift__(self, other):
"""
result = other >> future
"""
return other >> self.result
def __rand__(self, other):
"""
result = other & future
"""
return other & self.result
def __rxor__(self, other):
"""
result = other ^ future
"""
return other ^ self.result
def __ror__(self, other):
"""
result = other | future
"""
return other | self.result
def __getattr__(self, name, default=None):
"""
access an attribute of the future: future.some_attribute
or getattr(future, name, default)
:param name: attribute name
:param default: a value to be used if no attribute is found
:return:
"""
if name[0] == '_':
raise AttributeError(name)
return getattr(self.result, name, default)
def __getstate__(self):
"""
used for getting object state to serialize when pickling
:return: object
"""
return {'result': self.result}
def __setstate__(self, state):
"""
used for restoring object state when pickling
:param state: object
:return: None
"""
self._result = state['result']
# this helps with duck-typing.
# when grabbing the property for json encoder,
# we can look for this unique attribute which is an alias for result
# and we can be reasonably sure it is not accidentally grabbing
# some other type of object.
<API key> = result
def <API key>(func):
"""
Monkey-Patch the core json encoder library.
This isn't as bad as it sounds.
We override the default method so that if an object
falls through and can't be encoded normally, we see if it is
a Future object and return the result to be encoded.
I set a special attribute on the Future object so I can tell
that's what it is, and can grab the result.
If that doesn't work, I fall back to the earlier behavior.
The nice thing about patching the library this way is that it
won't inerfere with existing code and it can itself be wrapped
by other methods.
So it's very extensible.
:param func: the JSONEncoder.default method.
:return: an object that can be json serialized.
"""
@wraps(func)
def inner(self, o):
try:
return o.<API key> # noqa
except AttributeError:
pass
return func(self, o)
return inner
JSONEncoder.default = <API key>(JSONEncoder.default) |
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var users = require('./routes/users');
var events = require('./routes/events');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
//enable CORS
app.use(function (req, res, next) {
res.setHeader('<API key>', '*');
res.setHeader('<API key>', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('<API key>', 'X-Requested-With,content-type');
res.setHeader('<API key>', true);
next();
});
app.use('/', index);
app.use('/users', users);
app.use('/events', events);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
//app.listen(3000, () => console.log("Listening to Port 3000"));
module.exports = app; |
#!/bin/bash
# $Id: makedoc.sh,v 1.2 2007-12-10 01:11:19 ashnazg Exp $
# should be edited
#/**
# * title of generated documentation, default is 'Generated Documentation'
# *
# * @var string TITLE
# */
TITLE="logspy Documentation"
#/**
# * name to use for the default package. If not specified, uses 'default'
# *
# * @var string PACKAGES
# */
PACKAGES="logspy"
#/**
# * name of a directory(s) to parse directory1,directory2
# * $PWD is the directory where makedoc.sh
# *
# * @var string PATH_PROJECT
# */
PATH_PROJECT=$PWD/src
#/**
# * path of PHPDoc executable
# *
# * @var string PATH_PHPDOC
# */
PATH_PHPDOC=phpdoc
#/**
# * where documentation will be put
# *
# * @var string PATH_DOCS
# */
PATH_DOCS=$PWD/docs
#/**
# * what outputformat to use (html/pdf)
# *
# * @var string OUTPUTFORMAT
# */
OUTPUTFORMAT=HTML
#/**
# * converter to be used
# *
# * @var string CONVERTER
# */
CONVERTER=Frames
#/**
# * template to use
# *
# * @var string TEMPLATE
# */
TEMPLATE=default
#/**
# * parse elements marked as private
# *
# * @var bool (on/off) PRIVATE
# */
PRIVATE=off
# delete previous documentation
rm -rf "$PATH_DOCS"
# make documentation
"$PATH_PHPDOC" -d "$PATH_PROJECT" -t "$PATH_DOCS" -ti "$TITLE" -dn $PACKAGES \
-o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE
# vim: set expandtab : |
UPDATE validation_options
SET text = 'notsure'
WHERE text = 'unclear';
-- For users who validated the same label multiple times, remove all but the newest validation.
DELETE
FROM label_validation val_a
USING label_validation val_b
WHERE val_a.label_id = val_b.label_id
AND val_a.user_id = val_b.user_id
AND val_a.end_timestamp < val_b.end_timestamp;
-- Add validation count columns to the label table.
ALTER TABLE label
ADD COLUMN agree_count INTEGER NOT NULL DEFAULT 0,
ADD COLUMN disagree_count INTEGER NOT NULL DEFAULT 0,
ADD COLUMN notsure_count INTEGER NOT NULL DEFAULT 0,
ADD COLUMN correct BOOLEAN;
-- Populate table with current validation info.
UPDATE label
SET (agree_count, disagree_count, notsure_count, correct) = (n_agree, n_disagree, n_notsure, is_correct)
FROM (
SELECT label.label_id,
COUNT(CASE WHEN validation_result = 1 THEN 1 END) AS n_agree,
COUNT(CASE WHEN validation_result = 2 THEN 1 END) AS n_disagree,
COUNT(CASE WHEN validation_result = 3 THEN 1 END) AS n_notsure,
CASE
WHEN COUNT(CASE WHEN validation_result = 1 THEN 1 END) > COUNT(CASE WHEN validation_result = 2 THEN 1 END) THEN TRUE
WHEN COUNT(CASE WHEN validation_result = 2 THEN 1 END) > COUNT(CASE WHEN validation_result = 1 THEN 1 END) THEN FALSE
ELSE NULL
END AS is_correct
FROM mission
INNER JOIN label ON mission.mission_id = label.mission_id
INNER JOIN label_validation
ON label.label_id = label_validation.label_id AND mission.user_id <> label_validation.user_id
GROUP BY label.label_id
) AS validation_count
WHERE label.label_id = validation_count.label_id;
TRUNCATE TABLE <API key> CASCADE;
TRUNCATE TABLE <API key> CASCADE;
ALTER TABLE global_attribute
ADD COLUMN street_edge_id INTEGER NOT NULL DEFAULT -1;
ALTER TABLE global_attribute DROP COLUMN street_edge_id;
ALTER TABLE label
DROP COLUMN correct,
DROP COLUMN notsure_count,
DROP COLUMN disagree_count,
DROP COLUMN agree_count;
UPDATE validation_options
SET text = 'unclear'
WHERE text = 'notsure'; |
package cz.crcs.ectester.common.test;
import java.util.function.Function;
/**
* @param <T>
* @author Jan Jancar johny@neuromancer.sk
*/
public abstract class TestCallback<T extends Testable> implements Function<T, Result> {
} |
import {Injectable, Inject, Optional} from '@angular/core';
import {DOCUMENT} from '@angular/common';
const DEGREE_IN_RADIANS: number = Math.PI / 180;
@Injectable({providedIn: 'root'})
export class <API key> {
private base: HTMLBaseElement;
private hasPerf: boolean;
public supportsSvg: boolean;
constructor(@Optional() @Inject(DOCUMENT) document: any) {
this.supportsSvg = !!(
document &&
document.createElementNS &&
document.createElementNS('http:
);
this.base = document && document.head.querySelector('base');
this.hasPerf =
typeof window !== 'undefined' &&
window.performance &&
window.performance.now &&
typeof window.performance.now() === 'number';
}
/**
* Resolves a SVG color against the page's `base` tag.
*/
resolveColor(color: string): string {
if (this.base && this.base.href) {
const hashIndex = color.indexOf('
if (hashIndex > -1 && color.indexOf('url') > -1) {
return color.slice(0, hashIndex) + location.href + color.slice(hashIndex);
}
}
return color;
}
/**
* Generates a timestamp.
*/
getTimestamp(): number {
return this.hasPerf ? window.performance.now() : Date.now();
}
/**
* Generates the value for an SVG arc.
* @param current Current value.
* @param total Maximum value.
* @param pathRadius Radius of the SVG path.
* @param elementRadius Radius of the SVG container.
* @param isSemicircle Whether the element should be a semicircle.
*/
getArc(current: number, total: number, pathRadius: number, elementRadius: number, isSemicircle = false): string {
const value = Math.max(0, Math.min(current || 0, total));
const maxAngle = isSemicircle ? 180 : 359.9999;
const percentage = total === 0 ? maxAngle : (value / total) * maxAngle;
const start = this._polarToCartesian(elementRadius, pathRadius, percentage);
const end = this._polarToCartesian(elementRadius, pathRadius, 0);
const arcSweep = percentage <= 180 ? 0 : 1;
return `M ${start} A ${pathRadius} ${pathRadius} 0 ${arcSweep} 0 ${end}`;
}
/**
* Converts polar cooradinates to Cartesian.
* @param elementRadius Radius of the wrapper element.
* @param pathRadius Radius of the path being described.
* @param angleInDegrees Degree to be converted.
*/
private _polarToCartesian(elementRadius: number, pathRadius: number, angleInDegrees: number): string {
const angleInRadians = (angleInDegrees - 90) * DEGREE_IN_RADIANS;
const x = elementRadius + pathRadius * Math.cos(angleInRadians);
const y = elementRadius + pathRadius * Math.sin(angleInRadians);
return x + ' ' + y;
}
} |
# choco/ui.py
# This module is part of Choco and is released under
import re
import os
import posixpath
from choco import errors
from choco import util
from choco.runtime import _kwargs_for_include
class UIModule(object):
default_template = ""
def __init__(self, context, template=None):
self.lookup = context.lookup
self.ui_container = self.lookup.ui_container
self.context = context
self.template = template or self.default_template
self.initialize()
def initialize(self):
pass
def get(self, key, default=None):
"""get parent context local data by key"""
return self.context.get(key, default)
def _execute(self, *args, **kw):
"""execute the template"""
data = self.render(*args, **kw)
t = self.get_template()
return t.render_ui(self.context, *args, **data)
def get_template(self):
return self.ui_container.get_template(self.template)
def render(self, *args, **kw):
"""Entry point and logic section for custom appliction actions"""
raise NotImplemented()
class UIContainer(object):
def __init__(self, ui_paths, uis=None):
"""Init ui container,
param ui_paths: the ui template paths.
param uis: the dict like object, contains the ui module classes.
"""
self.ui_paths = [posixpath.normpath(d) for d in
util.to_list(ui_paths, ())
]
self.uis = uis or dict()
def put_ui(self, ui_name, uicls):
self.uis[ui_name] = uicls
def get_ui(self, ui_name):
uicls = self.uis.get(ui_name)
if uicls is None:
raise errors.UINotFoundException("Cant's find ui for %s" % ui_name)
return uicls
def set_lookup(self, lookup):
"""Set up template lookup"""
self.lookup = lookup
def get_template(self, uri):
"""Return a :class:`.Template` object corresponding to the given
``uri``.
.. note:: The ``relativeto`` argument is not supported here at
the moment.
"""
# the spefical ui uri with prefix "url://"
uiuri = "ui#" + uri
try:
if self.lookup.filesystem_checks:
return self.lookup.check(uiuri, self.lookup.collection[uiuri])
else:
return self.lookup.collection[uiuri]
except KeyError:
u = re.sub(r'^\/+', '', uri)
for dir in self.ui_paths:
# make sure the path seperators are posix - os.altsep is empty
# on POSIX and cannot be used.
dir = dir.replace(os.path.sep, posixpath.sep)
srcfile = posixpath.normpath(posixpath.join(dir, u))
if os.path.isfile(srcfile):
return self.lookup.load(srcfile, uiuri)
else:
raise errors.<API key>(
"Cant locate ui template for uri %r" % uiuri) |
# <API key>
Same as [action-cable-react](https://github.com/schneidmaster/action-cable-react), but allows authenticating websockets using JWTs
## Installation
Yarn:
javascript
yarn add <API key>
npm:
javascript
npm install <API key>
## Usage
Import <API key>
javascript
import ActionCable from '<API key>.js';
// if you don't use ES6 then use
// const ActionCable = require('<API key>.js');
Creating an actioncable websocket
javascript
let App = {};
App.cable = ActionCable.createConsumer("ws://cable.example.com", jwt) // place your jwt here
// you shall also use this.cable = ActionCable.createConsumer(...)
// to create the connection as soon as the view loads, place this in componentDidMount
Subscribing to a Channel for Receiving data
javascript
this.subscription = App.cable.subscriptions.create({channel: "YourChannel"}, {
connected: function() { console.log("cable: connected") }, // onConnect
disconnected: function() { console.log("cable: disconnected") }, // onDisconnect
received: (data) => { console.log("cable received: ", data); } // OnReceive
}
Send data to a channel
javascript
this.subscription.send('hello world')
Call a method on channel with arguments
javascript
this.subscription.perform('method_name', arguments)
In your `ApplicationCable::Connection` class in Ruby add
ruby
# app/channels/application_cable/connection.rb
module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
def connect
self.current_user = find_verified_user
end
private
def find_verified_user
begin
header_array = request.headers[:<API key>].split(',')
token = header_array[header_array.length-1]
decoded_token = JWT.decode token.strip, Rails.application.secrets.secret_key_base, true, { :algorithm => 'HS256' }
if (current_user = User.find((decoded_token[0])['sub']))
current_user
else
reject_un<API key>
end
rescue
reject_un<API key>
end
end
end
end
And in YourChannel.rb
ruby
# app/channels/you_channel.rb
class LocationChannel < ApplicationCable::Channel
# calls connect in client
def subscribed
stream_from 'location_user_' + current_user.id.to_s
end
# calls disconnect in client
def unsubscribed
# Any cleanup needed when channel is unsubscribed
end
# called when send is called in client
def receive(params)
print params[:data]
end
# called when perform is called in client
def method_name(params)
print params[:data]
end
end
Remove a subscription from cable
javascript
App.cable.subscriptions.remove(this.subscription)
// Place this in <API key> to remove subscription on exiting app
Add a subscription to cable
javascript
App.cable.subscriptions.add(this.subscription)
Querying url and jwt from cable
javascript
console.log(App.cable.jwt);
console.log(App.cable.url);
Querying subscriptions and connection from cable
javascript
console.log(App.cable.subscriptions);
console.log(App.cable.connection);
MIT
Copyright (c) 2017 Zeke
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
package testing;
public interface Tester {
void test ();
} |
layout: post
title: Overhead Imagery Datasets for Object Detection
description: "A chart with detailed information about overhead imagery datasets for object detection"
feature-img: "assets/img/rainbow.jpg"
thumbnail: "assets/img/gosse_bluff.jpg"
tags: [Geospatial Analytics]
This post provides a summary of some of the most important overhead imagery datasets for object detection. The aim of this post is to be a living document where I continue to add new datasets as they are released.
<b>Table of contents</b>
* TOC
{:toc}
# Overhead Imagery Datasets Overview
|Dataset Name | Total Number of Objects | Number of Images | Number of Categories | Image Size | Resolution | Annotation Type | Source | Year Released| Restrictions
|
|[DIOR](http:
|[DOTA](https://captain-whu.github.io/DOTA/dataset.html) | 188,282 | 2,806 | 15 | 387 X 455 - 4096 X 7168 | mostly 20-40cm (see below) | Rotated and Horizontal Bounding Boxes | Google Earth (mostly) and satellites | 2018 | Academic purposes only; any commercial use is prohibited
|[XVIEW](http://xviewdataset.org/) | 1,000,000+ | TBD | 60 | large | 30 cm | Horizontal Bounding Boxes | WorldView-3 satellites | 2018 | Non-commercial use
|[NWPU VHR-10](http:
|[COWC](https://gdo152.llnl.gov/cowc/) | 32,716 | TBD | 1 (cars) | large | 15 cm | Center Points | TBD | 2016 | None
# Descriptions
## DIOR
DIOR is a huge dataset with ten times the number of images as DOTA, although a similar number of objects. It is the most recent dataset on the list.
# Academic paper
[Object detection in optical remote sensing images: A survey and a new benchmark](https:
# Categories
Airplane, Airport, Baseball field, Basketball court, Bridge, Chimney, Dam, Expressway service area, Expressway toll station, Harbor, Golf course, Ground track field, Overpass, Ship, Stadium, Storage tank, Tennis court, Train station, Vehicle, and Windmill
## DOTA
DOTA is a large dataset that combines aerial and satellite imagery. It combines different sensors and platforms.
# Academic paper
[DOTA: A Large-scale Dataset for Object Detection in Aerial Images](https://arxiv.org/abs/1711.10398)
# Categories
(abbreviations used on leaderboard are shown in parentheses)
Plane, Ship, Storage Tank (ST), Baseball Diamond (BD), Tennis Court (TC), Basketball Court (BC), Ground Track Field (GTF), Harbor, Bridge, Large Vehicle (LV), Small Vehicle (SV), Helicopter (HC), Roundabout (RA), Soccer Ball Field (SBF), Basketball Court
# Leaderboard
[DOTA Leaderboard](https://captain-whu.github.io/DOTA/results.html)
# GSD Distribution
Here are histograms and boxplots of the ground sample distance for images in the dataset (when provided). Outliers have been excluded from the box plot for clarity.




## xView
The xView dataset contains over 1 million objects across 60 classes covering over 1,400 km^2. Objects in xView vary in size from 3 meters (10 pixels) to greater than 3,000 meters (10,000 pixels).
# Academic paper
[xView: Objects in Context in Overhead Imagery](https://arxiv.org/abs/1802.07856)
# Categories
They use ontological labels, which I like. Although for datasets that don't, this same idea could be done after the fact.
Aircraft Hangar, Barge, Building, Bus, Cargo Truck, Cargo/container Car, Cement Mixer, Construction Site, Container Crane, Container Ship, Crane Truck, Damaged/demolished Building, Dump Truck, Engineering Vehicle, Excavator, Facility, Ferry, Fishing Vessel, Fixed-wing Aircraft, Flat Car, Front Loader/bulldozer, Ground Grader, Haul Truck, Helicopter, Helipad, Hut/tent, Locomotive, Maritime Vessel, Mobile Crane, Motorboat, Oil Tanker, Passenger Vehicle, Passenger Car, Passenger/cargo Plane, Pickup Truck, Pylon, Railway Vehicle, Reach Stacker, Sailboat, Shed, Shipping Container, Shipping Container Lot, Small Aircraft, Small Car, Storage Tank, Straddle Carrier, Tank Car, Tower, Tower Crane, Tractor, Trailer, Truck, Truck Tractor, Truck Tractor W/ Box Trailer, Truck Tractor W/ Flatbed Trailer, Truck Tractor W/ Liquid Tank, Tugboat, Utility Truck, Vehicle Lot, Yacht
## Ontology

# Label Noise
They do three stages of quality control, including a mix of manual and automated checks and a comparison with a gold standard (hand-annotated by experts) dataset. In order to pass expert quality control, the batch was required to have a precision of 0.75 and recall of 0.95 at 0.5 intersection over union (IoU) when compared to the gold standard.
However, despite these efforts the xView dataset still has considerable noise. I think that part of the problem is that a 0.75 precision requirement for ground truth data isn't very high. The [winning solution](https:
# Other
This dataset does well for geographic diversity.

The images in this dataset, like most satellite images, were preprocessed by performing orthorectification, pan-sharpening, and atmospheric correction.
This dataset was released under a noncommercial license. See the [xView dataset rules](https://challenge.xviewdataset.org/rules) for more information.
## NWPU VHR-10
Northwestern Polytechnical University Very High Resolution-10
# Academic papers
[Multi-class geospatial object detection and geographic image classification based on collection of part detectors](https:
[A survey on object detection in optical remote sensing images](https:
[Learning rotation-invariant convolutional neural networks for object detection in VHR optical remote sensing images](https://ieeexplore.ieee.org/document/7560644) (Paywall)
# Categories
Airplane, Ship, Storage Tank, Baseball Diamond, Tennis Court, Basketball Court, Ground Track Field, Harbor, Bridge, Vehicle
# Label Noise
According to the website this dataset was manually annotated by experts, so the noise should be low.
# Other
150 of the 800 images are background only (no objects).
These images are from Google Earth and Vaihingen data set. The Vaihingen data was provided by the German Society for Photogrammetry, Remote Sensing and Geoinformation (DGPF).
## COWC
Cars Overhead With Context
# Academic paper
[A Large Contextual Dataset for Classification, Detection and Counting of Cars with Deep Learning](https://gdo152.llnl.gov/cowc/<API key>.pdf)
# Categories
Cars
# Other
Data is from six different locations:
* Toronto, Canada
* Selwyn, New Zealand
* Potsdam, Germany
* Vaihingen, Germany
* Columbus, Ohio
* Utah
The imagery from Vaihingen, Germany and Columbus, Ohio is in grayscale. |
#!/bin/sh
set -e
echo "mkdir -p ${<API key>}/${<API key>}"
mkdir -p "${<API key>}/${<API key>}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${<API key>}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
<API key> "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
<API key> "${destination}/${lib}"
done
fi
}
# Signs a framework with the provided identity
<API key>() {
if [ -n "${<API key>}" -a "${<API key>}" != "NO" -a "${<API key>}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${<API key>}"
echo "/usr/bin/codesign --force --sign ${<API key>} ${<API key>} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${<API key>} ${<API key>} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/FXLabel/FXLabel.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/FXLabel/FXLabel.framework"
fi |
<!doctype html>
<html lang="en">
<head>
<title>Shopping List Check Off</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<style>
.emptyMessage {
font-weight: bold;
color: red;
font-size: 1.2em;
}
li {
margin-bottom: 7px;
font-size: 1.2em;
}
li > button {
margin-left: 6px;
}
button > span {
color: green;
}
</style>
<script src="https://code.angularjs.org/1.5.8/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="<API key>">
<div class="container">
<h1>Shopping List Check Off</h1>
<div class="row">
<!-- To Buy List -->
<div class="col-md-6" ng-controller="<API key> as tobuy">
<h2>To Buy:</h2>
<ul>
<li ng-repeat="item in tobuy.items">Buy {{item.quantity}} {{item.name}}(s)<button class="btn btn-default" ng-click="tobuy.removeItem($index);"><span class="glyphicon glyphicon-ok"></span> Bought</button></li>
</ul>
<div class="emptyMessage" ng-if="tobuy.items.length == 0">Everything is bought!</div>
</div>
<!-- Already Bought List -->
<div class="col-md-6" ng-controller="<API key> as bought">
<h2>Already Bought:</h2>
<ul>
<!-- <li>Bought 10 cookies</li> -->
<li ng-repeat="item in bought.items">Bought {{item.quantity}} {{item.name}}(s)</li>
</ul>
<div class="emptyMessage" ng-if="bought.items.length == 0">Nothing bought yet.</div>
</div>
</div>
</div>
</body>
</html> |
#pragma once
#include <cstdint>
#include <cstddef>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <vector>
#include "Common/StdInputStream.h"
#include "Common/StdOutputStream.h"
#include "Serialization/<API key>.h"
#include "Serialization/<API key>.h"
template<class T> class SwappedVector {
public:
typedef T value_type;
class const_iterator {
public:
typedef ptrdiff_t difference_type;
typedef std::<API key> iterator_category;
typedef const T* pointer;
typedef const T& reference;
typedef T value_type;
const_iterator() {
}
const_iterator(SwappedVector* swappedVector, size_t index) : m_swappedVector(swappedVector), m_index(index) {
}
bool operator!=(const const_iterator& other) const {
return m_index != other.m_index;
}
bool operator<(const const_iterator& other) const {
return m_index < other.m_index;
}
bool operator<=(const const_iterator& other) const {
return m_index <= other.m_index;
}
bool operator==(const const_iterator& other) const {
return m_index == other.m_index;
}
bool operator>(const const_iterator& other) const {
return m_index > other.m_index;
}
bool operator>=(const const_iterator& other) const {
return m_index >= other.m_index;
}
const_iterator& operator++() {
++m_index;
return *this;
}
const_iterator operator++(int) {
const_iterator i = *this;
++m_index;
return i;
}
const_iterator& operator
--m_index;
return *this;
}
const_iterator operator--(int) {
const_iterator i = *this;
--m_index;
return i;
}
const_iterator& operator+=(difference_type n) {
m_index += n;
return *this;
}
const_iterator& operator-=(difference_type n) {
m_index -= n;
return *this;
}
const_iterator operator+(difference_type n) const {
return const_iterator(m_swappedVector, m_index + n);
}
friend const_iterator operator+(difference_type n, const const_iterator& i) {
return const_iterator(i.m_swappedVector, n + i.m_index);
}
difference_type operator-(const const_iterator& other) const {
return m_index - other.m_index;
}
const_iterator& operator-(difference_type n) const {
return const_iterator(m_swappedVector, m_index - n);
}
const T& operator*() const {
return (*m_swappedVector)[m_index];
}
const T* operator->() const {
return &(*m_swappedVector)[m_index];
}
const T& operator[](difference_type offset) const {
return (*m_swappedVector)[m_index + offset];
}
size_t index() const {
return m_index;
}
private:
SwappedVector* m_swappedVector;
size_t m_index;
};
SwappedVector();
//SwappedVector(const SwappedVector&) = delete;
~SwappedVector();
//SwappedVector& operator=(const SwappedVector&) = delete;
bool open(const std::string& itemFileName, const std::string& indexFileName, size_t poolSize);
void close();
bool empty() const;
uint64_t size() const;
const_iterator begin();
const_iterator end();
const T& operator[](uint64_t index);
const T& front();
const T& back();
void clear();
void pop_back();
void push_back(const T& item);
private:
struct ItemEntry;
struct CacheEntry;
struct ItemEntry {
public:
T item;
typename std::list<CacheEntry>::iterator cacheIter;
};
struct CacheEntry {
public:
typename std::map<uint64_t, ItemEntry>::iterator itemIter;
};
std::fstream m_itemsFile;
std::fstream m_indexesFile;
size_t m_poolSize;
std::vector<uint64_t> m_offsets;
uint64_t m_itemsFileSize;
std::map<uint64_t, ItemEntry> m_items;
std::list<CacheEntry> m_cache;
uint64_t m_cacheHits;
uint64_t m_cacheMisses;
T* prepare(uint64_t index);
};
template<class T> SwappedVector<T>::SwappedVector() {
}
template<class T> SwappedVector<T>::~SwappedVector() {
close();
}
template<class T> bool SwappedVector<T>::open(const std::string& itemFileName, const std::string& indexFileName, size_t poolSize) {
if (poolSize == 0) {
return false;
}
m_itemsFile.open(itemFileName, std::ios::in | std::ios::out | std::ios::binary);
m_indexesFile.open(indexFileName, std::ios::in | std::ios::out | std::ios::binary);
if (m_itemsFile && m_indexesFile) {
uint64_t count;
m_indexesFile.read(reinterpret_cast<char*>(&count), sizeof count);
if (!m_indexesFile) {
return false;
}
std::vector<uint64_t> offsets;
uint64_t itemsFileSize = 0;
for (uint64_t i = 0; i < count; ++i) {
uint32_t itemSize;
m_indexesFile.read(reinterpret_cast<char*>(&itemSize), sizeof itemSize);
if (!m_indexesFile) {
return false;
}
offsets.emplace_back(itemsFileSize);
itemsFileSize += itemSize;
}
m_offsets.swap(offsets);
m_itemsFileSize = itemsFileSize;
} else {
m_itemsFile.open(itemFileName, std::ios::out | std::ios::binary);
m_itemsFile.close();
m_itemsFile.open(itemFileName, std::ios::in | std::ios::out | std::ios::binary);
m_indexesFile.open(indexFileName, std::ios::out | std::ios::binary);
uint64_t count = 0;
m_indexesFile.write(reinterpret_cast<char*>(&count), sizeof count);
if (!m_indexesFile) {
return false;
}
m_indexesFile.close();
m_indexesFile.open(indexFileName, std::ios::in | std::ios::out | std::ios::binary);
m_offsets.clear();
m_itemsFileSize = 0;
}
m_poolSize = poolSize;
m_items.clear();
m_cache.clear();
m_cacheHits = 0;
m_cacheMisses = 0;
return true;
}
template<class T> void SwappedVector<T>::close() {
std::cout << "SwappedVector cache hits: " << m_cacheHits << ", misses: " << m_cacheMisses << " (" << std::fixed << std::setprecision(2) << static_cast<double>(m_cacheMisses) / (m_cacheHits + m_cacheMisses) * 100 << "%)" << std::endl;
}
template<class T> bool SwappedVector<T>::empty() const {
return m_offsets.empty();
}
template<class T> uint64_t SwappedVector<T>::size() const {
return m_offsets.size();
}
template<class T> typename SwappedVector<T>::const_iterator SwappedVector<T>::begin() {
return const_iterator(this, 0);
}
template<class T> typename SwappedVector<T>::const_iterator SwappedVector<T>::end() {
return const_iterator(this, m_offsets.size());
}
template<class T> const T& SwappedVector<T>::operator[](uint64_t index) {
auto itemIter = m_items.find(index);
if (itemIter != m_items.end()) {
if (itemIter->second.cacheIter != --m_cache.end()) {
m_cache.splice(m_cache.end(), m_cache, itemIter->second.cacheIter);
}
++m_cacheHits;
return itemIter->second.item;
}
if (index >= m_offsets.size()) {
throw std::runtime_error("SwappedVector::operator[]");
}
if (!m_itemsFile) {
throw std::runtime_error("SwappedVector::operator[]");
}
m_itemsFile.seekg(m_offsets[index]);
T tempItem;
Common::StdInputStream stream(m_itemsFile);
CryptoNote::<API key> archive(stream);
serialize(tempItem, archive);
T* item = prepare(index);
std::swap(tempItem, *item);
++m_cacheMisses;
return *item;
}
template<class T> const T& SwappedVector<T>::front() {
return operator[](0);
}
template<class T> const T& SwappedVector<T>::back() {
return operator[](m_offsets.size() - 1);
}
template<class T> void SwappedVector<T>::clear() {
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::clear");
}
m_indexesFile.seekp(0);
uint64_t count = 0;
m_indexesFile.write(reinterpret_cast<char*>(&count), sizeof count);
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::clear");
}
m_offsets.clear();
m_itemsFileSize = 0;
m_items.clear();
m_cache.clear();
}
template<class T> void SwappedVector<T>::pop_back() {
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::pop_back");
}
m_indexesFile.seekp(0);
uint64_t count = m_offsets.size() - 1;
m_indexesFile.write(reinterpret_cast<char*>(&count), sizeof count);
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::pop_back");
}
m_itemsFileSize = m_offsets.back();
m_offsets.pop_back();
auto itemIter = m_items.find(m_offsets.size());
if (itemIter != m_items.end()) {
m_cache.erase(itemIter->second.cacheIter);
m_items.erase(itemIter);
}
}
template<class T> void SwappedVector<T>::push_back(const T& item) {
uint64_t itemsFileSize;
{
if (!m_itemsFile) {
throw std::runtime_error("SwappedVector::push_back");
}
m_itemsFile.seekp(m_itemsFileSize);
Common::StdOutputStream stream(m_itemsFile);
CryptoNote::<API key> archive(stream);
serialize(const_cast<T&>(item), archive);
itemsFileSize = m_itemsFile.tellp();
}
{
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::push_back");
}
m_indexesFile.seekp(sizeof(uint64_t) + sizeof(uint32_t) * m_offsets.size());
uint32_t itemSize = static_cast<uint32_t>(itemsFileSize - m_itemsFileSize);
m_indexesFile.write(reinterpret_cast<char*>(&itemSize), sizeof itemSize);
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::push_back");
}
m_indexesFile.seekp(0);
uint64_t count = m_offsets.size() + 1;
m_indexesFile.write(reinterpret_cast<char*>(&count), sizeof count);
if (!m_indexesFile) {
throw std::runtime_error("SwappedVector::push_back");
}
}
m_offsets.push_back(m_itemsFileSize);
m_itemsFileSize = itemsFileSize;
T* newItem = prepare(m_offsets.size() - 1);
*newItem = item;
}
template<class T> T* SwappedVector<T>::prepare(uint64_t index) {
if (m_items.size() == m_poolSize) {
auto cacheIter = m_cache.begin();
m_items.erase(cacheIter->itemIter);
m_cache.erase(cacheIter);
}
auto itemIter = m_items.insert(std::make_pair(index, ItemEntry()));
CacheEntry cacheEntry = { itemIter.first };
auto cacheIter = m_cache.insert(m_cache.end(), cacheEntry);
itemIter.first->second.cacheIter = cacheIter;
return &itemIter.first->second.item;
} |
void permuteUnique(char* res, int* used, int size, int n, int k) {
int resIdx = size - n;
if (k == 0) {
for (int i = 0; i < size; i++) {
if (used[i] != 1) {
res[resIdx++] = '0' + i + 1;
}
}
return;
}
int temp = 1;
int i = 1;
while (i < n) {
temp *= i++;
}
int idx = k / temp;
for (int i = 0; i < size; i++) {
if (used[i] != 1 && idx
res[resIdx] = '0' + i + 1;
used[i] = 1;
}
}
k %= temp;
permuteUnique(res, used, size, n - 1, k);
return;
}
char* getPermutation(int n, int k) {
int* used = (int*) malloc(n * sizeof(int));
memset(used, 0, n * sizeof(int));
char* res = (char*) malloc((n + 1) * sizeof(char));
memset(res, 0, (n + 1) * sizeof(char));
permuteUnique(res, used, n, n, k - 1);
free(used);
return res;
} |
package elasticorm_test
import (
"fmt"
"os"
"path/filepath"
"reflect"
"runtime"
"testing"
)
var elasticSearchURL = <API key>()
func <API key>() string {
URL := os.Getenv("EDS_ES_URL")
if URL == `` {
URL = `http://localhost:9200`
}
return URL
}
// assert fails the test if the condition is false.
func assert(tb testing.TB, condition bool, msg string, v ...interface{}) {
if !condition {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...)
tb.FailNow()
}
}
// ok fails the test if an err is not nil.
func ok(tb testing.TB, err error) {
if err != nil {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: unexpected error: %s\033[39m\n\n", filepath.Base(file), line, err.Error())
tb.FailNow()
}
}
// equals fails the test if exp is not equal to act.
func equals(tb testing.TB, exp, act interface{}) {
if !reflect.DeepEqual(exp, act) {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d:\n\n\texp: %#v\n\n\tgot: %#v\033[39m\n\n", filepath.Base(file), line, exp, act)
tb.FailNow()
}
} |
<html>
<head>
<title>JSON Hyper Schema - Hypermedia Client</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body ng-cloak>
<div ng-controller="ClientArea" capture-save>
<div ng-include="client.url"></div>
</div>
</body>
<link rel="stylesheet" type="text/css" href="/build/combined.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"
data-main="/build/main.js"></script>
</html> |
@if (session("status"))
{{ session("status") }}
@endif
@if (session("error"))
{{ session("error") }}
@endif
<form method="POST">
<label>
Email:
<input type="email"
name="github_email"
value="{{ old("github_email") }}" />
</label>
<input
type="hidden"
name="_token"
value="{{ csrf_token() }}" />
<input
type="submit"
value="Send Password Reset Link" />
</form> |
using System;
using System.Diagnostics;
namespace System.Xml
{
internal class BinHexDecoder : <API key>
{
// Fields
private byte[] _buffer;
private int _startIndex;
private int _curIndex;
private int _endIndex;
private bool _hasHalfByteCached;
private byte _cachedHalfByte;
// <API key> interface
internal override int DecodedCount
{
get
{
return _curIndex - _startIndex;
}
}
internal override bool IsFull
{
get
{
return _curIndex == _endIndex;
}
}
#if !<API key>
[System.Security.<API key>]
#endif
internal override unsafe int Decode(char[] chars, int startPos, int len)
{
if (chars == null)
{
throw new <API key>("chars");
}
if (len < 0)
{
throw new <API key>("len");
}
if (startPos < 0)
{
throw new <API key>("startPos");
}
if (chars.Length - startPos < len)
{
throw new <API key>("len");
}
if (len == 0)
{
return 0;
}
int bytesDecoded, charsDecoded;
fixed (char* pChars = &chars[startPos])
{
fixed (byte* pBytes = &_buffer[_curIndex])
{
Decode(pChars, pChars + len, pBytes, pBytes + (_endIndex - _curIndex),
ref _hasHalfByteCached, ref _cachedHalfByte, out charsDecoded, out bytesDecoded);
}
}
_curIndex += bytesDecoded;
return charsDecoded;
}
#if !<API key>
[System.Security.<API key>]
#endif
internal override unsafe int Decode(string str, int startPos, int len)
{
if (str == null)
{
throw new <API key>("str");
}
if (len < 0)
{
throw new <API key>("len");
}
if (startPos < 0)
{
throw new <API key>("startPos");
}
if (str.Length - startPos < len)
{
throw new <API key>("len");
}
if (len == 0)
{
return 0;
}
int bytesDecoded, charsDecoded;
fixed (char* pChars = str)
{
fixed (byte* pBytes = &_buffer[_curIndex])
{
Decode(pChars + startPos, pChars + startPos + len, pBytes, pBytes + (_endIndex - _curIndex),
ref _hasHalfByteCached, ref _cachedHalfByte, out charsDecoded, out bytesDecoded);
}
}
_curIndex += bytesDecoded;
return charsDecoded;
}
internal override void Reset()
{
_hasHalfByteCached = false;
_cachedHalfByte = 0;
}
internal override void SetNextOutputBuffer(Array buffer, int index, int count)
{
Debug.Assert(buffer != null);
Debug.Assert(count >= 0);
Debug.Assert(index >= 0);
Debug.Assert(buffer.Length - index >= count);
Debug.Assert((buffer as byte[]) != null);
_buffer = (byte[])buffer;
_startIndex = index;
_curIndex = index;
_endIndex = index + count;
}
// Static methods
#if !<API key>
[System.Security.<API key>]
#endif
public static unsafe byte[] Decode(char[] chars, bool allowOddChars)
{
if (chars == null)
{
throw new <API key>("chars");
}
int len = chars.Length;
if (len == 0)
{
return Array.Empty<byte>();
}
byte[] bytes = new byte[(len + 1) / 2];
int bytesDecoded, charsDecoded;
bool hasHalfByteCached = false;
byte cachedHalfByte = 0;
fixed (char* pChars = &chars[0])
{
fixed (byte* pBytes = &bytes[0])
{
Decode(pChars, pChars + len, pBytes, pBytes + bytes.Length, ref hasHalfByteCached, ref cachedHalfByte, out charsDecoded, out bytesDecoded);
}
}
if (hasHalfByteCached && !allowOddChars)
{
throw new XmlException(SR.<API key>, new string(chars));
}
if (bytesDecoded < bytes.Length)
{
byte[] tmp = new byte[bytesDecoded];
Array.Copy(bytes, 0, tmp, 0, bytesDecoded);
bytes = tmp;
}
return bytes;
}
// Private methods
#if !<API key>
[System.Security.SecurityCritical]
#endif
private static unsafe void Decode(char* pChars, char* pCharsEndPos,
byte* pBytes, byte* pBytesEndPos,
ref bool hasHalfByteCached, ref byte cachedHalfByte,
out int charsDecoded, out int bytesDecoded)
{
#if DEBUG
Debug.Assert(pCharsEndPos - pChars >= 0);
Debug.Assert(pBytesEndPos - pBytes >= 0);
#endif
char* pChar = pChars;
byte* pByte = pBytes;
XmlCharType xmlCharType = XmlCharType.Instance;
while (pChar < pCharsEndPos && pByte < pBytesEndPos)
{
byte halfByte;
char ch = *pChar++;
if (ch >= 'a' && ch <= 'f')
{
halfByte = (byte)(ch - 'a' + 10);
}
else if (ch >= 'A' && ch <= 'F')
{
halfByte = (byte)(ch - 'A' + 10);
}
else if (ch >= '0' && ch <= '9')
{
halfByte = (byte)(ch - '0');
}
else if (xmlCharType.IsWhiteSpace(ch))
{
continue;
}
else
{
throw new XmlException(SR.<API key>, new string(pChars, 0, (int)(pCharsEndPos - pChars)));
}
if (hasHalfByteCached)
{
*pByte++ = (byte)((cachedHalfByte << 4) + halfByte);
hasHalfByteCached = false;
}
else
{
cachedHalfByte = halfByte;
hasHalfByteCached = true;
}
}
bytesDecoded = (int)(pByte - pBytes);
charsDecoded = (int)(pChar - pChars);
}
}
} |
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using System.IO;
[CustomEditor(typeof(AudioManager))]
public class <API key> : Editor
{
string _musicPath = "Assets/music";
AudioManager _am;
public override void OnInspectorGUI()
{
_am = target as AudioManager;
if (_am == null) return;
_am.AudioSourcePrefab = (AudioSource)EditorGUILayout.ObjectField("Audio Source Template Prefab", _am.AudioSourcePrefab, typeof(AudioSource));
_am.SoundVolume = EditorGUILayout.Slider("Sound Volume", _am.SoundVolume, 0.0f, 1.0f);
_am.MusicVolume = EditorGUILayout.Slider("Music Volume", _am.MusicVolume, 0.0f, 1.0f);
if (GUILayout.Button("Generate Music List"))
{
BuildMediaList(_am.MusicTracks, _musicPath);
}
PrintListContents(_am.MusicTracks);
if (GUI.changed)
{
EditorUtility.SetDirty(_am);
AssetDatabase.SaveAssets();
}
}
void BuildMediaList(List<AudioClip> listToPopulate, string pathToDirWithFiles)
{
listToPopulate.Clear();
string[] dirs = Directory.GetDirectories(pathToDirWithFiles, "*", SearchOption.AllDirectories);
if (dirs.Length == 0)
{
LoadFiles(listToPopulate, pathToDirWithFiles, "*.ogg");
}
else
{
for (int i = 0; i < dirs.Length; i++)
{
string dirSlashesFixed = dirs[i].Replace("\\", "/");
LoadFiles(listToPopulate, dirSlashesFixed, "*.ogg");
}
}
}
void PrintListContents(List<AudioClip> listToPrint)
{
if (listToPrint.Count != 0)
{
string text = string.Empty;
int counter = 0;
foreach (var item in listToPrint)
{
if (item != null)
{
text += string.Format("{0}: {1}\n", counter, item.name);
counter++;
}
}
EditorGUILayout.HelpBox(text, MessageType.None);
}
}
void LoadFiles(List<AudioClip> listToAdd, string path, string filter)
{
string[] files = Directory.GetFiles(path, filter);
for (int j = 0; j < files.Length; j++)
{
string fileSlashFixed = files[j].Replace("\\", "/");
AudioClip clip = AssetDatabase.LoadAssetAtPath(fileSlashFixed, typeof(AudioClip)) as AudioClip;
listToAdd.Add(clip);
}
}
} |
title: - ()
<a name=stdBar></a>
- [](#effect)
- [](#install)
- [](#config)
- [](#use)
- [](#style)
<a name="effect"></a> [](#stdBar)
<iframe src="http://fex.dev.quhuhu.com/guohui.yin/v-figure/html/polylineMobile.html" frameborder="0" width="810" height="350"></iframe>
<a name="install"></a> [](#stdBar)
javascript
var bar=require('lib/polyline/stdPolyLine.js');
<a name="config"></a> [](#stdBar)
javascript
var c1 = {
id: 'canvas',
padding:'50 30 50 0',
series: [{
data: [52, 70, 10, 20, 80, 120, 10, 34, 23, 11],
style: {
line: {
stroke: '#1ba9ba',
'stroke-dasharray': '.',
'stroke-width':2,
r: 5
},
point: {
stroke: '#1ba9ba',
r: 2,
fill: '#1ba9ba'
}
},
legend: ''
}, {
data: [42, 90, 20, 10, 70, 20, 100, 64, 43, 11],
style: {
line: {
stroke: '#f00',
r: 4
},
point: {
stroke: '#f00',
r: 0,
fill: '#f00'
}
},
legend: ''
}],
xAxis: ['2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010'],
animation: {
line: {
speed: 500,
type: '<>'
},
point: {
speed: 200,
type: '<>'
}
},
isxAxis: true,
isyAxis: false,
isGrid: true,
isTitle: false,
isLegend: false,
isFocus: true,
isZebra: true,
isData: true
};
var c2 = {
id: 'yAxis',
padding:'50 0 50 30',
series: [{
data: [52, 70, 10, 20, 80, 120, 10, 34, 23, 11],
style: {
line: {
stroke: '#1ba9ba',
'stroke-dasharray': '.',
'stroke-width':2,
r: 5
},
point: {
stroke: '#1ba9ba',
r: 2,
fill: '#1ba9ba'
}
},
legend: ''
}, {
data: [42, 90, 20, 10, 70, 20, 100, 64, 43, 11],
style: {
line: {
stroke: '#f00',
r: 4
},
point: {
stroke: '#f00',
r: 0,
fill: '#f00'
}
},
legend: ''
}],
xAxis: ['2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010'],
animation: {
line: {
speed: 500,
type: '<>'
},
point: {
speed: 200,
type: '<>'
}
},
isxAxis: false,
isyAxis: true,
isGrid: false,
isTitle: false,
isLegend: false,
isFocus: false,
isZebra: false,
isData: false
};
<a name="use"></a> [](#stdBar)
html
<article class="flexbox">
<nav class="flex left" id="yAxis"></nav>
<section class="flex right" id="canvas"></section>
</article>
css
*{
padding: 0;
margin: 0;
}
.flexbox {
display: flex;
}
.flex {
flex: 1;
}
.left {
flex: none;
width: 30px;
}
.right {
overflow-x: auto;
}
javascript
var m = new stdPolyLine(c1);
var y = new stdPolyLine(c2);
m.render();
y.render();
<a name="style"></a> [](#stdBar)
json
fill : ['color', 'gradient','image']
fill-opacity : number
font : string //css
font-family : string
font-size : number
font-weight: number
opacity : number
stroke : string
stroke-dasharray : string [“”, “-”, “.”, “-.”, “-..”, “. ”, “- ”, “
stroke-linecap : string [“butt”, “square”, “round”]
stroke-linejoin: string [“bevel”, “round”, “miter”]
stroke-opacity : number
stroke-width : number 1px
text : string \n
text-anchor: string [“start”, “middle”, “end”] middle |
@import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic);
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
.reveal a:not(.image) {
line-height: 1.3em; }
body {
background: #add9e4;
background: -moz-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #f7fbfc), color-stop(100%, #add9e4));
background: -<API key>(center, circle cover, #f7fbfc 0%, #add9e4 100%);
background: -o-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%);
background: -ms-radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%);
background: radial-gradient(center, circle cover, #f7fbfc 0%, #add9e4 100%);
background-color: #f7fbfc; }
.reveal {
font-family: "Open Sans", "Helvetica Bold", sans-serif;
font-size: 36px;
font-weight: normal;
letter-spacing: -0.02em;
color: #333333; }
::selection {
color: white;
background: #134674;
text-shadow: none; }
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
margin: 0 0 20px 0;
color: #333333;
font-family: "Quicksand", "Helvetica Bold", sans-serif;
line-height: 0.9em;
letter-spacing: -0.08em;
text-transform: uppercase;
text-shadow: none; }
.reveal h1 {
text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2); }
.reveal a:not(.image) {
color: #3b759e;
text-decoration: none;
-webkit-transition: color .15s ease;
-moz-transition: color .15s ease;
-ms-transition: color .15s ease;
-o-transition: color .15s ease;
transition: color .15s ease; }
.reveal a:not(.image):hover {
color: #74a7cb;
text-shadow: none;
border: none; }
.reveal .roll span:after {
color: #fff;
background: #264c66; }
.reveal section img {
margin: 15px 0px;
background: rgba(255, 255, 255, 0.12);
border: 4px solid #333333;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-ms-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear; }
.reveal a:hover img {
background: rgba(255, 255, 255, 0.2);
border-color: #3b759e;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); }
.reveal .controls div.navigate-left,
.reveal .controls div.navigate-left.enabled {
border-right-color: #3b759e; }
.reveal .controls div.navigate-right,
.reveal .controls div.navigate-right.enabled {
border-left-color: #3b759e; }
.reveal .controls div.navigate-up,
.reveal .controls div.navigate-up.enabled {
border-bottom-color: #3b759e; }
.reveal .controls div.navigate-down,
.reveal .controls div.navigate-down.enabled {
border-top-color: #3b759e; }
.reveal .controls div.navigate-left.enabled:hover {
border-right-color: #74a7cb; }
.reveal .controls div.navigate-right.enabled:hover {
border-left-color: #74a7cb; }
.reveal .controls div.navigate-up.enabled:hover {
border-bottom-color: #74a7cb; }
.reveal .controls div.navigate-down.enabled:hover {
border-top-color: #74a7cb; }
.reveal .progress {
background: rgba(0, 0, 0, 0.2); }
.reveal .progress span {
background: #3b759e;
-webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
-o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); }
.reveal .slide-number {
color: #3b759e; } |
#!/bin/sh
set -e
echo "mkdir -p ${<API key>}/${<API key>}"
mkdir -p "${<API key>}/${<API key>}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${<API key>}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# use filter instead of exclude so missing patterns dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
<API key> "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
<API key> "${destination}/${lib}"
done
fi
}
# Signs a framework with the provided identity
<API key>() {
if [ -n "${<API key>}" -a "${<API key>}" != "NO" -a "${<API key>}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${<API key>}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${<API key>} ${<API key>} --preserve-metadata=identifier,entitlements '$1'"
if [ "${<API key>}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/Oops/Oops.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "$BUILT_PRODUCTS_DIR/Oops/Oops.framework"
fi
if [ "${<API key>}" == "true" ]; then
wait
fi |
<!DOCTYPE html>
<html xmlns="http:
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta property="og:title" content="Tags" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://dev.im-bot.com/tags//" />
<meta property="og:image" content="http://dev.im-bot.com/public/opengraph_logo.png" />
<meta property="og:image:width" content="862" />
<meta property="og:image:height" content="453" />
<meta property="og:description" content="botbotbot's blog" />
<meta property="og:site_name" content="botbotbot" />
<meta property="og:locale" content="th_TH" />
<title>
Tags · botbotbot
</title>
<!-- CSS -->
<link rel="stylesheet" href="/public/css/poole.css">
<link rel="stylesheet" href="/public/css/syntax.css">
<link rel="stylesheet" href="/public/css/lanyon.css">
<link rel="stylesheet" href="/public/css/searchbox.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700|PT+Sans:400">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Icons -->
<link rel="<API key>" sizes="144x144" href="/public/<API key>.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">
<!-- Google Analytic-->
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-52133577-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular
styles, `#sidebar-checkbox` for behavior. -->
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">
<!-- Toggleable sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-item">
<p>botbotbot's blog</p>
</div>
<nav class="sidebar-nav">
<a class="sidebar-nav-item" href="/">Home</a>
<a class="sidebar-nav-item" href="/about/">About Me</a>
<a class="sidebar-nav-item active" href="/tags/">Tags</a>
<div class="sidebar-item">
<p>
© 2017. All rights reserved.
</p>
</div>
</div>
<!-- Wrap is the content to shift when toggling the sidebar. We wrap the
content to avoid any CSS collisions with our real content.
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="/" title="Home">botbotbot</a>
<small>'s blog</small>
<!-- <API key> -->
<span id="search">
<form action="/search" method="get" id="searchbox">
<input type="text" id="search-query" placeholder="Search" autocomplete="off" name="q">
</form>
</span>
</h3>
</div>
</div>
<!-- <API key> -->
<div class="container">
<div class="post">
<section id="search-results" style="display: none;">
<div id="<API key>">
<h1 class="post-title">
Search results
<i class="fa fa-times" style="font-size: 0.7em"></i>
</h1>
</div>
<div class="entries">
</div>
</section>
</div>
</div>
<div class="container content">
<div class="page">
<h1 class="page-title">Tags</h1>
<!-- site_tags: python,tmux,vim,jekyll,osx,testdisk,unix,CI,cloud,smtp,git,docker,robot-framework,qutoes,security,latex,ssh,coding,english,productivity,startup,markdown,website,jobs,learn,ror,wordpress,cassandra,nosql,keyboard,mongo,API,react,js,redux,vpn,es7,babel,auth,jwt -->
<!-- tag_words: APICI<API key><API key><API key> -->
<div id="tags">
<a href="#API">
API
<!-- <span>2</span> -->
</a>
<a href="
CI
<!-- <span>4</span> -->
</a>
<a href="#auth">
auth
<!-- <span>1</span> -->
</a>
<a href="#babel">
babel
<!-- <span>1</span> -->
</a>
<a href="#cassandra">
cassandra
<!-- <span>1</span> -->
</a>
<a href="#cloud">
cloud
<!-- <span>2</span> -->
</a>
<a href="#coding">
coding
<!-- <span>5</span> -->
</a>
<a href="#docker">
docker
<!-- <span>5</span> -->
</a>
<a href="#english">
english
<!-- <span>1</span> -->
</a>
<a href="#es7">
es7
<!-- <span>1</span> -->
</a>
<a href="#git">
git
<!-- <span>6</span> -->
</a>
<a href="#jekyll">
jekyll
<!-- <span>5</span> -->
</a>
<a href="#jobs">
jobs
<!-- <span>1</span> -->
</a>
<a href="
js
<!-- <span>4</span> -->
</a>
<a href="#jwt">
jwt
<!-- <span>1</span> -->
</a>
<a href="#keyboard">
keyboard
<!-- <span>1</span> -->
</a>
<a href="#latex">
latex
<!-- <span>1</span> -->
</a>
<a href="#learn">
learn
<!-- <span>1</span> -->
</a>
<a href="#markdown">
markdown
<!-- <span>1</span> -->
</a>
<a href="#mongo">
mongo
<!-- <span>2</span> -->
</a>
<a href="#nosql">
nosql
<!-- <span>2</span> -->
</a>
<a href="#osx">
osx
<!-- <span>4</span> -->
</a>
<a href="#productivity">
productivity
<!-- <span>1</span> -->
</a>
<a href="#python">
python
<!-- <span>7</span> -->
</a>
<a href="#qutoes">
qutoes
<!-- <span>1</span> -->
</a>
<a href="#react">
react
<!-- <span>1</span> -->
</a>
<a href="#redux">
redux
<!-- <span>1</span> -->
</a>
<a href="#robot-framework">
robot-framework
<!-- <span>2</span> -->
</a>
<a href="#ror">
ror
<!-- <span>1</span> -->
</a>
<a href="#security">
security
<!-- <span>2</span> -->
</a>
<a href="#smtp">
smtp
<!-- <span>1</span> -->
</a>
<a href="#ssh">
ssh
<!-- <span>1</span> -->
</a>
<a href="#startup">
startup
<!-- <span>1</span> -->
</a>
<a href="#testdisk">
testdisk
<!-- <span>1</span> -->
</a>
<a href="#tmux">
tmux
<!-- <span>1</span> -->
</a>
<a href="#unix">
unix
<!-- <span>4</span> -->
</a>
<a href="#vim">
vim
<!-- <span>7</span> -->
</a>
<a href="#vpn">
vpn
<!-- <span>1</span> -->
</a>
<a href="#website">
website
<!-- <span>1</span> -->
</a>
<a href="#wordpress">
wordpress
<!-- <span>1</span> -->
</a>
<h2 id="API">API</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-07-10T00:00:00+00:00" itemprop="datePublished">
July 10, 2016
</time>
</span> »
<a href="/api-docs/">
API Documents
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-06-26T00:00:00+00:00" itemprop="datePublished">
June 26, 2016
</time>
</span> »
<a href="/restful-api/">
RESTful API
</a>
</li>
</ul>
<h2 id="CI">CI</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-08-24T00:00:00+00:00" itemprop="datePublished">
August 24, 2015
</time>
</span> »
<a href="/jenkins/">
Jenkins CI
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-08-23T00:00:00+00:00" itemprop="datePublished">
August 23, 2015
</time>
</span> »
<a href="/travis-ci/">
Travis CI
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-08-23T00:00:00+00:00" itemprop="datePublished">
August 23, 2015
</time>
</span> »
<a href="/drone-ci/">
Drone.io CI
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-19T00:00:00+00:00" itemprop="datePublished">
July 19, 2014
</time>
</span> »
<a href="/ci/">
Continuos Integrations
</a>
</li>
</ul>
<h2 id="auth">auth</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-30T00:00:00+00:00" itemprop="datePublished">
November 30, 2016
</time>
</span> »
<a href="/jwt/">
JWT
</a>
</li>
</ul>
<h2 id="babel">babel</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-15T00:00:00+00:00" itemprop="datePublished">
November 15, 2016
</time>
</span> »
<a href="/babel/">
Babel
</a>
</li>
</ul>
<h2 id="cassandra">cassandra</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-24T00:00:00+00:00" itemprop="datePublished">
March 24, 2016
</time>
</span> »
<a href="/cassandra/">
What I know about Apache Cassandra
</a>
</li>
</ul>
<h2 id="cloud">cloud</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2014-08-09T00:00:00+00:00" itemprop="datePublished">
August 09, 2014
</time>
</span> »
<a href="/devops/">
DevOps
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-28T00:00:00+00:00" itemprop="datePublished">
July 28, 2014
</time>
</span> »
<a href="/compute-engine/">
Google Compute Engine
</a>
</li>
</ul>
<h2 id="coding">coding</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-23T00:00:00+00:00" itemprop="datePublished">
November 23, 2016
</time>
</span> »
<a href="/code-review/">
Code Review
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-06-16T00:00:00+00:00" itemprop="datePublished">
June 16, 2016
</time>
</span> »
<a href="/12-factor-apps/">
12 Factor Apps
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-04T00:00:00+00:00" itemprop="datePublished">
October 04, 2015
</time>
</span> »
<a href="/pair-programming/">
Pair Programming
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-07-01T00:00:00+00:00" itemprop="datePublished">
July 01, 2015
</time>
</span> »
<a href="/ocp/">
Open/closed principle Example in Python
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-06-24T00:00:00+00:00" itemprop="datePublished">
June 24, 2015
</time>
</span> »
<a href="/coding/">
Coding
</a>
</li>
</ul>
<h2 id="docker">docker</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-11T00:00:00+00:00" itemprop="datePublished">
November 11, 2016
</time>
</span> »
<a href="/<API key>/">
Add existed Docker host to docker-machine
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-24T00:00:00+00:00" itemprop="datePublished">
March 24, 2016
</time>
</span> »
<a href="/<API key>/">
Selectively disable caching for specific RUN commands in Dockerfile
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-04T00:00:00+00:00" itemprop="datePublished">
March 04, 2016
</time>
</span> »
<a href="/docker-cron/">
Crontab on Docker
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-03T00:00:00+00:00" itemprop="datePublished">
March 03, 2016
</time>
</span> »
<a href="/<API key>/">
Reduce docker image size
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-09-11T00:00:00+00:00" itemprop="datePublished">
September 11, 2014
</time>
</span> »
<a href="/docker/">
Docker.io
</a>
</li>
</ul>
<h2 id="english">english</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-07-30T00:00:00+00:00" itemprop="datePublished">
July 30, 2015
</time>
</span> »
<a href="/grammar/">
Grammar check
</a>
</li>
</ul>
<h2 id="es7">es7</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-13T00:00:00+00:00" itemprop="datePublished">
November 13, 2016
</time>
</span> »
<a href="/async-await/">
Async Await
</a>
</li>
</ul>
<h2 id="git">git</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-03T00:00:00+00:00" itemprop="datePublished">
November 03, 2016
</time>
</span> »
<a href="/git-ignore-sub-dir/">
Git ignore files in sub-directories
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-02T00:00:00+00:00" itemprop="datePublished">
November 02, 2016
</time>
</span> »
<a href="/git-conflicts/">
Git conflicts
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-10-25T00:00:00+00:00" itemprop="datePublished">
October 25, 2016
</time>
</span> »
<a href="/<API key>/">
Git Submodule and Git Subtree
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-06-14T00:00:00+00:00" itemprop="datePublished">
June 14, 2016
</time>
</span> »
<a href="/git-bisect/">
Git Bisect
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-12-25T00:00:00+00:00" itemprop="datePublished">
December 25, 2015
</time>
</span> »
<a href="/avoid-git-commit-m/">
Avoid git commit -m
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-29T00:00:00+00:00" itemprop="datePublished">
July 29, 2014
</time>
</span> »
<a href="/git/">
Git
</a>
</li>
</ul>
<h2 id="jekyll">jekyll</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-26T00:00:00+00:00" itemprop="datePublished">
October 26, 2015
</time>
</span> »
<a href="/<API key>/">
Jekyll build with Travis and deploy to Github Page
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-18T00:00:00+00:00" itemprop="datePublished">
October 18, 2015
</time>
</span> »
<a href="/read-more-jekyll/">
Read more feature on jekyll
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-12T00:00:00+00:00" itemprop="datePublished">
October 12, 2015
</time>
</span> »
<a href="/opengraph/">
Sharing with Open Graph
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-09-23T00:00:00+00:00" itemprop="datePublished">
September 23, 2015
</time>
</span> »
<a href="/jekyll-with-ci/">
Jekyll with Continuous Integration
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-16T00:00:00+00:00" itemprop="datePublished">
June 16, 2014
</time>
</span> »
<a href="/<API key>/">
How to set up this blog
</a>
</li>
</ul>
<h2 id="jobs">jobs</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-21T00:00:00+00:00" itemprop="datePublished">
October 21, 2015
</time>
</span> »
<a href="/get-job/">
How to get that job for developer
</a>
</li>
</ul>
<h2 id="js">js</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-15T00:00:00+00:00" itemprop="datePublished">
November 15, 2016
</time>
</span> »
<a href="/babel/">
Babel
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-13T00:00:00+00:00" itemprop="datePublished">
November 13, 2016
</time>
</span> »
<a href="/async-await/">
Async Await
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-10T00:00:00+00:00" itemprop="datePublished">
November 10, 2016
</time>
</span> »
<a href="/redux/">
Redux
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-04T00:00:00+00:00" itemprop="datePublished">
November 04, 2016
</time>
</span> »
<a href="/react/">
React
</a>
</li>
</ul>
<h2 id="jwt">jwt</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-30T00:00:00+00:00" itemprop="datePublished">
November 30, 2016
</time>
</span> »
<a href="/jwt/">
JWT
</a>
</li>
</ul>
<h2 id="keyboard">keyboard</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-26T00:00:00+00:00" itemprop="datePublished">
March 26, 2016
</time>
</span> »
<a href="/colemak/">
Colemak Keyboard Layout
</a>
</li>
</ul>
<h2 id="latex">latex</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-02-07T00:00:00+00:00" itemprop="datePublished">
February 07, 2015
</time>
</span> »
<a href="/latex/">
All about Latex
</a>
</li>
</ul>
<h2 id="learn">learn</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-12-12T00:00:00+00:00" itemprop="datePublished">
December 12, 2015
</time>
</span> »
<a href="/learning/">
Learning Resources
</a>
</li>
</ul>
<h2 id="markdown">markdown</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-10T00:00:00+00:00" itemprop="datePublished">
October 10, 2015
</time>
</span> »
<a href="/slide/">
Markdown Slide
</a>
</li>
</ul>
<h2 id="mongo">mongo</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-06-28T00:00:00+00:00" itemprop="datePublished">
June 28, 2016
</time>
</span> »
<a href="/mongo-search/">
Mongo Search
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-29T00:00:00+00:00" itemprop="datePublished">
March 29, 2016
</time>
</span> »
<a href="/mongo/">
All I know about mongo
</a>
</li>
</ul>
<h2 id="nosql">nosql</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-29T00:00:00+00:00" itemprop="datePublished">
March 29, 2016
</time>
</span> »
<a href="/mongo/">
All I know about mongo
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-24T00:00:00+00:00" itemprop="datePublished">
March 24, 2016
</time>
</span> »
<a href="/cassandra/">
What I know about Apache Cassandra
</a>
</li>
</ul>
<h2 id="osx">osx</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-19T00:00:00+00:00" itemprop="datePublished">
October 19, 2015
</time>
</span> »
<a href="/<API key>/">
Convert File Encoding in OSX
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-08-27T00:00:00+00:00" itemprop="datePublished">
August 27, 2015
</time>
</span> »
<a href="/dev-tools/">
OSX Dev Tools
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-09-08T00:00:00+00:00" itemprop="datePublished">
September 08, 2014
</time>
</span> »
<a href="/osx-backup/">
OSX Backup
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-17T00:00:00+00:00" itemprop="datePublished">
June 17, 2014
</time>
</span> »
<a href="/osx-write-ntfs/">
Enable NTFS write on OSX
</a>
</li>
</ul>
<h2 id="productivity">productivity</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-09-14T00:00:00+00:00" itemprop="datePublished">
September 14, 2015
</time>
</span> »
<a href="/pomodoro/">
Pomodoro Technique
</a>
</li>
</ul>
<h2 id="python">python</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-04T00:00:00+00:00" itemprop="datePublished">
October 04, 2015
</time>
</span> »
<a href="/fp-python/">
Functional Programming in Python
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-07-30T00:00:00+00:00" itemprop="datePublished">
July 30, 2015
</time>
</span> »
<a href="/line/">
Python Line API
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-07-01T00:00:00+00:00" itemprop="datePublished">
July 01, 2015
</time>
</span> »
<a href="/ocp/">
Open/closed principle Example in Python
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-24T00:00:00+00:00" itemprop="datePublished">
July 24, 2014
</time>
</span> »
<a href="/mock/">
Mock
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-20T00:00:00+00:00" itemprop="datePublished">
July 20, 2014
</time>
</span> »
<a href="/watchdog/">
Watchdog
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-11T00:00:00+00:00" itemprop="datePublished">
July 11, 2014
</time>
</span> »
<a href="/python-testing/">
Python Testing
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-08T00:00:00+00:00" itemprop="datePublished">
June 08, 2014
</time>
</span> »
<a href="/python/">
All about Python
</a>
</li>
</ul>
<h2 id="qutoes">qutoes</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2014-11-26T00:00:00+00:00" itemprop="datePublished">
November 26, 2014
</time>
</span> »
<a href="/quotes/">
Dev Qutoes
</a>
</li>
</ul>
<h2 id="react">react</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-04T00:00:00+00:00" itemprop="datePublished">
November 04, 2016
</time>
</span> »
<a href="/react/">
React
</a>
</li>
</ul>
<h2 id="redux">redux</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-10T00:00:00+00:00" itemprop="datePublished">
November 10, 2016
</time>
</span> »
<a href="/redux/">
Redux
</a>
</li>
</ul>
<h2 id="robot-framework">robot-framework</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-08-30T00:00:00+00:00" itemprop="datePublished">
August 30, 2015
</time>
</span> »
<a href="/robot-packtpub/">
Robot Packtpub
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-09-15T00:00:00+00:00" itemprop="datePublished">
September 15, 2014
</time>
</span> »
<a href="/robot-framework/">
Robot Framework
</a>
</li>
</ul>
<h2 id="ror">ror</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-12-12T00:00:00+00:00" itemprop="datePublished">
December 12, 2015
</time>
</span> »
<a href="/ror/">
All About Ruby and Ruby on Rails
</a>
</li>
</ul>
<h2 id="security">security</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-01-09T00:00:00+00:00" itemprop="datePublished">
January 09, 2016
</time>
</span> »
<a href="/password-manager/">
Password Manager
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-02-05T00:00:00+00:00" itemprop="datePublished">
February 05, 2015
</time>
</span> »
<a href="/Security/">
All about Security
</a>
</li>
</ul>
<h2 id="smtp">smtp</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2014-07-28T00:00:00+00:00" itemprop="datePublished">
July 28, 2014
</time>
</span> »
<a href="/smtp/">
Smtp with gmail
</a>
</li>
</ul>
<h2 id="ssh">ssh</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-04-06T00:00:00+00:00" itemprop="datePublished">
April 06, 2015
</time>
</span> »
<a href="/ssh/">
All about Secure Shell
</a>
</li>
</ul>
<h2 id="startup">startup</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-01T00:00:00+00:00" itemprop="datePublished">
October 01, 2015
</time>
</span> »
<a href="/startup/">
Start Up
</a>
</li>
</ul>
<h2 id="testdisk">testdisk</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-22T00:00:00+00:00" itemprop="datePublished">
June 22, 2014
</time>
</span> »
<a href="/<API key>/">
Recover lost partition
</a>
</li>
</ul>
<h2 id="tmux">tmux</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-09T00:00:00+00:00" itemprop="datePublished">
June 09, 2014
</time>
</span> »
<a href="/tmux/">
Tmux
</a>
</li>
</ul>
<h2 id="unix">unix</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-03-27T00:00:00+00:00" itemprop="datePublished">
March 27, 2016
</time>
</span> »
<a href="/dotfile/">
Dotfile
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-17T00:00:00+00:00" itemprop="datePublished">
October 17, 2015
</time>
</span> »
<a href="/text-processing/">
Text Processing in Shell
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-09-10T00:00:00+00:00" itemprop="datePublished">
September 10, 2014
</time>
</span> »
<a href="/debian/">
Debian frist boot
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-27T00:00:00+00:00" itemprop="datePublished">
June 27, 2014
</time>
</span> »
<a href="/unix/">
Unix
</a>
</li>
</ul>
<h2 id="vim">vim</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-29T00:00:00+00:00" itemprop="datePublished">
November 29, 2016
</time>
</span> »
<a href="/<API key>/">
Vim Grep then Substitute
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-02T00:00:00+00:00" itemprop="datePublished">
November 02, 2016
</time>
</span> »
<a href="/git-conflicts/">
Git conflicts
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-01T00:00:00+00:00" itemprop="datePublished">
November 01, 2016
</time>
</span> »
<a href="/<API key>/">
Vim Change Multiple files
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-09-07T00:00:00+00:00" itemprop="datePublished">
September 07, 2015
</time>
</span> »
<a href="/vim-plugins/">
Vim Plugins
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-09-07T00:00:00+00:00" itemprop="datePublished">
September 07, 2015
</time>
</span> »
<a href="/vim-command/">
Vim Command
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2015-01-23T00:00:00+00:00" itemprop="datePublished">
January 23, 2015
</time>
</span> »
<a href="/vimdiff/">
Vimdiff Custom
</a>
</li>
<li itemscope="">
<span class="entry-date">
<time datetime="2014-06-09T00:00:00+00:00" itemprop="datePublished">
June 09, 2014
</time>
</span> »
<a href="/vim/">
Vim
</a>
</li>
</ul>
<h2 id="vpn">vpn</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-11-12T00:00:00+00:00" itemprop="datePublished">
November 12, 2016
</time>
</span> »
<a href="/vpn/">
Open VPN
</a>
</li>
</ul>
<h2 id="website">website</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2015-10-12T00:00:00+00:00" itemprop="datePublished">
October 12, 2015
</time>
</span> »
<a href="/opengraph/">
Sharing with Open Graph
</a>
</li>
</ul>
<h2 id="wordpress">wordpress</h2>
<ul class="posts">
<li itemscope="">
<span class="entry-date">
<time datetime="2016-01-26T00:00:00+00:00" itemprop="datePublished">
January 26, 2016
</time>
</span> »
<a href="/wordpress/">
All about Wordpress
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<label for="sidebar-checkbox" class="sidebar-toggle"></label>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'im-bot'; // required: replace example with your forum shortname
// var disqus_developer = 1; // Comment out when the site is live
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.<API key>('HEAD')[0] || document.<API key>('BODY')[0]).appendChild(s);
}());
</script>
</body>
<!-- <API key> -->
<script src="/js/search.min.js" type="text/javascript" charset="utf-8"></script>
<script id="<API key>" type="text/mustache">
{{#entries}}
<article>
<h3>
{{#date}}<small><time datetime="{{pubdate}}" pubdate>{{displaydate}}</time></small>{{/date}}
<a href="{{url}}">{{title}}</a>
</h3>
</article>
{{/entries}}
</script>
<script type="text/javascript">
$(function() {
$('#search-query').lunrSearch({
indexUrl: '/js/index.json', // Url for the .json file containing search index data
results : '#search-results', // selector for containing search results element
entries : '.entries', // selector for search entries containing element (contained within results above)
template: '#<API key>' // selector for Mustache.js template
});
});
$("#<API key>").click(function(){
$('#search-query').val('');
$('#search-results').hide();
});
</script>
</html> |
<?php
namespace App\SecurityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class <API key> extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/hello/Fabien');
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
}
} |
package com.sonyericsson.extras.liveware.extension.util.control;
import com.sonyericsson.extras.liveware.aef.control.Control;
import com.sonyericsson.extras.liveware.aef.registration.Registration;
import com.sonyericsson.extras.liveware.aef.registration.Registration.Device;
import com.sonyericsson.extras.liveware.aef.registration.Registration.DeviceColumns;
import com.sonyericsson.extras.liveware.aef.registration.Registration.HostApp;
import com.sonyericsson.extras.liveware.aef.registration.Registration.HostAppColumns;
import com.sonyericsson.extras.liveware.extension.util.Dbg;
import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewGroup;
import java.io.<API key>;
/**
* The control extension handles a control on an accessory.
*/
public abstract class ControlExtension {
private static final int STATE_CREATED = 0;
private static final int STATE_STARTED = 1;
private static final int STATE_FOREGROUND = 2;
private int mState = STATE_CREATED;
protected final Context mContext;
protected final String mHostAppPackageName;
protected final BitmapFactory.Options mBitmapOptions;
/**
* Create control extension.
*
* @param context The context.
* @param hostAppPackageName Package name of host application.
*/
public ControlExtension(final Context context, final String hostAppPackageName) {
if (context == null) {
throw new <API key>("context == null");
}
mContext = context;
mHostAppPackageName = hostAppPackageName;
// Set some default bitmap factory options that we frequently will use.
mBitmapOptions = new BitmapFactory.Options();
// We use default throughout the extension to avoid any automatic
// scaling.
// Keep in mind that we are not showing the images on the phone, but on
// the accessory.
mBitmapOptions.inDensity = DisplayMetrics.DENSITY_DEFAULT;
mBitmapOptions.inTargetDensity = DisplayMetrics.DENSITY_DEFAULT;
}
/**
* Start control.
*/
public final void start() {
mState = STATE_STARTED;
onStart();
}
/**
* Resume control.
*/
public final void resume() {
mState = STATE_FOREGROUND;
onResume();
}
/**
* Pause control.
*/
public final void pause() {
mState = STATE_STARTED;
onPause();
}
/**
* Stop control.
*/
public final void stop() {
// If in foreground then pause it.
if (mState == STATE_FOREGROUND) {
pause();
}
mState = STATE_CREATED;
onStop();
}
/**
* Destroy control.
*/
public final void destroy() {
// If in foreground then pause it.
if (mState == STATE_FOREGROUND) {
pause();
}
// If started then stop it.
if (mState == STATE_STARTED) {
stop();
}
// No state for destroyed.
onDestroy();
}
/**
* Take action based on request code
*
* @param requestCode Code used to distinguish between different actions.
* @param bundle Optional bundle with additional information.
* @see com.sonyericsson.extras.liveware.extension.util.ExtensionService#<API key>(int, Bundle)
*/
public void onDoAction(int requestCode, Bundle bundle) {
}
/**
* Called to notify a control extension that it is no longer used and is
* being removed. The control extension should clean up any resources it
* holds (threads, registered receivers, etc) at this point.
*/
public void onDestroy() {
}
/**
* Called when the control extension is started by the host application.
*/
public void onStart() {
}
/**
* Called when the control extension is stopped by the host application.
*/
public void onStop() {
}
/**
* Called when the control extension is paused by the host application.
*/
public void onPause() {
}
/**
* Called when the control extension is resumed by the host application. The
* extension is expected to send a new image each time it is resumed.
*/
public void onResume() {
}
/**
* Called when host application reports an error.
*
* @param code The reported error code.
* {@link Control.Intents#EXTRA_ERROR_CODE}
*/
public void onError(final int code) {
}
/**
* Called when a key event has occurred.
*
* @param action The key action, one of
* <ul>
* <li> {@link Control.Intents#ACTION_LONGPRESS}</li>
* <li> {@link Control.Intents#ACTION_PRESS}</li>
* <li> {@link Control.Intents#ACTION_RELEASE}</li>
* </ul>
* @param keyCode The key code.
* @param timeStamp The time when the event occurred.
*/
public void onKey(final int action, final int keyCode, final long timeStamp) {
}
/**
* Called when a touch event has occurred.
*
* @param event The touch event.
*/
public void onTouch(final ControlTouchEvent event) {
}
/**
* Called when an object click event has occurred.
*
* @param event The object click event.
*/
public void onObjectClick(final <API key> event) {
}
/**
* Called when a swipe event has occurred
*
* @param direction The swipe direction, one of
* <ul>
* <li> {@link Control.Intents#DIRECTION_DOWN}</li>
* <li> {@link Control.Intents#DIRECTION_LEFT}</li>
* <li> {@link Control.Intents#DIRECTION_RIGHT}</li>
* <li> {@link Control.Intents#DIRECTION_UP}</li>
* </ul>
*/
public void onSwipe(int direction) {
}
/**
* Called when the host application requests content for a specific list
* item.
*
* @param layoutReference The referenced list view
* @param listItemPosition The referenced list item position
*/
public void onRequestListItem(final int layoutReference, final int listItemPosition) {
}
/**
* Called when an item in a list has been clicked.
*
* @param listItem The list item that was clicked
* @param clickType The type of click (long, short)
* @param itemLayoutReference The object within the list item that was
* clicked
*/
public void onListItemClick(final ControlListItem listItem, final int clickType,
final int itemLayoutReference) {
}
/**
* Called when an item in a list has been clicked.
*
* @param layoutReference The referenced list view
*/
public void <API key>(final int layoutReference) {
}
/**
* Called when an item in a list has been selected.
*
* @param listItem The list item that was selected
*/
public void onListItemSelected(final ControlListItem listItem) {
}
/**
* Called when a menu item has been selected.
*
* @param menuItem The menu item that was selected
*/
public void onMenuItemSelected(final int menuItem) {
}
/**
* Called when the accessory screen's state leaves or enters Active Low
* Power mode
*
* @param lowPowerModeOn true when the low power mode is started, false when
* the accessory screen leaves Active Low power mode
*/
public void <API key>(final boolean lowPowerModeOn) {
}
/**
* Send request to start to host application.
*/
protected void startRequest() {
if (Dbg.DEBUG) {
Dbg.d("Sending start request");
}
Intent intent = new Intent(Control.Intents.<API key>);
sendToHostApp(intent);
}
/**
* Send request to stop to host application.
*/
protected void stopRequest() {
if (Dbg.DEBUG) {
Dbg.d("Sending stop request");
}
Intent intent = new Intent(Control.Intents.<API key>);
sendToHostApp(intent);
}
/**
* Show an image on the accessory.
*
* @param resourceId The image resource id.
*/
protected void showImage(final int resourceId) {
if (Dbg.DEBUG) {
Dbg.d("showImage: " + resourceId);
}
Intent intent = new Intent();
intent.setAction(Control.Intents.<API key>);
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), resourceId, mBitmapOptions);
<API key> os = new <API key>(256);
bitmap.compress(CompressFormat.PNG, 100, os);
byte[] buffer = os.toByteArray();
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
sendToHostApp(intent);
}
/**
* Show a layout on the accessory.
*
* @param layoutId The layout resource id.
* @param layoutData The layout data.
*/
protected void showLayout(final int layoutId, final Bundle[] layoutData) {
if (Dbg.DEBUG) {
Dbg.d("showLayout");
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutId);
if (layoutData != null && layoutData.length > 0) {
intent.putExtra(Control.Intents.EXTRA_LAYOUT_DATA, layoutData);
}
sendToHostApp(intent);
}
/**
* Update an image in a specific layout, on the accessory.
*
* @param layoutReference The referenced resource within the current layout.
* @param resourceId The image resource id.
*/
protected void sendImage(final int layoutReference, final int resourceId) {
if (Dbg.DEBUG) {
Dbg.d("sendImage");
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
intent.putExtra(Control.Intents.EXTRA_DATA_URI,
ExtensionUtils.getUriString(mContext, resourceId));
sendToHostApp(intent);
}
/**
* Update an image in a specific layout, on the accessory.
*
* @param layoutReference The referenced resource within the current layout.
* @param bitmap The bitmap to show.
*/
protected void sendImage(final int layoutReference, final Bitmap bitmap) {
if (Dbg.DEBUG) {
Dbg.d("sendImage");
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
<API key> os = new <API key>(256);
bitmap.compress(CompressFormat.PNG, 100, os);
byte[] buffer = os.toByteArray();
intent.putExtra(Control.Intents.EXTRA_DATA, buffer);
sendToHostApp(intent);
}
/**
* Update text in a specific layout, on the accessory. TODO: This should be
* moved to ControlExtension
*
* @param layoutReference The referenced resource within the current layout.
* @param resourceId The image resource id.
*/
protected void sendText(final int layoutReference, final String text) {
if (Dbg.DEBUG) {
Dbg.d("sendText: " + text);
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
intent.putExtra(Control.Intents.EXTRA_TEXT, text);
sendToHostApp(intent);
}
/**
* Show bitmap on accessory.
*
* @param bitmap The bitmap to show.
*/
protected void showBitmap(final Bitmap bitmap) {
showBitmap(bitmap, 0, 0);
}
/**
* Show bitmap on accessory. Used when only updating part of the screen.
*
* @param bitmap The bitmap to show.
* @param x The x position.
* @param y The y position.
*/
protected void showBitmap(final Bitmap bitmap, final int x, final int y) {
if (Dbg.DEBUG) {
Dbg.v("showBitmap x: " + x + " y: " + y);
}
<API key> outputStream = new <API key>(256);
bitmap.compress(CompressFormat.PNG, 100, outputStream);
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.EXTRA_X_OFFSET, x);
intent.putExtra(Control.Intents.EXTRA_Y_OFFSET, y);
intent.putExtra(Control.Intents.EXTRA_DATA, outputStream.toByteArray());
sendToHostApp(intent);
}
/**
* Set the accessory screens state.
*
* @param state The screen state.
* @see Control.Intents#SCREEN_STATE_AUTO
* @see Control.Intents#SCREEN_STATE_DIM
* @see Control.Intents#SCREEN_STATE_OFF
* @see Control.Intents#SCREEN_STATE_ON
*/
protected void setScreenState(final int state) {
if (Dbg.DEBUG) {
Dbg.d("setScreenState: " + state);
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.EXTRA_SCREEN_STATE, state);
sendToHostApp(intent);
}
/**
* Start repeating vibrator
*
* @param onDuration On duration in milliseconds.
* @param offDuration Off duration in milliseconds.
* @param repeats The number of repeats of the on/off pattern. Use
* {@link Control.Intents#<API key>} to repeat
* until explicitly stopped.
*/
protected void startVibrator(int onDuration, int offDuration, int repeats) {
if (Dbg.DEBUG) {
Dbg.v("startVibrator: onDuration: " + onDuration + ", offDuration: " + offDuration
+ ", repeats: " + repeats);
}
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.EXTRA_ON_DURATION, onDuration);
intent.putExtra(Control.Intents.EXTRA_OFF_DURATION, offDuration);
intent.putExtra(Control.Intents.EXTRA_REPEATS, repeats);
sendToHostApp(intent);
}
/**
* Stop vibrator.
*/
protected void stopVibrator() {
if (Dbg.DEBUG) {
Dbg.v("Vibrator stop");
}
Intent intent = new Intent(Control.Intents.<API key>);
sendToHostApp(intent);
}
/**
* Start a LED pattern.
*
* @param id Id of the LED to be controlled.
* @param color Color you want the LED to blink with.
* @param onDuration On duration in milliseconds.
* @param offDuration Off duration in milliseconds.
* @param repeats The number of repeats of the on/off pattern. Use
* {@link Control.Intents#<API key>} to repeat
* until explicitly stopped.
*/
protected void startLedPattern(int id, int color, int onDuration, int offDuration, int repeats) {
if (Dbg.DEBUG) {
Dbg.v("startLedPattern: id: " + id + ", color: " + color + "onDuration: " + onDuration
+ ", offDuration: " + offDuration + ", repeats: " + repeats);
}
Intent intent = new Intent(Control.Intents.CONTROL_LED_INTENT);
intent.putExtra(Control.Intents.EXTRA_LED_ID, id);
intent.putExtra(Control.Intents.EXTRA_LED_COLOR, color);
intent.putExtra(Control.Intents.EXTRA_ON_DURATION, onDuration);
intent.putExtra(Control.Intents.EXTRA_OFF_DURATION, offDuration);
intent.putExtra(Control.Intents.EXTRA_REPEATS, repeats);
sendToHostApp(intent);
}
/**
* Turn led off
*
* @param id Id of the LED to be controlled.
*/
protected void stopLedPattern(int id) {
if (Dbg.DEBUG) {
Dbg.v("stopLedPattern: id: " + id);
}
Intent intent = new Intent(Control.Intents.CONTROL_LED_INTENT);
intent.putExtra(Control.Intents.EXTRA_LED_ID, id);
sendToHostApp(intent);
}
/**
* Clear accessory diplay.
*/
protected void clearDisplay() {
if (Dbg.DEBUG) {
Dbg.v("Clear display");
}
Intent intent = new Intent(Control.Intents.<API key>);
sendToHostApp(intent);
}
protected void sendListCount(int layoutReference, int listCount) {
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
intent.putExtra(Control.Intents.EXTRA_LIST_COUNT, listCount);
sendToHostApp(intent);
}
protected void <API key>(int layoutReference, int listCount, Bundle[] bundles) {
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
intent.putExtra(Control.Intents.EXTRA_LIST_COUNT, listCount);
intent.putExtra(Control.Intents.EXTRA_LIST_CONTENT, bundles);
sendToHostApp(intent);
}
protected void sendListItem(ControlListItem item) {
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, item.layoutReference);
intent.putExtra(Control.Intents.<API key>, item.dataXmlLayout);
if (item.listItemId != -1) {
intent.putExtra(Control.Intents.EXTRA_LIST_ITEM_ID, item.listItemId);
}
if (item.listItemPosition != -1) {
intent.putExtra(Control.Intents.<API key>, item.listItemPosition);
}
if (item.layoutData != null && item.layoutData.length > 0) {
intent.putExtra(Control.Intents.EXTRA_LAYOUT_DATA, item.layoutData);
}
sendToHostApp(intent);
}
/**
* Sends a request to host app to move a list to a specified position
*
* @param layoutReference The referenced list view
* @param listItemPosition The referenced list item position
*/
protected void sendListPosition(int layoutReference, int position) {
Intent intent = new Intent(Control.Intents.<API key>);
intent.putExtra(Control.Intents.<API key>, layoutReference);
intent.putExtra(Control.Intents.<API key>, position);
sendToHostApp(intent);
}
protected void showMenu(Bundle[] menuItems) {
Intent intent = new Intent(Control.Intents.CONTROL_MENU_SHOW);
intent.putExtra(Control.Intents.EXTRA_MENU_ITEMS, menuItems);
sendToHostApp(intent);
}
/**
* Send intent to host application. Adds host application package name and
* our package name.
*
* @param intent The intent to send.
*/
protected void sendToHostApp(final Intent intent) {
intent.putExtra(Control.Intents.<API key>, mContext.getPackageName());
intent.setPackage(mHostAppPackageName);
mContext.sendBroadcast(intent, Registration.HOSTAPP_PERMISSION);
}
/**
* Get the host application id for this control.
*
* @return The host application id.
*/
protected long getHostAppId() {
Cursor cursor = null;
try {
cursor = mContext.getContentResolver().query(HostApp.URI,
new String[] {
HostAppColumns._ID
}, HostAppColumns.PACKAGE_NAME + " = ?",
new String[] {
mHostAppPackageName
}, null);
if (cursor != null && cursor.moveToFirst()) {
return cursor.getLong(cursor.<API key>(HostAppColumns._ID));
}
} catch (SQLException | SecurityException | <API key> e) {
if (Dbg.DEBUG) {
Dbg.w("Failed to query host apps", e);
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return -1;
}
/**
* Check if this host application has a vibrator.
*
* @return True if vibrator exists.
*/
protected boolean hasVibrator() {
long hostAppId = getHostAppId();
Cursor cursor = null;
try {
cursor = mContext.getContentResolver().query(
Device.URI,
new String[] {
DeviceColumns.VIBRATOR
},
DeviceColumns.HOST_APPLICATION_ID + " = " + hostAppId + " AND "
+ DeviceColumns.VIBRATOR + " = 1", null, null);
if (cursor != null) {
return (cursor.getCount() > 0);
}
} catch (SQLException | SecurityException | <API key> exception) {
if (Dbg.DEBUG) {
Dbg.e("Failed to query vibrator", exception);
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return false;
}
protected ControlViewGroup parseLayout(View v) {
ControlViewGroup controlViewGroup = new ControlViewGroup();
controlViewGroup.addView(new ControlView(v));
if (v instanceof ViewGroup) {
parseLayoutTraverse((ViewGroup)v, controlViewGroup);
}
return controlViewGroup;
}
private void parseLayoutTraverse(ViewGroup v, ControlViewGroup controlViewGroup) {
for (int i = 0; i < v.getChildCount(); i++) {
View current = v.getChildAt(i);
controlViewGroup.addView(new ControlView(current));
if (current instanceof ViewGroup) {
parseLayoutTraverse((ViewGroup)current, controlViewGroup);
}
}
}
} |
layout: post
category: web
title: margin
tagline: by TopGrd
tags: [css]
<!--more
##margin
marginmargin
2div idabcss:
width:100px;
height:100px;
background:red;
margin:10px;
}
width:100px;
height:100px;
background:red;
margin:10px;
}
10px20px10px

css10px20px
margin
cssfloatmargin
width:100px;
height:100px;
background:red;
margin:10px;
float:left;
}
width:100px;
height:100px;
background:red;
margin:10px;
float:left;
clear:left;
}

ab20px
##IE6floatmargin
IE6IE6`display:inline` |
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.batchai.implementation;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.<API key>;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.batchai.fluent.ExperimentsClient;
import com.azure.resourcemanager.batchai.fluent.models.ExperimentInner;
import com.azure.resourcemanager.batchai.models.<API key>;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in ExperimentsClient. */
public final class <API key> implements ExperimentsClient {
private final ClientLogger logger = new ClientLogger(<API key>.class);
/** The proxy service used to perform REST calls. */
private final ExperimentsService service;
/** The service client containing this operation class. */
private final BatchAIImpl client;
/**
* Initializes an instance of <API key>.
*
* @param client the instance of the service client containing this operation class.
*/
<API key>(BatchAIImpl client) {
this.service =
RestProxy.create(ExperimentsService.class, client.getHttpPipeline(), client.<API key>());
this.client = client;
}
/**
* The interface defining all the services for BatchAIExperiments to be used by the proxy service to perform REST
* calls.
*/
@Host("{$host}")
@ServiceInterface(name = "BatchAIExperiments")
private interface ExperimentsService {
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces"
+ "/{workspaceName}/experiments")
@ExpectedResponses({200})
@<API key>(ManagementException.class)
Mono<Response<<API key>>> listByWorkspace(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("workspaceName") String workspaceName,
@QueryParam("maxresults") Integer maxResults,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces"
+ "/{workspaceName}/experiments/{experimentName}")
@ExpectedResponses({200, 202})
@<API key>(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> create(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("workspaceName") String workspaceName,
@PathParam("experimentName") String experimentName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces"
+ "/{workspaceName}/experiments/{experimentName}")
@ExpectedResponses({200, 202, 204})
@<API key>(ManagementException.class)
Mono<Response<Flux<ByteBuffer>>> delete(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("workspaceName") String workspaceName,
@PathParam("experimentName") String experimentName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/workspaces"
+ "/{workspaceName}/experiments/{experimentName}")
@ExpectedResponses({200})
@<API key>(ManagementException.class)
Mono<Response<ExperimentInner>> get(
@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("workspaceName") String workspaceName,
@PathParam("experimentName") String experimentName,
@QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get("{nextLink}")
@ExpectedResponses({200})
@<API key>(ManagementException.class)
Mono<Response<<API key>>> listByWorkspaceNext(
@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept,
Context context);
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ExperimentInner>> <API key>(
String resourceGroupName, String workspaceName, Integer maxResults) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.listByWorkspace(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
maxResults,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.<PagedResponse<ExperimentInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ExperimentInner>> <API key>(
String resourceGroupName, String workspaceName, Integer maxResults, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByWorkspace(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
maxResults,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<ExperimentInner> <API key>(
String resourceGroupName, String workspaceName, Integer maxResults) {
return new PagedFlux<>(
() -> <API key>(resourceGroupName, workspaceName, maxResults),
nextLink -> <API key>(nextLink));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<ExperimentInner> <API key>(String resourceGroupName, String workspaceName) {
final Integer maxResults = null;
return new PagedFlux<>(
() -> <API key>(resourceGroupName, workspaceName, maxResults),
nextLink -> <API key>(nextLink));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<ExperimentInner> <API key>(
String resourceGroupName, String workspaceName, Integer maxResults, Context context) {
return new PagedFlux<>(
() -> <API key>(resourceGroupName, workspaceName, maxResults, context),
nextLink -> <API key>(nextLink, context));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<ExperimentInner> listByWorkspace(String resourceGroupName, String workspaceName) {
final Integer maxResults = null;
return new PagedIterable<>(<API key>(resourceGroupName, workspaceName, maxResults));
}
/**
* Gets a list of Experiments within the specified Workspace.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments within the specified Workspace.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<ExperimentInner> listByWorkspace(
String resourceGroupName, String workspaceName, Integer maxResults, Context context) {
return new PagedIterable<>(<API key>(resourceGroupName, workspaceName, maxResults, context));
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> <API key>(
String resourceGroupName, String workspaceName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.create(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> <API key>(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.create(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context);
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ExperimentInner>, ExperimentInner> beginCreateAsync(
String resourceGroupName, String workspaceName, String experimentName) {
Mono<Response<Flux<ByteBuffer>>> mono =
<API key>(resourceGroupName, workspaceName, experimentName);
return this
.client
.<ExperimentInner, ExperimentInner>getLroResult(
mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, Context.NONE);
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<ExperimentInner>, ExperimentInner> beginCreateAsync(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
<API key>(resourceGroupName, workspaceName, experimentName, context);
return this
.client
.<ExperimentInner, ExperimentInner>getLroResult(
mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context);
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ExperimentInner>, ExperimentInner> beginCreate(
String resourceGroupName, String workspaceName, String experimentName) {
return beginCreateAsync(resourceGroupName, workspaceName, experimentName).getSyncPoller();
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ExperimentInner>, ExperimentInner> beginCreate(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return beginCreateAsync(resourceGroupName, workspaceName, experimentName, context).getSyncPoller();
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ExperimentInner> createAsync(String resourceGroupName, String workspaceName, String experimentName) {
return beginCreateAsync(resourceGroupName, workspaceName, experimentName)
.last()
.flatMap(this.client::<API key>);
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ExperimentInner> createAsync(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return beginCreateAsync(resourceGroupName, workspaceName, experimentName, context)
.last()
.flatMap(this.client::<API key>);
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner create(String resourceGroupName, String workspaceName, String experimentName) {
return createAsync(resourceGroupName, workspaceName, experimentName).block();
}
/**
* Creates an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return experiment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner create(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return createAsync(resourceGroupName, workspaceName, experimentName, context).block();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> <API key>(
String resourceGroupName, String workspaceName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.delete(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> <API key>(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
String resourceGroupName, String workspaceName, String experimentName) {
Mono<Response<Flux<ByteBuffer>>> mono =
<API key>(resourceGroupName, workspaceName, experimentName);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
<API key>(resourceGroupName, workspaceName, experimentName, context);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String workspaceName, String experimentName) {
return beginDeleteAsync(resourceGroupName, workspaceName, experimentName).getSyncPoller();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<Void>, Void> beginDelete(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return beginDeleteAsync(resourceGroupName, workspaceName, experimentName, context).getSyncPoller();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> deleteAsync(String resourceGroupName, String workspaceName, String experimentName) {
return beginDeleteAsync(resourceGroupName, workspaceName, experimentName)
.last()
.flatMap(this.client::<API key>);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Void> deleteAsync(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return beginDeleteAsync(resourceGroupName, workspaceName, experimentName, context)
.last()
.flatMap(this.client::<API key>);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String workspaceName, String experimentName) {
deleteAsync(resourceGroupName, workspaceName, experimentName).block();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String workspaceName, String experimentName, Context context) {
deleteAsync(resourceGroupName, workspaceName, experimentName, context).block();
}
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return information about an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<ExperimentInner>> <API key>(
String resourceGroupName, String workspaceName, String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.get(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return information about an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<ExperimentInner>> <API key>(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new <API key>("Parameter resourceGroupName is required and cannot be null."));
}
if (workspaceName == null) {
return Mono.error(new <API key>("Parameter workspaceName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new <API key>("Parameter experimentName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
resourceGroupName,
workspaceName,
experimentName,
this.client.getApiVersion(),
this.client.getSubscriptionId(),
accept,
context);
}
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return information about an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ExperimentInner> getAsync(String resourceGroupName, String workspaceName, String experimentName) {
return <API key>(resourceGroupName, workspaceName, experimentName)
.flatMap(
(Response<ExperimentInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
}
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return information about an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner get(String resourceGroupName, String workspaceName, String experimentName) {
return getAsync(resourceGroupName, workspaceName, experimentName).block();
}
/**
* Gets information about an Experiment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
* characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return information about an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<ExperimentInner> getWithResponse(
String resourceGroupName, String workspaceName, String experimentName, Context context) {
return <API key>(resourceGroupName, workspaceName, experimentName, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return values returned by the List operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ExperimentInner>> <API key>(String nextLink) {
if (nextLink == null) {
return Mono.error(new <API key>("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context))
.<PagedResponse<ExperimentInner>>map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @param context The context to associate with this operation.
* @throws <API key> thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return values returned by the List operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<ExperimentInner>> <API key>(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new <API key>("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono
.error(
new <API key>(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
}
} |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>/home/pavm/programming/lib/gft/include/gft_filtering3.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="<API key>.html">include</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">gft_filtering3.h</div> </div>
</div><!--header
<div class="contents">
<a href="gft__filtering3_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#ifndef _GFT_FILTERING3_H_</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor"></span><span class="preprocessor">#define _GFT_FILTERING3_H_</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor"></span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include "<a class="code" href="gft__common_8h.html">gft_common.h</a>"</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include "<a class="code" href="gft__scene_8h.html">gft_scene.h</a>"</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include "<a class="code" href="gft__adjrel3_8h.html">gft_adjrel3.h</a>"</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">namespace </span>gft{</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  <span class="keyword">namespace </span><a class="code" href="<API key>.html#<API key>">Scene8</a>{</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>  <span class="keywordtype">void</span> <a class="code" href="<API key>.html#<API key>">ModeFilterLabel</a>(<a class="code" href="<API key>.html#<API key>">Scene8</a> *label, <span class="keywordtype">float</span> r);</div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  } <span class="comment">//end Scene8 namespace</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> } <span class="comment">//end gft namespace</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="ttc" id="<API key>"><div class="ttname"><a href="<API key>.html#<API key>">gft::Scene8::Scene8</a></div><div class="ttdeci">struct gft::Scene8::_scene8 Scene8</div></div>
<div class="ttc" id="gft__common_8h_html"><div class="ttname"><a href="gft__common_8h.html">gft_common.h</a></div><div class="ttdoc">Header file for common definitions and function prototypes. </div></div>
<div class="ttc" id="<API key>"><div class="ttname"><a href="<API key>.html#<API key>">gft::Scene8::ModeFilterLabel</a></div><div class="ttdeci">void ModeFilterLabel(Scene8 *label, float r)</div><div class="ttdef"><b>Definition:</b> gft_filtering3.cpp:10</div></div>
<div class="ttc" id="<API key>"><div class="ttname"><a href="gft__adjrel3_8h.html">gft_adjrel3.h</a></div></div>
<div class="ttc" id="gft__scene_8h_html"><div class="ttname"><a href="gft__scene_8h.html">gft_scene.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 25 2015 10:27:50 by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html> |
# jquery.repeat #
[http:
For filling out mock-ups, making it easy to duplicate blocks of sample content during development.
## Demo ##
See the [demo](http://brm.io/jquery-repeat-demo/).
## Usage ##
$(<selector>).repeat(n [, target, deepClone])
Where:
<br>`n` is the number of times to repeat the selection
<br>`target` (optional) where to append the clones, otherwise appends to parents
<br>`deepClone` (optional) whether to perform a [deep clone](http://api.jquery.com/clone/), default is false
Every selected element is then cloned `n` times and inserted into to their respective parent(s) after the last element in the selection, or `target` if specified
Returns: the newly generated clones (for example, if you need to bind them)
## Example ##
$('ul li').repeat(2);
will create 2 clones of every `li` element and append to their respective parent elements
<ul>
<li>Sample 1</li>
<li>Sample 2</li>
</ul>
<ul>
<li>Sample 3</li>
<li>Sample 4</li>
</ul>
using the above example, would become
<ul>
<li>Sample 1</li>
<li>Sample 2</li>
<li>Sample 1</li>
<li>Sample 2</li>
<li>Sample 1</li>
<li>Sample 2</li>
</ul>
<ul>
<li>Sample 3</li>
<li>Sample 4</li>
<li>Sample 3</li>
<li>Sample 4</li>
<li>Sample 3</li>
<li>Sample 4</li>
</ul>
See the included `test.html` for example usage |
#!/bin/sh
# CYBERWATCH SAS - 2017
# Security fix for CESA-2015:2152
# Operating System: CentOS 7
# Architecture: x86_64
# - kernel.x86_64:3.10.0-327.el7
# - <API key>.noarch:3.10.0-327.el7
# - kernel-debug.x86_64:3.10.0-327.el7
# - kernel-debug-devel.x86_64:3.10.0-327.el7
# - kernel-devel.x86_64:3.10.0-327.el7
# - kernel-doc.noarch:3.10.0-327.el7
# - kernel-headers.x86_64:3.10.0-327.el7
# - kernel-tools.x86_64:3.10.0-327.el7
# - kernel-tools-libs.x86_64:3.10.0-327.el7
# - <API key>.x86_64:3.10.0-327.el7
# - perf.x86_64:3.10.0-327.el7
# - python-perf.x86_64:3.10.0-327.el7
# Last versions recommanded by security team:
# - kernel.x86_64:3.10.0-514.6.1.el7
# - <API key>.noarch:3.10.0-514.6.1.el7
# - kernel-debug.x86_64:3.10.0-514.6.1.el7
# - kernel-debug-devel.x86_64:3.10.0-514.6.1.el7
# - kernel-devel.x86_64:3.10.0-514.6.1.el7
# - kernel-doc.noarch:3.10.0-514.6.1.el7
# - kernel-headers.x86_64:3.10.0-514.6.1.el7
# - kernel-tools.x86_64:3.10.0-514.6.1.el7
# - kernel-tools-libs.x86_64:3.10.0-514.6.1.el7
# - <API key>.x86_64:3.10.0-514.6.1.el7
# - perf.x86_64:3.10.0-514.6.1.el7
# - python-perf.x86_64:3.10.0-514.6.1.el7
# CVE List:
# - CVE-2010-5313
# - CVE-2013-7421
# - CVE-2014-3647
# - CVE-2014-7842
# - CVE-2014-8171
# - CVE-2014-9419
# - CVE-2014-9644
# - CVE-2015-0239
# - CVE-2015-2925
# - CVE-2015-3339
# - CVE-2015-4170
# - CVE-2015-5283
# - CVE-2015-6526
# - CVE-2015-7613
# - CVE-2015-7837
# More details:
sudo yum install kernel.x86_64-3.10.0 -y
sudo yum install <API key>.noarch-3.10.0 -y
sudo yum install kernel-debug.x86_64-3.10.0 -y
sudo yum install kernel-debug-devel.x86_64-3.10.0 -y
sudo yum install kernel-devel.x86_64-3.10.0 -y
sudo yum install kernel-doc.noarch-3.10.0 -y
sudo yum install kernel-headers.x86_64-3.10.0 -y
sudo yum install kernel-tools.x86_64-3.10.0 -y
sudo yum install kernel-tools-libs.x86_64-3.10.0 -y
sudo yum install <API key>.x86_64-3.10.0 -y
sudo yum install perf.x86_64-3.10.0 -y
sudo yum install python-perf.x86_64-3.10.0 -y |
<reference path="../JSBus/TransportInterfaces.ts" />
<reference path="../typings/jquery/jquery.d.ts" />
var JSBus;
(function (JSBus) {
var <API key> = (function () {
function <API key>(hub) {
this.hub = hub;
// Since SignalR is dependent on JQuery, it is ok to use
// JQuery callbacks here.
this.notifySentCallbacks = $.Callbacks();
}
<API key>.prototype.send = function (message) {
console.log("Sending via SignalR", message);
// Consider using a separate web worker for data pump
// Use own deferred instead of SignalR provided promise as
// we need to supply the id to the caller for .then
var deferred = $.Deferred();
if (this.hub === undefined) {
console.log("Hub is undefined");
deferred.fail();
return deferred.promise();
}
this.hub.server.execute(message).then(deferred.resolve(message.id)).then(this.notifySentCallbacks.fire(message)).fail(deferred.fail);
return deferred.promise();
};
<API key>.prototype.notifyWhenSent = function (callback) {
this.notifySentCallbacks.add(callback);
};
return <API key>;
})();
JSBus.<API key> = <API key>;
})(JSBus || (JSBus = {})); |
import React from 'react';
import axios from 'axios';
export const userLogin = function(username, password) {
var context = this;
axios.post('/login', {
username: username,
password: password
})
.then(function (response) {
if(response.status === 200) {
//If the user is logged in already, or the login is successful - fire sessionCheck function
//See Nav for next step
if(typeof response.data === 'string') {
context.setState({alreadyLoggedIn: true, loggedIn: false, notFound: false})
} else {
context.setState({alreadyLoggedIn: false, loggedIn: true, notFound: false})
}
context.props.sessionCheck();
};
})
.catch(function (error) {
context.setState({alreadyLoggedIn: false, loggedIn: false, notFound: true});
console.log(error);
});
};
export const userSignup = function(username, password) {
var context = this;
axios.post('/signup', {
username: username,
password: password
})
.then(function (response) {
if(response.status === 201 ) {
context.setState({signedUp: true, exists: false});
context.props.sessionCheck();
}
})
.catch(function (error) {
context.setState({signedUp: false, exists: true});
console.log(error);
});
};
export const userLogout = function() {
console.log(this)
axios.get('/logout')
.then(function (response) {
window.location.reload()
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}; |
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_02_01
module Models
# City or town details.
class <API key>
include MsRestAzure
# @return [String] The city or town name.
attr_accessor :city_name
# @return [Array<String>] A list of Internet service providers.
attr_accessor :providers
# Mapper for <API key> class as Ruby Hash.
# This will be used for serialization/deserialization.
def self.mapper()
{
<API key>: true,
required: false,
serialized_name: '<API key>',
type: {
name: 'Composite',
class_name: '<API key>',
model_properties: {
city_name: {
<API key>: true,
required: false,
serialized_name: 'cityName',
type: {
name: 'String'
}
},
providers: {
<API key>: true,
required: false,
serialized_name: 'providers',
type: {
name: 'Sequence',
element: {
<API key>: true,
required: false,
serialized_name: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
}
end
end
end
end |
var resourceFound = false,
quitConditionCount = 0,
utils = require( "../../assert-to-console" ),
device = require( "../../../index" )(),
uuid = process.argv[ 2 ];
console.log( JSON.stringify( { assertionCount: 4 } ) );
function maybeQuit() {
quitConditionCount++;
if ( quitConditionCount >= 3 ) {
console.log( JSON.stringify( { killPeer: true } ) );
process.exit( 0 );
}
}
device.configure( {
role: "client",
connectionMode: "acked"
} ).then(
function() {
utils.assert( "ok", true, "Client: device.configure() successful" );
device.client.addEventListener( "resourcefound", function( event ) {
if ( !resourceFound && event.resource.uri === "/a/" + uuid ) {
resourceFound = true;
utils.assert( "ok", true, "Client: Resource found" );
device.client.retrieveResource( event.resource.id ).then(
function( resource ) {
utils.assert( "deepEqual", resource.properties, {
"How many angels can dance on the head of a pin?": "As many as wanting."
}, "Retrieved properties are as expected." );
// We have retrieved the resource, so we have completed one step towards
// concluding the test
maybeQuit();
},
function( error ) {
utils.die( "Failed to retrieve resource with " + error + " and result " +
error.result );
} );
// We found the resource, so we have completed one step towards concluding the test
maybeQuit();
}
} );
device.client.findResources().then(
function() {
utils.assert( "ok", true, "Client: findResources() successful" );
// We have completed the process of finding resources, so we have completed one
// step towards concluding the test
maybeQuit();
},
function( error ) {
utils.die( "Client: findResources() failed with: " + error );
} );
},
function( error ) {
utils.die( "Client: device.configure() failed with: " + error );
} ); |
import React from 'react';
import Component from '../src/Main'; // This is our component
import { storiesOf } from '@storybook/react';
storiesOf('Component', module)
.add('with lyef name', () => (
<Component name="lyef" />
))
.add('with another name', () => (
<Component name="another" />
)) |
/*global rule, match, info, warning, error, getChildrenOfAST*/
rule('<API key>', function () {
// 'use strict';
match(
function (ast) {
return ast.type === 'ExpressionStatement';
},
function (ast, ancestors) {
var problem;
//case 1
/*
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
**
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "instanceOfClass"
},
"property": {
"type": "Identifier",
"name": "_internal"
}
}
]
}*/
if( ast.expression.type === 'CallExpression' &&
ast.expression["arguments"]
){
ast.expression["arguments"].forEach(function(currentValue){
if(currentValue.property &&
currentValue.property.name.indexOf("_") === 0 &&
currentValue.object.type !== 'ThisExpression') {
//info('<API key>.');
problem = true;
}
else if(currentValue.callee &&
currentValue.callee.property.name.indexOf("_") === 0 &&
currentValue.callee.object.type !== 'ThisExpression') {
//info('<API key>.');
problem = true;
}
else if(currentValue.type === "BinaryExpression"){
problem = <API key>(currentValue);
}
});
}
// ast.expression.left.object &&
// ast.expression.left.object.type !== 'ThisExpression'
// //console.log(ast.expression);
// warn('<API key>.');
if(problem){
info('<API key>.');
}
}
);
function <API key>(ast){
if(ast.left &&
ast.left.type === "BinaryExpression"){
return <API key>(ast.left);
}
if( (ast.left.property &&
<API key>(ast.left.property, ast.left)) ||
(ast.right.property &&
<API key>(ast.right.property, ast.right))
){
return true;
}
}
function <API key>(property, object){
if(property.name.indexOf("_") === 0 &&
object.type !== 'ThisExpression'){
return true;
}
}
}); |
<?php
// Login
$app->map(['GET', 'POST'], '/login', 'APIDocGen\Controller\AdminController:login')->setName('login');
// Logout
$app->get('/logout', 'APIDocGen\Controller\AdminController:logout')->setName('logout');
// Register
$app->map(['GET', 'POST'], '/register', 'APIDocGen\Controller\AdminController:logout')->setName('register');
// Forget Password
$app->map(['GET', 'POST'], '/forgotpass', 'APIDocGen\Controller\AdminController:forgotpassword')->setName('forgotpass');
// Change Password
$app->map(['GET', 'POST'], '/changepass', 'APIDocGen\Controller\AdminController:changepassword')->setName('changepass');
// View Profile
$app->get('/profile', 'APIDocGen\Controller\AdminController:profile')->setName('profile');
// Update Profile
$app->map(['GET', 'POST'], '/profile/update', 'APIDocGen\Controller\AdminController:update')->setName('updateprofile');
// List Admin accounts
$app->map(['GET', 'POST'], '/admin', 'APIDocGen\Controller\AdminController:index')->setName('listadmin'); |
{% extends "base.html" %}
{% block title %}Opt-Out of The Open Source Report Card{% endblock %}
{% block body %}
<div class="container">
<h2>Opt-out of the OSRC</h2>
<p>
Sorry to hear that you want to opt-out!
<a href="{{ url_for('.optout_login', username=username) }}">Login using GitHub</a>
to verify your account and your profile will disappear immediately.
<strong>Note</strong>: this action is final and once your account is
disabled, you'll have to <a href="mailto:osrc@dfm.io">email me</a> to
get re-added.
</p>
</div>
{% endblock %} |
using System.Collections.Generic;
using ImperialArmy.Common.Soldier;
using ImperialArmy.Military.Soldier;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeAsserter;
namespace ImperialArmy.Military.UnitTests
{
[TestClass]
public class <API key>
{
[TestMethod]
public void <API key>()
{
var soldier = <API key>.CreateSoldier<IFootSoldier>();
Assert.IsNotNull( soldier );
Assert.IsTrue( soldier is SoldierBase );
Assert.IsTrue( soldier is FootSoldier );
}
[TestMethod]
public void <API key>()
{
AssertClass.IsStatic( typeof( <API key> ), ClassVisibility.Public );
}
[TestMethod]
public void <API key>()
{
var soldier = <API key>.CreateSoldier<IArcher>();
Assert.IsNotNull( soldier );
Assert.IsTrue( soldier is SoldierBase );
Assert.IsTrue( soldier is FootSoldier );
Assert.IsTrue( soldier is Archer );
}
[TestMethod]
public void <API key>()
{
var soldier = <API key>.CreateSoldier<IHorseman>();
Assert.IsNotNull( soldier );
Assert.IsTrue( soldier is SoldierBase );
Assert.IsTrue( soldier is FootSoldier );
Assert.IsTrue( soldier is Horseman );
}
[TestMethod]
public void <API key>()
{
var soldier = <API key>.CreateSoldier<IFlyingRainOfFire>();
Assert.IsNotNull( soldier );
Assert.IsTrue( soldier is SoldierBase );
Assert.IsTrue( soldier is FootSoldier );
Assert.IsTrue( soldier is FlyingRainOfFire );
}
[TestMethod]
public void <API key>()
{
<API key><IFootSoldier>();
}
[TestMethod]
public void <API key>()
{
<API key><IArcher>();
}
[TestMethod]
public void <API key>()
{
<API key><IHorseman>();
}
[TestMethod]
public void <API key>()
{
<API key><IFlyingRainOfFire>();
}
private void <API key><TSoldier>() where TSoldier : ISoldier
{
const int numberOfSoldiers = 1000;
var soldiers = (List<TSoldier>)<API key>.CreateManySoldiers<TSoldier>( numberOfSoldiers );
Assert.AreEqual( numberOfSoldiers, soldiers.Count );
}
}
} |
#!/usr/bin/env python
import subprocess
"""
A ssh based command dispatch system
"""
machines = ["10.0.1.40",
"10.0.1.50",
"10.0.1.51",
"10.0.1.60",
"10.0.1.80"]
cmd = "python /src/fingerprint.py"
for machine in machines:
subprocess.call("ssh root@%s %s" % (machine, cmd), shell=True) |
#include "guiutil.h"
#include "<API key>.h"
#include "walletmodel.h"
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
#include <QString>
#include <QDateTime>
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
#include <QUrl>
#include <QTextDocument> // For Qt::escape
#include <QAbstractItemView>
#include <QApplication>
#include <QClipboard>
#include <QFileDialog>
#include <QDesktopServices>
#include <QThread>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "shlwapi.h"
#include "shlobj.h"
#include "shellapi.h"
#endif
namespace GUIUtil {
QString dateTimeStr(const QDateTime &date)
{
return date.date().toString(Qt::<API key>) + QString(" ") + date.toString("hh:mm");
}
QString dateTimeStr(qint64 nTime)
{
return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));
}
QFont bitcoinAddressFont()
{
QFont font("Monospace");
font.setStyleHint(QFont::TypeWriter);
return font;
}
void setupAddressWidget(QLineEdit *widget, QWidget *parent)
{
widget->setMaxLength(<API key>::MaxAddressLength);
widget->setValidator(new <API key>(parent));
widget->setFont(bitcoinAddressFont());
}
void setupAmountWidget(QLineEdit *widget, QWidget *parent)
{
QDoubleValidator *amountValidator = new QDoubleValidator(parent);
amountValidator->setDecimals(8);
amountValidator->setBottom(0.0);
widget->setValidator(amountValidator);
widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
}
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
{
// NovaCoin: check prefix
if(uri.scheme() != QString("GOODcoin"))
return false;
SendCoinsRecipient rv;
rv.address = uri.path();
rv.amount = 0;
QList<QPair<QString, QString> > items = uri.queryItems();
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
{
bool fShouldReturnFalse = false;
if (i->first.startsWith("req-"))
{
i->first.remove(0, 4);
fShouldReturnFalse = true;
}
if (i->first == "label")
{
rv.label = i->second;
fShouldReturnFalse = false;
}
else if (i->first == "amount")
{
if(!i->second.isEmpty())
{
if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount))
{
return false;
}
}
fShouldReturnFalse = false;
}
if (fShouldReturnFalse)
return false;
}
if(out)
{
*out = rv;
}
return true;
}
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
{
// Convert GOODcoin:// to GOODcoin:
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
// which will lower-case it (and thus invalidate the address).
if(uri.startsWith("GOODcoin:
{
uri.replace(0, 12, "GOODcoin:");
}
QUrl uriInstance(uri);
return parseBitcoinURI(uriInstance, out);
}
QString HtmlEscape(const QString& str, bool fMultiLine)
{
QString escaped = Qt::escape(str);
if(fMultiLine)
{
escaped = escaped.replace("\n", "<br>\n");
}
return escaped;
}
QString HtmlEscape(const std::string& str, bool fMultiLine)
{
return HtmlEscape(QString::fromStdString(str), fMultiLine);
}
void copyEntryData(QAbstractItemView *view, int column, int role)
{
if(!view || !view->selectionModel())
return;
QModelIndexList selection = view->selectionModel()->selectedRows(column);
if(!selection.isEmpty())
{
// Copy first item
QApplication::clipboard()->setText(selection.at(0).data(role).toString());
}
}
QString getSaveFileName(QWidget *parent, const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedSuffixOut)
{
QString selectedFilter;
QString myDir;
if(dir.isEmpty()) // Default to user documents location
{
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
}
else
{
myDir = dir;
}
QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter);
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
QString selectedSuffix;
if(filter_re.exactMatch(selectedFilter))
{
selectedSuffix = filter_re.cap(1);
}
/* Add suffix if needed */
QFileInfo info(result);
if(!result.isEmpty())
{
if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())
{
/* No suffix specified, add selected suffix */
if(!result.endsWith("."))
result.append(".");
result.append(selectedSuffix);
}
}
/* Return selected suffix if asked to */
if(selectedSuffixOut)
{
*selectedSuffixOut = selectedSuffix;
}
return result;
}
Qt::ConnectionType <API key>()
{
if(QThread::currentThread() != QCoreApplication::instance()->thread())
{
return Qt::<API key>;
}
else
{
return Qt::DirectConnection;
}
}
bool checkPoint(const QPoint &p, const QWidget *w)
{
QWidget *atW = qApp->widgetAt(w->mapToGlobal(p));
if (!atW) return false;
return atW->topLevelWidget() == w;
}
bool isObscured(QWidget *w)
{
return !(checkPoint(QPoint(0, 0), w)
&& checkPoint(QPoint(w->width() - 1, 0), w)
&& checkPoint(QPoint(0, w->height() - 1), w)
&& checkPoint(QPoint(w->width() - 1, w->height() - 1), w)
&& checkPoint(QPoint(w->width() / 2, w->height() / 2), w));
}
void openDebugLogfile()
{
boost::filesystem::path pathDebug = GetDataDir() / "debug.log";
/* Open debug.log with the associated application */
if (boost::filesystem::exists(pathDebug))
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(pathDebug.string())));
}
<API key>::<API key>(int size_threshold, QObject *parent) :
QObject(parent), size_threshold(size_threshold)
{
}
bool <API key>::eventFilter(QObject *obj, QEvent *evt)
{
if(evt->type() == QEvent::ToolTipChange)
{
QWidget *widget = static_cast<QWidget*>(obj);
QString tooltip = widget->toolTip();
if(tooltip.size() > size_threshold && !tooltip.startsWith("<qt>") && !Qt::mightBeRichText(tooltip))
{
// Prefix <qt/> to make sure Qt detects this as rich text
// Escape the current message as HTML and replace \n by <br>
tooltip = "<qt>" + HtmlEscape(tooltip, true) + "<qt/>";
widget->setToolTip(tooltip);
return true;
}
}
return QObject::eventFilter(obj, evt);
}
#ifdef WIN32
boost::filesystem::path static StartupShortcutPath()
{
return <API key>(CSIDL_STARTUP) / "GOODCoin.lnk";
}
bool <API key>()
{
// check for Bitcoin.lnk
return boost::filesystem::exists(StartupShortcutPath());
}
bool <API key>(bool fAutoStart)
{
// If the shortcut exists already, remove it for updating
boost::filesystem::remove(StartupShortcutPath());
if (fAutoStart)
{
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
IShellLink* psl = NULL;
HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL,
<API key>, IID_IShellLink,
reinterpret_cast<void**>(&psl));
if (SUCCEEDED(hres))
{
// Get the current executable path
TCHAR pszExePath[MAX_PATH];
GetModuleFileName(NULL, pszExePath, sizeof(pszExePath));
TCHAR pszArgs[5] = TEXT("-min");
// Set the path to the shortcut target
psl->SetPath(pszExePath);
PathRemoveFileSpec(pszExePath);
psl->SetWorkingDirectory(pszExePath);
psl->SetShowCmd(SW_SHOWMINNOACTIVE);
psl->SetArguments(pszArgs);
// Query IShellLink for the IPersistFile interface for
// saving the shortcut in persistent storage.
IPersistFile* ppf = NULL;
hres = psl->QueryInterface(IID_IPersistFile,
reinterpret_cast<void**>(&ppf));
if (SUCCEEDED(hres))
{
WCHAR pwsz[MAX_PATH];
// Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(pwsz, TRUE);
ppf->Release();
psl->Release();
CoUninitialize();
return true;
}
psl->Release();
}
CoUninitialize();
return false;
}
return true;
}
#elif defined(LINUX)
// Follow the Desktop Application Autostart Spec:
boost::filesystem::path static GetAutostartDir()
{
namespace fs = boost::filesystem;
char* pszConfigHome = getenv("XDG_CONFIG_HOME");
if (pszConfigHome) return fs::path(pszConfigHome) / "autostart";
char* pszHome = getenv("HOME");
if (pszHome) return fs::path(pszHome) / ".config" / "autostart";
return fs::path();
}
boost::filesystem::path static <API key>()
{
return GetAutostartDir() / "GOODcoin.desktop";
}
bool <API key>()
{
boost::filesystem::ifstream optionFile(<API key>());
if (!optionFile.good())
return false;
// Scan through file for "Hidden=true":
std::string line;
while (!optionFile.eof())
{
getline(optionFile, line);
if (line.find("Hidden") != std::string::npos &&
line.find("true") != std::string::npos)
return false;
}
optionFile.close();
return true;
}
bool <API key>(bool fAutoStart)
{
if (!fAutoStart)
boost::filesystem::remove(<API key>());
else
{
char pszExePath[MAX_PATH+1];
memset(pszExePath, 0, sizeof(pszExePath));
if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
return false;
boost::filesystem::create_directories(GetAutostartDir());
boost::filesystem::ofstream optionFile(<API key>(), std::ios_base::out|std::ios_base::trunc);
if (!optionFile.good())
return false;
// Write a bitcoin.desktop file to the autostart directory:
optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n";
optionFile << "Name=GOODCoin\n";
optionFile << "Exec=" << pszExePath << " -min\n";
optionFile << "Terminal=false\n";
optionFile << "Hidden=false\n";
optionFile.close();
}
return true;
}
#else
// TODO: OSX startup stuff; see:
// https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Articles/CustomLogin.html
bool <API key>() { return false; }
bool <API key>(bool fAutoStart) { return false; }
#endif
HelpMessageBox::HelpMessageBox(QWidget *parent) :
QMessageBox(parent)
{
header = tr("GOODCoin-Qt") + " " + tr("version") + " " +
QString::fromStdString(FormatFullVersion()) + "\n\n" +
tr("Usage:") + "\n" +
" GOODcoin-qt [" + tr("command-line options") + "] " + "\n";
coreOptions = QString::fromStdString(HelpMessage());
uiOptions = tr("UI options") + ":\n" +
" -lang=<lang> " + tr("Set language, for example \"de_DE\" (default: system locale)") + "\n" +
" -min " + tr("Start minimized") + "\n" +
" -splash " + tr("Show splash screen on startup (default: 1)") + "\n";
setWindowTitle(tr("GOODCoin-Qt"));
setTextFormat(Qt::PlainText);
// setMinimumWidth is ignored for QMessageBox so put in non-breaking spaces to make it wider.
setText(header + QString(QChar(0x2003)).repeated(50));
setDetailedText(coreOptions + "\n" + uiOptions);
}
void HelpMessageBox::printToConsole()
{
// On other operating systems, the expected action is to print the message to the console.
QString strUsage = header + "\n" + coreOptions + "\n" + uiOptions;
fprintf(stdout, "%s", strUsage.toStdString().c_str());
}
void HelpMessageBox::showOrPrint()
{
#if defined(WIN32)
// On Windows, show a message box, as there is no stderr/stdout in windowed applications
exec();
#else
// On other operating systems, print help text to console
printToConsole();
#endif
}
} // namespace GUIUtil |
import Select from 'antd/lib/select';
export default Select; |
<html>
<head>
<title>Docs for page barcodes.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
<tr>
<td class="header_top">com-tecnick-tcpdf</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr>
<td class="header_menu">
[ <a href="../<API key>.html" class="menu">class tree: com-tecnick-tcpdf</a> ]
[ <a href="../<API key>.html" class="menu">index: com-tecnick-tcpdf</a> ]
[ <a href="../elementindex.html" class="menu">all elements</a> ]
</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="200" class="menu">
<div id="todolist">
<p><a href="../todolist.html">Todo List</a></p>
</div>
<b>Packages:</b><br />
<a href="../li_PHPExcel.html">PHPExcel</a><br />
<a href="../<API key>.html">com-tecnick-tcpdf</a><br />
<a href="../li_JAMA.html">JAMA</a><br />
<a href="../li_Math_Stats.html">Math_Stats</a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../li_PHPExcel_Cell.html">PHPExcel_Cell</a><br />
<a href="../li_PHPExcel_Reader.html">PHPExcel_Reader</a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../<API key>.html">PHPExcel_RichText</a><br />
<a href="../<API key>.html">PHPExcel_Settings</a><br />
<a href="../li_PHPExcel_Shared.html">PHPExcel_Shared</a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../<API key>.html">PHPExcel_Shared_OLE</a><br />
<a href="../li_PHPExcel_Style.html">PHPExcel_Style</a><br />
<a href="../<API key>.html">PHPExcel_Worksheet</a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../li_PHPExcel_Writer.html">PHPExcel_Writer</a><br />
<a href="../<API key>.html"><API key></a><br />
<a href="../<API key>.html"><API key></a><br />
<br /><br />
<b>Files:</b><br />
<div class="package">
<a href="../com-tecnick-tcpdf/<API key>.php.html"> 2dbarcodes.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> barcodes.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> eng.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> htmlcolors.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> ita.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> tcpdf.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> tcpdf_config.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> tcpdf_config_alt.php
</a><br>
<a href="../com-tecnick-tcpdf/<API key>.php.html"> unicode_data.php
</a><br>
</div><br />
<b>Classes:</b><br />
<div class="package">
<a href="../com-tecnick-tcpdf/TCPDF.html">TCPDF</a><br />
<a href="../com-tecnick-tcpdf/TCPDF2DBarcode.html">TCPDF2DBarcode</a><br />
<a href="../com-tecnick-tcpdf/TCPDFBarcode.html">TCPDFBarcode</a><br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<h1>Procedural File: barcodes.php</h1>
Source Location: /PHPExcel/Shared/PDF/barcodes.php<br /><br />
<br>
<br>
<div class="contents">
<h2>Classes:</h2>
<dt><a href="../com-tecnick-tcpdf/TCPDFBarcode.html">TCPDFBarcode</a></dt>
<dd>PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http:
</div><br /><br />
<h2>Page Details:</h2>
PHP class to creates array representations for common 1D barcodes to be used with TCPDF.<br /><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>author:</b> </td><td>Nicola Asuni</td>
</tr>
<tr>
<td><b>version:</b> </td><td>1.0.008</td>
</tr>
<tr>
<td><b>copyright:</b> </td><td>2008-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com</td>
</tr>
<tr>
<td><b>link:</b> </td><td><a href="http:
</tr>
<tr>
<td><b>abstract:</b> </td><td>Functions for generating string representation of common 1D barcodes.</td>
</tr>
<tr>
<td><b>filesource:</b> </td><td><a href="../__filesource/<API key>.php.html">Source Code for this file</a></td>
</tr>
<tr>
<td><b>license:</b> </td><td><a href="http:
</tr>
</table>
</div>
<br /><br />
<br /><br />
<br /><br />
<br />
<div class="credit">
<hr />
Documentation generated on Tue, 01 Jun 2010 17:02:01 +0200 by <a href="http:
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html> |
ERL ?= erl
APP := koth
.PHONY: deps
all: deps
@./rebar compile
deps:
@./rebar get-deps
clean:
@./rebar clean
distclean: clean
@./rebar delete-deps
docs:
@erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
nothing:
test: nothing
@./rebar eunit skip_deps=true
run: all
@erl -pa ebin -pa depsebin -s mimosa_app -config config/example.config |
import { CultureInfo, Culture } from "@microsoft/<API key>";
import { Constants } from "../constants";
import { <API key>, <API key> } from "./base";
import { <API key> } from "../../resources/<API key>";
export class <API key> extends <API key> {
readonly suffixList: ReadonlyMap<string, string>;
readonly prefixList: ReadonlyMap<string, string>;
readonly ambiguousUnitList: ReadonlyArray<string>;
readonly extractType: string;
constructor(ci?: CultureInfo) {
if (!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.extractType = Constants.<API key>;
this.suffixList = <API key>.<API key>;
this.prefixList = new Map<string, string>();
this.ambiguousUnitList = <API key>.<API key>;
}
}
export class <API key> extends <API key> {
constructor(ci?: CultureInfo) {
if(!ci) {
ci = new CultureInfo(Culture.English);
}
super(ci);
this.BindDictionary(<API key>.<API key>);
}
} |
package com.pkrete.xrde2e.client.member;
import org.niis.xrd4j.common.exception.XRd4JException;
import org.niis.xrd4j.common.member.ProducerMember;
public class E2EProducerMember extends ProducerMember {
private String label;
public E2EProducerMember(String xRoadInstance, String memberClass, String memberCode, String subsystemCode, String serviceCode, String label)
throws XRd4JException {
super(xRoadInstance, memberClass, memberCode, subsystemCode, serviceCode);
this.label = label;
}
/**
* Returns the label of this E2EProducerMember.
*
* @return the label this E2EProducerMember
*/
public String getLabel() {
return label;
}
/**
* Sets the label of this E2EProducerMember.
*
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
} |
import itertools
class RuleCollection(object):
def __init__(self):
self.rules = {}
def add_rule(self, rule, level=0):
self.rules.setdefault(level, [])
self.rules[level].append(rule)
def apply(self, transaction, entry):
entries = [entry]
levels = list(self.rules.keys())
levels.sort()
for level in levels:
rules = self.rules[level]
new_entries = []
for entry in entries:
new_entries.append(entry)
for rule in rules:
new_entries += list(rule.apply(transaction, entry))
entries = new_entries
return entries
class Generator(object):
def __init__(self, generator):
self.generator = generator
def __call__(self, *args):
return self.generator(*args)
def __add__(self, other):
@Generator
def result(*args):
return itertools.chain(self(*args), other(*args))
return result
Generator.null = Generator(lambda *args: [])
class Rule(object):
def __init__(self, filter, generator):
self.filter = filter
self.generator = generator
def apply(self, transaction, entry):
if self.filter(transaction, entry):
return self.generator(entry.info(transaction))
else:
return []
class TransactionRule(Rule):
def apply(self, transaction):
if self.filter(transaction, None):
return self.generator(transaction)
else:
return transaction |
$(document).ready(function() {
//Reward Listings
$('#list').click(function(event){
event.preventDefault();
$('.reward-list .item').addClass('list-group-item');
});
$('#grid').click(function(event){
event.preventDefault();
var item = $('.reward-list .item');
item.removeClass('list-group-item').addClass('grid-group-item');
});
//Cart
var stripe = $("#stripe"),
handler = false,
cartDescription = $('.cart-description');
$(".update-quantities").on('click', function(e) {
e.preventDefault();
var that = $(this),
input = $('<input type="hidden" name="updateQauntities" />').val(1);
that.addClass('fa-spin');
$('form').append(input).submit();
});
$('.cart').popover({
html : true,
container: 'body',
animation:false,
trigger: 'manual',
content: function() {
var cart = $('.cart-content').clone();
cart.removeClass('hide');
return cart.html();
}
}).on("mouseenter", function () {
var that = this;
$(this).popover("show");
$(".popover").on("mouseleave", function () {
$(that).popover('hide');
});
}).on("mouseleave", function () {
var that = this;
setTimeout(function () {
if (!$(".popover:hover").length) {
$(that).popover("hide")
}
}, 100);
});
if(cartDescription.length > 0) {
cartDescription.each(function(index, value) {
$clamp($(value)[0], {clamp: 4});
});
}
stripe.prop('disabled', false);
stripe.on('click', function(e) {
e.preventDefault();
var that = $(this),
name = that.data('name'),
key = that.data('key'),
amount = that.data('amount');
if(handler === false) {
handler = StripeCheckout.configure("customButtonA", {
key: key,
token: function(token, args){
var $input = $('<input type=hidden name=stripeToken />').val(token.id);
$('form').append($input).submit();
}
});
}
stripe.prop('disabled', true);
setTimeout(function () {
stripe.prop('disabled', false);
}, 3000); // Sets a short timeout
handler.open({
amount: amount,
name: name
});
});
$('#points').on('click', function(e) {
e.preventDefault();
$('form').submit();
});
//FAQ
$('.no-bullets li > strong, .no-bullets li .collapse-indicator').click(function(e){
var that = $(this);
var collapseControl = (e.target.className === 'collapse-indicator' ? that : that.parent().find('.collapse-indicator'));
that.parent().find('div').slideToggle(function(){
if(that.parent().find('div').is(':visible')) {
collapseControl.html('<i class="fa fa-fw fa-minus"></i>');
} else {
collapseControl.html('<i class="fa fa-fw fa-plus"></i>');
}
});
});
//Transactions
$(document).on("hidden.bs.modal", "#transactionModal", function (e) {
$(e.target).removeData("bs.modal").find(".modal-content").empty();
});
//Resize modal to fit within the contents of the window veritcally
$('.modal').on('show.bs.modal', function () {
$('.modal .modal-body').css({
'overflow-y': 'auto',
'max-height': $(window).height() * 0.7
});
});
//tooltips
$('[data-toggle="tooltip"]').tooltip();
$(window).scroll(function(){
/* Show hide scrolltop button */
if( $(window).scrollTop() == 0 ) {
$('.scroll-top').stop(false,true).fadeOut(600);
}else{
$('.scroll-top').stop(false,true).fadeIn(600);
}
});
/* scroll top */
$(document).on('click','.scroll-top',function(){
$('body,html').animate({scrollTop:0},400);
return false;
});
}); |
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdct.h" /* Private declarations for DCT subsystem */
/* Private subobject for this module */
typedef struct {
struct jpeg_forward_dct pub; /* public fields */
/* Pointer to the DCT routine actually in use */
<API key> do_dct[MAX_COMPONENTS];
#ifdef DCT_FLOAT_SUPPORTED
/* Same as above for the floating-point case. */
<API key> do_float_dct[MAX_COMPONENTS];
#endif
} my_fdct_controller;
typedef my_fdct_controller * my_fdct_ptr;
/* The allocated post-DCT divisor tables -- big enough for any
* supported variant and not identical to the quant table entries,
* because of scaling (especially for an unnormalized DCT) --
* are pointed to by dct_table in the per-component comp_info
* structures. Each table is given in normal array order.
*/
typedef union {
DCTELEM int_array[DCTSIZE2];
#ifdef DCT_FLOAT_SUPPORTED
FAST_FLOAT float_array[DCTSIZE2];
#endif
} divisor_table;
/* The current scaled-DCT routines require ISLOW-style divisor tables,
* so be sure to compile that code if either ISLOW or SCALING is requested.
*/
#ifdef DCT_ISLOW_SUPPORTED
#define <API key>
#else
#ifdef <API key>
#define <API key>
#endif
#endif
/*
* Perform forward DCT on one or more blocks of a component.
*
* The input samples are taken from the sample_data[] array starting at
* position start_col, and moving to the right for any additional blocks.
* The quantized coefficients are returned in coef_blocks[].
*/
METHODDEF(void)
forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_col, JDIMENSION num_blocks)
/* This version is used for integer DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
<API key> do_dct = fdct->do_dct[compptr->component_index];
DCTELEM * divisors = (DCTELEM *) compptr->dct_table;
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register DCTELEM temp, qval;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
qval = divisors[i];
temp = workspace[i];
/* Divide the coefficient value by qval, ensuring proper rounding.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
*
* In most files, at least half of the output values will be zero
* (at default quantization settings, more like three-quarters...)
* so we should ensure that this case is fast. On many machines,
* a comparison is enough cheaper than a divide to make a special test
* a win. Since both inputs will be nonnegative, we need only test
* for a < b to discover whether a/b is 0.
* If your machine's division is fast enough, define FAST_DIVIDE.
*/
#ifdef FAST_DIVIDE
#define DIVIDE_BY(a,b) a /= b
#else
#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
#endif
if (temp < 0) {
temp = -temp;
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
temp = -temp;
} else {
temp += qval>>1; /* for rounding */
DIVIDE_BY(temp, qval);
}
output_ptr[i] = (JCOEF) temp;
}
}
}
}
#ifdef DCT_FLOAT_SUPPORTED
METHODDEF(void)
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_col, JDIMENSION num_blocks)
/* This version is used for floating-point DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
<API key> do_dct = fdct->do_float_dct[compptr->component_index];
FAST_FLOAT * divisors = (FAST_FLOAT *) compptr->dct_table;
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
{ register FAST_FLOAT temp;
register int i;
register JCOEFPTR output_ptr = coef_blocks[bi];
for (i = 0; i < DCTSIZE2; i++) {
/* Apply the quantization and scaling factor */
temp = workspace[i] * divisors[i];
/* Round to nearest integer.
* Since C does not specify the direction of rounding for negative
* quotients, we have to force the dividend positive for portability.
* The maximum coefficient size is +-16K (for 12-bit data), so this
* code should work for either 16-bit or 32-bit ints.
*/
output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);
}
}
}
}
#endif /* DCT_FLOAT_SUPPORTED */
/*
* Initialize for a processing pass.
* Verify that all referenced Q-tables are present, and set up
* the divisor table for each one.
* In the current implementation, DCT of all components is done during
* the first pass, even if only some components will be output in the
* first scan. Hence all components should be examined here.
*/
METHODDEF(void)
start_pass_fdctmgr (j_compress_ptr cinfo)
{
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
int ci, qtblno, i;
jpeg_component_info *compptr;
int method = 0;
JQUANT_TBL * qtbl;
DCTELEM * dtbl;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Select the proper DCT routine for this component's scaling */
switch ((compptr->DCT_h_scaled_size << 8) + compptr->DCT_v_scaled_size) {
#ifdef <API key>
case ((1 << 8) + 1):
fdct->do_dct[ci] = jpeg_fdct_1x1;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_2x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((3 << 8) + 3):
fdct->do_dct[ci] = jpeg_fdct_3x3;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_4x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((5 << 8) + 5):
fdct->do_dct[ci] = jpeg_fdct_5x5;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_6x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((7 << 8) + 7):
fdct->do_dct[ci] = jpeg_fdct_7x7;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((9 << 8) + 9):
fdct->do_dct[ci] = jpeg_fdct_9x9;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((10 << 8) + 10):
fdct->do_dct[ci] = jpeg_fdct_10x10;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((11 << 8) + 11):
fdct->do_dct[ci] = jpeg_fdct_11x11;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((12 << 8) + 12):
fdct->do_dct[ci] = jpeg_fdct_12x12;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((13 << 8) + 13):
fdct->do_dct[ci] = jpeg_fdct_13x13;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((14 << 8) + 14):
fdct->do_dct[ci] = jpeg_fdct_14x14;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((15 << 8) + 15):
fdct->do_dct[ci] = jpeg_fdct_15x15;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((16 << 8) + 16):
fdct->do_dct[ci] = jpeg_fdct_16x16;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((16 << 8) + 8):
fdct->do_dct[ci] = jpeg_fdct_16x8;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((14 << 8) + 7):
fdct->do_dct[ci] = jpeg_fdct_14x7;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((12 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_12x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((10 << 8) + 5):
fdct->do_dct[ci] = jpeg_fdct_10x5;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((8 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_8x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 3):
fdct->do_dct[ci] = jpeg_fdct_6x3;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_4x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 1):
fdct->do_dct[ci] = jpeg_fdct_2x1;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((8 << 8) + 16):
fdct->do_dct[ci] = jpeg_fdct_8x16;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((7 << 8) + 14):
fdct->do_dct[ci] = jpeg_fdct_7x14;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((6 << 8) + 12):
fdct->do_dct[ci] = jpeg_fdct_6x12;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((5 << 8) + 10):
fdct->do_dct[ci] = jpeg_fdct_5x10;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((4 << 8) + 8):
fdct->do_dct[ci] = jpeg_fdct_4x8;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((3 << 8) + 6):
fdct->do_dct[ci] = jpeg_fdct_3x6;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((2 << 8) + 4):
fdct->do_dct[ci] = jpeg_fdct_2x4;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
case ((1 << 8) + 2):
fdct->do_dct[ci] = jpeg_fdct_1x2;
method = JDCT_ISLOW; /* jfdctint uses islow-style table */
break;
#endif
case ((DCTSIZE << 8) + DCTSIZE):
switch (cinfo->dct_method) {
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
fdct->do_dct[ci] = jpeg_fdct_islow;
method = JDCT_ISLOW;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
fdct->do_dct[ci] = jpeg_fdct_ifast;
method = JDCT_IFAST;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
fdct->do_float_dct[ci] = jpeg_fdct_float;
method = JDCT_FLOAT;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
}
break;
default:
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
}
qtblno = compptr->quant_tbl_no;
/* Make sure specified quantization table is present */
if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
cinfo->quant_tbl_ptrs[qtblno] == NULL)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
qtbl = cinfo->quant_tbl_ptrs[qtblno];
/* Create divisor table from quant table */
switch (method) {
#ifdef <API key>
case JDCT_ISLOW:
/* For LL&M IDCT method, divisors are equal to raw quantization
* coefficients multiplied by 8 (to counteract scaling).
*/
dtbl = (DCTELEM *) compptr->dct_table;
for (i = 0; i < DCTSIZE2; i++) {
dtbl[i] =
((DCTELEM) qtbl->quantval[i]) << (compptr->component_needed ? 4 : 3);
}
fdct->pub.forward_DCT[ci] = forward_DCT;
break;
#endif
#ifdef DCT_IFAST_SUPPORTED
case JDCT_IFAST:
{
/* For AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
*/
#define CONST_BITS 14
static const INT16 aanscales[DCTSIZE2] = {
/* precomputed values scaled up by 14 bits */
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
};
SHIFT_TEMPS
dtbl = (DCTELEM *) compptr->dct_table;
for (i = 0; i < DCTSIZE2; i++) {
dtbl[i] = (DCTELEM)
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
compptr->component_needed ? CONST_BITS-4 : CONST_BITS-3);
}
}
fdct->pub.forward_DCT[ci] = forward_DCT;
break;
#endif
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
{
/* For float AA&N IDCT method, divisors are equal to quantization
* coefficients scaled by scalefactor[row]*scalefactor[col], where
* scalefactor[0] = 1
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
* We apply a further scale factor of 8.
* What's actually stored is 1/divisor so that the inner loop can
* use a multiplication rather than a division.
*/
FAST_FLOAT * fdtbl = (FAST_FLOAT *) compptr->dct_table;
int row, col;
static const double aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
i = 0;
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fdtbl[i] = (FAST_FLOAT)
(1.0 / ((double) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col] *
(compptr->component_needed ? 16.0 : 8.0)));
i++;
}
}
}
fdct->pub.forward_DCT[ci] = forward_DCT_float;
break;
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
}
}
}
/*
* Initialize FDCT manager.
*/
GLOBAL(void)
jinit_forward_dct (j_compress_ptr cinfo)
{
my_fdct_ptr fdct;
int ci;
jpeg_component_info *compptr;
fdct = (my_fdct_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_fdct_controller));
cinfo->fdct = &fdct->pub;
fdct->pub.start_pass = start_pass_fdctmgr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Allocate a divisor table for each component */
compptr->dct_table = (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(divisor_table));
}
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-field: Not compatible </title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.1 / mathcomp-field - 1.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-field
<small>
1.7.0
<span class="label label-info">Not compatible </span>
</small>
</h1>
<p> <em><script>document.write(moment("2022-03-08 23:20:38 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-08 23:20:38 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
name: "coq-mathcomp-field"
version: "1.7.0"
maintainer: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
synopsis: "The Mathematical Components library"
homepage: "https://math-comp.github.io/math-comp/"
bug-reports: "Mathematical Components <mathcomp-dev@sympa.inria.fr>"
dev-repo: "git+https://github.com/math-comp/math-comp.git"
license: "CeCILL-B"
build: [ make "-C" "mathcomp/field" "-j" "%{jobs}%" ]
install: [ make "-C" "mathcomp/field" "install" ]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/mathcomp/field'" ]
depends: [
"ocaml"
"<API key>" {= "1.7.0"}
]
tags: [ "keyword:algebra" "keyword:field" "keyword:small scale reflection" "keyword:mathematical components" "keyword:odd order theorem" ]
authors: [ "Jeremy Avigad <>" "Andrea Asperti <>" "Stephane Le Roux <>" "Yves Bertot <>" "Laurence Rideau <>" "Enrico Tassi <>" "Ioana Pasca <>" "Georges Gonthier <>" "Sidi Ould Biha <>" "Cyril Cohen <>" "Francois Garillot <>" "Alexey Solovyev <>" "Russell O&
url {
src: "http://github.com/math-comp/math-comp/archive/mathcomp-1.7.0.tar.gz"
checksum: "md5=<API key>"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install </h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-field.1.7.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1).
The following dependencies couldn't be met:
- coq-mathcomp-field -> <API key> = 1.7.0 -> <API key> = 1.7.0 -> <API key> = 1.7.0 -> <API key> = 1.7.0 -> coq < 8.10~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-field.1.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install </h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https:
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html> |
#include "stdafx.h"
#include "TimeMgr.h"
TimeMgr::TimeMgr()
:Manager(ManagerType::Enum::Time)
{
}
TimeMgr::~TimeMgr()
{
}
void TimeMgr::init()
{
}
void TimeMgr::process(const float dt)
{
}
void TimeMgr::end()
{
}
const float TimeMgr::GetDeltaTime() const
{
return 0.0f;
} |
package com.sg.model.sgdsRs.repdet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"ID",
"SingleSelect",
"FriendlyName",
"SlicerIcon",
"SlicerMappings"
})
public class ReportSharedSlicer {
@JsonProperty("ID")
private String iD;
@JsonProperty("SingleSelect")
private Boolean singleSelect;
@JsonProperty("FriendlyName")
private String friendlyName;
@JsonProperty("SlicerIcon")
private String slicerIcon;
@JsonProperty("SlicerMappings")
private List<SlicerMapping> slicerMappings = new ArrayList<SlicerMapping>();
@JsonIgnore
private Map<String, Object> <API key> = new HashMap<String, Object>();
/**
*
* @return
* The iD
*/
@JsonProperty("ID")
public String getID() {
return iD;
}
/**
*
* @param iD
* The ID
*/
@JsonProperty("ID")
public void setID(String iD) {
this.iD = iD;
}
/**
*
* @return
* The singleSelect
*/
@JsonProperty("SingleSelect")
public Boolean getSingleSelect() {
return singleSelect;
}
/**
*
* @param singleSelect
* The SingleSelect
*/
@JsonProperty("SingleSelect")
public void setSingleSelect(Boolean singleSelect) {
this.singleSelect = singleSelect;
}
/**
*
* @return
* The friendlyName
*/
@JsonProperty("FriendlyName")
public String getFriendlyName() {
return friendlyName;
}
/**
*
* @param friendlyName
* The FriendlyName
*/
@JsonProperty("FriendlyName")
public void setFriendlyName(String friendlyName) {
this.friendlyName = friendlyName;
}
/**
*
* @return
* The slicerIcon
*/
@JsonProperty("SlicerIcon")
public String getSlicerIcon() {
return slicerIcon;
}
/**
*
* @param slicerIcon
* The SlicerIcon
*/
@JsonProperty("SlicerIcon")
public void setSlicerIcon(String slicerIcon) {
this.slicerIcon = slicerIcon;
}
/**
*
* @return
* The slicerMappings
*/
@JsonProperty("SlicerMappings")
public List<SlicerMapping> getSlicerMappings() {
return slicerMappings;
}
/**
*
* @param slicerMappings
* The SlicerMappings
*/
@JsonProperty("SlicerMappings")
public void setSlicerMappings(List<SlicerMapping> slicerMappings) {
this.slicerMappings = slicerMappings;
}
@JsonAnyGetter
public Map<String, Object> <API key>() {
return this.<API key>;
}
@JsonAnySetter
public void <API key>(String name, Object value) {
this.<API key>.put(name, value);
}
} |
#include"complements.hpp"
vector<string> <API key>()
{
vector<string> all_complements;
all_complements.push_back("@MOTION_TO");
all_complements.push_back("@MOTION_FROM");
all_complements.push_back("@PLACE_AT");
all_complements.push_back("@TIME_TO");
all_complements.push_back("@TIME_FROM");
all_complements.push_back("@TIME_AT");
all_complements.push_back("@TIME_DURATION");
all_complements.push_back("@DATIVE");
all_complements.push_back("@CAUSED_BY");
all_complements.push_back("@FOR");
all_complements.push_back("@GENITIVE");
all_complements.push_back("@TOPIC");
all_complements.push_back("@AND");
all_complements.push_back("@OR");
all_complements.push_back("@WITH");
all_complements.push_back("@EXCLUDING");
all_complements.push_back("@AFTER");
all_complements.push_back("@BEFORE");
all_complements.push_back("@MOTION_THROUGH");
all_complements.push_back("@MOTION_AGAINST");
all_complements.push_back("@TIME_THROUGH");
all_complements.push_back("@QUANTITY");
all_complements.push_back("@QUANTIFIER");
all_complements.push_back("@ALLOCUTION");
all_complements.push_back("@COMPARED");
all_complements.push_back("@COMPARED_TO");
all_complements.push_back("@OWNED_BY");
all_complements.push_back("@CLOCK_AT");
all_complements.push_back("@OWN");
all_complements.push_back("@AGE");
all_complements.push_back("@MORE");
all_complements.push_back("@LESS");
all_complements.push_back("@TIMES");
all_complements.push_back("@MORE_THAN"); // this is like a @QUANTITY complement
all_complements.push_back("@LESS_THAN"); // this is like a @QUANTITY complement
all_complements.push_back("@SIZE");
all_complements.push_back("@ACCORDING_TO");
// all_complements.push_back("@TIME");
return all_complements;
}
map<string,string> <API key>()
{
map<string,string> all_complements;
all_complements["@MOTION_TO"]= "to";
all_complements["@MOTION_FROM"]= "from";
all_complements["@PLACE_AT"] = "in";
all_complements["@TIME_TO"] = "to";
all_complements["@TIME_FROM"]= "from";
all_complements["@TIME_AT"] = "at";
all_complements["@DATIVE"] = "to";
all_complements["@CAUSED_BY"]= "by";
all_complements["@FOR"]= "for";
all_complements["@GENITIVE"]= "of";
all_complements["@TOPIC"]= "about";
all_complements["@WITH"]= "with";
//all_complements["@EXCLUDING"]= "though";
//all_complements["@EXCLUDING"]= "without";
all_complements["@EXCLUDING"]= "even_though";
all_complements["@AFTER"]= "after";
all_complements["@BEFORE"]= "before";
all_complements["@MOTION_THROUGH"]= "across";
all_complements["@MOTION_AGAINST"]= "against";
all_complements["@TIME_THROUGH"]= "across";
all_complements["@CLOCK_AT"]= "at";
all_complements["@OWNED_BY"]= "of";
all_complements["@QUANTITY"]= "[of-quantity]";
all_complements["@QUANTIFIER"]= "[of-quantity]";
all_complements["@ALLOCUTION"]= "[speech]";
all_complements["@SIZE"]= "[of-size]";
all_complements["@TIMES"]= "[of-times]";
//all_complements["@COMPARED_TO"]= "than";
all_complements["@COMPARED_TO"]= "compared_to";
all_complements["@MORE"]= "more";
all_complements["@LESS"]= "less";
all_complements["@MORE_THAN"]= "more_than";
all_complements["@LESS_THAN"]= "less_than";
all_complements["@TIME_BETWEEN"]= "between";
all_complements["@TIME_DURATION"]= "for";
all_complements["@AND"]= "and";
all_complements["@OR"]= "or";
//all_complements["@SUB-OBJ"]= "to";
//all_complements["@SUBORD"]= "to";
all_complements["@ACCORDING_TO"]= "according_to";
all_complements["@AGE"]= "of";
return all_complements;
} |
import { Command } from 'commander';
import path from 'path';
import shell from 'shelljs';
import { exit, isNutmegComponent, notifyOfUpdate, nutmegDir } from './utils';
notifyOfUpdate();
const program = new Command();
program.command('test <path>', 'test a Web Component').parse(process.argv);
const workingDir = path.resolve(process.cwd(), program.args[0]);
const karmaConfigFile = path.resolve(nutmegDir, 'karma.component.config.js');
const karmaCmd = `karma start ${karmaConfigFile}`;
exit(
"Directory doesn't have a package.json with @nutmeg/seed as a dependancy.",
!isNutmegComponent(workingDir)
);
const result = shell.exec(`npx ${karmaCmd}`);
process.exit(result.code); |
#ifndef <API key>
#define <API key>
#include <gmpxx.h>
#include "expression.hpp"
namespace Parsers {
namespace Int {
extern Expr::Parser<mpz_class> parser;
extern void init();
extern inline mpz_class eval(const std::string &expression) {
return parser.parse(expression);
}
extern void factor(mpz_class n);
mpz_class convert(const std::string &str);
mpz_class power(const mpz_class &left, const mpz_class &right);
mpz_class mod(const mpz_class &left, const mpz_class &right);
mpz_class abs(const std::vector<mpz_class> &argv);
mpz_class sgn(const std::vector<mpz_class> &argv);
mpz_class fac(const std::vector<mpz_class> &argv);
mpz_class P(const std::vector<mpz_class> &argv);
mpz_class C(const std::vector<mpz_class> &argv);
mpz_class max(const std::vector<mpz_class> &argv);
mpz_class min(const std::vector<mpz_class> &argv);
mpz_class gcd(const std::vector<mpz_class> &argv);
mpz_class lcm(const std::vector<mpz_class> &argv);
mpz_class rand(const std::vector<mpz_class> &argv);
}
namespace Double {
extern Expr::Parser<double> parser;
extern void init();
extern inline double eval(const std::string &expression) {
return parser.parse(expression);
}
double convert(const std::string &str);
double power(const double &left, const double &right);
double mod(const double &left, const double &right);
double abs(const std::vector<double> &argv);
double sgn(const std::vector<double> &argv);
double sqrt_(const std::vector<double> &argv);
double floor_(const std::vector<double> &argv);
double ceil_(const std::vector<double> &argv);
double sin_(const std::vector<double> &argv);
double cos_(const std::vector<double> &argv);
double tan_(const std::vector<double> &argv);
double asin_(const std::vector<double> &argv);
double acos_(const std::vector<double> &argv);
double atan_(const std::vector<double> &argv);
double exp_(const std::vector<double> &argv);
double log_(const std::vector<double> &argv);
double log2_(const std::vector<double> &argv);
double log10_(const std::vector<double> &argv);
double rand_(const std::vector<double> &argv);
}
}
#endif /* <API key> */ |
<?php
namespace CodeIgniter4\Util;
use PHP_CodeSniffer\Util\Common as BaseCommon;
/**
* Common
*
* Extends common functions.
*
* @author Louis Linehan <louis.linehan@gmail.com>
*/
class Common extends BaseCommon
{
/**
* A list of all PHP magic methods.
*
* @var array
*/
public static $magicMethods = [
'construct' => true,
'destruct' => true,
'call' => true,
'callstatic' => true,
'get' => true,
'set' => true,
'isset' => true,
'unset' => true,
'sleep' => true,
'wakeup' => true,
'tostring' => true,
'set_state' => true,
'clone' => true,
'invoke' => true,
'debuginfo' => true,
];
/**
* Allowed public methodNames
*
* @var array
*/
public static $publicMethodNames = ['_remap' => true];
/**
* Is lower snake case
*
* @param string $string The string to verify.
*
* @return boolean
*/
public static function isLowerSnakeCase($string)
{
if (strcmp($string, strtolower($string)) !== 0) {
return false;
}
if (strpos($string, ' ') !== false) {
return false;
}
return true;
}//end isLowerSnakeCase()
/**
* Has an underscore prefix
*
* @param string $string The string to verify.
*
* @return boolean
*/
public static function hasUnderscorePrefix($string)
{
if (strpos($string, '_') !== 0) {
return false;
}
return true;
}//end hasUnderscorePrefix()
/**
* Pluralize
*
* Basic pluralize intended for use in error messages
* tab/s, space/s, error/s etc.
*
* @param string $string String.
* @param float $num Number.
*
* @return string
*/
public static function pluralize($string, $num)
{
if ($num > 1) {
return $string.'s';
} else {
return $string;
}
}//end pluralize()
}//end class |
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v8.4.0: v8::<API key>< K, V > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v8.4.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="<API key>">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html"><API key></a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="#pub-static-attribs">Static Public Attributes</a> |
<a href="<API key>.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::<API key>< K, V > Class Template Reference</div> </div>
</div><!--header
<div class="contents">
<p><code>#include <<a class="el" href="v8-util_8h_source.html">v8-util.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for v8::<API key>< K, V >:</div>
<div class="dyncontent">
<div class="center"><img src="<API key>.png" border="0" usemap="#<API key>" alt="Inheritance graph"/></div>
<map name="<API key>" id="<API key>">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for v8::<API key>< K, V >:</div>
<div class="dyncontent">
<div class="center"><img src="<API key>.png" border="0" usemap="#<API key>" alt="Collaboration graph"/></div>
<map name="<API key>" id="<API key>">
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef <a class="el" href="<API key>.html">PersistentValueMap</a>< K, V, <a class="el" href="<API key>.html"><API key></a>< K, V > > </td><td class="memItemRight" valign="bottom"><b>MapType</b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef void </td><td class="memItemRight" valign="bottom"><b><API key></b></td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="<API key>.html">v8::StdMapTraits< K, V ></a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef std::map< K, <API key> > </td><td class="memItemRight" valign="bottom"><b>Impl</b></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
typedef Impl::iterator </td><td class="memItemRight" valign="bottom"><b>Iterator</b></td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <API key> * </td><td class="memItemRight" valign="bottom"><b><API key></b> (<a class="el" href="<API key>.html">MapType</a> *map, const K &key, <a class="el" href="classv8_1_1Local.html">Local</a>< V > value)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <a class="el" href="<API key>.html">MapType</a> * </td><td class="memItemRight" valign="bottom"><b><API key></b> (const <a class="el" href="<API key>.html">WeakCallbackInfo</a>< <API key> > &data)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static K </td><td class="memItemRight" valign="bottom"><b><API key></b> (const <a class="el" href="<API key>.html">WeakCallbackInfo</a>< <API key> > &data)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static void </td><td class="memItemRight" valign="bottom"><b>DisposeCallbackData</b> (<API key> *data)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static void </td><td class="memItemRight" valign="bottom"><b>Dispose</b> (<a class="el" href="classv8_1_1Isolate.html">Isolate</a> *isolate, <a class="el" href="classv8_1_1Global.html">Global</a>< V > value, K key)</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header <API key>"><td colspan="2" onclick="javascript:toggleInherit('<API key>')"><img src="closed.png" alt="-"/> Static Public Member Functions inherited from <a class="el" href="<API key>.html">v8::StdMapTraits< K, V ></a></td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static bool </td><td class="memItemRight" valign="bottom"><b>Empty</b> (Impl *impl)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static size_t </td><td class="memItemRight" valign="bottom"><b>Size</b> (Impl *impl)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static void </td><td class="memItemRight" valign="bottom"><b>Swap</b> (Impl &a, Impl &b)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static Iterator </td><td class="memItemRight" valign="bottom"><b>Begin</b> (Impl *impl)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static Iterator </td><td class="memItemRight" valign="bottom"><b>End</b> (Impl *impl)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static K </td><td class="memItemRight" valign="bottom"><b>Key</b> (Iterator it)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <API key> </td><td class="memItemRight" valign="bottom"><b>Value</b> (Iterator it)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <API key> </td><td class="memItemRight" valign="bottom"><b>Set</b> (Impl *impl, K key, <API key> value)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <API key> </td><td class="memItemRight" valign="bottom"><b>Get</b> (Impl *impl, K key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:<API key> inherit <API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static <API key> </td><td class="memItemRight" valign="bottom"><b>Remove</b> (Impl *impl, K key)</td></tr>
<tr class="separator:<API key> inherit <API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="<API key>"></a>
static const <API key> </td><td class="memItemRight" valign="bottom"><b>kCallbackType</b> = kNotWeak</td></tr>
<tr class="separator:<API key>"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<typename K, typename V><br />
class v8::<API key>< K, V ></h3>
<p>A default trait implementation for <a class="el" href="<API key>.html">PersistentValueMap</a>, which inherits a std:map backing map from <a class="el" href="<API key>.html">StdMapTraits</a> and holds non-weak persistent objects and has no special Dispose handling.</p>
<p>You should not derive from this class, since MapType depends on the surrounding class, and hence a subclass cannot simply inherit the methods. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8-util_8h_source.html">v8-util.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html> |
namespace Potassium.Internal
{
using System;
using System.Linq;
using Potassium.Core;
internal sealed class MapEvent<T, TB> : FireEvent<TB>
{
private Observable<T> source;
private Func<T, TB> map;
private ISubscription<T> subscription;
public MapEvent(Observable<T> source, Func<T, TB> map)
{
this.source = source;
this.map = map;
this.subscription = source.Subscribe(new Observer<T>(this.Fire), this.Priority);
}
public void Fire(T firing, Transaction trans)
{
var v = this.map(firing);
this.Fire(v, trans);
}
public override TB[] SubscriptionFirings()
{
var firings = GetSubscribeFirings(source);
if (firings == null)
{
return null;
}
return firings.Select(e => map(e)).ToArray();
}
protected override void Dispose(bool disposing)
{
if (this.subscription != null)
{
this.subscription.Dispose();
this.subscription = null;
}
source = null;
map = null;
base.Dispose(disposing);
}
}
} |
<?php
class <API key> extends Icewhale_Operation
{
protected $_action = 'basicoperations';
protected $_operation = 'tasks';
protected $_parameters = array(
'memberId' => array(
'required' => TRUE,
),
'memberGuid' => array(
'required' => TRUE,
),
);
} |
package com.microsoft.azure.management.network.v2019_11_01;
import com.microsoft.azure.arm.collection.SupportsCreating;
import com.microsoft.azure.arm.resources.collection.<API key>;
import com.microsoft.azure.arm.resources.collection.<API key>;
import com.microsoft.azure.arm.resources.collection.<API key>;
import rx.Observable;
import com.microsoft.azure.arm.resources.collection.<API key>;
import com.microsoft.azure.arm.collection.SupportsListing;
import com.microsoft.azure.management.network.v2019_11_01.implementation.LoadBalancersInner;
import com.microsoft.azure.arm.model.HasInner;
/**
* Type representing LoadBalancers.
*/
public interface LoadBalancers extends SupportsCreating<LoadBalancer.DefinitionStages.Blank>, <API key>, <API key>, <API key><LoadBalancer>, <API key><LoadBalancer>, SupportsListing<LoadBalancer>, HasInner<LoadBalancersInner> {
} |
/**
* Entry point for defining Gulp tasks.
*/
// Pull in the tasks from the gulp-tasks directory.
require('require-dir')('./gulp/tasks');
// "test-with-coverage": "PORT=1337 node_modules/.bin/istanbul cover node_modules/.bin/cucumber-js --report teamcity --report lcov -- --require features-support -f progress",
// "<API key>": "node_modules/.bin/<API key> < coverage/lcov.info", |
<?php
declare (strict_types=1);
namespace JGI\SwedishDates\Date;
class UNDay implements DayInterface, <API key>
{
/**
* {@inheritdoc}
*/
public function match(\DateTime $datetime): bool
{
return $this->getDateForYear((int) $datetime->format('Y'))->format('Y-m-d') == $datetime->format('Y-m-d');
}
/**
* {@inheritdoc}
*/
public function isRed(): bool
{
return false;
}
/**
* {@inheritdoc}
*/
public function isHoliday(): bool
{
return false;
}
/**
* {@inheritdoc}
*/
public function getName(): string
{
return 'FN-dagen';
}
/**
* {@inheritdoc}
*/
public function getDateForYear(int $year)
{
return new \DateTime(sprintf('%s-10-24', $year));
}
} |
:: Copyright (c) Microsoft Corporation. All rights reserved.
:: This code is licensed under the Visual Studio SDK license terms.
:: THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
:: ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
:: IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
:: PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
:: Build the binaries then extract their registry attributes as a WiX include file
MSBuild ..\IronPython.sln /p:Configuration=Release /p:<API key>=false
..\..\..\Tools\Bin\regpkg.exe /codebase /root:Software\Microsoft\VisualStudio\9.0 /wixfile:.\<API key>.generated.wxi ..\bin\Release\<API key>.dll
..\..\..\Tools\Bin\regpkg.exe /codebase /root:Software\Microsoft\VisualStudio\9.0 /wixfile:.\IronPython.LanguageService.generated.wxi ..\bin\Release\IronPython.LanguageService.dll
..\..\..\Tools\Bin\regpkg.exe /codebase /root:Software\Microsoft\VisualStudio\9.0 /wixfile:.\PythonProject.generated.wxi ..\bin\Release\PythonProject.dll |
class <API key>
def initialize(app)
@app = app
end
def query_string(request, nonce)
{
code: request.params["code"],
state: request.params["state"],
nonce: nonce,
}.to_query
end
def signed_query_string(query, secret)
"#{query}&signature=#{sign(query, secret)}"
end
# Generates a signature given data and a secret
def sign(str, secret)
OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha256"), secret, str)
end
# Verifies the signature value in a request
def verify!(request, secret)
query = query_string(request, request.params["nonce"])
unless request.params["signature"] == sign(query, secret)
raise O<API key>, "OAuth state signatures do not match"
end
end
# Since we channel all OAuth request through a single domain we have to have a way
# to send the user back to their original subdomain.
def redirect_original(request, state_params, site)
response = Rack::Response.new
# Note that app_callback_url is added by OmniAuth.config.<API key>
# any value provided by a client will be overwritten in that method so that we
# don't use/trust values sent by the client
return_url = state_params["app_callback_url"]
query = query_string(request, SecureRandom.hex(64))
return_url << "?"
return_url << signed_query_string(query, site.secret)
response.redirect return_url
response.finish
end
# Adds all parameters back into the request
def restore_state(request, state_params, site, oauth_state, env)
verify!(request, site.secret)
# Restore the param from before the OAuth dance
state_params.each do |key, value|
request.update_param(key, value)
end
oauth_state.destroy
env["canvas.url"] = site.url
env["oauth_consumer_key"] = state_params["oauth_consumer_key"]
end
# Retrieves all original app parameters (settings) from the database during
# an OAuth callback
def get_state(request)
if request.params["state"].present? && request.params["code"].present?
if oauth_state = OauthState.find_by(state: request.params["state"])
[oauth_state, JSON.parse(oauth_state.payload) || {}]
else
raise O<API key>, "Invalid state during OAuth callback"
end
end
end
# Finds a site by looking for the site_id in the params or by finding an application instance by it's LTI key
def get_site(state_params)
# site id will typically be provided by apps that know the site that contains the Canvas url they want to OAuth
# with but they may or may not have an associated application instance.
if state_params["site_id"].present?
site = Site.find(state_params["site_id"])
end
# LTI apps will typically have the oauth_consumer_key available
if site.blank?
<API key> =
LtiAdvantage::Authorization.<API key>(state_params["id_token"]) ||
ApplicationInstance.find_by(lti_key: state_params["oauth_consumer_key"])
site = <API key>.site
end
site
end
def call(env)
request = Rack::Request.new(env)
oauth_state, state_params = get_state(request)
if oauth_state.present?
site = get_site(state_params)
if request.params["signature"].present?
restore_state(request, state_params, site, oauth_state, env)
else
return redirect_original(request, state_params, site)
end
end
@app.call(env)
end
end
class O<API key> < RuntimeError
end |
<?php
/* TwigBundle:Exception:logs.html.twig */
class <API key> extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<ol class=\"traces logs\">
";
// line 2
$context['_parent'] = (array) $context;
$context['_seq'] = <API key>($this->getContext($context, "logs"));
foreach ($context['_seq'] as $context["_key"] => $context["log"]) {
// line 3
echo " <li";
if (($this->getAttribute($this->getContext($context, "log"), "priority") >= 400)) {
echo " class=\"error\"";
} elseif (($this->getAttribute($this->getContext($context, "log"), "priority") >= 300)) {
echo " class=\"warning\"";
}
echo ">
";
// line 4
echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "log"), "priorityName"), "html", null, true);
echo " - ";
echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "log"), "message"), "html", null, true);
echo "
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['log'], $context['_parent'], $context['loop']);
$context = array_merge($_parent, array_intersect_key($context, $_parent));
// line 7
echo "</ol>
";
}
public function getTemplateName()
{
return "TwigBundle:Exception:logs.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 35 => 4, 26 => 3, 87 => 20, 55 => 13, 31 => 5, 25 => 4, 21 => 2, 94 => 22, 92 => 21, 89 => 20, 85 => 19, 79 => 18, 75 => 17, 72 => 16, 68 => 14, 64 => 12, 56 => 9, 50 => 8, 41 => 9, 24 => 3, 196 => 90, 187 => 84, 183 => 82, 173 => 74, 171 => 73, 168 => 72, 166 => 71, 163 => 70, 158 => 67, 156 => 66, 151 => 63, 142 => 59, 138 => 57, 136 => 56, 133 => 55, 123 => 47, 121 => 46, 117 => 44, 115 => 43, 112 => 42, 105 => 40, 101 => 24, 91 => 31, 86 => 28, 69 => 25, 66 => 15, 62 => 23, 51 => 12, 49 => 19, 39 => 6, 19 => 1, 98 => 40, 93 => 9, 88 => 6, 80 => 19, 78 => 40, 46 => 7, 44 => 10, 36 => 7, 32 => 12, 27 => 4, 22 => 2, 57 => 14, 54 => 21, 43 => 8, 40 => 8, 33 => 5, 30 => 3,);
}
} |
<template name="specialAlert">
<div id="dialogoverlay"></div>
<div id="dialogbox">
<div>
<div id="dialogboxhead"></div>
<div id="dialogboxbody">
<label>
<span>Title of the work :</span>
<input class="title" style="width:200px;"/>
</label>
<label>
<span>Producers :</span>
<input class="producer" style="width:200px;"/>
</label>
<label>
<span>URL to work :</span>
<input class="url" style="width:200px;"/>
</label>
<label>
<span>URL to discussion of work :</span>
<input class="discussion-url" style="width: 200px;"/>
</label>
<label>
<span>Type of work :</span>
<select class="type-of-work">
<option></option>
{{#each typeOfWork}}
<option>{{clientName}}</option>
{{/each}}
</select>
</label>
<hr>
<label>
<span>Your familiarity with the work :</span>
<select class="work-familiarity">
<option></option>
{{#each familiarity}}
<option value="{{number}}">{{clientName}}</option>
{{/each}}
</select>
</label>
<form>
<span>Work's relationship to {{#if name}}ideology{{else}}policy{{/if}} : </span>
<input type="radio" name="type" class="positive" value="positive"> Lends support
<input type="radio" name="type" class="critical" value="critical"> Criticizes
<input type="radio" name="type" class="enlightening" value="enlightening"> Informs
</form>
<label>
<span>How well it does its job :</span>
<input type="number" class="convincing-score" maxlength="3" max="100" min="0" style="width:40px">
</label>
<label>
<span>How easy it is to read/watch :</span>
<input type="number" class="readability-score" max="100" min="0" maxlength="3" style="width:40px">
</label>
<label>
<span>URL to your review of this work (optional) : </span>
<input class="review" style="width:200px;"/>
</label>
</div>
<div id="dialogboxfoot">
<button class="btn close-custom-alert">Cancel</button>
<button class="btn btn-primary <API key>">OK</button>
</div>
</div>
</div>
</template> |
var Widgets = require("./widgets.js");
_.each([
require("./widgets/categorizer.jsx"),
require("./widgets/dropdown.jsx"),
require("./widgets/example-widget.jsx"),
require("./widgets/<API key>.jsx"),
require("./widgets/expression.jsx"),
require("./widgets/grapher.jsx"),
require("./widgets/iframe.jsx"),
require("./widgets/image.jsx"),
require("./widgets/input-number.jsx"),
require("./widgets/interaction.jsx"),
require("./widgets/interactive-graph.jsx"),
require("./widgets/<API key>.jsx"),
require("./widgets/lights-puzzle.jsx"),
require("./widgets/matcher.jsx"),
require("./widgets/measurer.jsx"),
require("./widgets/number-line.jsx"),
require("./widgets/numeric-input.jsx"),
require("./widgets/orderer.jsx"),
require("./widgets/passage.jsx"),
require("./widgets/passage-ref.jsx"),
require("./widgets/passage-ref-target.jsx"),
require("./widgets/plotter.jsx"),
require("./widgets/radio.jsx"),
require("./widgets/simulator.jsx"),
require("./widgets/<API key>.jsx"),
require("./widgets/sorter.jsx"),
require("./widgets/table.jsx"),
require("./widgets/transformer.jsx")
], function(widget) {
Widgets.register(widget.name, _.omit(widget, "name"));
}); |
<mat-tab-group (selectedTabChange)="selectedTabChange($event)" *ngIf="chatGroupsExist">
<mat-tab *ngFor="let chat of chatGroupSubject | async">
<ng-template mat-tab-label>
<span
[matBadgeHidden]="!<API key>(chat.id)"
[matBadge]="<API key>(chat.id)"
matBadgeColor="accent"
matBadgeOverlap="false"
>
{{ chat.name }}
</span>
</ng-template>
<ng-template matTabContent>
<<API key> [chatGroup]="chat"> </<API key>>
</ng-template>
</mat-tab>
</mat-tab-group>
<div *ngIf="!chatGroupsExist">
<span>
{{ 'No chat groups available' | translate }}
</span>
</div>
<!-- send chat -->
<form [formGroup]="newMessageForm" (ngSubmit)="send()" *ngIf="chatGroupsExist && <API key>" [@collapse]>
<mat-form-field appearance="outline" class="chat-form-field">
<input #chatinput autocomplete="off" type="text" matInput formControlName="text" />
<mat-hint align="end" *ngIf="chatinput.value?.length >= <API key> - 100">
<span> {{ chatinput.value?.length || 0 }}/{{ <API key> }} </span>
<span class="warn" *ngIf="chatinput.value?.length > <API key>">
({{ <API key> - chatinput.value?.length }})
</span>
</mat-hint>
<mat-label>{{ 'Message' | translate }}</mat-label>
<mat-spinner *ngIf="messagePending" matSuffix diameter="30"></mat-spinner>
<button
mat-icon-button
matSuffix
type="submit"
color="accent"
matTooltip=" {{ 'Send' | translate }}"
*ngIf="!messagePending"
[disabled]="!chatinput.value?.trim()?.length || newMessageForm.invalid || messagePending"
>
<mat-icon>send</mat-icon>
</button>
</mat-form-field>
</form> |
/**
* Main JS file for Casper behaviours
*/
/* globals jQuery, document */
(function ($, window, undefined) {
"use strict";
var $document = $(document),
// debouncing function from John Hann
debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
if (!execAsap) {
func.apply(obj, args);
}
timeout = null;
}
if (timeout) {
clearTimeout(timeout);
} else if (execAsap) {
func.apply(obj, args);
}
timeout = setTimeout(delayed, threshold || 100);
};
},
changeColor = function(e) {
var top = $('.main-header').height();
if ( e.currentTarget.scrollY > top) {
$('.main-header nav a').addClass('highlight');
} else {
$('.main-header nav a').removeClass('highlight');
}
},
scrollPosition = 0,
rotation = 45,
vertical = 210;
$document.ready(function () {
$(window).scroll(function(e){
// adapts menu icon color to background once
// user scrolls below header image
if ( $('body').hasClass('post-template') ) {
debounce(changeColor(e), 300);
}
});
$.each($('span.label'), function(){
if(this.innerHTML.indexOf('_')>-1) {
$(this).html(this.innerHTML.replace('_',' '))
}
});
});
})(jQuery, window); |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Thu Oct 27 12:13:58 EEST 2016 -->
<title>SKBoundingBox (SKMaps Framework)</title>
<meta name="date" content="2016-10-27">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SKBoundingBox (SKMaps Framework)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SKBoundingBox.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/skobbler/ngx/map/SKAnnotationView.html" title="class in com.skobbler.ngx.map"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/skobbler/ngx/map/SKCalloutView.html" title="class in com.skobbler.ngx.map"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/skobbler/ngx/map/SKBoundingBox.html" target="_top">Frames</a></li>
<li><a href="SKBoundingBox.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<div class="subTitle">com.skobbler.ngx.map</div>
<h2 title="Class SKBoundingBox" class="title">Class SKBoundingBox</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.skobbler.ngx.map.SKBoundingBox</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">SKBoundingBox</span>
extends java.lang.Object</pre>
<div class="block">Stores information about a bounding box.</div>
<dl><dt><span class="strong">Version:</span></dt>
<dd>3.0.2</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#SKBoundingBox(com.skobbler.ngx.SKCoordinate,%20com.skobbler.ngx.SKCoordinate)">SKBoundingBox</a></strong>(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> topLeft,
<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> bottomRight)</code>
<div class="block">Constructor</div>
</td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_summary">
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#getBottomRight()">getBottomRight</a></strong>()</code>
<div class="block">Returns the bottom right coordinate for bounding box.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#getTopLeft()">getTopLeft</a></strong>()</code>
<div class="block">Returns the top left coordinate for bounding box.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#setBottomRight(com.skobbler.ngx.SKCoordinate)">setBottomRight</a></strong>(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> bottomRight)</code>
<div class="block">Sets the bottom right coordinate for bounding box.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#setTopLeft(com.skobbler.ngx.SKCoordinate)">setTopLeft</a></strong>(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> topLeft)</code>
<div class="block">Sets the top left coordinate for bounding box.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../com/skobbler/ngx/map/SKBoundingBox.html#toString()">toString</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
</a>
<h3>Constructor Detail</h3>
<a name="SKBoundingBox(com.skobbler.ngx.SKCoordinate, com.skobbler.ngx.SKCoordinate)">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SKBoundingBox</h4>
<pre>public SKBoundingBox(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> topLeft,
<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> bottomRight)</pre>
<div class="block">Constructor</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>topLeft</code> - top left corner for bounding box</dd><dd><code>bottomRight</code> - bottom right corner for bounding box</dd></dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_detail">
</a>
<h3>Method Detail</h3>
<a name="getTopLeft()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTopLeft</h4>
<pre>public <a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> getTopLeft()</pre>
<div class="block">Returns the top left coordinate for bounding box.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the topLeft</dd></dl>
</li>
</ul>
<a name="setTopLeft(com.skobbler.ngx.SKCoordinate)">
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTopLeft</h4>
<pre>public void setTopLeft(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> topLeft)</pre>
<div class="block">Sets the top left coordinate for bounding box.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>topLeft</code> - the topLeft to set</dd></dl>
</li>
</ul>
<a name="getBottomRight()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBottomRight</h4>
<pre>public <a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> getBottomRight()</pre>
<div class="block">Returns the bottom right coordinate for bounding box.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the bottomRight</dd></dl>
</li>
</ul>
<a name="setBottomRight(com.skobbler.ngx.SKCoordinate)">
</a>
<ul class="blockList">
<li class="blockList">
<h4>setBottomRight</h4>
<pre>public void setBottomRight(<a href="../../../../com/skobbler/ngx/SKCoordinate.html" title="class in com.skobbler.ngx">SKCoordinate</a> bottomRight)</pre>
<div class="block">Sets the bottom right coordinate for bounding box.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>bottomRight</code> - the bottomRight to set</dd></dl>
</li>
</ul>
<a name="toString()">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SKBoundingBox.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/skobbler/ngx/map/SKAnnotationView.html" title="class in com.skobbler.ngx.map"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/skobbler/ngx/map/SKCalloutView.html" title="class in com.skobbler.ngx.map"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/skobbler/ngx/map/SKBoundingBox.html" target="_top">Frames</a></li>
<li><a href="SKBoundingBox.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>
<i>Copyright &
</body>
</html> |
class PricesController < <API key>
before_filter :authorize_admin!, :only => [:destroy, :revision, :revision_remove, :delete_revisions]
before_filter :authenticate_user!, :except => [:show, :destroy, :revision, :revision_remove, :delete_revisions]
before_filter :find_university_id, :except => :index
before_filter :find_price_id, :only => [:edit, :update, :show, :destroy, :delete_revisions]
before_filter :find_version, :only => [:revision, :revision_remove]
def new
@price = @university.prices.new
end
def edit
if can?(:review, @price) and @price.versions.present?
@revisions = @price.versions
end
end
def show
end
def update
if @price.update_attributes(params[:price])
redirect_to [@university, @price], :notice => t(:prup_text)
else
flash[:alert] = t(:prnotup_text)
render :action => :edit
end
end
def create
@price = @university.prices.new params[:price]
if @price.valid?
duplicate = @price.find_duplicate
if duplicate.present?
[:score_5, :score_4, :score_3, :test, :attestation, :course_work].each do |key|
duplicate[key] = params[:price][key]
end
redirect_to [@university, duplicate.lesson], :notice => t(:prup_text) if duplicate.save
else
@price.save
redirect_to [@university, @price.lesson], :notice => t(:prnotup_text) if @price.save
end
else
flash[:alert] = t(:prnotcr_text)
render :action => "new"
end
end
def revision
@price = @version.reify
if @price.save
@version.destroy
flash[:notice] = t(:prup_text)
else
flash[:alert] = t(:prnotup_text)
end
redirect_to <API key>(@university, @price)
end
def revision_remove
@price = Price.find params[:price_id]
@version.destroy
redirect_to <API key>(@university, @price), :notice => t(:revdel_text)
end
def delete_revisions
@price.versions.each do |version|
version.destroy
end
redirect_to <API key>(@university, @price), :notice => t(:allrevdel_text)
end
def destroy # FIXME: Move this code into model with callback! Thin controller, fat model!
@price.versions.each do |revision|
revision.destroy
end
Price.delete_with_lesson(@price) # FIXME: Add disable for storing destroy action
redirect_to @university, notice: t(:prdel_text)
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.