text
stringlengths 2
1.04M
| meta
dict |
|---|---|
package rpc
import (
"github.com/golang/glog"
"github.com/nebulaim/telegramd/baselib/grpc_util"
"github.com/nebulaim/telegramd/baselib/logger"
"github.com/nebulaim/telegramd/proto/mtproto"
"golang.org/x/net/context"
)
// help.getAppUpdate#c812ac7e device_model:string system_version:string app_version:string lang_code:string = help.AppUpdate;
func (s *HelpServiceImpl) HelpGetAppUpdateLayer46(ctx context.Context, request *mtproto.TLHelpGetAppUpdateLayer46) (*mtproto.Help_AppUpdate, error) {
md := grpc_util.RpcMetadataFromIncoming(ctx)
glog.Infof("help.getAppUpdate#c812ac7e - metadata: %s, request: %s", logger.JsonDebugData(md), logger.JsonDebugData(request))
// TODO(@benqi): Impl HelpGetAppUpdate logic
reply := &mtproto.TLHelpNoAppUpdate{Data2: &mtproto.Help_AppUpdate_Data{}}
glog.Infof("help.getAppUpdate#c812ac7e - reply: %s\n", logger.JsonDebugData(reply))
return reply.To_Help_AppUpdate(), nil
}
|
{
"content_hash": "0b9c63c5574b2653c7c4e9f08b4a8b53",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 149,
"avg_line_length": 40.26086956521739,
"alnum_prop": 0.775377969762419,
"repo_name": "nebulaim/telegramd",
"id": "0c414e75faf4ecaa8be777b805a0c273fb8b91a1",
"size": "1565",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/biz_server/help/rpc/help.getAppUpdateLayer46_handler.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "3708"
},
{
"name": "Go",
"bytes": "4917881"
},
{
"name": "Makefile",
"bytes": "43"
},
{
"name": "Python",
"bytes": "2877"
},
{
"name": "Shell",
"bytes": "7922"
},
{
"name": "Smarty",
"bytes": "67081"
}
],
"symlink_target": ""
}
|
class SitesController < ApplicationController
before_filter :remove_methods, :only => [:new, :create, :destroy]
before_filter :find_site, :except => [:index, :create, :new, :clear_cache]
before_filter :visitor_node
before_filter :check_is_admin
layout :admin_layout
def index
secure!(Site) do
@sites = Site.paginate(:all, :order => 'host', :per_page => 20, :page => params[:page])
end
respond_to do |format|
format.html # index.erb
format.xml { render :xml => @sites }
end
end
def show
respond_to do |format|
format.html
format.xml { render :xml => @site }
format.js
end
end
def jobs
@jobs = @site.respond_to?(:jobs) ? @site.jobs : []
respond_to do |format|
format.html
end
end
def edit
respond_to do |format|
format.html
format.js { render :partial => 'sites/form', :layout => false }
end
end
def update
respond_to do |format|
if @site.update_attributes(params[:site])
flash.now[:notice] = _('Site was successfully updated.')
format.html { redirect_to site_path(@site) }
format.js
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.js
format.xml { render :xml => @site.errors }
end
end
end
def clear_cache
secure!(Site) { Site.all }.each do |site|
site.clear_cache
end
redirect_to '/'
end
def action
if Site::ACTIONS.include?(params[:do])
@site.send(params[:do])
flash.now[:notice] = _("#{params[:do]} done.")
else
flash.now[:error] = _("Invalid action '%{action}'.") % {:action => params[:do]}
end
end
protected
def remove_methods
raise ActiveRecord::RecordNotFound
end
def find_site
@site = secure!(Site) { Site.find(params[:id])}
end
end
|
{
"content_hash": "e258ae7a632a639538e744657ed3003c",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 93,
"avg_line_length": 23.525,
"alnum_prop": 0.5834218916046758,
"repo_name": "zena/zena",
"id": "63adccf29ce78852230b500c747743e0fec503a7",
"size": "1970",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/controllers/sites_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "36000"
},
{
"name": "ApacheConf",
"bytes": "1250"
},
{
"name": "CSS",
"bytes": "146443"
},
{
"name": "HTML",
"bytes": "295199"
},
{
"name": "JavaScript",
"bytes": "289768"
},
{
"name": "Ruby",
"bytes": "2336285"
},
{
"name": "Shell",
"bytes": "1800"
}
],
"symlink_target": ""
}
|
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
module Control.Disruptor.RingBuffer.Generic where
import Control.Disruptor.Cursor
import Control.Disruptor.DataProvider
import Control.Disruptor.Sequence
import Control.Disruptor.Sequencer
class (DataProvider (b a) a, Cursor (b a) a, Sequenced (b a) a) => RingBuffer (b :: * -> *) a where
|
{
"content_hash": "8f7a44fae4df8e926662a8f9b95e0d28",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 99,
"avg_line_length": 37.25,
"alnum_prop": 0.727069351230425,
"repo_name": "iand675/disruptor",
"id": "1a676b8f0f398e2c96f34f6512e64a8e93652e34",
"size": "447",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Control/Disruptor/RingBuffer/Generic.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Haskell",
"bytes": "47226"
},
{
"name": "Nix",
"bytes": "829"
}
],
"symlink_target": ""
}
|
package acmi.l2.clientmod.utxconv;
import acmi.l2.clientmod.io.RandomAccessFile;
import acmi.l2.clientmod.io.UnrealPackageFile;
import acmi.l2.clientmod.unreal.classloader.FolderPackageLoader;
import acmi.l2.clientmod.unreal.classloader.PropertiesUtil;
import acmi.l2.clientmod.unreal.classloader.UnrealClassLoader;
import acmi.l2.clientmod.unreal.core.Package;
import acmi.l2.clientmod.unreal.engine.Font;
import acmi.l2.clientmod.unreal.engine.Material;
import acmi.l2.clientmod.unreal.engine.Palette;
import acmi.l2.clientmod.unreal.objectfactory.ObjectFactory;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.charset.Charset;
import static acmi.l2.clientmod.io.ByteUtil.uuidToBytes;
public class ConvertTool {
private static final int NEW_PACKAGE_VERSION = 0x00000076;
public static void save(UnrealPackageFile up, File savePath, UnrealClassLoader classLoader) throws IOException {
save(up, savePath, System.out, classLoader);
}
public static void save(UnrealPackageFile up, File savePath, PrintStream log, UnrealClassLoader classLoader) throws IOException {
ObjectFactory objectFactory = new ObjectFactory(classLoader);
PropertiesUtil propertiesUtil = classLoader.getPropertiesUtil();
log = checkLog(log);
try (RandomAccessFile dest = new RandomAccessFile(savePath, false, Charset.forName("ascii"))) {
dest.setLength(0);
dest.writeInt(UnrealPackageFile.UNREAL_PACKAGE_MAGIC);
dest.writeInt(NEW_PACKAGE_VERSION);
dest.writeInt(up.getFlags());
dest.writeInt(up.getNameTable().size());
dest.writeInt(0);
dest.writeInt(up.getExportTable().size());
dest.writeInt(0);
dest.writeInt(up.getImportTable().size());
dest.writeInt(0);
dest.write(uuidToBytes(up.getUUID()));
dest.writeInt(up.getGenerations().size());
for (UnrealPackageFile.Generation generation : up.getGenerations()) {
dest.writeInt(generation.getExportCount());
dest.writeInt(generation.getNameCount());
}
int nameOffset = dest.getPosition();
dest.setPosition(16);
dest.writeInt(nameOffset);
dest.setPosition(nameOffset);
for (int i = 0; i < up.getNameTable().size(); i++) {
UnrealPackageFile.NameEntry nameEntry = up.getNameTable().get(i);
if (!dest.getCharset().newEncoder().canEncode(nameEntry.getName()))
log.println("UTF->ASCII: " + nameEntry.getName());
dest.writeBytes(nameEntry.getName());
dest.writeInt(nameEntry.getFlags());
}
int[] exportSizes = new int[up.getExportTable().size()];
int[] exportOffsets = new int[up.getExportTable().size()];
boolean[] deleted = new boolean[up.getExportTable().size()];
for (int i = 0; i < up.getExportTable().size(); i++) {
exportOffsets[i] = dest.getPosition();
UnrealPackageFile.ExportEntry exportEntry = up.getExportTable().get(i);
acmi.l2.clientmod.unreal.core.Object object = objectFactory.apply(exportEntry);
if (!(object instanceof Package) &&
!(object instanceof Material) &&
!(object instanceof Palette) &&
!(object instanceof Font)) {
object = new Package();
deleted[i] = true;
}
object.writeTo(dest, propertiesUtil);
exportSizes[i] = dest.getPosition() - exportOffsets[i];
}
int importOffset = dest.getPosition();
dest.setPosition(32);
dest.writeInt(importOffset);
dest.setPosition(importOffset);
for (UnrealPackageFile.ImportEntry importEntry : up.getImportTable()) {
dest.writeCompactInt(up.nameReference(importEntry.getClassPackage().getName()));
dest.writeCompactInt(up.nameReference(importEntry.getClassName().getName()));
dest.writeInt(importEntry.getObjectPackage() != null ? importEntry.getObjectPackage().getObjectReference() : 0);
dest.writeCompactInt(up.nameReference(importEntry.getObjectName().getName()));
}
int exportOffset = dest.getPosition();
dest.setPosition(24);
dest.writeInt(exportOffset);
dest.setPosition(exportOffset);
for (int i = 0; i < up.getExportTable().size(); i++) {
UnrealPackageFile.ExportEntry exportEntry = up.getExportTable().get(i);
String objClass = exportEntry.getObjectClass().toString();
if (deleted[i]) {
objClass = "Core.Package";
log.println("REMOVED: " + exportEntry.toString() + "[" + exportEntry.getObjectClass().getObjectFullName() + "]");
}
dest.writeCompactInt(up.objectReference(objClass));
dest.writeCompactInt(exportEntry.getObjectSuperClass() != null ? exportEntry.getObjectSuperClass().getObjectReference() : 0);
dest.writeInt(exportEntry.getObjectPackage() != null ? exportEntry.getObjectPackage().getObjectReference() : 0);
dest.writeCompactInt(up.nameReference(exportEntry.getObjectName().getName()));
dest.writeInt(exportEntry.getObjectFlags());
dest.writeCompactInt(exportSizes[i]);
dest.writeCompactInt(exportOffsets[i]);
}
}
}
private static PrintStream checkLog(PrintStream log) {
return log != null ? log : new PrintStream(new OutputStream() {
@Override
public void write(int b) throws IOException {
}
});
}
public static void main(String[] args) {
if (args.length < 2 || args.length > 3) {
System.out.println("USAGE: " + ConvertTool.class.getSimpleName() + " l2_system l2_utx [ued_utx]");
System.out.println("\tl2_system - L2 system folder with .u packages");
System.out.println("\tl2_utx - input");
System.out.println("\tued_utx - output");
System.exit(0);
}
try (UnrealPackageFile up = new UnrealPackageFile(args[1], true)) {
save(up, new File(args[2]), new UnrealClassLoader(new FolderPackageLoader(args[0])));
} catch (IOException e) {
System.err.print(e.getClass());
if (e.getMessage() != null)
System.err.print(": " + e.getMessage());
System.err.println();
}
}
}
|
{
"content_hash": "113abea883bb76716d41ca5e6c7b699a",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 141,
"avg_line_length": 46.97241379310345,
"alnum_prop": 0.6128321832330055,
"repo_name": "acmi/l2io_legacy",
"id": "3d6ee9eec2f9cc0b3fdd5bc7793d9a3c8ffefa67",
"size": "7919",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/acmi/l2/clientmod/utxconv/ConvertTool.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "536648"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("SimpleAuth.Facebook.iOS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("IIS")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Clancey")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
|
{
"content_hash": "6dc293c0270ed44b5f76fb205b219b7b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 82,
"avg_line_length": 37.03703703703704,
"alnum_prop": 0.745,
"repo_name": "superlloyd/SimpleAuth",
"id": "9edead04da27de5b773a770075eaa9c9264b2bd6",
"size": "1002",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/SimpleAuth.Facebook.iOS/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "136014"
}
],
"symlink_target": ""
}
|
http://shinkendo.org.uk/
The website of Shinkendo UK, England Branch of the International Shinkendo Federation, the Aikibujutsu Tanren Kenkyukai and the Kokusai Toyama Ryu Renmei organisations.
The website is implemented from the grayscale theme:
# [Start Bootstrap](http://startbootstrap.com/) - [Grayscale](http://startbootstrap.com/template-overviews/grayscale/)
[Grayscale](http://startbootstrap.com/template-overviews/grayscale/) is a multipurpose, one page HTML theme for [Bootstrap](http://getbootstrap.com/) created by [Start Bootstrap](http://startbootstrap.com/). This template features various content sections and a Google Maps section with a custom map marker.
## Getting Started
To use this template, choose one of the following options to get started:
* Download the latest release on Start Bootstrap
* Fork this repository on GitHub
## Bugs and Issues
Have a bug or an issue with this template? [Open a new issue](https://github.com/IronSummitMedia/startbootstrap-grayscale/issues) here on GitHub or leave a comment on the [template overview page at Start Bootstrap](http://startbootstrap.com/template-overviews/grayscale/).
## Creator
Start Bootstrap was created by and is maintained by **David Miller**, Managing Parter at [Iron Summit Media Strategies](http://www.ironsummitmedia.com/).
* https://twitter.com/davidmillerskt
* https://github.com/davidtmiller
Start Bootstrap is based on the [Bootstrap](http://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).
## Copyright and License
Copyright 2013-2015 Iron Summit Media Strategies, LLC. Code released under the [Apache 2.0](https://github.com/IronSummitMedia/startbootstrap-grayscale/blob/gh-pages/LICENSE) license.
|
{
"content_hash": "904636009eb6c2da0030ccca4c3a8a4e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 307,
"avg_line_length": 55.4375,
"alnum_prop": 0.7857948139797069,
"repo_name": "enridaga/shinkendo-uk",
"id": "4dc462b47a7c548ce88677d92731e31f24c838a5",
"size": "1827",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "227"
},
{
"name": "CSS",
"bytes": "132733"
},
{
"name": "HTML",
"bytes": "4315"
},
{
"name": "JavaScript",
"bytes": "5620"
},
{
"name": "PHP",
"bytes": "52228"
}
],
"symlink_target": ""
}
|
package com.amazonaws.services.resiliencehub.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/resiliencehub-2020-04-30/ImportResourcesToDraftAppVersion"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImportResourcesToDraftAppVersionResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable,
Cloneable {
/**
* <p>
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs,
* see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names
* (ARNs)</a> in the <i>AWS General Reference</i>.
* </p>
*/
private String appArn;
/**
* <p>
* The version of the application.
* </p>
*/
private String appVersion;
/**
* <p>
* The Amazon Resource Names (ARNs) for the resources that you imported.
* </p>
*/
private java.util.List<String> sourceArns;
/**
* <p>
* The status of the action.
* </p>
*/
private String status;
/**
* <p>
* A list of terraform file s3 URLs you need to import.
* </p>
*/
private java.util.List<TerraformSource> terraformSources;
/**
* <p>
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs,
* see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names
* (ARNs)</a> in the <i>AWS General Reference</i>.
* </p>
*
* @param appArn
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information
* about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">
* Amazon Resource Names (ARNs)</a> in the <i>AWS General Reference</i>.
*/
public void setAppArn(String appArn) {
this.appArn = appArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs,
* see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names
* (ARNs)</a> in the <i>AWS General Reference</i>.
* </p>
*
* @return The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information
* about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">
* Amazon Resource Names (ARNs)</a> in the <i>AWS General Reference</i>.
*/
public String getAppArn() {
return this.appArn;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs,
* see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names
* (ARNs)</a> in the <i>AWS General Reference</i>.
* </p>
*
* @param appArn
* The Amazon Resource Name (ARN) of the application. The format for this ARN is: arn:<code>partition</code>
* :resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information
* about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">
* Amazon Resource Names (ARNs)</a> in the <i>AWS General Reference</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withAppArn(String appArn) {
setAppArn(appArn);
return this;
}
/**
* <p>
* The version of the application.
* </p>
*
* @param appVersion
* The version of the application.
*/
public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
}
/**
* <p>
* The version of the application.
* </p>
*
* @return The version of the application.
*/
public String getAppVersion() {
return this.appVersion;
}
/**
* <p>
* The version of the application.
* </p>
*
* @param appVersion
* The version of the application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withAppVersion(String appVersion) {
setAppVersion(appVersion);
return this;
}
/**
* <p>
* The Amazon Resource Names (ARNs) for the resources that you imported.
* </p>
*
* @return The Amazon Resource Names (ARNs) for the resources that you imported.
*/
public java.util.List<String> getSourceArns() {
return sourceArns;
}
/**
* <p>
* The Amazon Resource Names (ARNs) for the resources that you imported.
* </p>
*
* @param sourceArns
* The Amazon Resource Names (ARNs) for the resources that you imported.
*/
public void setSourceArns(java.util.Collection<String> sourceArns) {
if (sourceArns == null) {
this.sourceArns = null;
return;
}
this.sourceArns = new java.util.ArrayList<String>(sourceArns);
}
/**
* <p>
* The Amazon Resource Names (ARNs) for the resources that you imported.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setSourceArns(java.util.Collection)} or {@link #withSourceArns(java.util.Collection)} if you want to
* override the existing values.
* </p>
*
* @param sourceArns
* The Amazon Resource Names (ARNs) for the resources that you imported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withSourceArns(String... sourceArns) {
if (this.sourceArns == null) {
setSourceArns(new java.util.ArrayList<String>(sourceArns.length));
}
for (String ele : sourceArns) {
this.sourceArns.add(ele);
}
return this;
}
/**
* <p>
* The Amazon Resource Names (ARNs) for the resources that you imported.
* </p>
*
* @param sourceArns
* The Amazon Resource Names (ARNs) for the resources that you imported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withSourceArns(java.util.Collection<String> sourceArns) {
setSourceArns(sourceArns);
return this;
}
/**
* <p>
* The status of the action.
* </p>
*
* @param status
* The status of the action.
* @see ResourceImportStatusType
*/
public void setStatus(String status) {
this.status = status;
}
/**
* <p>
* The status of the action.
* </p>
*
* @return The status of the action.
* @see ResourceImportStatusType
*/
public String getStatus() {
return this.status;
}
/**
* <p>
* The status of the action.
* </p>
*
* @param status
* The status of the action.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceImportStatusType
*/
public ImportResourcesToDraftAppVersionResult withStatus(String status) {
setStatus(status);
return this;
}
/**
* <p>
* The status of the action.
* </p>
*
* @param status
* The status of the action.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceImportStatusType
*/
public ImportResourcesToDraftAppVersionResult withStatus(ResourceImportStatusType status) {
this.status = status.toString();
return this;
}
/**
* <p>
* A list of terraform file s3 URLs you need to import.
* </p>
*
* @return A list of terraform file s3 URLs you need to import.
*/
public java.util.List<TerraformSource> getTerraformSources() {
return terraformSources;
}
/**
* <p>
* A list of terraform file s3 URLs you need to import.
* </p>
*
* @param terraformSources
* A list of terraform file s3 URLs you need to import.
*/
public void setTerraformSources(java.util.Collection<TerraformSource> terraformSources) {
if (terraformSources == null) {
this.terraformSources = null;
return;
}
this.terraformSources = new java.util.ArrayList<TerraformSource>(terraformSources);
}
/**
* <p>
* A list of terraform file s3 URLs you need to import.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setTerraformSources(java.util.Collection)} or {@link #withTerraformSources(java.util.Collection)} if you
* want to override the existing values.
* </p>
*
* @param terraformSources
* A list of terraform file s3 URLs you need to import.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withTerraformSources(TerraformSource... terraformSources) {
if (this.terraformSources == null) {
setTerraformSources(new java.util.ArrayList<TerraformSource>(terraformSources.length));
}
for (TerraformSource ele : terraformSources) {
this.terraformSources.add(ele);
}
return this;
}
/**
* <p>
* A list of terraform file s3 URLs you need to import.
* </p>
*
* @param terraformSources
* A list of terraform file s3 URLs you need to import.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImportResourcesToDraftAppVersionResult withTerraformSources(java.util.Collection<TerraformSource> terraformSources) {
setTerraformSources(terraformSources);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAppArn() != null)
sb.append("AppArn: ").append(getAppArn()).append(",");
if (getAppVersion() != null)
sb.append("AppVersion: ").append(getAppVersion()).append(",");
if (getSourceArns() != null)
sb.append("SourceArns: ").append(getSourceArns()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getTerraformSources() != null)
sb.append("TerraformSources: ").append(getTerraformSources());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImportResourcesToDraftAppVersionResult == false)
return false;
ImportResourcesToDraftAppVersionResult other = (ImportResourcesToDraftAppVersionResult) obj;
if (other.getAppArn() == null ^ this.getAppArn() == null)
return false;
if (other.getAppArn() != null && other.getAppArn().equals(this.getAppArn()) == false)
return false;
if (other.getAppVersion() == null ^ this.getAppVersion() == null)
return false;
if (other.getAppVersion() != null && other.getAppVersion().equals(this.getAppVersion()) == false)
return false;
if (other.getSourceArns() == null ^ this.getSourceArns() == null)
return false;
if (other.getSourceArns() != null && other.getSourceArns().equals(this.getSourceArns()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getTerraformSources() == null ^ this.getTerraformSources() == null)
return false;
if (other.getTerraformSources() != null && other.getTerraformSources().equals(this.getTerraformSources()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAppArn() == null) ? 0 : getAppArn().hashCode());
hashCode = prime * hashCode + ((getAppVersion() == null) ? 0 : getAppVersion().hashCode());
hashCode = prime * hashCode + ((getSourceArns() == null) ? 0 : getSourceArns().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getTerraformSources() == null) ? 0 : getTerraformSources().hashCode());
return hashCode;
}
@Override
public ImportResourcesToDraftAppVersionResult clone() {
try {
return (ImportResourcesToDraftAppVersionResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
|
{
"content_hash": "279986bf67952775553c5f5a52eece36",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 153,
"avg_line_length": 34.75233644859813,
"alnum_prop": 0.6120075299179777,
"repo_name": "aws/aws-sdk-java",
"id": "83870deb506234c66bb82652e00bf906d771e8f6",
"size": "15454",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-resiliencehub/src/main/java/com/amazonaws/services/resiliencehub/model/ImportResourcesToDraftAppVersionResult.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package local.dam_2015.sismo.managers;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import local.dam_2015.sismo.SettingsActivity;
import local.dam_2015.sismo.services.DownloadEQService;
/**
* Created by cursomovil on 1/04/15.
*/
public class AlarmaManager {
public static void setAlarm(Context context, int interval){
AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
int alarmType = AlarmManager.RTC;
long LengthOfWait = interval * 1000 * 60;
Intent intentToFire = new Intent(context, DownloadEQService.class);
PendingIntent alarmIntent = PendingIntent.getService(context, 0, intentToFire, 0);
alarm.setInexactRepeating(alarmType, LengthOfWait, LengthOfWait, alarmIntent);
}
public static void cancelAlarm(Context context) {
AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intentToFire = new Intent(context, DownloadEQService.class);
PendingIntent alarmIntent = PendingIntent.getService(context, 0, intentToFire, 0);
alarm.cancel(alarmIntent);
}
public static void updateAlarm(Context context, int interval) {
setAlarm(context, interval);
}
}
|
{
"content_hash": "3c257d1c7016ac298e2cf28253613c5b",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 92,
"avg_line_length": 30.386363636363637,
"alnum_prop": 0.7337322363500374,
"repo_name": "aritzbrosa/Android",
"id": "d88498794d7fb14ebfe16f3c573483aeaaee4697",
"size": "1337",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sismo/app/src/main/java/local/dam_2015/sismo/managers/AlarmaManager.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "102550"
}
],
"symlink_target": ""
}
|
namespace NServiceBus.AcceptanceTests.Sagas
{
using System;
using System.Linq;
using System.Threading.Tasks;
using AcceptanceTesting;
using AcceptanceTesting.Support;
using EndpointTemplates;
using NServiceBus.MongoDB;
using NUnit.Framework;
[TestFixture]
public class When_auto_correlated_property_is_changed : NServiceBusAcceptanceTest
{
[Test]
public void Should_throw()
{
var exception = Assert.ThrowsAsync<AggregateException>(async () =>
await Scenario.Define<Context>()
.WithEndpoint<Endpoint>(
b => b.When(session => session.SendLocal(new StartSaga
{
DataId = Guid.NewGuid()
})))
.Done(c => c.FailedMessages.Any())
.Run())
.ExpectFailedMessages();
Assert.IsTrue(((Context)exception.ScenarioContext).ModifiedCorrelationProperty);
Assert.AreEqual(1, exception.FailedMessages.Count);
StringAssert.Contains(
"Changing the value of correlated properties at runtime is currently not supported",
exception.FailedMessages.Single().Exception.Message);
}
public class Context : ScenarioContext
{
public bool ModifiedCorrelationProperty { get; set; }
}
public class Endpoint : EndpointConfigurationBuilder
{
public Endpoint()
{
EndpointSetup<DefaultServer>();
}
public class CorrIdChangedSaga : Saga<CorrIdChangedSaga.CorrIdChangedSagaData>,
IAmStartedByMessages<StartSaga>
{
public Context TestContext { get; set; }
public Task Handle(StartSaga message, IMessageHandlerContext context)
{
Data.DataId = Guid.NewGuid();
TestContext.ModifiedCorrelationProperty = true;
return Task.FromResult(0);
}
protected override void ConfigureHowToFindSaga(SagaPropertyMapper<CorrIdChangedSagaData> mapper)
{
mapper.ConfigureMapping<StartSaga>(m => m.DataId).ToSaga(s => s.DataId);
}
public class CorrIdChangedSagaData : ContainMongoSagaData
{
public virtual Guid DataId { get; set; }
}
}
}
public class StartSaga : ICommand
{
public Guid DataId { get; set; }
}
}
}
|
{
"content_hash": "a0467e95754b505b7e3af9040c18afff",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 112,
"avg_line_length": 34.79746835443038,
"alnum_prop": 0.5354674427064388,
"repo_name": "sbmako/NServiceBus.MongoDB",
"id": "df70a38315057d79c1f67aed3069117461ce439e",
"size": "2751",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/NServiceBus.MongoDB.Acceptance.Tests/App_Packages/NSB.AcceptanceTests.6.0.0/Sagas/When_auto_correlated_property_is_changed.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "986392"
},
{
"name": "Dockerfile",
"bytes": "540"
},
{
"name": "Makefile",
"bytes": "1045"
}
],
"symlink_target": ""
}
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Picksel - Pixabay asset manager</title>
<meta name="description" content="Asset manager for Pixabay images.">
<meta name="author" content="Saul Johnson">
<meta name="viewport" content="width=device-width">
<!-- Full jQuery is required -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<!-- Boostrap 4 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Bootswatch 4 -->
<!--
You can change this skin if you like to any from: https://www.bootstrapcdn.com/bootswatch/
Generate SRI hashes using this: https://www.srihash.org/
-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/cerulean/bootstrap.min.css" integrity="sha384-WTtvlZJeRyCiKUtbQ88X1x9uHmKi0eHCbQ8irbzqSLkE0DpAZuixT5yFvgX0CjIu" crossorigin="anonymous">
<!-- Showdown markdown renderer -->
<script src="https://cdn.rawgit.com/showdownjs/showdown/1.9.0/dist/showdown.min.js" integrity="sha384-KpuxVjTC2hfOkg5KV3jSdx1eA6xy0PGS0wNfDrwf4sZBnZdzlIsnkH+LzLkavmH7" crossorigin="anonymous"></script>
<!-- Page-specific script -->
<script>
// Configure the page here.
const username = "lambdacasserole";
const repo = "picksel";
// Pre-calculate some URLs.
const userPage = `https://github.com/${username}`;
const projectPage = `${userPage}/${repo}`;
// This runs on page load.
$(document).ready(function() {
// Update links etc.
$(".jsProjPage").attr("href", projectPage);
$(".jsUsername").attr("href", userPage);
$(".jsUsername").html(username);
// Load markdown from the readme, render it and display.
$.ajax({
url: `https://raw.githubusercontent.com/${username}/${repo}/master/README.md`,
success: function(result) {
var converter = new showdown.Converter();
var logoRemoved = result.replace(/!\[logo\]\(.+?\)/gi, ""); // Remove logo.
$("#content").html(converter.makeHtml(logoRemoved));
},
error: function() {
// Show error message.
$("#content").html(`<p class="loadErr">Error loading page, visit it on <a href="${projectPage}">GitHub</a> instead.</p>`);
}
});
});
</script>
<!-- Page-specific styles -->
<style>
body {
margin: 36px;
}
.logo {
margin-bottom: 36px;
}
.loader {
color: #505050;
text-align: center;
}
.loadErr {
color: #7f0000;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<img class="logo" src="svg/logo.svg">
</div>
</div>
<div class="row">
<!-- Rendered markdown is loaded in the following element -->
<div class="col-md-12" id="content">
<!-- Loader is shown initially -->
<div class="loader">
<p>
Loading page content...
</p>
<img src="gif/loader.gif">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<hr>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center text-muted">
<small>Copyright © <a class="jsUsername"></a> | <a class="jsProjPage">GitHub</a> | Powered by <a target="_blank" href="https://lambdacasserole.github.io/rollout/">Rollout</a></small>
</div>
</div>
</div>
</body>
</html>
|
{
"content_hash": "8941eecc8966ff59d793c3d58f86c9c3",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 221,
"avg_line_length": 43.94285714285714,
"alnum_prop": 0.5715214564369311,
"repo_name": "lambdacasserole/picksel",
"id": "45c11dd5657011577d9c6193e162c4b412dbb2da",
"size": "4614",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "26223"
},
{
"name": "JavaScript",
"bytes": "57"
}
],
"symlink_target": ""
}
|
<div class="subheader editor-toolbar" id="editor-header">
<div class="fixed-container">
<div class="btn-group">
<div class="btn-toolbar pull-left" ng-controller="DecisionTableToolbarController" ng-cloak>
<button id="{{item.id}}" dec
title="{{item.title | translate}}"
ng-repeat="item in items"
ng-switch on="item.type"
class="btn btn-inverse" ng-class="{'separator': item.type == 'separator'}"
ng-disabled="item.type == 'separator' || item.enabled == false || (readOnly && item.disableOnReadonly)"
ng-click="toolbarButtonClicked($index)">
<i ng-switch-when="button" ng-class="item.cssClass" class="toolbar-button" data-toggle="tooltip"
title="{{item.title | translate}}"></i>
<div ng-switch-when="separator" ng-class="item.cssClass"></div>
</button>
</div>
</div>
<div class="btn-group pull-right" ng-show="!secondaryItems.length">
<div class="btn-toolbar pull-right" ng-controller="DecisionTableToolbarController">
<button title="{{item.title | translate}}" ng-repeat="item in secondaryItems" ng-switch on="item.type"
class="btn btn-inverse" ng-class="{'separator': item.type == 'separator'}"
ng-disabled="item.type == 'separator' || (readOnly && item.disableOnReadonly)"
ng-click="toolbarSecondaryButtonClicked($index)" id="{{item.id}}">
<i ng-switch-when="button" ng-class="item.cssClass" class="toolbar-button" data-toggle="tooltip"
title="{{item.title | translate}}"></i>
<div ng-switch-when="separator" ng-class="item.cssClass"></div>
</button>
</div>
</div>
</div>
</div>
<div class="container-fluid content decision-table" auto-height offset="40">
<br/>
<div class="row">
<div class="col-xs-12 text-right">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="actionsMenu" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
{{"DECISION-TABLE-EDITOR.BUTTON-ACTIONS-LABEL" | translate}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="actionsMenu">
<li><a href ng-click="addRule()">{{"DECISION-TABLE-EDITOR.BUTTON-ADD-RULE-LABEL" | translate}}</a>
</li>
<li ng-if="model.selectedRow !== undefined && model.rulesData.length >= 2 && model.selectedRow >= 1">
<a href ng-click="moveRuleUpwards()">{{"DECISION-TABLE-EDITOR.BUTTON-MOVE-RULE-UPWARDS-LABEL" |
translate}}</a></li>
<li ng-if="model.selectedRow !== undefined && model.selectedRow !== model.rulesData.length - 1"><a
href ng-click="moveRuleDownwards()">{{"DECISION-TABLE-EDITOR.BUTTON-MOVE-RULE-DOWNWARDS-LABEL"
| translate}}</a></li>
<li class="danger" ng-if="model.selectedRow !== undefined && model.rulesData.length > 1"><a href
ng-click="removeRule()">{{"DECISION-TABLE-EDITOR.BUTTON-REMOVE-RULE-LABEL"
| translate}}</a></li>
</ul>
</div>
</div>
</div>
<div class="decision-table-grid-wrapper" id="decisionTableGrid">
<div class="decision-name-container">
<div class="decision-name">
{{currentDecisionTable.name}}
</div>
</div>
<hot-table hot-auto-destroy
hot-id="decision-table-editor"
settings="model.hotSettings"
columns="model.columnDefs"
row-headers="true"
datarows="model.rulesData"
auto-row-size="'true'"
on-after-get-col-header=doAfterGetColHeader
on-modify-col-width=doAfterModifyColWidth
on-after-render=doAfterRender
on-after-on-cell-mouse-down=doAfterOnCellMouseDown
on-after-scroll-horizontally=doAfterScroll
on-after-scroll-vertically=doAfterScroll
current-row-class-name="'currentRow'"
height="500">
</hot-table>
</div>
</div>
<script>
function triggerExpressionEditor(expressionType, expressionPos, newExpression) {
if (expressionType === 'input') {
extScope.openInputExpressionEditor(expressionPos, newExpression);
} else {
extScope.openOutputExpressionEditor(expressionPos, newExpression);
}
}
function triggerRemoveExpression(expressionType, expressionPos) {
if (expressionType === 'input') {
extScope.removeInputExpression(expressionPos);
} else {
extScope.removeOutputExpression(expressionPos);
}
}
function triggerHitPolicyEditor() {
extScope.openHitPolicyEditor();
}
</script>
|
{
"content_hash": "d6af179ff2c1b80f493c85ee7fb21734",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 187,
"avg_line_length": 51.08411214953271,
"alnum_prop": 0.5367727771679474,
"repo_name": "ppcxy/cyfm",
"id": "4906cb49ca8fd596f439ae1d44de9dd7df55194a",
"size": "5466",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cyfm-web/src/main/webapp/static/flow/views/decision-table-editor.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3657"
},
{
"name": "CSS",
"bytes": "1520036"
},
{
"name": "FreeMarker",
"bytes": "228"
},
{
"name": "HTML",
"bytes": "746677"
},
{
"name": "Java",
"bytes": "2051822"
},
{
"name": "JavaScript",
"bytes": "14509647"
},
{
"name": "Scala",
"bytes": "2405"
},
{
"name": "Shell",
"bytes": "2809"
},
{
"name": "TSQL",
"bytes": "52431"
}
],
"symlink_target": ""
}
|
<?php
namespace Comment\CoreBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('comment_core');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
$rootNode
->children()
->arrayNode( 'entity' )
->children()
->scalarNode( 'class' )
->end()
->end()
->end();
return $treeBuilder;
}
}
|
{
"content_hash": "d70562314a791e57bb7e69d1eb7741ce",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 131,
"avg_line_length": 29.605263157894736,
"alnum_prop": 0.616,
"repo_name": "legiov/test",
"id": "064c7b4d98cb051adc29b249ac3232da91251a01",
"size": "1125",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Comment/CoreBundle/DependencyInjection/Configuration.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3697"
},
{
"name": "JavaScript",
"bytes": "410"
},
{
"name": "PHP",
"bytes": "179815"
},
{
"name": "Shell",
"bytes": "480"
}
],
"symlink_target": ""
}
|
An example of node express 4 using mongoose and mongodb
To use this example install node, npm, and mongodb.
Then you can create the package.json file and run npm install to take care of the rest of what is required.
Use google postman to test. With postman, among other things, you can post, put, delete, and get.
|
{
"content_hash": "f0c197eeb661b8a2807517fc32064041",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 107,
"avg_line_length": 78.5,
"alnum_prop": 0.7802547770700637,
"repo_name": "dcorns/Express4-CRUD-Example",
"id": "22c5f97539cb76290696fe329a5b0bb7c3df34e7",
"size": "349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
/************************************************************************/
/* Header */
/************************************************************************/
/*
* @author Julian Dolby (dolby@us.ibm.com)
* @date February 7, 2003 implemented for GLIB v.1
*
*
* @author Steven Augart
* <steve+classpath at augart dot com>, <augart at watson dot ibm dot com>
* @date April 30, 2004 -- May 10 2004: Support new functions for Glib v.2,
* fix cond_wait to free and re-acquire the mutex,
* replaced trylock stub implementation with a full one.
*
* This code implements the GThreadFunctions interface for GLIB using
* Java threading primitives. All of the locking and conditional variable
* functionality required by GThreadFunctions is implemented using the
* monitor and wait/notify functionality of Java objects. The thread-
* local functionality uses the java.lang.ThreadLocal class.
*
* Classpath's AWT support uses GTK+ peers. GTK+ uses GLIB. GLIB by default
* uses the platform's native threading model -- pthreads in most cases. If
* the Java runtime doesn't use the native threading model, then it needs this
* code in order to use Classpath's (GTK+-based) AWT routines.
*
* This code should be portable; I believe it makes no assumptions
* about the underlying VM beyond that it implements the JNI functionality
* that this code uses.
*
* Currently, use of this code is governed by the configuration option
* --enable-portable-native-sync. We will soon add a VM hook so the VM can
* select which threading model it wants to use at run time; at that point,
* the configuration option will go away.
*
* The code in this file uses only JNI 1.1, except for one JNI 1.2 function:
* GetEnv, in the JNI Invocation API. (There seems to be no way around using
* GetEnv).
*
* ACKNOWLEDGEMENT:
*
* I would like to thank Mark Wielaard for his kindness in spending at least
* six hours of his own time in reviewing this code and correcting my GNU
* coding and commenting style. --Steve Augart
*
*
* NOTES:
*
* This code has been tested with Jikes RVM and with Kaffe.
*
* This code should have proper automated unit tests. I manually tested it
* by running an application that uses AWT. --Steven Augart
*
* MINOR NIT:
*
* - Using a jboolean in the arglist to "throw()" and "rethrow()"
* triggers many warnings from GCC's -Wconversion operation, because that
* is not the same as the conversion (upcast to an int) that would occur in
* the absence of a prototype.
*
* It would be very slightly more efficient to just pass the jboolean, but
* is not worth the clutter of messages. The right solution would be to
* turn off the -Wconversion warning for just this file, *except* that
* -Wconversion also warns you against constructs such as:
* unsigned u = -1;
* and that is a useful warning. So I went from a "jboolean" to a
* "gboolean" (-Wconversion is not enabled by default for GNU Classpath,
* but it is in my own CFLAGS, which, for gcc 3.3.3, read: -pipe -ggdb3 -W
* -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual
* -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
* -fkeep-static-consts -fkeep-inline-functions -Wundef -Wwrite-strings
* -Wno-aggregate-return -Wmissing-noreturn -Wnested-externs -Wtrigraphs
* -Wconversion -Wsign-compare -Wno-float-equal -Wmissing-format-attribute
* -Wno-unreachable-code -Wdisabled-optimization )
*/
#include <config.h>
/************************************************************************/
/* Configuration */
/************************************************************************/
/** Tracing and Reporting **/
#define TRACE_API_CALLS 0 /* announce entry and exit into each method,
by printing to stderr. */
#define TRACE_MONITORS 0 /* Every enterMonitor() and exitMonitor() goes
to stderr. */
/** Trouble handling. There is a discussion below of this. **/
#define EXPLAIN_TROUBLE 1 /* Describe any unexpected trouble that
happens. This is a superset
of EXPLAIN_BROKEN, and if set trumps an
unset EXPLAIN_BROKEN. It is not a strict
superset, since at the moment there is no
TROUBLE that is not also BROKEN.
Use criticalMsg() to describe the problem.
*/
#define EXPLAIN_BROKEN 1 /* Describe trouble that is serious enough to
be BROKEN. (Right now all trouble is at
least BROKEN.) */
/* There is no EXPLAIN_BADLY_BROKEN definition. We always explain
BADLY_BROKEN trouble, since there is no other way to report it. */
/** Error Handling **/
#define DIE_IF_BROKEN 1 /* Dies if serious trouble happens. There is
really no non-serious trouble, except
possibly problems that arise during
pthread_create, which are reported by a
GError.
If you do not set DIE_IF_BROKEN, then
trouble will raise a Java RuntimeException.
We probably do want to die right away,
since anything that's BROKEN really
indicates a programming error or a
system-wide error, and that's what the glib
documentation says you should do in case of
that kind of error in a glib-style
function. But it does work to turn this
off. */
#if DIE_IF_BROKEN
#define DIE_IF_BADLY_BROKEN 1 /* DIE_IF_BROKEN implies DIE_IF_BADLY_BROKEN */
#else
#define DIE_IF_BADLY_BROKEN 1 /* Die if the system is badly broken --
that is, if we have further trouble while
attempting to throw an exception
upwards, or if we are unable to generate
one of the classes we'll need in order to
throw wrapped exceptions upward.
If unset, we will print a warning message,
and limp along anyway. Not that the system
is likely to work. */
#endif
/** Performance tuning parameters **/
#define ENABLE_EXPENSIVE_ASSERTIONS 0 /* Enable expensive assertions? */
#define DELETE_LOCAL_REFS 1 /* Whether to delete local references.
JNI only guarantees that there wil be 16
available. (Jikes RVM provides an number
only limited by VM memory.)
Jikes RVM will probably perform faster if
this is turned off, but other VMs may need
this to be turned on in order to perform at
all, or might need it if things change.
Remember, we don't know how many of those
local refs might have already been used up
by higher layers of JNI code that end up
calling g_thread_self(),
g_thread_set_private(), and so on.
We set this to 1 for GNU Classpath, since
one of our principles is "always go for the
most robust implementation" */
#define HAVE_JNI_VERSION_1_2 0 /* Assume we don't. We could
dynamically check for this. We will
assume JNI 1.2 in later versions of
Classpath.
As it stands, the code in this file
already needs one JNI 1.2 function:
GetEnv, in the JNI Invocation API.
TODO This code hasn't been tested yet.
And really hasn't been implemented yet.
*/
/************************************************************************/
/* Global data */
/************************************************************************/
#if defined HAVE_STDINT_H
#include <stdint.h> /* provides intptr_t */
#elif defined HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <stdarg.h> /* va_list */
#include <glib.h>
#include "gthread-jni.h"
#include <assert.h> /* assert() */
/* For Java thread priority constants. */
#include <gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h>
/* Since not all JNI header generators actually define constants we
define them here explicitly. */
#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY
#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY 1
#endif
#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY
#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY 5
#endif
#ifndef gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY
#define gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY 10
#endif
/* The VM handle. This is set in
Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit */
JavaVM *cp_gtk_the_vm;
/* Unions used for type punning. */
union env_union
{
void **void_env;
JNIEnv **jni_env;
};
union func_union
{
void *void_func;
GThreadFunc g_func;
};
/* Forward Declarations for Functions */
static int threadObj_set_priority (JNIEnv * env, jobject threadObj,
GThreadPriority gpriority);
static void fatalMsg (const char fmt[], ...)
__attribute__ ((format (printf, 1, 2)))
__attribute__ ((noreturn));
static void criticalMsg (const char fmt[], ...)
__attribute__ ((format (printf, 1, 2)));
static void tracing (const char fmt[], ...)
__attribute__ ((format (printf, 1, 2)));
static jint javaPriorityLevel (GThreadPriority priority)
__attribute__ ((const));
/************************************************************************/
/* Trouble-handling, including utilities to reflect exceptions */
/* back to the VM. Also some status reporting. */
/************************************************************************/
/* How are we going to handle problems?
There are several approaches:
1) Report them with the GError mechanism.
(*thread_create)() is the only one of these functions that takes a
GError pointer. And the only G_THREAD error defined maps onto EAGAIN.
We don't have any errors in our (*thread_create)() implementation that
can be mapped to EAGAIN. So this idea is a non-starter.
2) Reflect the exception back to the VM, wrapped in a RuntimeException.
This will fail sometimes, if we're so broken (BADLY_BROKEN) that we
fail to throw the exception.
3) Abort execution. This is what the glib functions themselves do for
errors that they can't report via GError.
Enable DIE_IF_BROKEN and/or DIE_IF_BADLY_BROKEN to
make this the default for BROKEN and/or BADLY_BROKEN trouble.
4) Display messages to stderr. We always do this for BADLY_BROKEN
trouble. The glib functions do that for errors they can't report via
GError.
There are some complications.
When I attempted to report a problem in g_thread_self() using g_critical (a
macro around g_log(), I found that g_log in turn looks for thread-private
data and calls g_thread_self() again.
We got a segfault, probably due to stack overflow. So, this code doesn't
use the g_critical() and g_error() functions any more. Nor do we use
g_assert(); we use the C library's assert() instead.
*/
#define WHERE __FILE__ ":" G_STRINGIFY(__LINE__) ": "
/* This is portable to older compilers that lack variable-argument macros.
This used to be just g_critical(), but then we ran into the error reporting
problem discussed above.
*/
static void
fatalMsg (const char fmt[], ...)
{
va_list ap;
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
fputs ("\nAborting execution\n", stderr);
abort ();
}
static void
criticalMsg (const char fmt[], ...)
{
va_list ap;
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
putc ('\n', stderr);
}
/* Unlike the other two, this one does not append a newline. This is only
used if one of the TRACE_ macros is defined. */
static void
tracing (const char fmt[], ...)
{
va_list ap;
va_start (ap, fmt);
vfprintf (stderr, fmt, ap);
va_end (ap);
}
#define assert_not_reached() \
do \
{ \
fputs(WHERE "You should never get here. Aborting execution.\n", \
stderr); \
abort(); \
} \
while(0)
#if DIE_IF_BADLY_BROKEN
#define BADLY_BROKEN fatalMsg
#else
#define BADLY_BROKEN criticalMsg
/* So, the user may still attempt to recover, even though we do not advise
this. */
#endif
/* I find it so depressing to have to use C without varargs macros. */
#define BADLY_BROKEN_MSG WHERE "Something fundamental" \
" to GNU Classpath's AWT JNI broke while we were trying to pass up a Java error message"
#define BADLY_BROKEN0() \
BADLY_BROKEN(BADLY_BROKEN_MSG);
#define BADLY_BROKEN1(msg) \
BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg)
#define BADLY_BROKEN2(msg, arg) \
BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg)
#define BADLY_BROKEN3(msg, arg, arg2) \
BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg1, arg2)
#define BADLY_BROKEN4(msg, arg, arg2, arg3) \
BADLY_BROKEN(BADLY_BROKEN_MSG ": " msg, arg1, arg2, arg3)
#define DELETE_LOCAL_REF(env, ref) \
do \
{ \
if ( DELETE_LOCAL_REFS ) \
{ \
(*env)->DeleteLocalRef (env, ref); \
(ref) = NULL; \
} \
} \
while(0)
/* Cached info for Exception-wrapping */
static jclass runtimeException_class; /* java.lang.RuntimeException */
static jmethodID runtimeException_ctor; /* constructor for it */
/* Throw a new RuntimeException. It may wrap around an existing exception.
1 if we did rethrow, -1 if we had trouble while rethrowing.
isBroken is always true in this case. */
static int
throw (JNIEnv * env, jthrowable cause, const char *message,
gboolean isBroken, const char *file, int line)
{
jstring jmessage;
gboolean describedException = FALSE; /* Did we already describe the
exception to stderr or the
equivalent? */
jthrowable wrapper;
/* allocate local message in Java */
const char fmt[] = "In AWT JNI, %s (at %s:%d)";
size_t len = strlen (message) + strlen (file) + sizeof fmt + 25;
char *buf;
if (EXPLAIN_TROUBLE || (isBroken && EXPLAIN_BROKEN))
{
criticalMsg ("%s:%d: AWT JNI failure%s: %s\n", file, line,
isBroken ? " (BROKEN)" : "", message);
if (cause)
{
jthrowable currentException = (*env)->ExceptionOccurred (env);
if (cause == currentException)
{
criticalMsg ("Description follows to System.err:");
(*env)->ExceptionDescribe (env);
/* ExceptionDescribe has the side-effect of clearing the pending
exception; relaunch it. */
describedException = TRUE;
if ((*env)->Throw (env, cause))
{
BADLY_BROKEN1
("Relaunching an exception with Throw failed.");
return -1;
}
}
else
{
DELETE_LOCAL_REF (env, currentException);
criticalMsg (WHERE
"currentException != cause; something else happened"
" while handling an exception.");
}
}
} /* if (EXPLAIN_TROUBLE) */
if (isBroken && DIE_IF_BROKEN)
fatalMsg ("%s:%d: Aborting execution; BROKEN: %s\n", file, line, message);
if ((buf = malloc (len)))
{
memset (buf, 0, len);
g_snprintf (buf, len, fmt, message, file, line);
jmessage = (*env)->NewStringUTF (env, buf);
free (buf);
}
else
{
jmessage = NULL;
}
/* Create the RuntimeException wrapper object and throw it. It is OK for
CAUSE to be NULL. */
wrapper = (jthrowable) (*env)->NewObject
(env, runtimeException_class, runtimeException_ctor, jmessage, cause);
DELETE_LOCAL_REF (env, jmessage);
if (!wrapper)
{
/* I think this should only happen:
- if there are bugs in my JNI code, or
- if the VM is broken, or
- if we run out of memory.
*/
if (EXPLAIN_TROUBLE)
{
criticalMsg (WHERE "GNU Classpath: JNI NewObject() could not create"
" a new java.lang.RuntimeException.");
criticalMsg ("We were trying to warn about the following"
" previous failure:");
criticalMsg ("%s:%d: %s", file, line, message);
criticalMsg ("The latest (NewObject()) exception's description"
" follows, to System.err:");
(*env)->ExceptionDescribe (env);
}
BADLY_BROKEN1 ("Failure of JNI NewObject()"
" to make a java.lang.RuntimeException");
return -1;
}
/* throw it */
if ((*env)->Throw (env, wrapper))
{
/* Throw() should just never fail, unless we're in such severe trouble
that we might as well die. */
BADLY_BROKEN1
("GNU Classpath: Failure of JNI Throw to report an Exception");
return -1;
}
DELETE_LOCAL_REF (env, wrapper);
return 1;
}
/* Rethrow an exception we received, wrapping it with a RuntimeException. 1
if we did rethrow, -1 if we had trouble while rethrowing.
CAUSE should be identical to the most recent exception that happened, so
that ExceptionDescribe will work. (Otherwise nix.) */
static int
rethrow (JNIEnv * env, jthrowable cause, const char *message,
gboolean isBroken, const char *file, int line)
{
assert (cause);
return throw (env, cause, message, isBroken, file, line);
}
/* This function checks for a pending exception, and rethrows it with
* a wrapper RuntimeException to deal with possible type problems (in
* case some calling piece of code does not expect the exception being
* thrown) and to include the given extra message.
*
* Returns 0 if no problems found (so no exception thrown), 1 if we rethrew an
* exception. Returns -1 on failure.
*/
static int
maybe_rethrow (JNIEnv * env, const char *message, gboolean isBroken,
const char *file, int line)
{
jthrowable cause = (*env)->ExceptionOccurred (env);
int ret = 0;
/* rethrow if an exception happened */
if (cause)
{
ret = rethrow (env, cause, message, isBroken, file, line);
DELETE_LOCAL_REF (env, cause);
}
return 0;
}
/* MAYBE_TROUBLE() is used to include a source location in the exception
message. Once we have run maybe_rethrow, if there WAS trouble,
return TRUE, else FALSE.
MAYBE_TROUBLE() is actually never used; all problems that throw exceptions
are BROKEN, at least. Nothing is recoverable :(. See the discussion of
possible errors at thread_create_jni_impl(). */
#define MAYBE_TROUBLE(_env, _message) \
maybe_rethrow(_env, _message, FALSE, __FILE__, __LINE__)
/* MAYBE_TROUBLE(), but something would be BROKEN if it were true. */
#define MAYBE_BROKEN(_env, _message) \
maybe_rethrow(_env, _message, TRUE, __FILE__, __LINE__)
/* Like MAYBE_TROUBLE(), TROUBLE() is never used. */
#define TROUBLE(_env, _message) \
rethrow(_env, (*env)->ExceptionOccurred (env), _message, FALSE, \
__FILE__, __LINE__)
#define BROKEN(_env, _message) \
rethrow (_env, (*env)->ExceptionOccurred (env), _message, TRUE, \
__FILE__, __LINE__)
/* Like MAYBE_TROUBLE(), NEW_TROUBLE() is never used. */
#define NEW_TROUBLE(_env, _message) \
throw (_env, NULL, _message, FALSE, __FILE__, __LINE__)
#define NEW_BROKEN(_env, _message) \
throw (_env, NULL, _message, TRUE, __FILE__, __LINE__)
/* Like MAYBE_TROUBLE(), RETHROW_CAUSE() is never used. */
#define RETHROW_CAUSE(_env, _cause, _message) \
rethrow (_env, _cause, _message, FALSE, __FILE__, __LINE__)
#define BROKEN_CAUSE(_env, _cause, _message) \
rethrow (_env, _cause, _message, TRUE, __FILE__, __LINE__)
/* Macros to handle the possibility that someone might have called one of the
GThreadFunctions API functions with a Java exception pending. It is
generally discouraged to continue to use JNI after a Java exception has
been raised. Sun's JNI book advises that one trap JNI errors immediately
and not continue with an exception pending.
These are #if'd out for these reasons:
1) They do not work in the C '89 subset that Classpath is currently
(2004 May 10) sticking to; HIDE_OLD_TROUBLE() includes a declaration
that should be in scope for the rest of the function, so it needs a
language version that lets you mix declarations and statements. (This
could be worked around if it were important.)
2) They chew up more time and resources.
3) There does not ever seem to be old trouble -- the assertion in
HIDE_OLD_TROUBLE never goes off.
You will want to re-enable them if this code needs to be used in a context
where old exceptions might be pending when the GThread functions are
called.
The implementations in this file are responsible for skipping around calls
to SHOW_OLD_TROUBLE() if they've raised exceptions during the call. So, if
we reach SHOW_OLD_TROUBLE, we are guaranteed that there are no exceptions
pending. */
#if 1
#define HIDE_OLD_TROUBLE(env) \
assert ( NULL == (*env)->ExceptionOccurred (env) )
#define SHOW_OLD_TROUBLE() \
assert ( NULL == (*env)->ExceptionOccurred (env) )
#else /* 0 */
#define HIDE_OLD_TROUBLE(env) \
jthrowable savedTrouble = (*env)->ExceptionOccurred (env); \
(*env)->ExceptionClear (env);
#define SHOW_OLD_TROUBLE() do \
{ \
assert ( NULL == (*env)->ExceptionOccurred (env) ) \
if (savedTrouble) \
{ \
if ((*env)->Throw (env, savedTrouble)) \
BADLY_BROKEN ("ReThrowing the savedTrouble failed"); \
} \
DELETE_LOCAL_REF (env, savedTrouble); \
} while(0)
#endif /* 0 */
/* Set up the cache of jclass and jmethodID primitives we need
in order to throw new exceptions and rethrow exceptions. We do this
independently of the other caching. We need to have this cache set up
first, so that we can then report errors properly.
If any errors while setting up the error cache, the world is BADLY_BROKEN.
May be called more than once.
Returns -1 if the cache was not initialized properly, 1 if it was.
*/
static int
setup_exception_cache (JNIEnv * env)
{
static int exception_cache_initialized = 0; /* -1 for trouble, 1 for proper
init. */
jclass lcl_class; /* a class used for local refs */
if (exception_cache_initialized)
return exception_cache_initialized;
lcl_class = (*env)->FindClass (env, "java/lang/RuntimeException");
if ( ! lcl_class )
{
BADLY_BROKEN1 ("Broken Class library or VM?"
" Couldn't find java/lang/RuntimeException");
return exception_cache_initialized = -1;
}
/* Pin it down. */
runtimeException_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!runtimeException_class)
{
BADLY_BROKEN1 ("Serious trouble: could not turn"
" java.lang.RuntimeException into a global reference");
return exception_cache_initialized = -1;
}
runtimeException_ctor =
(*env)->GetMethodID (env, runtimeException_class, "<init>",
"(Ljava/lang/String;Ljava/lang/Throwable;)V");
if ( ! runtimeException_ctor )
{
BADLY_BROKEN1 ("Serious trouble: classpath couldn't find a"
" two-arg constructor for java/lang/RuntimeException");
return exception_cache_initialized = -1;
}
return exception_cache_initialized = 1;
}
/**********************************************************/
/***** The main cache *************************************/
/**********************************************************/
/** This is a cache of all classes, methods, and field IDs that we use during
the run. We maintain a permanent global reference to each of the classes
we cache, since otherwise the (local) jclass that refers to that class
would go out of scope and possibly be reused in further calls.
The permanent global reference also achieves the secondary goal of
protecting the validity of the methods and field IDs in case the classes
were otherwise unloaded and then later loaded again. Obviously, this will
never happen to classes such as java.lang.Thread and java.lang.Object, but
the primary reason for maintaining permanent global refs is sitll valid.
The code in jnilink.c has a similar objective. TODO: Consider using that
code instead.
--Steven Augart
*/
/* All of these are cached classes and method IDs: */
/* java.lang.Object */
static jclass obj_class; /* java.lang.Object */
static jmethodID obj_ctor; /* no-arg Constructor for java.lang.Object */
static jmethodID obj_notify_mth; /* java.lang.Object.notify() */
static jmethodID obj_notifyall_mth; /* java.lang.Object.notifyall() */
static jmethodID obj_wait_mth; /* java.lang.Object.wait() */
static jmethodID obj_wait_nanotime_mth; /* java.lang.Object.wait(JI) */
/* GThreadMutex and its methods */
static jclass mutex_class;
static jmethodID mutex_ctor;
static jfieldID mutex_lockForPotentialLockers_fld;
static jfieldID mutex_potentialLockers_fld;
/* java.lang.Thread and its methods*/
static jclass thread_class; /* java.lang.Thread */
static jmethodID thread_current_mth; /* Thread.currentThread() */
static jmethodID thread_equals_mth; /* Thread.equals() */
static jmethodID thread_join_mth; /* Thread.join() */
static jmethodID thread_setPriority_mth; /* Thread.setPriority() */
static jmethodID thread_stop_mth; /* Thread.stop() */
static jmethodID thread_yield_mth; /* Thread.yield() */
/* java.lang.ThreadLocal and its methods */
static jclass threadlocal_class; /* java.lang.ThreadLocal */
static jmethodID threadlocal_ctor; /* Its constructor */
static jmethodID threadlocal_set_mth; /* ThreadLocal.set() */
static jmethodID threadlocal_get_mth; /* ThreadLocal.get() */
/* java.lang.Long and its methods */
static jclass long_class; /* java.lang.Long */
static jmethodID long_ctor; /* constructor for it: (J) */
static jmethodID long_longValue_mth; /* longValue()J */
/* GThreadNativeMethodRunner */
static jclass runner_class;
static jmethodID runner_ctor;
static jmethodID runner_threadToThreadID_mth;
static jmethodID runner_threadIDToThread_mth;
static jmethodID runner_deRegisterJoinable_mth;
static jmethodID runner_start_mth; /* Inherited Thread.start() */
/* java.lang.InterruptedException */
static jclass interrupted_exception_class;
/* Returns a negative value if there was trouble during initialization.
Returns a positive value of the cache was initialized correctly.
Never returns zero. */
static int
setup_cache (JNIEnv * env)
{
jclass lcl_class;
static int initialized = 0; /* 1 means initialized, 0 means uninitialized,
-1 means mis-initialized */
if (initialized)
return initialized;
/* make sure we can report on trouble */
if (setup_exception_cache (env) < 0)
return initialized = -1;
#ifdef JNI_VERSION_1_2
if (HAVE_JNI_VERSION_1_2)
assert ( ! (*env)->ExceptionCheck (env));
else
#endif
assert ( ! (*env)->ExceptionOccurred (env));
/* java.lang.Object and its methods */
lcl_class = (*env)->FindClass (env, "java/lang/Object");
if (!lcl_class)
{
BROKEN (env, "cannot find java.lang.Object");
return initialized = -1;
}
/* Pin it down. */
obj_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!obj_class)
{
BROKEN (env, "Cannot get a global reference to java.lang.Object");
return initialized = -1;
}
obj_ctor = (*env)->GetMethodID (env, obj_class, "<init>", "()V");
if (!obj_ctor)
{
BROKEN (env, "cannot find constructor for java.lang.Object");
return initialized = -1;
}
obj_notify_mth = (*env)->GetMethodID (env, obj_class, "notify", "()V");
if ( ! obj_notify_mth )
{
BROKEN (env, "cannot find java.lang.Object.notify()V");
return initialized = -1;
}
obj_notifyall_mth =
(*env)->GetMethodID (env, obj_class, "notifyAll", "()V");
if ( ! obj_notifyall_mth)
{
BROKEN (env, "cannot find java.lang.Object.notifyall()V");
return initialized = -1;
}
obj_wait_mth = (*env)->GetMethodID (env, obj_class, "wait", "()V");
if ( ! obj_wait_mth )
{
BROKEN (env, "cannot find Object.<wait()V>");
return initialized = -1;
}
obj_wait_nanotime_mth =
(*env)->GetMethodID (env, obj_class, "wait", "(JI)V");
if ( ! obj_wait_nanotime_mth )
{
BROKEN (env, "cannot find Object.<wait(JI)V>");
return initialized = -1;
}
/* GThreadMutex and its methods */
lcl_class = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GThreadMutex");
if ( ! lcl_class)
{
BROKEN (env, "cannot find gnu.java.awt.peer.gtk.GThreadMutex");
return initialized = -1;
}
/* Pin it down. */
mutex_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if ( ! mutex_class)
{
BROKEN (env, "Cannot get a global reference to GThreadMutex");
return initialized = -1;
}
mutex_ctor = (*env)->GetMethodID (env, mutex_class, "<init>", "()V");
if ( ! mutex_ctor)
{
BROKEN (env, "cannot find zero-arg constructor for GThreadMutex");
return initialized = -1;
}
mutex_potentialLockers_fld = (*env)->GetFieldID
(env, mutex_class, "potentialLockers", "I");
if ( ! mutex_class )
{
BROKEN (env, "cannot find GThreadMutex.potentialLockers");
return initialized = -1;
}
if (! (mutex_lockForPotentialLockers_fld = (*env)->GetFieldID
(env, mutex_class, "lockForPotentialLockers", "Ljava/lang/Object;")))
{
BROKEN (env, "cannot find GThreadMutex.lockForPotentialLockers");
return initialized = -1;
}
/* java.lang.Thread */
if (! (lcl_class = (*env)->FindClass (env, "java/lang/Thread")))
{
BROKEN (env, "cannot find java.lang.Thread");
return initialized = -1;
}
/* Pin it down. */
thread_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!thread_class)
{
BROKEN (env, "Cannot get a global reference to java.lang.Thread");
return initialized = -1;
}
thread_current_mth =
(*env)->GetStaticMethodID (env, thread_class, "currentThread",
"()Ljava/lang/Thread;");
if (!thread_current_mth)
{
BROKEN (env, "cannot find Thread.currentThread() method");
return initialized = -1;
}
thread_equals_mth =
(*env)->GetMethodID (env, thread_class, "equals", "(Ljava/lang/Object;)Z");
if (!thread_equals_mth)
{
BROKEN (env, "cannot find Thread.equals() method");
return initialized = -1;
}
thread_join_mth = (*env)->GetMethodID (env, thread_class, "join", "()V");
if (!thread_join_mth)
{
BROKEN (env, "cannot find Thread.join() method");
return initialized = -1;
}
thread_stop_mth = (*env)->GetMethodID (env, thread_class, "stop", "()V");
if ( ! thread_stop_mth )
{
BROKEN (env, "cannot find Thread.stop() method");
return initialized = -1;
}
thread_setPriority_mth =
(*env)->GetMethodID (env, thread_class, "setPriority", "(I)V");
if ( ! thread_setPriority_mth )
{
BROKEN (env, "cannot find Thread.setPriority() method");
return initialized = -1;
}
thread_yield_mth =
(*env)->GetStaticMethodID (env, thread_class, "yield", "()V");
if ( ! thread_yield_mth )
{
BROKEN (env, "cannot find Thread.yield() method");
return initialized = -1;
}
/* java.lang.ThreadLocal */
lcl_class = (*env)->FindClass (env, "java/lang/ThreadLocal");
if ( ! lcl_class )
{
BROKEN (env, "cannot find class java.lang.ThreadLocal");
return initialized = -1;
}
/* Pin it down. */
threadlocal_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if ( ! threadlocal_class )
{
BROKEN (env, "Cannot get a global reference to java.lang.ThreadLocal");
return initialized = -1;
}
threadlocal_ctor = (*env)->GetMethodID (env, threadlocal_class,
"<init>", "()V");
if ( ! threadlocal_ctor )
{
BROKEN (env, "cannot find ThreadLocal.<init>()V");
return initialized = -1;
}
threadlocal_get_mth = (*env)->GetMethodID (env, threadlocal_class,
"get", "()Ljava/lang/Object;");
if ( ! threadlocal_get_mth )
{
BROKEN (env, "cannot find java.lang.ThreadLocal.get()Object");
return initialized = -1;
}
threadlocal_set_mth = (*env)->GetMethodID (env, threadlocal_class,
"set", "(Ljava/lang/Object;)V");
if ( ! threadlocal_set_mth )
{
BROKEN (env, "cannot find ThreadLocal.set(Object)V");
return initialized = -1;
}
/* java.lang.Long */
lcl_class = (*env)->FindClass (env, "java/lang/Long");
if ( ! lcl_class )
{
BROKEN (env, "cannot find class java.lang.Long");
return initialized = -1;
}
/* Pin it down. */
long_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!long_class)
{
BROKEN (env, "Cannot get a global reference to java.lang.Long");
return initialized = -1;
}
long_ctor = (*env)->GetMethodID (env, long_class, "<init>", "(J)V");
if (!long_ctor)
{
BROKEN (env, "cannot find method java.lang.Long.<init>(J)V");
return initialized = -1;
}
long_longValue_mth =
(*env)->GetMethodID (env, long_class, "longValue", "()J");
if (!long_longValue_mth)
{
BROKEN (env, "cannot find method java.lang.Long.longValue()J");
return initialized = -1;
}
/* GThreadNativeMethodRunner */
lcl_class =
(*env)->FindClass (env,
"gnu/java/awt/peer/gtk/GThreadNativeMethodRunner");
if ( ! lcl_class )
{
BROKEN (env,
"cannot find gnu.java.awt.peer.gtk.GThreadNativeMethodRunner");
return initialized = -1;
}
/* Pin it down. */
runner_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!runner_class)
{
BROKEN (env,
"Cannot get a global reference to the class GThreadNativeMethodRunner");
return initialized = -1;
}
runner_ctor = (*env)->GetMethodID (env, runner_class, "<init>", "(JJZ)V");
if ( ! runner_ctor )
{
BROKEN (env,
"cannot find method GThreadNativeMethodRunner.<init>(JJZ)");
return initialized = -1;
}
runner_start_mth = (*env)->GetMethodID (env, runner_class, "start", "()V");
if ( ! runner_start_mth )
{
BROKEN (env, "cannot find method GThreadNativeMethodRunner.start()V");
return initialized = -1;
}
runner_threadToThreadID_mth =
(*env)->GetStaticMethodID (env, runner_class,
"threadToThreadID", "(Ljava/lang/Thread;)I");
if ( ! runner_threadToThreadID_mth )
{
BROKEN (env,
"cannot find method GThreadNativeMethodRunner.threadToThreadID(java.lang.Thread)I");
return initialized = -1;
}
runner_threadIDToThread_mth =
(*env)->GetStaticMethodID (env, runner_class,
"threadIDToThread", "(I)Ljava/lang/Thread;");
if ( ! runner_threadIDToThread_mth )
{
BROKEN (env,
"cannot find method GThreadNativeMethodRunner.threadIDToThread(I)java.lang.Thread");
return initialized = -1;
}
runner_deRegisterJoinable_mth =
(*env)->GetStaticMethodID (env, runner_class, "deRegisterJoinable",
"(Ljava/lang/Thread;)V");
if (!runner_deRegisterJoinable_mth)
{
BROKEN (env,
"cannot find method GThreadNativeMethodRunner.deRegisterJoinable(java.lang.Thread)V");
return initialized = -1;
}
/* java.lang.InterruptedException */
lcl_class = (*env)->FindClass (env, "java/lang/InterruptedException");
if ( ! lcl_class )
{
BROKEN (env, "cannot find class java.lang.InterruptedException");
return initialized = -1;
}
/* Pin it down. */
interrupted_exception_class = (jclass) (*env)->NewGlobalRef (env, lcl_class);
DELETE_LOCAL_REF (env, lcl_class);
if (!interrupted_exception_class)
{
BROKEN (env, "Cannot make a global reference"
" to java.lang.InterruptedException");
return initialized = -1;
}
#ifdef JNI_VERSION_1_2
if (HAVE_JNI_VERSION_1_2)
assert ( ! (*env)->ExceptionCheck (env));
else
#endif
assert ( ! (*env)->ExceptionOccurred (env));
return initialized = 1;
}
/************************************************************************/
/* Utilities to allocate and free java.lang.Objects */
/************************************************************************/
/* The condition variables are java.lang.Object objects,
* which this method allocates and returns a global ref. Note that global
* refs must be explicitly freed (isn't C fun?).
*/
static jobject
allocatePlainObject (JNIEnv * env)
{
jobject lcl_obj, global_obj;
lcl_obj = (*env)->NewObject (env, obj_class, obj_ctor);
if (!lcl_obj)
{
BROKEN (env, "cannot allocate object");
return NULL;
}
global_obj = (*env)->NewGlobalRef (env, lcl_obj);
DELETE_LOCAL_REF (env, lcl_obj);
if (!global_obj)
{
NEW_BROKEN (env, "cannot make global ref for a new plain Java object");
/* Deliberate fall-through */
}
return global_obj;
}
/* Frees any Java object given a global ref (isn't C fun?) */
static void
freeObject (JNIEnv * env, jobject obj)
{
if (obj)
{
(*env)->DeleteGlobalRef (env, obj);
/* DeleteGlobalRef can never fail */
}
}
/************************************************************************/
/* Utilities to allocate and free Java mutexes */
/************************************************************************/
/* The mutexes are gnu.java.awt.peer.gtk.GThreadMutex objects,
* which this method allocates and returns a global ref. Note that global
* refs must be explicitly freed (isn't C fun?).
*
* Free this with freeObject()
*/
static jobject
allocateMutexObject (JNIEnv * env)
{
jobject lcl_obj, global_obj;
lcl_obj = (*env)->NewObject (env, mutex_class, mutex_ctor);
if (!lcl_obj)
{
BROKEN (env, "cannot allocate a GThreadMutex");
return NULL;
}
global_obj = (*env)->NewGlobalRef (env, lcl_obj);
DELETE_LOCAL_REF (env, lcl_obj);
if (!global_obj)
{
NEW_BROKEN (env, "cannot make global ref");
/* Deliberate fallthrough */
}
return global_obj;
}
/************************************************************************/
/* Locking code */
/************************************************************************/
/* Lock a Java object */
#define ENTER_MONITOR(env, m) \
enterMonitor(env, m, G_STRINGIFY(m))
/* Return -1 on failure, 0 on success. */
static int
enterMonitor (JNIEnv * env, jobject monitorObj, const char monName[])
{
if (TRACE_MONITORS)
tracing (" <MonitorEnter(%s)>", monName);
assert (monitorObj);
if ((*env)->MonitorEnter (env, monitorObj) < 0)
{
BROKEN (env, "cannot enter monitor");
return -1;
}
return 0;
}
/* Unlock a Java object */
#define EXIT_MONITOR(env, m) \
exitMonitor(env, m, G_STRINGIFY(m))
static int
exitMonitor (JNIEnv * env, jobject mutexObj, const char monName[])
{
if (TRACE_MONITORS)
tracing (" <MonitorExit(%s)>", monName);
assert (mutexObj);
if ((*env)->MonitorExit (env, mutexObj) < 0)
{
BROKEN (env, "cannot exit monitor ");
return -1;
}
return 0;
}
/************************************************************************/
/* Miscellaneous utilities */
/************************************************************************/
/* Get the Java Thread object that corresponds to a particular thread ID.
A negative thread Id gives us a null object.
Returns a local reference.
*/
static jobject
getThreadFromThreadID (JNIEnv * env, gpointer gThreadID)
{
jint threadNum = GPOINTER_TO_INT(gThreadID);
jobject thread;
if (threadNum < 0)
{
NEW_BROKEN (env, "getThreadFromThreadID asked to look up"
" a negative thread index");
return NULL;
}
thread = (*env)->CallStaticObjectMethod
(env, runner_class, runner_threadIDToThread_mth, threadNum);
if (MAYBE_BROKEN (env, "cannot get Thread for threadID "))
return NULL;
return thread;
}
/** Return the unique threadID of THREAD.
Error handling: Return (gpointer) -1 on all failures,
and propagate an exception.
*/
static gpointer
getThreadIDFromThread (JNIEnv * env, jobject thread)
{
jint threadNum;
if (ENABLE_EXPENSIVE_ASSERTIONS)
assert ((*env)->IsInstanceOf (env, thread, thread_class));
HIDE_OLD_TROUBLE (env);
threadNum = (*env)->CallStaticIntMethod
(env, runner_class, runner_threadToThreadID_mth, thread);
if (MAYBE_BROKEN (env, "cannot get ThreadID for a Thread "))
{
threadNum = -1;
goto done;
}
SHOW_OLD_TROUBLE ();
done:
return GINT_TO_POINTER(threadNum);
}
/************************************************************************/
/* The Actual JNI functions that we pass to the function vector. */
/************************************************************************/
/************************************************************************/
/* Mutex Functions */
/************************************************************************/
/*** Mutex Utilities ****/
struct mutexObj_cache
{
jobject lockForPotentialLockersObj; /* Lock for the potentialLockers
field. Local reference. */
jobject lockObj; /* The real lock we use. This is a GLOBAL
reference and must not be freed. */
};
/* Initialize the cache of sub-locks for a particular mutex object.
-1 on error, 0 on success. The caller is not responsible for freeing the
partially-populated cache in case of failure (but in practice does anyway)
(This actually never fails, though, since GetObjectField allegedly never
fails.)
Guaranteed to leave all fields of the cache initialized, even if only to
zero.
*/
static int
populate_mutexObj_cache (JNIEnv * env, jobject mutexObj,
struct mutexObj_cache *mcache)
{
mcache->lockObj = mutexObj; /* the mutexObj is its own lock. */
assert (mcache->lockObj);
mcache->lockForPotentialLockersObj = (*env)->GetObjectField
(env, mutexObj, mutex_lockForPotentialLockers_fld);
/* GetObjectField can never fail. */
/* Retrieving a NULL object could only happen if we somehow got a
a mutex object that was not properly intialized. */
assert (mcache->lockForPotentialLockersObj);
return 0;
}
/* Clean out the mutexObj_cache, even if it was never populated. */
static void
clean_mutexObj_cache (JNIEnv * env, struct mutexObj_cache *mcache)
{
/* OK to pass NULL refs to DELETE_LOCAL_REF */
DELETE_LOCAL_REF (env, mcache->lockForPotentialLockersObj);
/* mcache->lockObj is a GLOBAL reference. */
mcache->lockObj = NULL;
}
/* -1 on failure, 0 on success.
The mutexObj_cache is already populated for this particular object. */
static int
mutexObj_lock (JNIEnv * env, jobject mutexObj, struct mutexObj_cache *mcache)
{
jint potentialLockers;
if (ENTER_MONITOR (env, mcache->lockForPotentialLockersObj))
return -1;
assert(mutexObj);
potentialLockers =
(*env)->GetIntField (env, mutexObj, mutex_potentialLockers_fld);
/* GetIntField() never fails. */
++potentialLockers;
(*env)->SetIntField
(env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
if (EXIT_MONITOR (env, mcache->lockForPotentialLockersObj))
return -1;
if (ENTER_MONITOR (env, mcache->lockObj))
return -1;
SHOW_OLD_TROUBLE ();
return 0;
}
/* Unlock a GMutex, once we're already in JNI and have already gotten the
mutexObj for it. This skips the messages that TRACE_API_CALLS would
print.
Returns -1 on error, 0 on success. */
static int
mutexObj_unlock (JNIEnv * env, jobject mutexObj,
struct mutexObj_cache *mcache)
{
jint potentialLockers;
int ret = -1; /* assume failure until we suceed. */
/* Free the lock first, so that someone waiting for the lock can get it
ASAP. */
/* This is guaranteed not to block. */
if (EXIT_MONITOR (env, mcache->lockObj) < 0)
goto done;
/* Kick down potentialLockers by one. We do this AFTER we free the lock, so
that we hold it no longer than necessary. */
if (ENTER_MONITOR (env, mcache->lockForPotentialLockersObj) < 0)
goto done;
potentialLockers = (*env)->GetIntField
(env, mutexObj, mutex_potentialLockers_fld);
/* GetIntField never fails */
assert (potentialLockers >= 1);
--potentialLockers;
(*env)->SetIntField
(env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
/* Never fails, so the JNI book says. */
/* Clean up. */
if (EXIT_MONITOR (env, mcache->lockForPotentialLockersObj) < 0)
goto done;
ret = 0;
done:
return ret;
}
/*** Mutex Implementations ****/
/* Create a mutex, which is a java.lang.Object for us.
In case of failure, we'll return NULL. Which will implicitly
cause future calls to fail. */
static GMutex *
mutex_new_jni_impl (void)
{
jobject mutexObj;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("mutex_new_jni_impl()");
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
{
mutexObj = NULL;
goto done;
}
mutexObj = allocateMutexObject (env);
done:
if (TRACE_API_CALLS)
tracing (" ==> %p \n", mutexObj);
return (GMutex *) mutexObj;
}
/* Lock a mutex. */
static void
mutex_lock_jni_impl (GMutex * mutex)
{
struct mutexObj_cache mcache;
jobject mutexObj = (jobject) mutex;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("mutex_lock_jni_impl( mutexObj = %p )", mutexObj);
assert (mutexObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
if (populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
goto done;
mutexObj_lock (env, mutexObj, &mcache);
/* No need to error check; we've already reported it in any case. */
done:
clean_mutexObj_cache (env, &mcache);
if (TRACE_API_CALLS)
tracing (" ==> VOID \n");
}
/* Try to lock a mutex. Return TRUE if we succeed, FALSE if we fail.
FALSE on error. */
static gboolean
mutex_trylock_jni_impl (GMutex * gmutex)
{
jobject mutexObj = (jobject) gmutex;
jint potentialLockers;
gboolean ret = FALSE;
JNIEnv *env;
union env_union e;
struct mutexObj_cache mcache;
if (TRACE_API_CALLS)
tracing ("mutex_trylock_jni_impl(mutexObj=%p)", mutexObj);
assert (mutexObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
if (populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
goto done;
if (ENTER_MONITOR (env, mcache.lockForPotentialLockersObj))
goto done;
potentialLockers = (*env)->GetIntField
(env, mutexObj, mutex_potentialLockers_fld);
assert (potentialLockers >= 0);
if (potentialLockers)
{
/* Already locked. Clean up and leave. */
EXIT_MONITOR (env, mcache.lockForPotentialLockersObj);
/* Ignore any error code from EXIT_MONITOR; there's nothing we could do
at this level, in any case. */
goto done;
}
/* Guaranteed not to block. */
if (ENTER_MONITOR (env, mcache.lockObj))
{
/* Clean up the existing lock. */
EXIT_MONITOR (env, mcache.lockForPotentialLockersObj);
/* Ignore any error code from EXIT_MONITOR; there's nothing we could do
at this level, in any case. */
goto done;
}
/* We have the monitor. Record that fact. */
potentialLockers = 1;
(*env)->SetIntField
(env, mutexObj, mutex_potentialLockers_fld, potentialLockers);
/* Set*Field() never fails */
ret = TRUE; /* We have the lock. */
/* Clean up. */
if (EXIT_MONITOR (env, mcache.lockForPotentialLockersObj))
goto done; /* If we fail at this point, still keep the
main lock. */
SHOW_OLD_TROUBLE ();
done:
clean_mutexObj_cache (env, &mcache);
if (TRACE_API_CALLS)
tracing (" ==> %s\n", ret ? "TRUE" : "FALSE");
return ret;
}
/* Unlock a mutex. */
static void
mutex_unlock_jni_impl (GMutex * gmutex)
{
jobject mutexObj = (jobject) gmutex;
struct mutexObj_cache mcache;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("mutex_unlock_jni_impl(mutexObj=%p)", mutexObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
assert (mutexObj);
if ( populate_mutexObj_cache (env, mutexObj, &mcache) < 0)
goto done;
(void) mutexObj_unlock (env, mutexObj, &mcache);
SHOW_OLD_TROUBLE ();
done:
clean_mutexObj_cache (env, &mcache);
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/* Free a mutex (isn't C fun?). OK this time for it to be NULL.
No failure conditions, for a change. */
static void
mutex_free_jni_impl (GMutex * mutex)
{
jobject mutexObj = (jobject) mutex;
JNIEnv *env;
union env_union e;
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (TRACE_API_CALLS)
tracing ("mutex_free_jni_impl(%p)", mutexObj);
freeObject (env, mutexObj);
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/************************************************************************/
/* Condition variable code */
/************************************************************************/
/* Create a new condition variable. This is a java.lang.Object for us. */
static GCond *
cond_new_jni_impl (void)
{
jobject condObj;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("mutex_free_jni_impl()");
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
condObj = allocatePlainObject (env);
if (TRACE_API_CALLS)
tracing (" ==> %p\n", condObj);
return (GCond *) condObj;
}
/* Signal on a condition variable. This is simply calling Object.notify
* for us.
*/
static void
cond_signal_jni_impl (GCond * gcond)
{
JNIEnv *env;
union env_union e;
jobject condObj = (jobject) gcond;
if (TRACE_API_CALLS)
tracing ("cond_signal_jni_impl(condObj = %p)", condObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
assert (condObj);
/* Must have locked an object to call notify */
if (ENTER_MONITOR (env, condObj))
goto done;
(*env)->CallVoidMethod (env, condObj, obj_notify_mth);
if (MAYBE_BROKEN (env, "cannot signal mutex with Object.notify()"))
{
if (EXIT_MONITOR (env, condObj))
BADLY_BROKEN1 ("Failed to unlock a monitor; the VM may deadlock.");
goto done;
}
EXIT_MONITOR (env, condObj);
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/* Broadcast to all waiting on a condition variable. This is simply
* calling Object.notifyAll for us.
*/
static void
cond_broadcast_jni_impl (GCond * gcond)
{
jobject condObj = (jobject) gcond;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("cond_broadcast_jni_impl(condObj=%p)", condObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
assert (condObj);
/* Must have locked an object to call notifyAll */
if (ENTER_MONITOR (env, condObj))
goto done;
(*env)->CallVoidMethod (env, condObj, obj_notifyall_mth);
if (MAYBE_BROKEN (env, "cannot broadcast to mutex with Object.notify()"))
{
EXIT_MONITOR (env, condObj);
goto done;
}
EXIT_MONITOR (env, condObj);
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/* Wait on a condition variable. For us, this simply means calling
* Object.wait.
*
* Throws a Java exception on trouble; may leave the mutexes set arbitrarily.
* XXX TODO: Further improve error recovery.
*/
static void
cond_wait_jni_impl (GCond * gcond, GMutex * gmutex)
{
struct mutexObj_cache cache;
jobject condObj = (jobject) gcond;
jobject mutexObj = (jobject) gmutex;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("cond_wait_jni_impl(condObj=%p, mutexObj=%p)",
condObj, mutexObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
assert (condObj);
assert (mutexObj);
/* Must have locked a Java object to call wait on it */
if (ENTER_MONITOR (env, condObj) < 0)
goto done;
/* Our atomicity is now guaranteed; we're protected by the Java monitor on
condObj. Unlock the GMutex. */
if (mutexObj_unlock (env, mutexObj, &cache))
goto done;
(*env)->CallVoidMethod (env, condObj, obj_wait_mth);
if (MAYBE_BROKEN (env, "cannot wait on condObj"))
{
EXIT_MONITOR (env, condObj); /* ignore err checking */
goto done;
}
/* Re-acquire the lock on the GMutex. Do this while we're protected by the
Java monitor on condObj. */
if (mutexObj_lock (env, mutexObj, &cache))
goto done;
EXIT_MONITOR (env, condObj);
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/** Wait on a condition variable until a timeout. This is a little tricky
* for us. We first call Object.wait(J) giving it the appropriate timeout
* value. On return, we check whether an InterruptedException happened. If
* so, that is Java-speak for wait timing out.
*
* We return FALSE if we timed out. Return TRUE if the condition was
* signalled first, before we timed out.
*
* In case of trouble we throw a Java exception. Whether we return FALSE or
* TRUE depends upon whether the condition was raised before the trouble
* happened.
*
* I believe that this function goes to the proper lengths to try to unlock
* all of the locked mutexes and monitors, as appropriate, and that it further
* tries to make sure that the thrown exception is the current one, not any
* future cascaded one from something like a failure to unlock the monitors.
*/
static gboolean
cond_timed_wait_jni_impl (GCond * gcond, GMutex * gmutex, GTimeVal * end_time)
{
JNIEnv *env;
union env_union e;
jlong time_millisec;
jint time_nanosec;
jthrowable cause;
jobject condObj = (jobject) gcond;
jobject mutexObj = (jobject) gmutex;
gboolean condRaised = FALSE; /* Condition has not been raised yet. */
struct mutexObj_cache cache;
gboolean interrupted;
if (TRACE_API_CALLS)
{
tracing ("cond_timed_wait_jni_impl(cond=%p, mutex=%p,"
" end_time=< sec=%lu, usec=%lu >)", condObj, mutexObj,
(unsigned long) end_time->tv_sec,
(unsigned long) end_time->tv_usec);
}
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
time_millisec = end_time->tv_sec * 1000 + end_time->tv_usec / 1000;
time_nanosec = 1000 * (end_time->tv_usec % 1000);
/* Must have locked an object to call wait */
if (ENTER_MONITOR (env, condObj) < 0)
goto done;
if (mutexObj_unlock (env, mutexObj, &cache) < 0)
{
if (EXIT_MONITOR (env, condObj) < 0)
criticalMsg
("Unable to unlock an existing lock on a condition; your proram may deadlock");
goto done;
}
(*env)->CallVoidMethod (env, condObj, obj_wait_nanotime_mth,
time_millisec, time_nanosec);
/* If there was trouble, save that fact, and the reason for the trouble. We
want to respond to this condition as fast as possible. */
cause = (*env)->ExceptionOccurred (env);
if ( ! cause )
{
condRaised = TRUE; /* condition was signalled */
}
else if ((*env)->IsInstanceOf (env, cause, interrupted_exception_class))
{
condRaised = FALSE; /* Condition was not raised before timeout.
(This is redundant with the initialization
of condRaised above) */
(*env)->ExceptionClear (env); /* Clear the InterruptedException. */
cause = NULL; /* no pending cause now. */
}
else
{
interrupted = FALSE; /* Trouble, but not because of
InterruptedException. Assume the condition
was not raised. */
/* Leave condRaised set to FALSE */
}
/* Irrespective of whether there is a pending problem to report, go ahead
and try to clean up. This may end up throwing an exception that is
different from the one that was thrown by the call to Object.wait().
So we will override it with the first exception (don't want to have
cascading problems). */
if (mutexObj_lock (env, mutexObj, &cache) && !cause)
{
cause = (*env)->ExceptionOccurred (env);
assert (cause);
}
if (EXIT_MONITOR (env, condObj) && !cause)
{
cause = (*env)->ExceptionOccurred (env);
assert (cause);
}
if (cause) /* Raise the first cause. */
{
BROKEN_CAUSE (env, cause, "error in timed wait or during its cleanup");
goto done;
}
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> condRaised = %s\n", condRaised ? "TRUE" : "FALSE");
return condRaised;
}
/* Free a condition variable. (isn't C fun?). Can not fail. */
static void
cond_free_jni_impl (GCond * cond)
{
jobject condObj = (jobject) cond;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("cond_free_jni_impl(condObj = %p)", condObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
freeObject (env, condObj);
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/************************************************************************/
/* Thread-local data code */
/************************************************************************/
/* Create a new thread-local key. We use java.lang.ThreadLocal objects
* for this. This returns the pointer representation of a Java global
* reference.
*
* We will throw a Java exception and return NULL in case of failure.
*/
static GPrivate *
private_new_jni_impl (GDestroyNotify notify __attribute__ ((unused)))
{
JNIEnv *env;
union env_union e;
jobject lcl_key;
jobject global_key;
GPrivate *gkey = NULL; /* Error return code */
if (TRACE_API_CALLS)
tracing ("private_new_jni_impl()");
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
lcl_key = (*env)->NewObject (env, threadlocal_class, threadlocal_ctor);
if ( ! lcl_key )
{
BROKEN (env, "cannot allocate a ThreadLocal");
goto done;
}
global_key = ((*env)->NewGlobalRef (env, lcl_key));
DELETE_LOCAL_REF (env, lcl_key);
if ( ! global_key)
{
NEW_BROKEN (env, "cannot create a GlobalRef to a new ThreadLocal");
goto done;
}
gkey = (GPrivate *) global_key;
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> %p\n", (void *) gkey);
return gkey;
}
/* Get this thread's value for a thread-local key. This is simply
* ThreadLocal.get for us. Return NULL if no value. (I can't think of
* anything else to do.)
*/
static gpointer
private_get_jni_impl (GPrivate * gkey)
{
JNIEnv *env;
union env_union e;
jobject val_wrapper;
jobject keyObj = (jobject) gkey;
gpointer thread_specific_data = NULL; /* Init to the error-return value */
jlong val;
if (TRACE_API_CALLS)
tracing ("private_get_jni_impl(keyObj=%p)", keyObj);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
val_wrapper = (*env)->CallObjectMethod (env, keyObj, threadlocal_get_mth);
if (MAYBE_BROKEN (env, "cannot find thread-local object"))
goto done;
if (! val_wrapper )
{
/* It's Java's "null" object. No ref found. This is OK; we must never
have set a value in this thread. Note that this next statement is
not necessary, strictly speaking, since we're already initialized to
NULL. A good optimizing C compiler will detect that and optimize out
this statement. */
thread_specific_data = NULL;
goto done;
}
val = (*env)->CallLongMethod (env, val_wrapper, long_longValue_mth);
if (MAYBE_BROKEN (env, "cannot get thread local value"))
goto done;
thread_specific_data = (gpointer) (intptr_t) val;
/* Only re-raise the old pending exception if a new one hasn't come along to
supersede it. */
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> %p\n", thread_specific_data);
return thread_specific_data;
}
/* Set this thread's value for a thread-local key. This is simply
* ThreadLocal.set() for us.
*/
static void
private_set_jni_impl (GPrivate * gkey, gpointer thread_specific_data)
{
JNIEnv *env;
union env_union e;
jobject val_wrapper;
jobject keyObj = (jobject) gkey;
if (TRACE_API_CALLS)
tracing ("private_set_jni_impl(keyObj=%p, thread_specific_data=%p)",
keyObj, thread_specific_data);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
/* We are just going to always use a Java long to represent a C pointer.
Otherwise all of the code would end up being conditionalized for various
pointer sizes, and that seems like too much of a hassle, in order to save
a paltry few bytes, especially given the horrendous overhead of JNI in
any case.
*/
val_wrapper = (*env)->NewObject (env, long_class, long_ctor,
(jlong) (intptr_t) thread_specific_data);
if ( ! val_wrapper )
{
BROKEN (env, "cannot create a java.lang.Long");
goto done;
}
/* At this point, we now have set lcl_obj as a numeric class that wraps
around the thread-specific data we were given. */
(*env)->CallVoidMethod (env, keyObj, threadlocal_set_mth, val_wrapper);
if (MAYBE_BROKEN (env, "cannot set thread local value"))
goto done;
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/** Create an object of type gnu.java.awt.peer.gtk.GThreadNativeMethodRunner.
Run it.
We need to create joinable threads. We handle the notion of a joinable
thread by determining whether or not we are going to maintain a permanent
hard reference to it until it croaks.
Posix does not appear to have a Java-like concept of daemon threads, where
the JVM will exit when there are only daemon threads running.
Error handling:
To quote from the glib guide:
"GError should only be used to report recoverable runtime errors, never
to report programming errors."
So how do we consider the failure to create a thread? Well, each of the
failure cases in this function are discussed, and none of them are really
recoverable.
The glib library is really designed so that you should fail
catastrophically in case of "programming errors". The only error defined
for the GThread functions is G_THREAD_ERROR_AGAIN, and that for
thread_create.
Most of these GThread functions could fail if we run out of memory, for
example, but the only one capable of reporting that fact is
thread_create. */
static void
thread_create_jni_impl (GThreadFunc func,
gpointer data,
gulong stack_size __attribute__((unused)),
gboolean joinable,
gboolean bound __attribute__((unused)),
GThreadPriority gpriority,
/* This prototype is horrible. threadIDp is actually
a gpointer to the thread's thread-ID. Which is,
of course, itself a gpointer-typed value. Ouch. */
gpointer threadIDp,
/* Do not touch the GError stuff unless you have
RECOVERABLE trouble. There is no recoverable
trouble in this implementation. */
GError **errorp __attribute__((unused)))
{
JNIEnv *env;
union env_union e;
union func_union f;
jboolean jjoinable = joinable;
jobject newThreadObj;
gpointer threadID; /* to be filled in */
if (TRACE_API_CALLS)
{
f.g_func = func;
tracing ("thread_create_jni_impl(func=%p, data=%p, joinable=%s,"
" threadIDp=%p, *(int *) threadIDp = %d)",
f.void_func, data, joinable ? "TRUE" : "FALSE",
threadIDp, *(int *) threadIDp);
}
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
{
/* The failed call to setup the cache is certainly not recoverable;
not appropriate for G_THREAD_ERROR_AGAIN. */
*(gpointer *) threadIDp = NULL;
goto done;
}
HIDE_OLD_TROUBLE (env);
/* If a thread is joinable, then notify its constructor. The constructor
will enter a hard reference for it, and the hard ref. won't go away until
the thread has been joined. */
newThreadObj =
(*env)->NewObject (env, runner_class, runner_ctor,
(jlong) (intptr_t) func, (jlong) (intptr_t) data,
jjoinable);
if ( ! newThreadObj )
{
BROKEN (env, "creating a new thread failed in the constructor");
*(gpointer *) threadIDp = NULL;
/* The failed call to the constructor does not throw any errors such
that G_THREAD_ERROR_AGAIN is appropriate. No other recoverable
errors defined. Once again, we go back to the VM. */
goto done;
}
if (threadObj_set_priority (env, newThreadObj, gpriority) < 0)
{
*(gpointer *) threadIDp = NULL;
/* None of these possible exceptions from Thread.setPriority() are
recoverable, so they are not appropriate for EAGAIN. So we should
fail. */
goto done;
}
(*env)->CallVoidMethod (env, runner_class, runner_start_mth);
if (MAYBE_BROKEN (env, "starting a new thread failed"))
{
*(gpointer *) threadIDp = NULL;
/* The only exception Thread.start() throws is
IllegalStateException. And that would indicate a programming error.
So there are no situations such that G_THREAD_ERROR_AGAIN would be
OK.
So, we don't use g_set_error() here to perform any error reporting.
*/
goto done;
}
threadID = getThreadIDFromThread (env, newThreadObj);
*(gpointer *) threadIDp = threadID;
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> (threadID = %p) \n", threadID);
}
/* Wraps a call to g_thread_yield. */
static void
thread_yield_jni_impl (void)
{
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("thread_yield_jni_impl()");
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
(*env)->CallStaticVoidMethod (env, thread_class, thread_yield_mth);
if (MAYBE_BROKEN (env, "Thread.yield() failed"))
goto done;
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
static void
thread_join_jni_impl (gpointer threadID)
{
JNIEnv *env;
union env_union e;
jobject threadObj = NULL;
if ( TRACE_API_CALLS )
tracing ("thread_join_jni_impl(threadID=%p) ", threadID);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
threadObj = getThreadFromThreadID (env, threadID);
if ( ! threadObj ) /* Already reported with BROKEN */
goto done;
(*env)->CallVoidMethod (env, threadObj, thread_join_mth);
if (MAYBE_BROKEN (env, "Thread.join() failed"))
goto done;
(*env)->CallStaticVoidMethod
(env, runner_class, runner_deRegisterJoinable_mth, threadObj);
if (MAYBE_BROKEN (env, "Thread.deRegisterJoinableThread() failed"))
goto done;
SHOW_OLD_TROUBLE ();
done:
DELETE_LOCAL_REF (env, threadObj);
if (TRACE_API_CALLS)
tracing (" ==> VOID \n");
}
/* Terminate the current thread. Unlike pthread_exit(), here we do not need
to bother with a return value or exit value for the thread which is about
to croak. (The gthreads abstraction doesn't use it.) However, we *do*
need to bail immediately. We handle this with Thread.stop(), which is
a deprecated method.
It's deprecated since we might leave objects protected by monitors in
half-constructed states on the way out -- Thread.stop() throws a
ThreadDeath exception, which is usually unchecked. There is no good
solution that I can see. */
static void
thread_exit_jni_impl (void)
{
JNIEnv *env;
union env_union e;
jobject this_thread;
if (TRACE_API_CALLS)
tracing ("thread_exit_jni_impl() ");
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
this_thread = (*env)->
CallStaticObjectMethod (env, thread_class, thread_current_mth);
if ( ! this_thread )
{
BROKEN (env, "cannot get current thread");
goto done;
}
(*env)->CallVoidMethod (env, this_thread, thread_stop_mth);
if (MAYBE_BROKEN (env, "cannot call Thread.stop() on current thread"))
goto done;
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> VOID \n");
}
/* Translate a GThreadPriority to a Java priority level. */
static jint
javaPriorityLevel (GThreadPriority priority)
{
/* We have these fields in java.lang.Thread to play with:
static int MIN_PRIORITY The minimum priority that a thread can have.
static int NORM_PRIORITY The default priority that is assigned to a
thread.
static int MAX_PRIORITY The maximum priority that a thread can have.
We get these from the header file generated by javah, even though they're
documented as being 1, 5, and 10.
*/
static const jint minJPri =
gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MIN_PRIORITY;
static const jint normJPri =
gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_NORM_PRIORITY;
static const jint maxJPri =
gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_MAX_PRIORITY;
switch (priority)
{
case G_THREAD_PRIORITY_LOW:
return minJPri;
break;
default:
assert_not_reached ();
/* Deliberate fall-through if assertions are turned off; also shuts up
GCC warnings if they're turned on. */
case G_THREAD_PRIORITY_NORMAL:
return normJPri;
break;
case G_THREAD_PRIORITY_HIGH:
return (normJPri + maxJPri) / 2;
break;
case G_THREAD_PRIORITY_URGENT:
return maxJPri;
break;
}
}
/** It would be safe not to implement this, according to the JNI docs, since
not all platforms do thread priorities. However, we might as well
provide the hint for those who want it.
*/
static void
thread_set_priority_jni_impl (gpointer gThreadID, GThreadPriority gpriority)
{
jobject threadObj = NULL;
JNIEnv *env;
union env_union e;
if (TRACE_API_CALLS)
tracing ("thread_set_priority_jni_impl(gThreadID=%p, gpriority = %u) ",
gThreadID, gpriority);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
goto done;
HIDE_OLD_TROUBLE (env);
threadObj = getThreadFromThreadID (env, gThreadID);
if ( ! threadObj) /* Reported with BROKEN already. */
goto done;
if (threadObj_set_priority (env, threadObj, gpriority))
goto done;
SHOW_OLD_TROUBLE ();
done:
DELETE_LOCAL_REF (env, threadObj);
if (TRACE_API_CALLS)
tracing (" ==> VOID\n");
}
/** It would be safe not to implement this, according to the JNI docs, since
not all platforms do thread priorities. However, we might as well
provide the hint for those who want it.
-1 on failure, 0 on success. */
static int
threadObj_set_priority (JNIEnv * env, jobject threadObj,
GThreadPriority gpriority)
{
jint javaPriority = javaPriorityLevel (gpriority);
(*env)->CallVoidMethod (env, threadObj, thread_setPriority_mth,
javaPriority);
return MAYBE_BROKEN (env, "Thread.setPriority() failed");
}
/** Return the result of Thread.currentThread(), a static method. */
static void
thread_self_jni_impl (/* Another confusing glib prototype. This is
actually a gpointer to the thread's thread-ID.
Which is, of course, a gpointer. */
gpointer my_thread_IDp)
{
JNIEnv *env;
union env_union e;
jobject this_thread;
gpointer my_threadID;
if (TRACE_API_CALLS)
tracing ("thread_self_jni_impl(my_thread_IDp=%p)", my_thread_IDp);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
return;
HIDE_OLD_TROUBLE (env);
this_thread = (*env)->
CallStaticObjectMethod (env, thread_class, thread_current_mth);
if (! this_thread )
{
BROKEN (env, "cannot get current thread");
my_threadID = NULL;
goto done;
}
my_threadID = getThreadIDFromThread (env, this_thread);
SHOW_OLD_TROUBLE ();
done:
if (TRACE_API_CALLS)
tracing (" ==> (my_threadID = %p) \n", my_threadID);
*(gpointer *) my_thread_IDp = my_threadID;
}
static gboolean
thread_equal_jni_impl (gpointer thread1, gpointer thread2)
{
JNIEnv *env;
union env_union e;
gpointer threadID1 = *(gpointer *) thread1;
gpointer threadID2 = *(gpointer *) thread2;
jobject thread1_obj = NULL;
jobject thread2_obj = NULL;
gboolean ret;
if (TRACE_API_CALLS)
tracing ("thread_equal_jni_impl(threadID1=%p, threadID2=%p)",
threadID1, threadID2);
e.jni_env = &env;
(*cp_gtk_the_vm)->GetEnv (cp_gtk_the_vm, e.void_env, JNI_VERSION_1_1);
if (setup_cache (env) < 0)
{
ret = FALSE; /* what is safer? We really don't ever want
to return from here. */
goto done;
}
HIDE_OLD_TROUBLE (env);
thread1_obj = getThreadFromThreadID (env, threadID1);
thread2_obj = getThreadFromThreadID (env, threadID2);
ret = (*env)->CallBooleanMethod (env, thread1_obj,
thread_equals_mth, thread2_obj);
if (MAYBE_BROKEN (env, "Thread.equals() failed"))
{
ret = FALSE;
goto done;
}
SHOW_OLD_TROUBLE ();
done:
DELETE_LOCAL_REF (env, thread1_obj);
DELETE_LOCAL_REF (env, thread2_obj);
if (TRACE_API_CALLS)
tracing (" ==> %s\n", ret ? "TRUE" : "FALSE");
return ret;
}
/************************************************************************/
/* GLIB interface */
/************************************************************************/
/* set of function pointers to give to glib. */
GThreadFunctions cp_gtk_portable_native_sync_jni_functions = {
mutex_new_jni_impl, /* mutex_new */
mutex_lock_jni_impl, /* mutex_lock */
mutex_trylock_jni_impl, /* mutex_trylock */
mutex_unlock_jni_impl, /* mutex_unlock */
mutex_free_jni_impl, /* mutex_free */
cond_new_jni_impl, /* cond_new */
cond_signal_jni_impl, /* cond_signal */
cond_broadcast_jni_impl, /* cond_broadcast */
cond_wait_jni_impl, /* cond_wait */
cond_timed_wait_jni_impl, /* cond_timed_wait */
cond_free_jni_impl, /* cond_free */
private_new_jni_impl, /* private_new */
private_get_jni_impl, /* private_get */
private_set_jni_impl, /* private_set */
thread_create_jni_impl, /* thread_create */
thread_yield_jni_impl, /* thread_yield */
thread_join_jni_impl, /* thread_join */
thread_exit_jni_impl, /* thread_exit */
thread_set_priority_jni_impl, /* thread_set_priority */
thread_self_jni_impl, /* thread_self */
thread_equal_jni_impl, /* thread_equal */
};
/* Keep c-font-lock-extra-types in alphabetical order. */
/* Local Variables: */
/* c-file-style: "gnu" */
/* c-font-lock-extra-types: ("\\sw+_t" "gboolean" "GError" "gpointer"
"GPrivate" "GThreadFunc" "GThreadFunctions" "GThreadPriority"
"gulong"
"JNIEnv"
"jboolean" "jclass" "jfieldID" "jint" "jlong" "jmethodID" "jobject" "jstring" "jthrowable" ) */
/* End: */
|
{
"content_hash": "f6abaf72bbab5e0ed3baa76b78971caa",
"timestamp": "",
"source": "github",
"line_count": 2558,
"max_line_length": 98,
"avg_line_length": 29.81078967943706,
"alnum_prop": 0.6329993705413345,
"repo_name": "shaotuanchen/sunflower_exp",
"id": "384ad0db60abfb5e2f505ad55b944bd3df6dacd5",
"size": "78022",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "tools/source/gcc-4.2.4/libjava/classpath/native/jni/gtk-peer/gthread-jni.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "459993"
},
{
"name": "Awk",
"bytes": "6562"
},
{
"name": "Batchfile",
"bytes": "9028"
},
{
"name": "C",
"bytes": "50326113"
},
{
"name": "C++",
"bytes": "2040239"
},
{
"name": "CSS",
"bytes": "2355"
},
{
"name": "Clarion",
"bytes": "2484"
},
{
"name": "Coq",
"bytes": "61440"
},
{
"name": "DIGITAL Command Language",
"bytes": "69150"
},
{
"name": "Emacs Lisp",
"bytes": "186910"
},
{
"name": "Fortran",
"bytes": "5364"
},
{
"name": "HTML",
"bytes": "2171356"
},
{
"name": "JavaScript",
"bytes": "27164"
},
{
"name": "Logos",
"bytes": "159114"
},
{
"name": "M",
"bytes": "109006"
},
{
"name": "M4",
"bytes": "100614"
},
{
"name": "Makefile",
"bytes": "5409865"
},
{
"name": "Mercury",
"bytes": "702"
},
{
"name": "Module Management System",
"bytes": "56956"
},
{
"name": "OCaml",
"bytes": "253115"
},
{
"name": "Objective-C",
"bytes": "57800"
},
{
"name": "Papyrus",
"bytes": "3298"
},
{
"name": "Perl",
"bytes": "70992"
},
{
"name": "Perl 6",
"bytes": "693"
},
{
"name": "PostScript",
"bytes": "3440120"
},
{
"name": "Python",
"bytes": "40729"
},
{
"name": "Redcode",
"bytes": "1140"
},
{
"name": "Roff",
"bytes": "3794721"
},
{
"name": "SAS",
"bytes": "56770"
},
{
"name": "SRecode Template",
"bytes": "540157"
},
{
"name": "Shell",
"bytes": "1560436"
},
{
"name": "Smalltalk",
"bytes": "10124"
},
{
"name": "Standard ML",
"bytes": "1212"
},
{
"name": "TeX",
"bytes": "385584"
},
{
"name": "WebAssembly",
"bytes": "52904"
},
{
"name": "Yacc",
"bytes": "510934"
}
],
"symlink_target": ""
}
|
Extracts card history from Mingle using its Events API.
|
{
"content_hash": "61a9d8d705fd3a38056cad0f15ac6526",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 55,
"avg_line_length": 56,
"alnum_prop": 0.8214285714285714,
"repo_name": "simondean/mingle-extractor",
"id": "60616378ce871d13cd4491eae4e3a5181b1f3b23",
"size": "76",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "3476"
}
],
"symlink_target": ""
}
|
import json
import random
import time
import mock
from sqlalchemy.exc import SQLAlchemyError
import config
import constants.api
import database.attachment
import database.paste
import database.user
import util.cryptography
import util.testing
from uri.authentication import *
from uri.main import *
from uri.paste import *
class TestPaste(util.testing.DatabaseTestCase):
def test_submit_paste_invalid(self):
# Invalid input
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.INCOMPLETE_PARAMS_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.INCOMPLETE_PARAMS_FAILURE)
def test_submit_paste_login_required(self):
# Config requires authentication to post paste
config.REQUIRE_LOGIN_TO_PASTE = True
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'paste',
}),
content_type='application/json',
)
self.assertEqual(constants.api.UNAUTHENTICATED_PASTES_DISABLED_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.UNAUTHENTICATED_PASTES_DISABLED_FAILURE, json.loads(resp.data))
user = util.testing.UserFactory.generate()
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'paste',
'api_key': user.api_key,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
def test_submit_paste_no_auth(self):
# Successful paste without authentication
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
resp_data = json.loads(resp.data)
self.assertIsNotNone(resp_data['post_time'])
self.assertIsNotNone(resp_data['paste_id_repr'])
self.assertTrue(resp_data['is_active'])
self.assertEquals('contents', resp_data['contents'])
self.assertIsNotNone(resp_data['deactivation_token'])
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'user_id': 1,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
resp_data = json.loads(resp.data)
self.assertIsNotNone(resp_data['post_time'])
self.assertIsNotNone(resp_data['paste_id_repr'])
self.assertTrue(resp_data['is_active'])
self.assertEquals('contents', resp_data['contents'])
self.assertIsNone(database.paste.get_paste_by_id(1).user_id)
def test_submit_paste_logged_in(self):
# Paste should automatically be associated with user who is logged in
user = util.testing.UserFactory.generate(username='username', password='password')
resp = self.client.post(
LoginUserURI.uri(),
data=json.dumps({
'username': 'username',
'password': 'password',
}),
content_type='application/json',
)
self.assertEquals(resp.status_code, constants.api.SUCCESS_CODE)
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
resp_data = json.loads(resp.data)
self.assertIsNotNone(resp_data['post_time'])
self.assertIsNotNone(resp_data['paste_id_repr'])
self.assertTrue(resp_data['is_active'])
self.assertEquals('contents', resp_data['contents'])
self.assertIsNotNone(resp_data['deactivation_token'])
self.assertEqual(user.user_id, database.paste.get_paste_by_id(util.cryptography.get_decid(resp_data['paste_id_repr'])).user_id)
def test_submit_paste_api_post(self):
# Ensure that the is_api_post flag is appropriately set
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
paste_id = util.cryptography.get_decid(json.loads(resp.data)['paste_id_repr'], force=True)
self.assertTrue(database.paste.get_paste_by_id(paste_id).is_api_post)
def test_submit_paste_non_api_post(self):
for referrer in [PastePostInterfaceURI.full_uri(), HomeURI.full_uri(), PastePostInterfaceURI.full_uri() + '/?extra=stuff']:
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
}),
content_type='application/json',
headers={
'referer': referrer, # TIL "referer" is a deliberate misspelling of "referrer"
},
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
paste_id = util.cryptography.get_decid(json.loads(resp.data)['paste_id_repr'], force=True)
self.assertFalse(database.paste.get_paste_by_id(paste_id).is_api_post)
def test_submit_paste_non_ascii(self):
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': '어머',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': json.loads(resp.data)['paste_id_repr'],
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
self.assertEqual(json.loads(resp.data)['details']['contents'], unicode('어머', 'utf8'))
def test_submit_paste_attachments_disabled(self):
config.ENABLE_PASTE_ATTACHMENTS = False
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': 'binary data',
}
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.PASTE_ATTACHMENTS_DISABLED_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.PASTE_ATTACHMENTS_DISABLED_FAILURE, json.loads(resp.data))
def test_submit_paste_with_attachments(self):
with mock.patch.object(database.attachment, '_store_attachment_file') as mock_store_attachment_file:
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': 'binary data',
},
{
'name': 'file name 2',
'size': 12345,
'mime_type': 'image/png',
'data': 'binary data 2',
}
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(2, mock_store_attachment_file.call_count)
resp_data = json.loads(resp.data)
self.assertEqual('file_name', resp_data['attachments'][0]['name'])
self.assertEqual(12345, resp_data['attachments'][0]['size'])
self.assertEqual('image/png', resp_data['attachments'][0]['mime_type'])
self.assertIsNotNone(database.attachment.get_attachment_by_name(
util.cryptography.get_decid(resp_data['paste_id_repr']),
'file_name')
)
self.assertEqual('file_name_2', resp_data['attachments'][1]['name'])
self.assertEqual(12345, resp_data['attachments'][1]['size'])
self.assertEqual('image/png', resp_data['attachments'][1]['mime_type'])
self.assertIsNotNone(database.attachment.get_attachment_by_name(
util.cryptography.get_decid(resp_data['paste_id_repr']),
'file_name_2')
)
def test_submit_paste_invalid_attachments(self):
with mock.patch.object(database.attachment, '_store_attachment_file') as mock_store_attachment_file:
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
}
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(1, mock_store_attachment_file.call_count)
def test_submit_paste_too_large(self):
config.MAX_ATTACHMENT_SIZE = 10.0 / (1000 * 1000) # 10 B
with mock.patch.object(database.attachment, '_store_attachment_file'):
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': util.testing.random_alphanumeric_string(length=20),
},
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.PASTE_ATTACHMENT_TOO_LARGE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.PASTE_ATTACHMENT_TOO_LARGE_FAILURE, json.loads(resp.data))
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': util.testing.random_alphanumeric_string(length=5),
},
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
def test_submit_paste_base64_size_threshold(self):
config.MAX_ATTACHMENT_SIZE = 3.0 / (1000 * 1000) # 3 B
with mock.patch.object(database.attachment, '_store_attachment_file'):
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': util.testing.random_alphanumeric_string(length=5),
},
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.PASTE_ATTACHMENT_TOO_LARGE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.PASTE_ATTACHMENT_TOO_LARGE_FAILURE, json.loads(resp.data))
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
'attachments': [
{
'name': 'file name',
'size': 12345,
'mime_type': 'image/png',
'data': util.testing.random_alphanumeric_string(length=4),
},
]
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
def test_submit_paste_server_error(self):
with mock.patch.object(database.paste, 'create_new_paste', side_effect=SQLAlchemyError):
resp = self.client.post(
PasteSubmitURI.uri(),
data=json.dumps({
'contents': 'contents',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.UNDEFINED_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.UNDEFINED_FAILURE)
def test_deactivate_paste_invalid(self):
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.INCOMPLETE_PARAMS_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.INCOMPLETE_PARAMS_FAILURE)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': -1,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.NONEXISTENT_PASTE_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.NONEXISTENT_PASTE_FAILURE)
def test_deactivate_paste_auth(self):
# Deactivate paste by being authenticated and owning the paste
user = util.testing.UserFactory.generate(username='username', password='password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.AUTH_FAILURE_CODE)
resp = self.client.post(
LoginUserURI.uri(),
data=json.dumps({
'username': 'username',
'password': 'password',
}),
content_type='application/json',
)
self.assertEquals(resp.status_code, constants.api.SUCCESS_CODE)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
self.assertFalse(database.paste.get_paste_by_id(paste.paste_id).is_active)
def test_deactivate_paste_api_key(self):
# Deactivate paste by authentication via an API key
user = util.testing.UserFactory.generate()
paste = util.testing.PasteFactory.generate(user_id=user.user_id)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'api_key': user.api_key,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertFalse(database.paste.get_paste_by_id(paste.paste_id).is_active)
def test_deactivate_paste_token(self):
# Deactivate paste using deactivation token
paste = util.testing.PasteFactory.generate()
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'deactivation_token': 'invalid',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.AUTH_FAILURE_CODE)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'deactivation_token': paste.deactivation_token,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
self.assertFalse(database.paste.get_paste_by_id(paste.paste_id).is_active)
def test_deactivate_paste_already_deactivated(self):
# Deactivate paste using deactivation token
paste = util.testing.PasteFactory.generate()
database.paste.deactivate_paste(paste.paste_id)
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'deactivation_token': paste.deactivation_token,
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_deactivate_paste_server_error(self):
with mock.patch.object(database.paste, 'deactivate_paste', side_effect=SQLAlchemyError):
paste = util.testing.PasteFactory.generate()
resp = self.client.post(
PasteDeactivateURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'deactivation_token': paste.deactivation_token,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.UNDEFINED_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.UNDEFINED_FAILURE)
def test_set_paste_password(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id)
old_password_hash = paste.password_hash
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertNotEqual(database.paste.get_paste_by_id(paste.paste_id).password_hash, old_password_hash)
def test_set_paste_password_unauth(self):
# Modifying your own paste without authorization
user = util.testing.UserFactory.generate(username='username', password='password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id)
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.AUTH_FAILURE_CODE, resp.status_code)
self.assertEqual('auth_failure', json.loads(resp.data)[constants.api.FAILURE])
def test_set_paste_password_invalid_auth(self):
# Modifying someone else's paste
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id + 1)
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.AUTH_FAILURE_CODE, resp.status_code)
self.assertEqual('auth_failure', json.loads(resp.data)[constants.api.FAILURE])
def test_set_paste_password_nonexistent(self):
util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': -1,
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_add_paste_password(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id, password=None)
self.assertIsNone(paste.password_hash)
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertIsNotNone(database.paste.get_paste_by_id(paste.paste_id).password_hash)
def test_remove_paste_password(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id, password='password')
self.assertIsNotNone(paste.password_hash)
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': None,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertIsNone(database.paste.get_paste_by_id(paste.paste_id).password_hash)
def test_set_paste_password_server_error(self):
with mock.patch.object(database.paste, 'set_paste_password', side_effect=SQLAlchemyError):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
paste = util.testing.PasteFactory.generate(user_id=user.user_id)
resp = self.client.post(
PasteSetPasswordURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(constants.api.UNDEFINED_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.UNDEFINED_FAILURE, json.loads(resp.data))
def test_paste_details_invalid(self):
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.INCOMPLETE_PARAMS_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.INCOMPLETE_PARAMS_FAILURE)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': -1,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.NONEXISTENT_PASTE_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.NONEXISTENT_PASTE_FAILURE)
def test_paste_details_no_password(self):
user = util.testing.UserFactory.generate(username='username')
paste = util.testing.PasteFactory.generate(password=None, user_id=user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
paste_details = database.paste.get_paste_by_id(paste.paste_id).as_dict()
paste_details['poster_username'] = 'username'
paste_details['attachments'] = []
self.assertEqual(paste_details, json.loads(resp.data)['details'])
def test_paste_details_password(self):
user = util.testing.UserFactory.generate(username='username')
paste = util.testing.PasteFactory.generate(password='None', user_id=user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.AUTH_FAILURE_CODE)
paste = util.testing.PasteFactory.generate(password='password', user_id=user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.AUTH_FAILURE_CODE)
paste = util.testing.PasteFactory.generate(password='password', user_id=user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'invalid',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.AUTH_FAILURE_CODE)
paste = util.testing.PasteFactory.generate(password='password', user_id=user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
'password': 'password',
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.SUCCESS_CODE)
paste_details = database.paste.get_paste_by_id(paste.paste_id).as_dict()
paste_details['poster_username'] = 'username'
paste_details['attachments'] = []
self.assertEqual(paste_details, json.loads(resp.data)['details'])
def test_paste_details_anonymous(self):
paste = util.testing.PasteFactory.generate(password=None, user_id=None)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual('Anonymous', json.loads(resp.data)['details']['poster_username'])
user = util.testing.UserFactory.generate(username='username')
paste = util.testing.PasteFactory.generate(password=None, user_id=user.user_id)
database.user.deactivate_user(user.user_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_paste_details_nonexistent(self):
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(1),
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_paste_details_inactive(self):
paste = util.testing.PasteFactory.generate(password=None, user_id=None)
database.paste.deactivate_paste(paste.paste_id)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_paste_details_expired(self):
paste = util.testing.PasteFactory.generate(password=None, user_id=None, expiry_time=int(time.time()) - 1000)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.NONEXISTENT_PASTE_FAILURE, json.loads(resp.data))
def test_paste_details_with_attachments(self):
paste = util.testing.PasteFactory.generate(password=None, user_id=None)
attachments = [
util.testing.AttachmentFactory.generate(paste_id=paste.paste_id).as_dict()
for _ in range(5)
]
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(5, len(json.loads(resp.data)['details']['attachments']))
for attachment in attachments:
self.assertIn(attachment, json.loads(resp.data)['details']['attachments'])
def test_paste_details_server_error(self):
with mock.patch.object(database.paste, 'get_paste_by_id', side_effect=SQLAlchemyError):
paste = util.testing.PasteFactory.generate(password=None)
resp = self.client.post(
PasteDetailsURI.uri(),
data=json.dumps({
'paste_id': util.cryptography.get_id_repr(paste.paste_id),
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.UNDEFINED_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.UNDEFINED_FAILURE)
def test_pastes_for_user_unauthorized(self):
resp = self.client.post(
PastesForUserURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.AUTH_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.AUTH_FAILURE, json.loads(resp.data))
def test_pastes_for_user_empty(self):
util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
resp = self.client.post(
PastesForUserURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual([], json.loads(resp.data)['pastes'])
def test_pastes_for_user_no_inactive(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
pastes = [util.testing.PasteFactory.generate(user_id=user.user_id).as_dict() for i in range(10)]
[database.paste.deactivate_paste(util.cryptography.get_decid(paste['paste_id_repr'], force=True)) for paste in pastes]
resp = self.client.post(
PastesForUserURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(0, len(json.loads(resp.data)['pastes']))
def test_pastes_for_user_valid(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
pastes = [util.testing.PasteFactory.generate(user_id=user.user_id).as_dict() for i in range(10)]
resp = self.client.post(
PastesForUserURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(len(pastes), len(json.loads(resp.data)['pastes']))
for paste in json.loads(resp.data)['pastes']:
self.assertIn(paste, pastes)
def test_pastes_for_user_server_error(self):
user = util.testing.UserFactory.generate(username='username', password='password')
self.api_login_user('username', 'password')
for i in range(3):
util.testing.PasteFactory.generate(user_id=user.user_id)
with mock.patch.object(database.paste, 'get_all_pastes_for_user', side_effect=SQLAlchemyError):
resp = self.client.post(
PastesForUserURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.UNDEFINED_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.UNDEFINED_FAILURE, json.loads(resp.data))
def test_recent_pastes_invalid(self):
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE, json.loads(resp.data))
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({
'page_num': 0,
}),
content_type='application/json',
)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE, json.loads(resp.data))
def test_recent_pastes_no_results(self):
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({
'page_num': 0,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual([], json.loads(resp.data)['pastes'])
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({
'page_num': 3,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual([], json.loads(resp.data)['pastes'])
def test_recent_pastes_results(self):
pastes = []
for i in range(15):
with mock.patch.object(time, 'time', return_value=time.time() + random.randint(-10000, 10000)):
pastes.append(util.testing.PasteFactory.generate(expiry_time=None))
recent_pastes_sorted = map(
lambda paste: paste.as_dict(),
sorted(pastes, key=lambda paste: paste.post_time, reverse=True),
)
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({
'page_num': 0,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual(recent_pastes_sorted[0:5], json.loads(resp.data)['pastes'])
def test_top_pastes_invalid(self):
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({}),
content_type='application/json',
)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE, json.loads(resp.data))
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': 0,
}),
content_type='application/json',
)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE_CODE, resp.status_code)
self.assertEqual(constants.api.INCOMPLETE_PARAMS_FAILURE, json.loads(resp.data))
def test_top_pastes_no_results(self):
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': 0,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual([], json.loads(resp.data)['pastes'])
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': 3,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(constants.api.SUCCESS_CODE, resp.status_code)
self.assertEqual([], json.loads(resp.data)['pastes'])
def test_recent_pastes_server_error(self):
with mock.patch.object(database.paste, 'get_recent_pastes', side_effect=SQLAlchemyError):
resp = self.client.post(
RecentPastesURI.uri(),
data=json.dumps({
'page_num': 0,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.UNDEFINED_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.UNDEFINED_FAILURE)
def test_top_pastes_results(self):
pastes = [util.testing.PasteFactory.generate() for i in range(15)]
for paste in pastes:
for i in range(random.randint(0, 50)):
database.paste.increment_paste_views(paste.paste_id)
for page_num in range(3):
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': page_num,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(5, len(json.loads(resp.data)['pastes']))
for i in range(4):
self.assertGreaterEqual(
json.loads(resp.data)['pastes'][i]['views'],
json.loads(resp.data)['pastes'][i + 1]['views']
)
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': 3,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual([], json.loads(resp.data)['pastes'])
def test_top_pastes_server_error(self):
with mock.patch.object(database.paste, 'get_top_pastes', side_effect=SQLAlchemyError):
resp = self.client.post(
TopPastesURI.uri(),
data=json.dumps({
'page_num': 0,
'num_per_page': 5,
}),
content_type='application/json',
)
self.assertEqual(resp.status_code, constants.api.UNDEFINED_FAILURE_CODE)
self.assertEqual(json.loads(resp.data), constants.api.UNDEFINED_FAILURE)
|
{
"content_hash": "3bd652d711952201c00aca91756bc31d",
"timestamp": "",
"source": "github",
"line_count": 957,
"max_line_length": 135,
"avg_line_length": 43.11494252873563,
"alnum_prop": 0.5718959792540171,
"repo_name": "LINKIWI/modern-paste",
"id": "adda09b2999a9f99515d8b32286adda17e0d5a48",
"size": "41285",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/test_api/test_paste.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20594"
},
{
"name": "HTML",
"bytes": "59261"
},
{
"name": "JavaScript",
"bytes": "93555"
},
{
"name": "Makefile",
"bytes": "1164"
},
{
"name": "Python",
"bytes": "219433"
}
],
"symlink_target": ""
}
|
var glowtime = 30000; //time score glows in ms
var fadetext = 20000; //interval between hints taken / time since last capture fade effects
var scoretext = true;
var ranking = "";
var game_data = [];
var tableOptions = {
onComplete: function(){ /*do nothing*/ },
duration: [1000, 0, 700, 0, 500], //The milliseconds to do each phase and the delay between them
extractIdFromCell: function(td){ return $.trim($(td).text()); }, //the function to use to extract the id value from a cell in the id column.
animationSettings: {
up: {
left: -25, // Move left
backgroundColor: '#004400' // Dullish green
},
down: {
left: 25, // Move right
backgroundColor: '#550000' // Dullish red
},
fresh: {
left: 0, //Stay put in first stage.
backgroundColor: 'transparent' // Yellow
},
drop: {
left: 0, //Stay put in first stage.
backgroundColor: 'transparent' // Purple
}
}
};
/* Update code */
$(document).ready(function() {
if ($("#timercount_hidescoreboard").length > 0) {
$.get("/scoreboard/ajax/timer", function(distance) {
distance = distance * 1000;
setTimer(distance, "_hidescoreboard");
});
window.scoreboard_ws = new WebSocket(wsUrl() + "/scoreboard/wsocket/pause_score");
scoreboard_ws.onmessage = function(event) {
if (event.data !== "pause") {
location.reload();
}
}
} else {
if ($("#timercount").length > 0) {
$.get("/scoreboard/ajax/timer", function(distance) {
distance = distance * 1000;
setTimer(distance, "");
});
}
window.scoreboard_ws = new WebSocket(wsUrl() + "/scoreboard/wsocket/game_data");
scoreboard_ws.onmessage = function(event) {
if (event.data === "pause") {
location.reload();
} else {
game_data = jQuery.parseJSON(event.data);
/* Update Summary Table */
let count = $("#parameters").data("count");
let page = $("#parameters").data("page");
$.get("/scoreboard/ajax/summary?count=" + count + "&page=" + page, function(table_data) {
highlight_table = highlights(table_data);
$("#summary_loading").hide();
if ($("#summary_tbody").find('tr').length == 0) {
$("#summary_tbody").html(highlight_table);
ranking = getRanking(table_data);
} else {
new_ranking = getRanking(table_data);
if (new_ranking === ranking) {
$("#summary_tbody").html(highlight_table);
} else {
//Animated Table Reorder
ranking = new_ranking;
var table = $("#summary_table").clone();
table.children('tbody').html(highlight_table);
$("#summary_table").rankingTableUpdate(table, tableOptions);
}
}
$("a[id^=team-details-button]").click(function() {
window.location = "/teams#" + $(this).data("uuid");
});
$("a[id^=user-details-button]").click(function() {
window.location = "/user?id=" + $(this).data("uuid");
});
});
if ($("#mvp_table").length > 0) {
/* Update MVP Table */
$.get("/scoreboard/ajax/mvp", function(table_data) {
$("#mvp_table").html(table_data);
});
}
}
};
setTimeout(changeDisplay, fadetext);
setTimeout(updateLastFlag, 1000);
}
$("#page_count").on('change', function() {
document.location.href = "/scoreboard?count=" + this.value + "&page=1";
});
});
function changeDisplay() {
if (scoretext) {
if ($(".lastflagcol").text().length > 0) {
$(".hintcol").fadeOut("slow", function() {
$(".lastflagcol").fadeIn("slow");
});
}
if ($("#mvp_table").length > 0) {
$("#scoreboard_right_image").fadeOut("slow", function() {
$("#scoreboard_mvp").fadeIn("slow");
});
}
} else {
if ($(".lastflagcol").text().length > 0) {
$(".lastflagcol").fadeOut("slow", function() {
$(".hintcol").fadeIn("slow");
});
}
if ($("#scoreboard_right_image").length > 0) {
$("#scoreboard_mvp").fadeOut("slow", function() {
$("#scoreboard_right_image").fadeIn("slow");
});
}
}
scoretext = !scoretext;
setTimeout(function () {
changeDisplay();
}, fadetext);
}
function getRanking(table_data) {
var new_rank = "";
$(table_data).siblings("tr").each(function() {
new_rank += $(this).attr("id");
});
return new_rank;
}
function highlights(table_data) {
var table_data = $(table_data);
//Set color of minibar
$(table_data).find(".minibar").each(function() {
if (this.style.width == "100%") {
$(this).css('background-color', "#00bb00");
$(this).css('background-image', 'linear-gradient(to bottom,#00bb00,#009900)')
} else {
$(this).css('background-color', "#eeee00");
$(this).css('background-image', 'linear-gradient(to bottom,#eeee00,#b3b300)');
}
});
if (!scoretext) {
$(table_data).find(".hintcol").hide();
$(table_data).find(".lastflagcol").show();
} else {
$(table_data).find(".lastflagcol").hide();
$(table_data).find(".hintcol").show();
}
//Glow for new updates
for (team in game_data) {
if ("highlights" in game_data[team]) {
var highlights = game_data[team]["highlights"];
var now = highlights["now"];
for (item in highlights) {
if (item !== "now") {
var diff = now - highlights[item];
if (diff < glowtime) {
var column = $(table_data).siblings("#" + game_data[team]["uuid"]).find("." + item + "col");
if (!$(column).hasClass("glow")) {
var currentColumn = $("#summary_table").find("#" + game_data[team]["uuid"]).find("." + item + "col");
$(column).addClass("glow");
$(currentColumn).addClass("glow");
$(currentColumn).text($(column).text());
var id = setTimeout(function() {
$(column).removeClass("glow");
}, glowtime);
$(column).data("id", id);
$(currentColumn).data("id", id);
} else {
//already glowing - set new timeout
clearTimeout($(column).data("id"));
var id = setTimeout(function() {
$(column).removeClass("glow");
}, glowtime);
$(column).data("id", id);
}
}
}
}
}
}
return table_data;
}
function updateLastFlag() {
for (team in game_data) {
if ("highlights" in game_data[team]) {
var highlights = game_data[team]["highlights"];
var money = highlights["money"];
if (money !== 0) {
var now = highlights["now"];
var diff = now - money;
$("#last-" + game_data[team]["uuid"]).text(timeConversion(diff) + " " + $("#summary_table").data("since-score"));
highlights["now"] = now + 1000;
}
}
}
setTimeout(updateLastFlag, 1000);
}
function padDigits(number, digits) {
return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number;
}
function setTimer(distance, id) {
// Update the count down every 1 second
var x = setInterval(function() {
// Time calculations for days, hours, minutes and seconds
var hours = Math.max(0,Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)));
var minutes = Math.max(0,Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)));
var seconds = Math.max(0,Math.floor((distance % (1000 * 60)) / 1000));
// Display the result in the element with id="demo"
var hourval = "";
if (hours > 0) {
hourval = hours + "h ";
}
$("#timercount" + id).text(hourval + padDigits(minutes,2) + "m " + padDigits(seconds,2) + "s ");
// If the count down is finished, write some text
if (distance <= 0) {
clearInterval(x);
$("#timercount" + id).text("EXPIRED");
}
distance = distance - 1000;
}, 1000);
}
function timeConversion(s) {
// Pad to 2 or 3 digits, default is 2
function pad(prior, n, z) {
if (prior > 0) {
z = z || 2;
return ('00' + n).slice(-z);
} else {
return n;
}
}
var s = parseInt(s / 1000);
var secs = s % 60;
s = (s - secs) / 60;
var mins = s % 60;
var hrs = (s - mins) / 60;
var flagtime = "";
if (hrs > 0) {
flagtime += hrs + ':';
}
if (flagtime.length > 0 || mins > 0) {
flagtime += pad(hrs, mins) + ":"
}
if (flagtime.length > 0 || secs > 0) {
flagtime += pad(hrs + mins, secs);
}
if (flagtime.length === 0) {
return 0;
}
return flagtime;
}
|
{
"content_hash": "1957164f5c8cbcaafcf6440ebf64943f",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 144,
"avg_line_length": 37.407407407407405,
"alnum_prop": 0.4622772277227723,
"repo_name": "moloch--/RootTheBox",
"id": "310e5279beb832a696c6b82f220dfb9cbb7443ec",
"size": "10100",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/js/pages/scoreboard/summary.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "209844"
},
{
"name": "Dockerfile",
"bytes": "1632"
},
{
"name": "HTML",
"bytes": "649097"
},
{
"name": "JavaScript",
"bytes": "361722"
},
{
"name": "Mako",
"bytes": "494"
},
{
"name": "Python",
"bytes": "671684"
},
{
"name": "Shell",
"bytes": "3824"
}
],
"symlink_target": ""
}
|
from twisted.trial.unittest import TestCase
from txssmi.builder import SSMIRequest, SSMICommandException
class SSMICommandTestCase(TestCase):
def test_valid_fields(self):
LoginRequest = SSMIRequest.create('LOGIN', {})
login = LoginRequest(username='foo', password='bar')
self.assertEqual(login.username, 'foo')
self.assertEqual(login.password, 'bar')
def test_defaults(self):
LoginRequest = SSMIRequest.create('LOGIN', {'username': 'foo'})
login = LoginRequest(password='bar')
self.assertEqual(login.username, 'foo')
self.assertEqual(login.password, 'bar')
def test_missing_fields(self):
LoginRequest = SSMIRequest.create('LOGIN', {'username': 'foo'})
self.assertRaisesRegexp(
SSMICommandException, 'Missing fields: password', LoginRequest)
def test_unsupported_field(self):
LoginRequest = SSMIRequest.create('LOGIN', {})
self.assertRaisesRegexp(
SSMICommandException, 'Unsupported fields: foo',
LoginRequest, foo='foo')
def test_parse(self):
LoginRequest = SSMIRequest.create('LOGIN')
expected_cmd = LoginRequest(username='foo', password='bar')
cmd = SSMIRequest.parse('SSMI,1,foo,bar')
self.assertEqual(cmd, expected_cmd)
def test_parse_missing_fields(self):
self.assertRaisesRegexp(
SSMICommandException,
'Too few parameters for command: LOGIN \(expected 2 got 1\)',
SSMIRequest.parse, 'SSMI,1,foo')
|
{
"content_hash": "a050ba774a55193e459a7ce4ef5e6ee4",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 75,
"avg_line_length": 37.65853658536585,
"alnum_prop": 0.6560880829015544,
"repo_name": "praekelt/txssmi",
"id": "d9a1ea602385af3dcd146c5181a61db74c1d93e9",
"size": "1544",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "txssmi/tests/test_commands.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "26424"
},
{
"name": "Shell",
"bytes": "802"
}
],
"symlink_target": ""
}
|
//-----------------------------------------------------------------------
// <copyright file="BaseInputModel.cs" company="Sitecore Corporation">
// Copyright (c) Sitecore Corporation 1999-2015
// </copyright>
// <summary>Base class of all action requests.</summary>
//-----------------------------------------------------------------------
// Copyright 2015 Sitecore Corporation A/S
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
// -------------------------------------------------------------------------------------------
namespace Sitecore.Reference.Storefront.Models.InputModels
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Defines the BaseInputModel class.
/// </summary>
public class BaseInputModel
{
}
}
|
{
"content_hash": "2ba270e7d78395ef30110a8d999ea3bb",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 94,
"avg_line_length": 42.67741935483871,
"alnum_prop": 0.5918367346938775,
"repo_name": "Sitecore/sccs-demo",
"id": "e0792790e9507a60d8185818cd8c5377feabfb66",
"size": "1325",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Common/Project/Models/InputModels/BaseInputModel.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "1179"
},
{
"name": "C#",
"bytes": "1572445"
},
{
"name": "CSS",
"bytes": "43813"
},
{
"name": "HTML",
"bytes": "253367"
},
{
"name": "JavaScript",
"bytes": "381220"
},
{
"name": "Smalltalk",
"bytes": "77392"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<!-- saved from url=(0022)http://localhost:9393/ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--
normalize.css removes cross-browser differences in defaults, e.g.,
differences in how form elements appear between Firefox and IE
See: http://necolas.github.com/normalize.css/
-->
<link rel="stylesheet" href="./localhost_files/normalize.css">
<!--
application.css is where you put your styles
-->
<link rel="stylesheet" type="text/css" href="./localhost_files/application.css">
<!-- the below script is to link it to javascript which will be used later in the course. -->
<script src="./localhost_files/jquery.min.js"></script><style type="text/css"></style>
<script src="./localhost_files/application.js"></script>
<title></title>
</head>
<body><div>
<header>
<div id="nav-left"><a href="./localhost_files/localhost.html">bitly</a></div>
<div id="nav-right">
<a href="./localhost_files/localhost.html">Sign In </a>
<a href="./localhost_files/localhost.html">Sign Up </a>
</div>
</header>
<div class="background">
<!-- <h1>Hello World</h1>
<p>See Me in views/static/index.html.erb</p>
-->
<div class="alterurl">
<form action="http://localhost:9393/urls" method="post">
Enter URL:
<input type="text" id="box" name="long_url">
<input type="submit" value="Submit">
</form>
</div>
<div class="alterurl">
<h1 class="blue">
*****UNLEASH THE POWER OF THE PINK*****
</h1>
</div>
<div class="bigmargin"><a href="http://dictionary.reference.com/browse/pink">Click here if you want to know more about this website</a></div>
<!-- <form action="/:short_url" method="get">
Enter URL:
<input type="text" name="short_url">
<input type="submit" value="Submit">
</form> -->
<div class="bigmargin"><a href="http://www.businessinsider.my/hello-kitty-is-not-a-cat-2014-8/?r=US&IR=T">Click here for further information</a></div>
<div class="bigmargin"><a href="./localhost_files/localhost.html">Please see below for your shortened link</a></div>
<footer>
<div class="biggermargin">
<p><a href="http://localhost:9393/rQmPm">http://localhost:9393/rQmPm</a></p>
<p>4</p>
<div id="nav-left">
<img src="./localhost_files/hellokitty.jpeg">
</div>
</div>
</footer>
</div>
</div>
</body></html>
|
{
"content_hash": "0e6525050042d5f687bbd1a9d1a46b1b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 154,
"avg_line_length": 30.545454545454547,
"alnum_prop": 0.6547619047619048,
"repo_name": "anyatan/bitly-clone",
"id": "564a67decd3fb433bc63ff465a1f026ffd2d74f5",
"size": "2352",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/css/localhost.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2118"
},
{
"name": "HTML",
"bytes": "4803"
},
{
"name": "JavaScript",
"bytes": "2048"
},
{
"name": "Ruby",
"bytes": "15574"
}
],
"symlink_target": ""
}
|
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/base_page.html">
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/webview_post_util.html">
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<dom-module id="provisioning-page">
<template>
<style include="iron-flex cr-hidden-style">
paper-spinner-lite {
height: 200px;
width: 200px;
}
#portalContainer {
height: 100%;
width: 100%;
}
#error-icon-container {
background-image: -webkit-image-set(
url(error_1x.png) 1x,
url(error_2x.png) 2x);
background-position: center center;
background-repeat: no-repeat;
height: 100%;
width: 100%;
}
</style>
<base-page title="[[getPageTitle_(
showError, carrierName_, hasCarrierPortalLoaded_)]]"
message="[[getPageMessage_(showError)]]">
<div slot="page-body" class="layout horizontal center-center">
<paper-spinner-lite active
hidden$="[[!shouldShowSpinner_(
showError, hasCarrierPortalLoaded_)]]">
</paper-spinner-lite>
<div id="portalContainer"
hidden$="[[!shouldShowPortal_(
showError, hasCarrierPortalLoaded_)]]">
</div>
<div id="error-icon-container" hidden$="[[!showError]]"></div>
</div>
</base-page>
</template>
<script src="provisioning_page.js"></script>
</dom-module>
|
{
"content_hash": "98e0298a5ec1fa8841a837ae1fd6c29a",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 106,
"avg_line_length": 38.4,
"alnum_prop": 0.6145833333333334,
"repo_name": "endlessm/chromium-browser",
"id": "43e2dcb035f30b26cd6b1766951c53041decb681",
"size": "1920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ui/webui/resources/cr_components/chromeos/cellular_setup/provisioning_page.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
using System.Web;
using System.Web.Mvc;
namespace ifcurso {
public class FilterConfig {
public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
filters.Add(new HandleErrorAttribute());
}
}
}
|
{
"content_hash": "b2dee42c95b3fee6a672b2c0313bf954",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 82,
"avg_line_length": 24.8,
"alnum_prop": 0.6814516129032258,
"repo_name": "ifsp-a6lp2/ifcursos",
"id": "57d7f3fee77a4959cdc92f7ec31dc80e5cb27fac",
"size": "250",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ifcurso/ifcurso/App_Start/FilterConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "98"
},
{
"name": "C#",
"bytes": "114757"
},
{
"name": "CSS",
"bytes": "114405"
},
{
"name": "HTML",
"bytes": "5127"
},
{
"name": "JavaScript",
"bytes": "407927"
}
],
"symlink_target": ""
}
|
export const SAVE_INSTAGRAM_TOKEN = 'SAVE_INSTAGRAM_TOKEN';
export const LOGIN = 'LOGIN';
export const ADD_HASHTAG = 'ADD_HASHTAG';
export const ADD_PEOPLE = 'ADD_PEOPLE';
export const ADD_USER = 'ADD_USER';
export const FETCH_USER_DATA = 'FETCH_USER_DATA';
export const SET_INFLUENCE_DATA = 'SET_INFLUENCE_DATA';
export const SET_PERFORMANCE_DATA = 'SET_PERFORMANCE_DATA';
|
{
"content_hash": "8342df8949bd6719f15c610008f3fae2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 59,
"avg_line_length": 25.4,
"alnum_prop": 0.7349081364829396,
"repo_name": "jmporchet/bravakin-client",
"id": "756a008cde3d37c674de569d776a9057df2346f0",
"size": "381",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/config/types.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2938"
},
{
"name": "HTML",
"bytes": "671"
},
{
"name": "JavaScript",
"bytes": "38174"
}
],
"symlink_target": ""
}
|
<component name="ProjectDictionaryState">
<dictionary name="vlad" />
</component>
|
{
"content_hash": "e90f6bd768c988f19f63d1be43ec6eec",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7469879518072289,
"repo_name": "tudordimitriu/elibrary",
"id": "477357ed44171648b8f3e4ae6019296299a8fd41",
"size": "83",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/dictionaries/vlad.xml",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "1042"
},
{
"name": "PHP",
"bytes": "10892"
},
{
"name": "Perl",
"bytes": "711"
},
{
"name": "Shell",
"bytes": "5"
}
],
"symlink_target": ""
}
|
#ifndef itkPreconditionedGradientDescentOptimizer_h
#define itkPreconditionedGradientDescentOptimizer_h
#include "itkScaledSingleValuedNonLinearOptimizer.h"
#include "itkArray2D.h"
#include <vnl/vnl_sparse_matrix.h>
#include "cholmod.h"
namespace itk
{
/** \class PreconditionedGradientDescentOptimizer
* \brief Implement a gradient descent optimizer
*
* PreconditionedGradientDescentOptimizer implements a simple gradient descent optimizer.
* At each iteration the current position is updated according to
*
* \f[
* p_{n+1} = p_n
* + \mbox{learningRate}
\, \frac{\partial f(p_n) }{\partial p_n}
* \f]
*
* The learning rate is a fixed scalar defined via SetLearningRate().
* The optimizer steps through a user defined number of iterations;
* no convergence checking is done.
*
* Additionally, user can scale each component of the \f$\partial f / \partial p\f$
* but setting a scaling vector using method SetScale().
*
* The difference of this class with the itk::GradientDescentOptimizer
* is that it's based on the ScaledSingleValuedNonLinearOptimizer
*
* \sa ScaledSingleValuedNonLinearOptimizer
*
* \ingroup Numerics Optimizers
*/
class PreconditionedGradientDescentOptimizer : public ScaledSingleValuedNonLinearOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(PreconditionedGradientDescentOptimizer);
/** Standard class typedefs. */
using Self = PreconditionedGradientDescentOptimizer;
using Superclass = ScaledSingleValuedNonLinearOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(PreconditionedGradientDescentOptimizer, ScaledSingleValuedNonLinearOptimizer);
/** Typedefs inherited from the superclass. */
using Superclass::MeasureType;
using Superclass::ParametersType;
using Superclass::DerivativeType;
using Superclass::CostFunctionType;
using Superclass::ScalesType;
using Superclass::ScaledCostFunctionType;
using Superclass::ScaledCostFunctionPointer;
/** Some typedefs for computing the SelfHessian */
using PreconditionValueType = DerivativeType::ValueType;
// typedef Array2D<PreconditionValueType> PreconditionType;
// typedef vnl_symmetric_eigensystem<
// PreconditionValueType > EigenSystemType;
using PreconditionType = vnl_sparse_matrix<PreconditionValueType>;
/** Codes of stopping conditions
* The MinimumStepSize stopcondition never occurs, but may
* be implemented in inheriting classes.
*/
enum StopConditionType
{
MaximumNumberOfIterations,
MetricError,
MinimumStepSize
};
/** Advance one step following the gradient direction. */
virtual void
AdvanceOneStep();
/** Start optimization. */
virtual void
StartOptimization();
/** Resume previously stopped optimization with current parameters
* \sa StopOptimization.
*/
virtual void
ResumeOptimization();
/** Stop optimization and pass on exception. */
virtual void
MetricErrorResponse(ExceptionObject & err);
/** Stop optimization.
* \sa ResumeOptimization */
virtual void
StopOptimization();
/** Set the learning rate. */
itkSetMacro(LearningRate, double);
/** Get the learning rate. */
itkGetConstReferenceMacro(LearningRate, double);
/** Set the number of iterations. */
itkSetMacro(NumberOfIterations, unsigned long);
/** Get the number of iterations. */
itkGetConstReferenceMacro(NumberOfIterations, unsigned long);
/** Get the current iteration number. */
itkGetConstMacro(CurrentIteration, unsigned int);
/** Get the current value. */
itkGetConstReferenceMacro(Value, double);
/** Get Stop condition. */
itkGetConstReferenceMacro(StopCondition, StopConditionType);
/** Get current gradient. */
itkGetConstReferenceMacro(Gradient, DerivativeType);
/** Get current search direction */
itkGetConstReferenceMacro(SearchDirection, DerivativeType);
/** Set the preconditioning matrix, whose inverse actually will be used to precondition.
* On setting the precondition matrix, an eigensystem is computed immediately, the
* eigenvalues/vectors are modified and only the modified eigenvectors/values are stored
* (in the EigenSystem).
* NB: this function destroys the input matrix, to save memory.
*/
virtual void
SetPreconditionMatrix(PreconditionType & precondition);
/** Temporary functions, for debugging */
const cholmod_common *
GetCholmodCommon() const
{
return this->m_CholmodCommon;
}
const cholmod_factor *
GetCholmodFactor() const
{
return this->m_CholmodFactor;
}
/** P = P + diagonalWeight * max(eigenvalue) * Identity */
itkSetMacro(DiagonalWeight, double);
itkGetConstMacro(DiagonalWeight, double);
/** Threshold for elements of cost function derivative; default 1e-10 */
itkSetMacro(MinimumGradientElementMagnitude, double);
itkGetConstMacro(MinimumGradientElementMagnitude, double);
/** Get estimated condition number; only valid after calling
* SetPreconditionMatrix */
itkGetConstMacro(ConditionNumber, double);
/** Get largestEigenValue; only valid after calling
* SetPreconditionMatrix */
itkGetConstMacro(LargestEigenValue, double);
/** Get sparsity of selfhessian; only valid after calling
* SetPreconditionMatrix; Takes into account that only upper half
* of the matrix is stored. 1 = dense, 0 = all elements zero.
*/
itkGetConstMacro(Sparsity, double);
protected:
PreconditionedGradientDescentOptimizer();
virtual ~PreconditionedGradientDescentOptimizer();
void
PrintSelf(std::ostream & os, Indent indent) const;
/** Cholmod index type: define at central place */
using cholmod_l = int CInt; // change to UF_long if using;
// made protected so subclass can access
DerivativeType m_Gradient;
double m_LearningRate{ 1.0 };
StopConditionType m_StopCondition{ MaximumNumberOfIterations };
DerivativeType m_SearchDirection;
double m_LargestEigenValue{ 1.0 };
double m_ConditionNumber{ 1.0 };
double m_Sparsity{ 1.0 };
cholmod_common * m_CholmodCommon;
cholmod_factor * m_CholmodFactor{ nullptr };
cholmod_sparse * m_CholmodGradient{ nullptr };
/** Solve Hx = g, using the Cholesky decomposition of the preconditioner.
* Matlab notation: x = L'\(L\g) = Pg = searchDirection
* The last argument can be used to also solve different systems, like L x = g.
*/
virtual void
CholmodSolve(const DerivativeType & gradient, DerivativeType & searchDirection, int solveType = CHOLMOD_A);
private:
bool m_Stop{ false };
double m_Value{ 0.0 };
unsigned long m_NumberOfIterations{ 100 };
unsigned long m_CurrentIteration{ 0 };
double m_DiagonalWeight{ 1e-6 };
double m_MinimumGradientElementMagnitude{ 1e-10 };
};
} // end namespace itk
#endif
|
{
"content_hash": "7ff3f346fd260b1be4045313ca940a9f",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 109,
"avg_line_length": 31.51801801801802,
"alnum_prop": 0.7353151350578819,
"repo_name": "SuperElastix/elastix",
"id": "e2338a80437fee6d6266c091d188bda6b0ddd7a8",
"size": "7772",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "Components/Optimizers/PreconditionedGradientDescent/itkPreconditionedGradientDescentOptimizer.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2993"
},
{
"name": "C",
"bytes": "176566"
},
{
"name": "C++",
"bytes": "7608507"
},
{
"name": "CMake",
"bytes": "241010"
},
{
"name": "CSS",
"bytes": "7791"
},
{
"name": "Dockerfile",
"bytes": "463"
},
{
"name": "HTML",
"bytes": "2448"
},
{
"name": "Python",
"bytes": "56415"
},
{
"name": "Shell",
"bytes": "11998"
},
{
"name": "TeX",
"bytes": "22075"
}
],
"symlink_target": ""
}
|
<?php
namespace PhpOffice\PhpSpreadsheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
class RowCellIterator extends CellIterator
{
/**
* Current iterator position.
*
* @var int
*/
private $currentColumnIndex;
/**
* Row index.
*
* @var int
*/
private $rowIndex = 1;
/**
* Start position.
*
* @var int
*/
private $startColumnIndex = 1;
/**
* End position.
*
* @var int
*/
private $endColumnIndex = 1;
/**
* Create a new column iterator.
*
* @param Worksheet $worksheet The worksheet to iterate over
* @param int $rowIndex The row that we want to iterate
* @param string $startColumn The column address at which to start iterating
* @param string $endColumn Optionally, the column address at which to stop iterating
*/
public function __construct(Worksheet $worksheet = null, $rowIndex = 1, $startColumn = 'A', $endColumn = null)
{
// Set subject and row index
$this->worksheet = $worksheet;
$this->rowIndex = $rowIndex;
$this->resetEnd($endColumn);
$this->resetStart($startColumn);
}
/**
* (Re)Set the start column and the current column pointer.
*
* @param string $startColumn The column address at which to start iterating
*
* @throws PhpSpreadsheetException
*
* @return RowCellIterator
*/
public function resetStart($startColumn = 'A')
{
$this->startColumnIndex = Coordinate::columnIndexFromString($startColumn);
$this->adjustForExistingOnlyRange();
$this->seek(Coordinate::stringFromColumnIndex($this->startColumnIndex));
return $this;
}
/**
* (Re)Set the end column.
*
* @param string $endColumn The column address at which to stop iterating
*
* @throws PhpSpreadsheetException
*
* @return RowCellIterator
*/
public function resetEnd($endColumn = null)
{
$endColumn = $endColumn ? $endColumn : $this->worksheet->getHighestColumn();
$this->endColumnIndex = Coordinate::columnIndexFromString($endColumn);
$this->adjustForExistingOnlyRange();
return $this;
}
/**
* Set the column pointer to the selected column.
*
* @param string $column The column address to set the current pointer at
*
* @throws PhpSpreadsheetException
*
* @return RowCellIterator
*/
public function seek($column = 'A')
{
$column = Coordinate::columnIndexFromString($column);
if (($column < $this->startColumnIndex) || ($column > $this->endColumnIndex)) {
throw new PhpSpreadsheetException("Column $column is out of range ({$this->startColumnIndex} - {$this->endColumnIndex})");
} else if ($this->onlyExistingCells && !($this->worksheet->cellExistsByColumnAndRow($column, $this->rowIndex))) {
throw new PhpSpreadsheetException('In "IterateOnlyExistingCells" mode and Cell does not exist');
}
$this->currentColumnIndex = $column;
return $this;
}
/**
* Rewind the iterator to the starting column.
*/
public function rewind()
{
$this->currentColumnIndex = $this->startColumnIndex;
}
/**
* Return the current cell in this worksheet row.
*
* @return \PhpOffice\PhpSpreadsheet\Cell\Cell
*/
public function current()
{
return $this->worksheet->getCellByColumnAndRow($this->currentColumnIndex, $this->rowIndex);
}
/**
* Return the current iterator key.
*
* @return string
*/
public function key()
{
return Coordinate::stringFromColumnIndex($this->currentColumnIndex);
}
/**
* Set the iterator to its next value.
*/
public function next()
{
do {
++$this->currentColumnIndex;
} while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex <= $this->endColumnIndex));
}
/**
* Set the iterator to its previous value.
*
* @throws PhpSpreadsheetException
*/
public function prev()
{
if ($this->currentColumnIndex <= $this->startColumnIndex) {
throw new PhpSpreadsheetException('Column is already at the beginning of range (' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ' - ' . Coordinate::stringFromColumnIndex($this->endColumnIndex) . ')');
}
do {
--$this->currentColumnIndex;
} while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex >= $this->startColumnIndex));
}
/**
* Indicate if more columns exist in the worksheet range of columns that we're iterating.
*
* @return bool
*/
public function valid()
{
return $this->currentColumnIndex <= $this->endColumnIndex;
}
/**
* Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
*
* @throws PhpSpreadsheetException
*/
protected function adjustForExistingOnlyRange()
{
if ($this->onlyExistingCells) {
while ((!$this->worksheet->cellExistsByColumnAndRow($this->startColumnIndex, $this->rowIndex)) && ($this->startColumnIndex <= $this->endColumnIndex)) {
++$this->startColumnIndex;
}
if ($this->startColumnIndex > $this->endColumnIndex) {
throw new PhpSpreadsheetException('No cells exist within the specified range');
}
while ((!$this->worksheet->cellExistsByColumnAndRow($this->endColumnIndex, $this->rowIndex)) && ($this->endColumnIndex >= $this->startColumnIndex)) {
--$this->endColumnIndex;
}
if ($this->endColumnIndex < $this->startColumnIndex) {
throw new PhpSpreadsheetException('No cells exist within the specified range');
}
}
}
}
|
{
"content_hash": "c2309d32971f1a044b1e0132f59aac39",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 227,
"avg_line_length": 31.41919191919192,
"alnum_prop": 0.6158173927021379,
"repo_name": "manhnam91/hmcms",
"id": "0e7b01a33409b51dc4ac333e820c46b306b2a982",
"size": "6221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hm_vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "569437"
},
{
"name": "Dockerfile",
"bytes": "273"
},
{
"name": "HTML",
"bytes": "213"
},
{
"name": "Hack",
"bytes": "4102"
},
{
"name": "JavaScript",
"bytes": "1465519"
},
{
"name": "PHP",
"bytes": "3017506"
},
{
"name": "XSLT",
"bytes": "2813"
}
],
"symlink_target": ""
}
|
import React, { PropTypes, Component } from 'react';
import AssetIndexRow from './AssetIndexRow';
export default class AssetIndexTable extends Component {
static propTypes = {
headers: PropTypes.array.isRequired,
durations: PropTypes.array.isRequired,
};
render() {
const { headers, durations } = this.props;
return (
<table>
<thead>
<tr>
<th></th>
{headers.map((type, idx) =>
<th key={idx}>{type}</th>
)}
</tr>
</thead>
<tbody>
{durations.map((duration, idx) =>
<AssetIndexRow
key={idx}
assetName={duration[0]}
times={duration.slice(1)}
/>
)}
</tbody>
</table>
);
}
}
|
{
"content_hash": "7220d70bc8953affa161d3e3137f5d27",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 56,
"avg_line_length": 28.583333333333332,
"alnum_prop": 0.38095238095238093,
"repo_name": "qingweibinary/binary-next-gen",
"id": "a9c918fa9a28a3fd0f65f0d6b6cead18dc9940b9",
"size": "1029",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/asset-index/AssetIndexTable.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15094"
},
{
"name": "HTML",
"bytes": "1823"
},
{
"name": "JavaScript",
"bytes": "625934"
},
{
"name": "Shell",
"bytes": "270"
}
],
"symlink_target": ""
}
|
/**
* @file my_client.c
* @author karl leplat
* @date 2009/07/01
*/
#include <assert.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include "vlib.h"
#include "app.h"
/* Video constant */
#define VIDEO_PORT 5555
#define RAW_CAPTURE_PORT 5557
#define H_ACQ_WIDTH VIDEO_WIDTH
#define H_ACQ_HEIGHT VIDEO_HEIGHT
#define VIDEO_BUFFER_SIZE (2*(VIDEO_WIDTH)*(VIDEO_HEIGHT))
#define DATA_RECEIVED_MAX_SIZE 8192
static video_controller_t controller;
static vp_api_picture_t picture;
static int pictureBpp;
// note: allocate twice the size of an image
uint16_t picture_buf[VIDEO_BUFFER_SIZE];
int num_picture_decoded = 0;
void stream_init(void)
{
C_RESULT status;
memset(&controller, 0, sizeof(controller));
memset(&picture, 0, sizeof(picture));
memset(picture_buf, 0, sizeof(picture_buf));
pictureBpp = 2;
/// Picture configuration
picture.format = PIX_FMT_RGB565;
picture.width = H_ACQ_WIDTH;
picture.height = H_ACQ_HEIGHT;
picture.framerate = 15;
picture.y_line_size = picture.width * pictureBpp;
picture.cb_line_size = 0;
picture.cr_line_size = 0;
picture.y_buf = (uint8_t *)picture_buf;
picture.cb_buf = NULL;
picture.cr_buf = NULL;
status = video_codec_open( &controller, UVLC_CODEC );
if (status) {
INFO("video_codec_open() failed\n");
}
video_controller_set_motion_estimation(&controller, FALSE);
video_controller_set_format( &controller, H_ACQ_WIDTH, H_ACQ_HEIGHT );
}
void stream_deinit(void)
{
video_codec_close(&controller);
}
static int video_udp_socket = -1;
void video_write (int8_t *buffer, int32_t len)
{
struct sockaddr_in to;
int32_t flags;
if( video_udp_socket < 0 )
{
struct sockaddr_in video_udp_addr;
memset( (char*)&video_udp_addr, 0, sizeof(video_udp_addr) );
video_udp_addr.sin_family = AF_INET;
video_udp_addr.sin_addr.s_addr = INADDR_ANY;
video_udp_addr.sin_port = htons( VIDEO_PORT + 100 );
video_udp_socket = socket( AF_INET, SOCK_DGRAM, 0 );
if( video_udp_socket > 0 )
{
flags = fcntl(video_udp_socket, F_GETFL, 0);
if( flags >= 0 )
{
flags |= O_NONBLOCK;
flags = fcntl(video_udp_socket, F_SETFL, flags );
}
else
{
INFO("Get Socket Options failed\n");
}
bind(video_udp_socket, (struct sockaddr*)&video_udp_addr, sizeof(struct sockaddr) );
}
}
if( video_udp_socket > 0 )
{
int res;
memset( (char*)&to, 0, sizeof(to) );
to.sin_family = AF_INET;
to.sin_addr.s_addr = inet_addr(WIFI_MYKONOS_IP); // BROADCAST address for subnet 192.168.1.xxx
to.sin_port = htons (VIDEO_PORT);
res = sendto( video_udp_socket, (char*)buffer, len, 0, (struct sockaddr*)&to, sizeof(to) );
}
}
DEFINE_THREAD_ROUTINE( stream_loop, data )
{
C_RESULT status;
int sockfd, addr_in_size;
struct sockaddr_in *my_addr, *from;
INFO("VIDEO stream thread starting (thread=%d)...\n", (int)pthread_self());
stream_init();
addr_in_size = sizeof(struct sockaddr_in);
from = (struct sockaddr_in *)malloc(addr_in_size);
my_addr = (struct sockaddr_in *)malloc(addr_in_size);
assert(from);
assert(my_addr);
memset((char *)my_addr,(char)0,addr_in_size);
my_addr->sin_family = AF_INET;
my_addr->sin_addr.s_addr = htonl(INADDR_ANY);
my_addr->sin_port = htons( VIDEO_PORT );
if((sockfd = socket (AF_INET, SOCK_DGRAM, 0)) < 0){
INFO ("socket: %s\n", strerror(errno));
goto fail;
};
if (bind(sockfd, (struct sockaddr *)my_addr, addr_in_size) < 0){
INFO ("bind: %s\n", strerror(errno));
goto fail;
};
{
struct timeval tv;
// 1 second timeout
tv.tv_sec = 1;
tv.tv_usec = 0;
setsockopt( sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
}
INFO("Ready to receive video data...\n");
{
int32_t one = 1;
video_write ((int8_t*)&one, sizeof( one ));
}
while(gAppAlive)
{
int size;
size = recvfrom (sockfd,
video_controller_get_stream_ptr(&controller),
DATA_RECEIVED_MAX_SIZE, 0, (struct sockaddr *)from,
(socklen_t*)&addr_in_size);
if (size == 0)
{
INFO ("Lost connection \n");
int32_t one = 1;
video_write ((int8_t*)&one, sizeof(one));
}
else if (size > 0) {
int decodeOK = FALSE;
controller.in_stream.used = size;
controller.in_stream.size = size;
controller.in_stream.index = 0;
controller.in_stream.length = 32;
controller.in_stream.code = 0;
//INFO("decode_blockline(size=%d)\n", size);
status = video_decode_blockline(&controller, &picture, &decodeOK);
if (status) {
INFO("video_decode_blockline() failed\n");
}
else if (decodeOK) {
// this is ugly: update counter and notify video renderer
num_picture_decoded = controller.num_frames;
//INFO("num_picture_decoded = %d\n", num_picture_decoded);
}
}
}
fail:
free(from);
free(my_addr);
if (sockfd >= 0){
close(sockfd);
sockfd = -1;
}
INFO("VIDEO stream thread stopping\n");
stream_deinit();
return NULL;
}
|
{
"content_hash": "5478b3e361a61d6b95dc708ffbc8d2ba",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 98,
"avg_line_length": 24.325892857142858,
"alnum_prop": 0.6151587447238025,
"repo_name": "feross/oculus-drone",
"id": "6dbdfde04a8df14af3fa1cee99ff16c902b7e03b",
"size": "5449",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "drone-sdk/Examples/Multiplatform/Protocol/stream.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "1657837"
},
{
"name": "C",
"bytes": "31483064"
},
{
"name": "C++",
"bytes": "2615531"
},
{
"name": "CSS",
"bytes": "55313"
},
{
"name": "D",
"bytes": "104239"
},
{
"name": "Java",
"bytes": "10351"
},
{
"name": "JavaScript",
"bytes": "63907"
},
{
"name": "Objective-C",
"bytes": "325163"
},
{
"name": "Perl",
"bytes": "22218"
},
{
"name": "Python",
"bytes": "1995"
},
{
"name": "Shell",
"bytes": "58502"
},
{
"name": "Verilog",
"bytes": "2853"
}
],
"symlink_target": ""
}
|
package model
import (
"reflect"
)
type Validator interface {
// Validate returns an error if metaData is not valid.
// In case of multiple errors errs.ErrSlice is returned.
Validate(metaData *MetaData) error
}
var ValidatorType = reflect.TypeOf((*Validator)(nil)).Elem()
func IsValidator(v reflect.Value) bool {
return v.Type().Implements(ValidatorType) || (v.CanAddr() && v.Addr().Type().Implements(ValidatorType))
}
|
{
"content_hash": "38f334ca1151cb443a17fa0b66797f6b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 104,
"avg_line_length": 25.176470588235293,
"alnum_prop": 0.7313084112149533,
"repo_name": "ungerik/go-start",
"id": "120455d3f90621971c43ed8df08ebf45caffaddc",
"size": "428",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "model/validator.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15544"
},
{
"name": "Go",
"bytes": "603394"
},
{
"name": "HTML",
"bytes": "8137"
},
{
"name": "JavaScript",
"bytes": "61410"
}
],
"symlink_target": ""
}
|
import netCDF4
import memoize as memo
import numpy as np
import trigrid
import pytz
class FvcomNC(object):
tz='US/Eastern'
tzvalue='-0500'
def __init__(self,nc_file,**kwargs):
self.nc_file = nc_file
self.nc=netCDF4.Dataset(self.nc_file)
self.__dict__.update(kwargs)
# pickle protocol interface - since Dataset cannot be pickled.
def __getstate__(self):
d = dict(self.__dict__)
del d['nc']
return d
def __setstate__(self,d):
self.__dict__.update(d)
self.nc=netCDF4.Dataset(self.nc_file)
@property
@memo.memoize()
def time(self):
nc_t_var=self.nc.variables['time']
units,origin = nc_t_var.units.split(" since ")
if origin[-1] in '0123456789':
origin = origin + self.tzvalue
tzero = np.datetime64(origin,'s')
days=self.nc.variables['Itime'][:] * np.timedelta64(1,'D')
msecs=self.nc.variables['Itime2'][:]*np.timedelta64(1,'ms')
t=tzero+days+msecs
return t
@property
@memo.memoize()
def points(self):
return np.array( [self.nc.variables['x'][:],
self.nc.variables['y'][:]], dtype='f8' ).T
@property
@memo.memoize()
def centers(self):
return np.array( [self.nc.variables['xc'][:],
self.nc.variables['yc'][:]] ).T
@property
@memo.memoize()
def trigrid(self):
cells=self.nc.variables['nv'][:].T - 1
points=self.points.copy()
g=trigrid.TriGrid(points=points,cells=cells)
areas=g.areas()
sel=np.nonzero(areas<0)[0]
cells[sel,:] = cells[sel,::-1]
# make a clean one with the new cells
g=trigrid.TriGrid(points=points,cells=cells)
g.make_edges_from_cells()
return g
# convenience for getting cell centered mean quantities
@property
@memo.memoize()
def hc(self):
h=self.nc.variables['h'][:]
return h[self.trigrid.cells].mean(axis=1)
@memo.memoize(lru=2)
def zetac(self,tidx):
zeta=self.nc.variables['zeta'][tidx]
return zeta[self.trigrid.cells].mean(axis=1)
@memo.memoize(lru=2)
def uvw(self,tidx,c=slice(None),sigma_layer=slice(None)):
u=self.nc.variables['u'][tidx,sigma_layer,c]
v=self.nc.variables['v'][tidx,sigma_layer,c]
w=self.nc.variables['ww'][tidx,sigma_layer,c]
return np.concatenate( (u[...,None],v[...,None],w[...,None]), axis=-1 )
@memo.memoize(lru=2)
def to_sigma_layer(self,tidx,c,X):
""" 0-based sigma layer index
"""
z=X[2]
h=self.hc[c]
zeta=self.zetac(tidx)[c]
# [-1,0]
sigma=(z-(-h))/(zeta-(-h)) - 1
siglevels=self.nc.variables['siglev'][:,self.trigrid.cells[c]].mean(axis=1)
layer=np.searchsorted(-siglevels,-sigma).clip(0,len(siglevels)-2)
return layer
|
{
"content_hash": "4408afbc00d268b5bb0242abafd6dc7a",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 83,
"avg_line_length": 30.770833333333332,
"alnum_prop": 0.5622884224779959,
"repo_name": "rustychris/stompy",
"id": "5fce3bb3432112915dfadeae3450b4d99c4a4ff8",
"size": "2954",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "stompy/model/fvcom/fvcom.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Fortran",
"bytes": "89942"
},
{
"name": "Makefile",
"bytes": "62"
},
{
"name": "Python",
"bytes": "4305617"
},
{
"name": "Shell",
"bytes": "241"
}
],
"symlink_target": ""
}
|
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.engine.impl.cmd;
import java.io.Serializable;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.identitylink.api.IdentityLinkType;
/**
* Command to set a new assignee on a process instance and return the previous one, if any.
*
* @author Micha Kiener
*/
public class SetProcessInstanceAssigneeCmd extends AbstractProcessInstanceIdentityLinkCmd implements Command<Void>, Serializable {
private static final long serialVersionUID = 1L;
protected final String processInstanceId;
protected final String assigneeUserId;
public SetProcessInstanceAssigneeCmd(String processInstanceId, String assigneeUserId) {
this.processInstanceId = processInstanceId;
this.assigneeUserId = assigneeUserId;
}
@Override
public Void execute(CommandContext commandContext) {
// remove ALL assignee identity links (there should only be one of course)
removeIdentityLinkType(commandContext, processInstanceId, IdentityLinkType.ASSIGNEE);
// now add the new one, but only, if it is not null, which means using the setAssignee with a null value results in the same
// as removeAssignee
createIdentityLinkType(commandContext, processInstanceId, assigneeUserId, null, IdentityLinkType.ASSIGNEE);
return null;
}
}
|
{
"content_hash": "2cfb4d0946b03d1db465055c6c095343",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 132,
"avg_line_length": 41.851063829787236,
"alnum_prop": 0.7600406710726996,
"repo_name": "dbmalkovsky/flowable-engine",
"id": "64a02516214f729e21ee75a384c3d624401f6e55",
"size": "1967",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SetProcessInstanceAssigneeCmd.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "166"
},
{
"name": "CSS",
"bytes": "673786"
},
{
"name": "Dockerfile",
"bytes": "477"
},
{
"name": "Groovy",
"bytes": "482"
},
{
"name": "HTML",
"bytes": "1201811"
},
{
"name": "Handlebars",
"bytes": "6004"
},
{
"name": "Java",
"bytes": "46660725"
},
{
"name": "JavaScript",
"bytes": "12668702"
},
{
"name": "Mustache",
"bytes": "2383"
},
{
"name": "PLSQL",
"bytes": "268970"
},
{
"name": "SQLPL",
"bytes": "238673"
},
{
"name": "Shell",
"bytes": "12773"
},
{
"name": "TSQL",
"bytes": "19452"
}
],
"symlink_target": ""
}
|
go-stdiolog
===========
Passively log the stdio for a process.
[](https://github.com/dstokes/go-stdiolog/releases)
[](https://travis-ci.org/dstokes/go-stdiolog)
usage
=====
Write stdio of child proccess to log files while preserving terminal stdio.
```shell
$ go-stdiolog -o stdout.log -e stderr.log -- foo -a bar
```
Pass stdin to child proccess.
```shell
$ echo ohai | go-stdiolog -o stdout.log -- cat
```
install
=======
```shell
$ go get github.com/dstokes/go-stdiolog
```
Make sure your `PATH` includes your `GOPATH` bin directory:
```shell
export PATH=$PATH:$GOPATH/bin
```
|
{
"content_hash": "d29199fd18ef73855d71c3c56d69eb72",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 130,
"avg_line_length": 21.5,
"alnum_prop": 0.6963064295485636,
"repo_name": "dstokes/go-stdiolog",
"id": "9bd698d25999c407164683a73f22de2cb7e74da6",
"size": "731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "4793"
},
{
"name": "Makefile",
"bytes": "1019"
}
],
"symlink_target": ""
}
|
Who are we
###################
Students of the Belfort's IUT in computer science :
Mathieu POURCHOT,
Jehan MILLERET
*******************
What's the project
*******************
This repo contains in-development code for future releases.
Final release will be a complete market for GPU
**************************
Changelog and New Features
**************************
V1.00 : Strong bases, basket release
*******************
Server Requirements
*******************
PHP version 5.4 or newer is recommended.
It should work on 5.2.4 as well, but we strongly advise you NOT to run
such old versions of PHP, because of potential security and performance
issues, as well as missing features.
|
{
"content_hash": "fa5fd97de4f164f3c312b13f63e7975a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 23.033333333333335,
"alnum_prop": 0.613603473227207,
"repo_name": "kariamoss/ProjetPhpS3",
"id": "dabe0efa575d03ffee5f40ec19615d6711181d16",
"size": "711",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "readme.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "16661"
},
{
"name": "HTML",
"bytes": "8099160"
},
{
"name": "JavaScript",
"bytes": "56182"
},
{
"name": "PHP",
"bytes": "1815096"
}
],
"symlink_target": ""
}
|
module NotPOM
class HomePage
include Calabash::Cucumber::Operations
def my_buggy_method
screenshot_and_raise 'Hey!'
end
end
end
|
{
"content_hash": "382b2b7750e782523d35537da0dcbcd5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 42,
"avg_line_length": 15.2,
"alnum_prop": 0.6842105263157895,
"repo_name": "calabash/ios-smoke-test-app",
"id": "2b8d469672e125590ae6999effa37b6f109f2d5d",
"size": "152",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CalSmokeApp/features/step_definitions/models/not-pom/home_page.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "31019"
},
{
"name": "GLSL",
"bytes": "553"
},
{
"name": "Gherkin",
"bytes": "26401"
},
{
"name": "Makefile",
"bytes": "2378"
},
{
"name": "Objective-C",
"bytes": "289035"
},
{
"name": "Ruby",
"bytes": "113172"
},
{
"name": "Shell",
"bytes": "30971"
}
],
"symlink_target": ""
}
|
{-# LANGUAGE OverloadedStrings #-}
module Network.WebSockets.Connection
( PendingConnection (..)
, acceptRequest
, AcceptRequest(..)
, defaultAcceptRequest
, acceptRequestWith
, rejectRequest
, RejectRequest(..)
, defaultRejectRequest
, rejectRequestWith
, Connection (..)
, ConnectionOptions (..)
, defaultConnectionOptions
, receive
, receiveDataMessage
, receiveData
, send
, sendDataMessage
, sendDataMessages
, sendTextData
, sendTextDatas
, sendBinaryData
, sendBinaryDatas
, sendClose
, sendCloseCode
, sendPing
, withPingThread
, forkPingThread
, pingThread
, CompressionOptions (..)
, PermessageDeflate (..)
, defaultPermessageDeflate
, SizeLimit (..)
) where
--------------------------------------------------------------------------------
import Control.Applicative ((<$>))
import Control.Concurrent (forkIO,
threadDelay)
import qualified Control.Concurrent.Async as Async
import Control.Exception (AsyncException,
fromException,
handle,
throwIO)
import Control.Monad (foldM, unless,
when)
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as Builder
import qualified Data.ByteString.Char8 as B8
import Data.IORef (IORef,
newIORef,
readIORef,
writeIORef)
import Data.List (find)
import Data.Maybe (catMaybes)
import qualified Data.Text as T
import Data.Word (Word16)
import Prelude
--------------------------------------------------------------------------------
import Network.WebSockets.Connection.Options
import Network.WebSockets.Extensions as Extensions
import Network.WebSockets.Extensions.PermessageDeflate
import Network.WebSockets.Extensions.StrictUnicode
import Network.WebSockets.Http
import Network.WebSockets.Protocol
import Network.WebSockets.Stream (Stream)
import qualified Network.WebSockets.Stream as Stream
import Network.WebSockets.Types
--------------------------------------------------------------------------------
-- | A new client connected to the server. We haven't accepted the connection
-- yet, though.
data PendingConnection = PendingConnection
{ pendingOptions :: !ConnectionOptions
-- ^ Options, passed as-is to the 'Connection'
, pendingRequest :: !RequestHead
-- ^ Useful for e.g. inspecting the request path.
, pendingOnAccept :: !(Connection -> IO ())
-- ^ One-shot callback fired when a connection is accepted, i.e., *after*
-- the accepting response is sent to the client.
, pendingStream :: !Stream
-- ^ Input/output stream
}
--------------------------------------------------------------------------------
-- | This datatype allows you to set options for 'acceptRequestWith'. It is
-- strongly recommended to use 'defaultAcceptRequest' and then modify the
-- various fields, that way new fields introduced in the library do not break
-- your code.
data AcceptRequest = AcceptRequest
{ acceptSubprotocol :: !(Maybe B.ByteString)
-- ^ The subprotocol to speak with the client. If 'pendingSubprotcols' is
-- non-empty, 'acceptSubprotocol' must be one of the subprotocols from the
-- list.
, acceptHeaders :: !Headers
-- ^ Extra headers to send with the response.
}
--------------------------------------------------------------------------------
defaultAcceptRequest :: AcceptRequest
defaultAcceptRequest = AcceptRequest Nothing []
--------------------------------------------------------------------------------
-- | Utility
sendResponse :: PendingConnection -> Response -> IO ()
sendResponse pc rsp = Stream.write (pendingStream pc)
(Builder.toLazyByteString (encodeResponse rsp))
--------------------------------------------------------------------------------
-- | Accept a pending connection, turning it into a 'Connection'.
acceptRequest :: PendingConnection -> IO Connection
acceptRequest pc = acceptRequestWith pc defaultAcceptRequest
--------------------------------------------------------------------------------
-- | This function is like 'acceptRequest' but allows you to set custom options
-- using the 'AcceptRequest' datatype.
acceptRequestWith :: PendingConnection -> AcceptRequest -> IO Connection
acceptRequestWith pc ar = case find (flip compatible request) protocols of
Nothing -> do
sendResponse pc $ response400 versionHeader ""
throwIO NotSupported
Just protocol -> do
-- Get requested list of exceptions from client.
rqExts <- either throwIO return $
getRequestSecWebSocketExtensions request
-- Set up permessage-deflate extension if configured.
pmdExt <- case connectionCompressionOptions (pendingOptions pc) of
NoCompression -> return Nothing
PermessageDeflateCompression pmd0 ->
case negotiateDeflate (connectionMessageDataSizeLimit options) (Just pmd0) rqExts of
Left err -> do
rejectRequestWith pc defaultRejectRequest {rejectMessage = B8.pack err}
throwIO NotSupported
Right pmd1 -> return (Just pmd1)
-- Set up strict utf8 extension if configured.
let unicodeExt =
if connectionStrictUnicode (pendingOptions pc)
then Just strictUnicode else Nothing
-- Final extension list.
let exts = catMaybes [pmdExt, unicodeExt]
let subproto = maybe [] (\p -> [("Sec-WebSocket-Protocol", p)]) $ acceptSubprotocol ar
headers = subproto ++ acceptHeaders ar ++ concatMap extHeaders exts
response = finishRequest protocol request headers
either throwIO (sendResponse pc) response
parseRaw <- decodeMessages
protocol
(connectionFramePayloadSizeLimit options)
(connectionMessageDataSizeLimit options)
(pendingStream pc)
writeRaw <- encodeMessages protocol ServerConnection (pendingStream pc)
write <- foldM (\x ext -> extWrite ext x) writeRaw exts
parse <- foldM (\x ext -> extParse ext x) parseRaw exts
sentRef <- newIORef False
let connection = Connection
{ connectionOptions = options
, connectionType = ServerConnection
, connectionProtocol = protocol
, connectionParse = parse
, connectionWrite = write
, connectionSentClose = sentRef
}
pendingOnAccept pc connection
return connection
where
options = pendingOptions pc
request = pendingRequest pc
versionHeader = [("Sec-WebSocket-Version",
B.intercalate ", " $ concatMap headerVersions protocols)]
--------------------------------------------------------------------------------
-- | Parameters that allow you to tweak how a request is rejected. Please use
-- 'defaultRejectRequest' and modify fields using record syntax so your code
-- will not break when new fields are added.
data RejectRequest = RejectRequest
{ -- | The status code, 400 by default.
rejectCode :: !Int
, -- | The message, "Bad Request" by default
rejectMessage :: !B.ByteString
, -- | Extra headers to be sent with the response.
rejectHeaders :: Headers
, -- | Reponse body of the rejection.
rejectBody :: !B.ByteString
}
--------------------------------------------------------------------------------
defaultRejectRequest :: RejectRequest
defaultRejectRequest = RejectRequest
{ rejectCode = 400
, rejectMessage = "Bad Request"
, rejectHeaders = []
, rejectBody = ""
}
--------------------------------------------------------------------------------
rejectRequestWith
:: PendingConnection -- ^ Connection to reject
-> RejectRequest -- ^ Params on how to reject the request
-> IO ()
rejectRequestWith pc reject = sendResponse pc $ Response
ResponseHead
{ responseCode = rejectCode reject
, responseMessage = rejectMessage reject
, responseHeaders = rejectHeaders reject
}
(rejectBody reject)
--------------------------------------------------------------------------------
rejectRequest
:: PendingConnection -- ^ Connection to reject
-> B.ByteString -- ^ Rejection response body
-> IO ()
rejectRequest pc body = rejectRequestWith pc
defaultRejectRequest {rejectBody = body}
--------------------------------------------------------------------------------
data Connection = Connection
{ connectionOptions :: !ConnectionOptions
, connectionType :: !ConnectionType
, connectionProtocol :: !Protocol
, connectionParse :: !(IO (Maybe Message))
, connectionWrite :: !([Message] -> IO ())
, connectionSentClose :: !(IORef Bool)
-- ^ According to the RFC, both the client and the server MUST send
-- a close control message to each other. Either party can initiate
-- the first close message but then the other party must respond. Finally,
-- the server is in charge of closing the TCP connection. This IORef tracks
-- if we have sent a close message and are waiting for the peer to respond.
}
--------------------------------------------------------------------------------
receive :: Connection -> IO Message
receive conn = do
mbMsg <- connectionParse conn
case mbMsg of
Nothing -> throwIO ConnectionClosed
Just msg -> return msg
--------------------------------------------------------------------------------
-- | Receive an application message. Automatically respond to control messages.
--
-- When the peer sends a close control message, an exception of type 'CloseRequest'
-- is thrown. The peer can send a close control message either to initiate a
-- close or in response to a close message we have sent to the peer. In either
-- case the 'CloseRequest' exception will be thrown. The RFC specifies that
-- the server is responsible for closing the TCP connection, which should happen
-- after receiving the 'CloseRequest' exception from this function.
--
-- This will throw 'ConnectionClosed' if the TCP connection dies unexpectedly.
receiveDataMessage :: Connection -> IO DataMessage
receiveDataMessage conn = do
msg <- receive conn
case msg of
DataMessage _ _ _ am -> return am
ControlMessage cm -> case cm of
Close i closeMsg -> do
hasSentClose <- readIORef $ connectionSentClose conn
unless hasSentClose $ send conn msg
throwIO $ CloseRequest i closeMsg
Pong _ -> do
connectionOnPong (connectionOptions conn)
receiveDataMessage conn
Ping pl -> do
send conn (ControlMessage (Pong pl))
receiveDataMessage conn
--------------------------------------------------------------------------------
-- | Receive a message, converting it to whatever format is needed.
receiveData :: WebSocketsData a => Connection -> IO a
receiveData conn = fromDataMessage <$> receiveDataMessage conn
--------------------------------------------------------------------------------
send :: Connection -> Message -> IO ()
send conn = sendAll conn . return
--------------------------------------------------------------------------------
sendAll :: Connection -> [Message] -> IO ()
sendAll _ [] = return ()
sendAll conn msgs = do
when (any isCloseMessage msgs) $
writeIORef (connectionSentClose conn) True
connectionWrite conn msgs
where
isCloseMessage (ControlMessage (Close _ _)) = True
isCloseMessage _ = False
--------------------------------------------------------------------------------
-- | Send a 'DataMessage'. This allows you send both human-readable text and
-- binary data. This is a slightly more low-level interface than 'sendTextData'
-- or 'sendBinaryData'.
sendDataMessage :: Connection -> DataMessage -> IO ()
sendDataMessage conn = sendDataMessages conn . return
--------------------------------------------------------------------------------
-- | Send a collection of 'DataMessage's. This is more efficient than calling
-- 'sendDataMessage' many times.
sendDataMessages :: Connection -> [DataMessage] -> IO ()
sendDataMessages conn = sendAll conn . map (DataMessage False False False)
--------------------------------------------------------------------------------
-- | Send a textual message. The message will be encoded as UTF-8. This should
-- be the default choice for human-readable text-based protocols such as JSON.
sendTextData :: WebSocketsData a => Connection -> a -> IO ()
sendTextData conn = sendTextDatas conn . return
--------------------------------------------------------------------------------
-- | Send a number of textual messages. This is more efficient than calling
-- 'sendTextData' many times.
sendTextDatas :: WebSocketsData a => Connection -> [a] -> IO ()
sendTextDatas conn =
sendDataMessages conn .
map (\x -> Text (toLazyByteString x) Nothing)
--------------------------------------------------------------------------------
-- | Send a binary message. This is useful for sending binary blobs, e.g.
-- images, data encoded with MessagePack, images...
sendBinaryData :: WebSocketsData a => Connection -> a -> IO ()
sendBinaryData conn = sendBinaryDatas conn . return
--------------------------------------------------------------------------------
-- | Send a number of binary messages. This is more efficient than calling
-- 'sendBinaryData' many times.
sendBinaryDatas :: WebSocketsData a => Connection -> [a] -> IO ()
sendBinaryDatas conn = sendDataMessages conn . map (Binary . toLazyByteString)
--------------------------------------------------------------------------------
-- | Send a friendly close message. Note that after sending this message,
-- you should still continue calling 'receiveDataMessage' to process any
-- in-flight messages. The peer will eventually respond with a close control
-- message of its own which will cause 'receiveDataMessage' to throw the
-- 'CloseRequest' exception. This exception is when you can finally consider
-- the connection closed.
sendClose :: WebSocketsData a => Connection -> a -> IO ()
sendClose conn = sendCloseCode conn 1000
--------------------------------------------------------------------------------
-- | Send a friendly close message and close code. Similar to 'sendClose',
-- you should continue calling 'receiveDataMessage' until you receive a
-- 'CloseRequest' exception.
--
-- See <http://tools.ietf.org/html/rfc6455#section-7.4> for a list of close
-- codes.
sendCloseCode :: WebSocketsData a => Connection -> Word16 -> a -> IO ()
sendCloseCode conn code =
send conn . ControlMessage . Close code . toLazyByteString
--------------------------------------------------------------------------------
-- | Send a ping
sendPing :: WebSocketsData a => Connection -> a -> IO ()
sendPing conn = send conn . ControlMessage . Ping . toLazyByteString
--------------------------------------------------------------------------------
-- | Forks a ping thread, sending a ping message every @n@ seconds over the
-- connection. The thread is killed when the inner IO action is finished.
--
-- This is useful to keep idle connections open through proxies and whatnot.
-- Many (but not all) proxies have a 60 second default timeout, so based on that
-- sending a ping every 30 seconds is a good idea.
withPingThread
:: Connection
-> Int -- ^ Second interval in which pings should be sent.
-> IO () -- ^ Repeat this after sending a ping.
-> IO a -- ^ Application to wrap with a ping thread.
-> IO a -- ^ Executes application and kills ping thread when done.
withPingThread conn n action app =
Async.withAsync (pingThread conn n action) (\_ -> app)
--------------------------------------------------------------------------------
-- | DEPRECATED: Use 'withPingThread' instead.
--
-- Forks a ping thread, sending a ping message every @n@ seconds over the
-- connection. The thread dies silently if the connection crashes or is closed.
--
-- This is useful to keep idle connections open through proxies and whatnot.
-- Many (but not all) proxies have a 60 second default timeout, so based on that
-- sending a ping every 30 seconds is a good idea.
forkPingThread :: Connection -> Int -> IO ()
forkPingThread conn n = do
_ <- forkIO $ pingThread conn n (return ())
return ()
{-# DEPRECATED forkPingThread "Use 'withPingThread' instead" #-}
--------------------------------------------------------------------------------
-- | Use this if you want to run the ping thread yourself.
--
-- See also 'withPingThread'.
pingThread :: Connection -> Int -> IO () -> IO ()
pingThread conn n action
| n <= 0 = return ()
| otherwise = ignore `handle` go 1
where
go :: Int -> IO ()
go i = do
threadDelay (n * 1000 * 1000)
sendPing conn (T.pack $ show i)
action
go (i + 1)
ignore e = case fromException e of
Just async -> throwIO (async :: AsyncException)
Nothing -> return ()
|
{
"content_hash": "065c2454445d2288f838e939c647aaca",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 100,
"avg_line_length": 41.93863636363636,
"alnum_prop": 0.5493415704763454,
"repo_name": "jaspervdj/websockets",
"id": "9e8795162e21b4147e7cb8f19c3406366d2626ae",
"size": "18646",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Network/WebSockets/Connection.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "2417"
},
{
"name": "CSS",
"bytes": "3278"
},
{
"name": "HTML",
"bytes": "5045"
},
{
"name": "Haskell",
"bytes": "168496"
},
{
"name": "JavaScript",
"bytes": "6895"
},
{
"name": "Python",
"bytes": "2616"
},
{
"name": "Shell",
"bytes": "1391"
}
],
"symlink_target": ""
}
|
package org.openengsb.context;
import org.openengsb.core.OpenEngSBComponent;
/**
* @org.apache.xbean.XBean element="contextComponent"
* description="Context Component" The Context-component
*/
public class ContextComponent extends OpenEngSBComponent {
@Override
protected Class<?>[] getEndpointClasses() {
return new Class[] { ContextEndpoint.class };
}
}
|
{
"content_hash": "5d2af991ed2228c387c02145b89466de",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 25.6875,
"alnum_prop": 0.681265206812652,
"repo_name": "tobster/openengsb",
"id": "c5c128284738f70947a25db4d513a1bff934d42a",
"size": "1045",
"binary": false,
"copies": "1",
"ref": "refs/heads/github-issue-tracker",
"path": "core/context/service-engine/src/main/java/org/openengsb/context/ContextComponent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "34188"
},
{
"name": "Java",
"bytes": "1211114"
},
{
"name": "Perl",
"bytes": "39252"
},
{
"name": "Shell",
"bytes": "12303"
}
],
"symlink_target": ""
}
|
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'Stream (Default)' => '',
'Saved' => 'Desat',
];
|
{
"content_hash": "4862269ca5c2575f97fb0d148447051c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 33.86363636363637,
"alnum_prop": 0.7140939597315437,
"repo_name": "LeonidLyalin/vova",
"id": "8d8ca447920587806d2af44f092adaf98cd8e4f3",
"size": "745",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/humhub/protected/humhub/modules/space/messages/ca/controllers_AdminController.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "227"
},
{
"name": "Batchfile",
"bytes": "3096"
},
{
"name": "CSS",
"bytes": "824207"
},
{
"name": "HTML",
"bytes": "25309"
},
{
"name": "JavaScript",
"bytes": "1284304"
},
{
"name": "PHP",
"bytes": "8757729"
},
{
"name": "Ruby",
"bytes": "375"
},
{
"name": "Shell",
"bytes": "3256"
}
],
"symlink_target": ""
}
|
package org.mifos.accounts.financial.business.service.activity.accountingentry;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.mifos.accounts.business.AccountTrxnEntity;
import org.mifos.accounts.financial.business.COABO;
import org.mifos.accounts.financial.business.FinancialActionBO;
import org.mifos.accounts.financial.business.FinancialTransactionBO;
import org.mifos.accounts.financial.business.GLCodeEntity;
import org.mifos.accounts.financial.business.service.activity.BaseFinancialActivity;
import org.mifos.accounts.financial.exceptions.FinancialException;
import org.mifos.customers.personnel.business.PersonnelBO;
import org.mifos.framework.util.helpers.Money;
import org.mockito.ArgumentCaptor;
public class BaseAccountingEntryTestCase {
/**
* Return an iterator on the list of TransactionBO objects created by an AccountEntry object, sorted by GLCode
* string. First verify the correct number of transactions was created.
*
* @param mockedFinancialActivity
* a Mockito-mocked BaseFinancialActivity instance
* @param expectedTransCount
* the size of the created list of FinancialTransactionBO instances
*/
protected void executeBuildAccountingEntryForAction(BaseAccountingEntry accountingEntry,
BaseFinancialActivity financialActivity) throws FinancialException {
accountingEntry.buildAccountEntryForAction(financialActivity);
}
protected Iterator<FinancialTransactionBO> getIteratorOnSortedTransactions(
BaseFinancialActivity mockedFinancialActivity, int expectedTransCount) {
ArgumentCaptor<FinancialTransactionBO> transactionCaptor = ArgumentCaptor
.forClass(FinancialTransactionBO.class);
verify(mockedFinancialActivity, times(expectedTransCount)).addFinancialTransaction(transactionCaptor.capture());
List<FinancialTransactionBO> capturedTransactions = transactionCaptor.getAllValues();
/*
* Sort by GLCode strings so "1" (asset account) should be first, followed by "2" (client savings)
*/
Collections.sort(capturedTransactions, new GLCodeComparator());
return capturedTransactions.iterator();
}
protected void verifyCreatedFinancialTransaction(FinancialTransactionBO actualTransaction,
AccountTrxnEntity expectedAccountTrxn, FinancialTransactionBO expectedRelatedFinancialTrxn,
FinancialActionBO expectedFinancialAction, GLCodeEntity expectedGlcode, Date expectedActionDate,
PersonnelBO expectedPostedBy, Short expectedAccountingUpdated, Money expectedPostedAmount,
String expectedNotes, Short expectedDebitCreditFlag, Date expectedPostedDate) {
assertThat(actualTransaction.getAccountTrxn(), is(expectedAccountTrxn));
assertThat(actualTransaction.getRelatedFinancialTrxn(), is(expectedRelatedFinancialTrxn));
assertThat(actualTransaction.getFinancialAction(), is(expectedFinancialAction));
assertThat(actualTransaction.getGlcode(), is(expectedGlcode));
assertThat(actualTransaction.getActionDate(), is(expectedActionDate));
assertThat(actualTransaction.getPostedBy(), is(expectedPostedBy));
assertThat(actualTransaction.getAccountingUpdated(), is(expectedAccountingUpdated));
assertThat(actualTransaction.getPostedAmount(), is(expectedPostedAmount));
assertThat(actualTransaction.getNotes(), is(expectedNotes));
assertThat(actualTransaction.getDebitCreditFlag(), is(expectedDebitCreditFlag));
assertThat(actualTransaction.getPostedDate(), is(expectedPostedDate));
}
/**
* Compare FinancialTransactionBO objects lexicographically by GL Code string values. Use this to sort collections
* of transactions created by AccountingEntry objects to verify the transactions in order of gl codes.
*
*/
protected class GLCodeComparator implements Comparator<FinancialTransactionBO> {
public int compare(final FinancialTransactionBO tran1, final FinancialTransactionBO tran2) {
return tran1.getGlcode().getGlcode().compareTo(tran2.getGlcode().getGlcode());
}
}
/**
* Return Set containing just one account. Useful for mocking FinancialActionBO.getAssociatedChartOfAccounts()
*/
protected Set<COABO> setWith(COABO account) {
Set<COABO> chart = new HashSet<COABO>();
chart.add(account);
return chart;
}
}
|
{
"content_hash": "7c8c3e202c50d3ebef15a1b59eb40dd1",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 120,
"avg_line_length": 47.396039603960396,
"alnum_prop": 0.7654063087528724,
"repo_name": "mifos/1.5.x",
"id": "9705fb8fa1ab231c8dcb4a8a870bf565019a051a",
"size": "5548",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/src/test/java/org/mifos/accounts/financial/business/service/activity/accountingentry/BaseAccountingEntryTestCase.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "13572065"
},
{
"name": "JavaScript",
"bytes": "412518"
},
{
"name": "Python",
"bytes": "25486"
},
{
"name": "Shell",
"bytes": "18029"
}
],
"symlink_target": ""
}
|
class GURL;
namespace phantomium {
// An application which implements a simple headless browser.
class PhantomiumPage : public headless::HeadlessWebContents::Observer,
public headless::inspector::ExperimentalObserver,
public headless::page::ExperimentalObserver {
public:
PhantomiumPage();
~PhantomiumPage() override;
virtual void OnStart(HeadlessBrowser* browser);
HeadlessDevToolsClient* devtools_client() const {
return devtools_client_.get();
}
private:
// HeadlessWebContents::Observer implementation:
void DevToolsTargetReady() override;
void OnTargetCrashed(const inspector::TargetCrashedParams& params) override;
// page::Observer implementation:
void OnLoadEventFired(const page::LoadEventFiredParams& params) override;
// network::Observer implementation:
void OnRequestIntercepted(
const network::RequestInterceptedParams& params) override;
virtual void Shutdown();
void FetchTimeout();
void PollReadyState();
void OnReadyState(std::unique_ptr<runtime::EvaluateResult> result);
void OnPageReady();
void PrintToPDF();
void OnPDFCreated(std::unique_ptr<page::PrintToPDFResult> result);
void WriteFile(const std::string& switch_string,
const std::string& default_file_name,
const std::string& base64_data);
void OnFileOpened(const std::string& decoded_data,
const base::FilePath file_name,
base::File::Error error_code);
void OnFileWritten(const base::FilePath file_name,
const size_t length,
base::File::Error error_code,
int write_result);
void OnFileClosed(base::File::Error error_code);
bool RemoteDebuggingEnabled() const;
GURL url_;
HeadlessBrowser* browser_; // Not owned.
std::unique_ptr<HeadlessDevToolsClient> devtools_client_;
#if !defined(CHROME_MULTIPLE_DLL_CHILD)
HeadlessWebContents* web_contents_;
HeadlessBrowserContext* browser_context_;
#endif
bool processed_page_ready_;
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
std::unique_ptr<base::FileProxy> file_proxy_;
std::unique_ptr<DeterministicDispatcher> deterministic_dispatcher_;
base::WeakPtrFactory<HeadlessShell> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(HeadlessShell);
};
} // namespace phantomium
#endif // PHANTOMIUM_PAGE_H_
|
{
"content_hash": "f7673b8a91182fac05659d2dcc150a85",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 31.31168831168831,
"alnum_prop": 0.7055163832434674,
"repo_name": "Vitallium/phantomium",
"id": "206a0ee02524dfea8dbbd7d66539ecda10a66f31",
"size": "3309",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/page.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "21146"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bignums: 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.0 / bignums - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
bignums
<small>
8.8.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-22 22:32:24 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-22 22:32:24 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
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.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Laurent.Thery@inria.fr"
homepage: "https://github.com/coq/bignums"
dev-repo: "git+https://github.com/coq/bignums.git"
bug-reports: "https://github.com/coq/bignums/issues"
authors: [
"Laurent Théry"
"Benjamin Grégoire"
"Arnaud Spiwack"
"Evgeny Makarov"
"Pierre Letouzey"
]
license: "LGPL-2.1-only"
build: [
[make "-j%{jobs}%" {ocaml:version >= "4.06"}]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [
"keyword:integer numbers"
"keyword:rational numbers"
"keyword:arithmetic"
"keyword:arbitrary-precision"
"category:Miscellaneous/Coq Extensions"
"category:Mathematics/Arithmetic and Number Theory/Number theory"
"category:Mathematics/Arithmetic and Number Theory/Rational numbers"
"date:2017-06-15"
"logpath:Bignums"
]
synopsis: "Bignums, the Coq library of arbitrary large numbers"
description:
"Provides BigN, BigZ, BigQ that used to be part of Coq standard library < 8.7."
url {
src: "https://github.com/coq/bignums/archive/V8.8.0.tar.gz"
checksum: "md5=75b96617033250a41d064ea8da4febf8"
}
</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-bignums.8.8.0 coq.8.13.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0).
The following dependencies couldn't be met:
- coq-bignums -> coq < 8.9~ -> ocaml < 4.06.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-bignums.8.8.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://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "6319154417e01235fce0941daeddb689",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 159,
"avg_line_length": 39.62841530054645,
"alnum_prop": 0.5500551571980143,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "7da23dd9576beaf9d1aaa243ab743cf81b76713b",
"size": "7279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.13.0/bignums/8.8.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
package eu.modernmt.rest.actions.memory;
import eu.modernmt.data.DataManagerException;
import eu.modernmt.facade.ModernMT;
import eu.modernmt.io.FileProxy;
import eu.modernmt.lang.LanguagePair;
import eu.modernmt.model.ImportJob;
import eu.modernmt.model.corpus.MultilingualCorpus;
import eu.modernmt.model.corpus.impl.parallel.CompactFileCorpus;
import eu.modernmt.model.corpus.impl.parallel.ParallelFileCorpus;
import eu.modernmt.model.corpus.impl.tmx.TMXCorpus;
import eu.modernmt.persistence.PersistenceException;
import eu.modernmt.rest.framework.*;
import eu.modernmt.rest.framework.actions.ObjectAction;
import eu.modernmt.rest.framework.routing.Route;
import eu.modernmt.rest.framework.routing.TemplateException;
import java.io.File;
import java.util.Locale;
/**
* Created by davide on 15/12/15.
*/
@Route(aliases = {"memories/:id/corpus", "domains/:id/corpus"}, method = HttpMethod.POST)
public class AddToMemoryCorpus extends ObjectAction<ImportJob> {
@Override
protected ImportJob execute(RESTRequest req, Parameters _params) throws DataManagerException, PersistenceException {
Params params = (Params) _params;
if (params.corpus == null)
return ModernMT.memory.add(params.direction, params.memory, params.source, params.target);
else
return ModernMT.memory.add(params.memory, params.corpus);
}
@Override
protected Parameters getParameters(RESTRequest req) throws Parameters.ParameterParsingException, TemplateException {
return new Params(req);
}
public enum FileCompression {
GZIP
}
public enum FileType {
TMX, COMPACT, PARALLEL
}
public static class Params extends Parameters {
private final LanguagePair direction;
private final long memory;
private final String source;
private final String target;
private final MultilingualCorpus corpus;
public Params(RESTRequest req) throws ParameterParsingException, TemplateException {
super(req);
memory = req.getPathParameterAsLong("id");
source = getString("sentence", false, null);
target = getString("translation", false, null);
if (source == null && target == null) {
FileType fileType = getEnum("content_type", FileType.class);
FileCompression fileCompression = getEnum("compression", FileCompression.class, null);
boolean gzipped = FileCompression.GZIP.equals(fileCompression);
switch (fileType) {
case COMPACT:
corpus = new CompactFileCorpus(getFileProxy(null, gzipped));
break;
case TMX:
corpus = new TMXCorpus(getFileProxy(null, gzipped));
break;
case PARALLEL:
Locale sourceLanguage = getLocale("source");
Locale targetLanguage = getLocale("target");
LanguagePair language = new LanguagePair(sourceLanguage, targetLanguage);
corpus = new ParallelFileCorpus(language, getFileProxy("source", gzipped), getFileProxy("target", gzipped));
break;
default:
throw new ParameterParsingException("content_type");
}
direction = null;
} else {
if (source == null)
throw new ParameterParsingException("sentence");
if (target == null)
throw new ParameterParsingException("translation");
Locale sourceLanguage = getLocale("source");
Locale targetLanguage = getLocale("target");
direction = new LanguagePair(sourceLanguage, targetLanguage);
corpus = null;
}
}
private FileProxy getFileProxy(String prefix, boolean gzipped) throws ParameterParsingException {
prefix = prefix == null ? "" : (prefix + '_');
String contentParameter = prefix + "content";
String fileParameter = prefix + "local_file";
FileParameter content;
if ((content = req.getFile(contentParameter)) != null) {
return new ParameterFileProxy(content, gzipped);
} else {
File localFile = new File(getString(fileParameter, false));
if (!localFile.isFile())
throw new ParameterParsingException(fileParameter, localFile.toString());
return FileProxy.wrap(localFile, gzipped);
}
}
}
}
|
{
"content_hash": "e9eeae3f01f8e8668f1af3808023bd35",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 132,
"avg_line_length": 37.752,
"alnum_prop": 0.6219538037719856,
"repo_name": "letconex/MMT",
"id": "4731fd90211b345dc691dd25974b71e06b836084",
"size": "4719",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/api-rest/src/main/java/eu/modernmt/rest/actions/memory/AddToMemoryCorpus.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AutoHotkey",
"bytes": "1609"
},
{
"name": "C",
"bytes": "2310"
},
{
"name": "C++",
"bytes": "3479743"
},
{
"name": "CMake",
"bytes": "42508"
},
{
"name": "Java",
"bytes": "810385"
},
{
"name": "Perl",
"bytes": "93820"
},
{
"name": "Protocol Buffer",
"bytes": "947"
},
{
"name": "Python",
"bytes": "232214"
},
{
"name": "Roff",
"bytes": "25856"
},
{
"name": "Shell",
"bytes": "15583"
}
],
"symlink_target": ""
}
|
import asyncio
import logging
import queue
import traceback
from typing import Optional, Tuple
from .bases import BaseClock
from .ephemera import ClockContext, EventType, Moment
logger = logging.getLogger("supriya.clocks")
class AsyncClock(BaseClock):
def __init__(self):
BaseClock.__init__(self)
self._event = asyncio.Event()
self._task = None
self._slop = 1.0
### SCHEDULING METHODS ###
def _enqueue_command(self, command):
super()._enqueue_command(command)
self._event.set()
async def _perform_callback_event(self, event, current_moment, desired_moment):
logger.debug(
f"[{self.name}] ... ... Performing {event.procedure} at "
f"{desired_moment.seconds - self._state.initial_seconds}:s / "
f"{desired_moment.offset}:o"
)
context = ClockContext(current_moment, desired_moment, event)
args = event.args or ()
kwargs = event.kwargs or {}
try:
result = event.procedure(context, *args, **kwargs)
if asyncio.iscoroutine(result):
result = await result
except Exception:
traceback.print_exc()
return
self._process_callback_event_result(desired_moment, event, result)
async def _perform_events(self, current_moment: Moment):
logger.debug(
f"[{self.name}] ... Ready to perform at "
f"{current_moment.seconds - self._state.initial_seconds}:s / "
f"{current_moment.offset}:o"
)
while self._is_running and self._event_queue.qsize():
(
event,
desired_moment,
should_continue,
should_break,
) = self._process_perform_event_loop(current_moment)
if should_continue:
continue
elif should_break:
break
if event.event_type == EventType.CHANGE:
current_moment, should_continue = self._perform_change_event(
event, current_moment, desired_moment
)
if not should_continue:
break
else:
await self._perform_callback_event(
event, current_moment, desired_moment
)
self._process_command_deque()
return current_moment
async def _run(self, *args, offline=False, **kwargs):
logger.debug(f"[{self.name}] Coroutine start")
self._process_command_deque(first_run=True)
while self._is_running:
logger.debug(f"[{self.name}] Loop start")
if not await self._wait_for_queue():
return
try:
current_moment = await self._wait_for_moment()
except queue.Empty:
continue
if current_moment is None:
return
current_moment = await self._perform_events(current_moment)
self._state = self._state._replace(
previous_seconds=current_moment.seconds,
previous_offset=current_moment.offset,
)
logger.debug(f"[{self.name}] Coroutine terminating")
self._stop()
async def _wait_for_event(self, sleep_time):
try:
await asyncio.wait_for(self._event.wait(), sleep_time)
except (asyncio.TimeoutError, RuntimeError):
pass
async def _wait_for_moment(self, offline=False) -> Optional[Moment]:
current_time = self.get_current_time()
next_time = self._event_queue.peek().seconds
logger.debug(
f"[{self.name}] ... Waiting for next moment at {next_time} from {current_time}"
)
while current_time < next_time:
if not offline:
await self._wait_for_event(next_time - current_time)
if not self._is_running:
return None
self._process_command_deque()
next_time = self._event_queue.peek().seconds
current_time = self.get_current_time()
self._event.clear()
return self._seconds_to_moment(current_time)
async def _wait_for_queue(self, offline=False) -> bool:
logger.debug(f"[{self.name}] ... Waiting for events")
self._process_command_deque()
self._event.clear()
while not self._event_queue.qsize():
if not offline:
await self._event.wait()
if not self._is_running:
return False
self._process_command_deque()
self._event.clear()
return True
### PUBLIC METHODS ###
def cancel(self, event_id) -> Optional[Tuple]:
event = super().cancel(event_id)
self._event.set()
return event
async def start(
self,
initial_time: Optional[float] = None,
initial_offset: float = 0.0,
initial_measure: int = 1,
beats_per_minute: Optional[float] = None,
time_signature: Optional[Tuple[int, int]] = None,
):
self._start(
initial_time=initial_time,
initial_offset=initial_offset,
initial_measure=initial_measure,
beats_per_minute=beats_per_minute,
time_signature=time_signature,
)
loop = asyncio.get_running_loop()
self._task = loop.create_task(self._run())
async def stop(self):
if self._stop():
self._event.set()
await self._task
|
{
"content_hash": "d69f5a49d1a6ea8a9b88cdbf75b6f30e",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 91,
"avg_line_length": 34.9811320754717,
"alnum_prop": 0.5539374325782093,
"repo_name": "josiah-wolf-oberholtzer/supriya",
"id": "b2887320a85fdfe2b3c9480ab4e02304ae3cd2fc",
"size": "5562",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "supriya/clocks/asynchronous.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Cython",
"bytes": "26333"
},
{
"name": "Makefile",
"bytes": "1792"
},
{
"name": "Python",
"bytes": "2331463"
},
{
"name": "SuperCollider",
"bytes": "318"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>ShapeContainer (POI API Documentation)</title>
<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="ShapeContainer (POI API Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ShapeContainer.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="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/sl/usermodel/ShapeGroup.html" title="interface in org.apache.poi.sl.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/sl/usermodel/ShapeContainer.html" target="_top">FRAMES</a></li>
<li><a href="ShapeContainer.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.sl.usermodel</p>
<h2 title="Interface ShapeContainer" class="title">Interface ShapeContainer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../../org/apache/poi/sl/usermodel/MasterSheet.html" title="interface in org.apache.poi.sl.usermodel">MasterSheet</a>, <a href="../../../../../org/apache/poi/sl/usermodel/Notes.html" title="interface in org.apache.poi.sl.usermodel">Notes</a>, <a href="../../../../../org/apache/poi/sl/usermodel/ShapeGroup.html" title="interface in org.apache.poi.sl.usermodel">ShapeGroup</a>, <a href="../../../../../org/apache/poi/sl/usermodel/Sheet.html" title="interface in org.apache.poi.sl.usermodel">Sheet</a>, <a href="../../../../../org/apache/poi/sl/usermodel/Slide.html" title="interface in org.apache.poi.sl.usermodel">Slide</a></dd>
</dl>
<hr>
<br>
<pre>public interface <strong>ShapeContainer</strong></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/sl/usermodel/ShapeContainer.html#addShape(org.apache.poi.sl.usermodel.Shape)">addShape</a></strong>(<a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a> shape)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/sl/usermodel/ShapeContainer.html#getShapes()">getShapes</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/poi/sl/usermodel/ShapeContainer.html#removeShape(org.apache.poi.sl.usermodel.Shape)">removeShape</a></strong>(<a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a> shape)</code> </td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getShapes()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getShapes</h4>
<pre><a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a>[] getShapes()</pre>
</li>
</ul>
<a name="addShape(org.apache.poi.sl.usermodel.Shape)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addShape</h4>
<pre>void addShape(<a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a> shape)</pre>
</li>
</ul>
<a name="removeShape(org.apache.poi.sl.usermodel.Shape)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>removeShape</h4>
<pre>boolean removeShape(<a href="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel">Shape</a> shape)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ShapeContainer.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="../../../../../org/apache/poi/sl/usermodel/Shape.html" title="interface in org.apache.poi.sl.usermodel"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../org/apache/poi/sl/usermodel/ShapeGroup.html" title="interface in org.apache.poi.sl.usermodel"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/poi/sl/usermodel/ShapeContainer.html" target="_top">FRAMES</a></li>
<li><a href="ShapeContainer.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY: </li>
<li>NESTED | </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL: </li>
<li>FIELD | </li>
<li>CONSTR | </li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright 2014 The Apache Software Foundation or
its licensors, as applicable.</i>
</small></p>
</body>
</html>
|
{
"content_hash": "1de180afab520a645982e75c6f3cf375",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 649,
"avg_line_length": 38.411764705882355,
"alnum_prop": 0.626230584117261,
"repo_name": "tringuyen1401/Stock-analyzing",
"id": "f35f58454a01a756e10a297934f6378c30776c11",
"size": "9142",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "jdbc/lib/poi-3.11/docs/apidocs/org/apache/poi/sl/usermodel/ShapeContainer.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23219"
},
{
"name": "HTML",
"bytes": "75486542"
},
{
"name": "Java",
"bytes": "2810339"
},
{
"name": "Rust",
"bytes": "92"
}
],
"symlink_target": ""
}
|
<?php
namespace AppBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class GameControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/games');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals(
1,
$crawler->filter('h1')->count()
);
}
/**
* @dataProvider dataProvider
* @param $url
* @param $code
*/
public function testShow($url, $code)
{
$client = static::createClient();
$crawler = $client->request('GET', $url);
$this->assertEquals($code, $client->getResponse()->getStatusCode());
$this->assertEquals(
1,
$crawler->filter('h1')->count()
);
}
public function dataProvider()
{
return [
['/game/3', 200],
['/game/3ff', 404],
];
}
}
|
{
"content_hash": "304e0a24d7253f5aba1e331936528254",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 76,
"avg_line_length": 22.555555555555557,
"alnum_prop": 0.5330049261083744,
"repo_name": "Wolframcheg/GeekhubHW7",
"id": "18f655fa547ad69e6475f68799cb777dd6164f1e",
"size": "1015",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/AppBundle/Tests/Controller/GameControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3606"
},
{
"name": "CSS",
"bytes": "1150"
},
{
"name": "HTML",
"bytes": "26253"
},
{
"name": "JavaScript",
"bytes": "2313"
},
{
"name": "PHP",
"bytes": "134222"
},
{
"name": "Shell",
"bytes": "665"
}
],
"symlink_target": ""
}
|
extern crate nalgebra as na;
use na::{Isometry2, Point2, Vector2};
use ncollide2d::query::PointQuery;
use ncollide2d::shape::Cuboid;
fn main() {
let cuboid = Cuboid::new(Vector2::new(1.0, 2.0));
let pt_inside = Point2::origin();
let pt_outside = Point2::new(2.0, 2.0);
// Solid projection.
assert_eq!(
cuboid.distance_to_point(&Isometry2::identity(), &pt_inside, true),
0.0
);
// Non-solid projection.
assert_eq!(
cuboid.distance_to_point(&Isometry2::identity(), &pt_inside, false),
-1.0
);
// The other point is outside of the cuboid so the `solid` flag has no effect.
assert_eq!(
cuboid.distance_to_point(&Isometry2::identity(), &pt_outside, false),
1.0
);
assert_eq!(
cuboid.distance_to_point(&Isometry2::identity(), &pt_outside, true),
1.0
);
}
|
{
"content_hash": "b32430bf82bd9a8cf920b1d1a9320e99",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 82,
"avg_line_length": 26.484848484848484,
"alnum_prop": 0.5983981693363845,
"repo_name": "sebcrozet/ncollide",
"id": "8f467d0d17b56c06443e8f6e9f16d58ca1752a80",
"size": "874",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/ncollide2d/examples/solid_point_query2d.rs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Makefile",
"bytes": "376"
},
{
"name": "Rust",
"bytes": "889216"
},
{
"name": "Shell",
"bytes": "1303"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.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">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<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="../../..">Unstable</a></li>
<li><a href=".">dev / contrib:kildall 8.4.dev</a></li>
<li class="active"><a href="">2014-12-17 17:32:45</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="../../../../../about.html">About</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href=".">« Up</a>
<h1>
contrib:kildall
<small>
8.4.dev
<span class="label label-info">Not compatible with this Coq</span>
</small>
</h1>
<p><em><script>document.write(moment("2014-12-17 17:32:45 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-12-17 17:32:45 UTC)</em><p>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:kildall/coq:contrib:kildall.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>The package is valid.
</pre></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 --dry-run coq:contrib:kildall.8.4.dev coq.dev</code></dd>
<dt>Return code</dt>
<dd>768</dd>
<dt>Duration</dt>
<dd>0 s</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq:contrib:kildall -> coq <= 8.4.dev
Your request can't be satisfied:
- Conflicting version constraints for coq
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --dry-run coq:contrib:kildall.8.4.dev</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>3 s</dd>
<dt>Output</dt>
<dd><pre>The following actions will be performed:
- remove coq.dev
=== 1 to remove ===
=-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Removing coq.dev.
[WARNING] Directory /home/bench/.opam/system/lib/coq is not empty, not removing
The following actions will be performed:
- install coq.8.4.dev [required by coq:contrib:kildall]
- install coq:contrib:kildall.8.4.dev
=== 2 to install ===
=-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Building coq.8.4.dev:
./configure -configdir /home/bench/.opam/system/lib/coq/config -mandir /home/bench/.opam/system/man -docdir /home/bench/.opam/system/doc -prefix /home/bench/.opam/system -usecamlp5 -camlp5dir /home/bench/.opam/system/lib/camlp5 -coqide no
make -j4
make install
Installing coq.8.4.dev.
Building coq:contrib:kildall.8.4.dev:
coq_makefile -f Make -o Makefile
make -j4
make install
Installing coq:contrib:kildall.8.4.dev.
</pre></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>Duration</dt>
<dd>0 s</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">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "243c8a68f32168cae705caaea3d42e96",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 240,
"avg_line_length": 40.773809523809526,
"alnum_prop": 0.502919708029197,
"repo_name": "coq-bench/coq-bench.github.io-old",
"id": "d991a74cace92a6d2ffb1e941bc1e663186c0f57",
"size": "6852",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.1-1.2.0/unstable/dev/contrib:kildall/8.4.dev/2014-12-17_17-32-45.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
/* elim_coli_extern.h - prototypes for elim_coli.c */
/* Author: Gregg Tracton & Jun Chen, UNC Dept of Radiation Oncology */
extern void elim_coli(int slice /* slice to eliminate colinear pts on */
);
extern void elim_coli_all();
|
{
"content_hash": "20f52850521ff4f4bf7f52fa79ef89a6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 72,
"avg_line_length": 31.125,
"alnum_prop": 0.6586345381526104,
"repo_name": "XiaoxiaoLiu/SCDS",
"id": "1159d22f66680973316cb661ae0b042abbeb3157",
"size": "249",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Libraries/ContourTiler/elim_coli_extern.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "217744"
},
{
"name": "C++",
"bytes": "3228772"
},
{
"name": "CLIPS",
"bytes": "4478"
},
{
"name": "M",
"bytes": "16670"
},
{
"name": "Matlab",
"bytes": "301134"
},
{
"name": "Objective-C",
"bytes": "6269"
},
{
"name": "Perl",
"bytes": "282"
},
{
"name": "R",
"bytes": "18587"
},
{
"name": "Shell",
"bytes": "124559"
}
],
"symlink_target": ""
}
|
ActiveRecord::Schema.define(:version => 20120625105800) do
create_table "items", :force => true do |t|
t.string "name"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "tests", :force => true do |t|
t.string "name"
t.integer "age"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "users", :force => true do |t|
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end
end
|
{
"content_hash": "e24a74e0a9c6655748099a66c84ec1a9",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 58,
"avg_line_length": 21.869565217391305,
"alnum_prop": 0.614314115308151,
"repo_name": "skylord73/usefull_table",
"id": "ae934eccabe76efe160eee8386f71fa7266de26a",
"size": "1220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/dummy/db/schema.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6915"
},
{
"name": "JavaScript",
"bytes": "8671"
},
{
"name": "Ruby",
"bytes": "74271"
}
],
"symlink_target": ""
}
|
Vue.component('header-label', {
props: ['data'],
template: '<div v-if="data != null" class="row wrapper border-bottom white-bg page-heading">'
+'<div class="col-lg-10">'
+'<h2>{{data.name}}</h2>'
+'<ol v-if="data.path != null" class="breadcrumb">'
+'<li v-for="item in data.path.parent">'
+'<a v-if="item.url == null">{{item.name}}</a>'
+'<router-link v-else v-bind:to="item.url">{{item.name}}</router-link>'
+'</li>'
+'<li class="active"><strong>{{data.path.active}}</strong></li>'
+'</ol>'
+'</div>'
+'<div class="col-lg-2"></div>'
+'</div>'
});
Vue.component('tt-table', {
props: ['value','data','selection'],
template: '<table class="table table-striped table-hover">' +
'<thead>' +
'<slot name="tt-title">' +
'<tr>' +
//复选框美化
'<th v-if="selection">' +
'<div class="checkbox checkbox-success tt-table-checkbox">' +
'<input v-model="allSelected" v-on:click="updateAllSelect" type="checkbox">' +
'<label></label>' +
'</div>' +
'</th>' +
//标题栏默认样式
'<slot v-for="(item,key) in innerTableDate.title" v-bind:name="\'tt-title-\'+key">' +
'<th :width="item.width">{{item.name}}</th>' +
'</slot>' +
'</tr>' +
'</slot>' +
'</thead>' +
'<tbody>' +
'<slot name="tt-body">' +
'<tr v-for="(item,index) in innerTableDate.data">' +
//复选框美化
'<td v-if="selection">' +
'<div class="checkbox checkbox-success tt-table-checkbox">' +
'<input v-model="checkedData" v-bind:value="item" v-on:click="updateSelect" type="checkbox">' +
'<label></label>' +
'</div>' +
'</td>' +
//表格主体默认样式
'<td v-for="(value,key) in innerTableDate.title">' +
'<slot v-bind:name="\'tt-body-\'+key" v-bind:row="item" v-bind:index="index">' +
'<div>{{item[key]}}</div>' +
'</slot>' +
'</td>' +
'</tr>' +
'</slot>' +
'</tbody>' +
'</table>',
data:function () {
return{
checkedData:[]
}
},
computed:{
allSelected:function () {
return this.checkedData.length !== 0;
},
innerTableDate:function () {
var self = this;
var temp = self.data || {};
temp.title = temp.title || {error:{name:"data不能为空",width:null}};
temp.data = temp.data || [];
jQuery.each(temp.title,function (key,value) {
if (self.isString(value)){
temp.title[key] = {name:value}
}
if (key === "$index"){
jQuery.each(temp.data,function (index,item) {
item[key] = index;
});
}
});
return temp;
}
},
created:function () {
},
mounted:function () {
this.$emit('input',this.checkedData);
},
methods:{
isString:function (str) {
return Object.prototype.toString.call(str) === "[object String]"
},
updateAllSelect:function () {
if (this.allSelected){
this.checkedData = [];
}else {
this.checkedData = this.innerTableDate.data.slice(0);
}
this.$emit('input',this.checkedData)
},
updateSelect:function () {
this.$emit('input',this.checkedData)
}
}
});
Vue.component('tt-pagination', {
props: ['value','label','type','placeholder'],
template: '<div class="btn-group">' +
'<button type="button" class="btn btn-white"><i class="fa fa-chevron-left"></i></button>' +
'<button class="btn btn-white">1</button>' +
'<button class="btn btn-white active">2</button>' +
'<button class="btn btn-white">3</button>' +
'<button class="btn btn-white">4</button>' +
'<button type="button" class="btn btn-white"><i class="fa fa-chevron-right"></i> </button>' +
'</div>',
data:function(){
return{
}
},
computed: {
baseType: function () {
return this.type||"text";
}
},
created:function () {
},
methods:{
updateValue:function (value) {
this.$emit('input',value)
}
}
});
Vue.component('tt-simple-input', {
props: ['value','name','label','type','row','placeholder','required','minlength','maxlength'],
template: '<div class="form-group tt-from-input">' +
'<label>{{label}}</label>' +
'<textarea v-if="baseType == \'textarea\'" class="form-control" :rows="baseRow" :placeholder="placeholder" class="form-control"' +
':required="required" :minlength="minlength" :maxlength="maxlength"></textarea>' +
'<input v-else :value="value" :name="innerName" @input="updateValue($event.target.value)" :type="baseType" :placeholder="placeholder" class="form-control"' +
':required="required" :minlength="minlength" :maxlength="maxlength">' +
'</div>',
data:function(){
return{
}
},
computed: {
baseType: function () {
return this.type||"text";
},
baseRow: function () {
return this.row||"3";
},
innerName:function () {
return this.name || this.label;
}
},
created:function () {
},
methods:{
updateValue:function (value) {
this.$emit('input',value)
}
}
});
Vue.component('tt-modal', {
props: ['size','close','title'],
template: '<div class="modal fade" v-bind:class="modalFormClass" aria-hidden="true">' +
'<div class="modal-dialog" v-bind:class="modalDialogClass">' +
'<div class="modal-content">' +
'<div class="modal-body">' +
'<div class="row">' +
'<div class="col-sm-10"><h3>{{title}}</h3></div>' +
'<button v-if="innerClose" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>' +
'</div>' +
'<slot></slot>' +
'</div>' +
'</div>' +
'</div>' +
'</div>',
computed: {
innerClose: function () {
var temp = this.close === undefined?true:this.close;
if (temp === "false") temp = false;
return temp;
},
modalFormClass:function () {
return {
"bs-example-modal-lg":this.size === "lg",
"bs-example-modal-sm":this.size === "sm"
}
},
modalDialogClass:function () {
return {
"modal-lg":this.size === "lg",
"modal-sm":this.size === "sm"
}
}
}
});
|
{
"content_hash": "d9279a47955cffc3d6c83ff9618c0b17",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 161,
"avg_line_length": 32.41871921182266,
"alnum_prop": 0.5061540799270627,
"repo_name": "JiangTJ/enterpriseAssetManagement",
"id": "7c47d61d910cdb9b40aaf85cb70489a480ad46ef",
"size": "6639",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/static/back/component-template.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "300711"
},
{
"name": "Dockerfile",
"bytes": "988"
},
{
"name": "HTML",
"bytes": "60441"
},
{
"name": "Java",
"bytes": "147990"
},
{
"name": "JavaScript",
"bytes": "454675"
},
{
"name": "Vue",
"bytes": "111326"
}
],
"symlink_target": ""
}
|
/* */
'use strict';
module.exports = filter;
function filter(name, str, options) {
if (typeof filter[name] === 'function') {
return filter[name](str, options);
} else {
throw new Error('unknown filter ":' + name + '"');
}
}
|
{
"content_hash": "e5ff662d9c01231af752916a9cba03ed",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 54,
"avg_line_length": 21.818181818181817,
"alnum_prop": 0.5916666666666667,
"repo_name": "taylorzane/aurelia-firebase",
"id": "01ea8fa1539ffde909f4afe37d7baed9f4e0736a",
"size": "240",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "jspm_packages/npm/jade@1.9.2/lib/filters-client.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "120212"
},
{
"name": "CoffeeScript",
"bytes": "2294"
},
{
"name": "HTML",
"bytes": "168070"
},
{
"name": "JavaScript",
"bytes": "7349137"
},
{
"name": "LiveScript",
"bytes": "219393"
},
{
"name": "Makefile",
"bytes": "1872"
},
{
"name": "Shell",
"bytes": "1270"
}
],
"symlink_target": ""
}
|
<?php
error_reporting(E_ALL);
//require_once 'vendor/autoload.php';
require_once __DIR__.'/vendor/autoload.php';
//date_default_timezone_set("Europe/London");
putenv('GOOGLE_APPLICATION_CREDENTIALS=edae9107104d.json');
## DB COnnection - Start ##
$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
'dbname' => 'wbcms',
'user' => 'root',
'password' => '',
'host' => 'localhost',
'driver' => 'pdo_mysql',
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
## DB COnnection - END ##
function fromCSVFile( $file) {
// open the CVS file
$handle = @fopen( $file, "r");
if ( !$handle ) {
throw new \Exception( "Couldn't open $file!" );
}
$result = [];
// read the first line
$first = fgets( $handle, 4096 );
// get the keys
$keys = str_getcsv( $first );
// read until the end of file
while ( ($buffer = fgets( $handle, 4096 )) !== false ) {
// read the next entry
$array = str_getcsv ( $buffer );
if ( empty( $array ) ) continue;
$row = [];
$i=0;
// replace numeric indexes with keys for each entry
if(count($keys) == count($array)){
foreach ( $keys as $key ) {
$row[ $key ] = $array[ $i ];
$i++;
}
}
// add relational array to final result
$result[] = $row;
}
fclose( $handle );
return $result;
}
function getDataFromFile($fileData){
$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
'dbname' => 'wbcms',
'user' => 'root',
'password' => '',
'host' => 'localhost',
'driver' => 'pdo_mysql',
);
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
if($fileData['mimeType'] == 'text/csv'){
$name = $fileData['name'];
$fileLink = $fileData['webContentLink'];
$uploaded_file = $fileLink;
$filename = $fileData['name'];
##########################################################
/*
if(!empty($_FILES)){
$filename = basename($_FILES['file']['name']);
$ext = substr($filename, strrpos($filename, '.') + 1);
$upload_dir = "";
$fileName = $_FILES['file']['name'];
$uploaded_file = '../web/uploaded_docs/playerlog/'.$fileName;
if(move_uploaded_file($_FILES['file']['tmp_name'],$uploaded_file)){
*/
$getData2 = 'SELECT * FROM playerlogs2 where file_ref="'.$filename.'"';
$allGetData2 = $conn->fetchAll($getData2);
if(count($allGetData2) == 0){
$lines = fromCSVFile($uploaded_file);
$insert_qry_here = 'INSERT INTO playerlogs2 (location_id, datetime, title, artist_name, playlist_name, category_name, file_ref) VALUES ';
$previousData = array();
$insert_qry_data = array();
foreach($lines as $insert_qry_arr1_tempVal){
$date = new \DateTime($insert_qry_arr1_tempVal['DateTime']);
$just_date = $date->format('Y-m-d');
if(!isset($previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date])){
$previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date] = array();
$getData = 'SELECT * FROM playerlogs2 where location_id="'.$insert_qry_arr1_tempVal['TokenId'].'" AND datetime LIKE "%'.$just_date.'%"';
//$data_connection2 = $this->getDoctrine()->getManager();
$allGetData = $conn->fetchAll($getData);
if(count($allGetData) > 0){
foreach($allGetData as $allGetDataVal){
$previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date][$allGetDataVal['datetime']] = $allGetDataVal;
}
}
}
$formated_date = '';
$date = new \DateTime($insert_qry_arr1_tempVal['DateTime']);
$formated_date = $date->format('Y-m-d H:i:s');
if(!isset($previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date][$formated_date])){
$insert_qry_data[] = "('".$insert_qry_arr1_tempVal['TokenId']."','".$formated_date."','".$insert_qry_arr1_tempVal['Title']."','".$insert_qry_arr1_tempVal['ArtistName']."','".$insert_qry_arr1_tempVal['PlaylistName']."','".$insert_qry_arr1_tempVal['CategoryName']."','".$filename."')";
}
}
if(count($insert_qry_data) > 0){
$insert_qry_here .= implode(", ",$insert_qry_data);
$insert_qry_here .= ';';
//$em = $this->getDoctrine()->getManager();
//$conn = $em->getConnection();
$conn->prepare($insert_qry_here)
->execute();
}
}
/*
}
}
*/
##########################################################
}
}
// I'm using a service account, use whatever Google auth flow for your type of account.
//putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account/key.json');
function getAllFilesFromSubFolder($folderID){
//$tempfiles
$client = new Google_Client();
$all_scope = array(Google_Service_Drive::DRIVE,Google_Service_Drive::DRIVE_APPDATA,Google_Service_Drive::DRIVE_FILE,Google_Service_Drive::DRIVE_METADATA,Google_Service_Drive::DRIVE_METADATA_READONLY,Google_Service_Drive::DRIVE_PHOTOS_READONLY,Google_Service_Drive::DRIVE_READONLY,Google_Service_Drive::DRIVE_SCRIPTS, Google_Service_Sheets::SPREADSHEETS_READONLY);
$client->addScope($all_scope);
$client->useApplicationDefaultCredentials();
$service = new Google_Service_Drive($client);
$optParams = array(
//'pageSize' => 10,
'fields' => "nextPageToken, files(id,name,size,webContentLink,webViewLink,mimeType,parents)",
'q' => "'".$folderID."' in parents"
);
$files = $service->files->listFiles($optParams);
$filesArr = json_decode(json_encode($files), true);
$allFiles = array();
foreach($filesArr["files"] as $fileData){
echo "<pre>";
print_r($fileData);
exit;
if($fileData['mimeType'] == 'text/csv'){
$allFiles[$fileData['id']] = $fileData;
}
if($fileData['mimeType'] == 'application/vnd.google-apps.folder'){
$otherFiles = getAllFilesFromSubFolder($fileData['id']);
}
$allTempFiles = array_merge($allFiles,$otherFiles);
}
return $allTempFiles;
}
$client = new Google_Client();
$all_scope = array(Google_Service_Drive::DRIVE,Google_Service_Drive::DRIVE_APPDATA,Google_Service_Drive::DRIVE_FILE,Google_Service_Drive::DRIVE_METADATA,Google_Service_Drive::DRIVE_METADATA_READONLY,Google_Service_Drive::DRIVE_PHOTOS_READONLY,Google_Service_Drive::DRIVE_READONLY,Google_Service_Drive::DRIVE_SCRIPTS, Google_Service_Sheets::SPREADSHEETS_READONLY);
$client->addScope($all_scope);
$client->useApplicationDefaultCredentials();
$service = new Google_Service_Drive($client);
$optParams = array(
'pageSize' => 1000,
'fields' => "nextPageToken, files(id,name,size,webContentLink,webViewLink,mimeType,parents)",
'q' => "'1kK0gUnlmTWk1hASHf5fa6DuxFmEZ_Q6C' in parents"
);
$files = $service->files->listFiles($optParams);
$filesArr = json_decode(json_encode($files), true);
$allFiles = array();
$FInalFIles = array();
//echo "<pre>";
//print_r($filesArr);
//exit;
foreach($filesArr["files"] as $fileData){
//echo "<pre>";
//print_r($fileData);
//exit;
//if($fileData['mimeType'] == 'text/csv'){
// $allFiles[$fileData['id']] = $fileData;
//getDataFromFile($fileData);
/*
////////////////////////////////////////////////////////////////////////////////////
//id
$fileId = $fileData['id'];
$fileParents = $fileData['parents'][0];
$folderId = '1fViSRsShSOc0gfZaE0tuRC2gp71MxNid';
$emptyFileMetadata = new Google_Service_Drive_DriveFile();
// Retrieve the existing parents to remove
//$file = $driveService->files->get($fileId, array('fields' => 'parents'));
$previousParents = $fileParents;
// Move the file to the new folder
$file = $service->files->update($fileId, $emptyFileMetadata, array(
'addParents' => $folderId,
'removeParents' => $previousParents,
'fields' => 'id, parents'));
*/
//////////////////////////////////////////////////////////////////////////////////////
//}
//if($fileData['mimeType'] == 'application/vnd.google-apps.folder'){
// $otherFiles = getAllFilesFromSubFolder($fileData['id']);
//}
//$FInalFIles = array_merge($allFiles,$otherFiles);
if($fileData['mimeType'] == 'text/csv'){
$name = $fileData['name'];
$fileLink = $fileData['webContentLink'];
$uploaded_file = $fileLink;
$filename = $fileData['name'];
##########################################################
$getData2 = 'SELECT * FROM playerlogs where file_ref="'.$filename.'"';
$allGetData2 = $conn->fetchAll($getData2);
if(count($allGetData2) == 0){
$lines = fromCSVFile($uploaded_file);
$insert_qry_here = 'INSERT INTO playerlogs (location_id, datetime, title, artist_name, playlist_name, category_name, file_ref) VALUES ';
$previousData = array();
$insert_qry_data = array();
foreach($lines as $insert_qry_arr1_tempVal){
$date = new \DateTime($insert_qry_arr1_tempVal['DateTime']);
$just_date = $date->format('Y-m-d');
if(!isset($previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date])){
$previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date] = array();
$getData = 'SELECT * FROM playerlogs where location_id="'.$insert_qry_arr1_tempVal['TokenId'].'" AND datetime LIKE "%'.$just_date.'%"';
//$data_connection2 = $this->getDoctrine()->getManager();
$allGetData = $conn->fetchAll($getData);
if(count($allGetData) > 0){
foreach($allGetData as $allGetDataVal){
$previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date][$allGetDataVal['datetime']] = $allGetDataVal;
}
}
}
$formated_date = '';
$date = new \DateTime($insert_qry_arr1_tempVal['DateTime']);
$formated_date = $date->format('Y-m-d H:i:s');
if(!isset($previousData[$insert_qry_arr1_tempVal['TokenId']][$just_date][$formated_date])){
$insert_qry_data[] = "('".$insert_qry_arr1_tempVal['TokenId']."','".$formated_date."','".$insert_qry_arr1_tempVal['Title']."','".$insert_qry_arr1_tempVal['ArtistName']."','".$insert_qry_arr1_tempVal['PlaylistName']."','".$insert_qry_arr1_tempVal['CategoryName']."','".$filename."')";
}
}
if(count($insert_qry_data) > 0){
$insert_qry_here .= implode(", ",$insert_qry_data);
$insert_qry_here .= ';';
//$em = $this->getDoctrine()->getManager();
//$conn = $em->getConnection();
$conn->prepare($insert_qry_here)
->execute();
}
//$getData3 = 'SELECT * FROM playerlogs where file_ref="'.$filename.'"';
//$allGetData3 = $conn->fetchAll($getData3);
//if(count($allGetData3) > 0){
// $service->files->delete($fileData['id']);
//}
}
}
}
?>
|
{
"content_hash": "24a61e0a27d6acdc585b42f35d41be53",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 365,
"avg_line_length": 41.320689655172416,
"alnum_prop": 0.5324209296503379,
"repo_name": "talktodhi/wb",
"id": "ab21a78fa29fbdf0a196b946e092f98d7e469acd",
"size": "11983",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "web/cron/google_drive_sync/test.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22143"
},
{
"name": "HTML",
"bytes": "2623415"
},
{
"name": "JavaScript",
"bytes": "96283"
},
{
"name": "PHP",
"bytes": "197441"
}
],
"symlink_target": ""
}
|
package lessons
import(
"fmt"
"encoding/json"
"os"
)
type Response1 struct {
Page int
Fruits []string
}
type Response2 struct {
Page int `json:"page"`
Fruits []string `json:"fruits"`
}
func Json() {
// First we'll look at encoding basic data types to
// JSON strings. Here are some examples for atomic
// values.
bolB, _ := json.Marshal(true)
fmt.Println(string(bolB))
intB, _ := json.Marshal(1)
fmt.Println(string(intB))
fltB, _ := json.Marshal(2.34)
fmt.Println(string(fltB))
strB, _ := json.Marshal("gopher")
fmt.Println(string(strB))
// And here are some for slices and maps, which encode
// to JSON arrays and objects as you'd expect.
slcD := []string{"apple", "peach", "pear"}
slcB, _ := json.Marshal(slcD)
fmt.Println(string(slcB))
mapD := map[string]int{"apple": 5, "lettuce": 7}
mapB, _ := json.Marshal(mapD)
fmt.Println(string(mapB))
// The JSON package can automatically encode your
// custom data types. It will only include exported
// fields in the encoded output and will by default
// use those names as the JSON keys.
res1D := &Response1{
Page: 1,
Fruits: []string{"apple", "peach", "pear"},
}
res1B, _ := json.Marshal(res1D)
fmt.Println(string(res1B))
// You can use tags on struct field declarations
// to customize the encoded JSON key names. Check the
// definition of `Response2` above to see an example
// of such tags.
res2D := &Response2{
Page: 1,
Fruits: []string{"apple", "peach", "pear"},
}
res2B, _ := json.Marshal(res2D)
fmt.Println(string(res2B))
// Now let's look at decoding JSON data into Go
// values. Here's an example for a generic data
// structure.
byt := []byte(`{"num": 6.13, "strs":["a", "b"]}`)
// We need to provide a variable where the JSON
// package can put the decoded data. This
// `map[string]interface{}` will hold a map of strings
// to arbitrary data types.
var dat map[string]interface{}
// Here's the actual decoding, and a check for
// associated errors.
if err := json.Unmarshal(byt, &dat); err != nil {
panic(err)
}
fmt.Println(dat)
// In order to use the values in the decoded map,
// we'll need to cast them to their appropriate type.
// For example here we cast the value in `num` to
// the expected `float64` type.
num := dat["num"].(float64)
fmt.Println(num)
// Accessing nested data requires a series of
// casts.
strs := dat["strs"].([]interface{})
str1 := strs[0].(string)
fmt.Println(str1)
// We can also decode JSON into custom data types.
// This has the advantages of adding additional
// type-safety to our programs and eliminating the
// need for type assertions when accessing the decoded
// data.
str := `{"page": 1, "fruits": ["apple", "peach"]}`
res := Response2{}
json.Unmarshal([]byte(str), &res)
fmt.Println(res)
fmt.Println(res.Fruits[0])
// In the examples above we always used bytes and
// strings as intermediates between the data and
// JSON representation on standard out. We can also
// stream JSON encodings directly to `os.Writer`s like
// `os.Stdout` or even HTTP response bodies.
enc := json.NewEncoder(os.Stdout)
d := map[string]int{"apple": 5, "lettuce": 7}
enc.Encode(d)
}
|
{
"content_hash": "741e004c67beeb9ecdcbbe4eef8b89ac",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 55,
"avg_line_length": 28.299145299145298,
"alnum_prop": 0.6472364844457867,
"repo_name": "divo1/go-lessons",
"id": "9e9221ee306939d864619a6d41a706734a9af6de",
"size": "3436",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/divo.net.pl/lessons/47_json.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "77762"
}
],
"symlink_target": ""
}
|
(function () {
'use strict';
angular.module('ClientApp')
.directive('clientTeamPointsController', clientTeamPointsController);
/**
* This is the directive for the points controller.
* Use:
* <client-team-points-controller></client-team-points-controller>
* to embed to controller in the html file.
*/
function clientTeamPointsController(){
return {
restrict: 'E',
scope: {},
templateUrl: 'app/client/clientTeamPoints/client-team-points.html',
controller: 'initTeamPointsController',
controllerAs: 'teamPointsCtrl'
};
}
})();
|
{
"content_hash": "1fb05d0168d8e1577d67472342c9aec5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 27.375,
"alnum_prop": 0.604261796042618,
"repo_name": "fefrei/nodebuzz",
"id": "9090e717500ded8a0aa26fb5130ea0bde9f0917c",
"size": "657",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "http/app/client/clientTeamPoints/clientTeamPoints.directive.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8809"
},
{
"name": "HTML",
"bytes": "63928"
},
{
"name": "JavaScript",
"bytes": "328327"
}
],
"symlink_target": ""
}
|
<?php
declare(strict_types=1);
namespace Phpml\Tests\Metric;
use Phpml\Metric\ConfusionMatrix;
use PHPUnit\Framework\TestCase;
class ConfusionMatrixTest extends TestCase
{
public function testComputeConfusionMatrixOnNumericLabels(): void
{
$actualLabels = [2, 0, 2, 2, 0, 1];
$predictedLabels = [0, 0, 2, 2, 0, 2];
$confusionMatrix = [
[2, 0, 0],
[0, 0, 1],
[1, 0, 2],
];
$this->assertEquals($confusionMatrix, ConfusionMatrix::compute($actualLabels, $predictedLabels));
}
public function testComputeConfusionMatrixOnStringLabels(): void
{
$actualLabels = ['cat', 'ant', 'cat', 'cat', 'ant', 'bird'];
$predictedLabels = ['ant', 'ant', 'cat', 'cat', 'ant', 'cat'];
$confusionMatrix = [
[2, 0, 0],
[0, 0, 1],
[1, 0, 2],
];
$this->assertEquals($confusionMatrix, ConfusionMatrix::compute($actualLabels, $predictedLabels));
}
public function testComputeConfusionMatrixOnLabelsWithSubset(): void
{
$actualLabels = ['cat', 'ant', 'cat', 'cat', 'ant', 'bird'];
$predictedLabels = ['ant', 'ant', 'cat', 'cat', 'ant', 'cat'];
$labels = ['ant', 'bird'];
$confusionMatrix = [
[2, 0],
[0, 0],
];
$this->assertEquals($confusionMatrix, ConfusionMatrix::compute($actualLabels, $predictedLabels, $labels));
$labels = ['bird', 'ant'];
$confusionMatrix = [
[0, 0],
[0, 2],
];
$this->assertEquals($confusionMatrix, ConfusionMatrix::compute($actualLabels, $predictedLabels, $labels));
}
}
|
{
"content_hash": "35f93266e48636f355b21702b3e9c413",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 114,
"avg_line_length": 27.387096774193548,
"alnum_prop": 0.5488810365135454,
"repo_name": "MustafaKarabulut/php-ml",
"id": "590aff89734846084a0b1391f39e85994a3873e9",
"size": "1698",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Metric/ConfusionMatrixTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "511304"
},
{
"name": "Shell",
"bytes": "1150"
}
],
"symlink_target": ""
}
|
class NotificationError(Exception):
pass
|
{
"content_hash": "02dbefb31eb8491264bdcc28053c0fad",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 35,
"avg_line_length": 22.5,
"alnum_prop": 0.7777777777777778,
"repo_name": "mistercrunch/panoramix",
"id": "749a91fd955b0113d92fc2cb76953277a7c44c48",
"size": "832",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "superset/reports/notifications/exceptions.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "46750"
},
{
"name": "HTML",
"bytes": "34140"
},
{
"name": "JavaScript",
"bytes": "81606"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Python",
"bytes": "240195"
},
{
"name": "Shell",
"bytes": "213"
}
],
"symlink_target": ""
}
|
import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import createServerRender from 'test/utils/createServerRender';
import consoleErrorMock from 'test/utils/consoleErrorMock';
import { createClientRender } from 'test/utils/createClientRender';
import Portal from './Portal';
describe('<Portal />', () => {
const serverRender = createServerRender();
const render = createClientRender();
describe('server-side', () => {
// Only run the test on node.
if (!/jsdom/.test(window.navigator.userAgent)) {
return;
}
beforeEach(() => {
consoleErrorMock.spy();
});
afterEach(() => {
consoleErrorMock.reset();
});
it('render nothing on the server', () => {
const markup1 = serverRender(<div>Bar</div>);
expect(markup1.text()).to.equal('Bar');
const markup2 = serverRender(
<Portal>
<div>Bar</div>
</Portal>,
);
expect(markup2.text()).to.equal('');
});
});
describe('ref', () => {
it('should have access to the mountNode when disabledPortal={false}', () => {
const refSpy = spy();
const { unmount } = render(
<Portal ref={refSpy}>
<h1>Foo</h1>
</Portal>,
);
expect(refSpy.args).to.deep.equal([[document.body]]);
unmount();
expect(refSpy.args).to.deep.equal([[document.body], [null]]);
});
it('should have access to the mountNode when disabledPortal={true}', () => {
const refSpy = spy();
const { unmount } = render(
<Portal disablePortal ref={refSpy}>
<h1 className="woofPortal">Foo</h1>
</Portal>,
);
const mountNode = document.querySelector('.woofPortal');
expect(refSpy.args).to.deep.equal([[mountNode]]);
unmount();
expect(refSpy.args).to.deep.equal([[mountNode], [null]]);
});
it('should have access to the mountNode when switching disabledPortal', () => {
const refSpy = spy();
const { setProps, unmount } = render(
<Portal disablePortal ref={refSpy}>
<h1 className="woofPortal">Foo</h1>
</Portal>,
);
const mountNode = document.querySelector('.woofPortal');
expect(refSpy.args).to.deep.equal([[mountNode]]);
setProps({
disablePortal: false,
ref: refSpy,
});
expect(refSpy.args).to.deep.equal([[mountNode], [null], [document.body]]);
unmount();
expect(refSpy.args).to.deep.equal([[mountNode], [null], [document.body], [null]]);
});
});
it('should render in a different node', () => {
render(
<div id="test1">
<h1 className="woofPortal1">Foo</h1>
<Portal>
<h1 className="woofPortal2">Foo</h1>
</Portal>
</div>,
);
const rootElement = document.querySelector('#test1');
expect(rootElement.contains(document.querySelector('.woofPortal1'))).to.equal(true);
expect(rootElement.contains(document.querySelector('.woofPortal2'))).to.equal(false);
});
it('should unmount when parent unmounts', () => {
function Parent(props) {
const { show = true } = props;
return <div>{show ? <Child /> : null}</div>;
}
function Child() {
const containerRef = React.useRef();
return (
<div>
<div ref={containerRef} />
<Portal container={() => containerRef.current}>
<div id="test1" />
</Portal>
</div>
);
}
const { setProps } = render(<Parent />);
expect(document.querySelectorAll('#test1').length).to.equal(1);
setProps({ show: false });
expect(document.querySelectorAll('#test1').length).to.equal(0);
});
it('should render overlay into container (document)', () => {
render(
<Portal>
<div className="test2" />
<div className="test2" />
</Portal>,
);
expect(document.querySelectorAll('.test2').length).to.equal(2);
});
it('should render overlay into container (DOMNode)', () => {
const container = document.createElement('div');
render(
<Portal container={container}>
<div id="test2" />
</Portal>,
);
expect(container.querySelectorAll('#test2').length).to.equal(1);
});
it('should change container on prop change', () => {
function ContainerTest(props) {
const { containerElement = false, disablePortal = true } = props;
const containerRef = React.useRef();
const container = React.useCallback(() => (containerElement ? containerRef.current : null), [
containerElement,
]);
return (
<span>
<strong ref={containerRef} />
<Portal disablePortal={disablePortal} container={container}>
<div id="test3" />
</Portal>
</span>
);
}
const { setProps } = render(<ContainerTest />);
expect(document.querySelector('#test3').parentElement.nodeName).to.equal('SPAN');
setProps({
containerElement: true,
disablePortal: true,
});
expect(document.querySelector('#test3').parentElement.nodeName).to.equal('SPAN');
setProps({
containerElement: true,
disablePortal: false,
});
expect(document.querySelector('#test3').parentElement.nodeName).to.equal('STRONG');
setProps({
containerElement: false,
disablePortal: false,
});
expect(document.querySelector('#test3').parentElement.nodeName).to.equal('BODY');
});
it('should call onRendered', () => {
const ref = React.createRef();
const handleRendered = spy();
render(
<Portal
ref={ref}
onRendered={() => {
handleRendered();
expect(ref.current !== null).to.equal(true);
}}
>
<div />
</Portal>,
);
expect(handleRendered.callCount).to.equal(1);
});
it('should call ref after child effect', () => {
const callOrder = [];
const handleRef = (node) => {
if (node) {
callOrder.push('ref');
}
};
const updateFunction = () => {
callOrder.push('effect');
};
function Test(props) {
const { container } = props;
React.useEffect(() => {
updateFunction();
}, [container]);
return (
<Portal ref={handleRef} container={container}>
<div />
</Portal>
);
}
const { setProps } = render(<Test container={document.createElement('div')} />);
setProps({ container: null });
setProps({ container: document.createElement('div') });
setProps({ container: null });
expect(callOrder).to.deep.equal([
'effect',
'ref',
'effect',
'ref',
'effect',
'ref',
'effect',
'ref',
]);
});
});
|
{
"content_hash": "d202b1568f99dc505f8da79fce049f8f",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 99,
"avg_line_length": 28.238493723849373,
"alnum_prop": 0.5697140317084013,
"repo_name": "lgollut/material-ui",
"id": "4e47d3fc61b0e54d8150fb04d08ca71e59062298",
"size": "6749",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/material-ui/src/Portal/Portal.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1202143"
}
],
"symlink_target": ""
}
|
<?php
namespace Imbo\Http\Response;
use Imbo\EventManager\EventInterface,
Imbo\EventListener\ListenerInterface,
Imbo\Model,
Imbo\Exception,
Symfony\Component\HttpFoundation\AcceptHeader;
/**
* This event listener will correctly format the response body based on the Accept headers in the
* request
*
* @author Christer Edvartsen <cogo@starzinger.net>
* @package Http
*/
class ResponseFormatter implements ListenerInterface {
/**
* Content formatters
*
* @var array
*/
private $formatters;
/**
* The default mime type to use when formatting a response
*
* @var string
*/
private $defaultMimeType = 'application/json';
/**
* Mapping from extensions to mime types
*
* @var array
*/
private $extensionsToMimeType = [
'json' => 'application/json',
'xml' => 'application/xml',
'gif' => 'image/gif',
'jpg' => 'image/jpeg',
'png' => 'image/png',
];
/**
* Supported content types and the associated formatter class name or instance, or in the
* case of an image model, the resulting image type
*
* @var array
*/
private $supportedTypes = [
'application/json' => 'json',
'application/xml' => 'xml',
'image/gif' => 'gif',
'image/png' => 'png',
'image/jpeg' => 'jpg',
];
/**
* The default types that models support, in a prioritized order
*
* @var array
*/
private $defaultModelTypes = [
'application/json',
'application/xml',
];
/**
* The types the different models can be expressed as, if they don't support the default ones,
* in a prioritized order. If the user agent sends "Accept: image/*" the first one will be the
* one used.
*
* The keys are the last part of the model name, lowercased:
*
* Imbo\Model\Image => image
* Imbo\Model\FooBar => foobar
*
* @var array
*/
private $modelTypes = [
'image' => [
'image/jpeg',
'image/png',
'image/gif',
],
];
/**
* The formatter to use
*
* @var string
*/
private $formatter;
/**
* Class constructor
*
* @param array $param Parameters for the event listener
*/
public function __construct(array $params) {
$this->formatters = $params['formatters'];
$this->contentNegotiation = $params['contentNegotiation'];
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
return [
'response.send' => ['format' => 20],
'response.negotiate' => 'negotiate',
];
}
/**
* Set the formatter
*
* @param string $formatter The formatter to set
* @return self
*/
public function setFormatter($formatter) {
$this->formatter = $formatter;
return $this;
}
/**
* Get the formatter
*
* @return string
*/
public function getFormatter() {
return $this->formatter;
}
/**
* Perform content negotiation by looking the the current URL and the Accept request header
*
* @param EventInterface $event The event instance
*/
public function negotiate(EventInterface $event) {
$request = $event->getRequest();
$response = $event->getResponse();
$formatter = null;
$extension = $request->getExtension();
$routeName = (string) $request->getRoute();
$config = $event->getConfig();
$contentNegotiateImages = $config['contentNegotiateImages'];
$model = $response->getModel();
if (!$extension && !$contentNegotiateImages && $model instanceof Model\Image) {
// Configuration is telling us not to use content negotiation for images,
// instead we want to use the original format of the image
$mime = $model->getMimeType();
$formatter = $this->supportedTypes[$mime];
} else if ($extension && !($model instanceof Model\Error && $routeName === 'image')) {
// The user agent wants a specific type. Skip content negotiation completely, but not
// if the request is against the image resource, and ended up as an error, because then
// Imbo would try to render the error as an image.
$mime = $this->defaultMimeType;
if (isset($this->extensionsToMimeType[$extension])) {
$mime = $this->extensionsToMimeType[$extension];
}
$formatter = $this->supportedTypes[$mime];
} else {
// Set Vary to Accept since we are doing content negotiation based on Accept
$response->setVary('Accept', false);
// No extension have been provided
$acceptableTypes = [];
foreach (AcceptHeader::fromString($request->headers->get('Accept', '*/*'))->all() as $item) {
$acceptableTypes[$item->getValue()] = $item->getQuality();
}
$match = false;
$maxQ = 0;
// Specify which types to check for since all models can't be formatted by all
// formatters
$modelClass = get_class($model);
$modelType = strtolower(substr($modelClass, strrpos($modelClass, '\\') + 1));
$types = $this->defaultModelTypes;
if (isset($this->modelTypes[$modelType])) {
$types = $this->modelTypes[$modelType];
}
// If we are dealing with images we want to make sure the original mime type of the
// image is checked first. If the client does not really have any preference with
// regards to the mime type (*/* or image/*) this results in the original mime type of
// the image being sent.
if ($model instanceof Model\Image) {
$original = $model->getMimeType();
if ($types[0] !== $original) {
$types = array_filter($types, function($type) use ($original) {
return $type !== $original;
});
array_unshift($types, $original);
}
}
foreach ($types as $mime) {
if (($q = $this->contentNegotiation->isAcceptable($mime, $acceptableTypes)) && ($q > $maxQ)) {
$maxQ = $q;
$match = true;
$formatter = $this->supportedTypes[$mime];
}
}
if (!$match && !$event->hasArgument('noStrict')) {
// No types matched with strict mode enabled. The client does not want any of Imbo's
// supported types. Y U NO ACCEPT MY TYPES?! FFFFUUUUUUU!
throw new Exception\RuntimeException('Not acceptable', 406);
} else if (!$match) {
// There was no match but we don't want to be an ass about it. Send a response
// anyway (allowed according to RFC2616, section 10.4.7)
$formatter = $this->supportedTypes[$this->defaultMimeType];
}
}
$this->formatter = $formatter;
}
/**
* Response send hook
*
* @param EventInterface $event The current event
*/
public function format(EventInterface $event) {
$response = $event->getResponse();
$model = $response->getModel();
if ($response->getStatusCode() === 204 || !$model) {
// No content to write
return;
}
$request = $event->getRequest();
// If we are dealing with an image we want to trigger an event that handles a possible
// conversion
if ($model instanceof Model\Image) {
$eventManager = $event->getManager();
if ($this->extensionsToMimeType[$this->formatter] !== $model->getMimeType()) {
$eventManager->trigger('image.transformation.convert', [
'image' => $model,
'params' => [
'type' => $this->formatter,
],
]);
}
// Finished transforming the image
$eventManager->trigger('image.transformed', ['image' => $model]);
$formattedData = $model->getBlob();
$contentType = $model->getMimeType();
} else {
// Create an instance of the formatter
$formatter = $this->formatters[$this->formatter];
$formattedData = $formatter->format($model);
$contentType = $formatter->getContentType();
}
if ($contentType === 'application/json') {
foreach (['callback', 'jsonp', 'json'] as $validParam) {
if ($request->query->has($validParam)) {
$formattedData = sprintf("%s(%s)", $request->query->get($validParam), $formattedData);
break;
}
}
}
$response->headers->add([
'Content-Type' => $contentType,
'Content-Length' => strlen($formattedData),
]);
if ($request->getMethod() !== 'HEAD') {
$response->setContent($formattedData);
}
}
}
|
{
"content_hash": "40a3a1b40770c76852cc7f7c9b83e128",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 110,
"avg_line_length": 31.874149659863946,
"alnum_prop": 0.536442215345214,
"repo_name": "kbrabrand/imbo",
"id": "698563dd3a23a9acdd77cf50f1399d8203c177c2",
"size": "9600",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "library/Imbo/Http/Response/ResponseFormatter.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Cucumber",
"bytes": "162029"
},
{
"name": "PHP",
"bytes": "1175565"
},
{
"name": "Ruby",
"bytes": "5121"
}
],
"symlink_target": ""
}
|
/*
* Simple connect server for phantom.js
* Adapted from Modernizr
*/
var connect = require('connect')
, http = require('http')
, fs = require('fs')
, app = connect()
.use(connect.static(__dirname + '/../../'));
http.createServer(app).listen(3000);
fs.writeFileSync(__dirname + '/pid.txt', process.pid, 'utf-8')
|
{
"content_hash": "33c79aac5f86b858df4531980dddd61a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 23.571428571428573,
"alnum_prop": 0.6212121212121212,
"repo_name": "DeinDesign/css",
"id": "f1df46fc2bd1f91afb5858ad2901c8eb9fb05382",
"size": "330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bower_components/bootstrap/js/tests/server.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "98568"
},
{
"name": "CoffeeScript",
"bytes": "2554"
}
],
"symlink_target": ""
}
|
from __future__ import unicode_literals
from djangorpc.responses import Error, Msg, RpcResponse, RpcHttpResponse
from djangorpc.router import RpcRouter
__all__ = ('Error', 'Msg', 'RpcResponse', 'RpcRouter', 'RpcHttpResponse')
__version__ = '0.5'
VERSION = __version__
__description__ = 'Django RPC for jQuery'
|
{
"content_hash": "6b8fb9c4455109204938e4afc06fdc8d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 73,
"avg_line_length": 28.545454545454547,
"alnum_prop": 0.7165605095541401,
"repo_name": "Alerion/django-rpc",
"id": "0091672f6c64d18efe8063703bbd57ab0999949e",
"size": "314",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "djangorpc/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "31"
},
{
"name": "HTML",
"bytes": "10594"
},
{
"name": "JavaScript",
"bytes": "64874"
},
{
"name": "Makefile",
"bytes": "1046"
},
{
"name": "Python",
"bytes": "30553"
}
],
"symlink_target": ""
}
|
/*! UIkit 3.6.6 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
typeof define === 'function' && define.amd ? define('uikittooltip', ['uikit-util'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkitTooltip = factory(global.UIkit.util));
}(this, (function (uikitUtil) { 'use strict';
var Container = {
props: {
container: Boolean
},
data: {
container: true
},
computed: {
container: function(ref) {
var container = ref.container;
return container === true && this.$container || container && uikitUtil.$(container);
}
}
};
var Togglable = {
props: {
cls: Boolean,
animation: 'list',
duration: Number,
origin: String,
transition: String
},
data: {
cls: false,
animation: [false],
duration: 200,
origin: false,
transition: 'linear',
clsEnter: 'uk-togglabe-enter',
clsLeave: 'uk-togglabe-leave',
initProps: {
overflow: '',
height: '',
paddingTop: '',
paddingBottom: '',
marginTop: '',
marginBottom: ''
},
hideProps: {
overflow: 'hidden',
height: 0,
paddingTop: 0,
paddingBottom: 0,
marginTop: 0,
marginBottom: 0
}
},
computed: {
hasAnimation: function(ref) {
var animation = ref.animation;
return !!animation[0];
},
hasTransition: function(ref) {
var animation = ref.animation;
return this.hasAnimation && animation[0] === true;
}
},
methods: {
toggleElement: function(targets, toggle, animate) {
var this$1 = this;
return new uikitUtil.Promise(function (resolve) { return uikitUtil.Promise.all(uikitUtil.toNodes(targets).map(function (el) {
var show = uikitUtil.isBoolean(toggle) ? toggle : !this$1.isToggled(el);
if (!uikitUtil.trigger(el, ("before" + (show ? 'show' : 'hide')), [this$1])) {
return uikitUtil.Promise.reject();
}
var promise = (
uikitUtil.isFunction(animate)
? animate
: animate === false || !this$1.hasAnimation
? this$1._toggle
: this$1.hasTransition
? toggleHeight(this$1)
: toggleAnimation(this$1)
)(el, show) || uikitUtil.Promise.resolve();
uikitUtil.addClass(el, show ? this$1.clsEnter : this$1.clsLeave);
uikitUtil.trigger(el, show ? 'show' : 'hide', [this$1]);
promise
.catch(uikitUtil.noop)
.then(function () { return uikitUtil.removeClass(el, show ? this$1.clsEnter : this$1.clsLeave); });
return promise.then(function () {
uikitUtil.removeClass(el, show ? this$1.clsEnter : this$1.clsLeave);
uikitUtil.trigger(el, show ? 'shown' : 'hidden', [this$1]);
this$1.$update(el);
});
})).then(resolve, uikitUtil.noop); }
);
},
isToggled: function(el) {
if ( el === void 0 ) el = this.$el;
return uikitUtil.hasClass(this.clsEnter)
? true
: uikitUtil.hasClass(this.clsLeave)
? false
: this.cls
? uikitUtil.hasClass(el, this.cls.split(' ')[0])
: !uikitUtil.hasAttr(el, 'hidden');
},
_toggle: function(el, toggled) {
if (!el) {
return;
}
toggled = Boolean(toggled);
var changed;
if (this.cls) {
changed = uikitUtil.includes(this.cls, ' ') || toggled !== uikitUtil.hasClass(el, this.cls);
changed && uikitUtil.toggleClass(el, this.cls, uikitUtil.includes(this.cls, ' ') ? undefined : toggled);
} else {
changed = toggled === el.hidden;
changed && (el.hidden = !toggled);
}
uikitUtil.$$('[autofocus]', el).some(function (el) { return uikitUtil.isVisible(el) ? el.focus() || true : el.blur(); });
if (changed) {
uikitUtil.trigger(el, 'toggled', [toggled, this]);
this.$update(el);
}
}
}
};
function toggleHeight(ref) {
var isToggled = ref.isToggled;
var duration = ref.duration;
var initProps = ref.initProps;
var hideProps = ref.hideProps;
var transition = ref.transition;
var _toggle = ref._toggle;
return function (el, show) {
var inProgress = uikitUtil.Transition.inProgress(el);
var inner = el.hasChildNodes ? uikitUtil.toFloat(uikitUtil.css(el.firstElementChild, 'marginTop')) + uikitUtil.toFloat(uikitUtil.css(el.lastElementChild, 'marginBottom')) : 0;
var currentHeight = uikitUtil.isVisible(el) ? uikitUtil.height(el) + (inProgress ? 0 : inner) : 0;
uikitUtil.Transition.cancel(el);
if (!isToggled(el)) {
_toggle(el, true);
}
uikitUtil.height(el, '');
// Update child components first
uikitUtil.fastdom.flush();
var endHeight = uikitUtil.height(el) + (inProgress ? 0 : inner);
uikitUtil.height(el, currentHeight);
return (show
? uikitUtil.Transition.start(el, uikitUtil.assign({}, initProps, {overflow: 'hidden', height: endHeight}), Math.round(duration * (1 - currentHeight / endHeight)), transition)
: uikitUtil.Transition.start(el, hideProps, Math.round(duration * (currentHeight / endHeight)), transition).then(function () { return _toggle(el, false); })
).then(function () { return uikitUtil.css(el, initProps); });
};
}
function toggleAnimation(cmp) {
return function (el, show) {
uikitUtil.Animation.cancel(el);
var animation = cmp.animation;
var duration = cmp.duration;
var _toggle = cmp._toggle;
if (show) {
_toggle(el, true);
return uikitUtil.Animation.in(el, animation[0], duration, cmp.origin);
}
return uikitUtil.Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(function () { return _toggle(el, false); });
};
}
var Position = {
props: {
pos: String,
offset: null,
flip: Boolean,
clsPos: String
},
data: {
pos: ("bottom-" + (!uikitUtil.isRtl ? 'left' : 'right')),
flip: true,
offset: false,
clsPos: ''
},
computed: {
pos: function(ref) {
var pos = ref.pos;
return (pos + (!uikitUtil.includes(pos, '-') ? '-center' : '')).split('-');
},
dir: function() {
return this.pos[0];
},
align: function() {
return this.pos[1];
}
},
methods: {
positionAt: function(element, target, boundary) {
uikitUtil.removeClasses(element, ((this.clsPos) + "-(top|bottom|left|right)(-[a-z]+)?"));
var ref = this;
var offset = ref.offset;
var axis = this.getAxis();
if (!uikitUtil.isNumeric(offset)) {
var node = uikitUtil.$(offset);
offset = node
? uikitUtil.offset(node)[axis === 'x' ? 'left' : 'top'] - uikitUtil.offset(target)[axis === 'x' ? 'right' : 'bottom']
: 0;
}
var ref$1 = uikitUtil.positionAt(
element,
target,
axis === 'x' ? ((uikitUtil.flipPosition(this.dir)) + " " + (this.align)) : ((this.align) + " " + (uikitUtil.flipPosition(this.dir))),
axis === 'x' ? ((this.dir) + " " + (this.align)) : ((this.align) + " " + (this.dir)),
axis === 'x' ? ("" + (this.dir === 'left' ? -offset : offset)) : (" " + (this.dir === 'top' ? -offset : offset)),
null,
this.flip,
boundary
).target;
var x = ref$1.x;
var y = ref$1.y;
this.dir = axis === 'x' ? x : y;
this.align = axis === 'x' ? y : x;
uikitUtil.toggleClass(element, ((this.clsPos) + "-" + (this.dir) + "-" + (this.align)), this.offset === false);
},
getAxis: function() {
return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
}
}
};
var obj;
var Component = {
mixins: [Container, Togglable, Position],
args: 'title',
props: {
delay: Number,
title: String
},
data: {
pos: 'top',
title: '',
delay: 0,
animation: ['uk-animation-scale-up'],
duration: 100,
cls: 'uk-active',
clsPos: 'uk-tooltip'
},
beforeConnect: function() {
this._hasTitle = uikitUtil.hasAttr(this.$el, 'title');
uikitUtil.attr(this.$el, 'title', '');
this.updateAria(false);
makeFocusable(this.$el);
},
disconnected: function() {
this.hide();
uikitUtil.attr(this.$el, 'title', this._hasTitle ? this.title : null);
},
methods: {
show: function() {
var this$1 = this;
if (this.isToggled(this.tooltip) || !this.title) {
return;
}
this._unbind = uikitUtil.once(document, 'show keydown', this.hide, false, function (e) { return e.type === 'keydown' && e.keyCode === 27
|| e.type === 'show' && e.detail[0] !== this$1 && e.detail[0].$name === this$1.$name; }
);
clearTimeout(this.showTimer);
this.showTimer = setTimeout(this._show, this.delay);
},
hide: function() {
var this$1 = this;
if (uikitUtil.matches(this.$el, 'input:focus')) {
return;
}
clearTimeout(this.showTimer);
if (!this.isToggled(this.tooltip)) {
return;
}
this.toggleElement(this.tooltip, false, false).then(function () {
this$1.tooltip = uikitUtil.remove(this$1.tooltip);
this$1._unbind();
});
},
_show: function() {
var this$1 = this;
this.tooltip = uikitUtil.append(this.container,
("<div class=\"" + (this.clsPos) + "\"> <div class=\"" + (this.clsPos) + "-inner\">" + (this.title) + "</div> </div>")
);
uikitUtil.on(this.tooltip, 'toggled', function (e, toggled) {
this$1.updateAria(toggled);
if (!toggled) {
return;
}
this$1.positionAt(this$1.tooltip, this$1.$el);
this$1.origin = this$1.getAxis() === 'y'
? ((uikitUtil.flipPosition(this$1.dir)) + "-" + (this$1.align))
: ((this$1.align) + "-" + (uikitUtil.flipPosition(this$1.dir)));
});
this.toggleElement(this.tooltip, true);
},
updateAria: function(toggled) {
uikitUtil.attr(this.$el, 'aria-expanded', toggled);
}
},
events: ( obj = {
focus: 'show',
blur: 'hide'
}, obj[(uikitUtil.pointerEnter + " " + uikitUtil.pointerLeave)] = function (e) {
if (uikitUtil.isTouch(e)) {
return;
}
e.type === uikitUtil.pointerEnter
? this.show()
: this.hide();
}, obj )
};
function makeFocusable(el) {
if (!isFocusable(el)) {
uikitUtil.attr(el, 'tabindex', '0');
}
}
function isFocusable(el) {
return uikitUtil.isInput(el) || uikitUtil.matches(el, 'a,button') || uikitUtil.hasAttr(el, 'tabindex');
}
if (typeof window !== 'undefined' && window.UIkit) {
window.UIkit.component('tooltip', Component);
}
return Component;
})));
|
{
"content_hash": "1b0f486ca8e9b4c152c505416c24bbd0",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 190,
"avg_line_length": 31.54566210045662,
"alnum_prop": 0.4463342259535355,
"repo_name": "cdnjs/cdnjs",
"id": "01250b9a5deecc747a4ce5f462eb982c5f21b5b5",
"size": "13817",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/uikit/3.6.6/js/components/tooltip.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
package net.kleinhaneveld.cli.instantiator;
import net.kleinhaneveld.cli.collection.ServiceLoaderStreamer;
public class ServiceLoaderInstantiator implements Instantiator {
@Override
public <T> T instantiate(Class<T> aClass) {
return ServiceLoaderStreamer.loadUniqueInstance(aClass);
}
}
|
{
"content_hash": "7ce8cacd34e3ff33affdccb68a955e11",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 64,
"avg_line_length": 30.9,
"alnum_prop": 0.7831715210355987,
"repo_name": "peterpaul/cli",
"id": "2c17f8aaceddc7ff1d263b5160787241817567d0",
"size": "309",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/kleinhaneveld/cli/instantiator/ServiceLoaderInstantiator.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "66823"
}
],
"symlink_target": ""
}
|
var request = require('request');
var jsdom = require('jsdom');
const sinon = require('sinon');
module.exports = {
description: "a function `postNewKanyeQuote` exists, that, when called, makes a POST request (with `method: \"POST\"` - using the method key, and \"POST\" in all caps) using jQuery to `https://randomquote.hoff.tech/api/lists/kanyequotes` (it doesn't matter what quote you submit)",
assert: function(url, cb) {
request(url, function(error, response, body) {
if (!error && response.statusCode == 200) {
jsdom.env(body, {
url: url,
features: {
FetchExternalResources: ["link", "css", "script"],
ProcessExternalResources: ["script"]
},
done: (error, window) => {
try {
if ("$" in window) {
var mySpy = sinon.spy(window.$, "ajax");
}
if ("postNewKanyeQuote" in window) {
window.postNewKanyeQuote();
}
if ((mySpy.callCount >= 1) && mySpy.calledWithMatch({
url: "https://randomquote.hoff.tech/api/lists/kanyequotes",
method: "POST"
})) {
this.passed = true;
} else {
this.passed = false;
}
return cb(null, this);
} catch (e) {
this.passed = false;
return cb(null, this);
}
}
});
} else {
this.passed = false;
cb(null, this);
}
}.bind(this));
}
};
|
{
"content_hash": "86b0d4edd6727324585aa5814ba5b9b4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 282,
"avg_line_length": 30.466666666666665,
"alnum_prop": 0.5696571845368344,
"repo_name": "kenhoff/grader",
"id": "2033b3632fe3ca93247e5134e20a2bbf38663b8b",
"size": "1371",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "assignments/tests/jquery_post_request.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "48227"
}
],
"symlink_target": ""
}
|
export class Card {
number: string;
expires: string;
name: string;
cvv: string;
constructor(number: string, expires: string, name: string, cvv: string) {
this.number = number;
this.expires = expires;
this.name = name;
this.cvv = cvv;
}
}
|
{
"content_hash": "1c721edaa10517cd9db062a6fa2b0f1d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 20.53846153846154,
"alnum_prop": 0.6367041198501873,
"repo_name": "dhilt/a2-mkdev-sub",
"id": "75ac86daba1f1b5ff18d4845989de6eb09d59f49",
"size": "267",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/payment/card.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "199560"
},
{
"name": "HTML",
"bytes": "5676"
},
{
"name": "JavaScript",
"bytes": "17160"
},
{
"name": "TypeScript",
"bytes": "10252"
}
],
"symlink_target": ""
}
|
*,
*:before,
*:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }
html,
body {
font-size: 100%; }
body {
background: white;
color: #222222;
padding: 0;
margin: 0;
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
font-weight: normal;
font-style: normal;
line-height: 1;
position: relative; }
a:focus {
outline: none; }
img,
object,
embed {
max-width: 100%;
height: auto; }
object,
embed {
height: 100%; }
img {
-ms-interpolation-mode: bicubic; }
#map_canvas img,
#map_canvas embed,
#map_canvas object,
.map_canvas img,
.map_canvas embed,
.map_canvas object {
max-width: none !important; }
.left {
float: left !important; }
.right {
float: right !important; }
.text-left {
text-align: left !important; }
.text-right {
text-align: right !important; }
.text-center {
text-align: center !important; }
.text-justify {
text-align: justify !important; }
.hide {
display: none; }
.antialiased {
-webkit-font-smoothing: antialiased; }
img {
display: inline-block;
vertical-align: middle; }
textarea {
height: auto;
min-height: 50px; }
select {
width: 100%; }
/* Grid HTML Classes */
.row {
width: 100%;
margin-left: auto;
margin-right: auto;
margin-top: 0;
margin-bottom: 0;
max-width: 62.5em;
*zoom: 1; }
.row:before, .row:after {
content: " ";
display: table; }
.row:after {
clear: both; }
.row.collapse .column,
.row.collapse .columns {
position: relative;
padding-left: 0;
padding-right: 0;
float: left; }
.row .row {
width: auto;
margin-left: -0.9375em;
margin-right: -0.9375em;
margin-top: 0;
margin-bottom: 0;
max-width: none;
*zoom: 1; }
.row .row:before, .row .row:after {
content: " ";
display: table; }
.row .row:after {
clear: both; }
.row .row.collapse {
width: auto;
margin: 0;
max-width: none;
*zoom: 1; }
.row .row.collapse:before, .row .row.collapse:after {
content: " ";
display: table; }
.row .row.collapse:after {
clear: both; }
.column,
.columns {
position: relative;
padding-left: 0.9375em;
padding-right: 0.9375em;
width: 100%;
float: left; }
@media only screen {
.column,
.columns {
position: relative;
padding-left: 0.9375em;
padding-right: 0.9375em;
float: left; }
.small-1 {
position: relative;
width: 8.33333%; }
.small-2 {
position: relative;
width: 16.66667%; }
.small-3 {
position: relative;
width: 25%; }
.small-4 {
position: relative;
width: 33.33333%; }
.small-5 {
position: relative;
width: 41.66667%; }
.small-6 {
position: relative;
width: 50%; }
.small-7 {
position: relative;
width: 58.33333%; }
.small-8 {
position: relative;
width: 66.66667%; }
.small-9 {
position: relative;
width: 75%; }
.small-10 {
position: relative;
width: 83.33333%; }
.small-11 {
position: relative;
width: 91.66667%; }
.small-12 {
position: relative;
width: 100%; }
.small-offset-1 {
position: relative;
margin-left: 8.33333%; }
.small-offset-2 {
position: relative;
margin-left: 16.66667%; }
.small-offset-3 {
position: relative;
margin-left: 25%; }
.small-offset-4 {
position: relative;
margin-left: 33.33333%; }
.small-offset-5 {
position: relative;
margin-left: 41.66667%; }
.small-offset-6 {
position: relative;
margin-left: 50%; }
.small-offset-7 {
position: relative;
margin-left: 58.33333%; }
.small-offset-8 {
position: relative;
margin-left: 66.66667%; }
.small-offset-9 {
position: relative;
margin-left: 75%; }
.small-offset-10 {
position: relative;
margin-left: 83.33333%; }
[class*="column"] + [class*="column"]:last-child {
float: right; }
[class*="column"] + [class*="column"].end {
float: left; }
.column.small-centered,
.columns.small-centered {
position: relative;
margin-left: auto;
margin-right: auto;
float: none !important; } }
/* Styles for screens that are atleast 768px; */
@media only screen and (min-width: 48em) {
.large-1 {
position: relative;
width: 8.33333%; }
.large-2 {
position: relative;
width: 16.66667%; }
.large-3 {
position: relative;
width: 25%; }
.large-4 {
position: relative;
width: 33.33333%; }
.large-5 {
position: relative;
width: 41.66667%; }
.large-6 {
position: relative;
width: 50%; }
.large-7 {
position: relative;
width: 58.33333%; }
.large-8 {
position: relative;
width: 66.66667%; }
.large-9 {
position: relative;
width: 75%; }
.large-10 {
position: relative;
width: 83.33333%; }
.large-11 {
position: relative;
width: 91.66667%; }
.large-12 {
position: relative;
width: 100%; }
.row .large-offset-1 {
position: relative;
margin-left: 8.33333%; }
.row .large-offset-2 {
position: relative;
margin-left: 16.66667%; }
.row .large-offset-3 {
position: relative;
margin-left: 25%; }
.row .large-offset-4 {
position: relative;
margin-left: 33.33333%; }
.row .large-offset-5 {
position: relative;
margin-left: 41.66667%; }
.row .large-offset-6 {
position: relative;
margin-left: 50%; }
.row .large-offset-7 {
position: relative;
margin-left: 58.33333%; }
.row .large-offset-8 {
position: relative;
margin-left: 66.66667%; }
.row .large-offset-9 {
position: relative;
margin-left: 75%; }
.row .large-offset-10 {
position: relative;
margin-left: 83.33333%; }
.row .large-offset-11 {
position: relative;
margin-left: 91.66667%; }
.push-1 {
position: relative;
left: 8.33333%;
right: auto; }
.pull-1 {
position: relative;
right: 8.33333%;
left: auto; }
.push-2 {
position: relative;
left: 16.66667%;
right: auto; }
.pull-2 {
position: relative;
right: 16.66667%;
left: auto; }
.push-3 {
position: relative;
left: 25%;
right: auto; }
.pull-3 {
position: relative;
right: 25%;
left: auto; }
.push-4 {
position: relative;
left: 33.33333%;
right: auto; }
.pull-4 {
position: relative;
right: 33.33333%;
left: auto; }
.push-5 {
position: relative;
left: 41.66667%;
right: auto; }
.pull-5 {
position: relative;
right: 41.66667%;
left: auto; }
.push-6 {
position: relative;
left: 50%;
right: auto; }
.pull-6 {
position: relative;
right: 50%;
left: auto; }
.push-7 {
position: relative;
left: 58.33333%;
right: auto; }
.pull-7 {
position: relative;
right: 58.33333%;
left: auto; }
.push-8 {
position: relative;
left: 66.66667%;
right: auto; }
.pull-8 {
position: relative;
right: 66.66667%;
left: auto; }
.push-9 {
position: relative;
left: 75%;
right: auto; }
.pull-9 {
position: relative;
right: 75%;
left: auto; }
.push-10 {
position: relative;
left: 83.33333%;
right: auto; }
.pull-10 {
position: relative;
right: 83.33333%;
left: auto; }
.push-11 {
position: relative;
left: 91.66667%;
right: auto; }
.pull-11 {
position: relative;
right: 91.66667%;
left: auto; }
.small-push-1 {
left: inherit; }
.small-pull-1 {
right: inherit; }
.small-push-2 {
left: inherit; }
.small-pull-2 {
right: inherit; }
.small-push-3 {
left: inherit; }
.small-pull-3 {
right: inherit; }
.small-push-4 {
left: inherit; }
.small-pull-4 {
right: inherit; }
.small-push-5 {
left: inherit; }
.small-pull-5 {
right: inherit; }
.small-push-6 {
left: inherit; }
.small-pull-6 {
right: inherit; }
.small-push-7 {
left: inherit; }
.small-pull-7 {
right: inherit; }
.small-push-8 {
left: inherit; }
.small-pull-8 {
right: inherit; }
.small-push-9 {
left: inherit; }
.small-pull-9 {
right: inherit; }
.small-push-10 {
left: inherit; }
.small-pull-10 {
right: inherit; }
.small-push-11 {
left: inherit; }
.small-pull-11 {
right: inherit; }
.column.large-centered,
.columns.large-centered {
position: relative;
margin-left: auto;
margin-right: auto;
float: none !important; }
.column.large-uncentered,
.columns.large-uncentered {
margin-left: 0;
margin-right: 0;
float: none; } }
/* Foundation Visibility HTML Classes */
.show-for-small,
.show-for-medium-down,
.show-for-large-down {
display: inherit !important; }
.show-for-medium,
.show-for-medium-up,
.show-for-large,
.show-for-large-up,
.show-for-xlarge {
display: none !important; }
.hide-for-medium,
.hide-for-medium-up,
.hide-for-large,
.hide-for-large-up,
.hide-for-xlarge {
display: inherit !important; }
.hide-for-small,
.hide-for-medium-down,
.hide-for-large-down {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-small, table.show-for-medium-down, table.show-for-large-down, table.hide-for-medium, table.hide-for-medium-up, table.hide-for-large, table.hide-for-large-up, table.hide-for-xlarge {
display: table; }
thead.show-for-small, thead.show-for-medium-down, thead.show-for-large-down, thead.hide-for-medium, thead.hide-for-medium-up, thead.hide-for-large, thead.hide-for-large-up, thead.hide-for-xlarge {
display: table-header-group !important; }
tbody.show-for-small, tbody.show-for-medium-down, tbody.show-for-large-down, tbody.hide-for-medium, tbody.hide-for-medium-up, tbody.hide-for-large, tbody.hide-for-large-up, tbody.hide-for-xlarge {
display: table-row-group !important; }
tr.show-for-small, tr.show-for-medium-down, tr.show-for-large-down, tr.hide-for-medium, tr.hide-for-medium-up, tr.hide-for-large, tr.hide-for-large-up, tr.hide-for-xlarge {
display: table-row !important; }
td.show-for-small, td.show-for-medium-down, td.show-for-large-down, td.hide-for-medium, td.hide-for-medium-up, td.hide-for-large, td.hide-for-large-up, td.hide-for-xlarge,
th.show-for-small,
th.show-for-medium-down,
th.show-for-large-down,
th.hide-for-medium,
th.hide-for-medium-up,
th.hide-for-large,
th.hide-for-large-up,
th.hide-for-xlarge {
display: table-cell !important; }
/* Medium Displays: 768px - 1279px */
@media only screen and (min-width: 48em) {
.show-for-medium,
.show-for-medium-up {
display: inherit !important; }
.show-for-small {
display: none !important; }
.hide-for-small {
display: inherit !important; }
.hide-for-medium,
.hide-for-medium-up {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-medium, table.show-for-medium-up, table.hide-for-small {
display: table; }
thead.show-for-medium, thead.show-for-medium-up, thead.hide-for-small {
display: table-header-group !important; }
tbody.show-for-medium, tbody.show-for-medium-up, tbody.hide-for-small {
display: table-row-group !important; }
tr.show-for-medium, tr.show-for-medium-up, tr.hide-for-small {
display: table-row !important; }
td.show-for-medium, td.show-for-medium-up, td.hide-for-small,
th.show-for-medium,
th.show-for-medium-up,
th.hide-for-small {
display: table-cell !important; } }
/* Large Displays: 1280px - 1440px */
@media only screen and (min-width: 80em) {
.show-for-large,
.show-for-large-up {
display: inherit !important; }
.show-for-medium,
.show-for-medium-down {
display: none !important; }
.hide-for-medium,
.hide-for-medium-down {
display: inherit !important; }
.hide-for-large,
.hide-for-large-up {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-large, table.show-for-large-up, table.hide-for-medium, table.hide-for-medium-down {
display: table; }
thead.show-for-large, thead.show-for-large-up, thead.hide-for-medium, thead.hide-for-medium-down {
display: table-header-group !important; }
tbody.show-for-large, tbody.show-for-large-up, tbody.hide-for-medium, tbody.hide-for-medium-down {
display: table-row-group !important; }
tr.show-for-large, tr.show-for-large-up, tr.hide-for-medium, tr.hide-for-medium-down {
display: table-row !important; }
td.show-for-large, td.show-for-large-up, td.hide-for-medium, td.hide-for-medium-down,
th.show-for-large,
th.show-for-large-up,
th.hide-for-medium,
th.hide-for-medium-down {
display: table-cell !important; } }
/* X-Large Displays: 1400px and up */
@media only screen and (min-width: 90em) {
.show-for-xlarge {
display: inherit !important; }
.show-for-large,
.show-for-large-down {
display: none !important; }
.hide-for-large,
.hide-for-large-down {
display: inherit !important; }
.hide-for-xlarge {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-xlarge, table.hide-for-large, table.hide-for-large-down {
display: table; }
thead.show-for-xlarge, thead.hide-for-large, thead.hide-for-large-down {
display: table-header-group !important; }
tbody.show-for-xlarge, tbody.hide-for-large, tbody.hide-for-large-down {
display: table-row-group !important; }
tr.show-for-xlarge, tr.hide-for-large, tr.hide-for-large-down {
display: table-row !important; }
td.show-for-xlarge, td.hide-for-large, td.hide-for-large-down,
th.show-for-xlarge,
th.hide-for-large,
th.hide-for-large-down {
display: table-cell !important; } }
/* Orientation targeting */
.show-for-landscape,
.hide-for-portrait {
display: inherit !important; }
.hide-for-landscape,
.show-for-portrait {
display: none !important; }
/* Specific visilbity for tables */
table.hide-for-landscape, table.show-for-portrait {
display: table; }
thead.hide-for-landscape, thead.show-for-portrait {
display: table-header-group !important; }
tbody.hide-for-landscape, tbody.show-for-portrait {
display: table-row-group !important; }
tr.hide-for-landscape, tr.show-for-portrait {
display: table-row !important; }
td.hide-for-landscape, td.show-for-portrait,
th.hide-for-landscape,
th.show-for-portrait {
display: table-cell !important; }
@media only screen and (orientation: landscape) {
.show-for-landscape,
.hide-for-portrait {
display: inherit !important; }
.hide-for-landscape,
.show-for-portrait {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-landscape, table.hide-for-portrait {
display: table; }
thead.show-for-landscape, thead.hide-for-portrait {
display: table-header-group !important; }
tbody.show-for-landscape, tbody.hide-for-portrait {
display: table-row-group !important; }
tr.show-for-landscape, tr.hide-for-portrait {
display: table-row !important; }
td.show-for-landscape, td.hide-for-portrait,
th.show-for-landscape,
th.hide-for-portrait {
display: table-cell !important; } }
@media only screen and (orientation: portrait) {
.show-for-portrait,
.hide-for-landscape {
display: inherit !important; }
.hide-for-portrait,
.show-for-landscape {
display: none !important; }
/* Specific visilbity for tables */
table.show-for-portrait, table.hide-for-landscape {
display: table; }
thead.show-for-portrait, thead.hide-for-landscape {
display: table-header-group !important; }
tbody.show-for-portrait, tbody.hide-for-landscape {
display: table-row-group !important; }
tr.show-for-portrait, tr.hide-for-landscape {
display: table-row !important; }
td.show-for-portrait, td.hide-for-landscape,
th.show-for-portrait,
th.hide-for-landscape {
display: table-cell !important; } }
/* Touch-enabled device targeting */
.show-for-touch {
display: none !important; }
.hide-for-touch {
display: inherit !important; }
.touch .show-for-touch {
display: inherit !important; }
.touch .hide-for-touch {
display: none !important; }
/* Specific visilbity for tables */
table.hide-for-touch {
display: table; }
.touch table.show-for-touch {
display: table; }
thead.hide-for-touch {
display: table-header-group !important; }
.touch thead.show-for-touch {
display: table-header-group !important; }
tbody.hide-for-touch {
display: table-row-group !important; }
.touch tbody.show-for-touch {
display: table-row-group !important; }
tr.hide-for-touch {
display: table-row !important; }
.touch tr.show-for-touch {
display: table-row !important; }
td.hide-for-touch {
display: table-cell !important; }
.touch td.show-for-touch {
display: table-cell !important; }
th.hide-for-touch {
display: table-cell !important; }
.touch th.show-for-touch {
display: table-cell !important; }
/* Foundation Block Grids for below small breakpoint */
@media only screen {
[class*="block-grid-"] {
display: block;
padding: 0;
margin: 0 -10px;
*zoom: 1; }
[class*="block-grid-"]:before, [class*="block-grid-"]:after {
content: " ";
display: table; }
[class*="block-grid-"]:after {
clear: both; }
[class*="block-grid-"] > li {
display: inline;
height: auto;
float: left;
padding: 0 10px 10px; }
.small-block-grid-1 > li {
width: 100%;
padding: 0 10px 10px; }
.small-block-grid-1 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-1 > li:nth-of-type(1n+1) {
clear: both; }
.small-block-grid-2 > li {
width: 50%;
padding: 0 10px 10px; }
.small-block-grid-2 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-2 > li:nth-of-type(2n+1) {
clear: both; }
.small-block-grid-3 > li {
width: 33.33333%;
padding: 0 10px 10px; }
.small-block-grid-3 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-3 > li:nth-of-type(3n+1) {
clear: both; }
.small-block-grid-4 > li {
width: 25%;
padding: 0 10px 10px; }
.small-block-grid-4 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-4 > li:nth-of-type(4n+1) {
clear: both; }
.small-block-grid-5 > li {
width: 20%;
padding: 0 10px 10px; }
.small-block-grid-5 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-5 > li:nth-of-type(5n+1) {
clear: both; }
.small-block-grid-6 > li {
width: 16.66667%;
padding: 0 10px 10px; }
.small-block-grid-6 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-6 > li:nth-of-type(6n+1) {
clear: both; }
.small-block-grid-7 > li {
width: 14.28571%;
padding: 0 10px 10px; }
.small-block-grid-7 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-7 > li:nth-of-type(7n+1) {
clear: both; }
.small-block-grid-8 > li {
width: 12.5%;
padding: 0 10px 10px; }
.small-block-grid-8 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-8 > li:nth-of-type(8n+1) {
clear: both; }
.small-block-grid-9 > li {
width: 11.11111%;
padding: 0 10px 10px; }
.small-block-grid-9 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-9 > li:nth-of-type(9n+1) {
clear: both; }
.small-block-grid-10 > li {
width: 10%;
padding: 0 10px 10px; }
.small-block-grid-10 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-10 > li:nth-of-type(10n+1) {
clear: both; }
.small-block-grid-11 > li {
width: 9.09091%;
padding: 0 10px 10px; }
.small-block-grid-11 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-11 > li:nth-of-type(11n+1) {
clear: both; }
.small-block-grid-12 > li {
width: 8.33333%;
padding: 0 10px 10px; }
.small-block-grid-12 > li:nth-of-type(n) {
clear: none; }
.small-block-grid-12 > li:nth-of-type(12n+1) {
clear: both; } }
/* Foundation Block Grids for above small breakpoint */
@media only screen and (min-width: 48em) {
/* Remove small grid clearing */
.small-block-grid-1 > li:nth-of-type(1n+1) {
clear: none; }
.small-block-grid-2 > li:nth-of-type(2n+1) {
clear: none; }
.small-block-grid-3 > li:nth-of-type(3n+1) {
clear: none; }
.small-block-grid-4 > li:nth-of-type(4n+1) {
clear: none; }
.small-block-grid-5 > li:nth-of-type(5n+1) {
clear: none; }
.small-block-grid-6 > li:nth-of-type(6n+1) {
clear: none; }
.small-block-grid-7 > li:nth-of-type(7n+1) {
clear: none; }
.small-block-grid-8 > li:nth-of-type(8n+1) {
clear: none; }
.small-block-grid-9 > li:nth-of-type(9n+1) {
clear: none; }
.small-block-grid-10 > li:nth-of-type(10n+1) {
clear: none; }
.small-block-grid-11 > li:nth-of-type(11n+1) {
clear: none; }
.small-block-grid-12 > li:nth-of-type(12n+1) {
clear: none; }
.large-block-grid-1 > li {
width: 100%;
padding: 0 10px 10px; }
.large-block-grid-1 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-1 > li:nth-of-type(1n+1) {
clear: both; }
.large-block-grid-2 > li {
width: 50%;
padding: 0 10px 10px; }
.large-block-grid-2 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-2 > li:nth-of-type(2n+1) {
clear: both; }
.large-block-grid-3 > li {
width: 33.33333%;
padding: 0 10px 10px; }
.large-block-grid-3 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-3 > li:nth-of-type(3n+1) {
clear: both; }
.large-block-grid-4 > li {
width: 25%;
padding: 0 10px 10px; }
.large-block-grid-4 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-4 > li:nth-of-type(4n+1) {
clear: both; }
.large-block-grid-5 > li {
width: 20%;
padding: 0 10px 10px; }
.large-block-grid-5 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-5 > li:nth-of-type(5n+1) {
clear: both; }
.large-block-grid-6 > li {
width: 16.66667%;
padding: 0 10px 10px; }
.large-block-grid-6 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-6 > li:nth-of-type(6n+1) {
clear: both; }
.large-block-grid-7 > li {
width: 14.28571%;
padding: 0 10px 10px; }
.large-block-grid-7 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-7 > li:nth-of-type(7n+1) {
clear: both; }
.large-block-grid-8 > li {
width: 12.5%;
padding: 0 10px 10px; }
.large-block-grid-8 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-8 > li:nth-of-type(8n+1) {
clear: both; }
.large-block-grid-9 > li {
width: 11.11111%;
padding: 0 10px 10px; }
.large-block-grid-9 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-9 > li:nth-of-type(9n+1) {
clear: both; }
.large-block-grid-10 > li {
width: 10%;
padding: 0 10px 10px; }
.large-block-grid-10 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-10 > li:nth-of-type(10n+1) {
clear: both; }
.large-block-grid-11 > li {
width: 9.09091%;
padding: 0 10px 10px; }
.large-block-grid-11 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-11 > li:nth-of-type(11n+1) {
clear: both; }
.large-block-grid-12 > li {
width: 8.33333%;
padding: 0 10px 10px; }
.large-block-grid-12 > li:nth-of-type(n) {
clear: none; }
.large-block-grid-12 > li:nth-of-type(12n+1) {
clear: both; } }
p.lead {
font-size: 1.21875em;
line-height: 1.6; }
.subheader {
line-height: 1.4;
color: #6f6f6f;
font-weight: 300;
margin-top: 0.2em;
margin-bottom: 0.5em; }
/* Typography resets */
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
p,
blockquote,
th,
td {
margin: 0;
padding: 0;
direction: ltr; }
/* Default Link Styles */
a {
color: #c8dae4;
text-decoration: none;
line-height: inherit; }
a:hover, a:focus {
color: #b7cedc; }
a img {
border: none; }
/* Default paragraph styles */
p {
font-family: inherit;
font-weight: normal;
font-size: 1em;
line-height: 1.6;
margin-bottom: 1.25em;
text-rendering: optimizeLegibility; }
p aside {
font-size: 0.875em;
line-height: 1.35;
font-style: italic; }
/* Default header styles */
h1, h2, h3, h4, h5, h6 {
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
font-weight: bold;
font-style: normal;
color: #222222;
text-rendering: optimizeLegibility;
margin-top: 0.2em;
margin-bottom: 0.5em;
line-height: 1.2125em; }
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small {
font-size: 60%;
color: #6f6f6f;
line-height: 0; }
h1 {
font-size: 2.125em; }
h2 {
font-size: 1.6875em; }
h3 {
font-size: 1.375em; }
h4 {
font-size: 1.125em; }
h5 {
font-size: 1.125em; }
h6 {
font-size: 1em; }
hr {
border: solid #dddddd;
border-width: 1px 0 0;
clear: both;
margin: 1.25em 0 1.1875em;
height: 0; }
/* Helpful Typography Defaults */
em,
i {
font-style: italic;
line-height: inherit; }
strong,
b {
font-weight: bold;
line-height: inherit; }
small {
font-size: 60%;
line-height: inherit; }
code {
font-family: Consolas, "Liberation Mono", Courier, monospace;
font-weight: bold;
color: #7f0a0c; }
/* Lists */
ul,
ol,
dl {
font-size: 1em;
line-height: 1.6;
margin-bottom: 1.25em;
list-style-position: outside;
font-family: inherit; }
/* Unordered Lists */
ul li ul,
ul li ol {
margin-left: 1.25em;
margin-bottom: 0;
font-size: 1em;
/* Override nested font-size change */ }
ul.square li ul, ul.circle li ul, ul.disc li ul {
list-style: inherit; }
ul.square {
list-style-type: square; }
ul.circle {
list-style-type: circle; }
ul.disc {
list-style-type: disc; }
ul.no-bullet {
list-style: none; }
/* Ordered Lists */
ol li ul,
ol li ol {
margin-left: 1.25em;
margin-bottom: 0; }
/* Definition Lists */
dl dt {
margin-bottom: 0.3em;
font-weight: bold; }
dl dd {
margin-bottom: 0.75em; }
/* Abbreviations */
abbr,
acronym {
text-transform: uppercase;
font-size: 90%;
color: #222222;
border-bottom: 1px dotted #dddddd;
cursor: help; }
abbr {
text-transform: none; }
/* Blockquotes */
blockquote {
margin: 0 0 1.25em;
padding: 0.5625em 1.25em 0 1.1875em;
border-left: 1px solid #dddddd; }
blockquote cite {
display: block;
font-size: 0.8125em;
color: #555555; }
blockquote cite:before {
content: "\2014 \0020"; }
blockquote cite a,
blockquote cite a:visited {
color: #555555; }
blockquote,
blockquote p {
line-height: 1.6;
color: #6f6f6f; }
/* Microformats */
.vcard {
display: inline-block;
margin: 0 0 1.25em 0;
border: 1px solid #dddddd;
padding: 0.625em 0.75em; }
.vcard li {
margin: 0;
display: block; }
.vcard .fn {
font-weight: bold;
font-size: 0.9375em; }
.vevent .summary {
font-weight: bold; }
.vevent abbr {
cursor: default;
text-decoration: none;
font-weight: bold;
border: none;
padding: 0 0.0625em; }
@media only screen and (min-width: 48em) {
h1, h2, h3, h4, h5, h6 {
line-height: 1.4; }
h1 {
font-size: 2.75em; }
h2 {
font-size: 2.3125em; }
h3 {
font-size: 1.6875em; }
h4 {
font-size: 1.4375em; } }
/*
* Print styles.
*
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/
* Credit to Paul Irish and HTML5 Boilerplate (html5boilerplate.com)
*/
.print-only {
display: none !important; }
@media print {
* {
background: transparent !important;
color: black !important;
/* Black prints faster: h5bp.com/s */
box-shadow: none !important;
text-shadow: none !important; }
a,
a:visited {
text-decoration: underline; }
a[href]:after {
content: " (" attr(href) ")"; }
abbr[title]:after {
content: " (" attr(title) ")"; }
.ir a:after,
a[href^="javascript:"]:after,
a[href^="#"]:after {
content: ""; }
pre,
blockquote {
border: 1px solid #999999;
page-break-inside: avoid; }
thead {
display: table-header-group;
/* h5bp.com/t */ }
tr,
img {
page-break-inside: avoid; }
img {
max-width: 100% !important; }
@page {
margin: 0.5cm; }
p,
h2,
h3 {
orphans: 3;
widows: 3; }
h2,
h3 {
page-break-after: avoid; }
.hide-on-print {
display: none !important; }
.print-only {
display: block !important; }
.hide-for-print {
display: none !important; }
.show-for-print {
display: inherit !important; } }
button, .button {
border-style: solid;
border-width: 1px;
cursor: pointer;
font-family: inherit;
font-weight: bold;
line-height: 1;
margin: 0 0 1.25em;
position: relative;
text-decoration: none;
text-align: center;
display: inline-block;
padding-top: 0.75em;
padding-right: 1.5em;
padding-bottom: 0.8125em;
padding-left: 1.5em;
font-size: 1em;
background-color: #c8dae4;
border-color: #a6c3d3;
color: #333333; }
button:hover, button:focus, .button:hover, .button:focus {
background-color: #a6c3d3; }
button:hover, button:focus, .button:hover, .button:focus {
color: #333333; }
button.secondary, .button.secondary {
background-color: #e9e9e9;
border-color: #d0d0d0;
color: #333333; }
button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
background-color: #d0d0d0; }
button.secondary:hover, button.secondary:focus, .button.secondary:hover, .button.secondary:focus {
color: #333333; }
button.success, .button.success {
background-color: #5da423;
border-color: #457a1a;
color: white; }
button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
background-color: #457a1a; }
button.success:hover, button.success:focus, .button.success:hover, .button.success:focus {
color: white; }
button.alert, .button.alert {
background-color: #c60f13;
border-color: #970b0e;
color: white; }
button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
background-color: #970b0e; }
button.alert:hover, button.alert:focus, .button.alert:hover, .button.alert:focus {
color: white; }
button.large, .button.large {
padding-top: 1em;
padding-right: 2em;
padding-bottom: 1.0625em;
padding-left: 2em;
font-size: 1.25em; }
button.small, .button.small {
padding-top: 0.5625em;
padding-right: 1.125em;
padding-bottom: 0.625em;
padding-left: 1.125em;
font-size: 0.8125em; }
button.tiny, .button.tiny {
padding-top: 0.4375em;
padding-right: 0.875em;
padding-bottom: 0.5em;
padding-left: 0.875em;
font-size: 0.6875em; }
button.expand, .button.expand {
padding-right: 0px;
padding-left: 0px;
width: 100%; }
button.left-align, .button.left-align {
text-align: left;
text-indent: 0.75em; }
button.right-align, .button.right-align {
text-align: right;
padding-right: 0.75em; }
button.disabled, button[disabled], .button.disabled, .button[disabled] {
background-color: #c8dae4;
border-color: #a6c3d3;
color: #333333;
cursor: default;
opacity: 0.6;
-webkit-box-shadow: none;
box-shadow: none; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
background-color: #a6c3d3; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
color: #333333; }
button.disabled:hover, button.disabled:focus, button[disabled]:hover, button[disabled]:focus, .button.disabled:hover, .button.disabled:focus, .button[disabled]:hover, .button[disabled]:focus {
background-color: #c8dae4; }
button.disabled.secondary, button[disabled].secondary, .button.disabled.secondary, .button[disabled].secondary {
background-color: #e9e9e9;
border-color: #d0d0d0;
color: #333333;
cursor: default;
opacity: 0.6;
-webkit-box-shadow: none;
box-shadow: none; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
background-color: #d0d0d0; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
color: #333333; }
button.disabled.secondary:hover, button.disabled.secondary:focus, button[disabled].secondary:hover, button[disabled].secondary:focus, .button.disabled.secondary:hover, .button.disabled.secondary:focus, .button[disabled].secondary:hover, .button[disabled].secondary:focus {
background-color: #e9e9e9; }
button.disabled.success, button[disabled].success, .button.disabled.success, .button[disabled].success {
background-color: #5da423;
border-color: #457a1a;
color: white;
cursor: default;
opacity: 0.6;
-webkit-box-shadow: none;
box-shadow: none; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
background-color: #457a1a; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
color: white; }
button.disabled.success:hover, button.disabled.success:focus, button[disabled].success:hover, button[disabled].success:focus, .button.disabled.success:hover, .button.disabled.success:focus, .button[disabled].success:hover, .button[disabled].success:focus {
background-color: #5da423; }
button.disabled.alert, button[disabled].alert, .button.disabled.alert, .button[disabled].alert {
background-color: #c60f13;
border-color: #970b0e;
color: white;
cursor: default;
opacity: 0.6;
-webkit-box-shadow: none;
box-shadow: none; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
background-color: #970b0e; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
color: white; }
button.disabled.alert:hover, button.disabled.alert:focus, button[disabled].alert:hover, button[disabled].alert:focus, .button.disabled.alert:hover, .button.disabled.alert:focus, .button[disabled].alert:hover, .button[disabled].alert:focus {
background-color: #c60f13; }
button, .button {
padding-top: 0.8125em;
padding-bottom: 0.75em; }
button.tiny, .button.tiny {
padding-top: 0.5em;
padding-bottom: 0.4375em; }
button.small, .button.small {
padding-top: 0.625em;
padding-bottom: 0.5625em; }
button.large, .button.large {
padding-top: 1.03125em;
padding-bottom: 1.03125em; }
@media only screen {
button, .button {
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
-webkit-transition: background-color 300ms ease-out;
-moz-transition: background-color 300ms ease-out;
transition: background-color 300ms ease-out; }
button:active, .button:active {
-webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset; }
button.radius, .button.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
button.round, .button.round {
-webkit-border-radius: 1000px;
border-radius: 1000px; } }
@media only screen and (min-width: 48em) {
button, .button {
display: inline-block; } }
/* Standard Forms */
form {
margin: 0 0 1em; }
/* Using forms within rows, we need to set some defaults */
form .row .row {
margin: 0 -0.5em; }
form .row .row .column,
form .row .row .columns {
padding: 0 0.5em; }
form .row .row.collapse {
margin: 0; }
form .row .row.collapse .column,
form .row .row.collapse .columns {
padding: 0; }
form .row input.column,
form .row input.columns,
form .row textarea.column,
form .row textarea.columns {
padding-left: 0.5em; }
/* Label Styles */
label {
font-size: 0.875em;
color: #4d4d4d;
cursor: pointer;
display: block;
font-weight: 500;
margin-bottom: 0.1875em; }
label.right {
float: none;
text-align: right; }
label.inline {
margin: 0 0 1em 0;
padding: 0.625em 0; }
/* Attach elements to the beginning or end of an input */
.prefix,
.postfix {
display: block;
position: relative;
z-index: 2;
text-align: center;
width: 100%;
padding-top: 0;
padding-bottom: 0;
border-style: solid;
border-width: 1px;
overflow: hidden;
font-size: 0.875em;
height: 2.3125em;
line-height: 2.3125em; }
/* Adjust padding, alignment and radius if pre/post element is a button */
.postfix.button {
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
text-align: center;
line-height: 2.125em; }
.prefix.button {
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
text-align: center;
line-height: 2.125em; }
.prefix.button.radius {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-topleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.postfix.button.radius {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px; }
.prefix.button.round {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-bottomleft: 1000px;
-moz-border-radius-topleft: 1000px;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.postfix.button.round {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-topright: 1000px;
-moz-border-radius-bottomright: 1000px;
-webkit-border-top-right-radius: 1000px;
-webkit-border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px; }
/* Separate prefix and postfix styles when on span so buttons keep their own */
span.prefix {
background: #f2f2f2;
border-color: #d9d9d9;
border-right: none;
color: #333333; }
span.prefix.radius {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-topleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
span.postfix {
background: #f2f2f2;
border-color: #cccccc;
border-left: none;
color: #333333; }
span.postfix.radius {
-webkit-border-radius: 0;
border-radius: 0;
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px; }
/* Input groups will automatically style first and last elements of the group */
.input-group.radius > *:first-child, .input-group.radius > *:first-child * {
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-topleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.input-group.radius > *:last-child, .input-group.radius > *:last-child * {
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px; }
.input-group.round > *:first-child, .input-group.round > *:first-child * {
-moz-border-radius-bottomleft: 1000px;
-moz-border-radius-topleft: 1000px;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.input-group.round > *:last-child, .input-group.round > *:last-child * {
-moz-border-radius-topright: 1000px;
-moz-border-radius-bottomright: 1000px;
-webkit-border-top-right-radius: 1000px;
-webkit-border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px; }
/* We use this to get basic styling on all basic form elements */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="time"],
input[type="url"],
textarea {
background-color: white;
font-family: inherit;
border: 1px solid #cccccc;
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
color: rgba(0, 0, 0, 0.75);
display: block;
font-size: 0.875em;
margin: 0 0 1em 0;
padding: 0.5em;
height: 2.3125em;
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: -webkit-box-shadow 0.45s, border-color 0.45s ease-in-out;
-moz-transition: -moz-box-shadow 0.45s, border-color 0.45s ease-in-out;
transition: box-shadow 0.45s, border-color 0.45s ease-in-out; }
input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
textarea:focus {
-webkit-box-shadow: 0 0 5px #999999;
-moz-box-shadow: 0 0 5px #999999;
box-shadow: 0 0 5px #999999;
border-color: #999999; }
input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="time"]:focus,
input[type="url"]:focus,
textarea:focus {
background: #fafafa;
border-color: #999999;
outline: none; }
input[type="text"][disabled],
input[type="password"][disabled],
input[type="date"][disabled],
input[type="datetime"][disabled],
input[type="datetime-local"][disabled],
input[type="month"][disabled],
input[type="week"][disabled],
input[type="email"][disabled],
input[type="number"][disabled],
input[type="search"][disabled],
input[type="tel"][disabled],
input[type="time"][disabled],
input[type="url"][disabled],
textarea[disabled] {
background-color: #dddddd; }
/* Adjust margin for form elements below */
input[type="file"],
input[type="checkbox"],
input[type="radio"],
select {
margin: 0 0 1em 0; }
/* Normalize file input width */
input[type="file"] {
width: 100%; }
/* We add basic fieldset styling */
fieldset {
border: solid 1px #dddddd;
padding: 1.25em;
margin: 1.125em 0; }
fieldset legend {
font-weight: bold;
background: white;
padding: 0 0.1875em;
margin: 0;
margin-left: -0.1875em; }
/* Error Handling */
.error input,
input.error,
.error textarea,
textarea.error {
border-color: #c60f13;
background-color: rgba(198, 15, 19, 0.1); }
.error input:focus,
input.error:focus,
.error textarea:focus,
textarea.error:focus {
background: #fafafa;
border-color: #999999; }
.error label,
label.error {
color: #c60f13; }
.error small,
small.error {
display: block;
padding: 0.375em 0.25em;
margin-top: -1.3125em;
margin-bottom: 1em;
font-size: 0.75em;
font-weight: bold;
background: #c60f13;
color: white; }
/* Custom Checkbox and Radio Inputs */
form.custom .hidden-field {
margin-left: -99999px;
position: absolute;
visibility: hidden; }
form.custom .custom {
display: inline-block;
width: 16px;
height: 16px;
position: relative;
vertical-align: middle;
border: solid 1px #cccccc;
background: white; }
form.custom .custom.checkbox {
-webkit-border-radius: 0px;
border-radius: 0px;
padding: -3px; }
form.custom .custom.radio {
-webkit-border-radius: 1000px;
border-radius: 1000px;
padding: 3px; }
form.custom .custom.checkbox:before {
content: "";
display: block;
font-size: 20px;
color: white; }
form.custom .custom.radio.checked:before {
content: "";
display: block;
width: 8px;
height: 8px;
-webkit-border-radius: 1000px;
border-radius: 1000px;
background: #222222;
position: relative; }
form.custom .custom.checkbox.checked:before {
content: "\2A2F";
color: #222222;
margin-top: -8px;
margin-left: 2px; }
/* Custom Select Options and Dropdowns */
form.custom {
/* Custom input, disabled */ }
form.custom .custom.dropdown {
display: block;
position: relative;
top: 0;
height: 2.3125em;
margin-bottom: 1.25em;
margin-top: 0px;
padding: 0px;
width: 100%;
background: white;
background: -moz-linear-gradient(top, white 0%, #f3f3f3 100%);
background: -webkit-linear-gradient(top, white 0%, #f3f3f3 100%);
background: linear-gradient(to bottom, white 0%, #f3f3f3 100%);
-webkit-box-shadow: none;
box-shadow: none;
font-size: 0.875em;
vertical-align: top; }
form.custom .custom.dropdown ul {
overflow-y: auto;
max-height: 200px; }
form.custom .custom.dropdown .current {
cursor: default;
white-space: nowrap;
line-height: 2.25em;
color: rgba(0, 0, 0, 0.75);
text-decoration: none;
overflow: hidden;
display: block;
margin-left: 0.5em;
margin-right: 2.3125em; }
form.custom .custom.dropdown .selector {
cursor: default;
position: absolute;
width: 2.5em;
height: 2.3125em;
display: block;
right: 0;
top: 0; }
form.custom .custom.dropdown .selector:after {
content: "";
display: block;
content: "";
display: block;
width: 0;
height: 0;
border: inset 5px;
border-color: #aaaaaa transparent transparent transparent;
border-top-style: solid;
position: absolute;
left: 0.9375em;
top: 50%;
margin-top: -3px; }
form.custom .custom.dropdown:hover a.selector:after, form.custom .custom.dropdown.open a.selector:after {
content: "";
display: block;
width: 0;
height: 0;
border: inset 5px;
border-color: #222222 transparent transparent transparent;
border-top-style: solid; }
form.custom .custom.dropdown .disabled {
color: #888888; }
form.custom .custom.dropdown .disabled:hover {
background: transparent;
color: #888888; }
form.custom .custom.dropdown .disabled:hover:after {
display: none; }
form.custom .custom.dropdown.open ul {
display: block;
z-index: 10;
min-width: 100%;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
box-sizing: content-box; }
form.custom .custom.dropdown.small {
max-width: 134px; }
form.custom .custom.dropdown.medium {
max-width: 254px; }
form.custom .custom.dropdown.large {
max-width: 434px; }
form.custom .custom.dropdown.expand {
width: 100% !important; }
form.custom .custom.dropdown.open.small ul {
min-width: 134px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }
form.custom .custom.dropdown.open.medium ul {
min-width: 254px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }
form.custom .custom.dropdown.open.large ul {
min-width: 434px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }
form.custom .custom.dropdown ul {
position: absolute;
width: auto;
display: none;
margin: 0;
left: -1px;
top: auto;
-webkit-box-shadow: 0 2px 2px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0 2px 2px 0px rgba(0, 0, 0, 0.1);
margin: 0;
padding: 0;
background: white;
border: solid 1px #cccccc;
font-size: 16px; }
form.custom .custom.dropdown ul li {
color: #555555;
font-size: 0.875em;
cursor: default;
padding-top: 0.25em;
padding-bottom: 0.25em;
padding-left: 0.375em;
padding-right: 2.375em;
min-height: 1.5em;
line-height: 1.5em;
margin: 0;
white-space: nowrap;
list-style: none; }
form.custom .custom.dropdown ul li.selected {
background: #eeeeee;
color: black; }
form.custom .custom.dropdown ul li:hover {
background-color: #e4e4e4;
color: black; }
form.custom .custom.dropdown ul li.selected:hover {
background: #eeeeee;
cursor: default;
color: black; }
form.custom .custom.dropdown ul.show {
display: block; }
form.custom .custom.disabled {
background: #dddddd; }
/* Button Groups */
.button-group {
list-style: none;
margin: 0;
*zoom: 1; }
.button-group:before, .button-group:after {
content: " ";
display: table; }
.button-group:after {
clear: both; }
.button-group > * {
margin: 0 0 0 -1px;
float: left; }
.button-group > *:first-child {
margin-left: 0; }
.button-group.radius > *:first-child, .button-group.radius > *:first-child > a, .button-group.radius > *:first-child > button, .button-group.radius > *:first-child > .button {
-moz-border-radius-bottomleft: 3px;
-moz-border-radius-topleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px; }
.button-group.radius > *:last-child, .button-group.radius > *:last-child > a, .button-group.radius > *:last-child > button, .button-group.radius > *:last-child > .button {
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px; }
.button-group.round > *:first-child, .button-group.round > *:first-child > a, .button-group.round > *:first-child > button, .button-group.round > *:first-child > .button {
-moz-border-radius-bottomleft: 1000px;
-moz-border-radius-topleft: 1000px;
-webkit-border-bottom-left-radius: 1000px;
-webkit-border-top-left-radius: 1000px;
border-bottom-left-radius: 1000px;
border-top-left-radius: 1000px; }
.button-group.round > *:last-child, .button-group.round > *:last-child > a, .button-group.round > *:last-child > button, .button-group.round > *:last-child > .button {
-moz-border-radius-topright: 1000px;
-moz-border-radius-bottomright: 1000px;
-webkit-border-top-right-radius: 1000px;
-webkit-border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px; }
.button-group.even-2 li {
width: 50%; }
.button-group.even-2 li button, .button-group.even-2 li .button {
width: 100%; }
.button-group.even-3 li {
width: 33.33333%; }
.button-group.even-3 li button, .button-group.even-3 li .button {
width: 100%; }
.button-group.even-4 li {
width: 25%; }
.button-group.even-4 li button, .button-group.even-4 li .button {
width: 100%; }
.button-group.even-5 li {
width: 20%; }
.button-group.even-5 li button, .button-group.even-5 li .button {
width: 100%; }
.button-group.even-6 li {
width: 16.66667%; }
.button-group.even-6 li button, .button-group.even-6 li .button {
width: 100%; }
.button-group.even-7 li {
width: 14.28571%; }
.button-group.even-7 li button, .button-group.even-7 li .button {
width: 100%; }
.button-group.even-8 li {
width: 12.5%; }
.button-group.even-8 li button, .button-group.even-8 li .button {
width: 100%; }
.button-bar {
*zoom: 1; }
.button-bar:before, .button-bar:after {
content: " ";
display: table; }
.button-bar:after {
clear: both; }
.button-bar .button-group {
float: left;
margin-right: 0.625em; }
.button-bar .button-group div {
overflow: hidden; }
/* Dropdown Button */
.dropdown.button {
position: relative;
padding-right: 3.1875em; }
.dropdown.button:before {
position: absolute;
content: "";
width: 0;
height: 0;
display: block;
border-style: solid;
border-color: white transparent transparent transparent;
top: 50%; }
.dropdown.button:before {
border-width: 0.5625em;
right: 1.5em;
margin-top: -0.25em; }
.dropdown.button:before {
border-color: white transparent transparent transparent; }
.dropdown.button.tiny {
padding-right: 2.1875em; }
.dropdown.button.tiny:before {
border-width: 0.4375em;
right: 0.875em;
margin-top: -0.15625em; }
.dropdown.button.tiny:before {
border-color: white transparent transparent transparent; }
.dropdown.button.small {
padding-right: 2.8125em; }
.dropdown.button.small:before {
border-width: 0.5625em;
right: 1.125em;
margin-top: -0.21875em; }
.dropdown.button.small:before {
border-color: white transparent transparent transparent; }
.dropdown.button.large {
padding-right: 4em; }
.dropdown.button.large:before {
border-width: 0.625em;
right: 1.75em;
margin-top: -0.3125em; }
.dropdown.button.large:before {
border-color: white transparent transparent transparent; }
.dropdown.button.secondary:before {
border-color: #333333 transparent transparent transparent; }
/* Split Buttons */
.split.button {
position: relative;
padding-right: 4.8em; }
.split.button span {
display: block;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: solid 1px; }
.split.button span:before {
position: absolute;
content: "";
width: 0;
height: 0;
display: block;
border-style: inset;
left: 50%; }
.split.button span:active {
background-color: rgba(0, 0, 0, 0.1); }
.split.button span {
border-left-color: #95b7cb; }
.split.button span {
width: 3em; }
.split.button span:before {
border-top-style: solid;
border-width: 0.5625em;
top: 1.125em;
margin-left: -0.5625em; }
.split.button span:before {
border-color: white transparent transparent transparent; }
.split.button.secondary span {
border-left-color: #c3c3c3; }
.split.button.secondary span:before {
border-color: white transparent transparent transparent; }
.split.button.alert span {
border-left-color: #7f0a0c; }
.split.button.success span {
border-left-color: #396516; }
.split.button.tiny {
padding-right: 3.9375em; }
.split.button.tiny span {
width: 2.84375em; }
.split.button.tiny span:before {
border-top-style: solid;
border-width: 0.4375em;
top: 0.875em;
margin-left: -0.3125em; }
.split.button.small {
padding-right: 3.9375em; }
.split.button.small span {
width: 2.8125em; }
.split.button.small span:before {
border-top-style: solid;
border-width: 0.5625em;
top: 0.84375em;
margin-left: -0.5625em; }
.split.button.large {
padding-right: 6em; }
.split.button.large span {
width: 3.75em; }
.split.button.large span:before {
border-top-style: solid;
border-width: 0.625em;
top: 1.3125em;
margin-left: -0.5625em; }
.split.button.expand {
padding-left: 2em; }
.split.button.secondary span:before {
border-color: #333333 transparent transparent transparent; }
.split.button.radius span {
-moz-border-radius-topright: 3px;
-moz-border-radius-bottomright: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px; }
.split.button.round span {
-moz-border-radius-topright: 1000px;
-moz-border-radius-bottomright: 1000px;
-webkit-border-top-right-radius: 1000px;
-webkit-border-bottom-right-radius: 1000px;
border-top-right-radius: 1000px;
border-bottom-right-radius: 1000px; }
/* Flex Video */
.flex-video {
position: relative;
padding-top: 1.5625em;
padding-bottom: 67.5%;
height: 0;
margin-bottom: 1em;
overflow: hidden; }
.flex-video.widescreen {
padding-bottom: 57.25%; }
.flex-video.vimeo {
padding-top: 0; }
.flex-video iframe,
.flex-video object,
.flex-video embed,
.flex-video video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%; }
/* Sections */
.section-container, .section-container.auto {
width: 100%;
display: block;
margin-bottom: 1.25em;
border: 1px solid #cccccc;
border-top: none; }
.section-container > section, .section-container > .section, .section-container.auto > section, .section-container.auto > .section {
position: relative; }
.section-container > section > .title, .section-container > .section > .title, .section-container.auto > section > .title, .section-container.auto > .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container > section > .title a, .section-container > .section > .title a, .section-container.auto > section > .title a, .section-container.auto > .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container > section > .title:hover, .section-container > .section > .title:hover, .section-container.auto > section > .title:hover, .section-container.auto > .section > .title:hover {
background-color: #e2e2e2; }
.section-container > section .content, .section-container > .section .content, .section-container.auto > section .content, .section-container.auto > .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container > section .content > *:last-child, .section-container > .section .content > *:last-child, .section-container.auto > section .content > *:last-child, .section-container.auto > .section .content > *:last-child {
margin-bottom: 0; }
.section-container > section .content > *:first-child, .section-container > .section .content > *:first-child, .section-container.auto > section .content > *:first-child, .section-container.auto > .section .content > *:first-child {
padding-top: 0; }
.section-container > section .content > *:last-child, .section-container > .section .content > *:last-child, .section-container.auto > section .content > *:last-child, .section-container.auto > .section .content > *:last-child {
padding-bottom: 0; }
.section-container > section.active > .content, .section-container > .section.active > .content, .section-container.auto > section.active > .content, .section-container.auto > .section.active > .content {
display: block; }
.section-container > section.active > .title, .section-container > .section.active > .title, .section-container.auto > section.active > .title, .section-container.auto > .section.active > .title {
background: #d5d5d5; }
.section-container > section.active > .title a, .section-container > .section.active > .title a, .section-container.auto > section.active > .title a, .section-container.auto > .section.active > .title a {
color: #333333; }
.section-container > section > .title, .section-container > .section > .title, .section-container.auto > section > .title, .section-container.auto > .section > .title {
top: 0;
width: 100%;
margin: 0;
border-top: solid 1px #cccccc; }
.section-container > section > .title a, .section-container > .section > .title a, .section-container.auto > section > .title a, .section-container.auto > .section > .title a {
width: 100%; }
.section-container.tabs {
border: 0;
position: relative; }
.section-container.tabs > section, .section-container.tabs > .section {
border: 0;
position: static; }
.section-container.tabs > section > .title, .section-container.tabs > .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container.tabs > section > .title a, .section-container.tabs > .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container.tabs > section > .title:hover, .section-container.tabs > .section > .title:hover {
background-color: #e2e2e2; }
.section-container.tabs > section .content, .section-container.tabs > .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container.tabs > section .content > *:last-child, .section-container.tabs > .section .content > *:last-child {
margin-bottom: 0; }
.section-container.tabs > section .content > *:first-child, .section-container.tabs > .section .content > *:first-child {
padding-top: 0; }
.section-container.tabs > section .content > *:last-child, .section-container.tabs > .section .content > *:last-child {
padding-bottom: 0; }
.section-container.tabs > section.active > .content, .section-container.tabs > .section.active > .content {
display: block; }
.section-container.tabs > section.active > .title, .section-container.tabs > .section.active > .title {
background: white; }
.section-container.tabs > section.active > .title a, .section-container.tabs > .section.active > .title a {
color: #333333; }
.section-container.tabs > section > .title, .section-container.tabs > .section > .title {
width: auto;
border: solid 1px #cccccc;
border-right: 0;
border-bottom: 0;
position: absolute;
top: 0;
z-index: 1; }
.section-container.tabs > section > .title a, .section-container.tabs > .section > .title a {
width: 100%; }
.section-container.tabs > section:last-child .title, .section-container.tabs > .section:last-child .title {
border-right: solid 1px #cccccc; }
.section-container.tabs > section .content, .section-container.tabs > .section .content {
border: solid 1px #cccccc;
position: absolute;
z-index: 10;
display: none;
top: -1px; }
.section-container.tabs > section.active > .title, .section-container.tabs > .section.active > .title {
z-index: 11;
border-bottom: 0;
background-color: white; }
.section-container.tabs > section.active > .content, .section-container.tabs > .section.active > .content {
position: relative; }
@media only screen and (min-width: 48em) {
.section-container.auto {
border: 0;
position: relative; }
.section-container.auto > section, .section-container.auto > .section {
border: 0;
position: static; }
.section-container.auto > section > .title, .section-container.auto > .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container.auto > section > .title a, .section-container.auto > .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container.auto > section > .title:hover, .section-container.auto > .section > .title:hover {
background-color: #e2e2e2; }
.section-container.auto > section .content, .section-container.auto > .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container.auto > section .content > *:last-child, .section-container.auto > .section .content > *:last-child {
margin-bottom: 0; }
.section-container.auto > section .content > *:first-child, .section-container.auto > .section .content > *:first-child {
padding-top: 0; }
.section-container.auto > section .content > *:last-child, .section-container.auto > .section .content > *:last-child {
padding-bottom: 0; }
.section-container.auto > section.active > .content, .section-container.auto > .section.active > .content {
display: block; }
.section-container.auto > section.active > .title, .section-container.auto > .section.active > .title {
background: white; }
.section-container.auto > section.active > .title a, .section-container.auto > .section.active > .title a {
color: #333333; }
.section-container.auto > section > .title, .section-container.auto > .section > .title {
width: auto;
border: solid 1px #cccccc;
border-right: 0;
border-bottom: 0;
position: absolute;
top: 0;
z-index: 1; }
.section-container.auto > section > .title a, .section-container.auto > .section > .title a {
width: 100%; }
.section-container.auto > section:last-child .title, .section-container.auto > .section:last-child .title {
border-right: solid 1px #cccccc; }
.section-container.auto > section .content, .section-container.auto > .section .content {
border: solid 1px #cccccc;
position: absolute;
z-index: 10;
display: none;
top: -1px; }
.section-container.auto > section.active > .title, .section-container.auto > .section.active > .title {
z-index: 11;
border-bottom: 0;
background-color: white; }
.section-container.auto > section.active > .content, .section-container.auto > .section.active > .content {
position: relative; }
.section-container.accordion .section {
padding-top: 0 !important; }
.section-container.vertical-tabs {
border: 1px solid #cccccc;
position: relative; }
.section-container.vertical-tabs section,
.section-container.vertical-tabs .section {
padding-top: 0 !important;
border: 0;
position: static; }
.section-container.vertical-tabs section > .title,
.section-container.vertical-tabs .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container.vertical-tabs section > .title a,
.section-container.vertical-tabs .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container.vertical-tabs section > .title:hover,
.section-container.vertical-tabs .section > .title:hover {
background-color: #e2e2e2; }
.section-container.vertical-tabs section .content,
.section-container.vertical-tabs .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container.vertical-tabs section .content > *:last-child,
.section-container.vertical-tabs .section .content > *:last-child {
margin-bottom: 0; }
.section-container.vertical-tabs section .content > *:first-child,
.section-container.vertical-tabs .section .content > *:first-child {
padding-top: 0; }
.section-container.vertical-tabs section .content > *:last-child,
.section-container.vertical-tabs .section .content > *:last-child {
padding-bottom: 0; }
.section-container.vertical-tabs section.active > .content,
.section-container.vertical-tabs .section.active > .content {
display: block; }
.section-container.vertical-tabs section.active > .title,
.section-container.vertical-tabs .section.active > .title {
background: #d5d5d5; }
.section-container.vertical-tabs section.active > .title a,
.section-container.vertical-tabs .section.active > .title a {
color: #333333; }
.section-container.vertical-tabs section > .title,
.section-container.vertical-tabs .section > .title {
position: absolute;
border-top: solid 1px #cccccc;
width: 12.5em; }
.section-container.vertical-tabs section:first-child .title,
.section-container.vertical-tabs .section:first-child .title {
border-top: 0; }
.section-container.vertical-tabs section .content,
.section-container.vertical-tabs .section .content {
display: block;
position: relative;
left: 12.5em;
border-left: solid 1px #cccccc;
z-index: 10; }
.section-container.vertical-tabs section.active > .title,
.section-container.vertical-tabs .section.active > .title {
background-color: #d5d5d5;
width: 12.5625em;
border-right: solid 0 transparent;
z-index: 11; }
.section-container.vertical-tabs section.active:last-child .title,
.section-container.vertical-tabs .section.active:last-child .title {
border-bottom: 0; }
.section-container.vertical-nav {
border: 0;
position: relative; }
.section-container.vertical-nav > section, .section-container.vertical-nav > .section {
padding-top: 0 !important;
position: relative; }
.section-container.vertical-nav > section > .title, .section-container.vertical-nav > .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container.vertical-nav > section > .title a, .section-container.vertical-nav > .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container.vertical-nav > section > .title:hover, .section-container.vertical-nav > .section > .title:hover {
background-color: #e2e2e2; }
.section-container.vertical-nav > section .content, .section-container.vertical-nav > .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container.vertical-nav > section .content > *:last-child, .section-container.vertical-nav > .section .content > *:last-child {
margin-bottom: 0; }
.section-container.vertical-nav > section .content > *:first-child, .section-container.vertical-nav > .section .content > *:first-child {
padding-top: 0; }
.section-container.vertical-nav > section .content > *:last-child, .section-container.vertical-nav > .section .content > *:last-child {
padding-bottom: 0; }
.section-container.vertical-nav > section.active > .content, .section-container.vertical-nav > .section.active > .content {
display: block; }
.section-container.vertical-nav > section.active > .title, .section-container.vertical-nav > .section.active > .title {
background: #d5d5d5; }
.section-container.vertical-nav > section.active > .title a, .section-container.vertical-nav > .section.active > .title a {
color: #333333; }
.section-container.vertical-nav > section > .title, .section-container.vertical-nav > .section > .title {
border-top: none;
border: solid 1px #cccccc; }
.section-container.vertical-nav > section > .title a, .section-container.vertical-nav > .section > .title a {
display: block;
width: 100%; }
.section-container.vertical-nav > section .content, .section-container.vertical-nav > .section .content {
display: none; }
.section-container.vertical-nav > section:first-child .title, .section-container.vertical-nav > .section:first-child .title {
border-bottom: none; }
.section-container.vertical-nav > section.active > .content, .section-container.vertical-nav > .section.active > .content {
display: block;
position: absolute;
left: 100%;
top: 0px;
z-index: 999;
min-width: 12.5em;
border: solid 1px #cccccc; }
.section-container.horizontal-nav {
position: relative;
background: #efefef;
border: 1px solid #cccccc; }
.section-container.horizontal-nav > section, .section-container.horizontal-nav > .section {
padding-top: 0;
border: 0;
position: static; }
.section-container.horizontal-nav > section > .title, .section-container.horizontal-nav > .section > .title {
background-color: #efefef;
cursor: pointer;
margin-bottom: 0; }
.section-container.horizontal-nav > section > .title a, .section-container.horizontal-nav > .section > .title a {
padding: 0.9375em;
display: inline-block;
color: #333333;
font-size: 0.875em;
white-space: nowrap; }
.section-container.horizontal-nav > section > .title:hover, .section-container.horizontal-nav > .section > .title:hover {
background-color: #e2e2e2; }
.section-container.horizontal-nav > section .content, .section-container.horizontal-nav > .section .content {
display: none;
padding: 0.9375em;
background-color: white; }
.section-container.horizontal-nav > section .content > *:last-child, .section-container.horizontal-nav > .section .content > *:last-child {
margin-bottom: 0; }
.section-container.horizontal-nav > section .content > *:first-child, .section-container.horizontal-nav > .section .content > *:first-child {
padding-top: 0; }
.section-container.horizontal-nav > section .content > *:last-child, .section-container.horizontal-nav > .section .content > *:last-child {
padding-bottom: 0; }
.section-container.horizontal-nav > section.active > .content, .section-container.horizontal-nav > .section.active > .content {
display: block; }
.section-container.horizontal-nav > section.active > .title, .section-container.horizontal-nav > .section.active > .title {
background: #d5d5d5; }
.section-container.horizontal-nav > section.active > .title a, .section-container.horizontal-nav > .section.active > .title a {
color: #333333; }
.section-container.horizontal-nav > section > .title, .section-container.horizontal-nav > .section > .title {
width: auto;
border: solid 1px #cccccc;
border-left: 0;
top: -1px;
position: absolute;
z-index: 1; }
.section-container.horizontal-nav > section > .title a, .section-container.horizontal-nav > .section > .title a {
width: 100%; }
.section-container.horizontal-nav > section .content, .section-container.horizontal-nav > .section .content {
display: none; }
.section-container.horizontal-nav > section.active > .content, .section-container.horizontal-nav > .section.active > .content {
display: block;
position: absolute;
z-index: 999;
left: 0;
top: -2px;
min-width: 12.5em;
border: solid 1px #cccccc; } }
/* Wrapped around .top-bar to contain to grid width */
.contain-to-grid {
width: 100%;
background: #111111; }
.fixed {
width: 100%;
left: 0;
position: fixed;
top: 0;
z-index: 99; }
.top-bar {
overflow: hidden;
height: 45px;
line-height: 45px;
position: relative;
background: #111111;
margin-bottom: 1.875em; }
.top-bar ul {
margin-bottom: 0;
list-style: none; }
.top-bar .row {
max-width: none; }
.top-bar form,
.top-bar input {
margin-bottom: 0; }
.top-bar input {
height: 2.45em; }
.top-bar .button {
padding-top: .5em;
padding-bottom: .5em;
margin-bottom: 0; }
.top-bar .title-area {
position: relative; }
.top-bar .name {
height: 45px;
margin: 0;
font-size: 16px; }
.top-bar .name h1 {
line-height: 45px;
font-size: 1.0625em;
margin: 0; }
.top-bar .name h1 a {
font-weight: bold;
color: white;
width: 50%;
display: block;
padding: 0 15px; }
.top-bar .toggle-topbar {
position: absolute;
right: 0;
top: 0; }
.top-bar .toggle-topbar a {
color: white;
text-transform: uppercase;
font-size: 0.8125em;
font-weight: bold;
position: relative;
display: block;
padding: 0 15px;
height: 45px;
line-height: 45px; }
.top-bar .toggle-topbar.menu-icon {
right: 15px;
top: 50%;
margin-top: -16px;
padding-left: 40px; }
.top-bar .toggle-topbar.menu-icon a {
text-indent: -48px;
width: 34px;
height: 34px;
line-height: 33px;
padding: 0;
color: white; }
.top-bar .toggle-topbar.menu-icon a span {
position: absolute;
right: 0;
display: block;
width: 16px;
height: 0;
-webkit-box-shadow: 0 10px 0 1px white, 0 16px 0 1px white, 0 22px 0 1px white;
box-shadow: 0 10px 0 1px white, 0 16px 0 1px white, 0 22px 0 1px white; }
.top-bar.expanded {
height: auto;
background: transparent; }
.top-bar.expanded .title-area {
background: #111111; }
.top-bar.expanded .toggle-topbar a {
color: #888888; }
.top-bar.expanded .toggle-topbar a span {
-webkit-box-shadow: 0 10px 0 1px #888888, 0 16px 0 1px #888888, 0 22px 0 1px #888888;
box-shadow: 0 10px 0 1px #888888, 0 16px 0 1px #888888, 0 22px 0 1px #888888; }
.top-bar-section {
left: 0;
position: relative;
width: auto;
-webkit-transition: left 300ms ease-out;
-moz-transition: left 300ms ease-out;
transition: left 300ms ease-out; }
.top-bar-section ul {
width: 100%;
height: auto;
display: block;
background: #333333;
font-size: 16px;
margin: 0; }
.top-bar-section .divider,
.top-bar-section [role="separator"] {
border-bottom: solid 1px #4d4d4d;
border-top: solid 1px #1a1a1a;
clear: both;
height: 1px;
width: 100%; }
.top-bar-section ul li > a {
display: block;
width: 100%;
color: white;
padding: 12px 0 12px 0;
padding-left: 15px;
font-size: 0.8125em;
font-weight: bold;
background: #333333; }
.top-bar-section ul li > a:hover {
background: #2b2b2b; }
.top-bar-section ul li > a.button {
background: #c8dae4;
font-size: 0.8125em; }
.top-bar-section ul li > a.button:hover {
background: #a6c3d3; }
.top-bar-section ul li > a.button.secondary {
background: #e9e9e9; }
.top-bar-section ul li > a.button.secondary:hover {
background: #d0d0d0; }
.top-bar-section ul li > a.button.success {
background: #5da423; }
.top-bar-section ul li > a.button.success:hover {
background: #457a1a; }
.top-bar-section ul li > a.button.alert {
background: #c60f13; }
.top-bar-section ul li > a.button.alert:hover {
background: #970b0e; }
.top-bar-section ul li.active > a {
background: #2b2b2b; }
.top-bar-section .has-form {
padding: 15px; }
.top-bar-section .has-dropdown {
position: relative; }
.top-bar-section .has-dropdown > a:after {
content: "";
display: block;
width: 0;
height: 0;
border: inset 5px;
border-color: transparent transparent transparent rgba(255, 255, 255, 0.5);
border-left-style: solid;
margin-right: 15px;
margin-top: -4.5px;
position: absolute;
top: 22px;
right: 0; }
.top-bar-section .has-dropdown.moved {
position: static; }
.top-bar-section .has-dropdown.moved > .dropdown {
visibility: visible; }
.top-bar-section .dropdown {
position: absolute;
left: 100%;
top: 0;
visibility: hidden;
z-index: 99; }
.top-bar-section .dropdown li {
width: 100%; }
.top-bar-section .dropdown li a {
font-weight: normal;
padding: 8px 15px; }
.top-bar-section .dropdown li.title h5 {
margin-bottom: 0; }
.top-bar-section .dropdown li.title h5 a {
color: white;
line-height: 22.5px;
display: block; }
.top-bar-section .dropdown label {
padding: 8px 15px 2px;
margin-bottom: 0;
text-transform: uppercase;
color: #555555;
font-weight: bold;
font-size: 0.625em; }
.top-bar-js-breakpoint {
width: 58.75em !important;
visibility: hidden; }
.js-generated {
display: block; }
@media only screen and (min-width: 58.75em) {
.top-bar {
background: #111111;
*zoom: 1;
overflow: visible; }
.top-bar:before, .top-bar:after {
content: " ";
display: table; }
.top-bar:after {
clear: both; }
.top-bar .toggle-topbar {
display: none; }
.top-bar .title-area {
float: left; }
.top-bar .name h1 a {
width: auto; }
.top-bar input,
.top-bar .button {
line-height: 2em;
font-size: 0.875em;
height: 2em;
padding: 0 10px;
position: relative;
top: 8px; }
.top-bar.expanded {
background: #111111; }
.contain-to-grid .top-bar {
max-width: 62.5em;
margin: 0 auto;
margin-bottom: 1.875em; }
.top-bar-section {
-webkit-transition: none 0 0;
-moz-transition: none 0 0;
transition: none 0 0;
left: 0 !important; }
.top-bar-section ul {
width: auto;
height: auto !important;
display: inline; }
.top-bar-section ul li {
float: left; }
.top-bar-section ul li .js-generated {
display: none; }
.top-bar-section li a:not(.button) {
padding: 0 15px;
line-height: 45px;
background: #111111; }
.top-bar-section li a:not(.button):hover {
background: black; }
.top-bar-section .has-dropdown > a {
padding-right: 35px !important; }
.top-bar-section .has-dropdown > a:after {
content: "";
display: block;
width: 0;
height: 0;
border: inset 5px;
border-color: rgba(255, 255, 255, 0.5) transparent transparent transparent;
border-top-style: solid;
margin-top: -2.5px;
top: 22.5px; }
.top-bar-section .has-dropdown.moved {
position: relative; }
.top-bar-section .has-dropdown.moved > .dropdown {
visibility: hidden; }
.top-bar-section .has-dropdown:hover > .dropdown, .top-bar-section .has-dropdown:active > .dropdown {
visibility: visible; }
.top-bar-section .has-dropdown .dropdown li.has-dropdown > a:after {
border: none;
content: "\00bb";
margin-top: -15px;
right: 5px; }
.top-bar-section .dropdown {
left: 0;
top: auto;
background: transparent;
min-width: 100%; }
.top-bar-section .dropdown li a {
color: white;
line-height: 1;
white-space: nowrap;
padding: 7px 15px;
background: #1e1e1e; }
.top-bar-section .dropdown li label {
white-space: nowrap;
background: #1e1e1e; }
.top-bar-section .dropdown li .dropdown {
left: 100%;
top: 0; }
.top-bar-section > ul > .divider, .top-bar-section > ul > [role="separator"] {
border-bottom: none;
border-top: none;
border-right: solid 1px #2b2b2b;
border-left: solid 1px black;
clear: none;
height: 45px;
width: 0px; }
.top-bar-section .has-form {
background: #111111;
padding: 0 15px;
height: 45px; }
.top-bar-section ul.right li .dropdown {
left: auto;
right: 0; }
.top-bar-section ul.right li .dropdown li .dropdown {
right: 100%; } }
.orbit-container {
overflow: hidden;
width: 100%;
position: relative;
background: whitesmoke; }
.orbit-container .orbit-slides-container {
list-style: none;
margin: 0;
padding: 0;
position: relative; }
.orbit-container .orbit-slides-container img {
display: block; }
.orbit-container .orbit-slides-container > * {
position: relative;
float: left;
height: 100%; }
.orbit-container .orbit-slides-container > * .orbit-caption {
position: absolute;
bottom: 0;
background-color: black;
background-color: rgba(0, 0, 0, 0.6);
color: #fff;
width: 100%;
padding: 10px 14px;
font-size: 0.875em; }
.orbit-container .orbit-slides-container > * .orbit-caption * {
color: white; }
.orbit-container .orbit-slide-number {
position: absolute;
top: 10px;
left: 10px;
font-size: 12px;
color: white;
background: rgba(0, 0, 0, 0); }
.orbit-container .orbit-slide-number span {
font-weight: 700;
padding: 0.3125em; }
.orbit-container .orbit-timer {
position: absolute;
top: 10px;
right: 10px;
height: 6px;
width: 100px; }
.orbit-container .orbit-timer .orbit-progress {
height: 100%;
background-color: black;
background-color: rgba(0, 0, 0, 0.6);
display: block;
width: 0%; }
.orbit-container .orbit-timer > span {
display: none;
position: absolute;
top: 10px;
right: 0px;
width: 11px;
height: 14px;
border: solid 4px black;
border-top: none;
border-bottom: none; }
.orbit-container .orbit-timer.paused > span {
right: -6px;
top: 9px;
width: 11px;
height: 14px;
border: inset 8px;
border-right-style: solid;
border-color: transparent transparent transparent black; }
.orbit-container:hover .orbit-timer > span {
display: block; }
.orbit-container .orbit-prev,
.orbit-container .orbit-next {
position: absolute;
top: 50%;
margin-top: -25px;
background-color: black;
background-color: rgba(0, 0, 0, 0.6);
width: 50px;
height: 60px;
line-height: 50px;
color: white;
text-indent: -9999px !important; }
.orbit-container .orbit-prev > span,
.orbit-container .orbit-next > span {
position: absolute;
top: 50%;
margin-top: -16px;
display: block;
width: 0;
height: 0;
border: inset 16px; }
.orbit-container .orbit-prev {
left: 0; }
.orbit-container .orbit-prev > span {
border-right-style: solid;
border-color: transparent;
border-right-color: #fff; }
.orbit-container .orbit-prev:hover > span {
border-right-color: #ccc; }
.orbit-container .orbit-next {
right: 0; }
.orbit-container .orbit-next > span {
border-color: transparent;
border-left-style: solid;
border-left-color: #fff;
left: 50%;
margin-left: -8px; }
.orbit-container .orbit-next:hover > span {
border-left-color: #ccc; }
.orbit-bullets {
margin: 0 auto 30px auto;
overflow: hidden;
position: relative;
top: 10px; }
.orbit-bullets li {
display: block;
width: 18px;
height: 18px;
background: #999999;
float: left;
margin-right: 6px;
border: solid 2px #222222;
-webkit-border-radius: 1000px;
border-radius: 1000px; }
.orbit-bullets li.active {
background: #222222; }
.orbit-bullets li:last-child {
margin-right: 0; }
.touch .orbit-container .orbit-prev,
.touch .orbit-container .orbit-next {
display: none; }
.touch .orbit-bullets {
display: none; }
@media only screen and (min-width: 48em) {
.touch .orbit-container .orbit-prev,
.touch .orbit-container .orbit-next {
display: inherit; }
.touch .orbit-bullets {
display: block; } }
.reveal-modal-bg {
position: fixed;
height: 100%;
width: 100%;
background: black;
background: rgba(0, 0, 0, 0.45);
z-index: 98;
display: none;
top: 0;
left: 0; }
.reveal-modal {
visibility: hidden;
display: none;
position: absolute;
left: 50%;
z-index: 99;
height: auto;
background-color: #fff;
margin-left: -40%;
width: 80%;
background-color: white;
padding: 1.25em;
border: solid 1px #666666;
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
top: 50px; }
.reveal-modal .column,
.reveal-modal .columns {
min-width: 0; }
.reveal-modal > :first-child {
margin-top: 0; }
.reveal-modal > :last-child {
margin-bottom: 0; }
.reveal-modal .close-reveal-modal {
font-size: 1.375em;
line-height: 1;
position: absolute;
top: 0.5em;
right: 0.6875em;
color: #aaaaaa;
font-weight: bold;
cursor: pointer; }
@media only screen and (min-width: 48em) {
.reveal-modal {
padding: 1.875em;
top: 6.25em; }
.reveal-modal.tiny {
margin-left: -15%;
width: 30%; }
.reveal-modal.small {
margin-left: -20%;
width: 40%; }
.reveal-modal.medium {
margin-left: -30%;
width: 60%; }
.reveal-modal.large {
margin-left: -35%;
width: 70%; }
.reveal-modal.xlarge {
margin-left: -47.5%;
width: 95%; } }
@media print {
.reveal-modal {
background: white !important; } }
/* Foundation Joyride */
.joyride-list {
display: none; }
/* Default styles for the container */
.joyride-tip-guide {
display: none;
position: absolute;
background: black;
color: white;
z-index: 101;
top: 0;
left: 2.5%;
font-family: inherit;
font-weight: normal;
width: 95%; }
.lt-ie9 .joyride-tip-guide {
max-width: 800px;
left: 50%;
margin-left: -400px; }
.joyride-content-wrapper {
width: 100%;
padding: 1.125em 1.25em 1.5em; }
.joyride-content-wrapper .button {
margin-bottom: 0 !important; }
/* Add a little css triangle pip, older browser just miss out on the fanciness of it */
.joyride-tip-guide .joyride-nub {
display: block;
position: absolute;
left: 22px;
width: 0;
height: 0;
border: inset 14px; }
.joyride-tip-guide .joyride-nub.top {
border-top-style: solid;
border-color: black;
border-top-color: transparent !important;
border-left-color: transparent !important;
border-right-color: transparent !important;
top: -28px; }
.joyride-tip-guide .joyride-nub.bottom {
border-bottom-style: solid;
border-color: black !important;
border-bottom-color: transparent !important;
border-left-color: transparent !important;
border-right-color: transparent !important;
bottom: -28px; }
.joyride-tip-guide .joyride-nub.right {
right: -28px; }
.joyride-tip-guide .joyride-nub.left {
left: -28px; }
/* Typography */
.joyride-tip-guide h1,
.joyride-tip-guide h2,
.joyride-tip-guide h3,
.joyride-tip-guide h4,
.joyride-tip-guide h5,
.joyride-tip-guide h6 {
line-height: 1.25;
margin: 0;
font-weight: bold;
color: white; }
.joyride-tip-guide p {
margin: 0 0 1.125em 0;
font-size: 0.875em;
line-height: 1.3; }
.joyride-timer-indicator-wrap {
width: 50px;
height: 3px;
border: solid 1px #555555;
position: absolute;
right: 1.0625em;
bottom: 1em; }
.joyride-timer-indicator {
display: block;
width: 0;
height: inherit;
background: #666666; }
.joyride-close-tip {
position: absolute;
right: 12px;
top: 10px;
color: #777777 !important;
text-decoration: none;
font-size: 30px;
font-weight: normal;
line-height: 0.5 !important; }
.joyride-close-tip:hover, .joyride-close-tip:focus {
color: #eeeeee !important; }
.joyride-modal-bg {
position: fixed;
height: 100%;
width: 100%;
background: transparent;
background: rgba(0, 0, 0, 0.5);
z-index: 100;
display: none;
top: 0;
left: 0;
cursor: pointer; }
.joyride-expose-wrapper {
background-color: #ffffff;
position: absolute;
border-radius: 3px;
z-index: 102;
-moz-box-shadow: 0px 0px 30px white;
-webkit-box-shadow: 0px 0px 15px white;
box-shadow: 0px 0px 15px white; }
.joyride-expose-cover {
background: transparent;
border-radius: 3px;
position: absolute;
z-index: 9999;
top: 0px;
left: 0px; }
/* Styles for screens that are atleast 768px; */
@media only screen and (min-width: 48em) {
.joyride-tip-guide {
width: 300px;
left: inherit; }
.joyride-tip-guide .joyride-nub.bottom {
border-color: black !important;
border-bottom-color: transparent !important;
border-left-color: transparent !important;
border-right-color: transparent !important;
bottom: -28px; }
.joyride-tip-guide .joyride-nub.right {
border-color: black !important;
border-top-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
top: 22px;
left: auto;
right: -28px; }
.joyride-tip-guide .joyride-nub.left {
border-color: black !important;
border-top-color: transparent !important;
border-left-color: transparent !important;
border-bottom-color: transparent !important;
top: 22px;
left: -28px;
right: auto; } }
/* Clearing Styles */
[data-clearing] {
*zoom: 1;
margin-bottom: 0;
list-style: none; }
[data-clearing]:before, [data-clearing]:after {
content: " ";
display: table; }
[data-clearing]:after {
clear: both; }
[data-clearing] li {
float: left;
margin-right: 10px; }
.clearing-blackout {
background: #111111;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 998; }
.clearing-blackout .clearing-close {
display: block; }
.clearing-container {
position: relative;
z-index: 998;
height: 100%;
overflow: hidden;
margin: 0; }
.visible-img {
height: 95%;
position: relative; }
.visible-img img {
position: absolute;
left: 50%;
top: 50%;
margin-left: -50%;
max-height: 100%;
max-width: 100%; }
.clearing-caption {
color: white;
line-height: 1.3;
margin-bottom: 0;
text-align: center;
bottom: 0;
background: #111111;
width: 100%;
padding: 10px 30px;
position: absolute;
left: 0; }
.clearing-close {
z-index: 999;
padding-left: 20px;
padding-top: 10px;
font-size: 40px;
line-height: 1;
color: white;
display: none; }
.clearing-close:hover, .clearing-close:focus {
color: #ccc; }
.clearing-assembled .clearing-container {
height: 100%; }
.clearing-assembled .clearing-container .carousel > ul {
display: none; }
@media only screen and (min-width: 48em) {
.clearing-main-prev,
.clearing-main-next {
position: absolute;
height: 100%;
width: 40px;
top: 0; }
.clearing-main-prev > span,
.clearing-main-next > span {
position: absolute;
top: 50%;
display: block;
width: 0;
height: 0;
border: solid 16px; }
.clearing-main-prev {
left: 0; }
.clearing-main-prev > span {
left: 5px;
border-color: transparent;
border-right-color: white; }
.clearing-main-next {
right: 0; }
.clearing-main-next > span {
border-color: transparent;
border-left-color: white; }
.clearing-main-prev.disabled,
.clearing-main-next.disabled {
opacity: 0.5; }
.clearing-feature ~ li {
display: none; }
.clearing-assembled .clearing-container .carousel {
background: #111111;
height: 150px;
margin-top: 5px; }
.clearing-assembled .clearing-container .carousel > ul {
display: block;
z-index: 999;
width: 200%;
height: 100%;
margin-left: 0;
position: relative;
left: 0; }
.clearing-assembled .clearing-container .carousel > ul li {
display: block;
width: 175px;
height: inherit;
padding: 0;
float: left;
overflow: hidden;
margin-right: 1px;
position: relative;
cursor: pointer;
opacity: 0.4; }
.clearing-assembled .clearing-container .carousel > ul li.fix-height img {
min-height: 100%;
height: 100%;
max-width: none; }
.clearing-assembled .clearing-container .carousel > ul li a.th {
border: none;
-webkit-box-shadow: none;
box-shadow: none;
display: block; }
.clearing-assembled .clearing-container .carousel > ul li img {
cursor: pointer !important;
min-width: 100% !important; }
.clearing-assembled .clearing-container .carousel > ul li.visible {
opacity: 1; }
.clearing-assembled .clearing-container .visible-img {
background: #111111;
overflow: hidden;
height: 75%; }
.clearing-close {
position: absolute;
top: 10px;
right: 20px;
padding-left: 0;
padding-top: 0; } }
/* Foundation Alerts */
.alert-box {
border-style: solid;
border-width: 1px;
display: block;
font-weight: bold;
margin-bottom: 1.25em;
position: relative;
padding: 0.6875em 1.3125em 0.75em 0.6875em;
font-size: 0.875em;
background-color: #c8dae4;
border-color: #a6c3d3;
color: #505050; }
.alert-box .close {
font-size: 1.375em;
padding: 5px 4px 4px;
line-height: 0;
position: absolute;
top: 0.4375em;
right: 0.3125em;
color: #333333;
opacity: 0.3; }
.alert-box .close:hover, .alert-box .close:focus {
opacity: 0.5; }
.alert-box.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
.alert-box.round {
-webkit-border-radius: 1000px;
border-radius: 1000px; }
.alert-box.success {
background-color: #5da423;
border-color: #457a1a;
color: white; }
.alert-box.alert {
background-color: #c60f13;
border-color: #970b0e;
color: white; }
.alert-box.secondary {
background-color: #e9e9e9;
border-color: #d0d0d0;
color: #505050; }
/* Breadcrumbs */
.breadcrumbs {
display: block;
padding: 0.5625em 0.875em 0.5625em;
overflow: hidden;
margin-left: 0;
list-style: none;
border-style: solid;
border-width: 1px;
background-color: #f6f6f6;
border-color: gainsboro;
-webkit-border-radius: 3px;
border-radius: 3px; }
.breadcrumbs > * {
margin: 0;
float: left;
font-size: 0.6875em;
text-transform: uppercase;
color: #c8dae4; }
.breadcrumbs > *:hover a, .breadcrumbs > *:focus a {
text-decoration: underline; }
.breadcrumbs > * a,
.breadcrumbs > * span {
text-transform: uppercase;
color: #c8dae4; }
.breadcrumbs > *.current {
cursor: default;
color: #333333; }
.breadcrumbs > *.current a {
cursor: default;
color: #333333; }
.breadcrumbs > *.current:hover, .breadcrumbs > *.current:hover a, .breadcrumbs > *.current:focus, .breadcrumbs > *.current:focus a {
text-decoration: none; }
.breadcrumbs > *.unavailable {
color: #999999; }
.breadcrumbs > *.unavailable a {
color: #999999; }
.breadcrumbs > *.unavailable:hover, .breadcrumbs > *.unavailable:hover a, .breadcrumbs > *.unavailable:focus,
.breadcrumbs > *.unavailable a:focus {
text-decoration: none;
color: #999999;
cursor: default; }
.breadcrumbs > *:before {
content: "/";
color: #aaaaaa;
margin: 0 0.75em;
position: relative;
top: 1px; }
.breadcrumbs > *:first-child:before {
content: " ";
margin: 0; }
/* Keystroke Characters */
.keystroke,
kbd {
background-color: #ededed;
border-color: #dbdbdb;
color: #222222;
border-style: solid;
border-width: 1px;
margin: 0;
font-family: "Consolas", "Menlo", "Courier", monospace;
font-size: 0.9375em;
padding: 0.125em 0.25em 0em;
-webkit-border-radius: 3px;
border-radius: 3px; }
/* Labels */
.label {
font-weight: bold;
text-align: center;
text-decoration: none;
line-height: 1;
white-space: nowrap;
display: inline-block;
position: relative;
padding: 0.1875em 0.625em 0.25em;
font-size: 0.875em;
background-color: #c8dae4;
color: #333333; }
.label.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
.label.round {
-webkit-border-radius: 1000px;
border-radius: 1000px; }
.label.alert {
background-color: #c60f13;
color: white; }
.label.success {
background-color: #5da423;
color: white; }
.label.secondary {
background-color: #e9e9e9;
color: #333333; }
/* Inline Lists */
.inline-list {
margin: 0 auto 1.0625em auto;
margin-left: -1.375em;
margin-right: 0;
padding: 0;
list-style: none;
overflow: hidden; }
.inline-list > li {
list-style: none;
float: left;
margin-left: 1.375em;
display: block; }
.inline-list > li > * {
display: block; }
/* Pagination */
.pagination {
display: block;
height: 1.5em;
margin-left: -0.3125em; }
.pagination li {
display: block;
float: left;
height: 1.5em;
color: #222222;
font-size: 0.875em;
margin-left: 0.3125em; }
.pagination li a {
display: block;
padding: 0.0625em 0.4375em 0.0625em;
color: #999999; }
.pagination li:hover a,
.pagination li a:focus {
background: #e6e6e6; }
.pagination li.unavailable a {
cursor: default;
color: #999999; }
.pagination li.unavailable:hover a, .pagination li.unavailable a:focus {
background: transparent; }
.pagination li.current a {
background: #c8dae4;
color: white;
font-weight: bold;
cursor: default; }
.pagination li.current a:hover, .pagination li.current a:focus {
background: #c8dae4; }
.pagination-centered {
text-align: center; }
.pagination-centered ul > li {
float: none;
display: inline-block; }
/* Panels */
.panel {
border-style: solid;
border-width: 1px;
border-color: #d9d9d9;
margin-bottom: 1.25em;
padding: 1.25em;
background: #f2f2f2; }
.panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6, .panel p {
color: #333333; }
.panel > :first-child {
margin-top: 0; }
.panel > :last-child {
margin-bottom: 0; }
.panel h1, .panel h2, .panel h3, .panel h4, .panel h5, .panel h6 {
line-height: 1;
margin-bottom: 0.625em; }
.panel h1.subheader, .panel h2.subheader, .panel h3.subheader, .panel h4.subheader, .panel h5.subheader, .panel h6.subheader {
line-height: 1.4; }
.panel.callout {
border-style: solid;
border-width: 1px;
border-color: #a6c3d3;
margin-bottom: 1.25em;
padding: 1.25em;
background: #c8dae4;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset; }
.panel.callout h1, .panel.callout h2, .panel.callout h3, .panel.callout h4, .panel.callout h5, .panel.callout h6, .panel.callout p {
color: #333333; }
.panel.callout > :first-child {
margin-top: 0; }
.panel.callout > :last-child {
margin-bottom: 0; }
.panel.callout h1, .panel.callout h2, .panel.callout h3, .panel.callout h4, .panel.callout h5, .panel.callout h6 {
line-height: 1;
margin-bottom: 0.625em; }
.panel.callout h1.subheader, .panel.callout h2.subheader, .panel.callout h3.subheader, .panel.callout h4.subheader, .panel.callout h5.subheader, .panel.callout h6.subheader {
line-height: 1.4; }
.panel.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
/* Pricing Tables */
.pricing-table {
border: solid 1px #dddddd;
margin-left: 0;
margin-bottom: 1.25em; }
.pricing-table * {
list-style: none;
line-height: 1; }
.pricing-table .title {
background-color: #dddddd;
padding: 0.9375em 1.25em;
text-align: center;
color: #333333;
font-weight: bold;
font-size: 1em; }
.pricing-table .price {
background-color: #eeeeee;
padding: 0.9375em 1.25em;
text-align: center;
color: #333333;
font-weight: normal;
font-size: 1.25em; }
.pricing-table .description {
background-color: white;
padding: 0.9375em;
text-align: center;
color: #777777;
font-size: 0.75em;
font-weight: normal;
line-height: 1.4;
border-bottom: dotted 1px #dddddd; }
.pricing-table .bullet-item {
background-color: white;
padding: 0.9375em;
text-align: center;
color: #333333;
font-size: 0.875em;
font-weight: normal;
border-bottom: dotted 1px #dddddd; }
.pricing-table .cta-button {
background-color: whitesmoke;
text-align: center;
padding: 1.25em 1.25em 0; }
/* Progress Bar */
.progress {
background-color: transparent;
height: 1.5625em;
border: 1px solid #cccccc;
padding: 0.125em;
margin-bottom: 0.625em; }
.progress .meter {
background: #c8dae4;
height: 100%;
display: block; }
.progress.secondary .meter {
background: #e9e9e9;
height: 100%;
display: block; }
.progress.success .meter {
background: #5da423;
height: 100%;
display: block; }
.progress.alert .meter {
background: #c60f13;
height: 100%;
display: block; }
.progress.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
.progress.radius .meter {
-webkit-border-radius: 2px;
border-radius: 2px; }
.progress.round {
-webkit-border-radius: 1000px;
border-radius: 1000px; }
.progress.round .meter {
-webkit-border-radius: 999px;
border-radius: 999px; }
/* Side Nav */
.side-nav {
display: block;
margin: 0;
padding: 0.875em 0;
list-style-type: none;
list-style-position: inside; }
.side-nav li {
margin: 0 0 0.4375em 0;
font-size: 0.875em; }
.side-nav li a {
display: block;
color: #c8dae4; }
.side-nav li.active > a:first-child {
color: #4d4d4d;
font-weight: bold; }
.side-nav li.divider {
border-top: 1px solid;
height: 0;
padding: 0;
list-style: none;
border-top-color: #e6e6e6; }
/* Side Nav */
.sub-nav {
display: block;
width: auto;
overflow: hidden;
margin: -0.25em 0 1.125em;
padding-top: 0.25em;
margin-right: 0;
margin-left: -0.5625em; }
.sub-nav dt,
.sub-nav dd {
float: left;
display: inline;
margin-left: 0.5625em;
margin-bottom: 0.625em;
font-weight: normal;
font-size: 0.875em; }
.sub-nav dt a,
.sub-nav dd a {
color: #999999;
text-decoration: none; }
.sub-nav dt.active a,
.sub-nav dd.active a {
-webkit-border-radius: 1000px;
border-radius: 1000px;
font-weight: bold;
background: #c8dae4;
padding: 0.1875em 0.5625em;
cursor: default;
color: white; }
/* Foundation Switches */
@media only screen {
div.switch {
position: relative;
width: 100%;
padding: 0;
display: block;
overflow: hidden;
border-style: solid;
border-width: 1px;
margin-bottom: 1.25em;
-webkit-animation: webkitSiblingBugfix infinite 1s;
height: 36px;
background: white;
border-color: #cccccc; }
div.switch label {
position: relative;
left: 0;
z-index: 2;
float: left;
width: 50%;
height: 100%;
margin: 0;
font-weight: bold;
text-align: left;
-webkit-transition: all 0.1s ease-out;
-moz-transition: all 0.1s ease-out;
transition: all 0.1s ease-out; }
div.switch input {
position: absolute;
z-index: 3;
opacity: 0;
width: 100%;
height: 100%;
-moz-appearance: none; }
div.switch input:hover, div.switch input:focus {
cursor: pointer; }
div.switch > span {
position: absolute;
top: -1px;
left: -1px;
z-index: 1;
display: block;
padding: 0;
border-width: 1px;
border-style: solid;
-webkit-transition: all 0.1s ease-out;
-moz-transition: all 0.1s ease-out;
transition: all 0.1s ease-out; }
div.switch input:not(:checked) + label {
opacity: 0; }
div.switch input:checked {
display: none !important; }
div.switch input {
left: 0;
display: block !important; }
div.switch input:first-of-type + label,
div.switch input:first-of-type + span + label {
left: -50%; }
div.switch input:first-of-type:checked + label,
div.switch input:first-of-type:checked + span + label {
left: 0%; }
div.switch input:last-of-type + label,
div.switch input:last-of-type + span + label {
right: -50%;
left: auto;
text-align: right; }
div.switch input:last-of-type:checked + label,
div.switch input:last-of-type:checked + span + label {
right: 0%;
left: auto; }
div.switch span.custom {
display: none !important; }
div.switch label {
padding: 0 0.375em;
line-height: 2.3em;
font-size: 0.875em; }
div.switch input:first-of-type:checked ~ span {
left: 100%;
margin-left: -2.1875em; }
div.switch > span {
width: 2.25em;
height: 2.25em; }
div.switch > span {
border-color: #b3b3b3;
background: white;
background: -moz-linear-gradient(top, white 0%, #f2f2f2 100%);
background: -webkit-linear-gradient(top, white 0%, #f2f2f2 100%);
background: linear-gradient(to bottom, white 0%, #f2f2f2 100%);
-webkit-box-shadow: 2px 0 10px 0 rgba(0, 0, 0, 0.07), 1000px 0 0 1000px #e1f5d1, -2px 0 10px 0 rgba(0, 0, 0, 0.07), -1000px 0 0 1000px whitesmoke;
box-shadow: 2px 0 10px 0 rgba(0, 0, 0, 0.07), 1000px 0 0 980px #e1f5d1, -2px 0 10px 0 rgba(0, 0, 0, 0.07), -1000px 0 0 1000px whitesmoke; }
div.switch:hover > span, div.switch:focus > span {
background: white;
background: -moz-linear-gradient(top, white 0%, #e6e6e6 100%);
background: -webkit-linear-gradient(top, white 0%, #e6e6e6 100%);
background: linear-gradient(to bottom, white 0%, #e6e6e6 100%); }
div.switch:active {
background: transparent; }
div.switch.large {
height: 44px; }
div.switch.large label {
padding: 0 0.375em;
line-height: 2.3em;
font-size: 1.0625em; }
div.switch.large input:first-of-type:checked ~ span {
left: 100%;
margin-left: -2.6875em; }
div.switch.large > span {
width: 2.75em;
height: 2.75em; }
div.switch.small {
height: 28px; }
div.switch.small label {
padding: 0 0.375em;
line-height: 2.1em;
font-size: 0.75em; }
div.switch.small input:first-of-type:checked ~ span {
left: 100%;
margin-left: -1.6875em; }
div.switch.small > span {
width: 1.75em;
height: 1.75em; }
div.switch.tiny {
height: 22px; }
div.switch.tiny label {
padding: 0 0.375em;
line-height: 1.9em;
font-size: 0.6875em; }
div.switch.tiny input:first-of-type:checked ~ span {
left: 100%;
margin-left: -1.3125em; }
div.switch.tiny > span {
width: 1.375em;
height: 1.375em; }
div.switch.radius {
-webkit-border-radius: 4px;
border-radius: 4px; }
div.switch.radius > span {
-webkit-border-radius: 3px;
border-radius: 3px; }
div.switch.round {
-webkit-border-radius: 1000px;
border-radius: 1000px; }
div.switch.round > span {
-webkit-border-radius: 999px;
border-radius: 999px; }
div.switch.round label {
padding: 0 0.5625em; }
@-webkit-keyframes webkitSiblingBugfix {
from {
position: relative; }
to {
position: relative; } } }
[data-magellan-expedition] {
background: white;
z-index: 50;
min-width: 100%;
padding: 10px; }
[data-magellan-expedition] .sub-nav {
margin-bottom: 0; }
[data-magellan-expedition] .sub-nav dd {
margin-bottom: 0; }
/* Tables */
table {
background: white;
margin-bottom: 1.25em;
border: solid 1px #dddddd; }
table thead,
table tfoot {
background: whitesmoke;
font-weight: bold; }
table thead tr th,
table thead tr td,
table tfoot tr th,
table tfoot tr td {
padding: 0.5em 0.625em 0.625em;
font-size: 0.875em;
color: #222222;
text-align: left; }
table tr th,
table tr td {
padding: 0.5625em 0.625em;
font-size: 0.875em;
color: #222222; }
table tr.even, table tr.alt, table tr:nth-of-type(even) {
background: #f9f9f9; }
table thead tr th,
table tfoot tr th,
table tbody tr td,
table tr td,
table tfoot tr td {
display: table-cell;
line-height: 1.125em; }
/* Image Thumbnails */
.th {
line-height: 0;
display: inline-block;
border: solid 4px white;
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
-webkit-transition: all 200ms ease-out;
-moz-transition: all 200ms ease-out;
transition: all 200ms ease-out; }
.th:hover, .th:focus {
-webkit-box-shadow: 0 0 6px 1px rgba(200, 218, 228, 0.5);
box-shadow: 0 0 6px 1px rgba(200, 218, 228, 0.5); }
.th.radius {
-webkit-border-radius: 3px;
border-radius: 3px; }
a.th {
display: block; }
/* Tooltips */
.has-tip {
border-bottom: dotted 1px #cccccc;
cursor: help;
font-weight: bold;
color: #333333; }
.has-tip:hover, .has-tip:focus {
border-bottom: dotted 1px #84acc2;
color: #c8dae4; }
.has-tip.tip-left, .has-tip.tip-right {
float: none !important; }
.tooltip {
display: none;
position: absolute;
z-index: 999;
font-weight: bold;
font-size: 0.9375em;
line-height: 1.3;
padding: 0.5em;
max-width: 85%;
left: 50%;
width: 100%;
color: white;
background: black;
-webkit-border-radius: 3px;
border-radius: 3px; }
.tooltip > .nub {
display: block;
left: 5px;
position: absolute;
width: 0;
height: 0;
border: solid 5px;
border-color: transparent transparent black transparent;
top: -10px; }
.tooltip.opened {
color: #c8dae4 !important;
border-bottom: dotted 1px #84acc2 !important; }
.tap-to-close {
display: block;
font-size: 0.625em;
color: #888888;
font-weight: normal; }
@media only screen and (min-width: 48em) {
.tooltip > .nub {
border-color: transparent transparent black transparent;
top: -10px; }
.tooltip.tip-top > .nub {
border-color: black transparent transparent transparent;
top: auto;
bottom: -10px; }
.tooltip.tip-left, .tooltip.tip-right {
float: none !important; }
.tooltip.tip-left > .nub {
border-color: transparent transparent transparent black;
right: -10px;
left: auto;
top: 50%;
margin-top: -5px; }
.tooltip.tip-right > .nub {
border-color: transparent black transparent transparent;
right: auto;
left: -10px;
top: 50%;
margin-top: -5px; } }
@media only screen and (max-width: 767px) {
.f-dropdown {
max-width: 100%;
left: 0; } }
/* Foundation Dropdowns */
.f-dropdown {
position: absolute;
top: -9999px;
list-style: none;
padding: 1.25em;
width: 100%;
height: auto;
max-height: none;
background: white;
border: solid 1px #cccccc;
font-size: 16px;
z-index: 99;
margin-top: 2px;
max-width: 200px; }
.f-dropdown *:first-child {
margin-top: 0; }
.f-dropdown *:last-child {
margin-bottom: 0; }
.f-dropdown:before {
content: "";
display: block;
width: 0;
height: 0;
border: inset 6px;
border-color: transparent transparent white transparent;
border-bottom-style: solid;
position: absolute;
top: -12px;
left: 10px;
z-index: 99; }
.f-dropdown:after {
content: "";
display: block;
width: 0;
height: 0;
border: inset 7px;
border-color: transparent transparent #cccccc transparent;
border-bottom-style: solid;
position: absolute;
top: -14px;
left: 9px;
z-index: 98; }
.f-dropdown.right:before {
left: auto;
right: 10px; }
.f-dropdown.right:after {
left: auto;
right: 9px; }
.f-dropdown li {
font-size: 0.875em;
cursor: pointer;
line-height: 1.125em;
margin: 0; }
.f-dropdown li:hover, .f-dropdown li:focus {
background: #eeeeee; }
.f-dropdown li a {
display: block;
padding: 0.3125em 0.625em;
color: #555555; }
.f-dropdown.content {
position: absolute;
top: -9999px;
list-style: none;
padding: 1.25em;
width: 100%;
height: auto;
max-height: none;
background: white;
border: solid 1px #cccccc;
font-size: 16px;
z-index: 99;
max-width: 200px; }
.f-dropdown.content *:first-child {
margin-top: 0; }
.f-dropdown.content *:last-child {
margin-bottom: 0; }
.f-dropdown.tiny {
max-width: 200px; }
.f-dropdown.small {
max-width: 300px; }
.f-dropdown.medium {
max-width: 500px; }
.f-dropdown.large {
max-width: 800px; }
|
{
"content_hash": "968b71edf1f77752b02d6d8799abc633",
"timestamp": "",
"source": "github",
"line_count": 4159,
"max_line_length": 278,
"avg_line_length": 28.427025727338304,
"alnum_prop": 0.6243444869235714,
"repo_name": "VentureCranial/system-status-dashboard",
"id": "5fa404a67e95f34e7fcb471fe211d359b011cc4a",
"size": "118228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "html/css/foundation.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "452653"
},
{
"name": "JavaScript",
"bytes": "72681"
},
{
"name": "Python",
"bytes": "242076"
},
{
"name": "Shell",
"bytes": "864"
}
],
"symlink_target": ""
}
|
using UnityEngine;
using System.Collections.Generic;
public class BananaScript : MonoBehaviour, CustomActionListener,IActionNotifier
{
public void init(Vector3 para_startPos,
Vector3 para_targetPos,
float para_speedToTarget,
Rect para_targetBounds)
{
Vector3 tmpEAngles = transform.localEulerAngles;
tmpEAngles.z = Random.Range(0,360);
transform.localEulerAngles = tmpEAngles;
triggerSoundAtCamera("throw");
//Spin spinScript = transform.gameObject.AddComponent<Spin>();
//spinScript.init(1f);
Animator tmpBAni = transform.GetComponent<Animator>();
tmpBAni.Play("Spin");
Rect currentBounds = CommonUnityUtils.get2DBounds(transform.renderer.bounds);
Vector3 destScale = new Vector3(para_targetBounds.width/currentBounds.width,para_targetBounds.height/currentBounds.height,1);
CustomAnimationManager aniMang = transform.gameObject.AddComponent<CustomAnimationManager>();
List<List<AniCommandPrep>> batchList = new List<List<AniCommandPrep>>();
List<AniCommandPrep> batch1 = new List<AniCommandPrep>();
batch1.Add(new AniCommandPrep("MoveToLocation",2, new List<System.Object>() { new float[3] {para_targetPos.x,para_targetPos.y,para_targetPos.z}, para_speedToTarget, false }));
//batch1.Add(new AniCommandPrep("Spin",2, new List<System.Object>() { 1f }));
batch1.Add(new AniCommandPrep("GrowProportionateToDistance",1, new List<System.Object>() { new float[3] {para_targetPos.x,para_targetPos.y,para_targetPos.z}, new float[3] {destScale.x,destScale.y,destScale.z} }));
batchList.Add(batch1);
aniMang.registerListener("BScript",this);
aniMang.init("BananaThrow",batchList);
}
public void respondToEvent(string para_sourceID, string para_eventID, System.Object para_eventData)
{
if(para_eventID == "BananaThrow")
{
// The banana has hit the back wall. Simply play the delete animation.
triggerDeath();
notifyAllListeners(transform.name,"BananaHitWall",null);
}
else if(para_eventID == "WitherAnimation")
{
Destroy(transform.gameObject);
}
}
void OnTriggerEnter(Collider collider)
{
//Debug.Log("Banna hit: "+collider.gameObject.name);
bool performWither = true;
if(collider.gameObject.name.Contains("Monkey"))
{
if(collider.gameObject.GetComponent<MonkeyScript>().isGoodMonkey)
{
performWither = false;
Destroy(transform.gameObject);
}
}
if(performWither)
{
Destroy(transform.GetComponent<Spin>());
CustomAnimationManager caMang = transform.gameObject.GetComponent<CustomAnimationManager>();
caMang.forceHalt();
triggerDeath();
}
}
private void triggerDeath()
{
Destroy(transform.GetComponent<Spin>());
transform.GetComponent<Animator>().speed = 0.05f;
triggerSoundAtCamera("splat");
CustomAnimationManager caMang = transform.gameObject.AddComponent<CustomAnimationManager>();
List<List<AniCommandPrep>> batchList = new List<List<AniCommandPrep>>();
List<AniCommandPrep> batch1 = new List<AniCommandPrep>();
batch1.Add(new AniCommandPrep("TriggerAnimation",1,new List<System.Object>() { "Splat" }));
batchList.Add(batch1);
caMang.registerListener("BScript",this);
caMang.init("WitherAnimation",batchList);
/*CustomAnimationManager caMang = transform.gameObject.AddComponent<CustomAnimationManager>();
List<List<AniCommandPrep>> batchList = new List<List<AniCommandPrep>>();
List<AniCommandPrep> batch1 = new List<AniCommandPrep>();
batch1.Add(new AniCommandPrep("ColorTransition",1,new List<System.Object>() { new float[4] {1,1,1,0}, 1f }));
batchList.Add(batch1);
caMang.registerListener("BScript",this);
caMang.init("WitherAnimation",batchList);*/
}
private void triggerSoundAtCamera(string para_soundFileName)
{
GameObject camGObj = Camera.main.gameObject;
Transform sfxPrefab = Resources.Load<Transform>("Prefabs/SFxBox");
GameObject nwSFX = ((Transform) Instantiate(sfxPrefab,camGObj.transform.position,Quaternion.identity)).gameObject;
AudioSource audS = (AudioSource) nwSFX.GetComponent(typeof(AudioSource));
audS.clip = (AudioClip) Resources.Load("Sounds/"+para_soundFileName,typeof(AudioClip));
audS.volume = 1f;
audS.Play();
}
// Action Notifier Methods.
IActionNotifier acNotifier = new ConcActionNotifier();
public void registerListener(string para_name, CustomActionListener para_listener) { acNotifier.registerListener(para_name,para_listener); }
public void unregisterListener(string para_name) { acNotifier.unregisterListener(para_name); }
public void notifyAllListeners(string para_sourceID, string para_eventID, System.Object para_eventData) { acNotifier.notifyAllListeners(para_sourceID,para_eventID,para_eventData); }
}
|
{
"content_hash": "fa0a7fa0d274b0a17785115e8ef1a7a9",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 215,
"avg_line_length": 37.584,
"alnum_prop": 0.7481907194550873,
"repo_name": "TAPeri/WordsMatter",
"id": "98d49ba6a03f8e35d2413f879b3fc8d0e3b45016",
"size": "4805",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Ac_WhackAMonkey/Code/Scripts/BananaScript.cs",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "1939761"
},
{
"name": "GLSL",
"bytes": "6187"
},
{
"name": "Java",
"bytes": "327675"
},
{
"name": "JavaScript",
"bytes": "5795"
}
],
"symlink_target": ""
}
|
from .base import * # NOQA
import logging.config
# For security and performance reasons, DEBUG is turned off
DEBUG = False
TEMPLATE_DEBUG = False
# Must mention ALLOWED_HOSTS in production!
# ALLOWED_HOSTS = ["pstHealth.com"]
# Cache the templates in memory for speed-up
loaders = [
('django.template.loaders.cached.Loader', [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
]),
]
TEMPLATES[0]['OPTIONS'].update({"loaders": loaders})
TEMPLATES[0].update({"APP_DIRS": False})
# Define STATIC_ROOT for the collectstatic command
STATIC_ROOT = join(BASE_DIR, '..', 'site', 'static')
# Log everything to the logs directory at the top
LOGFILE_ROOT = join(dirname(BASE_DIR), 'logs')
# Reset logging
LOGGING_CONFIG = None
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': "[%(asctime)s] %(levelname)s [%(pathname)s:%(lineno)s] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'proj_log_file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': join(LOGFILE_ROOT, 'project.log'),
'formatter': 'verbose'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
}
},
'loggers': {
'project': {
'handlers': ['proj_log_file'],
'level': 'DEBUG',
},
}
}
logging.config.dictConfig(LOGGING)
|
{
"content_hash": "b0d4368e2c1119734cdec670095cd8a4",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 90,
"avg_line_length": 26.746031746031747,
"alnum_prop": 0.5608308605341247,
"repo_name": "samabhi/pstHealth",
"id": "683be63567fa7e1ff28a86c3f9541b2b06c02551",
"size": "1799",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pstHealth/settings/production.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1449"
},
{
"name": "CSS",
"bytes": "150361"
},
{
"name": "HTML",
"bytes": "277699"
},
{
"name": "JavaScript",
"bytes": "266006"
},
{
"name": "Python",
"bytes": "9887720"
},
{
"name": "Shell",
"bytes": "3777"
}
],
"symlink_target": ""
}
|
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.office;
import com.wilutions.com.*;
/**
* MsoScaleFrom.
*
*/
@SuppressWarnings("all")
@CoInterface(guid="{00000000-0000-0000-0000-000000000000}")
public class MsoScaleFrom implements ComEnum {
static boolean __typelib__loaded = __TypeLib.load();
// Typed constants
public final static MsoScaleFrom msoScaleFromTopLeft = new MsoScaleFrom(0);
public final static MsoScaleFrom msoScaleFromMiddle = new MsoScaleFrom(1);
public final static MsoScaleFrom msoScaleFromBottomRight = new MsoScaleFrom(2);
// Integer constants for bitsets and switch statements
public final static int _msoScaleFromTopLeft = 0;
public final static int _msoScaleFromMiddle = 1;
public final static int _msoScaleFromBottomRight = 2;
// Value, readonly field.
public final int value;
// Private constructor, use valueOf to create an instance.
private MsoScaleFrom(int value) { this.value = value; }
// Return one of the predefined typed constants for the given value or create a new object.
public static MsoScaleFrom valueOf(int value) {
switch(value) {
case 0: return msoScaleFromTopLeft;
case 1: return msoScaleFromMiddle;
case 2: return msoScaleFromBottomRight;
default: return new MsoScaleFrom(value);
}
}
public String toString() {
switch(value) {
case 0: return "msoScaleFromTopLeft";
case 1: return "msoScaleFromMiddle";
case 2: return "msoScaleFromBottomRight";
default: {
StringBuilder sbuf = new StringBuilder();
sbuf.append("[").append(value).append("=");
if ((value & 0) != 0) sbuf.append("|msoScaleFromTopLeft");
if ((value & 1) != 0) sbuf.append("|msoScaleFromMiddle");
if ((value & 2) != 0) sbuf.append("|msoScaleFromBottomRight");
return sbuf.toString();
}
}
}
}
|
{
"content_hash": "7933a6acfe70925351ad2f5b925c3fa3",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 93,
"avg_line_length": 34.81818181818182,
"alnum_prop": 0.6819843342036553,
"repo_name": "wolfgangimig/joa",
"id": "f12d3a11e30e01a272a54d43c13ac5d3c0f114f0",
"size": "1915",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/joa/src-gen/com/wilutions/mslib/office/MsoScaleFrom.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1296"
},
{
"name": "CSS",
"bytes": "792"
},
{
"name": "HTML",
"bytes": "1337"
},
{
"name": "Java",
"bytes": "9952275"
},
{
"name": "VBScript",
"bytes": "338"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
android:id="@+id/layout_top_bar"
layout="@layout/top_bar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<com.miaotu.view.CircleImageView
android:id="@+id/iv_head_photo1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/icon_group" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:paddingTop="20dp">
<TextView
android:id="@+id/tv_group_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:text="12.21-12.23 杭州三天两夜"
android:textColor="#646464"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_group_no"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="群号:1003123"
android:textColor="#b4b4b4"
android:textSize="12sp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="right|bottom"
android:paddingBottom="15dp"
android:paddingRight="10dp">
<TextView
android:id="@+id/btn_dismiss"
android:layout_width="70dp"
android:layout_height="20dp"
android:background="#ff6b50"
android:gravity="center"
android:text="解散团聊"
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#969696"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="80dp"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="群公告"
android:textColor="#b4b4b4"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_annoncement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:text="欢迎大家报名该路线"
android:textSize="14sp"
android:textColor="#646464" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#b4b4b4"></View>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:padding="10dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="消息免打扰"
android:textColor="#323232"
android:textSize="16sp" />
<ImageView
android:layout_width="54dp"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:background="@drawable/icon_disturb_open" />
</RelativeLayout>
<!--<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#969696"></View>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_groupcount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="群成员"
android:textColor="#b4b4b4"
android:textSize="14sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#b4b4b4"></View>
<ListView
android:id="@+id/lv_group_member"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:divider="#b4b4b4"
android:dividerHeight="1px"
android:listSelector="@android:color/transparent"
android:descendantFocusability="afterDescendants"
android:background="@color/white"
android:scrollbars="none">
</ListView>
</LinearLayout>
|
{
"content_hash": "0395df781e8579628d72440eebff45e8",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 72,
"avg_line_length": 34.50819672131148,
"alnum_prop": 0.5559778305621536,
"repo_name": "dktlu/Mitotu",
"id": "3a041dc1b965361cfdf0fba1b82ae9656c92dbd7",
"size": "6381",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MiaoTu/src/main/res/layout/activity_group_detail.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2038230"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en-gb">
<meta charset="utf-8">
<head>
<style>
body {
font: 16px sans-serif;
}
svg {
background-color: #DDD;
}
rect {
fill: red;
stroke: black;
stroke-width: 10;
}
circle {
fill: blue;
stroke: black;
stroke-width: 10;
}
line {
stroke: green;
stroke-width: 10;
}
ellipse {
fill: orange;
stroke: black;
stroke-width: 10;
}
.svgText {
font-family: courier;
font-size: 2em;
}
</style>
</head>
<body>
<div>
<svg width="500" height="500">
<!-- x = x pos, y = y pos -->
<rect x="20" y="20" width="100" height="200"></rect>
<!-- cx = x pos, yx = y pos, r = radius -->
<circle cx="120" cy="120" r="40"></circle>
<!-- cx = xpos, cy = y pos, rx = , ry = -->
<ellipse cx="240" cy="220" rx="80" ry="40"></ellipse>
<!-- A line() takes two coordinates as the start position and two for the end position (x1,y1)(x2,y2) -->
<line x1="120" y1="20" x2="400" y2="220"></line>
<!-- x = xpos, y = y pos, SVG has a text element, which will be very useful when creating infographics, We can also add in a little CSS for good measure -->
<text x="200" y="40" class="svgText">SVG Text!</text>
</svg>
<!--Beside <rect> there are a number of other elements we can use. These include circle, line, ellipse, path, and text. All elements will remain invisible until styled, we can verify this using the chrome developer tools and inspecting the elements. As you have probably noticed, when elements overlap, the order of the elements dictate which element ends up on top. Each element is stacked above its predecessor.-->
</div>
</body>
</html>
|
{
"content_hash": "881c8ee669fc263b5214bdb65fcf0cf6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 424,
"avg_line_length": 30.65671641791045,
"alnum_prop": 0.49805258033106137,
"repo_name": "GunnerJnr/_CodeInstitute",
"id": "bd9829426746459fa6e7ccf75ee7a6589274ddd9",
"size": "2054",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Stream-2/Back-End-Development/27.Data-Visualisations-and-D3/2.Scalable-Vector-Graphics/Walkthrough/svg.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "336"
},
{
"name": "CSS",
"bytes": "2545480"
},
{
"name": "HTML",
"bytes": "708226"
},
{
"name": "JavaScript",
"bytes": "1984479"
},
{
"name": "Python",
"bytes": "1727585"
},
{
"name": "Shell",
"bytes": "75780"
},
{
"name": "TSQL",
"bytes": "642"
}
],
"symlink_target": ""
}
|
<?php
namespace Eulogix\Cool\Bundle\CoreBundle\Model\Core;
use Eulogix\Cool\Bundle\CoreBundle\Model\Core\om\BaseAccountProfileRefPeer;
class AccountProfileRefPeer extends BaseAccountProfileRefPeer
{
}
|
{
"content_hash": "ca3539b853809be0023beaa76aeeaad2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 75,
"avg_line_length": 18.727272727272727,
"alnum_prop": 0.8349514563106796,
"repo_name": "eulogix/cool-core-bundle",
"id": "e066087ccae81be06c5586190a31fec775d4b377",
"size": "435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Bundle/CoreBundle/Model/Core/AccountProfileRefPeer.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19165"
},
{
"name": "Dockerfile",
"bytes": "5831"
},
{
"name": "HTML",
"bytes": "42844"
},
{
"name": "JavaScript",
"bytes": "509547"
},
{
"name": "PHP",
"bytes": "5176181"
},
{
"name": "PLpgSQL",
"bytes": "122868"
},
{
"name": "Ruby",
"bytes": "6997"
},
{
"name": "Shell",
"bytes": "18309"
}
],
"symlink_target": ""
}
|
#import <Foundation/Foundation.h>
#import "CCAnimationManager.h"
//This has been replaced by CCAnimationManager
__attribute__ ((deprecated))
@interface CCBAnimationManager : CCAnimationManager
{
}
@end
|
{
"content_hash": "7789482c5bbe325d1bd1825e14485d5c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 16.23076923076923,
"alnum_prop": 0.7535545023696683,
"repo_name": "TukekeSoft/cocos2d-spritebuilder",
"id": "3ceb2656ca72883a3e8e4a95ca2eab0d7a060d4d",
"size": "1413",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "cocos2d-ui/CCBReader/CCBAnimationManager.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "244583"
},
{
"name": "C++",
"bytes": "14862"
},
{
"name": "Java",
"bytes": "2117"
},
{
"name": "Matlab",
"bytes": "2853"
},
{
"name": "Objective-C",
"bytes": "3420152"
}
],
"symlink_target": ""
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.LanguageServices.Implementation.Extensions;
using Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Differencing;
using Roslyn.Utilities;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.Preview
{
internal class FileChange : AbstractChange
{
private readonly TextDocument _left;
private readonly TextDocument _right;
private readonly IComponentModel _componentModel;
public readonly DocumentId Id;
private readonly ITextBuffer _buffer;
private readonly Encoding _encoding;
private readonly IVsImageService2 _imageService;
public FileChange(TextDocument left,
TextDocument right,
IComponentModel componentModel,
AbstractChange parent,
PreviewEngine engine,
IVsImageService2 imageService) : base(engine)
{
Contract.ThrowIfFalse(left != null || right != null);
this.Id = left != null ? left.Id : right.Id;
_left = left;
_right = right;
_imageService = imageService;
_componentModel = componentModel;
var bufferFactory = componentModel.GetService<ITextBufferFactoryService>();
var bufferText = left != null
? left.GetTextSynchronously(CancellationToken.None)
: right.GetTextSynchronously(CancellationToken.None);
_buffer = bufferFactory.CreateTextBuffer(bufferText.ToString(), bufferFactory.InertContentType);
_encoding = bufferText.Encoding;
this.Children = ComputeChildren(left, right, CancellationToken.None);
this.parent = parent;
}
private ChangeList ComputeChildren(TextDocument left, TextDocument right, CancellationToken cancellationToken)
{
if (left == null)
{
// Added document.
return GetEntireDocumentAsSpanChange(right);
}
else if (right == null)
{
// Removed document.
return GetEntireDocumentAsSpanChange(left);
}
var oldText = left.GetTextSynchronously(cancellationToken);
var newText = right.GetTextSynchronously(cancellationToken);
var diffSelector = _componentModel.GetService<ITextDifferencingSelectorService>();
var diffService = diffSelector.GetTextDifferencingService(
left.Project.LanguageServices.GetService<IContentTypeLanguageService>().GetDefaultContentType());
diffService ??= diffSelector.DefaultTextDifferencingService;
var diff = ComputeDiffSpans(diffService, left, right, cancellationToken);
if (diff.Differences.Count == 0)
{
// There are no changes.
return ChangeList.Empty;
}
return GetChangeList(diff, right.Id, oldText, newText);
}
private ChangeList GetChangeList(IHierarchicalDifferenceCollection diff, DocumentId id, SourceText oldText, SourceText newText)
{
var spanChanges = new List<SpanChange>();
foreach (var difference in diff)
{
var leftSpan = diff.LeftDecomposition.GetSpanInOriginal(difference.Left);
var rightSpan = diff.RightDecomposition.GetSpanInOriginal(difference.Right);
var leftText = oldText.GetSubText(leftSpan.ToTextSpan()).ToString();
var rightText = newText.GetSubText(rightSpan.ToTextSpan()).ToString();
var trackingSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(leftSpan, SpanTrackingMode.EdgeInclusive);
var isDeletion = difference.DifferenceType == DifferenceType.Remove;
var displayText = isDeletion ? GetDisplayText(leftText) : GetDisplayText(rightText);
var spanChange = new SpanChange(trackingSpan, _buffer, id, displayText, leftText, rightText, isDeletion, this, engine);
spanChanges.Add(spanChange);
}
return new ChangeList(spanChanges.ToArray());
}
private ChangeList GetEntireDocumentAsSpanChange(TextDocument document)
{
// Show the whole document.
var entireSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(0, _buffer.CurrentSnapshot.Length, SpanTrackingMode.EdgeInclusive);
var text = document.GetTextAsync().Result.ToString();
var displayText = GetDisplayText(text);
var entireSpanChild = new SpanChange(entireSpan, _buffer, document.Id, displayText, text, text, isDeletion: false, parent: this, engine: engine);
return new ChangeList(new[] { entireSpanChild });
}
private string GetDisplayText(string excerpt)
{
if (excerpt.Contains("\r\n"))
{
var split = excerpt.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (split.Length > 1)
{
return string.Format("{0} ... {1}", split[0].Trim(), split[split.Length - 1].Trim());
}
}
return excerpt.Trim();
}
public override int GetText(out VSTREETEXTOPTIONS tto, out string pbstrText)
{
if (_left == null)
{
pbstrText = ServicesVSResources.bracket_plus_bracket + _right.Name;
}
else if (_right == null)
{
pbstrText = ServicesVSResources.bracket_bracket + _left.Name;
}
else
{
pbstrText = _right.Name;
}
tto = VSTREETEXTOPTIONS.TTO_DEFAULT;
return VSConstants.S_OK;
}
public override int GetTipText(out VSTREETOOLTIPTYPE eTipType, out string pbstrText)
{
eTipType = VSTREETOOLTIPTYPE.TIPTYPE_DEFAULT;
pbstrText = null;
return VSConstants.E_FAIL;
}
public override int OnRequestSource(object pIUnknownTextView)
{
if (pIUnknownTextView != null && Children.Changes != null && Children.Changes.Length > 0)
{
engine.SetTextView(pIUnknownTextView);
UpdatePreview();
}
return VSConstants.S_OK;
}
public override void UpdatePreview()
=> engine.UpdatePreview(this.Id, (SpanChange)Children.Changes[0]);
private SourceText UpdateBufferText()
{
foreach (SpanChange child in Children.Changes)
{
using var edit = _buffer.CreateEdit();
edit.Replace(child.GetSpan(), child.GetApplicableText());
edit.ApplyAndLogExceptions();
}
return SourceText.From(_buffer.CurrentSnapshot.GetText(), _encoding);
}
public TextDocument GetOldDocument()
=> _left;
public TextDocument GetUpdatedDocument()
{
if (_left == null || _right == null)
{
// Added or removed document.
return _right;
}
return _right.WithText(UpdateBufferText());
}
// Note that either _left or _right *must* be non-null (we are either adding, removing or changing a file).
public TextDocumentKind ChangedDocumentKind => (_left ?? _right).Kind;
internal override void GetDisplayData(VSTREEDISPLAYDATA[] pData)
{
var document = _right ?? _left;
// If these are documents from a VS workspace, then attempt to get the right display
// data from the underlying VSHierarchy and itemids for the document.
var workspace = document.Project.Solution.Workspace;
if (workspace is VisualStudioWorkspaceImpl vsWorkspace)
{
if (vsWorkspace.TryGetImageListAndIndex(_imageService, document.Id, out pData[0].hImageList, out pData[0].Image))
{
pData[0].SelectedImage = pData[0].Image;
return;
}
}
pData[0].Image = pData[0].SelectedImage = (ushort)StandardGlyphGroup.GlyphLibrary;
}
private static IHierarchicalDifferenceCollection ComputeDiffSpans(ITextDifferencingService diffService, TextDocument left, TextDocument right, CancellationToken cancellationToken)
{
// TODO: it would be nice to have a syntax based differ for presentation here,
// current way of just using text differ has its own issue, and using syntax differ in compiler that are for incremental parser
// has its own drawbacks.
var oldText = left.GetTextSynchronously(cancellationToken);
var newText = right.GetTextSynchronously(cancellationToken);
var oldString = oldText.ToString();
var newString = newText.ToString();
return diffService.DiffStrings(oldString, newString, new StringDifferenceOptions()
{
DifferenceType = StringDifferenceTypes.Line,
});
}
}
}
|
{
"content_hash": "327720354ef00a2d676b7281a303b694",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 187,
"avg_line_length": 40.0996015936255,
"alnum_prop": 0.6245404868355688,
"repo_name": "brettfo/roslyn",
"id": "bc301eb5239d9aadf90b53c98abb091db405dcbe",
"size": "10067",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "289100"
},
{
"name": "Batchfile",
"bytes": "8643"
},
{
"name": "C#",
"bytes": "110983902"
},
{
"name": "C++",
"bytes": "5392"
},
{
"name": "Dockerfile",
"bytes": "1905"
},
{
"name": "F#",
"bytes": "508"
},
{
"name": "PowerShell",
"bytes": "105474"
},
{
"name": "Shell",
"bytes": "22163"
},
{
"name": "Smalltalk",
"bytes": "622"
},
{
"name": "Visual Basic",
"bytes": "68586535"
}
],
"symlink_target": ""
}
|
// Copyright 2011, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.common.lib.soap.testing;
/**
* Mock SOAP client with a few methods.
*
* @author Adam Rogal
*/
public class MockSoapClient implements MockSoapClientInterface {
public static final RuntimeException EXCEPTION = new RuntimeException("Mocked exception");
/**
* Returns the passed in {@code arg} as a single {@code Object}.
*/
public Object identityCall(Object[] arg) {
return arg;
}
/**
* Returns the passed in {@code arg} as a single {@code Object}.
*/
public Object identityCallSingle(Object arg) {
return arg;
}
/**
* Returns {@code arg1} and has an overloaded name.
*/
public Object testOverloaded(String arg1, String arg2) {
return arg1;
}
/**
* Returns {@code arg1} and has an overloaded name.
*/
public Object testOverloaded(int arg1) {
return arg1;
}
/**
* Returns the passed in {@code arg} as a single {@code Object}.
*/
public Object lotsOfArgsCall(Object arg, Object[] arg1, Object arg2, Object arg3) {
return arg;
}
/**
* Void call.
*/
public void voidCall(Object[] arg) {}
/**
* Empty call.
*/
public void emptyCall() {}
/**
* Throws an exception.
*/
public Object throwException(Object[] arg) {
throw EXCEPTION;
}
}
|
{
"content_hash": "efceac57454038d0e74f60eca4235623",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 92,
"avg_line_length": 24.61038961038961,
"alnum_prop": 0.6717678100263852,
"repo_name": "nafae/developer",
"id": "3e870f6b98f918e9c1fda0a506049720d06971af",
"size": "1895",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/ads_lib/src/test/java/com/google/api/ads/common/lib/soap/testing/MockSoapClient.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "127846798"
},
{
"name": "Perl",
"bytes": "28418"
}
],
"symlink_target": ""
}
|
class Module
# Returns all the source locations for a given module
# @return [Array]
def source_locations
Modloc::Locator.new(self).find
end
end
|
{
"content_hash": "a19f06d3e41b446ae7e849729520ad13",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 55,
"avg_line_length": 22.428571428571427,
"alnum_prop": 0.7197452229299363,
"repo_name": "jwaldrip/modloc",
"id": "f64baa4957efed494dd7a1444509eb663d49e62f",
"size": "193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/modloc/core_ext/module.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "7327"
}
],
"symlink_target": ""
}
|
package com.bzf.jianxin.chat.view;
import com.bzf.jianxin.base.BaseView;
import com.bzf.jianxin.chat.widget.ChatItemListViewBean;
/**
* com.bzf.jianxin.chat.view
* Author: baizhengfu
* Email:709889312@qq.com
*/
public interface ChatView extends BaseView{
void sendSuccess();
void sendFail(String msg);
void showSendMsgDialog();
void dimissSendMsgDialog();
void showSendMsgProgress(int progress);
/**
* 获取新消息成功的回调
* @param bean
*/
void getNewMsgSuccess(ChatItemListViewBean bean);
/**
* 获取新消息失败的回调
* @param msg
*/
void getNewMsgFail(String msg);
}
|
{
"content_hash": "9cbd96c676704d5e33476ece87ca38de",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 56,
"avg_line_length": 20.733333333333334,
"alnum_prop": 0.680064308681672,
"repo_name": "xiaobaiAndroid/jianxin",
"id": "2882ec38c2ecc10f7856f2d9e711544e8b152cfc",
"size": "664",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/bzf/jianxin/chat/view/ChatView.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "250434"
}
],
"symlink_target": ""
}
|
<?php
namespace Bundle\ECommerce\ShippingBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
return $this->render('ShippingBundle:Default:index.php');
}
}
|
{
"content_hash": "f09aed6c098e348c6b3fed4d9de01e67",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 21.53846153846154,
"alnum_prop": 0.7535714285714286,
"repo_name": "docteurklein/Symfony2-e-commerce",
"id": "022177124ec227e818de920cdd822d914401d3a9",
"size": "280",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Bundle/ECommerce/ShippingBundle/Controller/DefaultController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "105832"
}
],
"symlink_target": ""
}
|
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"github.com/constabulary/gb"
"github.com/constabulary/gb/cmd"
"github.com/constabulary/gb/cmd/gb/internal/match"
)
// disable to keep working directory
const destroyContext = true
var commands = make(map[string]*cmd.Command)
// registerCommand registers a command for main.
// registerCommand should only be called from init().
func registerCommand(command *cmd.Command) {
setCommandDefaults(command)
commands[command.Name] = command
}
// atExit functions are called in sequence at the exit of the program.
var atExit []func() error
// exit runs all atExit functions, then calls os.Exit(code).
func exit(code int) {
for _, fn := range atExit {
if err := fn(); err != nil {
fmt.Fprintln(os.Stderr, "atExit:", err)
}
}
os.Exit(code)
}
func fatalf(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, "FATAL: "+format+"\n", args...)
exit(1)
}
func main() {
fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError)
var cwd string
fs.StringVar(&cwd, "R", cmd.MustGetwd(), "set the project root") // actually the working directory to start the project root search
debug := fs.Bool("d", os.Getenv("DEBUG") != "", "enable debug output")
fs.Usage = usage
args := os.Args
if len(args) < 2 || args[1] == "-h" {
fs.Usage() // usage calls exit(2)
}
name := args[1]
if name == "help" {
help(args[2:])
exit(0)
}
command := lookupCommand(name)
// add extra flags if necessary
command.AddFlags(fs)
// parse 'em
if err := command.FlagParse(fs, args); err != nil {
fatalf("could not parse flags: %v", err)
}
// reset args to the leftovers from fs.Parse
args = fs.Args()
// if this is the plugin command, ensure the name of the
// plugin is first in the list of arguments.
if command == commands["plugin"] {
args = append([]string{name}, args...)
}
// if cwd was passed in via -R, make sure it is absolute
cwd, err := filepath.Abs(cwd)
if err != nil {
fatalf("could not make project root absolute: %v", err)
}
// construct a project context at the current working directory.
ctx, err := newContext(cwd, *debug)
if err != nil {
fatalf("unable to construct context: %v", err)
}
// unless the command wants to handle its own arguments, process
// arguments into import paths.
if !command.SkipParseArgs {
srcdir := filepath.Join(ctx.Projectdir(), "src")
for _, a := range args {
// support the "all" build alias. This used to be handled
// in match.ImportPaths, but that's too messy, so if "all"
// is present in the args, replace it with "..." and set cwd
// to srcdir.
if a == "all" {
args = []string{"..."}
cwd = srcdir
break
}
}
args = match.ImportPaths(srcdir, cwd, args)
}
if destroyContext {
atExit = append(atExit, ctx.Destroy)
}
if err := command.Run(ctx, args); err != nil {
fatalf("command %q failed: %v", name, err)
}
exit(0)
}
func lookupCommand(name string) *cmd.Command {
command, ok := commands[name]
if (command != nil && !command.Runnable()) || !ok {
plugin, err := lookupPlugin(name)
if err != nil {
fmt.Fprintf(os.Stderr, "FATAL: unknown command %q\n", name)
usage()
}
command = &cmd.Command{
Run: func(ctx *gb.Context, args []string) error {
args = append([]string{plugin}, args...)
env := cmd.MergeEnv(os.Environ(), map[string]string{
"GB_PROJECT_DIR": ctx.Projectdir(),
})
cmd := exec.Cmd{
Path: plugin,
Args: args,
Env: env,
Stdin: os.Stdin,
Stdout: os.Stdout,
Stderr: os.Stderr,
}
return cmd.Run()
},
// plugin should not interpret arguments
SkipParseArgs: true,
}
}
setCommandDefaults(command)
return command
}
func setCommandDefaults(command *cmd.Command) {
// add a dummy default AddFlags field if none provided.
if command.AddFlags == nil {
command.AddFlags = func(*flag.FlagSet) {}
}
// add the default flag parsing if not overrriden.
if command.FlagParse == nil {
command.FlagParse = func(fs *flag.FlagSet, args []string) error {
return fs.Parse(args[2:])
}
}
}
func newContext(cwd string, debug bool) (*gb.Context, error) {
return cmd.NewContext(
cwd, // project root
gb.GcToolchain(),
gb.Gcflags(gcflags...),
gb.Ldflags(ldflags...),
gb.Tags(buildtags...),
debugOption(debug),
func(c *gb.Context) error {
if !race {
return nil
}
// check this is a supported platform
if runtime.GOARCH != "amd64" {
fatalf("race detector not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
switch runtime.GOOS {
case "linux", "windows", "darwin", "freebsd":
// supported
default:
fatalf("race detector not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
// check the race runtime is built
_, err := os.Stat(filepath.Join(runtime.GOROOT(), "pkg", fmt.Sprintf("%s_%s_race", runtime.GOOS, runtime.GOARCH), "runtime.a"))
if os.IsNotExist(err) || err != nil {
fatalf("go installation at %s is missing race support. See https://getgb.io/faq/#missing-race-support", runtime.GOROOT())
}
return gb.WithRace(c)
},
)
}
func debugOption(debug bool) func(*gb.Context) error {
if debug {
return gb.WithDebug(os.Stderr)
}
return func(*gb.Context) error { return nil }
}
|
{
"content_hash": "8fab94ddc1a78ea4ecd482de5f2c3acb",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 132,
"avg_line_length": 24.677570093457945,
"alnum_prop": 0.6502556334027646,
"repo_name": "mopemope/gb",
"id": "044486ef03f6c432cf3dc8518cf6ad258e467438",
"size": "5281",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "cmd/gb/main.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "183"
},
{
"name": "Go",
"bytes": "265251"
},
{
"name": "Shell",
"bytes": "249"
}
],
"symlink_target": ""
}
|
<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
#>
<#
.SYNOPSIS
Apply a specific update at an update location.
.DESCRIPTION
Apply a specific update at an update location. After invoked, Get-AzsUpdateRun may be used to modify the progress of the update.
.PARAMETER ResourceGroupName
The resource group the resource is located under.
.PARAMETER Location
The name of the update location.
.PARAMETER Name
Name of the update.
.PARAMETER ResourceId
The resource id.
.PARAMETER AsJob
Run asynchronous as a job and return the job object.
.PARAMETER Force
Don't ask for confirmation.
.EXAMPLE
PS C:\> Get-AzsUpdate -Name Microsoft1.0.180305.1 | Install-AzsUpdate
Apply a specific update at an update location.
#>
function Install-AzsUpdate {
[OutputType([Microsoft.AzureStack.Management.Update.Admin.Models.Update])]
[CmdletBinding(DefaultParameterSetName = 'Apply', SupportsShouldProcess = $true)]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Apply')]
[ValidateNotNullOrEmpty()]
[System.String]
$Name,
[Parameter(Mandatory = $false, ParameterSetName = 'Apply')]
[ValidateLength(1, 90)]
[System.String]
$ResourceGroupName,
[Parameter(Mandatory = $false, ParameterSetName = 'Apply')]
[System.String]
$Location,
[Parameter(Mandatory = $false)]
[switch]
$AsJob,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'ResourceId')]
[Alias('id')]
[ValidateNotNullOrEmpty()]
[System.String]
$ResourceId,
[Parameter(Mandatory = $false)]
[switch]
$Force
)
Begin {
Initialize-PSSwaggerDependencies -Azure
$tracerObject = $null
if (('continue' -eq $DebugPreference) -or ('inquire' -eq $DebugPreference)) {
$oldDebugPreference = $global:DebugPreference
$global:DebugPreference = "continue"
$tracerObject = New-PSSwaggerClientTracing
Register-PSSwaggerClientTracing -TracerObject $tracerObject
}
}
Process {
if ('ResourceId' -eq $PsCmdlet.ParameterSetName) {
$GetArmResourceIdParameterValue_params = @{
IdTemplate = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}/providers/Microsoft.Update.Admin/updateLocations/{updateLocation}/updates/{update}'
}
$GetArmResourceIdParameterValue_params['Id'] = $ResourceId
$ArmResourceIdParameterValues = Get-ArmResourceIdParameterValue @GetArmResourceIdParameterValue_params
$ResourceGroupName = $ArmResourceIdParameterValues['resourceGroup']
$Location = $ArmResourceIdParameterValues['updateLocation']
$Name = $ArmResourceIdParameterValues['update']
} else {
$Name = Get-ResourceNameSuffix -ResourceName $Name
}
if ($PsCmdlet.ShouldProcess($Name, "Install the update")) {
if ($Force.IsPresent -or $PsCmdlet.ShouldContinue("Install the update?", "Performing operation ApplyWithHttpMessagesAsync on $Name")) {
$NewServiceClient_params = @{
FullClientTypeName = 'Microsoft.AzureStack.Management.Update.Admin.UpdateAdminClient'
}
$GlobalParameterHashtable = @{}
$NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable
$GlobalParameterHashtable['SubscriptionId'] = $null
if ($PSBoundParameters.ContainsKey('SubscriptionId')) {
$GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId']
}
$UpdateAdminClient = New-ServiceClient @NewServiceClient_params
if ([System.String]::IsNullOrEmpty($Location)) {
$Location = (Get-AzureRmLocation).Location
}
if ([System.String]::IsNullOrEmpty($ResourceGroupName)) {
$ResourceGroupName = "System.$Location"
}
if ('Apply' -eq $PsCmdlet.ParameterSetName -or 'ResourceId' -eq $PsCmdlet.ParameterSetName) {
Write-Verbose -Message 'Performing operation ApplyWithHttpMessagesAsync on $UpdateAdminClient.'
$TaskResult = $UpdateAdminClient.Updates.ApplyWithHttpMessagesAsync($ResourceGroupName, $Location, $Name)
} else {
Write-Verbose -Message 'Failed to map parameter set to operation method.'
throw 'Module failed to find operation to execute.'
}
Write-Verbose -Message "Waiting for the operation to complete."
$PSSwaggerJobScriptBlock = {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[System.Threading.Tasks.Task]
$TaskResult,
[Parameter(Mandatory = $true)]
[System.String]
$TaskHelperFilePath
)
if ($TaskResult) {
. $TaskHelperFilePath
$GetTaskResult_params = @{
TaskResult = $TaskResult
}
Get-TaskResult @GetTaskResult_params
}
}
$PSCommonParameters = Get-PSCommonParameter -CallerPSBoundParameters $PSBoundParameters
$TaskHelperFilePath = Join-Path -Path $ExecutionContext.SessionState.Module.ModuleBase -ChildPath 'Get-TaskResult.ps1'
if (-not $AsJob.IsPresent) {
Invoke-Command -ScriptBlock $PSSwaggerJobScriptBlock `
-ArgumentList $TaskResult, $TaskHelperFilePath `
@PSCommonParameters
} else {
$ScriptBlockParameters = New-Object -TypeName 'System.Collections.Generic.Dictionary[string,object]'
$ScriptBlockParameters['TaskResult'] = $TaskResult
$ScriptBlockParameters['AsJob'] = $true
$ScriptBlockParameters['TaskHelperFilePath'] = $TaskHelperFilePath
$PSCommonParameters.GetEnumerator() | ForEach-Object { $ScriptBlockParameters[$_.Name] = $_.Value }
Start-PSSwaggerJobHelper -ScriptBlock $PSSwaggerJobScriptBlock `
-CallerPSBoundParameters $ScriptBlockParameters `
-CallerPSCmdlet $PSCmdlet `
@PSCommonParameters
}
}
}
}
End {
if ($tracerObject) {
$global:DebugPreference = $oldDebugPreference
Unregister-PSSwaggerClientTracing -TracerObject $tracerObject
}
}
}
|
{
"content_hash": "5a038073f795cb023f694b0a2c107b85",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 176,
"avg_line_length": 39.1767955801105,
"alnum_prop": 0.5983641235368777,
"repo_name": "ClogenyTechnologies/azure-powershell",
"id": "04b2c71890e12b2bde9fbf3c2e213b8e62fec5ba",
"size": "7091",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/StackAdmin/Azs.Update.Admin/Module/Azs.Update.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Install-AzsUpdate.ps1",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "14332261"
},
{
"name": "JavaScript",
"bytes": "4979"
},
{
"name": "PHP",
"bytes": "41"
},
{
"name": "PowerShell",
"bytes": "590227"
},
{
"name": "Python",
"bytes": "20483"
},
{
"name": "Shell",
"bytes": "16102"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>ScalaTest 3.0.6 - org.scalatest.enablers.Futuristic</title>
<meta name="description" content="ScalaTest 3.0.6 - org.scalatest.enablers.Futuristic" />
<meta name="keywords" content="ScalaTest 3.0.6 org.scalatest.enablers.Futuristic" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js"></script>
<script type="text/javascript" src="../../../lib/jquery.panzoom.min.js"></script>
<script type="text/javascript" src="../../../lib/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../../../lib/index.js"></script>
<script type="text/javascript" src="../../../index.js"></script>
<script type="text/javascript" src="../../../lib/scheduler.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
/* this variable can be used by the JS to determine the path to the root document */
var toRoot = '../../../';
</script>
<!-- gtag [javascript] -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-71294502-1"></script>
<script defer>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-71294502-1');
</script>
</head>
<body>
<div id="search">
<span id="doc-title">ScalaTest 3.0.6<span id="doc-version"></span></span>
<span class="close-results"><span class="left"><</span> Back</span>
<div id="textfilter">
<span class="input">
<input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
<i class="clear material-icons"></i>
<i id="search-icon" class="material-icons"></i>
</span>
</div>
</div>
<div id="search-results">
<div id="search-progress">
<div id="progress-fill"></div>
</div>
<div id="results-content">
<div id="entity-results"></div>
<div id="member-results"></div>
</div>
</div>
<div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;">
<div id="content-container" style="-webkit-overflow-scrolling: touch;">
<div id="subpackage-spacer">
<div id="packages">
<h1>Packages</h1>
<ul>
<li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="_root_"></a><a id="root:_root_"></a>
<span class="permalink">
<a href="index.html#_root_" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../index.html"><span class="name">root</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="_root_.org" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="org"></a><a id="org:org"></a>
<span class="permalink">
<a href="index.html#org" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../index.html"><span class="name">org</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="org.scalatest" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="scalatest"></a><a id="scalatest:scalatest"></a>
<span class="permalink">
<a href="../org/index.html#scalatest" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter." href="../index.html"><span class="name">scalatest</span></a>
</span>
<p class="shortcomment cmt">ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.</p><div class="fullcomment"><div class="comment cmt"><p>ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.
</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="org">org</a></dd></dl></div>
</li><li name="org.scalatest.enablers" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="enablers"></a><a id="enablers:enablers"></a>
<span class="permalink">
<a href="../../org/scalatest/index.html#enablers" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="index.html"><span class="name">enablers</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="org.scalatest">scalatest</a></dd></dl></div>
</li><li class="current-entities indented3">
<a class="object" href="Aggregating$.html" title="Companion object for Aggregating that provides implicit implementations for the following types:"></a>
<a class="trait" href="Aggregating.html" title="Typeclass that enables for aggregations certain contain syntax in the ScalaTest matchers DSL."></a>
<a href="Aggregating.html" title="Typeclass that enables for aggregations certain contain syntax in the ScalaTest matchers DSL.">Aggregating</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="AggregatingHighPriorityImplicits.html" title=""></a>
<a href="AggregatingHighPriorityImplicits.html" title="">AggregatingHighPriorityImplicits</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="AggregatingImpls.html" title=""></a>
<a href="AggregatingImpls.html" title="">AggregatingImpls</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="AggregatingJavaImplicits.html" title=""></a>
<a href="AggregatingJavaImplicits.html" title="">AggregatingJavaImplicits</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="AggregatingStandardImplicits.html" title=""></a>
<a href="AggregatingStandardImplicits.html" title="">AggregatingStandardImplicits</a>
</li><li class="current-entities indented3">
<a class="object" href="CheckerAsserting$.html" title="Companion object to CheckerAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit."></a>
<a class="trait" href="CheckerAsserting.html" title="Supertrait for CheckerAsserting typeclasses, which are used to implement and determine the result type of GeneratorDrivenPropertyChecks's apply and forAll method."></a>
<a href="CheckerAsserting.html" title="Supertrait for CheckerAsserting typeclasses, which are used to implement and determine the result type of GeneratorDrivenPropertyChecks's apply and forAll method.">CheckerAsserting</a>
</li><li class="current-entities indented3">
<a class="object" href="Collecting$.html" title="Companion object for Collecting that provides implicit implementations for the following types:"></a>
<a class="trait" href="Collecting.html" title="Supertrait for typeclasses that enable loneElement and inspectors syntax for collections."></a>
<a href="Collecting.html" title="Supertrait for typeclasses that enable loneElement and inspectors syntax for collections.">Collecting</a>
</li><li class="current-entities indented3">
<a class="object" href="Containing$.html" title="Companion object for Containing that provides implicit implementations for the following types:"></a>
<a class="trait" href="Containing.html" title="Supertrait for typeclasses that enable certain contain matcher syntax for containers."></a>
<a href="Containing.html" title="Supertrait for typeclasses that enable certain contain matcher syntax for containers.">Containing</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="ContainingHighPriorityImplicits.html" title=""></a>
<a href="ContainingHighPriorityImplicits.html" title="">ContainingHighPriorityImplicits</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="ContainingImpls.html" title=""></a>
<a href="ContainingImpls.html" title="">ContainingImpls</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="ContainingStandardImplicits.html" title=""></a>
<a href="ContainingStandardImplicits.html" title="">ContainingStandardImplicits</a>
</li><li class="current-entities indented3">
<a class="object" href="Definition$.html" title="Companion object for Definition that provides implicit implementations for the following types:"></a>
<a class="trait" href="Definition.html" title="Supertrait for typeclasses that enable the be defined matcher syntax."></a>
<a href="Definition.html" title="Supertrait for typeclasses that enable the be defined matcher syntax.">Definition</a>
</li><li class="current-entities indented3">
<a class="object" href="Emptiness$.html" title="Companion object for Emptiness that provides implicit implementations for the following types:"></a>
<a class="trait" href="Emptiness.html" title="Supertrait for typeclasses that enable be empty matcher syntax."></a>
<a href="Emptiness.html" title="Supertrait for typeclasses that enable be empty matcher syntax.">Emptiness</a>
</li><li class="current-entities indented3">
<a class="object" href="Existence$.html" title="Companion object for Existence that provides implicit implementations for java.io.File."></a>
<a class="trait" href="Existence.html" title="Supertrait for typeclasses that enable the exist matcher syntax."></a>
<a href="Existence.html" title="Supertrait for typeclasses that enable the exist matcher syntax.">Existence</a>
</li><li class="current-entities indented3">
<a class="object" href="" title="Companion object for trait Futuristic that contains implicit Futuristic providers for FutureOutcome and Future[T] for any type T."></a>
<a class="trait" href="Futuristic.html" title="Supertrait for Futureistic typeclasses."></a>
<a href="Futuristic.html" title="Supertrait for Futureistic typeclasses.">Futuristic</a>
</li><li class="current-entities indented3">
<a class="object" href="InspectorAsserting$.html" title="Companion object to InspectorAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit."></a>
<a class="trait" href="InspectorAsserting.html" title="Supertrait for InspectorAsserting typeclasses, which are used to implement and determine the result type of Inspectors methods such as forAll, forBetween, etc."></a>
<a href="InspectorAsserting.html" title="Supertrait for InspectorAsserting typeclasses, which are used to implement and determine the result type of Inspectors methods such as forAll, forBetween, etc.">InspectorAsserting</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="trait" href="JavaContainingImplicits.html" title=""></a>
<a href="JavaContainingImplicits.html" title="">JavaContainingImplicits</a>
</li><li class="current-entities indented3">
<a class="object" href="KeyMapping$.html" title="Companion object for KeyMapping that provides implicit implementations for scala.collection.GenMap and java.util.Map."></a>
<a class="trait" href="KeyMapping.html" title="Supertrait for typeclasses that enable contain key matcher syntax."></a>
<a href="KeyMapping.html" title="Supertrait for typeclasses that enable contain key matcher syntax.">KeyMapping</a>
</li><li class="current-entities indented3">
<a class="object" href="Length$.html" title="Companion object for Length that provides implicit implementations for the following types:"></a>
<a class="trait" href="Length.html" title="Supertrait for Length typeclasses."></a>
<a href="Length.html" title="Supertrait for Length typeclasses.">Length</a>
</li><li class="current-entities indented3">
<a class="object" href="Messaging$.html" title="Companion object for Messaging that provides implicit implementations for the following types:"></a>
<a class="trait" href="Messaging.html" title="Supertrait for Messaging typeclasses."></a>
<a href="Messaging.html" title="Supertrait for Messaging typeclasses.">Messaging</a>
</li><li class="current-entities indented3">
<a class="object" href="Readability$.html" title="Companion object for Readability that provides implicit implementations for the following types:"></a>
<a class="trait" href="Readability.html" title="Supertrait for typeclasses that enable the be readable matcher syntax."></a>
<a href="Readability.html" title="Supertrait for typeclasses that enable the be readable matcher syntax.">Readability</a>
</li><li class="current-entities indented3">
<a class="object" href="Sequencing$.html" title="Companion object for Sequencing that provides implicit implementations for the following types:"></a>
<a class="trait" href="Sequencing.html" title="Typeclass that enables for sequencing certain contain syntax in the ScalaTest matchers DSL."></a>
<a href="Sequencing.html" title="Typeclass that enables for sequencing certain contain syntax in the ScalaTest matchers DSL.">Sequencing</a>
</li><li class="current-entities indented3">
<a class="object" href="Size$.html" title="Companion object for Size that provides implicit implementations for the following types:"></a>
<a class="trait" href="Size.html" title="Supertrait for Size typeclasses."></a>
<a href="Size.html" title="Supertrait for Size typeclasses.">Size</a>
</li><li class="current-entities indented3">
<a class="object" href="Sortable$.html" title="Companion object for Sortable that provides implicit implementations for the following types:"></a>
<a class="trait" href="Sortable.html" title="Supertrait for typeclasses that enable the be sorted matcher syntax."></a>
<a href="Sortable.html" title="Supertrait for typeclasses that enable the be sorted matcher syntax.">Sortable</a>
</li><li class="current-entities indented3">
<a class="object" href="TableAsserting$.html" title="Companion object to TableAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit."></a>
<a class="trait" href="TableAsserting.html" title="Supertrait for TableAsserting typeclasses, which are used to implement and determine the result type of TableDrivenPropertyChecks's forAll, forEvery and exists method."></a>
<a href="TableAsserting.html" title="Supertrait for TableAsserting typeclasses, which are used to implement and determine the result type of TableDrivenPropertyChecks's forAll, forEvery and exists method.">TableAsserting</a>
</li><li class="current-entities indented3">
<a class="object" href="Timed$.html" title="Companion object for Timed typeclass that offers three implicit providers: one for FutureOutcome, one for Future of any type, and one for any other type."></a>
<a class="trait" href="Timed.html" title="Trait that provides a timeoutAfter construct, which allows you to specify a timeout for an operation passed as a by-name parameter, as well as a way to signal/interrupt it if the operation exceeds its time limit."></a>
<a href="Timed.html" title="Trait that provides a timeoutAfter construct, which allows you to specify a timeout for an operation passed as a by-name parameter, as well as a way to signal/interrupt it if the operation exceeds its time limit.">Timed</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="class" href="UnitCheckerAsserting.html" title="Class holding lowest priority CheckerAsserting implicit, which enables GeneratorDrivenPropertyChecks expressions that have result type Unit."></a>
<a href="UnitCheckerAsserting.html" title="Class holding lowest priority CheckerAsserting implicit, which enables GeneratorDrivenPropertyChecks expressions that have result type Unit.">UnitCheckerAsserting</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="class" href="UnitInspectorAsserting.html" title="Class holding lowest priority InspectorAsserting implicit, which enables inspector expressions that have result type Unit."></a>
<a href="UnitInspectorAsserting.html" title="Class holding lowest priority InspectorAsserting implicit, which enables inspector expressions that have result type Unit.">UnitInspectorAsserting</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="class" href="UnitTableAsserting.html" title="Class holding lowest priority TableAsserting implicit, which enables TableDrivenPropertyChecks expressions that have result type Unit."></a>
<a href="UnitTableAsserting.html" title="Class holding lowest priority TableAsserting implicit, which enables TableDrivenPropertyChecks expressions that have result type Unit.">UnitTableAsserting</a>
</li><li class="current-entities indented3">
<span class="separator"></span>
<a class="class" href="UnitWheneverAsserting.html" title="Class holding lowest priority WheneverAsserting implicit, which enables Whenever expressions that have result type Unit."></a>
<a href="UnitWheneverAsserting.html" title="Class holding lowest priority WheneverAsserting implicit, which enables Whenever expressions that have result type Unit.">UnitWheneverAsserting</a>
</li><li class="current-entities indented3">
<a class="object" href="ValueMapping$.html" title="Companion object for ValueMapping that provides implicit implementations for scala.collection.GenMap and java.util.Map."></a>
<a class="trait" href="ValueMapping.html" title="Supertrait for typeclasses that enable contain value matcher syntax."></a>
<a href="ValueMapping.html" title="Supertrait for typeclasses that enable contain value matcher syntax.">ValueMapping</a>
</li><li class="current-entities indented3">
<a class="object" href="WheneverAsserting$.html" title="Companion object to WheneverAsserting that provides two implicit providers, a higher priority one for passed functions that have result type Assertion, which also yields result type Assertion, and one for any other type, which yields result type Unit."></a>
<a class="trait" href="WheneverAsserting.html" title="Supertrait for WheneverAsserting typeclasses, which are used to implement and determine the result type of Whenever's whenever method."></a>
<a href="WheneverAsserting.html" title="Supertrait for WheneverAsserting typeclasses, which are used to implement and determine the result type of Whenever's whenever method.">WheneverAsserting</a>
</li><li class="current-entities indented3">
<a class="object" href="Writability$.html" title="Companion object for Writability that provides implicit implementations for the following types:"></a>
<a class="trait" href="Writability.html" title="Supertrait for typeclasses that enable the be writable matcher syntax."></a>
<a href="Writability.html" title="Supertrait for typeclasses that enable the be writable matcher syntax.">Writability</a>
</li>
</ul>
</div>
</div>
<div id="content">
<body class="object value">
<!-- Top of doc.scalatest.org [javascript] -->
<script type="text/javascript">
var rnd = window.rnd || Math.floor(Math.random()*10e6);
var pid204546 = window.pid204546 || rnd;
var plc204546 = window.plc204546 || 0;
var abkw = window.abkw || '';
var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER';
document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>');
</script>
<div id="definition">
<a href="Futuristic.html" title="See companion trait"><div class="big-circle object-companion-trait">o</div></a>
<p id="owner"><a href="../../index.html" class="extype" name="org">org</a>.<a href="../index.html" class="extype" name="org.scalatest">scalatest</a>.<a href="index.html" class="extype" name="org.scalatest.enablers">enablers</a></p>
<h1><a href="Futuristic.html" title="See companion trait">Futuristic</a><span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span></h1>
<h3><span class="morelinks"><div>
Companion <a href="Futuristic.html" title="See companion trait">trait Futuristic</a>
</div></span></h3>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<span class="name">Futuristic</span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>Companion object for trait <code>Futuristic</code> that contains implicit <code>Futuristic</code> providers for
<code>FutureOutcome</code> and <code>Future[T]</code> for any type <code>T</code>.
</p></div><dl class="attributes block"> <dt>Source</dt><dd><a href="https://github.com/scalatest/scalatest/tree/release-3.0.6/scalatest//src/main/scala/org/scalatest/enablers/Futuristic.scala" target="_blank">Futuristic.scala</a></dd></dl><div class="toggleContainer block">
<span class="toggle">
Linear Supertypes
</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div class="toggle"></div>
<div id="memberfilter">
<i class="material-icons arrow"></i>
<span class="input">
<input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />
</span>
<i class="clear material-icons"></i>
</div>
<div id="filterby">
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div class="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="org.scalatest.enablers.Futuristic"><span>Futuristic</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div class="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
</div>
<div id="template">
<div id="allMembers">
<div class="values members">
<h3>Value Members</h3>
<ol>
<li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#!=(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html###():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#==(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#asInstanceOf[T0]:T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a><a id="clone():AnyRef"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#clone():Object" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#eq(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a><a id="equals(Any):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#equals(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#finalize():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="org.scalatest.enablers.Futuristic#futuristicNatureOfFutureOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="futuristicNatureOfFutureOf[V](implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[scala.concurrent.Future[V]]"></a><a id="futuristicNatureOfFutureOf[V](ExecutionContext):Futuristic[Future[V]]"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#futuristicNatureOfFutureOf[V](implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[scala.concurrent.Future[V]]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">implicit </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">futuristicNatureOfFutureOf</span><span class="tparams">[<span name="V">V</span>]</span><span class="params">(<span class="implicit">implicit </span><span name="executionContext">executionContext: <span class="extype" name="scala.concurrent.ExecutionContext">ExecutionContext</span></span>)</span><span class="result">: <a href="Futuristic.html" class="extype" name="org.scalatest.enablers.Futuristic">Futuristic</a>[<span class="extype" name="scala.concurrent.Future">Future</span>[<span class="extype" name="org.scalatest.enablers.Futuristic.futuristicNatureOfFutureOf.V">V</span>]]</span>
</span>
<p class="shortcomment cmt">Provides a <code>Futuristic</code> value for <code>Future[V]</code> for any type <code>V</code> that performs cleanup using the
implicitly provided execution context.</p><div class="fullcomment"><div class="comment cmt"><p>Provides a <code>Futuristic</code> value for <code>Future[V]</code> for any type <code>V</code> that performs cleanup using the
implicitly provided execution context.
</p></div><dl class="paramcmts block"><dt class="param">executionContext</dt><dd class="cmt"><p>an execution context that provides a strategy for executing the cleanup function</p></dd><dt>returns</dt><dd class="cmt"><p>a <code>Futuristic</code> instance for <code>Future[V]</code></p></dd></dl></div>
</li><li name="org.scalatest.enablers.Futuristic#futuristicNatureOfFutureOutcome" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="futuristicNatureOfFutureOutcome(implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[org.scalatest.FutureOutcome]"></a><a id="futuristicNatureOfFutureOutcome(ExecutionContext):Futuristic[FutureOutcome]"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#futuristicNatureOfFutureOutcome(implicitexecutionContext:scala.concurrent.ExecutionContext):org.scalatest.enablers.Futuristic[org.scalatest.FutureOutcome]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">implicit </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">futuristicNatureOfFutureOutcome</span><span class="params">(<span class="implicit">implicit </span><span name="executionContext">executionContext: <span class="extype" name="scala.concurrent.ExecutionContext">ExecutionContext</span></span>)</span><span class="result">: <a href="Futuristic.html" class="extype" name="org.scalatest.enablers.Futuristic">Futuristic</a>[<a href="../FutureOutcome.html" class="extype" name="org.scalatest.FutureOutcome">FutureOutcome</a>]</span>
</span>
<p class="shortcomment cmt">Provides a <code>Futuristic</code> value for <code>FutureOutcome</code> that performs cleanup using the
implicitly provided execution context.</p><div class="fullcomment"><div class="comment cmt"><p>Provides a <code>Futuristic</code> value for <code>FutureOutcome</code> that performs cleanup using the
implicitly provided execution context.
</p></div><dl class="paramcmts block"><dt class="param">executionContext</dt><dd class="cmt"><p>an execution context that provides a strategy for executing the cleanup function</p></dd><dt>returns</dt><dd class="cmt"><p>a <code>Futuristic</code> instance for <code>FutureOutcome</code></p></dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#getClass():Class[_]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#hashCode" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#hashCode():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#isInstanceOf[T0]:Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#ne(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#notify():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#notifyAll():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#synchronized[T0](x$1:=>T0):T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#toString" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#toString():String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#wait():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a>
<span class="permalink">
<a href="../../../org/scalatest/enablers/Futuristic$.html#wait(x$1:Long):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li>
</ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</div>
</div>
</div>
</body>
</html>
|
{
"content_hash": "eeadef58937ad6a35ddd7048ab8de70d",
"timestamp": "",
"source": "github",
"line_count": 801,
"max_line_length": 617,
"avg_line_length": 65.77153558052434,
"alnum_prop": 0.6138412770723004,
"repo_name": "scalatest/scalatest-website",
"id": "21fd965f82e513f76bb7a68269f6f12270d9a4b4",
"size": "52761",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/scaladoc/3.0.6/org/scalatest/enablers/Futuristic$.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "8401192"
},
{
"name": "HTML",
"bytes": "4508833233"
},
{
"name": "JavaScript",
"bytes": "12256885"
},
{
"name": "Procfile",
"bytes": "62"
},
{
"name": "Scala",
"bytes": "136544"
}
],
"symlink_target": ""
}
|
layout: post
title: Backup Gridfs files as normal files
published: true
category: blog
description: This is the monster I created to get gridfs files backed up as if they where on filesystem
---
This is the monster I created to get gridfs files backed up as if they where on filesystem:
<http://gist.github.com/534099>
One thing I wanted was to keep the script in one file, and to make it work with the least dependencies possibile.
This is what it does with the dump commnad
- dump all collections but fs.chunks as usual, with mongodump
- Gzip all bson files
- create a directory for grids files
- dump gridfs files to filesystem via Ruby, only if id+checksum did not change
- remove fs files that are no longer in the database
On restore
- unzip bson files
- restore the database from bson files
- iterate over fs.files collection, read dumped file from filesystem and restore it into gridfs.
The operations above can be performed on a subset of databases.
I learned a couple of things working on this script:
- What :snapshot => true is for. I ended up in an endless loop on restore. Cursor was beeing fed with new records on every iteration.
- Authentication in mongodb is painful. You have to add admin user to each and every database in order to make this script work for the whole instance when --auth is on.
Enjoy!
|
{
"content_hash": "4c53408a9f99e8748ed06ad5204d7b52",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 171,
"avg_line_length": 38.4,
"alnum_prop": 0.7708333333333334,
"repo_name": "freegenie/freegenie.github.io",
"id": "bab53cc31ad3b668beb745a2e70a1e91fe752e05",
"size": "1348",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2010-08-16-backup-gridfs-files-as-normal-files.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "25005"
},
{
"name": "Ruby",
"bytes": "4330"
}
],
"symlink_target": ""
}
|
package com.sksamuel.elastic4s.searches.queries.geo
import com.sksamuel.elastic4s.searches.GeoPoint
import com.sksamuel.exts.OptionImplicits._
import com.sksamuel.elastic4s.searches.queries.Query
case class GeoHashCellQuery(field: String,
geopoint: Option[GeoPoint] = None,
geohash: Option[String] = None,
neighbors: Option[Boolean] = None,
ignoreUnmapped: Option[Boolean] = None,
precisionLevels: Option[Int] = None,
precisionString: Option[String] = None,
boost: Option[Double] = None,
queryName: Option[String] = None)
extends Query {
def point(lat: Double, long: Double): GeoHashCellQuery = copy(geopoint = GeoPoint(lat, long).some)
def point(geoPoint: GeoPoint): GeoHashCellQuery = copy(geopoint = geoPoint.some)
def geohash(geohash: String): GeoHashCellQuery = copy(geohash = geohash.some)
def withPrecision(precision: Int): GeoHashCellQuery = copy(precisionLevels = Some(precision))
def withPrecision(precision: String): GeoHashCellQuery = copy(precisionString = Some(precision))
def neighbours(neighbors: Boolean): GeoHashCellQuery = copy(neighbors = Some(neighbors))
def ignoreUnmapped(ignoreUnmapped: Boolean): GeoHashCellQuery =
copy(ignoreUnmapped = Option(ignoreUnmapped))
def queryName(name: String): GeoHashCellQuery = copy(queryName = Option(name))
def boost(boost: Double): GeoHashCellQuery = copy(boost = Option(boost))
}
|
{
"content_hash": "8aded93132b9e91620f064653d261aa7",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 100,
"avg_line_length": 50.375,
"alnum_prop": 0.6581885856079405,
"repo_name": "Tecsisa/elastic4s",
"id": "70679f66a6ad7d06b14a0bc74e354f761fccf32a",
"size": "1612",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/queries/geo/GeoHashCellQuery.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "93"
},
{
"name": "Scala",
"bytes": "1286336"
}
],
"symlink_target": ""
}
|
// Type definitions for aws-sdk - AWS Storage Gateway
// Project: https://github.com/aws/aws-sdk-js
// Definitions by: https://github.com/ingenieux/aws-sdk-typescript
// GENERATED CODE - DO NOT EDIT
// COMMENTED <reference path="./aws-sdk.d.ts" />
declare module "aws-sdk" {
/**
* apiVersion: 2013-06-30
* endpointPrefix: storagegateway
* serviceAbbreviation:
* signatureVersion: v4
* protocol: json
*
* AWS Storage Gateway Service AWS Storage Gateway is the service that connects an
on-premises software appliance with cloud-based storage to provide seamless and
secure integration between an organization's on-premises IT environment and
AWS's storage infrastructure. The service enables you to securely upload data to
the AWS cloud for cost effective backup and rapid disaster recovery.
Use the following links to get started using the AWS Storage Gateway Service API
Reference:
&#42; AWS Storage Gateway Required Request Headers
[http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewayHTTPRequestsHeaders]
: Describes the required headers that you must send with every POST request
to AWS Storage Gateway.
* Signing Requests
[http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewaySigningRequests]
: AWS Storage Gateway requires that you authenticate every request you send;
this topic describes how sign such a request.
* Error Responses
[http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#APIErrorResponses]
: Provides reference information about AWS Storage Gateway errors.
* Operations in AWS Storage Gateway
[http://docs.aws.amazon.com/storagegateway/latest/APIReference/API_Operations.html]
: Contains detailed descriptions of all AWS Storage Gateway operations, their
request parameters, response elements, possible errors, and examples of
requests and responses.
* AWS Storage Gateway Regions and Endpoints
[http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html]:
Provides a list of each of the s and endpoints available for use with AWS
Storage Gateway.
AWS Storage Gateway resource IDs are in uppercase. When you use these resource
IDs with the Amazon EC2 API, EC2 expects resource IDs in lowercase. You must
change your resource ID to lowercase to use it with the EC2 API. For example, in
Storage Gateway the ID for a volume might be vol-1122AABB. When you use this ID
with the EC2 API, you must change it to vol-1122aabb. Otherwise, the EC2 API
might not behave as expected.
IDs for Storage Gateway volumes and Amazon EBS snapshots created from gateway
volumes are changing to a longer format. Starting in December 2016, all new
volumes and snapshots will be created with a 17-character string. Starting in
April 2016, you will be able to use these longer IDs so you can test your
systems with the new format. For more information, see Longer EC2 and EBS
Resource IDs [https://aws.amazon.com/ec2/faqs/#longer-ids].
For example, a volume ARN with the longer volume ID format will look like this:
arn:aws:storagegateway:us-west-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABBCCDDEEFFG
.
A snapshot ID with the longer ID format will look like this:
snap-78e226633445566ee.
For more information, see Announcement: Heads-up – Longer AWS Storage Gateway
volume and snapshot IDs coming in 2016
[https://forums.aws.amazon.com/ann.jspa?annID=3557].
*
*/
export class StorageGateway extends Service {
constructor(options?: any);
endpoint: Endpoint;
/**
* Activates the gateway you previously deployed on your host. For more
information, see Activate the AWS Storage Gateway
[http://docs.aws.amazon.com/storagegateway/latest/userguide/GettingStartedActivateGateway-common.html]
. In the activation process, you specify information such as the you want to use
for storing snapshots, the time zone for scheduled snapshots the gateway
snapshot schedule window, an activation key, and a name for your gateway. The
activation process also associates your gateway with your account; for more
information, see UpdateGatewayInformation.
You must turn on the gateway VM before you can activate your gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
activateGateway(params: StorageGateway.ActivateGatewayInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ActivateGatewayOutput|any) => void): Request<StorageGateway.ActivateGatewayOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Configures one or more gateway local disks as cache for a cached-volume gateway.
This operation is supported only for the gateway-cached volume architecture (see
Storage Gateway Concepts
[http://docs.aws.amazon.com/storagegateway/latest/userguide/StorageGatewayConcepts.html]
).
In the request, you specify the gateway Amazon Resource Name (ARN) to which you
want to add cache, and one or more disk IDs that you want to configure as cache.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
addCache(params: StorageGateway.AddCacheInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.AddCacheOutput|any) => void): Request<StorageGateway.AddCacheOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Adds one or more tags to the specified resource. You use tags to add metadata to
resources, which you can use to categorize these resources. For example, you can
categorize resources by purpose, owner, environment, or team. Each tag consists
of a key and a value, which you define. You can add tags to the following AWS
Storage Gateway resources:
&#42; Storage gateways of all types
* Storage Volumes
* Virtual Tapes
You can create a maximum of 10 tags for each resource. Virtual tapes and storage
volumes that are recovered to a new gateway maintain their tags.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
addTagsToResource(params: StorageGateway.AddTagsToResourceInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.AddTagsToResourceOutput|any) => void): Request<StorageGateway.AddTagsToResourceOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Configures one or more gateway local disks as upload buffer for a specified
gateway. This operation is supported for both the gateway-stored and
gateway-cached volume architectures.
In the request, you specify the gateway Amazon Resource Name (ARN) to which you
want to add upload buffer, and one or more disk IDs that you want to configure
as upload buffer.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
addUploadBuffer(params: StorageGateway.AddUploadBufferInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.AddUploadBufferOutput|any) => void): Request<StorageGateway.AddUploadBufferOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Configures one or more gateway local disks as working storage for a gateway.
This operation is supported only for the gateway-stored volume architecture.
This operation is deprecated in cached-volumes API version 20120630. Use
AddUploadBuffer instead.
Working storage is also referred to as upload buffer. You can also use the
AddUploadBuffer operation to add upload buffer to a stored-volume gateway.
In the request, you specify the gateway Amazon Resource Name (ARN) to which you
want to add working storage, and one or more disk IDs that you want to configure
as working storage.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
addWorkingStorage(params: StorageGateway.AddWorkingStorageInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.AddWorkingStorageOutput|any) => void): Request<StorageGateway.AddWorkingStorageOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Cancels archiving of a virtual tape to the virtual tape shelf (VTS) after the
archiving process is initiated.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
cancelArchival(params: StorageGateway.CancelArchivalInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CancelArchivalOutput|any) => void): Request<StorageGateway.CancelArchivalOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Cancels retrieval of a virtual tape from the virtual tape shelf (VTS) to a
gateway after the retrieval process is initiated. The virtual tape is returned
to the VTS.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
cancelRetrieval(params: StorageGateway.CancelRetrievalInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CancelRetrievalOutput|any) => void): Request<StorageGateway.CancelRetrievalOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Creates a cached volume on a specified cached gateway. This operation is
supported only for the gateway-cached volume architecture.
Cache storage must be allocated to the gateway before you can create a cached
volume. Use the AddCache operation to add cache storage to a gateway.
In the request, you must specify the gateway, size of the volume in bytes, the
iSCSI target name, an IP address on which to expose the target, and a unique
client token. In response, AWS Storage Gateway creates the volume and returns
information about it. This information includes the volume Amazon Resource Name
(ARN), its size, and the iSCSI target ARN that initiators can use to connect to
the volume target.
Optionally, you can provide the ARN for an existing volume as the
SourceVolumeARN for this cached volume, which creates an exact copy of the
existing volume’s latest recovery point. The VolumeSizeInBytes value must be
equal to or larger than the size of the copied volume, in bytes.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
createCachediSCSIVolume(params: StorageGateway.CreateCachediSCSIVolumeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CreateCachediSCSIVolumeOutput|any) => void): Request<StorageGateway.CreateCachediSCSIVolumeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Creates a file share on an existing file gateway. In Storage Gateway, a file
share is a file system mount point backed by Amazon S3 cloud storage. Storage
Gateway exposes file shares using a Network File System (NFS) interface.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
createNFSFileShare(params: StorageGateway.CreateNFSFileShareInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CreateNFSFileShareOutput|any) => void): Request<StorageGateway.CreateNFSFileShareOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Initiates a snapshot of a volume.
AWS Storage Gateway provides the ability to back up point-in-time snapshots of
your data to Amazon Simple Storage (S3) for durable off-site recovery, as well
as import the data to an Amazon Elastic Block Store (EBS) volume in Amazon
Elastic Compute Cloud (EC2). You can take snapshots of your gateway volume on a
scheduled or ad-hoc basis. This API enables you to take ad-hoc snapshot. For
more information, see Working With Snapshots in the AWS Storage Gateway Console
[http://docs.aws.amazon.com/storagegateway/latest/userguide/WorkingWithSnapshots.html]
.
In the CreateSnapshot request you identify the volume by providing its Amazon
Resource Name (ARN). You must also provide description for the snapshot. When
AWS Storage Gateway takes the snapshot of specified volume, the snapshot and
description appears in the AWS Storage Gateway Console. In response, AWS Storage
Gateway returns you a snapshot ID. You can use this snapshot ID to check the
snapshot progress or later use it when you want to create a volume from a
snapshot.
To list or delete a snapshot, you must use the Amazon EC2 API. For more
information, see DescribeSnapshots or DeleteSnapshot in the EC2 API reference
[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Operations.html].
Volume and snapshot IDs are changing to a longer length ID format. For more
information, see the important note on the Welcome
[http://docs.aws.amazon.com/storagegateway/latest/APIReference/Welcome.html]
page.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
* @error ServiceUnavailableError
*/
createSnapshot(params: StorageGateway.CreateSnapshotInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|StorageGateway.ServiceUnavailableError|any, data: StorageGateway.CreateSnapshotOutput|any) => void): Request<StorageGateway.CreateSnapshotOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|StorageGateway.ServiceUnavailableError|any>;
/**
* Initiates a snapshot of a gateway from a volume recovery point. This operation
is supported only for the gateway-cached volume architecture.
A volume recovery point is a point in time at which all data of the volume is
consistent and from which you can create a snapshot. To get a list of volume
recovery point for gateway-cached volumes, use ListVolumeRecoveryPoints.
In the CreateSnapshotFromVolumeRecoveryPoint request, you identify the volume by
providing its Amazon Resource Name (ARN). You must also provide a description
for the snapshot. When AWS Storage Gateway takes a snapshot of the specified
volume, the snapshot and its description appear in the AWS Storage Gateway
console. In response, AWS Storage Gateway returns you a snapshot ID. You can use
this snapshot ID to check the snapshot progress or later use it when you want to
create a volume from a snapshot.
To list or delete a snapshot, you must use the Amazon EC2 API. For more
information, in Amazon Elastic Compute Cloud API Reference.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
* @error ServiceUnavailableError
*/
createSnapshotFromVolumeRecoveryPoint(params: StorageGateway.CreateSnapshotFromVolumeRecoveryPointInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|StorageGateway.ServiceUnavailableError|any, data: StorageGateway.CreateSnapshotFromVolumeRecoveryPointOutput|any) => void): Request<StorageGateway.CreateSnapshotFromVolumeRecoveryPointOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|StorageGateway.ServiceUnavailableError|any>;
/**
* Creates a volume on a specified gateway. This operation is supported only for
the gateway-stored volume architecture.
The size of the volume to create is inferred from the disk size. You can choose
to preserve existing data on the disk, create volume from an existing snapshot,
or create an empty volume. If you choose to create an empty gateway volume, then
any existing data on the disk is erased.
In the request you must specify the gateway and the disk information on which
you are creating the volume. In response, AWS Storage Gateway creates the volume
and returns volume information such as the volume Amazon Resource Name (ARN),
its size, and the iSCSI target ARN that initiators can use to connect to the
volume target.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
createStorediSCSIVolume(params: StorageGateway.CreateStorediSCSIVolumeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CreateStorediSCSIVolumeOutput|any) => void): Request<StorageGateway.CreateStorediSCSIVolumeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Creates a virtual tape by using your own barcode. You write data to the virtual
tape and then archive the tape.
Cache storage must be allocated to the gateway before you can create a virtual
tape. Use the AddCache operation to add cache storage to a gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
createTapeWithBarcode(params: StorageGateway.CreateTapeWithBarcodeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CreateTapeWithBarcodeOutput|any) => void): Request<StorageGateway.CreateTapeWithBarcodeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Creates one or more virtual tapes. You write data to the virtual tapes and then
archive the tapes.
Cache storage must be allocated to the gateway before you can create virtual
tapes. Use the AddCache operation to add cache storage to a gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
createTapes(params: StorageGateway.CreateTapesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.CreateTapesOutput|any) => void): Request<StorageGateway.CreateTapesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes the bandwidth rate limits of a gateway. You can delete either the upload
and download bandwidth rate limit, or you can delete both. If you delete only
one of the limits, the other limit remains unchanged. To specify which gateway
to work with, use the Amazon Resource Name (ARN) of the gateway in your request.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteBandwidthRateLimit(params: StorageGateway.DeleteBandwidthRateLimitInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteBandwidthRateLimitOutput|any) => void): Request<StorageGateway.DeleteBandwidthRateLimitOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a
specified iSCSI target and initiator pair.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteChapCredentials(params: StorageGateway.DeleteChapCredentialsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteChapCredentialsOutput|any) => void): Request<StorageGateway.DeleteChapCredentialsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes a file share from a file gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteFileShare(params: StorageGateway.DeleteFileShareInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteFileShareOutput|any) => void): Request<StorageGateway.DeleteFileShareOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes a gateway. To specify which gateway to delete, use the Amazon Resource
Name (ARN) of the gateway in your request. The operation deletes the gateway;
however, it does not delete the gateway virtual machine (VM) from your host
computer.
After you delete a gateway, you cannot reactivate it. Completed snapshots of the
gateway volumes are not deleted upon deleting the gateway, however, pending
snapshots will not complete. After you delete a gateway, your next step is to
remove it from your environment.
You no longer pay software charges after the gateway is deleted; however, your
existing Amazon EBS snapshots persist and you will continue to be billed for
these snapshots. You can choose to remove all remaining Amazon EBS snapshots by
canceling your Amazon EC2 subscription. If you prefer not to cancel your Amazon
EC2 subscription, you can delete your snapshots using the Amazon EC2 console.
For more information, see the AWS Storage Gateway Detail Page
[http://aws.amazon.com/storagegateway].
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteGateway(params: StorageGateway.DeleteGatewayInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteGatewayOutput|any) => void): Request<StorageGateway.DeleteGatewayOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes a snapshot of a volume.
You can take snapshots of your gateway volumes on a scheduled or ad hoc basis.
This API action enables you to delete a snapshot schedule for a volume. For more
information, see Working with Snapshots
[http://docs.aws.amazon.com/storagegateway/latest/userguide/WorkingWithSnapshots.html]
. In the DeleteSnapshotSchedule request, you identify the volume by providing
its Amazon Resource Name (ARN).
To list or delete a snapshot, you must use the Amazon EC2 API. in Amazon Elastic
Compute Cloud API Reference.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteSnapshotSchedule(params: StorageGateway.DeleteSnapshotScheduleInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteSnapshotScheduleOutput|any) => void): Request<StorageGateway.DeleteSnapshotScheduleOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes the specified virtual tape.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteTape(params: StorageGateway.DeleteTapeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteTapeOutput|any) => void): Request<StorageGateway.DeleteTapeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes the specified virtual tape from the virtual tape shelf (VTS).
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteTapeArchive(params: StorageGateway.DeleteTapeArchiveInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteTapeArchiveOutput|any) => void): Request<StorageGateway.DeleteTapeArchiveOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Deletes the specified gateway volume that you previously created using the
CreateCachediSCSIVolume or CreateStorediSCSIVolume API. For gateway-stored
volumes, the local disk that was configured as the storage volume is not
deleted. You can reuse the local disk to create another storage volume.
Before you delete a gateway volume, make sure there are no iSCSI connections to
the volume you are deleting. You should also make sure there is no snapshot in
progress. You can use the Amazon Elastic Compute Cloud (Amazon EC2) API to query
snapshots on the volume you are deleting and check the snapshot status. For more
information, go to DescribeSnapshots
[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html]
in the Amazon Elastic Compute Cloud API Reference.
In the request, you must provide the Amazon Resource Name (ARN) of the storage
volume you want to delete.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
deleteVolume(params: StorageGateway.DeleteVolumeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DeleteVolumeOutput|any) => void): Request<StorageGateway.DeleteVolumeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns the bandwidth rate limits of a gateway. By default, these limits are not
set, which means no bandwidth rate limiting is in effect.
This operation only returns a value for a bandwidth rate limit only if the limit
is set. If no limits are set for the gateway, then this operation returns only
the gateway ARN in the response body. To specify which gateway to describe, use
the Amazon Resource Name (ARN) of the gateway in your request.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeBandwidthRateLimit(params: StorageGateway.DescribeBandwidthRateLimitInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeBandwidthRateLimitOutput|any) => void): Request<StorageGateway.DescribeBandwidthRateLimitOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns information about the cache of a gateway. This operation is supported
only for the gateway-cached volume architecture.
The response includes disk IDs that are configured as cache, and it includes the
amount of cache allocated and used.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeCache(params: StorageGateway.DescribeCacheInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeCacheOutput|any) => void): Request<StorageGateway.DescribeCacheOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a description of the gateway volumes specified in the request. This
operation is supported only for the gateway-cached volume architecture.
The list of gateway volumes in the request must be from one gateway. In the
response Amazon Storage Gateway returns volume information sorted by volume
Amazon Resource Name (ARN).
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeCachediSCSIVolumes(params: StorageGateway.DescribeCachediSCSIVolumesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeCachediSCSIVolumesOutput|any) => void): Request<StorageGateway.DescribeCachediSCSIVolumesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns an array of Challenge-Handshake Authentication Protocol (CHAP)
credentials information for a specified iSCSI target, one for each
target-initiator pair.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeChapCredentials(params: StorageGateway.DescribeChapCredentialsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeChapCredentialsOutput|any) => void): Request<StorageGateway.DescribeChapCredentialsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns metadata about a gateway such as its name, network interfaces,
configured time zone, and the state (whether the gateway is running or not). To
specify which gateway to describe, use the Amazon Resource Name (ARN) of the
gateway in your request.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeGatewayInformation(params: StorageGateway.DescribeGatewayInformationInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeGatewayInformationOutput|any) => void): Request<StorageGateway.DescribeGatewayInformationOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns your gateway's weekly maintenance start time including the day and time
of the week. Note that values are in terms of the gateway's time zone.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeMaintenanceStartTime(params: StorageGateway.DescribeMaintenanceStartTimeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeMaintenanceStartTimeOutput|any) => void): Request<StorageGateway.DescribeMaintenanceStartTimeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Gets a description for one or more file shares from a file gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeNFSFileShares(params: StorageGateway.DescribeNFSFileSharesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeNFSFileSharesOutput|any) => void): Request<StorageGateway.DescribeNFSFileSharesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Describes the snapshot schedule for the specified gateway volume. The snapshot
schedule information includes intervals at which snapshots are automatically
initiated on the volume.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeSnapshotSchedule(params: StorageGateway.DescribeSnapshotScheduleInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeSnapshotScheduleOutput|any) => void): Request<StorageGateway.DescribeSnapshotScheduleOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns the description of the gateway volumes specified in the request. The
list of gateway volumes in the request must be from one gateway. In the response
Amazon Storage Gateway returns volume information sorted by volume ARNs.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeStorediSCSIVolumes(params: StorageGateway.DescribeStorediSCSIVolumesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeStorediSCSIVolumesOutput|any) => void): Request<StorageGateway.DescribeStorediSCSIVolumesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a description of specified virtual tapes in the virtual tape shelf
(VTS).
If a specific TapeARN is not specified, AWS Storage Gateway returns a
description of all virtual tapes found in the VTS associated with your account.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeTapeArchives(params: StorageGateway.DescribeTapeArchivesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeTapeArchivesOutput|any) => void): Request<StorageGateway.DescribeTapeArchivesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a list of virtual tape recovery points that are available for the
specified gateway-VTL.
A recovery point is a point-in-time view of a virtual tape at which all the data
on the virtual tape is consistent. If your gateway crashes, virtual tapes that
have recovery points can be recovered to a new gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeTapeRecoveryPoints(params: StorageGateway.DescribeTapeRecoveryPointsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeTapeRecoveryPointsOutput|any) => void): Request<StorageGateway.DescribeTapeRecoveryPointsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a description of the specified Amazon Resource Name (ARN) of virtual
tapes. If a TapeARN is not specified, returns a description of all virtual tapes
associated with the specified gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeTapes(params: StorageGateway.DescribeTapesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeTapesOutput|any) => void): Request<StorageGateway.DescribeTapesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns information about the upload buffer of a gateway. This operation is
supported for both the gateway-stored and gateway-cached volume architectures.
The response includes disk IDs that are configured as upload buffer space, and
it includes the amount of upload buffer space allocated and used.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeUploadBuffer(params: StorageGateway.DescribeUploadBufferInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeUploadBufferOutput|any) => void): Request<StorageGateway.DescribeUploadBufferOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a description of virtual tape library (VTL) devices for the specified
gateway. In the response, AWS Storage Gateway returns VTL device information.
The list of VTL devices must be from one gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeVTLDevices(params: StorageGateway.DescribeVTLDevicesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeVTLDevicesOutput|any) => void): Request<StorageGateway.DescribeVTLDevicesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns information about the working storage of a gateway. This operation is
supported only for the gateway-stored volume architecture. This operation is
deprecated in cached-volumes API version (20120630). Use DescribeUploadBuffer
instead.
Working storage is also referred to as upload buffer. You can also use the
DescribeUploadBuffer operation to add upload buffer to a stored-volume gateway.
The response includes disk IDs that are configured as working storage, and it
includes the amount of working storage allocated and used.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
describeWorkingStorage(params: StorageGateway.DescribeWorkingStorageInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DescribeWorkingStorageOutput|any) => void): Request<StorageGateway.DescribeWorkingStorageOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Disables a gateway when the gateway is no longer functioning. For example, if
your gateway VM is damaged, you can disable the gateway so you can recover
virtual tapes.
Use this operation for a gateway-VTL that is not reachable or not functioning.
Once a gateway is disabled it cannot be enabled.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
disableGateway(params: StorageGateway.DisableGatewayInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.DisableGatewayOutput|any) => void): Request<StorageGateway.DisableGatewayOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Gets a list of the file shares for a specific file gateway, or the list of file
shares that belong to the calling user account.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listFileShares(params: StorageGateway.ListFileSharesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListFileSharesOutput|any) => void): Request<StorageGateway.ListFileSharesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists gateways owned by an AWS account in a region specified in the request. The
returned list is ordered by gateway Amazon Resource Name (ARN).
By default, the operation returns a maximum of 100 gateways. This operation
supports pagination that allows you to optionally reduce the number of gateways
returned in a response.
If you have more gateways than are returned in a response (that is, the response
returns only a truncated list of your gateways), the response contains a marker
that you can specify in your next request to fetch the next page of gateways.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listGateways(params: StorageGateway.ListGatewaysInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListGatewaysOutput|any) => void): Request<StorageGateway.ListGatewaysOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Returns a list of the gateway's local disks. To specify which gateway to
describe, you use the Amazon Resource Name (ARN) of the gateway in the body of
the request.
The request returns a list of all disks, specifying which are configured as
working storage, cache storage, or stored volume or not configured at all. The
response includes a DiskStatus field. This field can have a value of present
(the disk is available to use), missing (the disk is no longer connected to the
gateway), or mismatch (the disk node is occupied by a disk that has incorrect
metadata or the disk content is corrupted).
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listLocalDisks(params: StorageGateway.ListLocalDisksInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListLocalDisksOutput|any) => void): Request<StorageGateway.ListLocalDisksOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists the tags that have been added to the specified resource.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listTagsForResource(params: StorageGateway.ListTagsForResourceInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListTagsForResourceOutput|any) => void): Request<StorageGateway.ListTagsForResourceOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists virtual tapes in your virtual tape library (VTL) and your virtual tape
shelf (VTS). You specify the tapes to list by specifying one or more tape Amazon
Resource Names (ARNs). If you don't specify a tape ARN, the operation lists all
virtual tapes in both your VTL and VTS.
This operation supports pagination. By default, the operation returns a maximum
of up to 100 tapes. You can optionally specify the Limit parameter in the body
to limit the number of tapes in the response. If the number of tapes returned in
the response is truncated, the response includes a Marker element that you can
use in your subsequent request to retrieve the next set of tapes.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listTapes(params: StorageGateway.ListTapesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListTapesOutput|any) => void): Request<StorageGateway.ListTapesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists iSCSI initiators that are connected to a volume. You can use this
operation to determine whether a volume is being used or not.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listVolumeInitiators(params: StorageGateway.ListVolumeInitiatorsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListVolumeInitiatorsOutput|any) => void): Request<StorageGateway.ListVolumeInitiatorsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists the recovery points for a specified gateway. This operation is supported
only for the gateway-cached volume architecture.
Each gateway-cached volume has one recovery point. A volume recovery point is a
point in time at which all data of the volume is consistent and from which you
can create a snapshot. To create a snapshot from a volume recovery point use the
CreateSnapshotFromVolumeRecoveryPoint operation.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listVolumeRecoveryPoints(params: StorageGateway.ListVolumeRecoveryPointsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListVolumeRecoveryPointsOutput|any) => void): Request<StorageGateway.ListVolumeRecoveryPointsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Lists the iSCSI stored volumes of a gateway. Results are sorted by volume ARN.
The response includes only the volume ARNs. If you want additional volume
information, use the DescribeStorediSCSIVolumes or the
DescribeCachediSCSIVolumes API.
The operation supports pagination. By default, the operation returns a maximum
of up to 100 volumes. You can optionally specify the Limit field in the body to
limit the number of volumes in the response. If the number of volumes returned
in the response is truncated, the response includes a Marker field. You can use
this Marker value in your subsequent request to retrieve the next set of
volumes.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
listVolumes(params: StorageGateway.ListVolumesInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ListVolumesOutput|any) => void): Request<StorageGateway.ListVolumesOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Removes one or more tags from the specified resource.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
removeTagsFromResource(params: StorageGateway.RemoveTagsFromResourceInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.RemoveTagsFromResourceOutput|any) => void): Request<StorageGateway.RemoveTagsFromResourceOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Resets all cache disks that have encountered a error and makes the disks
available for reconfiguration as cache storage. If your cache disk encounters a
error, the gateway prevents read and write operations on virtual tapes in the
gateway. For example, an error can occur when a disk is corrupted or removed
from the gateway. When a cache is reset, the gateway loses its cache storage. At
this point you can reconfigure the disks as cache disks.
If the cache disk you are resetting contains data that has not been uploaded to
Amazon S3 yet, that data can be lost. After you reset cache disks, there will be
no configured cache disks left in the gateway, so you must configure at least
one new cache disk for your gateway to function properly.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
resetCache(params: StorageGateway.ResetCacheInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ResetCacheOutput|any) => void): Request<StorageGateway.ResetCacheOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Retrieves an archived virtual tape from the virtual tape shelf (VTS) to a
gateway-VTL. Virtual tapes archived in the VTS are not associated with any
gateway. However after a tape is retrieved, it is associated with a gateway,
even though it is also listed in the VTS.
Once a tape is successfully retrieved to a gateway, it cannot be retrieved again
to another gateway. You must archive the tape again before you can retrieve it
to another gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
retrieveTapeArchive(params: StorageGateway.RetrieveTapeArchiveInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.RetrieveTapeArchiveOutput|any) => void): Request<StorageGateway.RetrieveTapeArchiveOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Retrieves the recovery point for the specified virtual tape.
A recovery point is a point in time view of a virtual tape at which all the data
on the tape is consistent. If your gateway crashes, virtual tapes that have
recovery points can be recovered to a new gateway.
The virtual tape can be retrieved to only one gateway. The retrieved tape is
read-only. The virtual tape can be retrieved to only a gateway-VTL. There is no
charge for retrieving recovery points.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
retrieveTapeRecoveryPoint(params: StorageGateway.RetrieveTapeRecoveryPointInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.RetrieveTapeRecoveryPointOutput|any) => void): Request<StorageGateway.RetrieveTapeRecoveryPointOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Sets the password for your VM local console. When you log in to the local
console for the first time, you log in to the VM with the default credentials.
We recommend that you set a new password. You don't need to know the default
password to set a new password.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
setLocalConsolePassword(params: StorageGateway.SetLocalConsolePasswordInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.SetLocalConsolePasswordOutput|any) => void): Request<StorageGateway.SetLocalConsolePasswordOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Shuts down a gateway. To specify which gateway to shut down, use the Amazon
Resource Name (ARN) of the gateway in the body of your request.
The operation shuts down the gateway service component running in the storage
gateway's virtual machine (VM) and not the VM.
If you want to shut down the VM, it is recommended that you first shut down the
gateway component in the VM to avoid unpredictable conditions.
After the gateway is shutdown, you cannot call any other API except StartGateway
, DescribeGatewayInformation, and ListGateways. For more information, see
ActivateGateway. Your applications cannot read from or write to the gateway's
storage volumes, and there are no snapshots taken.
When you make a shutdown request, you will get a 200 OK success response
immediately. However, it might take some time for the gateway to shut down. You
can call the DescribeGatewayInformation API to check the status. For more
information, see ActivateGateway.
If do not intend to use the gateway again, you must delete the gateway (using
DeleteGateway) to no longer pay software charges associated with the gateway.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
shutdownGateway(params: StorageGateway.ShutdownGatewayInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.ShutdownGatewayOutput|any) => void): Request<StorageGateway.ShutdownGatewayOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Starts a gateway that you previously shut down (see ShutdownGateway). After the
gateway starts, you can then make other API calls, your applications can read
from or write to the gateway's storage volumes and you will be able to take
snapshot backups.
When you make a request, you will get a 200 OK success response immediately.
However, it might take some time for the gateway to be ready. You should call
DescribeGatewayInformation and check the status before making any additional API
calls. For more information, see ActivateGateway.
To specify which gateway to start, use the Amazon Resource Name (ARN) of the
gateway in your request.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
startGateway(params: StorageGateway.StartGatewayInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.StartGatewayOutput|any) => void): Request<StorageGateway.StartGatewayOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates the bandwidth rate limits of a gateway. You can update both the upload
and download bandwidth rate limit or specify only one of the two. If you don't
set a bandwidth rate limit, the existing rate limit remains.
By default, a gateway's bandwidth rate limits are not set. If you don't set any
limit, the gateway does not have any limitations on its bandwidth usage and
could potentially use the maximum available bandwidth.
To specify which gateway to update, use the Amazon Resource Name (ARN) of the
gateway in your request.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateBandwidthRateLimit(params: StorageGateway.UpdateBandwidthRateLimitInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateBandwidthRateLimitOutput|any) => void): Request<StorageGateway.UpdateBandwidthRateLimitOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates the Challenge-Handshake Authentication Protocol (CHAP) credentials for a
specified iSCSI target. By default, a gateway does not have CHAP enabled;
however, for added security, you might use it.
When you update CHAP credentials, all existing connections on the target are
closed and initiators must reconnect with the new credentials.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateChapCredentials(params: StorageGateway.UpdateChapCredentialsInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateChapCredentialsOutput|any) => void): Request<StorageGateway.UpdateChapCredentialsOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates a gateway's metadata, which includes the gateway's name and time zone.
To specify which gateway to update, use the Amazon Resource Name (ARN) of the
gateway in your request.
For Gateways activated after September 2, 2015, the gateway's ARN contains the
gateway ID rather than the gateway name. However, changing the name of the
gateway has no effect on the gateway's ARN.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateGatewayInformation(params: StorageGateway.UpdateGatewayInformationInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateGatewayInformationOutput|any) => void): Request<StorageGateway.UpdateGatewayInformationOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates the gateway virtual machine (VM) software. The request immediately
triggers the software update.
When you make this request, you get a 200 OK success response immediately.
However, it might take some time for the update to complete. You can call
DescribeGatewayInformation to verify the gateway is in the STATE_RUNNING state.
A software update forces a system restart of your gateway. You can minimize the
chance of any disruption to your applications by increasing your iSCSI
Initiators' timeouts. For more information about increasing iSCSI Initiator
timeouts for Windows and Linux, see Customizing Your Windows iSCSI Settings
[http://docs.aws.amazon.com/storagegateway/latest/userguide/ConfiguringiSCSIClientInitiatorWindowsClient.html#CustomizeWindowsiSCSISettings]
and Customizing Your Linux iSCSI Settings
[http://docs.aws.amazon.com/storagegateway/latest/userguide/ConfiguringiSCSIClientInitiatorRedHatClient.html#CustomizeLinuxiSCSISettings]
, respectively.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateGatewaySoftwareNow(params: StorageGateway.UpdateGatewaySoftwareNowInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateGatewaySoftwareNowOutput|any) => void): Request<StorageGateway.UpdateGatewaySoftwareNowOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates a gateway's weekly maintenance start time information, including day and
time of the week. The maintenance time is the time in your gateway's time zone.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateMaintenanceStartTime(params: StorageGateway.UpdateMaintenanceStartTimeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateMaintenanceStartTimeOutput|any) => void): Request<StorageGateway.UpdateMaintenanceStartTimeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates a file share.
To leave a file share field unchanged, set the corresponding input field to
null.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateNFSFileShare(params: StorageGateway.UpdateNFSFileShareInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateNFSFileShareOutput|any) => void): Request<StorageGateway.UpdateNFSFileShareOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates a snapshot schedule configured for a gateway volume.
The default snapshot schedule for volume is once every 24 hours, starting at the
creation time of the volume. You can use this API to change the snapshot
schedule configured for the volume.
In the request you must identify the gateway volume whose snapshot schedule you
want to update, and the schedule information, including when you want the
snapshot to begin on a day and the frequency (in hours) of snapshots.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateSnapshotSchedule(params: StorageGateway.UpdateSnapshotScheduleInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateSnapshotScheduleOutput|any) => void): Request<StorageGateway.UpdateSnapshotScheduleOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
/**
* Updates the type of medium changer in a gateway-VTL. When you activate a
gateway-VTL, you select a medium changer type for the gateway-VTL. This
operation enables you to select a different type of medium changer after a
gateway-VTL is activated.
*
* @error InvalidGatewayRequestException
* @error InternalServerError
*/
updateVTLDeviceType(params: StorageGateway.UpdateVTLDeviceTypeInput, callback?: (err: StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any, data: StorageGateway.UpdateVTLDeviceTypeOutput|any) => void): Request<StorageGateway.UpdateVTLDeviceTypeOutput|any,StorageGateway.InvalidGatewayRequestException|StorageGateway.InternalServerError|any>;
}
export module StorageGateway {
export type ActivationKey = string;
export type BandwidthDownloadRateLimit = number;
export type BandwidthType = string;
export type BandwidthUploadRateLimit = number;
export type Boolean = boolean;
export type CachediSCSIVolumes = CachediSCSIVolume[];
export type ChapCredentials = ChapInfo[];
export type ChapSecret = string;
export type ClientToken = string;
export type CreatedDate = number;
export type DayOfWeek = number;
export type Description = string;
export type DeviceType = string;
export type DiskAllocationType = string;
export type DiskId = string;
export type DiskIds = DiskId[];
export type Disks = Disk[];
export type DoubleObject = number;
export type ErrorCode = string;
export type FileShareARN = string;
export type FileShareARNList = FileShareARN[];
export type FileShareId = string;
export type FileShareInfoList = FileShareInfo[];
export type FileShareStatus = string;
export type GatewayARN = string;
export type GatewayId = string;
export type GatewayName = string;
export type GatewayNetworkInterfaces = NetworkInterface[];
export type GatewayOperationalState = string;
export type GatewayState = string;
export type GatewayTimezone = string;
export type GatewayType = string;
export type Gateways = GatewayInfo[];
export type HourOfDay = number;
export type Initiator = string;
export type Initiators = Initiator[];
export type IqnName = string;
export type KMSKey = string;
export type LastSoftwareUpdate = string;
export type LocalConsolePassword = string;
export type LocationARN = string;
export type Marker = string;
export type MediumChangerType = string;
export type MinuteOfHour = number;
export type NFSFileShareInfoList = NFSFileShareInfo[];
export type NetworkInterfaceId = string;
export type NextUpdateAvailabilityDate = string;
export type NumTapesToCreate = number;
export type Path = string;
export type PermissionId = number;
export type PermissionMode = string;
export type PositiveIntObject = number;
export type RecurrenceInHours = number;
export type RegionId = string;
export type ResourceARN = string;
export type Role = string;
export type SnapshotDescription = string;
export type SnapshotId = string;
export type StorageClass = string;
export type StorediSCSIVolumes = StorediSCSIVolume[];
export type TagKey = string;
export type TagKeys = TagKey[];
export type TagValue = string;
export type Tags = Tag[];
export type TapeARN = string;
export type TapeARNs = TapeARN[];
export type TapeArchiveStatus = string;
export type TapeArchives = TapeArchive[];
export type TapeBarcode = string;
export type TapeBarcodePrefix = string;
export type TapeDriveType = string;
export type TapeInfos = TapeInfo[];
export type TapeRecoveryPointInfos = TapeRecoveryPointInfo[];
export type TapeRecoveryPointStatus = string;
export type TapeSize = number;
export type TapeStatus = string;
export type Tapes = Tape[];
export type TargetARN = string;
export type TargetName = string;
export type Time = number;
export type VTLDeviceARN = string;
export type VTLDeviceARNs = VTLDeviceARN[];
export type VTLDeviceProductIdentifier = string;
export type VTLDeviceType = string;
export type VTLDeviceVendor = string;
export type VTLDevices = VTLDevice[];
export type VolumeARN = string;
export type VolumeARNs = VolumeARN[];
export type VolumeId = string;
export type VolumeInfos = VolumeInfo[];
export type VolumeRecoveryPointInfos = VolumeRecoveryPointInfo[];
export type VolumeStatus = string;
export type VolumeType = string;
export type double = number;
export type errorDetails = {[key:string]: string};
export type integer = number;
export type long = number;
export interface ActivateGatewayInput {
/** Your gateway activation key. You can obtain the activation key by sending an
HTTP GET request with redirects enabled to the gateway IP address (port 80). The
redirect URL returned in the response provides you the activation key for your
gateway in the query string parameter activationKey. It may also include other
activation-related parameters, however, these are merely defaults -- the
arguments you pass to the ActivateGateway API call determine the actual
configuration of your gateway. **/
ActivationKey: ActivationKey;
/** The name you configured for your gateway. **/
GatewayName: GatewayName;
/** A value that indicates the time zone you want to set for the gateway. The time
zone is used, for example, for scheduling snapshots and your gateway's
maintenance schedule. **/
GatewayTimezone: GatewayTimezone;
/** A value that indicates the region where you want to store the snapshot backups.
The gateway region specified must be the same region as the region in your Host
header in the request. For more information about available regions and
endpoints for AWS Storage Gateway, see Regions and Endpoints
[http://docs.aws.amazon.com/general/latest/gr/rande.html#sg_region] in the
Amazon Web Services Glossary.
Valid Values: "us-east-1", "us-west-1", "us-west-2", "eu-west-1",
"eu-central-1", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1",
"ap-southeast-2", "sa-east-1" **/
GatewayRegion: RegionId;
/** A value that defines the type of gateway to activate. The type specified is
critical to all later functions of the gateway and cannot be changed after
activation. The default value is STORED. **/
GatewayType?: GatewayType;
/** The value that indicates the type of tape drive to use for gateway-VTL. This
field is optional.
Valid Values: "IBM-ULT3580-TD5" **/
TapeDriveType?: TapeDriveType;
/** The value that indicates the type of medium changer to use for gateway-VTL. This
field is optional.
Valid Values: "STK-L700", "AWS-Gateway-VTL" **/
MediumChangerType?: MediumChangerType;
}
export interface ActivateGatewayOutput {
GatewayARN?: GatewayARN;
}
export interface AddCacheInput {
GatewayARN: GatewayARN;
DiskIds: DiskIds;
}
export interface AddCacheOutput {
GatewayARN?: GatewayARN;
}
export interface AddTagsToResourceInput {
/** The Amazon Resource Name (ARN) of the resource you want to add tags to. **/
ResourceARN: ResourceARN;
/** The key-value pair that represents the tag you want to add to the resource. The
value can be an empty string.
Valid characters for key and value are letters, spaces, and numbers
representable in UTF-8 format, and the following special characters: + - = . _ :
/ @. **/
Tags: Tags;
}
export interface AddTagsToResourceOutput {
/** The Amazon Resource Name (ARN) of the resource you want to add tags to. **/
ResourceARN?: ResourceARN;
}
export interface AddUploadBufferInput {
GatewayARN: GatewayARN;
DiskIds: DiskIds;
}
export interface AddUploadBufferOutput {
GatewayARN?: GatewayARN;
}
export interface AddWorkingStorageInput {
GatewayARN: GatewayARN;
/** An array of strings that identify disks that are to be configured as working
storage. Each string have a minimum length of 1 and maximum length of 300. You
can get the disk IDs from the ListLocalDisks API. **/
DiskIds: DiskIds;
}
export interface AddWorkingStorageOutput {
GatewayARN?: GatewayARN;
}
export interface CachediSCSIVolume {
/** The Amazon Resource Name (ARN) of the storage volume. **/
VolumeARN?: VolumeARN;
/** The unique identifier of the volume, e.g. vol-AE4B946D. **/
VolumeId?: VolumeId;
/** One of the VolumeType enumeration values that describes the type of the volume. **/
VolumeType?: VolumeType;
/** One of the VolumeStatus values that indicates the state of the storage volume. **/
VolumeStatus?: VolumeStatus;
/** The size of the volume in bytes. **/
VolumeSizeInBytes?: long;
/** Represents the percentage complete if the volume is restoring or bootstrapping
that represents the percent of data transferred. This field does not appear in
the response if the cached volume is not restoring or bootstrapping. **/
VolumeProgress?: DoubleObject;
/** If the cached volume was created from a snapshot, this field contains the
snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not included. **/
SourceSnapshotId?: SnapshotId;
/** An VolumeiSCSIAttributes object that represents a collection of iSCSI attributes
for one stored volume. **/
VolumeiSCSIAttributes?: VolumeiSCSIAttributes;
CreatedDate?: CreatedDate;
}
export interface CancelArchivalInput {
GatewayARN: GatewayARN;
/** The Amazon Resource Name (ARN) of the virtual tape you want to cancel archiving
for. **/
TapeARN: TapeARN;
}
export interface CancelArchivalOutput {
/** The Amazon Resource Name (ARN) of the virtual tape for which archiving was
canceled. **/
TapeARN?: TapeARN;
}
export interface CancelRetrievalInput {
GatewayARN: GatewayARN;
/** The Amazon Resource Name (ARN) of the virtual tape you want to cancel retrieval
for. **/
TapeARN: TapeARN;
}
export interface CancelRetrievalOutput {
/** The Amazon Resource Name (ARN) of the virtual tape for which retrieval was
canceled. **/
TapeARN?: TapeARN;
}
export interface ChapInfo {
/** The Amazon Resource Name (ARN) of the volume.
Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
(-). **/
TargetARN?: TargetARN;
/** The secret key that the initiator (for example, the Windows client) must provide
to participate in mutual CHAP with the target. **/
SecretToAuthenticateInitiator?: ChapSecret;
/** The iSCSI initiator that connects to the target. **/
InitiatorName?: IqnName;
/** The secret key that the target must provide to participate in mutual CHAP with
the initiator (e.g. Windows client). **/
SecretToAuthenticateTarget?: ChapSecret;
}
export interface CreateCachediSCSIVolumeInput {
GatewayARN: GatewayARN;
VolumeSizeInBytes: long;
SnapshotId?: SnapshotId;
TargetName: TargetName;
/** The ARN for an existing volume. Specifying this ARN makes the new volume into an
exact copy of the specified existing volume's latest recovery point. The
VolumeSizeInBytes value for this new volume must be equal to or larger than the
size of the existing volume, in bytes. **/
SourceVolumeARN?: VolumeARN;
NetworkInterfaceId: NetworkInterfaceId;
ClientToken: ClientToken;
}
export interface CreateCachediSCSIVolumeOutput {
VolumeARN?: VolumeARN;
TargetARN?: TargetARN;
}
export interface CreateNFSFileShareInput {
/** A unique string value that you supply that is used by file gateway to ensure
idempotent file share creation. **/
ClientToken: ClientToken;
/** File share default values. Optional. **/
NFSFileShareDefaults?: NFSFileShareDefaults;
/** The Amazon Resource Name (ARN) of the file gateway on which you want to create a
file share. **/
GatewayARN: GatewayARN;
/** True to use Amazon S3 server side encryption with your own AWS KMS key, or false
to use a key managed by Amazon S3. Optional. **/
KMSEncrypted?: Boolean;
/** The KMS key used for Amazon S3 server side encryption. This value can only be
set when KmsEncrypted is true. Optional. **/
KMSKey?: KMSKey;
/** The ARN of the AWS Identity and Access Management (IAM) role that a file gateway
assumes when it accesses the underlying storage. **/
Role: Role;
/** The ARN of the backend storage used for storing file data. **/
LocationARN: LocationARN;
/** The default storage class for objects put into an Amazon S3 bucket by file
gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not
populated, the default value S3_STANDARD is used. Optional. **/
DefaultStorageClass?: StorageClass;
}
export interface CreateNFSFileShareOutput {
/** The Amazon Resource Name (ARN) of the newly created file share. **/
FileShareARN?: FileShareARN;
}
export interface CreateSnapshotFromVolumeRecoveryPointInput {
VolumeARN: VolumeARN;
SnapshotDescription: SnapshotDescription;
}
export interface CreateSnapshotFromVolumeRecoveryPointOutput {
SnapshotId?: SnapshotId;
VolumeARN?: VolumeARN;
VolumeRecoveryPointTime?: string;
}
export interface CreateSnapshotInput {
/** The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
return a list of gateway volumes. **/
VolumeARN: VolumeARN;
/** Textual description of the snapshot that appears in the Amazon EC2 console,
Elastic Block Store snapshots panel in the Description field, and in the AWS
Storage Gateway snapshot Details pane, Description field **/
SnapshotDescription: SnapshotDescription;
}
export interface CreateSnapshotOutput {
/** The Amazon Resource Name (ARN) of the volume of which the snapshot was taken. **/
VolumeARN?: VolumeARN;
/** The snapshot ID that is used to refer to the snapshot in future operations such
as describing snapshots (Amazon Elastic Compute Cloud API DescribeSnapshots) or
creating a volume from a snapshot (CreateStorediSCSIVolume). **/
SnapshotId?: SnapshotId;
}
export interface CreateStorediSCSIVolumeInput {
GatewayARN: GatewayARN;
/** The unique identifier for the gateway local disk that is configured as a stored
volume. Use ListLocalDisks
[http://docs.aws.amazon.com/storagegateway/latest/userguide/API_ListLocalDisks.html]
to list disk IDs for a gateway. **/
DiskId: DiskId;
/** The snapshot ID (e.g. "snap-1122aabb") of the snapshot to restore as the new
stored volume. Specify this field if you want to create the iSCSI storage volume
from a snapshot otherwise do not include this field. To list snapshots for your
account use DescribeSnapshots
[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeSnapshots.html]
in the Amazon Elastic Compute Cloud API Reference. **/
SnapshotId?: SnapshotId;
/** Specify this field as true if you want to preserve the data on the local disk.
Otherwise, specifying this field as false creates an empty volume.
Valid Values: true, false **/
PreserveExistingData: boolean;
/** The name of the iSCSI target used by initiators to connect to the target and as
a suffix for the target ARN. For example, specifying TargetName as myvolume
results in the target ARN of
arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume.
The target name must be unique across all volumes of a gateway. **/
TargetName: TargetName;
/** The network interface of the gateway on which to expose the iSCSI target. Only
IPv4 addresses are accepted. Use DescribeGatewayInformation to get a list of the
network interfaces available on a gateway.
Valid Values: A valid IP address. **/
NetworkInterfaceId: NetworkInterfaceId;
}
export interface CreateStorediSCSIVolumeOutput {
/** The Amazon Resource Name (ARN) of the configured volume. **/
VolumeARN?: VolumeARN;
/** The size of the volume in bytes. **/
VolumeSizeInBytes?: long;
/** he Amazon Resource Name (ARN) of the volume target that includes the iSCSI name
that initiators can use to connect to the target. **/
TargetARN?: TargetARN;
}
export interface CreateTapeWithBarcodeInput {
/** The unique Amazon Resource Name (ARN) that represents the gateway to associate
the virtual tape with. Use the ListGateways operation to return a list of
gateways for your account and region. **/
GatewayARN: GatewayARN;
/** The size, in bytes, of the virtual tape that you want to create.
The size must be aligned by gigabyte (1024&#42;1024*1024 byte). **/
TapeSizeInBytes: TapeSize;
/** The barcode that you want to assign to the tape. **/
TapeBarcode: TapeBarcode;
}
export interface CreateTapeWithBarcodeOutput {
/** A unique Amazon Resource Name (ARN) that represents the virtual tape that was
created. **/
TapeARN?: TapeARN;
}
export interface CreateTapesInput {
/** The unique Amazon Resource Name (ARN) that represents the gateway to associate
the virtual tapes with. Use the ListGateways operation to return a list of
gateways for your account and region. **/
GatewayARN: GatewayARN;
/** The size, in bytes, of the virtual tapes that you want to create.
The size must be aligned by gigabyte (1024&#42;1024*1024 byte). **/
TapeSizeInBytes: TapeSize;
/** A unique identifier that you use to retry a request. If you retry a request, use
the same ClientToken you specified in the initial request.
Using the same ClientToken prevents creating the tape multiple times. **/
ClientToken: ClientToken;
/** The number of virtual tapes that you want to create. **/
NumTapesToCreate: NumTapesToCreate;
/** A prefix that you append to the barcode of the virtual tape you are creating.
This prefix makes the barcode unique.
The prefix must be 1 to 4 characters in length and must be one of the uppercase
letters from A to Z. **/
TapeBarcodePrefix: TapeBarcodePrefix;
}
export interface CreateTapesOutput {
/** A list of unique Amazon Resource Names (ARNs) that represents the virtual tapes
that were created. **/
TapeARNs?: TapeARNs;
}
export interface DeleteBandwidthRateLimitInput {
GatewayARN: GatewayARN;
/** One of the BandwidthType values that indicates the gateway bandwidth rate limit
to delete.
Valid Values: Upload, Download, All. **/
BandwidthType: BandwidthType;
}
export interface DeleteBandwidthRateLimitOutput {
GatewayARN?: GatewayARN;
}
export interface DeleteChapCredentialsInput {
/** The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
specified VolumeARN. **/
TargetARN: TargetARN;
/** The iSCSI initiator that connects to the target. **/
InitiatorName: IqnName;
}
export interface DeleteChapCredentialsOutput {
/** The Amazon Resource Name (ARN) of the target. **/
TargetARN?: TargetARN;
/** The iSCSI initiator that connects to the target. **/
InitiatorName?: IqnName;
}
export interface DeleteFileShareInput {
/** The Amazon Resource Name (ARN) of the file share to be deleted. **/
FileShareARN: FileShareARN;
}
export interface DeleteFileShareOutput {
/** The Amazon Resource Name (ARN) of the deleted file share. **/
FileShareARN?: FileShareARN;
}
export interface DeleteGatewayInput {
GatewayARN: GatewayARN;
}
export interface DeleteGatewayOutput {
GatewayARN?: GatewayARN;
}
export interface DeleteSnapshotScheduleInput {
VolumeARN: VolumeARN;
}
export interface DeleteSnapshotScheduleOutput {
VolumeARN?: VolumeARN;
}
export interface DeleteTapeArchiveInput {
/** The Amazon Resource Name (ARN) of the virtual tape to delete from the virtual
tape shelf (VTS). **/
TapeARN: TapeARN;
}
export interface DeleteTapeArchiveOutput {
/** The Amazon Resource Name (ARN) of the virtual tape that was deleted from the
virtual tape shelf (VTS). **/
TapeARN?: TapeARN;
}
export interface DeleteTapeInput {
/** The unique Amazon Resource Name (ARN) of the gateway that the virtual tape to
delete is associated with. Use the ListGateways operation to return a list of
gateways for your account and region. **/
GatewayARN: GatewayARN;
/** The Amazon Resource Name (ARN) of the virtual tape to delete. **/
TapeARN: TapeARN;
}
export interface DeleteTapeOutput {
/** The Amazon Resource Name (ARN) of the deleted virtual tape. **/
TapeARN?: TapeARN;
}
export interface DeleteVolumeInput {
/** The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
return a list of gateway volumes. **/
VolumeARN: VolumeARN;
}
export interface DeleteVolumeOutput {
/** The Amazon Resource Name (ARN) of the storage volume that was deleted. It is the
same ARN you provided in the request. **/
VolumeARN?: VolumeARN;
}
export interface DescribeBandwidthRateLimitInput {
GatewayARN: GatewayARN;
}
export interface DescribeBandwidthRateLimitOutput {
GatewayARN?: GatewayARN;
/** The average upload bandwidth rate limit in bits per second. This field does not
appear in the response if the upload rate limit is not set. **/
AverageUploadRateLimitInBitsPerSec?: BandwidthUploadRateLimit;
/** The average download bandwidth rate limit in bits per second. This field does
not appear in the response if the download rate limit is not set. **/
AverageDownloadRateLimitInBitsPerSec?: BandwidthDownloadRateLimit;
}
export interface DescribeCacheInput {
GatewayARN: GatewayARN;
}
export interface DescribeCacheOutput {
GatewayARN?: GatewayARN;
DiskIds?: DiskIds;
CacheAllocatedInBytes?: long;
CacheUsedPercentage?: double;
CacheDirtyPercentage?: double;
CacheHitPercentage?: double;
CacheMissPercentage?: double;
}
export interface DescribeCachediSCSIVolumesInput {
VolumeARNs: VolumeARNs;
}
export interface DescribeCachediSCSIVolumesOutput {
/** An array of objects where each object contains metadata about one cached volume. **/
CachediSCSIVolumes?: CachediSCSIVolumes;
}
export interface DescribeChapCredentialsInput {
/** The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for
specified VolumeARN. **/
TargetARN: TargetARN;
}
export interface DescribeChapCredentialsOutput {
/** An array of ChapInfo objects that represent CHAP credentials. Each object in the
array contains CHAP credential information for one target-initiator pair. If no
CHAP credentials are set, an empty array is returned. CHAP credential
information is provided in a JSON object with the following fields:
&#42; InitiatorName: The iSCSI initiator that connects to the target.
* SecretToAuthenticateInitiator: The secret key that the initiator (for
example, the Windows client) must provide to participate in mutual CHAP with
the target.
* SecretToAuthenticateTarget: The secret key that the target must provide to
participate in mutual CHAP with the initiator (e.g. Windows client).
* TargetARN: The Amazon Resource Name (ARN) of the storage volume. **/
ChapCredentials?: ChapCredentials;
}
export interface DescribeGatewayInformationInput {
GatewayARN: GatewayARN;
}
export interface DescribeGatewayInformationOutput {
GatewayARN?: GatewayARN;
/** The unique identifier assigned to your gateway during activation. This ID
becomes part of the gateway Amazon Resource Name (ARN), which you use as input
for other operations. **/
GatewayId?: GatewayId;
/** The name you configured for your gateway. **/
GatewayName?: string;
/** A value that indicates the time zone configured for the gateway. **/
GatewayTimezone?: GatewayTimezone;
/** A value that indicates the operating state of the gateway. **/
GatewayState?: GatewayState;
/** A NetworkInterface array that contains descriptions of the gateway network
interfaces. **/
GatewayNetworkInterfaces?: GatewayNetworkInterfaces;
/** The type of the gateway. **/
GatewayType?: GatewayType;
/** The date on which an update to the gateway is available. This date is in the
time zone of the gateway. If the gateway is not available for an update this
field is not returned in the response. **/
NextUpdateAvailabilityDate?: NextUpdateAvailabilityDate;
/** The date on which the last software update was applied to the gateway. If the
gateway has never been updated, this field does not return a value in the
response. **/
LastSoftwareUpdate?: LastSoftwareUpdate;
}
export interface DescribeMaintenanceStartTimeInput {
GatewayARN: GatewayARN;
}
export interface DescribeMaintenanceStartTimeOutput {
GatewayARN?: GatewayARN;
/** The hour component of the maintenance start time represented as hh, where hh is
the hour (0 to 23). The hour of the day is in the time zone of the gateway. **/
HourOfDay?: HourOfDay;
/** The minute component of the maintenance start time represented as mm, where mm
is the minute (0 to 59). The minute of the hour is in the time zone of the
gateway. **/
MinuteOfHour?: MinuteOfHour;
/** An ordinal number between 0 and 6 that represents the day of the week, where 0
represents Sunday and 6 represents Saturday. The day of week is in the time zone
of the gateway. **/
DayOfWeek?: DayOfWeek;
Timezone?: GatewayTimezone;
}
export interface DescribeNFSFileSharesInput {
/** An array containing the Amazon Resource Name (ARN) of each file share to be
described. **/
FileShareARNList: FileShareARNList;
}
export interface DescribeNFSFileSharesOutput {
/** An array containing a description for each requested file share. **/
NFSFileShareInfoList?: NFSFileShareInfoList;
}
export interface DescribeSnapshotScheduleInput {
/** The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
return a list of gateway volumes. **/
VolumeARN: VolumeARN;
}
export interface DescribeSnapshotScheduleOutput {
VolumeARN?: VolumeARN;
StartAt?: HourOfDay;
RecurrenceInHours?: RecurrenceInHours;
Description?: Description;
Timezone?: GatewayTimezone;
}
export interface DescribeStorediSCSIVolumesInput {
/** An array of strings where each string represents the Amazon Resource Name (ARN)
of a stored volume. All of the specified stored volumes must from the same
gateway. Use ListVolumes to get volume ARNs for a gateway. **/
VolumeARNs: VolumeARNs;
}
export interface DescribeStorediSCSIVolumesOutput {
StorediSCSIVolumes?: StorediSCSIVolumes;
}
export interface DescribeTapeArchivesInput {
/** Specifies one or more unique Amazon Resource Names (ARNs) that represent the
virtual tapes you want to describe. **/
TapeARNs?: TapeARNs;
/** An opaque string that indicates the position at which to begin describing
virtual tapes. **/
Marker?: Marker;
/** Specifies that the number of virtual tapes descried be limited to the specified
number. **/
Limit?: PositiveIntObject;
}
export interface DescribeTapeArchivesOutput {
/** An array of virtual tape objects in the virtual tape shelf (VTS). The
description includes of the Amazon Resource Name(ARN) of the virtual tapes. The
information returned includes the Amazon Resource Names (ARNs) of the tapes,
size of the tapes, status of the tapes, progress of the description and tape
barcode. **/
TapeArchives?: TapeArchives;
/** An opaque string that indicates the position at which the virtual tapes that
were fetched for description ended. Use this marker in your next request to
fetch the next set of virtual tapes in the virtual tape shelf (VTS). If there
are no more virtual tapes to describe, this field does not appear in the
response. **/
Marker?: Marker;
}
export interface DescribeTapeRecoveryPointsInput {
GatewayARN: GatewayARN;
/** An opaque string that indicates the position at which to begin describing the
virtual tape recovery points. **/
Marker?: Marker;
/** Specifies that the number of virtual tape recovery points that are described be
limited to the specified number. **/
Limit?: PositiveIntObject;
}
export interface DescribeTapeRecoveryPointsOutput {
GatewayARN?: GatewayARN;
/** An array of TapeRecoveryPointInfos that are available for the specified gateway. **/
TapeRecoveryPointInfos?: TapeRecoveryPointInfos;
/** An opaque string that indicates the position at which the virtual tape recovery
points that were listed for description ended.
Use this marker in your next request to list the next set of virtual tape
recovery points in the list. If there are no more recovery points to describe,
this field does not appear in the response. **/
Marker?: Marker;
}
export interface DescribeTapesInput {
GatewayARN: GatewayARN;
/** Specifies one or more unique Amazon Resource Names (ARNs) that represent the
virtual tapes you want to describe. If this parameter is not specified, AWS
Storage Gateway returns a description of all virtual tapes associated with the
specified gateway. **/
TapeARNs?: TapeARNs;
/** A marker value, obtained in a previous call to DescribeTapes. This marker
indicates which page of results to retrieve.
If not specified, the first page of results is retrieved. **/
Marker?: Marker;
/** Specifies that the number of virtual tapes described be limited to the specified
number.
Amazon Web Services may impose its own limit, if this field is not set. **/
Limit?: PositiveIntObject;
}
export interface DescribeTapesOutput {
/** An array of virtual tape descriptions. **/
Tapes?: Tapes;
/** An opaque string which can be used as part of a subsequent DescribeTapes call to
retrieve the next page of results.
If a response does not contain a marker, then there are no more results to be
retrieved. **/
Marker?: Marker;
}
export interface DescribeUploadBufferInput {
GatewayARN: GatewayARN;
}
export interface DescribeUploadBufferOutput {
GatewayARN?: GatewayARN;
DiskIds?: DiskIds;
UploadBufferUsedInBytes?: long;
UploadBufferAllocatedInBytes?: long;
}
export interface DescribeVTLDevicesInput {
GatewayARN: GatewayARN;
/** An array of strings, where each string represents the Amazon Resource Name (ARN)
of a VTL device.
All of the specified VTL devices must be from the same gateway. If no VTL
devices are specified, the result will contain all devices on the specified
gateway. **/
VTLDeviceARNs?: VTLDeviceARNs;
/** An opaque string that indicates the position at which to begin describing the
VTL devices. **/
Marker?: Marker;
/** Specifies that the number of VTL devices described be limited to the specified
number. **/
Limit?: PositiveIntObject;
}
export interface DescribeVTLDevicesOutput {
GatewayARN?: GatewayARN;
/** An array of VTL device objects composed of the Amazon Resource Name(ARN) of the
VTL devices. **/
VTLDevices?: VTLDevices;
/** An opaque string that indicates the position at which the VTL devices that were
fetched for description ended. Use the marker in your next request to fetch the
next set of VTL devices in the list. If there are no more VTL devices to
describe, this field does not appear in the response. **/
Marker?: Marker;
}
export interface DescribeWorkingStorageInput {
GatewayARN: GatewayARN;
}
export interface DescribeWorkingStorageOutput {
GatewayARN?: GatewayARN;
/** An array of the gateway's local disk IDs that are configured as working storage.
Each local disk ID is specified as a string (minimum length of 1 and maximum
length of 300). If no local disks are configured as working storage, then the
DiskIds array is empty. **/
DiskIds?: DiskIds;
/** The total working storage in bytes in use by the gateway. If no working storage
is configured for the gateway, this field returns 0. **/
WorkingStorageUsedInBytes?: long;
/** The total working storage in bytes allocated for the gateway. If no working
storage is configured for the gateway, this field returns 0. **/
WorkingStorageAllocatedInBytes?: long;
}
export interface DeviceiSCSIAttributes {
/** Specifies the unique Amazon Resource Name(ARN) that encodes the iSCSI qualified
name(iqn) of a tape drive or media changer target. **/
TargetARN?: TargetARN;
/** The network interface identifier of the VTL device. **/
NetworkInterfaceId?: NetworkInterfaceId;
/** The port used to communicate with iSCSI VTL device targets. **/
NetworkInterfacePort?: integer;
/** Indicates whether mutual CHAP is enabled for the iSCSI target. **/
ChapEnabled?: boolean;
}
export interface DisableGatewayInput {
GatewayARN: GatewayARN;
}
export interface DisableGatewayOutput {
/** The unique Amazon Resource Name of the disabled gateway. **/
GatewayARN?: GatewayARN;
}
export interface Disk {
DiskId?: DiskId;
DiskPath?: string;
DiskNode?: string;
DiskStatus?: string;
DiskSizeInBytes?: long;
DiskAllocationType?: DiskAllocationType;
DiskAllocationResource?: string;
}
export interface FileShareInfo {
FileShareARN?: FileShareARN;
FileShareId?: FileShareId;
FileShareStatus?: FileShareStatus;
GatewayARN?: GatewayARN;
}
export interface GatewayInfo {
/** The unique identifier assigned to your gateway during activation. This ID
becomes part of the gateway Amazon Resource Name (ARN), which you use as input
for other operations. **/
GatewayId?: GatewayId;
/** The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to
return a list of gateways for your account and region. **/
GatewayARN?: GatewayARN;
/** The type of the gateway. **/
GatewayType?: GatewayType;
/** The state of the gateway.
Valid Values: DISABLED or ACTIVE **/
GatewayOperationalState?: GatewayOperationalState;
/** The name of the gateway. **/
GatewayName?: string;
}
export interface InternalServerError {
/** A human-readable message describing the error that occurred. **/
message?: string;
/** A StorageGatewayError that provides more information about the cause of the
error. **/
error?: StorageGatewayError;
}
export interface InvalidGatewayRequestException {
/** A human-readable message describing the error that occurred. **/
message?: string;
/** A StorageGatewayError that provides more detail about the cause of the error. **/
error?: StorageGatewayError;
}
export interface ListFileSharesInput {
/** The Amazon resource Name (ARN) of the gateway whose file shares you want to
list. If this field is not present, all file shares under your account are
listed. **/
GatewayARN?: GatewayARN;
/** The maximum number of file shares to return in the response. The value must be
an integer with a value greater than zero. Optional. **/
Limit?: PositiveIntObject;
/** Opaque pagination token returned from a previous ListFileShares operation. If
present, Marker specifies where to continue the list from after a previous call
to ListFileShares. Optional. **/
Marker?: Marker;
}
export interface ListFileSharesOutput {
/** If the request includes Marker, the response returns that value in this field. **/
Marker?: Marker;
/** If a value is present, there are more file shares to return. In a subsequent
request, use NextMarker as the value for Marker to retrieve the next set of file
shares. **/
NextMarker?: Marker;
/** An array of information about the file gateway's file shares. **/
FileShareInfoList?: FileShareInfoList;
}
export interface ListGatewaysInput {
/** An opaque string that indicates the position at which to begin the returned list
of gateways. **/
Marker?: Marker;
/** Specifies that the list of gateways returned be limited to the specified number
of items. **/
Limit?: PositiveIntObject;
}
export interface ListGatewaysOutput {
Gateways?: Gateways;
Marker?: Marker;
}
export interface ListLocalDisksInput {
GatewayARN: GatewayARN;
}
export interface ListLocalDisksOutput {
GatewayARN?: GatewayARN;
Disks?: Disks;
}
export interface ListTagsForResourceInput {
/** The Amazon Resource Name (ARN) of the resource for which you want to list tags. **/
ResourceARN: ResourceARN;
/** An opaque string that indicates the position at which to begin returning the
list of tags. **/
Marker?: Marker;
/** Specifies that the list of tags returned be limited to the specified number of
items. **/
Limit?: PositiveIntObject;
}
export interface ListTagsForResourceOutput {
/** he Amazon Resource Name (ARN) of the resource for which you want to list tags. **/
ResourceARN?: ResourceARN;
/** An opaque string that indicates the position at which to stop returning the list
of tags. **/
Marker?: Marker;
/** An array that contains the tags for the specified resource. **/
Tags?: Tags;
}
export interface ListTapesInput {
TapeARNs?: TapeARNs;
/** A string that indicates the position at which to begin the returned list of
tapes. **/
Marker?: Marker;
/** An optional number limit for the tapes in the list returned by this call. **/
Limit?: PositiveIntObject;
}
export interface ListTapesOutput {
TapeInfos?: TapeInfos;
/** A string that indicates the position at which to begin returning the next list
of tapes. Use the marker in your next request to continue pagination of tapes.
If there are no more tapes to list, this element does not appear in the response
body. **/
Marker?: Marker;
}
export interface ListVolumeInitiatorsInput {
/** The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
return a list of gateway volumes for the gateway. **/
VolumeARN: VolumeARN;
}
export interface ListVolumeInitiatorsOutput {
/** The host names and port numbers of all iSCSI initiators that are connected to
the gateway. **/
Initiators?: Initiators;
}
export interface ListVolumeRecoveryPointsInput {
GatewayARN: GatewayARN;
}
export interface ListVolumeRecoveryPointsOutput {
GatewayARN?: GatewayARN;
VolumeRecoveryPointInfos?: VolumeRecoveryPointInfos;
}
export interface ListVolumesInput {
GatewayARN?: GatewayARN;
/** A string that indicates the position at which to begin the returned list of
volumes. Obtain the marker from the response of a previous List iSCSI Volumes
request. **/
Marker?: Marker;
/** Specifies that the list of volumes returned be limited to the specified number
of items. **/
Limit?: PositiveIntObject;
}
export interface ListVolumesOutput {
GatewayARN?: GatewayARN;
Marker?: Marker;
VolumeInfos?: VolumeInfos;
}
export interface NFSFileShareDefaults {
/** The Unix file mode in the form "nnnn". For example, "0666" represents the
default file mode inside the file share. The default value is 0666. **/
FileMode?: PermissionMode;
/** The Unix directory mode in the form "nnnn". For example, "0666" represents the
default access mode for all directories inside the file share. The default value
is 0777. **/
DirectoryMode?: PermissionMode;
/** The default group ID for the file share (unless the files have another group ID
specified). The default value is nfsnobody. **/
GroupId?: PermissionId;
/** The default owner ID for files in the file share (unless the files have another
owner ID specified). The default value is nfsnobody. **/
OwnerId?: PermissionId;
}
export interface NFSFileShareInfo {
NFSFileShareDefaults?: NFSFileShareDefaults;
FileShareARN?: FileShareARN;
FileShareId?: FileShareId;
FileShareStatus?: FileShareStatus;
GatewayARN?: GatewayARN;
/** True to use Amazon S3 server side encryption with your own KMS key, or false to
use a key managed by Amazon S3. Optional. **/
KMSEncrypted?: boolean;
KMSKey?: KMSKey;
Path?: Path;
Role?: Role;
LocationARN?: LocationARN;
/** The default storage class for objects put into an Amazon S3 bucket by file
gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not
populated, the default value S3_STANDARD is used. Optional. **/
DefaultStorageClass?: StorageClass;
}
export interface NetworkInterface {
/** The Internet Protocol version 4 (IPv4) address of the interface. **/
Ipv4Address?: string;
/** The Media Access Control (MAC) address of the interface.
This is currently unsupported and will not be returned in output. **/
MacAddress?: string;
/** The Internet Protocol version 6 (IPv6) address of the interface. Currently not
supported. **/
Ipv6Address?: string;
}
export interface RemoveTagsFromResourceInput {
/** The Amazon Resource Name (ARN) of the resource you want to remove the tags from. **/
ResourceARN: ResourceARN;
/** The keys of the tags you want to remove from the specified resource. A tag is
composed of a key/value pair. **/
TagKeys: TagKeys;
}
export interface RemoveTagsFromResourceOutput {
/** The Amazon Resource Name (ARN) of the resource that the tags were removed from. **/
ResourceARN?: ResourceARN;
}
export interface ResetCacheInput {
GatewayARN: GatewayARN;
}
export interface ResetCacheOutput {
GatewayARN?: GatewayARN;
}
export interface RetrieveTapeArchiveInput {
/** The Amazon Resource Name (ARN) of the virtual tape you want to retrieve from the
virtual tape shelf (VTS). **/
TapeARN: TapeARN;
/** The Amazon Resource Name (ARN) of the gateway you want to retrieve the virtual
tape to. Use the ListGateways operation to return a list of gateways for your
account and region.
You retrieve archived virtual tapes to only one gateway and the gateway must be
a gateway-VTL. **/
GatewayARN: GatewayARN;
}
export interface RetrieveTapeArchiveOutput {
/** The Amazon Resource Name (ARN) of the retrieved virtual tape. **/
TapeARN?: TapeARN;
}
export interface RetrieveTapeRecoveryPointInput {
/** The Amazon Resource Name (ARN) of the virtual tape for which you want to
retrieve the recovery point. **/
TapeARN: TapeARN;
GatewayARN: GatewayARN;
}
export interface RetrieveTapeRecoveryPointOutput {
/** The Amazon Resource Name (ARN) of the virtual tape for which the recovery point
was retrieved. **/
TapeARN?: TapeARN;
}
export interface ServiceUnavailableError {
/** A human-readable message describing the error that occurred. **/
message?: string;
/** A StorageGatewayError that provides more information about the cause of the
error. **/
error?: StorageGatewayError;
}
export interface SetLocalConsolePasswordInput {
GatewayARN: GatewayARN;
/** The password you want to set for your VM local console. **/
LocalConsolePassword: LocalConsolePassword;
}
export interface SetLocalConsolePasswordOutput {
GatewayARN?: GatewayARN;
}
export interface ShutdownGatewayInput {
GatewayARN: GatewayARN;
}
export interface ShutdownGatewayOutput {
GatewayARN?: GatewayARN;
}
export interface StartGatewayInput {
GatewayARN: GatewayARN;
}
export interface StartGatewayOutput {
GatewayARN?: GatewayARN;
}
export interface StorageGatewayError {
/** Additional information about the error. **/
errorCode?: ErrorCode;
/** Human-readable text that provides detail about the error that occurred. **/
errorDetails?: errorDetails;
}
export interface StorediSCSIVolume {
/** The Amazon Resource Name (ARN) of the storage volume. **/
VolumeARN?: VolumeARN;
/** The unique identifier of the volume, e.g. vol-AE4B946D. **/
VolumeId?: VolumeId;
/** One of the VolumeType enumeration values describing the type of the volume. **/
VolumeType?: VolumeType;
/** One of the VolumeStatus values that indicates the state of the storage volume. **/
VolumeStatus?: VolumeStatus;
/** The size of the volume in bytes. **/
VolumeSizeInBytes?: long;
/** Represents the percentage complete if the volume is restoring or bootstrapping
that represents the percent of data transferred. This field does not appear in
the response if the stored volume is not restoring or bootstrapping. **/
VolumeProgress?: DoubleObject;
/** The ID of the local disk that was specified in the CreateStorediSCSIVolume
operation. **/
VolumeDiskId?: DiskId;
/** If the stored volume was created from a snapshot, this field contains the
snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not included. **/
SourceSnapshotId?: SnapshotId;
/** Indicates if when the stored volume was created, existing data on the underlying
local disk was preserved.
Valid Values: true, false **/
PreservedExistingData?: boolean;
/** An VolumeiSCSIAttributes object that represents a collection of iSCSI attributes
for one stored volume. **/
VolumeiSCSIAttributes?: VolumeiSCSIAttributes;
CreatedDate?: CreatedDate;
}
export interface Tag {
Key: TagKey;
Value: TagValue;
}
export interface Tape {
/** The Amazon Resource Name (ARN) of the virtual tape. **/
TapeARN?: TapeARN;
/** The barcode that identifies a specific virtual tape. **/
TapeBarcode?: TapeBarcode;
TapeCreatedDate?: Time;
/** The size, in bytes, of the virtual tape. **/
TapeSizeInBytes?: TapeSize;
/** The current state of the virtual tape. **/
TapeStatus?: TapeStatus;
/** The virtual tape library (VTL) device that the virtual tape is associated with. **/
VTLDevice?: VTLDeviceARN;
/** For archiving virtual tapes, indicates how much data remains to be uploaded
before archiving is complete.
Range: 0 (not started) to 100 (complete). **/
Progress?: DoubleObject;
}
export interface TapeArchive {
/** The Amazon Resource Name (ARN) of an archived virtual tape. **/
TapeARN?: TapeARN;
/** The barcode that identifies the archived virtual tape. **/
TapeBarcode?: TapeBarcode;
TapeCreatedDate?: Time;
/** The size, in bytes, of the archived virtual tape. **/
TapeSizeInBytes?: TapeSize;
/** The time that the archiving of the virtual tape was completed.
The string format of the completion time is in the ISO8601 extended
YYYY-MM-DD'T'HH:MM:SS'Z' format. **/
CompletionTime?: Time;
/** The Amazon Resource Name (ARN) of the gateway-VTL that the virtual tape is being
retrieved to.
The virtual tape is retrieved from the virtual tape shelf (VTS). **/
RetrievedTo?: GatewayARN;
/** The current state of the archived virtual tape. **/
TapeStatus?: TapeArchiveStatus;
}
export interface TapeInfo {
/** The Amazon Resource Name (ARN) of a virtual tape. **/
TapeARN?: TapeARN;
/** The barcode that identifies a specific virtual tape. **/
TapeBarcode?: TapeBarcode;
/** The size, in bytes, of a virtual tape. **/
TapeSizeInBytes?: TapeSize;
/** The status of the tape. **/
TapeStatus?: TapeStatus;
/** The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to
return a list of gateways for your account and region. **/
GatewayARN?: GatewayARN;
}
export interface TapeRecoveryPointInfo {
/** The Amazon Resource Name (ARN) of the virtual tape. **/
TapeARN?: TapeARN;
/** The time when the point-in-time view of the virtual tape was replicated for
later recovery.
The string format of the tape recovery point time is in the ISO8601 extended
YYYY-MM-DD'T'HH:MM:SS'Z' format. **/
TapeRecoveryPointTime?: Time;
/** The size, in bytes, of the virtual tapes to recover. **/
TapeSizeInBytes?: TapeSize;
TapeStatus?: TapeRecoveryPointStatus;
}
export interface UpdateBandwidthRateLimitInput {
GatewayARN: GatewayARN;
/** The average upload bandwidth rate limit in bits per second. **/
AverageUploadRateLimitInBitsPerSec?: BandwidthUploadRateLimit;
/** The average download bandwidth rate limit in bits per second. **/
AverageDownloadRateLimitInBitsPerSec?: BandwidthDownloadRateLimit;
}
export interface UpdateBandwidthRateLimitOutput {
GatewayARN?: GatewayARN;
}
export interface UpdateChapCredentialsInput {
/** The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
DescribeStorediSCSIVolumes operation to return the TargetARN for specified
VolumeARN. **/
TargetARN: TargetARN;
/** The secret key that the initiator (for example, the Windows client) must provide
to participate in mutual CHAP with the target.
The secret key must be between 12 and 16 bytes when encoded in UTF-8. **/
SecretToAuthenticateInitiator: ChapSecret;
/** The iSCSI initiator that connects to the target. **/
InitiatorName: IqnName;
/** The secret key that the target must provide to participate in mutual CHAP with
the initiator (e.g. Windows client).
Byte constraints: Minimum bytes of 12. Maximum bytes of 16.
The secret key must be between 12 and 16 bytes when encoded in UTF-8. **/
SecretToAuthenticateTarget?: ChapSecret;
}
export interface UpdateChapCredentialsOutput {
/** The Amazon Resource Name (ARN) of the target. This is the same target specified
in the request. **/
TargetARN?: TargetARN;
/** The iSCSI initiator that connects to the target. This is the same initiator name
specified in the request. **/
InitiatorName?: IqnName;
}
export interface UpdateGatewayInformationInput {
GatewayARN: GatewayARN;
GatewayName?: GatewayName;
GatewayTimezone?: GatewayTimezone;
}
export interface UpdateGatewayInformationOutput {
GatewayARN?: GatewayARN;
GatewayName?: string;
}
export interface UpdateGatewaySoftwareNowInput {
GatewayARN: GatewayARN;
}
export interface UpdateGatewaySoftwareNowOutput {
GatewayARN?: GatewayARN;
}
export interface UpdateMaintenanceStartTimeInput {
GatewayARN: GatewayARN;
/** The hour component of the maintenance start time represented as hh, where hh is
the hour (00 to 23). The hour of the day is in the time zone of the gateway. **/
HourOfDay: HourOfDay;
/** The minute component of the maintenance start time represented as mm, where mm
is the minute (00 to 59). The minute of the hour is in the time zone of the
gateway. **/
MinuteOfHour: MinuteOfHour;
/** The maintenance start time day of the week represented as an ordinal number from
0 to 6, where 0 represents Sunday and 6 Saturday. **/
DayOfWeek: DayOfWeek;
}
export interface UpdateMaintenanceStartTimeOutput {
GatewayARN?: GatewayARN;
}
export interface UpdateNFSFileShareInput {
/** The Amazon Resource Name (ARN) of the file share to be updated. **/
FileShareARN: FileShareARN;
/** True to use Amazon S3 server side encryption with your own AWS KMS key, or false
to use a key managed by Amazon S3. Optional. **/
KMSEncrypted?: Boolean;
/** The KMS key used for Amazon S3 server side encryption. This value can only be
set when KmsEncrypted is true. Optional. **/
KMSKey?: KMSKey;
/** The default values for the file share. Optional. **/
NFSFileShareDefaults?: NFSFileShareDefaults;
/** The default storage class for objects put into an Amazon S3 bucket by a file
gateway. Possible values are S3_STANDARD or S3_STANDARD_IA. If this field is not
populated, the default value S3_STANDARD is used. Optional. **/
DefaultStorageClass?: StorageClass;
}
export interface UpdateNFSFileShareOutput {
/** The Amazon Resource Name (ARN) of the updated file share. **/
FileShareARN?: FileShareARN;
}
export interface UpdateSnapshotScheduleInput {
/** The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to
return a list of gateway volumes. **/
VolumeARN: VolumeARN;
/** The hour of the day at which the snapshot schedule begins represented as hh,
where hh is the hour (0 to 23). The hour of the day is in the time zone of the
gateway. **/
StartAt: HourOfDay;
/** Frequency of snapshots. Specify the number of hours between snapshots. **/
RecurrenceInHours: RecurrenceInHours;
/** Optional description of the snapshot that overwrites the existing description. **/
Description?: Description;
}
export interface UpdateSnapshotScheduleOutput {
/** **/
VolumeARN?: VolumeARN;
}
export interface UpdateVTLDeviceTypeInput {
/** The Amazon Resource Name (ARN) of the medium changer you want to select. **/
VTLDeviceARN: VTLDeviceARN;
/** The type of medium changer you want to select.
Valid Values: "STK-L700", "AWS-Gateway-VTL" **/
DeviceType: DeviceType;
}
export interface UpdateVTLDeviceTypeOutput {
/** The Amazon Resource Name (ARN) of the medium changer you have selected. **/
VTLDeviceARN?: VTLDeviceARN;
}
export interface VTLDevice {
/** Specifies the unique Amazon Resource Name (ARN) of the device (tape drive or
media changer). **/
VTLDeviceARN?: VTLDeviceARN;
VTLDeviceType?: VTLDeviceType;
VTLDeviceVendor?: VTLDeviceVendor;
VTLDeviceProductIdentifier?: VTLDeviceProductIdentifier;
/** A list of iSCSI information about a VTL device. **/
DeviceiSCSIAttributes?: DeviceiSCSIAttributes;
}
export interface VolumeInfo {
/** The Amazon Resource Name (ARN) for the storage volume. For example, the
following is a valid ARN:
arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB
Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
(-). **/
VolumeARN?: VolumeARN;
/** The unique identifier assigned to the volume. This ID becomes part of the volume
Amazon Resource Name (ARN), which you use as input for other operations.
Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
(-). **/
VolumeId?: VolumeId;
GatewayARN?: GatewayARN;
/** The unique identifier assigned to your gateway during activation. This ID
becomes part of the gateway Amazon Resource Name (ARN), which you use as input
for other operations.
Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
(-). **/
GatewayId?: GatewayId;
VolumeType?: VolumeType;
/** The size of the volume in bytes.
Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
(-). **/
VolumeSizeInBytes?: long;
}
export interface VolumeRecoveryPointInfo {
VolumeARN?: VolumeARN;
VolumeSizeInBytes?: long;
VolumeUsageInBytes?: long;
VolumeRecoveryPointTime?: string;
}
export interface VolumeiSCSIAttributes {
/** The Amazon Resource Name (ARN) of the volume target. **/
TargetARN?: TargetARN;
/** The network interface identifier. **/
NetworkInterfaceId?: NetworkInterfaceId;
/** The port used to communicate with iSCSI targets. **/
NetworkInterfacePort?: integer;
/** The logical disk number. **/
LunNumber?: PositiveIntObject;
/** Indicates whether mutual CHAP is enabled for the iSCSI target. **/
ChapEnabled?: boolean;
}
}
}
|
{
"content_hash": "ab321cce71df7fb054b2a4a98aed0825",
"timestamp": "",
"source": "github",
"line_count": 2316,
"max_line_length": 527,
"avg_line_length": 50.85146804835924,
"alnum_prop": 0.7427741738273953,
"repo_name": "ingenieux/aws-sdk-typescript",
"id": "e8411c737a04d735444dfd4d76684b2c44ec0f65",
"size": "117776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "output/typings/aws-storagegateway.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "16924"
},
{
"name": "JavaScript",
"bytes": "2219"
},
{
"name": "TypeScript",
"bytes": "19378"
}
],
"symlink_target": ""
}
|
#ifndef PB_MESSAGE_MESSAGE_H
#define PB_MESSAGE_MESSAGE_H
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <protobluff/message/message.h>
#include "message/common.h"
#include "message/journal.h"
#include "message/part.h"
/* ----------------------------------------------------------------------------
* Inline functions
* ------------------------------------------------------------------------- */
/*!
* Create an invalid message.
*
* \return Message
*/
PB_INLINE PB_WARN_UNUSED_RESULT
pb_message_t
pb_message_create_invalid(void) {
pb_message_t message = {
.descriptor = NULL,
.part = pb_part_create_invalid()
};
return message;
}
/*!
* Create a shallow copy of a message.
*
* \param[in] message Message
* \return Message copy
*/
PB_INLINE PB_WARN_UNUSED_RESULT
pb_message_t
pb_message_copy(const pb_message_t *message) {
assert(message);
return *message;
}
/*!
* Retrieve the underlying journal of a message.
*
* \param[in] message Message
* \return Journal
*/
PB_INLINE pb_journal_t *
pb_message_journal(pb_message_t *message) {
assert(message);
return pb_part_journal(&(message->part));
}
/*!
* Retrieve the version of a message.
*
* \param[in] message Message
* \return Version
*/
PB_INLINE pb_version_t
pb_message_version(const pb_message_t *message) {
assert(message);
return pb_part_version(&(message->part));
}
/*!
* Test whether a message is properly aligned.
*
* \param[in] message Message
* \return Test result
*/
PB_INLINE int
pb_message_aligned(const pb_message_t *message) {
assert(message);
return pb_part_aligned(&(message->part));
}
/*!
* Ensure that a message is properly aligned.
*
* \param[in,out] message Message
* \return Error code
*/
PB_INLINE PB_WARN_UNUSED_RESULT
pb_error_t
pb_message_align(pb_message_t *message) {
assert(message);
return !pb_part_aligned(&(message->part))
? pb_part_align(&(message->part))
: PB_ERROR_NONE;
}
/*!
* Retrieve the start offset of a message within its underlying journal.
*
* \param[in] message Message
* \return Start offset
*/
PB_INLINE size_t
pb_message_start(const pb_message_t *message) {
assert(message);
return pb_part_start(&(message->part));
}
/*!
* Retrieve the end offset of a message within its underlying journal.
*
* \param[in] message Message
* \return End offset
*/
PB_INLINE size_t
pb_message_end(const pb_message_t *message) {
assert(message);
return pb_part_end(&(message->part));
}
/*!
* Retrieve the size of a message.
*
* \param[in] message Message
* \return Message size
*/
PB_INLINE size_t
pb_message_size(const pb_message_t *message) {
assert(message);
return pb_part_size(&(message->part));
}
/*!
* Test whether a message is empty.
*
* \param[in] message Message
* \return Test result
*/
PB_INLINE int
pb_message_empty(const pb_message_t *message) {
assert(message);
return pb_part_empty(&(message->part));
}
/* ------------------------------------------------------------------------- */
/*!
* Test whether two messages are the same.
*
* \warning Message alignment is checked implicitly by comparing the messages'
* memory segments and thus their versions.
*
* \param[in] x Message
* \param[in] y Message
* \return Test result
*/
PB_INLINE int
pb_message_equals(const pb_message_t *x, const pb_message_t *y) {
assert(x && y);
return !memcmp(x, y, sizeof(pb_message_t));
}
#endif /* PB_MESSAGE_MESSAGE_H */
|
{
"content_hash": "2176f5b94bcdb3bbdb7fc17676ec9d38",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 79,
"avg_line_length": 21.63030303030303,
"alnum_prop": 0.613897450266181,
"repo_name": "squidfunk/protobluff",
"id": "849879bb9a66ff2e07c8fee27de971e78ba5a4e9",
"size": "4722",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/message/message.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "889934"
},
{
"name": "C++",
"bytes": "239326"
},
{
"name": "CSS",
"bytes": "6626"
},
{
"name": "GDB",
"bytes": "1308"
},
{
"name": "M4",
"bytes": "7379"
},
{
"name": "Makefile",
"bytes": "49688"
},
{
"name": "Shell",
"bytes": "4784"
}
],
"symlink_target": ""
}
|
package org.apache.sling.testing.mock.osgi;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import java.util.Dictionary;
import java.util.Hashtable;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
@RunWith(MockitoJUnitRunner.class)
public class MockBundleContextTest {
private BundleContext bundleContext;
@Before
public void setUp() {
bundleContext = MockOsgi.newBundleContext();
}
@Test
public void testBundle() {
assertNotNull(bundleContext.getBundle());
}
@Test
public void testServiceRegistration() throws InvalidSyntaxException {
// prepare test services
String clazz1 = String.class.getName();
Object service1 = new Object();
Dictionary<String, Object> properties1 = getServiceProperties(null);
ServiceRegistration reg1 = bundleContext.registerService(clazz1, service1, properties1);
String[] clazzes2 = new String[] { String.class.getName(), Integer.class.getName() };
Object service2 = new Object();
Dictionary<String, Object> properties2 = getServiceProperties(null);
ServiceRegistration reg2 = bundleContext.registerService(clazzes2, service2, properties2);
String clazz3 = Integer.class.getName();
Object service3 = new Object();
Dictionary<String, Object> properties3 = getServiceProperties(100L);
ServiceRegistration reg3 = bundleContext.registerService(clazz3, service3, properties3);
// test get service references
ServiceReference<?> refString = bundleContext.getServiceReference(String.class.getName());
assertSame(reg1.getReference(), refString);
ServiceReference<?> refInteger = bundleContext.getServiceReference(Integer.class.getName());
assertSame(reg3.getReference(), refInteger);
ServiceReference<?>[] refsString = bundleContext.getServiceReferences(String.class.getName(), null);
assertEquals(2, refsString.length);
assertSame(reg1.getReference(), refsString[0]);
assertSame(reg2.getReference(), refsString[1]);
ServiceReference<?>[] refsInteger = bundleContext.getServiceReferences(Integer.class.getName(), null);
assertEquals(2, refsInteger.length);
assertSame(reg3.getReference(), refsInteger[0]);
assertSame(reg2.getReference(), refsInteger[1]);
ServiceReference<?>[] allRefsString = bundleContext.getAllServiceReferences(String.class.getName(), null);
assertArrayEquals(refsString, allRefsString);
// test get services
assertSame(service1, bundleContext.getService(refsString[0]));
assertSame(service2, bundleContext.getService(refsString[1]));
assertSame(service3, bundleContext.getService(refInteger));
// unget does nothing
bundleContext.ungetService(refsString[0]);
bundleContext.ungetService(refsString[1]);
bundleContext.ungetService(refInteger);
}
@Test
public void testServiceUnregistration() {
// prepare test services
String clazz1 = String.class.getName();
Object service1 = new Object();
Dictionary<String, Object> properties1 = getServiceProperties(null);
ServiceRegistration reg1 = bundleContext.registerService(clazz1, service1, properties1);
assertNotNull(bundleContext.getServiceReference(clazz1));
reg1.unregister();
assertNull(bundleContext.getServiceReference(clazz1));
}
private Dictionary<String, Object> getServiceProperties(final Long serviceRanking) {
Dictionary<String, Object> props = new Hashtable<String, Object>();
if (serviceRanking != null) {
props.put(Constants.SERVICE_RANKING, serviceRanking);
}
return props;
}
@Test
public void testGetBundles() throws Exception {
assertEquals(0, bundleContext.getBundles().length);
}
@Test
public void testServiceListener() throws Exception {
ServiceListener serviceListener = mock(ServiceListener.class);
bundleContext.addServiceListener(serviceListener);
// prepare test services
String clazz1 = String.class.getName();
Object service1 = new Object();
bundleContext.registerService(clazz1, service1, null);
verify(serviceListener).serviceChanged(any(ServiceEvent.class));
bundleContext.removeServiceListener(serviceListener);
}
@Test
public void testBundleListener() throws Exception {
BundleListener bundleListener = mock(BundleListener.class);
BundleEvent bundleEvent = mock(BundleEvent.class);
bundleContext.addBundleListener(bundleListener);
MockOsgi.sendBundleEvent(bundleContext, bundleEvent);
verify(bundleListener).bundleChanged(bundleEvent);
bundleContext.removeBundleListener(bundleListener);
}
@Test
public void testFrameworkListener() throws Exception {
// ensure that listeners can be called (although they are not expected
// to to anything)
bundleContext.addFrameworkListener(null);
bundleContext.removeFrameworkListener(null);
}
@Test
public void testGetProperty() {
assertNull(bundleContext.getProperty("anyProperty"));
}
@Test
public void testObjectClassFilterMatches() throws InvalidSyntaxException {
Filter filter = bundleContext.createFilter("(" + Constants.OBJECTCLASS + "=" + Integer.class.getName() + ")");
ServiceRegistration serviceRegistration = bundleContext.registerService(Integer.class.getName(), Integer.valueOf(1), null);
assertTrue(filter.match(serviceRegistration.getReference()));
}
@Test
public void testObjectClassFilterDoesNotMatch() throws InvalidSyntaxException {
Filter filter = bundleContext.createFilter("(" + Constants.OBJECTCLASS + "=" + Integer.class.getName() + ")");
ServiceRegistration serviceRegistration = bundleContext.registerService(Long.class.getName(), Long.valueOf(1), null);
assertFalse(filter.match(serviceRegistration.getReference()));
}
}
|
{
"content_hash": "c8e79f106426c36673ca80b91fb3bf04",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 131,
"avg_line_length": 37.97849462365591,
"alnum_prop": 0.7141845979614949,
"repo_name": "SylvesterAbreu/sling",
"id": "fb704f1736702811b6dc3c4edd6b8477beff1476",
"size": "7871",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "testing/mocks/osgi-mock/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "7690"
},
{
"name": "Batchfile",
"bytes": "194"
},
{
"name": "CSS",
"bytes": "80802"
},
{
"name": "FreeMarker",
"bytes": "170"
},
{
"name": "Groff",
"bytes": "375"
},
{
"name": "Groovy",
"bytes": "12843"
},
{
"name": "HTML",
"bytes": "113853"
},
{
"name": "Java",
"bytes": "23164028"
},
{
"name": "JavaScript",
"bytes": "335394"
},
{
"name": "Makefile",
"bytes": "1519"
},
{
"name": "Python",
"bytes": "2586"
},
{
"name": "Ruby",
"bytes": "4896"
},
{
"name": "Scala",
"bytes": "127988"
},
{
"name": "Shell",
"bytes": "32456"
},
{
"name": "XProc",
"bytes": "2290"
},
{
"name": "XSLT",
"bytes": "8575"
}
],
"symlink_target": ""
}
|
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
Ecteinomyces zuphiicola Speg., 1915
### Remarks
null
|
{
"content_hash": "29fec14a524afcbc983d61cac7077732",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12.615384615384615,
"alnum_prop": 0.7195121951219512,
"repo_name": "mdoering/backbone",
"id": "f1d6984c0dd24e4389d1cc6d788928e3cfba4140",
"size": "223",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Laboulbeniomycetes/Laboulbeniales/Euceratomycetaceae/Pseudoecteinomyces/Pseudoecteinomyces zuphiicola/ Syn. Ecteinomyces zuphiicola/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
using GestorONG.DataModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace GestorONG.ViewModel
{
/// <summary>
/// Clase para almacenar los datos de las donaciones y los colaboradores a la hora de crear,editar o ver los detalles de una donación.
/// </summary>
public class DonacionesViewModel
{
#region PUBLIC_MEMBER_METHODS
/// <summary>
/// Constructor por defecto.
/// </summary>
public DonacionesViewModel()
{
}
/// <summary>
/// Constructor con parámetros.
/// </summary>
/// <param name="donacion">Objeto de la clase donaciones para guardar los datos de la donación.</param>
/// <param name="cuentaBancaria">String para almacenar el número de cuenta bancaria de la donación.</param>
/// <param name="NIF">String para almacenar el NIF/CIF del colaborador.</param>
public DonacionesViewModel(donaciones donacion, string cuentaBancaria, string NIF)
{
this.donacion = donacion;
this.cuentaBancaria = cuentaBancaria;
this.NIF = NIF;
}
#endregion
#region PUBLIC_MEMBER_VARIABLES
/// <summary>
/// Objeto de la clase donaciones para guardar los datos de la donación.
/// </summary>
public donaciones donacion { get; set; }
/// <summary>
/// String para almacenar el número de cuenta bancaria de la donación.
/// </summary>
[DisplayName("Cuenta Bancaria")]
[Required]
[StringLength(24)]
public string cuentaBancaria { get; set; }
/// <summary>
/// String para almacenar el NIF/CIF del colaborador.
/// </summary>
[DisplayName("NIF / CIF")]
[Required]
[StringLength(9)]
public string NIF { get; set; }
#endregion
}
}
|
{
"content_hash": "d27dc1f8beecff48bd251e8338196803",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 138,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.6078921078921079,
"repo_name": "joakDA/gestor-ongd-sps",
"id": "d11ccda4db16c577b1090a259d630eb7bdb92def",
"size": "2012",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GestorONG/ViewModel/DonacionesViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "100"
},
{
"name": "C#",
"bytes": "455243"
},
{
"name": "CSS",
"bytes": "265282"
},
{
"name": "HTML",
"bytes": "7961"
},
{
"name": "JavaScript",
"bytes": "2421121"
}
],
"symlink_target": ""
}
|
/**
*/
package COSEM.InterfaceClasses.impl;
import COSEM.InterfaceClasses.IPv6setup;
import COSEM.InterfaceClasses.InterfaceClassesPackage;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>IPv6setup</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class IPv6setupImpl extends BaseImpl implements IPv6setup {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IPv6setupImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return InterfaceClassesPackage.Literals.IPV6SETUP;
}
} //IPv6setupImpl
|
{
"content_hash": "3234a017721e57aac21b54b12c8bf89a",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 19.405405405405407,
"alnum_prop": 0.6504178272980501,
"repo_name": "georghinkel/ttc2017smartGrids",
"id": "07dce828fa615c586fec90e0998457312374ca6a",
"size": "718",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "solutions/ModelJoin/src/main/java/COSEM/InterfaceClasses/impl/IPv6setupImpl.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "79261108"
},
{
"name": "Java",
"bytes": "38407170"
},
{
"name": "Python",
"bytes": "6055"
},
{
"name": "R",
"bytes": "15405"
},
{
"name": "Rebol",
"bytes": "287"
}
],
"symlink_target": ""
}
|
package org.mifos.androidclient.entities.collectionsheet;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
public class SaveCollectionSheet implements Serializable {
private List<SaveCollectionSheetCustomer> saveCollectionSheetCustomers;
private Short paymentType;
private Date transactionDate;
private String receiptId;
private Date receiptDate;
private Integer userId;
public List<SaveCollectionSheetCustomer> getSaveCollectionSheetCustomers() {
return saveCollectionSheetCustomers;
}
public void setSaveCollectionSheetCustomers(List<SaveCollectionSheetCustomer> saveCollectionSheetCustomers) {
this.saveCollectionSheetCustomers = saveCollectionSheetCustomers;
}
public Short getPaymentType() {
return paymentType;
}
public void setPaymentType(Short paymentType) {
this.paymentType = paymentType;
}
public Date getTransactionDate() {
return transactionDate;
}
public void setTransactionDate(Date transactionDate) {
this.transactionDate = transactionDate;
}
public String getReceiptId() {
return receiptId;
}
public void setReceiptId(String receiptId) {
this.receiptId = receiptId;
}
public Date getReceiptDate() {
return receiptDate;
}
public void setReceiptDate(Date receiptDate) {
this.receiptDate = receiptDate;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
}
|
{
"content_hash": "9496abb790806f495e27cf4c8e6418d6",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 113,
"avg_line_length": 25.636363636363637,
"alnum_prop": 0.7192671394799054,
"repo_name": "mifos/android-client",
"id": "3b6a6f12dbbcc9e89336c43eb3a5a0a613a75b00",
"size": "1692",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "mifos-android-client/src/org/mifos/androidclient/entities/collectionsheet/SaveCollectionSheet.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "570205"
}
],
"symlink_target": ""
}
|
//
// SpectralBRDFExplorerConfiguration.h
// SpectralBRDFExplorer
//
// Created by Fabrizio Duroni on 03/01/2017.
//
//
#ifndef SpectralBRDFExplorerConfiguration_h
#define SpectralBRDFExplorerConfiguration_h
namespace SBEConfiguration {
/// Number of spectrum samples.
const int numberOfSamples = 31;
}
#endif /* SpectralBRDFExplorerConfiguration_h */
|
{
"content_hash": "6f02d5372428cf639e767546f6cc9483",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 48,
"avg_line_length": 20.72222222222222,
"alnum_prop": 0.7479892761394102,
"repo_name": "chicio/Spectral-BRDF-Explorer",
"id": "e2224b289d5855fc6d529e6a30157c72ddca8a7a",
"size": "373",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SpectralBRDFExplorer/SBEConfiguration.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9883"
},
{
"name": "C++",
"bytes": "2047808"
},
{
"name": "CMake",
"bytes": "2703"
},
{
"name": "GLSL",
"bytes": "81528"
},
{
"name": "Java",
"bytes": "8211"
},
{
"name": "Objective-C",
"bytes": "40915"
},
{
"name": "Objective-C++",
"bytes": "8446"
}
],
"symlink_target": ""
}
|
package suadb.index.btree;
import static java.sql.Types.INTEGER;
import suadb.file.Chunk;
import suadb.parse.Constant;
import suadb.parse.IntConstant;
import suadb.parse.StringConstant;
import suadb.tx.Transaction;
import suadb.record.*;
import suadb.index.Index;
/**
* A B-tree implementation of the Index interface.
* @author Edward Sciore
*/
public class BTreeIndex implements Index {
private Transaction tx;
private TableInfo dirTi, leafTi;
private BTreeLeaf leaf = null;
private Chunk rootblk;
/**
* Opens a B-tree suadb.index for the specified suadb.index.
* The method determines the appropriate files
* for the leaf and directory records,
* creating them if they did not exist.
* @param idxname the name of the suadb.index
* @param leafsch the schema of the leaf suadb.index records
* @param tx the calling transaction
*/
public BTreeIndex(String idxname, Schema leafsch, Transaction tx) {
this.tx = tx;
// deal with the leaves
String leaftbl = idxname + "leaf";
leafTi = new TableInfo(leaftbl, leafsch);
if (tx.size(leafTi.fileName()) == 0)
tx.append(leafTi.fileName(), new BTPageFormatter(leafTi, -1));
// deal with the directory
Schema dirsch = new Schema();
dirsch.add("chunk", leafsch);
dirsch.add("dataval", leafsch);
String dirtbl = idxname + "dir";
dirTi = new TableInfo(dirtbl, dirsch);
rootblk = new Chunk(dirTi.fileName(), 0);
if (tx.size(dirTi.fileName()) == 0)
// create new root chunk
tx.append(dirTi.fileName(), new BTPageFormatter(dirTi, 0));
BTreePage page = new BTreePage(rootblk, dirTi, tx);
if (page.getNumRecs() == 0) {
// insert initial directory entry
int fldtype = dirsch.type("dataval");
Constant minval = (fldtype == INTEGER) ?
new IntConstant(Integer.MIN_VALUE) :
new StringConstant("");
page.insertDir(0, minval, 0);
}
page.close();
}
/**
* Traverses the directory to find the leaf chunk corresponding
* to the specified search key.
* The method then opens a page for that leaf chunk, and
* positions the page before the first suadb.record (if any)
* having that search key.
* The leaf page is kept open, for use by the methods next
* and getDataRid.
* @see suadb.index.Index#beforeFirst(Constant)
*/
public void beforeFirst(Constant searchkey) {
close();
BTreeDir root = new BTreeDir(rootblk, dirTi, tx);
int blknum = root.search(searchkey);
root.close();
Chunk leafblk = new Chunk(leafTi.fileName(), blknum);
leaf = new BTreeLeaf(leafblk, leafTi, searchkey, tx);
}
/**
* Moves to the next leaf suadb.record having the
* previously-specified search key.
* Returns false if there are no more such leaf records.
* @see suadb.index.Index#next()
*/
public boolean next() {
return leaf.next();
}
/**
* Returns the dataRID value from the current leaf suadb.record.
* @see suadb.index.Index#getDataRid()
*/
public RID getDataRid() {
return leaf.getDataRid();
}
/**
* Inserts the specified suadb.record into the suadb.index.
* The method first traverses the directory to find
* the appropriate leaf page; then it inserts
* the suadb.record into the leaf.
* If the insertion causes the leaf to split, then
* the method calls insert on the root,
* passing it the directory entry of the new leaf page.
* If the root node splits, then makeNewRoot is called.
* @see suadb.index.Index#insert(Constant, suadb.record.RID)
*/
public void insert(Constant dataval, RID datarid) {
beforeFirst(dataval);
DirEntry e = leaf.insert(datarid);
leaf.close();
if (e == null)
return;
BTreeDir root = new BTreeDir(rootblk, dirTi, tx);
DirEntry e2 = root.insert(e);
if (e2 != null)
root.makeNewRoot(e2);
root.close();
}
/**
* Deletes the specified suadb.index suadb.record.
* The method first traverses the directory to find
* the leaf page containing that suadb.record; then it
* deletes the suadb.record from the page.
* @see suadb.index.Index#delete(Constant, suadb.record.RID)
*/
public void delete(Constant dataval, RID datarid) {
beforeFirst(dataval);
leaf.delete(datarid);
leaf.close();
}
/**
* Closes the suadb.index by closing its open leaf page,
* if necessary.
* @see suadb.index.Index#close()
*/
public void close() {
if (leaf != null)
leaf.close();
}
/**
* Estimates the number of chunk accesses
* required to find all suadb.index records having
* a particular search key.
* @param numblocks the number of blocks in the B-tree directory
* @param rpb the number of suadb.index entries per chunk
* @return the estimated traversal cost
*/
public static int searchCost(int numblocks, int rpb) {
return 1 + (int)(Math.log(numblocks) / Math.log(rpb));
}
}
|
{
"content_hash": "6dec63fb705806d15810c3477f94a20f",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 68,
"avg_line_length": 30.314102564102566,
"alnum_prop": 0.6999365616409389,
"repo_name": "RonyK/SuaDB",
"id": "7ba8e3a39689af76dfb655955fd9ffe9ac717c44",
"size": "4729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "suadb-server/src/suadb/index/btree/BTreeIndex.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "356"
},
{
"name": "Java",
"bytes": "582633"
},
{
"name": "XSLT",
"bytes": "3390"
}
],
"symlink_target": ""
}
|
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// Attaching this script to a label will make the label's letters animate.
/// </summary>
public class TweenLetters : UITweener
{
public enum AnimationLetterOrder { Forward, Reverse, Random }
class LetterProperties
{
public float start;
public float duration; // if RandomDurations is set, these will all be different.
public Vector2 offset;
}
[System.Serializable]
public class AnimationProperties
{
public AnimationLetterOrder animationOrder = AnimationLetterOrder.Random;
[Range(0f, 1f)]
public float overlap = 0.5f;
public bool randomDurations = false;
[MinMaxRange(0f, 1f)]
public Vector2 randomness = new Vector2(0.25f, 0.75f);
public Vector2 offsetRange = Vector2.zero;
public Vector3 pos = Vector3.zero;
public Vector3 rot = Vector3.zero;
public Vector3 scale = Vector3.one;
public float alpha = 1f;
}
public AnimationProperties hoverOver;
public AnimationProperties hoverOut;
UILabel mLabel;
int mVertexCount = -1;
int[] mLetterOrder;
LetterProperties[] mLetter;
AnimationProperties mCurrent;
void OnEnable ()
{
mVertexCount = -1;
mLabel.onPostFill += OnPostFill;
}
void OnDisable ()
{
mLabel.onPostFill -= OnPostFill;
}
void Awake ()
{
mLabel = GetComponent<UILabel>();
mCurrent = hoverOver;
}
public override void Play (bool forward)
{
mCurrent = (forward) ? hoverOver : hoverOut;
base.Play(forward);
}
void OnPostFill (UIWidget widget, int bufferOffset, List<Vector3> verts, List<Vector2> uvs, List<Color> cols)
{
if (verts == null) return;
var vertexCount = verts.Count;
if (verts == null || vertexCount == 0) return;
if (mLabel == null) return;
var quads = mLabel.quadsPerCharacter;
const int quadVerts = 4;
var characterCount = vertexCount / quads / quadVerts;
var pt = mLabel.printedText;
if (mVertexCount != vertexCount)
{
mVertexCount = vertexCount;
SetLetterOrder(characterCount);
GetLetterDuration(characterCount);
}
var mtx = Matrix4x4.identity;
var lerpPos = Vector3.zero;
var lerpRot = Quaternion.identity;
var lerpScale = Vector3.one;
var lerpAlpha = 1f;
int firstVert, letter;
float letterStart, t; // The individual letters tweenFactor
var letterCenter = Vector3.zero;
var qRot = Quaternion.Euler(mCurrent.rot);
var vert = Vector3.zero;
var c = Color.clear;
var timeIntoAnimation = base.tweenFactor * base.duration;
for (int q = 0; q < quads; ++q)
{
for (int i = 0; i < characterCount; ++i)
{
letter = mLetterOrder[i]; // Choose which letter to animate.
firstVert = q * characterCount * quadVerts + letter * quadVerts;
if (firstVert >= vertexCount)
{
#if UNITY_EDITOR
Debug.LogError("TweenLetters encountered an unhandled case trying to modify a vertex " + firstVert + ". Vertex Count: " + vertexCount + " Pass: " + q + "\nText: " + pt);
#endif
continue;
}
letterStart = mLetter[letter].start;
t = Mathf.Clamp(timeIntoAnimation - letterStart, 0f, mLetter[letter].duration) / mLetter[letter].duration;
t = animationCurve.Evaluate(t);
letterCenter = GetCenter(verts, firstVert, quadVerts);
var v = mLetter[letter].offset;
#if UNITY_4_7
lerpPos = LerpUnclamped(mCurrent.pos + new Vector3(v.x, v.y, 0f), Vector3.zero, t);
lerpRot = Quaternion.Slerp(qRot, Quaternion.identity, t);
lerpScale = LerpUnclamped(mCurrent.scale, Vector3.one, t);
lerpAlpha = LerpUnclamped(mCurrent.alpha, 1f, t);
#else
lerpPos = Vector3.LerpUnclamped(mCurrent.pos + new Vector3(v.x, v.y, 0f), Vector3.zero, t);
lerpRot = Quaternion.SlerpUnclamped(qRot, Quaternion.identity, t);
lerpScale = Vector3.LerpUnclamped(mCurrent.scale, Vector3.one, t);
lerpAlpha = Mathf.LerpUnclamped(mCurrent.alpha, 1f, t);
#endif
mtx.SetTRS(lerpPos, lerpRot, lerpScale);
for (int iv = firstVert; iv < firstVert + quadVerts; ++iv)
{
vert = verts[iv];
vert -= letterCenter;
vert = mtx.MultiplyPoint3x4(vert);
vert += letterCenter;
verts[iv] = vert;
c = cols[iv];
c.a = lerpAlpha;
cols[iv] = c;
}
}
}
}
#if UNITY_4_7
static Vector3 LerpUnclamped (Vector3 a, Vector3 b, float f)
{
a.x = a.x + (b.x - a.x) * f;
a.y = a.y + (b.y - a.y) * f;
a.z = a.z + (b.z - a.z) * f;
return a;
}
static float LerpUnclamped (float a, float b, float f) { return a + (b - a) * f; }
#endif
/// <summary>
/// Check every frame to see if the text has changed and mark the label as having been updated.
/// </summary>
protected override void OnUpdate (float factor, bool isFinished)
{
mLabel.MarkAsChanged();
}
/// <summary>
/// Sets the sequence that the letters are animated in.
/// </summary>
void SetLetterOrder (int letterCount)
{
if (letterCount == 0)
{
mLetter = null;
mLetterOrder = null;
return;
}
mLetterOrder = new int[letterCount];
mLetter = new LetterProperties[letterCount];
for (int i = 0; i < letterCount; ++i)
{
mLetterOrder[i] = (mCurrent.animationOrder == AnimationLetterOrder.Reverse) ? letterCount - 1 - i : i;
int current = mLetterOrder[i];
mLetter[current] = new LetterProperties();
mLetter[current].offset = new Vector2(Random.Range(-mCurrent.offsetRange.x, mCurrent.offsetRange.x), Random.Range(-mCurrent.offsetRange.y, mCurrent.offsetRange.y));
}
if (mCurrent.animationOrder == AnimationLetterOrder.Random)
{
// Shuffle the numbers in the array.
var rng = new System.Random();
int n = letterCount;
while (n > 1)
{
int k = rng.Next(--n + 1);
int tmp = mLetterOrder[k];
mLetterOrder[k] = mLetterOrder[n];
mLetterOrder[n] = tmp;
}
}
}
/// <summary>
/// Returns how long each letter has to animate based on the overall duration requested and how much they overlap.
/// </summary>
void GetLetterDuration (int letterCount)
{
if (mCurrent.randomDurations)
{
for (int i = 0; i < mLetter.Length; ++i)
{
mLetter[i].start = Random.Range(0f, mCurrent.randomness.x * base.duration);
float end = Random.Range(mCurrent.randomness.y * base.duration, base.duration);
mLetter[i].duration = end - mLetter[i].start;
}
}
else
{
// Calculate how long each letter will take to fade in.
float lengthPerLetter = base.duration / (float)letterCount;
float flippedOverlap = 1f - mCurrent.overlap;
// Figure out how long the animation will be taking into account overlapping letters.
float totalDuration = lengthPerLetter * letterCount * flippedOverlap;
// Scale the smaller total running time back up to the requested animation time.
float letterDuration = ScaleRange(lengthPerLetter, totalDuration + lengthPerLetter * mCurrent.overlap, base.duration);
float offset = 0;
for (int i = 0; i < mLetter.Length; ++i)
{
int letter = mLetterOrder[i];
mLetter[letter].start = offset;
mLetter[letter].duration = letterDuration;
offset += mLetter[letter].duration * flippedOverlap;
}
}
}
/// <summary>
/// Simplified Scale range function that assumes a minimum of 0 for both ranges.
/// </summary>
float ScaleRange (float value, float baseMax, float limitMax)
{
return (limitMax * value / baseMax);
}
/// <summary>
/// Finds the center point of a series of verts.
/// </summary>
static Vector3 GetCenter (List<Vector3> verts, int firstVert, int length)
{
Vector3 center = verts[firstVert];
for (int v = firstVert + 1; v < firstVert + length; ++v) center += verts[v];
return center / length;
}
}
|
{
"content_hash": "117680e8dafe604b2aa1e23cd6f0ce82",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 174,
"avg_line_length": 27.727941176470587,
"alnum_prop": 0.6795279766640149,
"repo_name": "mrjunlan/GameTestDemo",
"id": "281893f95441b1da0d8d4d0b29b9189f943be938",
"size": "7736",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "Source/Assets/NGUI/Scripts/Tweening/TweenLetters.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "2252986"
},
{
"name": "GLSL",
"bytes": "436379"
}
],
"symlink_target": ""
}
|
package com.jishuli.Moco.Activity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import com.jishuli.Moco.R;
public class Activity_MyFeedback extends Activity {
private ImageButton backButton;
private EditText editText;
private Button sendButton;
private String content;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_myfeedback);
backButton = (ImageButton)findViewById(R.id.MyFeedbackBackgroundLayoutBackButton);
editText = (EditText)findViewById(R.id.MyFeedbackEditText);
sendButton = (Button)findViewById(R.id.MyFeedbackSendButton);
//返回箭头的监听器
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Activity_MyFeedback.this.finish();
}
});
//取消提示,左对齐
editText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
editText.setHint(null);
editText.setGravity(Gravity.LEFT);
}
});
//提交反馈内容
sendButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (editText.getText().toString().length() == 0){
AlertDialog.Builder builder = new AlertDialog.Builder(Activity_MyFeedback.this);
builder.setMessage("请输入反馈内容");
builder.setTitle("提示");
builder.setPositiveButton("好的", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
return;
}
else {
content = editText.getText().toString();
sendContent(content);
}
}
});
}
public void sendContent(String content){
}
}
|
{
"content_hash": "ef79e59ad81f76f3e280522657216c68",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 100,
"avg_line_length": 32.693333333333335,
"alnum_prop": 0.5823817292006526,
"repo_name": "MichaelLee826/Moco",
"id": "1c14282e56fe2b8e1d9c39cd27d1a55986fbdf33",
"size": "2518",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "May17/app/src/main/java/com/jishuli/Moco/Activity/Activity_MyFeedback.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2604546"
}
],
"symlink_target": ""
}
|
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.styles = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
var _unsupportedProp = _interopRequireDefault(require("../utils/unsupportedProp"));
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
transition: theme.transitions.create(['color', 'padding-top'], {
duration: theme.transitions.duration.short
}),
padding: '6px 12px 8px',
minWidth: 80,
maxWidth: 168,
color: theme.palette.text.secondary,
flex: '1',
'&$iconOnly': {
paddingTop: 16
},
'&$selected': {
paddingTop: 6,
color: theme.palette.primary.main
}
},
/* Styles applied to the root element if selected. */
selected: {},
/* Styles applied to the root element if `showLabel={false}` and not selected. */
iconOnly: {},
/* Styles applied to the span element that wraps the icon and label. */
wrapper: {
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
width: '100%',
flexDirection: 'column'
},
/* Styles applied to the label's span element. */
label: {
fontFamily: theme.typography.fontFamily,
fontSize: theme.typography.pxToRem(12),
opacity: 1,
transition: 'font-size 0.2s, opacity 0.2s',
transitionDelay: '0.1s',
'&$iconOnly': {
opacity: 0,
transitionDelay: '0s'
},
'&$selected': {
fontSize: theme.typography.pxToRem(14)
}
}
};
};
exports.styles = styles;
var BottomNavigationAction = _react.default.forwardRef(function BottomNavigationAction(props, ref) {
var classes = props.classes,
className = props.className,
icon = props.icon,
label = props.label,
onChange = props.onChange,
onClick = props.onClick,
selected = props.selected,
showLabel = props.showLabel,
value = props.value,
other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "icon", "label", "onChange", "onClick", "selected", "showLabel", "value"]);
var handleChange = function handleChange(event) {
if (onChange) {
onChange(event, value);
}
if (onClick) {
onClick(event);
}
};
return _react.default.createElement(_ButtonBase.default, (0, _extends2.default)({
ref: ref,
className: (0, _clsx.default)(classes.root, selected && classes.selected, !showLabel && !selected && classes.iconOnly, className),
focusRipple: true,
onClick: handleChange
}, other), _react.default.createElement("span", {
className: classes.wrapper
}, icon, _react.default.createElement("span", {
className: (0, _clsx.default)(classes.label, selected && classes.selected, !showLabel && !selected && classes.iconOnly)
}, label)));
});
process.env.NODE_ENV !== "production" ? BottomNavigationAction.propTypes = {
/**
* This property isn't supported.
* Use the `component` property if you need to change the children structure.
*/
children: _unsupportedProp.default,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: _propTypes.default.object.isRequired,
/**
* @ignore
*/
className: _propTypes.default.string,
/**
* The icon element.
*/
icon: _propTypes.default.node,
/**
* The label element.
*/
label: _propTypes.default.node,
/**
* @ignore
*/
onChange: _propTypes.default.func,
/**
* @ignore
*/
onClick: _propTypes.default.func,
/**
* @ignore
*/
selected: _propTypes.default.bool,
/**
* If `true`, the `BottomNavigationAction` will show its label.
* By default, only the selected `BottomNavigationAction`
* inside `BottomNavigation` will show its label.
*/
showLabel: _propTypes.default.bool,
/**
* You can provide your own value. Otherwise, we fallback to the child position index.
*/
value: _propTypes.default.any
} : void 0;
var _default = (0, _withStyles.default)(styles, {
name: 'MuiBottomNavigationAction'
})(BottomNavigationAction);
exports.default = _default;
|
{
"content_hash": "2c5b59a97f08210b5f4c9534ff43dff3",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 160,
"avg_line_length": 27.34090909090909,
"alnum_prop": 0.6487946799667498,
"repo_name": "pcclarke/civ-techs",
"id": "87f75f688ba4d8bb455a60dad0025b9ee1135ea4",
"size": "4812",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "node_modules/@material-ui/core/BottomNavigationAction/BottomNavigationAction.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2127"
},
{
"name": "JavaScript",
"bytes": "5292"
}
],
"symlink_target": ""
}
|
1 npm install
2 npm start
3 gulp & gulp watch
## API
TODO
## Usage
As react start template.
## Others
[Markdown is edited online](http://mahua.jser.me/)
## License
MIT. See LICENSE.md for details.
|
{
"content_hash": "a027cf5ad241b428de62da804c71a30e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 50,
"avg_line_length": 13.294117647058824,
"alnum_prop": 0.6238938053097345,
"repo_name": "King-fly/react-demo",
"id": "50861c1fcfe578b80444fcfbd60c417a53a6193e",
"size": "265",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "292"
},
{
"name": "JavaScript",
"bytes": "721537"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../includes/main.css" type="text/css">
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<title>Apache CloudStack | The Power Behind Your Cloud</title>
</head>
<body>
<div id="insidetopbg">
<div id="inside_wrapper">
<div class="uppermenu_panel">
<div class="uppermenu_box"></div>
</div>
<div id="main_master">
<div id="inside_header">
<div class="header_top">
<a class="cloud_logo" href="http://cloudstack.org"></a>
<div class="mainemenu_panel"></div>
</div>
</div>
<div id="main_content">
<div class="inside_apileftpanel">
<div class="inside_contentpanel" style="width:930px;">
<div class="api_titlebox">
<div class="api_titlebox_left">
<span>
Apache CloudStack 4.15.0.0 Root Admin API Reference
</span>
<p></p>
<h1>issueCertificate</h1>
<p>Issues a client certificate using configured or provided CA plugin</p>
</div>
<div class="api_titlebox_right">
<a class="api_backbutton" href="../index.html"></a>
</div>
</div>
<div class="api_tablepanel">
<h2>Request parameters</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Parameter Name</strong></td><td style="width:500px;">Description</td><td style="width:180px;">Required</td>
</tr>
<tr>
<td style="width:200px;"><i>csr</i></td><td style="width:500px;"><i>The certificate signing request (in pem format), if CSR is not provided then configured/provided options are considered</i></td><td style="width:180px;"><i>false</i></td>
</tr>
<tr>
<td style="width:200px;"><i>domain</i></td><td style="width:500px;"><i>Comma separated list of domains, the certificate should be issued for. When csr is not provided, the first domain is used as a subject/CN</i></td><td style="width:180px;"><i>false</i></td>
</tr>
<tr>
<td style="width:200px;"><i>duration</i></td><td style="width:500px;"><i>Certificate validity duration in number of days, when not provided the default configured value will be used</i></td><td style="width:180px;"><i>false</i></td>
</tr>
<tr>
<td style="width:200px;"><i>ipaddress</i></td><td style="width:500px;"><i>Comma separated list of IP addresses, the certificate should be issued for</i></td><td style="width:180px;"><i>false</i></td>
</tr>
<tr>
<td style="width:200px;"><i>provider</i></td><td style="width:500px;"><i>Name of the CA service provider, otherwise the default configured provider plugin will be used</i></td><td style="width:180px;"><i>false</i></td>
</tr>
</table>
</div>
<div class="api_tablepanel">
<h2>Response Tags</h2>
<table class="apitable">
<tr class="hed">
<td style="width:200px;"><strong>Response Name</strong></td><td style="width:500px;">Description</td>
</tr>
<tr>
<td style="width:200px;"><strong>cacertificates</strong></td><td style="width:500px;">The CA certificate(s)</td>
</tr>
<tr>
<td style="width:200px;"><strong>certificate</strong></td><td style="width:500px;">The client certificate</td>
</tr>
<tr>
<td style="width:200px;"><strong>privatekey</strong></td><td style="width:500px;">Private key for the certificate</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="comments_thread">
<script type="text/javascript" src="https://comments.apache.org/show_comments.lua?site=test" async="true"></script>
<noscript>
<iframe width="930" height="500" src="https://comments.apache.org/iframe.lua?site=test&page=4.2.0/rootadmin"></iframe>
</noscript>
</div>
<div id="footer_mainmaster">
<p>
Copyright © 2015 The Apache Software Foundation, Licensed under the
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a>
<br>
Apache, CloudStack, Apache CloudStack, the Apache CloudStack logo, the CloudMonkey logo and the Apache feather logo are trademarks of The Apache Software Foundation.
</p>
</div>
</div>
</div>
</div>
</body>
</html>
|
{
"content_hash": "54fc33902fd72322425d01f9cdc0e7aa",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 303,
"avg_line_length": 67.49019607843137,
"alnum_prop": 0.40906449738524114,
"repo_name": "apache/cloudstack-www",
"id": "cf023510bc9055a4258af5ee68e9ee9b53058796",
"size": "6884",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "content/api/apidocs-4.15/apis/issueCertificate.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "568290"
},
{
"name": "HTML",
"bytes": "222229805"
},
{
"name": "JavaScript",
"bytes": "61116"
},
{
"name": "Python",
"bytes": "3284"
},
{
"name": "Ruby",
"bytes": "1973"
},
{
"name": "Shell",
"bytes": "873"
}
],
"symlink_target": ""
}
|
<?php
require_once('../config.php');
mysql_connect(DB_SERVER,DB_USER,DB_PASS);
@mysql_select_db(DB_NAME) or die( "Unable to select database");
$query = "SELECT * FROM twfy_mps WHERE 1 ORDER BY name;";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
$query = "SELECT * FROM hubble_mps WHERE (hubble_mps.person_id = '" . $row["person_id"] . "')";
$result2 = mysql_query($query);
$row2 = mysql_fetch_assoc($result2);
if ($row2["wikipedia"] == "") {
$query = "UPDATE hubble_mps SET wikipedia = '" . mysql_real_escape_string("http://en.wikipedia.org/wiki/" . str_replace(" ", "_", $row["name"])) . "' WHERE hubble_mps.person_id = '" . $row["person_id"] . "' LIMIT 1";
mysql_query($query);
}
}
echo("Done.");
mysql_close();
?>
|
{
"content_hash": "b925243234adbcdb8149d43f06d7fd92",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 224,
"avg_line_length": 32.52,
"alnum_prop": 0.5830258302583026,
"repo_name": "ianrenton/westminsterhubble",
"id": "f77817c417cadce74ac286e5b4ef0fcd41e28e81",
"size": "813",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "admin/pullfromwikipedia.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ActionScript",
"bytes": "17461"
},
{
"name": "ApacheConf",
"bytes": "226"
},
{
"name": "CSS",
"bytes": "28070"
},
{
"name": "HTML",
"bytes": "2616"
},
{
"name": "JavaScript",
"bytes": "51834"
},
{
"name": "PHP",
"bytes": "2355139"
},
{
"name": "Shell",
"bytes": "518"
}
],
"symlink_target": ""
}
|
const path = require('path');
const config = require('../config');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
exports.assetsPath = (_path) => {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory;
return path.posix.join(assetsSubDirectory, _path);
};
exports.cssLoaders = (options) => {
const ops = options || {};
const cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: ops.sourceMap,
},
};
// generate loader string to be used with extract text plugin
function generateLoaders(loader, loaderOptions) {
const loaders = [cssLoader];
if (loader) {
loaders.push({
loader: `${loader}-loader`,
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap,
}),
});
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
});
}
return ['vue-style-loader'].concat(loaders);
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus'),
};
};
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = (options) => {
const output = [];
const loaders = exports.cssLoaders(options);
Object.keys(loaders).forEach((extension) => {
const loader = loaders[extension];
output.push({
test: new RegExp(`\\.${extension}$`),
use: loader,
});
});
return output;
};
|
{
"content_hash": "e332ee66e5d1339b1faf51b1ae7af679",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 68,
"avg_line_length": 28.114285714285714,
"alnum_prop": 0.6382113821138211,
"repo_name": "samrose3/vue-portfolio",
"id": "a62bd170d4848816c33e4ef868e6caa58087a1fc",
"size": "1968",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/utils.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1423"
},
{
"name": "HTML",
"bytes": "911"
},
{
"name": "JavaScript",
"bytes": "30925"
},
{
"name": "Vue",
"bytes": "29654"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Fri Jun 20 06:34:49 EDT 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.handler.dataimport.DocBuilder.Statistics (Solr 4.9.0 API)</title>
<meta name="date" content="2014-06-20">
<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="Uses of Class org.apache.solr.handler.dataimport.DocBuilder.Statistics (Solr 4.9.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/handler/dataimport/class-use/DocBuilder.Statistics.html" target="_top">Frames</a></li>
<li><a href="DocBuilder.Statistics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.solr.handler.dataimport.DocBuilder.Statistics" class="title">Uses of Class<br>org.apache.solr.handler.dataimport.DocBuilder.Statistics</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.handler.dataimport">org.apache.solr.handler.dataimport</a></td>
<td class="colLast">
<div class="block"><a href="../../../../../../org/apache/solr/handler/dataimport/DataImportHandler.html" title="class in org.apache.solr.handler.dataimport"><code>DataImportHandler</code></a> and related code.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.solr.handler.dataimport">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a> in <a href="../../../../../../org/apache/solr/handler/dataimport/package-summary.html">org.apache.solr.handler.dataimport</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../../org/apache/solr/handler/dataimport/package-summary.html">org.apache.solr.handler.dataimport</a> declared as <a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></code></td>
<td class="colLast"><span class="strong">DataImporter.</span><code><strong><a href="../../../../../../org/apache/solr/handler/dataimport/DataImporter.html#cumulativeStatistics">cumulativeStatistics</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></code></td>
<td class="colLast"><span class="strong">DocBuilder.</span><code><strong><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.html#importStatistics">importStatistics</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/handler/dataimport/package-summary.html">org.apache.solr.handler.dataimport</a> that return <a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></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>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></code></td>
<td class="colLast"><span class="strong">DocBuilder.Statistics.</span><code><strong><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html#add(org.apache.solr.handler.dataimport.DocBuilder.Statistics)">add</a></strong>(<a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a> stats)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/handler/dataimport/package-summary.html">org.apache.solr.handler.dataimport</a> with parameters of type <a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></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>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a></code></td>
<td class="colLast"><span class="strong">DocBuilder.Statistics.</span><code><strong><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html#add(org.apache.solr.handler.dataimport.DocBuilder.Statistics)">add</a></strong>(<a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">DocBuilder.Statistics</a> stats)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/handler/dataimport/DocBuilder.Statistics.html" title="class in org.apache.solr.handler.dataimport">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/handler/dataimport/class-use/DocBuilder.Statistics.html" target="_top">Frames</a></li>
<li><a href="DocBuilder.Statistics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
{
"content_hash": "8c478aec32faed59c1cb5f8be3f8f3f8",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 450,
"avg_line_length": 51.99014778325123,
"alnum_prop": 0.6551070684100815,
"repo_name": "BibAlex/bhl_rails_4_solr_test",
"id": "b04fe9e240a7c79ffd342c86a28b02d5d8421206",
"size": "10554",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/solr-dataimporthandler/org/apache/solr/handler/dataimport/class-use/DocBuilder.Statistics.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "366"
},
{
"name": "CSS",
"bytes": "129178"
},
{
"name": "Groff",
"bytes": "37749613"
},
{
"name": "HTML",
"bytes": "87581"
},
{
"name": "JavaScript",
"bytes": "1040511"
},
{
"name": "Shell",
"bytes": "8670"
},
{
"name": "XSLT",
"bytes": "149538"
}
],
"symlink_target": ""
}
|
package com.facebook.buck.lua;
import com.facebook.buck.cli.FakeBuckConfig;
import com.facebook.buck.cxx.CxxBuckConfig;
import com.facebook.buck.cxx.CxxPlatform;
import com.facebook.buck.cxx.CxxPlatformUtils;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.model.FlavorDomain;
import com.facebook.buck.python.PythonPlatform;
import com.facebook.buck.python.PythonTestUtils;
import com.facebook.buck.rules.AbstractNodeBuilder;
import com.facebook.buck.rules.Description;
import com.google.common.collect.ImmutableSortedSet;
import java.util.Optional;
public class LuaBinaryBuilder extends AbstractNodeBuilder<LuaBinaryDescription.Arg> {
public LuaBinaryBuilder(
Description<LuaBinaryDescription.Arg> description,
BuildTarget target) {
super(description, target);
}
public LuaBinaryBuilder(
BuildTarget target,
LuaConfig config,
CxxBuckConfig cxxBuckConfig,
CxxPlatform defaultCxxPlatform,
FlavorDomain<CxxPlatform> cxxPlatforms,
FlavorDomain<PythonPlatform> pythonPlatforms) {
this(
new LuaBinaryDescription(
config,
cxxBuckConfig,
defaultCxxPlatform,
cxxPlatforms,
pythonPlatforms),
target);
}
public LuaBinaryBuilder(BuildTarget target, LuaConfig config) {
this(
target,
config,
new CxxBuckConfig(FakeBuckConfig.builder().build()),
CxxPlatformUtils.DEFAULT_PLATFORM,
CxxPlatformUtils.DEFAULT_PLATFORMS,
PythonTestUtils.PYTHON_PLATFORMS);
}
public LuaBinaryBuilder(BuildTarget target) {
this(target, FakeLuaConfig.DEFAULT);
}
public LuaBinaryBuilder setMainModule(String mainModule) {
arg.mainModule = mainModule;
return this;
}
public LuaBinaryBuilder setDeps(ImmutableSortedSet<BuildTarget> deps) {
arg.deps = deps;
return this;
}
public LuaBinaryBuilder setPackageStyle(LuaConfig.PackageStyle packageStyle) {
arg.packageStyle = Optional.of(packageStyle);
return this;
}
public LuaBinaryBuilder setNativeStarterLibrary(BuildTarget target) {
arg.nativeStarterLibrary = Optional.of(target);
return this;
}
}
|
{
"content_hash": "8d50cb52d94c8f0ec1efedbe6a4d0fbf",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 85,
"avg_line_length": 28.141025641025642,
"alnum_prop": 0.7362186788154897,
"repo_name": "illicitonion/buck",
"id": "cfecd2a0d3bfd6f9a9904ec31fa03a1bf6f5d900",
"size": "2800",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/com/facebook/buck/lua/LuaBinaryBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "579"
},
{
"name": "Batchfile",
"bytes": "1819"
},
{
"name": "C",
"bytes": "249076"
},
{
"name": "C#",
"bytes": "237"
},
{
"name": "C++",
"bytes": "6648"
},
{
"name": "CSS",
"bytes": "54863"
},
{
"name": "D",
"bytes": "1017"
},
{
"name": "Go",
"bytes": "15018"
},
{
"name": "Groff",
"bytes": "440"
},
{
"name": "Groovy",
"bytes": "3362"
},
{
"name": "HTML",
"bytes": "5949"
},
{
"name": "Haskell",
"bytes": "895"
},
{
"name": "IDL",
"bytes": "128"
},
{
"name": "Java",
"bytes": "16267876"
},
{
"name": "JavaScript",
"bytes": "934210"
},
{
"name": "Kotlin",
"bytes": "1996"
},
{
"name": "Lex",
"bytes": "2595"
},
{
"name": "Makefile",
"bytes": "1812"
},
{
"name": "Matlab",
"bytes": "47"
},
{
"name": "OCaml",
"bytes": "3132"
},
{
"name": "Objective-C",
"bytes": "1137167"
},
{
"name": "Objective-C++",
"bytes": "34"
},
{
"name": "PowerShell",
"bytes": "244"
},
{
"name": "Python",
"bytes": "516856"
},
{
"name": "Rust",
"bytes": "2504"
},
{
"name": "Scala",
"bytes": "4906"
},
{
"name": "Shell",
"bytes": "36660"
},
{
"name": "Smalltalk",
"bytes": "4640"
},
{
"name": "Standard ML",
"bytes": "15"
},
{
"name": "Swift",
"bytes": "6895"
},
{
"name": "Thrift",
"bytes": "12768"
},
{
"name": "Yacc",
"bytes": "323"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLogFilters">
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="Show only selected application" />
</component>
<component name="ChangeListManager">
<list default="true" id="ff2344e3-8176-42b8-8e77-d32a0296588a" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="main.dart" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-974">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="GroovyConsoleState">
<option name="list">
<list>
<Entry>
<option name="url" value="file://$APPLICATION_CONFIG_DIR$/consoles/groovy/groovy_console.groovy" />
<option name="moduleName" value="Kebab" />
<option name="title" value="Kebab (Bundled Groovy 2.4.12)" />
</Entry>
</list>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/.gitignore" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="22" />
<option name="width" value="1391" />
<option name="height" value="961" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="1" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="Kebab" type="b2602c69:ProjectViewProjectNode" />
<item name="Kebab" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Kebab" type="b2602c69:ProjectViewProjectNode" />
<item name="Kebab" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="AndroidView" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="android.sdk.path" value="$USER_HOME$/Library/Android/sdk" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="dart.analysis.tool.window.force.activate" value="false" />
<property name="show.migrate.to.gradle.popup" value="false" />
<property name="add_unversioned_files" value="$PROJECT_DIR$/lib/main.dart true" />
<property name="io.flutter.reload.alreadyRun" value="true" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
</configuration>
<configuration name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
</configuration>
<configuration name="<template>" type="Applet" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="ff2344e3-8176-42b8-8e77-d32a0296588a" name="Default" comment="" />
<created>1526930191954</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1526930191954</updated>
</task>
<servers />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1391" height="961" extended-state="0" />
<layout>
<window_info id="Android Profiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cargo" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="DB Execution Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Dart Analysis" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290993" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Flutter Outline" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Logcat" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290993" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Device File Explorer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290993" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="DB Browser" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3295838" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3290993" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3290993" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25722757" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Flutter Inspector" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32997844" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-18">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/groovy/groovy_console.groovy">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-974">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</component>
</project>
|
{
"content_hash": "f526aeace134222ec07ad24769265780",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 254,
"avg_line_length": 61.48529411764706,
"alnum_prop": 0.6514709399665152,
"repo_name": "minikin/Kebab",
"id": "81a12b84ddbbe622a60af1542a85a806b93660a5",
"size": "20905",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/workspace.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dart",
"bytes": "4484"
},
{
"name": "Kotlin",
"bytes": "334"
},
{
"name": "Objective-C",
"bytes": "37"
},
{
"name": "Swift",
"bytes": "403"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.